@wordpress/edit-site 5.33.0 → 5.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (543) hide show
  1. package/CHANGELOG.md +11 -3
  2. package/build/components/add-new-page/index.js +3 -0
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/add-new-pattern/index.js +8 -7
  5. package/build/components/add-new-pattern/index.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  7. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/add-custom-template-modal-content.js +3 -1
  9. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  10. package/build/components/add-new-template/index.js +2 -2
  11. package/build/components/add-new-template/index.js.map +1 -1
  12. package/build/components/app/index.js +4 -2
  13. package/build/components/app/index.js.map +1 -1
  14. package/build/components/block-editor/editor-canvas.js +4 -18
  15. package/build/components/block-editor/editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/resize-handle.js +20 -5
  17. package/build/components/block-editor/resize-handle.js.map +1 -1
  18. package/build/components/block-editor/site-editor-canvas.js +2 -2
  19. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  20. package/build/components/create-template-part-modal/index.js +3 -0
  21. package/build/components/create-template-part-modal/index.js.map +1 -1
  22. package/build/components/dataviews-actions/index.js +46 -0
  23. package/build/components/dataviews-actions/index.js.map +1 -0
  24. package/build/components/editor/index.js +95 -16
  25. package/build/components/editor/index.js.map +1 -1
  26. package/build/components/global-styles/background-panel.js +13 -1
  27. package/build/components/global-styles/background-panel.js.map +1 -1
  28. package/build/components/global-styles/color-indicator-wrapper.js +2 -2
  29. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  30. package/build/components/global-styles/color-palette-panel.js +5 -2
  31. package/build/components/global-styles/color-palette-panel.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/context.js +9 -3
  33. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/font-collection.js +7 -2
  35. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  36. package/build/components/global-styles/font-library-modal/installed-fonts.js +22 -20
  37. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  38. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  39. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  40. package/build/components/global-styles/gradients-palette-panel.js +1 -2
  41. package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
  42. package/build/components/global-styles/hooks.js +5 -2
  43. package/build/components/global-styles/hooks.js.map +1 -1
  44. package/build/components/global-styles/icon-with-current-color.js +2 -2
  45. package/build/components/global-styles/icon-with-current-color.js.map +1 -1
  46. package/build/components/global-styles/preset-colors.js +29 -0
  47. package/build/components/global-styles/preset-colors.js.map +1 -0
  48. package/build/components/global-styles/preview-colors.js +3 -7
  49. package/build/components/global-styles/preview-colors.js.map +1 -1
  50. package/build/components/global-styles/screen-color-palette.js +5 -5
  51. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  52. package/build/components/global-styles/screen-colors.js +1 -4
  53. package/build/components/global-styles/screen-colors.js.map +1 -1
  54. package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  55. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  56. package/build/components/global-styles/style-variations-container.js +8 -2
  57. package/build/components/global-styles/style-variations-container.js.map +1 -1
  58. package/build/components/global-styles/typography-example.js +5 -2
  59. package/build/components/global-styles/typography-example.js.map +1 -1
  60. package/build/components/global-styles/ui.js +4 -1
  61. package/build/components/global-styles/ui.js.map +1 -1
  62. package/build/components/global-styles/variations/variation.js +12 -6
  63. package/build/components/global-styles/variations/variation.js.map +1 -1
  64. package/build/components/global-styles/variations/variations-color.js +5 -5
  65. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  66. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  67. package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  68. package/build/components/global-styles-sidebar/index.js.map +1 -0
  69. package/build/components/header-edit-mode/index.js +21 -137
  70. package/build/components/header-edit-mode/index.js.map +1 -1
  71. package/build/components/header-edit-mode/more-menu/index.js +3 -97
  72. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  73. package/build/components/keyboard-shortcuts/register.js +0 -49
  74. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  75. package/build/components/layout/index.js +9 -9
  76. package/build/components/layout/index.js.map +1 -1
  77. package/build/components/layout/router.js +70 -44
  78. package/build/components/layout/router.js.map +1 -1
  79. package/build/components/page/index.js +2 -2
  80. package/build/components/page/index.js.map +1 -1
  81. package/build/components/page-pages/index.js +4 -14
  82. package/build/components/page-pages/index.js.map +1 -1
  83. package/build/components/page-patterns/dataviews-pattern-actions.js +15 -87
  84. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  85. package/build/components/page-patterns/header.js +3 -1
  86. package/build/components/page-patterns/header.js.map +1 -1
  87. package/build/components/page-patterns/index.js +28 -68
  88. package/build/components/page-patterns/index.js.map +1 -1
  89. package/build/components/page-patterns/use-patterns.js +1 -0
  90. package/build/components/page-patterns/use-patterns.js.map +1 -1
  91. package/build/components/page-templates/hooks.js.map +1 -0
  92. package/build/components/{page-templates-template-parts → page-templates}/index.js +73 -94
  93. package/build/components/page-templates/index.js.map +1 -0
  94. package/build/components/pagination/index.js +2 -2
  95. package/build/components/pagination/index.js.map +1 -1
  96. package/build/components/pattern-modal/duplicate.js +7 -5
  97. package/build/components/pattern-modal/duplicate.js.map +1 -1
  98. package/build/components/plugin-template-setting-panel/index.js +9 -0
  99. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  100. package/build/components/resizable-frame/index.js +20 -9
  101. package/build/components/resizable-frame/index.js.map +1 -1
  102. package/build/components/revisions/index.js +5 -2
  103. package/build/components/revisions/index.js.map +1 -1
  104. package/build/components/save-panel/index.js +4 -4
  105. package/build/components/save-panel/index.js.map +1 -1
  106. package/build/components/sidebar/index.js +61 -31
  107. package/build/components/sidebar/index.js.map +1 -1
  108. package/build/components/sidebar-button/index.js +2 -2
  109. package/build/components/sidebar-button/index.js.map +1 -1
  110. package/build/components/sidebar-dataviews/dataview-item.js +2 -2
  111. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  112. package/build/components/sidebar-navigation-item/index.js +5 -3
  113. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  114. package/build/components/sidebar-navigation-screen/index.js +6 -32
  115. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  116. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  117. package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  118. package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  119. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  120. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  121. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  122. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  123. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  124. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  125. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  126. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  127. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  128. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  129. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  130. package/build/components/sidebar-navigation-screen-page/index.js +39 -8
  131. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  132. package/build/components/sidebar-navigation-screen-page/status-label.js +2 -2
  133. package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  134. package/build/components/sidebar-navigation-screen-pattern/index.js +3 -15
  135. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  136. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  137. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  138. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  139. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  140. package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  141. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  142. package/build/components/sidebar-navigation-screen-patterns/index.js +25 -29
  143. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  144. package/build/components/sidebar-navigation-screen-template/index.js +5 -2
  145. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  146. package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  147. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  148. package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -33
  149. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  150. package/build/components/site-hub/index.js +3 -3
  151. package/build/components/site-hub/index.js.map +1 -1
  152. package/build/components/site-icon/index.js +2 -2
  153. package/build/components/site-icon/index.js.map +1 -1
  154. package/build/components/style-book/index.js +10 -7
  155. package/build/components/style-book/index.js.map +1 -1
  156. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
  157. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  158. package/build/components/template-actions/index.js +1 -1
  159. package/build/components/template-actions/index.js.map +1 -1
  160. package/build/components/template-part-converter/index.js +18 -1
  161. package/build/components/template-part-converter/index.js.map +1 -1
  162. package/build/deprecated.js +55 -0
  163. package/build/deprecated.js.map +1 -0
  164. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +40 -6
  165. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  166. package/build/index.js +18 -18
  167. package/build/index.js.map +1 -1
  168. package/build/utils/constants.js +1 -2
  169. package/build/utils/constants.js.map +1 -1
  170. package/build/utils/get-is-list-page.js +1 -1
  171. package/build/utils/get-is-list-page.js.map +1 -1
  172. package/build/utils/use-activate-theme.js +9 -6
  173. package/build/utils/use-activate-theme.js.map +1 -1
  174. package/build-module/components/add-new-page/index.js +3 -0
  175. package/build-module/components/add-new-page/index.js.map +1 -1
  176. package/build-module/components/add-new-pattern/index.js +8 -7
  177. package/build-module/components/add-new-pattern/index.js.map +1 -1
  178. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  179. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  180. package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
  181. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  182. package/build-module/components/add-new-template/index.js +2 -2
  183. package/build-module/components/add-new-template/index.js.map +1 -1
  184. package/build-module/components/app/index.js +4 -2
  185. package/build-module/components/app/index.js.map +1 -1
  186. package/build-module/components/block-editor/editor-canvas.js +4 -18
  187. package/build-module/components/block-editor/editor-canvas.js.map +1 -1
  188. package/build-module/components/block-editor/resize-handle.js +21 -6
  189. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  190. package/build-module/components/block-editor/site-editor-canvas.js +2 -2
  191. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  192. package/build-module/components/create-template-part-modal/index.js +3 -0
  193. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  194. package/build-module/components/dataviews-actions/index.js +38 -0
  195. package/build-module/components/dataviews-actions/index.js.map +1 -0
  196. package/build-module/components/editor/index.js +96 -17
  197. package/build-module/components/editor/index.js.map +1 -1
  198. package/build-module/components/global-styles/background-panel.js +12 -1
  199. package/build-module/components/global-styles/background-panel.js.map +1 -1
  200. package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
  201. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
  202. package/build-module/components/global-styles/color-palette-panel.js +4 -2
  203. package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
  204. package/build-module/components/global-styles/font-library-modal/context.js +9 -3
  205. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  206. package/build-module/components/global-styles/font-library-modal/font-collection.js +7 -2
  207. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  208. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +22 -20
  209. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  210. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  211. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  212. package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
  213. package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
  214. package/build-module/components/global-styles/hooks.js +4 -1
  215. package/build-module/components/global-styles/hooks.js.map +1 -1
  216. package/build-module/components/global-styles/icon-with-current-color.js +2 -2
  217. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
  218. package/build-module/components/global-styles/preset-colors.js +22 -0
  219. package/build-module/components/global-styles/preset-colors.js.map +1 -0
  220. package/build-module/components/global-styles/preview-colors.js +3 -7
  221. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  222. package/build-module/components/global-styles/screen-color-palette.js +5 -5
  223. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  224. package/build-module/components/global-styles/screen-colors.js +1 -4
  225. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  226. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  227. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  228. package/build-module/components/global-styles/style-variations-container.js +8 -2
  229. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  230. package/build-module/components/global-styles/typography-example.js +4 -1
  231. package/build-module/components/global-styles/typography-example.js.map +1 -1
  232. package/build-module/components/global-styles/ui.js +4 -1
  233. package/build-module/components/global-styles/ui.js.map +1 -1
  234. package/build-module/components/global-styles/variations/variation.js +11 -5
  235. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  236. package/build-module/components/global-styles/variations/variations-color.js +6 -6
  237. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  238. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
  239. package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
  240. package/build-module/components/global-styles-sidebar/index.js.map +1 -0
  241. package/build-module/components/header-edit-mode/index.js +22 -138
  242. package/build-module/components/header-edit-mode/index.js.map +1 -1
  243. package/build-module/components/header-edit-mode/more-menu/index.js +5 -99
  244. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  245. package/build-module/components/keyboard-shortcuts/register.js +0 -49
  246. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  247. package/build-module/components/layout/index.js +9 -9
  248. package/build-module/components/layout/index.js.map +1 -1
  249. package/build-module/components/layout/router.js +70 -45
  250. package/build-module/components/layout/router.js.map +1 -1
  251. package/build-module/components/page/index.js +2 -2
  252. package/build-module/components/page/index.js.map +1 -1
  253. package/build-module/components/page-pages/index.js +5 -15
  254. package/build-module/components/page-pages/index.js.map +1 -1
  255. package/build-module/components/page-patterns/dataviews-pattern-actions.js +15 -87
  256. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  257. package/build-module/components/page-patterns/header.js +3 -1
  258. package/build-module/components/page-patterns/header.js.map +1 -1
  259. package/build-module/components/page-patterns/index.js +31 -71
  260. package/build-module/components/page-patterns/index.js.map +1 -1
  261. package/build-module/components/page-patterns/use-patterns.js +1 -0
  262. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  263. package/build-module/components/page-templates/hooks.js.map +1 -0
  264. package/build-module/components/{page-templates-template-parts → page-templates}/index.js +73 -94
  265. package/build-module/components/page-templates/index.js.map +1 -0
  266. package/build-module/components/pagination/index.js +2 -2
  267. package/build-module/components/pagination/index.js.map +1 -1
  268. package/build-module/components/pattern-modal/duplicate.js +7 -5
  269. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  270. package/build-module/components/plugin-template-setting-panel/index.js +8 -0
  271. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  272. package/build-module/components/resizable-frame/index.js +21 -10
  273. package/build-module/components/resizable-frame/index.js.map +1 -1
  274. package/build-module/components/revisions/index.js +4 -1
  275. package/build-module/components/revisions/index.js.map +1 -1
  276. package/build-module/components/save-panel/index.js +4 -4
  277. package/build-module/components/save-panel/index.js.map +1 -1
  278. package/build-module/components/sidebar/index.js +62 -32
  279. package/build-module/components/sidebar/index.js.map +1 -1
  280. package/build-module/components/sidebar-button/index.js +2 -2
  281. package/build-module/components/sidebar-button/index.js.map +1 -1
  282. package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
  283. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  284. package/build-module/components/sidebar-navigation-item/index.js +5 -3
  285. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  286. package/build-module/components/sidebar-navigation-screen/index.js +6 -32
  287. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  288. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  289. package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
  290. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +4 -1
  291. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  292. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
  293. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  294. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
  295. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  296. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  297. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
  298. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
  299. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  300. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
  301. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  302. package/build-module/components/sidebar-navigation-screen-page/index.js +40 -9
  303. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  304. package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -2
  305. package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
  306. package/build-module/components/sidebar-navigation-screen-pattern/index.js +3 -15
  307. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  308. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  309. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  310. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  311. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  312. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  313. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  314. package/build-module/components/sidebar-navigation-screen-patterns/index.js +26 -30
  315. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  316. package/build-module/components/sidebar-navigation-screen-template/index.js +5 -2
  317. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  318. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  319. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  320. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -33
  321. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  322. package/build-module/components/site-hub/index.js +3 -3
  323. package/build-module/components/site-hub/index.js.map +1 -1
  324. package/build-module/components/site-icon/index.js +2 -2
  325. package/build-module/components/site-icon/index.js.map +1 -1
  326. package/build-module/components/style-book/index.js +9 -6
  327. package/build-module/components/style-book/index.js.map +1 -1
  328. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
  329. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  330. package/build-module/components/template-actions/index.js +1 -1
  331. package/build-module/components/template-actions/index.js.map +1 -1
  332. package/build-module/components/template-part-converter/index.js +18 -1
  333. package/build-module/components/template-part-converter/index.js.map +1 -1
  334. package/build-module/deprecated.js +45 -0
  335. package/build-module/deprecated.js.map +1 -0
  336. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +38 -5
  337. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  338. package/build-module/index.js +2 -4
  339. package/build-module/index.js.map +1 -1
  340. package/build-module/utils/constants.js +0 -1
  341. package/build-module/utils/constants.js.map +1 -1
  342. package/build-module/utils/get-is-list-page.js +1 -1
  343. package/build-module/utils/get-is-list-page.js.map +1 -1
  344. package/build-module/utils/use-activate-theme.js +9 -6
  345. package/build-module/utils/use-activate-theme.js.map +1 -1
  346. package/build-style/style-rtl.css +208 -484
  347. package/build-style/style.css +208 -484
  348. package/package.json +43 -45
  349. package/src/components/add-new-page/index.js +7 -1
  350. package/src/components/add-new-pattern/index.js +15 -12
  351. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  352. package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
  353. package/src/components/add-new-template/index.js +2 -2
  354. package/src/components/app/index.js +5 -2
  355. package/src/components/block-editor/editor-canvas.js +6 -26
  356. package/src/components/block-editor/resize-handle.js +30 -11
  357. package/src/components/block-editor/site-editor-canvas.js +2 -2
  358. package/src/components/block-editor/style.scss +12 -17
  359. package/src/components/create-template-part-modal/index.js +3 -0
  360. package/src/components/dataviews-actions/index.js +38 -0
  361. package/src/components/editor/index.js +117 -18
  362. package/src/components/editor/style.scss +6 -5
  363. package/src/components/global-styles/background-panel.js +17 -2
  364. package/src/components/global-styles/color-indicator-wrapper.js +2 -2
  365. package/src/components/global-styles/color-palette-panel.js +3 -4
  366. package/src/components/global-styles/font-library-modal/context.js +9 -3
  367. package/src/components/global-styles/font-library-modal/font-collection.js +31 -12
  368. package/src/components/global-styles/font-library-modal/installed-fonts.js +82 -54
  369. package/src/components/global-styles/font-library-modal/style.scss +17 -0
  370. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  371. package/src/components/global-styles/gradients-palette-panel.js +1 -4
  372. package/src/components/global-styles/hooks.js +2 -1
  373. package/src/components/global-styles/icon-with-current-color.js +2 -2
  374. package/src/components/global-styles/preset-colors.js +18 -0
  375. package/src/components/global-styles/preview-colors.js +4 -7
  376. package/src/components/global-styles/screen-color-palette.js +4 -4
  377. package/src/components/global-styles/screen-colors.js +0 -2
  378. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
  379. package/src/components/global-styles/stories/index.story.js +2 -1
  380. package/src/components/global-styles/style-variations-container.js +11 -2
  381. package/src/components/global-styles/typography-example.js +2 -1
  382. package/src/components/global-styles/ui.js +5 -1
  383. package/src/components/global-styles/variations/style.scss +15 -31
  384. package/src/components/global-styles/variations/variation.js +13 -10
  385. package/src/components/global-styles/variations/variations-color.js +5 -8
  386. package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
  387. package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
  388. package/src/components/header-edit-mode/index.js +25 -184
  389. package/src/components/header-edit-mode/more-menu/index.js +8 -145
  390. package/src/components/header-edit-mode/style.scss +1 -271
  391. package/src/components/keyboard-shortcuts/register.js +0 -58
  392. package/src/components/layout/index.js +14 -10
  393. package/src/components/layout/router.js +66 -56
  394. package/src/components/layout/style.scss +2 -1
  395. package/src/components/page/index.js +2 -2
  396. package/src/components/page-pages/index.js +8 -28
  397. package/src/components/page-patterns/dataviews-pattern-actions.js +11 -101
  398. package/src/components/page-patterns/header.js +3 -1
  399. package/src/components/page-patterns/index.js +32 -110
  400. package/src/components/page-patterns/style.scss +14 -1
  401. package/src/components/page-patterns/use-patterns.js +1 -0
  402. package/src/components/{page-templates-template-parts → page-templates}/index.js +33 -75
  403. package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
  404. package/src/components/pagination/index.js +2 -2
  405. package/src/components/pattern-modal/duplicate.js +4 -3
  406. package/src/components/plugin-template-setting-panel/index.js +8 -0
  407. package/src/components/resizable-frame/index.js +20 -7
  408. package/src/components/revisions/index.js +2 -1
  409. package/src/components/save-panel/index.js +4 -4
  410. package/src/components/sidebar/index.js +61 -37
  411. package/src/components/sidebar-button/index.js +2 -5
  412. package/src/components/sidebar-dataviews/dataview-item.js +4 -7
  413. package/src/components/sidebar-navigation-item/index.js +3 -3
  414. package/src/components/sidebar-navigation-screen/index.js +7 -31
  415. package/src/components/sidebar-navigation-screen/style.scss +11 -9
  416. package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
  417. package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -1
  418. package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
  419. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
  420. package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
  421. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
  422. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +0 -10
  423. package/src/components/sidebar-navigation-screen-page/index.js +48 -9
  424. package/src/components/sidebar-navigation-screen-page/status-label.js +2 -2
  425. package/src/components/sidebar-navigation-screen-pattern/index.js +1 -12
  426. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  427. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  428. package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
  429. package/src/components/sidebar-navigation-screen-patterns/index.js +20 -39
  430. package/src/components/sidebar-navigation-screen-template/index.js +3 -2
  431. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  432. package/src/components/sidebar-navigation-screen-templates-browse/index.js +8 -39
  433. package/src/components/site-hub/index.js +3 -3
  434. package/src/components/site-icon/index.js +2 -2
  435. package/src/components/style-book/index.js +7 -6
  436. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -4
  437. package/src/components/template-actions/index.js +1 -1
  438. package/src/components/template-part-converter/index.js +16 -3
  439. package/src/deprecated.js +42 -0
  440. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +71 -17
  441. package/src/index.js +2 -9
  442. package/src/style.scss +2 -16
  443. package/src/utils/constants.js +1 -1
  444. package/src/utils/get-is-list-page.js +1 -3
  445. package/src/utils/use-activate-theme.js +4 -4
  446. package/build/components/global-styles/global-styles-provider.js +0 -129
  447. package/build/components/global-styles/global-styles-provider.js.map +0 -1
  448. package/build/components/header-edit-mode/document-tools/index.js +0 -68
  449. package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
  450. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
  451. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  452. package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
  453. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  454. package/build/components/keyboard-shortcuts/edit-mode.js +0 -56
  455. package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  456. package/build/components/page-templates-template-parts/add-new-template-part.js +0 -65
  457. package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  458. package/build/components/page-templates-template-parts/hooks.js.map +0 -1
  459. package/build/components/page-templates-template-parts/index.js.map +0 -1
  460. package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  461. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  462. package/build/components/sidebar-edit-mode/index.js +0 -146
  463. package/build/components/sidebar-edit-mode/index.js.map +0 -1
  464. package/build/components/sidebar-edit-mode/page-panels/index.js +0 -98
  465. package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  466. package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
  467. package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  468. package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
  469. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  470. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
  471. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  472. package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
  473. package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  474. package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
  475. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  476. package/build/components/sidebar-edit-mode/template-panel/index.js +0 -130
  477. package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  478. package/build/components/start-template-options/index.js +0 -191
  479. package/build/components/start-template-options/index.js.map +0 -1
  480. package/build/utils/math.js +0 -98
  481. package/build/utils/math.js.map +0 -1
  482. package/build-module/components/global-styles/global-styles-provider.js +0 -120
  483. package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
  484. package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
  485. package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
  486. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
  487. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  488. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  489. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  490. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -49
  491. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  492. package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -57
  493. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  494. package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
  495. package/build-module/components/page-templates-template-parts/index.js.map +0 -1
  496. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
  497. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
  498. package/build-module/components/sidebar-edit-mode/index.js +0 -137
  499. package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
  500. package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -90
  501. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
  502. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
  503. package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
  504. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
  505. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  506. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -31
  507. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
  508. package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
  509. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
  510. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
  511. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
  512. package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -122
  513. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
  514. package/build-module/components/start-template-options/index.js +0 -184
  515. package/build-module/components/start-template-options/index.js.map +0 -1
  516. package/build-module/utils/math.js +0 -92
  517. package/build-module/utils/math.js.map +0 -1
  518. package/src/components/global-styles/global-styles-provider.js +0 -162
  519. package/src/components/header-edit-mode/document-tools/index.js +0 -68
  520. package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
  521. package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  522. package/src/components/keyboard-shortcuts/edit-mode.js +0 -59
  523. package/src/components/page-templates-template-parts/add-new-template-part.js +0 -62
  524. package/src/components/sidebar-edit-mode/index.js +0 -162
  525. package/src/components/sidebar-edit-mode/page-panels/index.js +0 -105
  526. package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
  527. package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
  528. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -49
  529. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -34
  530. package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
  531. package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
  532. package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
  533. package/src/components/sidebar-edit-mode/template-panel/index.js +0 -144
  534. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
  535. package/src/components/start-template-options/index.js +0 -231
  536. package/src/components/start-template-options/style.scss +0 -55
  537. package/src/utils/math.js +0 -93
  538. /package/build/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  539. /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  540. /package/build-module/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  541. /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  542. /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
  543. /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
