@wordpress/edit-post 8.50.0 → 8.51.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/back-button/fullscreen-mode-close.cjs +11 -119
  3. package/build/components/back-button/fullscreen-mode-close.cjs.map +3 -3
  4. package/build/components/layout/index.cjs +3 -14
  5. package/build/components/layout/index.cjs.map +2 -2
  6. package/build/index.cjs +12 -1
  7. package/build/index.cjs.map +2 -2
  8. package/build-module/components/back-button/fullscreen-mode-close.mjs +14 -122
  9. package/build-module/components/back-button/fullscreen-mode-close.mjs.map +2 -2
  10. package/build-module/components/layout/index.mjs +3 -14
  11. package/build-module/components/layout/index.mjs.map +2 -2
  12. package/build-module/index.mjs +12 -1
  13. package/build-module/index.mjs.map +2 -2
  14. package/build-style/classic-rtl.css +6 -0
  15. package/build-style/classic.css +6 -0
  16. package/build-style/style-rtl.css +21 -155
  17. package/build-style/style.css +21 -155
  18. package/package.json +36 -36
  19. package/src/components/back-button/fullscreen-mode-close.js +13 -145
  20. package/src/components/layout/index.js +3 -18
  21. package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
  22. package/src/components/preferences-modal/test/__snapshots__/enable-custom-fields.js.snap +20 -152
  23. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +27 -120
  24. package/src/index.js +14 -1
  25. package/src/style.scss +14 -8
  26. package/build/components/layout/use-should-iframe.cjs +0 -56
  27. package/build/components/layout/use-should-iframe.cjs.map +0 -7
  28. package/build-module/components/layout/use-should-iframe.mjs +0 -32
  29. package/build-module/components/layout/use-should-iframe.mjs.map +0 -7
  30. package/build-style/experimental-omnibar-rtl.css +0 -50
  31. package/build-style/experimental-omnibar.css +0 -50
  32. package/src/components/back-button/style.scss +0 -110
  33. package/src/components/layout/use-should-iframe.js +0 -45
  34. package/src/experimental-omnibar.scss +0 -67
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
4
4
  .emotion-0 {
5
- font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
5
+ font-family: -apple-system,system-ui,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
6
6
  font-size: 13px;
7
7
  box-sizing: border-box;
8
8
  }
@@ -17,41 +17,6 @@ exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
17
17
  margin-bottom: inherit;
18
18
  }
19
19
 
20
- .emotion-4 {
21
- display: -webkit-box;
22
- display: -webkit-flex;
23
- display: -ms-flexbox;
24
- display: flex;
25
- -webkit-align-items: center;
26
- -webkit-box-align: center;
27
- -ms-flex-align: center;
28
- align-items: center;
29
- -webkit-flex-direction: row;
30
- -ms-flex-direction: row;
31
- flex-direction: row;
32
- gap: calc(4px * 2);
33
- -webkit-box-pack: start;
34
- -ms-flex-pack: start;
35
- -webkit-justify-content: flex-start;
36
- justify-content: flex-start;
37
- width: 100%;
38
- }
39
-
40
- .emotion-4>* {
41
- min-width: 0;
42
- }
43
-
44
- .emotion-6 {
45
- display: block;
46
- max-height: 100%;
47
- max-width: 100%;
48
- min-height: 0;
49
- min-width: 0;
50
- -webkit-flex: 1;
51
- -ms-flex: 1;
52
- flex: 1;
53
- }
54
-
55
20
  <fieldset
56
21
  class="preferences-modal__section"
57
22
  >
@@ -77,9 +42,10 @@ exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
77
42
  class="components-base-control__field emotion-2 emotion-3"
78
43
  >
79
44
  <div
80
- class="components-flex components-h-stack emotion-4 emotion-5"
45
+ class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
81
46
  data-wp-c16t="true"
82
47
  data-wp-component="HStack"
48
+ style="--wp-components-flex-align: center; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 2); --wp-components-flex-justify: flex-start;"
83
49
  >
84
50
  <span
85
51
  class="components-form-toggle"
@@ -97,10 +63,11 @@ exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
97
63
  />
98
64
  </span>
99
65
  <label
100
- class="components-flex-item components-flex-block components-toggle-control__label emotion-6 emotion-5"
66
+ class="style-item style-block components-flex-item components-flex-block components-toggle-control__label"
101
67
  data-wp-c16t="true"
