@wordpress/edit-post 8.22.0 → 8.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,12 @@
1
- /**
2
- * Converts a hex value into the rgb equivalent.
3
- *
4
- * @param {string} hex - the hexadecimal value to convert
5
- * @return {string} comma separated rgb values
6
- */
7
1
  /**
8
2
  * Colors
9
3
  */
10
4
  /**
11
5
  * Breakpoints & Media Queries
12
6
  */
7
+ /**
8
+ * Colors
9
+ */
13
10
  /**
14
11
  * SCSS Variables.
15
12
  *
@@ -17,15 +14,136 @@
17
14
  * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
18
15
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
19
16
  */
17
+ /**
18
+ * Fonts & basic variables.
19
+ */
20
+ /**
21
+ * Typography
22
+ */
23
+ /**
24
+ * Grid System.
25
+ * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
26
+ */
27
+ /**
28
+ * Radius scale.
29
+ */
30
+ /**
31
+ * Elevation scale.
32
+ */
33
+ /**
34
+ * Dimensions.
35
+ */
36
+ /**
37
+ * Mobile specific styles
38
+ */
39
+ /**
40
+ * Editor styles.
41
+ */
42
+ /**
43
+ * Block & Editor UI.
44
+ */
45
+ /**
46
+ * Block paddings.
47
+ */
48
+ /**
49
+ * React Native specific.
50
+ * These variables do not appear to be used anywhere else.
51
+ */
52
+ /**
53
+ * Colors
54
+ */
55
+ /**
56
+ * SCSS Variables.
57
+ *
58
+ * Please use variables from this sheet to ensure consistency across the UI.
59
+ * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
60
+ * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
61
+ */
62
+ /**
63
+ * Fonts & basic variables.
64
+ */
65
+ /**
66
+ * Typography
67
+ */
68
+ /**
69
+ * Grid System.
70
+ * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
71
+ */
72
+ /**
73
+ * Radius scale.
74
+ */
75
+ /**
76
+ * Elevation scale.
77
+ */
78
+ /**
79
+ * Dimensions.
80
+ */
81
+ /**
82
+ * Mobile specific styles
83
+ */
84
+ /**
85
+ * Editor styles.
86
+ */
87
+ /**
88
+ * Block & Editor UI.
89
+ */
90
+ /**
91
+ * Block paddings.
92
+ */
93
+ /**
94
+ * React Native specific.
95
+ * These variables do not appear to be used anywhere else.
96
+ */
97
+ /**
98
+ * Breakpoints & Media Queries
99
+ */
20
100
  /**
21
101
  * Converts a hex value into the rgb equivalent.
22
102
  *
23
103
  * @param {string} hex - the hexadecimal value to convert
24
104
  * @return {string} comma separated rgb values
25
105
  */
106
+ /**
107
+ * Long content fade mixin
108
+ *
109
+ * Creates a fading overlay to signify that the content is longer
110
+ * than the space allows.
111
+ */
112
+ /**
113
+ * Typography
114
+ */
115
+ /**
116
+ * Breakpoint mixins
117
+ */
118
+ /**
119
+ * Focus styles.
120
+ */
121
+ /**
122
+ * Applies editor left position to the selector passed as argument
123
+ */
124
+ /**
125
+ * Styles that are reused verbatim in a few places
126
+ */
127
+ /**
128
+ * Allows users to opt-out of animations via OS-level preferences.
129
+ */
130
+ /**
131
+ * Reset default styles for JavaScript UI based pages.
132
+ * This is a WP-admin agnostic reset
133
+ */
134
+ /**
135
+ * Reset the WP Admin page styles for Gutenberg-like pages.
136
+ */
26
137
  /**
27
138
  * Colors
28
139
  */
140
+ /**
141
+ * SCSS Variables.
142
+ *
143
+ * Please use variables from this sheet to ensure consistency across the UI.
144
+ * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
145
+ * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
146
+ */
29
147
  /**
30
148
  * Fonts & basic variables.
31
149
  */
@@ -61,6 +179,9 @@
61
179
  * React Native specific.
62
180
  * These variables do not appear to be used anywhere else.
63
181
  */
182
+ /**
183
+ * Breakpoints & Media Queries
184
+ */
64
185
  /**
65
186
  * Converts a hex value into the rgb equivalent.
66
187
  *
@@ -99,6 +220,9 @@
99
220
  * Reset the WP Admin page styles for Gutenberg-like pages.
100
221
  */
