@wordpress/components 28.6.0 → 28.8.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 (698) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/CONTRIBUTING.md +42 -19
  3. package/build/alignment-matrix-control/cell.js +4 -7
  4. package/build/alignment-matrix-control/cell.js.map +1 -1
  5. package/build/alignment-matrix-control/icon.js +31 -19
  6. package/build/alignment-matrix-control/icon.js.map +1 -1
  7. package/build/alignment-matrix-control/index.js +55 -51
  8. package/build/alignment-matrix-control/index.js.map +1 -1
  9. package/build/alignment-matrix-control/styles.js +73 -0
  10. package/build/alignment-matrix-control/styles.js.map +1 -0
  11. package/build/alignment-matrix-control/types.js.map +1 -1
  12. package/build/angle-picker-control/angle-circle.js +9 -9
  13. package/build/angle-picker-control/angle-circle.js.map +1 -1
  14. package/build/border-control/border-control/component.js +18 -13
  15. package/build/border-control/border-control/component.js.map +1 -1
  16. package/build/box-control/all-input-control.js +1 -2
  17. package/build/box-control/all-input-control.js.map +1 -1
  18. package/build/box-control/utils.js +1 -1
  19. package/build/box-control/utils.js.map +1 -1
  20. package/build/card/card/component.js +2 -2
  21. package/build/card/card/component.js.map +1 -1
  22. package/build/card/styles.js +18 -18
  23. package/build/card/styles.js.map +1 -1
  24. package/build/circular-option-picker/circular-option-picker-option.js +15 -9
  25. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  26. package/build/circular-option-picker/circular-option-picker.js +15 -12
  27. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  28. package/build/circular-option-picker/types.js.map +1 -1
  29. package/build/clipboard-button/index.js +6 -6
  30. package/build/clipboard-button/index.js.map +1 -1
  31. package/build/color-palette/utils.js +1 -2
  32. package/build/color-palette/utils.js.map +1 -1
  33. package/build/color-picker/color-copy-button.js +8 -8
  34. package/build/color-picker/color-copy-button.js.map +1 -1
  35. package/build/color-picker/hex-input.js +8 -8
  36. package/build/color-picker/hex-input.js.map +1 -1
  37. package/build/color-picker/input-with-slider.js +8 -8
  38. package/build/color-picker/input-with-slider.js.map +1 -1
  39. package/build/color-picker/styles.js +8 -8
  40. package/build/color-picker/styles.js.map +1 -1
  41. package/build/combobox-control/index.js +3 -1
  42. package/build/combobox-control/index.js.map +1 -1
  43. package/build/combobox-control/types.js.map +1 -1
  44. package/build/composite/context.js +1 -1
  45. package/build/composite/context.js.map +1 -1
  46. package/build/composite/group-label.js +33 -0
  47. package/build/composite/group-label.js.map +1 -0
  48. package/build/composite/group.js +33 -0
  49. package/build/composite/group.js.map +1 -0
  50. package/build/composite/hover.js +33 -0
  51. package/build/composite/hover.js.map +1 -0
  52. package/build/composite/index.js +63 -118
  53. package/build/composite/index.js.map +1 -1
  54. package/build/composite/item.js +33 -0
  55. package/build/composite/item.js.map +1 -0
  56. package/build/composite/legacy/index.js +59 -7
  57. package/build/composite/legacy/index.js.map +1 -1
  58. package/build/composite/row.js +33 -0
  59. package/build/composite/row.js.map +1 -0
  60. package/build/composite/typeahead.js +33 -0
  61. package/build/composite/typeahead.js.map +1 -0
  62. package/build/composite/types.js.map +1 -1
  63. package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  64. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  65. package/build/custom-select-control-v2/styles.js +12 -14
  66. package/build/custom-select-control-v2/styles.js.map +1 -1
  67. package/build/date-time/date/index.js +1 -1
  68. package/build/date-time/date/index.js.map +1 -1
  69. package/build/date-time/date/styles.js +37 -26
  70. package/build/date-time/date/styles.js.map +1 -1
  71. package/build/date-time/date/use-lilius/index.js +163 -0
  72. package/build/date-time/date/use-lilius/index.js.map +1 -0
  73. package/build/date-time/time/time-input/index.js +17 -19
  74. package/build/date-time/time/time-input/index.js.map +1 -1
  75. package/build/dimension-control/index.js +6 -1
  76. package/build/dimension-control/index.js.map +1 -1
  77. package/build/draggable/index.js +4 -4
  78. package/build/draggable/index.js.map +1 -1
  79. package/build/dropdown-menu-v2/checkbox-item.js +69 -0
  80. package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
  81. package/build/dropdown-menu-v2/context.js +17 -0
  82. package/build/dropdown-menu-v2/context.js.map +1 -0
  83. package/build/dropdown-menu-v2/group-label.js +40 -0
  84. package/build/dropdown-menu-v2/group-label.js.map +1 -0
  85. package/build/dropdown-menu-v2/group.js +29 -0
  86. package/build/dropdown-menu-v2/group.js.map +1 -0
  87. package/build/dropdown-menu-v2/index.js +58 -146
  88. package/build/dropdown-menu-v2/index.js.map +1 -1
  89. package/build/dropdown-menu-v2/item-help-text.js +27 -0
  90. package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
  91. package/build/dropdown-menu-v2/item-label.js +27 -0
  92. package/build/dropdown-menu-v2/item-label.js.map +1 -0
  93. package/build/dropdown-menu-v2/item.js +53 -0
  94. package/build/dropdown-menu-v2/item.js.map +1 -0
  95. package/build/dropdown-menu-v2/radio-item.js +79 -0
  96. package/build/dropdown-menu-v2/radio-item.js.map +1 -0
  97. package/build/dropdown-menu-v2/separator.js +30 -0
  98. package/build/dropdown-menu-v2/separator.js.map +1 -0
  99. package/build/dropdown-menu-v2/styles.js +55 -79
  100. package/build/dropdown-menu-v2/styles.js.map +1 -1
  101. package/build/dropdown-menu-v2/types.js.map +1 -1
  102. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
  103. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  104. package/build/focal-point-picker/styles/focal-point-style.js +7 -2
  105. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  106. package/build/form-token-field/types.js.map +1 -1
  107. package/build/index.js +13 -0
  108. package/build/index.js.map +1 -1
  109. package/build/input-control/index.js +2 -2
  110. package/build/input-control/index.js.map +1 -1
  111. package/build/input-control/input-base.js +5 -10
  112. package/build/input-control/input-base.js.map +1 -1
  113. package/build/input-control/input-prefix-wrapper.js +3 -3
  114. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  115. package/build/input-control/input-suffix-wrapper.js +2 -3
  116. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  117. package/build/input-control/reducer/reducer.js +8 -8
  118. package/build/input-control/reducer/reducer.js.map +1 -1
  119. package/build/input-control/styles/input-control-styles.js +75 -45
  120. package/build/input-control/styles/input-control-styles.js.map +1 -1
  121. package/build/input-control/types.js.map +1 -1
  122. package/build/input-control/utils.js +3 -3
  123. package/build/input-control/utils.js.map +1 -1
  124. package/build/item-group/styles.js +10 -10
  125. package/build/item-group/styles.js.map +1 -1
  126. package/build/modal/index.js +32 -17
  127. package/build/modal/index.js.map +1 -1
  128. package/build/modal/types.js.map +1 -1
  129. package/build/modal/use-modal-exit-animation.js +75 -0
  130. package/build/modal/use-modal-exit-animation.js.map +1 -0
  131. package/build/navigation/index.js +4 -4
  132. package/build/navigation/index.js.map +1 -1
  133. package/build/navigation/styles/navigation-styles.js +13 -13
  134. package/build/navigation/styles/navigation-styles.js.map +1 -1
  135. package/build/navigator/index.js +12 -13
  136. package/build/navigator/index.js.map +1 -1
  137. package/build/navigator/navigator-back-button/hook.js +2 -2
  138. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  139. package/build/navigator/navigator-button/hook.js +2 -2
  140. package/build/navigator/navigator-button/hook.js.map +1 -1
  141. package/build/navigator/navigator-provider/component.js +99 -67
  142. package/build/navigator/navigator-provider/component.js.map +1 -1
  143. package/build/navigator/navigator-screen/component.js +5 -0
  144. package/build/navigator/navigator-screen/component.js.map +1 -1
  145. package/build/navigator/navigator-to-parent-button/component.js +2 -2
  146. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  147. package/build/navigator/types.js.map +1 -1
  148. package/build/navigator/use-navigator.js +1 -2
  149. package/build/navigator/use-navigator.js.map +1 -1
  150. package/build/palette-edit/index.js +2 -2
  151. package/build/palette-edit/index.js.map +1 -1
  152. package/build/private-apis.js +1 -14
  153. package/build/private-apis.js.map +1 -1
  154. package/build/range-control/styles/range-control-styles.js +30 -30
  155. package/build/range-control/styles/range-control-styles.js.map +1 -1
  156. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  157. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  158. package/build/select-control/styles/select-control-styles.js +12 -12
  159. package/build/select-control/styles/select-control-styles.js.map +1 -1
  160. package/build/slot-fill/bubbles-virtually/fill.js +4 -4
  161. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  162. package/build/slot-fill/index.js +1 -0
  163. package/build/slot-fill/index.js.map +1 -1
  164. package/build/snackbar/index.js +4 -4
  165. package/build/snackbar/index.js.map +1 -1
  166. package/build/tabs/index.js +4 -4
  167. package/build/tabs/index.js.map +1 -1
  168. package/build/tabs/styles.js +3 -3
  169. package/build/tabs/styles.js.map +1 -1
  170. package/build/tabs/tablist.js +5 -4
  171. package/build/tabs/tablist.js.map +1 -1
  172. package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
  173. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  174. package/build/tools-panel/tools-panel/hook.js +6 -6
  175. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  176. package/build/unit-control/styles/unit-control-styles.js +7 -7
  177. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  178. package/build/utils/config-values.js +10 -9
  179. package/build/utils/config-values.js.map +1 -1
  180. package/build/utils/element-rect.js +73 -105
  181. package/build/utils/element-rect.js.map +1 -1
  182. package/build/utils/hooks/use-update-effect.js +4 -4
  183. package/build/utils/hooks/use-update-effect.js.map +1 -1
  184. package/build-module/alignment-matrix-control/cell.js +2 -5
  185. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  186. package/build-module/alignment-matrix-control/icon.js +31 -19
  187. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  188. package/build-module/alignment-matrix-control/index.js +55 -50
  189. package/build-module/alignment-matrix-control/index.js.map +1 -1
  190. package/build-module/alignment-matrix-control/styles.js +70 -0
  191. package/build-module/alignment-matrix-control/styles.js.map +1 -0
  192. package/build-module/alignment-matrix-control/types.js.map +1 -1
  193. package/build-module/angle-picker-control/angle-circle.js +9 -9
  194. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  195. package/build-module/border-control/border-control/component.js +18 -13
  196. package/build-module/border-control/border-control/component.js.map +1 -1
  197. package/build-module/box-control/all-input-control.js +2 -2
  198. package/build-module/box-control/all-input-control.js.map +1 -1
  199. package/build-module/box-control/utils.js +1 -1
  200. package/build-module/box-control/utils.js.map +1 -1
  201. package/build-module/card/card/component.js +2 -2
  202. package/build-module/card/card/component.js.map +1 -1
  203. package/build-module/card/styles.js +18 -18
  204. package/build-module/card/styles.js.map +1 -1
  205. package/build-module/circular-option-picker/circular-option-picker-option.js +16 -10
  206. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  207. package/build-module/circular-option-picker/circular-option-picker.js +16 -13
  208. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  209. package/build-module/circular-option-picker/types.js.map +1 -1
  210. package/build-module/clipboard-button/index.js +6 -6
  211. package/build-module/clipboard-button/index.js.map +1 -1
  212. package/build-module/color-palette/utils.js +1 -2
  213. package/build-module/color-palette/utils.js.map +1 -1
  214. package/build-module/color-picker/color-copy-button.js +8 -8
  215. package/build-module/color-picker/color-copy-button.js.map +1 -1
  216. package/build-module/color-picker/hex-input.js +7 -8
  217. package/build-module/color-picker/hex-input.js.map +1 -1
  218. package/build-module/color-picker/input-with-slider.js +7 -8
  219. package/build-module/color-picker/input-with-slider.js.map +1 -1
  220. package/build-module/color-picker/styles.js +8 -8
  221. package/build-module/color-picker/styles.js.map +1 -1
  222. package/build-module/combobox-control/index.js +3 -1
  223. package/build-module/combobox-control/index.js.map +1 -1
  224. package/build-module/combobox-control/types.js.map +1 -1
  225. package/build-module/composite/context.js +1 -1
  226. package/build-module/composite/context.js.map +1 -1
  227. package/build-module/composite/group-label.js +25 -0
  228. package/build-module/composite/group-label.js.map +1 -0
  229. package/build-module/composite/group.js +25 -0
  230. package/build-module/composite/group.js.map +1 -0
  231. package/build-module/composite/hover.js +25 -0
  232. package/build-module/composite/hover.js.map +1 -0
  233. package/build-module/composite/index.js +64 -118
  234. package/build-module/composite/index.js.map +1 -1
  235. package/build-module/composite/item.js +25 -0
  236. package/build-module/composite/item.js.map +1 -0
  237. package/build-module/composite/legacy/index.js +57 -8
  238. package/build-module/composite/legacy/index.js.map +1 -1
  239. package/build-module/composite/row.js +25 -0
  240. package/build-module/composite/row.js.map +1 -0
  241. package/build-module/composite/typeahead.js +25 -0
  242. package/build-module/composite/typeahead.js.map +1 -0
  243. package/build-module/composite/types.js.map +1 -1
  244. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  245. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  246. package/build-module/custom-select-control-v2/styles.js +12 -14
  247. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  248. package/build-module/date-time/date/index.js +1 -2
  249. package/build-module/date-time/date/index.js.map +1 -1
  250. package/build-module/date-time/date/styles.js +33 -26
  251. package/build-module/date-time/date/styles.js.map +1 -1
  252. package/build-module/date-time/date/use-lilius/index.js +158 -0
  253. package/build-module/date-time/date/use-lilius/index.js.map +1 -0
  254. package/build-module/date-time/time/time-input/index.js +17 -19
  255. package/build-module/date-time/time/time-input/index.js.map +1 -1
  256. package/build-module/dimension-control/index.js +6 -1
  257. package/build-module/dimension-control/index.js.map +1 -1
  258. package/build-module/draggable/index.js +4 -4
  259. package/build-module/draggable/index.js.map +1 -1
  260. package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
  261. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
  262. package/build-module/dropdown-menu-v2/context.js +11 -0
  263. package/build-module/dropdown-menu-v2/context.js.map +1 -0
  264. package/build-module/dropdown-menu-v2/group-label.js +32 -0
  265. package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
  266. package/build-module/dropdown-menu-v2/group.js +21 -0
  267. package/build-module/dropdown-menu-v2/group.js.map +1 -0
  268. package/build-module/dropdown-menu-v2/index.js +57 -144
  269. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  270. package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
  271. package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
  272. package/build-module/dropdown-menu-v2/item-label.js +19 -0
  273. package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
  274. package/build-module/dropdown-menu-v2/item.js +46 -0
  275. package/build-module/dropdown-menu-v2/item.js.map +1 -0
  276. package/build-module/dropdown-menu-v2/radio-item.js +72 -0
  277. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
  278. package/build-module/dropdown-menu-v2/separator.js +22 -0
  279. package/build-module/dropdown-menu-v2/separator.js.map +1 -0
  280. package/build-module/dropdown-menu-v2/styles.js +55 -79
  281. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  282. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  283. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
  284. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  285. package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
  286. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  287. package/build-module/form-token-field/types.js.map +1 -1
  288. package/build-module/index.js +3 -1
  289. package/build-module/index.js.map +1 -1
  290. package/build-module/input-control/index.js +2 -2
  291. package/build-module/input-control/index.js.map +1 -1
  292. package/build-module/input-control/input-base.js +6 -11
  293. package/build-module/input-control/input-base.js.map +1 -1
  294. package/build-module/input-control/input-prefix-wrapper.js +4 -3
  295. package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
  296. package/build-module/input-control/input-suffix-wrapper.js +3 -3
  297. package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
  298. package/build-module/input-control/reducer/reducer.js +8 -8
  299. package/build-module/input-control/reducer/reducer.js.map +1 -1
  300. package/build-module/input-control/styles/input-control-styles.js +74 -44
  301. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  302. package/build-module/input-control/types.js.map +1 -1
  303. package/build-module/input-control/utils.js +3 -3
  304. package/build-module/input-control/utils.js.map +1 -1
  305. package/build-module/item-group/styles.js +10 -10
  306. package/build-module/item-group/styles.js.map +1 -1
  307. package/build-module/modal/index.js +34 -17
  308. package/build-module/modal/index.js.map +1 -1
  309. package/build-module/modal/types.js.map +1 -1
  310. package/build-module/modal/use-modal-exit-animation.js +68 -0
  311. package/build-module/modal/use-modal-exit-animation.js.map +1 -0
  312. package/build-module/navigation/index.js +4 -4
  313. package/build-module/navigation/index.js.map +1 -1
  314. package/build-module/navigation/styles/navigation-styles.js +14 -14
  315. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  316. package/build-module/navigator/index.js +6 -6
  317. package/build-module/navigator/index.js.map +1 -1
  318. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  319. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  320. package/build-module/navigator/navigator-button/hook.js +1 -1
  321. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  322. package/build-module/navigator/navigator-provider/component.js +99 -67
  323. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  324. package/build-module/navigator/navigator-screen/component.js +4 -0
  325. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  326. package/build-module/navigator/navigator-to-parent-button/component.js +1 -1
  327. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  328. package/build-module/navigator/types.js.map +1 -1
  329. package/build-module/navigator/use-navigator.js +1 -2
  330. package/build-module/navigator/use-navigator.js.map +1 -1
  331. package/build-module/palette-edit/index.js +2 -2
  332. package/build-module/palette-edit/index.js.map +1 -1
  333. package/build-module/private-apis.js +1 -14
  334. package/build-module/private-apis.js.map +1 -1
  335. package/build-module/range-control/styles/range-control-styles.js +31 -31
  336. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  337. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  338. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  339. package/build-module/select-control/styles/select-control-styles.js +13 -13
  340. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  341. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
  342. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  343. package/build-module/slot-fill/index.js +1 -0
  344. package/build-module/slot-fill/index.js.map +1 -1
  345. package/build-module/snackbar/index.js +4 -4
  346. package/build-module/snackbar/index.js.map +1 -1
  347. package/build-module/tabs/index.js +4 -4
  348. package/build-module/tabs/index.js.map +1 -1
  349. package/build-module/tabs/styles.js +4 -4
  350. package/build-module/tabs/styles.js.map +1 -1
  351. package/build-module/tabs/tablist.js +5 -4
  352. package/build-module/tabs/tablist.js.map +1 -1
  353. package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
  354. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  355. package/build-module/tools-panel/tools-panel/hook.js +6 -6
  356. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  357. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  358. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  359. package/build-module/utils/config-values.js +10 -9
  360. package/build-module/utils/config-values.js.map +1 -1
  361. package/build-module/utils/element-rect.js +74 -105
  362. package/build-module/utils/element-rect.js.map +1 -1
  363. package/build-module/utils/hooks/use-update-effect.js +4 -4
  364. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  365. package/build-style/style-rtl.css +60 -31
  366. package/build-style/style.css +60 -31
  367. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  368. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  369. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  370. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  371. package/build-types/alignment-matrix-control/index.d.ts +16 -6
  372. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  373. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  374. package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
  375. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
  376. package/build-types/alignment-matrix-control/types.d.ts +12 -1
  377. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  378. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  379. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  380. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  381. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  382. package/build-types/box-control/utils.d.ts +1 -1
  383. package/build-types/box-control/utils.d.ts.map +1 -1
  384. package/build-types/button-group/stories/index.story.d.ts +2 -2
  385. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  386. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  387. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  388. package/build-types/circular-option-picker/types.d.ts +2 -2
  389. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  390. package/build-types/color-palette/utils.d.ts.map +1 -1
  391. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  392. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  393. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  394. package/build-types/color-picker/styles.d.ts.map +1 -1
  395. package/build-types/combobox-control/index.d.ts.map +1 -1
  396. package/build-types/combobox-control/stories/index.story.d.ts +4 -0
  397. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  398. package/build-types/combobox-control/types.d.ts +5 -0
  399. package/build-types/combobox-control/types.d.ts.map +1 -1
  400. package/build-types/composite/context.d.ts.map +1 -1
  401. package/build-types/composite/group-label.d.ts +3 -0
  402. package/build-types/composite/group-label.d.ts.map +1 -0
  403. package/build-types/composite/group.d.ts +3 -0
  404. package/build-types/composite/group.d.ts.map +1 -0
  405. package/build-types/composite/hover.d.ts +3 -0
  406. package/build-types/composite/hover.d.ts.map +1 -0
  407. package/build-types/composite/index.d.ts +63 -47
  408. package/build-types/composite/index.d.ts.map +1 -1
  409. package/build-types/composite/item.d.ts +3 -0
  410. package/build-types/composite/item.d.ts.map +1 -0
  411. package/build-types/composite/legacy/index.d.ts +23 -3
  412. package/build-types/composite/legacy/index.d.ts.map +1 -1
  413. package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
  414. package/build-types/composite/row.d.ts +3 -0
  415. package/build-types/composite/row.d.ts.map +1 -0
  416. package/build-types/composite/stories/index.story.d.ts +9 -8
  417. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  418. package/build-types/composite/typeahead.d.ts +3 -0
  419. package/build-types/composite/typeahead.d.ts.map +1 -0
  420. package/build-types/composite/types.d.ts +12 -11
  421. package/build-types/composite/types.d.ts.map +1 -1
  422. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  423. package/build-types/date-time/date/index.d.ts +0 -3
  424. package/build-types/date-time/date/index.d.ts.map +1 -1
  425. package/build-types/date-time/date/styles.d.ts.map +1 -1
  426. package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
  427. package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
  428. package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
  429. package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
  430. package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
  431. package/build-types/dimension-control/index.d.ts +1 -1
  432. package/build-types/dimension-control/index.d.ts.map +1 -1
  433. package/build-types/dimension-control/stories/index.story.d.ts +5 -0
  434. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  435. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
  436. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
  437. package/build-types/dropdown-menu-v2/context.d.ts +6 -0
  438. package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
  439. package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
  440. package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
  441. package/build-types/dropdown-menu-v2/group.d.ts +3 -0
  442. package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
  443. package/build-types/dropdown-menu-v2/index.d.ts +39 -18
  444. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  445. package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
  446. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
  447. package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
  448. package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
  449. package/build-types/dropdown-menu-v2/item.d.ts +3 -0
  450. package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
  451. package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
  452. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
  453. package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
  454. package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
  455. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
  456. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  457. package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
  458. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  459. package/build-types/dropdown-menu-v2/types.d.ts +6 -0
  460. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  461. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
  462. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
  463. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  464. package/build-types/form-token-field/types.d.ts +1 -0
  465. package/build-types/form-token-field/types.d.ts.map +1 -1
  466. package/build-types/index.d.ts +4 -1
  467. package/build-types/index.d.ts.map +1 -1
  468. package/build-types/input-control/input-base.d.ts.map +1 -1
  469. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
  470. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  471. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
  472. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  473. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  474. package/build-types/input-control/stories/index.story.d.ts +9 -0
  475. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  476. package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
  477. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  478. package/build-types/input-control/types.d.ts +23 -6
  479. package/build-types/input-control/types.d.ts.map +1 -1
  480. package/build-types/modal/index.d.ts.map +1 -1
  481. package/build-types/modal/stories/index.story.d.ts +3 -0
  482. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  483. package/build-types/modal/types.d.ts +6 -10
  484. package/build-types/modal/types.d.ts.map +1 -1
  485. package/build-types/modal/use-modal-exit-animation.d.ts +9 -0
  486. package/build-types/modal/use-modal-exit-animation.d.ts.map +1 -0
  487. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  488. package/build-types/navigator/index.d.ts +6 -6
  489. package/build-types/navigator/index.d.ts.map +1 -1
  490. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  491. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  492. package/build-types/navigator/stories/index.story.d.ts +1 -1
  493. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  494. package/build-types/navigator/types.d.ts +3 -1
  495. package/build-types/navigator/types.d.ts.map +1 -1
  496. package/build-types/navigator/use-navigator.d.ts +1 -2
  497. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  498. package/build-types/private-apis.d.ts.map +1 -1
  499. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  500. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  501. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  502. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  503. package/build-types/slot-fill/index.d.ts +3 -0
  504. package/build-types/slot-fill/index.d.ts.map +1 -1
  505. package/build-types/tabs/index.d.ts.map +1 -1
  506. package/build-types/tabs/styles.d.ts.map +1 -1
  507. package/build-types/tabs/tablist.d.ts.map +1 -1
  508. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  509. package/build-types/utils/config-values.d.ts +3 -4
  510. package/build-types/utils/element-rect.d.ts +32 -74
  511. package/build-types/utils/element-rect.d.ts.map +1 -1
  512. package/package.json +19 -20
  513. package/src/alignment-matrix-control/README.md +1 -5
  514. package/src/alignment-matrix-control/cell.tsx +3 -9
  515. package/src/alignment-matrix-control/icon.tsx +48 -30
  516. package/src/alignment-matrix-control/index.tsx +60 -50
  517. package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
  518. package/src/alignment-matrix-control/styles.ts +113 -0
  519. package/src/alignment-matrix-control/types.ts +12 -1
  520. package/src/angle-picker-control/angle-circle.tsx +11 -9
  521. package/src/border-control/border-control/component.tsx +23 -16
  522. package/src/box-control/README.md +7 -0
  523. package/src/box-control/all-input-control.tsx +2 -3
  524. package/src/box-control/utils.ts +1 -1
  525. package/src/button-group/stories/index.story.tsx +10 -15
  526. package/src/card/card/component.tsx +1 -1
  527. package/src/card/styles.ts +1 -1
  528. package/src/card/test/__snapshots__/index.tsx.snap +54 -54
  529. package/src/circular-option-picker/circular-option-picker-option.tsx +16 -19
  530. package/src/circular-option-picker/circular-option-picker.tsx +26 -12
  531. package/src/circular-option-picker/types.ts +2 -2
  532. package/src/clipboard-button/index.tsx +6 -6
  533. package/src/color-palette/test/utils.ts +21 -2
  534. package/src/color-palette/utils.ts +1 -3
  535. package/src/color-picker/color-copy-button.tsx +10 -8
  536. package/src/color-picker/hex-input.tsx +6 -10
  537. package/src/color-picker/input-with-slider.tsx +6 -10
  538. package/src/color-picker/styles.ts +1 -1
  539. package/src/combobox-control/README.md +7 -0
  540. package/src/combobox-control/index.tsx +2 -0
  541. package/src/combobox-control/test/index.tsx +40 -0
  542. package/src/combobox-control/types.ts +5 -0
  543. package/src/composite/README.md +5 -24
  544. package/src/composite/{context.ts → context.tsx} +1 -2
  545. package/src/composite/group-label.tsx +30 -0
  546. package/src/composite/group.tsx +30 -0
  547. package/src/composite/hover.tsx +30 -0
  548. package/src/composite/index.tsx +71 -166
  549. package/src/composite/item.tsx +30 -0
  550. package/src/composite/legacy/index.tsx +73 -11
  551. package/src/composite/legacy/stories/index.story.tsx +2 -1
  552. package/src/composite/legacy/test/index.tsx +57 -1
  553. package/src/composite/row.tsx +30 -0
  554. package/src/composite/stories/index.story.tsx +254 -365
  555. package/src/composite/typeahead.tsx +30 -0
  556. package/src/composite/types.ts +14 -16
  557. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
  558. package/src/custom-gradient-picker/style.scss +2 -21
  559. package/src/custom-select-control-v2/styles.ts +5 -4
  560. package/src/date-time/date/index.tsx +1 -1
  561. package/src/date-time/date/styles.ts +33 -13
  562. package/src/date-time/date/test/use-lilius.ts +417 -0
  563. package/src/date-time/date/use-lilius/index.ts +394 -0
  564. package/src/date-time/time/test/index.tsx +3 -6
  565. package/src/date-time/time/time-input/index.tsx +25 -25
  566. package/src/date-time/time/time-input/test/index.tsx +6 -7
  567. package/src/dimension-control/README.md +4 -0
  568. package/src/dimension-control/index.tsx +7 -1
  569. package/src/dimension-control/stories/index.story.tsx +7 -2
  570. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
  571. package/src/dimension-control/test/index.test.js +1 -0
  572. package/src/draggable/index.tsx +4 -4
  573. package/src/dropdown-menu-v2/README.md +73 -60
  574. package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
  575. package/src/dropdown-menu-v2/context.tsx +13 -0
  576. package/src/dropdown-menu-v2/group-label.tsx +37 -0
  577. package/src/dropdown-menu-v2/group.tsx +26 -0
  578. package/src/dropdown-menu-v2/index.tsx +57 -197
  579. package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
  580. package/src/dropdown-menu-v2/item-label.tsx +23 -0
  581. package/src/dropdown-menu-v2/item.tsx +50 -0
  582. package/src/dropdown-menu-v2/radio-item.tsx +70 -0
  583. package/src/dropdown-menu-v2/separator.tsx +27 -0
  584. package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
  585. package/src/dropdown-menu-v2/styles.ts +103 -67
  586. package/src/dropdown-menu-v2/test/index.tsx +159 -132
  587. package/src/dropdown-menu-v2/types.ts +7 -0
  588. package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
  589. package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
  590. package/src/form-toggle/style.scss +2 -1
  591. package/src/form-token-field/style.scss +2 -3
  592. package/src/form-token-field/types.ts +1 -0
  593. package/src/index.ts +6 -1
  594. package/src/input-control/index.tsx +2 -2
  595. package/src/input-control/input-base.tsx +4 -14
  596. package/src/input-control/input-prefix-wrapper.tsx +8 -4
  597. package/src/input-control/input-suffix-wrapper.tsx +4 -6
  598. package/src/input-control/reducer/reducer.ts +13 -10
  599. package/src/input-control/stories/index.story.tsx +31 -12
  600. package/src/input-control/styles/input-control-styles.tsx +42 -11
  601. package/src/input-control/types.ts +23 -7
  602. package/src/input-control/utils.ts +3 -3
  603. package/src/item-group/styles.ts +3 -3
  604. package/src/item-group/test/__snapshots__/index.js.snap +3 -3
  605. package/src/modal/index.tsx +47 -24
  606. package/src/modal/stories/index.story.tsx +8 -14
  607. package/src/modal/style.scss +34 -11
  608. package/src/modal/types.ts +6 -18
  609. package/src/modal/use-modal-exit-animation.ts +99 -0
  610. package/src/navigation/index.tsx +4 -4
  611. package/src/navigation/styles/navigation-styles.tsx +3 -3
  612. package/src/navigator/index.ts +6 -6
  613. package/src/navigator/navigator-back-button/hook.ts +1 -1
  614. package/src/navigator/navigator-button/hook.ts +1 -1
  615. package/src/navigator/navigator-provider/README.md +2 -3
  616. package/src/navigator/navigator-provider/component.tsx +97 -82
  617. package/src/navigator/navigator-screen/component.tsx +7 -0
  618. package/src/navigator/navigator-to-parent-button/component.tsx +1 -1
  619. package/src/navigator/stories/index.story.tsx +82 -253
  620. package/src/navigator/test/index.tsx +8 -0
  621. package/src/navigator/types.ts +3 -1
  622. package/src/navigator/use-navigator.ts +1 -3
  623. package/src/palette-edit/index.tsx +2 -2
  624. package/src/popover/style.scss +3 -2
  625. package/src/private-apis.ts +1 -23
  626. package/src/range-control/styles/range-control-styles.ts +8 -7
  627. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
  628. package/src/resizable-box/style.scss +3 -3
  629. package/src/select-control/README.md +2 -2
  630. package/src/select-control/styles/select-control-styles.ts +5 -5
  631. package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
  632. package/src/slot-fill/index.tsx +1 -0
  633. package/src/snackbar/index.tsx +4 -4
  634. package/src/snackbar/style.scss +1 -1
  635. package/src/tab-panel/style.scss +0 -1
  636. package/src/tabs/index.tsx +8 -4
  637. package/src/tabs/styles.ts +42 -14
  638. package/src/tabs/tablist.tsx +5 -4
  639. package/src/text-control/style.scss +3 -2
  640. package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
  641. package/src/tools-panel/tools-panel/hook.ts +6 -6
  642. package/src/tooltip/style.scss +1 -0
  643. package/src/unit-control/styles/unit-control-styles.ts +2 -1
  644. package/src/utils/config-values.js +10 -9
  645. package/src/utils/element-rect.ts +93 -130
  646. package/src/utils/hooks/use-update-effect.js +4 -4
  647. package/tsconfig.tsbuildinfo +1 -1
  648. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
  649. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  650. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -77
  651. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  652. package/build/navigator/navigator-back-button/index.js +0 -14
  653. package/build/navigator/navigator-back-button/index.js.map +0 -1
  654. package/build/navigator/navigator-button/index.js +0 -14
  655. package/build/navigator/navigator-button/index.js.map +0 -1
  656. package/build/navigator/navigator-provider/index.js +0 -14
  657. package/build/navigator/navigator-provider/index.js.map +0 -1
  658. package/build/navigator/navigator-screen/index.js +0 -14
  659. package/build/navigator/navigator-screen/index.js.map +0 -1
  660. package/build/navigator/navigator-to-parent-button/index.js +0 -14
  661. package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
  662. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
  663. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  664. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -72
  665. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  666. package/build-module/navigator/navigator-back-button/index.js +0 -2
  667. package/build-module/navigator/navigator-back-button/index.js.map +0 -1
  668. package/build-module/navigator/navigator-button/index.js +0 -2
  669. package/build-module/navigator/navigator-button/index.js.map +0 -1
  670. package/build-module/navigator/navigator-provider/index.js +0 -2
  671. package/build-module/navigator/navigator-provider/index.js.map +0 -1
  672. package/build-module/navigator/navigator-screen/index.js +0 -2
  673. package/build-module/navigator/navigator-screen/index.js.map +0 -1
  674. package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
  675. package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
  676. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
  677. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
  678. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
  679. package/build-types/composite/stories/utils.d.ts +0 -29
  680. package/build-types/composite/stories/utils.d.ts.map +0 -1
  681. package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
  682. package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
  683. package/build-types/navigator/navigator-button/index.d.ts +0 -2
  684. package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
  685. package/build-types/navigator/navigator-provider/index.d.ts +0 -2
  686. package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
  687. package/build-types/navigator/navigator-screen/index.d.ts +0 -2
  688. package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
  689. package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
  690. package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
  691. package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
  692. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
  693. package/src/composite/stories/utils.tsx +0 -76
  694. package/src/navigator/navigator-back-button/index.ts +0 -1
  695. package/src/navigator/navigator-button/index.ts +0 -1
  696. package/src/navigator/navigator-provider/index.ts +0 -1
  697. package/src/navigator/navigator-screen/index.ts +0 -1
  698. package/src/navigator/navigator-to-parent-button/index.ts +0 -1
