@wordpress/block-editor 15.8.1-next.16d95556a.0 → 15.8.1-next.dc3f6d3c1.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 (169) hide show
  1. package/build/components/block-inspector/edit-contents.js +19 -23
  2. package/build/components/block-inspector/edit-contents.js.map +3 -3
  3. package/build/components/block-inspector/index.js +7 -1
  4. package/build/components/block-inspector/index.js.map +2 -2
  5. package/build/components/block-list/block.js +4 -0
  6. package/build/components/block-list/block.js.map +2 -2
  7. package/build/components/block-list/use-block-props/index.js +3 -1
  8. package/build/components/block-list/use-block-props/index.js.map +2 -2
  9. package/build/components/block-list/use-block-props/use-is-hovered.js +16 -10
  10. package/build/components/block-list/use-block-props/use-is-hovered.js.map +2 -2
  11. package/build/components/block-settings-menu-controls/edit-section-menu-item.js +64 -0
  12. package/build/components/block-settings-menu-controls/edit-section-menu-item.js.map +7 -0
  13. package/build/components/block-settings-menu-controls/index.js +8 -0
  14. package/build/components/block-settings-menu-controls/index.js.map +2 -2
  15. package/build/components/block-toolbar/block-toolbar-icon.js +9 -9
  16. package/build/components/block-toolbar/block-toolbar-icon.js.map +2 -2
  17. package/build/components/block-variation-transforms/index.js +32 -5
  18. package/build/components/block-variation-transforms/index.js.map +2 -2
  19. package/build/components/border-radius-control/single-input-control.js +1 -0
  20. package/build/components/border-radius-control/single-input-control.js.map +2 -2
  21. package/build/components/content-only-controls/index.js +263 -0
  22. package/build/components/content-only-controls/index.js.map +7 -0
  23. package/build/components/content-only-controls/link/index.js +204 -0
  24. package/build/components/content-only-controls/link/index.js.map +7 -0
  25. package/build/components/content-only-controls/media/index.js +264 -0
  26. package/build/components/content-only-controls/media/index.js.map +7 -0
  27. package/build/components/content-only-controls/plain-text/index.js +68 -0
  28. package/build/components/content-only-controls/plain-text/index.js.map +7 -0
  29. package/build/components/content-only-controls/rich-text/index.js +197 -0
  30. package/build/components/content-only-controls/rich-text/index.js.map +7 -0
  31. package/build/components/content-only-controls/use-inspector-popover-placement.js +41 -0
  32. package/build/components/content-only-controls/use-inspector-popover-placement.js.map +7 -0
  33. package/build/components/inserter/media-tab/media-tab.js +1 -33
  34. package/build/components/inserter/media-tab/media-tab.js.map +3 -3
  35. package/build/components/inspector-controls-tabs/content-tab.js +6 -2
  36. package/build/components/inspector-controls-tabs/content-tab.js.map +3 -3
  37. package/build/components/inspector-controls-tabs/index.js +7 -1
  38. package/build/components/inspector-controls-tabs/index.js.map +2 -2
  39. package/build/components/list-view/block-select-button.js +11 -4
  40. package/build/components/list-view/block-select-button.js.map +2 -2
  41. package/build/components/media-placeholder/index.js +1 -31
  42. package/build/components/media-placeholder/index.js.map +3 -3
  43. package/build/components/media-replace-flow/index.js +4 -30
  44. package/build/components/media-replace-flow/index.js.map +3 -3
  45. package/build/components/use-block-display-information/index.js +21 -1
  46. package/build/components/use-block-display-information/index.js.map +3 -3
  47. package/build/hooks/block-bindings.js +52 -61
  48. package/build/hooks/block-bindings.js.map +3 -3
  49. package/build/hooks/use-content-only-section-edit.js +67 -0
  50. package/build/hooks/use-content-only-section-edit.js.map +7 -0
  51. package/build/layouts/constrained.js +2 -2
  52. package/build/layouts/constrained.js.map +2 -2
  53. package/build/private-apis.js +2 -3
  54. package/build/private-apis.js.map +3 -3
  55. package/build/store/private-keys.js +3 -0
  56. package/build/store/private-keys.js.map +2 -2
  57. package/build/store/private-selectors.js +1 -2
  58. package/build/store/private-selectors.js.map +2 -2
  59. package/build/store/reducer.js +1 -2
  60. package/build/store/reducer.js.map +2 -2
  61. package/build/utils/fit-text-utils.js +9 -1
  62. package/build/utils/fit-text-utils.js.map +2 -2
  63. package/build-module/components/block-inspector/edit-contents.js +9 -23
  64. package/build-module/components/block-inspector/edit-contents.js.map +2 -2
  65. package/build-module/components/block-inspector/index.js +7 -1
  66. package/build-module/components/block-inspector/index.js.map +2 -2
  67. package/build-module/components/block-list/block.js +4 -0
  68. package/build-module/components/block-list/block.js.map +2 -2
  69. package/build-module/components/block-list/use-block-props/index.js +3 -1
  70. package/build-module/components/block-list/use-block-props/index.js.map +2 -2
  71. package/build-module/components/block-list/use-block-props/use-is-hovered.js +16 -10
  72. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +2 -2
  73. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js +29 -0
  74. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js.map +7 -0
  75. package/build-module/components/block-settings-menu-controls/index.js +8 -0
  76. package/build-module/components/block-settings-menu-controls/index.js.map +2 -2
  77. package/build-module/components/block-toolbar/block-toolbar-icon.js +10 -10
  78. package/build-module/components/block-toolbar/block-toolbar-icon.js.map +2 -2
  79. package/build-module/components/block-variation-transforms/index.js +32 -5
  80. package/build-module/components/block-variation-transforms/index.js.map +2 -2
  81. package/build-module/components/border-radius-control/single-input-control.js +1 -0
  82. package/build-module/components/border-radius-control/single-input-control.js.map +2 -2
  83. package/build-module/components/content-only-controls/index.js +237 -0
  84. package/build-module/components/content-only-controls/index.js.map +7 -0
  85. package/build-module/components/content-only-controls/link/index.js +172 -0
  86. package/build-module/components/content-only-controls/link/index.js.map +7 -0
  87. package/build-module/components/content-only-controls/media/index.js +243 -0
  88. package/build-module/components/content-only-controls/media/index.js.map +7 -0
  89. package/build-module/components/content-only-controls/plain-text/index.js +50 -0
  90. package/build-module/components/content-only-controls/plain-text/index.js.map +7 -0
  91. package/build-module/components/content-only-controls/rich-text/index.js +174 -0
  92. package/build-module/components/content-only-controls/rich-text/index.js.map +7 -0
  93. package/build-module/components/content-only-controls/use-inspector-popover-placement.js +16 -0
  94. package/build-module/components/content-only-controls/use-inspector-popover-placement.js.map +7 -0
  95. package/build-module/components/inserter/media-tab/media-tab.js +2 -34
  96. package/build-module/components/inserter/media-tab/media-tab.js.map +2 -2
  97. package/build-module/components/inspector-controls-tabs/content-tab.js +7 -3
  98. package/build-module/components/inspector-controls-tabs/content-tab.js.map +2 -2
  99. package/build-module/components/inspector-controls-tabs/index.js +7 -1
  100. package/build-module/components/inspector-controls-tabs/index.js.map +2 -2
  101. package/build-module/components/list-view/block-select-button.js +18 -5
  102. package/build-module/components/list-view/block-select-button.js.map +2 -2
  103. package/build-module/components/media-placeholder/index.js +1 -31
  104. package/build-module/components/media-placeholder/index.js.map +2 -2
  105. package/build-module/components/media-replace-flow/index.js +4 -30
  106. package/build-module/components/media-replace-flow/index.js.map +2 -2
  107. package/build-module/components/use-block-display-information/index.js +21 -1
  108. package/build-module/components/use-block-display-information/index.js.map +3 -3
  109. package/build-module/hooks/block-bindings.js +57 -62
  110. package/build-module/hooks/block-bindings.js.map +2 -2
  111. package/build-module/hooks/use-content-only-section-edit.js +46 -0
  112. package/build-module/hooks/use-content-only-section-edit.js.map +7 -0
  113. package/build-module/layouts/constrained.js +2 -2
  114. package/build-module/layouts/constrained.js.map +2 -2
  115. package/build-module/private-apis.js +3 -3
  116. package/build-module/private-apis.js.map +2 -2
  117. package/build-module/store/private-keys.js +2 -0
  118. package/build-module/store/private-keys.js.map +2 -2
  119. package/build-module/store/private-selectors.js +1 -2
  120. package/build-module/store/private-selectors.js.map +2 -2
  121. package/build-module/store/reducer.js +1 -2
  122. package/build-module/store/reducer.js.map +2 -2
  123. package/build-module/utils/fit-text-utils.js +9 -1
  124. package/build-module/utils/fit-text-utils.js.map +2 -2
  125. package/build-style/style-rtl.css +132 -0
  126. package/build-style/style.css +132 -0
  127. package/package.json +37 -37
  128. package/src/components/block-inspector/edit-contents.js +10 -29
  129. package/src/components/block-inspector/index.js +4 -2
  130. package/src/components/block-list/block.js +6 -0
  131. package/src/components/block-list/use-block-props/index.js +3 -1
  132. package/src/components/block-list/use-block-props/use-is-hovered.js +24 -12
  133. package/src/components/block-settings-menu-controls/edit-section-menu-item.js +39 -0
  134. package/src/components/block-settings-menu-controls/index.js +7 -0
  135. package/src/components/block-toolbar/block-toolbar-icon.js +14 -10
  136. package/src/components/block-variation-transforms/index.js +96 -35
  137. package/src/components/border-radius-control/single-input-control.js +1 -0
  138. package/src/components/content-only-controls/index.js +296 -0
  139. package/src/components/content-only-controls/link/index.js +195 -0
  140. package/src/components/content-only-controls/link/styles.scss +23 -0
  141. package/src/components/content-only-controls/media/index.js +285 -0
  142. package/src/components/content-only-controls/media/styles.scss +47 -0
  143. package/src/components/content-only-controls/plain-text/index.js +49 -0
  144. package/src/components/content-only-controls/rich-text/index.js +193 -0
  145. package/src/components/content-only-controls/rich-text/styles.scss +24 -0
  146. package/src/components/content-only-controls/styles.scss +35 -0
  147. package/src/components/content-only-controls/use-inspector-popover-placement.js +19 -0
  148. package/src/components/inserter/media-tab/media-tab.js +2 -44
  149. package/src/components/inspector-controls-tabs/content-tab.js +12 -4
  150. package/src/components/inspector-controls-tabs/index.js +4 -1
  151. package/src/components/list-view/block-select-button.js +37 -24
  152. package/src/components/media-placeholder/index.js +1 -41
  153. package/src/components/media-replace-flow/index.js +3 -39
  154. package/src/components/use-block-display-information/index.js +30 -2
  155. package/src/hooks/block-bindings.js +71 -82
  156. package/src/hooks/use-content-only-section-edit.js +63 -0
  157. package/src/layouts/constrained.js +8 -2
  158. package/src/private-apis.js +2 -2
  159. package/src/store/private-keys.js +1 -0
  160. package/src/store/private-selectors.js +1 -2
  161. package/src/store/reducer.js +0 -3
  162. package/src/store/test/reducer.js +7 -17
  163. package/src/style.scss +1 -0
  164. package/src/utils/fit-text-utils.js +19 -1
  165. package/build/components/media-upload-modal/index.js +0 -29
  166. package/build/components/media-upload-modal/index.js.map +0 -7
  167. package/build-module/components/media-upload-modal/index.js +0 -8
  168. package/build-module/components/media-upload-modal/index.js.map +0 -7
  169. package/src/components/media-upload-modal/index.js +0 -18
