@wordpress/edit-post 7.33.0 → 7.34.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.
- package/CHANGELOG.md +2 -0
- package/README.md +22 -36
- package/build/components/header/index.js +17 -48
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +17 -43
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/more-menu/manage-patterns-menu-item.js +40 -0
- package/build/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +0 -88
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +18 -11
- package/build/components/layout/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +2 -11
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +29 -6
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +40 -10
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/deprecated.js +132 -0
- package/build/deprecated.js.map +1 -0
- package/build/index.js +19 -58
- package/build/index.js.map +1 -1
- package/build-module/components/header/index.js +20 -51
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +17 -43
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js +33 -0
- package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
- package/build-module/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +1 -89
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +18 -11
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +3 -12
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +30 -7
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +43 -13
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/deprecated.js +116 -0
- package/build-module/deprecated.js.map +1 -0
- package/build-module/index.js +2 -15
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +6 -141
- package/build-style/style.css +6 -141
- package/package.json +31 -31
- package/src/components/header/index.js +24 -69
- package/src/components/header/more-menu/index.js +27 -42
- package/src/components/header/more-menu/manage-patterns-menu-item.js +33 -0
- package/src/components/header/style.scss +0 -79
- package/src/components/keyboard-shortcuts/index.js +1 -106
- package/src/components/layout/index.js +12 -6
- package/src/components/layout/style.scss +7 -80
- package/src/components/preferences-modal/index.js +2 -22
- package/src/components/sidebar/post-status/index.js +57 -17
- package/src/components/sidebar/settings-sidebar/index.js +60 -24
- package/src/deprecated.js +107 -0
- package/src/index.js +3 -24
- package/build/components/header/post-publish-button-or-toggle.js +0 -94
- package/build/components/header/post-publish-button-or-toggle.js.map +0 -1
- package/build/components/header/preferences-menu-item/index.js +0 -39
- package/build/components/header/preferences-menu-item/index.js.map +0 -1
- package/build/components/header/tools-more-menu-group/index.js +0 -26
- package/build/components/header/tools-more-menu-group/index.js.map +0 -1
- package/build/components/header/writing-menu/index.js +0 -71
- package/build/components/header/writing-menu/index.js.map +0 -1
- package/build/components/layout/actions-panel.js +0 -86
- package/build/components/layout/actions-panel.js.map +0 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +0 -38
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js +0 -39
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js +0 -43
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
- package/build/plugins/copy-content-menu-item/index.js +0 -39
- package/build/plugins/copy-content-menu-item/index.js.map +0 -1
- package/build/plugins/index.js +0 -69
- package/build/plugins/index.js.map +0 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -44
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
- package/build/plugins/welcome-guide-menu-item/index.js.map +0 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +0 -86
- package/build-module/components/header/post-publish-button-or-toggle.js.map +0 -1
- package/build-module/components/header/preferences-menu-item/index.js +0 -32
- package/build-module/components/header/preferences-menu-item/index.js.map +0 -1
- package/build-module/components/header/tools-more-menu-group/index.js +0 -19
- package/build-module/components/header/tools-more-menu-group/index.js.map +0 -1
- package/build-module/components/header/writing-menu/index.js +0 -64
- package/build-module/components/header/writing-menu/index.js.map +0 -1
- package/build-module/components/layout/actions-panel.js +0 -78
- package/build-module/components/layout/actions-panel.js.map +0 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +0 -31
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js +0 -32
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +0 -36
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
- package/build-module/plugins/copy-content-menu-item/index.js +0 -32
- package/build-module/plugins/copy-content-menu-item/index.js.map +0 -1
- package/build-module/plugins/index.js +0 -65
- package/build-module/plugins/index.js.map +0 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -36
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +0 -1
- package/src/components/header/post-publish-button-or-toggle.js +0 -97
- package/src/components/header/preferences-menu-item/index.js +0 -31
- package/src/components/header/test/index.js +0 -63
- package/src/components/header/tools-more-menu-group/index.js +0 -20
- package/src/components/header/writing-menu/index.js +0 -73
- package/src/components/layout/actions-panel.js +0 -103
- package/src/components/preferences-modal/enable-publish-sidebar.js +0 -32
- package/src/components/preferences-modal/test/index.js +0 -28
- package/src/components/sidebar/plugin-post-publish-panel/index.js +0 -28
- package/src/components/sidebar/plugin-pre-publish-panel/index.js +0 -32
- package/src/plugins/copy-content-menu-item/index.js +0 -29
- package/src/plugins/index.js +0 -85
- package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -36
- /package/src/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +0 -0
package/build-style/style.css
CHANGED
|
@@ -140,64 +140,6 @@
|
|
|
140
140
|
display: block;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper {
|
|
144
|
-
overflow: hidden;
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
height: 60px;
|
|
148
|
-
}
|
|
149
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-contextual-toolbar {
|
|
150
|
-
border-bottom: 0;
|
|
151
|
-
height: 100%;
|
|
152
|
-
}
|
|
153
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-toolbar {
|
|
154
|
-
height: 100%;
|
|
155
|
-
padding-top: 15px;
|
|
156
|
-
}
|
|
157
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-toolbar .components-button:not(.block-editor-block-mover-button) {
|
|
158
|
-
height: 32px;
|
|
159
|
-
}
|
|
160
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper::after {
|
|
161
|
-
content: "";
|
|
162
|
-
width: 1px;
|
|
163
|
-
height: 24px;
|
|
164
|
-
background-color: #ddd;
|
|
165
|
-
margin-left: 8px;
|
|
166
|
-
}
|
|
167
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar-group,
|
|
168
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar {
|
|
169
|
-
border-right: none;
|
|
170
|
-
}
|
|
171
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar-group::after,
|
|
172
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar::after {
|
|
173
|
-
content: "";
|
|
174
|
-
width: 1px;
|
|
175
|
-
height: 24px;
|
|
176
|
-
background-color: #ddd;
|
|
177
|
-
margin-top: 4px;
|
|
178
|
-
margin-left: 8px;
|
|
179
|
-
}
|
|
180
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar-group .components-toolbar-group.components-toolbar-group::after,
|
|
181
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .components-toolbar .components-toolbar-group.components-toolbar-group::after {
|
|
182
|
-
display: none;
|
|
183
|
-
}
|
|
184
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
|
|
185
|
-
height: 32px;
|
|
186
|
-
overflow: visible;
|
|
187
|
-
}
|
|
188
|
-
@media (min-width: 600px) {
|
|
189
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container {
|
|
190
|
-
position: relative;
|
|
191
|
-
top: -10px;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
.edit-post-header__toolbar .selected-block-tools-wrapper.is-collapsed {
|
|
195
|
-
display: none;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.edit-post-header__block-tools-toggle {
|
|
199
|
-
margin-left: 2px;
|
|
200
|
-
}
|
|
201
143
|
|
|
202
144
|
.edit-post-header__center {
|
|
203
145
|
flex-grow: 1;
|
|
@@ -472,13 +414,17 @@
|
|
|
472
414
|
.edit-post-layout .components-editor-notices__snackbar {
|
|
473
415
|
position: fixed;
|
|
474
416
|
right: 0;
|
|
475
|
-
bottom:
|
|
417
|
+
bottom: 16px;
|
|
476
418
|
padding-left: 16px;
|
|
477
419
|
padding-right: 16px;
|
|
478
420
|
}
|
|
479
421
|
|
|
480
422
|
.is-distraction-free .components-editor-notices__snackbar {
|
|
481
|
-
bottom:
|
|
423
|
+
bottom: 16px;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.has-block-breadcrumbs .components-editor-notices__snackbar {
|
|
427
|
+
bottom: 40px;
|
|
482
428
|
}
|
|
483
429
|
|
|
484
430
|
.edit-post-layout .components-editor-notices__snackbar {
|
|
@@ -519,87 +465,6 @@ body.is-fullscreen-mode .edit-post-layout .components-editor-notices__snackbar {
|
|
|
519
465
|
left: 0 !important;
|
|
520
466
|
}
|
|
521
467
|
|
|
522
|
-
.edit-post-layout .editor-post-publish-panel {
|
|
523
|
-
position: fixed;
|
|
524
|
-
z-index: 100001;
|
|
525
|
-
top: 46px;
|
|
526
|
-
bottom: 0;
|
|
527
|
-
right: 0;
|
|
528
|
-
left: 0;
|
|
529
|
-
overflow: auto;
|
|
530
|
-
}
|
|
531
|
-
@media (min-width: 782px) {
|
|
532
|
-
.edit-post-layout .editor-post-publish-panel {
|
|
533
|
-
z-index: 99998;
|
|
534
|
-
top: 32px;
|
|
535
|
-
left: auto;
|
|
536
|
-
width: 281px;
|
|
537
|
-
border-left: 1px solid #ddd;
|
|
538
|
-
transform: translateX(100%);
|
|
539
|
-
animation: edit-post-post-publish-panel__slide-in-animation 0.1s forwards;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
@media (min-width: 782px) and (prefers-reduced-motion: reduce) {
|
|
543
|
-
.edit-post-layout .editor-post-publish-panel {
|
|
544
|
-
animation-duration: 1ms;
|
|
545
|
-
animation-delay: 0s;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
@media (min-width: 782px) {
|
|
549
|
-
body.is-fullscreen-mode .edit-post-layout .editor-post-publish-panel {
|
|
550
|
-
top: 0;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
@media (min-width: 782px) {
|
|
554
|
-
[role=region]:focus .edit-post-layout .editor-post-publish-panel {
|
|
555
|
-
transform: translateX(0%);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
@keyframes edit-post-post-publish-panel__slide-in-animation {
|
|
560
|
-
100% {
|
|
561
|
-
transform: translateX(0%);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
.edit-post-layout .editor-post-publish-panel__header-publish-button {
|
|
565
|
-
justify-content: center;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
.edit-post-layout__toggle-publish-panel,
|
|
569
|
-
.edit-post-layout__toggle-sidebar-panel,
|
|
570
|
-
.edit-post-layout__toggle-entities-saved-states-panel {
|
|
571
|
-
z-index: 100000;
|
|
572
|
-
position: fixed !important;
|
|
573
|
-
top: -9999em;
|
|
574
|
-
bottom: auto;
|
|
575
|
-
left: auto;
|
|
576
|
-
right: 0;
|
|
577
|
-
box-sizing: border-box;
|
|
578
|
-
width: 280px;
|
|
579
|
-
background-color: #fff;
|
|
580
|
-
border: 1px dotted #ddd;
|
|
581
|
-
height: auto !important;
|
|
582
|
-
padding: 24px;
|
|
583
|
-
display: flex;
|
|
584
|
-
justify-content: center;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
.interface-interface-skeleton__sidebar:focus .edit-post-layout__toggle-sidebar-panel, .interface-interface-skeleton__sidebar:focus-within .edit-post-layout__toggle-sidebar-panel {
|
|
588
|
-
top: auto;
|
|
589
|
-
bottom: 0;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
.interface-interface-skeleton__actions:focus .edit-post-layout__toggle-entities-saved-states-panel, .interface-interface-skeleton__actions:focus-within .edit-post-layout__toggle-entities-saved-states-panel,
|
|
593
|
-
.interface-interface-skeleton__actions:focus .edit-post-layout__toggle-publish-panel,
|
|
594
|
-
.interface-interface-skeleton__actions:focus-within .edit-post-layout__toggle-publish-panel {
|
|
595
|
-
top: auto;
|
|
596
|
-
bottom: 0;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
.edit-post-layout .entities-saved-states__panel-header {
|
|
600
|
-
height: 61px;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
468
|
.edit-post-meta-boxes-area {
|
|
604
469
|
position: relative;
|
|
605
470
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.34.0",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,35 +27,35 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^12.
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/commands": "^0.
|
|
36
|
-
"@wordpress/components": "^27.
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/core-commands": "^0.
|
|
39
|
-
"@wordpress/core-data": "^6.
|
|
40
|
-
"@wordpress/data": "^9.
|
|
41
|
-
"@wordpress/deprecated": "^3.
|
|
42
|
-
"@wordpress/dom": "^3.
|
|
43
|
-
"@wordpress/editor": "^13.
|
|
44
|
-
"@wordpress/element": "^5.
|
|
45
|
-
"@wordpress/hooks": "^3.
|
|
46
|
-
"@wordpress/i18n": "^4.
|
|
47
|
-
"@wordpress/icons": "^9.
|
|
48
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
49
|
-
"@wordpress/keycodes": "^3.
|
|
50
|
-
"@wordpress/media-utils": "^4.
|
|
51
|
-
"@wordpress/notices": "^4.
|
|
52
|
-
"@wordpress/plugins": "^6.
|
|
53
|
-
"@wordpress/preferences": "^3.
|
|
54
|
-
"@wordpress/private-apis": "^0.
|
|
55
|
-
"@wordpress/url": "^3.
|
|
56
|
-
"@wordpress/viewport": "^5.
|
|
57
|
-
"@wordpress/warning": "^2.
|
|
58
|
-
"@wordpress/widgets": "^3.
|
|
30
|
+
"@wordpress/a11y": "^3.57.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.54.0",
|
|
32
|
+
"@wordpress/block-editor": "^12.25.0",
|
|
33
|
+
"@wordpress/block-library": "^8.34.0",
|
|
34
|
+
"@wordpress/blocks": "^12.34.0",
|
|
35
|
+
"@wordpress/commands": "^0.28.0",
|
|
36
|
+
"@wordpress/components": "^27.5.0",
|
|
37
|
+
"@wordpress/compose": "^6.34.0",
|
|
38
|
+
"@wordpress/core-commands": "^0.26.0",
|
|
39
|
+
"@wordpress/core-data": "^6.34.0",
|
|
40
|
+
"@wordpress/data": "^9.27.0",
|
|
41
|
+
"@wordpress/deprecated": "^3.57.0",
|
|
42
|
+
"@wordpress/dom": "^3.57.0",
|
|
43
|
+
"@wordpress/editor": "^13.34.0",
|
|
44
|
+
"@wordpress/element": "^5.34.0",
|
|
45
|
+
"@wordpress/hooks": "^3.57.0",
|
|
46
|
+
"@wordpress/i18n": "^4.57.0",
|
|
47
|
+
"@wordpress/icons": "^9.48.0",
|
|
48
|
+
"@wordpress/keyboard-shortcuts": "^4.34.0",
|
|
49
|
+
"@wordpress/keycodes": "^3.57.0",
|
|
50
|
+
"@wordpress/media-utils": "^4.48.0",
|
|
51
|
+
"@wordpress/notices": "^4.25.0",
|
|
52
|
+
"@wordpress/plugins": "^6.25.0",
|
|
53
|
+
"@wordpress/preferences": "^3.34.0",
|
|
54
|
+
"@wordpress/private-apis": "^0.39.0",
|
|
55
|
+
"@wordpress/url": "^3.58.0",
|
|
56
|
+
"@wordpress/viewport": "^5.34.0",
|
|
57
|
+
"@wordpress/warning": "^2.57.0",
|
|
58
|
+
"@wordpress/widgets": "^3.34.0",
|
|
59
59
|
"classnames": "^2.3.1",
|
|
60
60
|
"memize": "^2.1.0"
|
|
61
61
|
},
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "581d8a5580dba8f600b7268d51eb554771ae482c"
|
|
70
70
|
}
|
|
@@ -7,42 +7,36 @@ import classnames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
privateApis as blockEditorPrivateApis,
|
|
12
|
-
store as blockEditorStore,
|
|
13
|
-
} from '@wordpress/block-editor';
|
|
14
|
-
import {
|
|
10
|
+
DocumentBar,
|
|
15
11
|
PostSavedState,
|
|
16
12
|
PostPreviewButton,
|
|
17
13
|
store as editorStore,
|
|
18
|
-
DocumentBar,
|
|
19
14
|
privateApis as editorPrivateApis,
|
|
20
15
|
} from '@wordpress/editor';
|
|
21
|
-
import { useEffect, useRef, useState } from '@wordpress/element';
|
|
22
16
|
import { useSelect } from '@wordpress/data';
|
|
23
|
-
import { __ } from '@wordpress/i18n';
|
|
24
|
-
import { next, previous } from '@wordpress/icons';
|
|
25
17
|
import { useViewportMatch } from '@wordpress/compose';
|
|
26
|
-
import {
|
|
27
|
-
Button,
|
|
28
|
-
__unstableMotion as motion,
|
|
29
|
-
Popover,
|
|
30
|
-
} from '@wordpress/components';
|
|
18
|
+
import { __unstableMotion as motion } from '@wordpress/components';
|
|
31
19
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
20
|
+
import { useState } from '@wordpress/element';
|
|
32
21
|
|
|
33
22
|
/**
|
|
34
23
|
* Internal dependencies
|
|
35
24
|
*/
|
|
36
25
|
import FullscreenModeClose from './fullscreen-mode-close';
|
|
37
|
-
import
|
|
38
|
-
import PostPublishButtonOrToggle from './post-publish-button-or-toggle';
|
|
26
|
+
import PostEditorMoreMenu from './more-menu';
|
|
39
27
|
import MainDashboardButton from './main-dashboard-button';
|
|
40
28
|
import { store as editPostStore } from '../../store';
|
|
41
29
|
import { unlock } from '../../lock-unlock';
|
|
42
30
|
|
|
43
|
-
const {
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
const {
|
|
32
|
+
CollapsableBlockToolbar,
|
|
33
|
+
DocumentTools,
|
|
34
|
+
PostViewLink,
|
|
35
|
+
PreviewDropdown,
|
|
36
|
+
PinnedItems,
|
|
37
|
+
MoreMenu,
|
|
38
|
+
PostPublishButtonOrToggle,
|
|
39
|
+
} = unlock( editorPrivateApis );
|
|
46
40
|
|
|
47
41
|
const slideY = {
|
|
48
42
|
hidden: { y: '-50px' },
|
|
@@ -59,22 +53,19 @@ const slideX = {
|
|
|
59
53
|
function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
|
|
60
54
|
const isWideViewport = useViewportMatch( 'large' );
|
|
61
55
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
62
|
-
const blockToolbarRef = useRef();
|
|
63
56
|
const {
|
|
64
57
|
isTextEditor,
|
|
65
|
-
blockSelectionStart,
|
|
66
58
|
hasActiveMetaboxes,
|
|
67
59
|
isPublishSidebarOpened,
|
|
68
60
|
showIconLabels,
|
|
69
61
|
hasHistory,
|
|
62
|
+
hasFixedToolbar,
|
|
70
63
|
} = useSelect( ( select ) => {
|
|
71
64
|
const { get: getPreference } = select( preferencesStore );
|
|
72
65
|
const { getEditorMode } = select( editorStore );
|
|
73
66
|
|
|
74
67
|
return {
|
|
75
68
|
isTextEditor: getEditorMode() === 'text',
|
|
76
|
-
blockSelectionStart:
|
|
77
|
-
select( blockEditorStore ).getBlockSelectionStart(),
|
|
78
69
|
hasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),
|
|
79
70
|
hasHistory:
|
|
80
71
|
!! select( editorStore ).getEditorSettings()
|
|
@@ -82,22 +73,14 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
|
|
|
82
73
|
isPublishSidebarOpened:
|
|
83
74
|
select( editorStore ).isPublishSidebarOpened(),
|
|
84
75
|
showIconLabels: getPreference( 'core', 'showIconLabels' ),
|
|
76
|
+
hasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),
|
|
85
77
|
};
|
|
86
78
|
}, [] );
|
|
87
79
|
|
|
88
|
-
const
|
|
89
|
-
const showTopToolbar = isLargeViewport && showFixedToolbar;
|
|
80
|
+
const hasTopToolbar = isLargeViewport && hasFixedToolbar;
|
|
90
81
|
|
|
91
82
|
const [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =
|
|
92
83
|
useState( true );
|
|
93
|
-
const hasBlockSelection = !! blockSelectionStart;
|
|
94
|
-
|
|
95
|
-
useEffect( () => {
|
|
96
|
-
// If we have a new block selection, show the block tools
|
|
97
|
-
if ( blockSelectionStart ) {
|
|
98
|
-
setIsBlockToolsCollapsed( false );
|
|
99
|
-
}
|
|
100
|
-
}, [ blockSelectionStart ] );
|
|
101
84
|
|
|
102
85
|
return (
|
|
103
86
|
<div className="edit-post-header">
|
|
@@ -118,47 +101,18 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
|
|
|
118
101
|
className="edit-post-header__toolbar"
|
|
119
102
|
>
|
|
120
103
|
<DocumentTools disableBlockTools={ isTextEditor } />
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
'is-collapsed':
|
|
128
|
-
isBlockToolsCollapsed ||
|
|
129
|
-
! hasBlockSelection,
|
|
130
|
-
}
|
|
131
|
-
) }
|
|
132
|
-
>
|
|
133
|
-
<BlockToolbar hideDragHandle />
|
|
134
|
-
</div>
|
|
135
|
-
<Popover.Slot
|
|
136
|
-
ref={ blockToolbarRef }
|
|
137
|
-
name="block-toolbar"
|
|
138
|
-
/>
|
|
139
|
-
<Button
|
|
140
|
-
className="edit-post-header__block-tools-toggle"
|
|
141
|
-
icon={ isBlockToolsCollapsed ? next : previous }
|
|
142
|
-
onClick={ () => {
|
|
143
|
-
setIsBlockToolsCollapsed(
|
|
144
|
-
( collapsed ) => ! collapsed
|
|
145
|
-
);
|
|
146
|
-
} }
|
|
147
|
-
label={
|
|
148
|
-
isBlockToolsCollapsed
|
|
149
|
-
? __( 'Show block tools' )
|
|
150
|
-
: __( 'Hide block tools' )
|
|
151
|
-
}
|
|
152
|
-
size="compact"
|
|
153
|
-
/>
|
|
154
|
-
</>
|
|
104
|
+
{ hasTopToolbar && (
|
|
105
|
+
<CollapsableBlockToolbar
|
|
106
|
+
isCollapsed={ isBlockToolsCollapsed }
|
|
107
|
+
onToggle={ setIsBlockToolsCollapsed }
|
|
108
|
+
/>
|
|
155
109
|
) }
|
|
156
110
|
<div
|
|
157
111
|
className={ classnames( 'edit-post-header__center', {
|
|
158
112
|
'is-collapsed':
|
|
159
113
|
hasHistory &&
|
|
160
114
|
! isBlockToolsCollapsed &&
|
|
161
|
-
|
|
115
|
+
hasTopToolbar,
|
|
162
116
|
} ) }
|
|
163
117
|
>
|
|
164
118
|
{ hasHistory && <DocumentBar /> }
|
|
@@ -192,7 +146,8 @@ function Header( { setEntitiesSavedStatesCallback, initialPost } ) {
|
|
|
192
146
|
{ ( isWideViewport || ! showIconLabels ) && (
|
|
193
147
|
<PinnedItems.Slot scope="core" />
|
|
194
148
|
) }
|
|
195
|
-
<MoreMenu
|
|
149
|
+
<MoreMenu />
|
|
150
|
+
<PostEditorMoreMenu />
|
|
196
151
|
</motion.div>
|
|
197
152
|
</div>
|
|
198
153
|
);
|
|
@@ -2,62 +2,47 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { MenuGroup, DropdownMenu } from '@wordpress/components';
|
|
6
5
|
import { useViewportMatch } from '@wordpress/compose';
|
|
7
6
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
8
|
-
import {
|
|
7
|
+
import { PreferenceToggleMenuItem } from '@wordpress/preferences';
|
|
8
|
+
import { displayShortcut } from '@wordpress/keycodes';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import PreferencesMenuItem from '../preferences-menu-item';
|
|
14
|
-
import ToolsMoreMenuGroup from '../tools-more-menu-group';
|
|
15
|
-
import WritingMenu from '../writing-menu';
|
|
16
13
|
import { unlock } from '../../../lock-unlock';
|
|
14
|
+
import ManagePatternsMenuItem from './manage-patterns-menu-item';
|
|
15
|
+
import WelcomeGuideMenuItem from './welcome-guide-menu-item';
|
|
16
|
+
import EditPostPreferencesModal from '../../preferences-modal';
|
|
17
17
|
|
|
18
|
-
const {
|
|
18
|
+
const { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock( editorPrivateApis );
|
|
19
19
|
|
|
20
|
-
const MoreMenu = (
|
|
20
|
+
const MoreMenu = () => {
|
|
21
21
|
const isLargeViewport = useViewportMatch( 'large' );
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
>
|
|
38
|
-
{ ( { onClose } ) => (
|
|
39
|
-
<>
|
|
40
|
-
{ showIconLabels && ! isLargeViewport && (
|
|
41
|
-
<PinnedItems.Slot
|
|
42
|
-
className={ showIconLabels && 'show-icon-labels' }
|
|
43
|
-
scope="core"
|
|
44
|
-
/>
|
|
45
|
-
) }
|
|
46
|
-
<WritingMenu />
|
|
47
|
-
<ModeSwitcher />
|
|
48
|
-
<ActionItem.Slot
|
|
49
|
-
name="core/plugin-more-menu"
|
|
50
|
-
label={ __( 'Plugins' ) }
|
|
51
|
-
as={ MenuGroup }
|
|
52
|
-
fillProps={ { onClick: onClose } }
|
|
24
|
+
<>
|
|
25
|
+
{ isLargeViewport && (
|
|
26
|
+
<ViewMoreMenuGroup>
|
|
27
|
+
<PreferenceToggleMenuItem
|
|
28
|
+
scope="core/edit-post"
|
|
29
|
+
name="fullscreenMode"
|
|
30
|
+
label={ __( 'Fullscreen mode' ) }
|
|
31
|
+
info={ __( 'Show and hide the admin user interface' ) }
|
|
32
|
+
messageActivated={ __( 'Fullscreen mode activated' ) }
|
|
33
|
+
messageDeactivated={ __(
|
|
34
|
+
'Fullscreen mode deactivated'
|
|
35
|
+
) }
|
|
36
|
+
shortcut={ displayShortcut.secondary( 'f' ) }
|
|
53
37
|
/>
|
|
54
|
-
|
|
55
|
-
<MenuGroup>
|
|
56
|
-
<PreferencesMenuItem />
|
|
57
|
-
</MenuGroup>
|
|
58
|
-
</>
|
|
38
|
+
</ViewMoreMenuGroup>
|
|
59
39
|
) }
|
|
60
|
-
|
|
40
|
+
<ToolsMoreMenuGroup>
|
|
41
|
+
<ManagePatternsMenuItem />
|
|
42
|
+
<WelcomeGuideMenuItem />
|
|
43
|
+
</ToolsMoreMenuGroup>
|
|
44
|
+
<EditPostPreferencesModal />
|
|
45
|
+
</>
|
|
61
46
|
);
|
|
62
47
|
};
|
|
63
48
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { MenuItem } from '@wordpress/components';
|
|
5
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
9
|
+
|
|
10
|
+
function ManagePatternsMenuItem() {
|
|
11
|
+
const url = useSelect( ( select ) => {
|
|
12
|
+
const { canUser } = select( coreStore );
|
|
13
|
+
const defaultUrl = addQueryArgs( 'edit.php', {
|
|
14
|
+
post_type: 'wp_block',
|
|
15
|
+
} );
|
|
16
|
+
const patternsUrl = addQueryArgs( 'site-editor.php', {
|
|
17
|
+
path: '/patterns',
|
|
18
|
+
} );
|
|
19
|
+
|
|
20
|
+
// The site editor and templates both check whether the user has
|
|
21
|
+
// edit_theme_options capabilities. We can leverage that here and not
|
|
22
|
+
// display the manage patterns link if the user can't access it.
|
|
23
|
+
return canUser( 'read', 'templates' ) ? patternsUrl : defaultUrl;
|
|
24
|
+
}, [] );
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<MenuItem role="menuitem" href={ url }>
|
|
28
|
+
{ __( 'Manage patterns' ) }
|
|
29
|
+
</MenuItem>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default ManagePatternsMenuItem;
|
|
@@ -37,85 +37,6 @@
|
|
|
37
37
|
display: block;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
.selected-block-tools-wrapper {
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
height: $header-height;
|
|
46
|
-
|
|
47
|
-
.block-editor-block-contextual-toolbar {
|
|
48
|
-
border-bottom: 0;
|
|
49
|
-
height: 100%;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// These rules ensure that icons are always positioned in a way that lines up with the rest of the icons in the toolbar.
|
|
53
|
-
.block-editor-block-toolbar {
|
|
54
|
-
height: 100%;
|
|
55
|
-
// Push down so that buttons are centered vertically.
|
|
56
|
-
// It should be 14px (60px header height - 32px compact button height = 28 / 2),
|
|
57
|
-
// but there is a -1px top-margin down the stack that affects this.
|
|
58
|
-
padding-top: math.div($header-height - $button-size-compact, 2) + 1;
|
|
59
|
-
|
|
60
|
-
// Match the height of other buttons in the header toolbar.
|
|
61
|
-
.components-button:not(.block-editor-block-mover-button) {
|
|
62
|
-
height: $button-size-compact;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
&::after {
|
|
67
|
-
content: "";
|
|
68
|
-
width: $border-width;
|
|
69
|
-
height: $grid-unit-30;
|
|
70
|
-
background-color: $gray-300;
|
|
71
|
-
margin-left: $grid-unit;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Modified group borders.
|
|
75
|
-
.components-toolbar-group,
|
|
76
|
-
.components-toolbar {
|
|
77
|
-
border-right: none;
|
|
78
|
-
|
|
79
|
-
&::after {
|
|
80
|
-
content: "";
|
|
81
|
-
width: $border-width;
|
|
82
|
-
height: $grid-unit-30;
|
|
83
|
-
background-color: $gray-300;
|
|
84
|
-
margin-top: $grid-unit-05;
|
|
85
|
-
margin-left: $grid-unit;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
& .components-toolbar-group.components-toolbar-group {
|
|
89
|
-
&::after {
|
|
90
|
-
display: none;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.block-editor-block-mover {
|
|
96
|
-
// Match the height of other buttons in the header toolbar.
|
|
97
|
-
&.is-horizontal .block-editor-block-mover-button {
|
|
98
|
-
height: $button-size-compact;
|
|
99
|
-
overflow: visible;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Move up a little to prevent the toolbar shift when focus is on the vertical movers.
|
|
103
|
-
@include break-small() {
|
|
104
|
-
&:not(.is-horizontal) .block-editor-block-mover__move-button-container {
|
|
105
|
-
position: relative;
|
|
106
|
-
top: -10px;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&.is-collapsed {
|
|
112
|
-
display: none;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.edit-post-header__block-tools-toggle {
|
|
118
|
-
margin-left: 2px; // Allow focus ring to be fully visible
|
|
119
40
|
}
|
|
120
41
|
|
|
121
42
|
.edit-post-header__center {
|