101
222
  :root {
223
+ --wp-block-synced-color: #7a00df;
224
+ --wp-block-synced-color--rgb: 122, 0, 223;
225
+ --wp-bound-block-color: var(--wp-block-synced-color);
102
226
  --wp-admin-theme-color: #007cba;
103
227
  --wp-admin-theme-color--rgb: 0, 124, 186;
104
228
  --wp-admin-theme-color-darker-10: #006ba1;
@@ -106,9 +230,6 @@
106
230
  --wp-admin-theme-color-darker-20: #005a87;
107
231
  --wp-admin-theme-color-darker-20--rgb: 0, 90, 135;
108
232
  --wp-admin-border-width-focus: 2px;
109
- --wp-block-synced-color: #7a00df;
110
- --wp-block-synced-color--rgb: 122, 0, 223;
111
- --wp-bound-block-color: var(--wp-block-synced-color);
112
233
  }
113
234
  @media (min-resolution: 192dpi) {
114
235
  :root {
@@ -283,7 +404,12 @@
283
404
  clear: both;
284
405
  }
285
406
 
286
- .has-metaboxes .editor-visual-editor {
407
+ .has-metaboxes .interface-interface-skeleton__content:has(.edit-post-meta-boxes-main) .editor-visual-editor {
408
+ flex-shrink: 1;
409
+ flex-basis: 0%;
410
+ }
411
+
412
+ .has-metaboxes .editor-visual-editor.is-iframed {
287
413
  isolation: isolate;
288
414
  }
289
415
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-post",
3
- "version": "8.22.0",
3
+ "version": "8.24.0",
4
4
  "description": "Edit Post module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,35 +29,35 @@
29
29
  "wpScript": true,
30
30
  "dependencies": {
31
31
  "@babel/runtime": "7.25.7",
32
- "@wordpress/a11y": "^4.22.0",
33
- "@wordpress/api-fetch": "^7.22.0",
34
- "@wordpress/block-editor": "^14.17.0",
35
- "@wordpress/block-library": "^9.22.0",
36
- "@wordpress/blocks": "^14.11.0",
37
- "@wordpress/commands": "^1.22.0",
38
- "@wordpress/components": "^29.8.0",
39
- "@wordpress/compose": "^7.22.0",
40
- "@wordpress/core-commands": "^1.22.0",
41
- "@wordpress/core-data": "^7.22.0",
42
- "@wordpress/data": "^10.22.0",
43
- "@wordpress/deprecated": "^4.22.0",
44
- "@wordpress/dom": "^4.22.0",
45
- "@wordpress/editor": "^14.22.0",
46
- "@wordpress/element": "^6.22.0",
47
- "@wordpress/hooks": "^4.22.0",
48
- "@wordpress/html-entities": "^4.22.0",
49
- "@wordpress/i18n": "^5.22.0",
50
- "@wordpress/icons": "^10.22.0",
51
- "@wordpress/keyboard-shortcuts": "^5.22.0",
52
- "@wordpress/keycodes": "^4.22.0",
53
- "@wordpress/notices": "^5.22.0",
54
- "@wordpress/plugins": "^7.22.0",
55
- "@wordpress/preferences": "^4.22.0",
56
- "@wordpress/private-apis": "^1.22.0",
57
- "@wordpress/url": "^4.22.0",
58
- "@wordpress/viewport": "^6.22.0",
59
- "@wordpress/warning": "^3.22.0",
60
- "@wordpress/widgets": "^4.22.0",
32
+ "@wordpress/a11y": "^4.24.0",
33
+ "@wordpress/api-fetch": "^7.24.0",
34
+ "@wordpress/block-editor": "^14.19.0",
35
+ "@wordpress/block-library": "^9.24.0",
36
+ "@wordpress/blocks": "^14.13.0",
37
+ "@wordpress/commands": "^1.24.0",
38
+ "@wordpress/components": "^29.10.0",
39
+ "@wordpress/compose": "^7.24.0",
40
+ "@wordpress/core-commands": "^1.24.0",
41
+ "@wordpress/core-data": "^7.24.0",
42
+ "@wordpress/data": "^10.24.0",
43
+ "@wordpress/deprecated": "^4.24.0",
44
+ "@wordpress/dom": "^4.24.0",
45
+ "@wordpress/editor": "^14.24.0",
46
+ "@wordpress/element": "^6.24.0",
47
+ "@wordpress/hooks": "^4.24.0",
48
+ "@wordpress/html-entities": "^4.24.0",
49
+ "@wordpress/i18n": "^5.24.0",
50
+ "@wordpress/icons": "^10.24.0",
51
+ "@wordpress/keyboard-shortcuts": "^5.24.0",
52
+ "@wordpress/keycodes": "^4.24.0",
53
+ "@wordpress/notices": "^5.24.0",
54
+ "@wordpress/plugins": "^7.24.0",
55
+ "@wordpress/preferences": "^4.24.0",
56
+ "@wordpress/private-apis": "^1.24.0",
57
+ "@wordpress/url": "^4.24.0",
58
+ "@wordpress/viewport": "^6.24.0",
59
+ "@wordpress/warning": "^3.24.0",
60
+ "@wordpress/widgets": "^4.24.0",
61
61
  "clsx": "^2.1.1",
62
62
  "memize": "^2.1.0"
63
63
  },
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "01a314d7e46a50101e328fdb11959c441e49372d"
71
+ "gitHead": "9c03d1458cae76792ae15e67b421205836bf4393"
72
72
  }
@@ -149,7 +149,11 @@ function useEditorStyles( ...additionalStyles ) {
149
149
  ] );