102
68
  data-wp-component="FlexBlock"
103
69
  for="inspector-toggle-control-0"
70
+ style="--wp-components-flex-item-display: block;"
104
71
  >
105
72
  Custom fields
106
73
  </label>
@@ -114,7 +81,7 @@ exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
114
81
 
115
82
  exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`] = `
116
83
  .emotion-0 {
117
- font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
84
+ font-family: -apple-system,system-ui,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
118
85
  font-size: 13px;
119
86
  box-sizing: border-box;
120
87
  }
@@ -129,41 +96,6 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
129
96
  margin-bottom: inherit;
130
97
  }
131
98
 
132
- .emotion-4 {
133
- display: -webkit-box;
134
- display: -webkit-flex;
135
- display: -ms-flexbox;
136
- display: flex;
137
- -webkit-align-items: center;
138
- -webkit-box-align: center;
139
- -ms-flex-align: center;
140
- align-items: center;
141
- -webkit-flex-direction: row;
142
- -ms-flex-direction: row;
143
- flex-direction: row;
144
- gap: calc(4px * 2);
145
- -webkit-box-pack: start;
146
- -ms-flex-pack: start;
147
- -webkit-justify-content: flex-start;
148
- justify-content: flex-start;
149
- width: 100%;
150
- }
151
-
152
- .emotion-4>* {
153
- min-width: 0;
154
- }
155
-
156
- .emotion-6 {
157
- display: block;
158
- max-height: 100%;
159
- max-width: 100%;
160
- min-height: 0;
161
- min-width: 0;
162
- -webkit-flex: 1;
163
- -ms-flex: 1;
164
- flex: 1;
165
- }
166
-
167
99
  <fieldset
168
100
  class="preferences-modal__section"
169
101
  >
@@ -189,9 +121,10 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
189
121
  class="components-base-control__field emotion-2 emotion-3"
190
122
  >
191
123
  <div
192
- class="components-flex components-h-stack emotion-4 emotion-5"
124
+ class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
193
125
  data-wp-c16t="true"
194
126
  data-wp-component="HStack"
127
+ style="--wp-components-flex-align: center; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 2); --wp-components-flex-justify: flex-start;"
195
128
  >
196
129
  <span
197
130
  class="components-form-toggle"
@@ -209,10 +142,11 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
209
142
  />
210
143
  </span>
211
144
  <label
212
- class="components-flex-item components-flex-block components-toggle-control__label emotion-6 emotion-5"
145
+ class="style-item style-block components-flex-item components-flex-block components-toggle-control__label"
213
146
  data-wp-c16t="true"
214
147
  data-wp-component="FlexBlock"
215
148
  for="inspector-toggle-control-3"
149
+ style="--wp-components-flex-item-display: block;"
216
150
  >
217
151
  Custom fields
218
152
  </label>
@@ -230,9 +164,10 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
230
164
  class="components-base-control__field emotion-2 emotion-3"
231
165
  >
232
166
  <div
233
- class="components-flex components-h-stack emotion-4 emotion-5"
167
+ class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
234
168
  data-wp-c16t="true"
235
169
  data-wp-component="HStack"
170
+ style="--wp-components-flex-align: center; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 2); --wp-components-flex-justify: flex-start;"
236
171
  >
237
172
  <span
238
173
  class="components-form-toggle is-checked"
@@ -251,10 +186,11 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
251
186
  />
252
187
  </span>
253
188
  <label
254
- class="components-flex-item components-flex-block components-toggle-control__label emotion-6 emotion-5"
189
+ class="style-item style-block components-flex-item components-flex-block components-toggle-control__label"
255
190
  data-wp-c16t="true"
256
191
  data-wp-component="FlexBlock"
257
192
  for="inspector-toggle-control-4"
193
+ style="--wp-components-flex-item-display: block;"
258
194
  >
259
195
  Meta Box 1
260
196
  </label>
@@ -272,9 +208,10 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
272
208
  class="components-base-control__field emotion-2 emotion-3"
273
209
  >
274
210
  <div
275
- class="components-flex components-h-stack emotion-4 emotion-5"
211
+ class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
276
212
  data-wp-c16t="true"
277
213
  data-wp-component="HStack"
214
+ style="--wp-components-flex-align: center; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 2); --wp-components-flex-justify: flex-start;"
278
215
  >
279
216
  <span
280
217
  class="components-form-toggle is-checked"
