@wordpress/components 19.4.1 → 19.7.0-next.e230fbab09.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 (929) hide show
  1. package/CHANGELOG.md +34 -3
  2. package/CONTRIBUTING.md +69 -2
  3. package/build/alignment-matrix-control/utils.js +1 -1
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/angle-picker-control/angle-circle.js +1 -1
  6. package/build/angle-picker-control/angle-circle.js.map +1 -1
  7. package/build/animation/index.js +0 -6
  8. package/build/animation/index.js.map +1 -1
  9. package/build/autocomplete/get-default-use-items.js +3 -3
  10. package/build/autocomplete/get-default-use-items.js.map +1 -1
  11. package/build/base-field/hook.js +1 -1
  12. package/build/base-field/hook.js.map +1 -1
  13. package/build/box-control/icon.js +1 -1
  14. package/build/box-control/icon.js.map +1 -1
  15. package/build/box-control/index.js +4 -4
  16. package/build/box-control/index.js.map +1 -1
  17. package/build/box-control/unit-control.js +2 -2
  18. package/build/box-control/unit-control.js.map +1 -1
  19. package/build/box-control/utils.js +12 -8
  20. package/build/box-control/utils.js.map +1 -1
  21. package/build/button/index.js +5 -5
  22. package/build/button/index.js.map +1 -1
  23. package/build/button/index.native.js +7 -7
  24. package/build/button/index.native.js.map +1 -1
  25. package/build/card/card/component.js +2 -2
  26. package/build/card/card/component.js.map +1 -1
  27. package/build/card/card-body/component.js +1 -1
  28. package/build/card/card-body/component.js.map +1 -1
  29. package/build/card/card-divider/component.js +1 -1
  30. package/build/card/card-divider/component.js.map +1 -1
  31. package/build/card/card-footer/component.js +1 -1
  32. package/build/card/card-footer/component.js.map +1 -1
  33. package/build/card/card-header/component.js +1 -1
  34. package/build/card/card-header/component.js.map +1 -1
  35. package/build/card/card-media/component.js +1 -1
  36. package/build/card/card-media/component.js.map +1 -1
  37. package/build/color-palette/index.native.js +35 -30
  38. package/build/color-palette/index.native.js.map +1 -1
  39. package/build/color-picker/color-display.js +1 -1
  40. package/build/color-picker/color-display.js.map +1 -1
  41. package/build/color-picker/component.js.map +1 -1
  42. package/build/color-picker/hex-input.js +6 -9
  43. package/build/color-picker/hex-input.js.map +1 -1
  44. package/build/color-picker/styles.js +8 -8
  45. package/build/color-picker/styles.js.map +1 -1
  46. package/build/combobox-control/index.js +1 -1
  47. package/build/combobox-control/index.js.map +1 -1
  48. package/build/confirm-dialog/component.js +4 -2
  49. package/build/confirm-dialog/component.js.map +1 -1
  50. package/build/date-time/time.js +7 -4
  51. package/build/date-time/time.js.map +1 -1
  52. package/build/divider/component.js +5 -4
  53. package/build/divider/component.js.map +1 -1
  54. package/build/draggable/index.js +3 -3
  55. package/build/draggable/index.js.map +1 -1
  56. package/build/elevation/component.js +1 -1
  57. package/build/elevation/component.js.map +1 -1
  58. package/build/flex/flex/component.js +1 -1
  59. package/build/flex/flex/component.js.map +1 -1
  60. package/build/flex/flex-block/component.js +1 -1
  61. package/build/flex/flex-block/component.js.map +1 -1
  62. package/build/flex/flex-item/component.js +1 -1
  63. package/build/flex/flex-item/component.js.map +1 -1
  64. package/build/flyout/flyout/component.js +1 -1
  65. package/build/flyout/flyout/component.js.map +1 -1
  66. package/build/flyout/flyout-content/component.js +1 -1
  67. package/build/flyout/flyout-content/component.js.map +1 -1
  68. package/build/focal-point-picker/index.js +18 -12
  69. package/build/focal-point-picker/index.js.map +1 -1
  70. package/build/focal-point-picker/index.native.js +7 -7
  71. package/build/focal-point-picker/index.native.js.map +1 -1
  72. package/build/focal-point-picker/tooltip/index.native.js +1 -1
  73. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  74. package/build/font-size-picker/index.js +1 -2
  75. package/build/font-size-picker/index.js.map +1 -1
  76. package/build/form-token-field/index.js +6 -6
  77. package/build/form-token-field/index.js.map +1 -1
  78. package/build/form-token-field/suggestions-list.js +2 -2
  79. package/build/form-token-field/suggestions-list.js.map +1 -1
  80. package/build/grid/component.js +1 -1
  81. package/build/grid/component.js.map +1 -1
  82. package/build/h-stack/component.js +1 -1
  83. package/build/h-stack/component.js.map +1 -1
  84. package/build/heading/component.js +6 -5
  85. package/build/heading/component.js.map +1 -1
  86. package/build/heading/hook.js +1 -1
  87. package/build/heading/hook.js.map +1 -1
  88. package/build/higher-order/with-notices/index.js +1 -1
  89. package/build/higher-order/with-notices/index.js.map +1 -1
  90. package/build/index.js +14 -2
  91. package/build/index.js.map +1 -1
  92. package/build/index.native.js +15 -1
  93. package/build/index.native.js.map +1 -1
  94. package/build/input-control/index.js.map +1 -1
  95. package/build/input-control/input-base.js +1 -1
  96. package/build/input-control/input-base.js.map +1 -1
  97. package/build/input-control/input-field.js +19 -17
  98. package/build/input-control/input-field.js.map +1 -1
  99. package/build/input-control/reducer/reducer.js +3 -0
  100. package/build/input-control/reducer/reducer.js.map +1 -1
  101. package/build/input-control/styles/input-control-styles.js +25 -25
  102. package/build/input-control/styles/input-control-styles.js.map +1 -1
  103. package/build/isolated-event-container/index.js +1 -1
  104. package/build/isolated-event-container/index.js.map +1 -1
  105. package/build/item-group/item/component.js.map +1 -1
  106. package/build/item-group/item-group/component.js.map +1 -1
  107. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  108. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  109. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  110. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  111. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  112. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  113. package/build/mobile/bottom-sheet/cell.native.js +1 -1
  114. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  115. package/build/mobile/bottom-sheet/index.native.js +11 -11
  116. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  117. package/build/mobile/bottom-sheet/link-cell.native.js +1 -1
  118. package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  119. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  120. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  121. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  122. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  123. package/build/mobile/color-settings/palette.screen.native.js +26 -9
  124. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  125. package/build/mobile/global-styles-context/utils.native.js +73 -19
  126. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  127. package/build/mobile/gradient/index.native.js +2 -2
  128. package/build/mobile/gradient/index.native.js.map +1 -1
  129. package/build/mobile/html-text-input/container.ios.js +3 -3
  130. package/build/mobile/html-text-input/container.ios.js.map +1 -1
  131. package/build/mobile/html-text-input/index.native.js +1 -1
  132. package/build/mobile/html-text-input/index.native.js.map +1 -1
  133. package/build/mobile/image/index.native.js +1 -1
  134. package/build/mobile/image/index.native.js.map +1 -1
  135. package/build/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  136. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  137. package/build/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  138. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  139. package/build/mobile/link-picker/index.native.js +3 -3
  140. package/build/mobile/link-picker/index.native.js.map +1 -1
  141. package/build/mobile/link-picker/link-picker-results.native.js +8 -8
  142. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  143. package/build/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  144. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  145. package/build/mobile/link-settings/index.native.js +1 -1
  146. package/build/mobile/link-settings/index.native.js.map +1 -1
  147. package/build/modal/aria-helper.js +1 -1
  148. package/build/modal/aria-helper.js.map +1 -1
  149. package/build/modal/index.js +2 -2
  150. package/build/modal/index.js.map +1 -1
  151. package/build/navigable-container/container.js +2 -2
  152. package/build/navigable-container/container.js.map +1 -1
  153. package/build/navigable-container/tabbable.js +1 -1
  154. package/build/navigable-container/tabbable.js.map +1 -1
  155. package/build/navigation/item/index.js +1 -1
  156. package/build/navigation/item/index.js.map +1 -1
  157. package/build/navigation/menu/index.js +1 -1
  158. package/build/navigation/menu/index.js.map +1 -1
  159. package/build/navigator/index.js +16 -0
  160. package/build/navigator/index.js.map +1 -1
  161. package/build/navigator/navigator-back-button/component.js +72 -0
  162. package/build/navigator/navigator-back-button/component.js.map +1 -0
  163. package/build/navigator/navigator-back-button/hook.js +49 -0
  164. package/build/navigator/navigator-back-button/hook.js.map +1 -0
  165. package/build/navigator/navigator-back-button/index.js +16 -0
  166. package/build/navigator/navigator-back-button/index.js.map +1 -0
  167. package/build/navigator/navigator-button/component.js +71 -0
  168. package/build/navigator/navigator-button/component.js.map +1 -0
  169. package/build/navigator/navigator-button/hook.js +59 -0
  170. package/build/navigator/navigator-button/hook.js.map +1 -0
  171. package/build/navigator/navigator-button/index.js +16 -0
  172. package/build/navigator/navigator-button/index.js.map +1 -0
  173. package/build/navigator/navigator-provider/component.js +12 -22
  174. package/build/navigator/navigator-provider/component.js.map +1 -1
  175. package/build/navigator/navigator-screen/component.js +14 -22
  176. package/build/navigator/navigator-screen/component.js.map +1 -1
  177. package/build/number-control/index.js +1 -1
  178. package/build/number-control/index.js.map +1 -1
  179. package/build/panel/body.js +2 -2
  180. package/build/panel/body.js.map +1 -1
  181. package/build/popover/index.js +3 -3
  182. package/build/popover/index.js.map +1 -1
  183. package/build/popover/utils.js +6 -6
  184. package/build/popover/utils.js.map +1 -1
  185. package/build/radio-group/index.js +1 -1
  186. package/build/radio-group/index.js.map +1 -1
  187. package/build/range-control/styles/range-control-styles.js +29 -29
  188. package/build/range-control/styles/range-control-styles.js.map +1 -1
  189. package/build/resizable-box/index.js.map +1 -1
  190. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  191. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  192. package/build/sandbox/index.js +5 -5
  193. package/build/sandbox/index.js.map +1 -1
  194. package/build/sandbox/index.native.js +1 -1
  195. package/build/sandbox/index.native.js.map +1 -1
  196. package/build/scrollable/component.js +1 -1
  197. package/build/scrollable/component.js.map +1 -1
  198. package/build/select-control/index.js +1 -1
  199. package/build/select-control/index.js.map +1 -1
  200. package/build/select-control/styles/select-control-styles.js +5 -5
  201. package/build/select-control/styles/select-control-styles.js.map +1 -1
  202. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  203. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  204. package/build/slot-fill/bubbles-virtually/slot.js +1 -1
  205. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  206. package/build/slot-fill/fill.js +1 -1
  207. package/build/slot-fill/fill.js.map +1 -1
  208. package/build/slot-fill/provider.js +1 -1
  209. package/build/slot-fill/provider.js.map +1 -1
  210. package/build/snackbar/index.js +1 -1
  211. package/build/snackbar/index.js.map +1 -1
  212. package/build/snackbar/list.js +1 -1
  213. package/build/snackbar/list.js.map +1 -1
  214. package/build/spacer/component.js.map +1 -1
  215. package/build/style-provider/index.js +2 -2
  216. package/build/style-provider/index.js.map +1 -1
  217. package/build/surface/component.js +1 -1
  218. package/build/surface/component.js.map +1 -1
  219. package/build/text/component.js +1 -1
  220. package/build/text/component.js.map +1 -1
  221. package/build/text-control/index.js +2 -2
  222. package/build/text-control/index.js.map +1 -1
  223. package/build/toggle-group-control/toggle-group-control/component.js +2 -2
  224. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  225. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  226. package/build/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  227. package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  228. package/build/toolbar/index.js +1 -1
  229. package/build/toolbar/index.js.map +1 -1
  230. package/build/tools-panel/tools-panel/component.js.map +1 -1
  231. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  232. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  233. package/build/tooltip/index.js +3 -3
  234. package/build/tooltip/index.js.map +1 -1
  235. package/build/tooltip/index.native.js +7 -7
  236. package/build/tooltip/index.native.js.map +1 -1
  237. package/build/tree-grid/index.js +50 -6
  238. package/build/tree-grid/index.js.map +1 -1
  239. package/build/truncate/component.js +1 -1
  240. package/build/truncate/component.js.map +1 -1
  241. package/build/truncate/utils.js +1 -1
  242. package/build/truncate/utils.js.map +1 -1
  243. package/build/ui/context/context-connect.js +8 -15
  244. package/build/ui/context/context-connect.js.map +1 -1
  245. package/build/ui/context/context-system-provider.js +2 -2
  246. package/build/ui/context/context-system-provider.js.map +1 -1
  247. package/build/ui/context/index.js.map +1 -1
  248. package/build/ui/control-group/component.js +1 -1
  249. package/build/ui/control-group/component.js.map +1 -1
  250. package/build/ui/control-label/component.js +1 -1
  251. package/build/ui/control-label/component.js.map +1 -1
  252. package/build/ui/form-group/form-group.js +1 -1
  253. package/build/ui/form-group/form-group.js.map +1 -1
  254. package/build/ui/shortcut/component.js.map +1 -1
  255. package/build/ui/spinner/component.js +1 -1
  256. package/build/ui/spinner/component.js.map +1 -1
  257. package/build/ui/tooltip/component.js +1 -1
  258. package/build/ui/tooltip/component.js.map +1 -1
  259. package/build/ui/tooltip/content.js +1 -1
  260. package/build/ui/tooltip/content.js.map +1 -1
  261. package/build/ui/utils/colors.js +2 -2
  262. package/build/ui/utils/colors.js.map +1 -1
  263. package/build/ui/utils/space.js +2 -2
  264. package/build/ui/utils/space.js.map +1 -1
  265. package/build/unit-control/index.js +38 -29
  266. package/build/unit-control/index.js.map +1 -1
  267. package/build/unit-control/index.native.js +4 -2
  268. package/build/unit-control/index.native.js.map +1 -1
  269. package/build/unit-control/unit-select-control.js +1 -1
  270. package/build/unit-control/unit-select-control.js.map +1 -1
  271. package/build/unit-control/utils.js +96 -104
  272. package/build/unit-control/utils.js.map +1 -1
  273. package/build/utils/breakpoint-values.js +1 -1
  274. package/build/utils/breakpoint-values.js.map +1 -1
  275. package/build/utils/colors-values.js +1 -1
  276. package/build/utils/colors-values.js.map +1 -1
  277. package/build/v-stack/component.js +1 -1
  278. package/build/v-stack/component.js.map +1 -1
  279. package/build/visually-hidden/component.js +1 -1
  280. package/build/visually-hidden/component.js.map +1 -1
  281. package/build/z-stack/component.js.map +1 -1
  282. package/build-module/alignment-matrix-control/utils.js +1 -1
  283. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  284. package/build-module/angle-picker-control/angle-circle.js +1 -1
  285. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  286. package/build-module/animation/index.js +1 -1
  287. package/build-module/animation/index.js.map +1 -1
  288. package/build-module/autocomplete/get-default-use-items.js +3 -3
  289. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  290. package/build-module/base-field/hook.js +1 -1
  291. package/build-module/base-field/hook.js.map +1 -1
  292. package/build-module/box-control/icon.js +1 -1
  293. package/build-module/box-control/icon.js.map +1 -1
  294. package/build-module/box-control/index.js +5 -5
  295. package/build-module/box-control/index.js.map +1 -1
  296. package/build-module/box-control/unit-control.js +1 -1
  297. package/build-module/box-control/unit-control.js.map +1 -1
  298. package/build-module/box-control/utils.js +13 -9
  299. package/build-module/box-control/utils.js.map +1 -1
  300. package/build-module/button/index.js +5 -5
  301. package/build-module/button/index.js.map +1 -1
  302. package/build-module/button/index.native.js +7 -7
  303. package/build-module/button/index.native.js.map +1 -1
  304. package/build-module/card/card/component.js +2 -2
  305. package/build-module/card/card/component.js.map +1 -1
  306. package/build-module/card/card-body/component.js +1 -1
  307. package/build-module/card/card-body/component.js.map +1 -1
  308. package/build-module/card/card-divider/component.js +1 -1
  309. package/build-module/card/card-divider/component.js.map +1 -1
  310. package/build-module/card/card-footer/component.js +1 -1
  311. package/build-module/card/card-footer/component.js.map +1 -1
  312. package/build-module/card/card-header/component.js +1 -1
  313. package/build-module/card/card-header/component.js.map +1 -1
  314. package/build-module/card/card-media/component.js +1 -1
  315. package/build-module/card/card-media/component.js.map +1 -1
  316. package/build-module/color-palette/index.native.js +36 -31
  317. package/build-module/color-palette/index.native.js.map +1 -1
  318. package/build-module/color-picker/color-display.js +1 -1
  319. package/build-module/color-picker/color-display.js.map +1 -1
  320. package/build-module/color-picker/component.js.map +1 -1
  321. package/build-module/color-picker/hex-input.js +6 -9
  322. package/build-module/color-picker/hex-input.js.map +1 -1
  323. package/build-module/color-picker/styles.js +8 -8
  324. package/build-module/color-picker/styles.js.map +1 -1
  325. package/build-module/combobox-control/index.js +1 -1
  326. package/build-module/combobox-control/index.js.map +1 -1
  327. package/build-module/confirm-dialog/component.js +4 -5
  328. package/build-module/confirm-dialog/component.js.map +1 -1
  329. package/build-module/date-time/time.js +7 -4
  330. package/build-module/date-time/time.js.map +1 -1
  331. package/build-module/divider/component.js +3 -3
  332. package/build-module/divider/component.js.map +1 -1
  333. package/build-module/draggable/index.js +3 -3
  334. package/build-module/draggable/index.js.map +1 -1
  335. package/build-module/elevation/component.js +1 -1
  336. package/build-module/elevation/component.js.map +1 -1
  337. package/build-module/flex/flex/component.js +1 -1
  338. package/build-module/flex/flex/component.js.map +1 -1
  339. package/build-module/flex/flex-block/component.js +1 -1
  340. package/build-module/flex/flex-block/component.js.map +1 -1
  341. package/build-module/flex/flex-item/component.js +1 -1
  342. package/build-module/flex/flex-item/component.js.map +1 -1
  343. package/build-module/flyout/flyout/component.js +1 -1
  344. package/build-module/flyout/flyout/component.js.map +1 -1
  345. package/build-module/flyout/flyout-content/component.js +1 -1
  346. package/build-module/flyout/flyout-content/component.js.map +1 -1
  347. package/build-module/focal-point-picker/index.js +18 -12
  348. package/build-module/focal-point-picker/index.js.map +1 -1
  349. package/build-module/focal-point-picker/index.native.js +7 -7
  350. package/build-module/focal-point-picker/index.native.js.map +1 -1
  351. package/build-module/focal-point-picker/tooltip/index.native.js +1 -1
  352. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  353. package/build-module/font-size-picker/index.js +1 -2
  354. package/build-module/font-size-picker/index.js.map +1 -1
  355. package/build-module/form-token-field/index.js +6 -6
  356. package/build-module/form-token-field/index.js.map +1 -1
  357. package/build-module/form-token-field/suggestions-list.js +2 -2
  358. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  359. package/build-module/grid/component.js +1 -1
  360. package/build-module/grid/component.js.map +1 -1
  361. package/build-module/h-stack/component.js +1 -1
  362. package/build-module/h-stack/component.js.map +1 -1
  363. package/build-module/heading/component.js +4 -4
  364. package/build-module/heading/component.js.map +1 -1
  365. package/build-module/heading/hook.js +1 -1
  366. package/build-module/heading/hook.js.map +1 -1
  367. package/build-module/higher-order/with-notices/index.js +1 -1
  368. package/build-module/higher-order/with-notices/index.js.map +1 -1
  369. package/build-module/index.js +5 -5
  370. package/build-module/index.js.map +1 -1
  371. package/build-module/index.native.js +5 -5
  372. package/build-module/index.native.js.map +1 -1
  373. package/build-module/input-control/index.js.map +1 -1
  374. package/build-module/input-control/input-base.js +1 -1
  375. package/build-module/input-control/input-base.js.map +1 -1
  376. package/build-module/input-control/input-field.js +19 -16
  377. package/build-module/input-control/input-field.js.map +1 -1
  378. package/build-module/input-control/reducer/reducer.js +3 -0
  379. package/build-module/input-control/reducer/reducer.js.map +1 -1
  380. package/build-module/input-control/styles/input-control-styles.js +25 -25
  381. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  382. package/build-module/isolated-event-container/index.js +1 -1
  383. package/build-module/isolated-event-container/index.js.map +1 -1
  384. package/build-module/item-group/item/component.js.map +1 -1
  385. package/build-module/item-group/item-group/component.js.map +1 -1
  386. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  387. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  388. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  389. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  390. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  391. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  392. package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
  393. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  394. package/build-module/mobile/bottom-sheet/index.native.js +11 -11
  395. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  396. package/build-module/mobile/bottom-sheet/link-cell.native.js +1 -1
  397. package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  398. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  399. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  400. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  401. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  402. package/build-module/mobile/color-settings/palette.screen.native.js +27 -10
  403. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  404. package/build-module/mobile/global-styles-context/utils.native.js +70 -20
  405. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  406. package/build-module/mobile/gradient/index.native.js +2 -2
  407. package/build-module/mobile/gradient/index.native.js.map +1 -1
  408. package/build-module/mobile/html-text-input/container.ios.js +3 -3
  409. package/build-module/mobile/html-text-input/container.ios.js.map +1 -1
  410. package/build-module/mobile/html-text-input/index.native.js +1 -1
  411. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  412. package/build-module/mobile/image/index.native.js +1 -1
  413. package/build-module/mobile/image/index.native.js.map +1 -1
  414. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  415. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  416. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  417. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  418. package/build-module/mobile/link-picker/index.native.js +3 -3
  419. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  420. package/build-module/mobile/link-picker/link-picker-results.native.js +8 -8
  421. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  422. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  423. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  424. package/build-module/mobile/link-settings/index.native.js +1 -1
  425. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  426. package/build-module/modal/aria-helper.js +1 -1
  427. package/build-module/modal/aria-helper.js.map +1 -1
  428. package/build-module/modal/index.js +2 -2
  429. package/build-module/modal/index.js.map +1 -1
  430. package/build-module/navigable-container/container.js +2 -2
  431. package/build-module/navigable-container/container.js.map +1 -1
  432. package/build-module/navigable-container/tabbable.js +1 -1
  433. package/build-module/navigable-container/tabbable.js.map +1 -1
  434. package/build-module/navigation/item/index.js +1 -1
  435. package/build-module/navigation/item/index.js.map +1 -1
  436. package/build-module/navigation/menu/index.js +1 -1
  437. package/build-module/navigation/menu/index.js.map +1 -1
  438. package/build-module/navigator/index.js +2 -0
  439. package/build-module/navigator/index.js.map +1 -1
  440. package/build-module/navigator/navigator-back-button/component.js +59 -0
  441. package/build-module/navigator/navigator-back-button/component.js.map +1 -0
  442. package/build-module/navigator/navigator-back-button/hook.js +36 -0
  443. package/build-module/navigator/navigator-back-button/hook.js.map +1 -0
  444. package/build-module/navigator/navigator-back-button/index.js +2 -0
  445. package/build-module/navigator/navigator-back-button/index.js.map +1 -0
  446. package/build-module/navigator/navigator-button/component.js +58 -0
  447. package/build-module/navigator/navigator-button/component.js.map +1 -0
  448. package/build-module/navigator/navigator-button/hook.js +46 -0
  449. package/build-module/navigator/navigator-button/hook.js.map +1 -0
  450. package/build-module/navigator/navigator-button/index.js +2 -0
  451. package/build-module/navigator/navigator-button/index.js.map +1 -0
  452. package/build-module/navigator/navigator-provider/component.js +12 -22
  453. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  454. package/build-module/navigator/navigator-screen/component.js +13 -22
  455. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  456. package/build-module/number-control/index.js +1 -1
  457. package/build-module/number-control/index.js.map +1 -1
  458. package/build-module/panel/body.js +2 -2
  459. package/build-module/panel/body.js.map +1 -1
  460. package/build-module/popover/index.js +3 -3
  461. package/build-module/popover/index.js.map +1 -1
  462. package/build-module/popover/utils.js +6 -6
  463. package/build-module/popover/utils.js.map +1 -1
  464. package/build-module/radio-group/index.js +1 -1
  465. package/build-module/radio-group/index.js.map +1 -1
  466. package/build-module/range-control/styles/range-control-styles.js +29 -29
  467. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  468. package/build-module/resizable-box/index.js.map +1 -1
  469. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  470. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  471. package/build-module/sandbox/index.js +5 -5
  472. package/build-module/sandbox/index.js.map +1 -1
  473. package/build-module/sandbox/index.native.js +1 -1
  474. package/build-module/sandbox/index.native.js.map +1 -1
  475. package/build-module/scrollable/component.js +1 -1
  476. package/build-module/scrollable/component.js.map +1 -1
  477. package/build-module/select-control/index.js +2 -2
  478. package/build-module/select-control/index.js.map +1 -1
  479. package/build-module/select-control/styles/select-control-styles.js +5 -5
  480. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  481. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  482. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  483. package/build-module/slot-fill/bubbles-virtually/slot.js +1 -1
  484. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  485. package/build-module/slot-fill/fill.js +1 -1
  486. package/build-module/slot-fill/fill.js.map +1 -1
  487. package/build-module/slot-fill/provider.js +1 -1
  488. package/build-module/slot-fill/provider.js.map +1 -1
  489. package/build-module/snackbar/index.js +1 -1
  490. package/build-module/snackbar/index.js.map +1 -1
  491. package/build-module/snackbar/list.js +1 -1
  492. package/build-module/snackbar/list.js.map +1 -1
  493. package/build-module/spacer/component.js.map +1 -1
  494. package/build-module/style-provider/index.js +2 -2
  495. package/build-module/style-provider/index.js.map +1 -1
  496. package/build-module/surface/component.js +1 -1
  497. package/build-module/surface/component.js.map +1 -1
  498. package/build-module/text/component.js +1 -1
  499. package/build-module/text/component.js.map +1 -1
  500. package/build-module/text-control/index.js +2 -2
  501. package/build-module/text-control/index.js.map +1 -1
  502. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -2
  503. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  504. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  505. package/build-module/toggle-group-control/toggle-group-control-option/styles.js +8 -8
  506. package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  507. package/build-module/toolbar/index.js +1 -1
  508. package/build-module/toolbar/index.js.map +1 -1
  509. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  510. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  511. package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
  512. package/build-module/tooltip/index.js +3 -3
  513. package/build-module/tooltip/index.js.map +1 -1
  514. package/build-module/tooltip/index.native.js +7 -7
  515. package/build-module/tooltip/index.native.js.map +1 -1
  516. package/build-module/tree-grid/index.js +51 -7
  517. package/build-module/tree-grid/index.js.map +1 -1
  518. package/build-module/truncate/component.js +1 -1
  519. package/build-module/truncate/component.js.map +1 -1
  520. package/build-module/truncate/utils.js +1 -1
  521. package/build-module/truncate/utils.js.map +1 -1
  522. package/build-module/ui/context/context-connect.js +9 -16
  523. package/build-module/ui/context/context-connect.js.map +1 -1
  524. package/build-module/ui/context/context-system-provider.js +2 -2
  525. package/build-module/ui/context/context-system-provider.js.map +1 -1
  526. package/build-module/ui/context/index.js.map +1 -1
  527. package/build-module/ui/control-group/component.js +1 -1
  528. package/build-module/ui/control-group/component.js.map +1 -1
  529. package/build-module/ui/control-label/component.js +1 -1
  530. package/build-module/ui/control-label/component.js.map +1 -1
  531. package/build-module/ui/form-group/form-group.js +1 -1
  532. package/build-module/ui/form-group/form-group.js.map +1 -1
  533. package/build-module/ui/shortcut/component.js.map +1 -1
  534. package/build-module/ui/spinner/component.js +1 -1
  535. package/build-module/ui/spinner/component.js.map +1 -1
  536. package/build-module/ui/tooltip/component.js +1 -1
  537. package/build-module/ui/tooltip/component.js.map +1 -1
  538. package/build-module/ui/tooltip/content.js +1 -1
  539. package/build-module/ui/tooltip/content.js.map +1 -1
  540. package/build-module/ui/utils/colors.js +2 -2
  541. package/build-module/ui/utils/colors.js.map +1 -1
  542. package/build-module/ui/utils/space.js +2 -2
  543. package/build-module/ui/utils/space.js.map +1 -1
  544. package/build-module/unit-control/index.js +39 -30
  545. package/build-module/unit-control/index.js.map +1 -1
  546. package/build-module/unit-control/index.native.js +5 -3
  547. package/build-module/unit-control/index.native.js.map +1 -1
  548. package/build-module/unit-control/unit-select-control.js +1 -1
  549. package/build-module/unit-control/unit-select-control.js.map +1 -1
  550. package/build-module/unit-control/utils.js +92 -100
  551. package/build-module/unit-control/utils.js.map +1 -1
  552. package/build-module/utils/breakpoint-values.js +1 -1
  553. package/build-module/utils/breakpoint-values.js.map +1 -1
  554. package/build-module/utils/colors-values.js +1 -1
  555. package/build-module/utils/colors-values.js.map +1 -1
  556. package/build-module/v-stack/component.js +1 -1
  557. package/build-module/v-stack/component.js.map +1 -1
  558. package/build-module/visually-hidden/component.js +1 -1
  559. package/build-module/visually-hidden/component.js.map +1 -1
  560. package/build-module/z-stack/component.js.map +1 -1
  561. package/build-style/style-rtl.css +8 -0
  562. package/build-style/style.css +8 -0
  563. package/build-types/base-field/hook.d.ts +2 -1
  564. package/build-types/base-field/hook.d.ts.map +1 -1
  565. package/build-types/card/card/hook.d.ts +2 -1
  566. package/build-types/card/card/hook.d.ts.map +1 -1
  567. package/build-types/card/card-body/hook.d.ts +2 -1
  568. package/build-types/card/card-body/hook.d.ts.map +1 -1
  569. package/build-types/card/card-divider/hook.d.ts +2 -3
  570. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  571. package/build-types/card/card-footer/hook.d.ts +2 -1
  572. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  573. package/build-types/card/card-header/hook.d.ts +2 -1
  574. package/build-types/card/card-header/hook.d.ts.map +1 -1
  575. package/build-types/card/card-media/hook.d.ts +2 -1
  576. package/build-types/card/card-media/hook.d.ts.map +1 -1
  577. package/build-types/color-picker/styles.d.ts +2 -4
  578. package/build-types/color-picker/styles.d.ts.map +1 -1
  579. package/build-types/confirm-dialog/component.d.ts +10 -6
  580. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  581. package/build-types/confirm-dialog/types.d.ts +2 -0
  582. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  583. package/build-types/divider/component.d.ts +2 -2
  584. package/build-types/divider/component.d.ts.map +1 -1
  585. package/build-types/divider/stories/index.d.ts +10 -0
  586. package/build-types/divider/stories/index.d.ts.map +1 -0
  587. package/build-types/divider/types.d.ts +1 -1
  588. package/build-types/divider/types.d.ts.map +1 -1
  589. package/build-types/elevation/hook.d.ts +2 -1
  590. package/build-types/elevation/hook.d.ts.map +1 -1
  591. package/build-types/flex/flex/hook.d.ts +2 -1
  592. package/build-types/flex/flex/hook.d.ts.map +1 -1
  593. package/build-types/flex/flex-block/hook.d.ts +2 -1
  594. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  595. package/build-types/flex/flex-item/hook.d.ts +2 -1
  596. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  597. package/build-types/flyout/flyout/hook.d.ts +2 -2
  598. package/build-types/grid/hook.d.ts +2 -1
  599. package/build-types/grid/hook.d.ts.map +1 -1
  600. package/build-types/h-stack/hook.d.ts +3 -2
  601. package/build-types/h-stack/hook.d.ts.map +1 -1
  602. package/build-types/heading/component.d.ts +3 -3
  603. package/build-types/heading/component.d.ts.map +1 -1
  604. package/build-types/heading/hook.d.ts +2 -1
  605. package/build-types/heading/hook.d.ts.map +1 -1
  606. package/build-types/heading/stories/index.d.ts +12 -0
  607. package/build-types/heading/stories/index.d.ts.map +1 -0
  608. package/build-types/input-control/index.d.ts +3 -3
  609. package/build-types/input-control/index.d.ts.map +1 -1
  610. package/build-types/input-control/input-base.d.ts +2 -2
  611. package/build-types/input-control/input-base.d.ts.map +1 -1
  612. package/build-types/input-control/input-field.d.ts +1 -3
  613. package/build-types/input-control/input-field.d.ts.map +1 -1
  614. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  615. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  616. package/build-types/input-control/types.d.ts +1 -1
  617. package/build-types/input-control/types.d.ts.map +1 -1
  618. package/build-types/item-group/item/hook.d.ts +2 -1
  619. package/build-types/item-group/item/hook.d.ts.map +1 -1
  620. package/build-types/item-group/item-group/hook.d.ts +2 -1
  621. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  622. package/build-types/navigator/index.d.ts +2 -0
  623. package/build-types/navigator/index.d.ts.map +1 -1
  624. package/build-types/navigator/navigator-back-button/component.d.ts +38 -0
  625. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -0
  626. package/build-types/navigator/navigator-back-button/hook.d.ts +283 -0
  627. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -0
  628. package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
  629. package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
  630. package/build-types/navigator/navigator-button/component.d.ts +37 -0
  631. package/build-types/navigator/navigator-button/component.d.ts.map +1 -0
  632. package/build-types/navigator/navigator-button/hook.d.ts +283 -0
  633. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -0
  634. package/build-types/navigator/navigator-button/index.d.ts +2 -0
  635. package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
  636. package/build-types/navigator/navigator-provider/component.d.ts +10 -20
  637. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  638. package/build-types/navigator/navigator-screen/component.d.ts +10 -20
  639. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  640. package/build-types/navigator/types.d.ts +21 -0
  641. package/build-types/navigator/types.d.ts.map +1 -1
  642. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  643. package/build-types/resizable-box/index.d.ts +2 -2
  644. package/build-types/resizable-box/index.d.ts.map +1 -1
  645. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  646. package/build-types/scrollable/hook.d.ts +2 -1
  647. package/build-types/scrollable/hook.d.ts.map +1 -1
  648. package/build-types/select-control/index.d.ts +1 -3
  649. package/build-types/select-control/index.d.ts.map +1 -1
  650. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  651. package/build-types/spacer/hook.d.ts +2 -1
  652. package/build-types/spacer/hook.d.ts.map +1 -1
  653. package/build-types/surface/hook.d.ts +2 -1
  654. package/build-types/surface/hook.d.ts.map +1 -1
  655. package/build-types/text/hook.d.ts +2 -1
  656. package/build-types/text/hook.d.ts.map +1 -1
  657. package/build-types/text/types.d.ts +1 -2
  658. package/build-types/text/types.d.ts.map +1 -1
  659. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
  660. package/build-types/tools-panel/tools-panel/hook.d.ts +2 -1
  661. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  662. package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -1
  663. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  664. package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -1
  665. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  666. package/build-types/truncate/hook.d.ts +2 -1
  667. package/build-types/truncate/hook.d.ts.map +1 -1
  668. package/build-types/ui/context/context-connect.d.ts +18 -16
  669. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  670. package/build-types/ui/context/index.d.ts +4 -4
  671. package/build-types/ui/context/index.d.ts.map +1 -1
  672. package/build-types/ui/context/wordpress-component.d.ts +3 -6
  673. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  674. package/build-types/ui/control-group/hook.d.ts +2 -1
  675. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  676. package/build-types/ui/control-label/hook.d.ts +2 -1
  677. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  678. package/build-types/ui/form-group/use-form-group.d.ts +6 -4
  679. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  680. package/build-types/unit-control/index.d.ts +3 -5
  681. package/build-types/unit-control/index.d.ts.map +1 -1
  682. package/build-types/unit-control/types.d.ts +4 -6
  683. package/build-types/unit-control/types.d.ts.map +1 -1
  684. package/build-types/unit-control/utils.d.ts +47 -38
  685. package/build-types/unit-control/utils.d.ts.map +1 -1
  686. package/build-types/v-stack/hook.d.ts +2 -1
  687. package/build-types/v-stack/hook.d.ts.map +1 -1
  688. package/build-types/z-stack/component.d.ts.map +1 -1
  689. package/package.json +19 -18
  690. package/src/alignment-matrix-control/README.md +4 -0
  691. package/src/alignment-matrix-control/stories/index.js +1 -1
  692. package/src/alignment-matrix-control/utils.js +1 -1
  693. package/src/angle-picker-control/angle-circle.js +1 -1
  694. package/src/animation/index.js +0 -1
  695. package/src/autocomplete/get-default-use-items.js +3 -3
  696. package/src/base-control/stories/index.js +65 -22
  697. package/src/base-field/hook.js +1 -1
  698. package/src/box-control/icon.js +1 -1
  699. package/src/box-control/index.js +5 -5
  700. package/src/box-control/stories/index.js +4 -1
  701. package/src/box-control/test/index.js +27 -7
  702. package/src/box-control/unit-control.js +1 -1
  703. package/src/box-control/utils.js +13 -9
  704. package/src/button/index.js +5 -5
  705. package/src/button/index.native.js +7 -7
  706. package/src/button/style.scss +1 -0
  707. package/src/card/card/component.js +1 -1
  708. package/src/card/card-body/component.js +1 -1
  709. package/src/card/card-divider/component.js +1 -1
  710. package/src/card/card-footer/component.js +1 -1
  711. package/src/card/card-header/component.js +1 -1
  712. package/src/card/card-media/component.js +1 -1
  713. package/src/color-palette/index.native.js +92 -75
  714. package/src/color-palette/style.native.scss +10 -5
  715. package/src/color-palette/style.scss +1 -0
  716. package/src/color-picker/color-display.tsx +1 -1
  717. package/src/color-picker/component.tsx +2 -2
  718. package/src/color-picker/hex-input.tsx +9 -9
  719. package/src/color-picker/styles.ts +1 -1
  720. package/src/color-picker/test/index.js +1 -1
  721. package/src/combobox-control/index.js +1 -1
  722. package/src/combobox-control/style.scss +1 -0
  723. package/src/confirm-dialog/README.md +56 -45
  724. package/src/confirm-dialog/component.tsx +6 -4
  725. package/src/confirm-dialog/stories/index.js +19 -0
  726. package/src/confirm-dialog/test/index.js +28 -0
  727. package/src/confirm-dialog/types.ts +2 -0
  728. package/src/date-time/style.scss +4 -0
  729. package/src/date-time/time.js +16 -5
  730. package/src/dimension-control/test/index.test.js +1 -1
  731. package/src/disabled/test/index.js +1 -1
  732. package/src/divider/component.tsx +5 -5
  733. package/src/divider/stories/index.tsx +70 -0
  734. package/src/divider/types.ts +3 -1
  735. package/src/draggable/index.js +3 -3
  736. package/src/draggable/stories/index.js +1 -1
  737. package/src/elevation/component.js +1 -1
  738. package/src/flex/flex/component.js +1 -1
  739. package/src/flex/flex-block/component.js +1 -1
  740. package/src/flex/flex-item/component.js +1 -1
  741. package/src/flyout/flyout/README.md +1 -1
  742. package/src/flyout/flyout/component.js +1 -1
  743. package/src/flyout/flyout-content/component.js +1 -1
  744. package/src/flyout/test/index.js +1 -1
  745. package/src/focal-point-picker/README.md +7 -0
  746. package/src/focal-point-picker/index.js +12 -7
  747. package/src/focal-point-picker/index.native.js +7 -7
  748. package/src/focal-point-picker/stories/index.js +30 -0
  749. package/src/focal-point-picker/test/index.js +44 -0
  750. package/src/focal-point-picker/tooltip/index.native.js +1 -1
  751. package/src/font-size-picker/README.md +1 -2
  752. package/src/font-size-picker/index.js +1 -2
  753. package/src/font-size-picker/stories/index.js +87 -108
  754. package/src/form-file-upload/README.md +1 -1
  755. package/src/form-file-upload/stories/index.js +51 -0
  756. package/src/form-token-field/index.js +6 -6
  757. package/src/form-token-field/style.scss +1 -0
  758. package/src/form-token-field/suggestions-list.js +2 -2
  759. package/src/form-token-field/test/index.js +6 -6
  760. package/src/grid/component.js +1 -1
  761. package/src/h-stack/component.js +1 -1
  762. package/src/heading/component.tsx +6 -6
  763. package/src/heading/hook.ts +1 -1
  764. package/src/heading/stories/index.tsx +37 -0
  765. package/src/higher-order/with-filters/test/index.js +1 -1
  766. package/src/higher-order/with-focus-outside/test/index.js +1 -1
  767. package/src/higher-order/with-notices/index.js +1 -1
  768. package/src/higher-order/with-notices/test/index.js +3 -3
  769. package/src/index.js +6 -4
  770. package/src/index.native.js +9 -5
  771. package/src/input-control/index.tsx +2 -2
  772. package/src/input-control/input-base.tsx +3 -3
  773. package/src/input-control/input-field.tsx +16 -15
  774. package/src/input-control/reducer/reducer.ts +3 -0
  775. package/src/input-control/stories/index.js +1 -1
  776. package/src/input-control/styles/input-control-styles.tsx +1 -0
  777. package/src/input-control/test/index.js +4 -4
  778. package/src/input-control/types.ts +1 -1
  779. package/src/isolated-event-container/index.js +1 -1
  780. package/src/item-group/item/component.tsx +2 -2
  781. package/src/item-group/item-group/component.tsx +2 -2
  782. package/src/item-group/test/index.js +0 -1
  783. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  784. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  785. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -1
  786. package/src/mobile/bottom-sheet/cell.native.js +1 -1
  787. package/src/mobile/bottom-sheet/index.native.js +11 -11
  788. package/src/mobile/bottom-sheet/link-cell.native.js +1 -1
  789. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  790. package/src/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  791. package/src/mobile/color-settings/palette.screen.native.js +39 -9
  792. package/src/mobile/color-settings/style.native.scss +4 -0
  793. package/src/mobile/global-styles-context/test/fixtures/theme.native.js +27 -0
  794. package/src/mobile/global-styles-context/test/utils.native.js +2 -2
  795. package/src/mobile/global-styles-context/utils.native.js +85 -16
  796. package/src/mobile/gradient/index.native.js +2 -2
  797. package/src/mobile/html-text-input/container.ios.js +3 -3
  798. package/src/mobile/html-text-input/index.native.js +1 -1
  799. package/src/mobile/html-text-input/test/index.native.js +14 -14
  800. package/src/mobile/image/index.native.js +1 -1
  801. package/src/mobile/image/style.native.scss +1 -0
  802. package/src/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  803. package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  804. package/src/mobile/link-picker/index.native.js +3 -3
  805. package/src/mobile/link-picker/link-picker-results.native.js +8 -8
  806. package/src/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  807. package/src/mobile/link-settings/index.native.js +1 -2
  808. package/src/mobile/link-settings/test/edit.native.js +15 -15
  809. package/src/modal/aria-helper.js +1 -1
  810. package/src/modal/index.js +2 -2
  811. package/src/navigable-container/container.js +2 -2
  812. package/src/navigable-container/tabbable.js +1 -1
  813. package/src/navigable-container/test/menu.js +5 -5
  814. package/src/navigable-container/test/tabbable.js +2 -2
  815. package/src/navigation/item/index.js +1 -1
  816. package/src/navigation/menu/index.js +1 -1
  817. package/src/navigation/stories/controlled-state.js +2 -2
  818. package/src/navigation/stories/index.js +1 -1
  819. package/src/navigator/index.ts +2 -0
  820. package/src/navigator/navigator-back-button/README.md +31 -0
  821. package/src/navigator/navigator-back-button/component.tsx +62 -0
  822. package/src/navigator/navigator-back-button/hook.ts +40 -0
  823. package/src/navigator/navigator-back-button/index.ts +1 -0
  824. package/src/navigator/navigator-button/README.md +38 -0
  825. package/src/navigator/navigator-button/component.tsx +61 -0
  826. package/src/navigator/navigator-button/hook.ts +55 -0
  827. package/src/navigator/navigator-button/index.ts +1 -0
  828. package/src/navigator/navigator-provider/README.md +20 -33
  829. package/src/navigator/navigator-provider/component.tsx +13 -23
  830. package/src/navigator/navigator-screen/README.md +1 -1
  831. package/src/navigator/navigator-screen/component.tsx +16 -25
  832. package/src/navigator/stories/index.js +24 -37
  833. package/src/navigator/test/index.js +105 -51
  834. package/src/navigator/types.ts +27 -1
  835. package/src/number-control/index.js +1 -1
  836. package/src/number-control/stories/index.js +1 -1
  837. package/src/panel/body.js +2 -2
  838. package/src/popover/index.js +3 -3
  839. package/src/popover/utils.js +6 -6
  840. package/src/radio/stories/index.js +1 -1
  841. package/src/radio-group/index.js +1 -1
  842. package/src/radio-group/stories/index.js +4 -1
  843. package/src/range-control/stories/index.js +1 -1
  844. package/src/range-control/styles/range-control-styles.js +1 -1
  845. package/src/range-control/test/index.js +2 -2
  846. package/src/resizable-box/index.tsx +2 -2
  847. package/src/resizable-box/resize-tooltip/index.tsx +2 -2
  848. package/src/resizable-box/resize-tooltip/label.tsx +2 -2
  849. package/src/sandbox/index.js +5 -5
  850. package/src/sandbox/index.native.js +1 -1
  851. package/src/scrollable/component.js +1 -1
  852. package/src/select-control/index.tsx +3 -4
  853. package/src/select-control/styles/select-control-styles.ts +1 -0
  854. package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  855. package/src/slot-fill/bubbles-virtually/slot.js +1 -2
  856. package/src/slot-fill/fill.js +1 -1
  857. package/src/slot-fill/provider.js +1 -1
  858. package/src/snackbar/index.js +1 -1
  859. package/src/snackbar/list.js +1 -1
  860. package/src/spacer/component.tsx +2 -2
  861. package/src/style-provider/index.js +2 -2
  862. package/src/surface/component.js +1 -1
  863. package/src/tab-panel/test/index.js +1 -1
  864. package/src/text/component.js +1 -1
  865. package/src/text/test/index.js +2 -2
  866. package/src/text/types.ts +6 -8
  867. package/src/text-control/index.js +2 -2
  868. package/src/text-highlight/test/index.js +4 -4
  869. package/src/toggle-control/test/index.js +3 -3
  870. package/src/toggle-group-control/stories/index.js +1 -1
  871. package/src/toggle-group-control/test/__snapshots__/index.js.snap +1 -0
  872. package/src/toggle-group-control/toggle-group-control/component.tsx +4 -4
  873. package/src/toggle-group-control/toggle-group-control-option/component.tsx +2 -2
  874. package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -0
  875. package/src/toolbar/index.js +1 -1
  876. package/src/toolbar-group/test/index.js +2 -2
  877. package/src/tools-panel/stories/index.js +0 -1
  878. package/src/tools-panel/tools-panel/component.tsx +2 -2
  879. package/src/tools-panel/tools-panel-header/component.tsx +2 -2
  880. package/src/tools-panel/tools-panel-item/component.tsx +2 -2
  881. package/src/tooltip/index.js +3 -3
  882. package/src/tooltip/index.native.js +7 -7
  883. package/src/tooltip/test/index.js +2 -2
  884. package/src/tooltip/test/index.native.js +2 -2
  885. package/src/tree-grid/README.md +24 -1
  886. package/src/tree-grid/index.js +66 -7
  887. package/src/tree-grid/stories/index.js +4 -1
  888. package/src/tree-grid/test/__snapshots__/index.js.snap +1 -14
  889. package/src/tree-grid/test/index.js +259 -8
  890. package/src/truncate/component.js +1 -1
  891. package/src/truncate/utils.js +1 -1
  892. package/src/ui/context/{context-connect.js → context-connect.ts} +27 -16
  893. package/src/ui/context/context-system-provider.js +2 -2
  894. package/src/ui/context/{index.js → index.ts} +0 -0
  895. package/src/ui/context/wordpress-component.ts +3 -2
  896. package/src/ui/control-group/component.js +1 -1
  897. package/src/ui/control-label/component.js +1 -1
  898. package/src/ui/form-group/form-group.js +1 -1
  899. package/src/ui/shortcut/component.tsx +2 -2
  900. package/src/ui/spinner/component.js +1 -1
  901. package/src/ui/tooltip/component.js +1 -1
  902. package/src/ui/tooltip/content.js +1 -1
  903. package/src/ui/tooltip/test/index.js +4 -4
  904. package/src/ui/utils/colors.js +2 -2
  905. package/src/ui/utils/space.ts +2 -2
  906. package/src/unit-control/README.md +1 -1
  907. package/src/unit-control/index.native.js +5 -3
  908. package/src/unit-control/index.tsx +66 -37
  909. package/src/unit-control/stories/index.js +1 -1
  910. package/src/unit-control/test/index.js +102 -3
  911. package/src/unit-control/test/utils.js +56 -15
  912. package/src/unit-control/types.ts +5 -8
  913. package/src/unit-control/unit-select-control.tsx +1 -1
  914. package/src/unit-control/utils.ts +128 -125
  915. package/src/utils/breakpoint-values.js +1 -1
  916. package/src/utils/colors-values.js +1 -1
  917. package/src/utils/hooks/test/use-controlled-state.js +1 -1
  918. package/src/utils/hooks/test/use-controlled-value.js +3 -3
  919. package/src/utils/hooks/test/use-latest-ref.js +1 -1
  920. package/src/utils/test/math.js +2 -2
  921. package/src/utils/test/rtl.js +12 -12
  922. package/src/v-stack/component.js +1 -1
  923. package/src/visually-hidden/component.js +1 -1
  924. package/src/z-stack/component.tsx +2 -2
  925. package/tsconfig.json +1 -1
  926. package/tsconfig.tsbuildinfo +1 -1
  927. package/src/divider/stories/index.js +0 -64
  928. package/src/heading/stories/index.js +0 -24
  929. package/src/tools-panel/stories/typography-panel.js +0 -215
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","NavigatorScreen","props","forwardedRef","children","className","path","otherProps","prefersReducedMotion","location","NavigatorContext","isMatch","wrapperRef","previousLocation","cx","classes","isInitialLocation","isInitial","isBack","current","elementToFocus","focusTargetSelector","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","ConnectedNavigatorScreen"],"mappings":";;;;;;;;;AAYA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AAKA;;AAKA;;AACA;;AACA;;;;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,eAAT,CAA0BC,KAA1B,EAAwCC,YAAxC,EAAmE;AAClE,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+C,+BACpDL,KADoD,EAEpD,iBAFoD,CAArD;AAKA,QAAMM,oBAAoB,GAAG,gCAA7B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAe,yBAAYC,0BAAZ,CA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMkC,wBAAwB,GAAG,6BAChCrC,eADgC,EAEhC,iBAFgC,CAAjC;eAKeqC,wB","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { useContext, useEffect, useMemo, useRef } from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseMergeRefs,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tkeyof MotionProps\n>;\n\nfunction NavigatorScreen( props: Props, forwardedRef: Ref< any > ) {\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location } = useContext( NavigatorContext );\n\tconst isMatch = location.path === path;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tconst previousLocation = usePrevious( location );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\tif ( isInitialLocation || ! isMatch || ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && previousLocation?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tpreviousLocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = ( focus.tabbable.find(\n\t\t\t\twrapperRef.current\n\t\t\t) as HTMLElement[] )[ 0 ];\n\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\telementToFocus.focus();\n\t}, [ isInitialLocation, isMatch ] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\tconst initial = {\n\t\topacity: 0,\n\t\tx:\n\t\t\t( isRTL() && location.isBack ) || ( ! isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t};\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel/menu and is supposed to be used in combination with the `NavigatorProvider` component.\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalUseNavigator as useNavigator,\n * } from '@wordpress/components';\n *\n * function NavigatorButton( { path, ...props } ) {\n * const { goTo } = useNavigator();\n * return (\n * <Button\n * variant=\"primary\"\n * onClick={ () => goTo( path ) }\n * { ...props }\n * />\n * );\n * }\n *\n * function NavigatorBackButton( props ) {\n * const { goBack } = useNavigator();\n * return <Button variant=\"secondary\" onClick={ () => goBack() } { ...props } />;\n * }\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * \t <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>Go back</NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorScreen = contextConnect(\n\tNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default ConnectedNavigatorScreen;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","NavigatorScreen","props","forwardedRef","children","className","path","otherProps","prefersReducedMotion","location","NavigatorContext","isMatch","wrapperRef","previousLocation","cx","classes","isInitialLocation","isInitial","isBack","current","elementToFocus","focusTargetSelector","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","ConnectedNavigatorScreen"],"mappings":";;;;;;;;;AAYA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;;;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,eAAT,CAA0BC,KAA1B,EAAwCC,YAAxC,EAA4E;AAC3E,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+C,+BACpDL,KADoD,EAEpD,iBAFoD,CAArD;AAKA,QAAMM,oBAAoB,GAAG,gCAA7B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAe,yBAAYC,0BAAZ,CAArB;AACA,QAAMC,OAAO,GAAGF,QAAQ,CAACH,IAAT,KAAkB,iCA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMkC,wBAAwB,GAAG,6BAChCrC,eADgC,EAEhC,iBAFgC,CAAjC;eAKeqC,wB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { useContext, useEffect, useMemo, useRef } from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseMergeRefs,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tkeyof MotionProps\n>;\n\nfunction NavigatorScreen( props: Props, forwardedRef: ForwardedRef< any > ) {\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location } = useContext( NavigatorContext );\n\tconst isMatch = location.path === escapeAttribute( path );\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tconst previousLocation = usePrevious( location );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\tif ( isInitialLocation || ! isMatch || ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && previousLocation?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tpreviousLocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = ( focus.tabbable.find(\n\t\t\t\twrapperRef.current\n\t\t\t) as HTMLElement[] )[ 0 ];\n\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\telementToFocus.focus();\n\t}, [ isInitialLocation, isMatch ] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\tconst initial = {\n\t\topacity: 0,\n\t\tx:\n\t\t\t( isRTL() && location.isBack ) || ( ! isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t};\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorScreen = contextConnect(\n\tNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default ConnectedNavigatorScreen;\n"]}
@@ -66,7 +66,7 @@ function NumberControl(_ref, ref) {
66
66
  const baseValue = (0, _math.roundClamp)(0, min, max, baseStep);
67
67
 
68
68
  const constrainValue = (value, stepOverride) => {
69
- // When step is "any" clamp the value, otherwise round and clamp it
69
+ // When step is "any" clamp the value, otherwise round and clamp it.
70
70
  return isStepAny ? Math.min(max, Math.max(min, value)) : (0, _math.roundClamp)(value, min, max, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
71
71
  };
72
72
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/number-control/index.js"],"names":["NumberControl","ref","__unstableStateReducer","stateReducer","state","className","dragDirection","hideHTMLArrows","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","type","typeProp","value","valueProp","props","isStepAny","baseStep","parseFloat","baseValue","constrainValue","stepOverride","Math","autoComplete","classes","numberControlStateReducer","action","payload","event","currentValue","inputControlActionTypes","PRESS_UP","PRESS_DOWN","enableShift","shiftKey","incrementalValue","nextValue","preventDefault","DRAG","x","y","delta","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue"],"mappings":";;;;;;;;;;AASA;;;;AALA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAnBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAOO,SAASA,aAAT,OAkBNC,GAlBM,EAmBL;AAAA,MAlBD;AACCC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KADrD;AAECC,IAAAA,SAFD;AAGCC,IAAAA,aAAa,GAAG,GAHjB;AAICC,IAAAA,cAAc,GAAG,KAJlB;AAKCC,IAAAA,aAAa,GAAG,IALjB;AAMCC,IAAAA,kBAAkB,GAAG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KAGMR,KAHN;AAIC,IAAA,SAAS,EAAGS,OAJb;AAKC,IAAA,aAAa,EAAGxB,aALjB;AAMC,IAAA,cAAc,EAAGC,cANlB;AAOC,IAAA,aAAa,EAAGC,aAPjB;AAQC,IAAA,KAAK,EAAGE,KART;AASC,IAAA,GAAG,EAAGC,GATP;AAUC,IAAA,GAAG,EAAGE,GAVP;AAWC,IAAA,GAAG,EAAGZ,GAXP;AAYC,IAAA,QAAQ,EAAGa,QAZZ;AAaC,IAAA,IAAI,EAAGE,IAbR;AAcC,IAAA,IAAI,EAAGE,QAdR;AAeC,IAAA,KAAK,EAAGE,SAfT;AAgBC,IAAA,sBAAsB,EAAG,mCACxBW,yBADwB,EAExB5B,YAFwB;AAhB1B,KADD;AAuBA;;eAEc,yBAAYH,aAAZ,C","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Input } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { composeStateReducers } from '../input-control/reducer/reducer';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { isValueEmpty } from '../utils/values';\n\nexport function NumberControl(\n\t{\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\t...props\n\t},\n\tref\n) {\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : parseFloat( step );\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = ( value, stepOverride ) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it\n\t\treturn isStepAny\n\t\t\t? Math.min( max, Math.max( min, value ) )\n\t\t\t: roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : null;\n\tconst classes = classNames( 'components-number-control', className );\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @param {Object} state State from InputControl\n\t * @param {Object} action Action triggering state change\n\t * @return {Object} The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer = ( state, action ) => {\n\t\tconst { type, payload } = action;\n\t\tconst event = payload?.event;\n\t\tconst currentValue = state.value;\n\n\t\t/**\n\t\t * Handles custom UP and DOWN Keyboard events\n\t\t */\n\t\tif (\n\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t) {\n\t\t\tconst enableShift = event.shiftKey && isShiftStepEnabled;\n\n\t\t\tconst incrementalValue = enableShift\n\t\t\t\t? parseFloat( shiftStep ) * baseStep\n\t\t\t\t: baseStep;\n\t\t\tlet nextValue = isValueEmpty( currentValue )\n\t\t\t\t? baseValue\n\t\t\t\t: currentValue;\n\n\t\t\tif ( event?.preventDefault ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\tif ( type === inputControlActionTypes.PRESS_UP ) {\n\t\t\t\tnextValue = add( nextValue, incrementalValue );\n\t\t\t}\n\n\t\t\tif ( type === inputControlActionTypes.PRESS_DOWN ) {\n\t\t\t\tnextValue = subtract( nextValue, incrementalValue );\n\t\t\t}\n\n\t\t\tstate.value = constrainValue(\n\t\t\t\tnextValue,\n\t\t\t\tenableShift ? incrementalValue : null\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Handles drag to update events\n\t\t */\n\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\tconst [ x, y ] = payload.delta;\n\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\tconst modifier = enableShift\n\t\t\t\t? parseFloat( shiftStep ) * baseStep\n\t\t\t\t: baseStep;\n\n\t\t\tlet directionModifier;\n\t\t\tlet delta;\n\n\t\t\tswitch ( dragDirection ) {\n\t\t\t\tcase 'n':\n\t\t\t\t\tdelta = y;\n\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'e':\n\t\t\t\t\tdelta = x;\n\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 's':\n\t\t\t\t\tdelta = y;\n\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'w':\n\t\t\t\t\tdelta = x;\n\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( delta !== 0 ) {\n\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\tstate.value = constrainValue(\n\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\tenableShift ? modifier : null\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Handles commit (ENTER key press or on blur if isPressEnterToChange)\n\t\t */\n\t\tif (\n\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t) {\n\t\t\tconst applyEmptyValue = required === false && currentValue === '';\n\n\t\t\tstate.value = applyEmptyValue\n\t\t\t\t? currentValue\n\t\t\t\t: constrainValue( currentValue );\n\t\t}\n\n\t\treturn state;\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ hideHTMLArrows }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ ref }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ composeStateReducers(\n\t\t\t\tnumberControlStateReducer,\n\t\t\t\tstateReducer\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( NumberControl );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/number-control/index.js"],"names":["NumberControl","ref","__unstableStateReducer","stateReducer","state","className","dragDirection","hideHTMLArrows","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","type","typeProp","value","valueProp","props","isStepAny","baseStep","parseFloat","baseValue","constrainValue","stepOverride","Math","autoComplete","classes","numberControlStateReducer","action","payload","event","currentValue","inputControlActionTypes","PRESS_UP","PRESS_DOWN","enableShift","shiftKey","incrementalValue","nextValue","preventDefault","DRAG","x","y","delta","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue"],"mappings":";;;;;;;;;;AASA;;;;AALA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAnBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAOO,SAASA,aAAT,OAkBNC,GAlBM,EAmBL;AAAA,MAlBD;AACCC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KADrD;AAECC,IAAAA,SAFD;AAGCC,IAAAA,aAAa,GAAG,GAHjB;AAICC,IAAAA,cAAc,GAAG,KAJlB;AAKCC,IAAAA,aAAa,GAAG,IALjB;AAMCC,IAAAA,kBAAkB,GAAG,IANtB;AAOCC,IAAAA,KAPD;AAQCC,IAAAA,GAAG,GAAGC,QARP;AASCC,IAAAA,GAAG,GAAG,CAACD,QATR;AAUCE,I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lB;AAOC,IAAA,aAAa,EAAGC,aAPjB;AAQC,IAAA,KAAK,EAAGE,KART;AASC,IAAA,GAAG,EAAGC,GATP;AAUC,IAAA,GAAG,EAAGE,GAVP;AAWC,IAAA,GAAG,EAAGZ,GAXP;AAYC,IAAA,QAAQ,EAAGa,QAZZ;AAaC,IAAA,IAAI,EAAGE,IAbR;AAcC,IAAA,IAAI,EAAGE,QAdR;AAeC,IAAA,KAAK,EAAGE,SAfT;AAgBC,IAAA,sBAAsB,EAAG,mCACxBW,yBADwB,EAExB5B,YAFwB;AAhB1B,KADD;AAuBA;;eAEc,yBAAYH,aAAZ,C","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Input } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { composeStateReducers } from '../input-control/reducer/reducer';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { isValueEmpty } from '../utils/values';\n\nexport function NumberControl(\n\t{\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\t...props\n\t},\n\tref\n) {\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : parseFloat( step );\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = ( value, stepOverride ) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\treturn isStepAny\n\t\t\t? Math.min( max, Math.max( min, value ) )\n\t\t\t: roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : null;\n\tconst classes = classNames( 'components-number-control', className );\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @param {Object} state State from InputControl\n\t * @param {Object} action Action triggering state change\n\t * @return {Object} The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer = ( state, action ) => {\n\t\tconst { type, payload } = action;\n\t\tconst event = payload?.event;\n\t\tconst currentValue = state.value;\n\n\t\t/**\n\t\t * Handles custom UP and DOWN Keyboard events\n\t\t */\n\t\tif (\n\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t) {\n\t\t\tconst enableShift = event.shiftKey && isShiftStepEnabled;\n\n\t\t\tconst incrementalValue = enableShift\n\t\t\t\t? parseFloat( shiftStep ) * baseStep\n\t\t\t\t: baseStep;\n\t\t\tlet nextValue = isValueEmpty( currentValue )\n\t\t\t\t? baseValue\n\t\t\t\t: currentValue;\n\n\t\t\tif ( event?.preventDefault ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\tif ( type === inputControlActionTypes.PRESS_UP ) {\n\t\t\t\tnextValue = add( nextValue, incrementalValue );\n\t\t\t}\n\n\t\t\tif ( type === inputControlActionTypes.PRESS_DOWN ) {\n\t\t\t\tnextValue = subtract( nextValue, incrementalValue );\n\t\t\t}\n\n\t\t\tstate.value = constrainValue(\n\t\t\t\tnextValue,\n\t\t\t\tenableShift ? incrementalValue : null\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Handles drag to update events\n\t\t */\n\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\tconst [ x, y ] = payload.delta;\n\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\tconst modifier = enableShift\n\t\t\t\t? parseFloat( shiftStep ) * baseStep\n\t\t\t\t: baseStep;\n\n\t\t\tlet directionModifier;\n\t\t\tlet delta;\n\n\t\t\tswitch ( dragDirection ) {\n\t\t\t\tcase 'n':\n\t\t\t\t\tdelta = y;\n\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'e':\n\t\t\t\t\tdelta = x;\n\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 's':\n\t\t\t\t\tdelta = y;\n\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'w':\n\t\t\t\t\tdelta = x;\n\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( delta !== 0 ) {\n\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\tstate.value = constrainValue(\n\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\tenableShift ? modifier : null\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Handles commit (ENTER key press or on blur if isPressEnterToChange)\n\t\t */\n\t\tif (\n\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t) {\n\t\t\tconst applyEmptyValue = required === false && currentValue === '';\n\n\t\t\tstate.value = applyEmptyValue\n\t\t\t\t? currentValue\n\t\t\t\t: constrainValue( currentValue );\n\t\t}\n\n\t\treturn state;\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ hideHTMLArrows }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ ref }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ composeStateReducers(\n\t\t\t\tnumberControlStateReducer,\n\t\t\t\tstateReducer\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( NumberControl );\n"]}
@@ -62,11 +62,11 @@ function PanelBody(_ref, ref) {
62
62
  const next = !isOpened;
63
63
  setIsOpened(next);
64
64
  onToggle(next);
65
- }; // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value
65
+ }; // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.
66
66
 
67
67
 
68
68
  const scrollAfterOpenRef = (0, _element.useRef)();
69
- scrollAfterOpenRef.current = scrollAfterOpen; // Runs after initial render
69
+ scrollAfterOpenRef.current = scrollAfterOpen; // Runs after initial render.
70
70
 
71
71
  (0, _utils.useUpdateEffect)(() => {
72
72
  var _nodeRef$current;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/panel/body.js"],"names":["PanelBody","ref","buttonProps","children","className","icon","initialOpen","onToggle","noop","opened","title","scrollAfterOpen","isOpened","setIsOpened","initial","undefined","nodeRef","scrollBehavior","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","scrollIntoView","inline","block","behavior","classes","PanelBodyTitle","props","chevronUp","chevronDown","ForwardedComponent","displayName"],"mappings":";;;;;;;;;;AAUA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AAKO,SAASA,SAAT,OAYNC,GAZM,EAaL;AAAA,MAZD;AACCC,IAAAA,WAAW,GAAG,EADf;AAECC,IAAAA,QAFD;AAGCC,IAAAA,SAHD;AAICC,IAAAA,IAJD;AAKCC,IAAAA,WALD;AAMCC,IAAAA,QAAQ,GAAGC,YANZ;AAOCC,IAAAA,MAPD;AAQCC,IAA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BAAC,cAAD;AACC,IAAA,IAAI,EAAGI,IADR;AAEC,IAAA,QAAQ,EAAGO,QAFZ;AAGC,IAAA,OAAO,EAAGM,cAHX;AAIC,IAAA,KAAK,EAAGR;AAJT,KAKMR,WALN,EADD,EAQG,OAAOC,QAAP,KAAoB,UAApB,GACCA,QAAQ,CAAE;AAAEM,IAAAA,MAAM,EAAEG;AAAV,GAAF,CADT,GAECA,QAAQ,IAAIT,QAVhB,CADD;AAcA;;AAED,MAAM0B,cAAc,GAAG,yBACtB,QAAuC5B,GAAvC,KAAgD;AAAA,MAA9C;AAAEW,IAAAA,QAAF;AAAYP,IAAAA,IAAZ;AAAkBK,IAAAA,KAAlB;AAAyB,OAAGoB;AAA5B,GAA8C;AAC/C,MAAK,CAAEpB,KAAP,EAAe,OAAO,IAAP;AAEf,SACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACC,4BAAC,eAAD;AACC,IAAA,SAAS,EAAC,+BADX;AAEC,qBAAgBE,QAFjB;AAGC,IAAA,GAAG,EAAGX;AAHP,KAIM6B,KAJN,GAUC;AAAM,mBAAY;AAAlB,KACC,4BAAC,aAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,IAAI,EAAGlB,QAAQ,GAAGmB,gBAAH,GAAeC;AAF/B,IADD,CAVD,EAgBGtB,KAhBH,EAiBGL,IAAI,IACL,4BAAC,aAAD;AACC,IAAA,IAAI,EAAGA,IADR;AAEC,IAAA,SAAS,EAAC,wBAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAlBF,CADD,CADD;AA6BA,CAjCqB,CAAvB;AAoCA,MAAM4B,kBAAkB,GAAG,yBAAYjC,SAAZ,CAA3B;AACAiC,kBAAkB,CAACC,WAAnB,GAAiC,WAAjC;eAEeD,kB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nexport function PanelBody(\n\t{\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t},\n\tref\n) {\n\tconst [ isOpened, setIsOpened ] = useControlledState( opened, {\n\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t} );\n\tconst nodeRef = useRef();\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value\n\tconst scrollAfterOpenRef = useRef();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = classnames( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ isOpened }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: isOpened } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t( { isOpened, icon, title, ...props }, ref ) => {\n\t\tif ( ! title ) return null;\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nconst ForwardedComponent = forwardRef( PanelBody );\nForwardedComponent.displayName = 'PanelBody';\n\nexport default ForwardedComponent;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/panel/body.js"],"names":["PanelBody","ref","buttonProps","children","className","icon","initialOpen","onToggle","noop","opened","title","scrollAfterOpen","isOpened","setIsOpened","initial","undefined","nodeRef","scrollBehavior","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","scrollIntoView","inline","block","behavior","classes","PanelBodyTitle","props","chevronUp","chevronDown","ForwardedComponent","displayName"],"mappings":";;;;;;;;;;AAUA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AAKO,SAASA,SAAT,OAYNC,GAZM,EAaL;AAAA,MAZD;AACCC,IAAAA,WAAW,GAAG,EADf;AAECC,IAAAA,QAFD;AAGCC,IAAAA,SAHD;AAICC,IAAAA,IAJD;AAKCC,IAAAA,WALD;AAMCC,IAAAA,QAAQ,GAAGC,YANZ;AAOCC,IAAAA,MAPD;AAQCC,IAAAA,KARD;AASCC,IAAAA,eAAe,GAAG;AATnB,GAYC;AACD,QAAM,CAAEC,QAAF,EAAYC,WAAZ,IAA4B,+BAAoBJ,MAApB,EAA4B;AAC7DK,IAAAA,OAAO,EAAER,WAAW,KAAKS,SAAhB,GAA4B,IAA5B,GAAmCT;AADiB,GAA5B,CAAlC;AAGA,QAAMU,OAAO,GAAG,sBAAhB,CAJC,CAMD;AACA;;AACA,QAAMC,cAAc,GAAG,mCAAqB,MAArB,GAA8B,QAArD;;AAEA,QAAMC,cAAc,GAAKC,KAAF,IAAa;AACnCA,IAAAA,KAAK,CAACC,cAAN;AACA,UAAMC,IAAI,GAAG,CAAET,QAAf;AACAC,IAAAA,WAAW,CAAEQ,IAAF,CAAX;AACAd,IAAAA,QAAQ,CAAEc,IAAF,CAAR;AACA,GALD,CAVC,CAiBD;;;AACA,QAAMC,kBAAkB,GAAG,sBAA3B;AACAA,EAAAA,kBAAkB,CAACC,OAAnB,GAA6BZ,eAA7B,CAnBC,CAoBD;;AACA,8BAAiB,MAAM;AAAA;;AACtB,QACCC,QAAQ,IACRU,kBAAkB,CAACC,OADnB,wBAEAP,OAAO,CAACO,OAFR,6CAEA,iBAAi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AAA,IAAI,EAAGlB,QAAQ,GAAGmB,gBAAH,GAAeC;AAF/B,IADD,CAVD,EAgBGtB,KAhBH,EAiBGL,IAAI,IACL,4BAAC,aAAD;AACC,IAAA,IAAI,EAAGA,IADR;AAEC,IAAA,SAAS,EAAC,wBAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAlBF,CADD,CADD;AA6BA,CAjCqB,CAAvB;AAoCA,MAAM4B,kBAAkB,GAAG,yBAAYjC,SAAZ,CAA3B;AACAiC,kBAAkB,CAACC,WAAnB,GAAiC,WAAjC;eAEeD,kB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nexport function PanelBody(\n\t{\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t},\n\tref\n) {\n\tconst [ isOpened, setIsOpened ] = useControlledState( opened, {\n\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t} );\n\tconst nodeRef = useRef();\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n\tconst scrollAfterOpenRef = useRef();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render.\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = classnames( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ isOpened }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: isOpened } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t( { isOpened, icon, title, ...props }, ref ) => {\n\t\tif ( ! title ) return null;\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nconst ForwardedComponent = forwardRef( PanelBody );\nForwardedComponent.displayName = 'PanelBody';\n\nexport default ForwardedComponent;\n"]}
@@ -74,14 +74,14 @@ function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect) {
74
74
  return;
75
75
  } // Duck-type to check if `anchorRef` is an instance of Range
76
76
  // `anchorRef instanceof window.Range` checks will break across document boundaries
77
- // such as in an iframe
77
+ // such as in an iframe.
78
78
 
79
79
 
80
80
  if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.cloneRange) === 'function') {
81
81
  return (0, _utils.offsetIframe)((0, _dom.getRectangleFromRange)(anchorRef), anchorRef.endContainer.ownerDocument, container);
82
82
  } // Duck-type to check if `anchorRef` is an instance of Element
83
83
  // `anchorRef instanceof window.Element` checks will break across document boundaries
84
- // such as in an iframe
84
+ // such as in an iframe.
85
85
 
86
86
 
87
87
  if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.getBoundingClientRect) === 'function') {
@@ -333,7 +333,7 @@ const Popover = (_ref, ref) => {
333
333
  setAttribute(containerRef.current, 'data-x-axis', xAxis);
334
334
  setAttribute(containerRef.current, 'data-y-axis', yAxis);
335
335
  setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : '');
336
- setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position
336
+ setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position.
337
337
 
338
338
  const yAxisMapping = {
339
339
  top: 'bottom',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/popover/index.js"],"names":["SLOT_NAME","slotNameContext","computeAnchorRect","anchorRefFallback","anchorRect","getAnchorRect","anchorRef","shouldAnchorIncludePadding","container","current","rect","ownerDocument","window","Range","Element","DOMRect","cloneRange","endContainer","getBoundingClientRect","withoutPadding","top","bottom","topRect","bottomRect","left","width","parentNode","getComputedStyle","node","defaultView","element","paddingTop","paddingBottom","paddingLeft","paddingRight","parseInt","right","x","y","height","setAttribute","name","value","hasAttribute","removeAttribute","getAttribute","setStyle","property","style","setClass","toggle","classList","contains","add","remove","getAnchorDocument","anchor","Popover","ref","headerTitle","onClose","children","className","noArrow","isAlternate","position","range","focusOnMount","expandOnMobile","animate","onFocusOutside","__unstableStickyBoundaryElement","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent","__unstableForcePosition","__unstableForceXAlignment","__unstableEditorCanvasWrapper","contentProps","contentRef","containerRef","isMobileViewport","animateOrigin","setAnimateOrigin","slotName","slot","isExpanded","containerResizeListener","contentSize","refresh","offsetParent","relativeOffsetTop","body","offsetParentRect","boundaryElement","parentElement","usedContentSize","popoverTop","popoverLeft","xAxis","yAxis","contentHeight","contentWidth","yAxisMapping","xAxisMapping","animateYAxis","animateXAxis","intervalHandle","setInterval","rafId","refreshOnAnimationFrame","cancelAnimationFrame","requestAnimationFrame","addEventListener","anchorDocument","observer","MutationObserver","observe","attributes","clearInterval","removeEventListener","disconnect","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","mergedRefs","animateClassName","Boolean","origin","content","close","PopoverContainer","PopoverSlot","Slot","__unstableSlotNameProvider","Provider"],"mappings":";;;;;;;;;AASA;;;;AALA;;AAaA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAjCA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAOA;AACA;AACA;A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AAED4E,gBAAgB,CAACE,IAAjB,GAAwB,yBAAYD,WAAZ,CAAxB;AACAD,gBAAgB,CAACG,0BAAjB,GAA8CxI,eAAe,CAACyI,QAA9D;eAEeJ,gB","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseState,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport { getRectangleFromRange } from '@wordpress/dom';\nimport {\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { computePopoverPosition, offsetIframe } from './utils';\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport { getAnimateClassName } from '../animate';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nconst SLOT_NAME = 'Popover';\n\nconst slotNameContext = createContext();\n\nfunction computeAnchorRect(\n\tanchorRefFallback,\n\tanchorRect,\n\tgetAnchorRect,\n\tanchorRef = false,\n\tshouldAnchorIncludePadding,\n\tcontainer\n) {\n\tif ( anchorRect ) {\n\t\treturn anchorRect;\n\t}\n\n\tif ( getAnchorRect ) {\n\t\tif ( ! anchorRefFallback.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rect = getAnchorRect( anchorRefFallback.current );\n\t\treturn offsetIframe(\n\t\t\trect,\n\t\t\trect.ownerDocument || anchorRefFallback.current.ownerDocument,\n\t\t\tcontainer\n\t\t);\n\t}\n\n\tif ( anchorRef !== false ) {\n\t\tif (\n\t\t\t! anchorRef ||\n\t\t\t! window.Range ||\n\t\t\t! window.Element ||\n\t\t\t! window.DOMRect\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Duck-type to check if `anchorRef` is an instance of Range\n\t\t// `anchorRef instanceof window.Range` checks will break across document boundaries\n\t\t// such as in an iframe\n\t\tif ( typeof anchorRef?.cloneRange === 'function' ) {\n\t\t\treturn offsetIframe(\n\t\t\t\tgetRectangleFromRange( anchorRef ),\n\t\t\t\tanchorRef.endContainer.ownerDocument,\n\t\t\t\tcontainer\n\t\t\t);\n\t\t}\n\n\t\t// Duck-type to check if `anchorRef` is an instance of Element\n\t\t// `anchorRef instanceof window.Element` checks will break across document boundaries\n\t\t// such as in an iframe\n\t\tif ( typeof anchorRef?.getBoundingClientRect === 'function' ) {\n\t\t\tconst rect = offsetIframe(\n\t\t\t\tanchorRef.getBoundingClientRect(),\n\t\t\t\tanchorRef.ownerDocument,\n\t\t\t\tcontainer\n\t\t\t);\n\n\t\t\tif ( shouldAnchorIncludePadding ) {\n\t\t\t\treturn rect;\n\t\t\t}\n\n\t\t\treturn withoutPadding( rect, anchorRef );\n\t\t}\n\n\t\tconst { top, bottom } = anchorRef;\n\t\tconst topRect = top.getBoundingClientRect();\n\t\tconst bottomRect = bottom.getBoundingClientRect();\n\t\tconst rect = offsetIframe(\n\t\t\tnew window.DOMRect(\n\t\t\t\ttopRect.left,\n\t\t\t\ttopRect.top,\n\t\t\t\ttopRect.width,\n\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t),\n\t\t\ttop.ownerDocument,\n\t\t\tcontainer\n\t\t);\n\n\t\tif ( shouldAnchorIncludePadding ) {\n\t\t\treturn rect;\n\t\t}\n\n\t\treturn withoutPadding( rect, anchorRef );\n\t}\n\n\tif ( ! anchorRefFallback.current ) {\n\t\treturn;\n\t}\n\n\tconst { parentNode } = anchorRefFallback.current;\n\tconst rect = offsetIframe(\n\t\tparentNode.getBoundingClientRect(),\n\t\tparentNode.ownerDocument,\n\t\tcontainer\n\t);\n\n\tif ( shouldAnchorIncludePadding ) {\n\t\treturn rect;\n\t}\n\n\treturn withoutPadding( rect, parentNode );\n}\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nfunction withoutPadding( rect, element ) {\n\tconst {\n\t\tpaddingTop,\n\t\tpaddingBottom,\n\t\tpaddingLeft,\n\t\tpaddingRight,\n\t} = getComputedStyle( element );\n\tconst top = paddingTop ? parseInt( paddingTop, 10 ) : 0;\n\tconst bottom = paddingBottom ? parseInt( paddingBottom, 10 ) : 0;\n\tconst left = paddingLeft ? parseInt( paddingLeft, 10 ) : 0;\n\tconst right = paddingRight ? parseInt( paddingRight, 10 ) : 0;\n\n\treturn {\n\t\tx: rect.left + left,\n\t\ty: rect.top + top,\n\t\twidth: rect.width - left - right,\n\t\theight: rect.height - top - bottom,\n\t\tleft: rect.left + left,\n\t\tright: rect.right - right,\n\t\ttop: rect.top + top,\n\t\tbottom: rect.bottom - bottom,\n\t};\n}\n\n/**\n * Sets or removes an element attribute.\n *\n * @param {Element} element The element to modify.\n * @param {string} name The attribute name to set or remove.\n * @param {?string} value The value to set. A falsy value will remove the\n * attribute.\n */\nfunction setAttribute( element, name, value ) {\n\tif ( ! value ) {\n\t\tif ( element.hasAttribute( name ) ) {\n\t\t\telement.removeAttribute( name );\n\t\t}\n\t} else if ( element.getAttribute( name ) !== value ) {\n\t\telement.setAttribute( name, value );\n\t}\n}\n\n/**\n * Sets or removes an element style property.\n *\n * @param {Element} element The element to modify.\n * @param {string} property The property to set or remove.\n * @param {?string} value The value to set. A falsy value will remove the\n * property.\n */\nfunction setStyle( element, property, value = '' ) {\n\tif ( element.style[ property ] !== value ) {\n\t\telement.style[ property ] = value;\n\t}\n}\n\n/**\n * Sets or removes an element class.\n *\n * @param {Element} element The element to modify.\n * @param {string} name The class to set or remove.\n * @param {boolean} toggle True to set the class, false to remove.\n */\nfunction setClass( element, name, toggle ) {\n\tif ( toggle ) {\n\t\tif ( ! element.classList.contains( name ) ) {\n\t\t\telement.classList.add( name );\n\t\t}\n\t} else if ( element.classList.contains( name ) ) {\n\t\telement.classList.remove( name );\n\t}\n}\n\nfunction getAnchorDocument( anchor ) {\n\tif ( ! anchor ) {\n\t\treturn;\n\t}\n\n\tif ( anchor.endContainer ) {\n\t\treturn anchor.endContainer.ownerDocument;\n\t}\n\n\tif ( anchor.top ) {\n\t\treturn anchor.top.ownerDocument;\n\t}\n\n\treturn anchor.ownerDocument;\n}\n\nconst Popover = (\n\t{\n\t\theaderTitle,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tisAlternate,\n\t\t// Disable reason: We generate the `...contentProps` rest as remainder\n\t\t// of props which aren't explicitly handled by this component.\n\t\t/* eslint-disable no-unused-vars */\n\t\tposition = 'bottom right',\n\t\trange,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchorRef,\n\t\tshouldAnchorIncludePadding,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\texpandOnMobile,\n\t\tanimate = true,\n\t\tonFocusOutside,\n\t\t__unstableStickyBoundaryElement,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\t__unstableObserveElement,\n\t\t__unstableBoundaryParent,\n\t\t__unstableForcePosition,\n\t\t__unstableForceXAlignment,\n\t\t__unstableEditorCanvasWrapper,\n\t\t/* eslint-enable no-unused-vars */\n\t\t...contentProps\n\t},\n\tref\n) => {\n\tconst anchorRefFallback = useRef( null );\n\tconst contentRef = useRef( null );\n\tconst containerRef = useRef();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ animateOrigin, setAnimateOrigin ] = useState();\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst [ containerResizeListener, contentSize ] = useResizeObserver();\n\tnoArrow = isExpanded || noArrow;\n\n\tuseLayoutEffect( () => {\n\t\tif ( isExpanded ) {\n\t\t\tsetClass( containerRef.current, 'is-without-arrow', noArrow );\n\t\t\tsetClass( containerRef.current, 'is-alternate', isAlternate );\n\t\t\tsetAttribute( containerRef.current, 'data-x-axis' );\n\t\t\tsetAttribute( containerRef.current, 'data-y-axis' );\n\t\t\tsetStyle( containerRef.current, 'top' );\n\t\t\tsetStyle( containerRef.current, 'left' );\n\t\t\tsetStyle( contentRef.current, 'maxHeight' );\n\t\t\tsetStyle( contentRef.current, 'maxWidth' );\n\t\t\treturn;\n\t\t}\n\n\t\tconst refresh = () => {\n\t\t\tif ( ! containerRef.current || ! contentRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet anchor = computeAnchorRect(\n\t\t\t\tanchorRefFallback,\n\t\t\t\tanchorRect,\n\t\t\t\tgetAnchorRect,\n\t\t\t\tanchorRef,\n\t\t\t\tshouldAnchorIncludePadding,\n\t\t\t\tcontainerRef.current\n\t\t\t);\n\n\t\t\tif ( ! anchor ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { offsetParent, ownerDocument } = containerRef.current;\n\n\t\t\tlet relativeOffsetTop = 0;\n\n\t\t\t// If there is a positioned ancestor element that is not the body,\n\t\t\t// subtract the position from the anchor rect. If the position of\n\t\t\t// the popover is fixed, the offset parent is null or the body\n\t\t\t// element, in which case the position is relative to the viewport.\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n\t\t\tif ( offsetParent && offsetParent !== ownerDocument.body ) {\n\t\t\t\tconst offsetParentRect = offsetParent.getBoundingClientRect();\n\n\t\t\t\trelativeOffsetTop = offsetParentRect.top;\n\t\t\t\tanchor = new window.DOMRect(\n\t\t\t\t\tanchor.left - offsetParentRect.left,\n\t\t\t\t\tanchor.top - offsetParentRect.top,\n\t\t\t\t\tanchor.width,\n\t\t\t\t\tanchor.height\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet boundaryElement;\n\t\t\tif ( __unstableBoundaryParent ) {\n\t\t\t\tboundaryElement = containerRef.current.parentElement;\n\t\t\t}\n\n\t\t\tconst usedContentSize = ! contentSize.height\n\t\t\t\t? contentRef.current.getBoundingClientRect()\n\t\t\t\t: contentSize;\n\n\t\t\tconst {\n\t\t\t\tpopoverTop,\n\t\t\t\tpopoverLeft,\n\t\t\t\txAxis,\n\t\t\t\tyAxis,\n\t\t\t\tcontentHeight,\n\t\t\t\tcontentWidth,\n\t\t\t} = computePopoverPosition(\n\t\t\t\tanchor,\n\t\t\t\tusedContentSize,\n\t\t\t\tposition,\n\t\t\t\t__unstableStickyBoundaryElement,\n\t\t\t\tcontainerRef.current,\n\t\t\t\trelativeOffsetTop,\n\t\t\t\tboundaryElement,\n\t\t\t\t__unstableForcePosition,\n\t\t\t\t__unstableForceXAlignment,\n\t\t\t\t__unstableEditorCanvasWrapper\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\ttypeof popoverTop === 'number' &&\n\t\t\t\ttypeof popoverLeft === 'number'\n\t\t\t) {\n\t\t\t\tsetStyle( containerRef.current, 'top', popoverTop + 'px' );\n\t\t\t\tsetStyle( containerRef.current, 'left', popoverLeft + 'px' );\n\t\t\t}\n\n\t\t\tsetClass(\n\t\t\t\tcontainerRef.current,\n\t\t\t\t'is-without-arrow',\n\t\t\t\tnoArrow || ( xAxis === 'center' && yAxis === 'middle' )\n\t\t\t);\n\t\t\tsetClass( containerRef.current, 'is-alternate', isAlternate );\n\t\t\tsetAttribute( containerRef.current, 'data-x-axis', xAxis );\n\t\t\tsetAttribute( containerRef.current, 'data-y-axis', yAxis );\n\t\t\tsetStyle(\n\t\t\t\tcontentRef.current,\n\t\t\t\t'maxHeight',\n\t\t\t\ttypeof contentHeight === 'number' ? contentHeight + 'px' : ''\n\t\t\t);\n\t\t\tsetStyle(\n\t\t\t\tcontentRef.current,\n\t\t\t\t'maxWidth',\n\t\t\t\ttypeof contentWidth === 'number' ? contentWidth + 'px' : ''\n\t\t\t);\n\n\t\t\t// Compute the animation position\n\t\t\tconst yAxisMapping = {\n\t\t\t\ttop: 'bottom',\n\t\t\t\tbottom: 'top',\n\t\t\t};\n\t\t\tconst xAxisMapping = {\n\t\t\t\tleft: 'right',\n\t\t\t\tright: 'left',\n\t\t\t};\n\t\t\tconst animateYAxis = yAxisMapping[ yAxis ] || 'middle';\n\t\t\tconst animateXAxis = xAxisMapping[ xAxis ] || 'center';\n\n\t\t\tsetAnimateOrigin( animateXAxis + ' ' + animateYAxis );\n\t\t};\n\n\t\trefresh();\n\n\t\tconst { ownerDocument } = containerRef.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t/*\n\t\t * There are sometimes we need to reposition or resize the popover that\n\t\t * are not handled by the resize/scroll window events (i.e. CSS changes\n\t\t * in the layout that changes the position of the anchor).\n\t\t *\n\t\t * For these situations, we refresh the popover every 0.5s\n\t\t */\n\t\tconst intervalHandle = defaultView.setInterval( refresh, 500 );\n\n\t\tlet rafId;\n\n\t\tconst refreshOnAnimationFrame = () => {\n\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\t\t\trafId = defaultView.requestAnimationFrame( refresh );\n\t\t};\n\n\t\t// Sometimes a click trigger a layout change that affects the popover\n\t\t// position. This is an opportunity to immediately refresh rather than\n\t\t// at the interval.\n\t\tdefaultView.addEventListener( 'click', refreshOnAnimationFrame );\n\t\tdefaultView.addEventListener( 'resize', refresh );\n\t\tdefaultView.addEventListener( 'scroll', refresh, true );\n\n\t\tconst anchorDocument = getAnchorDocument( anchorRef );\n\n\t\t// If the anchor is within an iframe, the popover position also needs\n\t\t// to refrest when the iframe content is scrolled or resized.\n\t\tif ( anchorDocument && anchorDocument !== ownerDocument ) {\n\t\t\tanchorDocument.defaultView.addEventListener( 'resize', refresh );\n\t\t\tanchorDocument.defaultView.addEventListener(\n\t\t\t\t'scroll',\n\t\t\t\trefresh,\n\t\t\t\ttrue\n\t\t\t);\n\t\t}\n\n\t\tlet observer;\n\n\t\tif ( __unstableObserveElement ) {\n\t\t\tobserver = new defaultView.MutationObserver( refresh );\n\t\t\tobserver.observe( __unstableObserveElement, { attributes: true } );\n\t\t}\n\n\t\treturn () => {\n\t\t\tdefaultView.clearInterval( intervalHandle );\n\t\t\tdefaultView.removeEventListener( 'resize', refresh );\n\t\t\tdefaultView.removeEventListener( 'scroll', refresh, true );\n\t\t\tdefaultView.removeEventListener( 'click', refreshOnAnimationFrame );\n\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\n\t\t\tif ( anchorDocument && anchorDocument !== ownerDocument ) {\n\t\t\t\tanchorDocument.defaultView?.removeEventListener(\n\t\t\t\t\t'resize',\n\t\t\t\t\trefresh\n\t\t\t\t);\n\t\t\t\tanchorDocument.defaultView?.removeEventListener(\n\t\t\t\t\t'scroll',\n\t\t\t\t\trefresh,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( observer ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t};\n\t}, [\n\t\tisExpanded,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tanchorRef,\n\t\tshouldAnchorIncludePadding,\n\t\tposition,\n\t\tcontentSize,\n\t\t__unstableStickyBoundaryElement,\n\t\t__unstableObserveElement,\n\t\t__unstableBoundaryParent,\n\t] );\n\n\tconst onDialogClose = ( type, event ) => {\n\t\t// Ideally the popover should have just a single onClose prop and\n\t\t// not three props that potentially do the same thing.\n\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\tonFocusOutside( event );\n\t\t} else if ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t};\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst mergedRefs = useMergeRefs( [ containerRef, dialogRef, ref ] );\n\n\t/** @type {false | string} */\n\tconst animateClassName =\n\t\tBoolean( animate && animateOrigin ) &&\n\t\tgetAnimateClassName( {\n\t\t\ttype: 'appear',\n\t\t\torigin: animateOrigin,\n\t\t} );\n\n\t// Disable reason: We care to capture the _bubbled_ events from inputs\n\t// within popover as inferring close intent.\n\n\tlet content = (\n\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-popover',\n\t\t\t\tclassName,\n\t\t\t\tanimateClassName,\n\t\t\t\t{\n\t\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t\t'is-without-arrow': noArrow,\n\t\t\t\t\t'is-alternate': isAlternate,\n\t\t\t\t}\n\t\t\t) }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedRefs }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex=\"-1\"\n\t\t>\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div ref={ contentRef } className=\"components-popover__content\">\n\t\t\t\t<div style={ { position: 'relative' } }>\n\t\t\t\t\t{ containerResizeListener }\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\tif ( slot.ref ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t}\n\n\tif ( anchorRef || anchorRect ) {\n\t\treturn content;\n\t}\n\n\treturn <span ref={ anchorRefFallback }>{ content }</span>;\n};\n\nconst PopoverContainer = forwardRef( Popover );\n\nfunction PopoverSlot( { name = SLOT_NAME }, ref ) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\nPopoverContainer.Slot = forwardRef( PopoverSlot );\nPopoverContainer.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default PopoverContainer;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/popover/index.js"],"names":["SLOT_NAME","slotNameContext","computeAnchorRect","anchorRefFallback","anchorRect","getAnchorRect","anchorRef","shouldAnchorIncludePadding","container","current","rect","ownerDocument","window","Range","Element","DOMRect","cloneRange","endContainer","getBoundingClientRect","withoutPadding","top","bottom","topRect","bottomRect","left","width","parentNode","getComputedStyle","node","defaultView","element","paddingTop","paddingBottom","paddingLeft","paddingRight","parseInt","right","x","y","height","setAttribute","name","value","hasAttribute","removeAttribute","getAttribute","setStyle","property","style","setClass","toggle","classList","contains","add","remove","getAnchorDocument","anchor","Popover","ref","headerTitle","onClose","children","className","noArrow","isAlternate","position","range","focusOnMount","expandOnMobile","animate","onFocusOutside","__unstableStickyBoundaryElement","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent","__unstableForcePosition","__unstableForceXAlignment","__unstableEditorCanvasWrapper","contentProps","contentRef","containerRef","isMobileViewport","animateOrigin","setAnimateOrigin","slotName","slot","isExpanded","containerResizeListener","contentSize","refresh","offsetParent","relativeOffsetTop","body","offsetParentRect","boundaryElement","parentElement","usedContentSize","popoverTop","popoverLeft","xAxis","yAxis","contentHeight","contentWidth","yAxisMapping","xAxisMapping","animateYAxis","animateXAxis","intervalHandle","setInterval","rafId","refreshOnAnimationFrame","cancelAnimationFrame","requestAnimationFrame","addEventListener","anchorDocument","observer","MutationObserver","observe","attributes","clearInterval","removeEventListener","disconnect","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","mergedRefs","animateClassName","Boolean","origin","content","close","PopoverContainer","PopoverSlot","Slot","__unstableSlotNameProvider","Provider"],"mappings":";;;;;;;;;AASA;;;;AALA;;AAaA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAjCA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA,MAAMA,SAAS,GAAG,SAAlB;AAEA,MAAMC,eAAe,GA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AD,gBAAgB,CAACG,0BAAjB,GAA8CxI,eAAe,CAACyI,QAA9D;eAEeJ,gB","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseState,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport { getRectangleFromRange } from '@wordpress/dom';\nimport {\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { computePopoverPosition, offsetIframe } from './utils';\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport { getAnimateClassName } from '../animate';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nconst SLOT_NAME = 'Popover';\n\nconst slotNameContext = createContext();\n\nfunction computeAnchorRect(\n\tanchorRefFallback,\n\tanchorRect,\n\tgetAnchorRect,\n\tanchorRef = false,\n\tshouldAnchorIncludePadding,\n\tcontainer\n) {\n\tif ( anchorRect ) {\n\t\treturn anchorRect;\n\t}\n\n\tif ( getAnchorRect ) {\n\t\tif ( ! anchorRefFallback.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rect = getAnchorRect( anchorRefFallback.current );\n\t\treturn offsetIframe(\n\t\t\trect,\n\t\t\trect.ownerDocument || anchorRefFallback.current.ownerDocument,\n\t\t\tcontainer\n\t\t);\n\t}\n\n\tif ( anchorRef !== false ) {\n\t\tif (\n\t\t\t! anchorRef ||\n\t\t\t! window.Range ||\n\t\t\t! window.Element ||\n\t\t\t! window.DOMRect\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Duck-type to check if `anchorRef` is an instance of Range\n\t\t// `anchorRef instanceof window.Range` checks will break across document boundaries\n\t\t// such as in an iframe.\n\t\tif ( typeof anchorRef?.cloneRange === 'function' ) {\n\t\t\treturn offsetIframe(\n\t\t\t\tgetRectangleFromRange( anchorRef ),\n\t\t\t\tanchorRef.endContainer.ownerDocument,\n\t\t\t\tcontainer\n\t\t\t);\n\t\t}\n\n\t\t// Duck-type to check if `anchorRef` is an instance of Element\n\t\t// `anchorRef instanceof window.Element` checks will break across document boundaries\n\t\t// such as in an iframe.\n\t\tif ( typeof anchorRef?.getBoundingClientRect === 'function' ) {\n\t\t\tconst rect = offsetIframe(\n\t\t\t\tanchorRef.getBoundingClientRect(),\n\t\t\t\tanchorRef.ownerDocument,\n\t\t\t\tcontainer\n\t\t\t);\n\n\t\t\tif ( shouldAnchorIncludePadding ) {\n\t\t\t\treturn rect;\n\t\t\t}\n\n\t\t\treturn withoutPadding( rect, anchorRef );\n\t\t}\n\n\t\tconst { top, bottom } = anchorRef;\n\t\tconst topRect = top.getBoundingClientRect();\n\t\tconst bottomRect = bottom.getBoundingClientRect();\n\t\tconst rect = offsetIframe(\n\t\t\tnew window.DOMRect(\n\t\t\t\ttopRect.left,\n\t\t\t\ttopRect.top,\n\t\t\t\ttopRect.width,\n\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t),\n\t\t\ttop.ownerDocument,\n\t\t\tcontainer\n\t\t);\n\n\t\tif ( shouldAnchorIncludePadding ) {\n\t\t\treturn rect;\n\t\t}\n\n\t\treturn withoutPadding( rect, anchorRef );\n\t}\n\n\tif ( ! anchorRefFallback.current ) {\n\t\treturn;\n\t}\n\n\tconst { parentNode } = anchorRefFallback.current;\n\tconst rect = offsetIframe(\n\t\tparentNode.getBoundingClientRect(),\n\t\tparentNode.ownerDocument,\n\t\tcontainer\n\t);\n\n\tif ( shouldAnchorIncludePadding ) {\n\t\treturn rect;\n\t}\n\n\treturn withoutPadding( rect, parentNode );\n}\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nfunction withoutPadding( rect, element ) {\n\tconst {\n\t\tpaddingTop,\n\t\tpaddingBottom,\n\t\tpaddingLeft,\n\t\tpaddingRight,\n\t} = getComputedStyle( element );\n\tconst top = paddingTop ? parseInt( paddingTop, 10 ) : 0;\n\tconst bottom = paddingBottom ? parseInt( paddingBottom, 10 ) : 0;\n\tconst left = paddingLeft ? parseInt( paddingLeft, 10 ) : 0;\n\tconst right = paddingRight ? parseInt( paddingRight, 10 ) : 0;\n\n\treturn {\n\t\tx: rect.left + left,\n\t\ty: rect.top + top,\n\t\twidth: rect.width - left - right,\n\t\theight: rect.height - top - bottom,\n\t\tleft: rect.left + left,\n\t\tright: rect.right - right,\n\t\ttop: rect.top + top,\n\t\tbottom: rect.bottom - bottom,\n\t};\n}\n\n/**\n * Sets or removes an element attribute.\n *\n * @param {Element} element The element to modify.\n * @param {string} name The attribute name to set or remove.\n * @param {?string} value The value to set. A falsy value will remove the\n * attribute.\n */\nfunction setAttribute( element, name, value ) {\n\tif ( ! value ) {\n\t\tif ( element.hasAttribute( name ) ) {\n\t\t\telement.removeAttribute( name );\n\t\t}\n\t} else if ( element.getAttribute( name ) !== value ) {\n\t\telement.setAttribute( name, value );\n\t}\n}\n\n/**\n * Sets or removes an element style property.\n *\n * @param {Element} element The element to modify.\n * @param {string} property The property to set or remove.\n * @param {?string} value The value to set. A falsy value will remove the\n * property.\n */\nfunction setStyle( element, property, value = '' ) {\n\tif ( element.style[ property ] !== value ) {\n\t\telement.style[ property ] = value;\n\t}\n}\n\n/**\n * Sets or removes an element class.\n *\n * @param {Element} element The element to modify.\n * @param {string} name The class to set or remove.\n * @param {boolean} toggle True to set the class, false to remove.\n */\nfunction setClass( element, name, toggle ) {\n\tif ( toggle ) {\n\t\tif ( ! element.classList.contains( name ) ) {\n\t\t\telement.classList.add( name );\n\t\t}\n\t} else if ( element.classList.contains( name ) ) {\n\t\telement.classList.remove( name );\n\t}\n}\n\nfunction getAnchorDocument( anchor ) {\n\tif ( ! anchor ) {\n\t\treturn;\n\t}\n\n\tif ( anchor.endContainer ) {\n\t\treturn anchor.endContainer.ownerDocument;\n\t}\n\n\tif ( anchor.top ) {\n\t\treturn anchor.top.ownerDocument;\n\t}\n\n\treturn anchor.ownerDocument;\n}\n\nconst Popover = (\n\t{\n\t\theaderTitle,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tisAlternate,\n\t\t// Disable reason: We generate the `...contentProps` rest as remainder\n\t\t// of props which aren't explicitly handled by this component.\n\t\t/* eslint-disable no-unused-vars */\n\t\tposition = 'bottom right',\n\t\trange,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchorRef,\n\t\tshouldAnchorIncludePadding,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\texpandOnMobile,\n\t\tanimate = true,\n\t\tonFocusOutside,\n\t\t__unstableStickyBoundaryElement,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\t__unstableObserveElement,\n\t\t__unstableBoundaryParent,\n\t\t__unstableForcePosition,\n\t\t__unstableForceXAlignment,\n\t\t__unstableEditorCanvasWrapper,\n\t\t/* eslint-enable no-unused-vars */\n\t\t...contentProps\n\t},\n\tref\n) => {\n\tconst anchorRefFallback = useRef( null );\n\tconst contentRef = useRef( null );\n\tconst containerRef = useRef();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ animateOrigin, setAnimateOrigin ] = useState();\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst [ containerResizeListener, contentSize ] = useResizeObserver();\n\tnoArrow = isExpanded || noArrow;\n\n\tuseLayoutEffect( () => {\n\t\tif ( isExpanded ) {\n\t\t\tsetClass( containerRef.current, 'is-without-arrow', noArrow );\n\t\t\tsetClass( containerRef.current, 'is-alternate', isAlternate );\n\t\t\tsetAttribute( containerRef.current, 'data-x-axis' );\n\t\t\tsetAttribute( containerRef.current, 'data-y-axis' );\n\t\t\tsetStyle( containerRef.current, 'top' );\n\t\t\tsetStyle( containerRef.current, 'left' );\n\t\t\tsetStyle( contentRef.current, 'maxHeight' );\n\t\t\tsetStyle( contentRef.current, 'maxWidth' );\n\t\t\treturn;\n\t\t}\n\n\t\tconst refresh = () => {\n\t\t\tif ( ! containerRef.current || ! contentRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet anchor = computeAnchorRect(\n\t\t\t\tanchorRefFallback,\n\t\t\t\tanchorRect,\n\t\t\t\tgetAnchorRect,\n\t\t\t\tanchorRef,\n\t\t\t\tshouldAnchorIncludePadding,\n\t\t\t\tcontainerRef.current\n\t\t\t);\n\n\t\t\tif ( ! anchor ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { offsetParent, ownerDocument } = containerRef.current;\n\n\t\t\tlet relativeOffsetTop = 0;\n\n\t\t\t// If there is a positioned ancestor element that is not the body,\n\t\t\t// subtract the position from the anchor rect. If the position of\n\t\t\t// the popover is fixed, the offset parent is null or the body\n\t\t\t// element, in which case the position is relative to the viewport.\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n\t\t\tif ( offsetParent && offsetParent !== ownerDocument.body ) {\n\t\t\t\tconst offsetParentRect = offsetParent.getBoundingClientRect();\n\n\t\t\t\trelativeOffsetTop = offsetParentRect.top;\n\t\t\t\tanchor = new window.DOMRect(\n\t\t\t\t\tanchor.left - offsetParentRect.left,\n\t\t\t\t\tanchor.top - offsetParentRect.top,\n\t\t\t\t\tanchor.width,\n\t\t\t\t\tanchor.height\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet boundaryElement;\n\t\t\tif ( __unstableBoundaryParent ) {\n\t\t\t\tboundaryElement = containerRef.current.parentElement;\n\t\t\t}\n\n\t\t\tconst usedContentSize = ! contentSize.height\n\t\t\t\t? contentRef.current.getBoundingClientRect()\n\t\t\t\t: contentSize;\n\n\t\t\tconst {\n\t\t\t\tpopoverTop,\n\t\t\t\tpopoverLeft,\n\t\t\t\txAxis,\n\t\t\t\tyAxis,\n\t\t\t\tcontentHeight,\n\t\t\t\tcontentWidth,\n\t\t\t} = computePopoverPosition(\n\t\t\t\tanchor,\n\t\t\t\tusedContentSize,\n\t\t\t\tposition,\n\t\t\t\t__unstableStickyBoundaryElement,\n\t\t\t\tcontainerRef.current,\n\t\t\t\trelativeOffsetTop,\n\t\t\t\tboundaryElement,\n\t\t\t\t__unstableForcePosition,\n\t\t\t\t__unstableForceXAlignment,\n\t\t\t\t__unstableEditorCanvasWrapper\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\ttypeof popoverTop === 'number' &&\n\t\t\t\ttypeof popoverLeft === 'number'\n\t\t\t) {\n\t\t\t\tsetStyle( containerRef.current, 'top', popoverTop + 'px' );\n\t\t\t\tsetStyle( containerRef.current, 'left', popoverLeft + 'px' );\n\t\t\t}\n\n\t\t\tsetClass(\n\t\t\t\tcontainerRef.current,\n\t\t\t\t'is-without-arrow',\n\t\t\t\tnoArrow || ( xAxis === 'center' && yAxis === 'middle' )\n\t\t\t);\n\t\t\tsetClass( containerRef.current, 'is-alternate', isAlternate );\n\t\t\tsetAttribute( containerRef.current, 'data-x-axis', xAxis );\n\t\t\tsetAttribute( containerRef.current, 'data-y-axis', yAxis );\n\t\t\tsetStyle(\n\t\t\t\tcontentRef.current,\n\t\t\t\t'maxHeight',\n\t\t\t\ttypeof contentHeight === 'number' ? contentHeight + 'px' : ''\n\t\t\t);\n\t\t\tsetStyle(\n\t\t\t\tcontentRef.current,\n\t\t\t\t'maxWidth',\n\t\t\t\ttypeof contentWidth === 'number' ? contentWidth + 'px' : ''\n\t\t\t);\n\n\t\t\t// Compute the animation position.\n\t\t\tconst yAxisMapping = {\n\t\t\t\ttop: 'bottom',\n\t\t\t\tbottom: 'top',\n\t\t\t};\n\t\t\tconst xAxisMapping = {\n\t\t\t\tleft: 'right',\n\t\t\t\tright: 'left',\n\t\t\t};\n\t\t\tconst animateYAxis = yAxisMapping[ yAxis ] || 'middle';\n\t\t\tconst animateXAxis = xAxisMapping[ xAxis ] || 'center';\n\n\t\t\tsetAnimateOrigin( animateXAxis + ' ' + animateYAxis );\n\t\t};\n\n\t\trefresh();\n\n\t\tconst { ownerDocument } = containerRef.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t/*\n\t\t * There are sometimes we need to reposition or resize the popover that\n\t\t * are not handled by the resize/scroll window events (i.e. CSS changes\n\t\t * in the layout that changes the position of the anchor).\n\t\t *\n\t\t * For these situations, we refresh the popover every 0.5s\n\t\t */\n\t\tconst intervalHandle = defaultView.setInterval( refresh, 500 );\n\n\t\tlet rafId;\n\n\t\tconst refreshOnAnimationFrame = () => {\n\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\t\t\trafId = defaultView.requestAnimationFrame( refresh );\n\t\t};\n\n\t\t// Sometimes a click trigger a layout change that affects the popover\n\t\t// position. This is an opportunity to immediately refresh rather than\n\t\t// at the interval.\n\t\tdefaultView.addEventListener( 'click', refreshOnAnimationFrame );\n\t\tdefaultView.addEventListener( 'resize', refresh );\n\t\tdefaultView.addEventListener( 'scroll', refresh, true );\n\n\t\tconst anchorDocument = getAnchorDocument( anchorRef );\n\n\t\t// If the anchor is within an iframe, the popover position also needs\n\t\t// to refrest when the iframe content is scrolled or resized.\n\t\tif ( anchorDocument && anchorDocument !== ownerDocument ) {\n\t\t\tanchorDocument.defaultView.addEventListener( 'resize', refresh );\n\t\t\tanchorDocument.defaultView.addEventListener(\n\t\t\t\t'scroll',\n\t\t\t\trefresh,\n\t\t\t\ttrue\n\t\t\t);\n\t\t}\n\n\t\tlet observer;\n\n\t\tif ( __unstableObserveElement ) {\n\t\t\tobserver = new defaultView.MutationObserver( refresh );\n\t\t\tobserver.observe( __unstableObserveElement, { attributes: true } );\n\t\t}\n\n\t\treturn () => {\n\t\t\tdefaultView.clearInterval( intervalHandle );\n\t\t\tdefaultView.removeEventListener( 'resize', refresh );\n\t\t\tdefaultView.removeEventListener( 'scroll', refresh, true );\n\t\t\tdefaultView.removeEventListener( 'click', refreshOnAnimationFrame );\n\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\n\t\t\tif ( anchorDocument && anchorDocument !== ownerDocument ) {\n\t\t\t\tanchorDocument.defaultView?.removeEventListener(\n\t\t\t\t\t'resize',\n\t\t\t\t\trefresh\n\t\t\t\t);\n\t\t\t\tanchorDocument.defaultView?.removeEventListener(\n\t\t\t\t\t'scroll',\n\t\t\t\t\trefresh,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( observer ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t};\n\t}, [\n\t\tisExpanded,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tanchorRef,\n\t\tshouldAnchorIncludePadding,\n\t\tposition,\n\t\tcontentSize,\n\t\t__unstableStickyBoundaryElement,\n\t\t__unstableObserveElement,\n\t\t__unstableBoundaryParent,\n\t] );\n\n\tconst onDialogClose = ( type, event ) => {\n\t\t// Ideally the popover should have just a single onClose prop and\n\t\t// not three props that potentially do the same thing.\n\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\tonFocusOutside( event );\n\t\t} else if ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t};\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst mergedRefs = useMergeRefs( [ containerRef, dialogRef, ref ] );\n\n\t/** @type {false | string} */\n\tconst animateClassName =\n\t\tBoolean( animate && animateOrigin ) &&\n\t\tgetAnimateClassName( {\n\t\t\ttype: 'appear',\n\t\t\torigin: animateOrigin,\n\t\t} );\n\n\t// Disable reason: We care to capture the _bubbled_ events from inputs\n\t// within popover as inferring close intent.\n\n\tlet content = (\n\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-popover',\n\t\t\t\tclassName,\n\t\t\t\tanimateClassName,\n\t\t\t\t{\n\t\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t\t'is-without-arrow': noArrow,\n\t\t\t\t\t'is-alternate': isAlternate,\n\t\t\t\t}\n\t\t\t) }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedRefs }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex=\"-1\"\n\t\t>\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div ref={ contentRef } className=\"components-popover__content\">\n\t\t\t\t<div style={ { position: 'relative' } }>\n\t\t\t\t\t{ containerResizeListener }\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\tif ( slot.ref ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t}\n\n\tif ( anchorRef || anchorRect ) {\n\t\treturn content;\n\t}\n\n\treturn <span ref={ anchorRefFallback }>{ content }</span>;\n};\n\nconst PopoverContainer = forwardRef( Popover );\n\nfunction PopoverSlot( { name = SLOT_NAME }, ref ) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\nPopoverContainer.Slot = forwardRef( PopoverSlot );\nPopoverContainer.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default PopoverContainer;\n"]}
@@ -19,7 +19,7 @@ var _i18n = require("@wordpress/i18n");
19
19
  /**
20
20
  * Module constants
21
21
  */
22
- const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
22
+ const HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space.
23
23
 
24
24
  /**
25
25
  * Utility used to compute the popover position over the xAxis
@@ -42,7 +42,7 @@ const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
42
42
  function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) {
43
43
  const {
44
44
  width
45
- } = contentSize; // Correct xAxis for RTL support
45
+ } = contentSize; // Correct xAxis for RTL support.
46
46
 
47
47
  if (xAxis === 'left' && (0, _i18n.isRTL)()) {
48
48
  xAxis = 'right';
@@ -54,7 +54,7 @@ function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sti
54
54
  corner = 'right';
55
55
  } else if (corner === 'right' && (0, _i18n.isRTL)()) {
56
56
  corner = 'left';
57
- } // x axis alignment choices
57
+ } // X axis alignment choices.
58
58
 
59
59
 
60
60
  const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
@@ -85,7 +85,7 @@ function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sti
85
85
  const rightAlignment = {
86
86
  popoverLeft: rightAlignmentX,
87
87
  contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
88
- }; // Choosing the x axis
88
+ }; // Choosing the x axis.
89
89
 
90
90
  let chosenXAxis = xAxis;
91
91
  let contentWidth = null;
@@ -196,7 +196,7 @@ function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sti
196
196
  popoverTop: Math.min(anchorRect.bottom, stickyPositionTop)
197
197
  };
198
198
  }
199
- } // y axis alignment choices
199
+ } // Y axis alignment choices.
200
200
 
201
201
 
202
202
  let anchorMidPoint = anchorRect.top + anchorRect.height / 2;
@@ -218,7 +218,7 @@ function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sti
218
218
  const bottomAlignment = {
219
219
  popoverTop: anchorRect.bottom,
220
220
  contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
221
- }; // Choosing the y axis
221
+ }; // Choosing the y axis.
222
222
 
223
223
  let chosenYAxis = yAxis;
224
224
  let contentHeight = null;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/popover/utils.js"],"names":["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":";;;;;;;;;;AAIA;;AAJA;;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,aAAa,GAAG,EAAtB,C,CAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,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,IAAoB,kBAAzB,EAAmC;AAClCA,IAA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CAChDC,UADgD,EAEhDC,WAFgD,EAGhDC,KAHgD,EAIhDC,MAJgD,EAKhDC,qBALgD,EAMhDkD,aAAa,CAACvB,KANkC,EAOhDzB,eAPgD,EAQhDC,aARgD,EAShDC,eATgD,CAAjD;AAYA,SAAO,EACN,GAAG+C,aADG;AAEN,OAAGD;AAFG,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,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":["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":";;;;;;;;;;AAIA;;AAJA;;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,aAAa,GAAG,EAAtB,C,CAA0B;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,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,IAAoB,kBAAzB,EAAmC;AAClCA,IAAAA,KAAK,GAAG,OAAR;AACA,GAFD,MAEO,IAAKA,KAAK,KAAK,OAAV,IAAqB,kBAA1B,EAAoC;AAC1CA,IAAAA,KAAK,GAAG,MAAR;AACA;;AAED,MAAKC,MAAM,KAAK,MAAX,IAAqB,kBAA1B,EAAoC;AACnCA,IAAAA,MAAM,GAAG,OAAT;AACA,GAFD,MAEO,IAAKA,MAAM,KAAK,OAAX,IAAsB,kBAA3B,EAAqC;AAC3CA,IA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,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"]}
@@ -43,7 +43,7 @@ function RadioGroup(_ref, ref) {
43
43
  });
44
44
  const radioContext = { ...radioState,
45
45
  disabled,
46
- // controlled or uncontrolled
46
+ // Controlled or uncontrolled.
47
47
  state: checked !== null && checked !== void 0 ? checked : radioState.state,
48
48
  setState: onChange !== null && onChange !== void 0 ? onChange : radioState.setState
49
49
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/radio-group/index.js"],"names":["RadioGroup","ref","label","checked","defaultChecked","disabled","onChange","props","radioState","state","baseId","id","radioContext","setState","ButtonGroup"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAUA;;AACA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,UAAT,OAECC,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,GAAG,0BAAe;AACjCC,IAAAA,KAAK,EAAEL,cAD0B;AAEjCM,IAAAA,MAAM,EAAEH,KAAK,CAACI;AAFmB,GAAf,CAAnB;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,4BAAC,qBAAD,CAAc,QAAd;AAAuB,IAAA,KAAK,EAAGD;AAA/B,KACC,4BAAC,iBAAD;AACC,IAAA,GAAG,EAAGX,GADP;AAEC,IAAA,EAAE,EAAGa,oBAFN;AAGC,kBAAaZ;AAHd,KAIMM,UAJN,EAKMD,KALN,EADD,CADD;AAWA;;eAEc,yBAAYP,UAAZ,C","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":["RadioGroup","ref","label","checked","defaultChecked","disabled","onChange","props","radioState","state","baseId","id","radioContext","setState","ButtonGroup"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAUA;;AACA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,UAAT,OAECC,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,GAAG,0BAAe;AACjCC,IAAAA,KAAK,EAAEL,cAD0B;AAEjCM,IAAAA,MAAM,EAAEH,KAAK,CAACI;AAFmB,GAAf,CAAnB;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,4BAAC,qBAAD,CAAc,QAAd;AAAuB,IAAA,KAAK,EAAGD;AAA/B,KACC,4BAAC,iBAAD;AACC,IAAA,GAAG,EAAGX,GADP;AAEC,IAAA,EAAE,EAAGa,oBAFN;AAGC,kBAAaZ;AAHd,KAIMM,UAJN,EAKMD,KALN,EADD,CADD;AAWA;;eAEc,yBAAYP,UAAZ,C","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"]}