@wordpress/block-editor 11.8.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +15 -3
  3. package/build/components/block-info-slot-fill/index.js +47 -0
  4. package/build/components/block-info-slot-fill/index.js.map +1 -0
  5. package/build/components/block-inspector/index.js +4 -2
  6. package/build/components/block-inspector/index.js.map +1 -1
  7. package/build/components/block-list/block.native.js +3 -4
  8. package/build/components/block-list/block.native.js.map +1 -1
  9. package/build/components/block-toolbar/index.js +2 -1
  10. package/build/components/block-toolbar/index.js.map +1 -1
  11. package/build/components/block-tools/block-contextual-toolbar.js +83 -9
  12. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  13. package/build/components/block-tools/selected-block-popover.js +11 -28
  14. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  15. package/build/components/editor-styles/index.js +4 -3
  16. package/build/components/editor-styles/index.js.map +1 -1
  17. package/build/components/font-sizes/fluid-utils.js +21 -14
  18. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  19. package/build/components/global-styles/border-panel.js +2 -32
  20. package/build/components/global-styles/border-panel.js.map +1 -1
  21. package/build/components/global-styles/color-panel.js +12 -12
  22. package/build/components/global-styles/color-panel.js.map +1 -1
  23. package/build/components/global-styles/color-panel.native.js +174 -0
  24. package/build/components/global-styles/color-panel.native.js.map +1 -0
  25. package/build/components/global-styles/dimensions-panel.js +6 -6
  26. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  27. package/build/components/global-styles/effects-panel.js +1 -1
  28. package/build/components/global-styles/effects-panel.js.map +1 -1
  29. package/build/components/global-styles/filters-panel.js +78 -14
  30. package/build/components/global-styles/filters-panel.js.map +1 -1
  31. package/build/components/global-styles/typography-panel.js +9 -9
  32. package/build/components/global-styles/typography-panel.js.map +1 -1
  33. package/build/components/global-styles/use-global-styles-output.js +87 -77
  34. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  35. package/build/components/index.js +7 -0
  36. package/build/components/index.js.map +1 -1
  37. package/build/components/inserter/block-types-tab.js +12 -7
  38. package/build/components/inserter/block-types-tab.js.map +1 -1
  39. package/build/components/inserter/index.js +2 -1
  40. package/build/components/inserter/index.js.map +1 -1
  41. package/build/components/inspector-controls/groups.js +2 -0
  42. package/build/components/inspector-controls/groups.js.map +1 -1
  43. package/build/components/inspector-controls-tabs/styles-tab.js +2 -0
  44. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  45. package/build/components/list-view/block-select-button.js +7 -2
  46. package/build/components/list-view/block-select-button.js.map +1 -1
  47. package/build/components/list-view/block.js +12 -21
  48. package/build/components/list-view/block.js.map +1 -1
  49. package/build/components/list-view/drop-indicator.js +37 -10
  50. package/build/components/list-view/drop-indicator.js.map +1 -1
  51. package/build/components/list-view/index.js +10 -4
  52. package/build/components/list-view/index.js.map +1 -1
  53. package/build/components/list-view/leaf.js +2 -1
  54. package/build/components/list-view/leaf.js.map +1 -1
  55. package/build/components/list-view/use-block-selection.js +1 -1
  56. package/build/components/list-view/use-block-selection.js.map +1 -1
  57. package/build/components/media-replace-flow/index.js +5 -5
  58. package/build/components/media-replace-flow/index.js.map +1 -1
  59. package/build/components/navigable-toolbar/index.js +12 -4
  60. package/build/components/navigable-toolbar/index.js.map +1 -1
  61. package/build/components/off-canvas-editor/appender.js +2 -7
  62. package/build/components/off-canvas-editor/appender.js.map +1 -1
  63. package/build/hooks/duotone.js +29 -4
  64. package/build/hooks/duotone.js.map +1 -1
  65. package/build/hooks/utils.js +15 -3
  66. package/build/hooks/utils.js.map +1 -1
  67. package/build/private-apis.js +10 -1
  68. package/build/private-apis.js.map +1 -1
  69. package/build/store/actions.js +7 -0
  70. package/build/store/actions.js.map +1 -1
  71. package/build/utils/object.js +5 -5
  72. package/build/utils/object.js.map +1 -1
  73. package/build/utils/transform-styles/index.js +2 -2
  74. package/build/utils/transform-styles/index.js.map +1 -1
  75. package/build/utils/use-should-contextual-toolbar-show.js +68 -0
  76. package/build/utils/use-should-contextual-toolbar-show.js.map +1 -0
  77. package/build-module/components/block-info-slot-fill/index.js +34 -0
  78. package/build-module/components/block-info-slot-fill/index.js.map +1 -0
  79. package/build-module/components/block-inspector/index.js +3 -2
  80. package/build-module/components/block-inspector/index.js.map +1 -1
  81. package/build-module/components/block-list/block.native.js +3 -4
  82. package/build-module/components/block-list/block.native.js.map +1 -1
  83. package/build-module/components/block-toolbar/index.js +2 -1
  84. package/build-module/components/block-toolbar/index.js.map +1 -1
  85. package/build-module/components/block-tools/block-contextual-toolbar.js +79 -9
  86. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  87. package/build-module/components/block-tools/selected-block-popover.js +10 -27
  88. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  89. package/build-module/components/editor-styles/index.js +4 -3
  90. package/build-module/components/editor-styles/index.js.map +1 -1
  91. package/build-module/components/font-sizes/fluid-utils.js +21 -14
  92. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  93. package/build-module/components/global-styles/border-panel.js +2 -32
  94. package/build-module/components/global-styles/border-panel.js.map +1 -1
  95. package/build-module/components/global-styles/color-panel.js +13 -13
  96. package/build-module/components/global-styles/color-panel.js.map +1 -1
  97. package/build-module/components/global-styles/color-panel.native.js +150 -0
  98. package/build-module/components/global-styles/color-panel.native.js.map +1 -0
  99. package/build-module/components/global-styles/dimensions-panel.js +7 -7
  100. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  101. package/build-module/components/global-styles/effects-panel.js +2 -2
  102. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  103. package/build-module/components/global-styles/filters-panel.js +78 -16
  104. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  105. package/build-module/components/global-styles/typography-panel.js +10 -10
  106. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  107. package/build-module/components/global-styles/use-global-styles-output.js +87 -77
  108. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  109. package/build-module/components/index.js +1 -1
  110. package/build-module/components/index.js.map +1 -1
  111. package/build-module/components/inserter/block-types-tab.js +12 -6
  112. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  113. package/build-module/components/inserter/index.js +2 -1
  114. package/build-module/components/inserter/index.js.map +1 -1
  115. package/build-module/components/inspector-controls/groups.js +2 -0
  116. package/build-module/components/inspector-controls/groups.js.map +1 -1
  117. package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -0
  118. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  119. package/build-module/components/list-view/block-select-button.js +7 -2
  120. package/build-module/components/list-view/block-select-button.js.map +1 -1
  121. package/build-module/components/list-view/block.js +14 -22
  122. package/build-module/components/list-view/block.js.map +1 -1
  123. package/build-module/components/list-view/drop-indicator.js +36 -10
  124. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  125. package/build-module/components/list-view/index.js +11 -5
  126. package/build-module/components/list-view/index.js.map +1 -1
  127. package/build-module/components/list-view/leaf.js +2 -1
  128. package/build-module/components/list-view/leaf.js.map +1 -1
  129. package/build-module/components/list-view/use-block-selection.js +1 -1
  130. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  131. package/build-module/components/media-replace-flow/index.js +5 -5
  132. package/build-module/components/media-replace-flow/index.js.map +1 -1
  133. package/build-module/components/navigable-toolbar/index.js +12 -4
  134. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  135. package/build-module/components/off-canvas-editor/appender.js +1 -5
  136. package/build-module/components/off-canvas-editor/appender.js.map +1 -1
  137. package/build-module/hooks/duotone.js +28 -5
  138. package/build-module/hooks/duotone.js.map +1 -1
  139. package/build-module/hooks/utils.js +16 -4
  140. package/build-module/hooks/utils.js.map +1 -1
  141. package/build-module/private-apis.js +7 -1
  142. package/build-module/private-apis.js.map +1 -1
  143. package/build-module/store/actions.js +7 -0
  144. package/build-module/store/actions.js.map +1 -1
  145. package/build-module/utils/object.js +4 -4
  146. package/build-module/utils/object.js.map +1 -1
  147. package/build-module/utils/transform-styles/index.js +2 -2
  148. package/build-module/utils/transform-styles/index.js.map +1 -1
  149. package/build-module/utils/use-should-contextual-toolbar-show.js +56 -0
  150. package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -0
  151. package/build-style/content-rtl.css +9 -6
  152. package/build-style/content.css +9 -6
  153. package/build-style/style-rtl.css +223 -46
  154. package/build-style/style.css +223 -46
  155. package/package.json +32 -32
  156. package/src/components/block-info-slot-fill/index.js +24 -0
  157. package/src/components/block-inspector/index.js +3 -0
  158. package/src/components/block-list/block.native.js +2 -3
  159. package/src/components/block-list/content.scss +16 -15
  160. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +9 -9
  161. package/src/components/block-mover/style.scss +10 -4
  162. package/src/components/block-mover/test/index.native.js +4 -4
  163. package/src/components/block-toolbar/index.js +4 -3
  164. package/src/components/block-toolbar/style.scss +56 -33
  165. package/src/components/block-tools/block-contextual-toolbar.js +94 -11
  166. package/src/components/block-tools/selected-block-popover.js +11 -44
  167. package/src/components/block-tools/style.scss +157 -3
  168. package/src/components/editor-styles/index.js +9 -5
  169. package/src/components/font-sizes/fluid-utils.js +31 -14
  170. package/src/components/font-sizes/test/fluid-utils.js +5 -16
  171. package/src/components/global-styles/border-panel.js +1 -30
  172. package/src/components/global-styles/color-panel.js +13 -13
  173. package/src/components/global-styles/color-panel.native.js +207 -0
  174. package/src/components/global-styles/dimensions-panel.js +17 -7
  175. package/src/components/global-styles/effects-panel.js +2 -2
  176. package/src/components/global-styles/filters-panel.js +90 -17
  177. package/src/components/global-styles/style.scss +2 -1
  178. package/src/components/global-styles/test/typography-utils.js +63 -22
  179. package/src/components/global-styles/test/use-global-styles-output.js +126 -4
  180. package/src/components/global-styles/typography-panel.js +37 -11
  181. package/src/components/global-styles/use-global-styles-output.js +64 -64
  182. package/src/components/index.js +1 -0
  183. package/src/components/inserter/block-types-tab.js +9 -6
  184. package/src/components/inserter/index.js +1 -1
  185. package/src/components/inspector-controls/groups.js +2 -0
  186. package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
  187. package/src/components/list-view/block-select-button.js +6 -1
  188. package/src/components/list-view/block.js +23 -31
  189. package/src/components/list-view/drop-indicator.js +67 -22
  190. package/src/components/list-view/index.js +8 -1
  191. package/src/components/list-view/leaf.js +1 -0
  192. package/src/components/list-view/style.scss +15 -3
  193. package/src/components/list-view/use-block-selection.js +1 -1
  194. package/src/components/media-replace-flow/README.md +3 -2
  195. package/src/components/media-replace-flow/index.js +4 -5
  196. package/src/components/navigable-toolbar/index.js +12 -3
  197. package/src/components/off-canvas-editor/appender.js +1 -4
  198. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
  199. package/src/hooks/duotone.js +46 -25
  200. package/src/hooks/test/anchor.js +113 -0
  201. package/src/hooks/test/color.js +0 -9
  202. package/src/hooks/test/use-typography-props.js +2 -2
  203. package/src/hooks/test/utils.js +20 -101
  204. package/src/hooks/utils.js +20 -3
  205. package/src/private-apis.js +6 -0
  206. package/src/store/actions.js +7 -0
  207. package/src/utils/object.js +4 -4
  208. package/src/utils/test/object.js +21 -21
  209. package/src/utils/transform-styles/index.js +2 -2
  210. package/src/utils/use-should-contextual-toolbar-show.js +75 -0
  211. package/tsconfig.json +1 -0
  212. package/build/hooks/color-panel.native.js +0 -77
  213. package/build/hooks/color-panel.native.js.map +0 -1
  214. package/build-module/hooks/color-panel.native.js +0 -62
  215. package/build-module/hooks/color-panel.native.js.map +0 -1
  216. package/src/hooks/color-panel.native.js +0 -63