@@ -293,10 +230,11 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
293
230
  />
294
231
  </span>
295
232
  <label
296
- class="components-flex-item components-flex-block components-toggle-control__label emotion-6 emotion-5"
233
+ class="style-item style-block components-flex-item components-flex-block components-toggle-control__label"
297
234
  data-wp-c16t="true"
298
235
  data-wp-component="FlexBlock"
299
236
  for="inspector-toggle-control-5"
237
+ style="--wp-components-flex-item-display: block;"
300
238
  >
301
239
  Meta Box 2
302
240
  </label>
@@ -310,7 +248,7 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
310
248
 
311
249
  exports[`MetaBoxesSection renders meta box options 1`] = `
312
250
  .emotion-0 {
313
- font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
251
+ font-family: -apple-system,system-ui,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
314
252
  font-size: 13px;
315
253
  box-sizing: border-box;
316
254
  }
@@ -325,41 +263,6 @@ exports[`MetaBoxesSection renders meta box options 1`] = `
325
263
  margin-bottom: inherit;
326
264
  }
327
265
 
328
- .emotion-4 {
329
- display: -webkit-box;
330
- display: -webkit-flex;
331
- display: -ms-flexbox;
332
- display: flex;
333
- -webkit-align-items: center;
334
- -webkit-box-align: center;
335
- -ms-flex-align: center;
336
- align-items: center;
337
- -webkit-flex-direction: row;
338
- -ms-flex-direction: row;
339
- flex-direction: row;
340
- gap: calc(4px * 2);
341
- -webkit-box-pack: start;
342
- -ms-flex-pack: start;
343
- -webkit-justify-content: flex-start;
344
- justify-content: flex-start;
345
- width: 100%;
346
- }
347
-
348
- .emotion-4>* {
349
- min-width: 0;
350
- }
351
-
352
- .emotion-6 {
353
- display: block;
354
- max-height: 100%;
355
- max-width: 100%;
356
- min-height: 0;
357
- min-width: 0;
358
- -webkit-flex: 1;
359
- -ms-flex: 1;
360
- flex: 1;
361
- }
362
-
363
266
  <fieldset
364
267
  class="preferences-modal__section"
365
268
  >
@@ -385,9 +288,10 @@ exports[`MetaBoxesSection renders meta box options 1`] = `
385
288
  class="components-base-control__field emotion-2 emotion-3"
386
289
  >
387
290
  <div
388
- class="components-flex components-h-stack emotion-4 emotion-5"
291
+ class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
389
292
  data-wp-c16t="true"
390
293
  data-wp-component="HStack"
294
+ style="--wp-components-flex-align: center; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 2); --wp-components-flex-justify: flex-start;"
391
295
  >
392
296
  <span
393
297
  class="components-form-toggle is-checked"
@@ -406,10 +310,11 @@ exports[`MetaBoxesSection renders meta box options 1`] = `
406
310
  />
407
311
  </span>
408
312
  <label
409
- class="components-flex-item components-flex-block components-toggle-control__label emotion-6 emotion-5"
313
+ class="style-item style-block components-flex-item components-flex-block components-toggle-control__label"
410
314
  data-wp-c16t="true"
411
315
  data-wp-component="FlexBlock"
412
316
  for="inspector-toggle-control-1"
317
+ style="--wp-components-flex-item-display: block;"
413
318
  >
414
319
  Meta Box 1
415
320
  </label>
@@ -427,9 +332,10 @@ exports[`MetaBoxesSection renders meta box options 1`] = `
427
332
  class="components-base-control__field emotion-2 emotion-3"
428
333
  >
429
334
  <div
430
- class="components-flex components-h-stack emotion-4 emotion-5"
335
+ class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
431
336
  data-wp-c16t="true"
432
337
  data-wp-component="HStack"
338
+ style="--wp-components-flex-align: center; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: calc(4px * 2); --wp-components-flex-justify: flex-start;"
433
339
  >
434
340
  <span
435
341
  class="components-form-toggle is-checked"
@@ -448,10 +354,11 @@ exports[`MetaBoxesSection renders meta box options 1`] = `
448
354
  />
449
355
  </span>
450
356
  <label
451
- class="components-flex-item components-flex-block components-toggle-control__label emotion-6 emotion-5"
357
+ class="style-item style-block components-flex-item components-flex-block components-toggle-control__label"
452
358
  data-wp-c16t="true"
