@wordpress/components 23.5.0 → 23.7.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 (1131) hide show
  1. package/CHANGELOG.md +69 -8
  2. package/build/angle-picker-control/angle-circle.js +1 -4
  3. package/build/angle-picker-control/angle-circle.js.map +1 -1
  4. package/build/angle-picker-control/index.js +10 -22
  5. package/build/angle-picker-control/index.js.map +1 -1
  6. package/build/angle-picker-control/styles/angle-picker-control-styles.js +24 -15
  7. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  8. package/build/animate/index.js +29 -19
  9. package/build/animate/index.js.map +1 -1
  10. package/build/animate/types.js.map +1 -0
  11. package/build/animation/index.js.map +1 -1
  12. package/build/autocomplete/autocompleter-ui.js +5 -5
  13. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  14. package/build/autocomplete/get-default-use-items.js.map +1 -1
  15. package/build/autocomplete/index.js +25 -91
  16. package/build/autocomplete/index.js.map +1 -1
  17. package/build/autocomplete/types.js +6 -0
  18. package/build/autocomplete/types.js.map +1 -0
  19. package/build/box-control/axial-input-controls.js.map +1 -1
  20. package/build/color-picker/color-input.js +0 -4
  21. package/build/color-picker/color-input.js.map +1 -1
  22. package/build/color-picker/component.js +5 -4
  23. package/build/color-picker/component.js.map +1 -1
  24. package/build/color-picker/hex-input.js.map +1 -1
  25. package/build/color-picker/hsl-input.js.map +1 -1
  26. package/build/color-picker/input-with-slider.js.map +1 -1
  27. package/build/color-picker/legacy-adapter.js.map +1 -1
  28. package/build/color-picker/picker.js.map +1 -1
  29. package/build/color-picker/rgb-input.js.map +1 -1
  30. package/build/color-picker/use-deprecated-props.js.map +1 -1
  31. package/build/custom-gradient-picker/constants.js +1 -1
  32. package/build/custom-gradient-picker/constants.js.map +1 -1
  33. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -1
  34. package/build/custom-gradient-picker/gradient-bar/control-points.js +9 -3
  35. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  36. package/build/custom-gradient-picker/gradient-bar/index.js +14 -7
  37. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  38. package/build/custom-gradient-picker/gradient-bar/utils.js +34 -52
  39. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  40. package/build/custom-gradient-picker/index.js +45 -14
  41. package/build/custom-gradient-picker/index.js.map +1 -1
  42. package/build/custom-gradient-picker/serializer.js +14 -3
  43. package/build/custom-gradient-picker/serializer.js.map +1 -1
  44. package/build/custom-gradient-picker/styles/custom-gradient-picker-styles.js +6 -6
  45. package/build/custom-gradient-picker/styles/custom-gradient-picker-styles.js.map +1 -1
  46. package/build/custom-gradient-picker/types.js +6 -0
  47. package/build/custom-gradient-picker/types.js.map +1 -0
  48. package/build/custom-gradient-picker/utils.js +17 -10
  49. package/build/custom-gradient-picker/utils.js.map +1 -1
  50. package/build/dimension-control/index.js +31 -5
  51. package/build/dimension-control/index.js.map +1 -1
  52. package/build/dimension-control/sizes.js +2 -4
  53. package/build/dimension-control/sizes.js.map +1 -1
  54. package/build/dimension-control/types.js +6 -0
  55. package/build/dimension-control/types.js.map +1 -0
  56. package/build/{color-list-picker → duotone-picker/color-list-picker}/index.js +5 -5
  57. package/build/duotone-picker/color-list-picker/index.js.map +1 -0
  58. package/build/duotone-picker/color-list-picker/types.js +6 -0
  59. package/build/duotone-picker/color-list-picker/types.js.map +1 -0
  60. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  61. package/build/duotone-picker/duotone-picker.js +39 -2
  62. package/build/duotone-picker/duotone-picker.js.map +1 -1
  63. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  64. package/build/duotone-picker/index.js.map +1 -1
  65. package/build/duotone-picker/types.js +6 -0
  66. package/build/duotone-picker/types.js.map +1 -0
  67. package/build/duotone-picker/utils.js +13 -11
  68. package/build/duotone-picker/utils.js.map +1 -1
  69. package/build/flex/flex/hook.js +3 -3
  70. package/build/flex/flex/hook.js.map +1 -1
  71. package/build/font-size-picker/index.js +2 -1
  72. package/build/font-size-picker/index.js.map +1 -1
  73. package/build/form-token-field/index.js +10 -4
  74. package/build/form-token-field/index.js.map +1 -1
  75. package/build/gradient-picker/index.js +61 -7
  76. package/build/gradient-picker/index.js.map +1 -1
  77. package/build/gradient-picker/types.js +6 -0
  78. package/build/gradient-picker/types.js.map +1 -0
  79. package/build/guide/icons.js.map +1 -1
  80. package/build/guide/index.js +46 -8
  81. package/build/guide/index.js.map +1 -1
  82. package/build/guide/page-control.js.map +1 -1
  83. package/build/guide/page.js.map +1 -1
  84. package/build/guide/types.js +6 -0
  85. package/build/guide/types.js.map +1 -0
  86. package/build/h-stack/utils.js +5 -5
  87. package/build/h-stack/utils.js.map +1 -1
  88. package/build/higher-order/navigate-regions/index.js +33 -3
  89. package/build/higher-order/navigate-regions/index.js.map +1 -1
  90. package/build/higher-order/with-fallback-styles/index.js +2 -2
  91. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  92. package/build/higher-order/with-filters/index.js +31 -7
  93. package/build/higher-order/with-filters/index.js.map +1 -1
  94. package/build/higher-order/with-focus-return/index.js +10 -10
  95. package/build/higher-order/with-focus-return/index.js.map +1 -1
  96. package/build/higher-order/with-notices/index.js +28 -25
  97. package/build/higher-order/with-notices/index.js.map +1 -1
  98. package/build/higher-order/with-notices/types.js +6 -0
  99. package/build/higher-order/with-notices/types.js.map +1 -0
  100. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  101. package/build/icon/index.js +1 -8
  102. package/build/icon/index.js.map +1 -1
  103. package/build/index.native.js +18 -9
  104. package/build/index.native.js.map +1 -1
  105. package/build/mobile/bottom-sheet/cell.native.js +1 -1
  106. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  107. package/build/mobile/bottom-sheet-text-control/index.native.js +4 -3
  108. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  109. package/build/navigation/back-button/index.js +6 -5
  110. package/build/navigation/back-button/index.js.map +1 -1
  111. package/build/navigation/constants.js.map +1 -1
  112. package/build/navigation/context.js +7 -4
  113. package/build/navigation/context.js.map +1 -1
  114. package/build/navigation/group/context.js.map +1 -1
  115. package/build/navigation/group/index.js +5 -1
  116. package/build/navigation/group/index.js.map +1 -1
  117. package/build/navigation/index.js +49 -3
  118. package/build/navigation/index.js.map +1 -1
  119. package/build/navigation/item/base-content.js +0 -1
  120. package/build/navigation/item/base-content.js.map +1 -1
  121. package/build/navigation/item/base.js.map +1 -1
  122. package/build/navigation/item/index.js +5 -1
  123. package/build/navigation/item/index.js.map +1 -1
  124. package/build/navigation/item/use-navigation-tree-item.js +1 -1
  125. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  126. package/build/navigation/menu/context.js.map +1 -1
  127. package/build/navigation/menu/index.js +5 -1
  128. package/build/navigation/menu/index.js.map +1 -1
  129. package/build/navigation/menu/menu-title-search.js +8 -6
  130. package/build/navigation/menu/menu-title-search.js.map +1 -1
  131. package/build/navigation/menu/menu-title.js +4 -2
  132. package/build/navigation/menu/menu-title.js.map +1 -1
  133. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  134. package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  135. package/build/navigation/styles/navigation-styles.js +36 -36
  136. package/build/navigation/styles/navigation-styles.js.map +1 -1
  137. package/build/navigation/types.js +6 -0
  138. package/build/navigation/types.js.map +1 -0
  139. package/build/navigation/use-create-navigation-tree.js +7 -0
  140. package/build/navigation/use-create-navigation-tree.js.map +1 -1
  141. package/build/navigation/use-navigation-tree-nodes.js +3 -5
  142. package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
  143. package/build/navigation/utils.js.map +1 -1
  144. package/build/navigator/navigator-screen/component.js +5 -3
  145. package/build/navigator/navigator-screen/component.js.map +1 -1
  146. package/build/number-control/index.js +1 -3
  147. package/build/number-control/index.js.map +1 -1
  148. package/build/palette-edit/index.js +65 -26
  149. package/build/palette-edit/index.js.map +1 -1
  150. package/build/palette-edit/types.js +6 -0
  151. package/build/palette-edit/types.js.map +1 -0
  152. package/build/panel/body.js +15 -17
  153. package/build/panel/body.js.map +1 -1
  154. package/build/placeholder/index.js.map +1 -1
  155. package/build/query-controls/author-select.js +0 -4
  156. package/build/query-controls/author-select.js.map +1 -1
  157. package/build/query-controls/category-select.js +0 -4
  158. package/build/query-controls/category-select.js.map +1 -1
  159. package/build/query-controls/terms.js +30 -15
  160. package/build/query-controls/terms.js.map +1 -1
  161. package/build/range-control/index.js.map +1 -1
  162. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  163. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  164. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  165. package/build/responsive-wrapper/index.js +12 -13
  166. package/build/responsive-wrapper/index.js.map +1 -1
  167. package/build/sandbox/index.native.js +80 -67
  168. package/build/sandbox/index.native.js.map +1 -1
  169. package/build/select-control/index.js +19 -16
  170. package/build/select-control/index.js.map +1 -1
  171. package/build/tab-panel/index.js +1 -1
  172. package/build/tab-panel/index.js.map +1 -1
  173. package/build/toolbar/toolbar-button/index.js +32 -10
  174. package/build/toolbar/toolbar-button/index.js.map +1 -1
  175. package/build/toolbar/toolbar-button/toolbar-button-container.js +12 -4
  176. package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  177. package/build/toolbar/toolbar-button/types.js +6 -0
  178. package/build/toolbar/toolbar-button/types.js.map +1 -0
  179. package/build/toolbar/toolbar-context/index.js +4 -2
  180. package/build/toolbar/toolbar-context/index.js.map +1 -1
  181. package/build/tools-panel/tools-panel/hook.js +45 -6
  182. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  183. package/build/tooltip/index.js +18 -6
  184. package/build/tooltip/index.js.map +1 -1
  185. package/build/tree-select/index.js.map +1 -1
  186. package/build/ui/context/get-styled-class-name-from-key.js +2 -2
  187. package/build/ui/context/get-styled-class-name-from-key.js.map +1 -1
  188. package/build/utils/font.js +3 -7
  189. package/build/utils/font.js.map +1 -1
  190. package/build/utils/input/input-control.js +1 -1
  191. package/build/utils/input/input-control.js.map +1 -1
  192. package/build/v-stack/hook.js +2 -0
  193. package/build/v-stack/hook.js.map +1 -1
  194. package/build-module/angle-picker-control/angle-circle.js +1 -4
  195. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  196. package/build-module/angle-picker-control/index.js +12 -21
  197. package/build-module/angle-picker-control/index.js.map +1 -1
  198. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +20 -13
  199. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  200. package/build-module/animate/index.js +27 -17
  201. package/build-module/animate/index.js.map +1 -1
  202. package/build-module/animation/index.js.map +1 -1
  203. package/build-module/autocomplete/autocompleter-ui.js +6 -6
  204. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  205. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  206. package/build-module/autocomplete/index.js +28 -94
  207. package/build-module/autocomplete/index.js.map +1 -1
  208. package/build-module/autocomplete/types.js +2 -0
  209. package/build-module/box-control/axial-input-controls.js.map +1 -1
  210. package/build-module/color-picker/color-input.js +0 -4
  211. package/build-module/color-picker/color-input.js.map +1 -1
  212. package/build-module/color-picker/component.js +3 -3
  213. package/build-module/color-picker/component.js.map +1 -1
  214. package/build-module/color-picker/hex-input.js.map +1 -1
  215. package/build-module/color-picker/hsl-input.js.map +1 -1
  216. package/build-module/color-picker/input-with-slider.js.map +1 -1
  217. package/build-module/color-picker/legacy-adapter.js.map +1 -1
  218. package/build-module/color-picker/picker.js +4 -0
  219. package/build-module/color-picker/picker.js.map +1 -1
  220. package/build-module/color-picker/rgb-input.js.map +1 -1
  221. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  222. package/build-module/custom-gradient-picker/constants.js +1 -1
  223. package/build-module/custom-gradient-picker/constants.js.map +1 -1
  224. package/build-module/custom-gradient-picker/gradient-bar/constants.js.map +1 -1
  225. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +9 -3
  226. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  227. package/build-module/custom-gradient-picker/gradient-bar/index.js +14 -7
  228. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  229. package/build-module/custom-gradient-picker/gradient-bar/utils.js +34 -52
  230. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  231. package/build-module/custom-gradient-picker/index.js +44 -16
  232. package/build-module/custom-gradient-picker/index.js.map +1 -1
  233. package/build-module/custom-gradient-picker/serializer.js +14 -3
  234. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  235. package/build-module/custom-gradient-picker/styles/custom-gradient-picker-styles.js +6 -6
  236. package/build-module/custom-gradient-picker/styles/custom-gradient-picker-styles.js.map +1 -1
  237. package/build-module/custom-gradient-picker/types.js +2 -0
  238. package/build-module/custom-gradient-picker/types.js.map +1 -0
  239. package/build-module/custom-gradient-picker/utils.js +17 -10
  240. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  241. package/build-module/dimension-control/index.js +28 -3
  242. package/build-module/dimension-control/index.js.map +1 -1
  243. package/build-module/dimension-control/sizes.js +6 -5
  244. package/build-module/dimension-control/sizes.js.map +1 -1
  245. package/build-module/dimension-control/types.js +2 -0
  246. package/build-module/dimension-control/types.js.map +1 -0
  247. package/build-module/{color-list-picker → duotone-picker/color-list-picker}/index.js +5 -5
  248. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -0
  249. package/build-module/duotone-picker/color-list-picker/types.js +2 -0
  250. package/build-module/duotone-picker/color-list-picker/types.js.map +1 -0
  251. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  252. package/build-module/duotone-picker/duotone-picker.js +38 -2
  253. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  254. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  255. package/build-module/duotone-picker/index.js.map +1 -1
  256. package/build-module/duotone-picker/types.js +2 -0
  257. package/build-module/duotone-picker/types.js.map +1 -0
  258. package/build-module/duotone-picker/utils.js +17 -11
  259. package/build-module/duotone-picker/utils.js.map +1 -1
  260. package/build-module/flex/flex/hook.js +3 -3
  261. package/build-module/flex/flex/hook.js.map +1 -1
  262. package/build-module/font-size-picker/index.js +2 -1
  263. package/build-module/font-size-picker/index.js.map +1 -1
  264. package/build-module/form-token-field/index.js +10 -5
  265. package/build-module/form-token-field/index.js.map +1 -1
  266. package/build-module/gradient-picker/index.js +61 -9
  267. package/build-module/gradient-picker/index.js.map +1 -1
  268. package/build-module/gradient-picker/types.js +2 -0
  269. package/build-module/gradient-picker/types.js.map +1 -0
  270. package/build-module/guide/icons.js.map +1 -1
  271. package/build-module/guide/index.js +45 -8
  272. package/build-module/guide/index.js.map +1 -1
  273. package/build-module/guide/page-control.js.map +1 -1
  274. package/build-module/guide/page.js +4 -0
  275. package/build-module/guide/page.js.map +1 -1
  276. package/build-module/guide/types.js +2 -0
  277. package/build-module/guide/types.js.map +1 -0
  278. package/build-module/h-stack/utils.js +5 -5
  279. package/build-module/h-stack/utils.js.map +1 -1
  280. package/build-module/higher-order/navigate-regions/index.js +33 -3
  281. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  282. package/build-module/higher-order/with-fallback-styles/index.js +2 -2
  283. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  284. package/build-module/higher-order/with-filters/index.js +31 -7
  285. package/build-module/higher-order/with-filters/index.js.map +1 -1
  286. package/build-module/higher-order/with-focus-return/index.js +10 -10
  287. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  288. package/build-module/higher-order/with-notices/index.js +29 -26
  289. package/build-module/higher-order/with-notices/index.js.map +1 -1
  290. package/build-module/higher-order/with-notices/types.js +2 -0
  291. package/build-module/higher-order/with-notices/types.js.map +1 -0
  292. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  293. package/build-module/icon/index.js +2 -9
  294. package/build-module/icon/index.js.map +1 -1
  295. package/build-module/index.native.js +1 -0
  296. package/build-module/index.native.js.map +1 -1
  297. package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
  298. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  299. package/build-module/mobile/bottom-sheet-text-control/index.native.js +4 -3
  300. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  301. package/build-module/navigation/back-button/index.js +4 -3
  302. package/build-module/navigation/back-button/index.js.map +1 -1
  303. package/build-module/navigation/constants.js.map +1 -1
  304. package/build-module/navigation/context.js +7 -4
  305. package/build-module/navigation/context.js.map +1 -1
  306. package/build-module/navigation/group/context.js +4 -0
  307. package/build-module/navigation/group/context.js.map +1 -1
  308. package/build-module/navigation/group/index.js +2 -1
  309. package/build-module/navigation/group/index.js.map +1 -1
  310. package/build-module/navigation/index.js +46 -3
  311. package/build-module/navigation/index.js.map +1 -1
  312. package/build-module/navigation/item/base-content.js +0 -1
  313. package/build-module/navigation/item/base-content.js.map +1 -1
  314. package/build-module/navigation/item/base.js.map +1 -1
  315. package/build-module/navigation/item/index.js +2 -1
  316. package/build-module/navigation/item/index.js.map +1 -1
  317. package/build-module/navigation/item/use-navigation-tree-item.js +1 -1
  318. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  319. package/build-module/navigation/menu/context.js +4 -0
  320. package/build-module/navigation/menu/context.js.map +1 -1
  321. package/build-module/navigation/menu/index.js +2 -1
  322. package/build-module/navigation/menu/index.js.map +1 -1
  323. package/build-module/navigation/menu/menu-title-search.js +8 -6
  324. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  325. package/build-module/navigation/menu/menu-title.js +4 -2
  326. package/build-module/navigation/menu/menu-title.js.map +1 -1
  327. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  328. package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  329. package/build-module/navigation/styles/navigation-styles.js +36 -36
  330. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  331. package/build-module/navigation/types.js +2 -0
  332. package/build-module/navigation/types.js.map +1 -0
  333. package/build-module/navigation/use-create-navigation-tree.js +7 -0
  334. package/build-module/navigation/use-create-navigation-tree.js.map +1 -1
  335. package/build-module/navigation/use-navigation-tree-nodes.js +2 -2
  336. package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
  337. package/build-module/navigation/utils.js.map +1 -1
  338. package/build-module/navigator/navigator-screen/component.js +5 -3
  339. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  340. package/build-module/number-control/index.js +1 -3
  341. package/build-module/number-control/index.js.map +1 -1
  342. package/build-module/palette-edit/index.js +63 -26
  343. package/build-module/palette-edit/index.js.map +1 -1
  344. package/build-module/palette-edit/types.js +2 -0
  345. package/build-module/palette-edit/types.js.map +1 -0
  346. package/build-module/panel/body.js +12 -12
  347. package/build-module/panel/body.js.map +1 -1
  348. package/build-module/placeholder/index.js.map +1 -1
  349. package/build-module/query-controls/author-select.js +0 -4
  350. package/build-module/query-controls/author-select.js.map +1 -1
  351. package/build-module/query-controls/category-select.js +1 -5
  352. package/build-module/query-controls/category-select.js.map +1 -1
  353. package/build-module/query-controls/terms.js +29 -16
  354. package/build-module/query-controls/terms.js.map +1 -1
  355. package/build-module/range-control/index.js.map +1 -1
  356. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  357. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  358. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  359. package/build-module/responsive-wrapper/index.js +12 -12
  360. package/build-module/responsive-wrapper/index.js.map +1 -1
  361. package/build-module/sandbox/index.native.js +70 -58
  362. package/build-module/sandbox/index.native.js.map +1 -1
  363. package/build-module/select-control/index.js +20 -17
  364. package/build-module/select-control/index.js.map +1 -1
  365. package/build-module/tab-panel/index.js +2 -2
  366. package/build-module/tab-panel/index.js.map +1 -1
  367. package/build-module/toolbar/toolbar-button/index.js +32 -9
  368. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  369. package/build-module/toolbar/toolbar-button/toolbar-button-container.js +12 -4
  370. package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  371. package/build-module/toolbar/toolbar-button/types.js +2 -0
  372. package/build-module/toolbar/toolbar-button/types.js.map +1 -0
  373. package/build-module/toolbar/toolbar-context/index.js +4 -2
  374. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  375. package/build-module/tools-panel/tools-panel/hook.js +45 -6
  376. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  377. package/build-module/tooltip/index.js +16 -6
  378. package/build-module/tooltip/index.js.map +1 -1
  379. package/build-module/tree-select/index.js.map +1 -1
  380. package/build-module/ui/context/get-styled-class-name-from-key.js +1 -1
  381. package/build-module/ui/context/get-styled-class-name-from-key.js.map +1 -1
  382. package/build-module/utils/font.js +3 -6
  383. package/build-module/utils/font.js.map +1 -1
  384. package/build-module/utils/input/input-control.js +1 -1
  385. package/build-module/utils/input/input-control.js.map +1 -1
  386. package/build-module/v-stack/hook.js +2 -0
  387. package/build-module/v-stack/hook.js.map +1 -1
  388. package/build-style/style-rtl.css +54 -39
  389. package/build-style/style.css +56 -39
  390. package/build-types/alignment-matrix-control/types.d.ts +4 -4
  391. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  392. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  393. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  394. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +5 -0
  395. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  396. package/build-types/angle-picker-control/types.d.ts +2 -2
  397. package/build-types/angle-picker-control/types.d.ts.map +1 -1
  398. package/build-types/animate/index.d.ts +27 -22
  399. package/build-types/animate/index.d.ts.map +1 -1
  400. package/build-types/animate/stories/index.d.ts +18 -0
  401. package/build-types/animate/stories/index.d.ts.map +1 -0
  402. package/build-types/animate/types.d.ts +30 -0
  403. package/build-types/animate/types.d.ts.map +1 -0
  404. package/build-types/animation/index.d.ts +8 -1
  405. package/build-types/animation/index.d.ts.map +1 -1
  406. package/build-types/autocomplete/autocompleter-ui.d.ts +4 -0
  407. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -0
  408. package/build-types/autocomplete/get-default-use-items.d.ts +3 -0
  409. package/build-types/autocomplete/get-default-use-items.d.ts.map +1 -0
  410. package/build-types/autocomplete/index.d.ts +23 -0
  411. package/build-types/autocomplete/index.d.ts.map +1 -0
  412. package/build-types/autocomplete/test/index.d.ts +2 -0
  413. package/build-types/autocomplete/test/index.d.ts.map +1 -0
  414. package/build-types/autocomplete/types.d.ts +201 -0
  415. package/build-types/autocomplete/types.d.ts.map +1 -0
  416. package/build-types/base-control/types.d.ts +2 -2
  417. package/build-types/base-control/types.d.ts.map +1 -1
  418. package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
  419. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  420. package/build-types/border-box-control/styles.d.ts +3 -3
  421. package/build-types/border-box-control/styles.d.ts.map +1 -1
  422. package/build-types/border-box-control/types.d.ts +8 -8
  423. package/build-types/border-box-control/types.d.ts.map +1 -1
  424. package/build-types/border-box-control/utils.d.ts +5 -5
  425. package/build-types/border-box-control/utils.d.ts.map +1 -1
  426. package/build-types/border-control/border-control/hook.d.ts +3 -3
  427. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  428. package/build-types/border-control/border-control-dropdown/hook.d.ts +2 -2
  429. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  430. package/build-types/border-control/styles.d.ts +4 -4
  431. package/build-types/border-control/styles.d.ts.map +1 -1
  432. package/build-types/border-control/types.d.ts +6 -6
  433. package/build-types/border-control/types.d.ts.map +1 -1
  434. package/build-types/box-control/types.d.ts +6 -6
  435. package/build-types/box-control/types.d.ts.map +1 -1
  436. package/build-types/button/deprecated.d.ts +6 -6
  437. package/build-types/button/types.d.ts +10 -10
  438. package/build-types/button/types.d.ts.map +1 -1
  439. package/build-types/button-group/types.d.ts +1 -1
  440. package/build-types/button-group/types.d.ts.map +1 -1
  441. package/build-types/card/card/hook.d.ts +1 -1
  442. package/build-types/card/card/hook.d.ts.map +1 -1
  443. package/build-types/card/types.d.ts +10 -10
  444. package/build-types/card/types.d.ts.map +1 -1
  445. package/build-types/checkbox-control/types.d.ts +1 -1
  446. package/build-types/checkbox-control/types.d.ts.map +1 -1
  447. package/build-types/circular-option-picker/types.d.ts +4 -4
  448. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  449. package/build-types/color-indicator/types.d.ts +1 -1
  450. package/build-types/color-indicator/types.d.ts.map +1 -1
  451. package/build-types/color-palette/types.d.ts +7 -7
  452. package/build-types/color-palette/types.d.ts.map +1 -1
  453. package/build-types/color-palette/utils.d.ts +1 -1
  454. package/build-types/color-palette/utils.d.ts.map +1 -1
  455. package/build-types/color-picker/color-input.d.ts +1 -11
  456. package/build-types/color-picker/color-input.d.ts.map +1 -1
  457. package/build-types/color-picker/component.d.ts +8 -9
  458. package/build-types/color-picker/component.d.ts.map +1 -1
  459. package/build-types/color-picker/hex-input.d.ts +1 -10
  460. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  461. package/build-types/color-picker/hsl-input.d.ts +1 -10
  462. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  463. package/build-types/color-picker/input-with-slider.d.ts +1 -9
  464. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  465. package/build-types/color-picker/legacy-adapter.d.ts +1 -3
  466. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
  467. package/build-types/color-picker/picker.d.ts +4 -7
  468. package/build-types/color-picker/picker.d.ts.map +1 -1
  469. package/build-types/color-picker/rgb-input.d.ts +1 -10
  470. package/build-types/color-picker/rgb-input.d.ts.map +1 -1
  471. package/build-types/color-picker/stories/index.d.ts +19 -0
  472. package/build-types/color-picker/stories/index.d.ts.map +1 -0
  473. package/build-types/color-picker/styles.d.ts +3 -3
  474. package/build-types/color-picker/test/index.d.ts +2 -0
  475. package/build-types/color-picker/test/index.d.ts.map +1 -0
  476. package/build-types/color-picker/types.d.ts +107 -3
  477. package/build-types/color-picker/types.d.ts.map +1 -1
  478. package/build-types/color-picker/use-deprecated-props.d.ts +1 -44
  479. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  480. package/build-types/combobox-control/types.d.ts +2 -2
  481. package/build-types/combobox-control/types.d.ts.map +1 -1
  482. package/build-types/confirm-dialog/component.d.ts +4 -4
  483. package/build-types/confirm-dialog/types.d.ts +5 -5
  484. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  485. package/build-types/custom-gradient-picker/constants.d.ts +25 -0
  486. package/build-types/custom-gradient-picker/constants.d.ts.map +1 -0
  487. package/build-types/custom-gradient-picker/gradient-bar/constants.d.ts +8 -0
  488. package/build-types/custom-gradient-picker/gradient-bar/constants.d.ts.map +1 -0
  489. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +8 -0
  490. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -0
  491. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +4 -0
  492. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -0
  493. package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts +2 -0
  494. package/build-types/custom-gradient-picker/gradient-bar/test/utils.d.ts.map +1 -0
  495. package/build-types/custom-gradient-picker/gradient-bar/utils.d.ts +90 -0
  496. package/build-types/custom-gradient-picker/gradient-bar/utils.d.ts.map +1 -0
  497. package/build-types/custom-gradient-picker/index.d.ts +28 -0
  498. package/build-types/custom-gradient-picker/index.d.ts.map +1 -0
  499. package/build-types/custom-gradient-picker/serializer.d.ts +14 -0
  500. package/build-types/custom-gradient-picker/serializer.d.ts.map +1 -0
  501. package/build-types/custom-gradient-picker/stories/index.d.ts +12 -0
  502. package/build-types/custom-gradient-picker/stories/index.d.ts.map +1 -0
  503. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +12 -0
  504. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts.map +1 -0
  505. package/build-types/custom-gradient-picker/test/serializer.d.ts +2 -0
  506. package/build-types/custom-gradient-picker/test/serializer.d.ts.map +1 -0
  507. package/build-types/custom-gradient-picker/types.d.ts +120 -0
  508. package/build-types/custom-gradient-picker/types.d.ts.map +1 -0
  509. package/build-types/custom-gradient-picker/utils.d.ts +13 -0
  510. package/build-types/custom-gradient-picker/utils.d.ts.map +1 -0
  511. package/build-types/custom-select-control/styles.d.ts +1 -1
  512. package/build-types/custom-select-control/styles.d.ts.map +1 -1
  513. package/build-types/dashicon/types.d.ts +2 -2
  514. package/build-types/dashicon/types.d.ts.map +1 -1
  515. package/build-types/date-time/date-time/styles.d.ts +1 -4
  516. package/build-types/date-time/date-time/styles.d.ts.map +1 -1
  517. package/build-types/date-time/time/styles.d.ts +1 -1
  518. package/build-types/date-time/types.d.ts +4 -4
  519. package/build-types/date-time/types.d.ts.map +1 -1
  520. package/build-types/dimension-control/index.d.ts +28 -0
  521. package/build-types/dimension-control/index.d.ts.map +1 -0
  522. package/build-types/dimension-control/sizes.d.ts +26 -0
  523. package/build-types/dimension-control/sizes.d.ts.map +1 -0
  524. package/build-types/dimension-control/stories/index.d.ts +12 -0
  525. package/build-types/dimension-control/stories/index.d.ts.map +1 -0
  526. package/build-types/dimension-control/types.d.ts +47 -0
  527. package/build-types/dimension-control/types.d.ts.map +1 -0
  528. package/build-types/divider/types.d.ts +1 -1
  529. package/build-types/divider/types.d.ts.map +1 -1
  530. package/build-types/draggable/types.d.ts +1 -1
  531. package/build-types/draggable/types.d.ts.map +1 -1
  532. package/build-types/drop-zone/types.d.ts +2 -2
  533. package/build-types/drop-zone/types.d.ts.map +1 -1
  534. package/build-types/dropdown/types.d.ts +3 -3
  535. package/build-types/dropdown/types.d.ts.map +1 -1
  536. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -0
  537. package/build-types/{color-list-picker → duotone-picker/color-list-picker}/types.d.ts +4 -4
  538. package/build-types/duotone-picker/color-list-picker/types.d.ts.map +1 -0
  539. package/build-types/duotone-picker/custom-duotone-bar.d.ts +6 -0
  540. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -0
  541. package/build-types/duotone-picker/duotone-picker.d.ts +38 -0
  542. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -0
  543. package/build-types/duotone-picker/duotone-swatch.d.ts +5 -0
  544. package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -0
  545. package/build-types/duotone-picker/index.d.ts +3 -0
  546. package/build-types/duotone-picker/index.d.ts.map +1 -0
  547. package/build-types/duotone-picker/stories/duotone-picker.d.ts +12 -0
  548. package/build-types/duotone-picker/stories/duotone-picker.d.ts.map +1 -0
  549. package/build-types/duotone-picker/stories/duotone-swatch.d.ts +14 -0
  550. package/build-types/duotone-picker/stories/duotone-swatch.d.ts.map +1 -0
  551. package/build-types/duotone-picker/types.d.ts +60 -0
  552. package/build-types/duotone-picker/types.d.ts.map +1 -0
  553. package/build-types/duotone-picker/utils.d.ts +52 -0
  554. package/build-types/duotone-picker/utils.d.ts.map +1 -0
  555. package/build-types/elevation/types.d.ts +1 -1
  556. package/build-types/elevation/types.d.ts.map +1 -1
  557. package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
  558. package/build-types/external-link/types.d.ts +1 -1
  559. package/build-types/external-link/types.d.ts.map +1 -1
  560. package/build-types/flex/types.d.ts +4 -4
  561. package/build-types/flex/types.d.ts.map +1 -1
  562. package/build-types/focal-point-picker/types.d.ts +7 -7
  563. package/build-types/focal-point-picker/types.d.ts.map +1 -1
  564. package/build-types/font-size-picker/index.d.ts.map +1 -1
  565. package/build-types/font-size-picker/stories/index.d.ts.map +1 -1
  566. package/build-types/font-size-picker/types.d.ts +9 -5
  567. package/build-types/font-size-picker/types.d.ts.map +1 -1
  568. package/build-types/form-file-upload/types.d.ts +1 -1
  569. package/build-types/form-file-upload/types.d.ts.map +1 -1
  570. package/build-types/form-toggle/types.d.ts +1 -1
  571. package/build-types/form-toggle/types.d.ts.map +1 -1
  572. package/build-types/form-token-field/index.d.ts.map +1 -1
  573. package/build-types/form-token-field/stories/index.d.ts +6 -0
  574. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  575. package/build-types/form-token-field/styles.d.ts +1 -1
  576. package/build-types/form-token-field/styles.d.ts.map +1 -1
  577. package/build-types/form-token-field/types.d.ts +7 -1
  578. package/build-types/form-token-field/types.d.ts.map +1 -1
  579. package/build-types/gradient-picker/index.d.ts +50 -0
  580. package/build-types/gradient-picker/index.d.ts.map +1 -0
  581. package/build-types/gradient-picker/stories/index.d.ts +14 -0
  582. package/build-types/gradient-picker/stories/index.d.ts.map +1 -0
  583. package/build-types/gradient-picker/types.d.ts +87 -0
  584. package/build-types/gradient-picker/types.d.ts.map +1 -0
  585. package/build-types/grid/types.d.ts +2 -2
  586. package/build-types/grid/types.d.ts.map +1 -1
  587. package/build-types/guide/icons.d.ts +5 -0
  588. package/build-types/guide/icons.d.ts.map +1 -0
  589. package/build-types/guide/index.d.ts +37 -0
  590. package/build-types/guide/index.d.ts.map +1 -0
  591. package/build-types/guide/page-control.d.ts +4 -0
  592. package/build-types/guide/page-control.d.ts.map +1 -0
  593. package/build-types/guide/page.d.ts +7 -0
  594. package/build-types/guide/page.d.ts.map +1 -0
  595. package/build-types/guide/stories/index.d.ts +9 -0
  596. package/build-types/guide/stories/index.d.ts.map +1 -0
  597. package/build-types/guide/test/index.d.ts +2 -0
  598. package/build-types/guide/test/index.d.ts.map +1 -0
  599. package/build-types/guide/types.d.ts +65 -0
  600. package/build-types/guide/types.d.ts.map +1 -0
  601. package/build-types/h-stack/types.d.ts +6 -6
  602. package/build-types/h-stack/types.d.ts.map +1 -1
  603. package/build-types/heading/hook.d.ts +1 -1
  604. package/build-types/heading/types.d.ts +2 -2
  605. package/build-types/heading/types.d.ts.map +1 -1
  606. package/build-types/higher-order/navigate-regions/index.d.ts +46 -0
  607. package/build-types/higher-order/navigate-regions/index.d.ts.map +1 -0
  608. package/build-types/higher-order/with-fallback-styles/index.d.ts +44 -0
  609. package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -0
  610. package/build-types/higher-order/with-filters/index.d.ts +89 -0
  611. package/build-types/higher-order/with-filters/index.d.ts.map +1 -0
  612. package/build-types/higher-order/with-filters/test/index.d.ts +2 -0
  613. package/build-types/higher-order/with-filters/test/index.d.ts.map +1 -0
  614. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  615. package/build-types/higher-order/with-focus-return/index.d.ts +20 -0
  616. package/build-types/higher-order/with-focus-return/index.d.ts.map +1 -0
  617. package/build-types/higher-order/with-focus-return/test/index.d.ts +2 -0
  618. package/build-types/higher-order/with-focus-return/test/index.d.ts.map +1 -0
  619. package/build-types/higher-order/with-notices/index.d.ts +37 -0
  620. package/build-types/higher-order/with-notices/index.d.ts.map +1 -0
  621. package/build-types/higher-order/with-notices/test/index.d.ts +2 -0
  622. package/build-types/higher-order/with-notices/test/index.d.ts.map +1 -0
  623. package/build-types/higher-order/with-notices/types.d.ts +34 -0
  624. package/build-types/higher-order/with-notices/types.d.ts.map +1 -0
  625. package/build-types/higher-order/with-spoken-messages/index.d.ts +13 -2
  626. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  627. package/build-types/higher-order/with-spoken-messages/test/index.d.ts +2 -0
  628. package/build-types/higher-order/with-spoken-messages/test/index.d.ts.map +1 -0
  629. package/build-types/icon/index.d.ts +10 -6
  630. package/build-types/icon/index.d.ts.map +1 -1
  631. package/build-types/icon/test/index.d.ts +2 -0
  632. package/build-types/icon/test/index.d.ts.map +1 -0
  633. package/build-types/input-control/reducer/actions.d.ts +15 -15
  634. package/build-types/input-control/reducer/actions.d.ts.map +1 -1
  635. package/build-types/input-control/reducer/state.d.ts +1 -1
  636. package/build-types/input-control/reducer/state.d.ts.map +1 -1
  637. package/build-types/input-control/styles/input-control-styles.d.ts +4 -4
  638. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  639. package/build-types/input-control/types.d.ts +7 -7
  640. package/build-types/input-control/types.d.ts.map +1 -1
  641. package/build-types/item-group/item/hook.d.ts +1 -1
  642. package/build-types/item-group/types.d.ts +2 -2
  643. package/build-types/item-group/types.d.ts.map +1 -1
  644. package/build-types/keyboard-shortcuts/types.d.ts +3 -3
  645. package/build-types/keyboard-shortcuts/types.d.ts.map +1 -1
  646. package/build-types/menu-group/types.d.ts +1 -1
  647. package/build-types/menu-group/types.d.ts.map +1 -1
  648. package/build-types/menu-item/index.d.ts +1 -1
  649. package/build-types/menu-items-choice/types.d.ts +2 -2
  650. package/build-types/menu-items-choice/types.d.ts.map +1 -1
  651. package/build-types/modal/types.d.ts +1 -1
  652. package/build-types/modal/types.d.ts.map +1 -1
  653. package/build-types/navigable-container/container.d.ts +1 -1
  654. package/build-types/navigable-container/menu.d.ts +1 -1
  655. package/build-types/navigable-container/tabbable.d.ts +1 -1
  656. package/build-types/navigation/back-button/index.d.ts +5 -0
  657. package/build-types/navigation/back-button/index.d.ts.map +1 -0
  658. package/build-types/navigation/constants.d.ts +3 -0
  659. package/build-types/navigation/constants.d.ts.map +1 -0
  660. package/build-types/navigation/context.d.ts +5 -0
  661. package/build-types/navigation/context.d.ts.map +1 -0
  662. package/build-types/navigation/group/context.d.ts +8 -0
  663. package/build-types/navigation/group/context.d.ts.map +1 -0
  664. package/build-types/navigation/group/index.d.ts +5 -0
  665. package/build-types/navigation/group/index.d.ts.map +1 -0
  666. package/build-types/navigation/index.d.ts +46 -0
  667. package/build-types/navigation/index.d.ts.map +1 -0
  668. package/build-types/navigation/item/base-content.d.ts +4 -0
  669. package/build-types/navigation/item/base-content.d.ts.map +1 -0
  670. package/build-types/navigation/item/base.d.ts +4 -0
  671. package/build-types/navigation/item/base.d.ts.map +1 -0
  672. package/build-types/navigation/item/index.d.ts +5 -0
  673. package/build-types/navigation/item/index.d.ts.map +1 -0
  674. package/build-types/navigation/item/use-navigation-tree-item.d.ts +3 -0
  675. package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +1 -0
  676. package/build-types/navigation/menu/context.d.ts +8 -0
  677. package/build-types/navigation/menu/context.d.ts.map +1 -0
  678. package/build-types/navigation/menu/index.d.ts +5 -0
  679. package/build-types/navigation/menu/index.d.ts.map +1 -0
  680. package/build-types/navigation/menu/menu-title-search.d.ts +4 -0
  681. package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -0
  682. package/build-types/navigation/menu/menu-title.d.ts +4 -0
  683. package/build-types/navigation/menu/menu-title.d.ts.map +1 -0
  684. package/build-types/navigation/menu/search-no-results-found.d.ts +4 -0
  685. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -0
  686. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +3 -0
  687. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +1 -0
  688. package/build-types/navigation/stories/index.d.ts +18 -0
  689. package/build-types/navigation/stories/index.d.ts.map +1 -0
  690. package/build-types/navigation/stories/utils/controlled-state.d.ts +7 -0
  691. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -0
  692. package/build-types/navigation/stories/utils/default.d.ts +10 -0
  693. package/build-types/navigation/stories/utils/default.d.ts.map +1 -0
  694. package/build-types/navigation/stories/utils/group.d.ts +10 -0
  695. package/build-types/navigation/stories/utils/group.d.ts.map +1 -0
  696. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +10 -0
  697. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -0
  698. package/build-types/navigation/stories/utils/more-examples.d.ts +10 -0
  699. package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -0
  700. package/build-types/navigation/stories/utils/search.d.ts +10 -0
  701. package/build-types/navigation/stories/utils/search.d.ts.map +1 -0
  702. package/build-types/navigation/styles/navigation-styles.d.ts +58 -0
  703. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -0
  704. package/build-types/navigation/test/index.d.ts +2 -0
  705. package/build-types/navigation/test/index.d.ts.map +1 -0
  706. package/build-types/navigation/types.d.ts +267 -0
  707. package/build-types/navigation/types.d.ts.map +1 -0
  708. package/build-types/navigation/use-create-navigation-tree.d.ts +15 -0
  709. package/build-types/navigation/use-create-navigation-tree.d.ts.map +1 -0
  710. package/build-types/navigation/use-navigation-tree-nodes.d.ts +11 -0
  711. package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +1 -0
  712. package/build-types/navigation/utils.d.ts +3 -0
  713. package/build-types/navigation/utils.d.ts.map +1 -0
  714. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  715. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
  716. package/build-types/navigator/navigator-button/component.d.ts +1 -1
  717. package/build-types/navigator/navigator-button/hook.d.ts +1 -1
  718. package/build-types/navigator/navigator-screen/component.d.ts +1 -1
  719. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  720. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
  721. package/build-types/navigator/types.d.ts +12 -12
  722. package/build-types/navigator/types.d.ts.map +1 -1
  723. package/build-types/notice/types.d.ts +7 -7
  724. package/build-types/notice/types.d.ts.map +1 -1
  725. package/build-types/number-control/index.d.ts.map +1 -1
  726. package/build-types/number-control/types.d.ts +1 -1
  727. package/build-types/number-control/types.d.ts.map +1 -1
  728. package/build-types/palette-edit/index.d.ts +37 -0
  729. package/build-types/palette-edit/index.d.ts.map +1 -0
  730. package/build-types/palette-edit/stories/index.d.ts +13 -0
  731. package/build-types/palette-edit/stories/index.d.ts.map +1 -0
  732. package/build-types/palette-edit/styles.d.ts +51 -0
  733. package/build-types/palette-edit/styles.d.ts.map +1 -0
  734. package/build-types/palette-edit/test/index.d.ts +2 -0
  735. package/build-types/palette-edit/test/index.d.ts.map +1 -0
  736. package/build-types/palette-edit/types.d.ts +114 -0
  737. package/build-types/palette-edit/types.d.ts.map +1 -0
  738. package/build-types/panel/body.d.ts +9 -0
  739. package/build-types/panel/body.d.ts.map +1 -0
  740. package/build-types/panel/stories/index.d.ts +19 -0
  741. package/build-types/panel/stories/index.d.ts.map +1 -0
  742. package/build-types/panel/test/body.d.ts +2 -0
  743. package/build-types/panel/test/body.d.ts.map +1 -0
  744. package/build-types/panel/types.d.ts +73 -3
  745. package/build-types/panel/types.d.ts.map +1 -1
  746. package/build-types/placeholder/index.d.ts +1 -1
  747. package/build-types/placeholder/index.d.ts.map +1 -1
  748. package/build-types/placeholder/types.d.ts +2 -2
  749. package/build-types/placeholder/types.d.ts.map +1 -1
  750. package/build-types/popover/limit-shift.d.ts +2 -2
  751. package/build-types/popover/limit-shift.d.ts.map +1 -1
  752. package/build-types/popover/types.d.ts +10 -10
  753. package/build-types/popover/types.d.ts.map +1 -1
  754. package/build-types/popover/utils.d.ts +2 -2
  755. package/build-types/popover/utils.d.ts.map +1 -1
  756. package/build-types/query-controls/author-select.d.ts.map +1 -1
  757. package/build-types/query-controls/category-select.d.ts.map +1 -1
  758. package/build-types/query-controls/terms.d.ts.map +1 -1
  759. package/build-types/query-controls/types.d.ts +12 -12
  760. package/build-types/query-controls/types.d.ts.map +1 -1
  761. package/build-types/radio-control/types.d.ts +1 -1
  762. package/build-types/radio-control/types.d.ts.map +1 -1
  763. package/build-types/radio-group/index.d.ts +1 -1
  764. package/build-types/radio-group/radio/index.d.ts +1 -1
  765. package/build-types/range-control/index.d.ts +2 -2
  766. package/build-types/range-control/index.d.ts.map +1 -1
  767. package/build-types/range-control/types.d.ts +17 -17
  768. package/build-types/range-control/types.d.ts.map +1 -1
  769. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  770. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  771. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  772. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  773. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  774. package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
  775. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  776. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  777. package/build-types/responsive-wrapper/stories/index.d.ts +10 -0
  778. package/build-types/responsive-wrapper/stories/index.d.ts.map +1 -1
  779. package/build-types/responsive-wrapper/types.d.ts +3 -3
  780. package/build-types/responsive-wrapper/types.d.ts.map +1 -1
  781. package/build-types/sandbox/types.d.ts +1 -1
  782. package/build-types/sandbox/types.d.ts.map +1 -1
  783. package/build-types/scrollable/types.d.ts +2 -2
  784. package/build-types/scrollable/types.d.ts.map +1 -1
  785. package/build-types/search-control/types.d.ts +1 -1
  786. package/build-types/search-control/types.d.ts.map +1 -1
  787. package/build-types/select-control/index.d.ts +2 -1
  788. package/build-types/select-control/index.d.ts.map +1 -1
  789. package/build-types/select-control/stories/index.d.ts +3 -3
  790. package/build-types/select-control/stories/index.d.ts.map +1 -1
  791. package/build-types/select-control/types.d.ts +44 -20
  792. package/build-types/select-control/types.d.ts.map +1 -1
  793. package/build-types/shortcut/types.d.ts +1 -1
  794. package/build-types/shortcut/types.d.ts.map +1 -1
  795. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
  796. package/build-types/slot-fill/provider.d.ts +1 -0
  797. package/build-types/slot-fill/provider.d.ts.map +1 -1
  798. package/build-types/snackbar/types.d.ts +3 -3
  799. package/build-types/snackbar/types.d.ts.map +1 -1
  800. package/build-types/spacer/types.d.ts +1 -1
  801. package/build-types/spacer/types.d.ts.map +1 -1
  802. package/build-types/spinner/index.d.ts +1 -1
  803. package/build-types/style-provider/types.d.ts +1 -1
  804. package/build-types/style-provider/types.d.ts.map +1 -1
  805. package/build-types/surface/types.d.ts +2 -2
  806. package/build-types/surface/types.d.ts.map +1 -1
  807. package/build-types/tab-panel/index.d.ts.map +1 -1
  808. package/build-types/tab-panel/types.d.ts +5 -5
  809. package/build-types/tab-panel/types.d.ts.map +1 -1
  810. package/build-types/text/types.d.ts +3 -3
  811. package/build-types/text/types.d.ts.map +1 -1
  812. package/build-types/text-control/types.d.ts +1 -1
  813. package/build-types/text-control/types.d.ts.map +1 -1
  814. package/build-types/text-highlight/types.d.ts +1 -1
  815. package/build-types/text-highlight/types.d.ts.map +1 -1
  816. package/build-types/textarea-control/types.d.ts +1 -1
  817. package/build-types/textarea-control/types.d.ts.map +1 -1
  818. package/build-types/theme/types.d.ts +3 -3
  819. package/build-types/theme/types.d.ts.map +1 -1
  820. package/build-types/tip/types.d.ts +1 -1
  821. package/build-types/tip/types.d.ts.map +1 -1
  822. package/build-types/toggle-control/types.d.ts +1 -1
  823. package/build-types/toggle-control/types.d.ts.map +1 -1
  824. package/build-types/toggle-group-control/types.d.ts +10 -10
  825. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  826. package/build-types/toolbar/toolbar/types.d.ts +1 -1
  827. package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
  828. package/build-types/toolbar/toolbar-button/index.d.ts +165 -11
  829. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  830. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +6 -1
  831. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
  832. package/build-types/toolbar/toolbar-button/types.d.ts +45 -0
  833. package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -0
  834. package/build-types/toolbar/toolbar-context/index.d.ts +6 -1
  835. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  836. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +1 -1
  837. package/build-types/toolbar/toolbar-item/index.d.ts +1 -1
  838. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  839. package/build-types/tools-panel/types.d.ts +12 -11
  840. package/build-types/tools-panel/types.d.ts.map +1 -1
  841. package/build-types/tooltip/index.d.ts.map +1 -1
  842. package/build-types/tree-grid/types.d.ts +5 -5
  843. package/build-types/tree-grid/types.d.ts.map +1 -1
  844. package/build-types/tree-select/index.d.ts.map +1 -1
  845. package/build-types/tree-select/types.d.ts +4 -10
  846. package/build-types/tree-select/types.d.ts.map +1 -1
  847. package/build-types/truncate/types.d.ts +2 -2
  848. package/build-types/truncate/types.d.ts.map +1 -1
  849. package/build-types/ui/context/context-connect.d.ts +1 -1
  850. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  851. package/build-types/ui/context/wordpress-component.d.ts +3 -3
  852. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  853. package/build-types/ui/control-group/types.d.ts +2 -2
  854. package/build-types/ui/control-group/types.d.ts.map +1 -1
  855. package/build-types/ui/control-label/types.d.ts +1 -1
  856. package/build-types/ui/control-label/types.d.ts.map +1 -1
  857. package/build-types/ui/form-group/form-group-content.d.ts +1 -1
  858. package/build-types/ui/form-group/form-group-help.d.ts +1 -1
  859. package/build-types/ui/form-group/form-group-label.d.ts +1 -1
  860. package/build-types/ui/form-group/types.d.ts +5 -5
  861. package/build-types/ui/form-group/types.d.ts.map +1 -1
  862. package/build-types/ui/form-group/use-form-group.d.ts +3 -3
  863. package/build-types/ui/spinner/component.d.ts +1 -1
  864. package/build-types/ui/tooltip/content.d.ts +1 -1
  865. package/build-types/ui/tooltip/types.d.ts +2 -2
  866. package/build-types/ui/tooltip/types.d.ts.map +1 -1
  867. package/build-types/ui/utils/font-size.d.ts +1 -1
  868. package/build-types/ui/utils/font-size.d.ts.map +1 -1
  869. package/build-types/ui/utils/space.d.ts +1 -1
  870. package/build-types/ui/utils/space.d.ts.map +1 -1
  871. package/build-types/ui/utils/types.d.ts +4 -4
  872. package/build-types/ui/utils/types.d.ts.map +1 -1
  873. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  874. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  875. package/build-types/unit-control/types.d.ts +5 -5
  876. package/build-types/unit-control/types.d.ts.map +1 -1
  877. package/build-types/utils/breakpoint-values.d.ts +1 -1
  878. package/build-types/utils/colors-values.d.ts +1 -1
  879. package/build-types/utils/config-values.d.ts +9 -9
  880. package/build-types/utils/events.d.ts +1 -1
  881. package/build-types/utils/events.d.ts.map +1 -1
  882. package/build-types/utils/font-values.d.ts +1 -1
  883. package/build-types/utils/font.d.ts.map +1 -1
  884. package/build-types/utils/hooks/use-controlled-value.d.ts +1 -1
  885. package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
  886. package/build-types/utils/input/input-control.d.ts.map +1 -1
  887. package/build-types/utils/types.d.ts +4 -4
  888. package/build-types/utils/types.d.ts.map +1 -1
  889. package/build-types/v-stack/component.d.ts +1 -4
  890. package/build-types/v-stack/component.d.ts.map +1 -1
  891. package/build-types/v-stack/hook.d.ts.map +1 -1
  892. package/build-types/v-stack/stories/index.d.ts +1 -4
  893. package/build-types/v-stack/stories/index.d.ts.map +1 -1
  894. package/build-types/v-stack/types.d.ts +5 -3
  895. package/build-types/v-stack/types.d.ts.map +1 -1
  896. package/build-types/view/types.d.ts +1 -1
  897. package/build-types/view/types.d.ts.map +1 -1
  898. package/build-types/visually-hidden/types.d.ts +1 -1
  899. package/build-types/visually-hidden/types.d.ts.map +1 -1
  900. package/build-types/z-stack/types.d.ts +1 -1
  901. package/build-types/z-stack/types.d.ts.map +1 -1
  902. package/package.json +20 -20
  903. package/src/angle-picker-control/angle-circle.tsx +0 -1
  904. package/src/angle-picker-control/index.tsx +14 -27
  905. package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +16 -9
  906. package/src/animate/index.tsx +75 -0
  907. package/src/animate/stories/index.tsx +102 -0
  908. package/src/animate/types.ts +32 -0
  909. package/src/autocomplete/README.md +51 -0
  910. package/src/autocomplete/{autocompleter-ui.js → autocompleter-ui.tsx} +21 -10
  911. package/src/autocomplete/{get-default-use-items.js → get-default-use-items.tsx} +11 -6
  912. package/src/autocomplete/{index.js → index.tsx} +77 -111
  913. package/src/autocomplete/test/{index.js → index.tsx} +31 -20
  914. package/src/autocomplete/types.ts +220 -0
  915. package/src/border-box-control/stories/index.tsx +1 -1
  916. package/src/border-control/test/index.js +0 -2
  917. package/src/box-control/axial-input-controls.tsx +1 -1
  918. package/src/button/style.scss +12 -1
  919. package/src/button/types.ts +2 -2
  920. package/src/circular-option-picker/style.scss +10 -0
  921. package/src/circular-option-picker/types.ts +1 -1
  922. package/src/color-indicator/style.scss +1 -0
  923. package/src/color-palette/test/__snapshots__/index.tsx.snap +16 -14
  924. package/src/color-picker/README.md +2 -2
  925. package/src/color-picker/color-input.tsx +1 -12
  926. package/src/color-picker/component.tsx +9 -18
  927. package/src/color-picker/hex-input.tsx +2 -7
  928. package/src/color-picker/hsl-input.tsx +2 -7
  929. package/src/color-picker/input-with-slider.tsx +1 -9
  930. package/src/color-picker/legacy-adapter.tsx +1 -2
  931. package/src/color-picker/picker.tsx +5 -6
  932. package/src/color-picker/rgb-input.tsx +2 -7
  933. package/src/color-picker/stories/index.tsx +51 -0
  934. package/src/color-picker/test/{index.js → index.tsx} +36 -18
  935. package/src/color-picker/types.ts +128 -1
  936. package/src/color-picker/use-deprecated-props.ts +2 -53
  937. package/src/combobox-control/stories/index.tsx +1 -1
  938. package/src/custom-gradient-picker/{constants.js → constants.ts} +2 -2
  939. package/src/custom-gradient-picker/gradient-bar/{control-points.js → control-points.tsx} +171 -132
  940. package/src/custom-gradient-picker/gradient-bar/{index.js → index.tsx} +32 -8
  941. package/src/custom-gradient-picker/gradient-bar/test/{utils.js → utils.ts} +58 -31
  942. package/src/custom-gradient-picker/gradient-bar/utils.ts +193 -0
  943. package/src/custom-gradient-picker/{index.js → index.tsx} +63 -20
  944. package/src/custom-gradient-picker/serializer.ts +82 -0
  945. package/src/custom-gradient-picker/stories/index.tsx +45 -0
  946. package/src/custom-gradient-picker/style.scss +25 -4
  947. package/src/custom-gradient-picker/test/{serializer.js → serializer.ts} +39 -33
  948. package/src/custom-gradient-picker/types.ts +137 -0
  949. package/src/custom-gradient-picker/{utils.js → utils.ts} +37 -20
  950. package/src/custom-select-control/test/index.js +6 -4
  951. package/src/dimension-control/README.md +22 -55
  952. package/src/dimension-control/index.tsx +101 -0
  953. package/src/dimension-control/{sizes.js → sizes.ts} +8 -5
  954. package/src/dimension-control/stories/index.tsx +48 -0
  955. package/src/dimension-control/types.ts +48 -0
  956. package/src/{color-list-picker → duotone-picker/color-list-picker}/index.tsx +7 -6
  957. package/src/{color-list-picker → duotone-picker/color-list-picker}/types.ts +2 -2
  958. package/src/duotone-picker/{custom-duotone-bar.js → custom-duotone-bar.tsx} +7 -1
  959. package/src/duotone-picker/{duotone-picker.js → duotone-picker.tsx} +39 -2
  960. package/src/duotone-picker/{duotone-swatch.js → duotone-swatch.tsx} +2 -1
  961. package/src/duotone-picker/stories/{duotone-picker.js → duotone-picker.tsx} +15 -8
  962. package/src/duotone-picker/stories/{duotone-swatch.js → duotone-swatch.tsx} +9 -3
  963. package/src/duotone-picker/types.ts +61 -0
  964. package/src/duotone-picker/{utils.js → utils.ts} +29 -14
  965. package/src/flex/flex/hook.ts +2 -2
  966. package/src/flex/flex-item/README.md +1 -1
  967. package/src/font-size-picker/README.md +26 -20
  968. package/src/font-size-picker/index.tsx +2 -1
  969. package/src/font-size-picker/stories/index.tsx +1 -0
  970. package/src/font-size-picker/test/index.tsx +23 -0
  971. package/src/font-size-picker/types.ts +4 -0
  972. package/src/form-token-field/README.md +1 -0
  973. package/src/form-token-field/index.tsx +14 -4
  974. package/src/form-token-field/stories/index.tsx +13 -0
  975. package/src/form-token-field/style.scss +0 -7
  976. package/src/form-token-field/test/index.tsx +81 -0
  977. package/src/form-token-field/types.ts +6 -0
  978. package/src/gradient-picker/README.md +16 -23
  979. package/src/gradient-picker/{index.js → index.tsx} +70 -14
  980. package/src/gradient-picker/stories/{index.js → index.tsx} +19 -8
  981. package/src/gradient-picker/types.ts +89 -0
  982. package/src/guide/README.md +17 -15
  983. package/src/guide/{icons.js → icons.tsx} +1 -1
  984. package/src/guide/{index.js → index.tsx} +47 -7
  985. package/src/guide/{page-control.js → page-control.tsx} +2 -1
  986. package/src/guide/{page.js → page.tsx} +8 -1
  987. package/src/guide/stories/{index.js → index.tsx} +11 -5
  988. package/src/guide/test/{index.js → index.tsx} +22 -4
  989. package/src/guide/types.ts +68 -0
  990. package/src/h-stack/README.md +2 -2
  991. package/src/h-stack/types.ts +2 -2
  992. package/src/h-stack/utils.ts +3 -3
  993. package/src/higher-order/navigate-regions/{index.js → index.tsx} +47 -11
  994. package/src/higher-order/with-fallback-styles/{index.js → index.tsx} +22 -5
  995. package/src/higher-order/with-filters/{index.js → index.tsx} +44 -12
  996. package/src/higher-order/with-filters/test/{index.js → index.tsx} +5 -1
  997. package/src/higher-order/with-focus-return/index.tsx +74 -0
  998. package/src/higher-order/with-focus-return/test/{index.js → index.tsx} +2 -2
  999. package/src/higher-order/with-notices/README.md +4 -1
  1000. package/src/higher-order/with-notices/index.tsx +116 -0
  1001. package/src/higher-order/with-notices/test/{index.js → index.tsx} +11 -6
  1002. package/src/higher-order/with-notices/types.ts +35 -0
  1003. package/src/higher-order/with-spoken-messages/test/{index.js → index.tsx} +2 -1
  1004. package/src/icon/index.tsx +11 -15
  1005. package/src/icon/test/{index.js → index.tsx} +6 -2
  1006. package/src/index.native.js +1 -0
  1007. package/src/item-group/test/index.js +5 -3
  1008. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +1 -1
  1009. package/src/mobile/bottom-sheet/cell.native.js +1 -1
  1010. package/src/mobile/bottom-sheet-text-control/README.md +8 -1
  1011. package/src/mobile/bottom-sheet-text-control/index.native.js +2 -1
  1012. package/src/mobile/link-settings/test/link-settings-navigation.native.js +1 -1
  1013. package/src/navigation/README.md +16 -2
  1014. package/src/navigation/back-button/{index.js → index.tsx} +22 -6
  1015. package/src/navigation/{context.js → context.tsx} +8 -5
  1016. package/src/navigation/group/context.tsx +15 -0
  1017. package/src/navigation/group/{index.js → index.tsx} +9 -1
  1018. package/src/navigation/{index.js → index.tsx} +63 -7
  1019. package/src/navigation/item/{base-content.js → base-content.tsx} +5 -2
  1020. package/src/navigation/item/{base.js → base.tsx} +3 -1
  1021. package/src/navigation/item/{index.js → index.tsx} +8 -2
  1022. package/src/navigation/item/{use-navigation-tree-item.js → use-navigation-tree-item.tsx} +9 -2
  1023. package/src/navigation/menu/context.tsx +18 -0
  1024. package/src/navigation/menu/{index.js → index.tsx} +5 -1
  1025. package/src/navigation/menu/{menu-title-search.js → menu-title-search.tsx} +11 -7
  1026. package/src/navigation/menu/{menu-title.js → menu-title.tsx} +5 -3
  1027. package/src/navigation/menu/{search-no-results-found.js → search-no-results-found.tsx} +5 -1
  1028. package/src/navigation/menu/{use-navigation-tree-menu.js → use-navigation-tree-menu.tsx} +3 -1
  1029. package/src/navigation/stories/index.tsx +53 -0
  1030. package/src/navigation/stories/utils/{controlled-state.js → controlled-state.tsx} +32 -13
  1031. package/src/navigation/stories/utils/{default.js → default.tsx} +20 -6
  1032. package/src/navigation/stories/utils/{group.js → group.tsx} +21 -7
  1033. package/src/navigation/stories/utils/{hide-if-empty.js → hide-if-empty.tsx} +19 -6
  1034. package/src/navigation/stories/utils/{more-examples.js → more-examples.tsx} +30 -12
  1035. package/src/navigation/stories/utils/{search.js → search.tsx} +21 -7
  1036. package/src/navigation/test/{index.js → index.tsx} +17 -4
  1037. package/src/navigation/types.ts +325 -0
  1038. package/src/navigation/{use-create-navigation-tree.js → use-create-navigation-tree.tsx} +37 -25
  1039. package/src/navigation/{use-navigation-tree-nodes.js → use-navigation-tree-nodes.tsx} +10 -6
  1040. package/src/navigation/{utils.js → utils.tsx} +2 -2
  1041. package/src/navigator/navigator-screen/component.tsx +13 -7
  1042. package/src/navigator/test/index.tsx +65 -22
  1043. package/src/number-control/index.tsx +0 -2
  1044. package/src/palette-edit/{index.js → index.tsx} +114 -48
  1045. package/src/palette-edit/stories/index.tsx +82 -0
  1046. package/src/palette-edit/test/{index.js → index.tsx} +15 -3
  1047. package/src/palette-edit/types.ts +126 -0
  1048. package/src/panel/README.md +53 -35
  1049. package/src/panel/{body.js → body.tsx} +31 -17
  1050. package/src/panel/stories/{index.js → index.tsx} +16 -6
  1051. package/src/panel/test/{body.js → body.tsx} +12 -17
  1052. package/src/panel/types.ts +78 -0
  1053. package/src/placeholder/index.tsx +2 -6
  1054. package/src/placeholder/test/index.tsx +1 -1
  1055. package/src/placeholder/types.ts +2 -2
  1056. package/src/popover/test/index.tsx +5 -2
  1057. package/src/query-controls/author-select.tsx +1 -6
  1058. package/src/query-controls/category-select.tsx +1 -6
  1059. package/src/query-controls/terms.ts +29 -18
  1060. package/src/range-control/index.tsx +2 -6
  1061. package/src/range-control/types.ts +3 -3
  1062. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -1
  1063. package/src/resizable-box/resize-tooltip/utils.ts +1 -1
  1064. package/src/responsive-wrapper/README.md +8 -2
  1065. package/src/responsive-wrapper/index.tsx +18 -17
  1066. package/src/responsive-wrapper/stories/index.tsx +41 -0
  1067. package/src/responsive-wrapper/style.scss +5 -11
  1068. package/src/responsive-wrapper/types.ts +2 -2
  1069. package/src/sandbox/index.native.js +71 -78
  1070. package/src/select-control/index.tsx +16 -16
  1071. package/src/select-control/stories/index.tsx +24 -12
  1072. package/src/select-control/types.ts +68 -40
  1073. package/src/slot-fill/test/slot.js +8 -6
  1074. package/src/style.scss +1 -1
  1075. package/src/tab-panel/index.tsx +7 -2
  1076. package/src/tab-panel/types.ts +4 -4
  1077. package/src/toolbar/toolbar-button/README.md +13 -1
  1078. package/src/toolbar/toolbar-button/{index.js → index.tsx} +55 -20
  1079. package/src/toolbar/toolbar-button/toolbar-button-container.tsx +13 -0
  1080. package/src/toolbar/toolbar-button/types.ts +46 -0
  1081. package/src/toolbar/toolbar-context/index.ts +15 -0
  1082. package/src/tools-panel/test/index.tsx +86 -0
  1083. package/src/tools-panel/tools-panel/hook.ts +44 -4
  1084. package/src/tools-panel/types.ts +1 -0
  1085. package/src/tooltip/index.js +11 -1
  1086. package/src/tooltip/test/index.js +251 -301
  1087. package/src/tree-select/index.tsx +5 -2
  1088. package/src/tree-select/types.ts +6 -13
  1089. package/src/ui/context/get-styled-class-name-from-key.ts +1 -1
  1090. package/src/utils/font.js +1 -6
  1091. package/src/utils/input/input-control.js +1 -0
  1092. package/src/v-stack/README.md +2 -2
  1093. package/src/v-stack/hook.ts +6 -4
  1094. package/src/v-stack/stories/index.tsx +28 -7
  1095. package/src/v-stack/test/__snapshots__/index.tsx.snap +20 -18
  1096. package/src/v-stack/types.ts +5 -3
  1097. package/tsconfig.json +1 -15
  1098. package/tsconfig.tsbuildinfo +1 -1
  1099. package/build/color-list-picker/index.js.map +0 -1
  1100. package/build-module/color-list-picker/index.js.map +0 -1
  1101. package/build-types/color-list-picker/index.d.ts.map +0 -1
  1102. package/build-types/color-list-picker/types.d.ts.map +0 -1
  1103. package/src/animate/index.js +0 -58
  1104. package/src/animate/stories/index.js +0 -53
  1105. package/src/color-picker/stories/index.js +0 -41
  1106. package/src/custom-gradient-picker/gradient-bar/utils.js +0 -187
  1107. package/src/custom-gradient-picker/serializer.js +0 -46
  1108. package/src/custom-gradient-picker/stories/index.js +0 -33
  1109. package/src/dimension-control/index.js +0 -73
  1110. package/src/higher-order/with-focus-return/index.js +0 -64
  1111. package/src/higher-order/with-notices/index.js +0 -104
  1112. package/src/navigation/group/context.js +0 -9
  1113. package/src/navigation/menu/context.js +0 -11
  1114. package/src/navigation/stories/index.js +0 -33
  1115. package/src/toolbar/toolbar-button/toolbar-button-container.js +0 -6
  1116. package/src/toolbar/toolbar-context/index.js +0 -10
  1117. /package/build/{color-list-picker → animate}/types.js +0 -0
  1118. /package/build-module/{color-list-picker → animate}/types.js +0 -0
  1119. /package/build-module/{color-list-picker → animate}/types.js.map +0 -0
  1120. /package/{build/color-list-picker → build-module/autocomplete}/types.js.map +0 -0
  1121. /package/build-types/{color-list-picker → duotone-picker/color-list-picker}/index.d.ts +0 -0
  1122. /package/src/animation/{index.js → index.tsx} +0 -0
  1123. /package/src/custom-gradient-picker/gradient-bar/{constants.js → constants.ts} +0 -0
  1124. /package/src/custom-gradient-picker/styles/{custom-gradient-picker-styles.js → custom-gradient-picker-styles.tsx} +0 -0
  1125. /package/src/{color-list-picker → duotone-picker/color-list-picker}/style.scss +0 -0
  1126. /package/src/duotone-picker/{index.js → index.ts} +0 -0
  1127. /package/src/higher-order/with-filters/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1128. /package/src/higher-order/with-spoken-messages/{index.js → index.tsx} +0 -0
  1129. /package/src/navigation/{constants.js → constants.tsx} +0 -0
  1130. /package/src/navigation/styles/{navigation-styles.js → navigation-styles.tsx} +0 -0
  1131. /package/src/panel/test/__snapshots__/{body.js.snap → body.tsx.snap} +0 -0