@@ -1,49 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useShortcut } from '@wordpress/keyboard-shortcuts';
5
- import { useDispatch, useSelect } from '@wordpress/data';
6
- import { store as blockEditorStore } from '@wordpress/block-editor';
7
- import { createBlock } from '@wordpress/blocks';
8
- function KeyboardShortcutsEditMode() {
9
- const {
10
- replaceBlocks
11
- } = useDispatch(blockEditorStore);
12
- const {
13
- getBlockName,
14
- getSelectedBlockClientId,
15
- getBlockAttributes
16
- } = useSelect(blockEditorStore);
17
- const handleTextLevelShortcut = (event, level) => {
18
- event.preventDefault();
19
- const destinationBlockName = level === 0 ? 'core/paragraph' : 'core/heading';
20
- const currentClientId = getSelectedBlockClientId();
21
- if (currentClientId === null) {
22
- return;
23
- }
24
- const blockName = getBlockName(currentClientId);
25
- if (blockName !== 'core/paragraph' && blockName !== 'core/heading') {
26
- return;
27
- }
28
- const attributes = getBlockAttributes(currentClientId);
29
- const textAlign = blockName === 'core/paragraph' ? 'align' : 'textAlign';
30
- const destinationTextAlign = destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';
31
- replaceBlocks(currentClientId, createBlock(destinationBlockName, {
32
- level,
33
- content: attributes.content,
34
- ...{
35
- [destinationTextAlign]: attributes[textAlign]
36
- }
37
- }));
38
- };
39
- useShortcut('core/edit-site/transform-heading-to-paragraph', event => handleTextLevelShortcut(event, 0));
40
- [1, 2, 3, 4, 5, 6].forEach(level => {
41
- //the loop is based off on a constant therefore
42
- //the hook will execute the same way every time
43
- //eslint-disable-next-line react-hooks/rules-of-hooks
44
- useShortcut(`core/edit-site/transform-paragraph-to-heading-${level}`, event => handleTextLevelShortcut(event, level));
45
- });
46
- return null;
47
- }
48
- export default KeyboardShortcutsEditMode;
49
- //# sourceMappingURL=edit-mode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useShortcut","useDispatch","useSelect","store","blockEditorStore","createBlock","KeyboardShortcutsEditMode","replaceBlocks","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","forEach"],"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/edit-mode.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\nfunction KeyboardShortcutsEditMode() {\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseShortcut( 'core/edit-site/transform-heading-to-paragraph', ( event ) =>\n\t\thandleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-site/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcutsEditMode;\n"],"mappings":"A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AAuB,CAAEC,KAAK,EAAE,CAAE,CACnC,CAAC;EAED,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACU,OAAO,CAAIT,KAAK,IAAM;IAC1C;IACA;IACA;IACAb,WAAW,CACT,iDAAiDa,KAAO,EAAC,EACxDD,KAAK,IAAMD,uBAAuB,CAAEC,KAAK,EAAEC,KAAM,CACpD,CAAC;EACF,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAEA,eAAeP,yBAAyB","ignoreList":[]}
@@ -1,57 +0,0 @@
1
- import { createElement, Fragment } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { privateApis as routerPrivateApis } from '@wordpress/router';
6
- import { useSelect } from '@wordpress/data';
7
- import { store as coreStore } from '@wordpress/core-data';
8
- import { useState, memo } from '@wordpress/element';
9
- import { Button } from '@wordpress/components';
10
-
11
- /**
12
- * Internal dependencies
13
- */
14
- import { unlock } from '../../lock-unlock';
15
- import { store as editSiteStore } from '../../store';
16
- import CreateTemplatePartModal from '../create-template-part-modal';
17
- import { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
18
- const {
19
- useHistory
20
- } = unlock(routerPrivateApis);
21
- function AddNewTemplatePart() {
22
- const {
23
- canCreate,
24
- postType
25
- } = useSelect(select => {
26
- const {
27
- supportsTemplatePartsMode
28
- } = select(editSiteStore).getSettings();
29
- return {
30
- canCreate: !supportsTemplatePartsMode,
31
- postType: select(coreStore).getPostType(TEMPLATE_PART_POST_TYPE)
32
- };
33
- }, []);
34
- const [isModalOpen, setIsModalOpen] = useState(false);
35
- const history = useHistory();
36
- if (!canCreate || !postType) {
37
- return null;
38
- }
39
- return createElement(Fragment, null, createElement(Button, {
40
- variant: "primary",
41
- onClick: () => setIsModalOpen(true)
42
- }, postType.labels.add_new_item), isModalOpen && createElement(CreateTemplatePartModal, {
43
- closeModal: () => setIsModalOpen(false),
44
- blocks: [],
45
- onCreate: templatePart => {
46
- setIsModalOpen(false);
47
- history.push({
48
- postId: templatePart.id,
49
- postType: TEMPLATE_PART_POST_TYPE,
50
- canvas: 'edit'
51
- });
52
- },
53
- onError: () => setIsModalOpen(false)
54
- }));
55
- }
56
- export default memo(AddNewTemplatePart);
57
- //# sourceMappingURL=add-new-template-part.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["privateApis","routerPrivateApis","useSelect","store","coreStore","useState","memo","Button","unlock","editSiteStore","CreateTemplatePartModal","TEMPLATE_PART_POST_TYPE","useHistory","AddNewTemplatePart","canCreate","postType","select","supportsTemplatePartsMode","getSettings","getPostType","isModalOpen","setIsModalOpen","history","createElement","Fragment","variant","onClick","labels","add_new_item","closeModal","blocks","onCreate","templatePart","push","postId","id","canvas","onError"],"sources":["@wordpress/edit-site/src/components/page-templates-template-parts/add-new-template-part.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState, memo } from '@wordpress/element';\nimport { Button } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport CreateTemplatePartModal from '../create-template-part-modal';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction AddNewTemplatePart() {\n\tconst { canCreate, postType } = useSelect( ( select ) => {\n\t\tconst { supportsTemplatePartsMode } =\n\t\t\tselect( editSiteStore ).getSettings();\n\t\treturn {\n\t\t\tcanCreate: ! supportsTemplatePartsMode,\n\t\t\tpostType: select( coreStore ).getPostType(\n\t\t\t\tTEMPLATE_PART_POST_TYPE\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst history = useHistory();\n\n\tif ( ! canCreate || ! postType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button variant=\"primary\" onClick={ () => setIsModalOpen( true ) }>\n\t\t\t\t{ postType.labels.add_new_item }\n\t\t\t</Button>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<CreateTemplatePartModal\n\t\t\t\t\tcloseModal={ () => setIsModalOpen( false ) }\n\t\t\t\t\tblocks={ [] }\n\t\t\t\t\tonCreate={ ( templatePart ) => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpostId: templatePart.id,\n\t\t\t\t\t\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tonError={ () => setIsModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default memo( AddNewTemplatePart );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,QAAQ,EAAEC,IAAI,QAAQ,oBAAoB;AACnD,SAASC,MAAM,QAAQ,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,OAAOC,uBAAuB,MAAM,+BAA+B;AACnE,SAASC,uBAAuB,QAAQ,uBAAuB;AAE/D,MAAM;EAAEC;AAAW,CAAC,GAAGJ,MAAM,CAAEP,iBAAkB,CAAC;AAElD,SAASY,kBAAkBA,CAAA,EAAG;EAC7B,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGb,SAAS,CAAIc,MAAM,IAAM;IACxD,MAAM;MAAEC;IAA0B,CAAC,GAClCD,MAAM,CAAEP,aAAc,CAAC,CAACS,WAAW,CAAC,CAAC;IACtC,OAAO;MACNJ,SAAS,EAAE,CAAEG,yBAAyB;MACtCF,QAAQ,EAAEC,MAAM,CAAEZ,SAAU,CAAC,CAACe,WAAW,CACxCR,uBACD;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM,CAAES,WAAW,EAAEC,cAAc,CAAE,GAAGhB,QAAQ,CAAE,KAAM,CAAC;EACzD,MAAMiB,OAAO,GAAGV,UAAU,CAAC,CAAC;EAE5B,IAAK,CAAEE,SAAS,IAAI,CAAEC,QAAQ,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OACCQ,aAAA,CAAAC,QAAA,QACCD,aAAA,CAAChB,MAAM;IAACkB,OAAO,EAAC,SAAS;IAACC,OAAO,EAAGA,CAAA,KAAML,cAAc,CAAE,IAAK;EAAG,GAC/DN,QAAQ,CAACY,MAAM,CAACC,YACX,CAAC,EACPR,WAAW,IACZG,aAAA,CAACb,uBAAuB;IACvBmB,UAAU,EAAGA,CAAA,KAAMR,cAAc,CAAE,KAAM,CAAG;IAC5CS,MAAM,EAAG,EAAI;IACbC,QAAQ,EAAKC,YAAY,IAAM;MAC9BX,cAAc,CAAE,KAAM,CAAC;MACvBC,OAAO,CAACW,IAAI,CAAE;QACbC,MAAM,EAAEF,YAAY,CAACG,EAAE;QACvBpB,QAAQ,EAAEJ,uBAAuB;QACjCyB,MAAM,EAAE;MACT,CAAE,CAAC;IACJ,CAAG;IACHC,OAAO,EAAGA,CAAA,KAAMhB,cAAc,CAAE,KAAM;EAAG,CACzC,CAED,CAAC;AAEL;AAEA,eAAef,IAAI,CAAEO,kBAAmB,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["store","coreStore","useSelect","commentAuthorAvatar","authorIcon","layout","themeIcon","plugins","pluginIcon","globe","globeIcon","TEMPLATE_ORIGINS","useAddedBy","postType","postId","select","getEntityRecord","getMedia","getUser","getEditedEntityRecord","template","originalSource","original_source","authorText","author_text","type","icon","text","isCustomized","source","custom","siteData","imageUrl","site_logo","source_url","undefined","user","author","avatar_urls"],"sources":["@wordpress/edit-site/src/components/page-templates-template-parts/hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tcommentAuthorAvatar as authorIcon,\n\tlayout as themeIcon,\n\tplugins as pluginIcon,\n\tglobe as globeIcon,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_ORIGINS } from '../../utils/constants';\n\n/** @typedef {'wp_template'|'wp_template_part'} TemplateType */\n\n/**\n * @typedef {'theme'|'plugin'|'site'|'user'} AddedByType\n *\n * @typedef AddedByData\n * @type {Object}\n * @property {AddedByType} type The type of the data.\n * @property {JSX.Element} icon The icon to display.\n * @property {string} [imageUrl] The optional image URL to display.\n * @property {string} [text] The text to display.\n * @property {boolean} isCustomized Whether the template has been customized.\n *\n * @param {TemplateType} postType The template post type.\n * @param {number} postId The template post id.\n * @return {AddedByData} The added by object or null.\n */\nexport function useAddedBy( postType, postId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetMedia,\n\t\t\t\tgetUser,\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t} = select( coreStore );\n\t\t\tconst template = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst originalSource = template?.original_source;\n\t\t\tconst authorText = template?.author_text;\n\n\t\t\tswitch ( originalSource ) {\n\t\t\t\tcase 'theme': {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: originalSource,\n\t\t\t\t\t\ticon: themeIcon,\n\t\t\t\t\t\ttext: authorText,\n\t\t\t\t\t\tisCustomized:\n\t\t\t\t\t\t\ttemplate.source === TEMPLATE_ORIGINS.custom,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase 'plugin': {\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: originalSource,\n\t\t\t\t\t\ticon: pluginIcon,\n\t\t\t\t\t\ttext: authorText,\n\t\t\t\t\t\tisCustomized:\n\t\t\t\t\t\t\ttemplate.source === TEMPLATE_ORIGINS.custom,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcase 'site': {\n\t\t\t\t\tconst siteData = getEntityRecord(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'__unstableBase'\n\t\t\t\t\t);\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: originalSource,\n\t\t\t\t\t\ticon: globeIcon,\n\t\t\t\t\t\timageUrl: siteData?.site_logo\n\t\t\t\t\t\t\t? getMedia( siteData.site_logo )?.source_url\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\ttext: authorText,\n\t\t\t\t\t\tisCustomized: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tconst user = getUser( template.author );\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: 'user',\n\t\t\t\t\t\ticon: authorIcon,\n\t\t\t\t\t\timageUrl: user?.avatar_urls?.[ 48 ],\n\t\t\t\t\t\ttext: authorText,\n\t\t\t\t\t\tisCustomized: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ postType, postId ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,mBAAmB,IAAIC,UAAU,EACjCC,MAAM,IAAIC,SAAS,EACnBC,OAAO,IAAIC,UAAU,EACrBC,KAAK,IAAIC,SAAS,QACZ,kBAAkB;;AAEzB;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;;AAExD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS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AU;YAChB4B,QAAQ,EAAEI,IAAI,EAAEE,WAAW,GAAI,EAAE,CAAE;YACnCX,IAAI,EAAEJ,UAAU;YAChBK,YAAY,EAAE;UACf,CAAC;QACF;IACD;EACD,CAAC,EACD,CAAEf,QAAQ,EAAEC,MAAM,CACnB,CAAC;AACF","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["classnames","Icon","__experimentalText","Text","__experimentalHStack","HStack","VisuallyHidden","__","useState","useMemo","useCallback","useEffect","useEntityRecords","decodeEntities","parse","BlockPreview","privateApis","blockEditorPrivateApis","DataViews","filterSortAndPaginate","routerPrivateApis","editorPrivateApis","Async","Page","default","Link","useLink","AddNewTemplate","useAddedBy","TEMPLATE_POST_TYPE","ENUMERATION_TYPE","OPERATOR_IS_ANY","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","usePatternSettings","unlock","AddNewTemplatePart","usePostActions","ExperimentalBlockEditorProvider","useGlobalStyle","useHistory","useLocation","EMPTY_ARRAY","defaultConfigPerViewType","primaryField","mediaField","columnFields","DEFAULT_VIEW","type","search","page","perPage","sort","field","direction","hiddenFields","layout","filters","Title","item","viewType","title","rendered","linkProps","params","postId","id","postType","canvas","createElement","AuthorField","isImageLoaded","setIsImageLoaded","text","icon","imageUrl","withIcon","alignment","spacing","className","onLoad","alt","src","Preview","settings","backgroundColor","blocks","content","raw","onClick","isEmpty","length","style","TEMPLATE_ACTIONS","PageTemplatesTemplateParts","activeView","defaultView","usedType","operator","value","view","setView","currentView","records","isResolving","isLoadingData","per_page","history","onSelectionChange","items","push","undefined","authors","authorsSet","Set","forEach","template","add","author_text","Array","from","map","author","label","fields","_fields","header","render","minWidth","maxWidth","enableSorting","getValue","enableHiding","enableGlobalSearch","description","Fragment","variant","elements","width","data","paginationInfo","onActionPerformed","actionId","post","actions","onChangeView","newView","isLoading"],"sources":["@wordpress/edit-site/src/components/page-templates-template-parts/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { parse } from '@wordpress/blocks';\nimport {\n\tBlockPreview,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { Async } from '../async';\nimport Page from '../page';\nimport { default as Link, useLink } from '../routes/link';\nimport AddNewTemplate from '../add-new-template';\nimport { useAddedBy } from './hooks';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tENUMERATION_TYPE,\n\tOPERATOR_IS_ANY,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\n\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\nimport AddNewTemplatePart from './add-new-template-part';\n\nconst { usePostActions } = unlock( editorPrivateApis );\n\nconst { ExperimentalBlockEditorProvider, useGlobalStyle } = unlock(\n\tblockEditorPrivateApis\n);\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nconst defaultConfigPerViewType = {\n\t[ LAYOUT_TABLE ]: {\n\t\tprimaryField: 'title',\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tmediaField: 'preview',\n\t\tprimaryField: 'title',\n\t\tcolumnFields: [ 'description' ],\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tprimaryField: 'title',\n\t\tmediaField: 'preview',\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\t// All fields are visible by default, so it's\n\t// better to keep track of the hidden ones.\n\thiddenFields: [ 'preview' ],\n\tlayout: defaultConfigPerViewType[ LAYOUT_GRID ],\n\tfilters: [],\n};\n\nfunction Title( { item, viewType } ) {\n\tif ( viewType === LAYOUT_LIST ) {\n\t\treturn decodeEntities( item.title?.rendered ) || __( '(no title)' );\n\t}\n\tconst linkProps = {\n\t\tparams: {\n\t\t\tpostId: item.id,\n\t\t\tpostType: item.type,\n\t\t\tcanvas: 'edit',\n\t\t},\n\t};\n\treturn (\n\t\t<Link { ...linkProps }>\n\t\t\t{ decodeEntities( item.title?.rendered ) || __( '(no title)' ) }\n\t\t</Link>\n\t);\n}\n\nfunction AuthorField( { item, viewType } ) {\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\tconst { text, icon, imageUrl } = useAddedBy( item.type, item.id );\n\tconst withIcon = viewType !== LAYOUT_LIST;\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 1 }>\n\t\t\t{ withIcon && imageUrl && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'page-templates-author-field__avatar',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\tsrc={ imageUrl }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ withIcon && ! imageUrl && (\n\t\t\t\t<div className=\"page-templates-author-field__icon\">\n\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span className=\"page-templates-author-field__name\">{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nfunction Preview( { item, viewType } ) {\n\tconst settings = usePatternSettings();\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst blocks = useMemo( () => {\n\t\treturn parse( item.content.raw );\n\t}, [ item.content.raw ] );\n\tconst { onClick } = useLink( {\n\t\tpostId: item.id,\n\t\tpostType: item.type,\n\t\tcanvas: 'edit',\n\t} );\n\n\tconst isEmpty = ! blocks?.length;\n\t// Wrap everything in a block editor provider to ensure 'styles' that are needed\n\t// for the previews are synced between the site editor store and the block editor store.\n\t// Additionally we need to have the `__experimentalBlockPatterns` setting in order to\n\t// render patterns inside the previews.\n\t// TODO: Same approach is used in the patterns list and it becomes obvious that some of\n\t// the block editor settings are needed in context where we don't have the block editor.\n\t// Explore how we can solve this in a better way.\n\treturn (\n\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t<div\n\t\t\t\tclassName={ `page-templates-preview-field is-viewtype-${ viewType }` }\n\t\t\t\tstyle={ { backgroundColor } }\n\t\t\t>\n\t\t\t\t{ viewType === LAYOUT_LIST && ! isEmpty && (\n\t\t\t\t\t<Async>\n\t\t\t\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t\t\t</Async>\n\t\t\t\t) }\n\t\t\t\t{ viewType !== LAYOUT_LIST && (\n\t\t\t\t\t<button\n\t\t\t\t\t\tclassName=\"page-templates-preview-field__button\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\taria-label={ item.title?.rendered || item.title }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isEmpty &&\n\t\t\t\t\t\t\t( item.type === TEMPLATE_POST_TYPE\n\t\t\t\t\t\t\t\t? __( 'Empty template' )\n\t\t\t\t\t\t\t\t: __( 'Empty template part' ) ) }\n\t\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t\t<Async>\n\t\t\t\t\t\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t\t\t\t\t</Async>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n\nconst TEMPLATE_ACTIONS = [\n\t'edit-post',\n\t'reset-template',\n\t'rename-template',\n\t'view-post-revisions',\n\t'delete-template',\n];\n\nexport default function PageTemplatesTemplateParts( { postType } ) {\n\tconst { params } = useLocation();\n\tconst { activeView = 'all', layout } = params;\n\tconst defaultView = useMemo( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\treturn {\n\t\t\t...DEFAULT_VIEW,\n\t\t\ttype: usedType,\n\t\t\tlayout: defaultConfigPerViewType[ usedType ],\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: 'isAny',\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t};\n\t}, [ layout, activeView ] );\n\tconst [ view, setView ] = useState( defaultView );\n\tuseEffect( () => {\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t} ) );\n\t}, [ activeView ] );\n\n\tconst { records, isResolving: isLoadingData } = useEntityRecords(\n\t\t'postType',\n\t\tpostType,\n\t\t{\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\tconst history = useHistory();\n\tconst onSelectionChange = useCallback(\n\t\t( items ) => {\n\t\t\tif ( view?.type === LAYOUT_LIST ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ].id : undefined,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history, params, view?.type ]\n\t);\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ records ] );\n\n\tconst fields = useMemo( () => {\n\t\tconst _fields = [\n\t\t\t{\n\t\t\t\theader: __( 'Preview' ),\n\t\t\t\tid: 'preview',\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn <Preview item={ item } viewType={ view.type } />;\n\t\t\t\t},\n\t\t\t\tminWidth: 120,\n\t\t\t\tmaxWidth: 120,\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader:\n\t\t\t\t\tpostType === TEMPLATE_POST_TYPE\n\t\t\t\t\t\t? __( 'Template' )\n\t\t\t\t\t\t: __( 'Template Part' ),\n\t\t\t\tid: 'title',\n\t\t\t\tgetValue: ( { item } ) => item.title?.rendered,\n\t\t\t\trender: ( { item } ) => (\n\t\t\t\t\t<Title item={ item } viewType={ view.type } />\n\t\t\t\t),\n\t\t\t\tmaxWidth: 400,\n\t\t\t\tenableHiding: false,\n\t\t\t\tenableGlobalSearch: true,\n\t\t\t},\n\t\t];\n\t\tif ( postType === TEMPLATE_POST_TYPE ) {\n\t\t\t_fields.push( {\n\t\t\t\theader: __( 'Description' ),\n\t\t\t\tid: 'description',\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn item.description ? (\n\t\t\t\t\t\t<span className=\"page-templates-description\">\n\t\t\t\t\t\t\t{ decodeEntities( item.description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tview.type === LAYOUT_TABLE && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<Text variant=\"muted\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t&#8212;\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'No description.' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\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},\n\t\t\t\tmaxWidth: 400,\n\t\t\t\tminWidth: 320,\n\t\t\t\tenableSorting: false,\n\t\t\t\tenableGlobalSearch: true,\n\t\t\t} );\n\t\t}\n\t\t// TODO: The plan is to support fields reordering, which would require an API like `order` or something\n\t\t// similar. With the aforementioned API we wouldn't need to construct the fields array like this.\n\t\t_fields.push( {\n\t\t\theader: __( 'Author' ),\n\t\t\tid: 'author',\n\t\t\tgetValue: ( { item } ) => item.author_text,\n\t\t\trender: ( { item } ) => {\n\t\t\t\treturn <AuthorField viewType={ view.type } item={ item } />;\n\t\t\t},\n\t\t\ttype: ENUMERATION_TYPE,\n\t\t\telements: authors,\n\t\t\twidth: '1%',\n\t\t} );\n\t\treturn _fields;\n\t}, [ postType, authors, view.type ] );\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\treturn filterSortAndPaginate( records, view, fields );\n\t}, [ records, view, fields ] );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tif ( actionId === 'edit-post' ) {\n\t\t\t\tconst post = items[ 0 ];\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostId: post.id,\n\t\t\t\t\tpostType: post.type,\n\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history ]\n\t);\n\n\tconst actions = usePostActions( onActionPerformed, TEMPLATE_ACTIONS );\n\n\tconst onChangeView = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type !== view.type ) {\n\t\t\t\tnewView = {\n\t\t\t\t\t...newView,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...defaultConfigPerViewType[ newView.type ],\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tlayout: newView.type,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tsetView( newView );\n\t\t},\n\t\t[ view.type, setView, history, params ]\n\t);\n\n\treturn (\n\t\t<Page\n\t\t\tclassName=\"edit-site-page-template-template-parts-dataviews\"\n\t\t\ttitle={\n\t\t\t\tpostType === TEMPLATE_POST_TYPE\n\t\t\t\t\t? __( 'Templates' )\n\t\t\t\t\t: __( 'Template Parts' )\n\t\t\t}\n\t\t\tactions={\n\t\t\t\tpostType === TEMPLATE_POST_TYPE ? (\n\t\t\t\t\t<AddNewTemplate />\n\t\t\t\t) : (\n\t\t\t\t\t<AddNewTemplatePart />\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data }\n\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tonSelectionChange={ onSelectionChange }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,IAAI,EACJC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,cAAc,QACR,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,OAAO,EAAEC,WAAW,EAAEC,SAAS,QAAQ,oBAAoB;AAC9E,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD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OAAO,EAAE3C,MAAM,CACtC,CAAC;EAED,OACCK,aAAA,CAAC/C,IAAI;IACJyD,SAAS,EAAC,kDAAkD;IAC5DlB,KAAK,EACJM,QAAQ,KAAKvC,kBAAkB,GAC5BtB,EAAE,CAAE,WAAY,CAAC,GACjBA,EAAE,CAAE,gBAAiB,CACxB;IACD0I,OAAO,EACN7E,QAAQ,KAAKvC,kBAAkB,GAC9ByC,aAAA,CAAC3C,cAAc,MAAE,CAAC,GAElB2C,aAAA,CAACjC,kBAAkB,MAAE;EAEtB,GAEDiC,aAAA,CAACpD,SAAS;IACT2H,cAAc,EAAGA,cAAgB;IACjChB,MAAM,EAAGA,MAAQ;IACjBoB,OAAO,EAAGA,OAAS;IACnBL,IAAI,EAAGA,IAAM;IACbQ,SAAS,EAAG1C,aAAe;IAC3BL,IAAI,EAAGA,IAAM;IACb6C,YAAY,EAAGA,YAAc;IAC7BrC,iBAAiB,EAAGA;EAAmB,CACvC,CACI,CAAC;AAET","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["privateApis","editorPrivateApis","unlock","ComplementaryArea","ComplementaryAreaMoreMenuItem","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","isActiveByDefault","createElement","Fragment","scope","smallScreenTitle"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/default-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { ComplementaryArea, ComplementaryAreaMoreMenuItem } =\n\tunlock( editorPrivateApis );\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n\tpanelClassName,\n\tisActiveByDefault,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\tsmallScreenTitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t\tpanelClassName={ panelClassName }\n\t\t\t\tisActiveByDefault={ isActiveByDefault }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,iBAAiB;EAAEC;AAA8B,CAAC,GACzDF,MAAM,CAAED,iBAAkB,CAAC;AAE5B,eAAe,SAASI,cAAcA,CAAE;EACvCC,SAAS;EACTC,UAAU;EACVC,KAAK;EACLC,IAAI;EACJC,QAAQ;EACRC,UAAU;EACVC,MAAM;EACNC,eAAe;EACfC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACb,iBAAiB;IACjBG,SAAS,EAAGA,SAAW;IACvBY,KAAK,EAAC,MAAM;IACZX,UAAU,EAAGA,UAAY;IACzBC,KAAK,EAAGA,KAAO;IACfW,gBAAgB,EAAGX,KAAO;IAC1BC,IAAI,EAAGA,IAAM;IACbE,UAAU,EAAGA,UAAY;IACzBC,MAAM,EAAGA,MAAQ;IACjBC,eAAe,EAAGA,eAAiB;IACnCC,cAAc,EAAGA,cAAgB;IACjCC,iBAAiB,EAAGA;EAAmB,GAErCL,QACgB,CAAC,EACpBM,aAAA,CAACZ,6BAA6B;IAC7Bc,KAAK,EAAC,MAAM;IACZX,UAAU,EAAGA,UAAY;IACzBE,IAAI,EAAGA;EAAM,GAEXD,KAC4B,CAC9B,CAAC;AAEL","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["FlexItem","FlexBlock","Flex","Button","__experimentalUseNavigator","useNavigator","__","styles","seen","backup","useSelect","useDispatch","useEffect","store","preferencesStore","editorStore","privateApis","editorPrivateApis","DefaultSidebar","GlobalStylesUI","editSiteStore","GlobalStylesMenuSlot","unlock","coreStore","interfaceStore","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","canvasContainerView","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","_showListViewByDefault","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","setIsListViewOpened","goTo","toggleRevisions","toggleStyleBook","createElement","className","identifier","title","icon","closeLabel","panelClassName","header","style","minWidth","label","isPressed","disabled","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlexItem,\n\tFlexBlock,\n\tFlex,\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tisRevisionsOpened,\n\t\tisRevisionsStyleBookOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst canvasContainerView = getEditorCanvasContainerView();\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === canvasContainerView,\n\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t! _isEditCanvasMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tisRevisionsStyleBookOpened:\n\t\t\t\t'global-styles-revisions:style-book' === canvasContainerView,\n\t\t\tisRevisionsOpened:\n\t\t\t\t'global-styles-revisions' === canvasContainerView,\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { goTo } = useNavigator();\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t\treturn;\n\t\t}\n\t\tgoTo( '/revisions' );\n\n\t\tif ( isStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t} else {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( isStyleBookOpened && showListViewByDefault );\n\t\tsetEditorCanvasContainerView(\n\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t);\n\t};\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex className=\"edit-site-global-styles-sidebar__header\">\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<h2 className=\"edit-site-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisStyleBookOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisRevisionsOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,QAAQ,EACRC,SAAS,EACTC,IAAI,EACJC,MAAM,EACNC,0BAA0B,IAAIC,YAAY,QACpC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AACvD,SAASC,SAAS,E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sD,aAAA,CAACnD,MAAM;MACN6D,KAAK,EAAG1D,EAAE,CAAE,WAAY,CAAG;MAC3BoD,IAAI,EAAGjD,MAAQ;MACf0D,OAAO,EAAGf,eAAiB;MAC3Bc,QAAQ,EAAG,CAAErC,YAAc;MAC3BoC,SAAS,EACRnC,iBAAiB,IAAIC;IACrB,CACD,CACQ,CAAC,EACXuB,aAAA,CAACjC,oBAAoB,MAAE,CAClB;EACN,GAEDiC,aAAA,CAACnC,cAAc,MAAE,CACF,CAAC;AAEnB","ignoreList":[]}
@@ -1,137 +0,0 @@
1
- import { createElement, Fragment } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { createSlotFill, privateApis as componentsPrivateApis } from '@wordpress/components';
6
- import { isRTL, __ } from '@wordpress/i18n';
7
- import { drawerLeft, drawerRight } from '@wordpress/icons';
8
- import { useCallback, useContext, useEffect, useRef } from '@wordpress/element';
9
- import { useSelect, useDispatch } from '@wordpress/data';
10
- import { store as blockEditorStore } from '@wordpress/block-editor';
11
- import { store as coreStore } from '@wordpress/core-data';
12
- import { privateApis as editorPrivateApis } from '@wordpress/editor';
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
- import DefaultSidebar from './default-sidebar';
18
- import GlobalStylesSidebar from './global-styles-sidebar';
19
- import SettingsHeader from './settings-header';
20
- import PagePanels from './page-panels';
21
- import TemplatePanel from './template-panel';
22
- import { store as editSiteStore } from '../../store';
23
- import { unlock } from '../../lock-unlock';
24
- const {
25
- Tabs
26
- } = unlock(componentsPrivateApis);
27
- const {
28
- interfaceStore,
29
- useAutoSwitchEditorSidebars
30
- } = unlock(editorPrivateApis);
31
- const {
32
- Slot: InspectorSlot,
33
- Fill: InspectorFill
34
- } = createSlotFill('EditSiteSidebarInspector');
35
- export const SidebarInspectorFill = InspectorFill;
36
- const FillContents = ({
37
- tabName,
38
- isEditingPage,
39
- supportsGlobalStyles
40
- }) => {
41
- const tabListRef = useRef(null);
42
- // Because `DefaultSidebar` renders a `ComplementaryArea`, we
43
- // need to forward the `Tabs` context so it can be passed through the
44
- // underlying slot/fill.
45
- const tabsContextValue = useContext(Tabs.Context);
46
-
47
- // This effect addresses a race condition caused by tabbing from the last
48
- // block in the editor into the settings sidebar. Without this effect, the
49
- // selected tab and browser focus can become separated in an unexpected way.
50
- // (e.g the "block" tab is focused, but the "post" tab is selected).
51
- useEffect(() => {
52
- const tabsElements = Array.from(tabListRef.current?.querySelectorAll('[role="tab"]') || []);
53
- const selectedTabElement = tabsElements.find(
54
- // We are purposefully using a custom `data-tab-id` attribute here
55
- // because we don't want rely on any assumptions about `Tabs`
56
- // component internals.
57
- element => element.getAttribute('data-tab-id') === tabName);
58
- const activeElement = selectedTabElement?.ownerDocument.activeElement;
59
- const tabsHasFocus = tabsElements.some(element => {
60
- return activeElement && activeElement.id === element.id;
61
- });
62
- if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
63
- selectedTabElement?.focus();
64
- }
65
- }, [tabName]);
66
- return createElement(Fragment, null, createElement(DefaultSidebar, {
67
- identifier: tabName,
68
- title: __('Settings'),
69
- icon: isRTL() ? drawerLeft : drawerRight,
70
- closeLabel: __('Close Settings'),
71
- header: createElement(Tabs.Context.Provider, {
72
- value: tabsContextValue
73
- }, createElement(SettingsHeader, {
74
- ref: tabListRef
75
- })),
76
- headerClassName: "edit-site-sidebar-edit-mode__panel-tabs"
77
- // This classname is added so we can apply a corrective negative
78
- // margin to the panel.
79
- // see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
80
- ,
81
- className: "edit-site-sidebar__panel",
82
- isActiveByDefault: true
83
- }, createElement(Tabs.Context.Provider, {
84
- value: tabsContextValue
85
- }, createElement(Tabs.TabPanel, {
86
- tabId: "edit-post/document",
87
- focusable: false
88
- }, isEditingPage ? createElement(PagePanels, null) : createElement(TemplatePanel, null)), createElement(Tabs.TabPanel, {
89
- tabId: "edit-post/block",
90
- focusable: false
91
- }, createElement(InspectorSlot, {
92
- bubblesVirtually: true
93
- })))), supportsGlobalStyles && createElement(GlobalStylesSidebar, null));
94
- };
95
- export function SidebarComplementaryAreaFills() {
96
- useAutoSwitchEditorSidebars();
97
- const {
98
- tabName,
99
- supportsGlobalStyles,
100
- isEditingPage
101
- } = useSelect(select => {
102
- const sidebar = select(interfaceStore).getActiveComplementaryArea('core');
103
- const _isEditorSidebarOpened = ['edit-post/block', 'edit-post/document'].includes(sidebar);
104
- let _tabName = sidebar;
105
- if (!_isEditorSidebarOpened) {
106
- _tabName = !!select(blockEditorStore).getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
107
- }
108
- return {
109
- tabName: _tabName,
110
- supportsGlobalStyles: select(coreStore).getCurrentTheme()?.is_block_theme,
111
- isEditingPage: select(editSiteStore).isPage()
112
- };
113
- }, []);
114
- const {
115
- enableComplementaryArea
116
- } = useDispatch(interfaceStore);
117
-
118
- // `newSelectedTabId` could technically be falsey if no tab is selected (i.e.
119
- // the initial render) or when we don't want a tab displayed (i.e. the
120
- // sidebar is closed). These cases should both be covered by the `!!` check
121
- // below, so we shouldn't need any additional falsey handling.
122
- const onTabSelect = useCallback(newSelectedTabId => {
123
- if (!!newSelectedTabId) {
124
- enableComplementaryArea('core', newSelectedTabId);
125
- }
126
- }, [enableComplementaryArea]);
127
- return createElement(Tabs, {
128
- selectedTabId: tabName,
129
- onSelect: onTabSelect,
130
- selectOnMove: false
131
- }, createElement(FillContents, {
132
- tabName: tabName,
133
- isEditingPage: isEditingPage,
134
- supportsGlobalStyles: supportsGlobalStyles
135
- }));
136
- }
137
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createSlotFill","privateApis","componentsPrivateApis","isRTL","__","drawerLeft","drawerRight","useCallback","useContext","useEffect","useRef","useSelect","useDispatch","store","blockEditorStore","coreStore","editorPrivateApis","DefaultSidebar","GlobalStylesSidebar","SettingsHeader","PagePanels","TemplatePanel","editSiteStore","unlock","Tabs","interfaceStore","useAutoSwitchEditorSidebars","Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","FillContents","tabName","isEditingPage","supportsGlobalStyles","tabListRef","tabsContextValue","Context","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","createElement","Fragment","identifier","title","icon","closeLabel","header","Provider","value","ref","headerClassName","className","isActiveByDefault","TabPanel","tabId","focusable","bubblesVirtually","SidebarComplementaryAreaFills","select","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","getBlockSelectionStart","getCurrentTheme","is_block_theme","isPage","enableComplementaryArea","onTabSelect","newSelectedTabId","selectedTabId","onSelect","selectOnMove"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateSlotFill,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useCallback, useContext, useEffect, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport SettingsHeader from './settings-header';\nimport PagePanels from './page-panels';\nimport TemplatePanel from './template-panel';\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\nconst { interfaceStore, useAutoSwitchEditorSidebars } =\n\tunlock( editorPrivateApis );\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nconst FillContents = ( { tabName, isEditingPage, supportsGlobalStyles } ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `DefaultSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way.\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ tabName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t\theader={\n\t\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t\t<SettingsHeader ref={ tabListRef } />\n\t\t\t\t\t</Tabs.Context.Provider>\n\t\t\t\t}\n\t\t\t\theaderClassName=\"edit-site-sidebar-edit-mode__panel-tabs\"\n\t\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t\t// margin to the panel.\n\t\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\t\tclassName=\"edit-site-sidebar__panel\"\n\t\t\t\tisActiveByDefault\n\t\t\t>\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\ttabId=\"edit-post/document\"\n\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isEditingPage ? <PagePanels /> : <TemplatePanel /> }\n\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t<Tabs.TabPanel tabId=\"edit-post/block\" focusable={ false }>\n\t\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t</DefaultSidebar>\n\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t</>\n\t);\n};\n\nexport function SidebarComplementaryAreaFills() {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, supportsGlobalStyles, isEditingPage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\t'edit-post/block',\n\t\t\t\t'edit-post/document',\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? 'edit-post/block'\n\t\t\t\t\t: 'edit-post/document';\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tsupportsGlobalStyles:\n\t\t\t\t\tselect( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t\t\tisEditingPage: select( editSiteStore ).isPage(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\t// `newSelectedTabId` could technically be falsey if no tab is selected (i.e.\n\t// the initial render) or when we don't want a tab displayed (i.e. the\n\t// sidebar is closed). These cases should both be covered by the `!!` check\n\t// below, so we shouldn't need any additional falsey handling.\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<FillContents\n\t\t\t\ttabName={ tabName }\n\t\t\t\tisEditingPage={ isEditingPage }\n\t\t\t\tsupportsGlobalStyles={ supportsGlobalStyles }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;AAC1D,SAASC,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AAC/E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASd,WAAW,IAAIe,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASR,KAAK,IAAIS,aAAa,QAAQ,aAA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
- */
5
- import { PanelBody } from '@wordpress/components';
6
- import { __ } from '@wordpress/i18n';
7
- import { useSelect } from '@wordpress/data';
8
- import { store as coreStore } from '@wordpress/core-data';
9
- import { PageAttributesPanel, PluginDocumentSettingPanel, PostDiscussionPanel, PostExcerptPanel, PostLastRevisionPanel, PostTaxonomiesPanel, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
10
- import { privateApis as routerPrivateApis } from '@wordpress/router';
11
- import { useCallback } from '@wordpress/element';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
- import { store as editSiteStore } from '../../../store';
17
- import PageContent from './page-content';
18
- import PageSummary from './page-summary';
19
- import { unlock } from '../../../lock-unlock';
20
- const {
21
- PostCardPanel,
22
- PostActions
23
- } = unlock(editorPrivateApis);
24
- const {
25
- useHistory
26
- } = unlock(routerPrivateApis);
27
- export default function PagePanels() {
28
- const {
29
- id,
30
- type,
31
- hasResolved,
32
- status,
33
- date,
34
- password,
35
- renderingMode
36
- } = useSelect(select => {
37
- const {
38
- getEditedPostContext
39
- } = select(editSiteStore);
40
- const {
41
- getEditedEntityRecord,
42
- hasFinishedResolution
43
- } = select(coreStore);
44
- const {
45
- getRenderingMode
46
- } = select(editorStore);
47
- const context = getEditedPostContext();
48
- const queryArgs = ['postType', context.postType, context.postId];
49
- const page = getEditedEntityRecord(...queryArgs);
50
- return {
51
- hasResolved: hasFinishedResolution('getEditedEntityRecord', queryArgs),
52
- id: page?.id,
53
- type: page?.type,
54
- status: page?.status,
55
- date: page?.date,
56
- password: page?.password,
57
- renderingMode: getRenderingMode()
58
- };
59
- }, []);
60
- const history = useHistory();
61
- const onActionPerformed = useCallback((actionId, items) => {
62
- if (actionId === 'move-to-trash') {
63
- history.push({
64
- path: '/' + items[0].type,
65
- postId: undefined,
66
- postType: undefined,
67
- canvas: 'view'
68
- });
69
- }
70
- }, [history]);
71
- if (!hasResolved) {
72
- return null;
73
- }
74
- return createElement(Fragment, null, createElement(PostCardPanel, {
75
- actions: createElement(PostActions, {
76
- onActionPerformed: onActionPerformed
77
- })
78
- }), createElement(PanelBody, {
79
- title: __('Summary')
80
- }, createElement(PageSummary, {
81
- status: status,
82
- date: date,
83
- password: password,
84
- postId: id,
85
- postType: type
86
- })), createElement(PluginDocumentSettingPanel.Slot, null), renderingMode !== 'post-only' && createElement(PanelBody, {
87
- title: __('Content')
88
- }, createElement(PageContent, null)), createElement(PostLastRevisionPanel, null), createElement(PostTaxonomiesPanel, null), createElement(PostExcerptPanel, null), createElement(PostDiscussionPanel, null), createElement(PageAttributesPanel, null));
89
- }
90
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["PanelBody","__","useSelect","store","coreStore","PageAttributesPanel","PluginDocumentSettingPanel","PostDiscussionPanel","PostExcerptPanel","PostLastRevisionPanel","PostTaxonomiesPanel","editorStore","privateApis","editorPrivateApis","routerPrivateApis","useCallback","editSiteStore","PageContent","PageSummary","unlock","PostCardPanel","PostActions","useHistory","PagePanels","id","type","hasResolved","status","date","password","renderingMode","select","getEditedPostContext","getEditedEntityRecord","hasFinishedResolution","getRenderingMode","context","queryArgs","postType","postId","page","history","onActionPerformed","actionId","items","push","path","undefined","canvas","createElement","Fragment","actions","title","Slot"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tPageAttributesPanel,\n\tPluginDocumentSettingPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport PageContent from './page-content';\nimport PageSummary from './page-summary';\n\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostCardPanel, PostActions } = unlock( editorPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function PagePanels() {\n\tconst { id, type, hasResolved, status, date, password, renderingMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getEditedPostContext } = select( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getRenderingMode } = select( editorStore );\n\t\t\tconst context = getEditedPostContext();\n\t\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\t\treturn {\n\t\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\tid: page?.id,\n\t\t\t\ttype: page?.type,\n\t\t\t\tstatus: page?.status,\n\t\t\t\tdate: page?.date,\n\t\t\t\tpassword: page?.password,\n\t\t\t\trenderingMode: getRenderingMode(),\n\t\t\t};\n\t\t}, [] );\n\n\tconst history = useHistory();\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tif ( actionId === 'move-to-trash' ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath: '/' + items[ 0 ].type,\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t\tpostType: undefined,\n\t\t\t\t\tcanvas: 'view',\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history ]\n\t);\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PostCardPanel\n\t\t\t\tactions={\n\t\t\t\t\t<PostActions onActionPerformed={ onActionPerformed } />\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<PanelBody title={ __( 'Summary' ) }>\n\t\t\t\t<PageSummary\n\t\t\t\t\tstatus={ status }\n\t\t\t\t\tdate={ date }\n\t\t\t\t\tpassword={ password }\n\t\t\t\t\tpostId={ id }\n\t\t\t\t\tpostType={ type }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t{ renderingMode !== 'post-only' && (\n\t\t\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t\t\t<PageContent />\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t\t<PostLastRevisionPanel />\n\t\t\t<PostTaxonomiesPanel />\n\t\t\t<PostExcerptPanel />\n\t\t\t<PostDiscussionPanel />\n\t\t\t<PageAttributesPanel />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;AACjD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,mBAAmB,EACnBC,0BAA0B,EAC1BC,mBAAmB,EACnBC,gBAAgB,EAChBC,qBAAqB,EACrBC,mBAAmB,EACnBP,KAAK,IAAIQ,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,SAASZ,KAAK,IAAIa,aAAa,QAAQ,gBAAgB;AACvD,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,WAAW,MAAM,gBAAgB;AAExC,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC,aAAa;EAAEC;AAAY,CAAC,GAAGF,MAAM,CAAEN,iBAAkB,CAAC;AAClE,MAAM;EAAES;AAAW,CAAC,GAAGH,MAAM,CAAEL,iBAAkB,CAAC;AAElD,eAAe,SAASS,UAAUA,CAAA,EAAG;EACpC,MAAM;IAAEC,EAAE;IAAEC,IAAI;IAAEC,W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EACD,CAAC,EACD,CAAEP,OAAO,CACV,CAAC;EAED,IAAK,CAAEf,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OACCuB,aAAA,CAAAC,QAAA,QACCD,aAAA,CAAC7B,aAAa;IACb+B,OAAO,EACNF,aAAA,CAAC5B,WAAW;MAACqB,iBAAiB,EAAGA;IAAmB,CAAE;EACtD,CACD,CAAC,EACFO,aAAA,CAACjD,SAAS;IAACoD,KAAK,EAAGnD,EAAE,CAAE,SAAU;EAAG,GACnCgD,aAAA,CAAC/B,WAAW;IACXS,MAAM,EAAGA,MAAQ;IACjBC,IAAI,EAAGA,IAAM;IACbC,QAAQ,EAAGA,QAAU;IACrBU,MAAM,EAAGf,EAAI;IACbc,QAAQ,EAAGb;EAAM,CACjB,CACS,CAAC,EACZwB,aAAA,CAAC3C,0BAA0B,CAAC+C,IAAI,MAAE,CAAC,EACjCvB,aAAa,KAAK,WAAW,IAC9BmB,aAAA,CAACjD,SAAS;IAACoD,KAAK,EAAGnD,EAAE,CAAE,SAAU;EAAG,GACnCgD,aAAA,CAAChC,WAAW,MAAE,CACJ,CACX,EACDgC,aAAA,CAACxC,qBAAqB,MAAE,CAAC,EACzBwC,aAAA,CAACvC,mBAAmB,MAAE,CAAC,EACvBuC,aAAA,CAACzC,gBAAgB,MAAE,CAAC,EACpByC,aAAA,CAAC1C,mBAAmB,MAAE,CAAC,EACvB0C,aAAA,CAAC5C,mBAAmB,MAAE,CACrB,CAAC;AAEL","ignoreList":[]}
@@ -1,27 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { useSelect } from '@wordpress/data';
6
- import { store as blockEditorStore, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- import { unlock } from '../../../lock-unlock';
12
- const {
13
- BlockQuickNavigation
14
- } = unlock(blockEditorPrivateApis);
15
- const PAGE_CONTENT_BLOCKS = ['core/post-content', 'core/post-featured-image', 'core/post-title'];
16
- export default function PageContent() {
17
- const clientIds = useSelect(select => {
18
- const {
19
- getBlocksByName
20
- } = select(blockEditorStore);
21
- return getBlocksByName(PAGE_CONTENT_BLOCKS);
22
- }, []);
23
- return createElement(BlockQuickNavigation, {
24
- clientIds: clientIds
25
- });
26
- }
27
- //# sourceMappingURL=page-content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useSelect","store","blockEditorStore","privateApis","blockEditorPrivateApis","unlock","BlockQuickNavigation","PAGE_CONTENT_BLOCKS","PageContent","clientIds","select","getBlocksByName","createElement"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nconst PAGE_CONTENT_BLOCKS = [\n\t'core/post-content',\n\t'core/post-featured-image',\n\t'core/post-title',\n];\n\nexport default function PageContent() {\n\tconst clientIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName } = select( blockEditorStore );\n\t\treturn getBlocksByName( PAGE_CONTENT_BLOCKS );\n\t}, [] );\n\treturn <BlockQuickNavigation clientIds={ clientIds } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;;AAEhC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC;AAAqB,CAAC,GAAGD,MAAM,CAAED,sBAAuB,CAAC;AAEjE,MAAMG,mBAAmB,GAAG,CAC3B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,CACjB;AAED,eAAe,SAASC,WAAWA,CAAA,EAAG;EACrC,MAAMC,SAAS,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAC1C,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAER,gBAAiB,CAAC;IACtD,OAAOS,eAAe,CAAEJ,mBAAoB,CAAC;EAC9C,CAAC,EAAE,EAAG,CAAC;EACP,OAAOK,aAAA,CAACN,oBAAoB;IAACG,SAAS,EAAGA;EAAW,CAAE,CAAC;AACxD","ignoreList":[]}