453
359
  data-wp-component="FlexBlock"
454
360
  for="inspector-toggle-control-2"
361
+ style="--wp-components-flex-item-display: block;"
455
362
  >
456
363
  Meta Box 2
457
364
  </label>
package/src/index.js CHANGED
@@ -79,7 +79,9 @@ export function initializeEditor(
79
79
  enableChoosePatternModal: true,
80
80
  isPublishSidebarEnabled: true,
81
81
  showCollaborationCursor: false,
82
- showCollaborationNotifications: true,
82
+ showCollaborationJoinNotifications: true,
83
+ showCollaborationLeaveNotifications: true,
84
+ showCollaborationPostSaveNotifications: true,
83
85
  } );
84
86
 
85
87
  if ( window.__clientSideMediaProcessing ) {
@@ -238,6 +240,17 @@ async function preloadResolutions( postType, postId ) {
238
240
  kind: 'postType',
239
241
  name: 'wp_template',
240
242
  } ),
243
+ // The DataForm-based inspector requests the entity form config
244
+ // when the document sidebar mounts. The args must match the
245
+ // `useViewConfig` call in `@wordpress/views` exactly for the
246
+ // resolution (and its preload entry) to be shared.
247
+ ...( postType && window?.__experimentalDataFormInspector
248
+ ? [
249
+ unlock( core ).getViewConfig( 'postType', postType, {
250
+ fields: 'form',
251
+ } ),
252
+ ]
253
+ : [] ),
241
254
  // Per-post resolvers. `getPostType` and `getEditedEntityRecord`
242
255
  // are shorthand/forward-resolver aliases with their own
243
256
  // resolution metadata, so they need separate kicks.
package/src/style.scss CHANGED
@@ -1,14 +1,24 @@
1
1
  @use "@wordpress/base-styles/default-custom-properties";
2
2
  @use "@wordpress/base-styles/mixins" as *;
3
3
  @use "@wordpress/base-styles/variables" as *;
4
- @use "./components/back-button/style.scss" as *;
5
4
  @use "./components/layout/style.scss" as *;
6
5
  @use "./components/meta-boxes/meta-boxes-area/style.scss" as *;
7
6
  @use "./components/welcome-guide/style.scss" as *;
8
- @use "./experimental-omnibar.scss" as *;
9
7
 
10
8
  body.js.block-editor-page {
11
9
  @include wp-admin-reset( ".block-editor" );
10
+
11
+ &.is-fullscreen-mode {
12
+ @include break-medium {
13
+ &:has(.editor-editor-interface.is-distraction-free) {
14
+ --wp-admin--admin-bar--height: 0px;
15
+
16
+ #wpadminbar {
17
+ display: none;
18
+ }
19
+ }
20
+ }
21
+ }
12
22
  }
13
23
 
14
24
  // Fix issue with wp-admin menu not scrolling between 170% and 200% zoom.
@@ -19,7 +29,7 @@ body.js.block-editor-page {
19
29
  }
20
30
  }
21
31
 