@@ -26,7 +26,7 @@ const Root = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
26
26
  } : {
27
27
  name: "1cd7zoc",
28
28
  styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0",
29
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVc4QiIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3Jlc2l6YWJsZS1ib3gvcmVzaXplLXRvb2x0aXAvc3R5bGVzL3Jlc2l6ZS10b29sdGlwLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgVGV4dCB9IGZyb20gJy4uLy4uLy4uL3RleHQnO1xuaW1wb3J0IHsgQ09MT1JTIH0gZnJvbSAnLi4vLi4vLi4vdXRpbHMnO1xuXG5leHBvcnQgY29uc3QgUm9vdCA9IHN0e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CSS_ERROR__
31
31
  });
32
32
  exports.Root = Root;
@@ -41,7 +41,7 @@ const TooltipWrapper = (0, _base.default)("div", process.env.NODE_ENV === "produ
41
41
  } : {
42
42
  name: "ajymcs",
43
43
  styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear",
44
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFCd0MiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHJpZ2h0OiAwO1xuXHR0b3A6IDA7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRkaXNwbGF5OiBpbmxpbmUtZmxleDtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdG9wYWNpdHk6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */",
44
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3Mv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tcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1mYW1pbHk6ICR7IGZvbnQoICdkZWZhdWx0LmZvbnRGYW1pbHknICkgfTtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */",
45
45
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
46
46
  });
