Skip to content

Commit

Permalink
Block-editor: Auto-register block commands (#59079)
Browse files Browse the repository at this point in the history
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
Co-authored-by: draganescu <andraganescu@git.wordpress.org>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent d46d7a1 commit c57b5e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/block-editor/src/components/block-canvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Iframe from '../iframe';
import WritingFlow from '../writing-flow';
import { useMouseMoveTypingReset } from '../observe-typing';
import { useBlockSelectionClearer } from '../block-selection-clearer';
import { useBlockCommands } from '../use-block-commands';

export function ExperimentalBlockCanvas( {
shouldIframe = true,
Expand All @@ -23,6 +24,7 @@ export function ExperimentalBlockCanvas( {
contentRef: contentRefProp,
iframeProps,
} ) {
useBlockCommands();
const resetTypingRef = useMouseMoveTypingReset();
const clearerRef = useBlockSelectionClearer();
const localRef = useRef();
Expand Down
2 changes: 0 additions & 2 deletions packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
} from '@wordpress/editor';
import { useSelect, useDispatch } from '@wordpress/data';
import {
useBlockCommands,
BlockBreadcrumb,
BlockToolbar,
privateApis as blockEditorPrivateApis,
Expand Down Expand Up @@ -134,7 +133,6 @@ function useEditorStyles() {
function Layout( { initialPost } ) {
useCommands();
useCommonCommands();
useBlockCommands();

const isMobileViewport = useViewportMatch( 'medium', '<' );
const isHugeViewport = useViewportMatch( 'huge', '>=' );
Expand Down
2 changes: 0 additions & 2 deletions packages/edit-site/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
import { store as preferencesStore } from '@wordpress/preferences';
import {
privateApis as blockEditorPrivateApis,
useBlockCommands,
store as blockEditorStore,
} from '@wordpress/block-editor';
import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';
Expand Down Expand Up @@ -66,7 +65,6 @@ export default function Layout() {
useCommands();
useEditModeCommands();
useCommonCommands();
useBlockCommands();

const isMobileViewport = useViewportMatch( 'medium', '<' );

Expand Down

1 comment on commit c57b5e4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in c57b5e4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7920887344
📝 Reported issues:

Please sign in to comment.