@wordpress/block-editor 12.3.4 → 12.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 (58) hide show
  1. package/README.md +4 -0
  2. package/build/components/block-edit/edit.js +25 -13
  3. package/build/components/block-edit/edit.js.map +1 -1
  4. package/build/components/block-parent-selector/index.js +8 -5
  5. package/build/components/block-parent-selector/index.js.map +1 -1
  6. package/build/components/block-removal-warning-modal/index.js +4 -1
  7. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  8. package/build/components/block-tools/block-contextual-toolbar.js +7 -11
  9. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  10. package/build/components/index.js +10 -1
  11. package/build/components/index.js.map +1 -1
  12. package/build/components/inserter/reusable-block-rename-hint.js +62 -0
  13. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -0
  14. package/build/components/inserter/reusable-blocks-tab.js +5 -1
  15. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  16. package/build/components/list-view/use-list-view-client-ids.js +2 -2
  17. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  18. package/build/store/private-selectors.js +5 -6
  19. package/build/store/private-selectors.js.map +1 -1
  20. package/build/store/selectors.js +6 -4
  21. package/build/store/selectors.js.map +1 -1
  22. package/build-module/components/block-edit/edit.js +27 -10
  23. package/build-module/components/block-edit/edit.js.map +1 -1
  24. package/build-module/components/block-parent-selector/index.js +7 -5
  25. package/build-module/components/block-parent-selector/index.js.map +1 -1
  26. package/build-module/components/block-removal-warning-modal/index.js +4 -1
  27. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  28. package/build-module/components/block-tools/block-contextual-toolbar.js +8 -11
  29. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  30. package/build-module/components/index.js +5 -0
  31. package/build-module/components/index.js.map +1 -1
  32. package/build-module/components/inserter/reusable-block-rename-hint.js +48 -0
  33. package/build-module/components/inserter/reusable-block-rename-hint.js.map +1 -0
  34. package/build-module/components/inserter/reusable-blocks-tab.js +4 -1
  35. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  36. package/build-module/components/list-view/use-list-view-client-ids.js +2 -2
  37. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  38. package/build-module/store/private-selectors.js +3 -3
  39. package/build-module/store/private-selectors.js.map +1 -1
  40. package/build-module/store/selectors.js +6 -4
  41. package/build-module/store/selectors.js.map +1 -1
  42. package/build-style/style-rtl.css +71 -20
  43. package/build-style/style.css +71 -20
  44. package/package.json +9 -9
  45. package/src/components/block-edit/edit.js +26 -9
  46. package/src/components/block-edit/test/edit.js +1 -1
  47. package/src/components/block-parent-selector/index.js +13 -8
  48. package/src/components/block-removal-warning-modal/index.js +3 -0
  49. package/src/components/block-tools/block-contextual-toolbar.js +5 -11
  50. package/src/components/block-tools/style.scss +69 -26
  51. package/src/components/index.js +5 -0
  52. package/src/components/inserter/reusable-block-rename-hint.js +52 -0
  53. package/src/components/inserter/reusable-blocks-tab.js +4 -0
  54. package/src/components/inserter/style.scss +28 -0
  55. package/src/components/list-view/use-list-view-client-ids.js +2 -2
  56. package/src/store/private-selectors.js +3 -6
  57. package/src/store/selectors.js +9 -6
  58. package/src/store/test/private-selectors.js +5 -5
@@ -333,42 +333,72 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
333
333
  }
334
334
  @media (min-width: 782px) {
335
335
  .block-editor-block-contextual-toolbar.is-fixed {
336
- margin-right: 64px;
336
+ margin-right: 180px;
337
337
  position: fixed;
338
- top: 40px;
338
+ top: 39px;
339
339
  min-height: initial;
340
340
  border-bottom: none;
341
341
  display: flex;
342
342
  }
343
343
  .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
344
344
  width: initial;
345
- margin-right: 216px;
346
345
  }
347
346
  .is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
348
- margin-right: 120px;
349
- top: 8px;
347
+ margin-right: 240px;
348
+ top: 7px;
350
349
  }
351
350
  .is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
352
351
  width: initial;
353
- margin-right: 280px;
352
+ }
353
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar.is-showing-movers {
354
+ flex-grow: initial;
355
+ width: initial;
356
+ }
357
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar.is-showing-movers::before {
358
+ content: "";
359
+ width: 1px;
360
+ height: 24px;
361
+ margin-top: 12px;
362
+ margin-left: 0;
363
+ background-color: #ddd;
364
+ position: relative;
365
+ right: -2px;
366
+ top: -1px;
354
367
  }