47
47
  exports.TooltipWrapper = TooltipWrapper;
@@ -50,7 +50,7 @@ const Tooltip = (0, _base.default)("div", process.env.NODE_ENV === "production"
50
50
  } : {
51
51
  target: "e1wq7y4k1",
52
52
  label: "Tooltip"
53
- })("background:", _utils.COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-size:12px;color:", _utils.COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + (process.env.NODE_ENV === "production" ? "" : "/*# sour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ZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */")); // TODO: Resolve need to use &&& to increase specificity
53
+ })("background:", _utils.COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-family:", (0, _utils.font)('default.fontFamily'), ";font-size:12px;color:", _utils.COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXN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3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1mYW1pbHk6ICR7IGZvbnQoICdkZWZhdWx0LmZvbnRGYW1pbHknICkgfTtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */")); // TODO: Resolve need to use &&& to increase specificity
54
54
  // https://github.com/WordPress/gutenberg/issues/18483
55
55
 
56
56
  exports.Tooltip = Tooltip;
@@ -59,6 +59,6 @@ const LabelText = ( /*#__PURE__*/0, _base.default)(_text.Text, process.env.NODE_
59
59
  } : {
60
60
  target: "e1wq7y4k0",
61
61
  label: "LabelText"
62
- })("&&&{color:", _utils.COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3Vy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EyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */"));
62
+ })("&&&{color:", _utils.COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZDdUMiLCJmaWxlIjoiQHdvcmRwcm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JveDtcblx0Zm9udC1mYW1pbHk6ICR7IGZvbnQoICdkZWZhdWx0LmZvbnRGYW1pbHknICkgfTtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */"));
63
63
  exports.LabelText = LabelText;
64
64
  //# sourceMappingURL=resize-tooltip.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts"],"names":["Root","TooltipWrapper","Tooltip","COLORS","gray","ui","textDark","LabelText","Text"],"mappings":";;;;;;;;;;;AAQA;;AACA;;;;AAEO,MAAMA,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;;AAUA,MAAMC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;;AAUA,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,kBACJC,cAAOC,IAAP,CAAa,GAAb,CADI,oEAKTD,cAAOE,EAAP,CAAUC,QALD,29DAAb,C,CAUP;AACA;;;AAEO,MAAMC,SAAS,GAAG,iCAAQC,UAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,eAEVL,cAAOE,EAAP,CAAUC,QAFA,0/DAAf","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../../../text';\nimport { COLORS } from '../../../utils';\n\nexport const Root = styled.div`\n\tbottom: 0;\n\tbox-sizing: border-box;\n\tleft: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n`;\n\nexport const TooltipWrapper = styled.div`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\topacity: 0;\n\tpointer-events: none;\n\ttransition: opacity 120ms linear;\n`;\n\nexport const Tooltip = styled.div`\n\tbackground: ${ COLORS.gray[ 900 ] };\n\tborder-radius: 2px;\n\tbox-sizing: border-box;\n\tfont-size: 12px;\n\tcolor: ${ COLORS.ui.textDark };\n\tpadding: 4px 8px;\n\tposition: relative;\n`;\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const LabelText = styled( Text )`\n\t&&& {\n\t\tcolor: ${ COLORS.ui.textDark };\n\t\tdisplay: block;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\twhite-space: nowrap;\n\t}\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts"],"names":["Root","TooltipWrapper","Tooltip","COLORS","gray","ui","textDark","LabelText","Text"],"mappings":";;;;;;;;;;;AAQA;;AACA;;;;AAEO,MAAMA,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;;AAUA,MAAMC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;;AAUA,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,kBACJC,cAAOC,IAAP,CAAa,GAAb,CADI,2DAIH,iBAAM,oBAAN,CAJG,4BAMTD,cAAOE,EAAP,CAAUC,QAND,uiEAAb,C,CAWP;AACA;;;AAEO,MAAMC,SAAS,GAAG,iCAAQC,UAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,eAEVL,cAAOE,EAAP,CAAUC,QAFA,skEAAf","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../../../text';\nimport { font, COLORS } from '../../../utils';\n\nexport const Root = styled.div`\n\tbottom: 0;\n\tbox-sizing: border-box;\n\tleft: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n`;\n\nexport const TooltipWrapper = styled.div`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\topacity: 0;\n\tpointer-events: none;\n\ttransition: opacity 120ms linear;\n`;\n\nexport const Tooltip = styled.div`\n\tbackground: ${ COLORS.gray[ 900 ] };\n\tborder-radius: 2px;\n\tbox-sizing: border-box;\n\tfont-family: ${ font( 'default.fontFamily' ) };\n\tfont-size: 12px;\n\tcolor: ${ COLORS.ui.textDark };\n\tpadding: 4px 8px;\n\tposition: relative;\n`;\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const LabelText = styled( Text )`\n\t&&& {\n\t\tcolor: ${ COLORS.ui.textDark };\n\t\tdisplay: block;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\twhite-space: nowrap;\n\t}\n`;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/utils.ts"],"names":["noop","POSITIONS","bottom","corner","useResizeLabel","axis","fadeTimeout","onResize","position","showPx","resizeListener","sizes","isAxisControlled","moveX","setMoveX","moveY","setMoveY","width","height","heightRef","widthRef","moveTimeoutRef","debounceUnsetMoveXY","unsetMoveXY","current","window","clearTimeout","setTimeout","isRendered","didWidthChange","didHeightChange","label","getSizeLabel","undefined","labelUnit"],"mappings":";;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAIO,MAAMC,SAAS,GAAG;AACxBC,EAAAA,MAAM,EAAE,QADgB;AAExBC,EAAAA,MAAM,EAAE;AAFgB,CAAlB;;;AAsBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAT,OAMsC;AAAA,MANb;AAC/BC,IAAAA,IAD+B;AAE/BC,IAAAA,WAAW,GAAG,GAFiB;AAG/BC,IAAAA,QAAQ,GAAGP,IAHoB;AAI/BQ,IAAAA,QAAQ,GAAGP,SAAS,CAACC,MAJU;AAK/BO,IAAAA,MAAM,GAAG;AALsB,GAMa;;AAC5C;AACD;AACA;AACA;AACC,QAAM,CAAEC,cAAF,EAAkBC,KAAlB,IAA4B,iCAAlC;AAEA;AACD;AACA;AACA;AACA;;AACC,QAAMC,gBAAgB,GAAG,CAAC,CAAEP,IAA5B;AAEA;AACD;AACA;AACA;;AACC,QAAM,CAAEQ,KAAF,EAASC,QAAT,IAAsB,uBAAU,KAAV,CAA5B;AACA,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsB,uBAAU,KAAV,CAA5B;AAEA;AACD;AACA;AACA;;AACC,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAoBP,KAA1B;AACA,QAAMQ,SAAS,GAAG,qBAAQD,MAAR,CAAlB;AACA,QAAME,QAAQ,GAAG,qBAAQH,KAAR,CAAjB;AAEA;AACD;AACA;AACA;;AACC,QAAMI,cAAc,GAAG,sBAAvB;AAEA,QAAMC,mBAAmB,GAAG,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I,KAAO,GAAGiB,SAAW,EAAhC;AACA;;AACD,QAAK7B,IAAI,KAAK,GAAT,IAAgBU,KAArB,EAA6B;AAC5B,aAAQ,GAAGG,MAAQ,GAAGgB,SAAW,EAAjC;AACA;AACD;;AAED,MAAKrB,KAAK,IAAIE,KAAd,EAAsB;AACrB,WAAQ,GAAGE,KAAO,MAAMC,MAAQ,EAAhC;AACA;;AACD,MAAKL,KAAL,EAAa;AACZ,WAAQ,GAAGI,KAAO,GAAGiB,SAAW,EAAhC;AACA;;AACD,MAAKnB,KAAL,EAAa;AACZ,WAAQ,GAAGG,MAAQ,GAAGgB,SAAW,EAAjC;AACA;;AAED,SAAOD,SAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\nimport { useResizeObserver } from '@wordpress/compose';\n\nconst noop = () => {};\n\nexport type Axis = 'x' | 'y';\n\nexport const POSITIONS = {\n\tbottom: 'bottom',\n\tcorner: 'corner',\n} as const;\n\nexport type Position = typeof POSITIONS[ keyof typeof POSITIONS ];\n\ninterface UseResizeLabelProps {\n\t/** The label value. */\n\tlabel?: string;\n\t/** Element to be rendered for resize listening events. */\n\tresizeListener: JSX.Element;\n}\n\ninterface UseResizeLabelArgs {\n\taxis?: Axis;\n\tfadeTimeout: number;\n\tonResize( data: { width: number | null; height: number | null } ): void;\n\tposition: Position;\n\tshowPx: boolean;\n}\n\n/**\n * Custom hook that manages resize listener events. It also provides a label\n * based on current resize width x height values.\n *\n * @param props\n * @param props.axis Only shows the label corresponding to the axis.\n * @param props.fadeTimeout Duration (ms) before deactivating the resize label.\n * @param props.onResize Callback when a resize occurs. Provides { width, height } callback.\n * @param props.position Adjusts label value.\n * @param props.showPx Whether to add `PX` to the label.\n *\n * @return Properties for hook.\n */\nexport function useResizeLabel( {\n\taxis,\n\tfadeTimeout = 180,\n\tonResize = noop,\n\tposition = POSITIONS.bottom,\n\tshowPx = false,\n}: UseResizeLabelArgs ): UseResizeLabelProps {\n\t/*\n\t * The width/height values derive from this special useResizeObserver hook.\n\t * This custom hook uses the ResizeObserver API to listen for resize events.\n\t */\n\tconst [ resizeListener, sizes ] = useResizeObserver();\n\n\t/*\n\t * Indicates if the x/y axis is preferred.\n\t * If set, we will avoid resetting the moveX and moveY values.\n\t * This will allow for the preferred axis values to persist in the label.\n\t */\n\tconst isAxisControlled = !! axis;\n\n\t/*\n\t * The moveX and moveY values are used to track whether the label should\n\t * display width, height, or width x height.\n\t */\n\tconst [ moveX, setMoveX ] = useState( false );\n\tconst [ moveY, setMoveY ] = useState( false );\n\n\t/*\n\t * Cached dimension values to check for width/height updates from the\n\t * sizes property from useResizeAware()\n\t */\n\tconst { width, height } = sizes;\n\tconst heightRef = useRef( height );\n\tconst widthRef = useRef( width );\n\n\t/*\n\t * This timeout is used with setMoveX and setMoveY to determine of\n\t * both width and height values have changed at (roughly) the same time.\n\t */\n\tconst moveTimeoutRef = useRef< number >();\n\n\tconst debounceUnsetMoveXY = useCallback( () => {\n\t\tconst unsetMoveXY = () => {\n\t\t\t/*\n\t\t\t * If axis is controlled, we will avoid resetting the moveX and moveY values.\n\t\t\t * This will allow for the preferred axis values to persist in the label.\n\t\t\t */\n\t\t\tif ( isAxisControlled ) return;\n\t\t\tsetMoveX( false );\n\t\t\tsetMoveY( false );\n\t\t};\n\n\t\tif ( moveTimeoutRef.current ) {\n\t\t\twindow.clearTimeout( moveTimeoutRef.current );\n\t\t}\n\n\t\tmoveTimeoutRef.current = window.setTimeout( unsetMoveXY, fadeTimeout );\n\t}, [ fadeTimeout, isAxisControlled ] );\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * On the initial render of useResizeAware, the height and width values are\n\t\t * null. They are calculated then set using via an internal useEffect hook.\n\t\t */\n\t\tconst isRendered = width !== null || height !== null;\n\n\t\tif ( ! isRendered ) return;\n\n\t\tconst didWidthChange = width !== widthRef.current;\n\t\tconst didHeightChange = height !== heightRef.current;\n\n\t\tif ( ! didWidthChange && ! didHeightChange ) return;\n\n\t\t/*\n\t\t * After the initial render, the useResizeAware will set the first\n\t\t * width and height values. We'll sync those values with our\n\t\t * width and height refs. However, we shouldn't render our Tooltip\n\t\t * label on this first cycle.\n\t\t */\n\t\tif ( width && ! widthRef.current && height && ! heightRef.current ) {\n\t\t\twidthRef.current = width;\n\t\t\theightRef.current = height;\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * After the first cycle, we can track width and height changes.\n\t\t */\n\t\tif ( didWidthChange ) {\n\t\t\tsetMoveX( true );\n\t\t\twidthRef.current = width;\n\t\t}\n\n\t\tif ( didHeightChange ) {\n\t\t\tsetMoveY( true );\n\t\t\theightRef.current = height;\n\t\t}\n\n\t\tonResize( { width, height } );\n\t\tdebounceUnsetMoveXY();\n\t}, [ width, height, onResize, debounceUnsetMoveXY ] );\n\n\tconst label = getSizeLabel( {\n\t\taxis,\n\t\theight,\n\t\tmoveX,\n\t\tmoveY,\n\t\tposition,\n\t\tshowPx,\n\t\twidth,\n\t} );\n\n\treturn {\n\t\tlabel,\n\t\tresizeListener,\n\t};\n}\n\ninterface GetSizeLabelArgs {\n\taxis?: Axis;\n\theight: number | null;\n\tmoveX: boolean;\n\tmoveY: boolean;\n\tposition: Position;\n\tshowPx: boolean;\n\twidth: number | null;\n}\n\n/**\n * Gets the resize label based on width and height values (as well as recent changes).\n *\n * @param props\n * @param props.axis Only shows the label corresponding to the axis.\n * @param props.height Height value.\n * @param props.moveX Recent width (x axis) changes.\n * @param props.moveY Recent width (y axis) changes.\n * @param props.position Adjusts label value.\n * @param props.showPx Whether to add `PX` to the label.\n * @param props.width Width value.\n *\n * @return The rendered label.\n */\nfunction getSizeLabel( {\n\taxis,\n\theight,\n\tmoveX = false,\n\tmoveY = false,\n\tposition = POSITIONS.bottom,\n\tshowPx = false,\n\twidth,\n}: GetSizeLabelArgs ): string | undefined {\n\tif ( ! moveX && ! moveY ) return undefined;\n\n\t/*\n\t * Corner position...\n\t * We want the label to appear like width x height.\n\t */\n\tif ( position === POSITIONS.corner ) {\n\t\treturn `${ width } x ${ height }`;\n\t}\n\n\t/*\n\t * Other POSITIONS...\n\t * The label will combine both width x height values if both\n\t * values have recently been changed.\n\t *\n\t * Otherwise, only width or height will be displayed.\n\t * The `PX` unit will be added, if specified by the `showPx` prop.\n\t */\n\tconst labelUnit = showPx ? ' px' : '';\n\n\tif ( axis ) {\n\t\tif ( axis === 'x' && moveX ) {\n\t\t\treturn `${ width }${ labelUnit }`;\n\t\t}\n\t\tif ( axis === 'y' && moveY ) {\n\t\t\treturn `${ height }${ labelUnit }`;\n\t\t}\n\t}\n\n\tif ( moveX && moveY ) {\n\t\treturn `${ width } x ${ height }`;\n\t}\n\tif ( moveX ) {\n\t\treturn `${ width }${ labelUnit }`;\n\t}\n\tif ( moveY ) {\n\t\treturn `${ height }${ labelUnit }`;\n\t}\n\n\treturn undefined;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/utils.ts"],"names":["noop","POSITIONS","bottom","corner","useResizeLabel","axis","fadeTimeout","onResize","position","showPx","resizeListener","sizes","isAxisControlled","moveX","setMoveX","moveY","setMoveY","width","height","heightRef","widthRef","moveTimeoutRef","debounceUnsetMoveXY","unsetMoveXY","current","window","clearTimeout","setTimeout","isRendered","didWidthChange","didHeightChange","label","getSizeLabel","undefined","labelUnit"],"mappings":";;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAIO,MAAMC,SAAS,GAAG;AACxBC,EAAAA,MAAM,EAAE,QADgB;AAExBC,EAAAA,MAAM,EAAE;AAFgB,CAAlB;;;AAsBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAT,OAMsC;AAAA,MANb;AAC/BC,IAAAA,IAD+B;AAE/BC,IAAAA,WAAW,GAAG,GAFiB;AAG/BC,IAAAA,QAAQ,GAAGP,IAHoB;AAI/BQ,IAAA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AQ0C;AAAA,MARnB;AACtB3B,IAAAA,IADsB;AAEtBa,IAAAA,MAFsB;AAGtBL,IAAAA,KAAK,GAAG,KAHc;AAItBE,IAAAA,KAAK,GAAG,KAJc;AAKtBP,IAAAA,QAAQ,GAAGP,SAAS,CAACC,MALC;AAMtBO,IAAAA,MAAM,GAAG,KANa;AAOtBQ,IAAAA;AAPsB,GAQmB;AACzC,MAAK,CAAEJ,KAAF,IAAW,CAAEE,KAAlB,EAA0B,OAAOkB,SAAP;AAE1B;AACD;AACA;AACA;;AACC,MAAKzB,QAAQ,KAAKP,SAAS,CAACE,MAA5B,EAAqC;AACpC,WAAQ,GAAGc,KAAO,MAAMC,MAAQ,EAAhC;AACA;AAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;AACC,QAAMgB,SAAS,GAAGzB,MAAM,GAAG,KAAH,GAAW,EAAnC;;AAEA,MAAKJ,IAAL,EAAY;AACX,QAAKA,IAAI,KAAK,GAAT,IAAgBQ,KAArB,EAA6B;AAC5B,aAAQ,GAAGI,KAAO,GAAGiB,SAAW,EAAhC;AACA;;AACD,QAAK7B,IAAI,KAAK,GAAT,IAAgBU,KAArB,EAA6B;AAC5B,aAAQ,GAAGG,MAAQ,GAAGgB,SAAW,EAAjC;AACA;AACD;;AAED,MAAKrB,KAAK,IAAIE,KAAd,EAAsB;AACrB,WAAQ,GAAGE,KAAO,MAAMC,MAAQ,EAAhC;AACA;;AACD,MAAKL,KAAL,EAAa;AACZ,WAAQ,GAAGI,KAAO,GAAGiB,SAAW,EAAhC;AACA;;AACD,MAAKnB,KAAL,EAAa;AACZ,WAAQ,GAAGG,MAAQ,GAAGgB,SAAW,EAAjC;AACA;;AAED,SAAOD,SAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\nimport { useResizeObserver } from '@wordpress/compose';\n\nconst noop = () => {};\n\nexport type Axis = 'x' | 'y';\n\nexport const POSITIONS = {\n\tbottom: 'bottom',\n\tcorner: 'corner',\n} as const;\n\nexport type Position = ( typeof POSITIONS )[ keyof typeof POSITIONS ];\n\ninterface UseResizeLabelProps {\n\t/** The label value. */\n\tlabel?: string;\n\t/** Element to be rendered for resize listening events. */\n\tresizeListener: JSX.Element;\n}\n\ninterface UseResizeLabelArgs {\n\taxis?: Axis;\n\tfadeTimeout: number;\n\tonResize( data: { width: number | null; height: number | null } ): void;\n\tposition: Position;\n\tshowPx: boolean;\n}\n\n/**\n * Custom hook that manages resize listener events. It also provides a label\n * based on current resize width x height values.\n *\n * @param props\n * @param props.axis Only shows the label corresponding to the axis.\n * @param props.fadeTimeout Duration (ms) before deactivating the resize label.\n * @param props.onResize Callback when a resize occurs. Provides { width, height } callback.\n * @param props.position Adjusts label value.\n * @param props.showPx Whether to add `PX` to the label.\n *\n * @return Properties for hook.\n */\nexport function useResizeLabel( {\n\taxis,\n\tfadeTimeout = 180,\n\tonResize = noop,\n\tposition = POSITIONS.bottom,\n\tshowPx = false,\n}: UseResizeLabelArgs ): UseResizeLabelProps {\n\t/*\n\t * The width/height values derive from this special useResizeObserver hook.\n\t * This custom hook uses the ResizeObserver API to listen for resize events.\n\t */\n\tconst [ resizeListener, sizes ] = useResizeObserver();\n\n\t/*\n\t * Indicates if the x/y axis is preferred.\n\t * If set, we will avoid resetting the moveX and moveY values.\n\t * This will allow for the preferred axis values to persist in the label.\n\t */\n\tconst isAxisControlled = !! axis;\n\n\t/*\n\t * The moveX and moveY values are used to track whether the label should\n\t * display width, height, or width x height.\n\t */\n\tconst [ moveX, setMoveX ] = useState( false );\n\tconst [ moveY, setMoveY ] = useState( false );\n\n\t/*\n\t * Cached dimension values to check for width/height updates from the\n\t * sizes property from useResizeAware()\n\t */\n\tconst { width, height } = sizes;\n\tconst heightRef = useRef( height );\n\tconst widthRef = useRef( width );\n\n\t/*\n\t * This timeout is used with setMoveX and setMoveY to determine of\n\t * both width and height values have changed at (roughly) the same time.\n\t */\n\tconst moveTimeoutRef = useRef< number >();\n\n\tconst debounceUnsetMoveXY = useCallback( () => {\n\t\tconst unsetMoveXY = () => {\n\t\t\t/*\n\t\t\t * If axis is controlled, we will avoid resetting the moveX and moveY values.\n\t\t\t * This will allow for the preferred axis values to persist in the label.\n\t\t\t */\n\t\t\tif ( isAxisControlled ) return;\n\t\t\tsetMoveX( false );\n\t\t\tsetMoveY( false );\n\t\t};\n\n\t\tif ( moveTimeoutRef.current ) {\n\t\t\twindow.clearTimeout( moveTimeoutRef.current );\n\t\t}\n\n\t\tmoveTimeoutRef.current = window.setTimeout( unsetMoveXY, fadeTimeout );\n\t}, [ fadeTimeout, isAxisControlled ] );\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * On the initial render of useResizeAware, the height and width values are\n\t\t * null. They are calculated then set using via an internal useEffect hook.\n\t\t */\n\t\tconst isRendered = width !== null || height !== null;\n\n\t\tif ( ! isRendered ) return;\n\n\t\tconst didWidthChange = width !== widthRef.current;\n\t\tconst didHeightChange = height !== heightRef.current;\n\n\t\tif ( ! didWidthChange && ! didHeightChange ) return;\n\n\t\t/*\n\t\t * After the initial render, the useResizeAware will set the first\n\t\t * width and height values. We'll sync those values with our\n\t\t * width and height refs. However, we shouldn't render our Tooltip\n\t\t * label on this first cycle.\n\t\t */\n\t\tif ( width && ! widthRef.current && height && ! heightRef.current ) {\n\t\t\twidthRef.current = width;\n\t\t\theightRef.current = height;\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * After the first cycle, we can track width and height changes.\n\t\t */\n\t\tif ( didWidthChange ) {\n\t\t\tsetMoveX( true );\n\t\t\twidthRef.current = width;\n\t\t}\n\n\t\tif ( didHeightChange ) {\n\t\t\tsetMoveY( true );\n\t\t\theightRef.current = height;\n\t\t}\n\n\t\tonResize( { width, height } );\n\t\tdebounceUnsetMoveXY();\n\t}, [ width, height, onResize, debounceUnsetMoveXY ] );\n\n\tconst label = getSizeLabel( {\n\t\taxis,\n\t\theight,\n\t\tmoveX,\n\t\tmoveY,\n\t\tposition,\n\t\tshowPx,\n\t\twidth,\n\t} );\n\n\treturn {\n\t\tlabel,\n\t\tresizeListener,\n\t};\n}\n\ninterface GetSizeLabelArgs {\n\taxis?: Axis;\n\theight: number | null;\n\tmoveX: boolean;\n\tmoveY: boolean;\n\tposition: Position;\n\tshowPx: boolean;\n\twidth: number | null;\n}\n\n/**\n * Gets the resize label based on width and height values (as well as recent changes).\n *\n * @param props\n * @param props.axis Only shows the label corresponding to the axis.\n * @param props.height Height value.\n * @param props.moveX Recent width (x axis) changes.\n * @param props.moveY Recent width (y axis) changes.\n * @param props.position Adjusts label value.\n * @param props.showPx Whether to add `PX` to the label.\n * @param props.width Width value.\n *\n * @return The rendered label.\n */\nfunction getSizeLabel( {\n\taxis,\n\theight,\n\tmoveX = false,\n\tmoveY = false,\n\tposition = POSITIONS.bottom,\n\tshowPx = false,\n\twidth,\n}: GetSizeLabelArgs ): string | undefined {\n\tif ( ! moveX && ! moveY ) return undefined;\n\n\t/*\n\t * Corner position...\n\t * We want the label to appear like width x height.\n\t */\n\tif ( position === POSITIONS.corner ) {\n\t\treturn `${ width } x ${ height }`;\n\t}\n\n\t/*\n\t * Other POSITIONS...\n\t * The label will combine both width x height values if both\n\t * values have recently been changed.\n\t *\n\t * Otherwise, only width or height will be displayed.\n\t * The `PX` unit will be added, if specified by the `showPx` prop.\n\t */\n\tconst labelUnit = showPx ? ' px' : '';\n\n\tif ( axis ) {\n\t\tif ( axis === 'x' && moveX ) {\n\t\t\treturn `${ width }${ labelUnit }`;\n\t\t}\n\t\tif ( axis === 'y' && moveY ) {\n\t\t\treturn `${ height }${ labelUnit }`;\n\t\t}\n\t}\n\n\tif ( moveX && moveY ) {\n\t\treturn `${ width } x ${ height }`;\n\t}\n\tif ( moveX ) {\n\t\treturn `${ width }${ labelUnit }`;\n\t}\n\tif ( moveY ) {\n\t\treturn `${ height }${ labelUnit }`;\n\t}\n\n\treturn undefined;\n}\n"]}
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
- var _compose = require("@wordpress/compose");
15
-
16
14
  /**
17
15
  * External dependencies
18
16
  */
@@ -44,25 +42,26 @@ function ResponsiveWrapper(_ref) {
44
42
  children,
45
43
  isInline = false
46
44
  } = _ref;
47
- const [containerResizeListener, {
48
- width: containerWidth
49
- }] = (0, _compose.useResizeObserver)();
50
45
 
51
46
  if (_element.Children.count(children) !== 1) {
52
47
  return null;
53
48
  }
54
49
 
55
- const imageStyle = {
56
- paddingBottom: naturalWidth < (containerWidth !== null && containerWidth !== void 0 ? containerWidth : 0) ? naturalHeight : naturalHeight / naturalWidth * 100 + '%'
57
- };
58
50
  const TagName = isInline ? 'span' : 'div';
51
+ let aspectRatio;
52
+
53
+ if (naturalWidth && naturalHeight) {
54
+ aspectRatio = `${naturalWidth} / ${naturalHeight}`;
55
+ }
56
+
59
57
  return (0, _element.createElement)(TagName, {
60
58
  className: "components-responsive-wrapper"
61
- }, containerResizeListener, (0, _element.createElement)(TagName, {
62
- style: imageStyle
63
- }), (0, _element.cloneElement)(children, {
64
- className: (0, _classnames.default)('components-responsive-wrapper__content', children.props.className)
65
- }));
59
+ }, (0, _element.createElement)("div", null, (0, _element.cloneElement)(children, {
60
+ className: (0, _classnames.default)('components-responsive-wrapper__content', children.props.className),
61
+ style: { ...children.props.style,
62
+ aspectRatio
63
+ }
64
+ })));
66
65
  }
