@wordpress/edit-site 5.7.0 → 5.8.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 (182) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/editor/index.js +6 -4
  3. package/build/components/editor/index.js.map +1 -1
  4. package/build/components/global-styles/border-panel.js +35 -1
  5. package/build/components/global-styles/border-panel.js.map +1 -1
  6. package/build/components/global-styles/context-menu.js +6 -8
  7. package/build/components/global-styles/context-menu.js.map +1 -1
  8. package/build/components/global-styles/dimensions-panel.js +11 -1
  9. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  10. package/build/components/global-styles/effects-panel.js +53 -0
  11. package/build/components/global-styles/effects-panel.js.map +1 -0
  12. package/build/components/global-styles/filters-panel.js +45 -0
  13. package/build/components/global-styles/filters-panel.js.map +1 -0
  14. package/build/components/global-styles/global-styles-provider.js +7 -4
  15. package/build/components/global-styles/global-styles-provider.js.map +1 -1
  16. package/build/components/global-styles/preview.js +1 -1
  17. package/build/components/global-styles/preview.js.map +1 -1
  18. package/build/components/global-styles/screen-block-list.js +14 -8
  19. package/build/components/global-styles/screen-block-list.js.map +1 -1
  20. package/build/components/global-styles/screen-css.js +1 -1
  21. package/build/components/global-styles/screen-css.js.map +1 -1
  22. package/build/components/global-styles/screen-effects.js +15 -7
  23. package/build/components/global-styles/screen-effects.js.map +1 -1
  24. package/build/components/global-styles/screen-filters.js +2 -2
  25. package/build/components/global-styles/screen-filters.js.map +1 -1
  26. package/build/components/global-styles/screen-style-variations.js +8 -118
  27. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  28. package/build/components/global-styles/style-variations-container.js +149 -0
  29. package/build/components/global-styles/style-variations-container.js.map +1 -0
  30. package/build/components/global-styles/ui.js +46 -2
  31. package/build/components/global-styles/ui.js.map +1 -1
  32. package/build/components/header-edit-mode/more-menu/index.js +1 -1
  33. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  34. package/build/components/keyboard-shortcuts/index.js +0 -137
  35. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  36. package/build/components/layout/index.js +8 -1
  37. package/build/components/layout/index.js.map +1 -1
  38. package/build/components/preferences-modal/index.js +4 -0
  39. package/build/components/preferences-modal/index.js.map +1 -1
  40. package/build/components/sidebar/index.js +4 -0
  41. package/build/components/sidebar/index.js.map +1 -1
  42. package/build/components/sidebar-navigation-screen/index.js +8 -6
  43. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  44. package/build/components/sidebar-navigation-screen-global-styles/index.js +58 -0
  45. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -0
  46. package/build/components/sidebar-navigation-screen-main/index.js +5 -0
  47. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  48. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +114 -9
  49. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  50. package/build/components/site-hub/index.js +4 -3
  51. package/build/components/site-hub/index.js.map +1 -1
  52. package/build/components/welcome-guide/styles.js +1 -1
  53. package/build/components/welcome-guide/styles.js.map +1 -1
  54. package/build/hooks/commands/index.js +19 -0
  55. package/build/hooks/commands/index.js.map +1 -0
  56. package/build/hooks/commands/use-navigation-commands.js +117 -0
  57. package/build/hooks/commands/use-navigation-commands.js.map +1 -0
  58. package/build/hooks/commands/use-wp-admin-commands.js +94 -0
  59. package/build/hooks/commands/use-wp-admin-commands.js.map +1 -0
  60. package/build/hooks/template-part-edit.js +2 -1
  61. package/build/hooks/template-part-edit.js.map +1 -1
  62. package/build/index.js +2 -1
  63. package/build/index.js.map +1 -1
  64. package/build/store/selectors.js +2 -1
  65. package/build/store/selectors.js.map +1 -1
  66. package/build-module/components/editor/index.js +6 -4
  67. package/build-module/components/editor/index.js.map +1 -1
  68. package/build-module/components/global-styles/border-panel.js +34 -1
  69. package/build-module/components/global-styles/border-panel.js.map +1 -1
  70. package/build-module/components/global-styles/context-menu.js +6 -6
  71. package/build-module/components/global-styles/context-menu.js.map +1 -1
  72. package/build-module/components/global-styles/dimensions-panel.js +11 -1
  73. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  74. package/build-module/components/global-styles/effects-panel.js +43 -0
  75. package/build-module/components/global-styles/effects-panel.js.map +1 -0
  76. package/build-module/components/global-styles/filters-panel.js +35 -0
  77. package/build-module/components/global-styles/filters-panel.js.map +1 -0
  78. package/build-module/components/global-styles/global-styles-provider.js +8 -5
  79. package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
  80. package/build-module/components/global-styles/preview.js +1 -1
  81. package/build-module/components/global-styles/preview.js.map +1 -1
  82. package/build-module/components/global-styles/screen-block-list.js +13 -8
  83. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  84. package/build-module/components/global-styles/screen-css.js +1 -1
  85. package/build-module/components/global-styles/screen-css.js.map +1 -1
  86. package/build-module/components/global-styles/screen-effects.js +13 -4
  87. package/build-module/components/global-styles/screen-effects.js.map +1 -1
  88. package/build-module/components/global-styles/screen-filters.js +2 -2
  89. package/build-module/components/global-styles/screen-filters.js.map +1 -1
  90. package/build-module/components/global-styles/screen-style-variations.js +11 -114
  91. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  92. package/build-module/components/global-styles/style-variations-container.js +130 -0
  93. package/build-module/components/global-styles/style-variations-container.js.map +1 -0
  94. package/build-module/components/global-styles/ui.js +44 -3
  95. package/build-module/components/global-styles/ui.js.map +1 -1
  96. package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
  97. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  98. package/build-module/components/keyboard-shortcuts/index.js +1 -135
  99. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  100. package/build-module/components/layout/index.js +6 -1
  101. package/build-module/components/layout/index.js.map +1 -1
  102. package/build-module/components/preferences-modal/index.js +4 -0
  103. package/build-module/components/preferences-modal/index.js.map +1 -1
  104. package/build-module/components/sidebar/index.js +3 -0
  105. package/build-module/components/sidebar/index.js.map +1 -1
  106. package/build-module/components/sidebar-navigation-screen/index.js +9 -7
  107. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  108. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +41 -0
  109. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -0
  110. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -1
  111. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  112. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +113 -11
  113. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
  114. package/build-module/components/site-hub/index.js +3 -3
  115. package/build-module/components/site-hub/index.js.map +1 -1
  116. package/build-module/components/welcome-guide/styles.js +1 -1
  117. package/build-module/components/welcome-guide/styles.js.map +1 -1
  118. package/build-module/hooks/commands/index.js +10 -0
  119. package/build-module/hooks/commands/index.js.map +1 -0
  120. package/build-module/hooks/commands/use-navigation-commands.js +101 -0
  121. package/build-module/hooks/commands/use-navigation-commands.js.map +1 -0
  122. package/build-module/hooks/commands/use-wp-admin-commands.js +79 -0
  123. package/build-module/hooks/commands/use-wp-admin-commands.js.map +1 -0
  124. package/build-module/hooks/template-part-edit.js +2 -1
  125. package/build-module/hooks/template-part-edit.js.map +1 -1
  126. package/build-module/index.js +2 -1
  127. package/build-module/index.js.map +1 -1
  128. package/build-module/store/selectors.js +2 -1
  129. package/build-module/store/selectors.js.map +1 -1
  130. package/build-style/style-rtl.css +20 -46
  131. package/build-style/style.css +20 -46
  132. package/package.json +33 -31
  133. package/src/components/editor/index.js +11 -3
  134. package/src/components/global-styles/border-panel.js +32 -1
  135. package/src/components/global-styles/context-menu.js +6 -6
  136. package/src/components/global-styles/dimensions-panel.js +11 -0
  137. package/src/components/global-styles/effects-panel.js +40 -0
  138. package/src/components/global-styles/filters-panel.js +33 -0
  139. package/src/components/global-styles/global-styles-provider.js +4 -4
  140. package/src/components/global-styles/preview.js +1 -1
  141. package/src/components/global-styles/screen-block-list.js +9 -5
  142. package/src/components/global-styles/screen-css.js +1 -1
  143. package/src/components/global-styles/screen-effects.js +12 -5
  144. package/src/components/global-styles/screen-filters.js +2 -2
  145. package/src/components/global-styles/screen-style-variations.js +10 -129
  146. package/src/components/global-styles/style-variations-container.js +136 -0
  147. package/src/components/global-styles/style.scss +0 -39
  148. package/src/components/global-styles/ui.js +44 -2
  149. package/src/components/header-edit-mode/more-menu/index.js +1 -1
  150. package/src/components/keyboard-shortcuts/index.js +1 -155
  151. package/src/components/layout/index.js +4 -0
  152. package/src/components/preferences-modal/index.js +7 -0
  153. package/src/components/sidebar/index.js +4 -0
  154. package/src/components/sidebar-navigation-screen/index.js +10 -5
  155. package/src/components/sidebar-navigation-screen/style.scss +20 -5
  156. package/src/components/sidebar-navigation-screen-global-styles/index.js +41 -0
  157. package/src/components/sidebar-navigation-screen-main/index.js +9 -1
  158. package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +134 -9
  159. package/src/components/site-hub/index.js +3 -3
  160. package/src/components/start-template-options/style.scss +7 -14
  161. package/src/components/welcome-guide/styles.js +1 -1
  162. package/src/hooks/commands/index.js +10 -0
  163. package/src/hooks/commands/use-navigation-commands.js +103 -0
  164. package/src/hooks/commands/use-wp-admin-commands.js +77 -0
  165. package/src/hooks/template-part-edit.js +1 -0
  166. package/src/index.js +1 -0
  167. package/src/store/selectors.js +2 -1
  168. package/build/components/global-styles/duotone-panel.js +0 -78
  169. package/build/components/global-styles/duotone-panel.js.map +0 -1
  170. package/build/components/global-styles/filter-utils.js +0 -17
  171. package/build/components/global-styles/filter-utils.js.map +0 -1
  172. package/build/components/global-styles/shadow-panel.js +0 -197
  173. package/build/components/global-styles/shadow-panel.js.map +0 -1
  174. package/build-module/components/global-styles/duotone-panel.js +0 -67
  175. package/build-module/components/global-styles/duotone-panel.js.map +0 -1
  176. package/build-module/components/global-styles/filter-utils.js +0 -9
  177. package/build-module/components/global-styles/filter-utils.js.map +0 -1
  178. package/build-module/components/global-styles/shadow-panel.js +0 -178
  179. package/build-module/components/global-styles/shadow-panel.js.map +0 -1
  180. package/src/components/global-styles/duotone-panel.js +0 -82
  181. package/src/components/global-styles/filter-utils.js +0 -9
  182. package/src/components/global-styles/shadow-panel.js +0 -178
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-navigation-commands.js"],"names":["privateApis","__","useMemo","useSelect","store","coreStore","editSiteStore","unlock","useHistory","useCommandLoader","getNavigationCommandLoaderPerPostType","postType","useNavigationCommandLoader","search","supportsSearch","includes","deps","history","canvasMode","records","isLoading","select","getEntityRecords","query","undefined","per_page","orderby","hasFinishedResolution","getCanvasMode","commands","slice","map","record","name","title","rendered","id","label","callback","close","push","postId","canvas","usePageNavigationCommandLoader","usePostNavigationCommandLoader","useTemplateNavigationCommandLoader","useTemplatePartNavigationCommandLoader","useNavigationCommands","group","hook"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,qBAA5B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,UAAT,QAA2B,yBAA3B;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAuBF,MAAM,CAAEP,WAAF,CAAnC;;AAEA,MAAMU,qCAAqC,GAAKC,QAAF,IAC7C,SAASC,0BAAT,OAAkD;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AACjD,QAAMC,cAAc,GAAG,CAAE,CAAE,aAAF,EAAiB,kBAAjB,EAAsCC,QAAtC,CACxBJ,QADwB,CAAzB;AAGA,QAAMK,IAAI,GAAGF,cAAc,GAAG,CAAED,MAAF,CAAH,GAAg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AAE,mCADW;AAEjBe,IAAAA,KAAK,EAAE/C,EAAE,CAAE,WAAF,CAFQ;AAGjBgD,IAAAA,IAAI,EAAEJ;AAHW,GAAF,CAAhB;AAKApC,EAAAA,gBAAgB,CAAE;AACjBwB,IAAAA,IAAI,EAAE,wCADW;AAEjBe,IAAAA,KAAK,EAAE/C,EAAE,CAAE,gBAAF,CAFQ;AAGjBgD,IAAAA,IAAI,EAAEH;AAHW,GAAF,CAAhB;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis } from '@wordpress/commands';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport { useHistory } from '../../components/routes';\n\nconst { useCommandLoader } = unlock( privateApis );\n\nconst getNavigationCommandLoaderPerPostType = ( postType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst supportsSearch = ! [ 'wp_template', 'wp_template_part' ].includes(\n\t\t\tpostType\n\t\t);\n\t\tconst deps = supportsSearch ? [ search ] : [];\n\t\tconst history = useHistory();\n\t\tconst { canvasMode, records, isLoading } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst query = supportsSearch\n\t\t\t\t? {\n\t\t\t\t\t\tsearch: !! search ? search : undefined,\n\t\t\t\t\t\tper_page: 10,\n\t\t\t\t\t\torderby: search ? 'relevance' : 'date',\n\t\t\t\t }\n\t\t\t\t: {\n\t\t\t\t\t\tper_page: -1,\n\t\t\t\t };\n\t\t\treturn {\n\t\t\t\trecords: getEntityRecords( 'postType', postType, query ),\n\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t[ 'postType', postType, query ]\n\t\t\t\t),\n\t\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\t};\n\t\t}, deps );\n\n\t\tconst commands = useMemo( () => {\n\t\t\treturn ( records ?? [] ).slice( 0, 10 ).map( ( record ) => {\n\t\t\t\treturn {\n\t\t\t\t\tname: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t? record.title?.rendered\n\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\tpostId: record.id,\n\t\t\t\t\t\t\tcanvas:\n\t\t\t\t\t\t\t\tcanvasMode === 'edit' ? canvasMode : undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} );\n\t\t}, [ records, history, canvasMode ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst usePageNavigationCommandLoader =\n\tgetNavigationCommandLoaderPerPostType( 'page' );\nconst usePostNavigationCommandLoader =\n\tgetNavigationCommandLoaderPerPostType( 'post' );\nconst useTemplateNavigationCommandLoader =\n\tgetNavigationCommandLoaderPerPostType( 'wp_template' );\nconst useTemplatePartNavigationCommandLoader =\n\tgetNavigationCommandLoaderPerPostType( 'wp_template_part' );\n\nexport function useNavigationCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-pages',\n\t\tgroup: __( 'Pages' ),\n\t\thook: usePageNavigationCommandLoader,\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-posts',\n\t\tgroup: __( 'Posts' ),\n\t\thook: usePostNavigationCommandLoader,\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-templates',\n\t\tgroup: __( 'Templates' ),\n\t\thook: useTemplateNavigationCommandLoader,\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-template-parts',\n\t\tgroup: __( 'Template Parts' ),\n\t\thook: useTemplatePartNavigationCommandLoader,\n\t} );\n}\n"]}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis } from '@wordpress/commands';
5
+ import { __, sprintf } from '@wordpress/i18n';
6
+ import { useSelect } from '@wordpress/data';
7
+ import { addQueryArgs } from '@wordpress/url';
8
+ import { useMemo } from '@wordpress/element';
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+
13
+ import { store as editSiteStore } from '../../store';
14
+ import { unlock } from '../../private-apis';
15
+ const {
16
+ useCommandLoader
17
+ } = unlock(privateApis);
18
+
19
+ const getWPAdminAddCommandLoader = postType => function useAddCommandLoader(_ref) {
20
+ let {
21
+ search
22
+ } = _ref;
23
+ let label;
24
+
25
+ if (postType === 'post') {
26
+ label = __('Add a new post');
27
+ } else if (postType === 'page') {
28
+ label = __('Add a new page');
29
+ } else {
30
+ throw 'unsupported post type ' + postType;
31
+ }
32
+
33
+ const hasRecordTitle = !!search && !label.toLowerCase().includes(search.toLowerCase());
34
+
35
+ if (postType === 'post' && hasRecordTitle) {
36
+ /* translators: %s: Post title placeholder */
37
+ label = sprintf(__('Add a new post "%s"'), search);
38
+ } else if (postType === 'page' && hasRecordTitle) {
39
+ /* translators: %s: Page title placeholder */
40
+ label = sprintf(__('Add a new page "%s"'), search);
41
+ }
42
+
43
+ const newPostLink = useSelect(select => {
44
+ var _getSettings$newPostL;
45
+
46
+ const {
47
+ getSettings
48
+ } = unlock(select(editSiteStore));
49
+ return (_getSettings$newPostL = getSettings().newPostLink) !== null && _getSettings$newPostL !== void 0 ? _getSettings$newPostL : 'post-new.php';
50
+ }, []);
51
+ const commands = useMemo(() => [{
52
+ name: 'core/wp-admin/add-' + postType,
53
+ label,
54
+ callback: () => {
55
+ document.location.href = addQueryArgs(newPostLink, {
56
+ post_type: postType,
57
+ post_title: hasRecordTitle ? search : undefined
58
+ });
59
+ }
60
+ }], [newPostLink, hasRecordTitle, search, label]);
61
+ return {
62
+ isLoading: false,
63
+ commands
64
+ };
65
+ };
66
+
67
+ const useAddPostLoader = getWPAdminAddCommandLoader('post');
68
+ const useAddPageLoader = getWPAdminAddCommandLoader('page');
69
+ export function useWPAdminCommands() {
70
+ useCommandLoader({
71
+ name: 'core/wp-admin/add-post-loader',
72
+ hook: useAddPostLoader
73
+ });
74
+ useCommandLoader({
75
+ name: 'core/wp-admin/add-page-loader',
76
+ hook: useAddPageLoader
77
+ });
78
+ }
79
+ //# sourceMappingURL=use-wp-admin-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/commands/use-wp-admin-commands.js"],"names":["privateApis","__","sprintf","useSelect","addQueryArgs","useMemo","store","editSiteStore","unlock","useCommandLoader","getWPAdminAddCommandLoader","postType","useAddCommandLoader","search","label","hasRecordTitle","toLowerCase","includes","newPostLink","select","getSettings","commands","name","callback","document","location","href","post_type","post_title","undefined","isLoading","useAddPostLoader","useAddPageLoader","useWPAdminCommands","hook"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,qBAA5B;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAuBD,MAAM,CAAER,WAAF,CAAnC;;AAEA,MAAMU,0BAA0B,GAAKC,QAAF,IAClC,SAASC,mBAAT,OAA2C;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAC1C,MAAIC,KAAJ;;AACA,MAAKH,QAAQ,KAAK,MAAlB,EAA2B;AAC1BG,IAAAA,KAAK,GAAGb,EAAE,CAAE,gBAAF,CAAV;AACA,GAFD,MAEO,IAAKU,QA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,CAbuB,CAAxB;AAgBA,SAAO;AACNgB,IAAAA,SAAS,EAAE,KADL;AAENT,IAAAA;AAFM,GAAP;AAIA,CA7CF;;AA+CA,MAAMU,gBAAgB,GAAGrB,0BAA0B,CAAE,MAAF,CAAnD;AACA,MAAMsB,gBAAgB,GAAGtB,0BAA0B,CAAE,MAAF,CAAnD;AAEA,OAAO,SAASuB,kBAAT,GAA8B;AACpCxB,EAAAA,gBAAgB,CAAE;AACjBa,IAAAA,IAAI,EAAE,+BADW;AAEjBY,IAAAA,IAAI,EAAEH;AAFW,GAAF,CAAhB;AAIAtB,EAAAA,gBAAgB,CAAE;AACjBa,IAAAA,IAAI,EAAE,+BADW;AAEjBY,IAAAA,IAAI,EAAEF;AAFW,GAAF,CAAhB;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis } from '@wordpress/commands';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\n\nconst { useCommandLoader } = unlock( privateApis );\n\nconst getWPAdminAddCommandLoader = ( postType ) =>\n\tfunction useAddCommandLoader( { search } ) {\n\t\tlet label;\n\t\tif ( postType === 'post' ) {\n\t\t\tlabel = __( 'Add a new post' );\n\t\t} else if ( postType === 'page' ) {\n\t\t\tlabel = __( 'Add a new page' );\n\t\t} else {\n\t\t\tthrow 'unsupported post type ' + postType;\n\t\t}\n\t\tconst hasRecordTitle =\n\t\t\t!! search && ! label.toLowerCase().includes( search.toLowerCase() );\n\t\tif ( postType === 'post' && hasRecordTitle ) {\n\t\t\t/* translators: %s: Post title placeholder */\n\t\t\tlabel = sprintf( __( 'Add a new post \"%s\"' ), search );\n\t\t} else if ( postType === 'page' && hasRecordTitle ) {\n\t\t\t/* translators: %s: Page title placeholder */\n\t\t\tlabel = sprintf( __( 'Add a new page \"%s\"' ), search );\n\t\t}\n\n\t\tconst newPostLink = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\treturn getSettings().newPostLink ?? 'post-new.php';\n\t\t}, [] );\n\n\t\tconst commands = useMemo(\n\t\t\t() => [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/wp-admin/add-' + postType,\n\t\t\t\t\tlabel,\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( newPostLink, {\n\t\t\t\t\t\t\tpost_type: postType,\n\t\t\t\t\t\t\tpost_title: hasRecordTitle ? search : undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t[ newPostLink, hasRecordTitle, search, label ]\n\t\t);\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst useAddPostLoader = getWPAdminAddCommandLoader( 'post' );\nconst useAddPageLoader = getWPAdminAddCommandLoader( 'page' );\n\nexport function useWPAdminCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/wp-admin/add-post-loader',\n\t\thook: useAddPostLoader,\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/wp-admin/add-page-loader',\n\t\thook: useAddPageLoader,\n\t} );\n}\n"]}
@@ -35,7 +35,8 @@ function EditTemplatePartMenuItem(_ref) {
35
35
  }, [theme, slug]);
