@wordpress/edit-site 5.33.0 → 5.34.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 (272) hide show
  1. package/CHANGELOG.md +2 -0
  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/block-editor/resize-handle.js +20 -5
  11. package/build/components/block-editor/resize-handle.js.map +1 -1
  12. package/build/components/create-template-part-modal/index.js +3 -0
  13. package/build/components/create-template-part-modal/index.js.map +1 -1
  14. package/build/components/editor/index.js +28 -5
  15. package/build/components/editor/index.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/context.js +9 -3
  17. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/font-collection.js +7 -2
  19. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/installed-fonts.js +22 -20
  21. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  23. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  24. package/build/components/global-styles/style-variations-container.js +8 -2
  25. package/build/components/global-styles/style-variations-container.js.map +1 -1
  26. package/build/components/header-edit-mode/index.js +33 -49
  27. package/build/components/header-edit-mode/index.js.map +1 -1
  28. package/build/components/header-edit-mode/more-menu/index.js +3 -97
  29. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  30. package/build/components/keyboard-shortcuts/register.js +0 -49
  31. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  32. package/build/components/layout/index.js +7 -4
  33. package/build/components/layout/index.js.map +1 -1
  34. package/build/components/layout/router.js +9 -38
  35. package/build/components/layout/router.js.map +1 -1
  36. package/build/components/page-pages/index.js +4 -3
  37. package/build/components/page-pages/index.js.map +1 -1
  38. package/build/components/page-patterns/dataviews-pattern-actions.js +11 -7
  39. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  40. package/build/components/page-patterns/header.js +3 -1
  41. package/build/components/page-patterns/header.js.map +1 -1
  42. package/build/components/page-patterns/index.js +20 -49
  43. package/build/components/page-patterns/index.js.map +1 -1
  44. package/build/components/page-patterns/use-patterns.js +1 -0
  45. package/build/components/page-patterns/use-patterns.js.map +1 -1
  46. package/build/components/page-templates/hooks.js.map +1 -0
  47. package/build/components/{page-templates-template-parts → page-templates}/index.js +67 -80
  48. package/build/components/page-templates/index.js.map +1 -0
  49. package/build/components/pattern-modal/duplicate.js +7 -5
  50. package/build/components/pattern-modal/duplicate.js.map +1 -1
  51. package/build/components/plugin-template-setting-panel/index.js +9 -0
  52. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  53. package/build/components/resizable-frame/index.js +9 -6
  54. package/build/components/resizable-frame/index.js.map +1 -1
  55. package/build/components/sidebar-edit-mode/index.js +3 -2
  56. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  57. package/build/components/sidebar-edit-mode/page-panels/index.js +40 -9
  58. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  59. package/build/components/sidebar-edit-mode/page-panels/page-summary.js +24 -17
  60. package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  61. package/build/components/sidebar-edit-mode/template-panel/index.js +2 -5
  62. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  63. package/build/components/sidebar-navigation-screen-page/index.js +39 -8
  64. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  65. package/build/components/sidebar-navigation-screen-pattern/index.js +6 -13
  66. package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  67. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  68. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  69. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  70. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  71. package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  72. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  73. package/build/components/sidebar-navigation-screen-patterns/index.js +34 -28
  74. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  75. package/build/components/sidebar-navigation-screen-template/index.js +1 -1
  76. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  77. package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  78. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  79. package/build/components/sidebar-navigation-screen-templates-browse/index.js +5 -35
  80. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  81. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
  82. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  83. package/build/components/template-actions/index.js +1 -1
  84. package/build/components/template-actions/index.js.map +1 -1
  85. package/build/deprecated.js +55 -0
  86. package/build/deprecated.js.map +1 -0
  87. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +35 -4
  88. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  89. package/build/index.js +18 -18
  90. package/build/index.js.map +1 -1
  91. package/build/utils/constants.js +1 -2
  92. package/build/utils/constants.js.map +1 -1
  93. package/build-module/components/add-new-page/index.js +3 -0
  94. package/build-module/components/add-new-page/index.js.map +1 -1
  95. package/build-module/components/add-new-pattern/index.js +8 -7
  96. package/build-module/components/add-new-pattern/index.js.map +1 -1
  97. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  98. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  99. package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
  100. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  101. package/build-module/components/block-editor/resize-handle.js +21 -6
  102. package/build-module/components/block-editor/resize-handle.js.map +1 -1
  103. package/build-module/components/create-template-part-modal/index.js +3 -0
  104. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  105. package/build-module/components/editor/index.js +28 -5
  106. package/build-module/components/editor/index.js.map +1 -1
  107. package/build-module/components/global-styles/font-library-modal/context.js +9 -3
  108. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  109. package/build-module/components/global-styles/font-library-modal/font-collection.js +7 -2
  110. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  111. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +22 -20
  112. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  113. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  114. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
  115. package/build-module/components/global-styles/style-variations-container.js +8 -2
  116. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  117. package/build-module/components/header-edit-mode/index.js +39 -55
  118. package/build-module/components/header-edit-mode/index.js.map +1 -1
  119. package/build-module/components/header-edit-mode/more-menu/index.js +5 -99
  120. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  121. package/build-module/components/keyboard-shortcuts/register.js +0 -49
  122. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  123. package/build-module/components/layout/index.js +7 -4
  124. package/build-module/components/layout/index.js.map +1 -1
  125. package/build-module/components/layout/router.js +9 -38
  126. package/build-module/components/layout/router.js.map +1 -1
  127. package/build-module/components/page-pages/index.js +5 -4
  128. package/build-module/components/page-pages/index.js.map +1 -1
  129. package/build-module/components/page-patterns/dataviews-pattern-actions.js +11 -7
  130. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  131. package/build-module/components/page-patterns/header.js +3 -1
  132. package/build-module/components/page-patterns/header.js.map +1 -1
  133. package/build-module/components/page-patterns/index.js +22 -51
  134. package/build-module/components/page-patterns/index.js.map +1 -1
  135. package/build-module/components/page-patterns/use-patterns.js +1 -0
  136. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  137. package/build-module/components/page-templates/hooks.js.map +1 -0
  138. package/build-module/components/{page-templates-template-parts → page-templates}/index.js +67 -80
  139. package/build-module/components/page-templates/index.js.map +1 -0
  140. package/build-module/components/pattern-modal/duplicate.js +7 -5
  141. package/build-module/components/pattern-modal/duplicate.js.map +1 -1
  142. package/build-module/components/plugin-template-setting-panel/index.js +8 -0
  143. package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
  144. package/build-module/components/resizable-frame/index.js +9 -6
  145. package/build-module/components/resizable-frame/index.js.map +1 -1
  146. package/build-module/components/sidebar-edit-mode/index.js +4 -3
  147. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  148. package/build-module/components/sidebar-edit-mode/page-panels/index.js +43 -12
  149. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  150. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +25 -17
  151. package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
  152. package/build-module/components/sidebar-edit-mode/template-panel/index.js +3 -6
  153. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  154. package/build-module/components/sidebar-navigation-screen-page/index.js +40 -9
  155. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  156. package/build-module/components/sidebar-navigation-screen-pattern/index.js +6 -13
  157. package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
  158. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  159. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
  160. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  161. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  162. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
  163. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  164. package/build-module/components/sidebar-navigation-screen-patterns/index.js +35 -29
  165. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  166. package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
  167. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  168. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  169. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  170. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +5 -35
  171. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  172. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
  173. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  174. package/build-module/components/template-actions/index.js +1 -1
  175. package/build-module/components/template-actions/index.js.map +1 -1
  176. package/build-module/deprecated.js +45 -0
  177. package/build-module/deprecated.js.map +1 -0
  178. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +34 -4
  179. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  180. package/build-module/index.js +2 -4
  181. package/build-module/index.js.map +1 -1
  182. package/build-module/utils/constants.js +0 -1
  183. package/build-module/utils/constants.js.map +1 -1
  184. package/build-style/style-rtl.css +79 -125
  185. package/build-style/style.css +79 -125
  186. package/package.json +42 -42
  187. package/src/components/add-new-page/index.js +7 -1
  188. package/src/components/add-new-pattern/index.js +15 -12
  189. package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
  190. package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
  191. package/src/components/block-editor/resize-handle.js +30 -11
  192. package/src/components/block-editor/style.scss +10 -15
  193. package/src/components/create-template-part-modal/index.js +3 -0
  194. package/src/components/editor/index.js +42 -3
  195. package/src/components/editor/style.scss +6 -1
  196. package/src/components/global-styles/font-library-modal/context.js +9 -3
  197. package/src/components/global-styles/font-library-modal/font-collection.js +31 -12
  198. package/src/components/global-styles/font-library-modal/installed-fonts.js +82 -54
  199. package/src/components/global-styles/font-library-modal/style.scss +17 -0
  200. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
  201. package/src/components/global-styles/style-variations-container.js +11 -2
  202. package/src/components/header-edit-mode/index.js +56 -76
  203. package/src/components/header-edit-mode/more-menu/index.js +8 -145
  204. package/src/components/header-edit-mode/style.scss +13 -85
  205. package/src/components/keyboard-shortcuts/register.js +0 -58
  206. package/src/components/layout/index.js +11 -2
  207. package/src/components/layout/router.js +9 -49
  208. package/src/components/page-pages/index.js +14 -4
  209. package/src/components/page-pages/style.scss +11 -0
  210. package/src/components/page-patterns/dataviews-pattern-actions.js +8 -9
  211. package/src/components/page-patterns/header.js +3 -1
  212. package/src/components/page-patterns/index.js +17 -76
  213. package/src/components/page-patterns/style.scss +14 -1
  214. package/src/components/page-patterns/use-patterns.js +1 -0
  215. package/src/components/{page-templates-template-parts → page-templates}/index.js +23 -46
  216. package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
  217. package/src/components/pattern-modal/duplicate.js +4 -3
  218. package/src/components/plugin-template-setting-panel/index.js +8 -0
  219. package/src/components/resizable-frame/index.js +4 -3
  220. package/src/components/sidebar-edit-mode/index.js +13 -2
  221. package/src/components/sidebar-edit-mode/page-panels/index.js +49 -21
  222. package/src/components/sidebar-edit-mode/page-panels/page-summary.js +31 -19
  223. package/src/components/sidebar-edit-mode/template-panel/index.js +2 -12
  224. package/src/components/sidebar-navigation-screen-page/index.js +48 -9
  225. package/src/components/sidebar-navigation-screen-pattern/index.js +6 -11
  226. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
  227. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  228. package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
  229. package/src/components/sidebar-navigation-screen-patterns/index.js +30 -38
  230. package/src/components/sidebar-navigation-screen-template/index.js +1 -1
  231. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  232. package/src/components/sidebar-navigation-screen-templates-browse/index.js +7 -39
  233. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -4
  234. package/src/components/template-actions/index.js +1 -1
  235. package/src/deprecated.js +42 -0
  236. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +69 -16
  237. package/src/index.js +2 -9
  238. package/src/style.scss +1 -5
  239. package/src/utils/constants.js +1 -1
  240. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
  241. package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  242. package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
  243. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  244. package/build/components/keyboard-shortcuts/edit-mode.js +0 -56
  245. package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  246. package/build/components/page-templates-template-parts/add-new-template-part.js +0 -65
  247. package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  248. package/build/components/page-templates-template-parts/hooks.js.map +0 -1
  249. package/build/components/page-templates-template-parts/index.js.map +0 -1
  250. package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
  251. package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  252. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
  253. package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
  254. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  255. package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
  256. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -49
  257. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
  258. package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -57
  259. package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
  260. package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
  261. package/build-module/components/page-templates-template-parts/index.js.map +0 -1
  262. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
  263. package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
  264. package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
  265. package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
  266. package/src/components/keyboard-shortcuts/edit-mode.js +0 -59
  267. package/src/components/page-templates-template-parts/add-new-template-part.js +0 -62
  268. package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
  269. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -34
  270. /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  271. /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
  272. /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ PluginMoreMenuItem as EditorPluginMoreMenuItem,
