@wordpress/edit-site 5.28.1 → 5.28.3

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 (130) hide show
  1. package/build/components/add-new-pattern/index.js +18 -8
  2. package/build/components/add-new-pattern/index.js.map +1 -1
  3. package/build/components/editor/index.js +1 -1
  4. package/build/components/editor/index.js.map +1 -1
  5. package/build/components/global-styles/block-preview-panel.js +2 -2
  6. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  7. package/build/components/global-styles/font-library-modal/collection-font-details.js +1 -1
  8. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
  9. package/build/components/global-styles/font-library-modal/context.js +1 -1
  10. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  11. package/build/components/global-styles/font-library-modal/font-collection.js +84 -7
  12. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  13. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  14. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  15. package/build/components/global-styles/font-library-modal/installed-fonts.js +10 -7
  16. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  17. package/build/components/global-styles/font-library-modal/utils/index.js +1 -1
  18. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  19. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +14 -1
  20. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  21. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +64 -8
  22. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  23. package/build/components/global-styles/screen-revisions/revisions-buttons.js +6 -4
  24. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  25. package/build/components/layout/index.js +8 -3
  26. package/build/components/layout/index.js.map +1 -1
  27. package/build/components/layout/router.js +26 -5
  28. package/build/components/layout/router.js.map +1 -1
  29. package/build/components/media/index.js +3 -3
  30. package/build/components/media/index.js.map +1 -1
  31. package/build/components/page-patterns/use-patterns.js +10 -5
  32. package/build/components/page-patterns/use-patterns.js.map +1 -1
  33. package/build/components/page-templates-template-parts/index.js +1 -0
  34. package/build/components/page-templates-template-parts/index.js.map +1 -1
  35. package/build/components/sidebar/index.js +10 -3
  36. package/build/components/sidebar/index.js.map +1 -1
  37. package/build/components/sidebar-dataviews/default-views.js +1 -1
  38. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  39. package/build/components/sidebar-navigation-screen-pages/index.js +3 -1
  40. package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  41. package/build/hooks/commands/use-edit-mode-commands.js +8 -8
  42. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  43. package/build/store/private-actions.js +3 -1
  44. package/build/store/private-actions.js.map +1 -1
  45. package/build-module/components/add-new-pattern/index.js +18 -8
  46. package/build-module/components/add-new-pattern/index.js.map +1 -1
  47. package/build-module/components/editor/index.js +1 -1
  48. package/build-module/components/editor/index.js.map +1 -1
  49. package/build-module/components/global-styles/block-preview-panel.js +2 -2
  50. package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
  51. package/build-module/components/global-styles/font-library-modal/collection-font-details.js +1 -1
  52. package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
  53. package/build-module/components/global-styles/font-library-modal/context.js +1 -1
  54. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  55. package/build-module/components/global-styles/font-library-modal/font-collection.js +87 -10
  56. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  57. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  58. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  59. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +11 -8
  60. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  61. package/build-module/components/global-styles/font-library-modal/utils/index.js +2 -2
  62. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  63. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +13 -1
  64. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  65. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +63 -8
  66. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  67. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +6 -4
  68. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  69. package/build-module/components/layout/index.js +8 -3
  70. package/build-module/components/layout/index.js.map +1 -1
  71. package/build-module/components/layout/router.js +26 -5
  72. package/build-module/components/layout/router.js.map +1 -1
  73. package/build-module/components/media/index.js +3 -3
  74. package/build-module/components/media/index.js.map +1 -1
  75. package/build-module/components/page-patterns/use-patterns.js +10 -5
  76. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  77. package/build-module/components/page-templates-template-parts/index.js +1 -0
  78. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  79. package/build-module/components/sidebar/index.js +10 -3
  80. package/build-module/components/sidebar/index.js.map +1 -1
  81. package/build-module/components/sidebar-dataviews/default-views.js +2 -2
  82. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  83. package/build-module/components/sidebar-navigation-screen-pages/index.js +3 -1
  84. package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
  85. package/build-module/hooks/commands/use-edit-mode-commands.js +8 -8
  86. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  87. package/build-module/store/private-actions.js +3 -1
  88. package/build-module/store/private-actions.js.map +1 -1
  89. package/build-style/style-rtl.css +33 -11
  90. package/build-style/style.css +33 -11
  91. package/package.json +42 -42
  92. package/src/components/add-new-pattern/index.js +27 -11
  93. package/src/components/editor/index.js +1 -0
  94. package/src/components/global-styles/block-preview-panel.js +2 -2
  95. package/src/components/global-styles/font-library-modal/collection-font-details.js +1 -1
  96. package/src/components/global-styles/font-library-modal/context.js +1 -1
  97. package/src/components/global-styles/font-library-modal/font-collection.js +118 -13
  98. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  99. package/src/components/global-styles/font-library-modal/installed-fonts.js +25 -23
  100. package/src/components/global-styles/font-library-modal/style.scss +2 -5
  101. package/src/components/global-styles/font-library-modal/utils/index.js +2 -2
  102. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +13 -1
  103. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +72 -15
  104. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +60 -5
  105. package/src/components/global-styles/screen-revisions/revisions-buttons.js +7 -5
  106. package/src/components/global-styles/screen-revisions/style.scss +11 -6
  107. package/src/components/layout/index.js +47 -30
  108. package/src/components/layout/router.js +31 -2
  109. package/src/components/layout/style.scss +7 -0
  110. package/src/components/media/index.js +7 -9
  111. package/src/components/page-patterns/style.scss +10 -0
  112. package/src/components/page-patterns/use-patterns.js +13 -5
  113. package/src/components/page-templates-template-parts/index.js +1 -0
  114. package/src/components/page-templates-template-parts/style.scss +6 -0
  115. package/src/components/sidebar/index.js +14 -5
  116. package/src/components/sidebar-dataviews/default-views.js +2 -2
  117. package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -1
  118. package/src/components/sidebar-navigation-screen-pages/index.js +10 -6
  119. package/src/hooks/commands/use-edit-mode-commands.js +14 -14
  120. package/src/store/private-actions.js +4 -0
  121. package/build/components/global-styles/font-library-modal/fonts-grid.js +0 -57
  122. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +0 -1
  123. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +0 -92
  124. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +0 -1
  125. package/build-module/components/global-styles/font-library-modal/fonts-grid.js +0 -50
  126. package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +0 -1
  127. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +0 -84
  128. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +0 -1
  129. package/src/components/global-styles/font-library-modal/fonts-grid.js +0 -59
  130. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +0 -103