36
36
  const linkProps = useLink({
37
37
  postId: templatePart === null || templatePart === void 0 ? void 0 : templatePart.id,
38
- postType: templatePart === null || templatePart === void 0 ? void 0 : templatePart.type
38
+ postType: templatePart === null || templatePart === void 0 ? void 0 : templatePart.type,
39
+ canvas: 'edit'
39
40
  }, {
40
41
  fromTemplateId: params.postId
41
42
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/hooks/template-part-edit.js"],"names":["__","useSelect","BlockControls","store","coreStore","ToolbarButton","addFilter","createHigherOrderComponent","useLocation","useLink","EditTemplatePartMenuItem","attributes","theme","slug","params","templatePart","select","getEntityRecord","linkProps","postId","id","postType","type","fromTemplateId","event","onClick","withEditBlockControls","BlockEdit","props","name","isDisplayed"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,aAAT,QAA8B,yBAA9B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,0BAAT,QAA2C,oBAA3C;AAEA;AACA;AACA;;AACA,SAASC,WAAT,QAA4B,sBAA5B;AACA,SAASC,OAAT,QAAwB,2BAAxB;;AAEA,SAASC,wBAAT,OAAoD;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AACnD,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAkBF,UAAxB;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAaN,WAAW,EAA9B;AACA,QAAMO,YAAY,GAAGd,SAAS,CAC3Be,MAAF,IAAc;AACb,WAAOA,MAAM,CAAEZ,SAAF,CAAN,CAAoBa,eAApB,CACN,UADM,EAEN,kBAFM,EAGN;AACC,OAAGL,KAAO,KAAKC,IAAM,EAJhB,CAAP;AAMA,GAR4B,EAS7B,CAAED,KAAF,EAASC,IAAT,CAT6B,CAA9B;AAYA,QAAMK,SAAS,GAAGT,OAAO,CACxB;AACCU,IAAAA,MAAM,EAAEJ,YAAF,aAAEA,YAAF,uBAAEA,YAAY,CAAEK,EADvB;AAECC,IAAAA,QAAQ,EAAEN,YAAF,aAAEA,YAAF,uBAAEA,YAAY,CAAEO;AAFzB,GADwB,EAKxB;AACCC,IAAAA,cAAc,EAAET,MAAM,CAACK;AADxB,GALwB,CAAzB;;AAUA,MAAK,CAAEJ,YAAP,EAAsB;AACrB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,aAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,cAAC,aAAD,eACMG,SADN;AAEC,IAAA,OAAO,EAAKM,KAAF,IAAa;AACtBN,MAAAA,SAAS,CAACO,OAAV,CAAmBD,KAAnB;AACA;AAJF,MAMGxB,EAAE,CAAE,MAAF,CANL,CADD,CADD;AAYA;;AAED,OAAO,MAAM0B,qBAAqB,GAAGnB,0BAA0B,CAC5DoB,SAAF,IAAmBC,KAAF,IAAa;AAC7B,QAAM;AAAEjB,IAAAA,UAAF;AAAckB,IAAAA;AAAd,MAAuBD,KAA7B;AACA,QAAME,WAAW,GAAGD,IAAI,KAAK,oBAAT,IAAiClB,UAAU,CAACE,IAAhE;AAEA,SACC,8BACC,cAAC,SAAD,EAAgBe,KAAhB,CADD,EAEGE,WAAW,IACZ,cAAC,wBAAD;AAA0B,IAAA,UAAU,EAAGnB;AAAvC,IAHF,CADD;AAQA,CAb6D,EAc9D,uBAd8D,CAAxD;AAiBPL,SAAS,CACR,kBADQ,EAER,0CAFQ,EAGRoB,qBAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ToolbarButton } from '@wordpress/components';\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useLocation } from '../components/routes';\nimport { useLink } from '../components/routes/link';\n\nfunction EditTemplatePartMenuItem( { attributes } ) {\n\tconst { theme, slug } = attributes;\n\tconst { params } = useLocation();\n\tconst templatePart = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t// Ideally this should be an official public API.\n\t\t\t\t`${ theme }//${ slug }`\n\t\t\t);\n\t\t},\n\t\t[ theme, slug ]\n\t);\n\n\tconst linkProps = useLink(\n\t\t{\n\t\t\tpostId: templatePart?.id,\n\t\t\tpostType: templatePart?.type,\n\t\t},\n\t\t{\n\t\t\tfromTemplateId: params.postId,\n\t\t}\n\t);\n\n\tif ( ! templatePart ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockControls group=\"other\">\n\t\t\t<ToolbarButton\n\t\t\t\t{ ...linkProps }\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tlinkProps.onClick( event );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Edit' ) }\n\t\t\t</ToolbarButton>\n\t\t</BlockControls>\n\t);\n}\n\nexport const withEditBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { attributes, name } = props;\n\t\tconst isDisplayed = name === 'core/template-part' && attributes.slug;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isDisplayed && (\n\t\t\t\t\t<EditTemplatePartMenuItem attributes={ attributes } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withEditBlockControls'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/template-part-edit-button',\n\twithEditBlockControls\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/hooks/template-part-edit.js"],"names":["__","useSelect","BlockControls","store","coreStore","ToolbarButton","addFilter","createHigherOrderComponent","useLocation","useLink","EditTemplatePartMenuItem","attributes","theme","slug","params","templatePart","select","getEntityRecord","linkProps","postId","id","postType","type","canvas","fromTemplateId","event","onClick","withEditBlockControls","BlockEdit","props","name","isDisplayed"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,aAAT,QAA8B,yBAA9B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,SAAT,QAA0B,kBAA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F;AAAcmB,IAAAA;AAAd,MAAuBD,KAA7B;AACA,QAAME,WAAW,GAAGD,IAAI,KAAK,oBAAT,IAAiCnB,UAAU,CAACE,IAAhE;AAEA,SACC,8BACC,cAAC,SAAD,EAAgBgB,KAAhB,CADD,EAEGE,WAAW,IACZ,cAAC,wBAAD;AAA0B,IAAA,UAAU,EAAGpB;AAAvC,IAHF,CADD;AAQA,CAb6D,EAc9D,uBAd8D,CAAxD;AAiBPL,SAAS,CACR,kBADQ,EAER,0CAFQ,EAGRqB,qBAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ToolbarButton } from '@wordpress/components';\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useLocation } from '../components/routes';\nimport { useLink } from '../components/routes/link';\n\nfunction EditTemplatePartMenuItem( { attributes } ) {\n\tconst { theme, slug } = attributes;\n\tconst { params } = useLocation();\n\tconst templatePart = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t// Ideally this should be an official public API.\n\t\t\t\t`${ theme }//${ slug }`\n\t\t\t);\n\t\t},\n\t\t[ theme, slug ]\n\t);\n\n\tconst linkProps = useLink(\n\t\t{\n\t\t\tpostId: templatePart?.id,\n\t\t\tpostType: templatePart?.type,\n\t\t\tcanvas: 'edit',\n\t\t},\n\t\t{\n\t\t\tfromTemplateId: params.postId,\n\t\t}\n\t);\n\n\tif ( ! templatePart ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockControls group=\"other\">\n\t\t\t<ToolbarButton\n\t\t\t\t{ ...linkProps }\n\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\tlinkProps.onClick( event );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Edit' ) }\n\t\t\t</ToolbarButton>\n\t\t</BlockControls>\n\t);\n}\n\nexport const withEditBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { attributes, name } = props;\n\t\tconst isDisplayed = name === 'core/template-part' && attributes.slug;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isDisplayed && (\n\t\t\t\t\t<EditTemplatePartMenuItem attributes={ attributes } />\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withEditBlockControls'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/template-part-edit-button',\n\twithEditBlockControls\n);\n"]}
@@ -68,7 +68,8 @@ export function initializeEditor(id, settings) {
68
68
  keepCaretInsideBlock: false,
69
69
  welcomeGuide: true,
70
70
  welcomeGuideStyles: true,
71
- showListViewByDefault: false
71
+ showListViewByDefault: false,
72
+ showBlockBreadcrumbs: true
72
73
  });
