@wordpress/block-editor 13.1.0 → 13.2.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 (142) hide show
  1. package/CHANGELOG.md +19 -17
  2. package/README.md +1 -1
  3. package/build/components/block-lock/modal.js +67 -67
  4. package/build/components/block-lock/modal.js.map +1 -1
  5. package/build/components/block-mover/index.js +12 -6
  6. package/build/components/block-mover/index.js.map +1 -1
  7. package/build/components/block-toolbar/shuffle.js +3 -1
  8. package/build/components/block-toolbar/shuffle.js.map +1 -1
  9. package/build/components/child-layout-control/index.js +185 -127
  10. package/build/components/child-layout-control/index.js.map +1 -1
  11. package/build/components/global-styles/use-global-styles-output.js +4 -3
  12. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  13. package/build/components/grid/grid-item-movers.js +97 -0
  14. package/build/components/grid/grid-item-movers.js.map +1 -0
  15. package/build/components/{grid-visualizer → grid}/grid-item-resizer.js +18 -56
  16. package/build/components/grid/grid-item-resizer.js.map +1 -0
  17. package/build/components/grid/grid-visualizer.js +225 -0
  18. package/build/components/grid/grid-visualizer.js.map +1 -0
  19. package/build/components/{grid-visualizer → grid}/index.js +14 -0
  20. package/build/components/grid/index.js.map +1 -0
  21. package/build/components/grid/use-get-number-of-blocks-before-cell.js +40 -0
  22. package/build/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
  23. package/build/components/grid/use-grid-layout-sync.js +162 -0
  24. package/build/components/grid/use-grid-layout-sync.js.map +1 -0
  25. package/build/components/grid/utils.js +145 -0
  26. package/build/components/grid/utils.js.map +1 -0
  27. package/build/components/image-editor/aspect-ratio-dropdown.js +0 -1
  28. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  29. package/build/components/inner-blocks/index.js +1 -1
  30. package/build/components/inner-blocks/index.js.map +1 -1
  31. package/build/components/rich-text/event-listeners/input-rules.js +1 -0
  32. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
  33. package/build/components/rich-text/index.native.js +10 -4
  34. package/build/components/rich-text/index.native.js.map +1 -1
  35. package/build/components/rich-text/native/index.native.js +14 -0
  36. package/build/components/rich-text/native/index.native.js.map +1 -1
  37. package/build/hooks/block-style-variation.js +26 -7
  38. package/build/hooks/block-style-variation.js.map +1 -1
  39. package/build/hooks/layout-child.js +29 -21
  40. package/build/hooks/layout-child.js.map +1 -1
  41. package/build/hooks/utils.js +3 -2
  42. package/build/hooks/utils.js.map +1 -1
  43. package/build/layouts/grid.js +24 -47
  44. package/build/layouts/grid.js.map +1 -1
  45. package/build/lock-unlock.js +1 -1
  46. package/build/lock-unlock.js.map +1 -1
  47. package/build/store/actions.js +17 -1
  48. package/build/store/actions.js.map +1 -1
  49. package/build-module/components/block-lock/modal.js +67 -67
  50. package/build-module/components/block-lock/modal.js.map +1 -1
  51. package/build-module/components/block-mover/index.js +12 -6
  52. package/build-module/components/block-mover/index.js.map +1 -1
  53. package/build-module/components/block-toolbar/shuffle.js +3 -1
  54. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  55. package/build-module/components/child-layout-control/index.js +185 -127
  56. package/build-module/components/child-layout-control/index.js.map +1 -1
  57. package/build-module/components/global-styles/use-global-styles-output.js +4 -3
  58. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  59. package/build-module/components/grid/grid-item-movers.js +90 -0
  60. package/build-module/components/grid/grid-item-movers.js.map +1 -0
  61. package/build-module/components/{grid-visualizer → grid}/grid-item-resizer.js +13 -51
  62. package/build-module/components/grid/grid-item-resizer.js.map +1 -0
  63. package/build-module/components/grid/grid-visualizer.js +217 -0
  64. package/build-module/components/grid/grid-visualizer.js.map +1 -0
  65. package/build-module/components/grid/index.js +5 -0
  66. package/build-module/components/grid/index.js.map +1 -0
  67. package/build-module/components/grid/use-get-number-of-blocks-before-cell.js +33 -0
  68. package/build-module/components/grid/use-get-number-of-blocks-before-cell.js.map +1 -0
  69. package/build-module/components/grid/use-grid-layout-sync.js +155 -0
  70. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -0
  71. package/build-module/components/grid/utils.js +131 -0
  72. package/build-module/components/grid/utils.js.map +1 -0
  73. package/build-module/components/image-editor/aspect-ratio-dropdown.js +0 -1
  74. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  75. package/build-module/components/inner-blocks/index.js +1 -1
  76. package/build-module/components/inner-blocks/index.js.map +1 -1
  77. package/build-module/components/rich-text/event-listeners/input-rules.js +1 -1
  78. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  79. package/build-module/components/rich-text/index.native.js +11 -5
  80. package/build-module/components/rich-text/index.native.js.map +1 -1
  81. package/build-module/components/rich-text/native/index.native.js +14 -0
  82. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  83. package/build-module/hooks/block-style-variation.js +25 -7
  84. package/build-module/hooks/block-style-variation.js.map +1 -1
  85. package/build-module/hooks/layout-child.js +27 -19
  86. package/build-module/hooks/layout-child.js.map +1 -1
  87. package/build-module/hooks/utils.js +3 -2
  88. package/build-module/hooks/utils.js.map +1 -1
  89. package/build-module/layouts/grid.js +24 -47
  90. package/build-module/layouts/grid.js.map +1 -1
  91. package/build-module/lock-unlock.js +1 -1
  92. package/build-module/lock-unlock.js.map +1 -1
  93. package/build-module/store/actions.js +17 -1
  94. package/build-module/store/actions.js.map +1 -1
  95. package/build-style/style-rtl.css +39 -18
  96. package/build-style/style.css +39 -18
  97. package/package.json +31 -31
  98. package/src/components/block-lock/modal.js +95 -82
  99. package/src/components/block-lock/style.scss +11 -1
  100. package/src/components/block-mover/index.js +37 -24
  101. package/src/components/block-toolbar/shuffle.js +3 -1
  102. package/src/components/child-layout-control/index.js +224 -159
  103. package/src/components/global-styles/test/use-global-styles-output.js +38 -3
  104. package/src/components/global-styles/use-global-styles-output.js +4 -3
  105. package/src/components/grid/grid-item-movers.js +128 -0
  106. package/src/components/{grid-visualizer → grid}/grid-item-resizer.js +14 -52
  107. package/src/components/grid/grid-visualizer.js +267 -0
  108. package/src/components/grid/index.js +4 -0
  109. package/src/components/grid/style.scss +63 -0
  110. package/src/components/grid/use-get-number-of-blocks-before-cell.js +30 -0
  111. package/src/components/grid/use-grid-layout-sync.js +167 -0
  112. package/src/components/grid/utils.js +178 -0
  113. package/src/components/image-editor/aspect-ratio-dropdown.js +0 -1
  114. package/src/components/inner-blocks/index.js +3 -1
  115. package/src/components/rich-text/event-listeners/input-rules.js +1 -1
  116. package/src/components/rich-text/index.native.js +10 -8
  117. package/src/components/rich-text/native/index.native.js +17 -0
  118. package/src/hooks/block-style-variation.js +24 -6
  119. package/src/hooks/layout-child.js +34 -14
  120. package/src/hooks/utils.js +3 -1
  121. package/src/layouts/grid.js +54 -62
  122. package/src/lock-unlock.js +1 -1
  123. package/src/store/actions.js +21 -1
  124. package/src/style.scss +1 -1
  125. package/build/components/grid-visualizer/grid-item-resizer.js.map +0 -1
  126. package/build/components/grid-visualizer/grid-visualizer.js +0 -92
  127. package/build/components/grid-visualizer/grid-visualizer.js.map +0 -1
  128. package/build/components/grid-visualizer/index.js.map +0 -1
  129. package/build/components/grid-visualizer/utils.js +0 -10
  130. package/build/components/grid-visualizer/utils.js.map +0 -1
  131. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +0 -1
  132. package/build-module/components/grid-visualizer/grid-visualizer.js +0 -84
  133. package/build-module/components/grid-visualizer/grid-visualizer.js.map +0 -1
  134. package/build-module/components/grid-visualizer/index.js +0 -3
  135. package/build-module/components/grid-visualizer/index.js.map +0 -1
  136. package/build-module/components/grid-visualizer/utils.js +0 -4
  137. package/build-module/components/grid-visualizer/utils.js.map +0 -1
  138. package/src/components/grid-visualizer/grid-visualizer.js +0 -101
  139. package/src/components/grid-visualizer/index.js +0 -2
  140. package/src/components/grid-visualizer/style.scss +0 -34
  141. package/src/components/grid-visualizer/utils.js +0 -5
  142. /package/src/components/font-sizes/{README.MD → README.md} +0 -0