@@ -4,10 +4,17 @@ function findOptimalFontSize(textElement, applyFontSize) {
4
4
  let minSize = 5;
5
5
  let maxSize = 2400;
6
6
  let bestSize = minSize;
7
+ const computedStyle = window.getComputedStyle(textElement);
8
+ const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
9
+ const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
10
+ const range = document.createRange();
11
+ range.selectNodeContents(textElement);
7
12
  while (minSize <= maxSize) {
8
13
  const midSize = Math.floor((minSize + maxSize) / 2);
9
14
  applyFontSize(midSize);
10
- const fitsWidth = textElement.scrollWidth <= textElement.clientWidth;
15
+ const rect = range.getBoundingClientRect();
16
+ const textWidth = rect.width;
17
+ const fitsWidth = textElement.scrollWidth <= textElement.clientWidth && textWidth <= textElement.clientWidth - paddingLeft - paddingRight;
11
18
  const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= textElement.clientHeight;
12
19
  if (fitsWidth && fitsHeight) {
13
20
  bestSize = midSize;
@@ -16,6 +23,7 @@ function findOptimalFontSize(textElement, applyFontSize) {
16
23
  maxSize = midSize - 1;
17
24
  }
18
25
  }
26
+ range.detach();
19
27
  return bestSize;
20
28
  }
21
29
  function optimizeFitText(textElement, applyFontSize) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/fit-text-utils.js"],
4
- "sourcesContent": ["/**\n * Shared utility functions for fit text functionality.\n * Uses callback-based approach for maximum code reuse between editor and frontend.\n */\n\n/**\n * Find optimal font size using simple binary search between 5-600px.\n *\n * @param {HTMLElement} textElement The text element\n * @param {Function} applyFontSize Function that receives font size in pixels\n * @return {number} Optimal font size\n */\nfunction findOptimalFontSize( textElement, applyFontSize ) {\n\tconst alreadyHasScrollableHeight =\n\t\ttextElement.scrollHeight > textElement.clientHeight;\n\tlet minSize = 5;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\twhile ( minSize <= maxSize ) {\n\t\tconst midSize = Math.floor( ( minSize + maxSize ) / 2 );\n\t\tapplyFontSize( midSize );\n\n\t\tconst fitsWidth = textElement.scrollWidth <= textElement.clientWidth;\n\t\tconst fitsHeight =\n\t\t\talreadyHasScrollableHeight ||\n\t\t\ttextElement.scrollHeight <= textElement.clientHeight;\n\n\t\tif ( fitsWidth && fitsHeight ) {\n\t\t\tbestSize = midSize;\n\t\t\tminSize = midSize + 1;\n\t\t} else {\n\t\t\tmaxSize = midSize - 1;\n\t\t}\n\t}\n\n\treturn bestSize;\n}\n\n/**\n * Complete fit text optimization for a single text element.\n * Handles the full flow using callbacks for font size application.\n *\n * @param {HTMLElement} textElement The text element (paragraph, heading, etc.)\n * @param {Function} applyFontSize Function that receives font size in pixels (0 to clear, >0 to apply)\n */\nexport function optimizeFitText( textElement, applyFontSize ) {\n\tif ( ! textElement ) {\n\t\treturn;\n\t}\n\n\tapplyFontSize( 0 );\n\n\tconst optimalSize = findOptimalFontSize( textElement, applyFontSize );\n\n\tapplyFontSize( optimalSize );\n\treturn optimalSize;\n}\n"],
5
- "mappings": ";AAYA,SAAS,oBAAqB,aAAa,eAAgB;AAC1D,QAAM,6BACL,YAAY,eAAe,YAAY;AACxC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AAEf,SAAQ,WAAW,SAAU;AAC5B,UAAM,UAAU,KAAK,OAAS,UAAU,WAAY,CAAE;AACtD,kBAAe,OAAQ;AAEvB,UAAM,YAAY,YAAY,eAAe,YAAY;AACzD,UAAM,aACL,8BACA,YAAY,gBAAgB,YAAY;AAEzC,QAAK,aAAa,YAAa;AAC9B,iBAAW;AACX,gBAAU,UAAU;AAAA,IACrB,OAAO;AACN,gBAAU,UAAU;AAAA,IACrB;AAAA,EACD;AAEA,SAAO;AACR;AASO,SAAS,gBAAiB,aAAa,eAAgB;AAC7D,MAAK,CAAE,aAAc;AACpB;AAAA,EACD;AAEA,gBAAe,CAAE;AAEjB,QAAM,cAAc,oBAAqB,aAAa,aAAc;AAEpE,gBAAe,WAAY;AAC3B,SAAO;AACR;",
4
+ "sourcesContent": ["/**\n * Shared utility functions for fit text functionality.\n * Uses callback-based approach for maximum code reuse between editor and frontend.\n */\n\n/**\n * Find optimal font size using simple binary search between 5-600px.\n *\n * @param {HTMLElement} textElement The text element\n * @param {Function} applyFontSize Function that receives font size in pixels\n * @return {number} Optimal font size\n */\nfunction findOptimalFontSize( textElement, applyFontSize ) {\n\tconst alreadyHasScrollableHeight =\n\t\ttextElement.scrollHeight > textElement.clientHeight;\n\tlet minSize = 5;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\tconst computedStyle = window.getComputedStyle( textElement );\n\tconst paddingLeft = parseFloat( computedStyle.paddingLeft ) || 0;\n\tconst paddingRight = parseFloat( computedStyle.paddingRight ) || 0;\n\tconst range = document.createRange();\n\trange.selectNodeContents( textElement );\n\n\twhile ( minSize <= maxSize ) {\n\t\tconst midSize = Math.floor( ( minSize + maxSize ) / 2 );\n\t\tapplyFontSize( midSize );\n\n\t\t// When there is padding if the text overflows to the\n\t\t// padding area, it should be considered overflowing.\n\t\t// Use Range API to measure actual text content dimensions.\n\t\tconst rect = range.getBoundingClientRect();\n\t\tconst textWidth = rect.width;\n\n\t\t// Check if text fits within the element's width and is not\n\t\t// overflowing into the padding area.\n\t\tconst fitsWidth =\n\t\t\ttextElement.scrollWidth <= textElement.clientWidth &&\n\t\t\ttextWidth <= textElement.clientWidth - paddingLeft - paddingRight;\n\t\t// Check if text fits within the element's height.\n\t\tconst fitsHeight =\n\t\t\talreadyHasScrollableHeight ||\n\t\t\ttextElement.scrollHeight <= textElement.clientHeight;\n\n\t\tif ( fitsWidth && fitsHeight ) {\n\t\t\tbestSize = midSize;\n\t\t\tminSize = midSize + 1;\n\t\t} else {\n\t\t\tmaxSize = midSize - 1;\n\t\t}\n\t}\n\trange.detach();\n\n\treturn bestSize;\n}\n\n/**\n * Complete fit text optimization for a single text element.\n * Handles the full flow using callbacks for font size application.\n *\n * @param {HTMLElement} textElement The text element (paragraph, heading, etc.)\n * @param {Function} applyFontSize Function that receives font size in pixels (0 to clear, >0 to apply)\n */\nexport function optimizeFitText( textElement, applyFontSize ) {\n\tif ( ! textElement ) {\n\t\treturn;\n\t}\n\n\tapplyFontSize( 0 );\n\n\tconst optimalSize = findOptimalFontSize( textElement, applyFontSize );\n\n\tapplyFontSize( optimalSize );\n\treturn optimalSize;\n}\n"],
5
+ "mappings": ";AAYA,SAAS,oBAAqB,aAAa,eAAgB;AAC1D,QAAM,6BACL,YAAY,eAAe,YAAY;AACxC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AAEf,QAAM,gBAAgB,OAAO,iBAAkB,WAAY;AAC3D,QAAM,cAAc,WAAY,cAAc,WAAY,KAAK;AAC/D,QAAM,eAAe,WAAY,cAAc,YAAa,KAAK;AACjE,QAAM,QAAQ,SAAS,YAAY;AACnC,QAAM,mBAAoB,WAAY;AAEtC,SAAQ,WAAW,SAAU;AAC5B,UAAM,UAAU,KAAK,OAAS,UAAU,WAAY,CAAE;AACtD,kBAAe,OAAQ;AAKvB,UAAM,OAAO,MAAM,sBAAsB;AACzC,UAAM,YAAY,KAAK;AAIvB,UAAM,YACL,YAAY,eAAe,YAAY,eACvC,aAAa,YAAY,cAAc,cAAc;AAEtD,UAAM,aACL,8BACA,YAAY,gBAAgB,YAAY;AAEzC,QAAK,aAAa,YAAa;AAC9B,iBAAW;AACX,gBAAU,UAAU;AAAA,IACrB,OAAO;AACN,gBAAU,UAAU;AAAA,IACrB;AAAA,EACD;AACA,QAAM,OAAO;AAEb,SAAO;AACR;AASO,SAAS,gBAAiB,aAAa,eAAgB;AAC7D,MAAK,CAAE,aAAc;AACpB;AAAA,EACD;AAEA,gBAAe,CAAE;AAEjB,QAAM,cAAc,oBAAqB,aAAa,aAAc;AAEpE,gBAAe,WAAY;AAC3B,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -1623,6 +1623,138 @@ iframe[name=editor-canvas] {
1623
1623
  }