73
74
  dispatch(interfaceStore).setDefaultComplementaryArea('core/edit-site', 'edit-site/template');
74
75
  dispatch(editSiteStore).updateSettings(settings); // Keep the defaultTemplateTypes in the core/editor settings too,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","search","searchOptions","__experimentalFetchRichUrlData","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","showListViewByDefault","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version","default","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,2BAFD,EAGCC,4CAHD,QAIO,0BAJP;AAKA,SAASC,QAAT,QAAyB,iBAAzB;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SACCC,kCAAkC,IAAIC,oBADvC,EAECC,0BAA0B,IAAIC,YAF/B,QAGO,sBAHP;AAIA,SAASX,KAAK,IAAIY,WAAlB,QAAqC,mBAArC;AACA,SAASZ,KAAK,IAAIa,cAAlB,QAAwC,sBAAxC;AACA,SAASb,KAAK,IAAIc,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,yBADD,EAECC,wBAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAO,SAAP;AACA,SAAShB,KAAK,IAAIiB,aAAlB,QAAuC,SAAvC;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BC,EAA3B,EAA+BC,QAA/B,EAA0C;AAChD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBJ,EAAzB,CAAf;AACA,QAAMK,IAAI,GAAGlB,UAAU,CAAEe,MAAF,CAAvB;;AAEAD,EAAAA,QAAQ,CAACb,kCAAT,GAA8C,CAAEkB,MAAF,EAAUC,aAAV,KAC7ClB,oBAAoB,CAAEiB,MAAF,EAAUC,aAAV,EAAyBN,QAAzB,CADrB;;AAEAA,EAAAA,QAAQ,CAACO,8BAAT,GAA0CjB,YAA1C;;AAEAN,EAAAA,QAAQ,CAAEJ,WAAF,C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,EAAE7B,QAAQ,CAAC6B,oBADc;AAE7CC,IAAAA,wBAAwB,EAAE9B,QAAQ,CAAC8B;AAFU,GAA9C,EA7CgD,CAkDhD;;AACAC,EAAAA,MAAM,CAACC,gBAAP,CAAyB,UAAzB,EAAuCC,CAAF,IAASA,CAAC,CAACC,cAAF,EAA9C,EAAkE,KAAlE;AACAH,EAAAA,MAAM,CAACC,gBAAP,CAAyB,MAAzB,EAAmCC,CAAF,IAASA,CAAC,CAACC,cAAF,EAA1C,EAA8D,KAA9D;AAEA9B,EAAAA,IAAI,CAAC+B,MAAL,CAAa,cAAC,GAAD,OAAb;AAEA,SAAO/B,IAAP;AACA;AAED,OAAO,SAASgC,kBAAT,GAA8B;AACpCnD,EAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CoD,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAApC,CAAV;AAIA;AAED,SAASC,OAAO,IAAIC,aAApB,QAAyC,+CAAzC;AACA,SAASD,OAAO,IAAIE,yBAApB,QAAqD,6DAArD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,qDAA9C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tkeepCaretInsideBlock: false,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","editorStore","interfaceStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","initializeEditor","id","settings","target","document","getElementById","root","search","searchOptions","__experimentalFetchRichUrlData","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","editorMode","fixedToolbar","focusMode","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","showListViewByDefault","showBlockBreadcrumbs","setDefaultComplementaryArea","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version","default","PluginSidebar","PluginSidebarMoreMenuItem","PluginMoreMenuItem"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,2BAFD,EAGCC,4CAHD,QAIO,0BAJP;A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,CAAF,IAASA,CAAC,CAACC,cAAF,EAA1C,EAA8D,KAA9D;AAEA/B,EAAAA,IAAI,CAACgC,MAAL,CAAa,cAAC,GAAD,OAAb;AAEA,SAAOhC,IAAP;AACA;AAED,OAAO,SAASiC,kBAAT,GAA8B;AACpCpD,EAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CqD,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAApC,CAAV;AAIA;AAED,SAASC,OAAO,IAAIC,aAApB,QAAyC,+CAAzC;AACA,SAASD,OAAO,IAAIE,yBAApB,QAAqD,6DAArD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,qDAA9C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport {\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\tsettings.__experimentalFetchRichUrlData = fetchUrlData;\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tkeepCaretInsideBlock: false,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\tshowListViewByDefault: false,\n\t\tshowBlockBreadcrumbs: true,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\n"]}
