@wordpress/edit-site 5.3.3 → 5.3.5
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/add-new-template/new-template-part.js +3 -6
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +3 -6
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/global-styles/screen-border.js +1 -1
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/ui.js +1 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/list/table.js +0 -1
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-inspector/navigation-menu.js +4 -2
- package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build/components/save-panel/index.js +11 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +14 -33
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +4 -7
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +3 -3
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +8 -12
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -3
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +1 -14
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +8 -12
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +8 -7
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +34 -32
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +67 -18
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +3 -6
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +3 -6
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +1 -1
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/ui.js +1 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/list/table.js +0 -1
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +4 -2
- package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build-module/components/save-panel/index.js +8 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +15 -32
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +5 -8
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +3 -3
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +9 -13
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +1 -13
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +9 -13
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -7
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +34 -32
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +67 -18
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +19 -9
- package/build-style/style.css +19 -9
- package/package.json +21 -21
- package/src/components/add-new-template/new-template-part.js +3 -6
- package/src/components/add-new-template/new-template.js +3 -6
- package/src/components/editor/style.scss +0 -6
- package/src/components/global-styles/screen-border.js +1 -1
- package/src/components/global-styles/ui.js +1 -1
- package/src/components/layout/style.scss +8 -1
- package/src/components/list/table.js +0 -4
- package/src/components/navigation-inspector/navigation-menu.js +8 -2
- package/src/components/save-panel/index.js +8 -1
- package/src/components/sidebar/index.js +26 -27
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +3 -7
- package/src/components/sidebar-edit-mode/style.scss +16 -0
- package/src/components/sidebar-navigation-screen/index.js +31 -37
- package/src/components/sidebar-navigation-screen/style.scss +1 -0
- package/src/components/sidebar-navigation-screen-main/index.js +3 -3
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +21 -15
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +0 -2
- package/src/components/sidebar-navigation-screen-template/index.js +1 -13
- package/src/components/sidebar-navigation-screen-templates/index.js +6 -10
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -11
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +31 -22
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +78 -17
- package/src/utils/get-is-list-page.js +1 -1
|
@@ -11,33 +11,82 @@ import { useLocation, useHistory } from '../routes';
|
|
|
11
11
|
export default function useSyncPathWithURL() {
|
|
12
12
|
const history = useHistory();
|
|
13
13
|
const {
|
|
14
|
-
params
|
|
14
|
+
params: urlParams
|
|
15
15
|
} = useLocation();
|
|
16
16
|
const {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
location,
|
|
17
|
+
location: navigatorLocation,
|
|
18
|
+
params: navigatorParams,
|
|
21
19
|
goTo
|
|
22
20
|
} = useNavigator();
|
|
23
|
-
const
|
|
24
|
-
const
|
|
21
|
+
const currentUrlParams = useRef(urlParams);
|
|
22
|
+
const currentPath = useRef();
|
|
25
23
|
useEffect(() => {
|
|
26
|
-
|
|
24
|
+
// Don't trust the navigator path on initial render.
|
|
25
|
+
if (currentPath.current === null) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
function updateUrlParams(newUrlParams) {
|
|
30
|
+
if (Object.entries(newUrlParams).every(_ref => {
|
|
31
|
+
let [key, value] = _ref;
|
|
32
|
+
return currentUrlParams.current[key] === value;
|
|
33
|
+
})) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const updatedParams = { ...currentUrlParams.current,
|
|
38
|
+
...newUrlParams
|
|
39
|
+
};
|
|
40
|
+
currentUrlParams.current = updatedParams;
|
|
41
|
+
history.push(updatedParams);
|
|
30
42
|
}
|
|
31
|
-
}, [path]);
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
currentNavigatorLocation.current = location.path;
|
|
34
43
|
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
if (navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postType && navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postId) {
|
|
45
|
+
updateUrlParams({
|
|
46
|
+
postType: navigatorParams === null || navigatorParams === void 0 ? void 0 : navigatorParams.postType,
|
|
47
|
+
postId: navigatorParams === null || navigatorParams === void 0 ? void 0 : navigatorParams.postId,
|
|
48
|
+
path: undefined
|
|
49
|
+
});
|
|
50
|
+
} else if (navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postType && !(navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postId)) {
|
|
51
|
+
updateUrlParams({
|
|
52
|
+
postType: navigatorParams === null || navigatorParams === void 0 ? void 0 : navigatorParams.postType,
|
|
53
|
+
path: navigatorLocation.path,
|
|
54
|
+
postId: undefined
|
|
38
55
|
});
|
|
56
|
+
} else {
|
|
57
|
+
updateUrlParams({
|
|
58
|
+
postType: undefined,
|
|
59
|
+
postId: undefined,
|
|
60
|
+
path: navigatorLocation.path
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, [navigatorLocation === null || navigatorLocation === void 0 ? void 0 : navigatorLocation.path, navigatorParams, history]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
var _urlParams$path;
|
|
66
|
+
|
|
67
|
+
currentUrlParams.current = urlParams;
|
|
68
|
+
let path = (_urlParams$path = urlParams === null || urlParams === void 0 ? void 0 : urlParams.path) !== null && _urlParams$path !== void 0 ? _urlParams$path : '/'; // Compute the navigator path based on the URL params.
|
|
69
|
+
|
|
70
|
+
if (urlParams !== null && urlParams !== void 0 && urlParams.postType && urlParams !== null && urlParams !== void 0 && urlParams.postId && // This is just a special case to support old WP versions that perform redirects.
|
|
71
|
+
// This code should be removed when we minimum WP version becomes 6.2.
|
|
72
|
+
(urlParams === null || urlParams === void 0 ? void 0 : urlParams.postId) !== 'none') {
|
|
73
|
+
switch (urlParams.postType) {
|
|
74
|
+
case 'wp_template':
|
|
75
|
+
case 'wp_template_part':
|
|
76
|
+
path = `/${encodeURIComponent(urlParams.postType)}/${encodeURIComponent(urlParams.postId)}`;
|
|
77
|
+
break;
|
|
78
|
+
|
|
79
|
+
default:
|
|
80
|
+
path = `/navigation/${encodeURIComponent(urlParams.postType)}/${encodeURIComponent(urlParams.postId)}`;
|
|
81
|
+
}
|
|
39
82
|
}
|
|
40
|
-
|
|
41
|
-
|
|
83
|
+
|
|
84
|
+
if (currentPath.current !== path) {
|
|
85
|
+
currentPath.current = path;
|
|
86
|
+
goTo(path);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
goTo(path);
|
|
90
|
+
}, [urlParams, goTo]);
|
|
42
91
|
}
|
|
43
92
|
//# sourceMappingURL=use-sync-path-with-url.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js"],"names":["__experimentalUseNavigator","useNavigator","useEffect","useRef","useLocation","useHistory","useSyncPathWithURL","history","params","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-path-with-url.js"],"names":["__experimentalUseNavigator","useNavigator","useEffect","useRef","useLocation","useHistory","useSyncPathWithURL","history","params","urlParams","location","navigatorLocation","navigatorParams","goTo","currentUrlParams","currentPath","current","updateUrlParams","newUrlParams","Object","entries","every","key","value","updatedParams","push","postType","postId","path","undefined","encodeURIComponent"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useLocation, useHistory } from '../routes';\n\nexport default function useSyncPathWithURL() {\n\tconst history = useHistory();\n\tconst { params: urlParams } = useLocation();\n\tconst {\n\t\tlocation: navigatorLocation,\n\t\tparams: navigatorParams,\n\t\tgoTo,\n\t} = useNavigator();\n\tconst currentUrlParams = useRef( urlParams );\n\tconst currentPath = useRef();\n\n\tuseEffect( () => {\n\t\t// Don't trust the navigator path on initial render.\n\t\tif ( currentPath.current === null ) {\n\t\t\treturn;\n\t\t}\n\t\tfunction updateUrlParams( newUrlParams ) {\n\t\t\tif (\n\t\t\t\tObject.entries( newUrlParams ).every( ( [ key, value ] ) => {\n\t\t\t\t\treturn currentUrlParams.current[ key ] === value;\n\t\t\t\t} )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst updatedParams = {\n\t\t\t\t...currentUrlParams.current,\n\t\t\t\t...newUrlParams,\n\t\t\t};\n\t\t\tcurrentUrlParams.current = updatedParams;\n\t\t\thistory.push( updatedParams );\n\t\t}\n\n\t\tif ( navigatorParams?.postType && navigatorParams?.postId ) {\n\t\t\tupdateUrlParams( {\n\t\t\t\tpostType: navigatorParams?.postType,\n\t\t\t\tpostId: navigatorParams?.postId,\n\t\t\t\tpath: undefined,\n\t\t\t} );\n\t\t} else if ( navigatorParams?.postType && ! navigatorParams?.postId ) {\n\t\t\tupdateUrlParams( {\n\t\t\t\tpostType: navigatorParams?.postType,\n\t\t\t\tpath: navigatorLocation.path,\n\t\t\t\tpostId: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tupdateUrlParams( {\n\t\t\t\tpostType: undefined,\n\t\t\t\tpostId: undefined,\n\t\t\t\tpath: navigatorLocation.path,\n\t\t\t} );\n\t\t}\n\t}, [ navigatorLocation?.path, navigatorParams, history ] );\n\n\tuseEffect( () => {\n\t\tcurrentUrlParams.current = urlParams;\n\t\tlet path = urlParams?.path ?? '/';\n\n\t\t// Compute the navigator path based on the URL params.\n\t\tif (\n\t\t\turlParams?.postType &&\n\t\t\turlParams?.postId &&\n\t\t\t// This is just a special case to support old WP versions that perform redirects.\n\t\t\t// This code should be removed when we minimum WP version becomes 6.2.\n\t\t\turlParams?.postId !== 'none'\n\t\t) {\n\t\t\tswitch ( urlParams.postType ) {\n\t\t\t\tcase 'wp_template':\n\t\t\t\tcase 'wp_template_part':\n\t\t\t\t\tpath = `/${ encodeURIComponent(\n\t\t\t\t\t\turlParams.postType\n\t\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpath = `/navigation/${ encodeURIComponent(\n\t\t\t\t\t\turlParams.postType\n\t\t\t\t\t) }/${ encodeURIComponent( urlParams.postId ) }`;\n\t\t\t}\n\t\t}\n\n\t\tif ( currentPath.current !== path ) {\n\t\t\tcurrentPath.current = path;\n\t\t\tgoTo( path );\n\t\t}\n\t\tgoTo( path );\n\t}, [ urlParams, goTo ] );\n}\n"]}
|
|
@@ -10,6 +10,6 @@ export default function getIsListPage(_ref) {
|
|
|
10
10
|
let {
|
|
11
11
|
path
|
|
12
12
|
} = _ref;
|
|
13
|
-
return path === '/
|
|
13
|
+
return path === '/wp_template/all' || path === '/wp_template_part/all';
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=get-is-list-page.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"names":["getIsListPage","path"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,aAAT,OAAmC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACjD,SAAOA,IAAI,KAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"names":["getIsListPage","path"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,aAAT,OAAmC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACjD,SAAOA,IAAI,KAAK,kBAAT,IAA+BA,IAAI,KAAK,uBAA/C;AACA","sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage( { path } ) {\n\treturn path === '/wp_template/all' || path === '/wp_template_part/all';\n}\n"]}
|
|
@@ -413,15 +413,18 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
416
|
-
top:
|
|
416
|
+
top: auto;
|
|
417
417
|
bottom: 0;
|
|
418
418
|
}
|
|
419
|
+
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
420
|
+
top: 46px;
|
|
421
|
+
}
|
|
419
422
|
@media (min-width: 782px) {
|
|
420
|
-
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
423
|
+
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
421
424
|
border-right: 1px solid #ddd;
|
|
422
425
|
top: 32px;
|
|
423
426
|
}
|
|
424
|
-
.is-fullscreen-mode .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .interface-interface-skeleton__actions:focus-within {
|
|
427
|
+
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
425
428
|
top: 0;
|
|
426
429
|
}
|
|
427
430
|
}
|
|
@@ -1694,6 +1697,14 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1694
1697
|
margin: 0;
|
|
1695
1698
|
}
|
|
1696
1699
|
|
|
1700
|
+
.show-icon-labels .edit-site-global-styles-sidebar__header .components-button.has-icon svg {
|
|
1701
|
+
display: none;
|
|
1702
|
+
}
|
|
1703
|
+
.show-icon-labels .edit-site-global-styles-sidebar__header .components-button.has-icon::after {
|
|
1704
|
+
content: attr(aria-label);
|
|
1705
|
+
font-size: 12px;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1697
1708
|
.components-panel__header.edit-site-sidebar-edit-mode__panel-tabs {
|
|
1698
1709
|
justify-content: flex-start;
|
|
1699
1710
|
padding-right: 0;
|
|
@@ -1847,10 +1858,6 @@ h3.edit-site-template-card__template-areas-title {
|
|
|
1847
1858
|
display: flex;
|
|
1848
1859
|
justify-content: center;
|
|
1849
1860
|
}
|
|
1850
|
-
.edit-site-layout__actions:focus .edit-site-editor__toggle-save-panel, .edit-site-layout__actions:focus-within .edit-site-editor__toggle-save-panel {
|
|
1851
|
-
top: auto;
|
|
1852
|
-
bottom: 0;
|
|
1853
|
-
}
|
|
1854
1861
|
|
|
1855
1862
|
.edit-site .components-editor-notices__snackbar {
|
|
1856
1863
|
position: fixed;
|
|
@@ -2323,9 +2330,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2323
2330
|
background: #fff;
|
|
2324
2331
|
}
|
|
2325
2332
|
.edit-site-layout__actions:focus, .edit-site-layout__actions:focus-within {
|
|
2326
|
-
top:
|
|
2333
|
+
top: auto;
|
|
2327
2334
|
bottom: 0;
|
|
2328
2335
|
}
|
|
2336
|
+
.edit-site-layout__actions.is-entity-save-view-open:focus, .edit-site-layout__actions.is-entity-save-view-open:focus-within {
|
|
2337
|
+
top: 0;
|
|
2338
|
+
}
|
|
2329
2339
|
@media (min-width: 782px) {
|
|
2330
2340
|
.edit-site-layout__actions {
|
|
2331
2341
|
border-right: 1px solid #ddd;
|
|
@@ -2447,7 +2457,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2447
2457
|
.edit-site-sidebar-navigation-screen__back {
|
|
2448
2458
|
color: #e0e0e0;
|
|
2449
2459
|
}
|
|
2450
|
-
.edit-site-sidebar-navigation-screen__back:hover, .edit-site-sidebar-navigation-screen__back:not([aria-disabled=true]):active {
|
|
2460
|
+
.edit-site-sidebar-navigation-screen__back:hover, .edit-site-sidebar-navigation-screen__back:focus, .edit-site-sidebar-navigation-screen__back:not([aria-disabled=true]):active {
|
|
2451
2461
|
color: #fff;
|
|
2452
2462
|
}
|
|
2453
2463
|
|
package/build-style/style.css
CHANGED
|
@@ -413,15 +413,18 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
416
|
-
top:
|
|
416
|
+
top: auto;
|
|
417
417
|
bottom: 0;
|
|
418
418
|
}
|
|
419
|
+
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
420
|
+
top: 46px;
|
|
421
|
+
}
|
|
419
422
|
@media (min-width: 782px) {
|
|
420
|
-
.interface-interface-skeleton__actions:focus, .interface-interface-skeleton__actions:focus-within {
|
|
423
|
+
.is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
421
424
|
border-left: 1px solid #ddd;
|
|
422
425
|
top: 32px;
|
|
423
426
|
}
|
|
424
|
-
.is-fullscreen-mode .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .interface-interface-skeleton__actions:focus-within {
|
|
427
|
+
.is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus, .is-fullscreen-mode .is-entity-save-view-open .interface-interface-skeleton__actions:focus-within {
|
|
425
428
|
top: 0;
|
|
426
429
|
}
|
|
427
430
|
}
|
|
@@ -1694,6 +1697,14 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1694
1697
|
margin: 0;
|
|
1695
1698
|
}
|
|
1696
1699
|
|
|
1700
|
+
.show-icon-labels .edit-site-global-styles-sidebar__header .components-button.has-icon svg {
|
|
1701
|
+
display: none;
|
|
1702
|
+
}
|
|
1703
|
+
.show-icon-labels .edit-site-global-styles-sidebar__header .components-button.has-icon::after {
|
|
1704
|
+
content: attr(aria-label);
|
|
1705
|
+
font-size: 12px;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1697
1708
|
.components-panel__header.edit-site-sidebar-edit-mode__panel-tabs {
|
|
1698
1709
|
justify-content: flex-start;
|
|
1699
1710
|
padding-left: 0;
|
|
@@ -1847,10 +1858,6 @@ h3.edit-site-template-card__template-areas-title {
|
|
|
1847
1858
|
display: flex;
|
|
1848
1859
|
justify-content: center;
|
|
1849
1860
|
}
|
|
1850
|
-
.edit-site-layout__actions:focus .edit-site-editor__toggle-save-panel, .edit-site-layout__actions:focus-within .edit-site-editor__toggle-save-panel {
|
|
1851
|
-
top: auto;
|
|
1852
|
-
bottom: 0;
|
|
1853
|
-
}
|
|
1854
1861
|
|
|
1855
1862
|
.edit-site .components-editor-notices__snackbar {
|
|
1856
1863
|
position: fixed;
|
|
@@ -2323,9 +2330,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2323
2330
|
background: #fff;
|
|
2324
2331
|
}
|
|
2325
2332
|
.edit-site-layout__actions:focus, .edit-site-layout__actions:focus-within {
|
|
2326
|
-
top:
|
|
2333
|
+
top: auto;
|
|
2327
2334
|
bottom: 0;
|
|
2328
2335
|
}
|
|
2336
|
+
.edit-site-layout__actions.is-entity-save-view-open:focus, .edit-site-layout__actions.is-entity-save-view-open:focus-within {
|
|
2337
|
+
top: 0;
|
|
2338
|
+
}
|
|
2329
2339
|
@media (min-width: 782px) {
|
|
2330
2340
|
.edit-site-layout__actions {
|
|
2331
2341
|
border-left: 1px solid #ddd;
|
|
@@ -2447,7 +2457,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
|
|
|
2447
2457
|
.edit-site-sidebar-navigation-screen__back {
|
|
2448
2458
|
color: #e0e0e0;
|
|
2449
2459
|
}
|
|
2450
|
-
.edit-site-sidebar-navigation-screen__back:hover, .edit-site-sidebar-navigation-screen__back:not([aria-disabled=true]):active {
|
|
2460
|
+
.edit-site-sidebar-navigation-screen__back:hover, .edit-site-sidebar-navigation-screen__back:focus, .edit-site-sidebar-navigation-screen__back:not([aria-disabled=true]):active {
|
|
2451
2461
|
color: #fff;
|
|
2452
2462
|
}
|
|
2453
2463
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.5",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -29,33 +29,33 @@
|
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
30
|
"@wordpress/a11y": "^3.26.1",
|
|
31
31
|
"@wordpress/api-fetch": "^6.23.1",
|
|
32
|
-
"@wordpress/block-editor": "^11.3.
|
|
33
|
-
"@wordpress/block-library": "^8.3.
|
|
34
|
-
"@wordpress/blocks": "^12.3.
|
|
35
|
-
"@wordpress/components": "^23.3.
|
|
36
|
-
"@wordpress/compose": "^6.3.
|
|
37
|
-
"@wordpress/core-data": "^6.3.
|
|
38
|
-
"@wordpress/data": "^8.3.
|
|
32
|
+
"@wordpress/block-editor": "^11.3.5",
|
|
33
|
+
"@wordpress/block-library": "^8.3.5",
|
|
34
|
+
"@wordpress/blocks": "^12.3.3",
|
|
35
|
+
"@wordpress/components": "^23.3.4",
|
|
36
|
+
"@wordpress/compose": "^6.3.3",
|
|
37
|
+
"@wordpress/core-data": "^6.3.3",
|
|
38
|
+
"@wordpress/data": "^8.3.3",
|
|
39
39
|
"@wordpress/deprecated": "^3.26.1",
|
|
40
|
-
"@wordpress/editor": "^13.3.
|
|
41
|
-
"@wordpress/element": "^5.3.
|
|
40
|
+
"@wordpress/editor": "^13.3.5",
|
|
41
|
+
"@wordpress/element": "^5.3.2",
|
|
42
42
|
"@wordpress/hooks": "^3.26.1",
|
|
43
43
|
"@wordpress/html-entities": "^3.26.1",
|
|
44
44
|
"@wordpress/i18n": "^4.26.1",
|
|
45
|
-
"@wordpress/icons": "^9.17.
|
|
46
|
-
"@wordpress/interface": "^5.3.
|
|
47
|
-
"@wordpress/keyboard-shortcuts": "^4.3.
|
|
45
|
+
"@wordpress/icons": "^9.17.2",
|
|
46
|
+
"@wordpress/interface": "^5.3.5",
|
|
47
|
+
"@wordpress/keyboard-shortcuts": "^4.3.3",
|
|
48
48
|
"@wordpress/keycodes": "^3.26.2",
|
|
49
|
-
"@wordpress/media-utils": "^4.17.
|
|
50
|
-
"@wordpress/notices": "^3.26.
|
|
51
|
-
"@wordpress/plugins": "^5.3.
|
|
52
|
-
"@wordpress/preferences": "^3.3.
|
|
49
|
+
"@wordpress/media-utils": "^4.17.2",
|
|
50
|
+
"@wordpress/notices": "^3.26.3",
|
|
51
|
+
"@wordpress/plugins": "^5.3.3",
|
|
52
|
+
"@wordpress/preferences": "^3.3.4",
|
|
53
53
|
"@wordpress/private-apis": "^0.8.1",
|
|
54
|
-
"@wordpress/reusable-blocks": "^4.3.
|
|
54
|
+
"@wordpress/reusable-blocks": "^4.3.5",
|
|
55
55
|
"@wordpress/style-engine": "^1.9.1",
|
|
56
56
|
"@wordpress/url": "^3.27.1",
|
|
57
|
-
"@wordpress/viewport": "^5.3.
|
|
58
|
-
"@wordpress/widgets": "^3.3.
|
|
57
|
+
"@wordpress/viewport": "^5.3.3",
|
|
58
|
+
"@wordpress/widgets": "^3.3.5",
|
|
59
59
|
"classnames": "^2.3.1",
|
|
60
60
|
"colord": "^2.9.2",
|
|
61
61
|
"downloadjs": "^1.4.7",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "1e2b2f680c6378f789d6660bc04b30e35e3a33a3"
|
|
77
77
|
}
|
|
@@ -67,12 +67,9 @@ export default function NewTemplatePart( {
|
|
|
67
67
|
setCanvasMode( 'edit' );
|
|
68
68
|
|
|
69
69
|
// Navigate to the created template part editor.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
postType: 'wp_template_part',
|
|
74
|
-
path: '/template-parts/single',
|
|
75
|
-
} );
|
|
70
|
+
history.push( {
|
|
71
|
+
postId: templatePart.id,
|
|
72
|
+
postType: 'wp_template_part',
|
|
76
73
|
} );
|
|
77
74
|
|
|
78
75
|
// TODO: Add a success notice?
|
|
@@ -143,12 +143,9 @@ export default function NewTemplate( {
|
|
|
143
143
|
setCanvasMode( 'edit' );
|
|
144
144
|
|
|
145
145
|
// Navigate to the created template editor.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
postType: newTemplate.type,
|
|
150
|
-
path: '/templates/single',
|
|
151
|
-
} );
|
|
146
|
+
history.push( {
|
|
147
|
+
postId: newTemplate.id,
|
|
148
|
+
postType: newTemplate.type,
|
|
152
149
|
} );
|
|
153
150
|
|
|
154
151
|
createSuccessNotice(
|
|
@@ -16,7 +16,7 @@ function ScreenBorder( { name, variation = '' } ) {
|
|
|
16
16
|
const variationClassName = getVariationClassName( variation );
|
|
17
17
|
return (
|
|
18
18
|
<>
|
|
19
|
-
<ScreenHeader title={ __( 'Border
|
|
19
|
+
<ScreenHeader title={ __( 'Border' ) } />
|
|
20
20
|
<BlockPreviewPanel name={ name } variation={ variationClassName } />
|
|
21
21
|
{ hasBorderPanel && (
|
|
22
22
|
<BorderPanel name={ name } variation={ variation } />
|
|
@@ -207,10 +207,17 @@
|
|
|
207
207
|
|
|
208
208
|
&:focus,
|
|
209
209
|
&:focus-within {
|
|
210
|
-
top:
|
|
210
|
+
top: auto;
|
|
211
211
|
bottom: 0;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
&.is-entity-save-view-open {
|
|
215
|
+
&:focus,
|
|
216
|
+
&:focus-within {
|
|
217
|
+
top: 0;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
214
221
|
@include break-medium {
|
|
215
222
|
border-left: $border-width solid $gray-300;
|
|
216
223
|
}
|
|
@@ -84,10 +84,6 @@ export default function Table( { templateType } ) {
|
|
|
84
84
|
<Heading level={ 4 }>
|
|
85
85
|
<Link
|
|
86
86
|
params={ {
|
|
87
|
-
path:
|
|
88
|
-
template.type === 'wp_template'
|
|
89
|
-
? '/templates/single'
|
|
90
|
-
: '/template-parts/single',
|
|
91
87
|
postId: template.id,
|
|
92
88
|
postType: template.type,
|
|
93
89
|
} }
|
|
@@ -39,7 +39,7 @@ const ALLOWED_BLOCKS = {
|
|
|
39
39
|
export default function NavigationMenu( { innerBlocks, onSelect } ) {
|
|
40
40
|
const { updateBlockListSettings } = useDispatch( blockEditorStore );
|
|
41
41
|
|
|
42
|
-
const { OffCanvasEditor } = unlock( blockEditorPrivateApis );
|
|
42
|
+
const { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );
|
|
43
43
|
|
|
44
44
|
//TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
|
|
45
45
|
//Think through a better way of doing this, possible with adding allowed blocks to block library metadata
|
|
@@ -56,5 +56,11 @@ export default function NavigationMenu( { innerBlocks, onSelect } ) {
|
|
|
56
56
|
} );
|
|
57
57
|
}, [ updateBlockListSettings, innerBlocks ] );
|
|
58
58
|
|
|
59
|
-
return
|
|
59
|
+
return (
|
|
60
|
+
<OffCanvasEditor
|
|
61
|
+
blocks={ innerBlocks }
|
|
62
|
+
onSelect={ onSelect }
|
|
63
|
+
LeafMoreMenu={ LeafMoreMenu }
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
60
66
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
@@ -46,7 +51,9 @@ export default function SavePanel() {
|
|
|
46
51
|
|
|
47
52
|
return (
|
|
48
53
|
<NavigableRegion
|
|
49
|
-
className=
|
|
54
|
+
className={ classnames( 'edit-site-layout__actions', {
|
|
55
|
+
'is-entity-save-view-open': isSaveViewOpen,
|
|
56
|
+
} ) }
|
|
50
57
|
ariaLabel={ __( 'Save sidebar' ) }
|
|
51
58
|
>
|
|
52
59
|
{ isSaveViewOpen ? (
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { memo } from '@wordpress/element';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import {
|
|
6
|
+
__experimentalNavigatorProvider as NavigatorProvider,
|
|
7
|
+
__experimentalNavigatorScreen as NavigatorScreen,
|
|
8
|
+
} from '@wordpress/components';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
@@ -23,30 +24,29 @@ function SidebarScreens() {
|
|
|
23
24
|
|
|
24
25
|
return (
|
|
25
26
|
<>
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
<NavigatorScreen path="/">
|
|
28
|
+
<SidebarNavigationScreenMain />
|
|
29
|
+
</NavigatorScreen>
|
|
30
|
+
<NavigatorScreen path="/navigation">
|
|
31
|
+
<SidebarNavigationScreenNavigationMenus />
|
|
32
|
+
</NavigatorScreen>
|
|
33
|
+
<NavigatorScreen path="/navigation/:postType/:postId">
|
|
34
|
+
<SidebarNavigationScreenNavigationItem />
|
|
35
|
+
</NavigatorScreen>
|
|
36
|
+
<NavigatorScreen path="/:postType(wp_template|wp_template_part)">
|
|
37
|
+
<SidebarNavigationScreenTemplates />
|
|
38
|
+
</NavigatorScreen>
|
|
39
|
+
<NavigatorScreen path="/:postType(wp_template|wp_template_part)/all">
|
|
40
|
+
<SidebarNavigationScreenTemplatesBrowse />
|
|
41
|
+
</NavigatorScreen>
|
|
42
|
+
<NavigatorScreen path="/:postType(wp_template|wp_template_part)/:postId">
|
|
43
|
+
<SidebarNavigationScreenTemplate />
|
|
44
|
+
</NavigatorScreen>
|
|
35
45
|
</>
|
|
36
46
|
);
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
function Sidebar() {
|
|
40
|
-
const { isDirty } = useSelect( ( select ) => {
|
|
41
|
-
const { __experimentalGetDirtyEntityRecords } = select( coreStore );
|
|
42
|
-
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
43
|
-
// The currently selected entity to display.
|
|
44
|
-
// Typically template or template part in the site editor.
|
|
45
|
-
return {
|
|
46
|
-
isDirty: dirtyEntityRecords.length > 0,
|
|
47
|
-
};
|
|
48
|
-
}, [] );
|
|
49
|
-
|
|
50
50
|
return (
|
|
51
51
|
<>
|
|
52
52
|
<NavigatorProvider
|
|
@@ -55,11 +55,10 @@ function Sidebar() {
|
|
|
55
55
|
>
|
|
56
56
|
<SidebarScreens />
|
|
57
57
|
</NavigatorProvider>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
) }
|
|
58
|
+
|
|
59
|
+
<div className="edit-site-sidebar__footer">
|
|
60
|
+
<SaveButton />
|
|
61
|
+
</div>
|
|
63
62
|
</>
|
|
64
63
|
);
|
|
65
64
|
}
|
|
@@ -37,18 +37,14 @@ export default function GlobalStylesSidebar() {
|
|
|
37
37
|
closeLabel={ __( 'Close Styles sidebar' ) }
|
|
38
38
|
panelClassName="edit-site-global-styles-sidebar__panel"
|
|
39
39
|
header={
|
|
40
|
-
<Flex>
|
|
41
|
-
<FlexBlock>
|
|
40
|
+
<Flex className="edit-site-global-styles-sidebar__header">
|
|
41
|
+
<FlexBlock style={ { minWidth: 'min-content' } }>
|
|
42
42
|
<strong>{ __( 'Styles' ) }</strong>
|
|
43
43
|
</FlexBlock>
|
|
44
44
|
<FlexItem>
|
|
45
45
|
<Button
|
|
46
46
|
icon={ seen }
|
|
47
|
-
label={
|
|
48
|
-
isStyleBookOpened
|
|
49
|
-
? __( 'Close Style Book' )
|
|
50
|
-
: __( 'Open Style Book' )
|
|
51
|
-
}
|
|
47
|
+
label={ __( 'Style Book' ) }
|
|
52
48
|
isPressed={ isStyleBookOpened }
|
|
53
49
|
disabled={ editorMode !== 'visual' }
|
|
54
50
|
onClick={ () => {
|
|
@@ -83,3 +83,19 @@
|
|
|
83
83
|
.edit-site-global-styles-sidebar hr {
|
|
84
84
|
margin: 0;
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
.show-icon-labels {
|
|
88
|
+
.edit-site-global-styles-sidebar__header {
|
|
89
|
+
.components-button.has-icon {
|
|
90
|
+
// Hide the button icons when labels are set to display...
|
|
91
|
+
svg {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
// ... and display labels.
|
|
95
|
+
&::after {
|
|
96
|
+
content: attr(aria-label);
|
|
97
|
+
font-size: $helptext-font-size;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|