@wordpress/edit-site 5.3.7 → 5.3.8

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.
@@ -568,10 +568,19 @@ body.is-fullscreen-mode .interface-interface-skeleton {
568
568
  }
569
569
 
570
570
  @media (min-width: 600px) {
571
- .edit-site-new-template-dropdown .edit-site-new-template-dropdown__popover {
571
+ .edit-site-new-template-dropdown .edit-site-new-template-dropdown__menu-groups {
572
572
  min-width: 300px;
573
573
  }
574
574
  }
575
+ .edit-site-new-template-dropdown__menu-item-tooltip.components-tooltip .components-popover__content {
576
+ max-width: 320px;
577
+ padding: 8px 12px;
578
+ border-radius: 2px;
579
+ white-space: pre-wrap;
580
+ min-width: 0;
581
+ width: auto;
582
+ text-align: right;
583
+ }
575
584
 
576
585
  .edit-site-custom-template-modal__contents > .components-button {
577
586
  padding: 24px;
@@ -2449,7 +2458,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2449
2458
 
2450
2459
  .edit-site-site-hub__view-mode-toggle-container {
2451
2460
  height: 60px;
2452
- width: 64px;
2461
+ width: 60px;
2453
2462
  flex-shrink: 0;
2454
2463
  background: #1e1e1e;
2455
2464
  }
@@ -2516,6 +2525,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2516
2525
  color: #fff;
2517
2526
  }
2518
2527
 
2528
+ .edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu {
2529
+ display: none;
2530
+ }
2531
+
2519
2532
  .edit-site-site-icon__icon {
2520
2533
  fill: currentColor;
2521
2534
  }
@@ -2554,53 +2567,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2554
2567
  bottom: 0;
2555
2568
  right: 0;
2556
2569
  overflow: auto;
2557
- padding: 32px;
2570
+ padding: 0;
2558
2571
  position: absolute;
2559
2572
  left: 0;
2560
2573
  top: 48px;
2561
2574
  }
2562
2575
 