@@ -1,3 +1,4 @@
1
+ @charset "UTF-8";
1
2
  /**
2
3
  * Converts a hex value into the rgb equivalent.
3
4
  *
@@ -270,6 +271,44 @@
270
271
  /**
271
272
  * Block Toolbar when contextual.
272
273
  */
274
+ .block-editor-block-contextual-toolbar.is-fixed {
275
+ /* Set left position when auto-fold is not on the body element. */
276
+ left: 0;
277
+ }
278
+ @media (min-width: 783px) {
279
+ .block-editor-block-contextual-toolbar.is-fixed {
280
+ left: 160px;
281
+ }
282
+ }
283
+
284
+ .auto-fold .block-editor-block-contextual-toolbar.is-fixed {
285
+ /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
286
+ }
287
+ @media (min-width: 783px) {
288
+ .auto-fold .block-editor-block-contextual-toolbar.is-fixed {
289
+ left: 36px;
290
+ }
291
+ }
292
+ @media (min-width: 961px) {
293
+ .auto-fold .block-editor-block-contextual-toolbar.is-fixed {
294
+ left: 160px;
295
+ }
296
+ }
297
+
298
+ /* Sidebar manually collapsed. */
299
+ .folded .block-editor-block-contextual-toolbar.is-fixed {
300
+ left: 0;
301
+ }
302
+ @media (min-width: 783px) {
303
+ .folded .block-editor-block-contextual-toolbar.is-fixed {
304
+ left: 36px;
305
+ }
306
+ }
307
+
308
+ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
309
+ left: 0 !important;
310
+ }
311
+
273
312
  .block-editor-block-contextual-toolbar {
274
313
  display: inline-flex;
275
314
  border: 1px solid #1e1e1e;
@@ -283,10 +322,9 @@
283
322
  .block-editor-block-contextual-toolbar.is-fixed {
284
323
  position: sticky;
285
324
  top: 0;
286
- width: 100%;
287
325
  z-index: 31;
288
- min-height: 48px;
289
326
  display: block;
327
+ width: 100%;
290
328
  border: none;
291
329
  border-bottom: 1px solid #e0e0e0;
292
330
  border-radius: 0;
@@ -295,6 +333,119 @@
295
333
  .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar {
296
334
  border-right-color: #e0e0e0;
297
335
  }
336
+ @media (min-width: 782px) {
337
+ .block-editor-block-contextual-toolbar.is-fixed {
338
+ margin-left: 64px;
339
+ position: fixed;
340
+ top: 40px;
341
+ min-height: initial;
342
+ border-bottom: none;
343
+ display: flex;
344
+ }
345
+ .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
346
+ width: initial;
347
+ margin-left: 216px;
348
+ }
349
+ .is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed {
350
+ margin-left: 120px;
351
+ top: 8px;
352
+ }
353
+ .is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
354
+ width: initial;
355
+ margin-left: 280px;
356
+ }
357
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar {
358
+ border: none;
359
+ }
360
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-collapse-fixed-toolbar::after {
361
+ content: "";
362
+ width: 1px;
363
+ height: 24px;
364
+ margin-top: 12px;
365
+ margin-bottom: 12px;
366
+ background-color: #ddd;
367
+ position: absolute;
368
+ left: 44px;
369
+ top: -1px;
370
+ }
371
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar {
372
+ border: none;
373
+ }
374
+ .block-editor-block-contextual-toolbar.is-fixed > .block-editor-block-toolbar__group-expand-fixed-toolbar::before {
375
+ content: "";
376
+ width: 1px;
377
+ margin-top: 12px;
378
+ margin-bottom: 12px;
379
+ background-color: #ddd;
380
+ position: relative;
381
+ left: -12px;
382
+ height: 24px;
383
+ }
384
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed {
385
+ margin-left: 64px;
386
+ }
387
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
388
+ margin-left: 384px;
389
+ }
390
+ .is-fullscreen-mode .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed {
391
+ margin-left: 128px;
392
+ }
393
+ .is-fullscreen-mode .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed.is-collapsed {
394
+ margin-left: 448px;
395
+ }
396
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-parent-selector .block-editor-block-parent-selector__button::after {
397
+ left: 0;
398
+ }
399
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar__block-controls .block-editor-block-mover {
400
+ border-left: none;
401
+ }
402
+ .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar__block-controls .block-editor-block-mover::before {
403
+ content: "";
404
+ width: 1px;
405
+ margin-top: 12px;
406
+ margin-bottom: 12px;
407
+ background-color: #ddd;
408
+ position: relative;
409
+ }
410
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
411
+ position: relative;
412
+ top: -1px;
413
+ border: 0;
414
+ padding-right: 6px;
415
+ padding-left: 6px;
416
+ }
417
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-parent-selector .block-editor-block-parent-selector__button::after {
418
+ content: "·";
419
+ font-size: 16px;
420
+ line-height: 40px;
421
+ position: absolute;
422
+ left: 46px;
423
+ bottom: 4px;
424
+ }
425
+ .block-editor-block-contextual-toolbar:not(.is-fixed) .block-editor-block-parent-selector {
426
+ position: absolute;
427
+ top: -1px;
428
+ left: calc(-48px - 8px - 1px);
429
+ }
430
+ .show-icon-labels .block-editor-block-contextual-toolbar:not(.is-fixed) .block-editor-block-parent-selector {
431
+ position: relative;
432
+ left: auto;
433
+ top: auto;
434
+ margin-top: -1px;
435
+ margin-left: -1px;
436
+ margin-bottom: -1px;
437
+ }
438
+ }
439
+ @media (min-width: 782px) {
440
+ .block-editor-block-contextual-toolbar.is-fixed {
441
+ width: 100%;
442
+ }
443
+ }
444
+ @media (min-width: 960px) {
445
+ .block-editor-block-contextual-toolbar.is-fixed {
446
+ width: initial;
447
+ }
448
+ }
298
449
 
