@wordpress/block-editor 12.21.0 → 12.22.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 (213) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-actions/index.js +2 -4
  3. package/build/components/block-actions/index.js.map +1 -1
  4. package/build/components/block-heading-level-dropdown/index.js +5 -5
  5. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  6. package/build/components/block-heading-level-dropdown/index.native.js +5 -4
  7. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  8. package/build/components/block-list/block-crash-boundary.native.js +49 -0
  9. package/build/components/block-list/block-crash-boundary.native.js.map +1 -0
  10. package/build/components/block-list/block-crash-warning.native.js +24 -0
  11. package/build/components/block-list/block-crash-warning.native.js.map +1 -0
  12. package/build/components/block-list/block.native.js +7 -2
  13. package/build/components/block-list/block.native.js.map +1 -1
  14. package/build/components/block-settings/container.native.js +2 -1
  15. package/build/components/block-settings/container.native.js.map +1 -1
  16. package/build/components/block-settings-menu/block-settings-dropdown.js +29 -29
  17. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  18. package/build/components/block-settings-menu-controls/index.js +1 -3
  19. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  20. package/build/components/block-toolbar/index.js +3 -1
  21. package/build/components/block-toolbar/index.js.map +1 -1
  22. package/build/components/block-toolbar/shuffle.js +1 -1
  23. package/build/components/block-toolbar/shuffle.js.map +1 -1
  24. package/build/components/child-layout-control/index.js +108 -11
  25. package/build/components/child-layout-control/index.js.map +1 -1
  26. package/build/components/convert-to-group-buttons/toolbar.js +11 -0
  27. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  28. package/build/components/global-styles/dimensions-panel.js +8 -33
  29. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  30. package/build/components/global-styles/use-global-styles-output.js +1 -1
  31. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  32. package/build/components/global-styles/utils.js +1 -3
  33. package/build/components/global-styles/utils.js.map +1 -1
  34. package/build/components/iframe/index.js +34 -30
  35. package/build/components/iframe/index.js.map +1 -1
  36. package/build/components/inserter/block-patterns-explorer/index.js +3 -6
  37. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  38. package/build/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
  39. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  40. package/build/components/inserter/menu.js +3 -9
  41. package/build/components/inserter/menu.js.map +1 -1
  42. package/build/components/inserter/mobile-tab-navigation.js +1 -1
  43. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  44. package/build/components/inserter/search-results.js +2 -3
  45. package/build/components/inserter/search-results.js.map +1 -1
  46. package/build/components/inserter/tabs.js +1 -2
  47. package/build/components/inserter/tabs.js.map +1 -1
  48. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js +36 -0
  49. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
  50. package/build/components/list-view/block-select-button.js +2 -12
  51. package/build/components/list-view/block-select-button.js.map +1 -1
  52. package/build/components/list-view/block.js +4 -11
  53. package/build/components/list-view/block.js.map +1 -1
  54. package/build/components/list-view/utils.js +5 -3
  55. package/build/components/list-view/utils.js.map +1 -1
  56. package/build/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  57. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  58. package/build/components/use-moving-animation/index.js +4 -0
  59. package/build/components/use-moving-animation/index.js.map +1 -1
  60. package/build/components/warning/index.native.js +9 -4
  61. package/build/components/warning/index.native.js.map +1 -1
  62. package/build/hooks/anchor.js +7 -8
  63. package/build/hooks/anchor.js.map +1 -1
  64. package/build/hooks/background.js +39 -2
  65. package/build/hooks/background.js.map +1 -1
  66. package/build/hooks/index.js +2 -1
  67. package/build/hooks/index.js.map +1 -1
  68. package/build/hooks/layout-child.js +28 -6
  69. package/build/hooks/layout-child.js.map +1 -1
  70. package/build/hooks/layout.js +21 -10
  71. package/build/hooks/layout.js.map +1 -1
  72. package/build/hooks/position.js +1 -1
  73. package/build/hooks/position.js.map +1 -1
  74. package/build/private-apis.native.js +3 -1
  75. package/build/private-apis.native.js.map +1 -1
  76. package/build/store/reducer.js +31 -26
  77. package/build/store/reducer.js.map +1 -1
  78. package/build-module/components/block-actions/index.js +2 -4
  79. package/build-module/components/block-actions/index.js.map +1 -1
  80. package/build-module/components/block-heading-level-dropdown/index.js +5 -5
  81. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  82. package/build-module/components/block-heading-level-dropdown/index.native.js +5 -4
  83. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  84. package/build-module/components/block-list/block-crash-boundary.native.js +42 -0
  85. package/build-module/components/block-list/block-crash-boundary.native.js.map +1 -0
  86. package/build-module/components/block-list/block-crash-warning.native.js +15 -0
  87. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -0
  88. package/build-module/components/block-list/block.native.js +7 -2
  89. package/build-module/components/block-list/block.native.js.map +1 -1
  90. package/build-module/components/block-settings/container.native.js +3 -2
  91. package/build-module/components/block-settings/container.native.js.map +1 -1
  92. package/build-module/components/block-settings-menu/block-settings-dropdown.js +30 -30
  93. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  94. package/build-module/components/block-settings-menu-controls/index.js +1 -3
  95. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  96. package/build-module/components/block-toolbar/index.js +3 -1
  97. package/build-module/components/block-toolbar/index.js.map +1 -1
  98. package/build-module/components/block-toolbar/shuffle.js +1 -1
  99. package/build-module/components/block-toolbar/shuffle.js.map +1 -1
  100. package/build-module/components/child-layout-control/index.js +109 -12
  101. package/build-module/components/child-layout-control/index.js.map +1 -1
  102. package/build-module/components/convert-to-group-buttons/toolbar.js +12 -1
  103. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  104. package/build-module/components/global-styles/dimensions-panel.js +9 -34
  105. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  106. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  107. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  108. package/build-module/components/global-styles/utils.js +0 -2
  109. package/build-module/components/global-styles/utils.js.map +1 -1
  110. package/build-module/components/iframe/index.js +34 -30
  111. package/build-module/components/iframe/index.js.map +1 -1
  112. package/build-module/components/inserter/block-patterns-explorer/index.js +3 -6
  113. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  114. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
  115. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  116. package/build-module/components/inserter/menu.js +3 -9
  117. package/build-module/components/inserter/menu.js.map +1 -1
  118. package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
  119. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  120. package/build-module/components/inserter/search-results.js +2 -3
  121. package/build-module/components/inserter/search-results.js.map +1 -1
  122. package/build-module/components/inserter/tabs.js +1 -2
  123. package/build-module/components/inserter/tabs.js.map +1 -1
  124. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js +28 -0
  125. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
  126. package/build-module/components/list-view/block-select-button.js +3 -13
  127. package/build-module/components/list-view/block-select-button.js.map +1 -1
  128. package/build-module/components/list-view/block.js +6 -13
  129. package/build-module/components/list-view/block.js.map +1 -1
  130. package/build-module/components/list-view/utils.js +2 -1
  131. package/build-module/components/list-view/utils.js.map +1 -1
  132. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  133. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  134. package/build-module/components/use-moving-animation/index.js +4 -0
  135. package/build-module/components/use-moving-animation/index.js.map +1 -1
  136. package/build-module/components/warning/index.native.js +9 -4
  137. package/build-module/components/warning/index.native.js.map +1 -1
  138. package/build-module/hooks/anchor.js +8 -9
  139. package/build-module/hooks/anchor.js.map +1 -1
  140. package/build-module/hooks/background.js +38 -1
  141. package/build-module/hooks/background.js.map +1 -1
  142. package/build-module/hooks/index.js +2 -1
  143. package/build-module/hooks/index.js.map +1 -1
  144. package/build-module/hooks/layout-child.js +28 -6
  145. package/build-module/hooks/layout-child.js.map +1 -1
  146. package/build-module/hooks/layout.js +21 -10
  147. package/build-module/hooks/layout.js.map +1 -1
  148. package/build-module/hooks/position.js +1 -1
  149. package/build-module/hooks/position.js.map +1 -1
  150. package/build-module/private-apis.native.js +3 -1
  151. package/build-module/private-apis.native.js.map +1 -1
  152. package/build-module/store/reducer.js +31 -26
  153. package/build-module/store/reducer.js.map +1 -1
  154. package/build-style/content-rtl.css +14 -0
  155. package/build-style/content.css +14 -0
  156. package/build-style/style-rtl.css +8 -20
  157. package/build-style/style.css +8 -20
  158. package/package.json +31 -31
  159. package/src/components/block-actions/index.js +2 -8
  160. package/src/components/block-bindings-toolbar-indicator/style.scss +10 -8
  161. package/src/components/block-heading-level-dropdown/README.md +5 -5
  162. package/src/components/block-heading-level-dropdown/index.js +5 -5
  163. package/src/components/block-heading-level-dropdown/index.native.js +5 -4
  164. package/src/components/block-list/block-crash-boundary.native.js +43 -0
  165. package/src/components/block-list/block-crash-warning.native.js +19 -0
  166. package/src/components/block-list/block.native.js +14 -7
  167. package/src/components/block-list/content.scss +16 -0
  168. package/src/components/block-settings/container.native.js +5 -1
  169. package/src/components/block-settings-menu/block-settings-dropdown.js +41 -56
  170. package/src/components/block-settings-menu-controls/README.md +0 -9
  171. package/src/components/block-settings-menu-controls/index.js +1 -6
  172. package/src/components/block-toolbar/index.js +3 -1
  173. package/src/components/block-toolbar/shuffle.js +1 -1
  174. package/src/components/block-toolbar/test/index.native.js +1 -7
  175. package/src/components/child-layout-control/index.js +147 -35
  176. package/src/components/convert-to-group-buttons/toolbar.js +13 -1
  177. package/src/components/global-styles/dimensions-panel.js +9 -34
  178. package/src/components/global-styles/test/use-global-styles-output.js +31 -0
  179. package/src/components/global-styles/use-global-styles-output.js +3 -1
  180. package/src/components/global-styles/utils.js +0 -18
  181. package/src/components/iframe/index.js +60 -44
  182. package/src/components/inserter/block-patterns-explorer/index.js +2 -9
  183. package/src/components/inserter/block-patterns-explorer/pattern-list.js +7 -1
  184. package/src/components/inserter/menu.js +4 -10
  185. package/src/components/inserter/mobile-tab-navigation.js +1 -1
  186. package/src/components/inserter/search-results.js +1 -2
  187. package/src/components/inserter/tabs.js +1 -2
  188. package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +31 -0
  189. package/src/components/link-control/style.scss +0 -5
  190. package/src/components/list-view/block-select-button.js +2 -18
  191. package/src/components/list-view/block.js +12 -21
  192. package/src/components/list-view/style.scss +34 -24
  193. package/src/components/list-view/utils.js +4 -1
  194. package/src/components/rich-text/README.md +6 -0
  195. package/src/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  196. package/src/components/use-moving-animation/index.js +1 -0
  197. package/src/components/warning/index.native.js +19 -15
  198. package/src/hooks/anchor.js +41 -61
  199. package/src/hooks/background.js +48 -3
  200. package/src/hooks/index.js +2 -0
  201. package/src/hooks/layout-child.js +44 -8
  202. package/src/hooks/layout.js +22 -18
  203. package/src/hooks/position.js +1 -1
  204. package/src/hooks/test/__snapshots__/anchor.native.js.snap +7 -0
  205. package/src/hooks/test/anchor.native.js +32 -0
  206. package/src/private-apis.native.js +2 -0
  207. package/src/store/reducer.js +41 -41
  208. package/tsconfig.json +1 -0
  209. package/build/utils/calculate-scale.js +0 -17
  210. package/build/utils/calculate-scale.js.map +0 -1
  211. package/build-module/utils/calculate-scale.js +0 -11
  212. package/build-module/utils/calculate-scale.js.map +0 -1
  213. package/src/utils/calculate-scale.js +0 -20
