@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
@@ -10,7 +10,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
10
10
  * Internal dependencies
11
11
  */
12
12
  import { Text } from '../../../text';
13
- import { COLORS } from '../../../utils';
13
+ import { font, COLORS } from '../../../utils';
14
14
  export const Root = _styled("div", process.env.NODE_ENV === "production" ? {
15
15
  target: "e1wq7y4k3"
16
16
  } : {
@@ -22,7 +22,7 @@ export const Root = _styled("div", process.env.NODE_ENV === "production" ? {
22
22
  } : {
23
23
  name: "1cd7zoc",
24
24
  styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0",
25
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVc4QiIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3Jlc2l6YWJsZS1ib3gvcmVzaXplLXRvb2x0aXAvc3R5bGVzL3Jlc2l6ZS10b29sdGlwLnN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5b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ICR7IENPTE9SUy51aS50ZXh0RGFyayB9O1xuXHRcdGRpc3BsYXk6IGJsb2NrO1xuXHRcdGZvbnQtc2l6ZTogMTNweDtcblx0XHRsaW5lLWhlaWdodDogMS40O1xuXHRcdHdoaXRlLXNwYWNlOiBub3dyYXA7XG5cdH1cbmA7XG4iXX0= */",
26
26
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
27
27
  });
28
28
  export const TooltipWrapper = _styled("div", process.env.NODE_ENV === "production" ? {
@@ -36,7 +36,7 @@ export const TooltipWrapper = _styled("div", process.env.NODE_ENV === "productio
36
36
  } : {
37
37
  name: "ajymcs",
38
38
  styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear",
39
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFCd0MiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJv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nbi1pdGVtczogY2VudGVyO1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRkaXNwbGF5OiBpbmxpbmUtZmxleDtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdG9wYWNpdHk6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1mYW1pbHk6ICR7IGZvbnQoICdkZWZhdWx0LmZvbnRGYW1pbHknICkgfTtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */",
40
40
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
41
41
  });
42
42
  export const Tooltip = _styled("div", process.env.NODE_ENV === "production" ? {
@@ -44,7 +44,7 @@ export const Tooltip = _styled("div", process.env.NODE_ENV === "production" ? {
44
44
  } : {
45
45
  target: "e1wq7y4k1",
46
46
  label: "Tooltip"
47
- })("background:", COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-size:12px;color:", COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStCaUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHJpZ2h0OiAwO1xuXHR0b3A6IDA7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRkaXNwbGF5OiBpbmxpbmUtZmxleDtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdG9wYWNpdHk6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */")); // TODO: Resolve need to use &&& to increase specificity
47
+ })("background:", COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-family:", font('default.fontFamily'), ";font-size:12px;color:", COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStCaUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IGZvbnQsIENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHJpZ2h0OiAwO1xuXHR0b3A6IDA7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRkaXNwbGF5OiBpbmxpbmUtZmxleDtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdG9wYWNpdHk6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1mYW1pbHk6ICR7IGZvbnQoICdkZWZhdWx0LmZvbnRGYW1pbHknICkgfTtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */")); // TODO: Resolve need to use &&& to increase specificity
48
48
  // https://github.com/WordPress/gutenberg/issues/18483
49
49
 
50
50
  export const LabelText = /*#__PURE__*/_styled(Text, process.env.NODE_ENV === "production" ? {
@@ -52,5 +52,5 @@ export const LabelText = /*#__PURE__*/_styled(Text, process.env.NODE_ENV === "pr
52
52
  } : {
53
53
  target: "e1wq7y4k0",
54
54
  label: "LabelText"
55
- })("&&&{color:", 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRDdUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHJpZ2h0OiAwO1xuXHR0b3A6IDA7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRkaXNwbGF5OiBpbmxpbmUtZmxleDtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdG9wYWNpdHk6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */"));
55
+ })("&&&{color:", COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json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lbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1mYW1pbHk6ICR7IGZvbnQoICdkZWZhdWx0LmZvbnRGYW1pbHknICkgfTtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */"));
56
56
  //# 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":["Text","COLORS","Root","TooltipWrapper","Tooltip","gray","ui","textDark","LabelText"],"mappings":";;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,eAArB;AACA,SAASC,MAAT,QAAuB,gBAAvB;AAEA,OAAO,MAAMC,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;AAUP,OAAO,MAAMC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;AAUP,OAAO,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,kBACJH,MAAM,CAACI,IAAP,CAAa,GAAb,CADI,oEAKTJ,MAAM,CAACK,EAAP,CAAUC,QALD,29DAAb,C,CAUP;AACA;;AAEA,OAAO,MAAMC,SAAS,GAAG,qBAAQR,IAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,eAEVC,MAAM,CAACK,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":["Text","font","COLORS","Root","TooltipWrapper","Tooltip","gray","ui","textDark","LabelText"],"mappings":";;;;AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,eAArB;AACA,SAASC,IAAT,EAAeC,MAAf,QAA6B,gBAA7B;AAEA,OAAO,MAAMC,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;AAUP,OAAO,MAAMC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;AAUP,OAAO,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,kBACJH,MAAM,CAACI,IAAP,CAAa,GAAb,CADI,2DAIHL,IAAI,CAAE,oBAAF,CAJD,4BAMTC,MAAM,CAACK,EAAP,CAAUC,QAND,uiEAAb,C,CAWP;AACA;;AAEA,OAAO,MAAMC,SAAS,GAAG,qBAAQT,IAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,eAEVE,MAAM,CAACK,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":["useCallback","useEffect","useRef","useState","useResizeObserver","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":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,EAAiCC,MAAjC,EAAyCC,QAAzC,QAAyD,oBAAzD;AACA,SAASC,iBAAT,QAAkC,oBAAlC;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAIA,OAAO,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;AACA,OAAO,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,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASsB,YAAT,QAQ0C;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"]}
1
+ {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/utils.ts"],"names":["useCallback","useEffect","useRef","useState","useResizeObserver","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":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,EAAiCC,MAAjC,EAAyCC,QAAzC,QAAyD,oBAAzD;AACA,SAASC,iBAAT,QAAkC,oBAAlC;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAIA,OAAO,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;AACA,OAAO,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,IAA4BZ,iBAAiB,EAAnD;AAEA;AACD;AACA;AACA;AACA;;AACC,QAAMa,gBAAgB,GAAG,CAAC,CAAEP,IAA5B;AAEA;AACD;AACA;AACA;;AACC,QAAM,CAAEQ,KAAF,EAASC,QAAT,IAAsBhB,QAAQ,CAAE,KAAF,CAApC;AACA,QAAM,CAAEiB,KAAF,EAASC,QAAT,IAAsBlB,QAAQ,CAAE,KAAF,CAApC;AAE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ACA;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"]}
@@ -9,7 +9,6 @@ import classnames from 'classnames';
9
9
  */
10
10
 
11
11
  import { cloneElement, Children } from '@wordpress/element';
12
- import { useResizeObserver } from '@wordpress/compose';
13
12
  /**
14
13
  * Internal dependencies
15
14
  */
@@ -37,25 +36,26 @@ function ResponsiveWrapper(_ref) {
37
36
  children,
38
37
  isInline = false
39
38
  } = _ref;
40
- const [containerResizeListener, {
41
- width: containerWidth
42
- }] = useResizeObserver();
43
39
 
44
40
  if (Children.count(children) !== 1) {
45
41
  return null;
46
42
  }
47
43
 
48
- const imageStyle = {
49
- paddingBottom: naturalWidth < (containerWidth !== null && containerWidth !== void 0 ? containerWidth : 0) ? naturalHeight : naturalHeight / naturalWidth * 100 + '%'
50
- };
51
44
  const TagName = isInline ? 'span' : 'div';
45
+ let aspectRatio;
46
+
47
+ if (naturalWidth && naturalHeight) {
48
+ aspectRatio = `${naturalWidth} / ${naturalHeight}`;
49
+ }
50
+
52
51
  return createElement(TagName, {
53
52
  className: "components-responsive-wrapper"
54
- }, containerResizeListener, createElement(TagName, {
55
- style: imageStyle
56
- }), cloneElement(children, {
57
- className: classnames('components-responsive-wrapper__content', children.props.className)
58
- }));
53
+ }, createElement("div", null, cloneElement(children, {
54
+ className: classnames('components-responsive-wrapper__content', children.props.className),
55
+ style: { ...children.props.style,
56
+ aspectRatio
57
+ }
58
+ })));
59
59
  }
