Skip to content

Commit c050b4d

Browse files
authored
build: Upgrade WordPress packages (#66)
* build: Upgrade development dependencies * build: Upgrade @wordpress/icons * build: Upgrade @wordpress/base-styles * build: Upgrade @wordpress/preferences * build: Upgrade remaining WordPress packages Most of these depend upon one another and must be upgraded together. * fix: Ensure block canvas background color renders behind child margins The `display: flex;` declaration was removed in core: WordPress/gutenberg#66706 Its removal causes the post title's margin to extend beyond its parent boundaries, which caused the background color to not render the entire height of the editor. * refactor: Improve class name accuracy Rename classes to match component file names. * build: Downgrade eslint The latest version is incompatible with Gutenberg ESLint configuration. * Revert "build: Upgrade development dependencies" This reverts commit 147de47. * build: Upgrade non-ESLint development dependencies Postpone ESLint upgrades due to various configuration conflicts. * build: Upgrade eslint-plugin-react-refresh * build: Upgrade @wordpress/eslint-plugin * fix: Ensure block canvas fills its parent container width This resolves a regression introduced from changes in the following PR. Ideally we resolve this issue in Gutenberg core, rather than overriding the styles within GutenbergKit. WordPress/gutenberg#66706 * fix: Denote auto-draft status If Apple and Google allowed programmatic focus of interactive elements in web views, this would ensure the post title field is focused for new drafts. However, Apple and Google require user interaction--e.g., taps--for the virtual keyboard to display. Regardless, denoting the auto-draft status is likely still worthwhile.
1 parent fb31301 commit c050b4d

File tree

9 files changed

+1108
-1019
lines changed

9 files changed

+1108
-1019
lines changed

Diff for: package-lock.json

+1,046-975
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@
1515
},
1616
"dependencies": {
1717
"@wordpress/api-fetch": "^7.10",
18-
"@wordpress/base-styles": "^5.14.0",
18+
"@wordpress/base-styles": "^5.16.0",
1919
"@wordpress/block-editor": "^14.5",
2020
"@wordpress/block-library": "^9.10",
2121
"@wordpress/core-data": "^7.10",
22-
"@wordpress/edit-post": "^8.10",
22+
"@wordpress/edit-post": "^8.16.0",
2323
"@wordpress/editor": "^14.10",
2424
"@wordpress/element": "^6.10",
25-
"@wordpress/format-library": "^5.10",
26-
"@wordpress/icons": "^10.12.0",
27-
"@wordpress/preferences": "^4.10",
25+
"@wordpress/format-library": "^5.16.0",
26+
"@wordpress/icons": "^10.16.0",
27+
"@wordpress/preferences": "^4.16.0",
2828
"@wordpress/private-apis": "^1.10",
2929
"@wordpress/rich-text": "^7.16.0",
3030
"clsx": "^2.1.1",
3131
"vite-plugin-node-polyfills": "^0.23.0"
3232
},
3333
"devDependencies": {
34-
"@types/react": "^18.3",
35-
"@types/react-dom": "^18.3",
34+
"@types/react": "^19.0.8",
35+
"@types/react-dom": "^19.0.3",
3636
"@vitejs/plugin-react": "^4.3.4",
37-
"@wordpress/dependency-extraction-webpack-plugin": "^6.6",
38-
"@wordpress/eslint-plugin": "^21.5.0",
39-
"@wordpress/prettier-config": "^4.3",
37+
"@wordpress/dependency-extraction-webpack-plugin": "^6.16.0",
38+
"@wordpress/eslint-plugin": "^22.2.0",
39+
"@wordpress/prettier-config": "^4.16.0",
4040
"eslint": "^8.57",
41-
"eslint-plugin-react-refresh": "^0.4",
42-
"magic-string": "^0.30",
41+
"eslint-plugin-react-refresh": "^0.4.18",
42+
"magic-string": "^0.30.17",
4343
"patch-package": "^8.0.0",
44-
"prettier": "^3.3",
45-
"sass-embedded": "^1.83.0",
46-
"vite": "^6.0.3"
44+
"prettier": "^3.4.2",
45+
"sass-embedded": "^1.83.4",
46+
"vite": "^6.0.11"
4747
}
4848
}