299
450
  /**
300
451
  * Block Label for Navigation/Selection Mode
@@ -660,10 +811,12 @@
660
811
  .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container > * {
661
812
  width: 24px;
662
813
  min-width: 0 !important;
663
- padding-left: 0 !important;
664
- padding-right: 0 !important;
665
814
  overflow: hidden;
666
815
  }
816
+ .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container .block-editor-block-mover-button {
817
+ padding-left: 0;
818
+ padding-right: 0;
819
+ }
667
820
  .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container .block-editor-block-mover-button.is-up-button svg {
668
821
  left: 5px;
669
822
  }
@@ -676,10 +829,12 @@
676
829
  .block-editor-block-mover__drag-handle {
677
830
  width: 24px;
678
831
  min-width: 0 !important;
679
- padding-left: 0 !important;
680
- padding-right: 0 !important;
681
832
  overflow: hidden;
682
833
  }
834
+ .block-editor-block-mover .block-editor-block-mover__drag-handle.has-icon.has-icon {
835
+ padding-left: 0;
836
+ padding-right: 0;
837
+ }
683
838
  }
684
839
 
685
840
  .components-button.block-editor-block-mover-button::before {
@@ -1444,15 +1599,18 @@
1444
1599
  width: 230px;
1445
1600
  }
1446
1601
 
1602
+ .block-editor-global-styles-filters-panel__dropdown,
1447
1603
  .block-editor-global-styles-effects-panel__shadow-dropdown {
1448
1604
  display: block;
1449
1605
  padding: 0;
1450
1606
  }
1451
- .block-editor-global-styles-effects-panel__shadow-dropdown > button {
1607
+ .block-editor-global-styles-filters-panel__dropdown button,
1608
+ .block-editor-global-styles-effects-panel__shadow-dropdown button {
1452
1609
  width: 100%;
1453
1610
  padding: 8px;
1454
1611
  }
1455
- .block-editor-global-styles-effects-panel__shadow-dropdown > button.is-open {
1612
+ .block-editor-global-styles-filters-panel__dropdown button.is-open,
1613
+ .block-editor-global-styles-effects-panel__shadow-dropdown button.is-open {
1456
1614
  background-color: #f0f0f0;
1457
1615
  }
1458
1616
 
@@ -2131,6 +2289,12 @@
2131
2289
  .block-editor-list-view-leaf {
2132
2290
  position: relative;
2133
2291
  }
2292
+ .block-editor-list-view-leaf .components-button[aria-expanded=true] {
2293
+ color: #1e1e1e;
2294
+ }
2295
+ .block-editor-list-view-leaf .components-button:hover {
2296
+ color: var(--wp-admin-theme-color);
2297
+ }
2134
2298
  .block-editor-list-view-leaf.is-selected td {
2135
2299
  background: var(--wp-admin-theme-color);
2136
2300
  }
@@ -2187,16 +2351,16 @@
2187
2351
  .block-editor-list-view-leaf.is-branch-selected.is-first-selected td:last-child {
2188
2352
  border-top-right-radius: 2px;
2189
2353
  }
2190
- .block-editor-list-view-leaf[aria-expanded=false].is-branch-selected.is-first-selected td:first-child {
2354
+ .block-editor-list-view-leaf[data-expanded=false].is-branch-selected.is-first-selected td:first-child {
2191
2355
  border-top-left-radius: 2px;
2192
2356
  }
2193
- .block-editor-list-view-leaf[aria-expanded=false].is-branch-selected.is-first-selected td:last-child {
2357
+ .block-editor-list-view-leaf[data-expanded=false].is-branch-selected.is-first-selected td:last-child {
2194
2358
  border-top-right-radius: 2px;
2195
2359
  }
2196
- .block-editor-list-view-leaf[aria-expanded=false].is-branch-selected.is-last-selected td:first-child {
2360
+ .block-editor-list-view-leaf[data-expanded=false].is-branch-selected.is-last-selected td:first-child {
2197
2361
  border-bottom-left-radius: 2px;
2198
2362
  }
2199
- .block-editor-list-view-leaf[aria-expanded=false].is-branch-selected.is-last-selected td:last-child {
2363
+ .block-editor-list-view-leaf[data-expanded=false].is-branch-selected.is-last-selected td:last-child {
2200
2364
  border-bottom-right-radius: 2px;
2201
2365
  }
2202
2366
  .block-editor-list-view-leaf.is-branch-selected:not(.is-selected) td {
@@ -2464,25 +2628,25 @@
2464
2628
  visibility: hidden;
2465
2629
  }
2466
2630
 
2467
- .block-editor-list-view-leaf[aria-expanded=true] .block-editor-list-view__expander svg {
2631
+ .block-editor-list-view-leaf[data-expanded=true] .block-editor-list-view__expander svg {
2468
2632
  visibility: visible;
2469
2633
  transition: transform 0.2s ease;
2470
2634
  transform: rotate(90deg);
2471
2635
  }
2472
2636
  @media (prefers-reduced-motion: reduce) {
2473
- .block-editor-list-view-leaf[aria-expanded=true] .block-editor-list-view__expander svg {
2637
+ .block-editor-list-view-leaf[data-expanded=true] .block-editor-list-view__expander svg {
2474
2638
  transition-duration: 0s;
2475
2639
  transition-delay: 0s;
2476
2640
  }
2477
2641
  }
2478
2642
 
2479
- .block-editor-list-view-leaf[aria-expanded=false] .block-editor-list-view__expander svg {
2643
+ .block-editor-list-view-leaf[data-expanded=false] .block-editor-list-view__expander svg {
2480
2644
  visibility: visible;
2481
2645
  transform: rotate(0deg);
2482
2646
  transition: transform 0.2s ease;
2483
2647
  }
2484
2648
  @media (prefers-reduced-motion: reduce) {
2485
- .block-editor-list-view-leaf[aria-expanded=false] .block-editor-list-view__expander svg {
2649
+ .block-editor-list-view-leaf[data-expanded=false] .block-editor-list-view__expander svg {
2486
2650
  transition-duration: 0s;
2487
2651
  transition-delay: 0s;
2488
2652
  }
@@ -3176,6 +3340,30 @@
3176
3340
  border-right: none;
3177
3341
  }
3178
3342
 
3343
+ @media (min-width: 782px) {
3344
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar-group,
3345
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar {
3346
+ border-right: none;
3347
+ }
3348
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar-group::after,
3349
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar::after {
3350
+ content: "";
3351
+ width: 1px;
3352
+ margin-top: 12px;
3353
+ margin-bottom: 12px;
3354
+ background-color: #ddd;
3355
+ margin-left: 8px;
3356
+ }
3357
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar-group .components-toolbar-group.components-toolbar-group::after,
3358
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar .components-toolbar-group.components-toolbar-group::after {
3359
+ display: none;
3360
+ }
3361
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar > :last-child::after,
3362
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar > :last-child .components-toolbar-group::after,
3363
+ .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar > :last-child .components-toolbar::after {
3364
+ display: none;
3365
+ }
3366
+ }
3179
3367
  .block-editor-block-contextual-toolbar.has-parent:not(.is-fixed) {
3180
3368
  margin-left: calc(48px + 8px);
3181
3369
  }
@@ -3183,20 +3371,6 @@
3183
3371
  margin-left: 0;
3184
3372
  }
3185
3373
 
3186
- .block-editor-block-parent-selector {
3187
- position: absolute;
3188
- top: -1px;
3189
- left: calc(-48px - 8px - 1px);
3190
- }
3191
- .show-icon-labels .block-editor-block-parent-selector {
3192
- position: relative;
3193
- left: auto;
3194
- top: auto;
3195
- margin-top: -1px;
3196
- margin-left: -1px;
3197
- margin-bottom: -1px;
3198
- }
3199
-
3200
3374
  .block-editor-block-toolbar__block-controls .block-editor-block-switcher .components-dropdown-menu__toggle .block-editor-block-icon,
3201
3375
  .block-editor-block-toolbar__block-controls .block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
3202
3376
  width: 24px !important;
@@ -3245,13 +3419,27 @@
3245
3419
  .show-icon-labels .block-editor-block-switcher__no-switcher-icon .block-editor-block-icon {
3246
3420
  width: 0 !important;
3247
3421
  height: 0 !important;
3422
+ min-width: 0 !important;
3423
+ }
3424
+ .show-icon-labels .block-editor-block-parent-selector__button {
3425
+ border-top-right-radius: 0;
3426
+ border-bottom-right-radius: 0;
3248
3427
  }
3249
3428
  .show-icon-labels .block-editor-block-parent-selector__button .block-editor-block-icon {
3250
3429
  width: 0;
3251
3430
  }
3252
- .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container {
3431
+ .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3253
3432
  width: auto;
3254
3433
  }
3434
+ .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,
3435
+ .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
3436
+ padding-left: 6px;
3437
+ padding-right: 6px;
3438
+ }
3439
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover-button {
3440
+ padding-left: 8px;
3441
+ padding-right: 8px;
3442
+ }
3255
3443
  .show-icon-labels .block-editor-block-toolbar__block-controls .block-editor-block-mover {
3256
3444
  border-left: 1px solid #1e1e1e;
3257
3445
  margin-left: 6px;
@@ -3261,13 +3449,9 @@
3261
3449
  .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar__block-controls .block-editor-block-mover {
3262
3450
  border-left-color: #e0e0e0;
3263
3451
  }
3264
- .show-icon-labels .block-editor-block-mover-button {
3265
- padding-left: 8px !important;
3266
- padding-right: 8px !important;
3267
- }
3268
- .show-icon-labels .block-editor-block-mover__drag-handle.has-icon {
3269
- padding-left: 12px !important;
3270
- padding-right: 12px !important;
3452
+ .show-icon-labels .block-editor-block-mover .block-editor-block-mover__drag-handle.has-icon {
3453
+ padding-left: 12px;
3454
+ padding-right: 12px;
3271
3455
  }
3272
3456
  .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-mover__move-button-container {
3273
3457
  border-width: 0;
@@ -3281,15 +3465,8 @@
3281
3465
  .show-icon-labels .block-editor-block-mover__move-button-container {
3282
3466
  border-left: 1px solid #1e1e1e;
3283
3467
  }
3284
- .show-icon-labels .block-editor-block-mover__move-button-container::before {
3285
- content: "";
3286
- display: block;
3287
- height: 1px;
3288
- background: #1e1e1e;
3289
- order: 2;
3290
- }
3291
3468
  .show-icon-labels .is-down-button.is-down-button.is-down-button {
3292
- order: 3;
3469
+ order: 2;
3293
3470
  }
3294
3471
  .show-icon-labels .block-editor-block-contextual-toolbar.is-fixed .block-editor-block-mover__move-button-container::before {
3295
3472
  background: #ddd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "11.8.0",
3
+ "version": "12.0.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -33,35 +33,35 @@
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.16.0",
35
35
  "@react-spring/web": "^9.4.5",
36
- "@wordpress/a11y": "^3.31.0",
37
- "@wordpress/api-fetch": "^6.28.0",
38
- "@wordpress/blob": "^3.31.0",
39
- "@wordpress/blocks": "^12.8.0",
40
- "@wordpress/components": "^23.8.0",
41
- "@wordpress/compose": "^6.8.0",
42
- "@wordpress/data": "^9.1.0",
43
- "@wordpress/date": "^4.31.0",
44
- "@wordpress/deprecated": "^3.31.0",
45
- "@wordpress/dom": "^3.31.0",
46
- "@wordpress/element": "^5.8.0",
47
- "@wordpress/escape-html": "^2.31.0",
48
- "@wordpress/hooks": "^3.31.0",
49
- "@wordpress/html-entities": "^3.31.0",
50
- "@wordpress/i18n": "^4.31.0",
51
- "@wordpress/icons": "^9.22.0",
52
- "@wordpress/is-shallow-equal": "^4.31.0",
53
- "@wordpress/keyboard-shortcuts": "^4.8.0",
54
- "@wordpress/keycodes": "^3.31.0",
55
- "@wordpress/notices": "^3.31.0",
56
- "@wordpress/preferences": "^3.8.0",
57
- "@wordpress/private-apis": "^0.13.0",
58
- "@wordpress/rich-text": "^6.8.0",
59
- "@wordpress/shortcode": "^3.31.0",
60
- "@wordpress/style-engine": "^1.14.0",
61
- "@wordpress/token-list": "^2.31.0",
62
- "@wordpress/url": "^3.32.0",
63
- "@wordpress/warning": "^2.31.0",
64
- "@wordpress/wordcount": "^3.31.0",
36
+ "@wordpress/a11y": "^3.32.0",
37
+ "@wordpress/api-fetch": "^6.29.0",
38
+ "@wordpress/blob": "^3.32.0",
39
+ "@wordpress/blocks": "^12.9.0",
40
+ "@wordpress/components": "^23.9.0",
41
+ "@wordpress/compose": "^6.9.0",
42
+ "@wordpress/data": "^9.2.0",
43
+ "@wordpress/date": "^4.32.0",
44
+ "@wordpress/deprecated": "^3.32.0",
45
+ "@wordpress/dom": "^3.32.0",
46
+ "@wordpress/element": "^5.9.0",
47
+ "@wordpress/escape-html": "^2.32.0",
48
+ "@wordpress/hooks": "^3.32.0",
49
+ "@wordpress/html-entities": "^3.32.0",
50
+ "@wordpress/i18n": "^4.32.0",
51
+ "@wordpress/icons": "^9.23.0",
52
+ "@wordpress/is-shallow-equal": "^4.32.0",
53
+ "@wordpress/keyboard-shortcuts": "^4.9.0",
54
+ "@wordpress/keycodes": "^3.32.0",
55
+ "@wordpress/notices": "^4.0.0",
56
+ "@wordpress/preferences": "^3.9.0",
57
+ "@wordpress/private-apis": "^0.14.0",
58
+ "@wordpress/rich-text": "^6.9.0",
59
+ "@wordpress/shortcode": "^3.32.0",
60
+ "@wordpress/style-engine": "^1.15.0",
61
+ "@wordpress/token-list": "^2.32.0",
62
+ "@wordpress/url": "^3.33.0",
63
+ "@wordpress/warning": "^2.32.0",
64
+ "@wordpress/wordcount": "^3.32.0",
65
65
  "change-case": "^4.1.2",
66
66
  "classnames": "^2.3.1",
67
67
  "colord": "^2.7.0",
@@ -72,7 +72,7 @@
72
72
  "lodash": "^4.17.21",
73
73
  "react-autosize-textarea": "^7.1.0",
74
74
  "react-easy-crop": "^4.5.1",
75
- "rememo": "^4.0.0",
75
+ "rememo": "^4.0.2",
76
76
  "remove-accents": "^0.4.2",
77
77
  "traverse": "^0.6.6"
78
78
  },
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "d61700b9f1c72ba0b030fc815ef1685b4f4031ec"
86
+ "gitHead": "6df0c62d43b8901414ccd22ffbe56eaa99d012a6"
87
87
  }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis as componentsPrivateApis } from '@wordpress/components';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { unlock } from '../../lock-unlock';
10
+ import useDisplayBlockControls from '../use-display-block-controls';
11
+
12
+ const { createPrivateSlotFill } = unlock( componentsPrivateApis );
13
+ const { Fill, Slot } = createPrivateSlotFill( 'BlockInformation' );
14
+
15
+ const BlockInfo = ( props ) => {
16
+ const isDisplayed = useDisplayBlockControls();
17
+ if ( ! isDisplayed ) {
18
+ return null;
19
+ }
20
+ return <Fill { ...props } />;
21
+ };
22
+ BlockInfo.Slot = ( props ) => <Slot { ...props } />;
23
+
24
+ export default BlockInfo;
@@ -37,6 +37,7 @@ import useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-c
37
37
  import AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';
38
38
  import PositionControls from '../inspector-controls-tabs/position-controls-panel';
39
39
  import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
40
+ import BlockInfo from '../block-info-slot-fill';
40
41
 
41
42
  function useContentBlocks( blockTypes, block ) {
42
43
  const contentBlocksObjectAux = useMemo( () => {
@@ -115,6 +116,7 @@ function BlockInspectorLockedBlocks( { topLevelLockedBlock } ) {
115
116
  className={ blockInformation.isSynced && 'is-synced' }
116
117
  />
117
118
  <BlockVariationTransforms blockClientId={ topLevelLockedBlock } />
119
+ <BlockInfo.Slot />
118
120
  <VStack
119
121
  spacing={ 1 }
120
122
  padding={ 4 }
@@ -326,6 +328,7 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
326
328
  className={ blockInformation.isSynced && 'is-synced' }
327
329
  />
328
330
  <BlockVariationTransforms blockClientId={ clientId } />
331
+ <BlockInfo.Slot />
329
332
  { showTabs && (
330
333
  <InspectorControlsTabs
331
334
  hasBlockStyles={ hasBlockStyles }
@@ -215,7 +215,7 @@ class BlockListBlock extends Component {
215
215
  order + 1
216
216
  );
217
217
  const { isFullWidth, isContainerRelated } = alignmentHelpers;
218
- const isFocused = isSelected || isInnerBlockSelected;
218
+ const accessible = ! ( isSelected || isInnerBlockSelected );
219
219
  const screenWidth = Math.floor( Dimensions.get( 'window' ).width );
220
220
  const isScreenWidthEqual = blockWidth === screenWidth;
221
221
  const isScreenWidthWider = blockWidth < screenWidth;
@@ -224,9 +224,8 @@ class BlockListBlock extends Component {
224
224
  return (
225
225
  <TouchableWithoutFeedback
226
226
  onPress={ this.onFocus }
227
- accessible={ ! isFocused }
227
+ accessible={ accessible }
228
228
  accessibilityRole={ 'button' }
229
- disabled={ isFocused }
230
229
  >
231
230
  <View
232
231
  style={ { flex: 1 } }
@@ -35,11 +35,14 @@
35
35
  }
36
36
 
37
37
  // Block multi selection
38
- .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) {
39
- // Apply a rounded radius to the entire block.
38
+ // Apply a rounded radius to the entire block when multi selected, but with low specificity
39
+ // so explicit radii set by tools are preserved.
40
+ &:where(.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)) {
40
41
  border-radius: $radius-block-ui;
41
42
  overflow: hidden;
43
+ }
42
44
 
45
+ .block-editor-block-list__block.is-multi-selected:not(.is-partially-selected) {
43
46
  // Hide the native selection indicator, for the selection, and children.
44
47
  &::selection,
45
48
  & ::selection {
@@ -68,24 +71,22 @@
68
71
  // Show outline in high contrast mode.
69
72
  outline: 2px solid transparent;
70
73
  }
74
+
75
+ // Don't show the highlight focus style when multi selected.
76
+ &.is-highlighted::after {
77
+ box-shadow: none;
78
+ }
71
79
  }
72
80
 
73
- // Block highlight, and navigation mode, not focus.
74
- // By not using a pseudo element, we can limit ourselves to only
75
- // using ::after, leaving ::before free. Otherwise, highlight + multi-select
76
- // would require the opacity-changing overlay to be on ::before.
81
+ // Block highlight, and navigation mode, and focus.
82
+ // This piece of code has gone back and forth between using a pseudo element
83
+ // vs. styling the block directly. Ultimately we likely need a pseudo element
84
+ // (unless styles like focus and selection overlay can be rendered as separate elements),
85
+ // since things like border-radius need to be able to be set on the block itself.
77
86
  .block-editor-block-list__block.is-highlighted,
78
87
  .block-editor-block-list__block.is-highlighted ~ .is-multi-selected,
79
88
  &.is-navigate-mode .block-editor-block-list__block.is-selected,
80
- & .is-block-moving-mode.block-editor-block-list__block.has-child-selected {
81
- border-radius: $radius-block-ui;
82
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
83
-
84
- // Show outline in high contrast mode.
85
- outline: 2px solid transparent;
86
- }
87
-
88
- // Block focus.
89
+ & .is-block-moving-mode.block-editor-block-list__block.has-child-selected,
89
90
  .block-editor-block-list__block:not([contenteditable]):focus {
90
91
  outline: none;
91
92