150
150
  }
151
151
 
152
- function MetaBoxesMain() {
152
+ /**
153
+ * @param {Object} props
154
+ * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.
155
+ */
156
+ function MetaBoxesMain( { isLegacy } ) {
153
157
  const [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {
154
158
  const { get } = select( preferencesStore );
155
159
  const { isMetaBoxLocationVisible } = select( editPostStore );
@@ -229,15 +233,22 @@ function MetaBoxesMain() {
229
233
 
230
234
  const contents = (
231
235
  <div
232
- // The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.
233
- className="edit-post-layout__metaboxes edit-post-meta-boxes-main__liner"
234
- hidden={ isShort && ! isOpen }
236
+ className={ clsx(
237
+ // The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.
238
+ 'edit-post-layout__metaboxes',
239
+ ! isLegacy && 'edit-post-meta-boxes-main__liner'
240
+ ) }
241
+ hidden={ ! isLegacy && isShort && ! isOpen }
235
242
  >
236
243
  <MetaBoxes location="normal" />
237
244
  <MetaBoxes location="advanced" />
238
245
  </div>
239
246
  );
240
247
 
248
+ if ( isLegacy ) {
249
+ return contents;
250
+ }
251
+
241
252
  const isAutoHeight = openHeight === undefined;
242
253
  let usedMax = '50%'; // Approximation before max has a value.
243
254
  if ( max !== undefined ) {
@@ -388,6 +399,7 @@ function Layout( {
388
399
  isWelcomeGuideVisible,
389
400
  templateId,
390
401
  enablePaddingAppender,
402
+ isDevicePreview,
391
403
  } = useSelect(
392
404
  ( select ) => {
393
405
  const { get } = select( preferencesStore );
@@ -406,8 +418,12 @@ function Layout( {
406
418
  const { getBlockSelectionStart, isZoomOut } = unlock(
407
419
  select( blockEditorStore )
408
420
  );
409
- const { getEditorMode, getRenderingMode, getDefaultRenderingMode } =
410
- unlock( select( editorStore ) );
421
+ const {
422
+ getEditorMode,
423
+ getRenderingMode,
424
+ getDefaultRenderingMode,
425
+ getDeviceType,
426
+ } = unlock( select( editorStore ) );
411
427
  const isRenderingPostOnly = getRenderingMode() === 'post-only';
412
428
  const isNotDesignPostType =
413
429
  ! DESIGN_POST_TYPES.includes( currentPostType );
@@ -441,6 +457,7 @@ function Layout( {
441
457
  : null,
442
458
  enablePaddingAppender:
443
459
  ! isZoomOut() && isRenderingPostOnly && isNotDesignPostType,
460
+ isDevicePreview: getDeviceType() !== 'Desktop',
444
461
  };
445
462
  },
446
463
  [
@@ -593,7 +610,13 @@ function Layout( {
593
610
  }
594
611
  extraContent={
595
612
  ! isDistractionFree &&
596
- showMetaBoxes && <MetaBoxesMain />
613
+ showMetaBoxes && (
614
+ <MetaBoxesMain
615
+ isLegacy={
616
+ ! shouldIframe || isDevicePreview
617
+ }
618
+ />
619
+ )
597
620
  }
598
621
  >
599
622
  <PostLockedModal />
@@ -107,9 +107,14 @@
107
107
  clear: both;
108
108
  }
109
109
 
110
- .has-metaboxes .editor-visual-editor {
111
- // Contains z-indexes of children so that the block toolbar will appear behind
112
- // the drop shadow of the meta box pane.
110
+ // Only when the split view is active the visual editor should allow shrinking and
111
+ // its main size should be zero.
112
+ .has-metaboxes .interface-interface-skeleton__content:has(.edit-post-meta-boxes-main) .editor-visual-editor {
113
+ flex-shrink: 1;
114
+ flex-basis: 0%;
115
+ }
116
+
117
+ .has-metaboxes .editor-visual-editor.is-iframed {
113
118
  isolation: isolate;
114
119
  }
115
120