@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.
Files changed (102) hide show
  1. package/build/components/add-new-template/new-template-part.js +3 -6
  2. package/build/components/add-new-template/new-template-part.js.map +1 -1
  3. package/build/components/add-new-template/new-template.js +3 -6
  4. package/build/components/add-new-template/new-template.js.map +1 -1
  5. package/build/components/global-styles/screen-border.js +1 -1
  6. package/build/components/global-styles/screen-border.js.map +1 -1
  7. package/build/components/global-styles/ui.js +1 -1
  8. package/build/components/global-styles/ui.js.map +1 -1
  9. package/build/components/list/table.js +0 -1
  10. package/build/components/list/table.js.map +1 -1
  11. package/build/components/navigation-inspector/navigation-menu.js +4 -2
  12. package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
  13. package/build/components/save-panel/index.js +11 -1
  14. package/build/components/save-panel/index.js.map +1 -1
  15. package/build/components/sidebar/index.js +14 -33
  16. package/build/components/sidebar/index.js.map +1 -1
  17. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
  18. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  19. package/build/components/sidebar-navigation-screen/index.js +4 -7
  20. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  21. package/build/components/sidebar-navigation-screen-main/index.js +3 -3
  22. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  23. package/build/components/sidebar-navigation-screen-navigation-item/index.js +8 -12
  24. package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  25. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -3
  26. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  27. package/build/components/sidebar-navigation-screen-template/index.js +1 -14
  28. package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
  29. package/build/components/sidebar-navigation-screen-templates/index.js +8 -12
  30. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  31. package/build/components/sidebar-navigation-screen-templates-browse/index.js +8 -7
  32. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  33. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +34 -32
  34. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  35. package/build/components/sync-state-with-url/use-sync-path-with-url.js +67 -18
  36. package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  37. package/build/utils/get-is-list-page.js +1 -1
  38. package/build/utils/get-is-list-page.js.map +1 -1
  39. package/build-module/components/add-new-template/new-template-part.js +3 -6
  40. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  41. package/build-module/components/add-new-template/new-template.js +3 -6
  42. package/build-module/components/add-new-template/new-template.js.map +1 -1
  43. package/build-module/components/global-styles/screen-border.js +1 -1
  44. package/build-module/components/global-styles/screen-border.js.map +1 -1
  45. package/build-module/components/global-styles/ui.js +1 -1
  46. package/build-module/components/global-styles/ui.js.map +1 -1
  47. package/build-module/components/list/table.js +0 -1
  48. package/build-module/components/list/table.js.map +1 -1
  49. package/build-module/components/navigation-inspector/navigation-menu.js +4 -2
  50. package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
  51. package/build-module/components/save-panel/index.js +8 -1
  52. package/build-module/components/save-panel/index.js.map +1 -1
  53. package/build-module/components/sidebar/index.js +15 -32
  54. package/build-module/components/sidebar/index.js.map +1 -1
  55. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +8 -2
  56. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  57. package/build-module/components/sidebar-navigation-screen/index.js +5 -8
  58. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  59. package/build-module/components/sidebar-navigation-screen-main/index.js +3 -3
  60. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  61. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +9 -13
  62. package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
  63. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -3
  64. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  65. package/build-module/components/sidebar-navigation-screen-template/index.js +1 -13
  66. package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
  67. package/build-module/components/sidebar-navigation-screen-templates/index.js +9 -13
  68. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  69. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -7
  70. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  71. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +34 -32
  72. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  73. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +67 -18
  74. package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
  75. package/build-module/utils/get-is-list-page.js +1 -1
  76. package/build-module/utils/get-is-list-page.js.map +1 -1
  77. package/build-style/style-rtl.css +19 -9
  78. package/build-style/style.css +19 -9
  79. package/package.json +21 -21
  80. package/src/components/add-new-template/new-template-part.js +3 -6
  81. package/src/components/add-new-template/new-template.js +3 -6
  82. package/src/components/editor/style.scss +0 -6
  83. package/src/components/global-styles/screen-border.js +1 -1
  84. package/src/components/global-styles/ui.js +1 -1
  85. package/src/components/layout/style.scss +8 -1
  86. package/src/components/list/table.js +0 -4
  87. package/src/components/navigation-inspector/navigation-menu.js +8 -2
  88. package/src/components/save-panel/index.js +8 -1
  89. package/src/components/sidebar/index.js +26 -27
  90. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +3 -7
  91. package/src/components/sidebar-edit-mode/style.scss +16 -0
  92. package/src/components/sidebar-navigation-screen/index.js +31 -37
  93. package/src/components/sidebar-navigation-screen/style.scss +1 -0
  94. package/src/components/sidebar-navigation-screen-main/index.js +3 -3
  95. package/src/components/sidebar-navigation-screen-navigation-item/index.js +21 -15
  96. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +0 -2
  97. package/src/components/sidebar-navigation-screen-template/index.js +1 -13
  98. package/src/components/sidebar-navigation-screen-templates/index.js +6 -10
  99. package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -11
  100. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +31 -22
  101. package/src/components/sync-state-with-url/use-sync-path-with-url.js +78 -17
  102. 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