@@ -126,15 +126,15 @@
126
126
  .block-editor-block-bindings-toolbar-indicator {
127
127
  display: inline-flex;
128
128
  align-items: center;
129
- height: 48px;
129
+ justify-content: center;
130
130
  padding: 6px;
131
131
  }
132
- .block-editor-block-bindings-toolbar-indicator svg g {
133
- stroke: var(--wp-bound-block-color);
134
- fill: transparent;
135
- stroke-width: 1.5;
136
- stroke-linecap: round;
137
- stroke-linejoin: round;
132
+ .block-editor-block-bindings-toolbar-indicator svg {
133
+ fill: var(--wp-bound-block-color);
134
+ }
135
+
136
+ .edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-toolbar .block-editor-block-bindings-toolbar-indicator {
137
+ height: 32px;
138
138
  }
139
139
 
140
140
  iframe[name=editor-canvas] {
@@ -1934,10 +1934,6 @@ iframe[name=editor-canvas].has-editor-padding {
1934
1934
  left: 19px;
1935
1935
  top: 3px;
1936
1936
  }
1937
- .block-editor-link-control__search-enter svg {
1938
- position: relative;
1939
- top: -2px;
1940
- }
1941
1937
 
1942
1938
  .block-editor-link-control__search-actions {
1943
1939
  padding: 8px 16px 16px;
@@ -2361,7 +2357,7 @@ iframe[name=editor-canvas].has-editor-padding {
2361
2357
  }
2362
2358
  .block-editor-list-view-leaf.is-after-dragged-blocks.is-displacement-down {
2363
2359
  transition: transform 0.2s;
2364
- transform: translateY(calc(36px + var(--wp-admin--list-view-dragged-items-height, 36px) * -1));
2360
+ transform: translateY(calc(36px + var(--wp-admin--list-view-dragged-items-height, 36px) * -1));
2365
2361
  }
2366
2362
  @media (prefers-reduced-motion: reduce) {
2367
2363
  .block-editor-list-view-leaf.is-after-dragged-blocks.is-displacement-down {
@@ -2708,14 +2704,6 @@ iframe[name=editor-canvas].has-editor-padding {
2708
2704
  display: none;
2709
2705
  }
2710
2706
 
2711
- .block-editor-list-view-block-select-button__bindings svg g {
2712
- stroke: var(--wp-bound-block-color);
2713
- fill: transparent;
2714
- stroke-width: 1.5;
2715
- stroke-linecap: round;
2716
- stroke-linejoin: round;
2717
- }
2718
-
2719
2707
  .modal-open .block-editor-media-replace-flow__options {
2720
2708
  display: none;
2721
2709
  }
@@ -126,15 +126,15 @@
126
126
  .block-editor-block-bindings-toolbar-indicator {
127
127
  display: inline-flex;
128
128
  align-items: center;
129
- height: 48px;
129
+ justify-content: center;
130
130
  padding: 6px;
131
131
  }
132
- .block-editor-block-bindings-toolbar-indicator svg g {
133
- stroke: var(--wp-bound-block-color);
134
- fill: transparent;
135
- stroke-width: 1.5;
136
- stroke-linecap: round;
137
- stroke-linejoin: round;
132
+ .block-editor-block-bindings-toolbar-indicator svg {
133
+ fill: var(--wp-bound-block-color);
134
+ }
135
+
136
+ .edit-post-header__toolbar .selected-block-tools-wrapper .block-editor-block-toolbar .block-editor-block-bindings-toolbar-indicator {
137
+ height: 32px;
138
138
  }
139
139
 
140
140
  iframe[name=editor-canvas] {
@@ -1935,10 +1935,6 @@ iframe[name=editor-canvas].has-editor-padding {
1935
1935
  right: 19px;
1936
1936
  top: 3px;
1937
1937
  }
1938
- .block-editor-link-control__search-enter svg {
1939
- position: relative;
1940
- top: -2px;
1941
- }
1942
1938
 
1943
1939
  .block-editor-link-control__search-actions {
1944
1940
  padding: 8px 16px 16px;
@@ -2362,7 +2358,7 @@ iframe[name=editor-canvas].has-editor-padding {
2362
2358
  }
2363
2359
  .block-editor-list-view-leaf.is-after-dragged-blocks.is-displacement-down {
2364
2360
  transition: transform 0.2s;
2365
- transform: translateY(calc(36px + var(--wp-admin--list-view-dragged-items-height, 36px) * -1));
2361
+ transform: translateY(calc(36px + var(--wp-admin--list-view-dragged-items-height, 36px) * -1));
2366
2362
  }
2367
2363
  @media (prefers-reduced-motion: reduce) {
2368
2364
  .block-editor-list-view-leaf.is-after-dragged-blocks.is-displacement-down {
@@ -2709,14 +2705,6 @@ iframe[name=editor-canvas].has-editor-padding {
2709
2705
  display: none;
2710
2706
  }
2711
2707
 
2712
- .block-editor-list-view-block-select-button__bindings svg g {
2713
- stroke: var(--wp-bound-block-color);
2714
- fill: transparent;
2715
- stroke-width: 1.5;
2716
- stroke-linecap: round;
2717
- stroke-linejoin: round;
2718
- }
2719
-
2720
2708
  .modal-open .block-editor-media-replace-flow__options {
2721
2709
  display: none;
2722
2710
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "12.21.0",
3
+ "version": "12.22.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -35,35 +35,35 @@
35
35
  "@emotion/react": "^11.7.1",
36
36
  "@emotion/styled": "^11.6.0",
37
37
  "@react-spring/web": "^9.4.5",
38
- "@wordpress/a11y": "^3.53.0",
39
- "@wordpress/api-fetch": "^6.50.0",
40
- "@wordpress/blob": "^3.53.0",
41
- "@wordpress/blocks": "^12.30.0",
42
- "@wordpress/commands": "^0.24.0",
43
- "@wordpress/components": "^27.1.0",
44
- "@wordpress/compose": "^6.30.0",
45
- "@wordpress/data": "^9.23.0",
46
- "@wordpress/date": "^4.53.0",
47
- "@wordpress/deprecated": "^3.53.0",
48
- "@wordpress/dom": "^3.53.0",
49
- "@wordpress/element": "^5.30.0",
50
- "@wordpress/escape-html": "^2.53.0",
51
- "@wordpress/hooks": "^3.53.0",
52
- "@wordpress/html-entities": "^3.53.0",
53
- "@wordpress/i18n": "^4.53.0",
54
- "@wordpress/icons": "^9.44.0",
55
- "@wordpress/is-shallow-equal": "^4.53.0",
56
- "@wordpress/keyboard-shortcuts": "^4.30.0",
57
- "@wordpress/keycodes": "^3.53.0",
58
- "@wordpress/notices": "^4.21.0",
59
- "@wordpress/preferences": "^3.30.0",
60
- "@wordpress/private-apis": "^0.35.0",
61
- "@wordpress/rich-text": "^6.30.0",
62
- "@wordpress/style-engine": "^1.36.0",
63
- "@wordpress/token-list": "^2.53.0",
64
- "@wordpress/url": "^3.54.0",
65
- "@wordpress/warning": "^2.53.0",
66
- "@wordpress/wordcount": "^3.53.0",
38
+ "@wordpress/a11y": "^3.54.0",
39
+ "@wordpress/api-fetch": "^6.51.0",
40
+ "@wordpress/blob": "^3.54.0",
41
+ "@wordpress/blocks": "^12.31.0",
42
+ "@wordpress/commands": "^0.25.0",
43
+ "@wordpress/components": "^27.2.0",
44
+ "@wordpress/compose": "^6.31.0",
45
+ "@wordpress/data": "^9.24.0",
46
+ "@wordpress/date": "^4.54.0",
47
+ "@wordpress/deprecated": "^3.54.0",
48
+ "@wordpress/dom": "^3.54.0",
49
+ "@wordpress/element": "^5.31.0",
50
+ "@wordpress/escape-html": "^2.54.0",
51
+ "@wordpress/hooks": "^3.54.0",
52
+ "@wordpress/html-entities": "^3.54.0",
53
+ "@wordpress/i18n": "^4.54.0",
54
+ "@wordpress/icons": "^9.45.0",
55
+ "@wordpress/is-shallow-equal": "^4.54.0",
56
+ "@wordpress/keyboard-shortcuts": "^4.31.0",
57
+ "@wordpress/keycodes": "^3.54.0",
58
+ "@wordpress/notices": "^4.22.0",
59
+ "@wordpress/preferences": "^3.31.0",
60
+ "@wordpress/private-apis": "^0.36.0",
61
+ "@wordpress/rich-text": "^6.31.0",
62
+ "@wordpress/style-engine": "^1.37.0",
63
+ "@wordpress/token-list": "^2.54.0",
64
+ "@wordpress/url": "^3.55.0",
65
+ "@wordpress/warning": "^2.54.0",
66
+ "@wordpress/wordcount": "^3.54.0",
67
67
  "change-case": "^4.1.2",
68
68
  "classnames": "^2.3.1",
69
69
  "colord": "^2.7.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "ac3c3e465a083081a86a4da6ee6fb817b41e5130"
89
+ "gitHead": "ffc07735d0abfb3f69e91d48f25b7fe8d1ef92d2"
90
90
  }
@@ -98,16 +98,10 @@ export default function BlockActions( {
98
98
  return removeBlocks( clientIds, updateSelection );
99
99
  },
100
100
  onInsertBefore() {
101
- const clientId = Array.isArray( clientIds )
102
- ? clientIds[ 0 ]
103
- : clientId;
104
- insertBeforeBlock( clientId );
101
+ insertBeforeBlock( clientIds[ 0 ] );
105
102
  },
106
103
  onInsertAfter() {
107
- const clientId = Array.isArray( clientIds )
108
- ? clientIds[ clientIds.length - 1 ]
109
- : clientId;
110
- insertAfterBlock( clientId );
104
+ insertAfterBlock( clientIds[ clientIds.length - 1 ] );
111
105
  },
112
106
  onMoveTo() {
113
107
  setNavigationMode( true );
@@ -1,14 +1,16 @@
1
1
  .block-editor-block-bindings-toolbar-indicator {
2
2
  display: inline-flex;
3
3
  align-items: center;
4
- height: 48px;
4
+ justify-content: center;
5
5
  padding: 6px;
6
-
7
- svg g {
8
- stroke: var(--wp-bound-block-color);
9
- fill: transparent;
10
- stroke-width: 1.5;
11
- stroke-linecap: round;
12
- stroke-linejoin: round;
6
+ svg {
7
+ fill: var(--wp-bound-block-color);
13
8
  }
14
9
  }
10
+
11
+ .edit-post-header__toolbar
12
+ .selected-block-tools-wrapper
13
+ .block-editor-block-toolbar
14
+ .block-editor-block-bindings-toolbar-indicator {
15
+ height: 32px;
16
+ }
@@ -28,23 +28,23 @@ const MyHeadingLevelToolbar = () => (
28
28
 
29
29
  #### options
30
30
 
31
- The list of available HTML tags, passed from the block.
31
+ The list of available heading levels, passed from the block.
32
32
 
33
33
  - Type: `Object`
34
34
  - Required: no
35
35
 
36
36
  #### value
37
37
 
38
- The chosen HTML tag.
38
+ The chosen heading level.
39
39
 
40
- - Type: `string`
40
+ - Type: `number`
41
41
  - Required: no
42
42
 
43
43
  #### onChange
44
44
 
45
- Callback to run when toolbar value is changed.
45
+ Function called with the selected value changes.
46
46
 
47
- - Type: `string`
47
+ - Type: `() => number`
48
48
  - Required: yes
49
49
 
50
50
  ## Related components
@@ -22,10 +22,10 @@ const POPOVER_PROPS = {
22
22
  *
23
23
  * @typedef WPHeadingLevelDropdownProps
24
24
  *
25
- * @property {number} value The chosen heading level.
26
- * @property {number[]} options An array of supported heading levels.
27
- * @property {(newValue:number)=>any} onChange Callback to run when
28
- * toolbar value is changed.
25
+ * @property {number} value The chosen heading level.
26
+ * @property {number[]} options An array of supported heading levels.
27
+ * @property {()=>number} onChange Function called with
28
+ * the selected value changes.
29
29
  */
30
30
 
31
31
  /**
@@ -53,7 +53,7 @@ export default function HeadingLevelDropdown( {
53
53
  targetLevel === 0
54
54
  ? __( 'Paragraph' )
55
55
  : sprintf(
56
- // translators: %s: heading level e.g: "1", "2", "3"
56
+ // translators: %d: heading level e.g: "1", "2", "3"
57
57
  __( 'Heading %d' ),
58
58
  targetLevel
59
59
  ),
@@ -18,9 +18,10 @@ const HEADING_LEVELS = [ 1, 2, 3, 4, 5, 6 ];
18
18
  *
19
19
  * @typedef WPHeadingLevelDropdownProps
20
20
  *
21
- * @property {number} selectedLevel The chosen heading level.
22
- * @property {(newValue:number)=>any} onChange Callback to run when
23
- * toolbar value is changed.
21
+ * @property {number} value The chosen heading level.
22
+ * @property {number[]} options An array of supported heading levels.
23
+ * @property {()=>number} onChange Function called with
24
+ * the selected value changes.
24
25
  */
25
26
 
26
27
  /**
@@ -48,7 +49,7 @@ export default function HeadingLevelDropdown( {
48
49
  isPressed={ isActive }
49
50
  />
50
51
  ),
51
- // translators: %s: heading level e.g: "1", "2", "3"
52
+ // translators: %d: heading level e.g: "1", "2", "3"
52
53
  title: sprintf( __( 'Heading %d' ), targetLevel ),
53
54
  isActive,
54
55
  onClick: () => onChangeCallback( targetLevel ),
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Component } from '@wordpress/element';
5
+ import { logException } from '@wordpress/react-native-bridge';
6
+
7
+ class BlockCrashBoundary extends Component {
8
+ constructor() {
9
+ super( ...arguments );
10
+
11
+ this.state = {
12
+ error: null,
13
+ };
14
+ }
15
+
16
+ static getDerivedStateFromError( error ) {
17
+ return { error };
18
+ }
19
+
20
+ componentDidCatch( error ) {
21
+ const { blockName } = this.props;
22
+
23
+ logException( error, {
24
+ context: {
25
+ component_stack: error.componentStack,
26
+ block_name: blockName,
27
+ },
28
+ isHandled: true,
29
+ handledBy: 'Block-level Error Boundary',
30
+ } );
31
+ }
32
+
33
+ render() {
34
+ const { error } = this.state;
35
+ if ( ! error ) {
36
+ return this.props.children;
37
+ }
38
+
39
+ return this.props.fallback;
40
+ }
41
+ }
42
+
43
+ export default BlockCrashBoundary;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import Warning from '../warning';
10
+
11
+ const warning = (
12
+ <Warning
13
+ message={ __(
14
+ 'This block has encountered an error and cannot be previewed.'
15
+ ) }
16
+ />
17
+ );
18
+
19
+ export default () => warning;
@@ -49,6 +49,8 @@ import { useLayout } from './layout';
49
49
  import useScrollUponInsertion from './use-scroll-upon-insertion';
50
50
  import { useSettings } from '../use-settings';
51
51
  import { unlock } from '../../lock-unlock';
52
+ import BlockCrashBoundary from './block-crash-boundary';
53
+ import BlockCrashWarning from './block-crash-warning';
52
54
 
53
55
  const EMPTY_ARRAY = [];
54
56
 
@@ -139,14 +141,19 @@ function BlockWrapper( {
139
141
  isSelected={ isSelected }
140
142
  name={ name }
141
143
  />
142
- <BlockDraggable
143
- clientId={ clientId }
144
- draggingClientId={ draggingClientId }
145
- enabled={ draggingEnabled }
146
- testID="draggable-trigger-content"
144
+ <BlockCrashBoundary
145
+ blockName={ name }
146
+ fallback={ <BlockCrashWarning /> }
147
147
  >
148
- { children }
149
- </BlockDraggable>
148
+ <BlockDraggable
149
+ clientId={ clientId }
150
+ draggingClientId={ draggingClientId }
151
+ enabled={ draggingEnabled }
152
+ testID="draggable-trigger-content"
153
+ >
154
+ { children }
155
+ </BlockDraggable>
156
+ </BlockCrashBoundary>
150
157
  </Pressable>
151
158
  );
152
159
  }
@@ -360,6 +360,22 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
360
360
  z-index: z-index("{core/image aligned left or right} .wp-block");
361
361
  }
362
362
 
363
+ body.is-zoomed-out {
364
+ display: flex;
365
+ flex-direction: column;
366
+
367
+ > .is-root-container {
368
+ flex: 1;
369
+ display: flex;
370
+ flex-direction: column;
371
+ height: 100%;
372
+
373
+ > main {
374
+ flex: 1;
375
+ }
376
+ }
377
+ }
378
+
363
379
  .wp-site-blocks > [data-align="left"] {
364
380
  float: left;
365
381
  margin-right: 2em;
@@ -16,6 +16,7 @@ import styles from './container.native.scss';
16
16
  import InspectorControls from '../inspector-controls';
17
17
  import ImageLinkDestinationsScreen from '../image-link-destinations';
18
18
  import useMultipleOriginColorsAndGradients from '../colors-gradients/use-multiple-origin-colors-and-gradients';
19
+ import AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';
19
20
 
20
21
  export const blockSettingsScreens = {
21
22
  settings: 'Settings',
@@ -46,7 +47,10 @@ export default function BottomSheetSettings( props ) {
46
47
  <BottomSheet.NavigationScreen
47
48
  name={ blockSettingsScreens.settings }
48
49
  >
49
- <InspectorControls.Slot />
50
+ <>
51
+ <InspectorControls.Slot />
52
+ <AdvancedControls />
53
+ </>
50
54
  </BottomSheet.NavigationScreen>
51
55
  <BottomSheet.NavigationScreen
52
56
  name={ BottomSheet.SubSheet.screenName }
@@ -9,7 +9,7 @@ import {
9
9
  import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
10
10
  import { useDispatch, useSelect } from '@wordpress/data';
11
11
  import { moreVertical } from '@wordpress/icons';
12
- import { Children, cloneElement, useCallback } from '@wordpress/element';
12
+ import { Children, cloneElement } from '@wordpress/element';
13
13
  import { __ } from '@wordpress/i18n';
14
14
  import {
15
15
  store as keyboardShortcutsStore,
@@ -46,18 +46,14 @@ function CopyMenuItem( { clientIds, onCopy, label } ) {
46
46
  export function BlockSettingsDropdown( {
47
47
  block,
48
48
  clientIds,
49
- __experimentalSelectBlock,
50
49
  children,
51
- __unstableDisplayLocation,
50
+ __experimentalSelectBlock,
52
51
  ...props
53
52
  } ) {
54
53
  // Get the client id of the current block for this menu, if one is set.
55
54
  const currentClientId = block?.clientId;
56
- const blockClientIds = Array.isArray( clientIds )
57
- ? clientIds
58
- : [ clientIds ];
59
- const count = blockClientIds.length;
60
- const firstBlockClientId = blockClientIds[ 0 ];
55
+ const count = clientIds.length;
56
+ const firstBlockClientId = clientIds[ 0 ];
61
57
  const {
62
58
  firstParentClientId,
63
59
  onlyBlock,
@@ -127,41 +123,35 @@ export function BlockSettingsDropdown( {
127
123
  const isMatch = __unstableUseShortcutEventMatch();
128
124
  const hasSelectedBlocks = selectedBlockClientIds.length > 0;
129
125
 
130
- const updateSelectionAfterDuplicate = useCallback(
131
- async ( clientIdsPromise ) => {
132
- if ( __experimentalSelectBlock ) {
133
- const ids = await clientIdsPromise;
134
- if ( ids && ids[ 0 ] ) {
135
- __experimentalSelectBlock( ids[ 0 ], false );
136
- }
137
- }
138
- },
139
- [ __experimentalSelectBlock ]
140
- );
126
+ async function updateSelectionAfterDuplicate( clientIdsPromise ) {
127
+ if ( ! __experimentalSelectBlock ) {
128
+ return;
129
+ }
141
130
 
142
- const updateSelectionAfterRemove = useCallback( () => {
143
- if ( __experimentalSelectBlock ) {
144
- let blockToFocus = previousBlockClientId || firstParentClientId;
131
+ const ids = await clientIdsPromise;
132
+ if ( ids && ids[ 0 ] ) {
133
+ __experimentalSelectBlock( ids[ 0 ], false );
134
+ }
135
+ }
145
136
 
146
- // Focus the first block if there's no previous block nor parent block.
147
- if ( ! blockToFocus ) {
148
- blockToFocus = getBlockOrder()[ 0 ];
149
- }
137
+ function updateSelectionAfterRemove() {
138
+ if ( ! __experimentalSelectBlock ) {
139
+ return;
140
+ }
150
141
 
151
- // Only update the selection if the original selection is removed.
152
- const shouldUpdateSelection =
153
- hasSelectedBlocks && getSelectedBlockClientIds().length === 0;
142
+ let blockToFocus = previousBlockClientId || firstParentClientId;
154
143
 
155
- __experimentalSelectBlock( blockToFocus, shouldUpdateSelection );
144
+ // Focus the first block if there's no previous block nor parent block.
145
+ if ( ! blockToFocus ) {
146
+ blockToFocus = getBlockOrder()[ 0 ];
156
147
  }
157
- }, [
158
- __experimentalSelectBlock,
159
- previousBlockClientId,
160
- firstParentClientId,
161
- getBlockOrder,
162
- hasSelectedBlocks,
163
- getSelectedBlockClientIds,
164
- ] );
148
+
149
+ // Only update the selection if the original selection is removed.
150
+ const shouldUpdateSelection =
151
+ hasSelectedBlocks && getSelectedBlockClientIds().length === 0;
152
+
153
+ __experimentalSelectBlock( blockToFocus, shouldUpdateSelection );
154
+ }
165
155
 
166
156
  // This can occur when the selected block (the parent)
167
157
  // displays child blocks within a List View.
@@ -179,20 +169,17 @@ export function BlockSettingsDropdown( {
179
169
  ? undefined
180
170
  : openedBlockSettingsMenu === currentClientId || false;
181
171
 
182
- const onToggle = useCallback(
183
- ( localOpen ) => {
184
- if ( localOpen && openedBlockSettingsMenu !== currentClientId ) {
185
- setOpenedBlockSettingsMenu( currentClientId );
186
- } else if (
187
- ! localOpen &&
188
- openedBlockSettingsMenu &&
189
- openedBlockSettingsMenu === currentClientId
190
- ) {
191
- setOpenedBlockSettingsMenu( undefined );
192
- }
193
- },
194
- [ currentClientId, openedBlockSettingsMenu, setOpenedBlockSettingsMenu ]
195
- );
172
+ function onToggle( localOpen ) {
173
+ if ( localOpen && openedBlockSettingsMenu !== currentClientId ) {
174
+ setOpenedBlockSettingsMenu( currentClientId );
175
+ } else if (
176
+ ! localOpen &&
177
+ openedBlockSettingsMenu &&
178
+ openedBlockSettingsMenu === currentClientId
179
+ ) {
180
+ setOpenedBlockSettingsMenu( undefined );
181
+ }
182
+ }
196
183
 
197
184
  return (
198
185
  <BlockActions
@@ -233,7 +220,8 @@ export function BlockSettingsDropdown( {
233
220
  canRemove
234
221
  ) {
235
222
  event.preventDefault();
236
- updateSelectionAfterRemove( onRemove() );
223
+ onRemove();
224
+ updateSelectionAfterRemove();
237
225
  } else if (
238
226
  isMatch(
239
227
  'core/block-editor/duplicate',
@@ -349,9 +337,6 @@ export function BlockSettingsDropdown( {
349
337
  firstBlockClientId,
350
338
  } }
351
339
  clientIds={ clientIds }
352
- __unstableDisplayLocation={
353
- __unstableDisplayLocation
354
- }
355
340
  />
356
341
  { typeof children === 'function'
357
342
  ? children( { onClose } )
@@ -16,12 +16,3 @@ function ReusableBlocksMenuItems() {
16
16
  );
17
17
  }
18
18
  ```
19
-
20
- ## Props
21
-
22
- ### `__unstableDisplayLocation`
23
-
24
- - **Type:** `String`
25
- - **Default:** `undefined`
26
-
27
- A string representing the location where the component is being displayed within the UI. This can be used to conditionalize certain behaviors including the display of associated components. This behaviour will likely be refactored to a React.Context implementation.
@@ -26,11 +26,7 @@ import { BlockRenameControl, useBlockRename } from '../block-rename';
26
26
 
27
27
  const { Fill, Slot } = createSlotFill( 'BlockSettingsMenuControls' );
28
28
 
29
- const BlockSettingsMenuControlsSlot = ( {
30
- fillProps,
31
- clientIds = null,
32
- __unstableDisplayLocation,
33
- } ) => {
29
+ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
34
30
  const { selectedBlocks, selectedClientIds } = useSelect(
35
31
  ( select ) => {
36
32
  const { getBlockNamesByClientId, getSelectedBlockClientIds } =
@@ -61,7 +57,6 @@ const BlockSettingsMenuControlsSlot = ( {
61
57
  <Slot
62
58
  fillProps={ {
63
59
  ...fillProps,
64
- __unstableDisplayLocation,
65
60
  selectedBlocks,
66
61
  selectedClientIds,
67
62
  } }