@wordpress/edit-post 8.50.1-next.v.202607070741.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 (29) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/back-button/fullscreen-mode-close.cjs +11 -19
  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 +9 -0
  7. package/build/index.cjs.map +2 -2
  8. package/build-module/components/back-button/fullscreen-mode-close.mjs +13 -21
  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 +9 -0
  13. package/build-module/index.mjs.map +2 -2
  14. package/build-style/style-rtl.css +6 -65
  15. package/build-style/style.css +6 -65
  16. package/package.json +36 -36
  17. package/src/components/back-button/fullscreen-mode-close.js +9 -16
  18. package/src/components/layout/index.js +3 -18
  19. package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
  20. package/src/components/preferences-modal/test/__snapshots__/enable-custom-fields.js.snap +4 -4
  21. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +3 -3
  22. package/src/index.js +11 -0
  23. package/src/style.scss +1 -2
  24. package/build/components/layout/use-should-iframe.cjs +0 -56
  25. package/build/components/layout/use-should-iframe.cjs.map +0 -7
  26. package/build-module/components/layout/use-should-iframe.mjs +0 -32
  27. package/build-module/components/layout/use-should-iframe.mjs.map +0 -7
  28. package/src/components/back-button/style.scss +0 -70
  29. package/src/components/layout/use-should-iframe.js +0 -45
@@ -65,7 +65,6 @@ import WelcomeGuide from '../welcome-guide';
65
65
  import { store as editPostStore } from '../../store';
66
66
  import { unlock } from '../../lock-unlock';
67
67
  import useEditPostCommands from '../../commands/use-commands';
68
- import { useShouldIframe } from './use-should-iframe';
69
68
  import useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';
70
69
  import { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';
71
70
 
@@ -131,11 +130,7 @@ function useEditorStyles( settings ) {
131
130
  ] );
132
131
  }
133
132
 