355
368
  .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar {
356
369
  border: none;
357
370
  }
358
- .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar::after {
371
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar .components-button.has-icon svg {
372
+ display: none;
373
+ }
374
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar .components-button.has-icon::after {
375
+ content: attr(aria-label);
376
+ font-size: 12px;
377
+ }
378
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar::before {
359
379
  content: "";
360
380
  width: 1px;
361
381
  height: 24px;
362
382
  margin-top: 12px;
363
- margin-bottom: 12px;
383
+ margin-left: 8px;
364
384
  background-color: #ddd;
365
- position: absolute;
366
- right: 44px;
385
+ position: relative;
386
+ right: 0;
367
387
  top: -1px;
368
388
  }
369
389
  .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar {
370
390
  border: none;
371
391
  }
392
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar {
393
+ width: 256px;
394
+ }
395
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar .components-button.has-icon svg {
396
+ display: none;
397
+ }
398
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar .components-button.has-icon::after {
399
+ content: attr(aria-label);
400
+ font-size: 12px;
401
+ }
372
402
  .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar::before {
373
403
  content: "";
374
404
  width: 1px;
@@ -376,20 +406,15 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
376
406
  margin-bottom: 12px;
377
407
  background-color: #ddd;
378
408
  position: relative;
379
- right: -12px;
409
+ right: -8px;
380
410
  height: 24px;
411
+ top: -1px;
381
412
  }
382
413
  .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed {
383
- margin-right: 64px;
384
- }
385
- .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
386
- margin-right: 384px;
414
+ margin-right: 80px;
387
415
  }
388
416
  .is-fullscreen-mode .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed {
389
- margin-right: 128px;
390
- }
391
- .is-fullscreen-mode .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
392
- margin-right: 448px;
417
+ margin-right: 144px;
393
418
  }
394
419
  .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-parent-selector .block-editor-block-parent-selector__button::after {
395
420
  right: 0;
@@ -447,7 +472,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
447
472
  }
448
473
  @media (min-width: 960px) {
449
474
  .block-editor-block-contextual-toolbar.is-fixed {
450
- width: initial;
475
+ width: calc(100% - 240px - 256px);
451
476
  }
452
477
  }
453
478
 
@@ -4114,6 +4139,32 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
4114
4139
  margin: 0;
4115
4140
  }
4116
4141
 
4142
+ .block-editor-inserter__hint {
4143
+ margin: 16px 16px 0;
4144
+ }
4145
+
4146
+ .reusable-blocks-menu-items__rename-hint {
4147
+ align-items: top;
4148
+ background: #f0f0f0;
4149
+ border-radius: 2px;
4150
+ color: #1e1e1e;
4151
+ display: flex;
4152
+ flex-direction: row;
4153
+ max-width: 380px;
4154
+ }
4155
+
4156
+ .reusable-blocks-menu-items__rename-hint-content {
4157
+ margin: 12px 12px 12px 0;
4158
+ }
4159
+
4160
+ .reusable-blocks-menu-items__rename-hint-dismiss {
4161
+ margin: 4px 0 4px 4px;
4162
+ }
4163
+
4164
+ .components-menu-group .reusable-blocks-menu-items__rename-hint {
4165
+ margin: 0;
4166
+ }
4167
+
4117
4168
  .block-editor-post-preview__dropdown {
4118
4169
  padding: 0;
4119
4170
  }
@@ -333,42 +333,72 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
333
333
  }
334
334
  @media (min-width: 782px) {
335
335
  .block-editor-block-contextual-toolbar.is-fixed {
336
- margin-left: 64px;
336
+ margin-left: 180px;
337
337
  position: fixed;
338
- top: 40px;
338
+ top: 39px;
339
339
  min-height: initial;
340
340
  border-bottom: none;
341
341
  display: flex;
342
342
  }
343
343
  .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
344
344
  width: initial;
345
- margin-left: 216px;
346
345
  }
347
346
  .is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
348
- margin-left: 120px;
349
- top: 8px;
347
+ margin-left: 240px;
348
+ top: 7px;
350
349
  }
351
350
  .is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
352
351
  width: initial;
353
- margin-left: 280px;
352
+ }
353
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar.is-showing-movers {
354
+ flex-grow: initial;
355
+ width: initial;
356
+ }
357
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar.is-showing-movers::before {
358
+ content: "";
359
+ width: 1px;
360
+ height: 24px;
361
+ margin-top: 12px;
362
+ margin-right: 0;
363
+ background-color: #ddd;
364
+ position: relative;
365
+ left: -2px;
366
+ top: -1px;
354
367
  }
355
368
  .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar {
356
369
  border: none;
357
370
  }