@@ -72,8 +72,8 @@ function usePageContentFocusCommands() {
72
72
  if (currentPostType !== 'wp_template') {
73
73
  commands.push({
74
74
  name: 'core/switch-to-template-focus',
75
- /* translators: %1$s: template title */
76
- label: sprintf('Edit template: %s', decodeEntities(template.title)),
75
+ label: sprintf( /* translators: %s: template title */
76
+ __('Edit template: %s'), decodeEntities(template.title)),
77
77
  icon: layout,
78
78
  callback: ({
79
79
  close
@@ -155,9 +155,9 @@ function useManipulateDocumentCommands() {
155
155
  }
156
156
  const commands = [];
157
157
  if (isTemplateRevertable(template) && !isEditingPage) {
158
- const label = template.type === TEMPLATE_POST_TYPE ? /* translators: %1$s: template title */
159
- sprintf('Reset template: %s', decodeEntities(template.title)) : /* translators: %1$s: template part title */
160
- sprintf('Reset template part: %s', decodeEntities(template.title));
158
+ const label = template.type === TEMPLATE_POST_TYPE ? sprintf( /* translators: %s: template title */
159
+ __('Reset template: %s'), decodeEntities(template.title)) : sprintf( /* translators: %s: template part title */
160
+ __('Reset template part: %s'), decodeEntities(template.title));
161
161
  commands.push({
162
162
  name: 'core/reset-template',
163
163
  label,
@@ -171,9 +171,9 @@ function useManipulateDocumentCommands() {
171
171
  });
172
172
  }
173
173
  if (isTemplateRemovable(template) && !isEditingPage) {
174
- const label = template.type === TEMPLATE_POST_TYPE ? /* translators: %1$s: template title */
175
- sprintf('Delete template: %s', decodeEntities(template.title)) : /* translators: %1$s: template part title */
176
- sprintf('Delete template part: %s', decodeEntities(template.title));
174
+ const label = template.type === TEMPLATE_POST_TYPE ? sprintf( /* translators: %s: template title */
175
+ __('Delete template: %s'), decodeEntities(template.title)) : sprintf( /* translators: %s: template part title */
176
+ __('Delete template part: %s'), decodeEntities(template.title));
177
177
  const path = template.type === TEMPLATE_POST_TYPE ? '/wp_template' : '/wp_template_part/all';
178
178
  commands.push({
179
179
  name: 'core/remove-template',
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","__","sprintf","isRTL","edit","trash","rotateLeft","rotateRight","layout","page","drawerLeft","drawerRight","blockDefault","code","keyboard","listView","symbol","useCommandLoader","decodeEntities","privateApis","routerPrivateApis","store","preferencesStore","interfaceStore","noticesStore","editorStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","PREFERENCES_MODAL_NAME","PATTERN_MODALS","unlock","TEMPLATE_POST_TYPE","useLink","useHistory","usePageContentFocusCommands","record","template","isPage","canvasMode","templateId","currentPostType","select","_isPage","getCanvasMode","getCurrentPostType","getCurrentTemplateId","onClick","editTemplate","postType","postId","setRenderingMode","isLoading","commands","push","name","label","title","icon","callback","close","useEditorModeCommands","switchEditorMode","editorMode","getEditorMode","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","type","path","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","toggleDistractionFree","setIsListViewOpened","activeSidebar","showBlockBreadcrumbs","isListViewOpen","isDistractionFree","isTopToolbar","isFocusMode","get","isListViewOpened","getActiveComplementaryArea","openModal","toggle","createInfoNotice","id","actions","usePatternCommands","pattern","rename","duplicate","useEditModeCommands","hook","context"],"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tedit,\n\ttrash,\n\trotateLeft,\n\trotateRight,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcode,\n\tkeyboard,\n\tlistView,\n\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { PATTERN_MODALS } from '../../components/pattern-modal';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { useLink } from '../../components/routes/link';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, templateId, currentPostType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisPage: _isPage(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\t\tcurrentPostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { onClick: editTemplate } = useLink( {\n\t\tpostType: 'wp_template',\n\t\tpostId: templateId,\n\t} );\n\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( currentPostType !== 'wp_template' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\t/* translators: %1$s: template title */\n\t\t\tlabel: sprintf(\n\t\t\t\t'Edit template: %s',\n\t\t\t\tdecodeEntities( template.title )\n\t\t\t),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\teditTemplate();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-locked' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useEditorModeCommands() {\n\tconst { switchEditorMode } = useDispatch( editSiteStore );\n\tconst { canvasMode, editorMode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tif ( canvasMode !== 'edit' || editorMode !== 'text' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( editorMode === 'text' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/exit-code-editor',\n\t\t\tlabel: __( 'Exit code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'visual' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst isEditingPage = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editSiteStore ).isPage() &&\n\t\t\tselect( editorStore ).getCurrentPostType() !== 'wp_template',\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tconst path =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\ttoggleDistractionFree,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t} = useDispatch( editSiteStore );\n\tconst {\n\t\tcanvasMode,\n\t\teditorMode,\n\t\tactiveSidebar,\n\t\tshowBlockBreadcrumbs,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tisTopToolbar,\n\t\tisFocusMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editSiteStore );\n\t\tconst { isListViewOpened } = select( editorStore );\n\t\treturn {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisFocusMode: get( 'core', 'focusMode' ),\n\t\t\tisTopToolbar: get( 'core', 'fixedToolbar' ),\n\t\t};\n\t}, [] );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFocusMode ? __( 'Spotlight off.' ) : __( 'Spotlight on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-spotlight-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: isDistractionFree\n\t\t\t? __( 'Exit Distraction Free' )\n\t\t\t: __( 'Enter Distraction Free ' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggleDistractionFree();\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t}\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisTopToolbar\n\t\t\t\t\t? __( 'Top toolbar off.' )\n\t\t\t\t\t: __( 'Top toolbar on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-top-toolbar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tif ( editorMode === 'visual' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-code-editor',\n\t\t\tlabel: __( 'Open code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'text' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: isListViewOpen\n\t\t\t? __( 'Close List View' )\n\t\t\t: __( 'Open List View' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisListViewOpen ? __( 'List View off.' ) : __( 'List View on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-list-view/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction usePatternCommands() {\n\tconst { isLoaded, record: pattern } = useEditedEntityRecord();\n\tconst { openModal } = useDispatch( interfaceStore );\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( pattern?.type === 'wp_block' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/rename-pattern',\n\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\ticon: edit,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.rename );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t\tcommands.push( {\n\t\t\tname: 'core/duplicate-pattern',\n\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\ticon: symbol,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.duplicate );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/exit-code-editor',\n\t\thook: useEditorModeCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/patterns',\n\t\thook: usePatternCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACpD,SACCC,IAAI,EACJC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,YAAY,EACZC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,MAAM,QACA,kBAAkB;AACzB,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,cAAc,QAAQ,sBAAsB;AAC9D,SAASF,KAAK,IAAIG,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,aAAa,QAAQ,aAAa;AACpD,OAAOC,qBAAqB,MAAM,2CAA2C;AAC7E,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,oBAAoB,MAAM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AAC;IACHP,QAAQ,CAACC,IAAI,CAAE;MACdC,IAAI,EAAE,wBAAwB;MAC9BC,KAAK,EAAEzD,EAAE,CAAE,mBAAoB,CAAC;MAChC2D,IAAI,EAAE5C,MAAM;MACZ6C,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1B2B,SAAS,CAAEzD,cAAc,CAACiE,SAAU,CAAC;QACrCnC,KAAK,CAAC,CAAC;MACR;IACD,CAAE,CAAC;EACJ;EAEA,OAAO;IAAER,SAAS,EAAE,KAAK;IAAEC;EAAS,CAAC;AACtC;AAEA,OAAO,SAAS2C,mBAAmBA,CAAA,EAAG;EACrCjF,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,uBAAuB;IAC7B0C,IAAI,EAAEpC,qBAAqB;IAC3BqC,OAAO,EAAE;EACV,CAAE,CAAC;EAEHnF,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,mCAAmC;IACzC0C,IAAI,EAAE9D,2BAA2B;IACjC+D,OAAO,EAAE;EACV,CAAE,CAAC;EAEHnF,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,oCAAoC;IAC1C0C,IAAI,EAAEhC;EACP,CAAE,CAAC;EAEHlD,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,yBAAyB;IAC/B0C,IAAI,EAAEL,kBAAkB;IACxBM,OAAO,EAAE;EACV,CAAE,CAAC;EAEHnF,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,wBAAwB;IAC9B0C,IAAI,EAAExB;EACP,CAAE,CAAC;AACJ"}
1
+ {"version":3,"names":["useSelect","useDispatch","__","sprintf","isRTL","edit","trash","rotateLeft","rotateRight","layout","page","drawerLeft","drawerRight","blockDefault","code","keyboard","listView","symbol","useCommandLoader","decodeEntities","privateApis","routerPrivateApis","store","preferencesStore","interfaceStore","noticesStore","editorStore","editSiteStore","useEditedEntityRecord","isTemplateRemovable","isTemplateRevertable","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","PREFERENCES_MODAL_NAME","PATTERN_MODALS","unlock","TEMPLATE_POST_TYPE","useLink","useHistory","usePageContentFocusCommands","record","template","isPage","canvasMode","templateId","currentPostType","select","_isPage","getCanvasMode","getCurrentPostType","getCurrentTemplateId","onClick","editTemplate","postType","postId","setRenderingMode","isLoading","commands","push","name","label","title","icon","callback","close","useEditorModeCommands","switchEditorMode","editorMode","getEditorMode","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","type","path","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","toggleDistractionFree","setIsListViewOpened","activeSidebar","showBlockBreadcrumbs","isListViewOpen","isDistractionFree","isTopToolbar","isFocusMode","get","isListViewOpened","getActiveComplementaryArea","openModal","toggle","createInfoNotice","id","actions","usePatternCommands","pattern","rename","duplicate","useEditModeCommands","hook","context"],"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tedit,\n\ttrash,\n\trotateLeft,\n\trotateRight,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcode,\n\tkeyboard,\n\tlistView,\n\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { PATTERN_MODALS } from '../../components/pattern-modal';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { useLink } from '../../components/routes/link';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, templateId, currentPostType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisPage: _isPage(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\t\tcurrentPostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { onClick: editTemplate } = useLink( {\n\t\tpostType: 'wp_template',\n\t\tpostId: templateId,\n\t} );\n\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( currentPostType !== 'wp_template' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\tlabel: sprintf(\n\t\t\t\t/* translators: %s: template title */\n\t\t\t\t__( 'Edit template: %s' ),\n\t\t\t\tdecodeEntities( template.title )\n\t\t\t),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\teditTemplate();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-locked' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useEditorModeCommands() {\n\tconst { switchEditorMode } = useDispatch( editSiteStore );\n\tconst { canvasMode, editorMode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tif ( canvasMode !== 'edit' || editorMode !== 'text' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( editorMode === 'text' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/exit-code-editor',\n\t\t\tlabel: __( 'Exit code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'visual' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst isEditingPage = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editSiteStore ).isPage() &&\n\t\t\tselect( editorStore ).getCurrentPostType() !== 'wp_template',\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t\t__( 'Reset template: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\n\t\t\t\t\t\t__( 'Reset template part: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t\t__( 'Delete template: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: template part title */\n\t\t\t\t\t\t__( 'Delete template part: %s' ),\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tconst path =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\ttoggleDistractionFree,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t} = useDispatch( editSiteStore );\n\tconst {\n\t\tcanvasMode,\n\t\teditorMode,\n\t\tactiveSidebar,\n\t\tshowBlockBreadcrumbs,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t\tisTopToolbar,\n\t\tisFocusMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editSiteStore );\n\t\tconst { isListViewOpened } = select( editorStore );\n\t\treturn {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisFocusMode: get( 'core', 'focusMode' ),\n\t\t\tisTopToolbar: get( 'core', 'fixedToolbar' ),\n\t\t};\n\t}, [] );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFocusMode ? __( 'Spotlight off.' ) : __( 'Spotlight on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-spotlight-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: isDistractionFree\n\t\t\t? __( 'Exit Distraction Free' )\n\t\t\t: __( 'Enter Distraction Free ' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggleDistractionFree();\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t}\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisTopToolbar\n\t\t\t\t\t? __( 'Top toolbar off.' )\n\t\t\t\t\t: __( 'Top toolbar on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-top-toolbar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tif ( editorMode === 'visual' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-code-editor',\n\t\t\tlabel: __( 'Open code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'text' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: isListViewOpen\n\t\t\t? __( 'Close List View' )\n\t\t\t: __( 'Open List View' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisListViewOpen ? __( 'List View off.' ) : __( 'List View on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-list-view/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction usePatternCommands() {\n\tconst { isLoaded, record: pattern } = useEditedEntityRecord();\n\tconst { openModal } = useDispatch( interfaceStore );\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( pattern?.type === 'wp_block' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/rename-pattern',\n\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\ticon: edit,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.rename );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t\tcommands.push( {\n\t\t\tname: 'core/duplicate-pattern',\n\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\ticon: symbol,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.duplicate );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/exit-code-editor',\n\t\thook: useEditorModeCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/patterns',\n\t\thook: usePatternCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACpD,SACCC,IAAI,EACJC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,YAAY,EACZC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,MAAM,QACA,kBAAkB;AACzB,SAASC,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,cAAc,QAAQ,sBAAsB;AAC9D,SAASF,KAAK,IAAIG,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,aAAa,QAAQ,aAAa;AACpD,OAAOC,qBAAqB,MAAM,2CAA2C;AAC7E,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,iCAAiC,QAAQ,+CAA+C;AACjG,SAASC,sBAAsB,QAAQ,oCAAoC;AAC3E,SAASC,cAAc,QAAQ,gCAAgC;AAC/D,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,kBAAkB,QAAQ,uBAAuB;AAC1D,SAASC,OAAO,QAAQ,8BAA8B;AAEtD,MAAM;EAAEC;AAAW,CAAC,GAAGH,MAAM,CAAEb,iBAAkB,CAA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M;QAC1B2B,SAAS,CAAEzD,cAAc,CAACiE,SAAU,CAAC;QACrCnC,KAAK,CAAC,CAAC;MACR;IACD,CAAE,CAAC;EACJ;EAEA,OAAO;IAAER,SAAS,EAAE,KAAK;IAAEC;EAAS,CAAC;AACtC;AAEA,OAAO,SAAS2C,mBAAmBA,CAAA,EAAG;EACrCjF,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,uBAAuB;IAC7B0C,IAAI,EAAEpC,qBAAqB;IAC3BqC,OAAO,EAAE;EACV,CAAE,CAAC;EAEHnF,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,mCAAmC;IACzC0C,IAAI,EAAE9D,2BAA2B;IACjC+D,OAAO,EAAE;EACV,CAAE,CAAC;EAEHnF,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,oCAAoC;IAC1C0C,IAAI,EAAEhC;EACP,CAAE,CAAC;EAEHlD,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,yBAAyB;IAC/B0C,IAAI,EAAEL,kBAAkB;IACxBM,OAAO,EAAE;EACV,CAAE,CAAC;EAEHnF,gBAAgB,CAAE;IACjBwC,IAAI,EAAE,wBAAwB;IAC9B0C,IAAI,EAAExB;EACP,CAAE,CAAC;AACJ"}
@@ -23,6 +23,7 @@ export const setCanvasMode = mode => ({
23
23
  registry,
24
24
  dispatch
25
25
  }) => {
26
+ const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches;
26
27
  registry.dispatch(blockEditorStore).__unstableSetEditorMode('edit');
27
28
  dispatch({
28
29
  type: 'SET_CANVAS_MODE',
@@ -30,7 +31,8 @@ export const setCanvasMode = mode => ({
30
31
  });
31
32
  // Check if the block list view should be open by default.
32
33
  // If `distractionFree` mode is enabled, the block list view should not be open.
33
- if (mode === 'edit' && registry.select(preferencesStore).get('core', 'showListViewByDefault') && !registry.select(preferencesStore).get('core', 'distractionFree')) {
34
+ // This behavior is disabled for small viewports.
35
+ if (isMediumOrBigger && mode === 'edit' && registry.select(preferencesStore).get('core', 'showListViewByDefault') && !registry.select(preferencesStore).get('core', 'distractionFree')) {
34
36
  registry.dispatch(editorStore).setIsListViewOpened(true);
35
37
  } else {
36
38
  registry.dispatch(editorStore).setIsListViewOpened(false);
@@ -1 +1 @@
1
- {"version":3,"names":["store","blockEditorStore","preferencesStore","editorStore","coreStore","noticesStore","__","sprintf","decodeEntities","TEMPLATE_POST_TYPE","setCanvasMode","mode","registry","dispatch","__unstableSetEditorMode","type","select","get","setIsListViewOpened","setIsInserterOpened","setEditorCanvasContainerView","view","removeTemplates","items","isTemplate","promiseResult","Promise","allSettled","map","item","deleteEntityRecord","id","force","throwOnError","every","status","successMessage","length","title","rendered","createSuccessNotice","errorMessage","reason","message","errorMessages","Set","failedPromises","filter","failedPromise","add","size","join","createErrorNotice"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../utils/constants';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( true );\n\t\t} else {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t}\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n\n/**\n * Action that removes an array of templates.\n *\n * @param {Array} items An array of template or template part objects to remove.\n */\nexport const removeTemplates =\n\t( items ) =>\n\tasync ( { registry } ) => {\n\t\tconst isTemplate = items[ 0 ].type === TEMPLATE_POST_TYPE;\n\t\tconst promiseResult = await Promise.allSettled(\n\t\t\titems.map( ( item ) => {\n\t\t\t\treturn registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.deleteEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\titem.type,\n\t\t\t\t\t\titem.id,\n\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t);\n\t\t\t} )\n\t\t);\n\n\t\t// If all the promises were fulfilled with sucess.\n\t\tif ( promiseResult.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\t\tlet successMessage;\n\n\t\t\tif ( items.length === 1 ) {\n\t\t\t\t// Depending on how the entity was retrieved its title might be\n\t\t\t\t// an object or simple string.\n\t\t\t\tconst title =\n\t\t\t\t\ttypeof items[ 0 ].title === 'string'\n\t\t\t\t\t\t? items[ 0 ].title\n\t\t\t\t\t\t: items[ 0 ].title?.rendered;\n\t\t\t\tsuccessMessage = sprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tsuccessMessage = isTemplate\n\t\t\t\t\t? __( 'Templates deleted.' )\n\t\t\t\t\t: __( 'Template parts deleted.' );\n\t\t\t}\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( successMessage, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'site-editor-template-deleted-success',\n\t\t\t\t} );\n\t\t} else {\n\t\t\t// If there was at lease one failure.\n\t\t\tlet errorMessage;\n\t\t\t// If we were trying to delete a single template.\n\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? __( 'An error occurred while deleting the template.' )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the template part.'\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t// If we were trying to delete a multiple templates\n\t\t\t} else {\n\t\t\t\tconst errorMessages = new Set();\n\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t);\n\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\terrorMessages.add( failedPromise.reason.message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the templates.'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the template parts.'\n\t\t\t\t\t\t );\n\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the templates: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the template parts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the templates: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the template parts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t}\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;AACxD,SAASH,KAAK,IAAII,SAAS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AE,GAAI,CAC/B,CAAC,GACD5C,OAAO,EACP;QACAD,EAAE,CACD,4DACD,CAAC,EACD,CAAE,GAAGsC,aAAa,CAAE,CAACO,IAAI,CAAE,GAAI,CAC/B,CAAC;MACL;IACD;IACAvC,QAAQ,CACNC,QAAQ,CAAER,YAAa,CAAC,CACxB+C,iBAAiB,CAAEX,YAAY,EAAE;MAAE1B,IAAI,EAAE;IAAW,CAAE,CAAC;EAC1D;AACD,CAAC"}
1
+ {"version":3,"names":["store","blockEditorStore","preferencesStore","editorStore","coreStore","noticesStore","__","sprintf","decodeEntities","TEMPLATE_POST_TYPE","setCanvasMode","mode","registry","dispatch","isMediumOrBigger","window","matchMedia","matches","__unstableSetEditorMode","type","select","get","setIsListViewOpened","setIsInserterOpened","setEditorCanvasContainerView","view","removeTemplates","items","isTemplate","promiseResult","Promise","allSettled","map","item","deleteEntityRecord","id","force","throwOnError","every","status","successMessage","length","title","rendered","createSuccessNotice","errorMessage","reason","message","errorMessages","Set","failedPromises","filter","failedPromise","add","size","join","createErrorNotice"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../utils/constants';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tconst isMediumOrBigger =\n\t\t\twindow.matchMedia( '(min-width: 782px)' ).matches;\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\t// This behavior is disabled for small viewports.\n\t\tif (\n\t\t\tisMediumOrBigger &&\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( true );\n\t\t} else {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t}\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n\n/**\n * Action that removes an array of templates.\n *\n * @param {Array} items An array of template or template part objects to remove.\n */\nexport const removeTemplates =\n\t( items ) =>\n\tasync ( { registry } ) => {\n\t\tconst isTemplate = items[ 0 ].type === TEMPLATE_POST_TYPE;\n\t\tconst promiseResult = await Promise.allSettled(\n\t\t\titems.map( ( item ) => {\n\t\t\t\treturn registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.deleteEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\titem.type,\n\t\t\t\t\t\titem.id,\n\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t);\n\t\t\t} )\n\t\t);\n\n\t\t// If all the promises were fulfilled with sucess.\n\t\tif ( promiseResult.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\t\tlet successMessage;\n\n\t\t\tif ( items.length === 1 ) {\n\t\t\t\t// Depending on how the entity was retrieved its title might be\n\t\t\t\t// an object or simple string.\n\t\t\t\tconst title =\n\t\t\t\t\ttypeof items[ 0 ].title === 'string'\n\t\t\t\t\t\t? items[ 0 ].title\n\t\t\t\t\t\t: items[ 0 ].title?.rendered;\n\t\t\t\tsuccessMessage = sprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tsuccessMessage = isTemplate\n\t\t\t\t\t? __( 'Templates deleted.' )\n\t\t\t\t\t: __( 'Template parts deleted.' );\n\t\t\t}\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( successMessage, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'site-editor-template-deleted-success',\n\t\t\t\t} );\n\t\t} else {\n\t\t\t// If there was at lease one failure.\n\t\t\tlet errorMessage;\n\t\t\t// If we were trying to delete a single template.\n\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? __( 'An error occurred while deleting the template.' )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the template part.'\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t// If we were trying to delete a multiple templates\n\t\t\t} else {\n\t\t\t\tconst errorMessages = new Set();\n\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t);\n\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\terrorMessages.add( failedPromise.reason.message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the templates.'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'An error occurred while deleting the template parts.'\n\t\t\t\t\t\t );\n\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the templates: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the template parts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isTemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the templates: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the template parts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t}\n\t\t\tregistry\n\t\t\t\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AK,CAAC,EAAG;QACtCT,YAAY,GAAGjB,UAAU,GACtBrB,OAAO,EACP;QACAD,EAAE,CACD,oDACD,CAAC,EACD,CAAE,GAAG0C,aAAa,CAAE,CAAE,CAAC,CACvB,CAAC,GACDzC,OAAO,EACP;QACAD,EAAE,CACD,yDACD,CAAC,EACD,CAAE,GAAG0C,aAAa,CAAE,CAAE,CAAC,CACvB,CAAC;MACL,CAAC,MAAM;QACNH,YAAY,GAAGjB,UAAU,GACtBrB,OAAO,EACP;QACAD,EAAE,CACD,uDACD,CAAC,EACD,CAAE,GAAG0C,aAAa,CAAE,CAACO,IAAI,CAAE,GAAI,CAC/B,CAAC,GACDhD,OAAO,EACP;QACAD,EAAE,CACD,4DACD,CAAC,EACD,CAAE,GAAG0C,aAAa,CAAE,CAACO,IAAI,CAAE,GAAI,CAC/B,CAAC;MACL;IACD;IACA3C,QAAQ,CACNC,QAAQ,CAAER,YAAa,CAAC,CACxBmD,iBAAiB,CAAEX,YAAY,EAAE;MAAE1B,IAAI,EAAE;IAAW,CAAE,CAAC;EAC1D;AACD,CAAC"}
@@ -1806,7 +1806,7 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1806
1806
  .edit-site-global-styles-screen-revisions__revision-item.is-selected::before {
1807
1807
  background: var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
1808
1808
  }
1809
- .edit-site-global-styles-screen-revisions__revision-item.is-selected .edit-site-global-styles-screen-revisions__changes,
1809
+ .edit-site-global-styles-screen-revisions__revision-item.is-selected .edit-site-global-styles-screen-revisions__changes > li,
1810
1810
  .edit-site-global-styles-screen-revisions__revision-item.is-selected .edit-site-global-styles-screen-revisions__meta,
1811
1811
  .edit-site-global-styles-screen-revisions__revision-item.is-selected .edit-site-global-styles-screen-revisions__applied-text {
1812
1812
  color: #1e1e1e;
@@ -1828,7 +1828,7 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1828
1828
  width: 100%;
1829
1829
  height: auto;
1830
1830
  display: block;
1831
- padding: 12px 40px 8px 12px;
1831
+ padding: 12px 40px 4px 12px;
1832
1832
  z-index: 1;
1833
1833
  position: relative;
1834
1834
  outline-offset: -2px;
@@ -1837,7 +1837,7 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1837
1837
  .edit-site-global-styles-screen-revisions__apply-button.is-primary,
1838
1838
  .edit-site-global-styles-screen-revisions__applied-text {
1839
1839
  align-self: flex-start;
1840
- margin: 0 40px 12px 12px;
1840
+ margin: 4px 40px 12px 12px;
1841
1841
  }
1842
1842
 
1843
1843
  .edit-site-global-styles-screen-revisions__changes,
@@ -1859,15 +1859,14 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1859
1859
  font-size: 12px;
1860
1860
  }
1861
1861
 
1862
- .edit-site-global-styles-screen-revisions__changes,
1863
1862
  .edit-site-global-styles-screen-revisions__meta {
1864
1863
  display: flex;
1865
1864
  justify-content: start;
1866
1865
  width: 100%;
1867
1866
  align-items: flex-start;
1868
1867
  text-align: right;
1868
+ margin-bottom: 4px;
1869
1869
  }
1870
- .edit-site-global-styles-screen-revisions__changes img,
1871
1870
  .edit-site-global-styles-screen-revisions__meta img {
1872
1871
  width: 16px;
1873
1872
  height: 16px;
@@ -1880,10 +1879,13 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1880
1879
  }
1881
1880
 
1882
1881
  .edit-site-global-styles-screen-revisions__changes {
1883
- margin-bottom: 4px;
1884
1882
  text-align: right;
1885
- color: #1e1e1e;
1886
1883
  line-height: 1.4;
1884
+ margin-right: 12px;
1885
+ list-style: disc;
1886
+ }
1887
+ .edit-site-global-styles-screen-revisions__changes li {
1888
+ margin-bottom: 4px;
1887
1889
  }
1888
1890
 
1889
1891
  .edit-site-global-styles-screen-revisions__pagination.edit-site-global-styles-screen-revisions__pagination {
@@ -2587,6 +2589,14 @@ body.is-fullscreen-mode .edit-site-list-header {
2587
2589
  * DataViews patterns styles.
2588
2590
  * TODO: when this becomes stable, consolidate styles with the above.
2589
2591
  */
2592
+ .edit-site-page-patterns-dataviews {
2593
+ margin-top: 60px;
2594
+ }
2595
+ @media (min-width: 782px) {
2596
+ .edit-site-page-patterns-dataviews {
2597
+ margin-top: 0;
2598
+ }
2599
+ }
2590
2600
  .edit-site-page-patterns-dataviews .page-patterns-preview-field {
2591
2601
  display: flex;
2592
2602
  flex-direction: column;
@@ -2635,6 +2645,9 @@ body.is-fullscreen-mode .edit-site-list-header {
2635
2645
  text-overflow: ellipsis;
2636
2646
  color: inherit;
2637
2647
  }
2648
+ .edit-site-page-patterns-dataviews .dataviews-pagination {
2649
+ z-index: 2;
2650
+ }
2638
2651
 
2639
2652
  .dataviews-action-modal__duplicate-pattern [role=dialog] > [role=document] {
2640
2653
  width: 350px;
@@ -2712,6 +2725,10 @@ body.is-fullscreen-mode .edit-site-list-header {
2712
2725
  white-space: normal;
2713
2726
  }
2714
2727
 
2728
+ .edit-site-page-template-template-parts-dataviews .dataviews-pagination {
2729
+ z-index: 2;
2730
+ }
2731
+
2715
2732
  .edit-site-table-wrapper {
2716
2733
  width: 100%;
2717
2734
  padding: 32px;
@@ -2856,7 +2873,6 @@ body.is-fullscreen-mode .edit-site-list-header {
2856
2873
  }
2857
2874
  .edit-site-change-status__content .edit-site-change-status__options label .components-text {
2858
2875
  display: block;
2859
- margin-right: 26px;
2860
2876
  }
2861
2877
  .edit-site-change-status__content .edit-site-change-status__password-legend {
2862
2878
  padding: 0;
@@ -3308,6 +3324,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3308
3324
  flex-direction: column;
3309
3325
  }
3310
3326
 
3327
+ .edit-site-layout__mobile {
3328
+ position: relative;
3329
+ width: 100%;
3330
+ z-index: 2;
3331
+ }
3332
+
3311
3333
  .edit-site-layout__canvas-container {
3312
3334
  position: relative;
3313
3335
  flex-grow: 1;
@@ -3361,6 +3383,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3361
3383
  border-radius: 0;
3362
3384
  }
3363
3385
 
3386
+ .edit-site-layout__mobile .interface-interface-skeleton,
3364
3387
  .edit-site-layout__canvas .interface-interface-skeleton,
3365
3388
  .edit-site-template-pages-preview .interface-interface-skeleton {
3366
3389
  position: relative !important;
@@ -4289,9 +4312,8 @@ body:has(.edit-site-resizable-frame__inner.is-resizing) {
4289
4312
  background-color: #fff;
4290
4313
  }
4291
4314
 
4292
- .font-library-modal__fonts-grid .font-library-modal__fonts-grid__main {
4293
- display: flex;
4294
- flex-direction: column;
4315
+ .font-library-modal__tabpanel-layout .components-base-control__field {
4316
+ margin-bottom: 0;
4295
4317
  }
4296
4318
 
4297
4319
  .font-library-modal__font-card {
@@ -1807,7 +1807,7 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1807
1807
  .edit-site-global-styles-screen-revisions__revision-item.is-selected::before {
1808
1808
  background: var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
1809
1809
  }
1810
- .edit-site-global-styles-screen-revisions__revision-item.is-selected .edit-site-global-styles-screen-revisions__changes,
1810
+ .edit-site-global-styles-screen-revisions__revision-item.is-selected .edit-site-global-styles-screen-revisions__changes > li,
1811
1811
  .edit-site-global-styles-screen-revisions__revision-item.is-selected .edit-site-global-styles-screen-revisions__meta,
1812
1812
  .edit-site-global-styles-screen-revisions__revision-item.is-selected .edit-site-global-styles-screen-revisions__applied-text {
1813
1813
  color: #1e1e1e;
@@ -1829,7 +1829,7 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1829
1829
  width: 100%;
1830
1830
  height: auto;
1831
1831
  display: block;
1832
- padding: 12px 12px 8px 40px;
1832
+ padding: 12px 12px 4px 40px;
1833
1833
  z-index: 1;
1834
1834
  position: relative;
1835
1835
  outline-offset: -2px;
@@ -1838,7 +1838,7 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1838
1838
  .edit-site-global-styles-screen-revisions__apply-button.is-primary,
1839
1839
  .edit-site-global-styles-screen-revisions__applied-text {
1840
1840
  align-self: flex-start;
1841
- margin: 0 12px 12px 40px;
1841
+ margin: 4px 12px 12px 40px;
1842
1842
  }
1843
1843
 
1844
1844
  .edit-site-global-styles-screen-revisions__changes,
@@ -1860,15 +1860,14 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1860
1860
  font-size: 12px;
1861
1861
  }
1862
1862
 
1863
- .edit-site-global-styles-screen-revisions__changes,
1864
1863
  .edit-site-global-styles-screen-revisions__meta {
1865
1864
  display: flex;
1866
1865
  justify-content: start;
1867
1866
  width: 100%;
1868
1867
  align-items: flex-start;
1869
1868
  text-align: left;
1869
+ margin-bottom: 4px;
1870
1870
  }
1871
- .edit-site-global-styles-screen-revisions__changes img,
1872
1871
  .edit-site-global-styles-screen-revisions__meta img {
1873
1872
  width: 16px;
1874
1873
  height: 16px;
@@ -1881,10 +1880,13 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
1881
1880
  }
1882
1881
 
1883
1882
  .edit-site-global-styles-screen-revisions__changes {
1884
- margin-bottom: 4px;
1885
1883
  text-align: left;
1886
- color: #1e1e1e;
1887
1884
  line-height: 1.4;
1885
+ margin-left: 12px;
1886
+ list-style: disc;
1887
+ }
1888
+ .edit-site-global-styles-screen-revisions__changes li {
1889
+ margin-bottom: 4px;
1888
1890
  }
1889
1891
 
1890
1892
  .edit-site-global-styles-screen-revisions__pagination.edit-site-global-styles-screen-revisions__pagination {
@@ -2588,6 +2590,14 @@ body.is-fullscreen-mode .edit-site-list-header {
2588
2590
  * DataViews patterns styles.
2589
2591
  * TODO: when this becomes stable, consolidate styles with the above.
2590
2592
  */
2593
+ .edit-site-page-patterns-dataviews {
2594
+ margin-top: 60px;
2595
+ }
2596
+ @media (min-width: 782px) {
2597
+ .edit-site-page-patterns-dataviews {
2598
+ margin-top: 0;
2599
+ }
2600
+ }
2591
2601
  .edit-site-page-patterns-dataviews .page-patterns-preview-field {
2592
2602
  display: flex;
2593
2603
  flex-direction: column;
@@ -2636,6 +2646,9 @@ body.is-fullscreen-mode .edit-site-list-header {
2636
2646
  text-overflow: ellipsis;
2637
2647
  color: inherit;
2638
2648
  }
2649
+ .edit-site-page-patterns-dataviews .dataviews-pagination {
2650
+ z-index: 2;
2651
+ }
2639
2652
 
2640
2653
  .dataviews-action-modal__duplicate-pattern [role=dialog] > [role=document] {
2641
2654
  width: 350px;
@@ -2713,6 +2726,10 @@ body.is-fullscreen-mode .edit-site-list-header {
2713
2726
  white-space: normal;
2714
2727
  }
2715
2728
 
2729
+ .edit-site-page-template-template-parts-dataviews .dataviews-pagination {
2730
+ z-index: 2;
2731
+ }
2732
+
2716
2733
  .edit-site-table-wrapper {
2717
2734
  width: 100%;
2718
2735
  padding: 32px;
@@ -2857,7 +2874,6 @@ body.is-fullscreen-mode .edit-site-list-header {
2857
2874
  }
2858
2875
  .edit-site-change-status__content .edit-site-change-status__options label .components-text {
2859
2876
  display: block;
2860
- margin-left: 26px;
2861
2877
  }
2862
2878
  .edit-site-change-status__content .edit-site-change-status__password-legend {
2863
2879
  padding: 0;
@@ -3309,6 +3325,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3309
3325
  flex-direction: column;
3310
3326
  }
3311
3327
 
3328
+ .edit-site-layout__mobile {
3329
+ position: relative;
3330
+ width: 100%;
3331
+ z-index: 2;
3332
+ }
3333
+
3312
3334
  .edit-site-layout__canvas-container {
3313
3335
  position: relative;
3314
3336
  flex-grow: 1;
@@ -3362,6 +3384,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
3362
3384
  border-radius: 0;
3363
3385
  }
3364
3386
 
3387
+ .edit-site-layout__mobile .interface-interface-skeleton,
3365
3388
  .edit-site-layout__canvas .interface-interface-skeleton,
3366
3389
  .edit-site-template-pages-preview .interface-interface-skeleton {
3367
3390
  position: relative !important;
@@ -4290,9 +4313,8 @@ body:has(.edit-site-resizable-frame__inner.is-resizing) {
4290
4313
  background-color: #fff;
4291
4314
  }
4292
4315
 
4293
- .font-library-modal__fonts-grid .font-library-modal__fonts-grid__main {
4294
- display: flex;
4295
- flex-direction: column;
4316
+ .font-library-modal__tabpanel-layout .components-base-control__field {
4317
+ margin-bottom: 0;
4296
4318
  }
4297
4319
 
4298
4320
  .font-library-modal__font-card {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.28.1",
3
+ "version": "5.28.3",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,46 +27,46 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.51.0",
31
- "@wordpress/api-fetch": "^6.48.0",
32
- "@wordpress/blob": "^3.51.0",
33
- "@wordpress/block-editor": "^12.19.1",
34
- "@wordpress/block-library": "^8.28.1",
35
- "@wordpress/blocks": "^12.28.1",
36
- "@wordpress/commands": "^0.22.1",
37
- "@wordpress/components": "^26.0.1",
38
- "@wordpress/compose": "^6.28.0",
39
- "@wordpress/core-commands": "^0.20.1",
40
- "@wordpress/core-data": "^6.28.1",
41
- "@wordpress/data": "^9.21.0",
42
- "@wordpress/dataviews": "^0.5.1",
43
- "@wordpress/date": "^4.51.0",
44
- "@wordpress/deprecated": "^3.51.0",
45
- "@wordpress/dom": "^3.51.0",
46
- "@wordpress/editor": "^13.28.1",
47
- "@wordpress/element": "^5.28.0",
48
- "@wordpress/escape-html": "^2.51.0",
49
- "@wordpress/hooks": "^3.51.0",
50
- "@wordpress/html-entities": "^3.51.0",
51
- "@wordpress/i18n": "^4.51.0",
52
- "@wordpress/icons": "^9.42.0",
53
- "@wordpress/interface": "^5.28.1",
54
- "@wordpress/keyboard-shortcuts": "^4.28.0",
55
- "@wordpress/keycodes": "^3.51.0",
56
- "@wordpress/media-utils": "^4.42.0",
57
- "@wordpress/notices": "^4.19.0",
58
- "@wordpress/patterns": "^1.12.1",
59
- "@wordpress/plugins": "^6.19.1",
60
- "@wordpress/preferences": "^3.28.1",
61
- "@wordpress/primitives": "^3.49.0",
62
- "@wordpress/private-apis": "^0.33.0",
63
- "@wordpress/reusable-blocks": "^4.28.1",
64
- "@wordpress/router": "^0.20.0",
65
- "@wordpress/style-engine": "^1.34.0",
66
- "@wordpress/url": "^3.52.0",
67
- "@wordpress/viewport": "^5.28.0",
68
- "@wordpress/widgets": "^3.28.1",
69
- "@wordpress/wordcount": "^3.51.0",
30
+ "@wordpress/a11y": "^3.51.1",
31
+ "@wordpress/api-fetch": "^6.48.1",
32
+ "@wordpress/blob": "^3.51.1",
33
+ "@wordpress/block-editor": "^12.19.3",
34
+ "@wordpress/block-library": "^8.28.3",
35
+ "@wordpress/blocks": "^12.28.3",
36
+ "@wordpress/commands": "^0.22.2",
37
+ "@wordpress/components": "^26.0.2",
38
+ "@wordpress/compose": "^6.28.1",
39
+ "@wordpress/core-commands": "^0.20.3",
40
+ "@wordpress/core-data": "^6.28.3",
41
+ "@wordpress/data": "^9.21.1",
42
+ "@wordpress/dataviews": "^0.5.3",
43
+ "@wordpress/date": "^4.51.1",
44
+ "@wordpress/deprecated": "^3.51.1",
45
+ "@wordpress/dom": "^3.51.1",
46
+ "@wordpress/editor": "^13.28.3",
47
+ "@wordpress/element": "^5.28.1",
48
+ "@wordpress/escape-html": "^2.51.1",
49
+ "@wordpress/hooks": "^3.51.1",
50
+ "@wordpress/html-entities": "^3.51.1",
51
+ "@wordpress/i18n": "^4.51.1",
52
+ "@wordpress/icons": "^9.42.1",
53
+ "@wordpress/interface": "^5.28.2",
54
+ "@wordpress/keyboard-shortcuts": "^4.28.1",
55
+ "@wordpress/keycodes": "^3.51.1",
56
+ "@wordpress/media-utils": "^4.42.1",
57
+ "@wordpress/notices": "^4.19.1",
58
+ "@wordpress/patterns": "^1.12.3",
59
+ "@wordpress/plugins": "^6.19.2",
60
+ "@wordpress/preferences": "^3.28.2",
61
+ "@wordpress/primitives": "^3.49.1",
62
+ "@wordpress/private-apis": "^0.33.1",
63
+ "@wordpress/reusable-blocks": "^4.28.3",
64
+ "@wordpress/router": "^0.20.1",
65
+ "@wordpress/style-engine": "^1.34.1",
66
+ "@wordpress/url": "^3.52.1",
67
+ "@wordpress/viewport": "^5.28.1",
68
+ "@wordpress/widgets": "^3.28.3",
69
+ "@wordpress/wordcount": "^3.51.1",
70
70
  "change-case": "^4.1.2",
71
71
  "classnames": "^2.3.1",
72
72
  "colord": "^2.9.2",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "5902fc0f490528da6965dd4cf97f11192bcf5956"
88
+ "gitHead": "b12d75c5c5256fda2a0509bb432e20ddd3354d5e"
89
89
  }