22
- .edit-post-visual-editor.is-iframed {
32
+ .edit-post-visual-editor {
23
33
  @include reset;
24
34
  }
25
35
 
@@ -37,11 +47,7 @@ body.js.block-editor-page {
37
47
 
38
48
  // The WP header height changes at this breakpoint.
39
49
  @include break-medium {
40
- min-height: calc(100vh - #{$admin-bar-height});
41
-
42
- body.is-fullscreen-mode & {
43
- min-height: 100vh;
44
- }
50
+ min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
45
51
  }
46
52
 
47
53
  img {
@@ -1,56 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // packages/edit-post/src/components/layout/use-should-iframe.js
20
- var use_should_iframe_exports = {};
21
- __export(use_should_iframe_exports, {
22
- useShouldIframe: () => useShouldIframe
23
- });
24
- module.exports = __toCommonJS(use_should_iframe_exports);
25
- var import_editor = require("@wordpress/editor");
26
- var import_data = require("@wordpress/data");
27
- var import_blocks = require("@wordpress/blocks");
28
- var import_block_editor = require("@wordpress/block-editor");
29
- var import_lock_unlock = require("../../lock-unlock.cjs");
30
- var isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
31
- function useShouldIframe() {
32
- return (0, import_data.useSelect)((select) => {
33
- const { getCurrentPostType, getDeviceType } = select(import_editor.store);
34
- const { getClientIdsWithDescendants, getBlockName } = select(import_block_editor.store);
35
- const { getBlockType } = select(import_blocks.store);
36
- return (
37
- // If the Gutenberg plugin is active, we ALWAYS use the iframe for
38
- // consistency across the post and site editor. We plan on enforcing
39
- // the iframe in the future, so Gutenberg both serves as way for us
40
- // to warn plugin developers and for plugin developers to test their
41
- // blocks easily. Before GB v22.5, we only enforced it for
42
- // block-based themes (classic themes used the same rules as core).
43
- isGutenbergPlugin || // We also still want to iframe all the special
44
- // editor features and modes such as device previews, zoom out, and
45
- // template/pattern editing.
46
- getDeviceType() !== "Desktop" || ["wp_template", "wp_block"].includes(getCurrentPostType()) || (0, import_lock_unlock.unlock)(select(import_block_editor.store)).isZoomOut() || // Finally, still iframe the editor if all present blocks are v3
47
- // (which means they are marked as iframe-compatible).
48
- [...new Set(getClientIdsWithDescendants().map(getBlockName))].map(getBlockType).filter(Boolean).every((blockType) => blockType.apiVersion >= 3)
49
- );
50
- }, []);
51
- }
52
- // Annotate the CommonJS export names for ESM import in node:
53
- 0 && (module.exports = {
54
- useShouldIframe
55
- });
56
- //# sourceMappingURL=use-should-iframe.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/layout/use-should-iframe.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport function useShouldIframe() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getDeviceType } = select( editorStore );\n\t\tconst { getClientIdsWithDescendants, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getBlockType } = select( blocksStore );\n\n\t\treturn (\n\t\t\t// If the Gutenberg plugin is active, we ALWAYS use the iframe for\n\t\t\t// consistency across the post and site editor. We plan on enforcing\n\t\t\t// the iframe in the future, so Gutenberg both serves as way for us\n\t\t\t// to warn plugin developers and for plugin developers to test their\n\t\t\t// blocks easily. Before GB v22.5, we only enforced it for\n\t\t\t// block-based themes (classic themes used the same rules as core).\n\t\t\tisGutenbergPlugin ||\n\t\t\t// We also still want to iframe all the special\n\t\t\t// editor features and modes such as device previews, zoom out, and\n\t\t\t// template/pattern editing.\n\t\t\tgetDeviceType() !== 'Desktop' ||\n\t\t\t[ 'wp_template', 'wp_block' ].includes( getCurrentPostType() ) ||\n\t\t\tunlock( select( blockEditorStore ) ).isZoomOut() ||\n\t\t\t// Finally, still iframe the editor if all present blocks are v3\n\t\t\t// (which means they are marked as iframe-compatible).\n\t\t\t[ ...new Set( getClientIdsWithDescendants().map( getBlockName ) ) ]\n\t\t\t\t.map( getBlockType )\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.every( ( blockType ) => blockType.apiVersion >= 3 )\n\t\t);\n\t}, [] );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAqC;AACrC,kBAA0B;AAC1B,oBAAqC;AACrC,0BAA0C;AAK1C,yBAAuB;AAEvB,IAAM,oBAAoB,WAAW,sBAAsB,OAAO;AAE3D,SAAS,kBAAkB;AACjC,aAAO,uBAAW,CAAE,WAAY;AAC/B,UAAM,EAAE,oBAAoB,cAAc,IAAI,OAAQ,cAAAA,KAAY;AAClE,UAAM,EAAE,6BAA6B,aAAa,IACjD,OAAQ,oBAAAC,KAAiB;AAC1B,UAAM,EAAE,aAAa,IAAI,OAAQ,cAAAC,KAAY;AAE7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOC;AAAA;AAAA;AAAA,MAIA,cAAc,MAAM,aACpB,CAAE,eAAe,UAAW,EAAE,SAAU,mBAAmB,CAAE,SAC7D,2BAAQ,OAAQ,oBAAAD,KAAiB,CAAE,EAAE,UAAU;AAAA;AAAA,MAG/C,CAAE,GAAG,IAAI,IAAK,4BAA4B,EAAE,IAAK,YAAa,CAAE,CAAE,EAChE,IAAK,YAAa,EAClB,OAAQ,OAAQ,EAChB,MAAO,CAAE,cAAe,UAAU,cAAc,CAAE;AAAA;AAAA,EAEtD,GAAG,CAAC,CAAE;AACP;",
6
- "names": ["editorStore", "blockEditorStore", "blocksStore"]
7
- }
@@ -1,32 +0,0 @@
1
- // packages/edit-post/src/components/layout/use-should-iframe.js
2
- import { store as editorStore } from "@wordpress/editor";
3
- import { useSelect } from "@wordpress/data";
4
- import { store as blocksStore } from "@wordpress/blocks";
5
- import { store as blockEditorStore } from "@wordpress/block-editor";
6
- import { unlock } from "../../lock-unlock.mjs";
7
- var isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
8
- function useShouldIframe() {
9
- return useSelect((select) => {
10
- const { getCurrentPostType, getDeviceType } = select(editorStore);
11
- const { getClientIdsWithDescendants, getBlockName } = select(blockEditorStore);
12
- const { getBlockType } = select(blocksStore);
13
- return (
14
- // If the Gutenberg plugin is active, we ALWAYS use the iframe for
15
- // consistency across the post and site editor. We plan on enforcing
16
- // the iframe in the future, so Gutenberg both serves as way for us
17
- // to warn plugin developers and for plugin developers to test their
18
- // blocks easily. Before GB v22.5, we only enforced it for
19
- // block-based themes (classic themes used the same rules as core).
20
- isGutenbergPlugin || // We also still want to iframe all the special
21
- // editor features and modes such as device previews, zoom out, and
22
- // template/pattern editing.
23
- getDeviceType() !== "Desktop" || ["wp_template", "wp_block"].includes(getCurrentPostType()) || unlock(select(blockEditorStore)).isZoomOut() || // Finally, still iframe the editor if all present blocks are v3
24
- // (which means they are marked as iframe-compatible).
25
- [...new Set(getClientIdsWithDescendants().map(getBlockName))].map(getBlockType).filter(Boolean).every((blockType) => blockType.apiVersion >= 3)
26
- );
27
- }, []);
28
- }
29
- export {
30
- useShouldIframe
31
- };
32
- //# sourceMappingURL=use-should-iframe.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/layout/use-should-iframe.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport function useShouldIframe() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getDeviceType } = select( editorStore );\n\t\tconst { getClientIdsWithDescendants, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getBlockType } = select( blocksStore );\n\n\t\treturn (\n\t\t\t// If the Gutenberg plugin is active, we ALWAYS use the iframe for\n\t\t\t// consistency across the post and site editor. We plan on enforcing\n\t\t\t// the iframe in the future, so Gutenberg both serves as way for us\n\t\t\t// to warn plugin developers and for plugin developers to test their\n\t\t\t// blocks easily. Before GB v22.5, we only enforced it for\n\t\t\t// block-based themes (classic themes used the same rules as core).\n\t\t\tisGutenbergPlugin ||\n\t\t\t// We also still want to iframe all the special\n\t\t\t// editor features and modes such as device previews, zoom out, and\n\t\t\t// template/pattern editing.\n\t\t\tgetDeviceType() !== 'Desktop' ||\n\t\t\t[ 'wp_template', 'wp_block' ].includes( getCurrentPostType() ) ||\n\t\t\tunlock( select( blockEditorStore ) ).isZoomOut() ||\n\t\t\t// Finally, still iframe the editor if all present blocks are v3\n\t\t\t// (which means they are marked as iframe-compatible).\n\t\t\t[ ...new Set( getClientIdsWithDescendants().map( getBlockName ) ) ]\n\t\t\t\t.map( getBlockType )\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.every( ( blockType ) => blockType.apiVersion >= 3 )\n\t\t);\n\t}, [] );\n}\n"],
5
- "mappings": ";AAGA,SAAS,SAAS,mBAAmB;AACrC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,mBAAmB;AACrC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,cAAc;AAEvB,IAAM,oBAAoB,WAAW,sBAAsB,OAAO;AAE3D,SAAS,kBAAkB;AACjC,SAAO,UAAW,CAAE,WAAY;AAC/B,UAAM,EAAE,oBAAoB,cAAc,IAAI,OAAQ,WAAY;AAClE,UAAM,EAAE,6BAA6B,aAAa,IACjD,OAAQ,gBAAiB;AAC1B,UAAM,EAAE,aAAa,IAAI,OAAQ,WAAY;AAE7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOC;AAAA;AAAA;AAAA,MAIA,cAAc,MAAM,aACpB,CAAE,eAAe,UAAW,EAAE,SAAU,mBAAmB,CAAE,KAC7D,OAAQ,OAAQ,gBAAiB,CAAE,EAAE,UAAU;AAAA;AAAA,MAG/C,CAAE,GAAG,IAAI,IAAK,4BAA4B,EAAE,IAAK,YAAa,CAAE,CAAE,EAChE,IAAK,YAAa,EAClB,OAAQ,OAAQ,EAChB,MAAO,CAAE,cAAe,UAAU,cAAc,CAAE;AAAA;AAAA,EAEtD,GAAG,CAAC,CAAE;AACP;",
6
- "names": []
7
- }
@@ -1,50 +0,0 @@
1
- body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- width: 32px;
6
- height: 32px;
7
- }
8
- body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle .edit-post-fullscreen-mode-close__back-icon {
9
- top: auto;
10
- right: auto;
11
- width: 32px;
12
- height: 32px;
13
- background: transparent;
14
- }
15
- body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle:hover .edit-post-fullscreen-mode-close__back-icon {
16
- color: var(--wp-admin-theme-color);
17
- }
18
- body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button) {
19
- grid-template-columns: 32px minmax(0, max-content) minmax(min-content, 1fr) 64px;
20
- }
21
- body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button):has(> .editor-header__center) {
22
- grid-template-columns: 32px min-content 1fr min-content 64px;
23
- }
24
- body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header__back-button {
25
- padding-right: 8px;
26
- }
27
- @media (min-width: 782px) {
28
- body.has-admin-bar-in-editor.is-fullscreen-mode {
29
- margin-top: 0;
30
- height: 100%;
31
- }
32
- body.has-admin-bar-in-editor.is-fullscreen-mode #wpadminbar {
33
- display: block;
34
- }
35
- body.has-admin-bar-in-editor.is-fullscreen-mode .interface-interface-skeleton,
36
- body.has-admin-bar-in-editor.is-fullscreen-mode .editor-post-publish-panel,
37
- body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,
38
- body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
39
- top: var(--wp-admin--admin-bar--height, 0);
40
- }
41
- body.has-admin-bar-in-editor.is-fullscreen-mode .block-editor__container {
42
- min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
43
- }
44
- body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) {
45
- --wp-admin--admin-bar--height: 0;
46
- }
47
- body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) #wpadminbar {
48
- display: none;
49
- }
50
- }
@@ -1,50 +0,0 @@
1
- body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- width: 32px;
6
- height: 32px;
7
- }
8
- body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle .edit-post-fullscreen-mode-close__back-icon {
9
- top: auto;
10
- left: auto;
11
- width: 32px;
12
- height: 32px;
13
- background: transparent;
14
- }
15
- body.has-admin-bar-in-editor .edit-post-fullscreen-mode-close__view-mode-toggle:hover .edit-post-fullscreen-mode-close__back-icon {
16
- color: var(--wp-admin-theme-color);
17
- }
18
- body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button) {
19
- grid-template-columns: 32px minmax(0, max-content) minmax(min-content, 1fr) 64px;
20
- }
21
- body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header:has(> .editor-header__back-button):has(> .editor-header__center) {
22
- grid-template-columns: 32px min-content 1fr min-content 64px;
23
- }
24
- body.has-admin-bar-in-editor.is-fullscreen-mode .editor-header__back-button {
25
- padding-left: 8px;
26
- }
27
- @media (min-width: 782px) {
28
- body.has-admin-bar-in-editor.is-fullscreen-mode {
29
- margin-top: 0;
30
- height: 100%;
31
- }
32
- body.has-admin-bar-in-editor.is-fullscreen-mode #wpadminbar {
33
- display: block;
34
- }
35
- body.has-admin-bar-in-editor.is-fullscreen-mode .interface-interface-skeleton,
36
- body.has-admin-bar-in-editor.is-fullscreen-mode .editor-post-publish-panel,
37
- body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus,
38
- body.has-admin-bar-in-editor.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
39
- top: var(--wp-admin--admin-bar--height, 0);
40
- }
41
- body.has-admin-bar-in-editor.is-fullscreen-mode .block-editor__container {
42
- min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
43
- }
44
- body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) {
45
- --wp-admin--admin-bar--height: 0;
46
- }
47
- body.has-admin-bar-in-editor.is-fullscreen-mode:has(.editor-editor-interface.is-distraction-free) #wpadminbar {
48
- display: none;
49
- }
50
- }