@wordpress/components 19.5.0 → 19.6.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 (633) hide show
  1. package/CHANGELOG.md +23 -5
  2. package/build/alignment-matrix-control/utils.js +1 -1
  3. package/build/alignment-matrix-control/utils.js.map +1 -1
  4. package/build/angle-picker-control/angle-circle.js +1 -1
  5. package/build/angle-picker-control/angle-circle.js.map +1 -1
  6. package/build/animation/index.js +0 -6
  7. package/build/animation/index.js.map +1 -1
  8. package/build/autocomplete/get-default-use-items.js +3 -3
  9. package/build/autocomplete/get-default-use-items.js.map +1 -1
  10. package/build/base-field/hook.js +1 -1
  11. package/build/base-field/hook.js.map +1 -1
  12. package/build/box-control/icon.js +1 -1
  13. package/build/box-control/icon.js.map +1 -1
  14. package/build/box-control/index.js +4 -4
  15. package/build/box-control/index.js.map +1 -1
  16. package/build/box-control/utils.js +12 -8
  17. package/build/box-control/utils.js.map +1 -1
  18. package/build/button/index.js +5 -5
  19. package/build/button/index.js.map +1 -1
  20. package/build/button/index.native.js +7 -7
  21. package/build/button/index.native.js.map +1 -1
  22. package/build/color-picker/color-display.js +1 -1
  23. package/build/color-picker/color-display.js.map +1 -1
  24. package/build/color-picker/styles.js +8 -8
  25. package/build/color-picker/styles.js.map +1 -1
  26. package/build/combobox-control/index.js +1 -1
  27. package/build/combobox-control/index.js.map +1 -1
  28. package/build/confirm-dialog/component.js +4 -2
  29. package/build/confirm-dialog/component.js.map +1 -1
  30. package/build/date-time/time.js +7 -4
  31. package/build/date-time/time.js.map +1 -1
  32. package/build/divider/component.js +5 -4
  33. package/build/divider/component.js.map +1 -1
  34. package/build/draggable/index.js +3 -3
  35. package/build/draggable/index.js.map +1 -1
  36. package/build/focal-point-picker/index.native.js +7 -7
  37. package/build/focal-point-picker/index.native.js.map +1 -1
  38. package/build/focal-point-picker/tooltip/index.native.js +1 -1
  39. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  40. package/build/font-size-picker/index.js +1 -1
  41. package/build/font-size-picker/index.js.map +1 -1
  42. package/build/form-token-field/index.js +6 -6
  43. package/build/form-token-field/index.js.map +1 -1
  44. package/build/form-token-field/suggestions-list.js +2 -2
  45. package/build/form-token-field/suggestions-list.js.map +1 -1
  46. package/build/heading/component.js +6 -5
  47. package/build/heading/component.js.map +1 -1
  48. package/build/heading/hook.js +1 -1
  49. package/build/heading/hook.js.map +1 -1
  50. package/build/higher-order/with-notices/index.js +1 -1
  51. package/build/higher-order/with-notices/index.js.map +1 -1
  52. package/build/index.js +2 -2
  53. package/build/index.js.map +1 -1
  54. package/build/index.native.js.map +1 -1
  55. package/build/input-control/input-base.js +1 -1
  56. package/build/input-control/input-base.js.map +1 -1
  57. package/build/input-control/input-field.js +12 -10
  58. package/build/input-control/input-field.js.map +1 -1
  59. package/build/input-control/styles/input-control-styles.js +25 -25
  60. package/build/input-control/styles/input-control-styles.js.map +1 -1
  61. package/build/isolated-event-container/index.js +1 -1
  62. package/build/isolated-event-container/index.js.map +1 -1
  63. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  64. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  65. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  66. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  67. package/build/mobile/bottom-sheet/cell.native.js +1 -1
  68. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  69. package/build/mobile/bottom-sheet/index.native.js +11 -11
  70. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  71. package/build/mobile/bottom-sheet/link-cell.native.js +1 -1
  72. package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  73. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  74. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  75. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  76. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  77. package/build/mobile/global-styles-context/utils.native.js +10 -10
  78. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  79. package/build/mobile/gradient/index.native.js +2 -2
  80. package/build/mobile/gradient/index.native.js.map +1 -1
  81. package/build/mobile/html-text-input/container.ios.js +3 -3
  82. package/build/mobile/html-text-input/container.ios.js.map +1 -1
  83. package/build/mobile/html-text-input/index.native.js +1 -1
  84. package/build/mobile/html-text-input/index.native.js.map +1 -1
  85. package/build/mobile/image/index.native.js +1 -1
  86. package/build/mobile/image/index.native.js.map +1 -1
  87. package/build/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  88. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  89. package/build/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  90. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  91. package/build/mobile/link-picker/index.native.js +3 -3
  92. package/build/mobile/link-picker/index.native.js.map +1 -1
  93. package/build/mobile/link-picker/link-picker-results.native.js +8 -8
  94. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  95. package/build/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  96. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  97. package/build/mobile/link-settings/index.native.js +1 -1
  98. package/build/mobile/link-settings/index.native.js.map +1 -1
  99. package/build/modal/aria-helper.js +1 -1
  100. package/build/modal/aria-helper.js.map +1 -1
  101. package/build/modal/index.js +2 -2
  102. package/build/modal/index.js.map +1 -1
  103. package/build/navigable-container/container.js +2 -2
  104. package/build/navigable-container/container.js.map +1 -1
  105. package/build/navigable-container/tabbable.js +1 -1
  106. package/build/navigable-container/tabbable.js.map +1 -1
  107. package/build/navigation/item/index.js +1 -1
  108. package/build/navigation/item/index.js.map +1 -1
  109. package/build/navigation/menu/index.js +1 -1
  110. package/build/navigation/menu/index.js.map +1 -1
  111. package/build/navigator/navigator-provider/component.js +2 -2
  112. package/build/navigator/navigator-provider/component.js.map +1 -1
  113. package/build/navigator/navigator-screen/component.js +1 -1
  114. package/build/navigator/navigator-screen/component.js.map +1 -1
  115. package/build/number-control/index.js +1 -1
  116. package/build/number-control/index.js.map +1 -1
  117. package/build/panel/body.js +2 -2
  118. package/build/panel/body.js.map +1 -1
  119. package/build/popover/index.js +3 -3
  120. package/build/popover/index.js.map +1 -1
  121. package/build/popover/utils.js +6 -6
  122. package/build/popover/utils.js.map +1 -1
  123. package/build/radio-group/index.js +1 -1
  124. package/build/radio-group/index.js.map +1 -1
  125. package/build/range-control/styles/range-control-styles.js +29 -29
  126. package/build/range-control/styles/range-control-styles.js.map +1 -1
  127. package/build/sandbox/index.js +5 -5
  128. package/build/sandbox/index.js.map +1 -1
  129. package/build/sandbox/index.native.js +1 -1
  130. package/build/sandbox/index.native.js.map +1 -1
  131. package/build/select-control/index.js +1 -1
  132. package/build/select-control/index.js.map +1 -1
  133. package/build/select-control/styles/select-control-styles.js +5 -5
  134. package/build/select-control/styles/select-control-styles.js.map +1 -1
  135. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  136. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  137. package/build/slot-fill/bubbles-virtually/slot.js +1 -1
  138. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  139. package/build/slot-fill/fill.js +1 -1
  140. package/build/slot-fill/fill.js.map +1 -1
  141. package/build/slot-fill/provider.js +1 -1
  142. package/build/slot-fill/provider.js.map +1 -1
  143. package/build/snackbar/index.js +1 -1
  144. package/build/snackbar/index.js.map +1 -1
  145. package/build/snackbar/list.js +1 -1
  146. package/build/snackbar/list.js.map +1 -1
  147. package/build/style-provider/index.js +2 -2
  148. package/build/style-provider/index.js.map +1 -1
  149. package/build/toggle-group-control/toggle-group-control/component.js +2 -2
  150. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  151. package/build/toggle-group-control/toggle-group-control-option/component.js +1 -4
  152. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  153. package/build/toggle-group-control/toggle-group-control-option/styles.js +12 -19
  154. package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  155. package/build/toolbar/index.js +1 -1
  156. package/build/toolbar/index.js.map +1 -1
  157. package/build/tooltip/index.js +3 -3
  158. package/build/tooltip/index.js.map +1 -1
  159. package/build/tooltip/index.native.js +7 -7
  160. package/build/tooltip/index.native.js.map +1 -1
  161. package/build/tree-grid/index.js +4 -1
  162. package/build/tree-grid/index.js.map +1 -1
  163. package/build/truncate/utils.js +1 -1
  164. package/build/truncate/utils.js.map +1 -1
  165. package/build/ui/context/context-connect.js +8 -15
  166. package/build/ui/context/context-connect.js.map +1 -1
  167. package/build/ui/context/context-system-provider.js +2 -2
  168. package/build/ui/context/context-system-provider.js.map +1 -1
  169. package/build/ui/context/index.js.map +1 -1
  170. package/build/ui/utils/colors.js +2 -2
  171. package/build/ui/utils/colors.js.map +1 -1
  172. package/build/ui/utils/space.js +2 -2
  173. package/build/ui/utils/space.js.map +1 -1
  174. package/build/unit-control/index.js +38 -29
  175. package/build/unit-control/index.js.map +1 -1
  176. package/build/unit-control/index.native.js +4 -2
  177. package/build/unit-control/index.native.js.map +1 -1
  178. package/build/unit-control/unit-select-control.js +1 -1
  179. package/build/unit-control/unit-select-control.js.map +1 -1
  180. package/build/unit-control/utils.js +96 -104
  181. package/build/unit-control/utils.js.map +1 -1
  182. package/build/utils/breakpoint-values.js +1 -1
  183. package/build/utils/breakpoint-values.js.map +1 -1
  184. package/build/utils/colors-values.js +1 -1
  185. package/build/utils/colors-values.js.map +1 -1
  186. package/build-module/alignment-matrix-control/utils.js +1 -1
  187. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  188. package/build-module/angle-picker-control/angle-circle.js +1 -1
  189. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  190. package/build-module/animation/index.js +1 -1
  191. package/build-module/animation/index.js.map +1 -1
  192. package/build-module/autocomplete/get-default-use-items.js +3 -3
  193. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  194. package/build-module/base-field/hook.js +1 -1
  195. package/build-module/base-field/hook.js.map +1 -1
  196. package/build-module/box-control/icon.js +1 -1
  197. package/build-module/box-control/icon.js.map +1 -1
  198. package/build-module/box-control/index.js +5 -5
  199. package/build-module/box-control/index.js.map +1 -1
  200. package/build-module/box-control/utils.js +13 -9
  201. package/build-module/box-control/utils.js.map +1 -1
  202. package/build-module/button/index.js +5 -5
  203. package/build-module/button/index.js.map +1 -1
  204. package/build-module/button/index.native.js +7 -7
  205. package/build-module/button/index.native.js.map +1 -1
  206. package/build-module/color-picker/color-display.js +1 -1
  207. package/build-module/color-picker/color-display.js.map +1 -1
  208. package/build-module/color-picker/styles.js +8 -8
  209. package/build-module/color-picker/styles.js.map +1 -1
  210. package/build-module/combobox-control/index.js +1 -1
  211. package/build-module/combobox-control/index.js.map +1 -1
  212. package/build-module/confirm-dialog/component.js +4 -5
  213. package/build-module/confirm-dialog/component.js.map +1 -1
  214. package/build-module/date-time/time.js +7 -4
  215. package/build-module/date-time/time.js.map +1 -1
  216. package/build-module/divider/component.js +3 -3
  217. package/build-module/divider/component.js.map +1 -1
  218. package/build-module/draggable/index.js +3 -3
  219. package/build-module/draggable/index.js.map +1 -1
  220. package/build-module/focal-point-picker/index.native.js +7 -7
  221. package/build-module/focal-point-picker/index.native.js.map +1 -1
  222. package/build-module/focal-point-picker/tooltip/index.native.js +1 -1
  223. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  224. package/build-module/font-size-picker/index.js +1 -1
  225. package/build-module/font-size-picker/index.js.map +1 -1
  226. package/build-module/form-token-field/index.js +6 -6
  227. package/build-module/form-token-field/index.js.map +1 -1
  228. package/build-module/form-token-field/suggestions-list.js +2 -2
  229. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  230. package/build-module/heading/component.js +4 -4
  231. package/build-module/heading/component.js.map +1 -1
  232. package/build-module/heading/hook.js +1 -1
  233. package/build-module/heading/hook.js.map +1 -1
  234. package/build-module/higher-order/with-notices/index.js +1 -1
  235. package/build-module/higher-order/with-notices/index.js.map +1 -1
  236. package/build-module/index.js +4 -4
  237. package/build-module/index.js.map +1 -1
  238. package/build-module/index.native.js +4 -4
  239. package/build-module/index.native.js.map +1 -1
  240. package/build-module/input-control/input-base.js +1 -1
  241. package/build-module/input-control/input-base.js.map +1 -1
  242. package/build-module/input-control/input-field.js +13 -10
  243. package/build-module/input-control/input-field.js.map +1 -1
  244. package/build-module/input-control/styles/input-control-styles.js +25 -25
  245. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  246. package/build-module/isolated-event-container/index.js +1 -1
  247. package/build-module/isolated-event-container/index.js.map +1 -1
  248. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  249. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  250. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  251. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  252. package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
  253. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  254. package/build-module/mobile/bottom-sheet/index.native.js +11 -11
  255. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  256. package/build-module/mobile/bottom-sheet/link-cell.native.js +1 -1
  257. package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  258. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  259. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  260. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  261. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  262. package/build-module/mobile/global-styles-context/utils.native.js +10 -10
  263. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  264. package/build-module/mobile/gradient/index.native.js +2 -2
  265. package/build-module/mobile/gradient/index.native.js.map +1 -1
  266. package/build-module/mobile/html-text-input/container.ios.js +3 -3
  267. package/build-module/mobile/html-text-input/container.ios.js.map +1 -1
  268. package/build-module/mobile/html-text-input/index.native.js +1 -1
  269. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  270. package/build-module/mobile/image/index.native.js +1 -1
  271. package/build-module/mobile/image/index.native.js.map +1 -1
  272. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  273. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  274. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  275. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  276. package/build-module/mobile/link-picker/index.native.js +3 -3
  277. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  278. package/build-module/mobile/link-picker/link-picker-results.native.js +8 -8
  279. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  280. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  281. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  282. package/build-module/mobile/link-settings/index.native.js +1 -1
  283. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  284. package/build-module/modal/aria-helper.js +1 -1
  285. package/build-module/modal/aria-helper.js.map +1 -1
  286. package/build-module/modal/index.js +2 -2
  287. package/build-module/modal/index.js.map +1 -1
  288. package/build-module/navigable-container/container.js +2 -2
  289. package/build-module/navigable-container/container.js.map +1 -1
  290. package/build-module/navigable-container/tabbable.js +1 -1
  291. package/build-module/navigable-container/tabbable.js.map +1 -1
  292. package/build-module/navigation/item/index.js +1 -1
  293. package/build-module/navigation/item/index.js.map +1 -1
  294. package/build-module/navigation/menu/index.js +1 -1
  295. package/build-module/navigation/menu/index.js.map +1 -1
  296. package/build-module/navigator/navigator-provider/component.js +2 -2
  297. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  298. package/build-module/navigator/navigator-screen/component.js +1 -1
  299. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  300. package/build-module/number-control/index.js +1 -1
  301. package/build-module/number-control/index.js.map +1 -1
  302. package/build-module/panel/body.js +2 -2
  303. package/build-module/panel/body.js.map +1 -1
  304. package/build-module/popover/index.js +3 -3
  305. package/build-module/popover/index.js.map +1 -1
  306. package/build-module/popover/utils.js +6 -6
  307. package/build-module/popover/utils.js.map +1 -1
  308. package/build-module/radio-group/index.js +1 -1
  309. package/build-module/radio-group/index.js.map +1 -1
  310. package/build-module/range-control/styles/range-control-styles.js +29 -29
  311. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  312. package/build-module/sandbox/index.js +5 -5
  313. package/build-module/sandbox/index.js.map +1 -1
  314. package/build-module/sandbox/index.native.js +1 -1
  315. package/build-module/sandbox/index.native.js.map +1 -1
  316. package/build-module/select-control/index.js +1 -1
  317. package/build-module/select-control/index.js.map +1 -1
  318. package/build-module/select-control/styles/select-control-styles.js +5 -5
  319. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  320. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  321. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  322. package/build-module/slot-fill/bubbles-virtually/slot.js +1 -1
  323. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  324. package/build-module/slot-fill/fill.js +1 -1
  325. package/build-module/slot-fill/fill.js.map +1 -1
  326. package/build-module/slot-fill/provider.js +1 -1
  327. package/build-module/slot-fill/provider.js.map +1 -1
  328. package/build-module/snackbar/index.js +1 -1
  329. package/build-module/snackbar/index.js.map +1 -1
  330. package/build-module/snackbar/list.js +1 -1
  331. package/build-module/snackbar/list.js.map +1 -1
  332. package/build-module/style-provider/index.js +2 -2
  333. package/build-module/style-provider/index.js.map +1 -1
  334. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -2
  335. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  336. package/build-module/toggle-group-control/toggle-group-control-option/component.js +1 -4
  337. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  338. package/build-module/toggle-group-control/toggle-group-control-option/styles.js +11 -17
  339. package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  340. package/build-module/toolbar/index.js +1 -1
  341. package/build-module/toolbar/index.js.map +1 -1
  342. package/build-module/tooltip/index.js +3 -3
  343. package/build-module/tooltip/index.js.map +1 -1
  344. package/build-module/tooltip/index.native.js +7 -7
  345. package/build-module/tooltip/index.native.js.map +1 -1
  346. package/build-module/tree-grid/index.js +4 -1
  347. package/build-module/tree-grid/index.js.map +1 -1
  348. package/build-module/truncate/utils.js +1 -1
  349. package/build-module/truncate/utils.js.map +1 -1
  350. package/build-module/ui/context/context-connect.js +9 -16
  351. package/build-module/ui/context/context-connect.js.map +1 -1
  352. package/build-module/ui/context/context-system-provider.js +2 -2
  353. package/build-module/ui/context/context-system-provider.js.map +1 -1
  354. package/build-module/ui/context/index.js.map +1 -1
  355. package/build-module/ui/utils/colors.js +2 -2
  356. package/build-module/ui/utils/colors.js.map +1 -1
  357. package/build-module/ui/utils/space.js +2 -2
  358. package/build-module/ui/utils/space.js.map +1 -1
  359. package/build-module/unit-control/index.js +39 -30
  360. package/build-module/unit-control/index.js.map +1 -1
  361. package/build-module/unit-control/index.native.js +5 -3
  362. package/build-module/unit-control/index.native.js.map +1 -1
  363. package/build-module/unit-control/unit-select-control.js +1 -1
  364. package/build-module/unit-control/unit-select-control.js.map +1 -1
  365. package/build-module/unit-control/utils.js +92 -100
  366. package/build-module/unit-control/utils.js.map +1 -1
  367. package/build-module/utils/breakpoint-values.js +1 -1
  368. package/build-module/utils/breakpoint-values.js.map +1 -1
  369. package/build-module/utils/colors-values.js +1 -1
  370. package/build-module/utils/colors-values.js.map +1 -1
  371. package/build-style/style-rtl.css +8 -0
  372. package/build-style/style.css +8 -0
  373. package/build-types/base-field/hook.d.ts +2 -1
  374. package/build-types/base-field/hook.d.ts.map +1 -1
  375. package/build-types/card/card/hook.d.ts +2 -1
  376. package/build-types/card/card/hook.d.ts.map +1 -1
  377. package/build-types/card/card-body/hook.d.ts +2 -1
  378. package/build-types/card/card-body/hook.d.ts.map +1 -1
  379. package/build-types/card/card-divider/hook.d.ts +2 -2
  380. package/build-types/card/card-footer/hook.d.ts +2 -1
  381. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  382. package/build-types/card/card-header/hook.d.ts +2 -1
  383. package/build-types/card/card-header/hook.d.ts.map +1 -1
  384. package/build-types/card/card-media/hook.d.ts +2 -1
  385. package/build-types/card/card-media/hook.d.ts.map +1 -1
  386. package/build-types/color-picker/styles.d.ts +2 -2
  387. package/build-types/confirm-dialog/component.d.ts +8 -0
  388. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  389. package/build-types/confirm-dialog/types.d.ts +2 -0
  390. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  391. package/build-types/divider/component.d.ts +2 -2
  392. package/build-types/divider/component.d.ts.map +1 -1
  393. package/build-types/divider/stories/index.d.ts +10 -0
  394. package/build-types/divider/stories/index.d.ts.map +1 -0
  395. package/build-types/divider/types.d.ts +1 -1
  396. package/build-types/divider/types.d.ts.map +1 -1
  397. package/build-types/elevation/hook.d.ts +2 -1
  398. package/build-types/elevation/hook.d.ts.map +1 -1
  399. package/build-types/flex/flex/hook.d.ts +2 -1
  400. package/build-types/flex/flex/hook.d.ts.map +1 -1
  401. package/build-types/flex/flex-block/hook.d.ts +2 -1
  402. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  403. package/build-types/flex/flex-item/hook.d.ts +2 -1
  404. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  405. package/build-types/flyout/flyout/hook.d.ts +2 -1
  406. package/build-types/flyout/flyout/hook.d.ts.map +1 -1
  407. package/build-types/grid/hook.d.ts +2 -1
  408. package/build-types/grid/hook.d.ts.map +1 -1
  409. package/build-types/h-stack/hook.d.ts +3 -2
  410. package/build-types/h-stack/hook.d.ts.map +1 -1
  411. package/build-types/heading/component.d.ts +3 -3
  412. package/build-types/heading/component.d.ts.map +1 -1
  413. package/build-types/heading/hook.d.ts +2 -1
  414. package/build-types/heading/hook.d.ts.map +1 -1
  415. package/build-types/heading/stories/index.d.ts +12 -0
  416. package/build-types/heading/stories/index.d.ts.map +1 -0
  417. package/build-types/input-control/index.d.ts +1 -1
  418. package/build-types/input-control/index.d.ts.map +1 -1
  419. package/build-types/input-control/input-field.d.ts +1 -1
  420. package/build-types/input-control/input-field.d.ts.map +1 -1
  421. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  422. package/build-types/item-group/item/hook.d.ts +2 -1
  423. package/build-types/item-group/item/hook.d.ts.map +1 -1
  424. package/build-types/item-group/item-group/hook.d.ts +2 -1
  425. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  426. package/build-types/navigator/navigator-back-button/hook.d.ts +2 -1
  427. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  428. package/build-types/navigator/navigator-button/hook.d.ts +2 -1
  429. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  430. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  431. package/build-types/scrollable/hook.d.ts +2 -1
  432. package/build-types/scrollable/hook.d.ts.map +1 -1
  433. package/build-types/select-control/index.d.ts +1 -1
  434. package/build-types/select-control/index.d.ts.map +1 -1
  435. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  436. package/build-types/spacer/hook.d.ts +2 -1
  437. package/build-types/spacer/hook.d.ts.map +1 -1
  438. package/build-types/surface/hook.d.ts +2 -1
  439. package/build-types/surface/hook.d.ts.map +1 -1
  440. package/build-types/text/hook.d.ts +2 -1
  441. package/build-types/text/hook.d.ts.map +1 -1
  442. package/build-types/text/types.d.ts +1 -2
  443. package/build-types/text/types.d.ts.map +1 -1
  444. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  445. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts +0 -4
  446. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
  447. package/build-types/tools-panel/tools-panel/hook.d.ts +2 -1
  448. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  449. package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -1
  450. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  451. package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -1
  452. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  453. package/build-types/truncate/hook.d.ts +2 -1
  454. package/build-types/truncate/hook.d.ts.map +1 -1
  455. package/build-types/ui/context/context-connect.d.ts +18 -16
  456. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  457. package/build-types/ui/context/index.d.ts +4 -4
  458. package/build-types/ui/context/index.d.ts.map +1 -1
  459. package/build-types/ui/context/wordpress-component.d.ts +1 -0
  460. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  461. package/build-types/ui/control-group/hook.d.ts +2 -1
  462. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  463. package/build-types/ui/control-label/hook.d.ts +2 -1
  464. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  465. package/build-types/ui/form-group/use-form-group.d.ts +6 -4
  466. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  467. package/build-types/unit-control/index.d.ts +3 -3
  468. package/build-types/unit-control/index.d.ts.map +1 -1
  469. package/build-types/unit-control/types.d.ts +4 -6
  470. package/build-types/unit-control/types.d.ts.map +1 -1
  471. package/build-types/unit-control/utils.d.ts +47 -38
  472. package/build-types/unit-control/utils.d.ts.map +1 -1
  473. package/build-types/v-stack/hook.d.ts +2 -1
  474. package/build-types/v-stack/hook.d.ts.map +1 -1
  475. package/package.json +18 -18
  476. package/src/alignment-matrix-control/utils.js +1 -1
  477. package/src/angle-picker-control/angle-circle.js +1 -1
  478. package/src/animation/index.js +0 -1
  479. package/src/autocomplete/get-default-use-items.js +3 -3
  480. package/src/base-field/hook.js +1 -1
  481. package/src/box-control/icon.js +1 -1
  482. package/src/box-control/index.js +5 -5
  483. package/src/box-control/test/index.js +27 -7
  484. package/src/box-control/utils.js +13 -9
  485. package/src/button/index.js +5 -5
  486. package/src/button/index.native.js +7 -7
  487. package/src/button/style.scss +1 -0
  488. package/src/color-palette/style.scss +1 -0
  489. package/src/color-picker/color-display.tsx +1 -1
  490. package/src/color-picker/styles.ts +1 -1
  491. package/src/color-picker/test/index.js +1 -1
  492. package/src/combobox-control/index.js +1 -1
  493. package/src/combobox-control/style.scss +1 -0
  494. package/src/confirm-dialog/README.md +56 -45
  495. package/src/confirm-dialog/component.tsx +4 -2
  496. package/src/confirm-dialog/stories/index.js +19 -0
  497. package/src/confirm-dialog/test/index.js +28 -0
  498. package/src/confirm-dialog/types.ts +2 -0
  499. package/src/date-time/style.scss +4 -0
  500. package/src/date-time/time.js +16 -5
  501. package/src/dimension-control/test/index.test.js +1 -1
  502. package/src/disabled/test/index.js +1 -1
  503. package/src/divider/component.tsx +3 -3
  504. package/src/divider/stories/index.tsx +70 -0
  505. package/src/divider/types.ts +3 -1
  506. package/src/draggable/index.js +3 -3
  507. package/src/draggable/stories/index.js +1 -1
  508. package/src/flyout/flyout/README.md +1 -1
  509. package/src/flyout/test/index.js +1 -1
  510. package/src/focal-point-picker/index.native.js +7 -7
  511. package/src/focal-point-picker/tooltip/index.native.js +1 -1
  512. package/src/font-size-picker/README.md +1 -2
  513. package/src/font-size-picker/index.js +1 -1
  514. package/src/font-size-picker/stories/index.js +87 -108
  515. package/src/font-size-picker/test/index.js +0 -2
  516. package/src/form-token-field/index.js +6 -6
  517. package/src/form-token-field/style.scss +1 -0
  518. package/src/form-token-field/suggestions-list.js +2 -2
  519. package/src/form-token-field/test/index.js +6 -6
  520. package/src/heading/component.tsx +4 -4
  521. package/src/heading/hook.ts +1 -1
  522. package/src/heading/stories/index.tsx +37 -0
  523. package/src/higher-order/with-filters/test/index.js +1 -1
  524. package/src/higher-order/with-focus-outside/test/index.js +1 -1
  525. package/src/higher-order/with-notices/index.js +1 -1
  526. package/src/higher-order/with-notices/test/index.js +3 -3
  527. package/src/index.js +4 -4
  528. package/src/index.native.js +4 -4
  529. package/src/input-control/input-base.tsx +1 -1
  530. package/src/input-control/input-field.tsx +12 -9
  531. package/src/input-control/styles/input-control-styles.tsx +1 -0
  532. package/src/input-control/test/index.js +4 -4
  533. package/src/isolated-event-container/index.js +1 -1
  534. package/src/item-group/test/index.js +0 -1
  535. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  536. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  537. package/src/mobile/bottom-sheet/cell.native.js +1 -1
  538. package/src/mobile/bottom-sheet/index.native.js +11 -11
  539. package/src/mobile/bottom-sheet/link-cell.native.js +1 -1
  540. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  541. package/src/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  542. package/src/mobile/global-styles-context/utils.native.js +10 -10
  543. package/src/mobile/gradient/index.native.js +2 -2
  544. package/src/mobile/html-text-input/container.ios.js +3 -3
  545. package/src/mobile/html-text-input/index.native.js +1 -1
  546. package/src/mobile/html-text-input/test/index.native.js +14 -14
  547. package/src/mobile/image/index.native.js +1 -1
  548. package/src/mobile/image/style.native.scss +1 -0
  549. package/src/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  550. package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  551. package/src/mobile/link-picker/index.native.js +3 -3
  552. package/src/mobile/link-picker/link-picker-results.native.js +8 -8
  553. package/src/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  554. package/src/mobile/link-settings/index.native.js +1 -2
  555. package/src/mobile/link-settings/test/edit.native.js +15 -15
  556. package/src/modal/aria-helper.js +1 -1
  557. package/src/modal/index.js +2 -2
  558. package/src/navigable-container/container.js +2 -2
  559. package/src/navigable-container/tabbable.js +1 -1
  560. package/src/navigable-container/test/menu.js +5 -5
  561. package/src/navigable-container/test/tabbable.js +2 -2
  562. package/src/navigation/item/index.js +1 -1
  563. package/src/navigation/menu/index.js +1 -1
  564. package/src/navigation/stories/controlled-state.js +2 -2
  565. package/src/navigator/navigator-provider/component.tsx +1 -1
  566. package/src/navigator/navigator-screen/component.tsx +2 -2
  567. package/src/navigator/test/index.js +18 -19
  568. package/src/navigator/types.ts +1 -1
  569. package/src/number-control/index.js +1 -1
  570. package/src/panel/body.js +2 -2
  571. package/src/popover/index.js +3 -3
  572. package/src/popover/utils.js +6 -6
  573. package/src/radio-group/index.js +1 -1
  574. package/src/range-control/stories/index.js +1 -1
  575. package/src/range-control/styles/range-control-styles.js +1 -1
  576. package/src/range-control/test/index.js +2 -2
  577. package/src/sandbox/index.js +5 -5
  578. package/src/sandbox/index.native.js +1 -1
  579. package/src/select-control/index.tsx +1 -1
  580. package/src/select-control/styles/select-control-styles.ts +1 -0
  581. package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  582. package/src/slot-fill/bubbles-virtually/slot.js +1 -2
  583. package/src/slot-fill/fill.js +1 -1
  584. package/src/slot-fill/provider.js +1 -1
  585. package/src/snackbar/index.js +1 -1
  586. package/src/snackbar/list.js +1 -1
  587. package/src/style-provider/index.js +2 -2
  588. package/src/tab-panel/test/index.js +1 -1
  589. package/src/text/test/index.js +2 -2
  590. package/src/text/types.ts +6 -8
  591. package/src/text-highlight/test/index.js +4 -4
  592. package/src/toggle-control/test/index.js +3 -3
  593. package/src/toggle-group-control/test/__snapshots__/index.js.snap +1 -27
  594. package/src/toggle-group-control/toggle-group-control/component.tsx +2 -2
  595. package/src/toggle-group-control/toggle-group-control-option/component.tsx +1 -4
  596. package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -12
  597. package/src/toolbar/index.js +1 -1
  598. package/src/toolbar-group/test/index.js +2 -2
  599. package/src/tooltip/index.js +3 -3
  600. package/src/tooltip/index.native.js +7 -7
  601. package/src/tooltip/test/index.js +2 -2
  602. package/src/tooltip/test/index.native.js +2 -2
  603. package/src/tree-grid/README.md +1 -1
  604. package/src/tree-grid/index.js +4 -0
  605. package/src/tree-grid/test/__snapshots__/index.js.snap +1 -1
  606. package/src/tree-grid/test/index.js +128 -52
  607. package/src/truncate/utils.js +1 -1
  608. package/src/ui/context/{context-connect.js → context-connect.ts} +27 -16
  609. package/src/ui/context/context-system-provider.js +2 -2
  610. package/src/ui/context/{index.js → index.ts} +0 -0
  611. package/src/ui/context/wordpress-component.ts +1 -0
  612. package/src/ui/tooltip/test/index.js +4 -4
  613. package/src/ui/utils/colors.js +2 -2
  614. package/src/ui/utils/space.ts +2 -2
  615. package/src/unit-control/README.md +1 -1
  616. package/src/unit-control/index.native.js +5 -3
  617. package/src/unit-control/index.tsx +64 -35
  618. package/src/unit-control/test/index.js +102 -3
  619. package/src/unit-control/test/utils.js +56 -15
  620. package/src/unit-control/types.ts +5 -8
  621. package/src/unit-control/unit-select-control.tsx +1 -1
  622. package/src/unit-control/utils.ts +128 -125
  623. package/src/utils/breakpoint-values.js +1 -1
  624. package/src/utils/colors-values.js +1 -1
  625. package/src/utils/hooks/test/use-controlled-state.js +1 -1
  626. package/src/utils/hooks/test/use-controlled-value.js +3 -3
  627. package/src/utils/hooks/test/use-latest-ref.js +1 -1
  628. package/src/utils/test/math.js +2 -2
  629. package/src/utils/test/rtl.js +12 -12
  630. package/tsconfig.json +1 -1
  631. package/tsconfig.tsbuildinfo +1 -1
  632. package/src/divider/stories/index.js +0 -64
  633. package/src/heading/stories/index.js +0 -24
