@wordpress/block-editor 15.8.1-next.16d95556a.0 → 15.9.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 (302) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-inspector/edit-contents.js +19 -23
  3. package/build/components/block-inspector/edit-contents.js.map +3 -3
  4. package/build/components/block-inspector/index.js +7 -1
  5. package/build/components/block-inspector/index.js.map +2 -2
  6. package/build/components/block-list/block.js +4 -0
  7. package/build/components/block-list/block.js.map +2 -2
  8. package/build/components/block-list/index.js +2 -1
  9. package/build/components/block-list/index.js.map +2 -2
  10. package/build/components/block-list/use-block-props/index.js +3 -1
  11. package/build/components/block-list/use-block-props/index.js.map +2 -2
  12. package/build/components/block-list/use-block-props/use-is-hovered.js +16 -10
  13. package/build/components/block-list/use-block-props/use-is-hovered.js.map +2 -2
  14. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
  15. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
  16. package/build/components/block-lock/modal.js +5 -5
  17. package/build/components/block-lock/modal.js.map +2 -2
  18. package/build/components/block-lock/use-block-lock.js +10 -13
  19. package/build/components/block-lock/use-block-lock.js.map +2 -2
  20. package/build/components/block-settings-menu-controls/edit-section-menu-item.js +64 -0
  21. package/build/components/block-settings-menu-controls/edit-section-menu-item.js.map +7 -0
  22. package/build/components/block-settings-menu-controls/index.js +9 -1
  23. package/build/components/block-settings-menu-controls/index.js.map +2 -2
  24. package/build/components/block-toolbar/block-toolbar-icon.js +9 -9
  25. package/build/components/block-toolbar/block-toolbar-icon.js.map +2 -2
  26. package/build/components/block-tools/index.js +56 -45
  27. package/build/components/block-tools/index.js.map +3 -3
  28. package/build/components/block-variation-transforms/index.js +32 -5
  29. package/build/components/block-variation-transforms/index.js.map +2 -2
  30. package/build/components/block-visibility/toolbar.js +1 -1
  31. package/build/components/block-visibility/toolbar.js.map +1 -1
  32. package/build/components/border-radius-control/single-input-control.js +1 -0
  33. package/build/components/border-radius-control/single-input-control.js.map +2 -2
  34. package/build/components/content-only-controls/fields-dropdown-menu.js +66 -0
  35. package/build/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
  36. package/build/components/content-only-controls/index.js +444 -0
  37. package/build/components/content-only-controls/index.js.map +7 -0
  38. package/build/components/content-only-controls/link/index.js +193 -0
  39. package/build/components/content-only-controls/link/index.js.map +7 -0
  40. package/build/components/content-only-controls/media/index.js +264 -0
  41. package/build/components/content-only-controls/media/index.js.map +7 -0
  42. package/build/components/content-only-controls/rich-text/index.js +188 -0
  43. package/build/components/content-only-controls/rich-text/index.js.map +7 -0
  44. package/build/components/content-only-controls/use-inspector-popover-placement.js +41 -0
  45. package/build/components/content-only-controls/use-inspector-popover-placement.js.map +7 -0
  46. package/build/components/font-family/index.js +1 -15
  47. package/build/components/font-family/index.js.map +2 -2
  48. package/build/components/global-styles/dimensions-panel.js +35 -2
  49. package/build/components/global-styles/dimensions-panel.js.map +2 -2
  50. package/build/components/global-styles/hooks.js +1 -1
  51. package/build/components/global-styles/hooks.js.map +2 -2
  52. package/build/components/global-styles/typography-panel.js +1 -2
  53. package/build/components/global-styles/typography-panel.js.map +2 -2
  54. package/build/components/inserter/media-tab/media-tab.js +1 -33
  55. package/build/components/inserter/media-tab/media-tab.js.map +3 -3
  56. package/build/components/inspector-controls-tabs/content-tab.js +6 -2
  57. package/build/components/inspector-controls-tabs/content-tab.js.map +3 -3
  58. package/build/components/inspector-controls-tabs/index.js +7 -1
  59. package/build/components/inspector-controls-tabs/index.js.map +2 -2
  60. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
  61. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
  62. package/build/components/link-control/index.js +15 -7
  63. package/build/components/link-control/index.js.map +2 -2
  64. package/build/components/list-view/block-select-button.js +7 -8
  65. package/build/components/list-view/block-select-button.js.map +2 -2
  66. package/build/components/list-view/block.js +9 -7
  67. package/build/components/list-view/block.js.map +2 -2
  68. package/build/components/media-placeholder/index.js +18 -35
  69. package/build/components/media-placeholder/index.js.map +3 -3
  70. package/build/components/media-placeholder/utils.js +60 -0
  71. package/build/components/media-placeholder/utils.js.map +7 -0
  72. package/build/components/media-replace-flow/index.js +24 -33
  73. package/build/components/media-replace-flow/index.js.map +3 -3
  74. package/build/components/use-block-commands/index.js +1 -1
  75. package/build/components/use-block-commands/index.js.map +2 -2
  76. package/build/components/use-block-display-information/index.js +21 -1
  77. package/build/components/use-block-display-information/index.js.map +3 -3
  78. package/build/components/use-block-drop-zone/index.js +1 -5
  79. package/build/components/use-block-drop-zone/index.js.map +2 -2
  80. package/build/hooks/block-bindings.js +52 -61
  81. package/build/hooks/block-bindings.js.map +3 -3
  82. package/build/hooks/dimensions.js +3 -3
  83. package/build/hooks/dimensions.js.map +2 -2
  84. package/build/hooks/metadata.js +1 -1
  85. package/build/hooks/metadata.js.map +2 -2
  86. package/build/hooks/use-content-only-section-edit.js +67 -0
  87. package/build/hooks/use-content-only-section-edit.js.map +7 -0
  88. package/build/hooks/utils.js +5 -1
  89. package/build/hooks/utils.js.map +2 -2
  90. package/build/layouts/constrained.js +2 -2
  91. package/build/layouts/constrained.js.map +2 -2
  92. package/build/private-apis.js +2 -3
  93. package/build/private-apis.js.map +3 -3
  94. package/build/store/private-keys.js +3 -0
  95. package/build/store/private-keys.js.map +2 -2
  96. package/build/store/private-selectors.js +41 -2
  97. package/build/store/private-selectors.js.map +2 -2
  98. package/build/store/selectors.js +6 -4
  99. package/build/store/selectors.js.map +2 -2
  100. package/build/utils/fit-text-utils.js +9 -1
  101. package/build/utils/fit-text-utils.js.map +2 -2
  102. package/build-module/components/block-inspector/edit-contents.js +9 -23
  103. package/build-module/components/block-inspector/edit-contents.js.map +2 -2
  104. package/build-module/components/block-inspector/index.js +7 -1
  105. package/build-module/components/block-inspector/index.js.map +2 -2
  106. package/build-module/components/block-list/block.js +4 -0
  107. package/build-module/components/block-list/block.js.map +2 -2
  108. package/build-module/components/block-list/index.js +2 -1
  109. package/build-module/components/block-list/index.js.map +2 -2
  110. package/build-module/components/block-list/use-block-props/index.js +3 -1
  111. package/build-module/components/block-list/use-block-props/index.js.map +2 -2
  112. package/build-module/components/block-list/use-block-props/use-is-hovered.js +16 -10
  113. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +2 -2
  114. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
  115. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
  116. package/build-module/components/block-lock/modal.js +5 -5
  117. package/build-module/components/block-lock/modal.js.map +2 -2
  118. package/build-module/components/block-lock/use-block-lock.js +10 -13
  119. package/build-module/components/block-lock/use-block-lock.js.map +2 -2
  120. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js +29 -0
  121. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js.map +7 -0
  122. package/build-module/components/block-settings-menu-controls/index.js +9 -1
  123. package/build-module/components/block-settings-menu-controls/index.js.map +2 -2
  124. package/build-module/components/block-toolbar/block-toolbar-icon.js +10 -10
  125. package/build-module/components/block-toolbar/block-toolbar-icon.js.map +2 -2
  126. package/build-module/components/block-tools/index.js +56 -45
  127. package/build-module/components/block-tools/index.js.map +2 -2
  128. package/build-module/components/block-variation-transforms/index.js +32 -5
  129. package/build-module/components/block-variation-transforms/index.js.map +2 -2
  130. package/build-module/components/block-visibility/toolbar.js +1 -1
  131. package/build-module/components/block-visibility/toolbar.js.map +1 -1
  132. package/build-module/components/border-radius-control/single-input-control.js +1 -0
  133. package/build-module/components/border-radius-control/single-input-control.js.map +2 -2
  134. package/build-module/components/content-only-controls/fields-dropdown-menu.js +45 -0
  135. package/build-module/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
  136. package/build-module/components/content-only-controls/index.js +420 -0
  137. package/build-module/components/content-only-controls/index.js.map +7 -0
  138. package/build-module/components/content-only-controls/link/index.js +160 -0
  139. package/build-module/components/content-only-controls/link/index.js.map +7 -0
  140. package/build-module/components/content-only-controls/media/index.js +242 -0
  141. package/build-module/components/content-only-controls/media/index.js.map +7 -0
  142. package/build-module/components/content-only-controls/rich-text/index.js +160 -0
  143. package/build-module/components/content-only-controls/rich-text/index.js.map +7 -0
  144. package/build-module/components/content-only-controls/use-inspector-popover-placement.js +16 -0
  145. package/build-module/components/content-only-controls/use-inspector-popover-placement.js.map +7 -0
  146. package/build-module/components/font-family/index.js +1 -15
  147. package/build-module/components/font-family/index.js.map +2 -2
  148. package/build-module/components/global-styles/dimensions-panel.js +35 -2
  149. package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
  150. package/build-module/components/global-styles/hooks.js +1 -1
  151. package/build-module/components/global-styles/hooks.js.map +2 -2
  152. package/build-module/components/global-styles/typography-panel.js +1 -2
  153. package/build-module/components/global-styles/typography-panel.js.map +2 -2
  154. package/build-module/components/inserter/media-tab/media-tab.js +2 -34
  155. package/build-module/components/inserter/media-tab/media-tab.js.map +2 -2
  156. package/build-module/components/inspector-controls-tabs/content-tab.js +7 -3
  157. package/build-module/components/inspector-controls-tabs/content-tab.js.map +2 -2
  158. package/build-module/components/inspector-controls-tabs/index.js +7 -1
  159. package/build-module/components/inspector-controls-tabs/index.js.map +2 -2
  160. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
  161. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
  162. package/build-module/components/link-control/index.js +16 -8
  163. package/build-module/components/link-control/index.js.map +2 -2
  164. package/build-module/components/list-view/block-select-button.js +14 -9
  165. package/build-module/components/list-view/block-select-button.js.map +2 -2
  166. package/build-module/components/list-view/block.js +9 -7
  167. package/build-module/components/list-view/block.js.map +2 -2
  168. package/build-module/components/media-placeholder/index.js +19 -36
  169. package/build-module/components/media-placeholder/index.js.map +2 -2
  170. package/build-module/components/media-placeholder/utils.js +35 -0
  171. package/build-module/components/media-placeholder/utils.js.map +7 -0
  172. package/build-module/components/media-replace-flow/index.js +24 -33
  173. package/build-module/components/media-replace-flow/index.js.map +2 -2
  174. package/build-module/components/use-block-commands/index.js +1 -1
  175. package/build-module/components/use-block-commands/index.js.map +2 -2
  176. package/build-module/components/use-block-display-information/index.js +21 -1
  177. package/build-module/components/use-block-display-information/index.js.map +3 -3
  178. package/build-module/components/use-block-drop-zone/index.js +1 -5
  179. package/build-module/components/use-block-drop-zone/index.js.map +2 -2
  180. package/build-module/hooks/block-bindings.js +57 -62
  181. package/build-module/hooks/block-bindings.js.map +2 -2
  182. package/build-module/hooks/dimensions.js +3 -3
  183. package/build-module/hooks/dimensions.js.map +2 -2
  184. package/build-module/hooks/metadata.js +1 -1
  185. package/build-module/hooks/metadata.js.map +2 -2
  186. package/build-module/hooks/use-content-only-section-edit.js +46 -0
  187. package/build-module/hooks/use-content-only-section-edit.js.map +7 -0
  188. package/build-module/hooks/utils.js +5 -1
  189. package/build-module/hooks/utils.js.map +2 -2
  190. package/build-module/layouts/constrained.js +2 -2
  191. package/build-module/layouts/constrained.js.map +2 -2
  192. package/build-module/private-apis.js +3 -3
  193. package/build-module/private-apis.js.map +2 -2
  194. package/build-module/store/private-keys.js +2 -0
  195. package/build-module/store/private-keys.js.map +2 -2
  196. package/build-module/store/private-selectors.js +37 -2
  197. package/build-module/store/private-selectors.js.map +2 -2
  198. package/build-module/store/selectors.js +6 -4
  199. package/build-module/store/selectors.js.map +2 -2
  200. package/build-module/utils/fit-text-utils.js +9 -1
  201. package/build-module/utils/fit-text-utils.js.map +2 -2
  202. package/build-style/content-rtl.css +3 -0
  203. package/build-style/content.css +3 -0
  204. package/build-style/style-rtl.css +145 -4
  205. package/build-style/style.css +145 -4
  206. package/package.json +38 -37
  207. package/src/components/block-inspector/edit-contents.js +10 -29
  208. package/src/components/block-inspector/index.js +4 -2
  209. package/src/components/block-list/block.js +6 -0
  210. package/src/components/block-list/content.scss +5 -0
  211. package/src/components/block-list/index.js +3 -1
  212. package/src/components/block-list/use-block-props/index.js +3 -1
  213. package/src/components/block-list/use-block-props/use-is-hovered.js +24 -12
  214. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +34 -3
  215. package/src/components/block-lock/modal.js +6 -5
  216. package/src/components/block-lock/use-block-lock.js +10 -14
  217. package/src/components/block-patterns-list/stories/{index.story.js → index.story.jsx} +3 -1
  218. package/src/components/block-settings-menu-controls/edit-section-menu-item.js +39 -0
  219. package/src/components/block-settings-menu-controls/index.js +8 -1
  220. package/src/components/block-toolbar/block-toolbar-icon.js +14 -10
  221. package/src/components/block-tools/index.js +15 -2
  222. package/src/components/block-tools/style.scss +4 -0
  223. package/src/components/block-variation-transforms/index.js +96 -35
  224. package/src/components/block-visibility/toolbar.js +1 -1
  225. package/src/components/border-radius-control/single-input-control.js +1 -0
  226. package/src/components/content-only-controls/fields-dropdown-menu.js +53 -0
  227. package/src/components/content-only-controls/index.js +560 -0
  228. package/src/components/content-only-controls/link/index.js +200 -0
  229. package/src/components/content-only-controls/link/styles.scss +23 -0
  230. package/src/components/content-only-controls/media/index.js +306 -0
  231. package/src/components/content-only-controls/media/styles.scss +47 -0
  232. package/src/components/content-only-controls/rich-text/index.js +179 -0
  233. package/src/components/content-only-controls/rich-text/styles.scss +24 -0
  234. package/src/components/content-only-controls/styles.scss +44 -0
  235. package/src/components/content-only-controls/use-inspector-popover-placement.js +19 -0
  236. package/src/components/font-family/README.md +0 -9
  237. package/src/components/font-family/index.js +1 -16
  238. package/src/components/font-family/stories/{index.story.js → index.story.jsx} +0 -1
  239. package/src/components/global-styles/dimensions-panel.js +36 -0
  240. package/src/components/global-styles/hooks.js +1 -1
  241. package/src/components/global-styles/typography-panel.js +0 -1
  242. package/src/components/inserter/media-tab/media-tab.js +2 -44
  243. package/src/components/inspector-controls-tabs/content-tab.js +12 -4
  244. package/src/components/inspector-controls-tabs/index.js +4 -1
  245. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -5
  246. package/src/components/link-control/index.js +36 -12
  247. package/src/components/list-view/block-select-button.js +15 -10
  248. package/src/components/list-view/block.js +9 -7
  249. package/src/components/media-placeholder/index.js +21 -46
  250. package/src/components/media-placeholder/test/get-computed-accept-attribute.js +164 -0
  251. package/src/components/media-placeholder/utils.js +65 -0
  252. package/src/components/media-replace-flow/index.js +25 -42
  253. package/src/components/use-block-commands/index.js +1 -1
  254. package/src/components/use-block-display-information/index.js +30 -2
  255. package/src/components/use-block-drop-zone/index.js +1 -5
  256. package/src/hooks/block-bindings.js +71 -82
  257. package/src/hooks/dimensions.js +8 -3
  258. package/src/hooks/metadata.js +1 -1
  259. package/src/hooks/test/metadata.js +1 -1
  260. package/src/hooks/use-content-only-section-edit.js +63 -0
  261. package/src/hooks/utils.js +4 -0
  262. package/src/layouts/constrained.js +8 -2
  263. package/src/private-apis.js +2 -2
  264. package/src/store/private-keys.js +1 -0
  265. package/src/store/private-selectors.js +121 -5
  266. package/src/store/selectors.js +6 -4
  267. package/src/store/test/private-selectors.js +242 -0
  268. package/src/style.scss +1 -1
  269. package/src/utils/fit-text-utils.js +19 -1
  270. package/tsconfig.json +1 -0
  271. package/build/components/media-upload-modal/index.js +0 -29
  272. package/build/components/media-upload-modal/index.js.map +0 -7
  273. package/build-module/components/media-upload-modal/index.js +0 -8
  274. package/build-module/components/media-upload-modal/index.js.map +0 -7
  275. package/src/components/font-family/style.scss +0 -7
  276. package/src/components/media-upload-modal/index.js +0 -18
  277. /package/src/components/alignment-control/stories/{aliginment-toolbar.story.js → aliginment-toolbar.story.jsx} +0 -0
  278. /package/src/components/alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
  279. /package/src/components/block-alignment-matrix-control/stories/{index.story.js → index.story.jsx} +0 -0
  280. /package/src/components/block-draggable/stories/{index.story.js → index.story.jsx} +0 -0
  281. /package/src/components/block-heading-level-dropdown/stories/{index.story.js → index.story.jsx} +0 -0
  282. /package/src/components/block-mover/stories/{index.story.js → index.story.jsx} +0 -0
  283. /package/src/components/block-title/stories/{index.story.js → index.story.jsx} +0 -0
  284. /package/src/components/border-radius-control/stories/{index.story.js → index.story.jsx} +0 -0
  285. /package/src/components/date-format-picker/stories/{index.story.js → index.story.jsx} +0 -0
  286. /package/src/components/dimensions-tool/stories/{aspect-ratio-tool.story.js → aspect-ratio-tool.story.jsx} +0 -0
  287. /package/src/components/dimensions-tool/stories/{index.story.js → index.story.jsx} +0 -0
  288. /package/src/components/dimensions-tool/stories/{scale-tool.story.js → scale-tool.story.jsx} +0 -0
  289. /package/src/components/dimensions-tool/stories/{width-height-tool.story.js → width-height-tool.story.jsx} +0 -0
  290. /package/src/components/height-control/stories/{index.story.js → index.story.jsx} +0 -0
  291. /package/src/components/inserter/stories/{index.story.js → index.story.jsx} +0 -0
  292. /package/src/components/line-height-control/stories/{index.story.js → index.story.jsx} +0 -0
  293. /package/src/components/plain-text/stories/{index.story.js → index.story.jsx} +0 -0
  294. /package/src/components/resolution-tool/stories/{index.story.js → index.story.jsx} +0 -0
  295. /package/src/components/tabbed-sidebar/stories/{index.story.js → index.story.jsx} +0 -0
  296. /package/src/components/text-alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
  297. /package/src/components/text-decoration-control/stories/{index.story.js → index.story.jsx} +0 -0
  298. /package/src/components/text-transform-control/stories/{index.story.js → index.story.jsx} +0 -0
  299. /package/src/components/unit-control/stories/{index.story.js → index.story.jsx} +0 -0
  300. /package/src/components/url-popover/stories/{index.story.js → index.story.jsx} +0 -0
  301. /package/src/components/warning/stories/{index.story.js → index.story.jsx} +0 -0
  302. /package/src/components/writing-mode-control/stories/{index.story.js → index.story.jsx} +0 -0