134
- /**
135
- * @param {Object} props
136
- * @param {boolean} props.isLegacy True for device previews where split view is disabled.
137
- */
138
- function MetaBoxesMain( { isLegacy } ) {
133
+ function MetaBoxesMain() {
139
134
  const [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {
140
135
  const { get } = select( preferencesStore );
141
136
  const { isMetaBoxLocationVisible } = select( editPostStore );
@@ -284,17 +279,13 @@ function MetaBoxesMain( { isLegacy } ) {
284
279
  <div
285
280
  // The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.
286
281
  className="edit-post-layout__metaboxes edit-post-meta-boxes-main__liner"
287
- hidden={ ! isLegacy && ! isOpen }
282
+ hidden={ ! isOpen }
288
283
  >
289
284
  <MetaBoxes location="normal" />
290
285
  <MetaBoxes location="advanced" />
291
286
  </div>
292
287
  );
293
288
 
294
- if ( isLegacy ) {
295
- return contents;
296
- }
297
-
298
289
  const isAutoHeight = openHeight === undefined;
299
290
  const usedOpenHeight = isShort ? 'auto' : openHeight;
300
291
  const usedHeight = isOpen ? usedOpenHeight : min;
@@ -377,7 +368,6 @@ function Layout( {
377
368
  initialEdits,
378
369
  } ) {
379
370
  useEditPostCommands();
380
- const shouldIframe = useShouldIframe();
381
371
  const { createErrorNotice } = useDispatch( noticesStore );
382
372
  const {
383
373
  currentPost: { postId: currentPostId, postType: currentPostType },
@@ -588,7 +578,6 @@ function Layout( {
588
578
  templateId={ templateId }
589
579
  className={ className }
590
580
  forceIsDirty={ hasActiveMetaboxes }
591
- disableIframe={ ! shouldIframe }
592
581
  // We should auto-focus the canvas (title) on load.
593
582
  // eslint-disable-next-line jsx-a11y/no-autofocus
594
583
  autoFocus={ ! isWelcomeGuideVisible }
@@ -598,11 +587,7 @@ function Layout( {
598
587
  }
599
588
  extraContent={
600
589
  ! isDistractionFree &&
601
- showMetaBoxes && (
602
- <MetaBoxesMain
603
- isLegacy={ ! shouldIframe }
604
- />
605
- )
590
+ showMetaBoxes && <MetaBoxesMain />
606
591
  }
607
592
  >
608
593
  <PostLockedModal />
@@ -39,7 +39,7 @@
39
39
  #poststuff h2.hndle { /* WordPress selectors yolo */
40
40
  box-sizing: border-box;
41
41
  color: inherit;
42
- font-weight: 600;
42
+ font-weight: var(--wpds-typography-font-weight-emphasis);
43
43
  outline: none;
44
44
  padding: 0 $grid-unit-30;
45
45
  position: relative;
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`EnableCustomFieldsOption renders a checked checkbox and a confirmation message when toggled on 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
  }
@@ -75,7 +75,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox and a confirmation
75
75
 
76
76
  exports[`EnableCustomFieldsOption renders a checked checkbox when custom fields are enabled 1`] = `
77
77
  .emotion-0 {
78
- font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
78
+ font-family: -apple-system,system-ui,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
79
79
  font-size: 13px;
80
80
  box-sizing: border-box;
81
81
  }
@@ -138,7 +138,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox when custom fields
138
138
 
139
139
  exports[`EnableCustomFieldsOption renders an unchecked checkbox and a confirmation message when toggled off 1`] = `
140
140
  .emotion-0 {
141
- font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
141
+ font-family: -apple-system,system-ui,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
142
142
  font-size: 13px;
143
143
  box-sizing: border-box;
144
144
  }
@@ -212,7 +212,7 @@ exports[`EnableCustomFieldsOption renders an unchecked checkbox and a confirmati
212
212
 
213
213
  exports[`EnableCustomFieldsOption renders an unchecked checkbox when custom fields are disabled 1`] = `
214
214
  .emotion-0 {
215
- font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
215
+ font-family: -apple-system,system-ui,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
216
216
  font-size: 13px;
217
217
  box-sizing: border-box;
218
218
  }
@@ -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
  }
@@ -81,7 +81,7 @@ exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
81
81
 
82
82
  exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`] = `
83
83
  .emotion-0 {
84
- 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;
85
85
  font-size: 13px;
86
86
  box-sizing: border-box;
87
87
  }
@@ -248,7 +248,7 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
248
248
 
249
249
  exports[`MetaBoxesSection renders meta box options 1`] = `
250
250
  .emotion-0 {
251
- 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;
252
252
  font-size: 13px;
253
253
  box-sizing: border-box;
254
254
  }
package/src/index.js CHANGED
@@ -240,6 +240,17 @@ async function preloadResolutions( postType, postId ) {
240
240
  kind: 'postType',
241
241
  name: 'wp_template',
242
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
+ : [] ),
243
254
  // Per-post resolvers. `getPostType` and `getEditedEntityRecord`
244
255
  // are shorthand/forward-resolver aliases with their own
245
256
  // resolution metadata, so they need separate kicks.
package/src/style.scss CHANGED
@@ -1,7 +1,6 @@
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 *;
@@ -30,7 +29,7 @@ body.js.block-editor-page {
30
29
  }
31
30
  }
32
31
 
33
- .edit-post-visual-editor.is-iframed {
32
+ .edit-post-visual-editor {
34
33
  @include reset;
35
34
  }
36
35
 
@@ -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,70 +0,0 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
- @use "@wordpress/base-styles/variables" as *;
3
-
4
- // Developer notes: these rules are copied from the site editor.
5
- // They need to be updated in both places.
6
-
7
- .edit-post-fullscreen-mode-close__view-mode-toggle {
8
- top: 0;
9
- left: 0;
10
- display: flex;
11
- align-items: center;
12
- justify-content: center;
13
- height: $button-size-compact;
14
- width: $button-size-compact;
15
- z-index: 100;
16
-
17
- .components-button {
18
- color: $white;
19
- height: 100%;
20
- width: 100%;
21
- border-radius: 0;
22
- overflow: hidden;
23
- padding: 0;
24
- display: flex;
25
- align-items: center;
26
- justify-content: center;
27
- &:hover,
28
- &:active {
29
- color: $white;
30
- }
31
-
32
- &:focus {
33
- box-shadow: none;
34
- }
35
- }
36
-
37
- &:hover .edit-post-fullscreen-mode-close__back-icon {
38
- color: var(--wp-admin-theme-color);
39
- }
40
- }
41
-
42
- .edit-post-fullscreen-mode-close.components-button:focus {
43
- position: relative;
44
-
45
- &::before {
46
- content: "";
47
- display: block;
48
- position: absolute;
49
- z-index: 1;
50
- top: 0;
51
- right: 0;
52
- bottom: 0;
53
- left: 0;
54
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 0 0 calc(#{ $border-width } + var(--wp-admin-border-width-focus)) $white;
55
- }
56
- }
57
-
58
- .edit-post-fullscreen-mode-close__back-icon {
59
- position: absolute;
60
- width: $button-size-compact;
61
- height: $button-size-compact;
62
- display: flex;
63
- align-items: center;
64
- justify-content: center;
65
- pointer-events: none;
66
-
67
- svg {
68
- fill: currentColor;
69
- }
70
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { store as editorStore } from '@wordpress/editor';
5
- import { useSelect } from '@wordpress/data';
6
- import { store as blocksStore } from '@wordpress/blocks';
7
- import { store as blockEditorStore } from '@wordpress/block-editor';
8
-
9
- /**
10
- * Internal dependencies
11
- */
12
- import { unlock } from '../../lock-unlock';
13
-
14
- const isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
15
-
16
- export function useShouldIframe() {
17
- return useSelect( ( select ) => {
18
- const { getCurrentPostType, getDeviceType } = select( editorStore );
19
- const { getClientIdsWithDescendants, getBlockName } =
20
- select( blockEditorStore );
21
- const { getBlockType } = select( blocksStore );
22
-
23
- return (
24
- // If the Gutenberg plugin is active, we ALWAYS use the iframe for
25
- // consistency across the post and site editor. We plan on enforcing
26
- // the iframe in the future, so Gutenberg both serves as way for us
27
- // to warn plugin developers and for plugin developers to test their
28
- // blocks easily. Before GB v22.5, we only enforced it for
29
- // block-based themes (classic themes used the same rules as core).
30
- isGutenbergPlugin ||
31
- // We also still want to iframe all the special
32
- // editor features and modes such as device previews, zoom out, and
33
- // template/pattern editing.
34
- getDeviceType() !== 'Desktop' ||
35
- [ 'wp_template', 'wp_block' ].includes( getCurrentPostType() ) ||
36
- unlock( select( blockEditorStore ) ).isZoomOut() ||
37
- // Finally, still iframe the editor if all present blocks are v3
38
- // (which means they are marked as iframe-compatible).
39
- [ ...new Set( getClientIdsWithDescendants().map( getBlockName ) ) ]
40
- .map( getBlockType )
41
- .filter( Boolean )
42
- .every( ( blockType ) => blockType.apiVersion >= 3 )
43
- );
44
- }, [] );
45
- }