2563
- .edit-site-style-book__examples {
2564
- max-width: 900px;
2565
- margin: 0 auto;
2566
- }
2567
-
2568
- .edit-site-style-book__example {
2569
- background: none;
2570
- border-radius: 2px;
2571
- border: none;
2572
- color: inherit;
2573
- cursor: pointer;
2574
- display: flex;
2575
- flex-direction: column;
2576
- gap: 40px;
2577
- margin-bottom: 40px;
2578
- padding: 16px;
2579
- width: 100%;
2580
- }
2581
- .edit-site-style-book__example.is-selected {
2582
- box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
2583
- }
2584
- .edit-site-style-book.is-wide .edit-site-style-book__example {
2585
- flex-direction: row;
2586
- }
2587
-
2588
- .edit-site-style-book__example-title {
2589
- font-size: 11px;
2590
- font-weight: 500;
2591
- margin: 0;
2592
- text-align: right;
2593
- text-transform: uppercase;
2594
- }
2595
- .edit-site-style-book.is-wide .edit-site-style-book__example-title {
2596
- text-align: left;
2597
- width: 120px;
2598
- }
2599
-
2600
- .edit-site-style-book__example-preview {
2601
- width: 100%;
2602
- }
2603
-
2604
2576
  .edit-site-push-changes-to-global-styles-control .components-button {
2605
2577
  justify-content: center;
2606
2578
  width: 100%;
@@ -568,10 +568,19 @@ body.is-fullscreen-mode .interface-interface-skeleton {
568
568
  }
569
569
 
570
570
  @media (min-width: 600px) {
571
- .edit-site-new-template-dropdown .edit-site-new-template-dropdown__popover {
571
+ .edit-site-new-template-dropdown .edit-site-new-template-dropdown__menu-groups {
572
572
  min-width: 300px;
573
573
  }
574
574
  }
575
+ .edit-site-new-template-dropdown__menu-item-tooltip.components-tooltip .components-popover__content {
576
+ max-width: 320px;
577
+ padding: 8px 12px;
578
+ border-radius: 2px;
579
+ white-space: pre-wrap;
580
+ min-width: 0;
581
+ width: auto;
582
+ text-align: left;
583
+ }
575
584
 
576
585
  .edit-site-custom-template-modal__contents > .components-button {
577
586
  padding: 24px;
@@ -2449,7 +2458,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2449
2458
 
2450
2459
  .edit-site-site-hub__view-mode-toggle-container {
2451
2460
  height: 60px;
2452
- width: 64px;
2461
+ width: 60px;
2453
2462
  flex-shrink: 0;
2454
2463
  background: #1e1e1e;
2455
2464
  }
@@ -2516,6 +2525,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2516
2525
  color: #fff;
2517
2526
  }
2518
2527
 
2528
+ .edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu {
2529
+ display: none;
2530
+ }
2531
+
2519
2532
  .edit-site-site-icon__icon {
2520
2533
  fill: currentColor;
2521
2534
  }
@@ -2554,53 +2567,12 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar {
2554
2567
  bottom: 0;
2555
2568
  left: 0;
2556
2569
  overflow: auto;
2557
- padding: 32px;
2570
+ padding: 0;
2558
2571
  position: absolute;
2559
2572
  right: 0;
2560
2573
  top: 48px;
2561
2574
  }
2562
2575
 
2563
- .edit-site-style-book__examples {
2564
- max-width: 900px;
2565
- margin: 0 auto;
2566
- }
2567
-
2568
- .edit-site-style-book__example {
2569
- background: none;
2570
- border-radius: 2px;
2571
- border: none;
2572
- color: inherit;
2573
- cursor: pointer;
2574
- display: flex;
2575
- flex-direction: column;
2576
- gap: 40px;
2577
- margin-bottom: 40px;
2578
- padding: 16px;
2579
- width: 100%;
2580
- }
2581
- .edit-site-style-book__example.is-selected {
2582
- box-shadow: 0 0 0 1px var(--wp-admin-theme-color);
2583
- }
2584
- .edit-site-style-book.is-wide .edit-site-style-book__example {
2585
- flex-direction: row;
2586
- }
2587
-
2588
- .edit-site-style-book__example-title {
2589
- font-size: 11px;
2590
- font-weight: 500;
2591
- margin: 0;
2592
- text-align: left;
2593
- text-transform: uppercase;
2594
- }
2595
- .edit-site-style-book.is-wide .edit-site-style-book__example-title {
2596
- text-align: right;
2597
- width: 120px;
2598
- }
2599
-
2600
- .edit-site-style-book__example-preview {
2601
- width: 100%;
2602
- }
2603
-
2604
2576
  .edit-site-push-changes-to-global-styles-control .components-button {
2605
2577
  justify-content: center;
2606
2578
  width: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "5.3.7",
3
+ "version": "5.3.8",
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.7",
33
- "@wordpress/block-library": "^8.3.7",
32
+ "@wordpress/block-editor": "^11.3.8",
33
+ "@wordpress/block-library": "^8.3.8",
34
34
  "@wordpress/blocks": "^12.3.3",
35
- "@wordpress/components": "^23.3.5",
35
+ "@wordpress/components": "^23.3.6",
36
36
  "@wordpress/compose": "^6.3.3",
37
37
  "@wordpress/core-data": "^6.3.3",
38
38
  "@wordpress/data": "^8.3.3",
39
39
  "@wordpress/deprecated": "^3.26.1",
40
- "@wordpress/editor": "^13.3.7",
40
+ "@wordpress/editor": "^13.3.8",
41
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
45
  "@wordpress/icons": "^9.17.2",
46
- "@wordpress/interface": "^5.3.6",
46
+ "@wordpress/interface": "^5.3.7",
47
47
  "@wordpress/keyboard-shortcuts": "^4.3.3",
48
48
  "@wordpress/keycodes": "^3.26.2",
49
49
  "@wordpress/media-utils": "^4.17.2",
50
50
  "@wordpress/notices": "^3.26.3",
51
51
  "@wordpress/plugins": "^5.3.3",
52
- "@wordpress/preferences": "^3.3.5",
52
+ "@wordpress/preferences": "^3.3.6",
53
53
  "@wordpress/private-apis": "^0.8.1",
54
- "@wordpress/reusable-blocks": "^4.3.7",
54
+ "@wordpress/reusable-blocks": "^4.3.8",
55
55
  "@wordpress/style-engine": "^1.9.1",
56
56
  "@wordpress/url": "^3.27.1",
57
57
  "@wordpress/viewport": "^5.3.3",
58
- "@wordpress/widgets": "^3.3.7",
58
+ "@wordpress/widgets": "^3.3.8",
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": "d14fea64bd9ad9d2d86047936974dbed39a5b5b3"
76
+ "gitHead": "446428841b54f47e5373d6e9723ef7ec24cf11b3"
77
77
  }
@@ -7,7 +7,8 @@ import {
7
7
  DropdownMenu,
8
8
  MenuGroup,
9
9
  MenuItem,
10
- NavigableMenu,
10
+ Tooltip,
11
+ VisuallyHidden,
11
12
  } from '@wordpress/components';
12
13
  import { useState } from '@wordpress/element';
13
14
  import { useDispatch } from '@wordpress/data';
@@ -179,6 +180,11 @@ export default function NewTemplate( {
179
180
  if ( ! missingTemplates.length ) {
180
181
  return null;
181
182
  }
183
+
184
+ const customTemplateDescription = __(
185
+ 'A custom template can be manually applied to any post or page.'
186
+ );
187
+
182
188
  return (
183
189
  <>
184
190
  <DropdownMenu
@@ -196,7 +202,7 @@ export default function NewTemplate( {
196
202
  { isCreatingTemplate && (
197
203
  <TemplateActionsLoadingScreen />
198
204
  ) }
199
- <NavigableMenu className="edit-site-new-template-dropdown__popover">
205
+ <div className="edit-site-new-template-dropdown__menu-groups">
200
206
  <MenuGroup label={ postType.labels.add_new_item }>
201
207
  { missingTemplates.map( ( template ) => {
202
208
  const {
@@ -207,44 +213,63 @@ export default function NewTemplate( {
207
213
  icon,
208
214
  } = template;
209
215
  return (
210
- <MenuItem
211
- icon={
212
- icon ||
213
- TEMPLATE_ICONS[ slug ] ||
214
- post
215
- }
216
- iconPosition="left"
217
- info={ description }
216
+ <Tooltip
218
217
  key={ slug }
219
- onClick={ () =>
220
- onClick
221
- ? onClick( template )
222
- : createTemplate( template )
223
- }
218
+ position="top right"
219
+ text={ description }
220
+ className="edit-site-new-template-dropdown__menu-item-tooltip"
224
221
  >
225
- { title }
226
- </MenuItem>
222
+ <MenuItem
223
+ icon={
224
+ icon ||
225
+ TEMPLATE_ICONS[ slug ] ||
226
+ post
227
+ }
228
+ iconPosition="left"
229
+ onClick={ () =>
230
+ onClick
231
+ ? onClick( template )
232
+ : createTemplate(
233
+ template
234
+ )
235
+ }
236
+ >
237
+ { title }
238
+ { /* TODO: This probably won't be needed if the <Tooltip> component is accessible.
239
+ * @see https://github.com/WordPress/gutenberg/issues/48222 */ }
240
+ <VisuallyHidden>
241
+ { description }
242
+ </VisuallyHidden>
243
+ </MenuItem>
244
+ </Tooltip>
227
245
  );
228
246
  } ) }
229
247
  </MenuGroup>
230
248
  <MenuGroup>
231
- <MenuItem
232
- icon={ customGenericTemplateIcon }
233
- iconPosition="left"
234
- info={ __(
235
- 'Custom templates can be applied to any post or page.'
236
- ) }
237
- key="custom-template"
238
- onClick={ () =>
239
- setShowCustomGenericTemplateModal(
240
- true
241
- )
242
- }
249
+ <Tooltip
250
+ position="top right"
251
+ text={ customTemplateDescription }
252
+ className="edit-site-new-template-dropdown__menu-item-tooltip"
243
253
  >
244
- { __( 'Custom template' ) }
245
- </MenuItem>
254
+ <MenuItem
255
+ icon={ customGenericTemplateIcon }
256
+ iconPosition="left"
257
+ onClick={ () =>
258
+ setShowCustomGenericTemplateModal(
259
+ true
260
+ )
261
+ }
262
+ >
263
+ { __( 'Custom template' ) }
264
+ { /* TODO: This probably won't be needed if the <Tooltip> component is accessible.
265
+ * @see https://github.com/WordPress/gutenberg/issues/48222 */ }
266
+ <VisuallyHidden>
267
+ { customTemplateDescription }
268
+ </VisuallyHidden>
269
+ </MenuItem>
270
+ </Tooltip>
246
271
  </MenuGroup>
247
- </NavigableMenu>
272
+ </div>
248
273
  </>
249
274
  ) }
250
275
  </DropdownMenu>
@@ -1,9 +1,20 @@
1
1
  .edit-site-new-template-dropdown {
2
- .edit-site-new-template-dropdown__popover {
2
+ .edit-site-new-template-dropdown__menu-groups {
3
3
  @include break-small() {
4
4
  min-width: 300px;
5
5
  }
6
6
  }
7
+
8
+ // The specificity is needed to override the default tooltip styles.
9
+ &__menu-item-tooltip.components-tooltip .components-popover__content {
10
+ max-width: 320px;
11
+ padding: $grid-unit-10 $grid-unit-15;
12
+ border-radius: 2px;
13
+ white-space: pre-wrap;
14
+ min-width: 0;
15
+ width: auto;
16
+ text-align: left;
17
+ }
7
18
  }
8
19
 
9
20
  .edit-site-custom-template-modal {
@@ -5,10 +5,7 @@ import { __ } from '@wordpress/i18n';
5
5
  import { useCallback, useMemo } from '@wordpress/element';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { store as coreStore } from '@wordpress/core-data';
8
- import {
9
- BlockEditorProvider,
10
- privateApis as blockEditorPrivateApis,
11
- } from '@wordpress/block-editor';
8
+ import { BlockEditorProvider } from '@wordpress/block-editor';
12
9
  import { createBlock } from '@wordpress/blocks';
13
10
 
14
11
  /**
@@ -17,7 +14,6 @@ import { createBlock } from '@wordpress/blocks';
17
14
  import SidebarNavigationScreen from '../sidebar-navigation-screen';
18
15
  import { useHistory } from '../routes';
19
16
  import NavigationMenuContent from './navigation-menu-content';
20
- import SidebarButton from '../sidebar-button';
21
17
  import { NavigationMenuLoader } from './loader';
22
18
  import { unlock } from '../../private-apis';
23
19
  import { store as editSiteStore } from '../../store';
@@ -38,11 +34,6 @@ function SidebarNavigationScreenWrapper( { children, actions } ) {
38
34
  );
39
35
  }
40
36
 
41
- const prioritizedInserterBlocks = [
42
- 'core/navigation-link/page',
43
- 'core/navigation-link',
44
- ];
45
-
46
37
  export default function SidebarNavigationScreenNavigationMenus() {
47
38
  const history = useHistory();
48
39
  const { navigationMenus, hasResolvedNavigationMenus, storedSettings } =
@@ -109,18 +100,6 @@ export default function SidebarNavigationScreenNavigationMenus() {
109
100
  },
110
101
  [ history ]
111
102
  );
112
- const orderInitialBlockItems = useCallback( ( items ) => {
113
- items.sort( ( { id: aName }, { id: bName } ) => {
114
- // Sort block items according to `prioritizedInserterBlocks`.
115
- let aIndex = prioritizedInserterBlocks.indexOf( aName );
116
- let bIndex = prioritizedInserterBlocks.indexOf( bName );
117
- // All other block items should come after that.
118
- if ( aIndex < 0 ) aIndex = prioritizedInserterBlocks.length;
119
- if ( bIndex < 0 ) bIndex = prioritizedInserterBlocks.length;
120
- return aIndex - bIndex;
121
- } );
122
- return items;
123
- }, [] );
124
103
 
125
104
  if ( hasResolvedNavigationMenus && ! hasNavigationMenus ) {
126
105
  return (
@@ -137,7 +116,7 @@ export default function SidebarNavigationScreenNavigationMenus() {
137
116
  </SidebarNavigationScreenWrapper>
138
117
  );
139
118
  }
140
- const { PrivateInserter } = unlock( blockEditorPrivateApis );
119
+
141
120
  return (
142
121
  <BlockEditorProvider
143
122
  settings={ storedSettings }
@@ -145,23 +124,7 @@ export default function SidebarNavigationScreenNavigationMenus() {
145
124
  onChange={ noop }
146
125
  onInput={ noop }
147
126
  >
148
- <SidebarNavigationScreenWrapper
149
- actions={
150
- <PrivateInserter
151
- rootClientId={ blocks[ 0 ].clientId }
152
- position="bottom right"
153
- isAppender
154
- selectBlockOnInsert={ false }
155
- shouldDirectInsert={ false }
156
- __experimentalIsQuick
157
- toggleProps={ {
158
- as: SidebarButton,
159
- label: __( 'Add menu item' ),
160
- } }
161
- orderInitialBlockItems={ orderInitialBlockItems }
162
- />
163
- }
164
- >
127
+ <SidebarNavigationScreenWrapper>
165
128
  <div className="edit-site-sidebar-navigation-screen-navigation-menus__content">
166
129
  <NavigationMenuContent
167
130
  rootClientId={ blocks[ 0 ].clientId }
@@ -61,3 +61,7 @@
61
61
  }
62
62
  }
63
63
  }
64
+
65
+ .edit-site-sidebar-navigation-screen-navigation-menus__content .popover-slot .wp-block-navigation-submenu {
66
+ display: none;
67
+ }
@@ -11,7 +11,7 @@
11
11
 
12
12
  .edit-site-site-hub__view-mode-toggle-container {
13
13
  height: $header-height;
14
- width: $header-height + 4px;
14
+ width: $header-height;
15
15
  flex-shrink: 0;
16
16
  background: $gray-900;
17
17
  }