60
60
 
61
61
  export default ResponsiveWrapper;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/responsive-wrapper/index.tsx"],"names":["classnames","cloneElement","Children","useResizeObserver","ResponsiveWrapper","naturalWidth","naturalHeight","children","isInline","containerResizeListener","width","containerWidth","count","imageStyle","paddingBottom","TagName","className","props"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,YAAT,EAAuBC,QAAvB,QAAuC,oBAAvC;AACA,SAASC,iBAAT,QAAkC,oBAAlC;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,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,IACLR,iBAAiB,EADlB;;AAEA,MAAKD,QAAQ,CAACU,KAAT,CAAgBL,QAAhB,MAA+B,CAApC,EAAwC;AACvC,WAAO,IAAP;AACA;;AACD,QAAMM,UAAU,GAAG;AAClBC,IAAAA,aAAa,EACZT,YAAY,IAAKM,cAAL,aAAKA,cAAL,cAAKA,cAAL,GAAuB,CAAvB,CAAZ,GACGL,aADH,GAEKA,aAAa,GAAGD,YAAlB,GAAmC,GAAnC,GAAyC;AAJ3B,GAAnB;AAMA,QAAMU,OAAO,GAAGP,QAAQ,GAAG,MAAH,GAAY,KAApC;AACA,SACC,cAAC,OAAD;AAAS,IAAA,SAAS,EAAC;AAAnB,KACGC,uBADH,EAEC,cAAC,OAAD;AAAS,IAAA,KAAK,EAAGI;AAAjB,IAFD,EAGGZ,YAAY,CAAEM,QAAF,EAAY;AACzBS,IAAAA,SAAS,EAAEhB,UAAU,CACpB,wCADoB,EAEpBO,QAAQ,CAACU,KAAT,CAAeD,SAFK;AADI,GAAZ,CAHf,CADD;AAYA;;AAED,eAAeZ,iBAAf","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":["classnames","cloneElement","Children","ResponsiveWrapper","naturalWidth","naturalHeight","children","isInline","count","TagName","aspectRatio","className","props","style"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,YAAT,EAAuBC,QAAvB,QAAuC,oBAAvC;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAT,OAK4B;AAAA,MALA;AAC3BC,IAAAA,YAD2B;AAE3BC,IAAAA,aAF2B;AAG3BC,IAAAA,QAH2B;AAI3BC,IAAAA,QAAQ,GAAG;AAJgB,GAKA;;AAC3B,MAAKL,QAAQ,CAACM,KAAT,CAAgBF,QAAhB,MAA+B,CAApC,EAAwC;AACvC,WAAO,IAAP;AACA;;AAED,QAAMG,OAAO,GAAGF,QAAQ,GAAG,MAAH,GAAY,KAApC;AACA,MAAIG,WAAJ;;AACA,MAAKN,YAAY,IAAIC,aAArB,EAAqC;AACpCK,IAAAA,WAAW,GAAI,GAAGN,YAAc,MAAMC,aAAe,EAArD;AACA;;AAED,SACC,cAAC,OAAD;AAAS,IAAA,SAAS,EAAC;AAAnB,KACC,2BACGJ,YAAY,CAAEK,QAAF,EAAY;AACzBK,IAAAA,SAAS,EAAEX,UAAU,CACpB,wCADoB,EAEpBM,QAAQ,CAACM,KAAT,CAAeD,SAFK,CADI;AAKzBE,IAAAA,KAAK,EAAE,EACN,GAAGP,QAAQ,CAACM,KAAT,CAAeC,KADZ;AAENH,MAAAA;AAFM;AALkB,GAAZ,CADf,CADD,CADD;AAgBA;;AAED,eAAeP,iBAAf","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"]}
@@ -16,69 +16,85 @@ import { usePreferredColorScheme } from '@wordpress/compose';
16
16
  */
17
17
 
18
18
  import sandboxStyles from './style.scss';
19
+ const observeAndResizeJS = `
20
+ (function() {
21
+ const { MutationObserver } = window;
19
22
 
20
- const observeAndResizeJS = function () {
21
- // Hermes requires a special directive to preserve the original source code
22
- // when using `Function.prototype.toString()` below.
23
- // https://github.com/facebook/hermes/issues/114#issuecomment-887106990
24
- 'show source';
23
+ if ( ! MutationObserver || ! document.body || ! window.parent ) {
24
+ return;
25
+ }
25
26
 
26
- const {
27
- MutationObserver
28
- } = window;
27
+ function sendResize() {
28
+ const clientBoundingRect = document.body.getBoundingClientRect();
29
29
 
30
- if (!MutationObserver || !document.body || !window.parent) {
31
- return;
32
- }
30
+ // The function postMessage is exposed by the react-native-webview library
31
+ // to communicate between React Native and the WebView, in this case,
32
+ // we use it for notifying resize changes.
33
+ window.ReactNativeWebView.postMessage(
34
+ JSON.stringify( {
35
+ action: 'resize',
36
+ width: clientBoundingRect.width,
37
+ height: clientBoundingRect.height,
38
+ } )
39
+ );
40
+ }
33
41
 
34
- function sendResize() {
35
- const clientBoundingRect = document.body.getBoundingClientRect(); // The function postMessage is exposed by the react-native-webview library
36
- // to communicate between React Native and the WebView, in this case,
37
- // we use it for notifying resize changes.
42
+ const observer = new MutationObserver( sendResize );
43
+ observer.observe( document.body, {
44
+ attributes: true,
45
+ attributeOldValue: false,
46
+ characterData: true,
47
+ characterDataOldValue: false,
48
+ childList: true,
49
+ subtree: true,
50
+ } );
38
51
 
39
- window.ReactNativeWebView.postMessage(JSON.stringify({
40
- action: 'resize',
41
- width: clientBoundingRect.width,
42
- height: clientBoundingRect.height
43
- }));
44
- }
52
+ window.addEventListener( 'load', sendResize, true );
45
53
 
46
- const observer = new MutationObserver(sendResize);
47
- observer.observe(document.body, {
48
- attributes: true,
49
- attributeOldValue: false,
50
- characterData: true,
51
- characterDataOldValue: false,
52
- childList: true,
53
- subtree: true
54
- });
55
- window.addEventListener('load', sendResize, true); // Hack: Remove viewport unit styles, as these are relative
56
- // the iframe root and interfere with our mechanism for
57
- // determining the unconstrained page bounds.
54
+ // Hack: Remove viewport unit styles, as these are relative
55
+ // the iframe root and interfere with our mechanism for
56
+ // determining the unconstrained page bounds.
57
+ function removeViewportStyles( ruleOrNode ) {
58
+ if ( ruleOrNode.style ) {
59
+ [ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function (
60
+ style
61
+ ) {
62
+ if (
63
+ /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] )
64
+ ) {
65
+ ruleOrNode.style[ style ] = '';
66
+ }
67
+ } );
68
+ }
69
+ }
58
70
 
59
- function removeViewportStyles(ruleOrNode) {
60
- if (ruleOrNode.style) {
61
- ['width', 'height', 'minHeight', 'maxHeight'].forEach(function (style) {
62
- if (/^\\d+(vmin|vmax|vh|vw)$/.test(ruleOrNode.style[style])) {
63
- ruleOrNode.style[style] = '';
64
- }
65
- });
66
- }
67
- }
71
+ Array.prototype.forEach.call(
72
+ document.querySelectorAll( '[style]' ),
73
+ removeViewportStyles
74
+ );
75
+ Array.prototype.forEach.call(
76
+ document.styleSheets,
77
+ function ( stylesheet ) {
78
+ Array.prototype.forEach.call(
79
+ stylesheet.cssRules || stylesheet.rules,
80
+ removeViewportStyles
81
+ );
82
+ }
83
+ );
68
84
 
69
- Array.prototype.forEach.call(document.querySelectorAll('[style]'), removeViewportStyles);
70
- Array.prototype.forEach.call(document.styleSheets, function (stylesheet) {
71
- Array.prototype.forEach.call(stylesheet.cssRules || stylesheet.rules, removeViewportStyles);
72
- });
73
- document.body.style.position = 'absolute';
74
- document.body.style.width = '100%';
75
- document.body.setAttribute('data-resizable-iframe-connected', '');
76
- sendResize(); // Resize events can change the width of elements with 100% width, but we don't
77
- // get an DOM mutations for that, so do the resize when the window is resized, too.
85
+ document.body.style.position = 'absolute';
86
+ document.body.style.width = '100%';
87
+ document.body.setAttribute( 'data-resizable-iframe-connected', '' );
78
88
 
79
- window.addEventListener('resize', sendResize, true);
80
- };
89
+ sendResize();
81
90
 
91
+ // Resize events can change the width of elements with 100% width, but we don't
92
+ // get an DOM mutations for that, so do the resize when the window is resized, too.
93
+ window.addEventListener( 'resize', sendResize, true );
94
+ window.addEventListener( 'orientationchange', sendResize, true );
95
+ widow.addEventListener( 'click', sendResize, true );
96
+ })();
97
+ `;
82
98
  const style = `
83
99
  body {
84
100
  margin: 0;
@@ -202,11 +218,6 @@ function Sandbox(_ref) {
202
218
  dangerouslySetInnerHTML: {
203
219
  __html: html
204
220
  }
205
- }), createElement("script", {
206
- type: "text/javascript",
207
- dangerouslySetInnerHTML: {
208
- __html: customJS || `(${observeAndResizeJS.toString()})();`
209
- }
210
221
  }), scripts.map(src => createElement("script", {
211
222
  key: src,
212
223
  src: src
@@ -283,6 +294,7 @@ function Sandbox(_ref) {
283
294
  }, [isLandscape]);
284
295
  return createElement(WebView, {
285
296
  containerStyle: [sandboxStyles['sandbox-webview__container'], containerStyle],
297
+ injectedJavaScript: customJS || observeAndResizeJS,
286
298
  key: key,
287
299
  ref: ref,
288
300
  source: {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/sandbox/index.native.js"],"names":["Dimensions","StyleSheet","WebView","Platform","renderToString","memo","useRef","useState","useEffect","usePreferredColorScheme","sandboxStyles","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","get","isLandscape","setIsLandscape","wasLandscape","key","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","baseUrl","isAndroid","workaroundStyles","webView","create","opacity"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UAAT,EAAqBC,UAArB,QAAuC,cAAvC;AACA,SAASC,OAAT,QAAwB,sBAAxB;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,cAFD,EAGCC,IAHD,EAICC,MAJD,EAKCC,QALD,EAMCC,SAND,QAOO,oBAPP;AAQA,SAASC,uBAAT,QAAwC,oBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,cAA1B;;AAEA,MAAMC,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,CAAC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AA,aAAa,EAAG,KAjBjB;AAkBC,IAAA,sBAAsB,EAAG,KAlB1B;AAmBC,IAAA,8BAA8B,EAAG,KAnBlC;AAoBC,IAAA,4BAA4B,EAAG;AApBhC,IADD;AAwBA;;AAED,MAAMkB,gBAAgB,GAAGzG,UAAU,CAAC2G,MAAX,CAAmB;AAC3CD,EAAAA,OAAO,EAAE;AACR;AACF;AACA;AACA;AACA;AACEE,IAAAA,OAAO,EAAE;AAND;AADkC,CAAnB,CAAzB;AAWA,eAAexG,IAAI,CAAE+C,OAAF,CAAnB","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":["Dimensions","StyleSheet","WebView","Platform","renderToString","memo","useRef","useState","useEffect","usePreferredColorScheme","sandboxStyles","observeAndResizeJS","style","EMPTY_ARRAY","Sandbox","containerStyle","customJS","html","lang","providerUrl","scripts","styles","title","type","url","colorScheme","ref","height","setHeight","contentHtml","setContentHtml","getHtmlDoc","windowSize","get","isLandscape","setIsLandscape","width","wasLandscape","key","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","baseUrl","isAndroid","workaroundStyles","webView","create","opacity"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UAAT,EAAqBC,UAArB,QAAuC,cAAvC;AACA,SAASC,OAAT,QAAwB,sBAAxB;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,cAFD,EAGCC,IAHD,EAICC,MAJD,EAKCC,QALD,EAMCC,SAND,QAOO,oBAPP;AAQA,SAASC,uBAAT,QAAwC,oBAAxC;AAEA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,cAA1B;AAEA,MAAMC,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;A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AT;AAOAZ,EAAAA,SAAS,CAAE,MAAM;AAChB;AACA;AACA,QAAK6B,YAAY,CAACkC,OAAb,KAAyBrC,WAA9B,EAA4C;AAC3CN,MAAAA,SAAS,CAAE,CAAF,CAAT;AACA;;AACDS,IAAAA,YAAY,CAACkC,OAAb,GAAuBrC,WAAvB;AACA,GAPQ,EAON,CAAEA,WAAF,CAPM,CAAT;AASA,SACC,cAAC,OAAD;AACC,IAAA,cAAc,EAAG,CAChBxB,aAAa,CAAE,4BAAF,CADG,EAEhBK,cAFgB,CADlB;AAKC,IAAA,kBAAkB,EAAGC,QAAQ,IAAIL,kBALlC;AAMC,IAAA,GAAG,EAAG2B,GANP;AAOC,IAAA,GAAG,EAAGZ,GAPP;AAQC,IAAA,MAAM,EAAG;AAAE8C,MAAAA,OAAO,EAAErD,WAAX;AAAwBF,MAAAA,IAAI,EAAEY;AAA9B,KARV,CASC;AACA;AAVD;AAWC,IAAA,eAAe,EAAG,CAAE,GAAF,CAXnB;AAYC,IAAA,KAAK,EAAG,CACPnB,aAAa,CAAE,0BAAF,CADN,EAEPkD,YAAY,EAFL,EAGPzD,QAAQ,CAACsE,SAAT,IAAsBC,gBAAgB,CAACC,OAHhC,CAZT;AAiBC,IAAA,SAAS,EAAGvB,qBAjBb;AAkBC,IAAA,aAAa,EAAG,KAlBjB;AAmBC,IAAA,sBAAsB,EAAG,KAnB1B;AAoBC,IAAA,8BAA8B,EAAG,KApBlC;AAqBC,IAAA,4BAA4B,EAAG;AArBhC,IADD;AAyBA;;AAED,MAAMsB,gBAAgB,GAAGzE,UAAU,CAAC2E,MAAX,CAAmB;AAC3CD,EAAAA,OAAO,EAAE;AACR;AACF;AACA;AACA;AACA;AACEE,IAAAA,OAAO,EAAE;AAND;AADkC,CAAnB,CAAzB;AAWA,eAAexE,IAAI,CAAES,OAAF,CAAnB","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"]}
@@ -5,10 +5,10 @@ import { createElement } from "@wordpress/element";
5
5
  * External dependencies
6
6
  */
7
7
  import classNames from 'classnames';
8
-
9
8
  /**
10
9
  * WordPress dependencies
11
10
  */
11
+
12
12
  import { useInstanceId } from '@wordpress/compose';
13
13
  import { useState, forwardRef } from '@wordpress/element';
14
14
  /**
@@ -28,8 +28,8 @@ function useUniqueId(idProp) {
28
28
  return idProp || id;
29
29
  }
30
30
 
31
- function UnforwardedSelectControl(_ref, ref) {
32
- let {
31
+ function UnforwardedSelectControl(props, ref) {
32
+ const {
33
33
  className,
34
34
  disabled = false,
35
35
  help,
@@ -38,7 +38,7 @@ function UnforwardedSelectControl(_ref, ref) {
38
38
  label,
39
39
  multiple = false,
40
40
  onBlur = noop,
41
- onChange = noop,
41
+ onChange,
42
42
  onFocus = noop,
43
43
  options = [],
44
44
  size = 'default',
@@ -49,8 +49,8 @@ function UnforwardedSelectControl(_ref, ref) {
49
49
  suffix,
50
50
  __next36pxDefaultSize = false,
51
51
  __nextHasNoMarginBottom = false,
52
- ...props
53
- } = _ref;
52
+ ...restProps
53
+ } = props;
54
54
  const [isFocused, setIsFocused] = useState(false);
55
55
  const id = useUniqueId(idProp);
56
56
  const helpId = help ? `${id}__help` : undefined; // Disable reason: A select with an onchange throws a warning.
@@ -68,31 +68,35 @@ function UnforwardedSelectControl(_ref, ref) {
68
68
  };
69
69
 
70
70
  const handleOnChange = event => {
71
- if (multiple) {
72
- const selectedOptions = Array.from(event.target.options).filter(_ref2 => {
71
+ var _props$onChange2;
72
+
73
+ if (props.multiple) {
74
+ var _props$onChange;
75
+
76
+ const selectedOptions = Array.from(event.target.options).filter(_ref => {
73
77
  let {
74
78
  selected
75
- } = _ref2;
79
+ } = _ref;
76
80
  return selected;
77
81
  });
78
- const newValues = selectedOptions.map(_ref3 => {
82
+ const newValues = selectedOptions.map(_ref2 => {
79
83
  let {
80
84
  value
81
- } = _ref3;
85
+ } = _ref2;
82
86
  return value;
83
87
  });
84
- onChange(newValues);
88
+ (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, newValues, {
89
+ event
90
+ });
85
91
  return;
86
92
  }
87
93
 
88
- onChange(event.target.value, {
94
+ (_props$onChange2 = props.onChange) === null || _props$onChange2 === void 0 ? void 0 : _props$onChange2.call(props, event.target.value, {
89
95
  event
90
96
  });
91
97
  };
92
98
 
93
99
  const classes = classNames('components-select-control', className);
94
- /* eslint-disable jsx-a11y/no-onchange */
95
-
96
100
  return createElement(BaseControl, {
97
101
  help: help,
98
102
  id: id,
@@ -109,7 +113,7 @@ function UnforwardedSelectControl(_ref, ref) {
109
113
  prefix: prefix,
110
114
  labelPosition: labelPosition,
111
115
  __next36pxDefaultSize: __next36pxDefaultSize
112
- }, createElement(Select, _extends({}, props, {
116
+ }, createElement(Select, _extends({}, restProps, {
113
117
  __next36pxDefaultSize: __next36pxDefaultSize,
114
118
  "aria-describedby": helpId,
115
119
  className: "components-select-control__input",
@@ -130,7 +134,6 @@ function UnforwardedSelectControl(_ref, ref) {
130
134
  disabled: option.disabled
131
135
  }, option.label);
132
136
  }))));
133
- /* eslint-enable jsx-a11y/no-onchange */
134
137
  }
135
138
  /**
136
139
  * `SelectControl` allows users to select from a single or multiple option menu.