@wordpress/edit-site 5.19.2 → 5.19.4

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 (162) hide show
  1. package/build/components/add-new-pattern/index.js +6 -10
  2. package/build/components/add-new-pattern/index.js.map +1 -1
  3. package/build/components/global-styles/font-library-modal/collection-font-details.js +3 -1
  4. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
  5. package/build/components/global-styles/font-library-modal/context.js +26 -30
  6. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  7. package/build/components/global-styles/font-library-modal/font-collection.js +31 -11
  8. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  9. package/build/components/global-styles/font-library-modal/index.js +10 -3
  10. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  11. package/build/components/global-styles/font-library-modal/installed-fonts.js +27 -7
  12. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  13. package/build/components/global-styles/font-library-modal/local-fonts.js +35 -8
  14. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  15. package/build/components/global-styles/font-library-modal/resolvers.js +1 -1
  16. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  17. package/build/components/global-styles/font-library-modal/upload-fonts.js +26 -0
  18. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -0
  19. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -1
  20. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  21. package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js +71 -0
  22. package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +1 -0
  23. package/build/components/global-styles/font-library-modal/utils/index.js +4 -1
  24. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  25. package/build/components/page-patterns/grid.js +0 -1
  26. package/build/components/page-patterns/grid.js.map +1 -1
  27. package/build/components/page-patterns/patterns-list.js +1 -1
  28. package/build/components/page-patterns/patterns-list.js.map +1 -1
  29. package/build/components/page-patterns/use-patterns.js +5 -1
  30. package/build/components/page-patterns/use-patterns.js.map +1 -1
  31. package/build/components/page-template-parts/index.js +12 -1
  32. package/build/components/page-template-parts/index.js.map +1 -1
  33. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +1 -1
  34. package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
  35. package/build/components/sidebar-edit-mode/template-panel/hooks.js +71 -0
  36. package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -0
  37. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +2 -2
  38. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
  39. package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js +82 -0
  40. package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +1 -0
  41. package/build/components/sidebar-edit-mode/template-panel/template-actions.js +10 -3
  42. package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
  43. package/build/components/sidebar-edit-mode/template-panel/template-areas.js +1 -1
  44. package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -1
  45. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +5 -3
  46. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  47. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +5 -4
  48. package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  49. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +8 -1
  50. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  51. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +29 -0
  52. package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -0
  53. package/build/components/sidebar-navigation-screen-patterns/index.js +14 -2
  54. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  55. package/build/components/sidebar-navigation-screen-template/home-template-details.js +13 -18
  56. package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  57. package/build/components/sidebar-navigation-screen-templates-browse/index.js +16 -4
  58. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  59. package/build/store/selectors.js +4 -5
  60. package/build/store/selectors.js.map +1 -1
  61. package/build/utils/constants.js +1 -1
  62. package/build/utils/constants.js.map +1 -1
  63. package/build-module/components/add-new-pattern/index.js +7 -11
  64. package/build-module/components/add-new-pattern/index.js.map +1 -1
  65. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +3 -1
  66. package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
  67. package/build-module/components/global-styles/font-library-modal/context.js +26 -30
  68. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  69. package/build-module/components/global-styles/font-library-modal/font-collection.js +32 -12
  70. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  71. package/build-module/components/global-styles/font-library-modal/index.js +10 -3
  72. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  73. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +28 -8
  74. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  75. package/build-module/components/global-styles/font-library-modal/local-fonts.js +38 -11
  76. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  77. package/build-module/components/global-styles/font-library-modal/resolvers.js +1 -1
  78. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  79. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +17 -0
  80. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -0
  81. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -1
  82. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  83. package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js +63 -0
  84. package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +1 -0
  85. package/build-module/components/global-styles/font-library-modal/utils/index.js +4 -1
  86. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  87. package/build-module/components/page-patterns/grid.js +0 -1
  88. package/build-module/components/page-patterns/grid.js.map +1 -1
  89. package/build-module/components/page-patterns/patterns-list.js +1 -1
  90. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  91. package/build-module/components/page-patterns/use-patterns.js +5 -1
  92. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  93. package/build-module/components/page-template-parts/index.js +12 -1
  94. package/build-module/components/page-template-parts/index.js.map +1 -1
  95. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +1 -1
  96. package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
  97. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +64 -0
  98. package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -0
  99. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +3 -3
  100. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
  101. package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js +76 -0
  102. package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +1 -0
  103. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +10 -3
  104. package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
  105. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +1 -1
  106. package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -1
  107. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +5 -3
  108. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
  109. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +5 -4
  110. package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
  111. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +7 -1
  112. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
  113. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +22 -0
  114. package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -0
  115. package/build-module/components/sidebar-navigation-screen-patterns/index.js +14 -2
  116. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  117. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +14 -19
  118. package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
  119. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +16 -4
  120. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  121. package/build-module/store/selectors.js +4 -5
  122. package/build-module/store/selectors.js.map +1 -1
  123. package/build-module/utils/constants.js +1 -1
  124. package/build-module/utils/constants.js.map +1 -1
  125. package/build-style/style-rtl.css +35 -2
  126. package/build-style/style.css +35 -2
  127. package/package.json +40 -40
  128. package/src/components/add-new-pattern/index.js +7 -10
  129. package/src/components/global-styles/font-library-modal/collection-font-details.js +1 -1
  130. package/src/components/global-styles/font-library-modal/context.js +36 -38
  131. package/src/components/global-styles/font-library-modal/font-collection.js +41 -12
  132. package/src/components/global-styles/font-library-modal/index.js +16 -6
  133. package/src/components/global-styles/font-library-modal/installed-fonts.js +36 -6
  134. package/src/components/global-styles/font-library-modal/local-fonts.js +65 -23
  135. package/src/components/global-styles/font-library-modal/resolvers.js +1 -1
  136. package/src/components/global-styles/font-library-modal/style.scss +18 -1
  137. package/src/components/global-styles/font-library-modal/upload-fonts.js +20 -0
  138. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -3
  139. package/src/components/global-styles/font-library-modal/utils/get-notice-from-response.js +62 -0
  140. package/src/components/global-styles/font-library-modal/utils/index.js +5 -1
  141. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +1 -1
  142. package/src/components/page-patterns/grid.js +1 -1
  143. package/src/components/page-patterns/patterns-list.js +1 -1
  144. package/src/components/page-patterns/use-patterns.js +7 -3
  145. package/src/components/page-template-parts/index.js +14 -1
  146. package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +1 -1
  147. package/src/components/sidebar-edit-mode/template-panel/hooks.js +97 -0
  148. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +18 -16
  149. package/src/components/sidebar-edit-mode/template-panel/replace-template-button.js +89 -0
  150. package/src/components/sidebar-edit-mode/template-panel/style.scss +18 -0
  151. package/src/components/sidebar-edit-mode/template-panel/template-actions.js +27 -12
  152. package/src/components/sidebar-edit-mode/template-panel/template-areas.js +1 -1
  153. package/src/components/sidebar-navigation-screen/style.scss +0 -1
  154. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +5 -8
  155. package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +5 -9
  156. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -5
  157. package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +32 -0
  158. package/src/components/sidebar-navigation-screen-patterns/index.js +25 -4
  159. package/src/components/sidebar-navigation-screen-template/home-template-details.js +27 -35
  160. package/src/components/sidebar-navigation-screen-templates-browse/index.js +12 -4
  161. package/src/store/selectors.js +9 -10
  162. package/src/utils/constants.js +1 -1