67
66
 
68
67
  var _default = ResponsiveWrapper;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/responsive-wrapper/index.tsx"],"names":["ResponsiveWrapper","naturalWidth","naturalHeight","children","isInline","containerResizeListener","width","containerWidth","Children","count","imageStyle","paddingBottom","TagName","className","props"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAT,OAK4B;AAAA,MALA;AAC3BC,IAAAA,YAD2B;AAE3BC,IAAAA,aAF2B;AAG3BC,IAAAA,QAH2B;AAI3BC,IAAAA,QAAQ,GAAG;AAJgB,GAKA;AAC3B,QAAM,CAAEC,uBAAF,EAA2B;AAAEC,IAAAA,KAAK,EAAEC;AAAT,GAA3B,IACL,iCADD;;AAEA,MAAKC,kBAASC,KAAT,CAAgBN,QAAhB,MAA+B,CAApC,EAAwC;AACvC,WAAO,IAAP;AACA;;AACD,QAAMO,UAAU,GAAG;AAClBC,IAAAA,aAAa,EACZV,YAAY,IAAKM,cAAL,aAAKA,cAAL,cAAKA,cAAL,GAAuB,CAAvB,CAAZ,GACGL,aADH,GAEKA,aAAa,GAAGD,YAAlB,GAAmC,GAAnC,GAAyC;AAJ3B,GAAnB;AAMA,QAAMW,OAAO,GAAGR,QAAQ,GAAG,MAAH,GAAY,KAApC;AACA,SACC,4BAAC,OAAD;AAAS,IAAA,SAAS,EAAC;AAAnB,KACGC,uBADH,EAEC,4BAAC,OAAD;AAAS,IAAA,KAAK,EAAGK;AAAjB,IAFD,EAGG,2BAAcP,QAAd,EAAwB;AACzBU,IAAAA,SAAS,EAAE,yBACV,wCADU,EAEVV,QAAQ,CAACW,KAAT,CAAeD,SAFL;AADc,GAAxB,CAHH,CADD;AAYA;;eAEcb,iB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { cloneElement, Children } from '@wordpress/element';\nimport { useResizeObserver } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { ResponsiveWrapperProps } from './types';\n\n/**\n * A wrapper component that maintains its aspect ratio when resized.\n *\n * ```jsx\n * import { ResponsiveWrapper } from '@wordpress/components';\n *\n * const MyResponsiveWrapper = () => (\n * \t<ResponsiveWrapper naturalWidth={ 2000 } naturalHeight={ 680 }>\n * \t\t<img\n * \t\t\tsrc=\"https://s.w.org/style/images/about/WordPress-logotype-standard.png\"\n * \t\t\talt=\"WordPress\"\n * \t\t/>\n * \t</ResponsiveWrapper>\n * );\n * ```\n */\nfunction ResponsiveWrapper( {\n\tnaturalWidth,\n\tnaturalHeight,\n\tchildren,\n\tisInline = false,\n}: ResponsiveWrapperProps ) {\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn null;\n\t}\n\tconst imageStyle = {\n\t\tpaddingBottom:\n\t\t\tnaturalWidth < ( containerWidth ?? 0 )\n\t\t\t\t? naturalHeight\n\t\t\t\t: ( naturalHeight / naturalWidth ) * 100 + '%',\n\t};\n\tconst TagName = isInline ? 'span' : 'div';\n\treturn (\n\t\t<TagName className=\"components-responsive-wrapper\">\n\t\t\t{ containerResizeListener }\n\t\t\t<TagName style={ imageStyle } />\n\t\t\t{ cloneElement( children, {\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'components-responsive-wrapper__content',\n\t\t\t\t\tchildren.props.className\n\t\t\t\t),\n\t\t\t} ) }\n\t\t</TagName>\n\t);\n}\n\nexport default ResponsiveWrapper;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/responsive-wrapper/index.tsx"],"names":["ResponsiveWrapper","naturalWidth","naturalHeight","children","isInline","Children","count","TagName","aspectRatio","className","props","style"],"mappings":";;;;;;;;;AAQA;;AALA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAT,OAK4B;AAAA,MALA;AAC3BC,IAAAA,YAD2B;AAE3BC,IAAAA,aAF2B;AAG3BC,IAAAA,QAH2B;AAI3BC,IAAAA,QAAQ,GAAG;AAJgB,GAKA;;AAC3B,MAAKC,kBAASC,KAAT,CAAgBH,QAAhB,MAA+B,CAApC,EAAwC;AACvC,WAAO,IAAP;AACA;;AAED,QAAMI,OAAO,GAAGH,QAAQ,GAAG,MAAH,GAAY,KAApC;AACA,MAAII,WAAJ;;AACA,MAAKP,YAAY,IAAIC,aAArB,EAAqC;AACpCM,IAAAA,WAAW,GAAI,GAAGP,YAAc,MAAMC,aAAe,EAArD;AACA;;AAED,SACC,4BAAC,OAAD;AAAS,IAAA,SAAS,EAAC;AAAnB,KACC,yCACG,2BAAcC,QAAd,EAAwB;AACzBM,IAAAA,SAAS,EAAE,yBACV,wCADU,EAEVN,QAAQ,CAACO,KAAT,CAAeD,SAFL,CADc;AAKzBE,IAAAA,KAAK,EAAE,EACN,GAAGR,QAAQ,CAACO,KAAT,CAAeC,KADZ;AAENH,MAAAA;AAFM;AALkB,GAAxB,CADH,CADD,CADD;AAgBA;;eAEcR,iB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { cloneElement, Children } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ResponsiveWrapperProps } from './types';\n\n/**\n * A wrapper component that maintains its aspect ratio when resized.\n *\n * ```jsx\n * import { ResponsiveWrapper } from '@wordpress/components';\n *\n * const MyResponsiveWrapper = () => (\n * \t<ResponsiveWrapper naturalWidth={ 2000 } naturalHeight={ 680 }>\n * \t\t<img\n * \t\t\tsrc=\"https://s.w.org/style/images/about/WordPress-logotype-standard.png\"\n * \t\t\talt=\"WordPress\"\n * \t\t/>\n * \t</ResponsiveWrapper>\n * );\n * ```\n */\nfunction ResponsiveWrapper( {\n\tnaturalWidth,\n\tnaturalHeight,\n\tchildren,\n\tisInline = false,\n}: ResponsiveWrapperProps ) {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn null;\n\t}\n\n\tconst TagName = isInline ? 'span' : 'div';\n\tlet aspectRatio;\n\tif ( naturalWidth && naturalHeight ) {\n\t\taspectRatio = `${ naturalWidth } / ${ naturalHeight }`;\n\t}\n\n\treturn (\n\t\t<TagName className=\"components-responsive-wrapper\">\n\t\t\t<div>\n\t\t\t\t{ cloneElement( children, {\n\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t'components-responsive-wrapper__content',\n\t\t\t\t\t\tchildren.props.className\n\t\t\t\t\t),\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\t...children.props.style,\n\t\t\t\t\t\taspectRatio,\n\t\t\t\t\t},\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</TagName>\n\t);\n}\n\nexport default ResponsiveWrapper;\n"]}