358
- .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar::after {
371
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar .components-button.has-icon svg {
372
+ display: none;
373
+ }
374
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar .components-button.has-icon::after {
375
+ content: attr(aria-label);
376
+ font-size: 12px;
377
+ }
378
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar::before {
359
379
  content: "";
360
380
  width: 1px;
361
381
  height: 24px;
362
382
  margin-top: 12px;
363
- margin-bottom: 12px;
383
+ margin-right: 8px;
364
384
  background-color: #ddd;
365
- position: absolute;
366
- left: 44px;
385
+ position: relative;
386
+ left: 0;
367
387
  top: -1px;
368
388
  }
369
389
  .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar {
370
390
  border: none;
371
391
  }
392
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar {
393
+ width: 256px;
394
+ }
395
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar .components-button.has-icon svg {
396
+ display: none;
397
+ }
398
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar .components-button.has-icon::after {
399
+ content: attr(aria-label);
400
+ font-size: 12px;
401
+ }
372
402
  .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar::before {
373
403
  content: "";
374
404
  width: 1px;
@@ -376,20 +406,15 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
376
406
  margin-bottom: 12px;
377
407
  background-color: #ddd;
378
408
  position: relative;
379
- left: -12px;
409
+ left: -8px;
380
410
  height: 24px;
411
+ top: -1px;
381
412
  }
382
413
  .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed {
383
- margin-left: 64px;
384
- }
385
- .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
386
- margin-left: 384px;
414
+ margin-left: 80px;
387
415
  }
388
416
  .is-fullscreen-mode .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed {
389
- margin-left: 128px;
390
- }
391
- .is-fullscreen-mode .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
392
- margin-left: 448px;
417
+ margin-left: 144px;
393
418
  }
394
419
  .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-parent-selector .block-editor-block-parent-selector__button::after {
395
420
  left: 0;
@@ -447,7 +472,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
447
472
  }
448
473
  @media (min-width: 960px) {
449
474
  .block-editor-block-contextual-toolbar.is-fixed {
450
- width: initial;
475
+ width: calc(100% - 240px - 256px);
451
476
  }
452
477
  }
453
478
 
@@ -4115,6 +4140,32 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
4115
4140
  margin: 0;
4116
4141
  }
4117
4142
 
4143
+ .block-editor-inserter__hint {
4144
+ margin: 16px 16px 0;
4145
+ }
4146
+
4147
+ .reusable-blocks-menu-items__rename-hint {
4148
+ align-items: top;
4149
+ background: #f0f0f0;
4150
+ border-radius: 2px;
4151
+ color: #1e1e1e;
4152
+ display: flex;
4153
+ flex-direction: row;
4154
+ max-width: 380px;
4155
+ }
4156
+
4157
+ .reusable-blocks-menu-items__rename-hint-content {
4158
+ margin: 12px 0 12px 12px;
4159
+ }
4160
+
4161
+ .reusable-blocks-menu-items__rename-hint-dismiss {
4162
+ margin: 4px 4px 4px 0;
4163
+ }
4164
+
4165
+ .components-menu-group .reusable-blocks-menu-items__rename-hint {
4166
+ margin: 0;
4167
+ }
4168
+
4118
4169
  .block-editor-post-preview__dropdown {
4119
4170
  padding: 0;
4120
4171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "12.3.4",
3
+ "version": "12.3.5",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,10 +37,10 @@
37
37
  "@wordpress/a11y": "^3.35.1",
38
38
  "@wordpress/api-fetch": "^6.32.1",
39
39
  "@wordpress/blob": "^3.35.1",
40
- "@wordpress/blocks": "^12.12.2",
41
- "@wordpress/components": "^25.1.4",
40
+ "@wordpress/blocks": "^12.12.3",
41
+ "@wordpress/components": "^25.1.5",
42
42
  "@wordpress/compose": "^6.12.1",
43
- "@wordpress/data": "^9.5.2",
43
+ "@wordpress/data": "^9.5.3",
44
44
  "@wordpress/date": "^4.35.1",
45
45
  "@wordpress/deprecated": "^3.35.1",
46
46
  "@wordpress/dom": "^3.35.1",
@@ -51,12 +51,12 @@
51
51
  "@wordpress/i18n": "^4.35.1",
52
52
  "@wordpress/icons": "^9.26.2",
53
53
  "@wordpress/is-shallow-equal": "^4.35.1",
54
- "@wordpress/keyboard-shortcuts": "^4.12.2",
54
+ "@wordpress/keyboard-shortcuts": "^4.12.3",
55
55
  "@wordpress/keycodes": "^3.35.1",
56
- "@wordpress/notices": "^4.3.2",
57
- "@wordpress/preferences": "^3.12.4",
56
+ "@wordpress/notices": "^4.3.3",
57
+ "@wordpress/preferences": "^3.12.5",
58
58
  "@wordpress/private-apis": "^0.17.1",
59
- "@wordpress/rich-text": "^6.12.2",
59
+ "@wordpress/rich-text": "^6.12.3",
60
60
  "@wordpress/shortcode": "^3.35.1",
61
61
  "@wordpress/style-engine": "^1.18.1",
62
62
  "@wordpress/token-list": "^2.35.1",
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "65fb4cd5187a47ca274c24c04a220bcdb2ddfa67"
88
+ "gitHead": "3eeb607ebb76c3bf06cb8acb462f0dc068f340f9"
89
89
  }
