Skip to content

Commit 741ac3d

Browse files
dcalhounclaude
andcommitted
fix: replace deprecated EditorSnackbars with SnackbarNotices
`wp.editor.EditorSnackbars` is deprecated since @wordpress/editor v7.0 and will be removed in v7.2. Replace with `wp.notices.SnackbarNotices`, using a project-owned `gutenberg-kit-layout__snackbar` class and moving the positioning styles to layout/style.scss. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6d5eb0a commit 741ac3d

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

src/components/editor/style.scss

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,3 @@ button {
3737
font-size: inherit;
3838
font-weight: inherit;
3939
}
40-
41-
.gutenberg-kit-editor .components-editor-notices__snackbar {
42-
bottom: 58px;
43-
left: 0;
44-
padding-right: 8px;
45-
padding-left: 8px;
46-
position: fixed;
47-
right: 0;
48-
}

src/components/layout/index.jsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import {
5-
EditorSnackbars,
6-
ErrorBoundary,
7-
AutosaveMonitor,
8-
} from '@wordpress/editor';
4+
import { ErrorBoundary, AutosaveMonitor } from '@wordpress/editor';
5+
import { SnackbarNotices } from '@wordpress/notices';
96

107
/**
118
* Internal dependencies
@@ -32,7 +29,7 @@ export default function Layout( props ) {
3229
<OfflineIndicator />
3330
<AutosaveMonitor autosave={ onEditorContentChanged } />
3431
<Editor { ...editorProps }>
35-
<EditorSnackbars />
32+
<SnackbarNotices className="gutenberg-kit-layout__snackbar" />
3633
</Editor>
3734
<EditorLoadNotice
3835
className="gutenberg-kit-layout__load-notice"

src/components/layout/style.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
.gutenberg-kit-layout__snackbar {
2+
bottom: 58px;
3+
left: 0;
4+
padding-right: 8px;
5+
padding-left: 8px;
6+
position: fixed;
7+
right: 0;
8+
}
9+
110
.gutenberg-kit-layout__load-notice {
211
bottom: 62px;
312
left: 16px;

0 commit comments

Comments
 (0)