@@ -28,68 +28,85 @@ var _style = _interopRequireDefault(require("./style.scss"));
28
28
  /**
29
29
  * Internal dependencies
30
30
  */
31
- const observeAndResizeJS = function () {
32
- // Hermes requires a special directive to preserve the original source code
33
- // when using `Function.prototype.toString()` below.
34
- // https://github.com/facebook/hermes/issues/114#issuecomment-887106990
35
- 'show source';
36
-
37
- const {
38
- MutationObserver
39
- } = window;
40
-
41
- if (!MutationObserver || !document.body || !window.parent) {
42
- return;
43
- }
44
-
45
- function sendResize() {
46
- const clientBoundingRect = document.body.getBoundingClientRect(); // The function postMessage is exposed by the react-native-webview library
47
- // to communicate between React Native and the WebView, in this case,
48
- // we use it for notifying resize changes.
49
-
50
- window.ReactNativeWebView.postMessage(JSON.stringify({
51
- action: 'resize',
52
- width: clientBoundingRect.width,
53
- height: clientBoundingRect.height
54
- }));
55
- }
56
-
57
- const observer = new MutationObserver(sendResize);
58
- observer.observe(document.body, {
59
- attributes: true,
60
- attributeOldValue: false,
61
- characterData: true,
62
- characterDataOldValue: false,
63
- childList: true,
64
- subtree: true
65
- });
66
- window.addEventListener('load', sendResize, true); // Hack: Remove viewport unit styles, as these are relative
67
- // the iframe root and interfere with our mechanism for
68
- // determining the unconstrained page bounds.
69
-
70
- function removeViewportStyles(ruleOrNode) {
71
- if (ruleOrNode.style) {
72
- ['width', 'height', 'minHeight', 'maxHeight'].forEach(function (style) {
73
- if (/^\\d+(vmin|vmax|vh|vw)$/.test(ruleOrNode.style[style])) {
74
- ruleOrNode.style[style] = '';
75
- }
76
- });
77
- }
78
- }
79
-
80
- Array.prototype.forEach.call(document.querySelectorAll('[style]'), removeViewportStyles);
81
- Array.prototype.forEach.call(document.styleSheets, function (stylesheet) {
82
- Array.prototype.forEach.call(stylesheet.cssRules || stylesheet.rules, removeViewportStyles);
83
- });
84
- document.body.style.position = 'absolute';
85
- document.body.style.width = '100%';
86
- document.body.setAttribute('data-resizable-iframe-connected', '');
87
- sendResize(); // Resize events can change the width of elements with 100% width, but we don't
88
- // get an DOM mutations for that, so do the resize when the window is resized, too.
89
-
90
- window.addEventListener('resize', sendResize, true);
91
- };
92
-
31
+ const observeAndResizeJS = `
32
+ (function() {
33
+ const { MutationObserver } = window;
34
+
35
+ if ( ! MutationObserver || ! document.body || ! window.parent ) {
36
+ return;
37
+ }
38
+
39
+ function sendResize() {
40
+ const clientBoundingRect = document.body.getBoundingClientRect();
41
+
42
+ // The function postMessage is exposed by the react-native-webview library
43
+ // to communicate between React Native and the WebView, in this case,
44
+ // we use it for notifying resize changes.
45
+ window.ReactNativeWebView.postMessage(
46
+ JSON.stringify( {
47
+ action: 'resize',
48
+ width: clientBoundingRect.width,
49
+ height: clientBoundingRect.height,
50
+ } )
51
+ );
52
+ }
53
+
54
+ const observer = new MutationObserver( sendResize );
55
+ observer.observe( document.body, {
56
+ attributes: true,
57
+ attributeOldValue: false,
58
+ characterData: true,
59
+ characterDataOldValue: false,
60
+ childList: true,
61
+ subtree: true,
62
+ } );
63
+
64
+ window.addEventListener( 'load', sendResize, true );
65
+
66
+ // Hack: Remove viewport unit styles, as these are relative
67
+ // the iframe root and interfere with our mechanism for
68
+ // determining the unconstrained page bounds.
69
+ function removeViewportStyles( ruleOrNode ) {
70
+ if ( ruleOrNode.style ) {
71
+ [ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function (
72
+ style
73
+ ) {
74
+ if (
75
+ /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] )
76
+ ) {
77
+ ruleOrNode.style[ style ] = '';
78
+ }
79
+ } );
80
+ }
81
+ }
82
+
83
+ Array.prototype.forEach.call(
84
+ document.querySelectorAll( '[style]' ),
85
+ removeViewportStyles
86
+ );
87
+ Array.prototype.forEach.call(
88
+ document.styleSheets,
89
+ function ( stylesheet ) {
90
+ Array.prototype.forEach.call(
91
+ stylesheet.cssRules || stylesheet.rules,
92
+ removeViewportStyles
93
+ );
94
+ }
95
+ );
96
+
97
+ document.body.style.position = 'absolute';
98
+ document.body.style.width = '100%';
99
+ document.body.setAttribute( 'data-resizable-iframe-connected', '' );
100
+
101
+ sendResize();
102
+
103
+ // Resize events can change the width of elements with 100% width, but we don't
104
+ // get an DOM mutations for that, so do the resize when the window is resized, too.
105
+ window.addEventListener( 'resize', sendResize, true );
106
+ window.addEventListener( 'orientationchange', sendResize, true );
107
+ widow.addEventListener( 'click', sendResize, true );
108
+ })();
109
+ `;
93
110
  const style = `
94
111
  body {
95
112
  margin: 0;
@@ -215,11 +232,6 @@ function Sandbox(_ref) {
215
232
  dangerouslySetInnerHTML: {
216
233
  __html: html
217
234
  }
218
- }), (0, _element.createElement)("script", {
219
- type: "text/javascript",
220
- dangerouslySetInnerHTML: {
221
- __html: customJS || `(${observeAndResizeJS.toString()})();`
222
- }
223
235
  }), scripts.map(src => (0, _element.createElement)("script", {
224
236
  key: src,
225
237
  src: src
@@ -297,6 +309,7 @@ function Sandbox(_ref) {
297
309
  }, [isLandscape]);
298
310
  return (0, _element.createElement)(_reactNativeWebview.WebView, {
299
311
  containerStyle: [_style.default['sandbox-webview__container'], containerStyle],
312
+ injectedJavaScript: customJS || observeAndResizeJS,
300
313
  key: key,
301
314
  ref: ref,
302
315
  source: {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/sandbox/index.native.js"],"names":["observeAndResizeJS","MutationObserver","window","document","body","parent","sendResize","clientBoundingRect","getBoundingClientRect","ReactNativeWebView","postMessage","JSON","stringify","action","width","height","observer","observe","attributes","attributeOldValue","characterData","characterDataOldValue","childList","subtree","addEventListener","removeViewportStyles","ruleOrNode","style","forEach","test","Array","prototype","call","querySelectorAll","styleSheets","stylesheet","cssRules","rules","position","setAttribute","EMPTY_ARRAY","Sandbox","containerStyle","customJS","html","lang","providerUrl","scripts","styles","title","type","url","colorScheme","ref","setHeight","contentHtml","setContentHtml","getHtmlDoc","windowSize","Dimensions","get","isLandscape","setIsLandscape","wasLandscape","key","Platform","select","android","ios","htmlDoc","__html","map","i","toString","src","updateContentHtml","forceRerender","newContentHtml","setImmediate","checkMessageForResize","event","data","nativeEvent","parse","e","getSizeStyle","contentHeight","Math","ceil","aspectRatio","onChangeDimensions","dimensions","dimensionsChangeSubscription","remove","current","sandboxStyles","baseUrl","isAndroid","workaroundStyles","webView","StyleSheet","create","opacity"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAaA;;AAKA;;AAtBA;AACA;AACA;;AAIA;AACA;AACA;;AAWA;AACA;AACA;AAGA,MAAMA,kBAAkB,GAAG,YAAY;AACtC;AACA;AACA;AACA;;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAuBC,MAA7B;;AAEA,MAAK,CAAED,gBAAF,IAAsB,CAAEE,QAAQ,CAACC,IAAjC,IAAyC,CAAEF,MAAM,CAACG,MAAvD,EAAgE;AAC/D;AACA;;AAED,WAASC,UAAT,GAAsB;AACrB,UAAMC,kBAAkB,GAAGJ,QAAQ,CAACC,IAAT,CAAcI,qBAAd,EAA3B,CADqB,CAGrB;AACA;AACA;;AACAN,IAAAA,MAAM,CAACO,kBAAP,CAA0BC,WAA1B,CACCC,IAAI,CAACC,SAAL,CAAgB;AACfC,MAAAA,MAAM,EAAE,QADO;AAEfC,MAAAA,KAAK,EAAEP,kBAAkB,CAACO,KAFX;AAGfC,MAAAA,MAAM,EAAER,kBAAkB,CAACQ;AAHZ,KAAhB,CADD;AAOA;;AAED,QAAMC,QAAQ,GAAG,IAAIf,gBAAJ,CAAsBK,UAAtB,CAAjB;AACAU,EAAAA,QAAQ,CAACC,OAAT,CAAkBd,QAAQ,CAACC,IAA3B,EAAiC;AAChCc,IAAAA,UAAU,EAAE,IADo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ACA;AACA;AACA;AACEG,IAAAA,OAAO,EAAE;AAND;AADkC,CAAnB,CAAzB;;eAWe,mBAAM7D,OAAN,C","sourcesContent":["/**\n * External dependencies\n */\nimport { Dimensions, StyleSheet } from 'react-native';\nimport { WebView } from 'react-native-webview';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tPlatform,\n\trenderToString,\n\tmemo,\n\tuseRef,\n\tuseState,\n\tuseEffect,\n} from '@wordpress/element';\nimport { usePreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport sandboxStyles from './style.scss';\n\nconst observeAndResizeJS = function () {\n\t// Hermes requires a special directive to preserve the original source code\n\t// when using `Function.prototype.toString()` below.\n\t// https://github.com/facebook/hermes/issues/114#issuecomment-887106990\n\t'show source';\n\tconst { MutationObserver } = window;\n\n\tif ( ! MutationObserver || ! document.body || ! window.parent ) {\n\t\treturn;\n\t}\n\n\tfunction sendResize() {\n\t\tconst clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t// The function postMessage is exposed by the react-native-webview library\n\t\t// to communicate between React Native and the WebView, in this case,\n\t\t// we use it for notifying resize changes.\n\t\twindow.ReactNativeWebView.postMessage(\n\t\t\tJSON.stringify( {\n\t\t\t\taction: 'resize',\n\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\theight: clientBoundingRect.height,\n\t\t\t} )\n\t\t);\n\t}\n\n\tconst observer = new MutationObserver( sendResize );\n\tobserver.observe( document.body, {\n\t\tattributes: true,\n\t\tattributeOldValue: false,\n\t\tcharacterData: true,\n\t\tcharacterDataOldValue: false,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t} );\n\n\twindow.addEventListener( 'load', sendResize, true );\n\n\t// Hack: Remove viewport unit styles, as these are relative\n\t// the iframe root and interfere with our mechanism for\n\t// determining the unconstrained page bounds.\n\tfunction removeViewportStyles( ruleOrNode ) {\n\t\tif ( ruleOrNode.style ) {\n\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function (\n\t\t\t\tstyle\n\t\t\t) {\n\t\t\t\tif (\n\t\t\t\t\t/^\\\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] )\n\t\t\t\t) {\n\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tArray.prototype.forEach.call(\n\t\tdocument.querySelectorAll( '[style]' ),\n\t\tremoveViewportStyles\n\t);\n\tArray.prototype.forEach.call(\n\t\tdocument.styleSheets,\n\t\tfunction ( stylesheet ) {\n\t\t\tArray.prototype.forEach.call(\n\t\t\t\tstylesheet.cssRules || stylesheet.rules,\n\t\t\t\tremoveViewportStyles\n\t\t\t);\n\t\t}\n\t);\n\n\tdocument.body.style.position = 'absolute';\n\tdocument.body.style.width = '100%';\n\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\tsendResize();\n\n\t// Resize events can change the width of elements with 100% width, but we don't\n\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\twindow.addEventListener( 'resize', sendResize, true );\n};\n\nconst style = `\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div,\n\tbody > div iframe {\n\t\twidth: 100%;\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n\n\t.wp-block-embed__wrapper {\n\t\tposition: relative;\n\t}\n\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\n\t/**\n\t * Add responsiveness to embeds with aspect ratios.\n\t *\n\t * These styles have been copied from the web version (https://github.com/WordPress/gutenberg/blob/7901895ca20cf61e402925e31571d659dab64721/packages/block-library/src/embed/style.scss#L42-L89) and\n\t * adapted for the native version.\n\t */\n\t.wp-has-aspect-ratio.wp-block-embed__wrapper::before {\n\t\tcontent: \"\";\n\t\tdisplay: block;\n\t\tpadding-top: 50%; // Default to 2:1 aspect ratio.\n\t}\n\t.wp-has-aspect-ratio iframe {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\t.wp-embed-aspect-21-9.wp-block-embed__wrapper::before {\n\t\tpadding-top: 42.85%; // 9 / 21 * 100\n\t}\n\t.wp-embed-aspect-18-9.wp-block-embed__wrapper::before {\n\t\tpadding-top: 50%; // 9 / 18 * 100\n\t}\n\t.wp-embed-aspect-16-9.wp-block-embed__wrapper::before {\n\t\tpadding-top: 56.25%; // 9 / 16 * 100\n\t}\n\t.wp-embed-aspect-4-3.wp-block-embed__wrapper::before {\n\t\tpadding-top: 75%; // 3 / 4 * 100\n\t}\n\t.wp-embed-aspect-1-1.wp-block-embed__wrapper::before {\n\t\tpadding-top: 100%; // 1 / 1 * 100\n\t}\n\t.wp-embed-aspect-9-16.wp-block-embed__wrapper::before {\n\t\tpadding-top: 177.77%; // 16 / 9 * 100\n\t}\n\t.wp-embed-aspect-1-2.wp-block-embed__wrapper::before {\n\t\tpadding-top: 200%; // 2 / 1 * 100\n\t}\n`;\n\nconst EMPTY_ARRAY = [];\n\nfunction Sandbox( {\n\tcontainerStyle,\n\tcustomJS,\n\thtml = '',\n\tlang = 'en',\n\tproviderUrl = '',\n\tscripts = EMPTY_ARRAY,\n\tstyles = EMPTY_ARRAY,\n\ttitle = '',\n\ttype,\n\turl,\n} ) {\n\tconst colorScheme = usePreferredColorScheme();\n\tconst ref = useRef();\n\tconst [ height, setHeight ] = useState( 0 );\n\tconst [ contentHtml, setContentHtml ] = useState( getHtmlDoc() );\n\n\tconst windowSize = Dimensions.get( 'window' );\n\tconst [ isLandscape, setIsLandscape ] = useState(\n\t\twindowSize.width >= windowSize.height\n\t);\n\tconst wasLandscape = useRef( isLandscape );\n\t// On Android, we need to recreate the WebView on any of the following actions, otherwise it disappears:\n\t// - Device rotation\n\t// - Light/dark mode changes\n\t// For this purpose, the key prop used in the WebView will be updated with the value of the actions.\n\tconst key = Platform.select( {\n\t\tandroid: `${ url }-${\n\t\t\tisLandscape ? 'landscape' : 'portrait'\n\t\t}-${ colorScheme }`,\n\t\tios: url,\n\t} );\n\n\tfunction getHtmlDoc() {\n\t\t// Put the html snippet into a html document, and update the state to refresh the WebView,\n\t\t// we can use this in the future to inject custom styles or scripts.\n\t\t// Scripts go into the body rather than the head, to support embedded content such as Instagram\n\t\t// that expect the scripts to be part of the body.\n\t\tconst htmlDoc = (\n\t\t\t<html lang={ lang }>\n\t\t\t\t<head>\n\t\t\t\t\t<title>{ title }</title>\n\t\t\t\t\t<meta\n\t\t\t\t\t\tname=\"viewport\"\n\t\t\t\t\t\tcontent=\"width=device-width, initial-scale=1\"\n\t\t\t\t\t></meta>\n\t\t\t\t\t<style dangerouslySetInnerHTML={ { __html: style } } />\n\t\t\t\t\t{ styles.map( ( rules, i ) => (\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ { __html: rules } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</head>\n\t\t\t\t<body\n\t\t\t\t\tdata-resizable-iframe-connected=\"data-resizable-iframe-connected\"\n\t\t\t\t\tclassName={ type }\n\t\t\t\t>\n\t\t\t\t\t<div dangerouslySetInnerHTML={ { __html: html } } />\n\t\t\t\t\t<script\n\t\t\t\t\t\ttype=\"text/javascript\"\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html:\n\t\t\t\t\t\t\t\tcustomJS ||\n\t\t\t\t\t\t\t\t`(${ observeAndResizeJS.toString() })();`,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ scripts.map( ( src ) => (\n\t\t\t\t\t\t<script key={ src } src={ src } />\n\t\t\t\t\t) ) }\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t);\n\t\treturn '<!DOCTYPE html>' + renderToString( htmlDoc );\n\t}\n\n\tfunction updateContentHtml( forceRerender = false ) {\n\t\tconst newContentHtml = getHtmlDoc();\n\n\t\tif ( forceRerender && contentHtml === newContentHtml ) {\n\t\t\t// The re-render is forced by updating the state with empty HTML,\n\t\t\t// waiting for the JS code to be executed with \"setImmediate\" and then\n\t\t\t// setting the content HTML again.\n\t\t\tsetContentHtml( '' );\n\t\t\tsetImmediate( () => setContentHtml( newContentHtml ) );\n\t\t} else {\n\t\t\tsetContentHtml( newContentHtml );\n\t\t}\n\t}\n\n\tfunction checkMessageForResize( event ) {\n\t\t// Attempt to parse the message data as JSON if passed as string.\n\t\tlet data = event.nativeEvent.data || {};\n\n\t\tif ( 'string' === typeof data ) {\n\t\t\ttry {\n\t\t\t\tdata = JSON.parse( data );\n\t\t\t} catch ( e ) {}\n\t\t}\n\n\t\t// Update the state only if the message is formatted as we expect,\n\t\t// i.e. as an object with a 'resize' action.\n\t\tif ( 'resize' !== data.action ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetHeight( data.height );\n\t}\n\n\tfunction getSizeStyle() {\n\t\tconst contentHeight = Math.ceil( height );\n\n\t\treturn contentHeight ? { height: contentHeight } : { aspectRatio: 1 };\n\t}\n\n\tfunction onChangeDimensions( dimensions ) {\n\t\tsetIsLandscape( dimensions.window.width >= dimensions.window.height );\n\t}\n\n\tuseEffect( () => {\n\t\tconst dimensionsChangeSubscription = Dimensions.addEventListener(\n\t\t\t'change',\n\t\t\tonChangeDimensions\n\t\t);\n\t\treturn () => {\n\t\t\tdimensionsChangeSubscription.remove();\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tupdateContentHtml();\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ html, title, type, styles, scripts ] );\n\n\tuseEffect( () => {\n\t\t// When device orientation changes we have to recalculate the size,\n\t\t// for this purpose we reset the current size value.\n\t\tif ( wasLandscape.current !== isLandscape ) {\n\t\t\tsetHeight( 0 );\n\t\t}\n\t\twasLandscape.current = isLandscape;\n\t}, [ isLandscape ] );\n\n\treturn (\n\t\t<WebView\n\t\t\tcontainerStyle={ [\n\t\t\t\tsandboxStyles[ 'sandbox-webview__container' ],\n\t\t\t\tcontainerStyle,\n\t\t\t] }\n\t\t\tkey={ key }\n\t\t\tref={ ref }\n\t\t\tsource={ { baseUrl: providerUrl, html: contentHtml } }\n\t\t\t// Wildcard value is required for static HTML\n\t\t\t// Reference: https://github.com/react-native-webview/react-native-webview/blob/master/docs/Reference.md#source\n\t\t\toriginWhitelist={ [ '*' ] }\n\t\t\tstyle={ [\n\t\t\t\tsandboxStyles[ 'sandbox-webview__content' ],\n\t\t\t\tgetSizeStyle(),\n\t\t\t\tPlatform.isAndroid && workaroundStyles.webView,\n\t\t\t] }\n\t\t\tonMessage={ checkMessageForResize }\n\t\t\tscrollEnabled={ false }\n\t\t\tsetBuiltInZoomControls={ false }\n\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\tshowsVerticalScrollIndicator={ false }\n\t\t/>\n\t);\n}\n\nconst workaroundStyles = StyleSheet.create( {\n\twebView: {\n\t\t/**\n\t\t * The slight opacity below is a workaround for an Android crash caused from combining Android\n\t\t * 12's new scroll overflow behavior and webviews.\n\t\t * https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-808869253\n\t\t */\n\t\topacity: 0.99,\n\t},\n} );\n\nexport default memo( Sandbox );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/sandbox/index.native.js"],"names":["observeAndResizeJS","style","EMPTY_ARRAY","Sandbox","containerStyle","customJS","html","lang","providerUrl","scripts","styles","title","type","url","colorScheme","ref","height","setHeight","contentHtml","setContentHtml","getHtmlDoc","windowSize","Dimensions","get","isLandscape","setIsLandscape","width","wasLandscape","key","Platform","select","android","ios","htmlDoc","__html","map","rules","i","src","updateContentHtml","forceRerender","newContentHtml","setImmediate","checkMessageForResize","event","data","nativeEvent","JSON","parse","e","action","getSizeStyle","contentHeight","Math","ceil","aspectRatio","onChangeDimensions","dimensions","window","dimensionsChangeSubscription","addEventListener","remove","current","sandboxStyles","baseUrl","isAndroid","workaroundStyles","webView","StyleSheet","create","opacity"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAaA;;AAKA;;AAtBA;AACA;AACA;;AAIA;AACA;AACA;;AAWA;AACA;AACA;AAGA,MAAMA,kBAAkB,GAAI;AAC5B;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;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;AACA,CA9EA;AAgFA,MAAMC,KAAK,GAAI;AACf;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;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,CAjEA;AAmEA,MAAMC,WAAW,GAAG,EAApB;;AAEA,SAASC,OAAT,OAWI;AAAA,MAXc;AACjBC,IAAAA,cADiB;AAEjBC,IAAAA,QAFiB;AAGjBC,IAAAA,IAAI,GAAG,EAHU;AAIjBC,IAAAA,IAAI,GAAG,IAJU;AAKjBC,IAAAA,WAAW,GAAG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P6C,eAAe,0BAAf,CADO,EAEPZ,YAAY,EAFL,EAGPtB,kBAASoC,SAAT,IAAsBC,gBAAgB,CAACC,OAHhC,CAZT;AAiBC,IAAA,SAAS,EAAGxB,qBAjBb;AAkBC,IAAA,aAAa,EAAG,KAlBjB;AAmBC,IAAA,sBAAsB,EAAG,KAnB1B;AAoBC,IAAA,8BAA8B,EAAG,KApBlC;AAqBC,IAAA,4BAA4B,EAAG;AArBhC,IADD;AAyBA;;AAED,MAAMuB,gBAAgB,GAAGE,wBAAWC,MAAX,CAAmB;AAC3CF,EAAAA,OAAO,EAAE;AACR;AACF;AACA;AACA;AACA;AACEG,IAAAA,OAAO,EAAE;AAND;AADkC,CAAnB,CAAzB;;eAWe,mBAAMnE,OAAN,C","sourcesContent":["/**\n * External dependencies\n */\nimport { Dimensions, StyleSheet } from 'react-native';\nimport { WebView } from 'react-native-webview';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tPlatform,\n\trenderToString,\n\tmemo,\n\tuseRef,\n\tuseState,\n\tuseEffect,\n} from '@wordpress/element';\nimport { usePreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport sandboxStyles from './style.scss';\n\nconst observeAndResizeJS = `\n\t(function() {\n\t\tconst { MutationObserver } = window;\n\n\t\tif ( ! MutationObserver || ! document.body || ! window.parent ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction sendResize() {\n\t\t\tconst clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t\t// The function postMessage is exposed by the react-native-webview library\n\t\t\t// to communicate between React Native and the WebView, in this case,\n\t\t\t// we use it for notifying resize changes.\n\t\t\twindow.ReactNativeWebView.postMessage(\n\t\t\t\tJSON.stringify( {\n\t\t\t\t\taction: 'resize',\n\t\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\t\theight: clientBoundingRect.height,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tconst observer = new MutationObserver( sendResize );\n\t\tobserver.observe( document.body, {\n\t\t\tattributes: true,\n\t\t\tattributeOldValue: false,\n\t\t\tcharacterData: true,\n\t\t\tcharacterDataOldValue: false,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t} );\n\n\t\twindow.addEventListener( 'load', sendResize, true );\n\n\t\t// Hack: Remove viewport unit styles, as these are relative\n\t\t// the iframe root and interfere with our mechanism for\n\t\t// determining the unconstrained page bounds.\n\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\tif ( ruleOrNode.style ) {\n\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function (\n\t\t\t\t\tstyle\n\t\t\t\t) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t/^\\\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] )\n\t\t\t\t\t) {\n\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll( '[style]' ),\n\t\t\tremoveViewportStyles\n\t\t);\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.styleSheets,\n\t\t\tfunction ( stylesheet ) {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tstylesheet.cssRules || stylesheet.rules,\n\t\t\t\t\tremoveViewportStyles\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tdocument.body.style.position = 'absolute';\n\t\tdocument.body.style.width = '100%';\n\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\t\tsendResize();\n\n\t\t// Resize events can change the width of elements with 100% width, but we don't\n\t\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\t\twindow.addEventListener( 'resize', sendResize, true );\n\t\twindow.addEventListener( 'orientationchange', sendResize, true );\n\t\twidow.addEventListener( 'click', sendResize, true );\n\t})();\n`;\n\nconst style = `\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div,\n\tbody > div iframe {\n\t\twidth: 100%;\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n\n\t.wp-block-embed__wrapper {\n\t\tposition: relative;\n\t}\n\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\n\t/**\n\t * Add responsiveness to embeds with aspect ratios.\n\t *\n\t * These styles have been copied from the web version (https://github.com/WordPress/gutenberg/blob/7901895ca20cf61e402925e31571d659dab64721/packages/block-library/src/embed/style.scss#L42-L89) and\n\t * adapted for the native version.\n\t */\n\t.wp-has-aspect-ratio.wp-block-embed__wrapper::before {\n\t\tcontent: \"\";\n\t\tdisplay: block;\n\t\tpadding-top: 50%; // Default to 2:1 aspect ratio.\n\t}\n\t.wp-has-aspect-ratio iframe {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\t.wp-embed-aspect-21-9.wp-block-embed__wrapper::before {\n\t\tpadding-top: 42.85%; // 9 / 21 * 100\n\t}\n\t.wp-embed-aspect-18-9.wp-block-embed__wrapper::before {\n\t\tpadding-top: 50%; // 9 / 18 * 100\n\t}\n\t.wp-embed-aspect-16-9.wp-block-embed__wrapper::before {\n\t\tpadding-top: 56.25%; // 9 / 16 * 100\n\t}\n\t.wp-embed-aspect-4-3.wp-block-embed__wrapper::before {\n\t\tpadding-top: 75%; // 3 / 4 * 100\n\t}\n\t.wp-embed-aspect-1-1.wp-block-embed__wrapper::before {\n\t\tpadding-top: 100%; // 1 / 1 * 100\n\t}\n\t.wp-embed-aspect-9-16.wp-block-embed__wrapper::before {\n\t\tpadding-top: 177.77%; // 16 / 9 * 100\n\t}\n\t.wp-embed-aspect-1-2.wp-block-embed__wrapper::before {\n\t\tpadding-top: 200%; // 2 / 1 * 100\n\t}\n`;\n\nconst EMPTY_ARRAY = [];\n\nfunction Sandbox( {\n\tcontainerStyle,\n\tcustomJS,\n\thtml = '',\n\tlang = 'en',\n\tproviderUrl = '',\n\tscripts = EMPTY_ARRAY,\n\tstyles = EMPTY_ARRAY,\n\ttitle = '',\n\ttype,\n\turl,\n} ) {\n\tconst colorScheme = usePreferredColorScheme();\n\tconst ref = useRef();\n\tconst [ height, setHeight ] = useState( 0 );\n\tconst [ contentHtml, setContentHtml ] = useState( getHtmlDoc() );\n\n\tconst windowSize = Dimensions.get( 'window' );\n\tconst [ isLandscape, setIsLandscape ] = useState(\n\t\twindowSize.width >= windowSize.height\n\t);\n\tconst wasLandscape = useRef( isLandscape );\n\t// On Android, we need to recreate the WebView on any of the following actions, otherwise it disappears:\n\t// - Device rotation\n\t// - Light/dark mode changes\n\t// For this purpose, the key prop used in the WebView will be updated with the value of the actions.\n\tconst key = Platform.select( {\n\t\tandroid: `${ url }-${\n\t\t\tisLandscape ? 'landscape' : 'portrait'\n\t\t}-${ colorScheme }`,\n\t\tios: url,\n\t} );\n\n\tfunction getHtmlDoc() {\n\t\t// Put the html snippet into a html document, and update the state to refresh the WebView,\n\t\t// we can use this in the future to inject custom styles or scripts.\n\t\t// Scripts go into the body rather than the head, to support embedded content such as Instagram\n\t\t// that expect the scripts to be part of the body.\n\t\tconst htmlDoc = (\n\t\t\t<html lang={ lang }>\n\t\t\t\t<head>\n\t\t\t\t\t<title>{ title }</title>\n\t\t\t\t\t<meta\n\t\t\t\t\t\tname=\"viewport\"\n\t\t\t\t\t\tcontent=\"width=device-width, initial-scale=1\"\n\t\t\t\t\t></meta>\n\t\t\t\t\t<style dangerouslySetInnerHTML={ { __html: style } } />\n\t\t\t\t\t{ styles.map( ( rules, i ) => (\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ { __html: rules } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</head>\n\t\t\t\t<body\n\t\t\t\t\tdata-resizable-iframe-connected=\"data-resizable-iframe-connected\"\n\t\t\t\t\tclassName={ type }\n\t\t\t\t>\n\t\t\t\t\t<div dangerouslySetInnerHTML={ { __html: html } } />\n\t\t\t\t\t{ scripts.map( ( src ) => (\n\t\t\t\t\t\t<script key={ src } src={ src } />\n\t\t\t\t\t) ) }\n\t\t\t\t</body>\n\t\t\t</html>\n\t\t);\n\t\treturn '<!DOCTYPE html>' + renderToString( htmlDoc );\n\t}\n\n\tfunction updateContentHtml( forceRerender = false ) {\n\t\tconst newContentHtml = getHtmlDoc();\n\n\t\tif ( forceRerender && contentHtml === newContentHtml ) {\n\t\t\t// The re-render is forced by updating the state with empty HTML,\n\t\t\t// waiting for the JS code to be executed with \"setImmediate\" and then\n\t\t\t// setting the content HTML again.\n\t\t\tsetContentHtml( '' );\n\t\t\tsetImmediate( () => setContentHtml( newContentHtml ) );\n\t\t} else {\n\t\t\tsetContentHtml( newContentHtml );\n\t\t}\n\t}\n\n\tfunction checkMessageForResize( event ) {\n\t\t// Attempt to parse the message data as JSON if passed as string.\n\t\tlet data = event.nativeEvent.data || {};\n\n\t\tif ( 'string' === typeof data ) {\n\t\t\ttry {\n\t\t\t\tdata = JSON.parse( data );\n\t\t\t} catch ( e ) {}\n\t\t}\n\n\t\t// Update the state only if the message is formatted as we expect,\n\t\t// i.e. as an object with a 'resize' action.\n\t\tif ( 'resize' !== data.action ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetHeight( data.height );\n\t}\n\n\tfunction getSizeStyle() {\n\t\tconst contentHeight = Math.ceil( height );\n\n\t\treturn contentHeight ? { height: contentHeight } : { aspectRatio: 1 };\n\t}\n\n\tfunction onChangeDimensions( dimensions ) {\n\t\tsetIsLandscape( dimensions.window.width >= dimensions.window.height );\n\t}\n\n\tuseEffect( () => {\n\t\tconst dimensionsChangeSubscription = Dimensions.addEventListener(\n\t\t\t'change',\n\t\t\tonChangeDimensions\n\t\t);\n\t\treturn () => {\n\t\t\tdimensionsChangeSubscription.remove();\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tupdateContentHtml();\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ html, title, type, styles, scripts ] );\n\n\tuseEffect( () => {\n\t\t// When device orientation changes we have to recalculate the size,\n\t\t// for this purpose we reset the current size value.\n\t\tif ( wasLandscape.current !== isLandscape ) {\n\t\t\tsetHeight( 0 );\n\t\t}\n\t\twasLandscape.current = isLandscape;\n\t}, [ isLandscape ] );\n\n\treturn (\n\t\t<WebView\n\t\t\tcontainerStyle={ [\n\t\t\t\tsandboxStyles[ 'sandbox-webview__container' ],\n\t\t\t\tcontainerStyle,\n\t\t\t] }\n\t\t\tinjectedJavaScript={ customJS || observeAndResizeJS }\n\t\t\tkey={ key }\n\t\t\tref={ ref }\n\t\t\tsource={ { baseUrl: providerUrl, html: contentHtml } }\n\t\t\t// Wildcard value is required for static HTML\n\t\t\t// Reference: https://github.com/react-native-webview/react-native-webview/blob/master/docs/Reference.md#source\n\t\t\toriginWhitelist={ [ '*' ] }\n\t\t\tstyle={ [\n\t\t\t\tsandboxStyles[ 'sandbox-webview__content' ],\n\t\t\t\tgetSizeStyle(),\n\t\t\t\tPlatform.isAndroid && workaroundStyles.webView,\n\t\t\t] }\n\t\t\tonMessage={ checkMessageForResize }\n\t\t\tscrollEnabled={ false }\n\t\t\tsetBuiltInZoomControls={ false }\n\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\tshowsVerticalScrollIndicator={ false }\n\t\t/>\n\t);\n}\n\nconst workaroundStyles = StyleSheet.create( {\n\twebView: {\n\t\t/**\n\t\t * The slight opacity below is a workaround for an Android crash caused from combining Android\n\t\t * 12's new scroll overflow behavior and webviews.\n\t\t * https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-808869253\n\t\t */\n\t\topacity: 0.99,\n\t},\n} );\n\nexport default memo( Sandbox );\n"]}
@@ -42,8 +42,8 @@ function useUniqueId(idProp) {
42
42
  return idProp || id;
43
43
  }
44
44
 
45
- function UnforwardedSelectControl(_ref, ref) {
46
- let {
45
+ function UnforwardedSelectControl(props, ref) {
46
+ const {
47
47
  className,
48
48
  disabled = false,
49
49
  help,
@@ -52,7 +52,7 @@ function UnforwardedSelectControl(_ref, ref) {
52
52
  label,
53
53
  multiple = false,
54
54
  onBlur = noop,
55
- onChange = noop,
55
+ onChange,
56
56
  onFocus = noop,
57
57
  options = [],
58
58
  size = 'default',
@@ -63,8 +63,8 @@ function UnforwardedSelectControl(_ref, ref) {
63
63
  suffix,
64
64
  __next36pxDefaultSize = false,
65
65
  __nextHasNoMarginBottom = false,
66
- ...props
67
- } = _ref;
66
+ ...restProps
67
+ } = props;
68
68
  const [isFocused, setIsFocused] = (0, _element.useState)(false);
69
69
  const id = useUniqueId(idProp);
70
70
  const helpId = help ? `${id}__help` : undefined; // Disable reason: A select with an onchange throws a warning.
@@ -82,31 +82,35 @@ function UnforwardedSelectControl(_ref, ref) {
82
82
  };
83
83
 
84
84
  const handleOnChange = event => {
85
- if (multiple) {
86
- const selectedOptions = Array.from(event.target.options).filter(_ref2 => {
85
+ var _props$onChange2;
86
+
87
+ if (props.multiple) {
88
+ var _props$onChange;
89
+
90
+ const selectedOptions = Array.from(event.target.options).filter(_ref => {
87
91
  let {
88
92
  selected
89
- } = _ref2;
93
+ } = _ref;
90
94
  return selected;
91
95
  });
92
- const newValues = selectedOptions.map(_ref3 => {
96
+ const newValues = selectedOptions.map(_ref2 => {
93
97
  let {
94
98
  value
95
- } = _ref3;
99
+ } = _ref2;
96
100
  return value;
97
101
  });
98
- onChange(newValues);
102
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, newValues, {
103
+ event
104
+ });
99
105
  return;
100
106
  }
101
107
 
102
- onChange(event.target.value, {
108
+ (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 ? void 0 : _props$onChange2.call(props, event.target.value, {
103
109
  event
104
110
  });
105
111
  };
106
112
 
107
113
  const classes = (0, _classnames.default)('components-select-control', className);
108
- /* eslint-disable jsx-a11y/no-onchange */
109
-
110
114
  return (0, _element.createElement)(_baseControl.default, {
111
115
  help: help,
112
116
  id: id,
@@ -123,7 +127,7 @@ function UnforwardedSelectControl(_ref, ref) {
123
127
  prefix: prefix,
124
128
  labelPosition: labelPosition,
125
129
  __next36pxDefaultSize: __next36pxDefaultSize
126
- }, (0, _element.createElement)(_selectControlStyles.Select, (0, _extends2.default)({}, props, {
130
+ }, (0, _element.createElement)(_selectControlStyles.Select, (0, _extends2.default)({}, restProps, {
127
131
  __next36pxDefaultSize: __next36pxDefaultSize,
128
132
  "aria-describedby": helpId,
129
133
  className: "components-select-control__input",
@@ -144,7 +148,6 @@ function UnforwardedSelectControl(_ref, ref) {
144
148
  disabled: option.disabled
145
149
  }, option.label);
146
150
  }))));
147
- /* eslint-enable jsx-a11y/no-onchange */
148
151
  }
149
152
  /**
150
153
  * `SelectControl` allows users to select from a single or multiple option menu.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/select-control/index.tsx"],"names":["noop","useUniqueId","idProp","instanceId","SelectControl","id","UnforwardedSelectControl","ref","className","disabled","help","hideLabelFromVision","label","multiple","onBlur","onChange","onFocus","options","size","value","valueProp","labelPosition","children","prefix","suffix","__next36pxDefaultSize","__nextHasNoMarginBottom","props","isFocused","setIsFocused","helpId","undefined","length","handleOnBlur","event","handleOnFocus","handleOnChange","selectedOptions","Array","from","target","filter","selected","newValues","map","classes","option","index","key"],"mappings":";;;;;;;;;AAUA;;;;AAPA;;AAMA;;AAMA;;AACA;;AACA;;AAGA;;AApBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AAQA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UA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ZjB;AAaC,IAAA,qBAAqB,EAAGI;AAbzB,KAeC,4BAAC,2BAAD,6BACME,KADN;AAEC,IAAA,qBAAqB,EAAGF,qBAFzB;AAGC,wBAAmBK,MAHpB;AAIC,IAAA,SAAS,EAAC,kCAJX;AAKC,IAAA,QAAQ,EAAGrB,QALZ;AAMC,IAAA,EAAE,EAAGJ,EANN;AAOC,IAAA,QAAQ,EAAGQ,QAPZ;AAQC,IAAA,MAAM,EAAGoB,YARV;AASC,IAAA,QAAQ,EAAGG,cATZ;AAUC,IAAA,OAAO,EAAGD,aAVX;AAWC,IAAA,GAAG,EAAG5B,GAXP;AAYC,IAAA,UAAU,EAAGW,IAZd;AAaC,IAAA,KAAK,EAAGE;AAbT,MAeGE,QAAQ,IACTL,OAAO,CAAC2B,GAAR,CAAa,CAAEE,MAAF,EAAUC,KAAV,KAAqB;AACjC,UAAMC,GAAG,GACRF,MAAM,CAACzC,EAAP,IACC,GAAGyC,MAAM,CAAClC,KAAO,IAAIkC,MAAM,CAAC3B,KAAO,IAAI4B,KAAO,EAFhD;AAIA,WACC;AACC,MAAA,GAAG,EAAGC,GADP;AAEC,MAAA,KAAK,EAAGF,MAAM,CAAC3B,KAFhB;AAGC,MAAA,QAAQ,EAAG2B,MAAM,CAACrC;AAHnB,OAKGqC,MAAM,CAAClC,KALV,CADD;AASA,GAdD,CAhBF,CAfD,CALD,CADD;AAwDA;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMR,aAAa,GAAG,yBAAYE,wBAAZ,CAAtB;;eAEQF,a","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ChangeEvent, FocusEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport InputBase from '../input-control/input-base';\nimport { Select } from './styles/select-control-styles';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { SelectControlProps } from './types';\nimport SelectControlChevronDown from './chevron-down';\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( SelectControl );\n\tconst id = `inspector-select-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nfunction UnforwardedSelectControl(\n\t{\n\t\tclassName,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision,\n\t\tid: idProp,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonFocus = noop,\n\t\toptions = [],\n\t\tsize = 'default',\n\t\tvalue: valueProp,\n\t\tlabelPosition = 'top',\n\t\tchildren,\n\t\tprefix,\n\t\tsuffix,\n\t\t__next36pxDefaultSize = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\t...props\n\t}: WordPressComponentProps< SelectControlProps, 'select', false >,\n\tref: ForwardedRef< HTMLSelectElement >\n) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst id = useUniqueId( idProp );\n\tconst helpId = help ? `${ id }__help` : undefined;\n\n\t// Disable reason: A select with an onchange throws a warning.\n\tif ( ! options?.length && ! children ) return null;\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLSelectElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLSelectElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t};\n\n\tconst handleOnChange = ( event: ChangeEvent< HTMLSelectElement > ) => {\n\t\tif ( multiple ) {\n\t\t\tconst selectedOptions = Array.from( event.target.options ).filter(\n\t\t\t\t( { selected } ) => selected\n\t\t\t);\n\t\t\tconst newValues = selectedOptions.map( ( { value } ) => value );\n\t\t\tonChange( newValues );\n\t\t\treturn;\n\t\t}\n\n\t\tonChange( event.target.value, { event } );\n\t};\n\n\tconst classes = classNames( 'components-select-control', className );\n\n\t/* eslint-disable jsx-a11y/no-onchange */\n\treturn (\n\t\t<BaseControl\n\t\t\thelp={ help }\n\t\t\tid={ id }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t>\n\t\t\t<InputBase\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\tisFocused={ isFocused }\n\t\t\t\tlabel={ label }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={\n\t\t\t\t\tsuffix || ( ! multiple && <SelectControlChevronDown /> )\n\t\t\t\t}\n\t\t\t\tprefix={ prefix }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t>\n\t\t\t\t<Select\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t\taria-describedby={ helpId }\n\t\t\t\t\tclassName=\"components-select-control__input\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tmultiple={ multiple }\n\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tselectSize={ size }\n\t\t\t\t\tvalue={ valueProp }\n\t\t\t\t>\n\t\t\t\t\t{ children ||\n\t\t\t\t\t\toptions.map( ( option, index ) => {\n\t\t\t\t\t\t\tconst key =\n\t\t\t\t\t\t\t\toption.id ||\n\t\t\t\t\t\t\t\t`${ option.label }-${ option.value }-${ index }`;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<option\n\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\tdisabled={ option.disabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t</Select>\n\t\t\t</InputBase>\n\t\t</BaseControl>\n\t);\n\t/* eslint-enable jsx-a11y/no-onchange */\n}\n\n/**\n * `SelectControl` allows users to select from a single or multiple option menu.\n * It functions as a wrapper around the browser's native `<select>` element.\n *\n * @example\n * import { SelectControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MySelectControl = () => {\n * const [ size, setSize ] = useState( '50%' );\n *\n * return (\n * <SelectControl\n * label=\"Size\"\n * value={ size }\n * options={ [\n * { label: 'Big', value: '100%' },\n * { label: 'Medium', value: '50%' },\n * { label: 'Small', value: '25%' },\n * ] }\n * onChange={ setSize }\n * />\n * );\n * };\n */\nexport const SelectControl = forwardRef( UnforwardedSelectControl );\n\nexport default SelectControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/select-control/index.tsx"],"names":["noop","useUniqueId","idProp","instanceId","SelectControl","id","UnforwardedSelectControl","props","ref","className","disabled","help","hideLabelFromVision","label","multiple","onBlur","onChange","onFocus","options","size","value","valueProp","labelPosition","children","prefix","suffix","__next36pxDefaultSize","__nextHasNoMarginBottom","restProps","isFocused","setIsFocused","helpId","undefined","length","handleOnBlur","event","handleOnFocus","handleOnChange","selectedOptions","Array","from","target","filter","selected","newValues","map","classes","option","index","key"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAMA;;AACA;;AACA;;AAGA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAQA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,WAAT,CAAsBC,MAAtB,EAAwC;AACvC,QAAMC,UAAU,GAAG,4BAAeC,aAAf,CAAnB;AACA,QAAMC,EAAE,GAAI,4BAA4BF,U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GU,MAXV;AAYC,IAAA,aAAa,EAAGF,aAZjB;AAaC,IAAA,qBAAqB,EAAGI;AAbzB,KAeC,4BAAC,2BAAD,6BACME,SADN;AAEC,IAAA,qBAAqB,EAAGF,qBAFzB;AAGC,wBAAmBK,MAHpB;AAIC,IAAA,SAAS,EAAC,kCAJX;AAKC,IAAA,QAAQ,EAAGrB,QALZ;AAMC,IAAA,EAAE,EAAGL,EANN;AAOC,IAAA,QAAQ,EAAGS,QAPZ;AAQC,IAAA,MAAM,EAAGoB,YARV;AASC,IAAA,QAAQ,EAAGG,cATZ;AAUC,IAAA,OAAO,EAAGD,aAVX;AAWC,IAAA,GAAG,EAAG5B,GAXP;AAYC,IAAA,UAAU,EAAGW,IAZd;AAaC,IAAA,KAAK,EAAGE;AAbT,MAeGE,QAAQ,IACTL,OAAO,CAAC2B,GAAR,CAAa,CAAEE,MAAF,EAAUC,KAAV,KAAqB;AACjC,UAAMC,GAAG,GACRF,MAAM,CAAC1C,EAAP,IACC,GAAG0C,MAAM,CAAClC,KAAO,IAAIkC,MAAM,CAAC3B,KAAO,IAAI4B,KAAO,EAFhD;AAIA,WACC;AACC,MAAA,GAAG,EAAGC,GADP;AAEC,MAAA,KAAK,EAAGF,MAAM,CAAC3B,KAFhB;AAGC,MAAA,QAAQ,EAAG2B,MAAM,CAACrC;AAHnB,OAKGqC,MAAM,CAAClC,KALV,CADD;AASA,GAdD,CAhBF,CAfD,CALD,CADD;AAwDA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMT,aAAa,GAAG,yBAAYE,wBAAZ,CAAtB;;eAEQF,a","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport InputBase from '../input-control/input-base';\nimport { Select } from './styles/select-control-styles';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { SelectControlProps } from './types';\nimport SelectControlChevronDown from './chevron-down';\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( SelectControl );\n\tconst id = `inspector-select-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nfunction UnforwardedSelectControl(\n\tprops: WordPressComponentProps< SelectControlProps, 'select', false >,\n\tref: React.ForwardedRef< HTMLSelectElement >\n) {\n\tconst {\n\t\tclassName,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision,\n\t\tid: idProp,\n\t\tlabel,\n\t\tmultiple = false,\n\t\tonBlur = noop,\n\t\tonChange,\n\t\tonFocus = noop,\n\t\toptions = [],\n\t\tsize = 'default',\n\t\tvalue: valueProp,\n\t\tlabelPosition = 'top',\n\t\tchildren,\n\t\tprefix,\n\t\tsuffix,\n\t\t__next36pxDefaultSize = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\t...restProps\n\t} = props;\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst id = useUniqueId( idProp );\n\tconst helpId = help ? `${ id }__help` : undefined;\n\n\t// Disable reason: A select with an onchange throws a warning.\n\tif ( ! options?.length && ! children ) return null;\n\n\tconst handleOnBlur = ( event: React.FocusEvent< HTMLSelectElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t};\n\n\tconst handleOnFocus = ( event: React.FocusEvent< HTMLSelectElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t};\n\n\tconst handleOnChange = (\n\t\tevent: React.ChangeEvent< HTMLSelectElement >\n\t) => {\n\t\tif ( props.multiple ) {\n\t\t\tconst selectedOptions = Array.from( event.target.options ).filter(\n\t\t\t\t( { selected } ) => selected\n\t\t\t);\n\t\t\tconst newValues = selectedOptions.map( ( { value } ) => value );\n\t\t\tprops.onChange?.( newValues, { event } );\n\t\t\treturn;\n\t\t}\n\n\t\tprops.onChange?.( event.target.value, { event } );\n\t};\n\n\tconst classes = classNames( 'components-select-control', className );\n\n\treturn (\n\t\t<BaseControl\n\t\t\thelp={ help }\n\t\t\tid={ id }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t>\n\t\t\t<InputBase\n\t\t\t\tclassName={ classes }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\tisFocused={ isFocused }\n\t\t\t\tlabel={ label }\n\t\t\t\tsize={ size }\n\t\t\t\tsuffix={\n\t\t\t\t\tsuffix || ( ! multiple && <SelectControlChevronDown /> )\n\t\t\t\t}\n\t\t\t\tprefix={ prefix }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t>\n\t\t\t\t<Select\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t__next36pxDefaultSize={ __next36pxDefaultSize }\n\t\t\t\t\taria-describedby={ helpId }\n\t\t\t\t\tclassName=\"components-select-control__input\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tmultiple={ multiple }\n\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tselectSize={ size }\n\t\t\t\t\tvalue={ valueProp }\n\t\t\t\t>\n\t\t\t\t\t{ children ||\n\t\t\t\t\t\toptions.map( ( option, index ) => {\n\t\t\t\t\t\t\tconst key =\n\t\t\t\t\t\t\t\toption.id ||\n\t\t\t\t\t\t\t\t`${ option.label }-${ option.value }-${ index }`;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<option\n\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\tdisabled={ option.disabled }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t</Select>\n\t\t\t</InputBase>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * `SelectControl` allows users to select from a single or multiple option menu.\n * It functions as a wrapper around the browser's native `<select>` element.\n *\n * @example\n * import { SelectControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MySelectControl = () => {\n * const [ size, setSize ] = useState( '50%' );\n *\n * return (\n * <SelectControl\n * label=\"Size\"\n * value={ size }\n * options={ [\n * { label: 'Big', value: '100%' },\n * { label: 'Medium', value: '50%' },\n * { label: 'Small', value: '25%' },\n * ] }\n * onChange={ setSize }\n * />\n * );\n * };\n */\nexport const SelectControl = forwardRef( UnforwardedSelectControl );\n\nexport default SelectControl;\n"]}
@@ -117,7 +117,7 @@ function TabPanel(_ref2) {
117
117
  });
118
118
  const selectedId = `${instanceId}-${(_selectedTab$name = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.name) !== null && _selectedTab$name !== void 0 ? _selectedTab$name : 'none'}`; // Handle selecting the initial tab.
119
119
 
120
- (0, _element.useEffect)(() => {
120
+ (0, _element.useLayoutEffect)(() => {
121
121
  // If there's a selected tab, don't override it.
122
122
  if (selectedTab) {
123
123
  return;