- path = '/'
18
- } = params;
19
- const {
20
- location,
17
+ location: navigatorLocation,
18
+ params: navigatorParams,
21
19
  goTo
22
20
  } = useNavigator();
23
- const currentPath = useRef(path);
24
- const currentNavigatorLocation = useRef(location.path);
21
+ const currentUrlParams = useRef(urlParams);
22
+ const currentPath = useRef();
25
23
  useEffect(() => {
26
- currentPath.current = path;
24
+ // Don't trust the navigator path on initial render.
25
+ if (currentPath.current === null) {
26
+ return;
27
+ }
27
28
 
28
- if (path !== currentNavigatorLocation.current) {
29
- goTo(path);
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 (location.path !== currentPath.current) {
36
- history.push({ ...params,
37
- path: location.path
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
- }, [location.path, history]);
41
- return path;
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","path","location","goTo","currentPath","currentNavigatorLocation","current","push"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,IAAIC,YAAvC,QAA2D,uBAA3D;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AAEA;AACA;AACA;;AACA,SAASC,WAAT,EAAsBC,UAAtB,QAAwC,WAAxC;AAEA,eAAe,SAASC,kBAAT,GAA8B;AAC5C,QAAMC,OAAO,GAAGF,UAAU,EAA1B;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAaJ,WAAW,EAA9B;AACA,QAAM;AAAEK,IAAAA,IAAI,GAAG;AAAT,MAAiBD,MAAvB;AACA,QAAM;AAAEE,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAqBV,YAAY,EAAvC;AACA,QAAMW,WAAW,GAAGT,MAAM,CAAEM,IAAF,CAA1B;AACA,QAAMI,wBAAwB,GAAGV,MAAM,CAAEO,QAAQ,CAACD,IAAX,CAAvC;AACAP,EAAAA,SAAS,CAAE,MAAM;AAChBU,IAAAA,WAAW,CAACE,OAAZ,GAAsBL,IAAtB;;AACA,QAAKA,IAAI,KAAKI,wBAAwB,CAACC,OAAvC,EAAiD;AAChDH,MAAAA,IAAI,CAAEF,IAAF,CAAJ;AACA;AACD,GALQ,EAKN,CAAEA,IAAF,CALM,CAAT;AAMAP,EAAAA,SAAS,CAAE,MAAM;AAChBW,IAAAA,wBAAwB,CAACC,OAAzB,GAAmCJ,QAAQ,CAACD,IAA5C;;AACA,QAAKC,QAAQ,CAACD,IAAT,KAAkBG,WAAW,CAACE,OAAnC,EAA6C;AAC5CP,MAAAA,OAAO,CAACQ,IAAR,CAAc,EACb,GAAGP,MADU;AAEbC,QAAAA,IAAI,EAAEC,QAAQ,CAACD;AAFF,OAAd;AAIA;AACD,GARQ,EAQN,CAAEC,QAAQ,CAACD,IAAX,EAAiBF,OAAjB,CARM,CAAT;AAUA,SAAOE,IAAP;AACA","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 } = useLocation();\n\tconst { path = '/' } = params;\n\tconst { location, goTo } = useNavigator();\n\tconst currentPath = useRef( path );\n\tconst currentNavigatorLocation = useRef( location.path );\n\tuseEffect( () => {\n\t\tcurrentPath.current = path;\n\t\tif ( path !== currentNavigatorLocation.current ) {\n\t\t\tgoTo( path );\n\t\t}\n\t}, [ path ] );\n\tuseEffect( () => {\n\t\tcurrentNavigatorLocation.current = location.path;\n\t\tif ( location.path !== currentPath.current ) {\n\t\t\thistory.push( {\n\t\t\t\t...params,\n\t\t\t\tpath: location.path,\n\t\t\t} );\n\t\t}\n\t}, [ location.path, history ] );\n\n\treturn path;\n}\n"]}
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 === '/templates/all' || path === '/template-parts/all';
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,gBAAT,IAA6BA,IAAI,KAAK,qBAA7C;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 === '/templates/all' || path === '/template-parts/all';\n}\n"]}
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: 46px;
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: 0;
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
 
@@ -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: 46px;
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: 0;
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",
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.3",
33
- "@wordpress/block-library": "^8.3.3",
34
- "@wordpress/blocks": "^12.3.2",
35
- "@wordpress/components": "^23.3.2",
36
- "@wordpress/compose": "^6.3.2",
37
- "@wordpress/core-data": "^6.3.2",
38
- "@wordpress/data": "^8.3.2",
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.3",
41
- "@wordpress/element": "^5.3.1",
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.1",
46
- "@wordpress/interface": "^5.3.3",
47
- "@wordpress/keyboard-shortcuts": "^4.3.2",
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.1",
50
- "@wordpress/notices": "^3.26.2",
51
- "@wordpress/plugins": "^5.3.2",
52
- "@wordpress/preferences": "^3.3.2",
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.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.2",
58
- "@wordpress/widgets": "^3.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": "1bf01c01a8238ce3a681ad1e517f86033818b78d"
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
- window.queueMicrotask( () => {
71
- history.push( {
72
- postId: templatePart.id,
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
- window.queueMicrotask( () => {
147
- history.push( {
148
- postId: newTemplate.id,
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(
@@ -6,12 +6,6 @@
6
6
  padding: $grid-unit-30;
7
7
  display: flex;
8
8
  justify-content: center;
9
-
10
- .edit-site-layout__actions:focus &,
11
- .edit-site-layout__actions:focus-within & {
12
- top: auto;
13
- bottom: 0;
14
- }
15
9
  }
16
10
 
17
11
  // Adjust the position of the notices
@@ -16,7 +16,7 @@ function ScreenBorder( { name, variation = '' } ) {
16
16
  const variationClassName = getVariationClassName( variation );
17
17
  return (
18
18
  <>
19
- <ScreenHeader title={ __( 'Border & Shadow' ) } />
19
+ <ScreenHeader title={ __( 'Border' ) } />
20
20
  <BlockPreviewPanel name={ name } variation={ variationClassName } />
21
21
  { hasBorderPanel && (
22
22
  <BorderPanel name={ name } variation={ variation } />
@@ -68,7 +68,7 @@ function GlobalStylesActionMenu() {
68
68
  <GlobalStylesMenuFill>
69
69
  <DropdownMenu
70
70
  icon={ moreVertical }
71
- label={ __( 'More Styles actions' ) }
71
+ label={ __( 'Styles actions' ) }
72
72
  controls={ [
73
73
  {
74
74
  title: __( 'Reset to defaults' ),
@@ -207,10 +207,17 @@
207
207
 
208
208
  &:focus,
209
209
  &:focus-within {
210
- top: 0;
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 <OffCanvasEditor blocks={ innerBlocks } onSelect={ onSelect } />;
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="edit-site-layout__actions"
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 { useSelect } from '@wordpress/data';
6
- import { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';
7
- import { store as coreStore } from '@wordpress/core-data';
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
- <SidebarNavigationScreenMain />
27
- <SidebarNavigationScreenNavigationMenus />
28
- <SidebarNavigationScreenNavigationItem />
29
- <SidebarNavigationScreenTemplates postType="wp_template" />
30
- <SidebarNavigationScreenTemplates postType="wp_template_part" />
31
- <SidebarNavigationScreenTemplate postType="wp_template" />
32
- <SidebarNavigationScreenTemplate postType="wp_template_part" />
33
- <SidebarNavigationScreenTemplatesBrowse postType="wp_template" />
34
- <SidebarNavigationScreenTemplatesBrowse postType="wp_template_part" />
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
- { isDirty && (
59
- <div className="edit-site-sidebar__footer">
60
- <SaveButton />
61
- </div>
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
+ }