@wordpress/block-editor 15.22.1-next.v.202606191442.0 → 15.22.1

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 (352) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +2 -2
  3. package/build/components/block-editing-mode/index.cjs +13 -7
  4. package/build/components/block-editing-mode/index.cjs.map +2 -2
  5. package/build/components/block-inspector/index.cjs +32 -16
  6. package/build/components/block-inspector/index.cjs.map +2 -2
  7. package/build/components/block-rename/modal.cjs +0 -1
  8. package/build/components/block-rename/modal.cjs.map +2 -2
  9. package/build/components/block-toolbar/block-toolbar-icon.cjs +14 -6
  10. package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
  11. package/build/components/colors-gradients/control.cjs +25 -14
  12. package/build/components/colors-gradients/control.cjs.map +2 -2
  13. package/build/components/colors-gradients/dropdown.cjs +4 -1
  14. package/build/components/colors-gradients/dropdown.cjs.map +3 -3
  15. package/build/components/contrast-checker/index.cjs +22 -4
  16. package/build/components/contrast-checker/index.cjs.map +2 -2
  17. package/build/components/date-format-picker/index.cjs +0 -1
  18. package/build/components/date-format-picker/index.cjs.map +2 -2
  19. package/build/components/global-styles/background-panel.cjs +153 -25
  20. package/build/components/global-styles/background-panel.cjs.map +3 -3
  21. package/build/components/global-styles/color-gradient-dropdown-item.cjs +227 -0
  22. package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +7 -0
  23. package/build/components/global-styles/color-panel.cjs +98 -375
  24. package/build/components/global-styles/color-panel.cjs.map +3 -3
  25. package/build/components/global-styles/dimensions-panel.cjs +0 -3
  26. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  27. package/build/components/global-styles/hooks.cjs +34 -0
  28. package/build/components/global-styles/hooks.cjs.map +2 -2
  29. package/build/components/global-styles/typography-panel.cjs +82 -10
  30. package/build/components/global-styles/typography-panel.cjs.map +3 -3
  31. package/build/components/inspector-controls/groups.cjs +2 -0
  32. package/build/components/inspector-controls/groups.cjs.map +2 -2
  33. package/build/components/inspector-controls-tabs/styles-tab.cjs +75 -31
  34. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  35. package/build/components/link-control/index.cjs +1 -2
  36. package/build/components/link-control/index.cjs.map +2 -2
  37. package/build/components/list-view/block-select-button.cjs +1 -10
  38. package/build/components/list-view/block-select-button.cjs.map +3 -3
  39. package/build/components/provider/use-block-sync.cjs +3 -1
  40. package/build/components/provider/use-block-sync.cjs.map +2 -2
  41. package/build/components/url-popover/image-url-input-ui.cjs +0 -2
  42. package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
  43. package/build/components/use-block-display-information/index.cjs +10 -3
  44. package/build/components/use-block-display-information/index.cjs.map +2 -2
  45. package/build/hooks/anchor.cjs +0 -1
  46. package/build/hooks/anchor.cjs.map +2 -2
  47. package/build/hooks/background.cjs +124 -75
  48. package/build/hooks/background.cjs.map +3 -3
  49. package/build/hooks/color.cjs +0 -162
  50. package/build/hooks/color.cjs.map +3 -3
  51. package/build/hooks/contrast-checker.cjs +31 -28
  52. package/build/hooks/contrast-checker.cjs.map +3 -3
  53. package/build/hooks/custom-class-name.cjs +0 -1
  54. package/build/hooks/custom-class-name.cjs.map +2 -2
  55. package/build/hooks/elements.cjs +142 -0
  56. package/build/hooks/elements.cjs.map +7 -0
  57. package/build/hooks/grid-visualizer.cjs +21 -11
  58. package/build/hooks/grid-visualizer.cjs.map +2 -2
  59. package/build/hooks/layout-child.cjs +38 -8
  60. package/build/hooks/layout-child.cjs.map +2 -2
  61. package/build/hooks/layout.cjs +6 -3
  62. package/build/hooks/layout.cjs.map +2 -2
  63. package/build/hooks/states.cjs +2 -2
  64. package/build/hooks/states.cjs.map +2 -2
  65. package/build/hooks/style.cjs +8 -4
  66. package/build/hooks/style.cjs.map +2 -2
  67. package/build/hooks/typography.cjs +62 -10
  68. package/build/hooks/typography.cjs.map +3 -3
  69. package/build/layouts/flex.cjs +99 -6
  70. package/build/layouts/flex.cjs.map +2 -2
  71. package/build/utils/block-bindings.cjs +9 -9
  72. package/build/utils/block-bindings.cjs.map +3 -3
  73. package/build/utils/color-values.cjs +10 -1
  74. package/build/utils/color-values.cjs.map +3 -3
  75. package/build/utils/dom.cjs +2 -5
  76. package/build/utils/dom.cjs.map +3 -3
  77. package/build/utils/fit-text-frontend.cjs +6 -2
  78. package/build/utils/fit-text-frontend.cjs.map +3 -3
  79. package/build/utils/fit-text-utils.cjs +1 -1
  80. package/build/utils/fit-text-utils.cjs.map +3 -3
  81. package/build/utils/format-font-style.cjs +1 -1
  82. package/build/utils/format-font-style.cjs.map +3 -3
  83. package/build/utils/format-font-weight.cjs +1 -1
  84. package/build/utils/format-font-weight.cjs.map +3 -3
  85. package/build/utils/get-editor-region.cjs +4 -2
  86. package/build/utils/get-editor-region.cjs.map +3 -3
  87. package/build/utils/get-font-styles-and-weights.cjs +8 -12
  88. package/build/utils/get-font-styles-and-weights.cjs.map +3 -3
  89. package/build/utils/get-px-from-css-unit.cjs +1 -1
  90. package/build/utils/get-px-from-css-unit.cjs.map +1 -1
  91. package/build/utils/index.cjs +1 -1
  92. package/build/utils/index.cjs.map +1 -1
  93. package/build/utils/math.cjs +1 -1
  94. package/build/utils/math.cjs.map +3 -3
  95. package/build/utils/object.cjs +8 -8
  96. package/build/utils/object.cjs.map +3 -3
  97. package/build/utils/order-inserter-block-items.cjs +1 -1
  98. package/build/utils/order-inserter-block-items.cjs.map +3 -3
  99. package/build/utils/pasting.cjs +4 -2
  100. package/build/utils/pasting.cjs.map +3 -3
  101. package/build/utils/selection.cjs +2 -1
  102. package/build/utils/selection.cjs.map +3 -3
  103. package/build/utils/sorting.cjs +9 -3
  104. package/build/utils/sorting.cjs.map +3 -3
  105. package/build/utils/transform-styles/index.cjs +3 -2
  106. package/build/utils/transform-styles/index.cjs.map +3 -3
  107. package/build/utils/transform-styles/postcss-urlrebase.d.cjs +2 -0
  108. package/build/utils/transform-styles/postcss-urlrebase.d.cjs.map +7 -0
  109. package/build/utils/transform-styles/types.cjs +19 -0
  110. package/build/utils/transform-styles/types.cjs.map +7 -0
  111. package/build/utils/types.cjs +19 -0
  112. package/build/utils/types.cjs.map +7 -0
  113. package/build-module/components/block-editing-mode/index.mjs +14 -8
  114. package/build-module/components/block-editing-mode/index.mjs.map +2 -2
  115. package/build-module/components/block-inspector/index.mjs +32 -16
  116. package/build-module/components/block-inspector/index.mjs.map +2 -2
  117. package/build-module/components/block-rename/modal.mjs +0 -1
  118. package/build-module/components/block-rename/modal.mjs.map +2 -2
  119. package/build-module/components/block-toolbar/block-toolbar-icon.mjs +14 -6
  120. package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
  121. package/build-module/components/colors-gradients/control.mjs +27 -15
  122. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  123. package/build-module/components/colors-gradients/dropdown.mjs +4 -1
  124. package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
  125. package/build-module/components/contrast-checker/index.mjs +18 -4
  126. package/build-module/components/contrast-checker/index.mjs.map +2 -2
  127. package/build-module/components/date-format-picker/index.mjs +0 -1
  128. package/build-module/components/date-format-picker/index.mjs.map +2 -2
  129. package/build-module/components/global-styles/background-panel.mjs +155 -27
  130. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  131. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +207 -0
  132. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +7 -0
  133. package/build-module/components/global-styles/color-panel.mjs +106 -387
  134. package/build-module/components/global-styles/color-panel.mjs.map +3 -3
  135. package/build-module/components/global-styles/dimensions-panel.mjs +0 -3
  136. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  137. package/build-module/components/global-styles/hooks.mjs +33 -0
  138. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  139. package/build-module/components/global-styles/typography-panel.mjs +84 -10
  140. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  141. package/build-module/components/inspector-controls/groups.mjs +2 -0
  142. package/build-module/components/inspector-controls/groups.mjs.map +2 -2
  143. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +75 -31
  144. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  145. package/build-module/components/link-control/index.mjs +1 -2
  146. package/build-module/components/link-control/index.mjs.map +2 -2
  147. package/build-module/components/list-view/block-select-button.mjs +2 -17
  148. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  149. package/build-module/components/provider/use-block-sync.mjs +3 -1
  150. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  151. package/build-module/components/url-popover/image-url-input-ui.mjs +0 -2
  152. package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
  153. package/build-module/components/use-block-display-information/index.mjs +10 -3
  154. package/build-module/components/use-block-display-information/index.mjs.map +2 -2
  155. package/build-module/hooks/anchor.mjs +0 -1
  156. package/build-module/hooks/anchor.mjs.map +2 -2
  157. package/build-module/hooks/background.mjs +123 -75
  158. package/build-module/hooks/background.mjs.map +2 -2
  159. package/build-module/hooks/color.mjs +2 -175
  160. package/build-module/hooks/color.mjs.map +2 -2
  161. package/build-module/hooks/contrast-checker.mjs +32 -19
  162. package/build-module/hooks/contrast-checker.mjs.map +2 -2
  163. package/build-module/hooks/custom-class-name.mjs +0 -1
  164. package/build-module/hooks/custom-class-name.mjs.map +2 -2
  165. package/build-module/hooks/elements.mjs +115 -0
  166. package/build-module/hooks/elements.mjs.map +7 -0
  167. package/build-module/hooks/grid-visualizer.mjs +21 -11
  168. package/build-module/hooks/grid-visualizer.mjs.map +2 -2
  169. package/build-module/hooks/layout-child.mjs +41 -8
  170. package/build-module/hooks/layout-child.mjs.map +2 -2
  171. package/build-module/hooks/layout.mjs +6 -3
  172. package/build-module/hooks/layout.mjs.map +2 -2
  173. package/build-module/hooks/states.mjs +2 -2
  174. package/build-module/hooks/states.mjs.map +2 -2
  175. package/build-module/hooks/style.mjs +9 -5
  176. package/build-module/hooks/style.mjs.map +2 -2
  177. package/build-module/hooks/typography.mjs +62 -10
  178. package/build-module/hooks/typography.mjs.map +2 -2
  179. package/build-module/layouts/flex.mjs +105 -7
  180. package/build-module/layouts/flex.mjs.map +2 -2
  181. package/build-module/utils/block-bindings.mjs +9 -9
  182. package/build-module/utils/block-bindings.mjs.map +3 -3
  183. package/build-module/utils/color-values.mjs +9 -1
  184. package/build-module/utils/color-values.mjs.map +3 -3
  185. package/build-module/utils/dom.mjs +2 -5
  186. package/build-module/utils/dom.mjs.map +3 -3
  187. package/build-module/utils/fit-text-frontend.mjs +6 -2
  188. package/build-module/utils/fit-text-frontend.mjs.map +3 -3
  189. package/build-module/utils/fit-text-utils.mjs +1 -1
  190. package/build-module/utils/fit-text-utils.mjs.map +3 -3
  191. package/build-module/utils/format-font-style.mjs +1 -1
  192. package/build-module/utils/format-font-style.mjs.map +3 -3
  193. package/build-module/utils/format-font-weight.mjs +1 -1
  194. package/build-module/utils/format-font-weight.mjs.map +3 -3
  195. package/build-module/utils/get-editor-region.mjs +4 -2
  196. package/build-module/utils/get-editor-region.mjs.map +3 -3
  197. package/build-module/utils/get-font-styles-and-weights.mjs +8 -12
  198. package/build-module/utils/get-font-styles-and-weights.mjs.map +3 -3
  199. package/build-module/utils/get-px-from-css-unit.mjs +1 -1
  200. package/build-module/utils/get-px-from-css-unit.mjs.map +1 -1
  201. package/build-module/utils/index.mjs +1 -1
  202. package/build-module/utils/index.mjs.map +1 -1
  203. package/build-module/utils/math.mjs +1 -1
  204. package/build-module/utils/math.mjs.map +3 -3
  205. package/build-module/utils/object.mjs +8 -8
  206. package/build-module/utils/object.mjs.map +3 -3
  207. package/build-module/utils/order-inserter-block-items.mjs +1 -1
  208. package/build-module/utils/order-inserter-block-items.mjs.map +3 -3
  209. package/build-module/utils/pasting.mjs +4 -2
  210. package/build-module/utils/pasting.mjs.map +3 -3
  211. package/build-module/utils/selection.mjs +2 -1
  212. package/build-module/utils/selection.mjs.map +3 -3
  213. package/build-module/utils/sorting.mjs +9 -3
  214. package/build-module/utils/sorting.mjs.map +3 -3
  215. package/build-module/utils/transform-styles/index.mjs +3 -2
  216. package/build-module/utils/transform-styles/index.mjs.map +3 -3
  217. package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs +1 -0
  218. package/build-module/utils/transform-styles/postcss-urlrebase.d.mjs.map +7 -0
  219. package/build-module/utils/transform-styles/types.mjs +1 -0
  220. package/build-module/utils/transform-styles/types.mjs.map +7 -0
  221. package/build-module/utils/types.mjs +1 -0
  222. package/build-module/utils/types.mjs.map +7 -0
  223. package/build-style/content-rtl.css +2 -0
  224. package/build-style/content.css +2 -0
  225. package/build-style/style-rtl.css +34 -41
  226. package/build-style/style.css +34 -41
  227. package/build-types/utils/block-bindings.d.ts +27 -0
  228. package/build-types/utils/block-bindings.d.ts.map +1 -0
  229. package/build-types/utils/color-values.d.ts +40 -0
  230. package/build-types/utils/color-values.d.ts.map +1 -0
  231. package/build-types/utils/dom.d.ts +19 -19
  232. package/build-types/utils/dom.d.ts.map +1 -1
  233. package/build-types/utils/fit-text-frontend.d.ts +7 -0
  234. package/build-types/utils/fit-text-frontend.d.ts.map +1 -0
  235. package/build-types/utils/fit-text-utils.d.ts +15 -0
  236. package/build-types/utils/fit-text-utils.d.ts.map +1 -0
  237. package/build-types/utils/format-font-style.d.ts +12 -0
  238. package/build-types/utils/format-font-style.d.ts.map +1 -0
  239. package/build-types/utils/format-font-weight.d.ts +12 -0
  240. package/build-types/utils/format-font-weight.d.ts.map +1 -0
  241. package/build-types/utils/get-editor-region.d.ts +9 -0
  242. package/build-types/utils/get-editor-region.d.ts.map +1 -0
  243. package/build-types/utils/get-font-styles-and-weights.d.ts +16 -0
  244. package/build-types/utils/get-font-styles-and-weights.d.ts.map +1 -0
  245. package/build-types/utils/get-px-from-css-unit.d.ts +10 -0
  246. package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -0
  247. package/build-types/utils/index.d.ts +3 -0
  248. package/build-types/utils/index.d.ts.map +1 -0
  249. package/build-types/utils/math.d.ts +61 -0
  250. package/build-types/utils/math.d.ts.map +1 -0
  251. package/build-types/utils/object.d.ts +39 -0
  252. package/build-types/utils/object.d.ts.map +1 -0
  253. package/build-types/utils/order-inserter-block-items.d.ts +13 -0
  254. package/build-types/utils/order-inserter-block-items.d.ts.map +1 -0
  255. package/build-types/utils/pasting.d.ts +28 -0
  256. package/build-types/utils/pasting.d.ts.map +1 -0
  257. package/build-types/utils/selection.d.ts +21 -0
  258. package/build-types/utils/selection.d.ts.map +1 -0
  259. package/build-types/utils/sorting.d.ts +17 -0
  260. package/build-types/utils/sorting.d.ts.map +1 -0
  261. package/build-types/utils/transform-styles/index.d.ts +15 -0
  262. package/build-types/utils/transform-styles/index.d.ts.map +1 -0
  263. package/build-types/utils/transform-styles/types.d.ts +13 -0
  264. package/build-types/utils/transform-styles/types.d.ts.map +1 -0
  265. package/build-types/utils/types.d.ts +28 -0
  266. package/build-types/utils/types.d.ts.map +1 -0
  267. package/package.json +40 -39
  268. package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -0
  269. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -0
  270. package/src/components/block-editing-mode/index.js +17 -9
  271. package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -0
  272. package/src/components/block-inspector/index.js +20 -10
  273. package/src/components/block-rename/modal.js +0 -1
  274. package/src/components/block-toolbar/block-toolbar-icon.js +22 -6
  275. package/src/components/block-toolbar/test/block-toolbar-icon.js +99 -0
  276. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +4 -0
  277. package/src/components/colors-gradients/control.js +29 -12
  278. package/src/components/colors-gradients/dropdown.js +4 -1
  279. package/src/components/colors-gradients/style.scss +39 -2
  280. package/src/components/contrast-checker/README.md +9 -0
  281. package/src/components/contrast-checker/index.js +42 -3
  282. package/src/components/date-format-picker/index.js +0 -1
  283. package/src/components/default-block-appender/content.scss +3 -0
  284. package/src/components/global-styles/background-panel.js +201 -34
  285. package/src/components/global-styles/color-gradient-dropdown-item.js +258 -0
  286. package/src/components/global-styles/color-panel.js +125 -487
  287. package/src/components/global-styles/dimensions-panel.js +0 -3
  288. package/src/components/global-styles/hooks.js +45 -0
  289. package/src/components/global-styles/test/background-panel.js +56 -0
  290. package/src/components/global-styles/test/color-panel.js +172 -118
  291. package/src/components/global-styles/test/typography-panel.js +167 -0
  292. package/src/components/global-styles/typography-panel.js +100 -11
  293. package/src/components/inspector-controls/README.md +0 -2
  294. package/src/components/inspector-controls/groups.js +2 -0
  295. package/src/components/inspector-controls-tabs/styles-tab.js +74 -28
  296. package/src/components/link-control/index.js +0 -1
  297. package/src/components/link-control/test/index.js +2 -3
  298. package/src/components/list-view/block-select-button.js +2 -17
  299. package/src/components/provider/use-block-sync.js +3 -1
  300. package/src/components/rich-text/content.scss +2 -0
  301. package/src/components/url-popover/image-url-input-ui.js +0 -2
  302. package/src/components/use-block-display-information/index.js +15 -2
  303. package/src/components/use-block-display-information/test/index.js +140 -0
  304. package/src/hooks/anchor.js +0 -1
  305. package/src/hooks/background.js +210 -133
  306. package/src/hooks/background.scss +0 -35
  307. package/src/hooks/color.js +2 -205
  308. package/src/hooks/color.scss +3 -9
  309. package/src/hooks/contrast-checker.js +60 -17
  310. package/src/hooks/custom-class-name.js +0 -1
  311. package/src/hooks/elements.js +140 -0
  312. package/src/hooks/elements.scss +8 -0
  313. package/src/hooks/grid-visualizer.js +59 -45
  314. package/src/hooks/layout-child.js +51 -12
  315. package/src/hooks/layout.js +6 -3
  316. package/src/hooks/states.js +2 -2
  317. package/src/hooks/style.js +11 -7
  318. package/src/hooks/test/background.js +59 -0
  319. package/src/hooks/test/block-style-state.js +14 -14
  320. package/src/hooks/test/layout.js +6 -6
  321. package/src/hooks/test/style.js +8 -8
  322. package/src/hooks/typography.js +70 -6
  323. package/src/layouts/flex.js +118 -15
  324. package/src/store/test/private-selectors.js +28 -7
  325. package/src/store/test/reducer.js +61 -10
  326. package/src/style.scss +1 -0
  327. package/src/utils/block-bindings.ts +51 -0
  328. package/src/utils/color-values.ts +63 -0
  329. package/src/utils/{dom.js → dom.ts} +27 -27
  330. package/src/utils/{fit-text-frontend.js → fit-text-frontend.ts} +12 -4
  331. package/src/utils/{fit-text-utils.js → fit-text-utils.ts} +15 -7
  332. package/src/utils/{format-font-style.js → format-font-style.ts} +10 -3
  333. package/src/utils/{format-font-weight.js → format-font-weight.ts} +10 -3
  334. package/src/utils/{get-editor-region.js → get-editor-region.ts} +10 -6
  335. package/src/utils/{get-font-styles-and-weights.js → get-font-styles-and-weights.ts} +21 -17
  336. package/src/utils/{math.js → math.ts} +37 -30
  337. package/src/utils/object.ts +89 -0
  338. package/src/utils/{order-inserter-block-items.js → order-inserter-block-items.ts} +8 -5
  339. package/src/utils/{pasting.js → pasting.ts} +18 -11
  340. package/src/utils/{selection.js → selection.ts} +11 -4
  341. package/src/utils/sorting.ts +81 -0
  342. package/src/utils/test/color-values.js +44 -1
  343. package/src/utils/transform-styles/{index.js → index.ts} +25 -25
  344. package/src/utils/transform-styles/postcss-urlrebase.d.ts +15 -0
  345. package/src/utils/transform-styles/types.ts +13 -0
  346. package/src/utils/types.ts +29 -0
  347. package/src/utils/block-bindings.js +0 -46
  348. package/src/utils/color-values.js +0 -28
  349. package/src/utils/object.js +0 -67
  350. package/src/utils/sorting.js +0 -54
  351. /package/src/utils/{get-px-from-css-unit.js → get-px-from-css-unit.ts} +0 -0
  352. /package/src/utils/{index.js → index.ts} +0 -0