@@ -8,7 +8,7 @@ import { isRTL } from '@wordpress/i18n';
8
8
  * Module constants
9
9
  */
10
10
 
11
- const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
11
+ const HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space.
12
12
 
13
13
  /**
14
14
  * Utility used to compute the popover position over the xAxis
@@ -31,7 +31,7 @@ const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
31
31
  export function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) {
32
32
  const {
33
33
  width
34
- } = contentSize; // Correct xAxis for RTL support
34
+ } = contentSize; // Correct xAxis for RTL support.
35
35
 
36
36
  if (xAxis === 'left' && isRTL()) {
37
37
  xAxis = 'right';
@@ -43,7 +43,7 @@ export function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corn
43
43
  corner = 'right';
44
44
  } else if (corner === 'right' && isRTL()) {
45
45
  corner = 'left';
46
- } // x axis alignment choices
46
+ } // X axis alignment choices.
47
47
 
48
48
 
49
49
  const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
@@ -74,7 +74,7 @@ export function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corn
74
74
  const rightAlignment = {
75
75
  popoverLeft: rightAlignmentX,
76
76
  contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
77
- }; // Choosing the x axis
77
+ }; // Choosing the x axis.
78
78
 
79
79
  let chosenXAxis = xAxis;
80
80
  let contentWidth = null;
@@ -184,7 +184,7 @@ export function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corn
184
184
  popoverTop: Math.min(anchorRect.bottom, stickyPositionTop)
185
185
  };
186
186
  }
187
- } // y axis alignment choices
187
+ } // Y axis alignment choices.
188
188
 
189
189
 
190
190
  let anchorMidPoint = anchorRect.top + anchorRect.height / 2;
@@ -206,7 +206,7 @@ export function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corn
206
206
  const bottomAlignment = {
207
207
  popoverTop: anchorRect.bottom,
208
208
  contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
209
- }; // Choosing the y axis
209
+ }; // Choosing the y axis.
210
210
 
211
211
  let chosenYAxis = yAxis;
212
212
  let contentHeight = null;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/popover/utils.js"],"names":["isRTL","HEIGHT_OFFSET","computePopoverXAxisPosition","anchorRect","contentSize","xAxis","corner","stickyBoundaryElement","chosenYAxis","boundaryElement","forcePosition","forceXAlignment","width","anchorMidPoint","Math","round","left","centerAlignment","popoverLeft","contentWidth","window","innerWidth","leftAlignmentX","right","rightAlignmentX","leftAlignment","rightAlignment","chosenXAxis","chosenWidth","min","offsetLeft","offsetWidth","max","computePopoverYAxisPosition","yAxis","anchorRef","relativeOffsetTop","editorWrapper","height","stickyRect","getBoundingClientRect","stickyPositionTop","top","stickyPositionBottom","bottom","isRoomAboveInCanvas","scrollTop","popoverTop","middleAlignment","contentHeight","innerHeight","topAlignment","bottomAlignment","chosenHeight","computePopoverPosition","position","split","yAxisPosition","xAxisPosition","offsetIframe","rect","ownerDocument","container","defaultView","frameElement","iframeRect","DOMRect"],"mappings":"AAAA;;AACA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,iBAAtB;AAEA;AACA;AACA;;AACA,MAAMC,aAAa,GAAG,EAAtB,C,CAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,2BAAT,CACNC,UADM,EAENC,WAFM,EAGNC,KAHM,EAINC,MAJM,EAKNC,qBALM,EAMNC,WANM,EAONC,eAPM,EAQNC,aARM,EASNC,eATM,EAUL;AACD,QAAM;AAAEC,IAAAA;AAAF,MAAYR,WAAlB,CADC,CAGD;;AACA,MAAKC,KAAK,KAAK,MAAV,IAAoBL,KAAK,EAA9B,EAAmC;AAClCK,IAAAA,KAAK,GAAG,OAAR;AACA,GAFD,MAEO,IAAKA,KAAK,KAAK,OAAV,IAAqBL,KAAK,EAA/B,EAAoC;AAC1CK,IAAAA,KAAK,GAAG,MAAR;AACA;;AAED,MAAKC,MAAM,KAAK,MAAX,IAAqBN,KAAK,EAA/B,EAAoC;AACnCM,IAAAA,MAAM,GAAG,OAAT;AACA,GAFD,MAEO,IAAKA,MAAM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A;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,YAAT,CAAuBC,IAAvB,EAA6BC,aAA7B,EAA4CC,SAA5C,EAAwD;AAC9D,QAAM;AAAEC,IAAAA;AAAF,MAAkBF,aAAxB;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAmBD,WAAzB;;AAEA,MAAK,CAAEC,YAAF,IAAkBH,aAAa,KAAKC,SAAS,CAACD,aAAnD,EAAmE;AAClE,WAAOD,IAAP;AACA;;AAED,QAAMK,UAAU,GAAGD,YAAY,CAACxB,qBAAb,EAAnB;AACA,SAAO,IAAIuB,WAAW,CAACG,OAAhB,CACNN,IAAI,CAAC5C,IAAL,GAAYiD,UAAU,CAACjD,IADjB,EAEN4C,IAAI,CAAClB,GAAL,GAAWuB,UAAU,CAACvB,GAFhB,EAGNkB,IAAI,CAAChD,KAHC,EAINgD,IAAI,CAACtB,MAJC,CAAP;AAMA","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Module constants\n */\nconst HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space\n\n/**\n * Utility used to compute the popover position over the xAxis\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} xAxis Desired xAxis.\n * @param {string} corner Desired corner.\n * @param {boolean} stickyBoundaryElement The boundary element to use when\n * switching between sticky and normal\n * position.\n * @param {string} chosenYAxis yAxis to be used.\n * @param {Element} boundaryElement Boundary element.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis\n *\n * @return {Object} Popover xAxis position and constraints.\n */\nexport function computePopoverXAxisPosition(\n\tanchorRect,\n\tcontentSize,\n\txAxis,\n\tcorner,\n\tstickyBoundaryElement,\n\tchosenYAxis,\n\tboundaryElement,\n\tforcePosition,\n\tforceXAlignment\n) {\n\tconst { width } = contentSize;\n\n\t// Correct xAxis for RTL support\n\tif ( xAxis === 'left' && isRTL() ) {\n\t\txAxis = 'right';\n\t} else if ( xAxis === 'right' && isRTL() ) {\n\t\txAxis = 'left';\n\t}\n\n\tif ( corner === 'left' && isRTL() ) {\n\t\tcorner = 'right';\n\t} else if ( corner === 'right' && isRTL() ) {\n\t\tcorner = 'left';\n\t}\n\n\t// x axis alignment choices\n\tconst anchorMidPoint = Math.round( anchorRect.left + anchorRect.width / 2 );\n\tconst centerAlignment = {\n\t\tpopoverLeft: anchorMidPoint,\n\t\tcontentWidth:\n\t\t\t( anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint ) +\n\t\t\t( anchorMidPoint + width / 2 > window.innerWidth\n\t\t\t\t? window.innerWidth - anchorMidPoint\n\t\t\t\t: width / 2 ),\n\t};\n\n\tlet leftAlignmentX = anchorRect.left;\n\n\tif ( corner === 'right' ) {\n\t\tleftAlignmentX = anchorRect.right;\n\t} else if ( chosenYAxis !== 'middle' && ! forceXAlignment ) {\n\t\tleftAlignmentX = anchorMidPoint;\n\t}\n\n\tlet rightAlignmentX = anchorRect.right;\n\n\tif ( corner === 'left' ) {\n\t\trightAlignmentX = anchorRect.left;\n\t} else if ( chosenYAxis !== 'middle' && ! forceXAlignment ) {\n\t\trightAlignmentX = anchorMidPoint;\n\t}\n\n\tconst leftAlignment = {\n\t\tpopoverLeft: leftAlignmentX,\n\t\tcontentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX,\n\t};\n\tconst rightAlignment = {\n\t\tpopoverLeft: rightAlignmentX,\n\t\tcontentWidth:\n\t\t\trightAlignmentX + width > window.innerWidth\n\t\t\t\t? window.innerWidth - rightAlignmentX\n\t\t\t\t: width,\n\t};\n\n\t// Choosing the x axis\n\tlet chosenXAxis = xAxis;\n\tlet contentWidth = null;\n\n\tif ( ! stickyBoundaryElement && ! forcePosition ) {\n\t\tif ( xAxis === 'center' && centerAlignment.contentWidth === width ) {\n\t\t\tchosenXAxis = 'center';\n\t\t} else if ( xAxis === 'left' && leftAlignment.contentWidth === width ) {\n\t\t\tchosenXAxis = 'left';\n\t\t} else if (\n\t\t\txAxis === 'right' &&\n\t\t\trightAlignment.contentWidth === width\n\t\t) {\n\t\t\tchosenXAxis = 'right';\n\t\t} else {\n\t\t\tchosenXAxis =\n\t\t\t\tleftAlignment.contentWidth > rightAlignment.contentWidth\n\t\t\t\t\t? 'left'\n\t\t\t\t\t: 'right';\n\t\t\tconst chosenWidth =\n\t\t\t\tchosenXAxis === 'left'\n\t\t\t\t\t? leftAlignment.contentWidth\n\t\t\t\t\t: rightAlignment.contentWidth;\n\n\t\t\t// Limit width of the content to the viewport width\n\t\t\tif ( width > window.innerWidth ) {\n\t\t\t\tcontentWidth = window.innerWidth;\n\t\t\t}\n\n\t\t\t// If we can't find any alignment options that could fit\n\t\t\t// our content, then let's fallback to the center of the viewport.\n\t\t\tif ( chosenWidth !== width ) {\n\t\t\t\tchosenXAxis = 'center';\n\t\t\t\tcenterAlignment.popoverLeft = window.innerWidth / 2;\n\t\t\t}\n\t\t}\n\t}\n\n\tlet popoverLeft;\n\tif ( chosenXAxis === 'center' ) {\n\t\tpopoverLeft = centerAlignment.popoverLeft;\n\t} else if ( chosenXAxis === 'left' ) {\n\t\tpopoverLeft = leftAlignment.popoverLeft;\n\t} else {\n\t\tpopoverLeft = rightAlignment.popoverLeft;\n\t}\n\n\tif ( boundaryElement ) {\n\t\tpopoverLeft = Math.min(\n\t\t\tpopoverLeft,\n\t\t\tboundaryElement.offsetLeft + boundaryElement.offsetWidth - width\n\t\t);\n\n\t\t// Avoid the popover being position beyond the left boundary if the\n\t\t// direction is left to right.\n\t\tif ( ! isRTL() ) {\n\t\t\tpopoverLeft = Math.max( popoverLeft, 0 );\n\t\t}\n\t}\n\n\treturn {\n\t\txAxis: chosenXAxis,\n\t\tpopoverLeft,\n\t\tcontentWidth,\n\t};\n}\n\n/**\n * Utility used to compute the popover position over the yAxis\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} yAxis Desired yAxis.\n * @param {string} corner Desired corner.\n * @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky\n * and normal position.\n * @param {Element} anchorRef The anchor element.\n * @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned\n * parent container.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access\n * scroll position to determine sticky behavior.\n * @return {Object} Popover xAxis position and constraints.\n */\nexport function computePopoverYAxisPosition(\n\tanchorRect,\n\tcontentSize,\n\tyAxis,\n\tcorner,\n\tstickyBoundaryElement,\n\tanchorRef,\n\trelativeOffsetTop,\n\tforcePosition,\n\teditorWrapper\n) {\n\tconst { height } = contentSize;\n\n\tif ( stickyBoundaryElement ) {\n\t\tconst stickyRect = stickyBoundaryElement.getBoundingClientRect();\n\t\tconst stickyPositionTop = stickyRect.top + height - relativeOffsetTop;\n\t\tconst stickyPositionBottom =\n\t\t\tstickyRect.bottom - height - relativeOffsetTop;\n\n\t\tif ( anchorRect.top <= stickyPositionTop ) {\n\t\t\tif ( editorWrapper ) {\n\t\t\t\t// If a popover cannot be positioned above the anchor, even after scrolling, we must\n\t\t\t\t// ensure we use the bottom position instead of the popover slot. This prevents the\n\t\t\t\t// popover from always restricting block content and interaction while selected if the\n\t\t\t\t// block is near the top of the site editor.\n\n\t\t\t\tconst isRoomAboveInCanvas =\n\t\t\t\t\theight + HEIGHT_OFFSET <\n\t\t\t\t\teditorWrapper.scrollTop + anchorRect.top;\n\t\t\t\tif ( ! isRoomAboveInCanvas ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tyAxis: 'bottom',\n\t\t\t\t\t\t// If the bottom of the block is also below the bottom sticky position (ex -\n\t\t\t\t\t\t// block is also taller than the editor window), return the bottom sticky\n\t\t\t\t\t\t// position instead. We do this instead of the top sticky position both to\n\t\t\t\t\t\t// allow a smooth transition and more importantly to ensure every section of\n\t\t\t\t\t\t// the block can be free from popover obscuration at some point in the\n\t\t\t\t\t\t// scroll position.\n\t\t\t\t\t\tpopoverTop: Math.min(\n\t\t\t\t\t\t\tanchorRect.bottom,\n\t\t\t\t\t\t\tstickyPositionBottom\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Default sticky behavior.\n\t\t\treturn {\n\t\t\t\tyAxis,\n\t\t\t\tpopoverTop: Math.min( anchorRect.bottom, stickyPositionTop ),\n\t\t\t};\n\t\t}\n\t}\n\n\t// y axis alignment choices\n\tlet anchorMidPoint = anchorRect.top + anchorRect.height / 2;\n\n\tif ( corner === 'bottom' ) {\n\t\tanchorMidPoint = anchorRect.bottom;\n\t} else if ( corner === 'top' ) {\n\t\tanchorMidPoint = anchorRect.top;\n\t}\n\n\tconst middleAlignment = {\n\t\tpopoverTop: anchorMidPoint,\n\t\tcontentHeight:\n\t\t\t( anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint ) +\n\t\t\t( anchorMidPoint + height / 2 > window.innerHeight\n\t\t\t\t? window.innerHeight - anchorMidPoint\n\t\t\t\t: height / 2 ),\n\t};\n\n\tconst topAlignment = {\n\t\tpopoverTop: anchorRect.top,\n\t\tcontentHeight:\n\t\t\tanchorRect.top - HEIGHT_OFFSET - height > 0\n\t\t\t\t? height\n\t\t\t\t: anchorRect.top - HEIGHT_OFFSET,\n\t};\n\tconst bottomAlignment = {\n\t\tpopoverTop: anchorRect.bottom,\n\t\tcontentHeight:\n\t\t\tanchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight\n\t\t\t\t? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom\n\t\t\t\t: height,\n\t};\n\n\t// Choosing the y axis\n\tlet chosenYAxis = yAxis;\n\tlet contentHeight = null;\n\n\tif ( ! stickyBoundaryElement && ! forcePosition ) {\n\t\tif ( yAxis === 'middle' && middleAlignment.contentHeight === height ) {\n\t\t\tchosenYAxis = 'middle';\n\t\t} else if ( yAxis === 'top' && topAlignment.contentHeight === height ) {\n\t\t\tchosenYAxis = 'top';\n\t\t} else if (\n\t\t\tyAxis === 'bottom' &&\n\t\t\tbottomAlignment.contentHeight === height\n\t\t) {\n\t\t\tchosenYAxis = 'bottom';\n\t\t} else {\n\t\t\tchosenYAxis =\n\t\t\t\ttopAlignment.contentHeight > bottomAlignment.contentHeight\n\t\t\t\t\t? 'top'\n\t\t\t\t\t: 'bottom';\n\t\t\tconst chosenHeight =\n\t\t\t\tchosenYAxis === 'top'\n\t\t\t\t\t? topAlignment.contentHeight\n\t\t\t\t\t: bottomAlignment.contentHeight;\n\t\t\tcontentHeight = chosenHeight !== height ? chosenHeight : null;\n\t\t}\n\t}\n\n\tlet popoverTop;\n\tif ( chosenYAxis === 'middle' ) {\n\t\tpopoverTop = middleAlignment.popoverTop;\n\t} else if ( chosenYAxis === 'top' ) {\n\t\tpopoverTop = topAlignment.popoverTop;\n\t} else {\n\t\tpopoverTop = bottomAlignment.popoverTop;\n\t}\n\n\treturn {\n\t\tyAxis: chosenYAxis,\n\t\tpopoverTop,\n\t\tcontentHeight,\n\t};\n}\n\n/**\n * Utility used to compute the popover position and the content max width/height for a popover given\n * its anchor rect and its content size.\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} position Position.\n * @param {boolean} stickyBoundaryElement The boundary element to use when switching between\n * sticky and normal position.\n * @param {Element} anchorRef The anchor element.\n * @param {number} relativeOffsetTop If applicable, top offset of the relative positioned\n * parent container.\n * @param {Element} boundaryElement Boundary element.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis\n * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access\n * scroll position to determine sticky behavior.\n * @return {Object} Popover position and constraints.\n */\nexport function computePopoverPosition(\n\tanchorRect,\n\tcontentSize,\n\tposition = 'top',\n\tstickyBoundaryElement,\n\tanchorRef,\n\trelativeOffsetTop,\n\tboundaryElement,\n\tforcePosition,\n\tforceXAlignment,\n\teditorWrapper\n) {\n\tconst [ yAxis, xAxis = 'center', corner ] = position.split( ' ' );\n\n\tconst yAxisPosition = computePopoverYAxisPosition(\n\t\tanchorRect,\n\t\tcontentSize,\n\t\tyAxis,\n\t\tcorner,\n\t\tstickyBoundaryElement,\n\t\tanchorRef,\n\t\trelativeOffsetTop,\n\t\tforcePosition,\n\t\teditorWrapper\n\t);\n\tconst xAxisPosition = computePopoverXAxisPosition(\n\t\tanchorRect,\n\t\tcontentSize,\n\t\txAxis,\n\t\tcorner,\n\t\tstickyBoundaryElement,\n\t\tyAxisPosition.yAxis,\n\t\tboundaryElement,\n\t\tforcePosition,\n\t\tforceXAlignment\n\t);\n\n\treturn {\n\t\t...xAxisPosition,\n\t\t...yAxisPosition,\n\t};\n}\n\n/**\n * Offsets the given rect by the position of the iframe that contains the\n * element. If the owner document is not in an iframe then it returns with the\n * original rect. If the popover container document and the anchor document are\n * the same, the original rect will also be returned.\n *\n * @param {DOMRect} rect bounds of the element\n * @param {Document} ownerDocument document of the element\n * @param {Element} container The popover container to position.\n *\n * @return {DOMRect} offsetted bounds\n */\nexport function offsetIframe( rect, ownerDocument, container ) {\n\tconst { defaultView } = ownerDocument;\n\tconst { frameElement } = defaultView;\n\n\tif ( ! frameElement || ownerDocument === container.ownerDocument ) {\n\t\treturn rect;\n\t}\n\n\tconst iframeRect = frameElement.getBoundingClientRect();\n\treturn new defaultView.DOMRect(\n\t\trect.left + iframeRect.left,\n\t\trect.top + iframeRect.top,\n\t\trect.width,\n\t\trect.height\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/popover/utils.js"],"names":["isRTL","HEIGHT_OFFSET","computePopoverXAxisPosition","anchorRect","contentSize","xAxis","corner","stickyBoundaryElement","chosenYAxis","boundaryElement","forcePosition","forceXAlignment","width","anchorMidPoint","Math","round","left","centerAlignment","popoverLeft","contentWidth","window","innerWidth","leftAlignmentX","right","rightAlignmentX","leftAlignment","rightAlignment","chosenXAxis","chosenWidth","min","offsetLeft","offsetWidth","max","computePopoverYAxisPosition","yAxis","anchorRef","relativeOffsetTop","editorWrapper","height","stickyRect","getBoundingClientRect","stickyPositionTop","top","stickyPositionBottom","bottom","isRoomAboveInCanvas","scrollTop","popoverTop","middleAlignment","contentHeight","innerHeight","topAlignment","bottomAlignment","chosenHeight","computePopoverPosition","position","split","yAxisPosition","xAxisPosition","offsetIframe","rect","ownerDocument","container","defaultView","frameElement","iframeRect","DOMRect"],"mappings":"AAAA;;AACA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,iBAAtB;AAEA;AACA;AACA;;AACA,MAAMC,aAAa,GAAG,EAAtB,C,CAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,2BAAT,CACNC,UADM,EAENC,WAFM,EAGNC,KAHM,EAINC,MAJM,EAKNC,qBALM,EAMNC,WANM,EAONC,eAPM,EAQNC,aARM,EASNC,eATM,EAUL;AACD,QAAM;AAAEC,IAAAA;AAAF,MAAYR,WAAlB,CADC,CAGD;;AACA,MAAKC,KAAK,KAAK,MAAV,IAAoBL,KAAK,EAA9B,EAAmC;AAClCK,IAAAA,KAAK,GAAG,OAAR;AACA,GAFD,MAEO,IAAKA,KAAK,KAAK,OAAV,IAAqBL,KAAK,EAA/B,EAAoC;AAC1CK,IAAAA,KAAK,GAAG,MAAR;AACA;;AAED,MAAKC,MAAM,KAAK,MAAX,IAAqBN,KAAK,EAA/B,EAAoC;AACnCM,IAAAA,MAAM,GAAG,OAAT;AACA,GAFD,MAEO,IAAKA,MAAM,KAAK,OAAX,IAAsBN,KAAK,EAAhC,EAAqC;AAC3CM,IAAAA,MAAM,GAAG,MAAT;AACA,GAdA,CAgBD;;;AACA,QAAMO,cAAc,GAAGC,IAAI,CAACC,KAAL,CAAYZ,UAAU,CAACa,IAAX,GAAkBb,UAAU,CAACS,KAAX,GAAmB,CAAjD,CAAvB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AAAF,MAAmBD,WAAzB;;AAEA,MAAK,CAAEC,YAAF,IAAkBH,aAAa,KAAKC,SAAS,CAACD,aAAnD,EAAmE;AAClE,WAAOD,IAAP;AACA;;AAED,QAAMK,UAAU,GAAGD,YAAY,CAACxB,qBAAb,EAAnB;AACA,SAAO,IAAIuB,WAAW,CAACG,OAAhB,CACNN,IAAI,CAAC5C,IAAL,GAAYiD,UAAU,CAACjD,IADjB,EAEN4C,IAAI,CAAClB,GAAL,GAAWuB,UAAU,CAACvB,GAFhB,EAGNkB,IAAI,CAAChD,KAHC,EAINgD,IAAI,CAACtB,MAJC,CAAP;AAMA","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Module constants\n */\nconst HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space.\n\n/**\n * Utility used to compute the popover position over the xAxis\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} xAxis Desired xAxis.\n * @param {string} corner Desired corner.\n * @param {boolean} stickyBoundaryElement The boundary element to use when\n * switching between sticky and normal\n * position.\n * @param {string} chosenYAxis yAxis to be used.\n * @param {Element} boundaryElement Boundary element.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis\n *\n * @return {Object} Popover xAxis position and constraints.\n */\nexport function computePopoverXAxisPosition(\n\tanchorRect,\n\tcontentSize,\n\txAxis,\n\tcorner,\n\tstickyBoundaryElement,\n\tchosenYAxis,\n\tboundaryElement,\n\tforcePosition,\n\tforceXAlignment\n) {\n\tconst { width } = contentSize;\n\n\t// Correct xAxis for RTL support.\n\tif ( xAxis === 'left' && isRTL() ) {\n\t\txAxis = 'right';\n\t} else if ( xAxis === 'right' && isRTL() ) {\n\t\txAxis = 'left';\n\t}\n\n\tif ( corner === 'left' && isRTL() ) {\n\t\tcorner = 'right';\n\t} else if ( corner === 'right' && isRTL() ) {\n\t\tcorner = 'left';\n\t}\n\n\t// X axis alignment choices.\n\tconst anchorMidPoint = Math.round( anchorRect.left + anchorRect.width / 2 );\n\tconst centerAlignment = {\n\t\tpopoverLeft: anchorMidPoint,\n\t\tcontentWidth:\n\t\t\t( anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint ) +\n\t\t\t( anchorMidPoint + width / 2 > window.innerWidth\n\t\t\t\t? window.innerWidth - anchorMidPoint\n\t\t\t\t: width / 2 ),\n\t};\n\n\tlet leftAlignmentX = anchorRect.left;\n\n\tif ( corner === 'right' ) {\n\t\tleftAlignmentX = anchorRect.right;\n\t} else if ( chosenYAxis !== 'middle' && ! forceXAlignment ) {\n\t\tleftAlignmentX = anchorMidPoint;\n\t}\n\n\tlet rightAlignmentX = anchorRect.right;\n\n\tif ( corner === 'left' ) {\n\t\trightAlignmentX = anchorRect.left;\n\t} else if ( chosenYAxis !== 'middle' && ! forceXAlignment ) {\n\t\trightAlignmentX = anchorMidPoint;\n\t}\n\n\tconst leftAlignment = {\n\t\tpopoverLeft: leftAlignmentX,\n\t\tcontentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX,\n\t};\n\tconst rightAlignment = {\n\t\tpopoverLeft: rightAlignmentX,\n\t\tcontentWidth:\n\t\t\trightAlignmentX + width > window.innerWidth\n\t\t\t\t? window.innerWidth - rightAlignmentX\n\t\t\t\t: width,\n\t};\n\n\t// Choosing the x axis.\n\tlet chosenXAxis = xAxis;\n\tlet contentWidth = null;\n\n\tif ( ! stickyBoundaryElement && ! forcePosition ) {\n\t\tif ( xAxis === 'center' && centerAlignment.contentWidth === width ) {\n\t\t\tchosenXAxis = 'center';\n\t\t} else if ( xAxis === 'left' && leftAlignment.contentWidth === width ) {\n\t\t\tchosenXAxis = 'left';\n\t\t} else if (\n\t\t\txAxis === 'right' &&\n\t\t\trightAlignment.contentWidth === width\n\t\t) {\n\t\t\tchosenXAxis = 'right';\n\t\t} else {\n\t\t\tchosenXAxis =\n\t\t\t\tleftAlignment.contentWidth > rightAlignment.contentWidth\n\t\t\t\t\t? 'left'\n\t\t\t\t\t: 'right';\n\t\t\tconst chosenWidth =\n\t\t\t\tchosenXAxis === 'left'\n\t\t\t\t\t? leftAlignment.contentWidth\n\t\t\t\t\t: rightAlignment.contentWidth;\n\n\t\t\t// Limit width of the content to the viewport width\n\t\t\tif ( width > window.innerWidth ) {\n\t\t\t\tcontentWidth = window.innerWidth;\n\t\t\t}\n\n\t\t\t// If we can't find any alignment options that could fit\n\t\t\t// our content, then let's fallback to the center of the viewport.\n\t\t\tif ( chosenWidth !== width ) {\n\t\t\t\tchosenXAxis = 'center';\n\t\t\t\tcenterAlignment.popoverLeft = window.innerWidth / 2;\n\t\t\t}\n\t\t}\n\t}\n\n\tlet popoverLeft;\n\tif ( chosenXAxis === 'center' ) {\n\t\tpopoverLeft = centerAlignment.popoverLeft;\n\t} else if ( chosenXAxis === 'left' ) {\n\t\tpopoverLeft = leftAlignment.popoverLeft;\n\t} else {\n\t\tpopoverLeft = rightAlignment.popoverLeft;\n\t}\n\n\tif ( boundaryElement ) {\n\t\tpopoverLeft = Math.min(\n\t\t\tpopoverLeft,\n\t\t\tboundaryElement.offsetLeft + boundaryElement.offsetWidth - width\n\t\t);\n\n\t\t// Avoid the popover being position beyond the left boundary if the\n\t\t// direction is left to right.\n\t\tif ( ! isRTL() ) {\n\t\t\tpopoverLeft = Math.max( popoverLeft, 0 );\n\t\t}\n\t}\n\n\treturn {\n\t\txAxis: chosenXAxis,\n\t\tpopoverLeft,\n\t\tcontentWidth,\n\t};\n}\n\n/**\n * Utility used to compute the popover position over the yAxis\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} yAxis Desired yAxis.\n * @param {string} corner Desired corner.\n * @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky\n * and normal position.\n * @param {Element} anchorRef The anchor element.\n * @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned\n * parent container.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access\n * scroll position to determine sticky behavior.\n * @return {Object} Popover xAxis position and constraints.\n */\nexport function computePopoverYAxisPosition(\n\tanchorRect,\n\tcontentSize,\n\tyAxis,\n\tcorner,\n\tstickyBoundaryElement,\n\tanchorRef,\n\trelativeOffsetTop,\n\tforcePosition,\n\teditorWrapper\n) {\n\tconst { height } = contentSize;\n\n\tif ( stickyBoundaryElement ) {\n\t\tconst stickyRect = stickyBoundaryElement.getBoundingClientRect();\n\t\tconst stickyPositionTop = stickyRect.top + height - relativeOffsetTop;\n\t\tconst stickyPositionBottom =\n\t\t\tstickyRect.bottom - height - relativeOffsetTop;\n\n\t\tif ( anchorRect.top <= stickyPositionTop ) {\n\t\t\tif ( editorWrapper ) {\n\t\t\t\t// If a popover cannot be positioned above the anchor, even after scrolling, we must\n\t\t\t\t// ensure we use the bottom position instead of the popover slot. This prevents the\n\t\t\t\t// popover from always restricting block content and interaction while selected if the\n\t\t\t\t// block is near the top of the site editor.\n\n\t\t\t\tconst isRoomAboveInCanvas =\n\t\t\t\t\theight + HEIGHT_OFFSET <\n\t\t\t\t\teditorWrapper.scrollTop + anchorRect.top;\n\t\t\t\tif ( ! isRoomAboveInCanvas ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tyAxis: 'bottom',\n\t\t\t\t\t\t// If the bottom of the block is also below the bottom sticky position (ex -\n\t\t\t\t\t\t// block is also taller than the editor window), return the bottom sticky\n\t\t\t\t\t\t// position instead. We do this instead of the top sticky position both to\n\t\t\t\t\t\t// allow a smooth transition and more importantly to ensure every section of\n\t\t\t\t\t\t// the block can be free from popover obscuration at some point in the\n\t\t\t\t\t\t// scroll position.\n\t\t\t\t\t\tpopoverTop: Math.min(\n\t\t\t\t\t\t\tanchorRect.bottom,\n\t\t\t\t\t\t\tstickyPositionBottom\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Default sticky behavior.\n\t\t\treturn {\n\t\t\t\tyAxis,\n\t\t\t\tpopoverTop: Math.min( anchorRect.bottom, stickyPositionTop ),\n\t\t\t};\n\t\t}\n\t}\n\n\t// Y axis alignment choices.\n\tlet anchorMidPoint = anchorRect.top + anchorRect.height / 2;\n\n\tif ( corner === 'bottom' ) {\n\t\tanchorMidPoint = anchorRect.bottom;\n\t} else if ( corner === 'top' ) {\n\t\tanchorMidPoint = anchorRect.top;\n\t}\n\n\tconst middleAlignment = {\n\t\tpopoverTop: anchorMidPoint,\n\t\tcontentHeight:\n\t\t\t( anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint ) +\n\t\t\t( anchorMidPoint + height / 2 > window.innerHeight\n\t\t\t\t? window.innerHeight - anchorMidPoint\n\t\t\t\t: height / 2 ),\n\t};\n\n\tconst topAlignment = {\n\t\tpopoverTop: anchorRect.top,\n\t\tcontentHeight:\n\t\t\tanchorRect.top - HEIGHT_OFFSET - height > 0\n\t\t\t\t? height\n\t\t\t\t: anchorRect.top - HEIGHT_OFFSET,\n\t};\n\tconst bottomAlignment = {\n\t\tpopoverTop: anchorRect.bottom,\n\t\tcontentHeight:\n\t\t\tanchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight\n\t\t\t\t? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom\n\t\t\t\t: height,\n\t};\n\n\t// Choosing the y axis.\n\tlet chosenYAxis = yAxis;\n\tlet contentHeight = null;\n\n\tif ( ! stickyBoundaryElement && ! forcePosition ) {\n\t\tif ( yAxis === 'middle' && middleAlignment.contentHeight === height ) {\n\t\t\tchosenYAxis = 'middle';\n\t\t} else if ( yAxis === 'top' && topAlignment.contentHeight === height ) {\n\t\t\tchosenYAxis = 'top';\n\t\t} else if (\n\t\t\tyAxis === 'bottom' &&\n\t\t\tbottomAlignment.contentHeight === height\n\t\t) {\n\t\t\tchosenYAxis = 'bottom';\n\t\t} else {\n\t\t\tchosenYAxis =\n\t\t\t\ttopAlignment.contentHeight > bottomAlignment.contentHeight\n\t\t\t\t\t? 'top'\n\t\t\t\t\t: 'bottom';\n\t\t\tconst chosenHeight =\n\t\t\t\tchosenYAxis === 'top'\n\t\t\t\t\t? topAlignment.contentHeight\n\t\t\t\t\t: bottomAlignment.contentHeight;\n\t\t\tcontentHeight = chosenHeight !== height ? chosenHeight : null;\n\t\t}\n\t}\n\n\tlet popoverTop;\n\tif ( chosenYAxis === 'middle' ) {\n\t\tpopoverTop = middleAlignment.popoverTop;\n\t} else if ( chosenYAxis === 'top' ) {\n\t\tpopoverTop = topAlignment.popoverTop;\n\t} else {\n\t\tpopoverTop = bottomAlignment.popoverTop;\n\t}\n\n\treturn {\n\t\tyAxis: chosenYAxis,\n\t\tpopoverTop,\n\t\tcontentHeight,\n\t};\n}\n\n/**\n * Utility used to compute the popover position and the content max width/height for a popover given\n * its anchor rect and its content size.\n *\n * @param {Object} anchorRect Anchor Rect.\n * @param {Object} contentSize Content Size.\n * @param {string} position Position.\n * @param {boolean} stickyBoundaryElement The boundary element to use when switching between\n * sticky and normal position.\n * @param {Element} anchorRef The anchor element.\n * @param {number} relativeOffsetTop If applicable, top offset of the relative positioned\n * parent container.\n * @param {Element} boundaryElement Boundary element.\n * @param {boolean} forcePosition Don't adjust position based on anchor.\n * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis\n * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access\n * scroll position to determine sticky behavior.\n * @return {Object} Popover position and constraints.\n */\nexport function computePopoverPosition(\n\tanchorRect,\n\tcontentSize,\n\tposition = 'top',\n\tstickyBoundaryElement,\n\tanchorRef,\n\trelativeOffsetTop,\n\tboundaryElement,\n\tforcePosition,\n\tforceXAlignment,\n\teditorWrapper\n) {\n\tconst [ yAxis, xAxis = 'center', corner ] = position.split( ' ' );\n\n\tconst yAxisPosition = computePopoverYAxisPosition(\n\t\tanchorRect,\n\t\tcontentSize,\n\t\tyAxis,\n\t\tcorner,\n\t\tstickyBoundaryElement,\n\t\tanchorRef,\n\t\trelativeOffsetTop,\n\t\tforcePosition,\n\t\teditorWrapper\n\t);\n\tconst xAxisPosition = computePopoverXAxisPosition(\n\t\tanchorRect,\n\t\tcontentSize,\n\t\txAxis,\n\t\tcorner,\n\t\tstickyBoundaryElement,\n\t\tyAxisPosition.yAxis,\n\t\tboundaryElement,\n\t\tforcePosition,\n\t\tforceXAlignment\n\t);\n\n\treturn {\n\t\t...xAxisPosition,\n\t\t...yAxisPosition,\n\t};\n}\n\n/**\n * Offsets the given rect by the position of the iframe that contains the\n * element. If the owner document is not in an iframe then it returns with the\n * original rect. If the popover container document and the anchor document are\n * the same, the original rect will also be returned.\n *\n * @param {DOMRect} rect bounds of the element\n * @param {Document} ownerDocument document of the element\n * @param {Element} container The popover container to position.\n *\n * @return {DOMRect} offsetted bounds\n */\nexport function offsetIframe( rect, ownerDocument, container ) {\n\tconst { defaultView } = ownerDocument;\n\tconst { frameElement } = defaultView;\n\n\tif ( ! frameElement || ownerDocument === container.ownerDocument ) {\n\t\treturn rect;\n\t}\n\n\tconst iframeRect = frameElement.getBoundingClientRect();\n\treturn new defaultView.DOMRect(\n\t\trect.left + iframeRect.left,\n\t\trect.top + iframeRect.top,\n\t\trect.width,\n\t\trect.height\n\t);\n}\n"]}
@@ -32,7 +32,7 @@ function RadioGroup(_ref, ref) {
32
32
  });