6
+ PluginSidebar as EditorPluginSidebar,
7
+ PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,
8
+ } from '@wordpress/editor';
9
+ import deprecated from '@wordpress/deprecated';
10
+
11
+ const deprecateSlot = ( name ) => {
12
+ deprecated( `wp.editPost.${ name }`, {
13
+ since: '6.6',
14
+ alternative: `wp.editor.${ name }`,
15
+ } );
16
+ };
17
+
18
+ /* eslint-disable jsdoc/require-param */
19
+ /**
20
+ * @see PluginMoreMenuItem in @wordpress/editor package.
21
+ */
22
+ export function PluginMoreMenuItem( props ) {
23
+ deprecateSlot( 'PluginMoreMenuItem' );
24
+ return <EditorPluginMoreMenuItem { ...props } />;
25
+ }
26
+
27
+ /**
28
+ * @see PluginSidebar in @wordpress/editor package.
29
+ */
30
+ export function PluginSidebar( props ) {
31
+ deprecateSlot( 'PluginSidebar' );
32
+ return <EditorPluginSidebar { ...props } />;
33
+ }
34
+
35
+ /**
36
+ * @see PluginSidebarMoreMenuItem in @wordpress/editor package.
37
+ */
38
+ export function PluginSidebarMoreMenuItem( props ) {
39
+ deprecateSlot( 'PluginSidebarMoreMenuItem' );
40
+ return <EditorPluginSidebarMoreMenuItem { ...props } />;
41
+ }
42
+ /* eslint-enable jsdoc/require-param */
@@ -153,22 +153,53 @@ export default function useThemeStyleVariationsByProperty( {
153
153
  ? cloneDeep( baseVariation )
154
154
  : null;
155
155
 
156
- let processedStyleVariations = variations.map( ( variation ) => {
157
- let result = {
158
- ...filterObjectByProperty( cloneDeep( variation ), property ),
159
- title: variation?.title,
160
- description: variation?.description,
161
- };
162
-
163
- if ( clonedBaseVariation ) {
164
- /*
165
- * Overwrites all baseVariation object `styleProperty` properties
166
- * with the theme variation `styleProperty` properties.
167
- */
168
- result = mergeBaseAndUserConfigs( clonedBaseVariation, result );
169
- }
170
- return result;
171
- } );
156
+ let processedStyleVariations = variations.reduce(
157
+ ( accumulator, variation ) => {
158
+ const variationFilteredByProperty = filterObjectByProperty(
159
+ cloneDeep( variation ),
160
+ property
161
+ );
162
+ // Remove variations that are empty once the property is filtered out.
163
+ if ( Object.keys( variationFilteredByProperty ).length === 0 ) {
164
+ return accumulator;
165
+ }
166
+
167
+ let result = {
168
+ ...variationFilteredByProperty,
169
+ title: variation?.title,
170
+ description: variation?.description,
171
+ };
172
+
173
+ if ( clonedBaseVariation ) {
174
+ /*
175
+ * Overwrites all baseVariation object `styleProperty` properties
176
+ * with the theme variation `styleProperty` properties.
177
+ */
178
+ result = mergeBaseAndUserConfigs(
179
+ clonedBaseVariation,
180
+ result
181
+ );
182
+ }
183
+
184
+ // Detect if this is a duplicate variation.
185
+ const isDuplicate = accumulator.some( ( item ) => {
186
+ return (
187
+ JSON.stringify( item.styles ) ===
188
+ JSON.stringify( result?.styles ) &&
189
+ JSON.stringify( item.settings ) ===
190
+ JSON.stringify( result?.settings )
191
+ );
192
+ } );
193
+ if ( isDuplicate ) {
194
+ return accumulator;
195
+ }
196
+
197
+ // If the variation is not a duplicate, add it to the accumulator.
198
+ accumulator.push( result );
199
+ return accumulator;
200
+ },
201
+ [] // Initial accumulator value.
202
+ );
172
203
 
173
204
  if ( 'function' === typeof filter ) {
174
205
  processedStyleVariations =
@@ -178,3 +209,25 @@ export default function useThemeStyleVariationsByProperty( {
178
209
  return processedStyleVariations;
179
210
  }, [ variations, property, baseVariation, filter ] );
180
211
  }
212
+
213
+ /**
214
+ * Compares a style variation to the same variation filtered by a single property.
215
+ * Returns true if the variation contains only the property specified.
216
+ *
217
+ * @param {Object} variation The variation to compare.
218
+ * @param {string} property The property to compare.
219
+ * @return {boolean} Whether the variation contains only a single property.
220
+ */
221
+ export function isVariationWithSingleProperty( variation, property ) {
222
+ const variationWithProperty = filterObjectByProperty(
223
+ cloneDeep( variation ),
224
+ property
225
+ );
226
+
227
+ return (
228
+ JSON.stringify( variationWithProperty?.styles ) ===
229
+ JSON.stringify( variation?.styles ) &&
230
+ JSON.stringify( variationWithProperty?.settings ) ===
231
+ JSON.stringify( variation?.settings )
232
+ );
233
+ }
package/src/index.js CHANGED
@@ -10,12 +10,7 @@ import {
10
10
  import { dispatch } from '@wordpress/data';
11
11
  import deprecated from '@wordpress/deprecated';
12
12
  import { createRoot } from '@wordpress/element';
13
- import {
14
- PluginMoreMenuItem,
15
- PluginSidebar,
16
- PluginSidebarMoreMenuItem,
17
- store as editorStore,
18
- } from '@wordpress/editor';
13
+ import { store as editorStore } from '@wordpress/editor';
19
14
  import { store as preferencesStore } from '@wordpress/preferences';
20
15
  import {
21
16
  registerLegacyWidgetBlock,
@@ -102,8 +97,6 @@ export function reinitializeEditor() {
102
97
  } );
103
98
  }
104
99
 
105
- export { PluginMoreMenuItem };
106
- export { PluginSidebar };
107
- export { PluginSidebarMoreMenuItem };
108
100
  export { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';
109
101
  export { store } from './store';
102
+ export * from './deprecated';
package/src/style.scss CHANGED
@@ -10,10 +10,9 @@
10
10
  @import "./components/page/style.scss";
11
11
  @import "./components/page-pages/style.scss";
12
12
  @import "./components/page-patterns/style.scss";
13
- @import "./components/page-templates-template-parts/style.scss";
13
+ @import "./components/page-templates/style.scss";
14
14
  @import "./components/table/style.scss";
15
15
  @import "./components/sidebar-edit-mode/style.scss";
16
- @import "./components/sidebar-edit-mode/page-panels/style.scss";
17
16
  @import "./components/sidebar-edit-mode/settings-header/style.scss";
18
17
  @import "./components/sidebar-edit-mode/template-panel/style.scss";
19
18
  @import "./components/editor/style.scss";
@@ -93,9 +92,6 @@ body.js.site-editor-php {
93
92
  display: none;
94
93
  }
95
94
 
96
- .interface-interface-skeleton__content {
97
- background-color: $gray-300;
98
- }
99
95
  }
100
96
 
101
97
  /**
@@ -50,7 +50,7 @@ export const POST_TYPE_LABELS = {
50
50
  export const LAYOUT_GRID = 'grid';
51
51
  export const LAYOUT_TABLE = 'table';
52
52
  export const LAYOUT_LIST = 'list';
53
- export const ENUMERATION_TYPE = 'enumeration';
53
+
54
54
  export const OPERATOR_IS = 'is';
55
55
  export const OPERATOR_IS_NOT = 'isNot';
56
56
  export const OPERATOR_IS_ANY = 'isAny';
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = CopyContentMenuItem;
7
- var _react = require("react");
8
- var _components = require("@wordpress/components");
9
- var _data = require("@wordpress/data");
10
- var _i18n = require("@wordpress/i18n");
11
- var _compose = require("@wordpress/compose");
12
- var _notices = require("@wordpress/notices");
13
- var _coreData = require("@wordpress/core-data");
14
- var _blocks = require("@wordpress/blocks");
15
- var _store = require("../../../store");
16
- /**
17
- * WordPress dependencies
18
- */
19
-
20
- /**
21
- * Internal dependencies
22
- */
23
-
24
- function CopyContentMenuItem() {
25
- const {
26
- createNotice
27
- } = (0, _data.useDispatch)(_notices.store);
28
- const {
29
- getEditedPostId,
30
- getEditedPostType
31
- } = (0, _data.useSelect)(_store.store);
32
- const {
33
- getEditedEntityRecord
34
- } = (0, _data.useSelect)(_coreData.store);
35
- function getText() {
36
- const record = getEditedEntityRecord('postType', getEditedPostType(), getEditedPostId());
37
- if (!record) {
38
- return '';
39
- }
40
- if (typeof record.content === 'function') {
41
- return record.content(record);
42
- } else if (record.blocks) {
43
- return (0, _blocks.__unstableSerializeAndClean)(record.blocks);
44
- } else if (record.content) {
45
- return record.content;
46
- }
47
- }
48
- function onSuccess() {
49
- createNotice('info', (0, _i18n.__)('All content copied.'), {
50
- isDismissible: true,
51
- type: 'snackbar'
52
- });
53
- }
54
- const ref = (0, _compose.useCopyToClipboard)(getText, onSuccess);
55
- return (0, _react.createElement)(_components.MenuItem, {
56
- ref: ref
57
- }, (0, _i18n.__)('Copy all blocks'));
58
- }
59
- //# sourceMappingURL=copy-content-menu-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_data","_i18n","_compose","_notices","_coreData","_blocks","_store","CopyContentMenuItem","createNotice","useDispatch","noticesStore","getEditedPostId","getEditedPostType","useSelect","editSiteStore","getEditedEntityRecord","coreStore","getText","record","content","blocks","__unstableSerializeAndClean","onSuccess","__","isDismissible","type","ref","useCopyToClipboard","_react","createElement","MenuItem"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/more-menu/copy-content-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nexport default function CopyContentMenuItem() {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { getEditedPostId, getEditedPostType } = useSelect( editSiteStore );\n\tconst { getEditedEntityRecord } = useSelect( coreStore );\n\n\tfunction getText() {\n\t\tconst record = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tgetEditedPostType(),\n\t\t\tgetEditedPostId()\n\t\t);\n\t\tif ( ! record ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ( typeof record.content === 'function' ) {\n\t\t\treturn record.content( record );\n\t\t} else if ( record.blocks ) {\n\t\t\treturn __unstableSerializeAndClean( record.blocks );\n\t\t} else if ( record.content ) {\n\t\t\treturn record.content;\n\t\t}\n\t}\n\n\tfunction onSuccess() {\n\t\tcreateNotice( 'info', __( 'All content copied.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tconst ref = useCopyToClipboard( getText, onSuccess );\n\n\treturn <MenuItem ref={ ref }>{ __( 'Copy all blocks' ) }</MenuItem>;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGe,SAASQ,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEC,cAAa,CAAC;EACpD,MAAM;IAAEC,eAAe;IAAEC;EAAkB,CAAC,GAAG,IAAAC,eAAS,EAAEC,YAAc,CAAC;EACzE,MAAM;IAAEC;EAAsB,CAAC,GAAG,IAAAF,eAAS,EAAEG,eAAU,CAAC;EAExD,SAASC,OAAOA,CAAA,EAAG;IAClB,MAAMC,MAAM,GAAGH,qBAAqB,CACnC,UAAU,EACVH,iBAAiB,CAAC,CAAC,EACnBD,eAAe,CAAC,CACjB,CAAC;IACD,IAAK,CAAEO,MAAM,EAAG;MACf,OAAO,EAAE;IACV;IAEA,IAAK,OAAOA,MAAM,CAACC,OAAO,KAAK,UAAU,EAAG;MAC3C,OAAOD,MAAM,CAACC,OAAO,CAAED,MAAO,CAAC;IAChC,CAAC,MAAM,IAAKA,MAAM,CAACE,MAAM,EAAG;MAC3B,OAAO,IAAAC,mCAA2B,EAAEH,MAAM,CAACE,MAAO,CAAC;IACpD,CAAC,MAAM,IAAKF,MAAM,CAACC,OAAO,EAAG;MAC5B,OAAOD,MAAM,CAACC,OAAO;IACtB;EACD;EAEA,SAASG,SAASA,CAAA,EAAG;IACpBd,YAAY,CAAE,MAAM,EAAE,IAAAe,QAAE,EAAE,qBAAsB,CAAC,EAAE;MAClDC,aAAa,EAAE,IAAI;MACnBC,IAAI,EAAE;IACP,CAAE,CAAC;EACJ;EAEA,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEV,OAAO,EAAEK,SAAU,CAAC;EAEpD,OAAO,IAAAM,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAAgC,QAAQ;IAACJ,GAAG,EAAGA;EAAK,GAAG,IAAAH,QAAE,EAAE,iBAAkB,CAAa,CAAC;AACpE","ignoreList":[]}
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _components = require("@wordpress/components");
9
- /**
10
- * WordPress dependencies
11
- */
12
-
13
- const {
14
- Fill: ToolsMoreMenuGroup,
15
- Slot
16
- } = (0, _components.createSlotFill)('EditSiteToolsMoreMenuGroup');
17
- ToolsMoreMenuGroup.Slot = ({
18
- fillProps
19
- }) => (0, _react.createElement)(Slot, {
20
- fillProps: fillProps
21
- }, fills => fills && fills.length > 0);
22
- var _default = exports.default = ToolsMoreMenuGroup;
23
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","Fill","ToolsMoreMenuGroup","Slot","createSlotFill","fillProps","_react","createElement","fills","length","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/tools-more-menu-group/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditSiteToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => fills && fills.length > 0 }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAM;EAAEC,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EACxD,4BACD,CAAC;AAEDF,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEE;AAAU,CAAC,KACxC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,IAAI;EAACE,SAAS,EAAGA;AAAW,GACxBG,KAAK,IAAMA,KAAK,IAAIA,KAAK,CAACC,MAAM,GAAG,CAClC,CACN;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaV,kBAAkB","ignoreList":[]}
@@ -1,56 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
8
- var _data = require("@wordpress/data");
9
- var _blockEditor = require("@wordpress/block-editor");
10
- var _blocks = require("@wordpress/blocks");
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- function KeyboardShortcutsEditMode() {
16
- const {
17
- replaceBlocks
18
- } = (0, _data.useDispatch)(_blockEditor.store);
19
- const {
20
- getBlockName,
21
- getSelectedBlockClientId,
22
- getBlockAttributes
23
- } = (0, _data.useSelect)(_blockEditor.store);
24
- const handleTextLevelShortcut = (event, level) => {
25
- event.preventDefault();
26
- const destinationBlockName = level === 0 ? 'core/paragraph' : 'core/heading';
27
- const currentClientId = getSelectedBlockClientId();
28
- if (currentClientId === null) {
29
- return;
30
- }
31
- const blockName = getBlockName(currentClientId);
32
- if (blockName !== 'core/paragraph' && blockName !== 'core/heading') {
33
- return;
34
- }
35
- const attributes = getBlockAttributes(currentClientId);
36
- const textAlign = blockName === 'core/paragraph' ? 'align' : 'textAlign';
37
- const destinationTextAlign = destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';
38
- replaceBlocks(currentClientId, (0, _blocks.createBlock)(destinationBlockName, {
39
- level,
40
- content: attributes.content,
41
- ...{
42
- [destinationTextAlign]: attributes[textAlign]
43
- }
44
- }));
45
- };
46
- (0, _keyboardShortcuts.useShortcut)('core/edit-site/transform-heading-to-paragraph', event => handleTextLevelShortcut(event, 0));
47
- [1, 2, 3, 4, 5, 6].forEach(level => {
48
- //the loop is based off on a constant therefore
49
- //the hook will execute the same way every time
50
- //eslint-disable-next-line react-hooks/rules-of-hooks
51
- (0, _keyboardShortcuts.useShortcut)(`core/edit-site/transform-paragraph-to-heading-${level}`, event => handleTextLevelShortcut(event, level));
52
- });
53
- return null;
54
- }
55
- var _default = exports.default = KeyboardShortcutsEditMode;
56
- //# sourceMappingURL=edit-mode.js.map
@@ -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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W,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;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAfA;AACA;AACA;;AAOA;AACA;AACA;;AAMA,MAAM;EA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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}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AAQ,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,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,e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