@@ -416,14 +416,22 @@ iframe[name=editor-canvas] {
416
416
  }
417
417
  }
418
418
 
419
+ .block-editor-block-lock-modal__options {
420
+ margin-top: 16px;
421
+ }
422
+ .block-editor-block-lock-modal__options legend {
423
+ margin-bottom: 16px;
424
+ padding: 0;
425
+ }
426
+
419
427
  .block-editor-block-lock-modal__checklist {
420
428
  margin: 0;
421
429
  }
422
430
 
423
- .block-editor-block-lock-modal__options-title {
431
+ .block-editor-block-lock-modal__options-all {
424
432
  padding: 12px 0;
425
433
  }
426
- .block-editor-block-lock-modal__options-title .components-checkbox-control__label {
434
+ .block-editor-block-lock-modal__options-all .components-checkbox-control__label {
427
435
  font-weight: 600;
428
436
  }
429
437
 
@@ -1662,36 +1670,50 @@ iframe[name=editor-canvas] {
1662
1670
  box-sizing: inherit;
1663
1671
  }
1664
1672
 
1665
- .block-editor-grid-visualizer {
1666
- z-index: 30 !important;
1673
+ .block-editor-grid-visualizer.block-editor-grid-visualizer.block-editor-grid-visualizer {
1674
+ z-index: 30;
1667
1675
  }
1668
-
1669
- .block-editor-grid-visualizer .components-popover__content * {
1670
- pointer-events: none !important;
1676
+ .block-editor-grid-visualizer.block-editor-grid-visualizer.block-editor-grid-visualizer .components-popover__content * {
1677
+ pointer-events: none;
1678
+ }
1679
+ .block-editor-grid-visualizer.block-editor-grid-visualizer.block-editor-grid-visualizer.is-dropping-allowed .block-editor-grid-visualizer__drop-zone {
1680
+ pointer-events: all;
1671
1681
  }
1672
1682
 
1673
1683
  .block-editor-grid-visualizer__grid {
1674
1684
  display: grid;
1675
1685
  }
1676
1686
 
1677
- .block-editor-grid-visualizer__item {
1678
- outline: 1px solid transparent;
1679
- border-radius: 2px;
1687
+ .block-editor-grid-visualizer__cell {
1688
+ align-items: center;
1689
+ display: flex;
1690
+ justify-content: center;
1680
1691
  }
1681
1692
 
1682
- .block-editor-grid-item-resizer {
1683
- z-index: 30 !important;
1693
+ .block-editor-grid-visualizer__drop-zone {
1694
+ background: rgba(204, 204, 204, 0.1);
1695
+ border: 1px dotted #ddd;
1696
+ width: 100%;
1697
+ height: 100%;
1698
+ min-width: 8px;
1699
+ min-height: 8px;
1700
+ }
1701
+ .block-editor-grid-visualizer__drop-zone.is-highlighted {
1702
+ background: var(--wp-admin-theme-color);
1684
1703
  }
1685
1704
 
1686
- .block-editor-grid-item-resizer .components-popover__content * {
1687
- pointer-events: none !important;
1705
+ .block-editor-grid-item-resizer.block-editor-grid-item-resizer.block-editor-grid-item-resizer {
1706
+ z-index: 30;
1707
+ }
1708
+ .block-editor-grid-item-resizer.block-editor-grid-item-resizer.block-editor-grid-item-resizer .components-popover__content * {
1709
+ pointer-events: none;
1688
1710
  }
1689
1711
 
1690
1712
  .block-editor-grid-item-resizer__box {
1691
1713
  border: 1px solid var(--wp-admin-theme-color);
1692
1714
  }
1693
- .block-editor-grid-item-resizer__box .components-resizable-box__handle {
1694
- pointer-events: all !important;
1715
+ .block-editor-grid-item-resizer__box .components-resizable-box__handle.components-resizable-box__handle.components-resizable-box__handle {
1716
+ pointer-events: all;
1695
1717
  }
1696
1718
 
1697
1719
  .block-editor-height-control {
@@ -2887,8 +2909,7 @@ iframe[name=editor-canvas] {
2887
2909
  .block-editor-responsive-block-control .components-base-control__help {
2888
2910
  border: 0;
2889
2911
  clip: rect(1px, 1px, 1px, 1px);
2890
- -webkit-clip-path: inset(50%);
2891
- clip-path: inset(50%);
2912
+ clip-path: inset(50%);
2892
2913
  height: 1px;
2893
2914
  margin: -1px;
2894
2915
  overflow: hidden;
@@ -416,14 +416,22 @@ iframe[name=editor-canvas] {
416
416
  }
417
417
  }
418
418
 
419
+ .block-editor-block-lock-modal__options {
420
+ margin-top: 16px;
421
+ }
422
+ .block-editor-block-lock-modal__options legend {
423
+ margin-bottom: 16px;
424
+ padding: 0;
425
+ }
426
+
419
427
  .block-editor-block-lock-modal__checklist {
420
428
  margin: 0;
421
429
  }
422
430
 
423
- .block-editor-block-lock-modal__options-title {
431
+ .block-editor-block-lock-modal__options-all {
424
432
  padding: 12px 0;
425
433
  }
426
- .block-editor-block-lock-modal__options-title .components-checkbox-control__label {
434
+ .block-editor-block-lock-modal__options-all .components-checkbox-control__label {
427
435
  font-weight: 600;
428
436
  }
429
437
 
@@ -1663,36 +1671,50 @@ iframe[name=editor-canvas] {
1663
1671
  box-sizing: inherit;
1664
1672
  }
1665
1673
 
1666
- .block-editor-grid-visualizer {
1667
- z-index: 30 !important;
1674
+ .block-editor-grid-visualizer.block-editor-grid-visualizer.block-editor-grid-visualizer {
1675
+ z-index: 30;
1668
1676
  }
1669
-
1670
- .block-editor-grid-visualizer .components-popover__content * {
1671
- pointer-events: none !important;
1677
+ .block-editor-grid-visualizer.block-editor-grid-visualizer.block-editor-grid-visualizer .components-popover__content * {
1678
+ pointer-events: none;
1679
+ }
1680
+ .block-editor-grid-visualizer.block-editor-grid-visualizer.block-editor-grid-visualizer.is-dropping-allowed .block-editor-grid-visualizer__drop-zone {
1681
+ pointer-events: all;
1672
1682
  }
1673
1683
 
1674
1684
  .block-editor-grid-visualizer__grid {
1675
1685
  display: grid;
1676
1686
  }
1677
1687
 
1678
- .block-editor-grid-visualizer__item {
1679
- outline: 1px solid transparent;
1680
- border-radius: 2px;
1688
+ .block-editor-grid-visualizer__cell {
1689
+ align-items: center;
1690
+ display: flex;
1691
+ justify-content: center;
1681
1692
  }
1682
1693
 
1683
- .block-editor-grid-item-resizer {
1684
- z-index: 30 !important;
1694
+ .block-editor-grid-visualizer__drop-zone {
1695
+ background: rgba(204, 204, 204, 0.1);
1696
+ border: 1px dotted #ddd;
1697
+ width: 100%;
1698
+ height: 100%;
1699
+ min-width: 8px;
1700
+ min-height: 8px;
1701
+ }
1702
+ .block-editor-grid-visualizer__drop-zone.is-highlighted {
1703
+ background: var(--wp-admin-theme-color);
1685
1704
  }
1686
1705
 
1687
- .block-editor-grid-item-resizer .components-popover__content * {
1688
- pointer-events: none !important;
1706
+ .block-editor-grid-item-resizer.block-editor-grid-item-resizer.block-editor-grid-item-resizer {
1707
+ z-index: 30;
1708
+ }
1709
+ .block-editor-grid-item-resizer.block-editor-grid-item-resizer.block-editor-grid-item-resizer .components-popover__content * {
1710
+ pointer-events: none;
1689
1711
  }
1690
1712
 
1691
1713
  .block-editor-grid-item-resizer__box {
1692
1714
  border: 1px solid var(--wp-admin-theme-color);
1693
1715
  }
1694
- .block-editor-grid-item-resizer__box .components-resizable-box__handle {
1695
- pointer-events: all !important;
1716
+ .block-editor-grid-item-resizer__box .components-resizable-box__handle.components-resizable-box__handle.components-resizable-box__handle {
1717
+ pointer-events: all;
1696
1718
  }
1697
1719
 
1698
1720
  .block-editor-height-control {
@@ -2888,8 +2910,7 @@ iframe[name=editor-canvas] {
2888
2910
  .block-editor-responsive-block-control .components-base-control__help {
2889
2911
  border: 0;
2890
2912
  clip: rect(1px, 1px, 1px, 1px);
2891
- -webkit-clip-path: inset(50%);
2892
- clip-path: inset(50%);
2913
+ clip-path: inset(50%);
2893
2914
  height: 1px;
2894
2915
  margin: -1px;
2895
2916
  overflow: hidden;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "13.1.0",
3
+ "version": "13.2.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -36,35 +36,35 @@
36
36
  "@emotion/react": "^11.7.1",
37
37
  "@emotion/styled": "^11.6.0",
38
38
  "@react-spring/web": "^9.4.5",
39
- "@wordpress/a11y": "^4.1.0",
40
- "@wordpress/api-fetch": "^7.1.0",
41
- "@wordpress/blob": "^4.1.0",
42
- "@wordpress/blocks": "^13.1.0",
43
- "@wordpress/commands": "^1.1.0",
44
- "@wordpress/components": "^28.1.0",
45
- "@wordpress/compose": "^7.1.0",
46
- "@wordpress/data": "^10.1.0",
47
- "@wordpress/date": "^5.1.0",
48
- "@wordpress/deprecated": "^4.1.0",
49
- "@wordpress/dom": "^4.1.0",
50
- "@wordpress/element": "^6.1.0",
51
- "@wordpress/escape-html": "^3.1.0",
52
- "@wordpress/hooks": "^4.1.0",
53
- "@wordpress/html-entities": "^4.1.0",
54
- "@wordpress/i18n": "^5.1.0",
55
- "@wordpress/icons": "^10.1.0",
56
- "@wordpress/is-shallow-equal": "^5.1.0",
57
- "@wordpress/keyboard-shortcuts": "^5.1.0",
58
- "@wordpress/keycodes": "^4.1.0",
59
- "@wordpress/notices": "^5.1.0",
60
- "@wordpress/preferences": "^4.1.0",
61
- "@wordpress/private-apis": "^1.1.0",
62
- "@wordpress/rich-text": "^7.1.0",
63
- "@wordpress/style-engine": "^2.1.0",
64
- "@wordpress/token-list": "^3.1.0",
65
- "@wordpress/url": "^4.1.0",
66
- "@wordpress/warning": "^3.1.0",
67
- "@wordpress/wordcount": "^4.1.0",
39
+ "@wordpress/a11y": "^4.2.0",
40
+ "@wordpress/api-fetch": "^7.2.0",
41
+ "@wordpress/blob": "^4.2.0",
42
+ "@wordpress/blocks": "^13.2.0",
43
+ "@wordpress/commands": "^1.2.0",
44
+ "@wordpress/components": "^28.2.0",
45
+ "@wordpress/compose": "^7.2.0",
46
+ "@wordpress/data": "^10.2.0",
47
+ "@wordpress/date": "^5.2.0",
48
+ "@wordpress/deprecated": "^4.2.0",
49
+ "@wordpress/dom": "^4.2.0",
50
+ "@wordpress/element": "^6.2.0",
51
+ "@wordpress/escape-html": "^3.2.0",
52
+ "@wordpress/hooks": "^4.2.0",
53
+ "@wordpress/html-entities": "^4.2.0",
54
+ "@wordpress/i18n": "^5.2.0",
55
+ "@wordpress/icons": "^10.2.0",
56
+ "@wordpress/is-shallow-equal": "^5.2.0",
57
+ "@wordpress/keyboard-shortcuts": "^5.2.0",
58
+ "@wordpress/keycodes": "^4.2.0",
59
+ "@wordpress/notices": "^5.2.0",
60
+ "@wordpress/preferences": "^4.2.0",
61
+ "@wordpress/private-apis": "^1.2.0",
62
+ "@wordpress/rich-text": "^7.2.0",
63
+ "@wordpress/style-engine": "^2.2.0",
64
+ "@wordpress/token-list": "^3.2.0",
65
+ "@wordpress/url": "^4.2.0",
66
+ "@wordpress/warning": "^3.2.0",
67
+ "@wordpress/wordcount": "^4.2.0",
68
68
  "change-case": "^4.1.2",
69
69
  "clsx": "^2.1.1",
70
70
  "colord": "^2.7.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "66d3bf12e67d16deddc4b4a9ec42e1d0bed3479a"
89
+ "gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
90
90
  }
@@ -13,7 +13,6 @@ import {
13
13
  ToggleControl,
14
14
  } from '@wordpress/components';
15
15
  import { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';
16
- import { useInstanceId } from '@wordpress/compose';
17
16
  import { useDispatch, useSelect } from '@wordpress/data';
18
17
  import { getBlockType } from '@wordpress/blocks';
19
18
 
@@ -64,10 +63,6 @@ export default function BlockLockModal( { clientId, onClose } ) {
64
63
  );
65
64
  const { updateBlockAttributes } = useDispatch( blockEditorStore );
66
65
  const blockInformation = useBlockDisplayInformation( clientId );
67
- const instanceId = useInstanceId(
68
- BlockLockModal,
69
- 'block-editor-block-lock-modal__options-title'
70
- );
71
66
 
72
67
  useEffect( () => {
73
68
  setLock( {
@@ -90,11 +85,6 @@ export default function BlockLockModal( { clientId, onClose } ) {
90
85
  overlayClassName="block-editor-block-lock-modal"
91
86
  onRequestClose={ onClose }
92
87
  >
93
- <p>
94
- { __(
95
- 'Choose specific attributes to restrict or lock all available options.'
96
- ) }
97
- </p>
98
88
  <form
99
89
  onSubmit={ ( event ) => {
100
90
  event.preventDefault();
@@ -107,84 +97,107 @@ export default function BlockLockModal( { clientId, onClose } ) {
107
97
  onClose();
108
98
  } }
109
99
  >
110
- <div
111
- role="group"
112
- aria-labelledby={ instanceId }
113
- className="block-editor-block-lock-modal__options"
114
- >
115
- <CheckboxControl
116
- __nextHasNoMarginBottom
117
- className="block-editor-block-lock-modal__options-title"
118
- label={
119
- <span id={ instanceId }>{ __( 'Lock all' ) }</span>
120
- }
121
- checked={ isAllChecked }
122
- indeterminate={ isMixed }
123
- onChange={ ( newValue ) =>
124
- setLock( {
125
- move: newValue,
126
- remove: newValue,
127
- ...( allowsEditLocking
128
- ? { edit: newValue }
129
- : {} ),
130
- } )
131
- }
132
- />
133
- <ul className="block-editor-block-lock-modal__checklist">
134
- { allowsEditLocking && (
135
- <li className="block-editor-block-lock-modal__checklist-item">
136
- <CheckboxControl
137
- __nextHasNoMarginBottom
138
- label={ __( 'Restrict editing' ) }
139
- checked={ !! lock.edit }
140
- onChange={ ( edit ) =>
141
- setLock( ( prevLock ) => ( {
142
- ...prevLock,
143
- edit,
144
- } ) )
145
- }
146
- />
147
- <Icon
148
- className="block-editor-block-lock-modal__lock-icon"
149
- icon={ lock.edit ? lockIcon : unlockIcon }
150
- />
151
- </li>
100
+ <fieldset className="block-editor-block-lock-modal__options">
101
+ <legend>
102
+ { __(
103
+ 'Choose specific attributes to restrict or lock all available options.'
152
104
  ) }
153
- <li className="block-editor-block-lock-modal__checklist-item">
105
+ </legend>
106
+ { /*
107
+ * Disable reason: The `list` ARIA role is redundant but
108
+ * Safari+VoiceOver won't announce the list otherwise.
109
+ */
110
+ /* eslint-disable jsx-a11y/no-redundant-roles */ }
111
+ <ul
112
+ role="list"
113
+ className="block-editor-block-lock-modal__checklist"
114
+ >
115
+ <li>
154
116
  <CheckboxControl
155
117
  __nextHasNoMarginBottom
156
- label={ __( 'Disable movement' ) }
157
- checked={ lock.move }
158
- onChange={ ( move ) =>
159
- setLock( ( prevLock ) => ( {
160
- ...prevLock,
161
- move,
162
- } ) )
118
+ className="block-editor-block-lock-modal__options-all"
119
+ label={ __( 'Lock all' ) }
120
+ checked={ isAllChecked }
121
+ indeterminate={ isMixed }
122
+ onChange={ ( newValue ) =>
123
+ setLock( {
124
+ move: newValue,
125
+ remove: newValue,
126
+ ...( allowsEditLocking
127
+ ? { edit: newValue }
128
+ : {} ),
129
+ } )
163
130
  }
164
131
  />
165
- <Icon
166
- className="block-editor-block-lock-modal__lock-icon"
167
- icon={ lock.move ? lockIcon : unlockIcon }
168
- />
169
- </li>
170
- <li className="block-editor-block-lock-modal__checklist-item">
171
- <CheckboxControl
172
- __nextHasNoMarginBottom
173
- label={ __( 'Prevent removal' ) }
174
- checked={ lock.remove }
175
- onChange={ ( remove ) =>
176
- setLock( ( prevLock ) => ( {
177
- ...prevLock,
178
- remove,
179
- } ) )
180
- }
181
- />
182
- <Icon
183
- className="block-editor-block-lock-modal__lock-icon"
184
- icon={ lock.remove ? lockIcon : unlockIcon }
185
- />
132
+ <ul
133
+ role="list"
134
+ className="block-editor-block-lock-modal__checklist"
135
+ >
136
+ { allowsEditLocking && (
137
+ <li className="block-editor-block-lock-modal__checklist-item">
138
+ <CheckboxControl
139
+ __nextHasNoMarginBottom
140
+ label={ __( 'Restrict editing' ) }
141
+ checked={ !! lock.edit }
142
+ onChange={ ( edit ) =>
143
+ setLock( ( prevLock ) => ( {
144
+ ...prevLock,
145
+ edit,
146
+ } ) )
147
+ }
148
+ />
149
+ <Icon
150
+ className="block-editor-block-lock-modal__lock-icon"
151
+ icon={
152
+ lock.edit
153
+ ? lockIcon
154
+ : unlockIcon
155
+ }
156
+ />
157
+ </li>
158
+ ) }
159
+ <li className="block-editor-block-lock-modal__checklist-item">
160
+ <CheckboxControl
161
+ __nextHasNoMarginBottom
162
+ label={ __( 'Disable movement' ) }
163
+ checked={ lock.move }
164
+ onChange={ ( move ) =>
165
+ setLock( ( prevLock ) => ( {
166
+ ...prevLock,
167
+ move,
168
+ } ) )
169
+ }
170
+ />
171
+ <Icon
172
+ className="block-editor-block-lock-modal__lock-icon"
173
+ icon={
174
+ lock.move ? lockIcon : unlockIcon
175
+ }
176
+ />
177
+ </li>
178
+ <li className="block-editor-block-lock-modal__checklist-item">
179
+ <CheckboxControl
180
+ __nextHasNoMarginBottom
181
+ label={ __( 'Prevent removal' ) }
182
+ checked={ lock.remove }
183
+ onChange={ ( remove ) =>
184
+ setLock( ( prevLock ) => ( {
185
+ ...prevLock,
186
+ remove,
187
+ } ) )
188
+ }
189
+ />
190
+ <Icon
191
+ className="block-editor-block-lock-modal__lock-icon"
192
+ icon={
193
+ lock.remove ? lockIcon : unlockIcon
194
+ }
195
+ />
196
+ </li>
197
+ </ul>
186
198
  </li>
187
199
  </ul>
200
+ { /* eslint-enable jsx-a11y/no-redundant-roles */ }
188
201
  { hasTemplateLock && (
189
202
  <ToggleControl
190
203
  __nextHasNoMarginBottom
@@ -197,7 +210,7 @@ export default function BlockLockModal( { clientId, onClose } ) {
197
210
  }
198
211
  />
199
212
  ) }
200
- </div>
213
+ </fieldset>
201
214
  <Flex
202
215
  className="block-editor-block-lock-modal__actions"
203
216
  justify="flex-end"
@@ -8,17 +8,27 @@
8
8
  }
9
9
  }
10
10
 
11
+ .block-editor-block-lock-modal__options {
12
+ margin-top: $grid-unit-20;
13
+
14
+ legend {
15
+ margin-bottom: $grid-unit-20;
16
+ padding: 0;
17
+ }
18
+ }
19
+
11
20
  .block-editor-block-lock-modal__checklist {
12
21
  margin: 0;
13
22
  }
14
23
 
15
- .block-editor-block-lock-modal__options-title {
24
+ .block-editor-block-lock-modal__options-all {
16
25
  padding: $grid-unit-15 0;
17
26
 
18
27
  .components-checkbox-control__label {
19
28
  font-weight: 600;
20
29
  }
21
30
  }
31
+
22
32
  .block-editor-block-lock-modal__checklist-item {
23
33
  display: flex;
24
34
  justify-content: space-between;
@@ -25,7 +25,14 @@ function BlockMover( {
25
25
  isBlockMoverUpButtonDisabled,
26
26
  isBlockMoverDownButtonDisabled,
27
27
  } ) {
28
- const { canMove, rootClientId, isFirst, isLast, orientation } = useSelect(
28
+ const {
29
+ canMove,
30
+ rootClientId,
31
+ isFirst,
32
+ isLast,
33
+ orientation,
34
+ isManualGrid,
35
+ } = useSelect(
29
36
  ( select ) => {
30
37
  const {
31
38
  getBlockIndex,
@@ -33,6 +40,7 @@ function BlockMover( {
33
40
  canMoveBlocks,
34
41
  getBlockOrder,
35
42
  getBlockRootClientId,
43
+ getBlockAttributes,
36
44
  } = select( blockEditorStore );
37
45
  const normalizedClientIds = Array.isArray( clientIds )
38
46
  ? clientIds
@@ -44,6 +52,7 @@ function BlockMover( {
44
52
  normalizedClientIds[ normalizedClientIds.length - 1 ]
45
53
  );
46
54
  const blockOrder = getBlockOrder( _rootClientId );
55
+ const { layout = {} } = getBlockAttributes( _rootClientId ) ?? {};
47
56
 
48
57
  return {
49
58
  canMove: canMoveBlocks( clientIds ),
@@ -51,6 +60,10 @@ function BlockMover( {
51
60
  isFirst: firstIndex === 0,
52
61
  isLast: lastIndex === blockOrder.length - 1,
53
62
  orientation: getBlockListSettings( _rootClientId )?.orientation,
63
+ isManualGrid:
64
+ layout.type === 'grid' &&
65
+ !! layout.columnCount &&
66
+ window.__experimentalEnableGridInteractivity,
54
67
  };
55
68
  },
56
69
  [ clientIds ]
@@ -60,8 +73,6 @@ function BlockMover( {
60
73
  return null;
61
74
  }
62
75
 
63
- const dragHandleLabel = __( 'Drag' );
64
-
65
76
  return (
66
77
  <ToolbarGroup
67
78
  className={ clsx( 'block-editor-block-mover', {
@@ -75,7 +86,7 @@ function BlockMover( {
75
86
  icon={ dragHandle }
76
87
  className="block-editor-block-mover__drag-handle"
77
88
  aria-hidden="true"
78
- label={ dragHandleLabel }
89
+ label={ __( 'Drag' ) }
79
90
  // Should not be able to tab to drag handle as this
80
91
  // button can only be used with a pointer device.
81
92
  tabIndex="-1"
@@ -84,26 +95,28 @@ function BlockMover( {
84
95
  ) }
85
96
  </BlockDraggable>
86
97
  ) }
87
- <div className="block-editor-block-mover__move-button-container">
88
- <ToolbarItem>
89
- { ( itemProps ) => (
90
- <BlockMoverUpButton
91
- disabled={ isBlockMoverUpButtonDisabled }
92
- clientIds={ clientIds }
93
- { ...itemProps }
94
- />
95
- ) }
96
- </ToolbarItem>
97
- <ToolbarItem>
98
- { ( itemProps ) => (
99
- <BlockMoverDownButton
100
- disabled={ isBlockMoverDownButtonDisabled }
101
- clientIds={ clientIds }
102
- { ...itemProps }
103
- />
104
- ) }
105
- </ToolbarItem>
106
- </div>
98
+ { ! isManualGrid && (
99
+ <div className="block-editor-block-mover__move-button-container">
100
+ <ToolbarItem>
101
+ { ( itemProps ) => (
102
+ <BlockMoverUpButton
103
+ disabled={ isBlockMoverUpButtonDisabled }
104
+ clientIds={ clientIds }
105
+ { ...itemProps }
106
+ />
107
+ ) }
108
+ </ToolbarItem>
109
+ <ToolbarItem>
110
+ { ( itemProps ) => (
111
+ <BlockMoverDownButton
112
+ disabled={ isBlockMoverDownButtonDisabled }
113
+ clientIds={ clientIds }
114
+ { ...itemProps }
115
+ />
116
+ ) }
117
+ </ToolbarItem>
118
+ </div>
119
+ ) }
107
120
  </ToolbarGroup>
108
121
  );
109
122
  }
@@ -60,7 +60,9 @@ export default function Shuffle( { clientId, as = Container } ) {
60
60
  pattern.blocks.length === 1 &&
61
61
  pattern.categories?.some( ( category ) => {
62
62
  return categories.includes( category );
63
- } )
63
+ } ) &&
64
+ // Check if the pattern is not a synced pattern.
65
+ ( pattern.syncStatus === 'unsynced' || ! pattern.id )
64
66
  );
65
67
  } );
66
68
  }, [ categories, patterns ] );