@@ -1519,14 +1519,22 @@ iframe[name=editor-canvas] {
1519
1519
  background: linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1520
1520
  }
1521
1521
 
1522
+ .block-editor-panel-color-gradient-settings__contrast-notice {
1523
+ margin-bottom: 16px;
1524
+ }
1525
+
1522
1526
  /**
1523
1527
  * The following styles replicate the separated border of the
1524
1528
  * `ItemGroup` component but allows for hidden items. This is because
1525
1529
  * to maintain the order of `ToolsPanel` controls, each `ToolsPanelItem`
1526
1530
  * must at least render a placeholder which would otherwise interfere
1527
1531
  * with the `:last-child` styles.
1532
+ *
1533
+ * Applied via the shared `block-editor-color-gradient-item` class on
1534
+ * color/gradient dropdown items across the Color, Background, and
1535
+ * Typography panels.
1528
1536
  */
1529
- .block-editor-tools-panel-color-gradient-settings__item {
1537
+ .block-editor-color-gradient-item {
1530
1538
  padding: 0;
1531
1539
  max-width: 100%;
1532
1540
  position: relative;
@@ -1534,18 +1542,17 @@ iframe[name=editor-canvas] {
1534
1542
  border-right: 1px solid #ddd;
1535
1543
  border-bottom: 1px solid #ddd;
1536
1544
  }
1537
- .block-editor-tools-panel-color-gradient-settings__item:nth-child(1 of .block-editor-tools-panel-color-gradient-settings__item) {
1538
- margin-top: 24px;
1545
+ .block-editor-color-gradient-item:nth-child(1 of .block-editor-color-gradient-item) {
1539
1546
  border-top-left-radius: 2px;
1540
1547
  border-top-right-radius: 2px;
1541
1548
  border-top: 1px solid #ddd;
1542
1549
  }
1543
- .block-editor-tools-panel-color-gradient-settings__item:nth-last-child(1 of .block-editor-tools-panel-color-gradient-settings__item) {
1550
+ .block-editor-color-gradient-item:nth-last-child(1 of .block-editor-color-gradient-item) {
1544
1551
  border-bottom-left-radius: 2px;
1545
1552
  border-bottom-right-radius: 2px;
1546
1553
  }
1547
- .block-editor-tools-panel-color-gradient-settings__item > div,
1548
- .block-editor-tools-panel-color-gradient-settings__item > div > button {
1554
+ .block-editor-color-gradient-item > div,
1555
+ .block-editor-color-gradient-item > div > button {
1549
1556
  border-radius: inherit;
1550
1557
  }
1551
1558
 
@@ -1569,6 +1576,9 @@ iframe[name=editor-canvas] {
1569
1576
  text-overflow: ellipsis;
1570
1577
  max-width: calc(100% - 44px);
1571
1578
  }
1579
+ .block-editor-tools-panel-color-gradient-settings__dropdown > button.has-contrast-warning .block-editor-panel-color-gradient-settings__color-name {
1580
+ max-width: calc(100% - 72px);
1581
+ }
1572
1582
 
1573
1583
  .block-editor-panel-color-gradient-settings__dropdown {
1574
1584
  width: 100%;
@@ -1600,6 +1610,19 @@ iframe[name=editor-canvas] {
1600
1610
  opacity: 1;
1601
1611
  }
1602
1612
  }
1613
+ .block-editor-panel-color-gradient-settings__dropdown.has-contrast-warning + .block-editor-panel-color-gradient-settings__reset {
1614
+ right: 28px;
1615
+ }
1616
+
1617
+ .block-editor-panel-color-gradient-settings__contrast-warning {
1618
+ position: absolute;
1619
+ right: 0;
1620
+ top: 8px;
1621
+ margin: auto 8px auto;
1622
+ }
1623
+ .block-editor-panel-color-gradient-settings__contrast-warning.block-editor-panel-color-gradient-settings__contrast-warning {
1624
+ border-radius: 2px;
1625
+ }
1603
1626
 
1604
1627
  .block-editor-date-format-picker {
1605
1628
  margin: 0 0 16px;
@@ -3412,33 +3435,6 @@ iframe[name=editor-canvas] {
3412
3435
  font-size: 12px;
3413
3436
  }
3414
3437
 
3415
- /**
3416
- * ItemGroup-like border styles for the background panel's ToolsPanelItems.
3417
- * Replicates the separated border of the `ItemGroup` component while
3418
- * allowing for hidden placeholder items (same approach as the color panel).
3419
- */
3420
- .block-editor-background-panel__item {
3421
- padding: 0;
3422
- max-width: 100%;
3423
- position: relative;
3424
- border-left: 1px solid #ddd;
3425
- border-right: 1px solid #ddd;
3426
- border-bottom: 1px solid #ddd;
3427
- }
3428
- .block-editor-background-panel__item:nth-child(1 of .block-editor-background-panel__item) {
3429
- border-top-left-radius: 2px;
3430
- border-top-right-radius: 2px;
3431
- border-top: 1px solid #ddd;
3432
- }
3433
- .block-editor-background-panel__item:nth-last-child(1 of .block-editor-background-panel__item) {
3434
- border-bottom-left-radius: 2px;
3435
- border-bottom-right-radius: 2px;
3436
- }
3437
- .block-editor-background-panel__item > div,
3438
- .block-editor-background-panel__item > div > button {
3439
- border-radius: inherit;
3440
- }
3441
-
3442
3438
  .background-block-support-panel {
3443
3439
  /* Increased specificity required to remove the slot wrapper's row gap */
3444
3440
  }
@@ -3653,15 +3649,12 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3653
3649
  .color-block-support-panel.color-block-support-panel .color-block-support-panel__inner-wrapper {
3654
3650
  row-gap: 0;
3655
3651
  }
3656
- .color-block-support-panel {
3657
- /**
3658
- * After converting PanelColorGradientSettings to render as a ToolsPanel
3659
- * we need to remove the top margin when wrapping inner content due to
3660
- * rendering via SlotFills.
3661
- */
3652
+
3653
+ .elements-block-support-panel {
3654
+ /* Increased specificity required to remove the slot wrapper's row gap */
3662
3655
  }
3663
- .color-block-support-panel .block-editor-tools-panel-color-gradient-settings__item.first {
3664
- margin-top: 0;
3656
+ .elements-block-support-panel.elements-block-support-panel .elements-block-support-panel__inner-wrapper {
3657
+ row-gap: 0;
3665
3658
  }
3666
3659
 
3667
3660
  .dimensions-block-support-panel .single-column {
@@ -0,0 +1,27 @@
1
+ type Binding = {
2
+ source?: string;
3
+ };
4
+ type Bindings = Record<string, Binding>;
5
+ /**
6
+ * Checks if the block has the `__default` binding for pattern overrides.
7
+ *
8
+ * @param bindings A block's bindings from the metadata attribute.
9
+ *
10
+ * @return Whether the block has the `__default` binding for pattern overrides.
11
+ */
12
+ export declare function hasPatternOverridesDefaultBinding(bindings: Bindings | undefined | null): bindings is Bindings;
13
+ /**
14
+ * Returns the bindings with the `__default` binding for pattern overrides
15
+ * replaced with the full-set of supported attributes. e.g.:
16
+ *
17
+ * - bindings passed in: `{ __default: { source: 'core/pattern-overrides' } }`
18
+ * - bindings returned: `{ content: { source: 'core/pattern-overrides' } }`
19
+ *
20
+ * @param bindings A block's bindings from the metadata attribute.
21
+ * @param supportedAttributes The block's attributes which are supported by block bindings.
22
+ *
23
+ * @return The bindings with default replaced for pattern overrides.
24
+ */
25
+ export declare function replacePatternOverridesDefaultBinding(bindings: Bindings | undefined | null, supportedAttributes: string[]): Bindings | null | undefined;
26
+ export {};
27
+ //# sourceMappingURL=block-bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-bindings.d.ts","sourceRoot":"","sources":["../../src/utils/block-bindings.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACnC,KAAK,QAAQ,GAAG,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAC;AAK1C;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAChD,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,GACnC,QAAQ,IAAI,QAAQ,CAEtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qCAAqC,CACpD,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,EACrC,mBAAmB,EAAE,MAAM,EAAE,+BAiB7B"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Extracts the palette slug from a style value for any preset type, supporting
3
+ * both the user preset format and the theme CSS-variable format:
4
+ *
5
+ * - User format: `var:preset|<type>|slug`
6
+ * - Theme format: `var(--wp--preset--<type>--slug)`
7
+ *
8
+ * Returns `undefined` for plain values, non-strings, or any other
9
+ * unrecognised format.
10
+ *
11
+ * @param rawValue Raw style value stored in the style object.
12
+ * @param type Preset type, e.g. `'color'` or `'gradient'`.
13
+ * @return The palette slug, or undefined.
14
+ */
15
+ export declare function extractPresetSlug(rawValue: unknown, type: 'color' | 'gradient'): string | undefined;
16
+ /**
17
+ * Encodes a color value for storage in the style object.
18
+ *
19
+ * When a `slug` is provided it is used directly (the slug-based selection
20
+ * path). This is important because two palette entries can share the same
21
+ * hex value (e.g. two custom colors both set to `#e10000`); relying on a
22
+ * hex lookup alone would collapse them onto whichever entry appears first
23
+ * in the palette and silently discard the user's actual choice. Only when
24
+ * no slug is supplied does the function fall back to matching the hex value
25
+ * against the palette; if a match is found the slug is encoded, otherwise
26
+ * the raw value is stored as-is.
27
+ *
28
+ * Callers pass the flattened palette (`allColors`), typically computed once
29
+ * per render from the per-origin `colors` array.
30
+ *
31
+ * @param allColors Flat array of `{ color, slug }` objects.
32
+ * @param colorValue Hex or CSS color string.
33
+ * @param slug Optional palette slug from slug-aware selection.
34
+ * @return Encoded value suitable for the style object.
35
+ */
36
+ export declare function encodeColorValueWithPalette(allColors: {
37
+ color: string;
38
+ slug: string;
39
+ }[], colorValue?: string, slug?: string): string | undefined;
40
+ //# sourceMappingURL=color-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-values.d.ts","sourceRoot":"","sources":["../../src/utils/color-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,OAAO,GAAG,UAAU,sBAc1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,2BAA2B,CAC1C,SAAS,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EAC5C,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,MAAM,sBAOb"}
@@ -1,45 +1,45 @@
1
1
  /**
2
2
  * Returns true if two elements are contained within the same block.
3
3
  *
4
- * @param {Element} a First element.
5
- * @param {Element} b Second element.
4
+ * @param a First element.
5
+ * @param b Second element.
6
6
  *
7
- * @return {boolean} Whether elements are in the same block.
7
+ * @return Whether elements are in the same block.
8
8
  */
9
9
  export declare function isInSameBlock(a: Element, b: Element): boolean;
10
10
  /**
11
11
  * Returns true if an element is considered part of the block and not its inner
12
12
  * blocks or appender.
13
13
  *
14
- * @param {Element} blockElement Block container element.
15
- * @param {Element} element Element.
14
+ * @param blockElement Block container element.
15
+ * @param element Element.
16
16
  *
17
- * @return {boolean} Whether an element is considered part of the block and not
18
- * its inner blocks or appender.
17
+ * @return Whether an element is considered part of the block and not
18
+ * its inner blocks or appender.
19
19
  */
20
20
  export declare function isInsideRootBlock(blockElement: Element, element: Element): boolean;
21
21
  /**
22
22
  * Finds the block client ID given any DOM node inside the block.
23
23
  *
24
- * @param {Node?} node DOM node.
24
+ * @param node DOM node.
25
25
  *
26
- * @return {string|undefined} Client ID or undefined if the node is not part of
27
- * a block.
26
+ * @return Client ID or undefined if the node is not part of
27
+ * a block.
28
28
  */
29
29
  export declare function getBlockClientId(node: Node | null): string | undefined;
30
30
  /**
31
31
  * Calculates the union of two rectangles.
32
32
  *
33
- * @param {DOMRect} rect1 First rectangle.
34
- * @param {DOMRect} rect2 Second rectangle.
35
- * @return {DOMRect} Union of the two rectangles.
33
+ * @param rect1 First rectangle.
34
+ * @param rect2 Second rectangle.
35
+ * @return Union of the two rectangles.
36
36
  */
37
- export declare function rectUnion(rect1: DOMRect, rect2: DOMRect): DOMRect;
37
+ export declare function rectUnion(rect1: DOMRect, rect2: DOMRect): DOMRectReadOnly;
38
38
  /**
39
39
  * Returns whether an element is visible.
40
40
  *
41
- * @param {Element} element Element.
42
- * @return {boolean} Whether the element is visible.
41
+ * @param element Element.
42
+ * @return Whether the element is visible.
43
43
  */
44
44
  export declare function isElementVisible(element: Element): boolean;
45
45
  export declare const WITH_OVERFLOW_ELEMENT_BLOCKS: string[];
@@ -53,8 +53,8 @@ export declare const WITH_OVERFLOW_ELEMENT_BLOCKS: string[];
53
53
  * The returned rect represents the full extent of the element and its visible
54
54
  * children, which may extend beyond the viewport.
55
55
  *
56
- * @param {Element} element Element.
57
- * @return {DOMRect} Bounding client rect of the element and its visible children.
56
+ * @param element Element.
57
+ * @return Bounding client rect of the element and its visible children.
58
58
  */
59
- export declare function getElementBounds(element: Element): DOMRect;
59
+ export declare function getElementBounds(element: Element): DOMRectReadOnly;
60
60
  //# sourceMappingURL=dom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAE,CAAC,EALrB,OAKqB,EAAE,CAAC,EAJxB,OAIwB,GAFvB,OAAO,CAIlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAE,YAAY,EANpC,OAMoC,EAAE,OAAO,EAL7C,OAK6C,GAH5C,OAAO,CAQlB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAE,IAAI,EAL3B,IAAI,OAKuB,GAH1B,MAAM,GAAC,SAAS,CAoB3B;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAE,KAAK,EAJrB,OAIqB,EAAE,KAAK,EAH5B,OAG4B,GAF3B,OAAO,CASlB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAH9B,OAG8B,GAF7B,OAAO,CAsClB;AAkBD,eAAO,MAAM,4BAA4B,UAAwB,CAAC;AAClE;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAH9B,OAG8B,GAF7B,OAAO,CAoDlB"}
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,WAEpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,WAKzE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,IAAI,GAAG,IAAI,sBAiBlD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,mBAOxD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,OAAO,WAoCjD;AAkBD,eAAO,MAAM,4BAA4B,UAAwB,CAAC;AAClE;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,OAAO,mBAkDjD"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Frontend fit text functionality.
3
+ * Automatically detects and initializes fit text on blocks with the has-fit-text class.
4
+ * Supports both initial page load and Interactivity API client-side navigation.
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=fit-text-frontend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-text-frontend.d.ts","sourceRoot":"","sources":["../../src/utils/fit-text-frontend.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Shared utility functions for fit text functionality.
3
+ * Uses callback-based approach for maximum code reuse between editor and frontend.
4
+ */
5
+ type ApplyFontSize = (size: number) => void;
6
+ /**
7
+ * Complete fit text optimization for a single text element.
8
+ * Handles the full flow using callbacks for font size application.
9
+ *
10
+ * @param textElement The text element (paragraph, heading, etc.)
11
+ * @param applyFontSize Function that receives font size in pixels (0 to clear, >0 to apply)
12
+ */
13
+ export declare function optimizeFitText(textElement: HTMLElement | null, applyFontSize: ApplyFontSize): number | undefined;
14
+ export {};
15
+ //# sourceMappingURL=fit-text-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-text-utils.d.ts","sourceRoot":"","sources":["../../src/utils/fit-text-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,KAAK,aAAa,GAAG,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;AAmF9C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC9B,WAAW,EAAE,WAAW,GAAG,IAAI,EAC/B,aAAa,EAAE,aAAa,sBAY5B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { FormattedFont } from './types';
5
+ /**
6
+ * Formats font styles to human readable names.
7
+ *
8
+ * @param fontStyle font style string
9
+ * @return new object with formatted font style
10
+ */
11
+ export declare function formatFontStyle(fontStyle: FormattedFont | string | undefined): FormattedFont;
12
+ //# sourceMappingURL=format-font-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-font-style.d.ts","sourceRoot":"","sources":["../../src/utils/format-font-style.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,eAAe,CAC9B,SAAS,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,GAC3C,aAAa,CA4Bf"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { FormattedFont } from './types';
5
+ /**
6
+ * Formats font weights to human readable names.
7
+ *
8
+ * @param fontWeight font weight string
9
+ * @return new object with formatted font weight
10
+ */
11
+ export declare function formatFontWeight(fontWeight: FormattedFont | string | undefined): FormattedFont;
12
+ //# sourceMappingURL=format-font-weight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-font-weight.d.ts","sourceRoot":"","sources":["../../src/utils/format-font-weight.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC/B,UAAU,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,GAC5C,aAAa,CAmDf"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Gets the editor region for a given editor canvas element or
3
+ * returns the passed element if no region is found
4
+ *
5
+ * @param editor The editor canvas element.
6
+ * @return The editor region or given editor element
7
+ */
8
+ export default function getEditorRegion(editor: Element | null | undefined): Element | null;
9
+ //# sourceMappingURL=get-editor-region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-editor-region.d.ts","sourceRoot":"","sources":["../../src/utils/get-editor-region.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAE,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,kBA2B1E"}
@@ -0,0 +1,16 @@
1
+ import type { FontFamilyFace, FormattedFont, CombinedStyleAndWeightOption } from './types';
2
+ /**
3
+ * Builds a list of font style and weight options based on font family faces.
4
+ * Defaults to the standard font styles and weights if no font family faces are provided.
5
+ *
6
+ * @param fontFamilyFaces font family faces array
7
+ * @return new object with combined and separated font style and weight properties
8
+ */
9
+ export declare function getFontStylesAndWeights(fontFamilyFaces: FontFamilyFace[] | undefined): {
10
+ fontStyles: FormattedFont[];
11
+ fontWeights: FormattedFont[];
12
+ combinedStyleAndWeightOptions: CombinedStyleAndWeightOption[];
13
+ isSystemFont: boolean;
14
+ isVariableFont: boolean;
15
+ };
16
+ //# sourceMappingURL=get-font-styles-and-weights.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-font-styles-and-weights.d.ts","sourceRoot":"","sources":["../../src/utils/get-font-styles-and-weights.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACX,cAAc,EACd,aAAa,EACb,4BAA4B,EAC5B,MAAM,SAAS,CAAC;AAwDjB;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACtC,eAAe,EAAE,cAAc,EAAE,GAAG,SAAS;;;;;;EA4H7C"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This function was accidentally exposed for mobile/native usage.
3
+ *
4
+ * @deprecated
5
+ *
6
+ * @return {string} Empty string.
7
+ */
8
+ declare const _default: () => string;
9
+ export default _default;
10
+ //# sourceMappingURL=get-px-from-css-unit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-px-from-css-unit.d.ts","sourceRoot":"","sources":["../../src/utils/get-px-from-css-unit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,3 @@
1
+ export { default as transformStyles } from './transform-styles';
2
+ export { default as getPxFromCssUnit } from './get-px-from-css-unit';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * A string representing the name of an edge.
3
+ */
4
+ type EdgeName = 'top' | 'right' | 'bottom' | 'left';
5
+ interface Point {
6
+ /** The horizontal position. */
7
+ x: number;
8
+ /** The vertical position. */
9
+ y: number;
10
+ }
11
+ /**
12
+ * Given a point, a DOMRect and the name of an edge, returns the distance to
13
+ * that edge of the rect.
14
+ *
15
+ * This function works for edges that are horizontal or vertical (e.g. not
16
+ * rotated), the following terms are used so that the function works in both
17
+ * orientations:
18
+ *
19
+ * - Forward, meaning the axis running horizontally when an edge is vertical
20
+ * and vertically when an edge is horizontal.
21
+ * - Lateral, meaning the axis running vertically when an edge is vertical
22
+ * and horizontally when an edge is horizontal.
23
+ *
24
+ * @param point The point to measure distance from.
25
+ * @param rect A DOM Rect containing edge positions.
26
+ * @param edge The edge to measure to.
27
+ */
28
+ export declare function getDistanceFromPointToEdge(point: Point, rect: DOMRect, edge: EdgeName): number;
29
+ /**
30
+ * Given a point, a DOMRect and a list of allowed edges returns the name of and
31
+ * distance to the nearest edge.
32
+ *
33
+ * @param point The point to measure distance from.
34
+ * @param rect A DOM Rect containing edge positions.
35
+ * @param allowedEdges A list of the edges included in the
36
+ * calculation. Defaults to all edges.
37
+ *
38
+ * @return An array where the first value is the distance
39
+ * and a second is the edge name.
40
+ */
41
+ export declare function getDistanceToNearestEdge(point: Point, rect: DOMRect, allowedEdges?: EdgeName[]): (number | EdgeName | undefined)[];
42
+ /**
43
+ * Is the point contained by the rectangle.
44
+ *
45
+ * @param point The point.
46
+ * @param rect The rectangle.
47
+ *
48
+ * @return True if the point is contained by the rectangle, false otherwise.
49
+ */
50
+ export declare function isPointContainedByRect(point: Point, rect: DOMRect): boolean;
51
+ /**
52
+ * Is the point within the top and bottom boundaries of the rectangle.
53
+ *
54
+ * @param point The point.
55
+ * @param rect The rectangle.
56
+ *
57
+ * @return True if the point is within top and bottom of rectangle, false otherwise.
58
+ */
59
+ export declare function isPointWithinTopAndBottomBoundariesOfRect(point: Point, rect: DOMRect): boolean;
60
+ export {};
61
+ //# sourceMappingURL=math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/utils/math.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,KAAK,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEpD,UAAU,KAAK;IACd,+BAA+B;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,6BAA6B;IAC7B,CAAC,EAAE,MAAM,CAAC;CACV;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,QAAQ,UA8Bd;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,EACb,YAAY,GAAE,QAAQ,EAAyC,qCAe/D;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,WAOlE;AAED;;;;;;;GAOG;AACH,wBAAgB,yCAAyC,CACxD,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,OAAO,WAGb"}
@@ -0,0 +1,39 @@
1
+ type AnyObject = Record<string, unknown>;
2
+ type ObjectOrArray = AnyObject | unknown[];
3
+ type ObjectPathKey = number | string;
4
+ type ObjectPath = ObjectPathKey | ObjectPathKey[];
5
+ /**
6
+ * Immutably sets a value inside an object. Like `lodash#set`, but returning a
7
+ * new object. Treats nullish initial values as empty objects. Clones any
8
+ * nested objects. Supports arrays, too.
9
+ *
10
+ * @param object Object to set a value in.
11
+ * @param path Path in the object to modify.
12
+ * @param value New value to set.
13
+ * @return Cloned object with the new value set.
14
+ */
15
+ export declare function setImmutably(object: ObjectOrArray | null | undefined, path: ObjectPath, value: unknown): ObjectOrArray;
16
+ /**
17
+ * Helper util to return a value from a certain path of the object.
18
+ * Path is specified as either:
19
+ * - a string of properties, separated by dots, for example: "x.y".
20
+ * - an array of properties, for example `[ 'x', 'y' ]`.
21
+ * You can also specify a default value in case the result is nullish.
22
+ *
23
+ * @param object Input object.
24
+ * @param path Path to the object property.
25
+ * @param defaultValue Default value if the value at the specified path is nullish.
26
+ * @return Value of the object property at the specified path.
27
+ */
28
+ export declare const getValueFromObjectPath: (object: AnyObject | undefined | null, path: string | string[], defaultValue?: unknown) => unknown;
29
+ /**
30
+ * Helper util to filter out objects with duplicate values for a given property.
31
+ *
32
+ * @param array Array of objects to filter.
33
+ * @param property Property to filter unique values by.
34
+ *
35
+ * @return Array of objects with unique values for the specified property.
36
+ */
37
+ export declare function uniqByProperty<T extends AnyObject>(array: T[], property: string): T[];
38
+ export {};
39
+ //# sourceMappingURL=object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAC;AAC3C,KAAK,aAAa,GAAG,SAAS,GAAG,OAAO,EAAE,CAAC;AAC3C,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AACrC,KAAK,UAAU,GAAG,aAAa,GAAG,aAAa,EAAE,CAAC;AAElD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,EACxC,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,OAAO,GACZ,aAAa,CAyBf;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,WAC1B,SAAS,GAAG,SAAS,GAAG,IAAI,QAC9B,MAAM,GAAG,MAAM,EAAE,iBACR,OAAO,YAQtB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAE,CAAC,SAAS,SAAS,EAClD,KAAK,EAAE,CAAC,EAAE,EACV,QAAQ,EAAE,MAAM,OAOhB"}
@@ -0,0 +1,13 @@
1
+ type EditorInserterItem = {
2
+ id: string;
3
+ };
4
+ /**
5
+ * Helper function to order inserter block items according to a provided array of prioritized blocks.
6
+ *
7
+ * @param items The array of editor inserter block items to be sorted.
8
+ * @param priority The array of block names to be prioritized.
9
+ * @return The sorted array of editor inserter block items.
10
+ */
11
+ export declare const orderInserterBlockItems: (items: EditorInserterItem[], priority: string[] | undefined) => EditorInserterItem[];
12
+ export {};
13
+ //# sourceMappingURL=order-inserter-block-items.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-inserter-block-items.d.ts","sourceRoot":"","sources":["../../src/utils/order-inserter-block-items.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,UAC5B,kBAAkB,EAAE,YACjB,MAAM,EAAE,GAAG,SAAS,yBAqB9B,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare function getPasteEventData({ clipboardData }: {
2
+ clipboardData: DataTransfer;
3
+ }): {
4
+ files: File[];
5
+ html?: undefined;
6
+ plainText?: undefined;
7
+ } | {
8
+ html: string;
9
+ plainText: string;
10
+ files: never[];
11
+ } | undefined;
12
+ /**
13
+ * Given a collection of DataTransfer files and HTML and plain text strings,
14
+ * determine whether the files are to be dismissed in favor of the HTML.
15
+ *
16
+ * Certain office-type programs, like Microsoft Word or Apple Numbers,
17
+ * will, upon copy, generate a screenshot of the content being copied and
18
+ * attach it to the clipboard alongside the actual rich text that the user
19
+ * sought to copy. In those cases, we should let Gutenberg handle the rich text
20
+ * content and not the screenshot, since this allows Gutenberg to insert
21
+ * meaningful blocks, like paragraphs, lists or even tables.
22
+ *
23
+ * @param files File objects obtained from a paste event
24
+ * @param html HTML content obtained from a paste event
25
+ * @return True if the files should be dismissed
26
+ */
27
+ export declare function shouldDismissPastedFiles(files: File[], html: string): boolean;
28
+ //# sourceMappingURL=pasting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pasting.d.ts","sourceRoot":"","sources":["../../src/utils/pasting.ts"],"names":[],"mappings":"AAkDA,wBAAgB,iBAAiB,CAAE,EAClC,aAAa,EACb,EAAE;IACF,aAAa,EAAE,YAAY,CAAC;CAC5B;;;;;;;;cA2BA;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,IAAI,EAAE,EACb,IAAI,EAAE,MAAM,WA+BZ"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A robust way to retain selection position through various
3
+ * transforms is to insert a special character at the position and
4
+ * then recover it.
5
+ */
6
+ export declare const START_OF_SELECTED_AREA = "\u0086";
7
+ /**
8
+ * Retrieve the block attribute that contains the selection position.
9
+ *
10
+ * @param blockAttributes Block attributes.
11
+ * @return The name of the block attribute that was previously selected.
12
+ */
13
+ export declare function retrieveSelectedAttribute(blockAttributes: Record<string, unknown> | undefined): string | undefined;
14
+ type BlockTypeWithAttributes = {
15
+ attributes: Record<string, {
16
+ source?: string;
17
+ }>;
18
+ };
19
+ export declare function findRichTextAttributeKey(blockType: BlockTypeWithAttributes): string | undefined;
20
+ export {};
21
+ //# sourceMappingURL=selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../src/utils/selection.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAE/C;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACxC,eAAe,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,GAAG,SAAS,sBAetD;AAED,KAAK,uBAAuB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAE,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAE,CAAC;CAClD,CAAC;AAEF,wBAAgB,wBAAwB,CAAE,SAAS,EAAE,uBAAuB,sBAO3E"}
@@ -0,0 +1,17 @@
1
+ type Comparable = string | number | undefined;
2
+ type SortItem = Record<string, Comparable>;
3
+ type SortField<T> = string | ((item: T) => Comparable);
4
+ /**
5
+ * Order items by a certain key.
6
+ * Supports decorator functions that allow complex picking of a comparison field.
7
+ * Sorts in ascending order by default, but supports descending as well.
8
+ * Stable sort - maintains original order of equal items.
9
+ *
10
+ * @param items Items to order.
11
+ * @param field Field to order by.
12
+ * @param order Sorting order, `asc` or `desc`.
13
+ * @return Sorted items.
14
+ */
15
+ export declare function orderBy<T extends SortItem>(items: T[], field: SortField<T>, order?: string): T[];
16
+ export {};
17
+ //# sourceMappingURL=sorting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sorting.d.ts","sourceRoot":"","sources":["../../src/utils/sorting.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAC9C,KAAK,QAAQ,GAAG,MAAM,CAAE,MAAM,EAAE,UAAU,CAAE,CAAC;AAC7C,KAAK,SAAS,CAAE,CAAC,IAAK,MAAM,GAAG,CAAE,CAAE,IAAI,EAAE,CAAC,KAAM,UAAU,CAAE,CAAC;AA6D7D;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAE,CAAC,SAAS,QAAQ,EAC1C,KAAK,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,SAAS,CAAE,CAAC,CAAE,EACrB,KAAK,SAAQ,OAGb"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { EditorStyle, TransformOptions } from './types';
5
+ /**
6
+ * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.
7
+ *
8
+ * @param styles CSS rules.
9
+ * @param wrapperSelector Wrapper selector.
10
+ * @param transformOptions Additional options for style transformation.
11
+ * @return converted rules.
12
+ */
13
+ declare const transformStyles: (styles: EditorStyle[], wrapperSelector?: string, transformOptions?: TransformOptions) => any[];
14
+ export default transformStyles;
15
+ //# sourceMappingURL=index.d.ts.map