@@ -2,98 +2,13 @@
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { useRef, useEffect, useState } from '@wordpress/element';
5
+ import { useLayoutEffect, useRef, useState } from '@wordpress/element';
6
+ import { useResizeObserver } from '@wordpress/compose';
6
7
  /**
7
8
  * Internal dependencies
8
9
  */
9
10
  import { useEvent } from './hooks/use-event';
10
11
 
11
- /**
12
- * `useTrackElementRectUpdates` options.
13
- */
14
-
15
- /**
16
- * Tracks an element's "rect" (size and position) and fires `onRect` for all
17
- * of its discrete values. The element can be changed dynamically and **it
18
- * must not be stored in a ref**. Instead, it should be stored in a React
19
- * state or equivalent.
20
- *
21
- * By default, `onRect` is called initially for the target element (including
22
- * when the target element changes), not only on size or position updates.
23
- * This allows consumers of the hook to always be in sync with all rect values
24
- * of the target element throughout its lifetime. This behavior can be
25
- * disabled by setting the `fireOnElementInit` option to `false`.
26
- *
27
- * Under the hood, it sets up a `ResizeObserver` that tracks the element. The
28
- * target element can be changed dynamically, and the observer will be
29
- * updated accordingly.
30
- *
31
- * @example
32
- *
33
- * ```tsx
34
- * const [ targetElement, setTargetElement ] = useState< HTMLElement | null >();
35
- *
36
- * useTrackElementRectUpdates( targetElement, ( element ) => {
37
- * console.log( 'Element resized:', element );
38
- * } );
39
- *
40
- * <div ref={ setTargetElement } />;
41
- * ```
42
- */
43
- export function useTrackElementRectUpdates(
44
- /**
45
- * The target element to observe. It can be changed dynamically.
46
- */
47
- targetElement,
48
- /**
49
- * Callback to fire when the element is resized. It will also be
50
- * called when the observer is set up, unless `fireOnElementInit` is
51
- * set to `false`.
52
- */
53
- onRect, {
54
- fireOnElementInit = true
55
- } = {}) {
56
- const onRectEvent = useEvent(onRect);
57
- const observedElementRef = useRef();
58
- const resizeObserverRef = useRef();
59
-
60
- // TODO: could this be a layout effect?
61
- useEffect(() => {
62
- if (targetElement === observedElementRef.current) {
63
- return;
64
- }
65
- observedElementRef.current = targetElement;
66
-
67
- // Set up a ResizeObserver.
68
- if (!resizeObserverRef.current) {
69
- resizeObserverRef.current = new ResizeObserver(entries => {
70
- if (observedElementRef.current) {
71
- onRectEvent(observedElementRef.current, entries);
72
- }
73
- });
74
- }
75
- const {
76
- current: resizeObserver
77
- } = resizeObserverRef;
78
-
79
- // Observe new element.
80
- if (targetElement) {
81
- if (fireOnElementInit) {
82
- // TODO: investigate if this can be removed,
83
- // see: https://stackoverflow.com/a/60026394
84
- onRectEvent(targetElement);
85
- }
86
- resizeObserver.observe(targetElement);
87
- }
88
- return () => {
89
- // Unobserve previous element.
90
- if (observedElementRef.current) {
91
- resizeObserver.unobserve(observedElementRef.current);
92
- }
93
- };
94
- }, [fireOnElementInit, onRectEvent, targetElement]);
95
- }
96
-
97
12
  /**
98
13
  * The position and dimensions of an element, relative to its offset parent.
99
14
  */
