@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 +0,0 @@
1
- {"version":3,"names":["_keyboardShortcuts","require","_data","_blockEditor","_blocks","KeyboardShortcutsEditMode","replaceBlocks","useDispatch","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","useSelect","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","createBlock","content","useShortcut","forEach","_default","exports","default"],"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":";;;;;;AAGA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA,SAASI,yBAAyBA,CAAA,EAAG;EACpC,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEC,kBAAiB,CAAC;EACzD,MAAM;IAAEC,YAAY;IAAEC,wBAAwB;IAAEC;EAAmB,CAAC,GACnE,IAAAC,eAAS,EAAEJ,kBAAiB,CAAC;EAE9B,MAAMK,uBAAuB,GAAGA,CAAEC,KAAK,EAAEC,KAAK,KAAM;IACnDD,KAAK,CAACE,cAAc,CAAC,CAAC;IACtB,MAAMC,oBAAoB,GACzBF,KAAK,KAAK,CAAC,GAAG,gBAAgB,GAAG,cAAc;IAChD,MAAMG,eAAe,GAAGR,wBAAwB,CAAC,CAAC;IAClD,IAAKQ,eAAe,KAAK,IAAI,EAAG;MAC/B;IACD;IACA,MAAMC,SAAS,GAAGV,YAAY,CAAES,eAAgB,CAAC;IACjD,IAAKC,SAAS,KAAK,gBAAgB,IAAIA,SAAS,KAAK,cAAc,EAAG;MACrE;IACD;IACA,MAAMC,UAAU,GAAGT,kBAAkB,CAAEO,eAAgB,CAAC;IACxD,MAAMG,SAAS,GACdF,SAAS,KAAK,gBAAgB,GAAG,OAAO,GAAG,WAAW;IACvD,MAAMG,oBAAoB,GACzBL,oBAAoB,KAAK,gBAAgB,GAAG,OAAO,GAAG,WAAW;IAElEX,aAAa,CACZY,eAAe,EACf,IAAAK,mBAAW,EAAEN,oBAAoB,EAAE;MAClCF,KAAK;MACLS,OAAO,EAAEJ,UAAU,CAACI,OAAO;MAC3B,GAAG;QAAE,CAAEF,oBAAoB,GAAIF,UAAU,CAAEC,SAAS;MAAG;IACxD,CAAE,CACH,CAAC;EACF,CAAC;EAED,IAAAI,8BAAW,EAAE,+CAA+C,EAAIX,KAAK,IACpED,uBAAuB,CAAEC,KAAK,EAAE,CAAE,CACnC,CAAC;EAED,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACY,OAAO,CAAIX,KAAK,IAAM;IAC1C;IACA;IACA;IACA,IAAAU,8BAAW,EACT,iDAAiDV,KAAO,EAAC,EACxDD,KAAK,IAAMD,uBAAuB,CAAEC,KAAK,EAAEC,KAAM,CACpD,CAAC;EACF,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcxB,yBAAyB","ignoreList":[]}
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = require("react");
9
- var _router = require("@wordpress/router");
10
- var _data = require("@wordpress/data");
11
- var _coreData = require("@wordpress/core-data");
12
- var _element = require("@wordpress/element");
13
- var _components = require("@wordpress/components");
14
- var _lockUnlock = require("../../lock-unlock");
15
- var _store = require("../../store");
16
- var _createTemplatePartModal = _interopRequireDefault(require("../create-template-part-modal"));
17
- var _constants = require("../../utils/constants");
18
- /**
19
- * WordPress dependencies
20
- */
21
-
22
- /**
23
- * Internal dependencies
24
- */
25
-
26
- const {
27
- useHistory
28
- } = (0, _lockUnlock.unlock)(_router.privateApis);
29
- function AddNewTemplatePart() {
30
- const {
31
- canCreate,
32
- postType
33
- } = (0, _data.useSelect)(select => {
34
- const {
35
- supportsTemplatePartsMode
36
- } = select(_store.store).getSettings();
37
- return {
38
- canCreate: !supportsTemplatePartsMode,
39
- postType: select(_coreData.store).getPostType(_constants.TEMPLATE_PART_POST_TYPE)
40
- };
41
- }, []);
42
- const [isModalOpen, setIsModalOpen] = (0, _element.useState)(false);
43
- const history = useHistory();
44
- if (!canCreate || !postType) {
45
- return null;
46
- }
47
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.Button, {
48
- variant: "primary",
49
- onClick: () => setIsModalOpen(true)
50
- }, postType.labels.add_new_item), isModalOpen && (0, _react.createElement)(_createTemplatePartModal.default, {
51
- closeModal: () => setIsModalOpen(false),
52
- blocks: [],
53
- onCreate: templatePart => {
54
- setIsModalOpen(false);
55
- history.push({
56
- postId: templatePart.id,
57
- postType: _constants.TEMPLATE_PART_POST_TYPE,
58
- canvas: 'edit'
59
- });
60
- },
61
- onError: () => setIsModalOpen(false)
62
- }));
63
- }
64
- var _default = exports.default = (0, _element.memo)(AddNewTemplatePart);
65
- //# sourceMappingURL=add-new-template-part.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_router","require","_data","_coreData","_element","_components","_lockUnlock","_store","_createTemplatePartModal","_interopRequireDefault","_constants","useHistory","unlock","routerPrivateApis","AddNewTemplatePart","canCreate","postType","useSelect","select","supportsTemplatePartsMode","editSiteStore","getSettings","coreStore","getPostType","TEMPLATE_PART_POST_TYPE","isModalOpen","setIsModalOpen","useState","history","_react","createElement","Fragment","Button","variant","onClick","labels","add_new_item","default","closeModal","blocks","onCreate","templatePart","push","postId","id","canvas","onError","_default","exports","memo"],"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":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;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MACvBE,OAAO,CAACc,IAAI,CAAE;QACbC,MAAM,EAAEF,YAAY,CAACG,EAAE;QACvB5B,QAAQ,EAAEQ,kCAAuB;QACjCqB,MAAM,EAAE;MACT,CAAE,CAAC;IACJ,CAAG;IACHC,OAAO,EAAGA,CAAA,KAAMpB,cAAc,CAAE,KAAM;EAAG,CACzC,CAED,CAAC;AAEL;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAX,OAAA,GAEc,IAAAY,aAAI,EAAEnC,kBAAmB,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_coreData","require","_data","_icons","_constants","useAddedBy","postType","postId","useSelect","select","getEntityRecord","getMedia","getUser","getEditedEntityRecord","coreStore","template","originalSource","original_source","authorText","author_text","type","icon","themeIcon","text","isCustomized","source","TEMPLATE_ORIGINS","custom","pluginIcon","siteData","globeIcon","imageUrl","site_logo","source_url","undefined","user","author","authorIcon","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":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAUA,IAAAG,UAAA,GAAAH,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,UAAUA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC9C,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MACLC,eAAe;MACfC,QAAQ;MACRC,OAAO;MACPC;IACD,CAAC,GAAGJ,MAAM,CAAEK,eAAU,CAAC;IACvB,MAAMC,QAAQ,GAAGF,qBAAqB,CACrC,UAAU,EACVP,QAAQ,EACRC,MACD,CAAC;IACD,MAAMS,cAAc,GAAGD,QAAQ,EAAEE,eAAe;IAChD,MAAMC,UAAU,GAAGH,QAAQ,EAAEI,WAAW;IAExC,QAASH,cAAc;MACtB,KAAK,OAAO;QAAE;UACb,OAAO;YACNI,IAAI,EAAEJ,cAAc;YACpBK,IAAI,EAAEC,aAAS;YACfC,IAAI,EAAEL,UAAU;YAChBM,YAAY,EACXT,QAAQ,CAACU,MAAM,KAAKC,2BAAgB,CAACC;UACvC,CAAC;QACF;MACA,KAAK,QAAQ;QAAE;UACd,OAAO;YACNP,IAAI,EAAEJ,cAAc;YACpBK,IAAI,EAAEO,cAAU;YAChBL,IAAI,EAAEL,UAAU;YAChBM,YAAY,EACXT,QAAQ,CAACU,MAAM,KAAKC,2BAAgB,CAACC;UACvC,CAAC;QACF;MACA,KAAK,MAAM;QAAE;UACZ,MAAME,QAAQ,GAAGnB,eAAe,CAC/B,MAAM,EACN,gBACD,CAAC;UACD,OAAO;YACNU,IAAI,EAAEJ,cAAc;YACpBK,IAAI,EAAES,YAAS;YACfC,QAAQ,EAAEF,QAAQ,EAAEG,SAAS,GAC1BrB,QAAQ,CAAEkB,QAAQ,CAACG,SAAU,CAAC,EAAEC,UAAU,GAC1CC,SAAS;YACZX,IAAI,EAAEL,UAAU;YAChBM,YAAY,EAAE;UACf,CAAC;QACF;MACA;QAAS;UACR,MAAMW,IAAI,GAAGvB,OAAO,CAAEG,QAAQ,CAACqB,MAAO,CAAC;UACvC,OAAO;YACNhB,IAAI,EAAE,MAAM;YACZC,IAAI,EAAEgB,0BAAU;YAChBN,QAAQ,EAAEI,IAAI,EAAEG,WAAW,GAAI,EAAE,CAAE;YACnCf,IAAI,EAAEL,UAAU;YAChBM,YAAY,EAAE;UACf,CAAC;QACF;IACD;EACD,CAAC,EACD,CAAElB,QAAQ,EAAEC,MAAM,CACnB,CAAC;AACF","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_i18n","_element","_coreData","_htmlEntities","_blocks","_blockEditor","_dataviews","_router","_editor","_async","_page","_link","_interopRequireWildcard","_addNewTemplate","_hooks","_constants","_usePatternSettings","_lockUnlock","_addNewTemplatePart","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","usePostActions","unlock","editorPrivateApis","ExperimentalBlockEditorProvider","useGlobalStyle","blockEditorPrivateApis","useHistory","useLocation","routerPrivateApis","EMPTY_ARRAY","defaultConfigPerViewType","LAYOUT_TABLE","primaryField","LAYOUT_GRID","mediaField","columnFields","LAYOUT_LIST","DEFAULT_VIEW","type","search","page","perPage","sort","field","direction","hiddenFields","layout","filters","Title","item","viewType","decodeEntities","title","rendered","__","linkProps","params","postId","id","postType","canvas","_react","createElement","AuthorField","isImageLoaded","setIsImageLoaded","useState","text","icon","imageUrl","useAddedBy","withIcon","__experimentalHStack","alignment","spacing","className","classnames","onLoad","alt","src","Icon","Preview","settings","usePatternSettings","backgroundColor","blocks","useMemo","parse","content","raw","onClick","useLink","isEmpty","length","style","Async","BlockPreview","TEMPLATE_POST_TYPE","TEMPLATE_ACTIONS","PageTemplatesTemplateParts","activeView","defaultView","usedType","operator","value","view","setView","useEffect","currentView","OPERATOR_IS_ANY","records","isResolving","isLoadingData","useEntityRecords","per_page","history","onSelectionChange","useCallback","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","__experimentalText","variant","VisuallyHidden","ENUMERATION_TYPE","elements","width","data","paginationInfo","filterSortAndPaginate","onActionPerformed","actionId","post","actions","onChangeView","newView","DataViews","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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAIA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAKA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,KAAA,GAAAC,uBAAA,CAAAd,OAAA;AACA,IAAAe,eAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AACA,IAAAiB,UAAA,GAAAjB,OAAA;AASA,IAAAkB,mBAAA,GAAAnB,sBAAA,CAAAC,OAAA;AACA,IAAAmB,WAAA,GAAAnB,OAAA;AACA,IAAAoB,mBAAA,GAAArB,sBAAA,CAAAC,OAAA;AAAyD,SAAAqB,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAA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,QAAE,EAAE,gBAAiB,CACxB;IACDuG,OAAO,EACNlG,QAAQ,KAAKsC,6BAAkB,GAC9B,IAAApC,MAAA,CAAAC,aAAA,EAACpE,eAAA,CAAAY,OAAc,MAAE,CAAC,GAElB,IAAAuD,MAAA,CAAAC,aAAA,EAAC/D,mBAAA,CAAAO,OAAkB,MAAE;EAEtB,GAED,IAAAuD,MAAA,CAAAC,aAAA,EAAC3E,UAAA,CAAA6K,SAAS;IACTR,cAAc,EAAGA,cAAgB;IACjCnB,MAAM,EAAGA,MAAQ;IACjBwB,OAAO,EAAGA,OAAS;IACnBN,IAAI,EAAGA,IAAM;IACbU,SAAS,EAAGjD,aAAe;IAC3BP,IAAI,EAAGA,IAAM;IACbqD,YAAY,EAAGA,YAAc;IAC7B1C,iBAAiB,EAAGA;EAAmB,CACvC,CACI,CAAC;AAET","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_editor","require","_lockUnlock","ComplementaryArea","ComplementaryAreaMoreMenuItem","unlock","editorPrivateApis","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","isActiveByDefault","_react","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":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EAAEE,iBAAiB;EAAEC;AAA8B,CAAC,GACzD,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEb,SAASC,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,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAAChB,iBAAiB;IACjBK,SAAS,EAAGA,SAAW;IACvBa,KAAK,EAAC,MAAM;IACZZ,UAAU,EAAGA,UAAY;IACzBC,KAAK,EAAGA,KAAO;IACfY,gBAAgB,EAAGZ,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,EACpB,IAAAM,MAAA,CAAAC,aAAA,EAACf,6BAA6B;IAC7BiB,KAAK,EAAC,MAAM;IACZZ,UAAU,EAAGA,UAAY;IACzBE,IAAI,EAAGA;EAAM,GAEXD,KAC4B,CAC9B,CAAC;AAEL","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_preferences","_editor","_defaultSidebar","_interopRequireDefault","_globalStyles","_store","_ui","_lockUnlock","_coreData","interfaceStore","unlock","editorPrivateApis","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","useSelect","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","editSiteStore","canvasContainerView","_isVisualEditorMode","editorStore","getEditorMode","_isEditCanvasMode","_showListViewByDefault","preferencesStore","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","useDispatch","useEffect","setIsListViewOpened","goTo","useNavigator","toggleRevisions","toggleStyleBook","_react","createElement","default","className","identifier","title","__","icon","styles","closeLabel","panelClassName","header","Flex","FlexBlock","style","minWidth","FlexItem","Button","seen","label","isPressed","disabled","onClick","backup","GlobalStylesMenuSlot","GlobalStylesUI"],"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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OA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MACDoD,QAAQ,EAAGzD,8BAAgC;MAC3C0D,OAAO,EAAGvB;IAAiB,CAC3B,CACQ,CAAC,EACX,IAAAC,MAAA,CAAAC,aAAA,EAACxD,WAAA,CAAAuE,QAAQ,QACR,IAAAhB,MAAA,CAAAC,aAAA,EAACxD,WAAA,CAAAwE,MAAM;MACNE,KAAK,EAAG,IAAAb,QAAE,EAAE,WAAY,CAAG;MAC3BC,IAAI,EAAGgB,aAAQ;MACfD,OAAO,EAAGxB,eAAiB;MAC3BuB,QAAQ,EAAG,CAAEtD,YAAc;MAC3BqD,SAAS,EACRpD,iBAAiB,IAAIC;IACrB,CACD,CACQ,CAAC,EACX,IAAA+B,MAAA,CAAAC,aAAA,EAAC5C,GAAA,CAAAmE,oBAAoB,MAAE,CAClB;EACN,GAED,IAAAxB,MAAA,CAAAC,aAAA,EAAC9C,aAAA,CAAAsE,cAAc,MAAE,CACF,CAAC;AAEnB","ignoreList":[]}
@@ -1,146 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.SidebarComplementaryAreaFills = SidebarComplementaryAreaFills;
8
- exports.SidebarInspectorFill = void 0;
9
- var _react = require("react");
10
- var _components = require("@wordpress/components");
11
- var _i18n = require("@wordpress/i18n");
12
- var _icons = require("@wordpress/icons");
13
- var _element = require("@wordpress/element");
14
- var _data = require("@wordpress/data");
15
- var _blockEditor = require("@wordpress/block-editor");
16
- var _coreData = require("@wordpress/core-data");
17
- var _editor = require("@wordpress/editor");
18
- var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
19
- var _globalStylesSidebar = _interopRequireDefault(require("./global-styles-sidebar"));
20
- var _settingsHeader = _interopRequireDefault(require("./settings-header"));
21
- var _pagePanels = _interopRequireDefault(require("./page-panels"));
22
- var _templatePanel = _interopRequireDefault(require("./template-panel"));
23
- var _store = require("../../store");
24
- var _lockUnlock = require("../../lock-unlock");
25
- /**
26
- * WordPress dependencies
27
- */
28
-
29
- /**
30
- * Internal dependencies
31
- */
32
-
33
- const {
34
- Tabs
35
- } = (0, _lockUnlock.unlock)(_components.privateApis);
36
- const {
37
- interfaceStore,
38
- useAutoSwitchEditorSidebars
39
- } = (0, _lockUnlock.unlock)(_editor.privateApis);
40
- const {
41
- Slot: InspectorSlot,
42
- Fill: InspectorFill
43
- } = (0, _components.createSlotFill)('EditSiteSidebarInspector');
44
- const SidebarInspectorFill = exports.SidebarInspectorFill = InspectorFill;
45
- const FillContents = ({
46
- tabName,
47
- isEditingPage,
48
- supportsGlobalStyles
49
- }) => {
50
- const tabListRef = (0, _element.useRef)(null);
51
- // Because `DefaultSidebar` renders a `ComplementaryArea`, we
52
- // need to forward the `Tabs` context so it can be passed through the
53
- // underlying slot/fill.
54
- const tabsContextValue = (0, _element.useContext)(Tabs.Context);
55
-
56
- // This effect addresses a race condition caused by tabbing from the last
57
- // block in the editor into the settings sidebar. Without this effect, the
58
- // selected tab and browser focus can become separated in an unexpected way.
59
- // (e.g the "block" tab is focused, but the "post" tab is selected).
60
- (0, _element.useEffect)(() => {
61
- const tabsElements = Array.from(tabListRef.current?.querySelectorAll('[role="tab"]') || []);
62
- const selectedTabElement = tabsElements.find(
63
- // We are purposefully using a custom `data-tab-id` attribute here
64
- // because we don't want rely on any assumptions about `Tabs`
65
- // component internals.
66
- element => element.getAttribute('data-tab-id') === tabName);
67
- const activeElement = selectedTabElement?.ownerDocument.activeElement;
68
- const tabsHasFocus = tabsElements.some(element => {
69
- return activeElement && activeElement.id === element.id;
70
- });
71
- if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
72
- selectedTabElement?.focus();
73
- }
74
- }, [tabName]);
75
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_defaultSidebar.default, {
76
- identifier: tabName,
77
- title: (0, _i18n.__)('Settings'),
78
- icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
79
- closeLabel: (0, _i18n.__)('Close Settings'),
80
- header: (0, _react.createElement)(Tabs.Context.Provider, {
81
- value: tabsContextValue
82
- }, (0, _react.createElement)(_settingsHeader.default, {
83
- ref: tabListRef
84
- })),
85
- headerClassName: "edit-site-sidebar-edit-mode__panel-tabs"
86
- // This classname is added so we can apply a corrective negative
87
- // margin to the panel.
88
- // see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
89
- ,
90
- className: "edit-site-sidebar__panel",
91
- isActiveByDefault: true
92
- }, (0, _react.createElement)(Tabs.Context.Provider, {
93
- value: tabsContextValue
94
- }, (0, _react.createElement)(Tabs.TabPanel, {
95
- tabId: "edit-post/document",
96
- focusable: false
97
- }, isEditingPage ? (0, _react.createElement)(_pagePanels.default, null) : (0, _react.createElement)(_templatePanel.default, null)), (0, _react.createElement)(Tabs.TabPanel, {
98
- tabId: "edit-post/block",
99
- focusable: false
100
- }, (0, _react.createElement)(InspectorSlot, {
101
- bubblesVirtually: true
102
- })))), supportsGlobalStyles && (0, _react.createElement)(_globalStylesSidebar.default, null));
103
- };
104
- function SidebarComplementaryAreaFills() {
105
- useAutoSwitchEditorSidebars();
106
- const {
107
- tabName,
108
- supportsGlobalStyles,
109
- isEditingPage
110
- } = (0, _data.useSelect)(select => {
111
- const sidebar = select(interfaceStore).getActiveComplementaryArea('core');
112
- const _isEditorSidebarOpened = ['edit-post/block', 'edit-post/document'].includes(sidebar);
113
- let _tabName = sidebar;
114
- if (!_isEditorSidebarOpened) {
115
- _tabName = !!select(_blockEditor.store).getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
116
- }
117
- return {
118
- tabName: _tabName,
119
- supportsGlobalStyles: select(_coreData.store).getCurrentTheme()?.is_block_theme,
120
- isEditingPage: select(_store.store).isPage()
121
- };
122
- }, []);
123
- const {
124
- enableComplementaryArea
125
- } = (0, _data.useDispatch)(interfaceStore);
126
-
127
- // `newSelectedTabId` could technically be falsey if no tab is selected (i.e.
128
- // the initial render) or when we don't want a tab displayed (i.e. the
129
- // sidebar is closed). These cases should both be covered by the `!!` check
130
- // below, so we shouldn't need any additional falsey handling.
131
- const onTabSelect = (0, _element.useCallback)(newSelectedTabId => {
132
- if (!!newSelectedTabId) {
133
- enableComplementaryArea('core', newSelectedTabId);
134
- }
135
- }, [enableComplementaryArea]);
136
- return (0, _react.createElement)(Tabs, {
137
- selectedTabId: tabName,
138
- onSelect: onTabSelect,
139
- selectOnMove: false
140
- }, (0, _react.createElement)(FillContents, {
141
- tabName: tabName,
142
- isEditingPage: isEditingPage,
143
- supportsGlobalStyles: supportsGlobalStyles
144
- }));
145
- }
146
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_i18n","_icons","_element","_data","_blockEditor","_coreData","_editor","_defaultSidebar","_interopRequireDefault","_globalStylesSidebar","_settingsHeader","_pagePanels","_templatePanel","_store","_lockUnlock","Tabs","unlock","componentsPrivateApis","interfaceStore","useAutoSwitchEditorSidebars","editorPrivateApis","Slot","InspectorSlot","Fill","InspectorFill","createSlotFill","SidebarInspectorFill","exports","FillContents","tabName","isEditingPage","supportsGlobalStyles","tabListRef","useRef","tabsContextValue","useContext","Context","useEffect","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","_react","createElement","Fragment","default","identifier","title","__","icon","isRTL","drawerLeft","drawerRight","closeLabel","header","Provider","value","ref","headerClassName","className","isActiveByDefault","TabPanel","tabId","focusable","bubblesVirtually","SidebarComplementaryAreaFills","useSelect","select","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","blockEditorStore","getBlockSelectionStart","coreStore","getCurrentTheme","is_block_theme","editSiteStore","isPage","enableComplementaryArea","useDispatch","onTabSelect","useCallback","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\tsupportsGlobalSt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sBAAsB,EAAG;MAC/BE,QAAQ,GAAG,CAAC,CAAEL,MAAM,CACnBM,kBACD,CAAC,CAACC,sBAAsB,CAAC,CAAC,GACvB,iBAAiB,GACjB,oBAAoB;IACxB;IAEA,OAAO;MACNxD,OAAO,EAAEsD,QAAQ;MACjBpD,oBAAoB,EACnB+C,MAAM,CAAEQ,eAAU,CAAC,CAACC,eAAe,CAAC,CAAC,EAAEC,cAAc;MACtD1D,aAAa,EAAEgD,MAAM,CAAEW,YAAc,CAAC,CAACC,MAAM,CAAC;IAC/C,CAAC;EACF,CAAC,EACD,EACD,CAAC;EACD,MAAM;IAAEC;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAE1E,cAAe,CAAC;;EAEjE;EACA;EACA;EACA;EACA,MAAM2E,WAAW,GAAG,IAAAC,oBAAW,EAC5BC,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BJ,uBAAuB,CAAE,MAAM,EAAEI,gBAAiB,CAAC;IACpD;EACD,CAAC,EACD,CAAEJ,uBAAuB,CAC1B,CAAC;EAED,OACC,IAAAtC,MAAA,CAAAC,aAAA,EAACvC,IAAI;IACJiF,aAAa,EAAGnE,OAAS;IACzBoE,QAAQ,EAAGJ,WAAa;IACxBK,YAAY,EAAG;EAAO,GAEtB,IAAA7C,MAAA,CAAAC,aAAA,EAAC1B,YAAY;IACZC,OAAO,EAAGA,OAAS;IACnBC,aAAa,EAAGA,aAAe;IAC/BC,oBAAoB,EAAGA;EAAsB,CAC7C,CACI,CAAC;AAET","ignoreList":[]}
@@ -1,98 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = PagePanels;
8
- var _react = require("react");
9
- var _components = require("@wordpress/components");
10
- var _i18n = require("@wordpress/i18n");
11
- var _data = require("@wordpress/data");
12
- var _coreData = require("@wordpress/core-data");
13
- var _editor = require("@wordpress/editor");
14
- var _router = require("@wordpress/router");
15
- var _element = require("@wordpress/element");
16
- var _store = require("../../../store");
17
- var _pageContent = _interopRequireDefault(require("./page-content"));
18
- var _pageSummary = _interopRequireDefault(require("./page-summary"));
19
- var _lockUnlock = require("../../../lock-unlock");
20
- /**
21
- * WordPress dependencies
22
- */
23
-
24
- /**
25
- * Internal dependencies
26
- */
27
-
28
- const {
29
- PostCardPanel,
30
- PostActions
31
- } = (0, _lockUnlock.unlock)(_editor.privateApis);
32
- const {
33
- useHistory
34
- } = (0, _lockUnlock.unlock)(_router.privateApis);
35
- function PagePanels() {
36
- const {
37
- id,
38
- type,
39
- hasResolved,
40
- status,
41
- date,
42
- password,
43
- renderingMode
44
- } = (0, _data.useSelect)(select => {
45
- const {
46
- getEditedPostContext
47
- } = select(_store.store);
48
- const {
49
- getEditedEntityRecord,
50
- hasFinishedResolution
51
- } = select(_coreData.store);
52
- const {
53
- getRenderingMode
54
- } = select(_editor.store);
55
- const context = getEditedPostContext();
56
- const queryArgs = ['postType', context.postType, context.postId];
57
- const page = getEditedEntityRecord(...queryArgs);
58
- return {
59
- hasResolved: hasFinishedResolution('getEditedEntityRecord', queryArgs),
60
- id: page?.id,
61
- type: page?.type,
62
- status: page?.status,
63
- date: page?.date,
64
- password: page?.password,
65
- renderingMode: getRenderingMode()
66
- };
67
- }, []);
68
- const history = useHistory();
69
- const onActionPerformed = (0, _element.useCallback)((actionId, items) => {
70
- if (actionId === 'move-to-trash') {
71
- history.push({
72
- path: '/' + items[0].type,
73
- postId: undefined,
74
- postType: undefined,
75
- canvas: 'view'
76
- });
77
- }
78
- }, [history]);
79
- if (!hasResolved) {
80
- return null;
81
- }
82
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(PostCardPanel, {
83
- actions: (0, _react.createElement)(PostActions, {
84
- onActionPerformed: onActionPerformed
85
- })
86
- }), (0, _react.createElement)(_components.PanelBody, {
87
- title: (0, _i18n.__)('Summary')
88
- }, (0, _react.createElement)(_pageSummary.default, {
89
- status: status,
90
- date: date,
91
- password: password,
92
- postId: id,
93
- postType: type
94
- })), (0, _react.createElement)(_editor.PluginDocumentSettingPanel.Slot, null), renderingMode !== 'post-only' && (0, _react.createElement)(_components.PanelBody, {
95
- title: (0, _i18n.__)('Content')
96
- }, (0, _react.createElement)(_pageContent.default, null)), (0, _react.createElement)(_editor.PostLastRevisionPanel, null), (0, _react.createElement)(_editor.PostTaxonomiesPanel, null), (0, _react.createElement)(_editor.PostExcerptPanel, null), (0, _react.createElement)(_editor.PostDiscussionPanel, null), (0, _react.createElement)(_editor.PageAttributesPanel, null));
97
- }
98
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_i18n","_data","_coreData","_editor","_router","_element","_store","_pageContent","_interopRequireDefault","_pageSummary","_lockUnlock","PostCardPanel","PostActions","unlock","editorPrivateApis","useHistory","routerPrivateApis","PagePanels","id","type","hasResolved","status","date","password","renderingMode","useSelect","select","getEditedPostContext","editSiteStore","getEditedEntityRecord","hasFinishedResolution","coreStore","getRenderingMode","editorStore","context","queryArgs","postType","postId","page","history","onActionPerformed","useCallback","actionId","items","push","path","undefined","canvas","_react","createElement","Fragment","actions","PanelBody","title","__","default","PluginDocumentSettingPanel","Slot","PostLastRevisionPanel","PostTaxonomiesPanel","PostExcerptPanel","PostDiscussionPanel","PageAttributesPanel"],"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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAUA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,YAAA,GAAAD,sBAAA,CAAAT,OAAA;AAEA,IAAAW,WAAA,GAAAX,OAAA;AA3BA;AACA;AACA;;AAkBA;AACA;AACA;;AAOA,MAAM;EAAEY,aAAa;EAAEC;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAClE,MAAM;EAAEC;AAAW,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAEnC,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAM;IAAEC,EAAE;IAAEC,IAAI;IAAEC,WAAW;IAAEC,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC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AAA,EAAC9C,OAAA,CAAA2D,mBAAmB,MAAE,CACrB,CAAC;AAEL","ignoreList":[]}
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = PageContent;
7
- var _react = require("react");
8
- var _data = require("@wordpress/data");
9
- var _blockEditor = require("@wordpress/block-editor");
10
- var _lockUnlock = require("../../../lock-unlock");
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
-
19
- const {
20
- BlockQuickNavigation
21
- } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
22
- const PAGE_CONTENT_BLOCKS = ['core/post-content', 'core/post-featured-image', 'core/post-title'];
23
- function PageContent() {
24
- const clientIds = (0, _data.useSelect)(select => {
25
- const {
26
- getBlocksByName
27
- } = select(_blockEditor.store);
28
- return getBlocksByName(PAGE_CONTENT_BLOCKS);
29
- }, []);
30
- return (0, _react.createElement)(BlockQuickNavigation, {
31
- clientIds: clientIds
32
- });
33
- }
34
- //# sourceMappingURL=page-content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_data","require","_blockEditor","_lockUnlock","BlockQuickNavigation","unlock","blockEditorPrivateApis","PAGE_CONTENT_BLOCKS","PageContent","clientIds","useSelect","select","getBlocksByName","blockEditorStore","_react","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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEG;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,MAAMC,mBAAmB,GAAG,CAC3B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,CACjB;AAEc,SAASC,WAAWA,CAAA,EAAG;EACrC,MAAMC,SAAS,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC1C,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IACtD,OAAOD,eAAe,CAAEL,mBAAoB,CAAC;EAC9C,CAAC,EAAE,EAAG,CAAC;EACP,OAAO,IAAAO,MAAA,CAAAC,aAAA,EAACX,oBAAoB;IAACK,SAAS,EAAGA;EAAW,CAAE,CAAC;AACxD","ignoreList":[]}