Diff for: patches/@wordpress+editor+14.10.0.patch renamed to patches/@wordpress+editor+14.16.0.patch

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/@wordpress/editor/build-module/private-apis.js b/node_modules/@wordpress/editor/build-module/private-apis.js
2-
index eb169ff..2b8528b 100644
2+
index c45347e..ab39c50 100644
33
--- a/node_modules/@wordpress/editor/build-module/private-apis.js
44
+++ b/node_modules/@wordpress/editor/build-module/private-apis.js
55
@@ -9,6 +9,7 @@ import * as interfaceApis from '@wordpress/interface';
@@ -8,11 +8,11 @@ index eb169ff..2b8528b 100644
88
import EditorContentSlotFill from './components/editor-interface/content-slot-fill';
99
+import useBlockEditorSettings from './components/provider/use-block-editor-settings';
1010
import BackButton from './components/header/back-button';
11-
import CreateTemplatePartModal from './components/create-template-part-modal';
1211
import Editor from './components/editor';
13-
@@ -43,6 +44,7 @@ lock(privateApis, {
14-
ResizableEditor,
12+
import PluginPostExcerpt from './components/post-excerpt/plugin';
13+
@@ -47,6 +48,7 @@ lock(privateApis, {
1514
registerCoreBlockBindingsSources,
15+
getTemplateInfo,
1616
// This is a temporary private API while we're updating the site editor to use EditorProvider.
1717
+ useBlockEditorSettings,
1818
interfaceStore,

Diff for: src/components/editor/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export default function Editor({ post, children }) {
6666
}, []);
6767

6868
return (
69-
<div className="gutenberg-kit-editor-interface">
70-
<EditorLoadNotice className="gutenberg-kit-editor-interface__load-notice" />
69+
<div className="gutenberg-kit-editor">
70+
<EditorLoadNotice className="gutenberg-kit-editor__load-notice" />
7171
<BlockEditorProvider
7272
value={postBlocks}
7373
onInput={onInput}

Diff for: src/components/editor/style.scss

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
$baseline-interactive-font-size: 17px;
22
$min-menu-item-touch-target-size: 42px;
33

4-
.gutenberg-kit-editor-interface {
4+
.gutenberg-kit-editor {
55
-webkit-tap-highlight-color: transparent; // Rely upon UI components to communicate touch feedback
66
flex-grow: 1;
77
}
88

9-
.gutenberg-kit-editor-interface__load-notice {
9+
.gutenberg-kit-editor__load-notice {
1010
bottom: 62px;
1111
left: 16px;
1212
position: fixed;
1313
right: 16px;
1414
}
1515

16-
.gutenberg-kit-editor-interface .components-button {
16+
.gutenberg-kit-editor .components-button {
1717
font-size: $baseline-interactive-font-size;
1818
}
1919

20-
.gutenberg-kit-editor-interface .components-dropdown-menu__menu-item,
21-
.gutenberg-kit-editor-interface
20+
.gutenberg-kit-editor .components-dropdown-menu__menu-item,
21+
.gutenberg-kit-editor
2222
.components-dropdown-menu__menu
2323
.components-menu-item__button,
24-
.gutenberg-kit-editor-interface
24+
.gutenberg-kit-editor
2525
.components-dropdown-menu__menu
2626
.components-menu-item__button.components-button {
2727
min-height: $min-menu-item-touch-target-size;
2828
}
2929

30-
.gutenberg-kit-editor-interface
31-
.components-autocomplete__result.components-button {
30+
.gutenberg-kit-editor .components-autocomplete__result.components-button {
3231
min-height: $min-menu-item-touch-target-size;
3332
}

Diff for: src/components/visual-editor/default-theme-styles.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* unavailable or when the editor's theme styles feature is disabled.
44
*/
55

6-
.editor-visual-editor__post-title-wrapper .wp-block-post-title {
6+
.gutenberg-kit-visual-editor__post-title-wrapper .wp-block-post-title {
77
font-size: 20px; // Set reasonable default size for small screens
88
}
99

Diff for: src/components/visual-editor/index.jsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,15 @@ function VisualEditor({ useRootPaddingAwareAlignments }) {
5656

5757
const styles = useEditorStyles();
5858

59-
const editorClasses = clsx('gutenberg-kit-editor', {
59+
const editorClasses = clsx('gutenberg-kit-visual-editor', {
6060
'has-root-padding': !useRootPaddingAwareAlignments,
6161
});
62-
const titleClasses = clsx('editor-visual-editor__post-title-wrapper', {
63-
'has-global-padding': useRootPaddingAwareAlignments,
64-
});
62+
const titleClasses = clsx(
63+
'gutenberg-kit-visual-editor__post-title-wrapper',
64+
{
65+
'has-global-padding': useRootPaddingAwareAlignments,
66+
}
67+
);
6568
const blockListClasses = clsx({
6669
'has-global-padding': useRootPaddingAwareAlignments,
6770
});
@@ -76,7 +79,7 @@ function VisualEditor({ useRootPaddingAwareAlignments }) {
7679
</BlockCanvas>
7780

7881
{isEditorReady && (
79-
<EditorToolbar className="gutenberg-kit-editor__toolbar" />
82+
<EditorToolbar className="gutenberg-kit-visual-editor__toolbar" />
8083
)}
8184

8285
<Popover.Slot />

Diff for: src/components/visual-editor/style.scss

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.gutenberg-kit-editor {
1+
.gutenberg-kit-visual-editor {
22
box-sizing: border-box;
33
flex-shrink: 0;
44
height: 100%;
@@ -9,22 +9,38 @@
99
width: 100%;
1010
}
1111

12-
.gutenberg-kit-editor .editor-styles-wrapper {
12+
// TODO: Replace this `display` style--which ensures children margins are
13+
// contained, rendering the background color behind them--with a proper fix in
14+
// core.
15+
//
16+
// See the following related changes:
17+
// - https://github.com/WordPress/gutenberg/pull/66706
18+
// - https://github.com/WordPress/gutenberg/pull/66390
19+
.gutenberg-kit-visual-editor .block-editor-block-canvas {
20+
display: flex;
21+
}
22+
23+
.gutenberg-kit-visual-editor .editor-styles-wrapper {
1324
// Ensure the toolbar does not overlap the content
1425
padding-bottom: 56px;
1526
// Remove outline to mirror default user agent styles for body elements, which
1627
// is the element used for Gutenberg's iframed editor
1728
outline: none;
29+
// TODO: Ideally we resolve this in Gutenberg core. Ensures the styles wrapper
30+
// fills its parent container.
31+
//
32+
// See: https://github.com/WordPress/gutenberg/pull/66706
33+
width: 100%;
1834
}
1935

2036
// Apply root level padding for themes that do not use the experimental
2137
// `useRootPaddingAwareAlignments` settings
22-
.gutenberg-kit-editor.has-root-padding .editor-styles-wrapper {
38+
.gutenberg-kit-visual-editor.has-root-padding .editor-styles-wrapper {
2339
padding-left: 16px;
2440
padding-right: 16px;
2541
}
2642

27-
.gutenberg-kit-editor__toolbar {
43+
.gutenberg-kit-visual-editor__toolbar {
2844
align-items: center;
2945
bottom: 0;
3046
left: 0;
@@ -36,17 +52,17 @@
3652

3753
// HACK: Force a full-width inserter, consider replacing with a better inserter
3854
// popover implementation in the future.
39-
.gutenberg-kit-editor .block-editor-inserter__main-area {
55+
.gutenberg-kit-visual-editor .block-editor-inserter__main-area {
4056
width: 100%;
4157
}
4258

4359
// Prevent the popover from stealing focus away from the inserter, which results
4460
// in needing to tap a block type twice to insert it.
45-
.gutenberg-kit-editor .block-editor-block-popover {
61+
.gutenberg-kit-visual-editor .block-editor-block-popover {
4662
display: none;
4763
}
4864

49-
.gutenberg-kit-editor .components-editor-notices__snackbar {
65+
.gutenberg-kit-visual-editor .components-editor-notices__snackbar {
5066
bottom: 58px;
5167
left: 0;
5268
padding-right: 8px;
@@ -58,7 +74,7 @@
5874
// Manually copy styles required by Gutenberg that are provided by the WP Admin
5975
// environment in the form of the `load-styles.php` utility.
6076
// https://github.com/WordPress/wordpress-develop/blob/a82874058f58575dbba64ce09b6dcbd43ccf5fdc/src/wp-admin/css/common.css#L2617-L2621
61-
.gutenberg-kit-editor :where(fieldset) {
77+
.gutenberg-kit-visual-editor :where(fieldset) {
6278
border: 0;
6379
padding: 0;
6480
margin: 0;

Diff for: src/utils/bridge.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export function getPost() {
175175
// We assign a temporary ID of -1.
176176
return {
177177
type: 'post',
178-
status: 'draft',
178+
status: 'auto-draft',
179179
id: -1,
180180
};
181181
}

0 commit comments

Comments
 (0)