1624
1624
  }
1625
1625
 
1626
+ .block-editor-content-only-controls__link {
1627
+ width: 100%;
1628
+ box-shadow: inset 0 0 0 1px #ccc;
1629
+ }
1630
+ .block-editor-content-only-controls__link:focus:not(:disabled) {
1631
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1632
+ }
1633
+
1634
+ .block-editor-content-only-controls__link-row {
1635
+ align-items: center;
1636
+ }
1637
+
1638
+ .block-editor-content-only-controls__link-title {
1639
+ width: 100%;
1640
+ white-space: nowrap;
1641
+ text-overflow: ellipsis;
1642
+ overflow: hidden;
1643
+ }
1644
+
1645
+ .block-editor-content-only-controls__media {
1646
+ width: 100%;
1647
+ box-shadow: inset 0 0 0 1px #ccc;
1648
+ }
1649
+ .block-editor-content-only-controls__media:focus:not(:disabled) {
1650
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1651
+ }
1652
+
1653
+ .block-editor-content-only-controls__media-replace-flow {
1654
+ display: block;
1655
+ }
1656
+
1657
+ .block-editor-content-only-controls__media-row {
1658
+ align-items: center;
1659
+ }
1660
+
1661
+ .block-editor-content-only-controls__media-placeholder {
1662
+ width: 24px;
1663
+ height: 24px;
1664
+ border-radius: 2px;
1665
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
1666
+ display: inline-block;
1667
+ padding: 0;
1668
+ background: #fff linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1669
+ }
1670
+
1671
+ .block-editor-content-only-controls__media-title {
1672
+ width: 100%;
1673
+ white-space: nowrap;
1674
+ text-overflow: ellipsis;
1675
+ overflow: hidden;
1676
+ }
1677
+
1678
+ block-editor-content-only-controls__media-thumbnail {
1679
+ width: 100%;
1680
+ height: 100%;
1681
+ border-radius: 2px;
1682
+ align-self: center;
1683
+ }
1684
+
1685
+ .block-editor-content-only-controls__rich-text {
1686
+ width: 100%;
1687
+ margin: 0;
1688
+ background: #fff;
1689
+ color: #1e1e1e;
1690
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
1691
+ padding: 6px 8px;
1692
+ /* Fonts smaller than 16px causes mobile safari to zoom. */
1693
+ font-size: 16px;
1694
+ /* Override core line-height. To be reviewed. */
1695
+ line-height: normal;
1696
+ box-shadow: 0 0 0 transparent;
1697
+ border-radius: 2px;
1698
+ border: 1px solid #949494;
1699
+ }
1700
+ @media not (prefers-reduced-motion) {
1701
+ .block-editor-content-only-controls__rich-text {
1702
+ transition: box-shadow 0.1s linear;
1703
+ }
1704
+ }
1705
+ @media (min-width: 600px) {
1706
+ .block-editor-content-only-controls__rich-text {
1707
+ font-size: 13px;
1708
+ /* Override core line-height. To be reviewed. */
1709
+ line-height: normal;
1710
+ }
1711
+ }
1712
+ .block-editor-content-only-controls__rich-text:focus {
1713
+ border-color: var(--wp-admin-theme-color, #3858e9);
1714
+ box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color, #3858e9);
1715
+ outline: 2px solid transparent;
1716
+ }
1717
+ .block-editor-content-only-controls__rich-text::-webkit-input-placeholder {
1718
+ color: rgba(30, 30, 30, 0.62);
1719
+ }
1720
+ .block-editor-content-only-controls__rich-text::-moz-placeholder {
1721
+ color: rgba(30, 30, 30, 0.62);
1722
+ }
1723
+ .block-editor-content-only-controls__rich-text:-ms-input-placeholder {
1724
+ color: rgba(30, 30, 30, 0.62);
1725
+ }
1726
+ .block-editor-content-only-controls__rich-text {
1727
+ border-color: #949494;
1728
+ }
1729
+ .block-editor-content-only-controls__rich-text::placeholder {
1730
+ color: color-mix(in srgb, #1e1e1e, transparent 38%);
1731
+ }
1732
+ .block-editor-content-only-controls__rich-text {
1733
+ min-height: 40px;
1734
+ padding: 12px;
1735
+ }
1736
+
1737
+ .block-editor-content-only-controls__screen.components-navigator-screen {
1738
+ padding: 8px 0 0 0;
1739
+ }
1740
+ .block-editor-content-only-controls__screen {
1741
+ border-top: 1px solid #e0e0e0;
1742
+ }
1743
+ .block-editor-content-only-controls__screen .components-tools-panel {
1744
+ border-top: none;
1745
+ padding-top: 8px;
1746
+ }
1747
+
1748
+ .block-editor-content-only-controls__button-panel {
1749
+ padding: 4px;
1750
+ font-weight: 500 !important;
1751
+ }
1752
+
1753
+ .block-editor-content-only-controls__back-button,
1754
+ .block-editor-content-only-controls__drill-down-button {
1755
+ width: 100%;
1756
+ }
1757
+
1626
1758
  .block-editor-date-format-picker {
1627
1759
  margin: 0 0 16px;
1628
1760
  padding: 0;
@@ -1623,6 +1623,138 @@ iframe[name=editor-canvas] {
1623
1623
  }
1624
1624
  }
1625
1625
 
1626
+ .block-editor-content-only-controls__link {
1627
+ width: 100%;
1628
+ box-shadow: inset 0 0 0 1px #ccc;
1629
+ }
1630
+ .block-editor-content-only-controls__link:focus:not(:disabled) {
1631
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1632
+ }
1633
+
1634
+ .block-editor-content-only-controls__link-row {
1635
+ align-items: center;
1636
+ }
1637
+
1638
+ .block-editor-content-only-controls__link-title {
1639
+ width: 100%;
1640
+ white-space: nowrap;
1641
+ text-overflow: ellipsis;
1642
+ overflow: hidden;
1643
+ }
1644
+
1645
+ .block-editor-content-only-controls__media {
1646
+ width: 100%;
1647
+ box-shadow: inset 0 0 0 1px #ccc;
1648
+ }
1649
+ .block-editor-content-only-controls__media:focus:not(:disabled) {
1650
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1651
+ }
1652
+
1653
+ .block-editor-content-only-controls__media-replace-flow {
1654
+ display: block;
1655
+ }
1656
+
1657
+ .block-editor-content-only-controls__media-row {
1658
+ align-items: center;
1659
+ }
1660
+
1661
+ .block-editor-content-only-controls__media-placeholder {
1662
+ width: 24px;
1663
+ height: 24px;
1664
+ border-radius: 2px;
1665
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
1666
+ display: inline-block;
1667
+ padding: 0;
1668
+ background: #fff linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1669
+ }
1670
+
1671
+ .block-editor-content-only-controls__media-title {
1672
+ width: 100%;
1673
+ white-space: nowrap;
1674
+ text-overflow: ellipsis;
1675
+ overflow: hidden;
1676
+ }
1677
+
1678
+ block-editor-content-only-controls__media-thumbnail {
1679
+ width: 100%;
1680
+ height: 100%;
1681
+ border-radius: 2px;
1682
+ align-self: center;
1683
+ }
1684
+
1685
+ .block-editor-content-only-controls__rich-text {
1686
+ width: 100%;
1687
+ margin: 0;
1688
+ background: #fff;
1689
+ color: #1e1e1e;
1690
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
1691
+ padding: 6px 8px;
1692
+ /* Fonts smaller than 16px causes mobile safari to zoom. */
1693
+ font-size: 16px;
1694
+ /* Override core line-height. To be reviewed. */
1695
+ line-height: normal;
1696
+ box-shadow: 0 0 0 transparent;
1697
+ border-radius: 2px;
1698
+ border: 1px solid #949494;
1699
+ }
1700
+ @media not (prefers-reduced-motion) {
1701
+ .block-editor-content-only-controls__rich-text {
1702
+ transition: box-shadow 0.1s linear;
1703
+ }
1704
+ }
1705
+ @media (min-width: 600px) {
1706
+ .block-editor-content-only-controls__rich-text {
1707
+ font-size: 13px;
1708
+ /* Override core line-height. To be reviewed. */
1709
+ line-height: normal;
1710
+ }
1711
+ }
1712
+ .block-editor-content-only-controls__rich-text:focus {
1713
+ border-color: var(--wp-admin-theme-color, #3858e9);
1714
+ box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color, #3858e9);
1715
+ outline: 2px solid transparent;
1716
+ }
1717
+ .block-editor-content-only-controls__rich-text::-webkit-input-placeholder {
1718
+ color: rgba(30, 30, 30, 0.62);
1719
+ }
1720
+ .block-editor-content-only-controls__rich-text::-moz-placeholder {
1721
+ color: rgba(30, 30, 30, 0.62);
1722
+ }
1723
+ .block-editor-content-only-controls__rich-text:-ms-input-placeholder {
1724
+ color: rgba(30, 30, 30, 0.62);
1725
+ }
1726
+ .block-editor-content-only-controls__rich-text {
1727
+ border-color: #949494;
1728
+ }
1729
+ .block-editor-content-only-controls__rich-text::placeholder {
1730
+ color: color-mix(in srgb, #1e1e1e, transparent 38%);
1731
+ }
1732
+ .block-editor-content-only-controls__rich-text {
1733
+ min-height: 40px;
1734
+ padding: 12px;
1735
+ }
1736
+
1737
+ .block-editor-content-only-controls__screen.components-navigator-screen {
1738
+ padding: 8px 0 0 0;
1739
+ }
1740
+ .block-editor-content-only-controls__screen {
1741
+ border-top: 1px solid #e0e0e0;
1742
+ }
1743
+ .block-editor-content-only-controls__screen .components-tools-panel {
1744
+ border-top: none;
1745
+ padding-top: 8px;
1746
+ }
1747
+
1748
+ .block-editor-content-only-controls__button-panel {
1749
+ padding: 4px;
1750
+ font-weight: 500 !important;
1751
+ }
1752
+
1753
+ .block-editor-content-only-controls__back-button,
1754
+ .block-editor-content-only-controls__drill-down-button {
1755
+ width: 100%;
1756
+ }
1757
+
1626
1758
  .block-editor-date-format-picker {
1627
1759
  margin: 0 0 16px;
1628
1760
  padding: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "15.8.1-next.16d95556a.0",
3
+ "version": "15.8.1-next.dc3f6d3c1.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -55,41 +55,41 @@
55
55
  "@emotion/react": "^11.7.1",
56
56
  "@emotion/styled": "^11.6.0",
57
57
  "@react-spring/web": "^9.4.5",
58
- "@wordpress/a11y": "^4.35.1-next.16d95556a.0",
59
- "@wordpress/api-fetch": "^7.35.1-next.16d95556a.0",
60
- "@wordpress/base-styles": "^6.11.1-next.16d95556a.0",
61
- "@wordpress/blob": "^4.35.1-next.16d95556a.0",
62
- "@wordpress/block-serialization-default-parser": "^5.35.1-next.16d95556a.0",
63
- "@wordpress/blocks": "^15.8.1-next.16d95556a.0",
64
- "@wordpress/commands": "^1.35.1-next.16d95556a.0",
65
- "@wordpress/components": "^30.8.1-next.16d95556a.0",
66
- "@wordpress/compose": "^7.35.1-next.16d95556a.0",
67
- "@wordpress/data": "^10.35.1-next.16d95556a.0",
68
- "@wordpress/date": "^5.35.1-next.16d95556a.0",
69
- "@wordpress/deprecated": "^4.35.1-next.16d95556a.0",
70
- "@wordpress/dom": "^4.35.1-next.16d95556a.0",
71
- "@wordpress/element": "^6.35.1-next.16d95556a.0",
72
- "@wordpress/escape-html": "^3.35.1-next.16d95556a.0",
73
- "@wordpress/global-styles-engine": "^1.2.1-next.16d95556a.0",
74
- "@wordpress/hooks": "^4.35.1-next.16d95556a.0",
75
- "@wordpress/html-entities": "^4.35.1-next.16d95556a.0",
76
- "@wordpress/i18n": "^6.8.1-next.16d95556a.0",
77
- "@wordpress/icons": "^11.2.1-next.16d95556a.0",
78
- "@wordpress/interactivity": "^6.35.1-next.16d95556a.0",
79
- "@wordpress/is-shallow-equal": "^5.35.1-next.16d95556a.0",
80
- "@wordpress/keyboard-shortcuts": "^5.35.1-next.16d95556a.0",
81
- "@wordpress/keycodes": "^4.35.1-next.16d95556a.0",
82
- "@wordpress/notices": "^5.35.1-next.16d95556a.0",
83
- "@wordpress/preferences": "^4.35.1-next.16d95556a.0",
84
- "@wordpress/priority-queue": "^3.35.1-next.16d95556a.0",
85
- "@wordpress/private-apis": "^1.35.1-next.16d95556a.0",
86
- "@wordpress/rich-text": "^7.35.1-next.16d95556a.0",
87
- "@wordpress/style-engine": "^2.35.1-next.16d95556a.0",
88
- "@wordpress/token-list": "^3.35.1-next.16d95556a.0",
89
- "@wordpress/upload-media": "^0.20.1-next.16d95556a.0",
90
- "@wordpress/url": "^4.35.1-next.16d95556a.0",
91
- "@wordpress/warning": "^3.35.1-next.16d95556a.0",
92
- "@wordpress/wordcount": "^4.35.1-next.16d95556a.0",
58
+ "@wordpress/a11y": "^4.35.1-next.dc3f6d3c1.0",
59
+ "@wordpress/api-fetch": "^7.35.1-next.dc3f6d3c1.0",
60
+ "@wordpress/base-styles": "^6.11.1-next.dc3f6d3c1.0",
61
+ "@wordpress/blob": "^4.35.1-next.dc3f6d3c1.0",
62
+ "@wordpress/block-serialization-default-parser": "^5.35.1-next.dc3f6d3c1.0",
63
+ "@wordpress/blocks": "^15.8.1-next.dc3f6d3c1.0",
64
+ "@wordpress/commands": "^1.35.1-next.dc3f6d3c1.0",
65
+ "@wordpress/components": "^30.8.2-next.dc3f6d3c1.0",
66
+ "@wordpress/compose": "^7.35.1-next.dc3f6d3c1.0",
67
+ "@wordpress/data": "^10.35.1-next.dc3f6d3c1.0",
68
+ "@wordpress/date": "^5.35.1-next.dc3f6d3c1.0",
69
+ "@wordpress/deprecated": "^4.35.1-next.dc3f6d3c1.0",
70
+ "@wordpress/dom": "^4.35.1-next.dc3f6d3c1.0",
71
+ "@wordpress/element": "^6.35.1-next.dc3f6d3c1.0",
72
+ "@wordpress/escape-html": "^3.35.1-next.dc3f6d3c1.0",
73
+ "@wordpress/global-styles-engine": "^1.2.1-next.dc3f6d3c1.0",
74
+ "@wordpress/hooks": "^4.35.1-next.dc3f6d3c1.0",
75
+ "@wordpress/html-entities": "^4.35.1-next.dc3f6d3c1.0",
76
+ "@wordpress/i18n": "^6.8.1-next.dc3f6d3c1.0",
77
+ "@wordpress/icons": "^11.2.1-next.dc3f6d3c1.0",
78
+ "@wordpress/interactivity": "^6.35.1-next.dc3f6d3c1.0",
79
+ "@wordpress/is-shallow-equal": "^5.35.1-next.dc3f6d3c1.0",
80
+ "@wordpress/keyboard-shortcuts": "^5.35.1-next.dc3f6d3c1.0",
81
+ "@wordpress/keycodes": "^4.35.1-next.dc3f6d3c1.0",
82
+ "@wordpress/notices": "^5.35.1-next.dc3f6d3c1.0",
83
+ "@wordpress/preferences": "^4.35.1-next.dc3f6d3c1.0",
84
+ "@wordpress/priority-queue": "^3.35.1-next.dc3f6d3c1.0",
85
+ "@wordpress/private-apis": "^1.35.1-next.dc3f6d3c1.0",
86
+ "@wordpress/rich-text": "^7.35.1-next.dc3f6d3c1.0",
87
+ "@wordpress/style-engine": "^2.35.1-next.dc3f6d3c1.0",
88
+ "@wordpress/token-list": "^3.35.1-next.dc3f6d3c1.0",
89
+ "@wordpress/upload-media": "^0.20.1-next.dc3f6d3c1.0",
90
+ "@wordpress/url": "^4.35.1-next.dc3f6d3c1.0",
91
+ "@wordpress/warning": "^3.35.1-next.dc3f6d3c1.0",
92
+ "@wordpress/wordcount": "^4.35.1-next.dc3f6d3c1.0",
93
93
  "change-case": "^4.1.2",
94
94
  "clsx": "^2.1.1",
95
95
  "colord": "^2.7.0",
@@ -112,5 +112,5 @@
112
112
  "publishConfig": {
113
113
  "access": "public"
114
114
  },
115
- "gitHead": "59a9383612bbe16e21af84d13b035bfbca7fe833"
115
+ "gitHead": "f73b5e69b34fbaccfb8c47783f4f993059ff1a41"
116
116
  }
@@ -2,40 +2,21 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { Button, __experimentalVStack as VStack } from '@wordpress/components';
5
- import { useDispatch, useSelect } from '@wordpress/data';
6
5
  import { __ } from '@wordpress/i18n';
7
6
 
8
7
  /**
9
8
  * Internal dependencies
10
9
  */
11
- import { store as blockEditorStore } from '../../store';
12
- import { unlock } from '../../lock-unlock';
10
+ import useContentOnlySectionEdit from '../../hooks/use-content-only-section-edit';
13
11
 
14
12
  export default function EditContents( { clientId } ) {
15
- const { editContentOnlySection, stopEditingContentOnlySection } = unlock(
16
- useDispatch( blockEditorStore )
17
- );
18
- const { isWithinSection, isWithinEditedSection, editedContentOnlySection } =
19
- useSelect(
20
- ( select ) => {
21
- const {
22
- isSectionBlock,
23
- getParentSectionBlock,
24
- getEditedContentOnlySection,
25
- isWithinEditedContentOnlySection,
26
- } = unlock( select( blockEditorStore ) );
27
-
28
- return {
29
- isWithinSection:
30
- isSectionBlock( clientId ) ||
31
- !! getParentSectionBlock( clientId ),
32
- isWithinEditedSection:
33
- isWithinEditedContentOnlySection( clientId ),
34
- editedContentOnlySection: getEditedContentOnlySection(),
35
- };
36
- },
37
- [ clientId ]
38
- );
13
+ const {
14
+ isWithinSection,
15
+ isWithinEditedSection,
16
+ editedContentOnlySection,
17
+ editContentOnlySection,
18
+ stopEditingContentOnlySection,
19
+ } = useContentOnlySectionEdit( clientId );
39
20
 
40
21
  if ( ! isWithinSection && ! isWithinEditedSection ) {
41
22
  return null;
@@ -56,8 +37,8 @@ export default function EditContents( { clientId } ) {
56
37
  } }
57
38
  >
58
39
  { editedContentOnlySection
59
- ? __( 'Exit pattern' )
60
- : __( 'Edit pattern' ) }
40
+ ? __( 'Exit section' )
41
+ : __( 'Edit section' ) }
61
42
  </Button>
62
43
  </VStack>
63
44
  );
@@ -29,7 +29,6 @@ import PositionControls from '../inspector-controls-tabs/position-controls-panel
29
29
  import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
30
30
  import { useBorderPanelLabel } from '../../hooks/border';
31
31
  import ContentTab from '../inspector-controls-tabs/content-tab';
32
-
33
32
  import { unlock } from '../../lock-unlock';
34
33
 
35
34
  function BlockStylesPanel( { clientId } ) {
@@ -368,7 +367,10 @@ const BlockInspectorSingleBlock = ( {
368
367
  { hasBlockStyles && (
369
368
  <BlockStylesPanel clientId={ clientId } />
370
369
  ) }
371
- <ContentTab contentClientIds={ contentClientIds } />
370
+ <ContentTab
371
+ rootClientId={ clientId }
372
+ contentClientIds={ contentClientIds }
373
+ />
372
374
  { ! isSectionBlock && (
373
375
  <StyleInspectorSlots
374
376
  blockName={ blockName }
@@ -563,6 +563,7 @@ function BlockListBlockProvider( props ) {
563
563
  isSelectionEnabled,
564
564
  getTemplateLock,
565
565
  isSectionBlock: _isSectionBlock,
566
+ getParentSectionBlock,
566
567
  getBlockWithoutAttributes,
567
568
  getBlockAttributes,
568
569
  canRemoveBlock,
@@ -674,6 +675,9 @@ function BlockListBlockProvider( props ) {
674
675
  isSelectionEnabled: isSelectionEnabled(),
675
676
  isLocked: !! getTemplateLock( rootClientId ),
676
677
  isSectionBlock: _isSectionBlock( clientId ),
678
+ isWithinSectionBlock:
679
+ _isSectionBlock( clientId ) ||
680
+ !! getParentSectionBlock( clientId ),
677
681
  canRemove,
678
682
  canMove,
679
683
  isSelected: _isSelected,
@@ -756,6 +760,7 @@ function BlockListBlockProvider( props ) {
756
760
  isDragging,
757
761
  hasChildSelected,
758
762
  isSectionBlock,
763
+ isWithinSectionBlock,
759
764
  isEditingDisabled,
760
765
  hasEditableOutline,
761
766
  className,
@@ -802,6 +807,7 @@ function BlockListBlockProvider( props ) {
802
807
  isDragging,
803
808
  hasChildSelected,
804
809
  isSectionBlock,
810
+ isWithinSectionBlock,
805
811
  isEditingDisabled,
806
812
  hasEditableOutline,
807
813
  isEditingContentOnlySection,
@@ -100,6 +100,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
100
100
  isEditingContentOnlySection,
101
101
  defaultClassName,
102
102
  isSectionBlock,
103
+ isWithinSectionBlock,
103
104
  canMove,
104
105
  isBlockHidden,
105
106
  } = useContext( PrivateBlockContext );
@@ -108,13 +109,14 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
108
109
  const blockLabel = sprintf( __( 'Block: %s' ), blockTitle );
109
110
  const htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';
110
111
  const ffDragRef = useFirefoxDraggableCompatibility();
112
+ const isHoverEnabled = ! isWithinSectionBlock;
111
113
  const mergedRefs = useMergeRefs( [
112
114
  props.ref,
113
115
  useFocusFirstElement( { clientId, initialPosition } ),
114
116
  useBlockRefProvider( clientId ),
115
117
  useFocusHandler( clientId ),
116
118
  useEventHandlers( { clientId, isSelected } ),
117
- useIsHovered(),
119
+ useIsHovered( { isEnabled: isHoverEnabled } ),
118
120
  useIntersectionObserver(),
119
121
  useMovingAnimation( { triggerAnimationOnChange: index, clientId } ),
120
122
  useDisabled( { isDisabled: ! hasOverlay } ),
@@ -15,21 +15,33 @@ function listener( event ) {
15
15
  );
16
16
  }
17
17
 
18
- /*
18
+ /**
19
19
  * Adds `is-hovered` class when the block is hovered and in navigation or
20
20
  * outline mode.
21
+ *
22
+ * @param {Object} options Options object.
23
+ * @param {boolean} [options.isEnabled=true] Whether to enable hover detection.
24
+ *
25
+ * @return {Function} Ref callback.
21
26
  */
22
- export function useIsHovered() {
23
- return useRefEffect( ( node ) => {
24
- node.addEventListener( 'mouseout', listener );
25
- node.addEventListener( 'mouseover', listener );
27
+ export function useIsHovered( { isEnabled = true } = {} ) {
28
+ return useRefEffect(
29
+ ( node ) => {
30
+ if ( ! isEnabled ) {
31
+ return;
32
+ }
33
+
34
+ node.addEventListener( 'mouseout', listener );
35
+ node.addEventListener( 'mouseover', listener );
26
36
 
27
- return () => {
28
- node.removeEventListener( 'mouseout', listener );
29
- node.removeEventListener( 'mouseover', listener );
37
+ return () => {
38
+ node.removeEventListener( 'mouseout', listener );
39
+ node.removeEventListener( 'mouseover', listener );
30
40
 
31
- // Remove class in case it lingers.
32
- node.classList.remove( 'is-hovered' );
33
- };
34
- }, [] );
41
+ // Remove class in case it lingers.
42
+ node.classList.remove( 'is-hovered' );
43
+ };
44
+ },
45
+ [ isEnabled ]
46
+ );
35
47
  }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { MenuItem } from '@wordpress/components';
5
+ import { _x } from '@wordpress/i18n';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import useContentOnlySectionEdit from '../../hooks/use-content-only-section-edit';
11
+
12
+ export function EditSectionMenuItem( { clientId, onClose } ) {
13
+ const {
14
+ isSectionBlock,
15
+ isEditingContentOnlySection,
16
+ editContentOnlySection,
17
+ } = useContentOnlySectionEdit( clientId );
18
+
19
+ // Only show when the experiment is enabled, the block is a section block,
20
+ // and we're not already editing it
21
+ if (
22
+ ! window?.__experimentalContentOnlyPatternInsertion ||
23
+ ! isSectionBlock ||
24
+ isEditingContentOnlySection
25
+ ) {
26
+ return null;
27
+ }
28
+
29
+ return (
30
+ <MenuItem
31
+ onClick={ () => {
32
+ editContentOnlySection( clientId );
33
+ onClose();
34
+ } }
35
+ >
36
+ { _x( 'Edit section', 'Editing a section in the Editor' ) }
37
+ </MenuItem>
38
+ );
39
+ }
@@ -22,6 +22,7 @@ import BlockModeToggle from '../block-settings-menu/block-mode-toggle';
22
22
  import { ModifyContentOnlySectionMenuItem } from '../content-lock';
23
23
  import { BlockRenameControl, useBlockRename } from '../block-rename';
24
24
  import { BlockVisibilityMenuItem } from '../block-visibility';
25
+ import { EditSectionMenuItem } from './edit-section-menu-item';
25
26
 
26
27
  const { Fill, Slot } = createSlotFill( 'BlockSettingsMenuControls' );
27
28
 
@@ -98,6 +99,12 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
98
99
  onClose={ fillProps?.onClose }
99
100
  />
100
101
  ) }
102
+ { selectedClientIds.length === 1 && (
103
+ <EditSectionMenuItem
104
+ clientId={ selectedClientIds[ 0 ] }
105
+ onClose={ fillProps?.onClose }
106
+ />
107
+ ) }
101
108
  { showLockButton && (
102
109
  <BlockLockMenuItem
103
110
  clientId={ selectedClientIds[ 0 ] }