@@ -6,7 +6,7 @@ import { __ } from '@wordpress/i18n';
6
6
  import { debounce } from '@wordpress/compose';
7
7
  import { useSelect, useDispatch } from '@wordpress/data';
8
8
  import { store as coreStore } from '@wordpress/core-data';
9
- import { CheckboxControl, __experimentalUseNavigator as useNavigator, __experimentalInputControl as InputControl, __experimentalNumberControl as NumberControl, __experimentalTruncate as Truncate, __experimentalItemGroup as ItemGroup } from '@wordpress/components';
9
+ import { CheckboxControl, __experimentalInputControl as InputControl, __experimentalNumberControl as NumberControl, __experimentalTruncate as Truncate, __experimentalItemGroup as ItemGroup } from '@wordpress/components';
10
10
  import { header, footer, layout } from '@wordpress/icons';
11
11
  import { useMemo, useState, useEffect } from '@wordpress/element';
12
12
  import { decodeEntities } from '@wordpress/html-entities';
@@ -48,13 +48,6 @@ function TemplateAreaButton({
48
48
  }, decodeEntities(title)));
49
49
  }
50
50
  export default function HomeTemplateDetails() {
51
- const navigator = useNavigator();
52
- const {
53
- params: {
54
- postType,
55
- postId
56
- }
57
- } = navigator;
58
51
  const {
59
52
  editEntityRecord
60
53
  } = useDispatch(coreStore);
@@ -69,22 +62,21 @@ export default function HomeTemplateDetails() {
69
62
  const {
70
63
  getEntityRecord
71
64
  } = select(coreStore);
72
- const siteSettings = getEntityRecord('root', 'site');
73
65
  const {
74
- getSettings
66
+ getSettings,
67
+ getCurrentTemplateTemplateParts
75
68
  } = unlock(select(editSiteStore));
76
- const _currentTemplateParts = select(editSiteStore).getCurrentTemplateTemplateParts();
77
- const siteEditorSettings = getSettings();
78
- const _postsPageRecord = siteSettings?.page_for_posts ? select(coreStore).getEntityRecord('postType', 'page', siteSettings?.page_for_posts) : EMPTY_OBJECT;
69
+ const siteSettings = getEntityRecord('root', 'site');
70
+ const _postsPageRecord = siteSettings?.page_for_posts ? getEntityRecord('postType', 'page', siteSettings?.page_for_posts) : EMPTY_OBJECT;
79
71
  return {
80
72
  allowCommentsOnNewPosts: siteSettings?.default_comment_status === 'open',
81
73
  postsPageTitle: _postsPageRecord?.title?.rendered,
82
74
  postsPageId: _postsPageRecord?.id,
83
75
  postsPerPage: siteSettings?.posts_per_page,
84
- templatePartAreas: siteEditorSettings?.defaultTemplatePartAreas,
85
- currentTemplateParts: _currentTemplateParts
76
+ templatePartAreas: getSettings()?.defaultTemplatePartAreas,
77
+ currentTemplateParts: getCurrentTemplateTemplateParts()
86
78
  };
87
- }, [postType, postId]);
79
+ }, []);
88
80
  const [commentsOnNewPostsValue, setCommentsOnNewPostsValue] = useState('');
89
81
  const [postsCountValue, setPostsCountValue] = useState(1);
90
82
  const [postsPageTitleValue, setPostsPageTitleValue] = useState('');