@@ -35,6 +35,7 @@ export const __unstableGetPreference = createRegistrySelector(select => (state,
35
35
  /**
36
36
  * Returns whether the given feature is enabled or not.
37
37
  *
38
+ * @deprecated
38
39
  * @param {Object} state Global application state.
39
40
  * @param {string} featureName Feature slug.
40
41
  *
@@ -42,7 +43,7 @@ export const __unstableGetPreference = createRegistrySelector(select => (state,
42
43
  */
43
44
 
44
45
  export function isFeatureActive(state, featureName) {
45
- deprecated(`select( 'core/interface' ).isFeatureActive`, {
46
+ deprecated(`select( 'core/edit-site' ).isFeatureActive`, {
46
47
  since: '6.0',
47
48
  alternative: `select( 'core/preferences' ).get`
48
49
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","getFilteredTemplatePartBlocks","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","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","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","blocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASC,6BAAT,QAA8C,SAA9C;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,uBAAuB,GAAGN,sBAAsB,CAC1DO,MAAF,IAAc,CAAEC,KAAF,EAASC,IAAT,KACbF,MAAM,CAAEH,gBAAF,CAAN,CAA2BM,GAA3B,CAAgC,gBAAhC,EAAkDD,IAAlD,CAF2D,CAAtD;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,eAAT,CAA0BH,KAA1B,EAAiCI,WAAjC,EAA+C;AACrDX,EAAAA,UAAU,CAAG,4CAAH,EAAgD;AACzDY,IAAAA,KAAK,EAAE,KADkD;AAEzDC,IAAAA,WAAW,EAAG;AAF2C,GAAhD,CAAV;AAKA,SAAO,CAAC,CAAER,uBAAuB,CAAEE,KAAF,EAASI,WAAT,CAAjC;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,kCAAT,CAA6CP,KAA7C,EAAqD;AAC3D,SAAOA,KAAK,CAACQ,UAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAGjB,sBAAsB,CACxDO,MAAF,IAAc,MAAMA,MAAM,CAAER,aAAF,C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QAAMyD,QAAQ,GAAG1D,MAAM,CAAER,aAAF,CAAN,CAAwBmE,qBAAxB,CAChB,UADgB,EAEhBH,YAFgB,EAGhBC,UAHgB,CAAjB;AAMA,QAAMG,aAAa,GAAG5D,MAAM,CAAER,aAAF,CAAN,CAAwBuB,gBAAxB,CACrB,UADqB,EAErB,kBAFqB,EAGrB;AAAEC,IAAAA,QAAQ,EAAE,CAAC;AAAb,GAHqB,CAAtB;AAMA,SAAOlB,6BAA6B,CAAE4D,QAAQ,CAACG,MAAX,EAAmBD,aAAnB,CAApC;AACA,CAjBmE,CAA9D;AAoBP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,aAAT,CAAwB7D,KAAxB,EAAgC;AACtC,SAAOF,uBAAuB,CAAEE,KAAF,EAAS,YAAT,CAA9B;AACA;AAED;AACA;AACA;;AACA,OAAO,SAAS8D,wCAAT,GAAoD;AAC1DrE,EAAAA,UAAU,CACT,uEADS,EAET;AACCY,IAAAA,KAAK,EAAE,KADR;AAEC+B,IAAAA,OAAO,EAAE;AAFV,GAFS,CAAV;AAOA;AAED;AACA;AACA;;AACA,OAAO,SAAS2B,4BAAT,GAAwC;AAC9CtE,EAAAA,UAAU,CAAE,2DAAF,EAA+D;AACxEY,IAAAA,KAAK,EAAE,KADiE;AAExE+B,IAAAA,OAAO,EAAE;AAF+D,GAA/D,CAAV;AAIA;AAED;AACA;AACA;;AACA,OAAO,SAAS4B,kBAAT,GAA8B;AACpCvE,EAAAA,UAAU,CAAE,iDAAF,EAAqD;AAC9DY,IAAAA,KAAK,EAAE,KADuD;AAE9D+B,IAAAA,OAAO,EAAE;AAFqD,GAArD,CAAV;AAIA","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';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\n\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 * @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/interface' ).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\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\t'wp_template' === 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, '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 function __experimentalGetInsertionPoint( state ) {\n\tconst { rootClientId, insertionIndex, filterValue } =\n\t\tstate.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\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\t'wp_template_part',\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-site/src/store/selectors.js"],"names":["createSelector","store","coreDataStore","createRegistrySelector","deprecated","uploadMedia","Platform","preferencesStore","getFilteredTemplatePartBlocks","__unstableGetPreference","select","state","name","get","isFeatureActive","featureName","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","canUser","getReusableBlocks","isWeb","OS","getEntityRecords","per_page","getSettings","setIsInserterOpen","settings","outlineMode","focusMode","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","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateType","templateId","template","getEditedEntityRecord","templateParts","blocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,WAAT,QAA4B,wBAA5B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASL,KAAK,IAAIM,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASC,6BAAT,QAA8C,SAA9C;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,uBAAuB,GAAGN,sBAAsB,CAC1DO,MAAF,IAAc,CAAEC,KAAF,EAASC,IAAT,KACbF,MAAM,CAAEH,gBAAF,CAAN,CAA2BM,GAA3B,CAAgC,gBAAhC,EAAkDD,IAAlD,CAF2D,CAAtD;AAKP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,eAAT,CAA0BH,KAA1B,EAAiCI,WAAjC,EAA+C;AACrDX,EAAAA,UAAU,CAAG,4CAAH,EAAgD;AACzDY,IAAAA,KAAK,EAAE,KADkD;AAEzDC,IAAAA,WAAW,EAAG;AAF2C,GAAhD,CAAV;AAKA,SAAO,CAAC,CAAER,uBAAuB,C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AC9DY,IAAAA,KAAK,EAAE,KADuD;AAE9D+B,IAAAA,OAAO,EAAE;AAFqD,GAArD,CAAV;AAIA","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';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\n\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\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\t'wp_template' === 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, '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 function __experimentalGetInsertionPoint( state ) {\n\tconst { rootClientId, insertionIndex, filterValue } =\n\t\tstate.blockInserterPanel;\n\treturn { rootClientId, insertionIndex, filterValue };\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\t'wp_template_part',\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"]}
@@ -1133,40 +1133,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1133
1133
  flex-direction: column;
1134
1134
  }
1135
1135
 
1136
- .edit-site-global-styles__shadow-panel {
1137
- width: 230px;
1138
- }
1139
-
1140
- .edit-site-global-styles__shadow-dropdown {
1141
- display: block;
1142
- padding: 0;
1143
- }
1144
- .edit-site-global-styles__shadow-dropdown > button {
1145
- width: 100%;
1146
- padding: 8px;
1147
- }
1148
- .edit-site-global-styles__shadow-dropdown > button.is-open {
1149
- background-color: #f0f0f0;
1150
- }
1151
-
1152
- .edit-site-global-styles__shadow-indicator-wrapper {
1153
- padding: 6px;
1154
- overflow: hidden;
1155
- display: flex;
1156
- align-items: center;
1157
- justify-content: center;
1158
- }
1159
-
1160
- .edit-site-global-styles__shadow-indicator {
1161
- color: #2f2f2f;
1162
- border: #e0e0e0 1px solid;
1163
- border-radius: 2px;
1164
- cursor: pointer;
1165
- padding: 0;
1166
- height: 24px;
1167
- width: 24px;
1168
- }
1169
-
1170
1136
  .edit-site-global-styles-screen-root.edit-site-global-styles-screen-root,
1171
1137
  .edit-site-global-styles-screen-style-variations.edit-site-global-styles-screen-style-variations {
1172
1138
  background: unset;
@@ -2094,7 +2060,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2094
2060
  }
2095
2061
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container {
2096
2062
  height: 100%;
2097
- box-shadow: 0 0 0 1px #ddd;
2098
2063
  }
2099
2064
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__content {
2100
2065
  width: 100%;
@@ -2103,12 +2068,8 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2103
2068
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-patterns-list__item-title {
2104
2069
  display: none;
2105
2070
  }
2106
- .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:hover .block-editor-block-preview__container {
2107
- box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
2108
- }
2109
- .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:focus .block-editor-block-preview__container {
2110
- box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
2111
- outline: 2px solid transparent;
2071
+ .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__item:not(:focus):not(:hover) .block-editor-block-preview__container {
2072
+ box-shadow: 0 0 0 1px #ddd;
2112
2073
  }
2113
2074
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:nth-last-child(2) .block-editor-block-preview__container {
2114
2075
  position: absolute;
@@ -2501,15 +2462,28 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2501
2462
  margin-bottom: 8px;
2502
2463
  padding-bottom: 8px;
2503
2464
  padding-left: 16px;
2465
+ z-index: 1;
2504
2466
  }
2505
2467
 
2506
2468
  .edit-site-sidebar-navigation-screen__title {
2507
- font-size: calc(1.56 * 13px);
2508
- line-height: normal;
2509
- font-weight: 500;
2510
2469
  flex-grow: 1;
2511
- color: #fff;
2512
- margin: 0;
2470
+ padding: 6px 0 0 0;
2471
+ }
2472
+
2473
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container {
2474
+ margin-right: 16px;
2475
+ }
2476
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item-preview {
2477
+ border: #1e1e1e 1px solid;
2478
+ }
2479
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview {
2480
+ border: #f0f0f0 1px solid;
2481
+ }
2482
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview {
2483
+ border: var(--wp-admin-theme-color) 1px solid;
2484
+ }
2485
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview {
2486
+ border: var(--wp-admin-theme-color) var(--wp-admin-border-width-focus) solid;
2513
2487
  }
2514
2488
 
2515
2489
  .edit-site-sidebar-navigation-screen-template__added-by-description {
@@ -1133,40 +1133,6 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1133
1133
  flex-direction: column;
1134
1134
  }
1135
1135
 
1136
- .edit-site-global-styles__shadow-panel {
1137
- width: 230px;
1138
- }
1139
-
1140
- .edit-site-global-styles__shadow-dropdown {
1141
- display: block;
1142
- padding: 0;
1143
- }
1144
- .edit-site-global-styles__shadow-dropdown > button {
1145
- width: 100%;
1146
- padding: 8px;
1147
- }
1148
- .edit-site-global-styles__shadow-dropdown > button.is-open {
1149
- background-color: #f0f0f0;
1150
- }
1151
-
1152
- .edit-site-global-styles__shadow-indicator-wrapper {
1153
- padding: 6px;
1154
- overflow: hidden;
1155
- display: flex;
1156
- align-items: center;
1157
- justify-content: center;
1158
- }
1159
-
1160
- .edit-site-global-styles__shadow-indicator {
1161
- color: #2f2f2f;
1162
- border: #e0e0e0 1px solid;
1163
- border-radius: 2px;
1164
- cursor: pointer;
1165
- padding: 0;
1166
- height: 24px;
1167
- width: 24px;
1168
- }
1169
-
1170
1136
  .edit-site-global-styles-screen-root.edit-site-global-styles-screen-root,
1171
1137
  .edit-site-global-styles-screen-style-variations.edit-site-global-styles-screen-style-variations {
1172
1138
  background: unset;
@@ -2094,7 +2060,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2094
2060
  }
2095
2061
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container {
2096
2062
  height: 100%;
2097
- box-shadow: 0 0 0 1px #ddd;
2098
2063
  }
2099
2064
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__content {
2100
2065
  width: 100%;
@@ -2103,12 +2068,8 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2103
2068
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-patterns-list__item-title {
2104
2069
  display: none;
2105
2070
  }
2106
- .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:hover .block-editor-block-preview__container {
2107
- box-shadow: 0 0 0 2px var(--wp-admin-theme-color);
2108
- }
2109
- .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:focus .block-editor-block-preview__container {
2110
- box-shadow: inset 0 0 0 1px #fff, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
2111
- outline: 2px solid transparent;
2071
+ .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__item:not(:focus):not(:hover) .block-editor-block-preview__container {
2072
+ box-shadow: 0 0 0 1px #ddd;
2112
2073
  }
2113
2074
  .edit-site-start-template-options__modal-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item:nth-last-child(2) .block-editor-block-preview__container {
2114
2075
  position: absolute;
@@ -2501,15 +2462,28 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2501
2462
  margin-bottom: 8px;
2502
2463
  padding-bottom: 8px;
2503
2464
  padding-right: 16px;
2465
+ z-index: 1;
2504
2466
  }
2505
2467
 
2506
2468
  .edit-site-sidebar-navigation-screen__title {
2507
- font-size: calc(1.56 * 13px);
2508
- line-height: normal;
2509
- font-weight: 500;
2510
2469
  flex-grow: 1;
2511
- color: #fff;
2512
- margin: 0;
2470
+ padding: 6px 0 0 0;
2471
+ }
2472
+
2473
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container {
2474
+ margin-left: 16px;
2475
+ }
2476
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item-preview {
2477
+ border: #1e1e1e 1px solid;
2478
+ }
2479
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview {
2480
+ border: #f0f0f0 1px solid;
2481
+ }
2482
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview {
2483
+ border: var(--wp-admin-theme-color) 1px solid;
2484
+ }
2485
+ .edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview {
2486
+ border: var(--wp-admin-theme-color) var(--wp-admin-border-width-focus) solid;
2513
2487
  }
2514
2488
 
2515
2489
  .edit-site-sidebar-navigation-screen-template__added-by-description {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,35 +27,37 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.30.0",
31
- "@wordpress/api-fetch": "^6.27.0",
32
- "@wordpress/block-editor": "^11.7.0",
33
- "@wordpress/block-library": "^8.7.0",
34
- "@wordpress/blocks": "^12.7.0",
35
- "@wordpress/components": "^23.7.0",
36
- "@wordpress/compose": "^6.7.0",
37
- "@wordpress/core-data": "^6.7.0",
38
- "@wordpress/data": "^9.0.0",
39
- "@wordpress/deprecated": "^3.30.0",
40
- "@wordpress/editor": "^13.7.0",
41
- "@wordpress/element": "^5.7.0",
42
- "@wordpress/hooks": "^3.30.0",
43
- "@wordpress/html-entities": "^3.30.0",
44
- "@wordpress/i18n": "^4.30.0",
45
- "@wordpress/icons": "^9.21.0",
46
- "@wordpress/interface": "^5.7.0",
47
- "@wordpress/keyboard-shortcuts": "^4.7.0",
48
- "@wordpress/keycodes": "^3.30.0",
49
- "@wordpress/media-utils": "^4.21.0",
50
- "@wordpress/notices": "^3.30.0",
51
- "@wordpress/plugins": "^5.7.0",
52
- "@wordpress/preferences": "^3.7.0",
53
- "@wordpress/private-apis": "^0.12.0",
54
- "@wordpress/reusable-blocks": "^4.7.0",
55
- "@wordpress/style-engine": "^1.13.0",
56
- "@wordpress/url": "^3.31.0",
57
- "@wordpress/viewport": "^5.7.0",
58
- "@wordpress/widgets": "^3.7.0",
30
+ "@wordpress/a11y": "^3.31.0",
31
+ "@wordpress/api-fetch": "^6.28.0",
32
+ "@wordpress/block-editor": "^11.8.0",
33
+ "@wordpress/block-library": "^8.8.0",
34
+ "@wordpress/blocks": "^12.8.0",
35
+ "@wordpress/commands": "^0.2.0",
36
+ "@wordpress/components": "^23.8.0",
37
+ "@wordpress/compose": "^6.8.0",
38
+ "@wordpress/core-data": "^6.8.0",
39
+ "@wordpress/data": "^9.1.0",
40
+ "@wordpress/deprecated": "^3.31.0",
41
+ "@wordpress/dom": "^3.31.0",
42
+ "@wordpress/editor": "^13.8.0",
43
+ "@wordpress/element": "^5.8.0",
44
+ "@wordpress/hooks": "^3.31.0",
45
+ "@wordpress/html-entities": "^3.31.0",
46
+ "@wordpress/i18n": "^4.31.0",
47
+ "@wordpress/icons": "^9.22.0",
48
+ "@wordpress/interface": "^5.8.0",
49
+ "@wordpress/keyboard-shortcuts": "^4.8.0",
50
+ "@wordpress/keycodes": "^3.31.0",
51
+ "@wordpress/media-utils": "^4.22.0",
52
+ "@wordpress/notices": "^3.31.0",
53
+ "@wordpress/plugins": "^5.8.0",
54
+ "@wordpress/preferences": "^3.8.0",
55
+ "@wordpress/private-apis": "^0.13.0",
56
+ "@wordpress/reusable-blocks": "^4.8.0",
57
+ "@wordpress/style-engine": "^1.14.0",
58
+ "@wordpress/url": "^3.32.0",
59
+ "@wordpress/viewport": "^5.8.0",
60
+ "@wordpress/widgets": "^3.8.0",
59
61
  "classnames": "^2.3.1",
60
62
  "colord": "^2.9.2",
61
63
  "downloadjs": "^1.4.7",
@@ -73,5 +75,5 @@
73
75
  "publishConfig": {
74
76
  "access": "public"
75
77
  },
76
- "gitHead": "d5c28a67b11e91e3e4b8e90346bfcb90909364d6"
78
+ "gitHead": "d61700b9f1c72ba0b030fc815ef1685b4f4031ec"
77
79
  }
@@ -67,6 +67,7 @@ export default function Editor() {
67
67
  isInserterOpen,
68
68
  isListViewOpen,
69
69
  showIconLabels,
70
+ showBlockBreadcrumbs,
70
71
  } = useSelect( ( select ) => {
71
72
  const {
72
73
  getEditedPostContext,
@@ -94,6 +95,10 @@ export default function Editor() {
94
95
  'core/edit-site',
95
96
  'showIconLabels'
96
97
  ),
98
+ showBlockBreadcrumbs: select( preferencesStore ).get(
99
+ 'core/edit-site',
100
+ 'showBlockBreadcrumbs'
101
+ ),
97
102
  };
98
103
  }, [] );
99
104
  const { setEditedPostContext } = useDispatch( editSiteStore );
@@ -101,8 +106,11 @@ export default function Editor() {
101
106
  const isViewMode = canvasMode === 'view';
102
107
  const isEditMode = canvasMode === 'edit';
103
108
  const showVisualEditor = isViewMode || editorMode === 'visual';
104
- const showBlockBreakcrumb =
105
- isEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';
109
+ const shouldShowBlockBreakcrumbs =
110
+ showBlockBreadcrumbs &&
111
+ isEditMode &&
112
+ showVisualEditor &&
113
+ blockEditorMode !== 'zoom-out';
106
114
  const shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;
107
115
  const shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;
108
116
  const secondarySidebarLabel = isListViewOpen
@@ -205,7 +213,7 @@ export default function Editor() {
205
213
  )
206
214
  }
207
215
  footer={
208
- showBlockBreakcrumb && (
216
+ shouldShowBlockBreakcrumbs && (
209
217
  <BlockBreadcrumb
210
218
  rootLabelText={ __( 'Template' ) }
211
219
  />