@@ -102,44 +17,98 @@ onRect, {
102
17
  * An `ElementOffsetRect` object with all values set to zero.
103
18
  */
104
19
  export const NULL_ELEMENT_OFFSET_RECT = {
105
- left: 0,
106
20
  top: 0,
21
+ right: 0,
22
+ bottom: 0,
23
+ left: 0,
107
24
  width: 0,
108
25
  height: 0
109
26
  };
110
27
 
111
28
  /**
112
29
  * Returns the position and dimensions of an element, relative to its offset
113
- * parent. This is useful in contexts where `getBoundingClientRect` is not
114
- * suitable, such as when the element is transformed.
30
+ * parent, with subpixel precision. Values reflect the real measures before any
31
+ * potential scaling distortions along the X and Y axes.
115
32
  *
116
- * **Note:** the `left` and `right` values are adjusted due to a limitation
117
- * in the way the browser calculates the offset position of the element,
118
- * which can cause unwanted scrollbars to appear. This adjustment makes the
119
- * values potentially inaccurate within a range of 1 pixel.
33
+ * Useful in contexts where plain `getBoundingClientRect` calls or `ResizeObserver`
34
+ * entries are not suitable, such as when the element is transformed, and when
35
+ * `element.offset<Top|Left|Width|Height>` methods are not precise enough.
36
+ *
37
+ * **Note:** in some contexts, like when the scale is 0, this method will fail
38
+ * because it's impossible to calculate a scaling ratio. When that happens, it
39
+ * will return `undefined`.
120
40
  */
121
41
  export function getElementOffsetRect(element) {
42
+ var _element$offsetParent;
43
+ // Position and dimension values computed with `getBoundingClientRect` have
44
+ // subpixel precision, but are affected by distortions since they represent
45
+ // the "real" measures, or in other words, the actual final values as rendered
46
+ // by the browser.
47
+ const rect = element.getBoundingClientRect();
48
+ if (rect.width === 0 || rect.height === 0) {
49
+ return;
50
+ }
51
+ const offsetParentRect = (_element$offsetParent = element.offsetParent?.getBoundingClientRect()) !== null && _element$offsetParent !== void 0 ? _element$offsetParent : NULL_ELEMENT_OFFSET_RECT;
52
+
53
+ // Computed widths and heights have subpixel precision, and are not affected
54
+ // by distortions.
55
+ const computedWidth = parseFloat(getComputedStyle(element).width);
56
+ const computedHeight = parseFloat(getComputedStyle(element).height);
57
+
58
+ // We can obtain the current scale factor for the element by comparing "computed"
59
+ // dimensions with the "real" ones.
60
+ const scaleX = computedWidth / rect.width;
61
+ const scaleY = computedHeight / rect.height;
122
62
  return {
123
- // The adjustments mentioned in the documentation above are necessary
124
- // because `offsetLeft` and `offsetTop` are rounded to the nearest pixel,
125
- // which can result in a position mismatch that causes unwanted overflow.
126
- // For context, see: https://github.com/WordPress/gutenberg/pull/61979
127
- left: Math.max(element.offsetLeft - 1, 0),
128
- top: Math.max(element.offsetTop - 1, 0),
129
- // This is a workaround to obtain these values with a sub-pixel precision,
130
- // since `offsetWidth` and `offsetHeight` are rounded to the nearest pixel.
131
- width: parseFloat(getComputedStyle(element).width),
132
- height: parseFloat(getComputedStyle(element).height)
63
+ // To obtain the adjusted values for the position:
64
+ // 1. Compute the element's position relative to the offset parent.
65
+ // 2. Correct for the scale factor.
66
+ top: (rect.top - offsetParentRect?.top) * scaleY,
67
+ right: (offsetParentRect?.right - rect.right) * scaleX,
68
+ bottom: (offsetParentRect?.bottom - rect.bottom) * scaleY,
69
+ left: (rect.left - offsetParentRect?.left) * scaleX,
70
+ // Computed dimensions don't need any adjustments.
71
+ width: computedWidth,
72
+ height: computedHeight
133
73
  };
134
74
  }
75
+ const POLL_RATE = 100;
135
76
 
136
77
  /**
137
78
  * Tracks the position and dimensions of an element, relative to its offset
138
79
  * parent. The element can be changed dynamically.
80
+ *
81
+ * **Note:** sometimes, the measurement will fail (see `getElementOffsetRect`'s
82
+ * documentation for more details). When that happens, this hook will attempt
83
+ * to measure again after a frame, and if that fails, it will poll every 100
84
+ * milliseconds until it succeeds.
139
85
  */
140
86
  export function useTrackElementOffsetRect(targetElement) {
141
87
  const [indicatorPosition, setIndicatorPosition] = useState(NULL_ELEMENT_OFFSET_RECT);
142
- useTrackElementRectUpdates(targetElement, element => setIndicatorPosition(getElementOffsetRect(element)));
88
+ const intervalRef = useRef();
89
+ const measure = useEvent(() => {
90
+ if (targetElement) {
91
+ const elementOffsetRect = getElementOffsetRect(targetElement);
92
+ if (elementOffsetRect) {
93
+ setIndicatorPosition(elementOffsetRect);
94
+ clearInterval(intervalRef.current);
95
+ return true;
96
+ }
97
+ } else {
98
+ clearInterval(intervalRef.current);
99
+ }
100
+ return false;
101
+ });
102
+ const setElement = useResizeObserver(() => {
103
+ if (!measure()) {
104
+ requestAnimationFrame(() => {
105
+ if (!measure()) {
106
+ intervalRef.current = setInterval(measure, POLL_RATE);
107
+ }
108
+ });
109
+ }
110
+ });
111
+ useLayoutEffect(() => setElement(targetElement), [setElement, targetElement]);
143
112
  return indicatorPosition;
144
113
  }
145
114
 
@@ -1 +1 @@
1
- {"version":3,"names":["useRef","useEffect","useState","useEvent","useTrackElementRectUpdates","targetElement","onRect","fireOnElementInit","onRectEvent","observedElementRef","resizeObserverRef","current","ResizeObserver","entries","resizeObserver","observe","unobserve","NULL_ELEMENT_OFFSET_RECT","left","top","width","height","getElementOffsetRect","element","Math","max","offsetLeft","offsetTop","parseFloat","getComputedStyle","useTrackElementOffsetRect","indicatorPosition","setIndicatorPosition"],"sources":["@wordpress/components/src/utils/element-rect.ts"],"sourcesContent":["/* eslint-disable jsdoc/require-param */\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect, useState } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport { useEvent } from './hooks/use-event';\n\n/**\n * `useTrackElementRectUpdates` options.\n */\nexport type UseTrackElementRectUpdatesOptions = {\n\t/**\n\t * Whether to trigger the callback when an element's ResizeObserver is\n\t * first set up, including when the target element changes.\n\t *\n\t * @default true\n\t */\n\tfireOnElementInit?: boolean;\n};\n\n/**\n * Tracks an element's \"rect\" (size and position) and fires `onRect` for all\n * of its discrete values. The element can be changed dynamically and **it\n * must not be stored in a ref**. Instead, it should be stored in a React\n * state or equivalent.\n *\n * By default, `onRect` is called initially for the target element (including\n * when the target element changes), not only on size or position updates.\n * This allows consumers of the hook to always be in sync with all rect values\n * of the target element throughout its lifetime. This behavior can be\n * disabled by setting the `fireOnElementInit` option to `false`.\n *\n * Under the hood, it sets up a `ResizeObserver` that tracks the element. The\n * target element can be changed dynamically, and the observer will be\n * updated accordingly.\n *\n * @example\n *\n * ```tsx\n * const [ targetElement, setTargetElement ] = useState< HTMLElement | null >();\n *\n * useTrackElementRectUpdates( targetElement, ( element ) => {\n * console.log( 'Element resized:', element );\n * } );\n *\n * <div ref={ setTargetElement } />;\n * ```\n */\nexport function useTrackElementRectUpdates(\n\t/**\n\t * The target element to observe. It can be changed dynamically.\n\t */\n\ttargetElement: HTMLElement | undefined | null,\n\t/**\n\t * Callback to fire when the element is resized. It will also be\n\t * called when the observer is set up, unless `fireOnElementInit` is\n\t * set to `false`.\n\t */\n\tonRect: (\n\t\t/**\n\t\t * The element being tracked at the time of this update.\n\t\t */\n\t\telement: HTMLElement,\n\t\t/**\n\t\t * The list of\n\t\t * [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)\n\t\t * objects passed to the `ResizeObserver.observe` callback. This list\n\t\t * won't be available when the observer is set up, and only on updates.\n\t\t */\n\t\tresizeObserverEntries?: ResizeObserverEntry[]\n\t) => void,\n\t{ fireOnElementInit = true }: UseTrackElementRectUpdatesOptions = {}\n) {\n\tconst onRectEvent = useEvent( onRect );\n\n\tconst observedElementRef = useRef< HTMLElement | null >();\n\tconst resizeObserverRef = useRef< ResizeObserver >();\n\n\t// TODO: could this be a layout effect?\n\tuseEffect( () => {\n\t\tif ( targetElement === observedElementRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tobservedElementRef.current = targetElement;\n\n\t\t// Set up a ResizeObserver.\n\t\tif ( ! resizeObserverRef.current ) {\n\t\t\tresizeObserverRef.current = new ResizeObserver( ( entries ) => {\n\t\t\t\tif ( observedElementRef.current ) {\n\t\t\t\t\tonRectEvent( observedElementRef.current, entries );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tconst { current: resizeObserver } = resizeObserverRef;\n\n\t\t// Observe new element.\n\t\tif ( targetElement ) {\n\t\t\tif ( fireOnElementInit ) {\n\t\t\t\t// TODO: investigate if this can be removed,\n\t\t\t\t// see: https://stackoverflow.com/a/60026394\n\t\t\t\tonRectEvent( targetElement );\n\t\t\t}\n\t\t\tresizeObserver.observe( targetElement );\n\t\t}\n\n\t\treturn () => {\n\t\t\t// Unobserve previous element.\n\t\t\tif ( observedElementRef.current ) {\n\t\t\t\tresizeObserver.unobserve( observedElementRef.current );\n\t\t\t}\n\t\t};\n\t}, [ fireOnElementInit, onRectEvent, targetElement ] );\n}\n\n/**\n * The position and dimensions of an element, relative to its offset parent.\n */\nexport type ElementOffsetRect = {\n\t/**\n\t * The distance from the left edge of the offset parent to the left edge of\n\t * the element.\n\t */\n\tleft: number;\n\t/**\n\t * The distance from the top edge of the offset parent to the top edge of\n\t * the element.\n\t */\n\ttop: number;\n\t/**\n\t * The width of the element.\n\t */\n\twidth: number;\n\t/**\n\t * The height of the element.\n\t */\n\theight: number;\n};\n\n/**\n * An `ElementOffsetRect` object with all values set to zero.\n */\nexport const NULL_ELEMENT_OFFSET_RECT = {\n\tleft: 0,\n\ttop: 0,\n\twidth: 0,\n\theight: 0,\n} satisfies ElementOffsetRect;\n\n/**\n * Returns the position and dimensions of an element, relative to its offset\n * parent. This is useful in contexts where `getBoundingClientRect` is not\n * suitable, such as when the element is transformed.\n *\n * **Note:** the `left` and `right` values are adjusted due to a limitation\n * in the way the browser calculates the offset position of the element,\n * which can cause unwanted scrollbars to appear. This adjustment makes the\n * values potentially inaccurate within a range of 1 pixel.\n */\nexport function getElementOffsetRect(\n\telement: HTMLElement\n): ElementOffsetRect {\n\treturn {\n\t\t// The adjustments mentioned in the documentation above are necessary\n\t\t// because `offsetLeft` and `offsetTop` are rounded to the nearest pixel,\n\t\t// which can result in a position mismatch that causes unwanted overflow.\n\t\t// For context, see: https://github.com/WordPress/gutenberg/pull/61979\n\t\tleft: Math.max( element.offsetLeft - 1, 0 ),\n\t\ttop: Math.max( element.offsetTop - 1, 0 ),\n\t\t// This is a workaround to obtain these values with a sub-pixel precision,\n\t\t// since `offsetWidth` and `offsetHeight` are rounded to the nearest pixel.\n\t\twidth: parseFloat( getComputedStyle( element ).width ),\n\t\theight: parseFloat( getComputedStyle( element ).height ),\n\t};\n}\n\n/**\n * Tracks the position and dimensions of an element, relative to its offset\n * parent. The element can be changed dynamically.\n */\nexport function useTrackElementOffsetRect(\n\ttargetElement: HTMLElement | undefined | null\n) {\n\tconst [ indicatorPosition, setIndicatorPosition ] =\n\t\tuseState< ElementOffsetRect >( NULL_ELEMENT_OFFSET_RECT );\n\n\tuseTrackElementRectUpdates( targetElement, ( element ) =>\n\t\tsetIndicatorPosition( getElementOffsetRect( element ) )\n\t);\n\n\treturn indicatorPosition;\n}\n\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["useLayoutEffect","useRef","useState","useResizeObserver","useEvent","NULL_ELEMENT_OFFSET_RECT","top","right","bottom","left","width","height","getElementOffsetRect","element","_element$offsetParent","rect","getBoundingClientRect","offsetParentRect","offsetParent","computedWidth","parseFloat","getComputedStyle","computedHeight","scaleX","scaleY","POLL_RATE","useTrackElementOffsetRect","targetElement","indicatorPosition","setIndicatorPosition","intervalRef","measure","elementOffsetRect","clearInterval","current","setElement","requestAnimationFrame","setInterval"],"sources":["@wordpress/components/src/utils/element-rect.ts"],"sourcesContent":["/* eslint-disable jsdoc/require-param */\n/**\n * WordPress dependencies\n */\nimport { useLayoutEffect, useRef, useState } from '@wordpress/element';\nimport { useResizeObserver } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport { useEvent } from './hooks/use-event';\n\n/**\n * The position and dimensions of an element, relative to its offset parent.\n */\nexport type ElementOffsetRect = {\n\t/**\n\t * The distance from the top edge of the offset parent to the top edge of\n\t * the element.\n\t */\n\ttop: number;\n\t/**\n\t * The distance from the right edge of the offset parent to the right edge\n\t * of the element.\n\t */\n\tright: number;\n\t/**\n\t * The distance from the bottom edge of the offset parent to the bottom edge\n\t * of the element.\n\t */\n\tbottom: number;\n\t/**\n\t * The distance from the left edge of the offset parent to the left edge of\n\t * the element.\n\t */\n\tleft: number;\n\t/**\n\t * The width of the element.\n\t */\n\twidth: number;\n\t/**\n\t * The height of the element.\n\t */\n\theight: number;\n};\n\n/**\n * An `ElementOffsetRect` object with all values set to zero.\n */\nexport const NULL_ELEMENT_OFFSET_RECT = {\n\ttop: 0,\n\tright: 0,\n\tbottom: 0,\n\tleft: 0,\n\twidth: 0,\n\theight: 0,\n} satisfies ElementOffsetRect;\n\n/**\n * Returns the position and dimensions of an element, relative to its offset\n * parent, with subpixel precision. Values reflect the real measures before any\n * potential scaling distortions along the X and Y axes.\n *\n * Useful in contexts where plain `getBoundingClientRect` calls or `ResizeObserver`\n * entries are not suitable, such as when the element is transformed, and when\n * `element.offset<Top|Left|Width|Height>` methods are not precise enough.\n *\n * **Note:** in some contexts, like when the scale is 0, this method will fail\n * because it's impossible to calculate a scaling ratio. When that happens, it\n * will return `undefined`.\n */\nexport function getElementOffsetRect(\n\telement: HTMLElement\n): ElementOffsetRect | undefined {\n\t// Position and dimension values computed with `getBoundingClientRect` have\n\t// subpixel precision, but are affected by distortions since they represent\n\t// the \"real\" measures, or in other words, the actual final values as rendered\n\t// by the browser.\n\tconst rect = element.getBoundingClientRect();\n\tif ( rect.width === 0 || rect.height === 0 ) {\n\t\treturn;\n\t}\n\tconst offsetParentRect =\n\t\telement.offsetParent?.getBoundingClientRect() ??\n\t\tNULL_ELEMENT_OFFSET_RECT;\n\n\t// Computed widths and heights have subpixel precision, and are not affected\n\t// by distortions.\n\tconst computedWidth = parseFloat( getComputedStyle( element ).width );\n\tconst computedHeight = parseFloat( getComputedStyle( element ).height );\n\n\t// We can obtain the current scale factor for the element by comparing \"computed\"\n\t// dimensions with the \"real\" ones.\n\tconst scaleX = computedWidth / rect.width;\n\tconst scaleY = computedHeight / rect.height;\n\n\treturn {\n\t\t// To obtain the adjusted values for the position:\n\t\t// 1. Compute the element's position relative to the offset parent.\n\t\t// 2. Correct for the scale factor.\n\t\ttop: ( rect.top - offsetParentRect?.top ) * scaleY,\n\t\tright: ( offsetParentRect?.right - rect.right ) * scaleX,\n\t\tbottom: ( offsetParentRect?.bottom - rect.bottom ) * scaleY,\n\t\tleft: ( rect.left - offsetParentRect?.left ) * scaleX,\n\t\t// Computed dimensions don't need any adjustments.\n\t\twidth: computedWidth,\n\t\theight: computedHeight,\n\t};\n}\n\nconst POLL_RATE = 100;\n\n/**\n * Tracks the position and dimensions of an element, relative to its offset\n * parent. The element can be changed dynamically.\n *\n * **Note:** sometimes, the measurement will fail (see `getElementOffsetRect`'s\n * documentation for more details). When that happens, this hook will attempt\n * to measure again after a frame, and if that fails, it will poll every 100\n * milliseconds until it succeeds.\n */\nexport function useTrackElementOffsetRect(\n\ttargetElement: HTMLElement | undefined | null\n) {\n\tconst [ indicatorPosition, setIndicatorPosition ] =\n\t\tuseState< ElementOffsetRect >( NULL_ELEMENT_OFFSET_RECT );\n\tconst intervalRef = useRef< ReturnType< typeof setInterval > >();\n\n\tconst measure = useEvent( () => {\n\t\tif ( targetElement ) {\n\t\t\tconst elementOffsetRect = getElementOffsetRect( targetElement );\n\t\t\tif ( elementOffsetRect ) {\n\t\t\t\tsetIndicatorPosition( elementOffsetRect );\n\t\t\t\tclearInterval( intervalRef.current );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\tclearInterval( intervalRef.current );\n\t\t}\n\t\treturn false;\n\t} );\n\n\tconst setElement = useResizeObserver( () => {\n\t\tif ( ! measure() ) {\n\t\t\trequestAnimationFrame( () => {\n\t\t\t\tif ( ! measure() ) {\n\t\t\t\t\tintervalRef.current = setInterval( measure, POLL_RATE );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\n\tuseLayoutEffect(\n\t\t() => setElement( targetElement ),\n\t\t[ setElement, targetElement ]\n\t);\n\n\treturn indicatorPosition;\n}\n\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"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","ignoreList":[]}
@@ -12,12 +12,12 @@ import { useRef, useEffect } from '@wordpress/element';
12
12
  * @param {import('react').DependencyList} deps
13
13
  */
14
14
  function useUpdateEffect(effect, deps) {
15
- const mounted = useRef(false);
15
+ const mountedRef = useRef(false);
16
16
  useEffect(() => {
17
- if (mounted.current) {
17
+ if (mountedRef.current) {
18
18
  return effect();
19
19
  }
20
- mounted.current = true;
20
+ mountedRef.current = true;
21
21
  return undefined;
22
22
  // Disable reasons:
23
23
  // 1. This hook needs to pass a dep list that isn't an array literal
@@ -26,7 +26,7 @@ function useUpdateEffect(effect, deps) {
26
26
  // eslint-disable-next-line react-hooks/exhaustive-deps
27
27
  }, deps);
28
28
  useEffect(() => () => {
29
- mounted.current = false;
29
+ mountedRef.current = false;
30
30
  }, []);
31
31
  }
32
32
  export default useUpdateEffect;
@@ -1 +1 @@
1
- {"version":3,"names":["useRef","useEffect","useUpdateEffect","effect","deps","mounted","current","undefined"],"sources":["@wordpress/components/src/utils/hooks/use-update-effect.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\n\n/**\n * A `React.useEffect` that will not run on the first render.\n * Source:\n * https://github.com/ariakit/ariakit/blob/main/packages/ariakit-react-core/src/utils/hooks.ts\n *\n * @param {import('react').EffectCallback} effect\n * @param {import('react').DependencyList} deps\n */\nfunction useUpdateEffect( effect, deps ) {\n\tconst mounted = useRef( false );\n\tuseEffect( () => {\n\t\tif ( mounted.current ) {\n\t\t\treturn effect();\n\t\t}\n\t\tmounted.current = true;\n\t\treturn undefined;\n\t\t// Disable reasons:\n\t\t// 1. This hook needs to pass a dep list that isn't an array literal\n\t\t// 2. `effect` is missing from the array, and will need to be added carefully to avoid additional warnings\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, deps );\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tmounted.current = false;\n\t\t},\n\t\t[]\n\t);\n}\n\nexport default useUpdateEffect;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAEC,MAAM,EAAEC,IAAI,EAAG;EACxC,MAAMC,OAAO,GAAGL,MAAM,CAAE,KAAM,CAAC;EAC/BC,SAAS,CAAE,MAAM;IAChB,IAAKI,OAAO,CAACC,OAAO,EAAG;MACtB,OAAOH,MAAM,CAAC,CAAC;IAChB;IACAE,OAAO,CAACC,OAAO,GAAG,IAAI;IACtB,OAAOC,SAAS;IAChB;IACA;IACA;IACA;IACA;EACD,CAAC,EAAEH,IAAK,CAAC;EAETH,SAAS,CACR,MAAM,MAAM;IACXI,OAAO,CAACC,OAAO,GAAG,KAAK;EACxB,CAAC,EACD,EACD,CAAC;AACF;AAEA,eAAeJ,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["useRef","useEffect","useUpdateEffect","effect","deps","mountedRef","current","undefined"],"sources":["@wordpress/components/src/utils/hooks/use-update-effect.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\n\n/**\n * A `React.useEffect` that will not run on the first render.\n * Source:\n * https://github.com/ariakit/ariakit/blob/main/packages/ariakit-react-core/src/utils/hooks.ts\n *\n * @param {import('react').EffectCallback} effect\n * @param {import('react').DependencyList} deps\n */\nfunction useUpdateEffect( effect, deps ) {\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tif ( mountedRef.current ) {\n\t\t\treturn effect();\n\t\t}\n\t\tmountedRef.current = true;\n\t\treturn undefined;\n\t\t// Disable reasons:\n\t\t// 1. This hook needs to pass a dep list that isn't an array literal\n\t\t// 2. `effect` is missing from the array, and will need to be added carefully to avoid additional warnings\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, deps );\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tmountedRef.current = false;\n\t\t},\n\t\t[]\n\t);\n}\n\nexport default useUpdateEffect;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAEC,MAAM,EAAEC,IAAI,EAAG;EACxC,MAAMC,UAAU,GAAGL,MAAM,CAAE,KAAM,CAAC;EAClCC,SAAS,CAAE,MAAM;IAChB,IAAKI,UAAU,CAACC,OAAO,EAAG;MACzB,OAAOH,MAAM,CAAC,CAAC;IAChB;IACAE,UAAU,CAACC,OAAO,GAAG,IAAI;IACzB,OAAOC,SAAS;IAChB;IACA;IACA;IACA;IACA;EACD,CAAC,EAAEH,IAAK,CAAC;EAETH,SAAS,CACR,MAAM,MAAM;IACXI,UAAU,CAACC,OAAO,GAAG,KAAK;EAC3B,CAAC,EACD,EACD,CAAC;AACF;AAEA,eAAeJ,eAAe","ignoreList":[]}
@@ -1052,18 +1052,6 @@ input.components-combobox-control__input[type=text]:focus {
1052
1052
  height: 20px;
1053
1053
  }
1054
1054
 
1055
- .components-custom-gradient-picker .components-custom-gradient-picker__toolbar {
1056
- border: none;
1057
- }
1058
- .components-custom-gradient-picker .components-custom-gradient-picker__toolbar > div + div {
1059
- margin-right: 1px;
1060
- }
1061
- .components-custom-gradient-picker .components-custom-gradient-picker__toolbar button.is-pressed > svg {
1062
- background: #fff;
1063
- border: 1px solid #949494;
1064
- border-radius: 2px;
1065
- }
1066
-
1067
1055
  .components-custom-gradient-picker__ui-line {
1068
1056
  position: relative;
1069
1057
  z-index: 0;
@@ -1368,6 +1356,7 @@ body.is-dragging-components-draggable {
1368
1356
  border-radius: 50%;
1369
1357
  transition: 0.2s transform ease, 0.2s background-color ease-out;
1370
1358
  background-color: #1e1e1e;
1359
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01);
1371
1360
  border: 6px solid transparent;
1372
1361
  }
1373
1362
  @media (prefers-reduced-motion: reduce) {
@@ -1539,7 +1528,6 @@ body.is-dragging-components-draggable {
1539
1528
  }
1540
1529
  .components-form-token-field__token.is-borderless.is-error .components-form-token-field__token-text {
1541
1530
  color: #cc1818;
1542
- border-radius: 0 4px 4px 0;
1543
1531
  padding: 0 6px 0 4px;
1544
1532
  }
1545
1533
  .components-form-token-field__token.is-borderless.is-validating .components-form-token-field__token-text {
@@ -1569,7 +1557,7 @@ body.is-dragging-components-draggable {
1569
1557
  }
1570
1558
 
1571
1559
  .components-form-token-field__token-text {
1572
- border-radius: 0 2px 2px 0;
1560
+ border-radius: 0 1px 1px 0;
1573
1561
  padding: 0 8px 0 0;
1574
1562
  white-space: nowrap;
1575
1563
  overflow: hidden;
@@ -1578,7 +1566,7 @@ body.is-dragging-components-draggable {
1578
1566
 
1579
1567
  .components-form-token-field__remove-token.components-button {
1580
1568
  cursor: pointer;
1581
- border-radius: 2px 0 0 2px;
1569
+ border-radius: 1px 0 0 1px;
1582
1570
  padding: 0 2px;
1583
1571
  color: #1e1e1e;
1584
1572
  line-height: 10px;
@@ -1885,27 +1873,55 @@ body.is-dragging-components-draggable {
1885
1873
  background-color: rgba(0, 0, 0, 0.35);
1886
1874
  z-index: 100000;
1887
1875
  display: flex;
1888
- animation: edit-post__fade-in-animation 0.2s ease-out 0s;
1876
+ animation: __wp-base-styles-fade-in 0.08s linear 0s;
1889
1877
  animation-fill-mode: forwards;
1890
1878
  }
1879
+ @keyframes __wp-base-styles-fade-in {
1880
+ from {
1881
+ opacity: 0;
1882
+ }
1883
+ to {
1884
+ opacity: 1;
1885
+ }
1886
+ }
1891
1887
  @media (prefers-reduced-motion: reduce) {
1892
1888
  .components-modal__screen-overlay {
1893
1889
  animation-duration: 1ms;
1894
1890
  animation-delay: 0s;
1895
1891
  }
1896
1892
  }
1893
+ .components-modal__screen-overlay.is-animating-out {
1894
+ animation: __wp-base-styles-fade-out 0.08s linear 80ms;
1895
+ animation-fill-mode: forwards;
1896
+ }
1897
+ @keyframes __wp-base-styles-fade-out {
1898
+ from {
1899
+ opacity: 1;
1900
+ }
1901
+ to {
1902
+ opacity: 0;
1903
+ }
1904
+ }
1905
+ @media (prefers-reduced-motion: reduce) {
1906
+ .components-modal__screen-overlay.is-animating-out {
1907
+ animation-duration: 1ms;
1908
+ animation-delay: 0s;
1909
+ }
1910
+ }
1897
1911
 
1898
1912
  .components-modal__frame {
1899
1913
  box-sizing: border-box;
1900
1914
  margin: 40px 0 0 0;
1901
1915
  width: 100%;
1902
1916
  background: #fff;
1903
- box-shadow: 0 0.7px 1px rgba(0, 0, 0, 0.15), 0 2.7px 3.8px -0.2px rgba(0, 0, 0, 0.15), 0 5.5px 7.8px -0.3px rgba(0, 0, 0, 0.15), -0.1px 11.5px 16.4px -0.5px rgba(0, 0, 0, 0.15);
1917
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02);
1904
1918
  border-radius: 8px 8px 0 0;
1905
1919
  overflow: hidden;
1906
1920
  display: flex;
1907
- animation: components-modal__appear-animation 0.1s ease-out;
1921
+ animation-name: components-modal__appear-animation;
1922
+ animation-duration: var(--modal-frame-animation-duration);
1908
1923
  animation-fill-mode: forwards;
1924
+ animation-timing-function: cubic-bezier(0.29, 0, 0, 1);
1909
1925
  }
1910
1926
  .components-modal__frame *,
1911
1927
  .components-modal__frame *::before,
@@ -1918,6 +1934,10 @@ body.is-dragging-components-draggable {
1918
1934
  animation-delay: 0s;
1919
1935
  }
1920
1936
  }
1937
+ .components-modal__screen-overlay.is-animating-out .components-modal__frame {
1938
+ animation-name: components-modal__disappear-animation;
1939
+ animation-timing-function: cubic-bezier(1, 0, 0.2, 1);
1940
+ }
1921
1941
  @media (min-width: 600px) {
1922
1942
  .components-modal__frame {
1923
1943
  border-radius: 8px;
@@ -1970,10 +1990,22 @@ body.is-dragging-components-draggable {
1970
1990
 
1971
1991
  @keyframes components-modal__appear-animation {
1972
1992
  from {
1973
- transform: translateY(32px);
1993
+ opacity: 0;
1994
+ transform: scale(0.9);
1995
+ }
1996
+ to {
1997
+ opacity: 1;
1998
+ transform: scale(1);
1999
+ }
2000
+ }
2001
+ @keyframes components-modal__disappear-animation {
2002
+ from {
2003
+ opacity: 1;
2004
+ transform: scale(1);
1974
2005
  }
1975
2006
  to {
1976
- transform: translateY(0);
2007
+ opacity: 0;
2008
+ transform: scale(0.9);
1977
2009
  }
1978
2010
  }
1979
2011
  .components-modal__header {
@@ -1999,10 +2031,6 @@ body.is-dragging-components-draggable {
1999
2031
  line-height: 1;
2000
2032
  margin: 0;
2001
2033
  }
2002
- .components-modal__header .components-button {
2003
- position: relative;
2004
- right: 8px;
2005
- }
2006
2034
  .components-modal__content.has-scrolled-content:not(.hide-header) .components-modal__header {
2007
2035
  border-bottom-color: #ddd;
2008
2036
  }
@@ -2517,13 +2545,14 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
2517
2545
 
2518
2546
  .components-popover__content {
2519
2547
  background: #fff;
2520
- box-shadow: 0 0 0 1px #ccc, 0 0.7px 1px rgba(0, 0, 0, 0.1), 0 1.2px 1.7px -0.2px rgba(0, 0, 0, 0.1), 0 2.3px 3.3px -0.5px rgba(0, 0, 0, 0.1);
2548
+ box-shadow: 0 0 0 1px #ccc, 0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02);
2521
2549
  border-radius: 4px;
2522
2550
  box-sizing: border-box;
2523
2551
  width: min-content;
2524
2552
  }
2525
2553
  .is-alternate .components-popover__content {
2526
2554
  box-shadow: 0 0 0 1px #1e1e1e;
2555
+ border-radius: 2px;
2527
2556
  }
2528
2557
  .is-unstyled .components-popover__content {
2529
2558
  background: none;
@@ -2783,13 +2812,13 @@ body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right
2783
2812
  position: absolute;
2784
2813
  top: calc(50% - 8px);
2785
2814
  left: calc(50% - 8px);
2786
- box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
2815
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)), 0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01);
2787
2816
  outline: 2px solid transparent;
2788
2817
  }
2789
2818
 
2790
2819
  .components-resizable-box__side-handle::before {
2791
2820
  display: block;
2792
- border-radius: 2px;
2821
+ border-radius: 9999px;
2793
2822
  content: "";
2794
2823
  width: 3px;
2795
2824
  height: 3px;
@@ -2969,7 +2998,7 @@ body.lockscroll {
2969
2998
  -webkit-backdrop-filter: blur(16px) saturate(180%);
2970
2999
  backdrop-filter: blur(16px) saturate(180%);
2971
3000
  border-radius: 4px;
2972
- box-shadow: 0 0.7px 1px rgba(0, 0, 0, 0.1), 0 1.2px 1.7px -0.2px rgba(0, 0, 0, 0.1), 0 2.3px 3.3px -0.5px rgba(0, 0, 0, 0.1);
3001
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02);
2973
3002
  color: #fff;
2974
3003
  padding: 12px 20px;
2975
3004
  width: 100%;
@@ -3123,7 +3152,6 @@ body.lockscroll {
3123
3152
  outline: none;
3124
3153
  }
3125
3154
  .components-tab-panel__tab-content:focus-visible {
3126
- border-radius: 2px;
3127
3155
  box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
3128
3156
  outline: 2px solid transparent;
3129
3157
  outline-offset: 0;
@@ -3278,8 +3306,8 @@ body.lockscroll {
3278
3306
  .components-text-control__input[type=month].is-next-40px-default-size,
3279
3307
  .components-text-control__input[type=number].is-next-40px-default-size {
3280
3308
  height: 40px;
3281
- padding-right: 16px;
3282
- padding-left: 16px;
3309
+ padding-right: 12px;
3310
+ padding-left: 12px;
3283
3311
  }
3284
3312
 
3285
3313
  .components-tip {
@@ -3498,6 +3526,7 @@ div.components-toolbar > div + div.has-left-divider::before {
3498
3526
  font-size: 12px;
3499
3527
  padding: 4px 8px;
3500
3528
  z-index: 1000002;
3529
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02);
3501
3530
  }
3502
3531
 
3503
3532
  .components-tooltip__shortcut {