33
33
  const radioContext = { ...radioState,
34
34
  disabled,
35
- // controlled or uncontrolled
35
+ // Controlled or uncontrolled.
36
36
  state: checked !== null && checked !== void 0 ? checked : radioState.state,
37
37
  setState: onChange !== null && onChange !== void 0 ? onChange : radioState.setState
38
38
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/radio-group/index.js"],"names":["useRadioState","RadioGroup","ReakitRadioGroup","forwardRef","ButtonGroup","RadioContext","ref","label","checked","defaultChecked","disabled","onChange","props","radioState","state","baseId","id","radioContext","setState"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,UAAU,IAAIC,gBAAtC,QAA8D,cAA9D;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;;AAEA,SAASJ,UAAT,OAECK,GAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBC,IAAAA,cAAlB;AAAkCC,IAAAA,QAAlC;AAA4CC,IAAAA,QAA5C;AAAsD,OAAGC;AAAzD,GAEC;AACD,QAAMC,UAAU,GAAGb,aAAa,CAAE;AACjCc,IAAAA,KAAK,EAAEL,cAD0B;AAEjCM,IAAAA,MAAM,EAAEH,KAAK,CAACI;AAFmB,GAAF,CAAhC;AAIA,QAAMC,YAAY,GAAG,EACpB,GAAGJ,UADiB;AAEpBH,IAAAA,QAFoB;AAGpB;AACAI,IAAAA,KAAK,EAAEN,OAAF,aAAEA,OAAF,cAAEA,OAAF,GAAaK,UAAU,CAACC,KAJT;AAKpBI,IAAAA,QAAQ,EAAEP,QAAF,aAAEA,QAAF,cAAEA,QAAF,GAAcE,UAAU,CAACK;AALb,GAArB;AAQA,SACC,cAAC,YAAD,CAAc,QAAd;AAAuB,IAAA,KAAK,EAAGD;AAA/B,KACC,cAAC,gBAAD;AACC,IAAA,GAAG,EAAGX,GADP;AAEC,IAAA,EAAE,EAAGF,WAFN;AAGC,kBAAaG;AAHd,KAIMM,UAJN,EAKMD,KALN,EADD,CADD;AAWA;;AAED,eAAeT,UAAU,CAAEF,UAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport { useRadioState, RadioGroup as ReakitRadioGroup } from 'reakit/Radio';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ButtonGroup from '../button-group';\nimport RadioContext from '../radio-context';\n\nfunction RadioGroup(\n\t{ label, checked, defaultChecked, disabled, onChange, ...props },\n\tref\n) {\n\tconst radioState = useRadioState( {\n\t\tstate: defaultChecked,\n\t\tbaseId: props.id,\n\t} );\n\tconst radioContext = {\n\t\t...radioState,\n\t\tdisabled,\n\t\t// controlled or uncontrolled\n\t\tstate: checked ?? radioState.state,\n\t\tsetState: onChange ?? radioState.setState,\n\t};\n\n\treturn (\n\t\t<RadioContext.Provider value={ radioContext }>\n\t\t\t<ReakitRadioGroup\n\t\t\t\tref={ ref }\n\t\t\t\tas={ ButtonGroup }\n\t\t\t\taria-label={ label }\n\t\t\t\t{ ...radioState }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</RadioContext.Provider>\n\t);\n}\n\nexport default forwardRef( RadioGroup );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/radio-group/index.js"],"names":["useRadioState","RadioGroup","ReakitRadioGroup","forwardRef","ButtonGroup","RadioContext","ref","label","checked","defaultChecked","disabled","onChange","props","radioState","state","baseId","id","radioContext","setState"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,UAAU,IAAIC,gBAAtC,QAA8D,cAA9D;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;;AAEA,SAASJ,UAAT,OAECK,GAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBC,IAAAA,cAAlB;AAAkCC,IAAAA,QAAlC;AAA4CC,IAAAA,QAA5C;AAAsD,OAAGC;AAAzD,GAEC;AACD,QAAMC,UAAU,GAAGb,aAAa,CAAE;AACjCc,IAAAA,KAAK,EAAEL,cAD0B;AAEjCM,IAAAA,MAAM,EAAEH,KAAK,CAACI;AAFmB,GAAF,CAAhC;AAIA,QAAMC,YAAY,GAAG,EACpB,GAAGJ,UADiB;AAEpBH,IAAAA,QAFoB;AAGpB;AACAI,IAAAA,KAAK,EAAEN,OAAF,aAAEA,OAAF,cAAEA,OAAF,GAAaK,UAAU,CAACC,KAJT;AAKpBI,IAAAA,QAAQ,EAAEP,QAAF,aAAEA,QAAF,cAAEA,QAAF,GAAcE,UAAU,CAACK;AALb,GAArB;AAQA,SACC,cAAC,YAAD,CAAc,QAAd;AAAuB,IAAA,KAAK,EAAGD;AAA/B,KACC,cAAC,gBAAD;AACC,IAAA,GAAG,EAAGX,GADP;AAEC,IAAA,EAAE,EAAGF,WAFN;AAGC,kBAAaG;AAHd,KAIMM,UAJN,EAKMD,KALN,EADD,CADD;AAWA;;AAED,eAAeT,UAAU,CAAEF,UAAF,CAAzB","sourcesContent":["/**\n * External dependencies\n */\nimport { useRadioState, RadioGroup as ReakitRadioGroup } from 'reakit/Radio';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ButtonGroup from '../button-group';\nimport RadioContext from '../radio-context';\n\nfunction RadioGroup(\n\t{ label, checked, defaultChecked, disabled, onChange, ...props },\n\tref\n) {\n\tconst radioState = useRadioState( {\n\t\tstate: defaultChecked,\n\t\tbaseId: props.id,\n\t} );\n\tconst radioContext = {\n\t\t...radioState,\n\t\tdisabled,\n\t\t// Controlled or uncontrolled.\n\t\tstate: checked ?? radioState.state,\n\t\tsetState: onChange ?? radioState.setState,\n\t};\n\n\treturn (\n\t\t<RadioContext.Provider value={ radioContext }>\n\t\t\t<ReakitRadioGroup\n\t\t\t\tref={ ref }\n\t\t\t\tas={ ButtonGroup }\n\t\t\t\taria-label={ label }\n\t\t\t\t{ ...radioState }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</RadioContext.Provider>\n\t);\n}\n\nexport default forwardRef( RadioGroup );\n"]}