@@ -106,12 +98,14 @@ export default function HomeTemplateDetails() {
106
98
  */
107
99
  const templateAreas = useMemo(() => {
108
100
  return currentTemplateParts.length && templatePartAreas ? currentTemplateParts.map(({
109
- templatePart
101
+ templatePart,
102
+ block
110
103
  }) => ({
111
104
  ...templatePartAreas?.find(({
112
105
  area
113
106
  }) => area === templatePart?.area),
114
- ...templatePart
107
+ ...templatePart,
108
+ clientId: block.clientId
115
109
  })) : [];
116
110
  }, [currentTemplateParts, templatePartAreas]);
117
111
  const setAllowCommentsOnNewPosts = newValue => {
@@ -166,13 +160,14 @@ export default function HomeTemplateDetails() {
166
160
  title: __('Areas'),
167
161
  spacing: 3
168
162
  }, createElement(ItemGroup, null, templateAreas.map(({
163
+ clientId,
169
164
  label,
170
165
  icon,
171
166
  theme,
172
167
  slug,
173
168
  title
174
169
  }) => createElement(SidebarNavigationScreenDetailsPanelRow, {
175
- key: slug
170
+ key: clientId
176
171
  }, createElement(TemplateAreaButton, {
177
172
  postId: `${theme}//${slug}`,
178
173
  title: title?.rendered || label,
@@ -1 +1 @@
1
- {"version":3,"names":["__","debounce","useSelect","useDispatch","store","coreStore","CheckboxControl","__experimentalUseNavigator","useNavigator","__experimentalInputControl","InputControl","__experimentalNumberControl","NumberControl","__experimentalTruncate","Truncate","__experimentalItemGroup","ItemGroup","header","footer","layout","useMemo","useState","useEffect","decodeEntities","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","unlock","editSiteStore","useLink","SidebarNavigationItem","TEMPLATE_PART_POST_TYPE","EMPTY_OBJECT","TemplateAreaButton","postId","icon","title","_icons$icon","icons","linkInfo","postType","createElement","className","withChevron","limit","ellipsizeMode","numberOfLines","HomeTemplateDetails","navigator","params","editEntityRecord","allowCommentsOnNewPosts","templatePartAreas","postsPerPage","postsPageTitle","postsPageId","currentTemplateParts","select","getEntityRecord","siteSettings","getSettings","_currentTemplateParts","getCurrentTemplateTemplateParts","siteEditorSettings","_postsPageRecord","page_for_posts","default_comment_status","rendered","id","posts_per_page","defaultTemplatePartAreas","commentsOnNewPostsValue","setCommentsOnNewPostsValue","postsCountValue","setPostsCountValue","postsPageTitleValue","setPostsPageTitleValue","templateAreas","length","map","templatePart","find","area","setAllowCommentsOnNewPosts","newValue","undefined","setPostsPageTitle","setPostsPerPage","Fragment","spacing","placeholder","size","value","onChange","label","help","spinControls","step","min","checked","theme","slug","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template/home-template-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { debounce } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tCheckboxControl,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalInputControl as InputControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalTruncate as Truncate,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { header, footer, layout } from '@wordpress/icons';\nimport { useMemo, useState, useEffect } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n} from '../sidebar-navigation-screen-details-panel';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\nconst EMPTY_OBJECT = {};\n\nfunction TemplateAreaButton( { postId, icon, title } ) {\n\tconst icons = {\n\t\theader,\n\t\tfooter,\n\t};\n\tconst linkInfo = useLink( {\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tpostId,\n\t} );\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template__template-area-button\"\n\t\t\t{ ...linkInfo }\n\t\t\ticon={ icons[ icon ] ?? layout }\n\t\t\twithChevron\n\t\t>\n\t\t\t<Truncate\n\t\t\t\tlimit={ 20 }\n\t\t\t\tellipsizeMode=\"tail\"\n\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template__template-area-label-text\"\n\t\t\t>\n\t\t\t\t{ decodeEntities( title ) }\n\t\t\t</Truncate>\n\t\t</SidebarNavigationItem>\n\t);\n}\n\nexport default function HomeTemplateDetails() {\n\tconst navigator = useNavigator();\n\tconst {\n\t\tparams: { postType, postId },\n\t} = navigator;\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst {\n\t\tallowCommentsOnNewPosts,\n\t\ttemplatePartAreas,\n\t\tpostsPerPage,\n\t\tpostsPageTitle,\n\t\tpostsPageId,\n\t\tcurrentTemplateParts,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst _currentTemplateParts =\n\t\t\t\tselect( editSiteStore ).getCurrentTemplateTemplateParts();\n\t\t\tconst siteEditorSettings = getSettings();\n\t\t\tconst _postsPageRecord = siteSettings?.page_for_posts\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\tsiteSettings?.page_for_posts\n\t\t\t\t )\n\t\t\t\t: EMPTY_OBJECT;\n\n\t\t\treturn {\n\t\t\t\tallowCommentsOnNewPosts:\n\t\t\t\t\tsiteSettings?.default_comment_status === 'open',\n\t\t\t\tpostsPageTitle: _postsPageRecord?.title?.rendered,\n\t\t\t\tpostsPageId: _postsPageRecord?.id,\n\t\t\t\tpostsPerPage: siteSettings?.posts_per_page,\n\t\t\t\ttemplatePartAreas: siteEditorSettings?.defaultTemplatePartAreas,\n\t\t\t\tcurrentTemplateParts: _currentTemplateParts,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst [ commentsOnNewPostsValue, setCommentsOnNewPostsValue ] =\n\t\tuseState( '' );\n\tconst [ postsCountValue, setPostsCountValue ] = useState( 1 );\n\tconst [ postsPageTitleValue, setPostsPageTitleValue ] = useState( '' );\n\n\t/*\n\t * This hook serves to set the server-retrieved values,\n\t * postsPageTitle, allowCommentsOnNewPosts, postsPerPage,\n\t * to local state.\n\t */\n\tuseEffect( () => {\n\t\tsetCommentsOnNewPostsValue( allowCommentsOnNewPosts );\n\t\tsetPostsPageTitleValue( postsPageTitle );\n\t\tsetPostsCountValue( postsPerPage );\n\t}, [ postsPageTitle, allowCommentsOnNewPosts, postsPerPage ] );\n\n\t/*\n\t * Merge data in currentTemplateParts with templatePartAreas,\n\t * which contains the template icon and fallback labels\n\t */\n\tconst templateAreas = useMemo( () => {\n\t\treturn currentTemplateParts.length && templatePartAreas\n\t\t\t? currentTemplateParts.map( ( { templatePart } ) => ( {\n\t\t\t\t\t...templatePartAreas?.find(\n\t\t\t\t\t\t( { area } ) => area === templatePart?.area\n\t\t\t\t\t),\n\t\t\t\t\t...templatePart,\n\t\t\t } ) )\n\t\t\t: [];\n\t}, [ currentTemplateParts, templatePartAreas ] );\n\n\tconst setAllowCommentsOnNewPosts = ( newValue ) => {\n\t\tsetCommentsOnNewPostsValue( newValue );\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tdefault_comment_status: newValue ? 'open' : null,\n\t\t} );\n\t};\n\n\tconst setPostsPageTitle = ( newValue ) => {\n\t\tsetPostsPageTitleValue( newValue );\n\t\teditEntityRecord( 'postType', 'page', postsPageId, {\n\t\t\ttitle: newValue,\n\t\t} );\n\t};\n\n\tconst setPostsPerPage = ( newValue ) => {\n\t\tsetPostsCountValue( newValue );\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tposts_per_page: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreenDetailsPanel spacing={ 6 }>\n\t\t\t\t{ postsPageId && (\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\t\tplaceholder={ __( 'No Title' ) }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t\tvalue={ postsPageTitleValue }\n\t\t\t\t\t\t\tonChange={ debounce( setPostsPageTitle, 300 ) }\n\t\t\t\t\t\t\tlabel={ __( 'Blog title' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Set the Posts Page title. Appears in search results, and when the page is shared on social media.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t) }\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t<NumberControl\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\tplaceholder={ 0 }\n\t\t\t\t\t\tvalue={ postsCountValue }\n\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\tonChange={ setPostsPerPage }\n\t\t\t\t\t\tlabel={ __( 'Posts per page' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationScreenDetailsPanel>\n\n\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\tspacing={ 3 }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\tlabel={ __( 'Allow comments on new posts' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Changes will apply to new posts only. Individual posts may override these settings.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tchecked={ commentsOnNewPostsValue }\n\t\t\t\t\t\tonChange={ setAllowCommentsOnNewPosts }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\ttitle={ __( 'Areas' ) }\n\t\t\t\tspacing={ 3 }\n\t\t\t>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{ templateAreas.map(\n\t\t\t\t\t\t( { label, icon, theme, slug, title } ) => (\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow\n\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TemplateAreaButton\n\t\t\t\t\t\t\t\t\tpostId={ `${ theme }//${ slug }` }\n\t\t\t\t\t\t\t\t\ttitle={ title?.rendered || label }\n\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,eAAe,EACfC,0BA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;EAAG,GAEbhD,aAAA,CAACf,sCAAsC,QACtCe,aAAA,CAAClC,eAAe;IACfmC,SAAS,EAAC,oDAAoD;IAC9DoD,KAAK,EAAG7F,EAAE,CAAE,6BAA8B,CAAG;IAC7C8F,IAAI,EAAG9F,EAAE,CACR,qFACD,CAAG;IACHkG,OAAO,EAAG5B,uBAAyB;IACnCsB,QAAQ,EAAGV;EAA4B,CACvC,CACsC,CACJ,CAAC,EACtC1C,aAAA,CAAChB,mCAAmC;IACnCW,KAAK,EAAGnC,EAAE,CAAE,OAAQ,CAAG;IACvBwF,OAAO,EAAG;EAAG,GAEbhD,aAAA,CAACxB,SAAS,QACP4D,aAAa,CAACE,GAAG,CAClB,CAAE;IAAEe,KAAK;IAAE3D,IAAI;IAAEiE,KAAK;IAAEC,IAAI;IAAEjE;EAAM,CAAC,KACpCK,aAAA,CAACf,sCAAsC;IACtC4E,GAAG,EAAGD;EAAM,GAEZ5D,aAAA,CAACR,kBAAkB;IAClBC,MAAM,EAAI,GAAGkE,KAAO,KAAKC,IAAM,EAAG;IAClCjE,KAAK,EAAGA,KAAK,EAAE+B,QAAQ,IAAI2B,KAAO;IAClC3D,IAAI,EAAGA;EAAM,CACb,CACsC,CAE1C,CACU,CACyB,CACpC,CAAC;AAEL"}
1
+ {"version":3,"names":["__","debounce","useSelect","useDispatch","store","coreStore","CheckboxControl","__experimentalInputControl","InputControl","__experimentalNumberControl","NumberControl","__experimentalTruncate","Truncate","__experimentalItemGroup","ItemGroup","header","footer","layout","useMemo","useState","useEffect","decodeEntities","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","unlock","editSiteStore","useLink","SidebarNavigationItem","TEMPLATE_PART_POST_TYPE","EMPTY_OBJECT","TemplateAreaButton","postId","icon","title","_icons$icon","icons","linkInfo","postType","createElement","className","withChevron","limit","ellipsizeMode","numberOfLines","HomeTemplateDetails","editEntityRecord","allowCommentsOnNewPosts","templatePartAreas","postsPerPage","postsPageTitle","postsPageId","currentTemplateParts","select","getEntityRecord","getSettings","getCurrentTemplateTemplateParts","siteSettings","_postsPageRecord","page_for_posts","default_comment_status","rendered","id","posts_per_page","defaultTemplatePartAreas","commentsOnNewPostsValue","setCommentsOnNewPostsValue","postsCountValue","setPostsCountValue","postsPageTitleValue","setPostsPageTitleValue","templateAreas","length","map","templatePart","block","find","area","clientId","setAllowCommentsOnNewPosts","newValue","undefined","setPostsPageTitle","setPostsPerPage","Fragment","spacing","placeholder","size","value","onChange","label","help","spinControls","step","min","checked","theme","slug","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template/home-template-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { debounce } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tCheckboxControl,\n\t__experimentalInputControl as InputControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalTruncate as Truncate,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { header, footer, layout } from '@wordpress/icons';\nimport { useMemo, useState, useEffect } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n} from '../sidebar-navigation-screen-details-panel';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\nconst EMPTY_OBJECT = {};\n\nfunction TemplateAreaButton( { postId, icon, title } ) {\n\tconst icons = {\n\t\theader,\n\t\tfooter,\n\t};\n\tconst linkInfo = useLink( {\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tpostId,\n\t} );\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template__template-area-button\"\n\t\t\t{ ...linkInfo }\n\t\t\ticon={ icons[ icon ] ?? layout }\n\t\t\twithChevron\n\t\t>\n\t\t\t<Truncate\n\t\t\t\tlimit={ 20 }\n\t\t\t\tellipsizeMode=\"tail\"\n\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template__template-area-label-text\"\n\t\t\t>\n\t\t\t\t{ decodeEntities( title ) }\n\t\t\t</Truncate>\n\t\t</SidebarNavigationItem>\n\t);\n}\n\nexport default function HomeTemplateDetails() {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst {\n\t\tallowCommentsOnNewPosts,\n\t\ttemplatePartAreas,\n\t\tpostsPerPage,\n\t\tpostsPageTitle,\n\t\tpostsPageId,\n\t\tcurrentTemplateParts,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst { getSettings, getCurrentTemplateTemplateParts } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\tconst _postsPageRecord = siteSettings?.page_for_posts\n\t\t\t? getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'page',\n\t\t\t\t\tsiteSettings?.page_for_posts\n\t\t\t )\n\t\t\t: EMPTY_OBJECT;\n\n\t\treturn {\n\t\t\tallowCommentsOnNewPosts:\n\t\t\t\tsiteSettings?.default_comment_status === 'open',\n\t\t\tpostsPageTitle: _postsPageRecord?.title?.rendered,\n\t\t\tpostsPageId: _postsPageRecord?.id,\n\t\t\tpostsPerPage: siteSettings?.posts_per_page,\n\t\t\ttemplatePartAreas: getSettings()?.defaultTemplatePartAreas,\n\t\t\tcurrentTemplateParts: getCurrentTemplateTemplateParts(),\n\t\t};\n\t}, [] );\n\n\tconst [ commentsOnNewPostsValue, setCommentsOnNewPostsValue ] =\n\t\tuseState( '' );\n\tconst [ postsCountValue, setPostsCountValue ] = useState( 1 );\n\tconst [ postsPageTitleValue, setPostsPageTitleValue ] = useState( '' );\n\n\t/*\n\t * This hook serves to set the server-retrieved values,\n\t * postsPageTitle, allowCommentsOnNewPosts, postsPerPage,\n\t * to local state.\n\t */\n\tuseEffect( () => {\n\t\tsetCommentsOnNewPostsValue( allowCommentsOnNewPosts );\n\t\tsetPostsPageTitleValue( postsPageTitle );\n\t\tsetPostsCountValue( postsPerPage );\n\t}, [ postsPageTitle, allowCommentsOnNewPosts, postsPerPage ] );\n\n\t/*\n\t * Merge data in currentTemplateParts with templatePartAreas,\n\t * which contains the template icon and fallback labels\n\t */\n\tconst templateAreas = useMemo( () => {\n\t\treturn currentTemplateParts.length && templatePartAreas\n\t\t\t? currentTemplateParts.map( ( { templatePart, block } ) => ( {\n\t\t\t\t\t...templatePartAreas?.find(\n\t\t\t\t\t\t( { area } ) => area === templatePart?.area\n\t\t\t\t\t),\n\t\t\t\t\t...templatePart,\n\t\t\t\t\tclientId: block.clientId,\n\t\t\t } ) )\n\t\t\t: [];\n\t}, [ currentTemplateParts, templatePartAreas ] );\n\n\tconst setAllowCommentsOnNewPosts = ( newValue ) => {\n\t\tsetCommentsOnNewPostsValue( newValue );\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tdefault_comment_status: newValue ? 'open' : null,\n\t\t} );\n\t};\n\n\tconst setPostsPageTitle = ( newValue ) => {\n\t\tsetPostsPageTitleValue( newValue );\n\t\teditEntityRecord( 'postType', 'page', postsPageId, {\n\t\t\ttitle: newValue,\n\t\t} );\n\t};\n\n\tconst setPostsPerPage = ( newValue ) => {\n\t\tsetPostsCountValue( newValue );\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tposts_per_page: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreenDetailsPanel spacing={ 6 }>\n\t\t\t\t{ postsPageId && (\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\t\tplaceholder={ __( 'No Title' ) }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t\tvalue={ postsPageTitleValue }\n\t\t\t\t\t\t\tonChange={ debounce( setPostsPageTitle, 300 ) }\n\t\t\t\t\t\t\tlabel={ __( 'Blog title' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Set the Posts Page title. Appears in search results, and when the page is shared on social media.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t) }\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t<NumberControl\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\tplaceholder={ 0 }\n\t\t\t\t\t\tvalue={ postsCountValue }\n\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\tonChange={ setPostsPerPage }\n\t\t\t\t\t\tlabel={ __( 'Posts per page' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationScreenDetailsPanel>\n\n\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\tspacing={ 3 }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\tlabel={ __( 'Allow comments on new posts' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Changes will apply to new posts only. Individual posts may override these settings.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tchecked={ commentsOnNewPostsValue }\n\t\t\t\t\t\tonChange={ setAllowCommentsOnNewPosts }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\ttitle={ __( 'Areas' ) }\n\t\t\t\tspacing={ 3 }\n\t\t\t>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{ templateAreas.map(\n\t\t\t\t\t\t( { clientId, label, icon, theme, slug, title } ) => (\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow\n\t\t\t\t\t\t\t\tkey={ clientId }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TemplateAreaButton\n\t\t\t\t\t\t\t\t\tpostId={ `${ theme }//${ slug }` }\n\t\t\t\t\t\t\t\t\ttitle={ title?.rendered || label }\n\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,eAAe,EACfC,0BAA0B,IAAIC,YAAY,EAC1CC,2BAA2B,IAAIC,aAAa,EAC5CC,sBAAsB,IAAIC,QAAQ,EAClCC,uBAAuB,IAAIC,SAAS,QAC9B,uBAAuB;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b9C,aAAA,CAACxB,SAAS,QACPwD,aAAa,CAACE,GAAG,CAClB,CAAE;IAAEK,QAAQ;IAAEY,KAAK;IAAEzD,IAAI;IAAE+D,KAAK;IAAEC,IAAI;IAAE/D;EAAM,CAAC,KAC9CK,aAAA,CAACf,sCAAsC;IACtC0E,GAAG,EAAGpB;EAAU,GAEhBvC,aAAA,CAACR,kBAAkB;IAClBC,MAAM,EAAI,GAAGgE,KAAO,KAAKC,IAAM,EAAG;IAClC/D,KAAK,EAAGA,KAAK,EAAE2B,QAAQ,IAAI6B,KAAO;IAClCzD,IAAI,EAAGA;EAAM,CACb,CACsC,CAE1C,CACU,CACyB,CACpC,CAAC;AAEL"}
@@ -5,6 +5,7 @@ import { createElement } from "@wordpress/element";
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { __experimentalUseNavigator as useNavigator } from '@wordpress/components';
8
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
8
9
 
9
10
  /**
10
11
  * Internal dependencies
@@ -12,6 +13,7 @@ import { __experimentalUseNavigator as useNavigator } from '@wordpress/component
12
13
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
13
14
  import { store as editSiteStore } from '../../store';
14
15
  import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
16
+ import { unlock } from '../../lock-unlock';
15
17
  const config = {
16
18
  [TEMPLATE_POST_TYPE]: {
17
19
  title: __('All templates'),
@@ -23,18 +25,28 @@ const config = {
23
25
  backPath: '/patterns'
24
26
  }
25
27
  };
28
+ const {
29
+ useLocation
30
+ } = unlock(routerPrivateApis);
26
31
  export default function SidebarNavigationScreenTemplatesBrowse() {
27
32
  const {
28
33
  params: {
29
34
  postType
30
35
  }
31
36
  } = useNavigator();
37
+ const {
38
+ params: {
39
+ didAccessPatternsPage
40
+ }
41
+ } = useLocation();
32
42
  const isTemplatePartsMode = useSelect(select => {
33
- const settings = select(editSiteStore).getSettings();
34
- return !!settings.supportsTemplatePartsMode;
43
+ return !!select(editSiteStore).getSettings().supportsTemplatePartsMode;
35
44
  }, []);
36
- return createElement(SidebarNavigationScreen, {
37
- isRoot: isTemplatePartsMode,
45
+ return createElement(SidebarNavigationScreen
46
+ // If a classic theme that supports template parts has never
47
+ // accessed the Patterns page, return to the dashboard.
48
+ , {
49
+ isRoot: isTemplatePartsMode && !didAccessPatternsPage,
38
50
  title: config[postType].title,
39
51
  description: config[postType].description,
40
52
  backPath: config[postType].backPath
@@ -1 +1 @@
1
- {"version":3,"names":["__","useSelect","__experimentalUseNavigator","useNavigator","SidebarNavigationScreen","store","editSiteStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","config","title","description","backPath","SidebarNavigationScreenTemplatesBrowse","params","postType","isTemplatePartsMode","select","settings","getSettings","supportsTemplatePartsMode","createElement","isRoot"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates-browse/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../utils/constants';\n\nconst config = {\n\t[ TEMPLATE_POST_TYPE ]: {\n\t\ttitle: __( 'All templates' ),\n\t\tdescription: __(\n\t\t\t'Create new templates, or reset any customizations made to the templates supplied by your theme.'\n\t\t),\n\t},\n\t[ TEMPLATE_PART_POST_TYPE ]: {\n\t\ttitle: __( 'All template parts' ),\n\t\tdescription: __(\n\t\t\t'Create new template parts, or reset any customizations made to the template parts supplied by your theme.'\n\t\t),\n\t\tbackPath: '/patterns',\n\t},\n};\n\nexport default function SidebarNavigationScreenTemplatesBrowse() {\n\tconst {\n\t\tparams: { postType },\n\t} = useNavigator();\n\n\tconst isTemplatePartsMode = useSelect( ( select ) => {\n\t\tconst settings = select( editSiteStore ).getSettings();\n\n\t\treturn !! settings.supportsTemplatePartsMode;\n\t}, [] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot={ isTemplatePartsMode }\n\t\t\ttitle={ config[ postType ].title }\n\t\t\tdescription={ config[ postType ].description }\n\t\t\tbackPath={ config[ postType ].backPath }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;;AAElF;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,uBAAuB;AAE9B,MAAMC,MAAM,GAAG;EACd,CAAEF,kBAAkB,GAAI;IACvBG,KAAK,EAAEV,EAAE,CAAE,eAAgB,CAAC;IAC5BW,WAAW,EAAEX,EAAE,CACd,iGACD;EACD,CAAC;EACD,CAAEQ,uBAAuB,GAAI;IAC5BE,KAAK,EAAEV,EAAE,CAAE,oBAAqB,CAAC;IACjCW,WAAW,EAAEX,EAAE,CACd,2GACD,CAAC;IACDY,QAAQ,EAAE;EACX;AACD,CAAC;AAED,eAAe,SAASC,sCAAsCA,CAAA,EAAG;EAChE,MAAM;IACLC,MAAM,EAAE;MAAEC;IAAS;EACpB,CAAC,GAAGZ,YAAY,CAAC,CAAC;EAElB,MAAMa,mBAAmB,GAAGf,SAAS,CAAIgB,MAAM,IAAM;IACpD,MAAMC,QAAQ,GAAGD,MAAM,CAAEX,aAAc,CAAC,CAACa,WAAW,CAAC,CAAC;IAEtD,OAAO,CAAC,CAAED,QAAQ,CAACE,yBAAyB;EAC7C,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAACjB,uBAAuB;IACvBkB,MAAM,EAAGN,mBAAqB;IAC9BN,KAAK,EAAGD,MAAM,CAAEM,QAAQ,CAAE,CAACL,KAAO;IAClCC,WAAW,EAAGF,MAAM,CAAEM,QAAQ,CAAE,CAACJ,WAAa;IAC9CC,QAAQ,EAAGH,MAAM,CAAEM,QAAQ,CAAE,CAACH;EAAU,CACxC,CAAC;AAEJ"}
1
+ {"version":3,"names":["__","useSelect","__experimentalUseNavigator","useNavigator","privateApis","routerPrivateApis","SidebarNavigationScreen","store","editSiteStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","unlock","config","title","description","backPath","useLocation","SidebarNavigationScreenTemplatesBrowse","params","postType","didAccessPatternsPage","isTemplatePartsMode","select","getSettings","supportsTemplatePartsMode","createElement","isRoot"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates-browse/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst config = {\n\t[ TEMPLATE_POST_TYPE ]: {\n\t\ttitle: __( 'All templates' ),\n\t\tdescription: __(\n\t\t\t'Create new templates, or reset any customizations made to the templates supplied by your theme.'\n\t\t),\n\t},\n\t[ TEMPLATE_PART_POST_TYPE ]: {\n\t\ttitle: __( 'All template parts' ),\n\t\tdescription: __(\n\t\t\t'Create new template parts, or reset any customizations made to the template parts supplied by your theme.'\n\t\t),\n\t\tbackPath: '/patterns',\n\t},\n};\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreenTemplatesBrowse() {\n\tconst {\n\t\tparams: { postType },\n\t} = useNavigator();\n\tconst {\n\t\tparams: { didAccessPatternsPage },\n\t} = useLocation();\n\n\tconst isTemplatePartsMode = useSelect( ( select ) => {\n\t\treturn !! select( editSiteStore ).getSettings()\n\t\t\t.supportsTemplatePartsMode;\n\t}, [] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\t// If a classic theme that supports template parts has never\n\t\t\t// accessed the Patterns page, return to the dashboard.\n\t\t\tisRoot={ isTemplatePartsMode && ! didAccessPatternsPage }\n\t\t\ttitle={ config[ postType ].title }\n\t\t\tdescription={ config[ postType ].description }\n\t\t\tbackPath={ config[ postType ].backPath }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;AAClF,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAMC,MAAM,GAAG;EACd,CAAEH,kBAAkB,GAAI;IACvBI,KAAK,EAAEb,EAAE,CAAE,eAAgB,CAAC;IAC5Bc,WAAW,EAAEd,EAAE,CACd,iGACD;EACD,CAAC;EACD,CAAEU,uBAAuB,GAAI;IAC5BG,KAAK,EAAEb,EAAE,CAAE,oBAAqB,CAAC;IACjCc,WAAW,EAAEd,EAAE,CACd,2GACD,CAAC;IACDe,QAAQ,EAAE;EACX;AACD,CAAC;AAED,MAAM;EAAEC;AAAY,CAAC,GAAGL,MAAM,CAAEN,iBAAkB,CAAC;AAEnD,eAAe,SAASY,sCAAsCA,CAAA,EAAG;EAChE,MAAM;IACLC,MAAM,EAAE;MAAEC;IAAS;EACpB,CAAC,GAAGhB,YAAY,CAAC,CAAC;EAClB,MAAM;IACLe,MAAM,EAAE;MAAEE;IAAsB;EACjC,CAAC,GAAGJ,WAAW,CAAC,CAAC;EAEjB,MAAMK,mBAAmB,GAAGpB,SAAS,CAAIqB,MAAM,IAAM;IACpD,OAAO,CAAC,CAAEA,MAAM,CAAEd,aAAc,CAAC,CAACe,WAAW,CAAC,CAAC,CAC7CC,yBAAyB;EAC5B,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAACnB;EACA;EACA;EAAA;IACAoB,MAAM,EAAGL,mBAAmB,IAAI,CAAED,qBAAuB;IACzDP,KAAK,EAAGD,MAAM,CAAEO,QAAQ,CAAE,CAACN,KAAO;IAClCC,WAAW,EAAGF,MAAM,CAAEO,QAAQ,CAAE,CAACL,WAAa;IAC9CC,QAAQ,EAAGH,MAAM,CAAEO,QAAQ,CAAE,CAACJ;EAAU,CACxC,CAAC;AAEJ"}
@@ -259,14 +259,13 @@ export function isSaveViewOpened(state) {
259
259
  * @param {Object} state Global application state.
260
260
  * @return {Array} Template parts and their blocks in an array.
261
261
  */
262
- export const getCurrentTemplateTemplateParts = createRegistrySelector(select => state => {
263
- const templateType = getEditedPostType(state);
264
- const templateId = getEditedPostId(state);
265
- const template = select(coreDataStore).getEditedEntityRecord('postType', templateType, templateId);
262
+ export const getCurrentTemplateTemplateParts = createRegistrySelector(select => () => {
266
263
  const templateParts = select(coreDataStore).getEntityRecords('postType', TEMPLATE_PART_POST_TYPE, {
267
264
  per_page: -1
268
265
  });
269
- return getFilteredTemplatePartBlocks(template.blocks, templateParts);
266
+ const clientIds = select(blockEditorStore).__experimentalGetGlobalBlocksByName('core/template-part');
267
+ const blocks = select(blockEditorStore).getBlocksByClientId(clientIds);
268
+ return getFilteredTemplatePartBlocks(blocks, templateParts);
270
269
  });
271
270
 
272
271
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","blockEditorStore","getFilteredTemplatePartBlocks","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","blocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\tisDistractionFree: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tshowIconLabels: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\tTEMPLATE_POST_TYPE === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'distractionFree' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\t__unstableGetPreference( state, 'keepCaretInsideBlock' ),\n\t\t__unstableGetPreference( state, 'showIconLabels' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst templateType = getEditedPostType( state );\n\t\tconst templateId = getEditedPostId( state );\n\t\tconst template = select( coreDataStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\ttemplateType,\n\t\t\ttemplateId\n\t\t);\n\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\treturn getFilteredTemplatePartBlocks( template.blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus( state ) {\n\treturn isPage( state ) ? state.hasPageContentFocus : false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASC,6BAA6B,QAAQ,SAAS;AACvD,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,oBAAoB;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGT,sBAAsB,CAC1DU,MAAM,IAAM,CAAEC,KAAK,EAAEC,IAAI,KAC1BF,MAAM,CAAEN,gBAAiB,CAAC,CAACS,GAAG,CAAE,gBAAgB,EAAED,IAAK,CACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,eAAeA,CAAEH,KAAK,EAAEI,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AK,EAAE,YAAa,CAAC;AACtD;;AAEA;AACA;AACA;AACA,OAAO,SAASmE,wCAAwCA,CAAA,EAAG;EAC1D7E,UAAU,CACT,uEAAuE,EACvE;IACCe,KAAK,EAAE,KAAK;IACZgC,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAAS+B,4BAA4BA,CAAA,EAAG;EAC9C9E,UAAU,CAAE,2DAA2D,EAAE;IACxEe,KAAK,EAAE,KAAK;IACZgC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA,OAAO,SAASgC,kBAAkBA,CAAA,EAAG;EACpC/E,UAAU,CAAE,iDAAiD,EAAE;IAC9De,KAAK,EAAE,KAAK;IACZgC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASiC,MAAMA,CAAEtE,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACsC,UAAU,CAACK,OAAO,EAAE4B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASpB,mBAAmBA,CAAEnD,KAAK,EAAG;EAC5C,OAAOsE,MAAM,CAAEtE,KAAM,CAAC,GAAGA,KAAK,CAACmD,mBAAmB,GAAG,KAAK;AAC3D"}
1
+ {"version":3,"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","blockEditorStore","getFilteredTemplatePartBlocks","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","clientIds","blocks","getBlocksByClientId","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\tisDistractionFree: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tshowIconLabels: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\tTEMPLATE_POST_TYPE === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'distractionFree' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\t__unstableGetPreference( state, 'keepCaretInsideBlock' ),\n\t\t__unstableGetPreference( state, 'showIconLabels' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t'core/template-part'\n\t\t\t);\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus( state ) {\n\treturn isPage( state ) ? state.hasPageContentFocus : false;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAc,MAAM,QAAQ;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASC,6BAA6B,QAAQ,SAAS;AACvD,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,oBAAoB;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGT,sBAAsB,CAC1DU,MAAM,IAAM,CAAEC,KAAK,EAAEC,IAAI,KAC1BF,MAAM,CAAEN,gBAAiB,CAAC,CAACS,GAAG,CAAE,gBAAgB,EAAED,IAAK,CACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,eAAeA,CAAEH,KAAK,EAAEI,WAAW,EAAG;EACrDd,UAAU,CAAG,4CAA2C,EAAE;IACzDe,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAER,uBAAuB,CAAEE,KAAK,EAAEI,WAAY,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,kCAAkCA,CAAEP,KAAK,EAAG;EAC3D,OAAOA,KAAK,CAACQ,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC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,CAAE,iDAAiD,EAAE;IAC9De,KAAK,EAAE,KAAK;IACZgC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS+B,MAAMA,CAAEpE,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACsC,UAAU,CAACK,OAAO,EAAE0B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASlB,mBAAmBA,CAAEnD,KAAK,EAAG;EAC5C,OAAOoE,MAAM,CAAEpE,KAAM,CAAC,GAAGA,KAAK,CAACmD,mBAAmB,GAAG,KAAK;AAC3D"}
@@ -45,7 +45,7 @@ export const PAGE_CONTENT_BLOCK_TYPES = {
45
45
  };
46
46
  export const POST_TYPE_LABELS = {
47
47
  [TEMPLATE_POST_TYPE]: __('Template'),
48
- [TEMPLATE_PART_POST_TYPE]: __('Template Part'),
48
+ [TEMPLATE_PART_POST_TYPE]: __('Template part'),
49
49
  [PATTERN_TYPES.user]: __('Pattern'),
50
50
  [NAVIGATION_POST_TYPE]: __('Navigation')
51
51
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__","privateApis","patternPrivateApis","unlock","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","PATTERN_CORE_SOURCES","PATTERN_SYNC_TYPES","FOCUSABLE_ENTITIES","user","PAGE_CONTENT_BLOCK_TYPES","POST_TYPE_LABELS"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tPATTERN_CORE_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\n/**\n * Block types that are considered to be page content. These are the only blocks\n * editable when hasPageContentFocus() is true.\n */\nexport const PAGE_CONTENT_BLOCK_TYPES = {\n\t'core/post-title': true,\n\t'core/post-featured-image': true,\n\t'core/post-content': true,\n};\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template Part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,kBAAkB,QAAQ,qBAAqB;;AAEvE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA,OAAO,MAAMC,oBAAoB,GAAG,eAAe;;AAEnD;AACA,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACD,OAAO,MAAMC,mCAAmC,GAAG,eAAe;;AAElE;AACA,OAAO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,oBAAoB;EACpBC;AACD,CAAC,GAAGb,MAAM,CAAED,kBAAmB,CAAC;;AAEhC;AACA,OAAO,MAAMe,kBAAkB,GAAG,CACjCX,uBAAuB,EACvBF,oBAAoB,EACpBQ,aAAa,CAACM,IAAI,CAClB;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvC,iBAAiB,EAAE,IAAI;EACvB,0BAA0B,EAAE,IAAI;EAChC,mBAAmB,EAAE;AACtB,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAG;EAC/B,CAAEf,kBAAkB,GAAIL,EAAE,CAAE,UAAW,CAAC;EACxC,CAAEM,uBAAuB,GAAIN,EAAE,CAAE,eAAgB,CAAC;EAClD,CAAEY,aAAa,CAACM,IAAI,GAAIlB,EAAE,CAAE,SAAU,CAAC;EACvC,CAAEI,oBAAoB,GAAIJ,EAAE,CAAE,YAAa;AAC5C,CAAC"}
1
+ {"version":3,"names":["__","privateApis","patternPrivateApis","unlock","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","PATTERN_CORE_SOURCES","PATTERN_SYNC_TYPES","FOCUSABLE_ENTITIES","user","PAGE_CONTENT_BLOCK_TYPES","POST_TYPE_LABELS"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tPATTERN_CORE_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\n/**\n * Block types that are considered to be page content. These are the only blocks\n * editable when hasPageContentFocus() is true.\n */\nexport const PAGE_CONTENT_BLOCK_TYPES = {\n\t'core/post-title': true,\n\t'core/post-featured-image': true,\n\t'core/post-content': true,\n};\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,kBAAkB,QAAQ,qBAAqB;;AAEvE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA,OAAO,MAAMC,oBAAoB,GAAG,eAAe;;AAEnD;AACA,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACD,OAAO,MAAMC,mCAAmC,GAAG,eAAe;;AAElE;AACA,OAAO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,oBAAoB;EACpBC;AACD,CAAC,GAAGb,MAAM,CAAED,kBAAmB,CAAC;;AAEhC;AACA,OAAO,MAAMe,kBAAkB,GAAG,CACjCX,uBAAuB,EACvBF,oBAAoB,EACpBQ,aAAa,CAACM,IAAI,CAClB;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAG;EACvC,iBAAiB,EAAE,IAAI;EACvB,0BAA0B,EAAE,IAAI;EAChC,mBAAmB,EAAE;AACtB,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAG;EAC/B,CAAEf,kBAAkB,GAAIL,EAAE,CAAE,UAAW,CAAC;EACxC,CAAEM,uBAAuB,GAAIN,EAAE,CAAE,eAAgB,CAAC;EAClD,CAAEY,aAAa,CAACM,IAAI,GAAIlB,EAAE,CAAE,SAAU,CAAC;EACvC,CAAEI,oBAAoB,GAAIJ,EAAE,CAAE,YAAa;AAC5C,CAAC"}
@@ -2476,6 +2476,25 @@ h3.edit-site-template-card__template-areas-title {
2476
2476
  margin: 0 0 8px;
2477
2477
  }
2478
2478
 
2479
+ .edit-site-template-panel__replace-template-modal {
2480
+ z-index: 1000001;
2481
+ }
2482
+
2483
+ .edit-site-template-panel__replace-template-modal__content {
2484
+ column-count: 2;
2485
+ column-gap: 24px;
2486
+ }
2487
+ @media (min-width: 782px) {
2488
+ .edit-site-template-panel__replace-template-modal__content {
2489
+ column-count: 3;
2490
+ }
2491
+ }
2492
+ @media (min-width: 1280px) {
2493
+ .edit-site-template-panel__replace-template-modal__content {
2494
+ column-count: 4;
2495
+ }
2496
+ }
2497
+
2479
2498
  .edit-site-editor__interface-skeleton {
2480
2499
  opacity: 1;
2481
2500
  transition: opacity 0.1s ease-out;
@@ -3269,7 +3288,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3269
3288
  .edit-site-sidebar-navigation-screen__title {
3270
3289
  flex-grow: 1;
3271
3290
  padding: 6px 0 0 0;
3272
- overflow: hidden;
3273
3291
  overflow-wrap: break-word;
3274
3292
  }
3275
3293
 
@@ -3887,11 +3905,22 @@ body:has(.edit-site-resizable-frame__inner.is-resizing) {
3887
3905
  align-items: center;
3888
3906
  display: flex;
3889
3907
  justify-content: center;
3890
- height: 100px;
3908
+ height: 250px;
3891
3909
  width: 100%;
3892
3910
  background-color: #f0f0f0;
3893
3911
  }
3894
3912
 
3913
+ .font-library-modal__local-fonts {
3914
+ margin: 0 auto;
3915
+ width: 80%;
3916
+ }
3917
+ .font-library-modal__local-fonts .font-library-modal__upload-area__text {
3918
+ color: #6e6e6e;
3919
+ }
3920
+ .font-library-modal__local-fonts .font-library-modal__upload-area__notice {
3921
+ margin: 0;
3922
+ }
3923
+
3895
3924
  .font-library-modal__font-name {
3896
3925
  font-weight: bold;
3897
3926
  }
@@ -3930,6 +3959,10 @@ body:has(.edit-site-resizable-frame__inner.is-resizing) {
3930
3959
  max-width: 350px;
3931
3960
  }
3932
3961
 
3962
+ .font-library-modal__font-collection__notice {
3963
+ margin: 0;
3964
+ }
3965
+
3933
3966
  body.js #wpadminbar {
3934
3967
  display: none;
3935
3968
  }
@@ -2477,6 +2477,25 @@ h3.edit-site-template-card__template-areas-title {
2477
2477
  margin: 0 0 8px;
2478
2478
  }
2479
2479
 
2480
+ .edit-site-template-panel__replace-template-modal {
2481
+ z-index: 1000001;
2482
+ }
2483
+
2484
+ .edit-site-template-panel__replace-template-modal__content {
2485
+ column-count: 2;
2486
+ column-gap: 24px;
2487
+ }
2488
+ @media (min-width: 782px) {
2489
+ .edit-site-template-panel__replace-template-modal__content {
2490
+ column-count: 3;
2491
+ }
2492
+ }
2493
+ @media (min-width: 1280px) {
2494
+ .edit-site-template-panel__replace-template-modal__content {
2495
+ column-count: 4;
2496
+ }
2497
+ }
2498
+
2480
2499
  .edit-site-editor__interface-skeleton {
2481
2500
  opacity: 1;
2482
2501
  transition: opacity 0.1s ease-out;
@@ -3270,7 +3289,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3270
3289
  .edit-site-sidebar-navigation-screen__title {
3271
3290
  flex-grow: 1;
3272
3291
  padding: 6px 0 0 0;
3273
- overflow: hidden;
3274
3292
  overflow-wrap: break-word;
3275
3293
  }
3276
3294
 
@@ -3888,11 +3906,22 @@ body:has(.edit-site-resizable-frame__inner.is-resizing) {
3888
3906
  align-items: center;
3889
3907
  display: flex;
3890
3908
  justify-content: center;
3891
- height: 100px;
3909
+ height: 250px;
3892
3910
  width: 100%;
3893
3911
  background-color: #f0f0f0;
3894
3912
  }
3895
3913
 
3914
+ .font-library-modal__local-fonts {
3915
+ margin: 0 auto;
3916
+ width: 80%;
3917
+ }
3918
+ .font-library-modal__local-fonts .font-library-modal__upload-area__text {
3919
+ color: #6e6e6e;
3920
+ }
3921
+ .font-library-modal__local-fonts .font-library-modal__upload-area__notice {
3922
+ margin: 0;
3923
+ }
3924
+
3896
3925
  .font-library-modal__font-name {
3897
3926
  font-weight: bold;
3898
3927
  }
@@ -3931,6 +3960,10 @@ body:has(.edit-site-resizable-frame__inner.is-resizing) {
3931
3960
  max-width: 350px;
3932
3961
  }
3933
3962
 
3963
+ .font-library-modal__font-collection__notice {
3964
+ margin: 0;
3965
+ }
3966
+
3934
3967
  body.js #wpadminbar {
3935
3968
  display: none;
3936
3969
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.19.2",
3
+ "version": "5.19.4",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,44 +27,44 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.42.2",
31
- "@wordpress/api-fetch": "^6.39.2",
32
- "@wordpress/block-editor": "^12.10.2",
33
- "@wordpress/block-library": "^8.19.2",
34
- "@wordpress/blocks": "^12.19.2",
35
- "@wordpress/commands": "^0.13.2",
36
- "@wordpress/components": "^25.8.2",
37
- "@wordpress/compose": "^6.19.2",
38
- "@wordpress/core-commands": "^0.11.2",
39
- "@wordpress/core-data": "^6.19.2",
40
- "@wordpress/data": "^9.12.2",
41
- "@wordpress/date": "^4.42.2",
42
- "@wordpress/deprecated": "^3.42.2",
43
- "@wordpress/dom": "^3.42.2",
44
- "@wordpress/editor": "^13.19.2",
45
- "@wordpress/element": "^5.19.2",
46
- "@wordpress/escape-html": "^2.42.2",
47
- "@wordpress/hooks": "^3.42.2",
48
- "@wordpress/html-entities": "^3.42.2",
49
- "@wordpress/i18n": "^4.42.2",
50
- "@wordpress/icons": "^9.33.2",
51
- "@wordpress/interface": "^5.19.2",
52
- "@wordpress/keyboard-shortcuts": "^4.19.2",
53
- "@wordpress/keycodes": "^3.42.2",
54
- "@wordpress/media-utils": "^4.33.2",
55
- "@wordpress/notices": "^4.10.2",
56
- "@wordpress/patterns": "^1.3.2",
57
- "@wordpress/plugins": "^6.10.2",
58
- "@wordpress/preferences": "^3.19.2",
59
- "@wordpress/primitives": "^3.40.2",
60
- "@wordpress/private-apis": "^0.24.2",
61
- "@wordpress/reusable-blocks": "^4.19.2",
62
- "@wordpress/router": "^0.11.2",
63
- "@wordpress/style-engine": "^1.25.2",
64
- "@wordpress/url": "^3.43.2",
65
- "@wordpress/viewport": "^5.19.2",
66
- "@wordpress/widgets": "^3.19.2",
67
- "@wordpress/wordcount": "^3.42.2",
30
+ "@wordpress/a11y": "^3.42.4",
31
+ "@wordpress/api-fetch": "^6.39.4",
32
+ "@wordpress/block-editor": "^12.10.4",
33
+ "@wordpress/block-library": "^8.19.4",
34
+ "@wordpress/blocks": "^12.19.4",
35
+ "@wordpress/commands": "^0.13.4",
36
+ "@wordpress/components": "^25.8.4",
37
+ "@wordpress/compose": "^6.19.4",
38
+ "@wordpress/core-commands": "^0.11.4",
39
+ "@wordpress/core-data": "^6.19.4",
40
+ "@wordpress/data": "^9.12.4",
41
+ "@wordpress/date": "^4.42.4",
42
+ "@wordpress/deprecated": "^3.42.4",
43
+ "@wordpress/dom": "^3.42.4",
44
+ "@wordpress/editor": "^13.19.4",
45
+ "@wordpress/element": "^5.19.4",
46
+ "@wordpress/escape-html": "^2.42.4",
47
+ "@wordpress/hooks": "^3.42.4",
48
+ "@wordpress/html-entities": "^3.42.4",
49
+ "@wordpress/i18n": "^4.42.4",
50
+ "@wordpress/icons": "^9.33.4",
51
+ "@wordpress/interface": "^5.19.4",
52
+ "@wordpress/keyboard-shortcuts": "^4.19.4",
53
+ "@wordpress/keycodes": "^3.42.4",
54
+ "@wordpress/media-utils": "^4.33.4",
55
+ "@wordpress/notices": "^4.10.4",
56
+ "@wordpress/patterns": "^1.3.4",
57
+ "@wordpress/plugins": "^6.10.4",
58
+ "@wordpress/preferences": "^3.19.4",
59
+ "@wordpress/primitives": "^3.40.4",
60
+ "@wordpress/private-apis": "^0.24.4",
61
+ "@wordpress/reusable-blocks": "^4.19.4",
62
+ "@wordpress/router": "^0.11.4",
63
+ "@wordpress/style-engine": "^1.25.4",
64
+ "@wordpress/url": "^3.43.4",
65
+ "@wordpress/viewport": "^5.19.4",
66
+ "@wordpress/widgets": "^3.19.4",
67
+ "@wordpress/wordcount": "^3.42.4",
68
68
  "change-case": "^4.1.2",
69
69
  "classnames": "^2.3.1",
70
70
  "colord": "^2.9.2",
@@ -84,5 +84,5 @@
84
84
  "publishConfig": {
85
85
  "access": "public"
86
86
  },
87
- "gitHead": "5d2e3d07cc97af8090fc32c1e5d5013a2967e752"
87
+ "gitHead": "d1072bbcaf037a18d414da7865ebaf366a0e7062"
88
88
  }