@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
@@ -1,110 +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
- height: $header-height;
11
- width: $header-height;
12
- z-index: 100;
13
-
14
- .components-button {
15
- color: $white;
16
- height: 100%;
17
- width: 100%;
18
- border-radius: 0;
19
- overflow: hidden;
20
- padding: 0;
21
- display: flex;
22
- align-items: center;
23
- justify-content: center;
24
- &:hover,
25
- &:active {
26
- color: $white;
27
- }
28
-
29
- &:focus {
30
- box-shadow: none;
31
- }
32
- }
33
-
34
- .edit-post-fullscreen-mode-close__view-mode-toggle-icon {
35
- svg,
36
- img {
37
- background: $gray-900;
38
- display: block;
39
- }
40
- }
41
- }
42
-
43
- .edit-post-fullscreen-mode-close-site-icon__icon {
44
- fill: currentColor;
45
- width: 100%;
46
- height: 100%;
47
- padding: $grid-unit-15;
48
- }
49
-
50
- .edit-post-fullscreen-mode-close-site-icon__image {
51
- width: 100%;
52
- height: 100%;
53
- object-fit: cover;
54
- background: #333;
55
- aspect-ratio: 1 / 1;
56
- }
57
-
58
- .edit-post-fullscreen-mode-close.components-button:focus {
59
- position: relative;
60
-
61
- &::before {
62
- content: "";
63
- display: block;
64
- position: absolute;
65
- z-index: 1;
66
- top: 0;
67
- right: 0;
68
- bottom: 0;
69
- left: 0;
70
- 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;
71
- }
72
- }
73
-
74
- .edit-post-fullscreen-mode-close__back-icon {
75
- position: absolute;
76
- top: 0;
77
- left: 0;
78
- width: $header-height;
79
- height: $header-height;
80
- display: flex;
81
- align-items: center;
82
- justify-content: center;
83
- background-color: hsla(0, 0%, 80%);
84
- pointer-events: none;
85
-
86
- svg {
87
- fill: currentColor;
88
- }
89
-
90
- &.has-site-icon {
91
- background-color: hsla(0, 0%, 100%, 0.6);
92
- -webkit-backdrop-filter: saturate(180%) blur(15px);
93
- backdrop-filter: saturate(180%) blur(15px);
94
- }
95
- }
96
-
97
- /**
98
- * Show icon label overrides.
99
- */
100
- .show-icon-labels .editor-header {
101
- .edit-post-fullscreen-mode-close.has-icon {
102
- width: $header-height;
103
- svg {
104
- display: block;
105
- }
106
- &::after {
107
- content: none;
108
- }
109
- }
110
- }
@@ -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
- }
@@ -1,67 +0,0 @@
1
- // Styles for the experimental admin bar in editor.
2
-
3
- body.has-admin-bar-in-editor {
4
- .edit-post-fullscreen-mode-close__view-mode-toggle {
5
- display: flex;
6
- align-items: center;
7
- justify-content: center;
8
- width: 32px;
9
- height: 32px;
10
-
11
- .edit-post-fullscreen-mode-close__back-icon {
12
- top: auto;
13
- left: auto;
14
- width: 32px;
15
- height: 32px;
16
- background: transparent;
17
- }
18
-
19
- &:hover .edit-post-fullscreen-mode-close__back-icon {
20
- color: var(--wp-admin-theme-color);
21
- }
22
- }
23
-
24
- &.is-fullscreen-mode {
25
- .editor-header:has(> .editor-header__back-button) {
26
- grid-template-columns: 32px minmax(0, max-content) minmax(min-content, 1fr) 64px;
27
- }
28
-
29
- .editor-header:has(> .editor-header__back-button):has(> .editor-header__center) {
30
- grid-template-columns: 32px min-content 1fr min-content 64px;
31
- }
32
-
33
- .editor-header__back-button {
34
- padding-left: 8px;
35
- }
36
- }
37
-
38
- @media (min-width: 782px) {
39
- &.is-fullscreen-mode {
40
- margin-top: 0;
41
- height: 100%;
42
-
43
- #wpadminbar {
44
- display: block;
45
- }
46
-
47
- .interface-interface-skeleton,
48
- .editor-post-publish-panel,
49
- .is-entity-save-view-open .interface-interface-skeleton__actions:focus,
50
- .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
51
- top: var(--wp-admin--admin-bar--height, 0);
52
- }
53
-
54
- .block-editor__container {
55
- min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0));
56
- }
57
-
58
- &:has(.editor-editor-interface.is-distraction-free) {
59
- --wp-admin--admin-bar--height: 0;
60
-
61
- #wpadminbar {
62
- display: none;
63
- }
64
- }
65
- }
66
- }
67
- }