@@ -29,7 +29,25 @@ import BlockContext from '../block-context';
29
29
  */
30
30
  const DEFAULT_BLOCK_CONTEXT = {};
31
31
 
32
- export const Edit = ( props ) => {
32
+ const Edit = ( props ) => {
33
+ const { name } = props;
34
+ const blockType = getBlockType( name );
35
+
36
+ if ( ! blockType ) {
37
+ return null;
38
+ }
39
+
40
+ // `edit` and `save` are functions or components describing the markup
41
+ // with which a block is displayed. If `blockType` is valid, assign
42
+ // them preferentially as the render value for the block.
43
+ const Component = blockType.edit || blockType.save;
44
+
45
+ return <Component { ...props } />;
46
+ };
47
+
48
+ const EditWithFilters = withFilters( 'editor.BlockEdit' )( Edit );
49
+
50
+ const EditWithGeneratedProps = ( props ) => {
33
51
  const { attributes = {}, name } = props;
34
52
  const blockType = getBlockType( name );
35
53
  const blockContext = useContext( BlockContext );
@@ -49,13 +67,8 @@ export const Edit = ( props ) => {
49
67
  return null;
50
68
  }
51
69
 
52
- // `edit` and `save` are functions or components describing the markup
53
- // with which a block is displayed. If `blockType` is valid, assign
54
- // them preferentially as the render value for the block.
55
- const Component = blockType.edit || blockType.save;
56
-
57
70
  if ( blockType.apiVersion > 1 ) {
58
- return <Component { ...props } context={ context } />;
71
+ return <EditWithFilters { ...props } context={ context } />;
59
72
  }
60
73
 
61
74
  // Generate a class name for the block's editable form.
@@ -69,8 +82,12 @@ export const Edit = ( props ) => {
69
82
  );
70
83
 
71
84
  return (
72
- <Component { ...props } context={ context } className={ className } />
85
+ <EditWithFilters
86
+ { ...props }
87
+ context={ context }
88
+ className={ className }
89
+ />
73
90
  );
74
91
  };
75
92
 
76
- export default withFilters( 'editor.BlockEdit' )( Edit );
93
+ export default EditWithGeneratedProps;
@@ -15,7 +15,7 @@ import {
15
15
  /**
16
16
  * Internal dependencies
17
17
  */
18
- import { Edit } from '../edit';
18
+ import Edit from '../edit';
19
19
  import { BlockContextProvider } from '../../block-context';
20
20
 
21
21
  const noop = () => {};
@@ -14,6 +14,7 @@ import useBlockDisplayInformation from '../use-block-display-information';
14
14
  import BlockIcon from '../block-icon';
15
15
  import { useShowMoversGestures } from '../block-toolbar/utils';
16
16
  import { store as blockEditorStore } from '../../store';
17
+ import { unlock } from '../../lock-unlock';
17
18
 
18
19
  /**
19
20
  * Block parent selector component, displaying the hierarchy of the
@@ -24,14 +25,15 @@ import { store as blockEditorStore } from '../../store';
24
25
  export default function BlockParentSelector() {
25
26
  const { selectBlock, toggleBlockHighlight } =
26
27
  useDispatch( blockEditorStore );
27
- const { firstParentClientId, shouldHide, isDistractionFree } = useSelect(
28
+ const { firstParentClientId, isVisible, isDistractionFree } = useSelect(
28
29
  ( select ) => {
29
30
  const {
30
31
  getBlockName,
31
32
  getBlockParents,
32
33
  getSelectedBlockClientId,
33
34
  getSettings,
34
- } = select( blockEditorStore );
35
+ getBlockEditingMode,
36
+ } = unlock( select( blockEditorStore ) );
35
37
  const { hasBlockSupport } = select( blocksStore );
36
38
  const selectedBlockClientId = getSelectedBlockClientId();
37
39
  const parents = getBlockParents( selectedBlockClientId );
@@ -41,11 +43,14 @@ export default function BlockParentSelector() {
41
43
  const settings = getSettings();
42
44
  return {
43
45
  firstParentClientId: _firstParentClientId,
44
- shouldHide: ! hasBlockSupport(
45
- _parentBlockType,
46
- '__experimentalParentSelector',
47
- true
48
- ),
46
+ isVisible:
47
+ _firstParentClientId &&
48
+ getBlockEditingMode( _firstParentClientId ) === 'default' &&
49
+ hasBlockSupport(
50
+ _parentBlockType,
51
+ '__experimentalParentSelector',
52
+ true
53
+ ),
49
54
  isDistractionFree: settings.isDistractionFree,
50
55
  };
51
56
  },
@@ -66,7 +71,7 @@ export default function BlockParentSelector() {
66
71
  },
67
72
  } );
68
73
 
69
- if ( shouldHide || firstParentClientId === undefined ) {
74
+ if ( ! isVisible ) {
70
75
  return null;
71
76
  }
72
77
 
@@ -62,6 +62,9 @@ export function BlockRemovalWarningModal() {
62
62
  <Modal
63
63
  title={ __( 'Are you sure?' ) }
64
64
  onRequestClose={ clearRemovalPrompt }
65
+ style={ {
66
+ maxWidth: '40rem',
67
+ } }
65
68
  >
66
69
  { blockNamesForPrompt.length === 1 ? (
67
70
  <p>{ blockTypePromptMessages[ blockNamesForPrompt[ 0 ] ] }</p>
@@ -15,7 +15,7 @@ import {
15
15
  ToolbarButton,
16
16
  ToolbarGroup,
17
17
  } from '@wordpress/components';
18
- import { levelUp } from '@wordpress/icons';
18
+ import { next, previous } from '@wordpress/icons';
19
19
  import { useViewportMatch } from '@wordpress/compose';
20
20
 
21
21
  /**
@@ -24,7 +24,6 @@ import { useViewportMatch } from '@wordpress/compose';
24
24
  import NavigableToolbar from '../navigable-toolbar';
25
25
  import BlockToolbar from '../block-toolbar';
26
26
  import { store as blockEditorStore } from '../../store';
27
- import BlockIcon from '../block-icon';
28
27
  import { unlock } from '../../lock-unlock';
29
28
 
30
29
  function BlockContextualToolbar( { focusOnMount, isFixed, ...props } ) {
@@ -57,6 +56,7 @@ function BlockContextualToolbar( { focusOnMount, isFixed, ...props } ) {
57
56
  hasParents: parents.length,
58
57
  showParentSelector:
59
58
  parentBlockType &&
59
+ getBlockEditingMode( firstParentClientId ) === 'default' &&
60
60
  hasBlockSupport(
61
61
  parentBlockType,
62
62
  '__experimentalParentSelector',
@@ -93,6 +93,7 @@ function BlockContextualToolbar( { focusOnMount, isFixed, ...props } ) {
93
93
  aria-label={ __( 'Block tools' ) }
94
94
  { ...props }
95
95
  >
96
+ { ! isCollapsed && <BlockToolbar hideDragHandle={ isFixed } /> }
96
97
  { isFixed && isLargeViewport && blockType && (
97
98
  <ToolbarGroup
98
99
  className={
@@ -104,13 +105,7 @@ function BlockContextualToolbar( { focusOnMount, isFixed, ...props } ) {
104
105
  <ToolbarItem
105
106
  as={ ToolbarButton }
106
107
  ref={ toolbarButtonRef }
107
- icon={
108
- isCollapsed ? (
109
- <BlockIcon icon={ blockType.icon } />
110
- ) : (
111
- levelUp
112
- )
113
- }
108
+ icon={ isCollapsed ? next : previous }
114
109
  onClick={ () => {
115
110
  setIsCollapsed( ( collapsed ) => ! collapsed );
116
111
  toolbarButtonRef.current.focus();
@@ -118,12 +113,11 @@ function BlockContextualToolbar( { focusOnMount, isFixed, ...props } ) {
118
113
  label={
119
114
  isCollapsed
120
115
  ? __( 'Show block tools' )
121
- : __( 'Show document tools' )
116
+ : __( 'Hide block tools' )
122
117
  }
123
118
  />
124
119
  </ToolbarGroup>
125
120
  ) }
126
- { ! isCollapsed && <BlockToolbar hideDragHandle={ isFixed } /> }
127
121
  </NavigableToolbar>
128
122
  );
129
123
  }