@wordpress/edit-site 4.7.0 → 4.8.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/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +3 -7
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +9 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/more-menu/copy-content-menu-item.js +1 -1
- package/build/components/header/more-menu/copy-content-menu-item.js.map +1 -1
- package/build/components/header/more-menu/site-export.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/navigation-menu-sidebar/navigation-inspector.js.map +1 -1
- package/build/components/sidebar/template-card/index.js.map +1 -1
- package/build/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +3 -5
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +9 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/more-menu/copy-content-menu-item.js +1 -1
- package/build-module/components/header/more-menu/copy-content-menu-item.js.map +1 -1
- package/build-module/components/header/more-menu/site-export.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/navigation-menu-sidebar/navigation-inspector.js.map +1 -1
- package/build-module/components/sidebar/template-card/index.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +3 -6
- package/build-style/style.css +3 -6
- package/package.json +29 -29
- package/src/components/add-new-template/new-template.js +2 -3
- package/src/components/block-editor/block-inspector-button.js +2 -3
- package/src/components/block-editor/index.js +4 -9
- package/src/components/edit-template-part-menu-button/index.js +2 -3
- package/src/components/editor/index.js +4 -5
- package/src/components/global-styles/global-styles-provider.js +4 -8
- package/src/components/global-styles/gradients-palette-panel.js +2 -5
- package/src/components/global-styles/hooks.js +4 -3
- package/src/components/global-styles/screen-block-list.js +4 -4
- package/src/components/global-styles/screen-root.js +4 -3
- package/src/components/global-styles/screen-style-variations.js +10 -4
- package/src/components/header/index.js +2 -3
- package/src/components/header/mode-switcher/index.js +4 -4
- package/src/components/header/more-menu/copy-content-menu-item.js +3 -4
- package/src/components/header/more-menu/site-export.js +2 -3
- package/src/components/keyboard-shortcuts/index.js +6 -10
- package/src/components/list/actions/index.js +2 -3
- package/src/components/list/actions/rename-menu-item.js +4 -6
- package/src/components/list/added-by.js +4 -3
- package/src/components/navigation-sidebar/index.js +2 -4
- package/src/components/save-button/index.js +2 -4
- package/src/components/sidebar/index.js +6 -6
- package/src/components/sidebar/navigation-menu-sidebar/navigation-inspector.js +6 -9
- package/src/components/sidebar/template-card/index.js +2 -3
- package/src/components/sidebar/template-card/template-areas.js +6 -6
- package/src/components/template-details/template-areas.js +6 -6
- package/src/components/template-part-converter/index.js +2 -3
- package/src/components/url-query-controller/index.js +2 -3
- package/src/store/actions.js +257 -233
- package/src/store/selectors.js +9 -10
package/build-style/style.css
CHANGED
|
@@ -1094,8 +1094,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
|
|
|
1094
1094
|
width: 36px;
|
|
1095
1095
|
height: 36px;
|
|
1096
1096
|
border-radius: 2px;
|
|
1097
|
-
|
|
1098
|
-
object-fit: cover;
|
|
1097
|
+
object-fit: cover;
|
|
1099
1098
|
margin-top: -1px;
|
|
1100
1099
|
}
|
|
1101
1100
|
|
|
@@ -1434,8 +1433,7 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1434
1433
|
.edit-site-list-added-by__avatar img {
|
|
1435
1434
|
width: 32px;
|
|
1436
1435
|
height: 32px;
|
|
1437
|
-
|
|
1438
|
-
object-fit: cover;
|
|
1436
|
+
object-fit: cover;
|
|
1439
1437
|
opacity: 0;
|
|
1440
1438
|
transition: opacity 0.1s linear;
|
|
1441
1439
|
}
|
|
@@ -1963,8 +1961,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
1963
1961
|
.edit-site-welcome-guide__image > img {
|
|
1964
1962
|
display: block;
|
|
1965
1963
|
max-width: 100%;
|
|
1966
|
-
|
|
1967
|
-
object-fit: cover;
|
|
1964
|
+
object-fit: cover;
|
|
1968
1965
|
}
|
|
1969
1966
|
.edit-site-welcome-guide__heading {
|
|
1970
1967
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,33 +27,33 @@
|
|
|
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": "^9.
|
|
33
|
-
"@wordpress/block-library": "^7.
|
|
34
|
-
"@wordpress/blocks": "^11.
|
|
35
|
-
"@wordpress/components": "^19.
|
|
36
|
-
"@wordpress/compose": "^5.
|
|
37
|
-
"@wordpress/core-data": "^4.
|
|
38
|
-
"@wordpress/data": "^6.
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/editor": "^12.
|
|
41
|
-
"@wordpress/element": "^4.
|
|
42
|
-
"@wordpress/hooks": "^3.
|
|
43
|
-
"@wordpress/html-entities": "^3.
|
|
44
|
-
"@wordpress/i18n": "^4.
|
|
45
|
-
"@wordpress/icons": "^9.
|
|
46
|
-
"@wordpress/interface": "^4.
|
|
47
|
-
"@wordpress/keyboard-shortcuts": "^3.
|
|
48
|
-
"@wordpress/keycodes": "^3.
|
|
49
|
-
"@wordpress/media-utils": "^4.
|
|
50
|
-
"@wordpress/notices": "^3.
|
|
51
|
-
"@wordpress/plugins": "^4.
|
|
52
|
-
"@wordpress/preferences": "^2.
|
|
53
|
-
"@wordpress/reusable-blocks": "^3.
|
|
54
|
-
"@wordpress/style-engine": "^0.
|
|
55
|
-
"@wordpress/url": "^3.
|
|
56
|
-
"@wordpress/viewport": "^4.
|
|
30
|
+
"@wordpress/a11y": "^3.11.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.8.0",
|
|
32
|
+
"@wordpress/block-editor": "^9.3.0",
|
|
33
|
+
"@wordpress/block-library": "^7.8.0",
|
|
34
|
+
"@wordpress/blocks": "^11.10.0",
|
|
35
|
+
"@wordpress/components": "^19.13.0",
|
|
36
|
+
"@wordpress/compose": "^5.9.0",
|
|
37
|
+
"@wordpress/core-data": "^4.9.0",
|
|
38
|
+
"@wordpress/data": "^6.11.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.11.0",
|
|
40
|
+
"@wordpress/editor": "^12.10.0",
|
|
41
|
+
"@wordpress/element": "^4.9.0",
|
|
42
|
+
"@wordpress/hooks": "^3.11.0",
|
|
43
|
+
"@wordpress/html-entities": "^3.11.0",
|
|
44
|
+
"@wordpress/i18n": "^4.11.0",
|
|
45
|
+
"@wordpress/icons": "^9.2.0",
|
|
46
|
+
"@wordpress/interface": "^4.10.0",
|
|
47
|
+
"@wordpress/keyboard-shortcuts": "^3.9.0",
|
|
48
|
+
"@wordpress/keycodes": "^3.11.0",
|
|
49
|
+
"@wordpress/media-utils": "^4.2.0",
|
|
50
|
+
"@wordpress/notices": "^3.11.0",
|
|
51
|
+
"@wordpress/plugins": "^4.9.0",
|
|
52
|
+
"@wordpress/preferences": "^2.3.0",
|
|
53
|
+
"@wordpress/reusable-blocks": "^3.9.0",
|
|
54
|
+
"@wordpress/style-engine": "^0.10.0",
|
|
55
|
+
"@wordpress/url": "^3.12.0",
|
|
56
|
+
"@wordpress/viewport": "^4.9.0",
|
|
57
57
|
"classnames": "^2.3.1",
|
|
58
58
|
"downloadjs": "^1.4.7",
|
|
59
59
|
"history": "^5.1.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "48d5f37dfb52d2e77c8eeb662f9874cf141b8c6b"
|
|
72
72
|
}
|
|
@@ -79,9 +79,8 @@ export default function NewTemplate( { postType } ) {
|
|
|
79
79
|
'wp_template',
|
|
80
80
|
{ per_page: -1 }
|
|
81
81
|
),
|
|
82
|
-
defaultTemplateTypes:
|
|
83
|
-
editorStore
|
|
84
|
-
).__experimentalGetDefaultTemplateTypes(),
|
|
82
|
+
defaultTemplateTypes:
|
|
83
|
+
select( editorStore ).__experimentalGetDefaultTemplateTypes(),
|
|
85
84
|
} ),
|
|
86
85
|
[]
|
|
87
86
|
);
|
|
@@ -30,9 +30,8 @@ export default function BlockInspectorButton( { onClick = () => {} } ) {
|
|
|
30
30
|
} ),
|
|
31
31
|
[]
|
|
32
32
|
);
|
|
33
|
-
const { enableComplementaryArea, disableComplementaryArea } =
|
|
34
|
-
interfaceStore
|
|
35
|
-
);
|
|
33
|
+
const { enableComplementaryArea, disableComplementaryArea } =
|
|
34
|
+
useDispatch( interfaceStore );
|
|
36
35
|
|
|
37
36
|
const label = isBlockInspectorOpen
|
|
38
37
|
? __( 'Hide more settings' )
|
|
@@ -51,12 +51,8 @@ const LAYOUT = {
|
|
|
51
51
|
export default function BlockEditor( { setIsInserterOpen } ) {
|
|
52
52
|
const { storedSettings, templateType, templateId, page } = useSelect(
|
|
53
53
|
( select ) => {
|
|
54
|
-
const {
|
|
55
|
-
|
|
56
|
-
getEditedPostType,
|
|
57
|
-
getEditedPostId,
|
|
58
|
-
getPage,
|
|
59
|
-
} = select( editSiteStore );
|
|
54
|
+
const { getSettings, getEditedPostType, getEditedPostId, getPage } =
|
|
55
|
+
select( editSiteStore );
|
|
60
56
|
|
|
61
57
|
return {
|
|
62
58
|
storedSettings: getSettings( setIsInserterOpen ),
|
|
@@ -78,9 +74,8 @@ export default function BlockEditor( { setIsInserterOpen } ) {
|
|
|
78
74
|
const { restBlockPatterns, restBlockPatternCategories } = useSelect(
|
|
79
75
|
( select ) => ( {
|
|
80
76
|
restBlockPatterns: select( coreStore ).getBlockPatterns(),
|
|
81
|
-
restBlockPatternCategories:
|
|
82
|
-
coreStore
|
|
83
|
-
).getBlockPatternCategories(),
|
|
77
|
+
restBlockPatternCategories:
|
|
78
|
+
select( coreStore ).getBlockPatternCategories(),
|
|
84
79
|
} ),
|
|
85
80
|
[]
|
|
86
81
|
);
|
|
@@ -34,9 +34,8 @@ function EditTemplatePartMenuItem( { selectedClientId, onClose } ) {
|
|
|
34
34
|
const { params } = useLocation();
|
|
35
35
|
const selectedTemplatePart = useSelect(
|
|
36
36
|
( select ) => {
|
|
37
|
-
const block =
|
|
38
|
-
selectedClientId
|
|
39
|
-
);
|
|
37
|
+
const block =
|
|
38
|
+
select( blockEditorStore ).getBlock( selectedClientId );
|
|
40
39
|
|
|
41
40
|
if ( block && isTemplatePart( block ) ) {
|
|
42
41
|
const { theme, slug } = block.attributes;
|
|
@@ -119,10 +119,8 @@ function Editor( { onError } ) {
|
|
|
119
119
|
const { setPage, setIsInserterOpened } = useDispatch( editSiteStore );
|
|
120
120
|
const { enableComplementaryArea } = useDispatch( interfaceStore );
|
|
121
121
|
|
|
122
|
-
const [
|
|
123
|
-
|
|
124
|
-
setIsEntitiesSavedStatesOpen,
|
|
125
|
-
] = useState( false );
|
|
122
|
+
const [ isEntitiesSavedStatesOpen, setIsEntitiesSavedStatesOpen ] =
|
|
123
|
+
useState( false );
|
|
126
124
|
const openEntitiesSavedStates = useCallback(
|
|
127
125
|
() => setIsEntitiesSavedStatesOpen( true ),
|
|
128
126
|
[]
|
|
@@ -217,7 +215,8 @@ function Editor( { onError } ) {
|
|
|
217
215
|
<InterfaceSkeleton
|
|
218
216
|
labels={ {
|
|
219
217
|
...interfaceLabels,
|
|
220
|
-
secondarySidebar:
|
|
218
|
+
secondarySidebar:
|
|
219
|
+
secondarySidebarLabel,
|
|
221
220
|
} }
|
|
222
221
|
className={
|
|
223
222
|
showIconLabels &&
|
|
@@ -48,9 +48,8 @@ const cleanEmptyObject = ( object ) => {
|
|
|
48
48
|
|
|
49
49
|
function useGlobalStylesUserConfig() {
|
|
50
50
|
const { globalStylesId, settings, styles } = useSelect( ( select ) => {
|
|
51
|
-
const _globalStylesId =
|
|
52
|
-
coreStore
|
|
53
|
-
).__experimentalGetCurrentGlobalStylesId();
|
|
51
|
+
const _globalStylesId =
|
|
52
|
+
select( coreStore ).__experimentalGetCurrentGlobalStylesId();
|
|
54
53
|
const record = _globalStylesId
|
|
55
54
|
? select( coreStore ).getEditedEntityRecord(
|
|
56
55
|
'root',
|
|
@@ -108,11 +107,8 @@ function useGlobalStylesBaseConfig() {
|
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
function useGlobalStylesContext() {
|
|
111
|
-
const [
|
|
112
|
-
|
|
113
|
-
userConfig,
|
|
114
|
-
setUserConfig,
|
|
115
|
-
] = useGlobalStylesUserConfig();
|
|
110
|
+
const [ isUserConfigReady, userConfig, setUserConfig ] =
|
|
111
|
+
useGlobalStylesUserConfig();
|
|
116
112
|
const [ isBaseConfigReady, baseConfig ] = useGlobalStylesBaseConfig();
|
|
117
113
|
const mergedConfig = useMemo( () => {
|
|
118
114
|
if ( ! baseConfig || ! userConfig ) {
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { noop } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -20,6 +15,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
20
15
|
import { useSetting } from './hooks';
|
|
21
16
|
import Subtitle from './subtitle';
|
|
22
17
|
|
|
18
|
+
const noop = () => {};
|
|
19
|
+
|
|
23
20
|
export default function GradientPalettePanel( { name } ) {
|
|
24
21
|
const [ themeGradients, setThemeGradients ] = useSetting(
|
|
25
22
|
'color.gradients.theme',
|
|
@@ -27,9 +27,10 @@ export const useGlobalStylesReset = () => {
|
|
|
27
27
|
const canReset = !! config && ! isEqual( config, EMPTY_CONFIG );
|
|
28
28
|
return [
|
|
29
29
|
canReset,
|
|
30
|
-
useCallback(
|
|
31
|
-
setUserConfig,
|
|
32
|
-
|
|
30
|
+
useCallback(
|
|
31
|
+
() => setUserConfig( () => EMPTY_CONFIG ),
|
|
32
|
+
[ setUserConfig ]
|
|
33
|
+
),
|
|
33
34
|
];
|
|
34
35
|
};
|
|
35
36
|
|
|
@@ -40,10 +40,10 @@ function useSortedBlockTypes() {
|
|
|
40
40
|
type.push( block );
|
|
41
41
|
return blocks;
|
|
42
42
|
};
|
|
43
|
-
const {
|
|
44
|
-
|
|
45
|
-
noncore:
|
|
46
|
-
|
|
43
|
+
const { core: coreItems, noncore: nonCoreItems } = blockItems.reduce(
|
|
44
|
+
groupByType,
|
|
45
|
+
{ core: [], noncore: [] }
|
|
46
|
+
);
|
|
47
47
|
return [ ...coreItems, ...nonCoreItems ];
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -28,9 +28,10 @@ import StylesPreview from './preview';
|
|
|
28
28
|
function ScreenRoot() {
|
|
29
29
|
const { variations } = useSelect( ( select ) => {
|
|
30
30
|
return {
|
|
31
|
-
variations:
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
variations:
|
|
32
|
+
select(
|
|
33
|
+
coreStore
|
|
34
|
+
).__experimentalGetCurrentThemeGlobalStylesVariations(),
|
|
34
35
|
};
|
|
35
36
|
}, [] );
|
|
36
37
|
|
|
@@ -79,6 +79,7 @@ function Variation( { variation } ) {
|
|
|
79
79
|
onKeyDown={ selectOnEnter }
|
|
80
80
|
tabIndex="0"
|
|
81
81
|
aria-label={ variation?.title }
|
|
82
|
+
aria-current={ isActive }
|
|
82
83
|
onFocus={ () => setIsFocused( true ) }
|
|
83
84
|
onBlur={ () => setIsFocused( false ) }
|
|
84
85
|
>
|
|
@@ -96,9 +97,10 @@ function Variation( { variation } ) {
|
|
|
96
97
|
function ScreenStyleVariations() {
|
|
97
98
|
const { variations } = useSelect( ( select ) => {
|
|
98
99
|
return {
|
|
99
|
-
variations:
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
variations:
|
|
101
|
+
select(
|
|
102
|
+
coreStore
|
|
103
|
+
).__experimentalGetCurrentThemeGlobalStylesVariations(),
|
|
102
104
|
};
|
|
103
105
|
}, [] );
|
|
104
106
|
|
|
@@ -109,7 +111,11 @@ function ScreenStyleVariations() {
|
|
|
109
111
|
settings: {},
|
|
110
112
|
styles: {},
|
|
111
113
|
},
|
|
112
|
-
...variations
|
|
114
|
+
...variations.map( ( variation ) => ( {
|
|
115
|
+
...variation,
|
|
116
|
+
settings: variation.settings ?? {},
|
|
117
|
+
styles: variation.styles ?? {},
|
|
118
|
+
} ) ),
|
|
113
119
|
];
|
|
114
120
|
}, [ variations ] );
|
|
115
121
|
|
|
@@ -57,9 +57,8 @@ export default function Header( {
|
|
|
57
57
|
getEditorMode,
|
|
58
58
|
} = select( editSiteStore );
|
|
59
59
|
const { getEditedEntityRecord } = select( coreStore );
|
|
60
|
-
const { __experimentalGetTemplateInfo: getTemplateInfo } =
|
|
61
|
-
editorStore
|
|
62
|
-
);
|
|
60
|
+
const { __experimentalGetTemplateInfo: getTemplateInfo } =
|
|
61
|
+
select( editorStore );
|
|
63
62
|
const { getShortcutRepresentation } = select( keyboardShortcutsStore );
|
|
64
63
|
|
|
65
64
|
const postType = getEditedPostType();
|
|
@@ -36,10 +36,10 @@ function ModeSwitcher() {
|
|
|
36
36
|
shortcut: select(
|
|
37
37
|
keyboardShortcutsStore
|
|
38
38
|
).getShortcutRepresentation( 'core/edit-site/toggle-mode' ),
|
|
39
|
-
isRichEditingEnabled:
|
|
40
|
-
.richEditingEnabled,
|
|
41
|
-
isCodeEditingEnabled:
|
|
42
|
-
.codeEditingEnabled,
|
|
39
|
+
isRichEditingEnabled:
|
|
40
|
+
select( editSiteStore ).getSettings().richEditingEnabled,
|
|
41
|
+
isCodeEditingEnabled:
|
|
42
|
+
select( editSiteStore ).getSettings().codeEditingEnabled,
|
|
43
43
|
mode: select( editSiteStore ).getEditorMode(),
|
|
44
44
|
} ),
|
|
45
45
|
[]
|
|
@@ -18,9 +18,8 @@ export default function CopyContentMenuItem() {
|
|
|
18
18
|
const { createNotice } = useDispatch( noticesStore );
|
|
19
19
|
const getText = useSelect( ( select ) => {
|
|
20
20
|
return () => {
|
|
21
|
-
const { getEditedPostId, getEditedPostType } =
|
|
22
|
-
editSiteStore
|
|
23
|
-
);
|
|
21
|
+
const { getEditedPostId, getEditedPostType } =
|
|
22
|
+
select( editSiteStore );
|
|
24
23
|
const { getEditedEntityRecord } = select( coreStore );
|
|
25
24
|
const record = getEditedEntityRecord(
|
|
26
25
|
'postType',
|
|
@@ -49,5 +48,5 @@ export default function CopyContentMenuItem() {
|
|
|
49
48
|
|
|
50
49
|
const ref = useCopyToClipboard( getText, onSuccess );
|
|
51
50
|
|
|
52
|
-
return <MenuItem ref={ ref }>{ __( 'Copy all
|
|
51
|
+
return <MenuItem ref={ ref }>{ __( 'Copy all blocks' ) }</MenuItem>;
|
|
53
52
|
}
|
|
@@ -26,9 +26,8 @@ export default function SiteExport() {
|
|
|
26
26
|
const contentDisposition = response.headers.get(
|
|
27
27
|
'content-disposition'
|
|
28
28
|
);
|
|
29
|
-
const contentDispositionMatches =
|
|
30
|
-
/=(.+)\.zip/
|
|
31
|
-
);
|
|
29
|
+
const contentDispositionMatches =
|
|
30
|
+
contentDisposition.match( /=(.+)\.zip/ );
|
|
32
31
|
const fileName = contentDispositionMatches[ 1 ]
|
|
33
32
|
? contentDispositionMatches[ 1 ]
|
|
34
33
|
: 'edit-site-export';
|
|
@@ -19,10 +19,8 @@ import { SIDEBAR_BLOCK } from '../sidebar/constants';
|
|
|
19
19
|
import { STORE_NAME } from '../../store/constants';
|
|
20
20
|
|
|
21
21
|
function KeyboardShortcuts( { openEntitiesSavedStates } ) {
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
isSavingEntityRecord,
|
|
25
|
-
} = useSelect( coreStore );
|
|
22
|
+
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =
|
|
23
|
+
useSelect( coreStore );
|
|
26
24
|
const { getEditorMode } = useSelect( editSiteStore );
|
|
27
25
|
const isListViewOpen = useSelect(
|
|
28
26
|
( select ) => select( editSiteStore ).isListViewOpened(),
|
|
@@ -36,12 +34,10 @@ function KeyboardShortcuts( { openEntitiesSavedStates } ) {
|
|
|
36
34
|
[]
|
|
37
35
|
);
|
|
38
36
|
const { redo, undo } = useDispatch( coreStore );
|
|
39
|
-
const { setIsListViewOpened, switchEditorMode } =
|
|
40
|
-
editSiteStore
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
interfaceStore
|
|
44
|
-
);
|
|
37
|
+
const { setIsListViewOpened, switchEditorMode } =
|
|
38
|
+
useDispatch( editSiteStore );
|
|
39
|
+
const { enableComplementaryArea, disableComplementaryArea } =
|
|
40
|
+
useDispatch( interfaceStore );
|
|
45
41
|
|
|
46
42
|
useShortcut( 'core/edit-site/save', ( event ) => {
|
|
47
43
|
event.preventDefault();
|
|
@@ -19,9 +19,8 @@ import RenameMenuItem from './rename-menu-item';
|
|
|
19
19
|
export default function Actions( { template } ) {
|
|
20
20
|
const { removeTemplate, revertTemplate } = useDispatch( editSiteStore );
|
|
21
21
|
const { saveEditedEntityRecord } = useDispatch( coreStore );
|
|
22
|
-
const { createSuccessNotice, createErrorNotice } =
|
|
23
|
-
noticesStore
|
|
24
|
-
);
|
|
22
|
+
const { createSuccessNotice, createErrorNotice } =
|
|
23
|
+
useDispatch( noticesStore );
|
|
25
24
|
|
|
26
25
|
const isRemovable = isTemplateRemovable( template );
|
|
27
26
|
const isRevertable = isTemplateRevertable( template );
|
|
@@ -19,12 +19,10 @@ export default function RenameMenuItem( { template, onClose } ) {
|
|
|
19
19
|
const [ title, setTitle ] = useState( () => template.title.rendered );
|
|
20
20
|
const [ isModalOpen, setIsModalOpen ] = useState( false );
|
|
21
21
|
|
|
22
|
-
const { editEntityRecord, saveEditedEntityRecord } =
|
|
23
|
-
coreStore
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
noticesStore
|
|
27
|
-
);
|
|
22
|
+
const { editEntityRecord, saveEditedEntityRecord } =
|
|
23
|
+
useDispatch( coreStore );
|
|
24
|
+
const { createSuccessNotice, createErrorNotice } =
|
|
25
|
+
useDispatch( noticesStore );
|
|
28
26
|
|
|
29
27
|
if ( ! template.is_custom ) {
|
|
30
28
|
return null;
|
|
@@ -106,9 +106,10 @@ function AddedByPlugin( { slug, isCustomized } ) {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
function AddedByAuthor( { id } ) {
|
|
109
|
-
const user = useSelect(
|
|
110
|
-
id,
|
|
111
|
-
|
|
109
|
+
const user = useSelect(
|
|
110
|
+
( select ) => select( coreStore ).getUser( id ),
|
|
111
|
+
[ id ]
|
|
112
|
+
);
|
|
112
113
|
|
|
113
114
|
return (
|
|
114
115
|
<BaseAddedBy
|
|
@@ -18,10 +18,8 @@ export const {
|
|
|
18
18
|
Slot: NavigationPanelPreviewSlot,
|
|
19
19
|
} = createSlotFill( 'EditSiteNavigationPanelPreview' );
|
|
20
20
|
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
Slot: NavigationSidebarSlot,
|
|
24
|
-
} = createSlotFill( 'EditSiteNavigationSidebar' );
|
|
21
|
+
const { Fill: NavigationSidebarFill, Slot: NavigationSidebarSlot } =
|
|
22
|
+
createSlotFill( 'EditSiteNavigationSidebar' );
|
|
25
23
|
|
|
26
24
|
function NavigationSidebar( { isDefaultOpen = false, activeTemplateType } ) {
|
|
27
25
|
const isDesktopViewport = useViewportMatch( 'medium' );
|
|
@@ -16,10 +16,8 @@ export default function SaveButton( {
|
|
|
16
16
|
isEntitiesSavedStatesOpen,
|
|
17
17
|
} ) {
|
|
18
18
|
const { isDirty, isSaving } = useSelect( ( select ) => {
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
isSavingEntityRecord,
|
|
22
|
-
} = select( coreStore );
|
|
19
|
+
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =
|
|
20
|
+
select( coreStore );
|
|
23
21
|
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
24
22
|
return {
|
|
25
23
|
isDirty: dirtyEntityRecords.length > 0,
|
|
@@ -28,9 +28,10 @@ export const SidebarInspectorFill = InspectorFill;
|
|
|
28
28
|
export function SidebarComplementaryAreaFills() {
|
|
29
29
|
const { sidebar, isEditorSidebarOpened, hasBlockSelection } = useSelect(
|
|
30
30
|
( select ) => {
|
|
31
|
-
const _sidebar =
|
|
32
|
-
interfaceStore
|
|
33
|
-
|
|
31
|
+
const _sidebar =
|
|
32
|
+
select( interfaceStore ).getActiveComplementaryArea(
|
|
33
|
+
STORE_NAME
|
|
34
|
+
);
|
|
34
35
|
const _isEditorSidebarOpened = [
|
|
35
36
|
SIDEBAR_BLOCK,
|
|
36
37
|
SIDEBAR_TEMPLATE,
|
|
@@ -38,9 +39,8 @@ export function SidebarComplementaryAreaFills() {
|
|
|
38
39
|
return {
|
|
39
40
|
sidebar: _sidebar,
|
|
40
41
|
isEditorSidebarOpened: _isEditorSidebarOpened,
|
|
41
|
-
hasBlockSelection:
|
|
42
|
-
blockEditorStore
|
|
43
|
-
).getBlockSelectionStart(),
|
|
42
|
+
hasBlockSelection:
|
|
43
|
+
!! select( blockEditorStore ).getBlockSelectionStart(),
|
|
44
44
|
};
|
|
45
45
|
},
|
|
46
46
|
[]
|
|
@@ -35,9 +35,8 @@ export default function NavigationInspector() {
|
|
|
35
35
|
getBlock,
|
|
36
36
|
} = select( blockEditorStore );
|
|
37
37
|
|
|
38
|
-
const { getEntityRecords, hasFinishedResolution, isResolving } =
|
|
39
|
-
coreStore
|
|
40
|
-
);
|
|
38
|
+
const { getEntityRecords, hasFinishedResolution, isResolving } =
|
|
39
|
+
select( coreStore );
|
|
41
40
|
|
|
42
41
|
const navigationMenusQuery = [
|
|
43
42
|
'postType',
|
|
@@ -46,14 +45,12 @@ export default function NavigationInspector() {
|
|
|
46
45
|
];
|
|
47
46
|
|
|
48
47
|
// Get the active Navigation block (if present).
|
|
49
|
-
const selectedNavId =
|
|
50
|
-
'core/navigation'
|
|
51
|
-
);
|
|
48
|
+
const selectedNavId =
|
|
49
|
+
__experimentalGetActiveBlockIdByBlockNames( 'core/navigation' );
|
|
52
50
|
|
|
53
51
|
// Get all Navigation blocks currently within the editor canvas.
|
|
54
|
-
const navBlockIds =
|
|
55
|
-
'core/navigation'
|
|
56
|
-
);
|
|
52
|
+
const navBlockIds =
|
|
53
|
+
__experimentalGetGlobalBlocksByName( 'core/navigation' );
|
|
57
54
|
const idToRef = {};
|
|
58
55
|
navBlockIds.forEach( ( id ) => {
|
|
59
56
|
idToRef[ id ] = getBlock( id )?.attributes?.ref;
|
|
@@ -16,9 +16,8 @@ export default function TemplateCard() {
|
|
|
16
16
|
const { title, description, icon } = useSelect( ( select ) => {
|
|
17
17
|
const { getEditedPostType, getEditedPostId } = select( editSiteStore );
|
|
18
18
|
const { getEntityRecord } = select( coreStore );
|
|
19
|
-
const { __experimentalGetTemplateInfo: getTemplateInfo } =
|
|
20
|
-
editorStore
|
|
21
|
-
);
|
|
19
|
+
const { __experimentalGetTemplateInfo: getTemplateInfo } =
|
|
20
|
+
select( editorStore );
|
|
22
21
|
|
|
23
22
|
const postType = getEditedPostType();
|
|
24
23
|
const postId = getEditedPostId();
|
|
@@ -16,14 +16,14 @@ import { __ } from '@wordpress/i18n';
|
|
|
16
16
|
import { store as editSiteStore } from '../../../store';
|
|
17
17
|
|
|
18
18
|
function TemplateAreaItem( { area, clientId } ) {
|
|
19
|
-
const { selectBlock, toggleBlockHighlight } =
|
|
20
|
-
blockEditorStore
|
|
21
|
-
);
|
|
19
|
+
const { selectBlock, toggleBlockHighlight } =
|
|
20
|
+
useDispatch( blockEditorStore );
|
|
22
21
|
const templatePartArea = useSelect(
|
|
23
22
|
( select ) => {
|
|
24
|
-
const defaultAreas =
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const defaultAreas =
|
|
24
|
+
select(
|
|
25
|
+
editorStore
|
|
26
|
+
).__experimentalGetDefaultTemplatePartAreas();
|
|
27
27
|
|
|
28
28
|
return defaultAreas.find(
|
|
29
29
|
( defaultArea ) => defaultArea.area === area
|
|
@@ -75,14 +75,14 @@ function TemplatePartItem( {
|
|
|
75
75
|
clientId,
|
|
76
76
|
closeTemplateDetailsDropdown,
|
|
77
77
|
} ) {
|
|
78
|
-
const { selectBlock, toggleBlockHighlight } =
|
|
79
|
-
blockEditorStore
|
|
80
|
-
);
|
|
78
|
+
const { selectBlock, toggleBlockHighlight } =
|
|
79
|
+
useDispatch( blockEditorStore );
|
|
81
80
|
const templatePartArea = useSelect(
|
|
82
81
|
( select ) => {
|
|
83
|
-
const defaultAreas =
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
const defaultAreas =
|
|
83
|
+
select(
|
|
84
|
+
editorStore
|
|
85
|
+
).__experimentalGetDefaultTemplatePartAreas();
|
|
86
86
|
|
|
87
87
|
return defaultAreas.find(
|
|
88
88
|
( defaultArea ) => defaultArea.area === templatePart.area
|
|
@@ -12,9 +12,8 @@ import ConvertToTemplatePart from './convert-to-template-part';
|
|
|
12
12
|
|
|
13
13
|
export default function TemplatePartConverter() {
|
|
14
14
|
const { clientIds, blocks } = useSelect( ( select ) => {
|
|
15
|
-
const { getSelectedBlockClientIds, getBlocksByClientId } =
|
|
16
|
-
blockEditorStore
|
|
17
|
-
);
|
|
15
|
+
const { getSelectedBlockClientIds, getBlocksByClientId } =
|
|
16
|
+
select( blockEditorStore );
|
|
18
17
|
const selectedBlockClientIds = getSelectedBlockClientIds();
|
|
19
18
|
return {
|
|
20
19
|
clientIds: selectedBlockClientIds,
|
|
@@ -11,9 +11,8 @@ import { useLocation } from '../routes';
|
|
|
11
11
|
import { store as editSiteStore } from '../../store';
|
|
12
12
|
|
|
13
13
|
export default function URLQueryController() {
|
|
14
|
-
const { setTemplate, setTemplatePart, setPage } =
|
|
15
|
-
editSiteStore
|
|
16
|
-
);
|
|
14
|
+
const { setTemplate, setTemplatePart, setPage } =
|
|
15
|
+
useDispatch( editSiteStore );
|
|
17
16
|
const {
|
|
18
17
|
params: { postId, postType },
|
|
19
18
|
} = useLocation();
|