@wordpress/edit-widgets 4.0.1 → 4.1.0-next.e230fbab09.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/build/components/header/index.js +1 -1
- package/build/components/header/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/interface.js +3 -1
- package/build/components/layout/interface.js.map +1 -1
- package/build/components/more-menu/index.js +12 -10
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +0 -11
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/welcome-guide/index.js +5 -5
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-content/index.js +2 -2
- package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-provider/index.js +4 -4
- package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +4 -7
- package/build/store/index.js.map +1 -1
- package/build-module/components/header/index.js +1 -1
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/interface.js +2 -1
- package/build-module/components/layout/interface.js.map +1 -1
- package/build-module/components/more-menu/index.js +12 -11
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -12
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +5 -5
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +2 -2
- package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +3 -3
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build-module/index.js +2 -2
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +5 -8
- package/build-module/store/index.js.map +1 -1
- package/build-style/style-rtl.css +91 -34
- package/build-style/style.css +91 -34
- package/package.json +29 -24
- package/src/blocks/widget-area/editor.scss +1 -0
- package/src/components/header/index.js +1 -1
- package/src/components/keyboard-shortcuts/index.js +1 -1
- package/src/components/layout/interface.js +5 -3
- package/src/components/more-menu/index.js +12 -11
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -11
- package/src/components/welcome-guide/index.js +4 -6
- package/src/components/widget-areas-block-editor-content/index.js +2 -2
- package/src/components/widget-areas-block-editor-provider/index.js +3 -3
- package/src/index.js +2 -2
- package/src/store/actions.js +1 -1
- package/src/store/index.js +3 -7
- package/src/style.scss +0 -1
- package/src/components/more-menu/style.scss +0 -35
package/build-style/style.css
CHANGED
|
@@ -304,7 +304,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
304
304
|
display: flex;
|
|
305
305
|
flex-direction: column;
|
|
306
306
|
overflow: auto;
|
|
307
|
-
z-index:
|
|
307
|
+
z-index: 91;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
.interface-interface-skeleton__secondary-sidebar,
|
|
@@ -447,6 +447,95 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
447
447
|
max-height: 24px;
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
+
@media (min-width: 600px) {
|
|
451
|
+
.interface-preferences-modal {
|
|
452
|
+
width: calc(100% - 32px);
|
|
453
|
+
height: calc(100% - 120px);
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
@media (min-width: 782px) {
|
|
457
|
+
.interface-preferences-modal {
|
|
458
|
+
width: 750px;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
@media (min-width: 960px) {
|
|
462
|
+
.interface-preferences-modal {
|
|
463
|
+
height: 70%;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
@media (max-width: 781px) {
|
|
467
|
+
.interface-preferences-modal .components-modal__content {
|
|
468
|
+
padding: 0;
|
|
469
|
+
}
|
|
470
|
+
.interface-preferences-modal .components-modal__content::before {
|
|
471
|
+
content: none;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.interface-preferences__tabs .components-tab-panel__tabs {
|
|
476
|
+
position: absolute;
|
|
477
|
+
top: 84px;
|
|
478
|
+
left: 16px;
|
|
479
|
+
width: 160px;
|
|
480
|
+
}
|
|
481
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item {
|
|
482
|
+
border-radius: 2px;
|
|
483
|
+
font-weight: 400;
|
|
484
|
+
}
|
|
485
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active {
|
|
486
|
+
background: #f0f0f0;
|
|
487
|
+
box-shadow: none;
|
|
488
|
+
font-weight: 500;
|
|
489
|
+
}
|
|
490
|
+
.interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
|
|
491
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
492
|
+
}
|
|
493
|
+
.interface-preferences__tabs .components-tab-panel__tab-content {
|
|
494
|
+
padding-left: 24px;
|
|
495
|
+
margin-left: 160px;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
@media (max-width: 781px) {
|
|
499
|
+
.interface-preferences__provider {
|
|
500
|
+
height: 100%;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
.interface-preferences-modal__section {
|
|
504
|
+
margin: 0 0 2.5rem 0;
|
|
505
|
+
}
|
|
506
|
+
.interface-preferences-modal__section:last-child {
|
|
507
|
+
margin: 0;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.interface-preferences-modal__section-title {
|
|
511
|
+
font-size: 0.9rem;
|
|
512
|
+
font-weight: 600;
|
|
513
|
+
margin-top: 0;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.interface-preferences-modal__section-description {
|
|
517
|
+
margin: -8px 0 8px 0;
|
|
518
|
+
font-size: 12px;
|
|
519
|
+
font-style: normal;
|
|
520
|
+
color: #757575;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.interface-preferences-modal__option .components-base-control .components-base-control__field {
|
|
524
|
+
align-items: center;
|
|
525
|
+
display: flex;
|
|
526
|
+
margin-bottom: 0;
|
|
527
|
+
}
|
|
528
|
+
.interface-preferences-modal__option .components-base-control .components-base-control__field > label {
|
|
529
|
+
flex-grow: 1;
|
|
530
|
+
padding: 0.6rem 0 0.6rem 10px;
|
|
531
|
+
}
|
|
532
|
+
.interface-preferences-modal__option .components-base-control__help {
|
|
533
|
+
margin: -8px 0 8px 58px;
|
|
534
|
+
font-size: 12px;
|
|
535
|
+
font-style: normal;
|
|
536
|
+
color: #757575;
|
|
537
|
+
}
|
|
538
|
+
|
|
450
539
|
.wp-block[data-type="core/widget-area"] {
|
|
451
540
|
max-width: 700px;
|
|
452
541
|
margin-left: auto;
|
|
@@ -466,6 +555,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
466
555
|
}
|
|
467
556
|
.wp-block[data-type="core/widget-area"] .block-list-appender.wp-block {
|
|
468
557
|
width: initial;
|
|
558
|
+
position: relative;
|
|
469
559
|
}
|
|
470
560
|
.wp-block[data-type="core/widget-area"] .editor-styles-wrapper .wp-block.wp-block.wp-block.wp-block.wp-block {
|
|
471
561
|
max-width: 100%;
|
|
@@ -643,39 +733,6 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
643
733
|
margin: 0 0 0 0.2rem;
|
|
644
734
|
}
|
|
645
735
|
|
|
646
|
-
.edit-widgets-more-menu {
|
|
647
|
-
margin-left: -4px;
|
|
648
|
-
}
|
|
649
|
-
.edit-widgets-more-menu .components-button {
|
|
650
|
-
width: auto;
|
|
651
|
-
padding: 0 2px;
|
|
652
|
-
}
|
|
653
|
-
@media (min-width: 600px) {
|
|
654
|
-
.edit-widgets-more-menu {
|
|
655
|
-
margin-left: 0;
|
|
656
|
-
}
|
|
657
|
-
.edit-widgets-more-menu .components-button {
|
|
658
|
-
padding: 0 4px;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
.edit-widgets-more-menu__content .components-popover__content {
|
|
663
|
-
min-width: 280px;
|
|
664
|
-
}
|
|
665
|
-
@media (min-width: 480px) {
|
|
666
|
-
.edit-widgets-more-menu__content .components-popover__content {
|
|
667
|
-
width: auto;
|
|
668
|
-
max-width: 480px;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
.edit-widgets-more-menu__content .components-popover__content .components-dropdown-menu__menu {
|
|
672
|
-
padding: 0;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
.components-popover.edit-widgets-more-menu__content {
|
|
676
|
-
z-index: 99998;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
736
|
.components-panel__header.edit-widgets-sidebar__panel-tabs {
|
|
680
737
|
justify-content: flex-start;
|
|
681
738
|
padding-left: 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.1.0-next.e230fbab09.0",
|
|
4
4
|
"description": "Widgets Page module for WordPress..",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,33 +27,38 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/api-fetch": "^6.0.
|
|
31
|
-
"@wordpress/block-editor": "^8.
|
|
32
|
-
"@wordpress/block-library": "^7.0.
|
|
33
|
-
"@wordpress/blocks": "^11.
|
|
34
|
-
"@wordpress/components": "^19.
|
|
35
|
-
"@wordpress/compose": "^5.
|
|
36
|
-
"@wordpress/core-data": "^4.
|
|
37
|
-
"@wordpress/data": "^6.
|
|
38
|
-
"@wordpress/dom": "^3.
|
|
39
|
-
"@wordpress/element": "^4.
|
|
40
|
-
"@wordpress/hooks": "^3.
|
|
41
|
-
"@wordpress/i18n": "^4.
|
|
42
|
-
"@wordpress/icons": "^7.0.0",
|
|
43
|
-
"@wordpress/interface": "^4.
|
|
44
|
-
"@wordpress/keyboard-shortcuts": "^3.
|
|
45
|
-
"@wordpress/keycodes": "^3.
|
|
46
|
-
"@wordpress/media-utils": "^3.
|
|
47
|
-
"@wordpress/notices": "^3.
|
|
48
|
-
"@wordpress/plugins": "^4.
|
|
49
|
-
"@wordpress/
|
|
50
|
-
"@wordpress/
|
|
51
|
-
"@wordpress/
|
|
30
|
+
"@wordpress/api-fetch": "^6.1.0-next.e230fbab09.0",
|
|
31
|
+
"@wordpress/block-editor": "^8.3.0-next.e230fbab09.0",
|
|
32
|
+
"@wordpress/block-library": "^7.1.0-next.e230fbab09.0",
|
|
33
|
+
"@wordpress/blocks": "^11.3.0-next.e230fbab09.0",
|
|
34
|
+
"@wordpress/components": "^19.7.0-next.e230fbab09.0",
|
|
35
|
+
"@wordpress/compose": "^5.2.0-next.e230fbab09.0",
|
|
36
|
+
"@wordpress/core-data": "^4.2.0-next.e230fbab09.0",
|
|
37
|
+
"@wordpress/data": "^6.4.0-next.e230fbab09.0",
|
|
38
|
+
"@wordpress/dom": "^3.4.0-next.e230fbab09.0",
|
|
39
|
+
"@wordpress/element": "^4.3.0-next.e230fbab09.0",
|
|
40
|
+
"@wordpress/hooks": "^3.4.0-next.e230fbab09.0",
|
|
41
|
+
"@wordpress/i18n": "^4.4.0-next.e230fbab09.0",
|
|
42
|
+
"@wordpress/icons": "^7.1.0-next.e230fbab09.0",
|
|
43
|
+
"@wordpress/interface": "^4.3.0-next.e230fbab09.0",
|
|
44
|
+
"@wordpress/keyboard-shortcuts": "^3.2.0-next.e230fbab09.0",
|
|
45
|
+
"@wordpress/keycodes": "^3.4.0-next.e230fbab09.0",
|
|
46
|
+
"@wordpress/media-utils": "^3.2.0-next.e230fbab09.0",
|
|
47
|
+
"@wordpress/notices": "^3.4.0-next.e230fbab09.0",
|
|
48
|
+
"@wordpress/plugins": "^4.2.0-next.e230fbab09.0",
|
|
49
|
+
"@wordpress/preferences": "^1.0.0-prerelease",
|
|
50
|
+
"@wordpress/reusable-blocks": "^3.2.0-next.e230fbab09.0",
|
|
51
|
+
"@wordpress/url": "^3.5.0-next.e230fbab09.0",
|
|
52
|
+
"@wordpress/widgets": "^2.2.0-next.e230fbab09.0",
|
|
52
53
|
"classnames": "^2.3.1",
|
|
53
54
|
"lodash": "^4.17.21"
|
|
54
55
|
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": "^17.0.0",
|
|
58
|
+
"react-dom": "^17.0.0"
|
|
59
|
+
},
|
|
55
60
|
"publishConfig": {
|
|
56
61
|
"access": "public"
|
|
57
62
|
},
|
|
58
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "308df03e6a96ded732f9c4e32471b1b4f8dea54a"
|
|
59
64
|
}
|
|
@@ -51,7 +51,7 @@ function Header() {
|
|
|
51
51
|
const { selectBlock } = useDispatch( blockEditorStore );
|
|
52
52
|
const handleClick = () => {
|
|
53
53
|
if ( isInserterOpen ) {
|
|
54
|
-
// Focusing the inserter button closes the inserter popover
|
|
54
|
+
// Focusing the inserter button closes the inserter popover.
|
|
55
55
|
setIsInserterOpened( false );
|
|
56
56
|
} else {
|
|
57
57
|
if ( ! isLastSelectedWidgetAreaOpen ) {
|
|
@@ -38,7 +38,7 @@ function KeyboardShortcuts() {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function KeyboardShortcutsRegister() {
|
|
41
|
-
// Registering the shortcuts
|
|
41
|
+
// Registering the shortcuts.
|
|
42
42
|
const { registerShortcut } = useDispatch( keyboardShortcutsStore );
|
|
43
43
|
useEffect( () => {
|
|
44
44
|
registerShortcut( {
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from '@wordpress/interface';
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
14
14
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
15
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Internal dependencies
|
|
@@ -54,9 +55,10 @@ function Interface( { blockEditorSettings } ) {
|
|
|
54
55
|
).getActiveComplementaryArea( editWidgetsStore.name ),
|
|
55
56
|
isInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),
|
|
56
57
|
isListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),
|
|
57
|
-
hasBlockBreadCrumbsEnabled: select(
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
hasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(
|
|
59
|
+
'core/edit-widgets',
|
|
60
|
+
'showBlockBreadcrumbs'
|
|
61
|
+
),
|
|
60
62
|
previousShortcut: select(
|
|
61
63
|
keyboardShortcutsStore
|
|
62
64
|
).getAllShortcutKeyCombinations(
|
|
@@ -5,7 +5,8 @@ import { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';
|
|
|
5
5
|
import { useState } from '@wordpress/element';
|
|
6
6
|
import { __, _x } from '@wordpress/i18n';
|
|
7
7
|
import { external } from '@wordpress/icons';
|
|
8
|
-
import { MoreMenuDropdown
|
|
8
|
+
import { MoreMenuDropdown } from '@wordpress/interface';
|
|
9
|
+
import { PreferenceToggleMenuItem } from '@wordpress/preferences';
|
|
9
10
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
10
11
|
import { useShortcut } from '@wordpress/keyboard-shortcuts';
|
|
11
12
|
import { useViewportMatch } from '@wordpress/compose';
|
|
@@ -38,9 +39,9 @@ export default function MoreMenu() {
|
|
|
38
39
|
<>
|
|
39
40
|
{ isLargeViewport && (
|
|
40
41
|
<MenuGroup label={ _x( 'View', 'noun' ) }>
|
|
41
|
-
<
|
|
42
|
+
<PreferenceToggleMenuItem
|
|
42
43
|
scope="core/edit-widgets"
|
|
43
|
-
|
|
44
|
+
name="fixedToolbar"
|
|
44
45
|
label={ __( 'Top toolbar' ) }
|
|
45
46
|
info={ __(
|
|
46
47
|
'Access all block and document tools in a single place'
|
|
@@ -63,9 +64,9 @@ export default function MoreMenu() {
|
|
|
63
64
|
>
|
|
64
65
|
{ __( 'Keyboard shortcuts' ) }
|
|
65
66
|
</MenuItem>
|
|
66
|
-
<
|
|
67
|
+
<PreferenceToggleMenuItem
|
|
67
68
|
scope="core/edit-widgets"
|
|
68
|
-
|
|
69
|
+
name="welcomeGuide"
|
|
69
70
|
label={ __( 'Welcome Guide' ) }
|
|
70
71
|
/>
|
|
71
72
|
<MenuItem
|
|
@@ -90,9 +91,9 @@ export default function MoreMenu() {
|
|
|
90
91
|
/>
|
|
91
92
|
</MenuGroup>
|
|
92
93
|
<MenuGroup label={ __( 'Preferences' ) }>
|
|
93
|
-
<
|
|
94
|
+
<PreferenceToggleMenuItem
|
|
94
95
|
scope="core/edit-widgets"
|
|
95
|
-
|
|
96
|
+
name="keepCaretInsideBlock"
|
|
96
97
|
label={ __(
|
|
97
98
|
'Contain text cursor inside block'
|
|
98
99
|
) }
|
|
@@ -106,18 +107,18 @@ export default function MoreMenu() {
|
|
|
106
107
|
'Contain text cursor inside block deactivated'
|
|
107
108
|
) }
|
|
108
109
|
/>
|
|
109
|
-
<
|
|
110
|
+
<PreferenceToggleMenuItem
|
|
110
111
|
scope="core/edit-widgets"
|
|
111
|
-
|
|
112
|
+
name="themeStyles"
|
|
112
113
|
info={ __(
|
|
113
114
|
'Make the editor look like your theme.'
|
|
114
115
|
) }
|
|
115
116
|
label={ __( 'Use theme styles' ) }
|
|
116
117
|
/>
|
|
117
118
|
{ isLargeViewport && (
|
|
118
|
-
<
|
|
119
|
+
<PreferenceToggleMenuItem
|
|
119
120
|
scope="core/edit-widgets"
|
|
120
|
-
|
|
121
|
+
name="showBlockBreadcrumbs"
|
|
121
122
|
label={ __( 'Display block breadcrumbs' ) }
|
|
122
123
|
info={ __(
|
|
123
124
|
'Shows block breadcrumbs at the bottom of the editor.'
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
__experimentalListView as ListView,
|
|
6
|
-
store as blockEditorStore,
|
|
7
|
-
} from '@wordpress/block-editor';
|
|
4
|
+
import { __experimentalListView as ListView } from '@wordpress/block-editor';
|
|
8
5
|
import { Button } from '@wordpress/components';
|
|
9
6
|
import {
|
|
10
7
|
useFocusOnMount,
|
|
@@ -25,12 +22,6 @@ import { store as editWidgetsStore } from '../../store';
|
|
|
25
22
|
export default function ListViewSidebar() {
|
|
26
23
|
const { setIsListViewOpened } = useDispatch( editWidgetsStore );
|
|
27
24
|
|
|
28
|
-
const { clearSelectedBlock, selectBlock } = useDispatch( blockEditorStore );
|
|
29
|
-
async function selectEditorBlock( clientId ) {
|
|
30
|
-
await clearSelectedBlock();
|
|
31
|
-
selectBlock( clientId, -1 );
|
|
32
|
-
}
|
|
33
|
-
|
|
34
25
|
const focusOnMountRef = useFocusOnMount( 'firstElement' );
|
|
35
26
|
const headerFocusReturnRef = useFocusReturn();
|
|
36
27
|
const contentFocusReturnRef = useFocusReturn();
|
|
@@ -70,7 +61,6 @@ export default function ListViewSidebar() {
|
|
|
70
61
|
] ) }
|
|
71
62
|
>
|
|
72
63
|
<ListView
|
|
73
|
-
onSelect={ selectEditorBlock }
|
|
74
64
|
showNestedBlocks
|
|
75
65
|
__experimentalHideContainerBlockActions
|
|
76
66
|
__experimentalFeatures
|
|
@@ -5,7 +5,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
5
5
|
import { ExternalLink, Guide } from '@wordpress/components';
|
|
6
6
|
import { __, sprintf, _n } from '@wordpress/i18n';
|
|
7
7
|
import { createInterpolateElement } from '@wordpress/element';
|
|
8
|
-
import { store as
|
|
8
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
@@ -15,14 +15,14 @@ import { store as editWidgetsStore } from '../../store';
|
|
|
15
15
|
export default function WelcomeGuide() {
|
|
16
16
|
const isActive = useSelect(
|
|
17
17
|
( select ) =>
|
|
18
|
-
select(
|
|
18
|
+
!! select( preferencesStore ).get(
|
|
19
19
|
'core/edit-widgets',
|
|
20
20
|
'welcomeGuide'
|
|
21
21
|
),
|
|
22
22
|
[]
|
|
23
23
|
);
|
|
24
24
|
|
|
25
|
-
const {
|
|
25
|
+
const { toggle } = useDispatch( preferencesStore );
|
|
26
26
|
|
|
27
27
|
const widgetAreas = useSelect(
|
|
28
28
|
( select ) =>
|
|
@@ -52,9 +52,7 @@ export default function WelcomeGuide() {
|
|
|
52
52
|
className="edit-widgets-welcome-guide"
|
|
53
53
|
contentLabel={ __( 'Welcome to block Widgets' ) }
|
|
54
54
|
finishButtonText={ __( 'Get started' ) }
|
|
55
|
-
onFinish={ () =>
|
|
56
|
-
toggleFeature( 'core/edit-widgets', 'welcomeGuide' )
|
|
57
|
-
}
|
|
55
|
+
onFinish={ () => toggle( 'core/edit-widgets', 'welcomeGuide' ) }
|
|
58
56
|
pages={ [
|
|
59
57
|
{
|
|
60
58
|
image: (
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from '@wordpress/block-editor';
|
|
12
12
|
import { useSelect } from '@wordpress/data';
|
|
13
13
|
import { useMemo } from '@wordpress/element';
|
|
14
|
-
import { store as
|
|
14
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Internal dependencies
|
|
@@ -24,7 +24,7 @@ export default function WidgetAreasBlockEditorContent( {
|
|
|
24
24
|
} ) {
|
|
25
25
|
const hasThemeStyles = useSelect(
|
|
26
26
|
( select ) =>
|
|
27
|
-
select(
|
|
27
|
+
!! select( preferencesStore ).get(
|
|
28
28
|
'core/edit-widgets',
|
|
29
29
|
'themeStyles'
|
|
30
30
|
),
|
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
CopyHandler,
|
|
17
17
|
} from '@wordpress/block-editor';
|
|
18
18
|
import { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';
|
|
19
|
-
import { store as interfaceStore } from '@wordpress/interface';
|
|
20
19
|
import { ShortcutProvider } from '@wordpress/keyboard-shortcuts';
|
|
20
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Internal dependencies
|
|
@@ -50,11 +50,11 @@ export default function WidgetAreasBlockEditorProvider( {
|
|
|
50
50
|
reusableBlocks: ALLOW_REUSABLE_BLOCKS
|
|
51
51
|
? select( coreStore ).getEntityRecords( 'postType', 'wp_block' )
|
|
52
52
|
: [],
|
|
53
|
-
isFixedToolbarActive: select(
|
|
53
|
+
isFixedToolbarActive: !! select( preferencesStore ).get(
|
|
54
54
|
'core/edit-widgets',
|
|
55
55
|
'fixedToolbar'
|
|
56
56
|
),
|
|
57
|
-
keepCaretInsideBlock: select(
|
|
57
|
+
keepCaretInsideBlock: !! select( preferencesStore ).get(
|
|
58
58
|
'core/edit-widgets',
|
|
59
59
|
'keepCaretInsideBlock'
|
|
60
60
|
),
|
package/src/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
registerLegacyWidgetVariations,
|
|
21
21
|
registerWidgetGroupBlock,
|
|
22
22
|
} from '@wordpress/widgets';
|
|
23
|
-
import { store as
|
|
23
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Internal dependencies
|
|
@@ -78,7 +78,7 @@ export function initialize( id, settings ) {
|
|
|
78
78
|
);
|
|
79
79
|
} );
|
|
80
80
|
|
|
81
|
-
dispatch(
|
|
81
|
+
dispatch( preferencesStore ).setDefaults( 'core/edit-widgets', {
|
|
82
82
|
fixedToolbar: false,
|
|
83
83
|
welcomeGuide: true,
|
|
84
84
|
showBlockBreadcrumbs: true,
|
package/src/store/actions.js
CHANGED
|
@@ -95,7 +95,7 @@ export const saveWidgetAreas = ( widgetAreas ) => async ( {
|
|
|
95
95
|
await dispatch.saveWidgetArea( widgetArea.id );
|
|
96
96
|
}
|
|
97
97
|
} finally {
|
|
98
|
-
// saveEditedEntityRecord resets the resolution status, let's fix it manually
|
|
98
|
+
// saveEditedEntityRecord resets the resolution status, let's fix it manually.
|
|
99
99
|
await registry
|
|
100
100
|
.dispatch( coreStore )
|
|
101
101
|
.finishResolution(
|
package/src/store/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import apiFetch from '@wordpress/api-fetch';
|
|
5
|
-
import { createReduxStore,
|
|
5
|
+
import { createReduxStore, register } from '@wordpress/data';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -16,7 +16,7 @@ import { STORE_NAME } from './constants';
|
|
|
16
16
|
/**
|
|
17
17
|
* Block editor data store configuration.
|
|
18
18
|
*
|
|
19
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#
|
|
19
|
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register
|
|
20
20
|
*
|
|
21
21
|
* @type {Object}
|
|
22
22
|
*/
|
|
@@ -25,7 +25,6 @@ const storeConfig = {
|
|
|
25
25
|
selectors,
|
|
26
26
|
resolvers,
|
|
27
27
|
actions,
|
|
28
|
-
__experimentalUseThunks: true,
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
/**
|
|
@@ -36,10 +35,7 @@ const storeConfig = {
|
|
|
36
35
|
* @type {Object}
|
|
37
36
|
*/
|
|
38
37
|
export const store = createReduxStore( STORE_NAME, storeConfig );
|
|
39
|
-
|
|
40
|
-
// Once we build a more generic persistence plugin that works across types of stores
|
|
41
|
-
// we'd be able to replace this with a register call.
|
|
42
|
-
registerStore( STORE_NAME, storeConfig );
|
|
38
|
+
register( store );
|
|
43
39
|
|
|
44
40
|
// This package uses a few in-memory post types as wrappers for convenience.
|
|
45
41
|
// This middleware prevents any network requests related to these types as they are
|
package/src/style.scss
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
@import "./components/error-boundary/style.scss";
|
|
5
5
|
@import "./components/header/style.scss";
|
|
6
6
|
@import "./components/keyboard-shortcut-help-modal/style.scss";
|
|
7
|
-
@import "./components/more-menu/style.scss";
|
|
8
7
|
@import "./components/sidebar/style.scss";
|
|
9
8
|
@import "./components/notices/style.scss";
|
|
10
9
|
@import "./components/layout/style.scss";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
.edit-widgets-more-menu {
|
|
2
|
-
margin-left: -4px;
|
|
3
|
-
|
|
4
|
-
// the padding and margin of the more menu is intentionally non-standard
|
|
5
|
-
.components-button {
|
|
6
|
-
width: auto;
|
|
7
|
-
padding: 0 2px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@include break-small() {
|
|
11
|
-
margin-left: 0;
|
|
12
|
-
|
|
13
|
-
.components-button {
|
|
14
|
-
padding: 0 4px;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.edit-widgets-more-menu__content .components-popover__content {
|
|
20
|
-
min-width: 280px;
|
|
21
|
-
|
|
22
|
-
// Let the menu scale to fit items.
|
|
23
|
-
@include break-mobile() {
|
|
24
|
-
width: auto;
|
|
25
|
-
max-width: $break-mobile;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.components-dropdown-menu__menu {
|
|
29
|
-
padding: 0;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.components-popover.edit-widgets-more-menu__content {
|
|
34
|
-
z-index: z-index(".components-popover.edit-widgets-more-menu__content");
|
|
35
|
-
}
|