@@ -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
  }
@@ -279,6 +279,9 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
279
279
  .block-editor-block-list__layout .block-editor-block-list__block[draggable=true], .block-editor-block-list__layout .block-editor-block-list__block[data-draggable=true] {
280
280
  cursor: grab;
281
281
  }
282
+ .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected {
283
+ cursor: default;
284
+ }
282
285
  .block-editor-block-list__layout .block-editor-block-list__block[contenteditable],
283
286
  .block-editor-block-list__layout .block-editor-block-list__block [contenteditable] {
284
287
  cursor: text;
@@ -279,6 +279,9 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
279
279
  .block-editor-block-list__layout .block-editor-block-list__block[draggable=true], .block-editor-block-list__layout .block-editor-block-list__block[data-draggable=true] {
280
280
  cursor: grab;
281
281
  }
282
+ .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected {
283
+ cursor: default;
284
+ }
282
285
  .block-editor-block-list__layout .block-editor-block-list__block[contenteditable],
283
286
  .block-editor-block-list__layout .block-editor-block-list__block [contenteditable] {
284
287
  cursor: text;
@@ -531,6 +531,10 @@ iframe[name=editor-canvas] {
531
531
  right: 50%;
532
532
  }
533
533
 
534
+ .block-editor-block-tools--is-dragging > .popover-slot {
535
+ display: none;
536
+ }
537
+
534
538
  .block-editor-block-lock-modal {
535
539
  z-index: 1000001;
536
540
  }
@@ -1623,6 +1627,147 @@ iframe[name=editor-canvas] {
1623
1627
  }
1624
1628
  }
1625
1629
 
1630
+ .block-editor-content-only-controls__link {
1631
+ width: 100%;
1632
+ box-shadow: inset 0 0 0 1px #ccc;
1633
+ }
1634
+ .block-editor-content-only-controls__link:focus:not(:disabled) {
1635
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1636
+ }
1637
+
1638
+ .block-editor-content-only-controls__link-row {
1639
+ align-items: center;
1640
+ }
1641
+
1642
+ .block-editor-content-only-controls__link-title {
1643
+ width: 100%;
1644
+ white-space: nowrap;
1645
+ text-overflow: ellipsis;
1646
+ overflow: hidden;
1647
+ }
1648
+
1649
+ .block-editor-content-only-controls__media {
1650
+ width: 100%;
1651
+ box-shadow: inset 0 0 0 1px #ccc;
1652
+ }
1653
+ .block-editor-content-only-controls__media:focus:not(:disabled) {
1654
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1655
+ }
1656
+
1657
+ .block-editor-content-only-controls__media-replace-flow {
1658
+ display: block;
1659
+ }
1660
+
1661
+ .block-editor-content-only-controls__media-row {
1662
+ align-items: center;
1663
+ }
1664
+
1665
+ .block-editor-content-only-controls__media-placeholder {
1666
+ width: 24px;
1667
+ height: 24px;
1668
+ border-radius: 2px;
1669
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
1670
+ display: inline-block;
1671
+ padding: 0;
1672
+ background: #fff linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1673
+ }
1674
+
1675
+ .block-editor-content-only-controls__media-title {
1676
+ width: 100%;
1677
+ white-space: nowrap;
1678
+ text-overflow: ellipsis;
1679
+ overflow: hidden;
1680
+ }
1681
+
1682
+ block-editor-content-only-controls__media-thumbnail {
1683
+ width: 100%;
1684
+ height: 100%;
1685
+ border-radius: 2px;
1686
+ align-self: center;
1687
+ }
1688
+
1689
+ .block-editor-content-only-controls__rich-text {
1690
+ width: 100%;
1691
+ margin: 0;
1692
+ background: #fff;
1693
+ color: #1e1e1e;
1694
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
1695
+ padding: 6px 8px;
1696
+ /* Fonts smaller than 16px causes mobile safari to zoom. */
1697
+ font-size: 16px;
1698
+ /* Override core line-height. To be reviewed. */
1699
+ line-height: normal;
1700
+ box-shadow: 0 0 0 transparent;
1701
+ border-radius: 2px;
1702
+ border: 1px solid #949494;
1703
+ }
1704
+ @media not (prefers-reduced-motion) {
1705
+ .block-editor-content-only-controls__rich-text {
1706
+ transition: box-shadow 0.1s linear;
1707
+ }
1708
+ }
1709
+ @media (min-width: 600px) {
1710
+ .block-editor-content-only-controls__rich-text {
1711
+ font-size: 13px;
1712
+ /* Override core line-height. To be reviewed. */
1713
+ line-height: normal;
1714
+ }
1715
+ }
1716
+ .block-editor-content-only-controls__rich-text:focus {
1717
+ border-color: var(--wp-admin-theme-color, #3858e9);
1718
+ box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color, #3858e9);
1719
+ outline: 2px solid transparent;
1720
+ }
1721
+ .block-editor-content-only-controls__rich-text::-webkit-input-placeholder {
1722
+ color: rgba(30, 30, 30, 0.62);
1723
+ }
1724
+ .block-editor-content-only-controls__rich-text::-moz-placeholder {
1725
+ color: rgba(30, 30, 30, 0.62);
1726
+ }
1727
+ .block-editor-content-only-controls__rich-text:-ms-input-placeholder {
1728
+ color: rgba(30, 30, 30, 0.62);
1729
+ }
1730
+ .block-editor-content-only-controls__rich-text {
1731
+ border-color: #949494;
1732
+ }
1733
+ .block-editor-content-only-controls__rich-text::placeholder {
1734
+ color: color-mix(in srgb, #1e1e1e, transparent 38%);
1735
+ }
1736
+ .block-editor-content-only-controls__rich-text {
1737
+ min-height: 40px;
1738
+ padding: 12px;
1739
+ }
1740
+
1741
+ .block-editor-content-only-controls__screen.components-navigator-screen {
1742
+ padding: 8px 0 16px 0;
1743
+ }
1744
+ .block-editor-content-only-controls__screen {
1745
+ border-top: 1px solid #e0e0e0;
1746
+ }
1747
+ .block-editor-content-only-controls__screen .components-tools-panel {
1748
+ border-top: none;
1749
+ padding-top: 8px;
1750
+ }
1751
+
1752
+ .block-editor-content-only-controls__button-panel {
1753
+ padding: 4px;
1754
+ font-weight: 500 !important;
1755
+ }
1756
+
1757
+ .block-editor-content-only-controls__back-button,
1758
+ .block-editor-content-only-controls__drill-down-button {
1759
+ width: 100%;
1760
+ }
1761
+
1762
+ .block-editor-content-only-controls__fields-container {
1763
+ padding: 0 16px;
1764
+ }
1765
+
1766
+ .block-editor-content-only-controls__fields-header {
1767
+ padding: 8px 0;
1768
+ margin-bottom: 4px;
1769
+ }
1770
+
1626
1771
  .block-editor-date-format-picker {
1627
1772
  margin: 0 0 16px;
1628
1773
  padding: 0;
@@ -1656,10 +1801,6 @@ iframe[name=editor-canvas] {
1656
1801
  text-transform: capitalize;
1657
1802
  }
1658
1803
 
1659
- .block-editor-font-family-control:not(.is-next-has-no-margin-bottom) {
1660
- margin-bottom: 8px;
1661
- }
1662
-
1663
1804
  .block-editor-global-styles__toggle-icon {
1664
1805
  fill: currentColor;
1665
1806
  }
@@ -531,6 +531,10 @@ iframe[name=editor-canvas] {
531
531
  left: 50%;
532
532
  }
533
533
 
534
+ .block-editor-block-tools--is-dragging > .popover-slot {
535
+ display: none;
536
+ }
537
+
534
538
  .block-editor-block-lock-modal {
535
539
  z-index: 1000001;
536
540
  }
@@ -1623,6 +1627,147 @@ iframe[name=editor-canvas] {
1623
1627
  }
1624
1628
  }
1625
1629
 
1630
+ .block-editor-content-only-controls__link {
1631
+ width: 100%;
1632
+ box-shadow: inset 0 0 0 1px #ccc;
1633
+ }
1634
+ .block-editor-content-only-controls__link:focus:not(:disabled) {
1635
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1636
+ }
1637
+
1638
+ .block-editor-content-only-controls__link-row {
1639
+ align-items: center;
1640
+ }
1641
+
1642
+ .block-editor-content-only-controls__link-title {
1643
+ width: 100%;
1644
+ white-space: nowrap;
1645
+ text-overflow: ellipsis;
1646
+ overflow: hidden;
1647
+ }
1648
+
1649
+ .block-editor-content-only-controls__media {
1650
+ width: 100%;
1651
+ box-shadow: inset 0 0 0 1px #ccc;
1652
+ }
1653
+ .block-editor-content-only-controls__media:focus:not(:disabled) {
1654
+ box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
1655
+ }
1656
+
1657
+ .block-editor-content-only-controls__media-replace-flow {
1658
+ display: block;
1659
+ }
1660
+
1661
+ .block-editor-content-only-controls__media-row {
1662
+ align-items: center;
1663
+ }
1664
+
1665
+ .block-editor-content-only-controls__media-placeholder {
1666
+ width: 24px;
1667
+ height: 24px;
1668
+ border-radius: 2px;
1669
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
1670
+ display: inline-block;
1671
+ padding: 0;
1672
+ background: #fff linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1673
+ }
1674
+
1675
+ .block-editor-content-only-controls__media-title {
1676
+ width: 100%;
1677
+ white-space: nowrap;
1678
+ text-overflow: ellipsis;
1679
+ overflow: hidden;
1680
+ }
1681
+
1682
+ block-editor-content-only-controls__media-thumbnail {
1683
+ width: 100%;
1684
+ height: 100%;
1685
+ border-radius: 2px;
1686
+ align-self: center;
1687
+ }
1688
+
1689
+ .block-editor-content-only-controls__rich-text {
1690
+ width: 100%;
1691
+ margin: 0;
1692
+ background: #fff;
1693
+ color: #1e1e1e;
1694
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
1695
+ padding: 6px 8px;
1696
+ /* Fonts smaller than 16px causes mobile safari to zoom. */
1697
+ font-size: 16px;
1698
+ /* Override core line-height. To be reviewed. */
1699
+ line-height: normal;
1700
+ box-shadow: 0 0 0 transparent;
1701
+ border-radius: 2px;
1702
+ border: 1px solid #949494;
1703
+ }
1704
+ @media not (prefers-reduced-motion) {
1705
+ .block-editor-content-only-controls__rich-text {
1706
+ transition: box-shadow 0.1s linear;
1707
+ }
1708
+ }
1709
+ @media (min-width: 600px) {
1710
+ .block-editor-content-only-controls__rich-text {
1711
+ font-size: 13px;
1712
+ /* Override core line-height. To be reviewed. */
1713
+ line-height: normal;
1714
+ }
1715
+ }
1716
+ .block-editor-content-only-controls__rich-text:focus {
1717
+ border-color: var(--wp-admin-theme-color, #3858e9);
1718
+ box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color, #3858e9);
1719
+ outline: 2px solid transparent;
1720
+ }
1721
+ .block-editor-content-only-controls__rich-text::-webkit-input-placeholder {
1722
+ color: rgba(30, 30, 30, 0.62);
1723
+ }
1724
+ .block-editor-content-only-controls__rich-text::-moz-placeholder {
1725
+ color: rgba(30, 30, 30, 0.62);
1726
+ }
1727
+ .block-editor-content-only-controls__rich-text:-ms-input-placeholder {
1728
+ color: rgba(30, 30, 30, 0.62);
1729
+ }
1730
+ .block-editor-content-only-controls__rich-text {
1731
+ border-color: #949494;
1732
+ }
1733
+ .block-editor-content-only-controls__rich-text::placeholder {
1734
+ color: color-mix(in srgb, #1e1e1e, transparent 38%);
1735
+ }
1736
+ .block-editor-content-only-controls__rich-text {
1737
+ min-height: 40px;
1738
+ padding: 12px;
1739
+ }
1740
+
1741
+ .block-editor-content-only-controls__screen.components-navigator-screen {
1742
+ padding: 8px 0 16px 0;
1743
+ }
1744
+ .block-editor-content-only-controls__screen {
1745
+ border-top: 1px solid #e0e0e0;
1746
+ }
1747
+ .block-editor-content-only-controls__screen .components-tools-panel {
1748
+ border-top: none;
1749
+ padding-top: 8px;
1750
+ }
1751
+
1752
+ .block-editor-content-only-controls__button-panel {
1753
+ padding: 4px;
1754
+ font-weight: 500 !important;
1755
+ }
1756
+
1757
+ .block-editor-content-only-controls__back-button,
1758
+ .block-editor-content-only-controls__drill-down-button {
1759
+ width: 100%;
1760
+ }
1761
+
1762
+ .block-editor-content-only-controls__fields-container {
1763
+ padding: 0 16px;
1764
+ }
1765
+
1766
+ .block-editor-content-only-controls__fields-header {
1767
+ padding: 8px 0;
1768
+ margin-bottom: 4px;
1769
+ }
1770
+
1626
1771
  .block-editor-date-format-picker {
1627
1772
  margin: 0 0 16px;
1628
1773
  padding: 0;
@@ -1656,10 +1801,6 @@ iframe[name=editor-canvas] {
1656
1801
  text-transform: capitalize;
1657
1802
  }
1658
1803
 
1659
- .block-editor-font-family-control:not(.is-next-has-no-margin-bottom) {
1660
- margin-bottom: 8px;
1661
- }
1662
-
1663
1804
  .block-editor-global-styles__toggle-icon {
1664
1805
  fill: currentColor;
1665
1806
  }
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.9.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -55,41 +55,42 @@
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.36.0",
59
+ "@wordpress/api-fetch": "^7.36.0",
60
+ "@wordpress/base-styles": "^6.12.0",
61
+ "@wordpress/blob": "^4.36.0",
62
+ "@wordpress/block-serialization-default-parser": "^5.36.0",
63
+ "@wordpress/blocks": "^15.9.0",
64
+ "@wordpress/commands": "^1.36.0",
65
+ "@wordpress/components": "^30.9.0",
66
+ "@wordpress/compose": "^7.36.0",
67
+ "@wordpress/data": "^10.36.0",
68
+ "@wordpress/dataviews": "^11.0.0",
69
+ "@wordpress/date": "^5.36.0",
70
+ "@wordpress/deprecated": "^4.36.0",
71
+ "@wordpress/dom": "^4.36.0",
72
+ "@wordpress/element": "^6.36.0",
73
+ "@wordpress/escape-html": "^3.36.0",
74
+ "@wordpress/global-styles-engine": "^1.3.0",
75
+ "@wordpress/hooks": "^4.36.0",
76
+ "@wordpress/html-entities": "^4.36.0",
77
+ "@wordpress/i18n": "^6.9.0",
78
+ "@wordpress/icons": "^11.3.0",
79
+ "@wordpress/interactivity": "^6.36.0",
80
+ "@wordpress/is-shallow-equal": "^5.36.0",
81
+ "@wordpress/keyboard-shortcuts": "^5.36.0",
82
+ "@wordpress/keycodes": "^4.36.0",
83
+ "@wordpress/notices": "^5.36.0",
84
+ "@wordpress/preferences": "^4.36.0",
85
+ "@wordpress/priority-queue": "^3.36.0",
86
+ "@wordpress/private-apis": "^1.36.0",
87
+ "@wordpress/rich-text": "^7.36.0",
88
+ "@wordpress/style-engine": "^2.36.0",
89
+ "@wordpress/token-list": "^3.36.0",
90
+ "@wordpress/upload-media": "^0.21.0",
91
+ "@wordpress/url": "^4.36.0",
92
+ "@wordpress/warning": "^3.36.0",
93
+ "@wordpress/wordcount": "^4.36.0",
93
94
  "change-case": "^4.1.2",
94
95
  "clsx": "^2.1.1",
95
96
  "colord": "^2.7.0",
@@ -112,5 +113,5 @@
112
113
  "publishConfig": {
113
114
  "access": "public"
114
115
  },
115
- "gitHead": "59a9383612bbe16e21af84d13b035bfbca7fe833"
116
+ "gitHead": "b35cf1a2dce04665e99fd6b9c2891c0b336361b9"
116
117
  }
@@ -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,
@@ -222,6 +222,11 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
222
222
  cursor: grab;
223
223
  }
224
224
 
225
+ // Dragging multi selected blocks is not supported yet.
226
+ &.is-multi-selected {
227
+ cursor: default;
228
+ }
229
+
225
230
  &[contenteditable],
226
231
  [contenteditable] {
227
232
  cursor: text;
@@ -226,6 +226,8 @@ function Items( {
226
226
  rootClientId === selectedBlockClientId
227
227
  );
228
228
 
229
+ const templateLock = getTemplateLock( rootClientId );
230
+
229
231
  return {
230
232
  order: _order,
231
233
  selectedBlocks: selectedBlockClientIds,
@@ -238,7 +240,7 @@ function Items( {
238
240
  rootClientId
239
241
  ) ) &&
240
242
  getBlockEditingMode( rootClientId ) !== 'disabled' &&
241
- ! getTemplateLock( rootClientId ) &&
243
+ ( ! templateLock || templateLock === 'contentOnly' ) &&
242
244
  hasAppender &&
243
245
  ! _isZoomOut() &&
244
246
  ( hasCustomAppender ||
@@ -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 } ),