@wordpress/components 28.9.0 → 28.11.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 (1108) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/build/alignment-matrix-control/icon.js.map +1 -1
  3. package/build/alignment-matrix-control/types.js.map +1 -1
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/angle-picker-control/angle-circle.js.map +1 -1
  6. package/build/autocomplete/autocompleter-ui.js +5 -9
  7. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  8. package/build/autocomplete/autocompleter-ui.native.js +2 -4
  9. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  10. package/build/autocomplete/get-default-use-items.js.map +1 -1
  11. package/build/autocomplete/index.js +5 -5
  12. package/build/autocomplete/index.js.map +1 -1
  13. package/build/base-control/hooks.js.map +1 -1
  14. package/build/base-control/index.js.map +1 -1
  15. package/build/base-control/types.js.map +1 -1
  16. package/build/border-box-control/border-box-control/component.js +1 -0
  17. package/build/border-box-control/border-box-control/component.js.map +1 -1
  18. package/build/border-box-control/border-box-control/hook.js +6 -0
  19. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  20. package/build/border-box-control/styles.js.map +1 -1
  21. package/build/border-box-control/utils.js.map +1 -1
  22. package/build/border-control/border-control/component.js +1 -0
  23. package/build/border-control/border-control/component.js.map +1 -1
  24. package/build/border-control/border-control/hook.js +6 -0
  25. package/build/border-control/border-control/hook.js.map +1 -1
  26. package/build/border-control/border-control-dropdown/component.js +12 -12
  27. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  28. package/build/border-control/styles.js.map +1 -1
  29. package/build/box-control/axial-input-controls.js.map +1 -1
  30. package/build/box-control/icon.js.map +1 -1
  31. package/build/box-control/index.js.map +1 -1
  32. package/build/box-control/input-controls.js.map +1 -1
  33. package/build/button/index.native.js +1 -1
  34. package/build/button/index.native.js.map +1 -1
  35. package/build/card/card/component.js +1 -1
  36. package/build/card/card/component.js.map +1 -1
  37. package/build/card/styles.js.map +1 -1
  38. package/build/color-palette/index.js +1 -1
  39. package/build/color-palette/index.js.map +1 -1
  40. package/build/color-palette/index.native.js +3 -3
  41. package/build/color-palette/index.native.js.map +1 -1
  42. package/build/color-picker/index.native.js +0 -1
  43. package/build/color-picker/index.native.js.map +1 -1
  44. package/build/color-picker/styles.js.map +1 -1
  45. package/build/combobox-control/index.js +1 -1
  46. package/build/combobox-control/index.js.map +1 -1
  47. package/build/composite/legacy/index.js +5 -2
  48. package/build/composite/legacy/index.js.map +1 -1
  49. package/build/context/context-connect.js +1 -0
  50. package/build/context/context-connect.js.map +1 -1
  51. package/build/context/context-system-provider.js +1 -1
  52. package/build/context/context-system-provider.js.map +1 -1
  53. package/build/context/get-styled-class-name-from-key.js.map +1 -1
  54. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -1
  55. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  56. package/build/custom-gradient-picker/index.js.map +1 -1
  57. package/build/custom-gradient-picker/serializer.js.map +1 -1
  58. package/build/custom-gradient-picker/utils.js.map +1 -1
  59. package/build/custom-select-control-v2/styles.js.map +1 -1
  60. package/build/dashicon/index.js.map +1 -1
  61. package/build/date-time/date/index.js +0 -1
  62. package/build/date-time/date/index.js.map +1 -1
  63. package/build/date-time/date/styles.js.map +1 -1
  64. package/build/date-time/time/timezone.js.map +1 -1
  65. package/build/draggable/index.js.map +1 -1
  66. package/build/drop-zone/index.js +1 -2
  67. package/build/drop-zone/index.js.map +1 -1
  68. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  69. package/build/duotone-picker/utils.js.map +1 -1
  70. package/build/elevation/hook.js.map +1 -1
  71. package/build/external-link/index.js +20 -23
  72. package/build/external-link/index.js.map +1 -1
  73. package/build/focal-point-picker/index.js.map +1 -1
  74. package/build/focal-point-picker/index.native.js.map +1 -1
  75. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  76. package/build/font-size-picker/index.js.map +1 -1
  77. package/build/font-size-picker/index.native.js +6 -6
  78. package/build/font-size-picker/index.native.js.map +1 -1
  79. package/build/form-token-field/index.js +2 -4
  80. package/build/form-token-field/index.js.map +1 -1
  81. package/build/form-token-field/suggestions-list.js +7 -3
  82. package/build/form-token-field/suggestions-list.js.map +1 -1
  83. package/build/form-token-field/token-input.js.map +1 -1
  84. package/build/form-token-field/token.js +1 -1
  85. package/build/form-token-field/token.js.map +1 -1
  86. package/build/gradient-picker/index.js.map +1 -1
  87. package/build/grid/hook.js.map +1 -1
  88. package/build/guide/page-control.js +1 -1
  89. package/build/guide/page-control.js.map +1 -1
  90. package/build/h-stack/hook.js.map +1 -1
  91. package/build/heading/hook.js.map +1 -1
  92. package/build/input-control/index.js.map +1 -1
  93. package/build/input-control/input-base.js.map +1 -1
  94. package/build/input-control/styles/input-control-styles.js.map +1 -1
  95. package/build/item-group/styles.js.map +1 -1
  96. package/build/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
  97. package/build/menu/checkbox-item.js.map +1 -0
  98. package/build/{dropdown-menu-v2 → menu}/context.js +2 -2
  99. package/build/menu/context.js.map +1 -0
  100. package/build/{dropdown-menu-v2 → menu}/group-label.js +5 -5
  101. package/build/menu/group-label.js.map +1 -0
  102. package/build/{dropdown-menu-v2 → menu}/group.js +5 -5
  103. package/build/menu/group.js.map +1 -0
  104. package/build/{dropdown-menu-v2 → menu}/index.js +38 -38
  105. package/build/menu/index.js.map +1 -0
  106. package/build/{dropdown-menu-v2 → menu}/item-help-text.js +3 -3
  107. package/build/menu/item-help-text.js.map +1 -0
  108. package/build/{dropdown-menu-v2 → menu}/item-label.js +3 -3
  109. package/build/menu/item-label.js.map +1 -0
  110. package/build/{dropdown-menu-v2 → menu}/item.js +7 -7
  111. package/build/menu/item.js.map +1 -0
  112. package/build/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
  113. package/build/menu/radio-item.js.map +1 -0
  114. package/build/{dropdown-menu-v2 → menu}/separator.js +6 -6
  115. package/build/menu/separator.js.map +1 -0
  116. package/build/menu/styles.js +150 -0
  117. package/build/menu/styles.js.map +1 -0
  118. package/build/menu/types.js.map +1 -0
  119. package/build/menu/use-temporary-focus-visible-fix.js.map +1 -0
  120. package/build/menu-group/index.js.map +1 -1
  121. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  122. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  123. package/build/mobile/bottom-sheet/cell.native.js +4 -4
  124. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  125. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  126. package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
  127. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  128. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  129. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  130. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  131. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  132. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  133. package/build/mobile/bottom-sheet/switch-cell.native.js +4 -4
  134. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  135. package/build/mobile/bottom-sheet-select-control/index.native.js +2 -2
  136. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  137. package/build/mobile/color-settings/index.native.js +1 -3
  138. package/build/mobile/color-settings/index.native.js.map +1 -1
  139. package/build/mobile/color-settings/picker-screen.native.js +1 -3
  140. package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
  141. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  142. package/build/mobile/gradient/index.native.js.map +1 -1
  143. package/build/mobile/image/index.native.js +1 -3
  144. package/build/mobile/image/index.native.js.map +1 -1
  145. package/build/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  146. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  147. package/build/mobile/link-picker/index.native.js +1 -1
  148. package/build/mobile/link-picker/index.native.js.map +1 -1
  149. package/build/mobile/link-picker/link-picker-results.native.js +2 -5
  150. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  151. package/build/mobile/link-picker/link-picker-screen.native.js +1 -3
  152. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  153. package/build/mobile/link-settings/index.native.js +6 -18
  154. package/build/mobile/link-settings/index.native.js.map +1 -1
  155. package/build/mobile/link-settings/link-settings-screen.native.js +1 -3
  156. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  157. package/build/mobile/picker/index.android.js.map +1 -1
  158. package/build/mobile/segmented-control/index.native.js +2 -6
  159. package/build/mobile/segmented-control/index.native.js.map +1 -1
  160. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  161. package/build/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  162. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  163. package/build/modal/aria-helper.js +2 -1
  164. package/build/modal/aria-helper.js.map +1 -1
  165. package/build/modal/index.js +2 -1
  166. package/build/modal/index.js.map +1 -1
  167. package/build/modal/use-modal-exit-animation.js.map +1 -1
  168. package/build/navigation/group/index.js.map +1 -1
  169. package/build/navigation/index.js +1 -2
  170. package/build/navigation/index.js.map +1 -1
  171. package/build/navigation/item/base.js.map +1 -1
  172. package/build/navigation/item/use-navigation-tree-item.js +2 -2
  173. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  174. package/build/navigation/menu/index.js.map +1 -1
  175. package/build/navigation/menu/menu-title-search.js +4 -4
  176. package/build/navigation/menu/menu-title-search.js.map +1 -1
  177. package/build/navigation/menu/menu-title.js.map +1 -1
  178. package/build/navigation/menu/use-navigation-tree-menu.js +2 -2
  179. package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  180. package/build/navigation/styles/navigation-styles.js.map +1 -1
  181. package/build/navigator/navigator/component.js.map +1 -1
  182. package/build/navigator/navigator-button/hook.js.map +1 -1
  183. package/build/number-control/styles/number-control-styles.js.map +1 -1
  184. package/build/palette-edit/index.js +29 -4
  185. package/build/palette-edit/index.js.map +1 -1
  186. package/build/palette-edit/styles.js +13 -28
  187. package/build/palette-edit/styles.js.map +1 -1
  188. package/build/popover/index.js +1 -1
  189. package/build/popover/index.js.map +1 -1
  190. package/build/popover/overlay-middlewares.js.map +1 -1
  191. package/build/popover/utils.js.map +1 -1
  192. package/build/private-apis.js +4 -4
  193. package/build/private-apis.js.map +1 -1
  194. package/build/progress-bar/index.js.map +1 -1
  195. package/build/progress-bar/styles.js.map +1 -1
  196. package/build/query-controls/index.js.map +1 -1
  197. package/build/query-controls/index.native.js.map +1 -1
  198. package/build/radio-control/index.js.map +1 -1
  199. package/build/radio-control/index.native.js.map +1 -1
  200. package/build/radio-group/index.js +3 -1
  201. package/build/radio-group/index.js.map +1 -1
  202. package/build/range-control/index.js.map +1 -1
  203. package/build/range-control/index.native.js.map +1 -1
  204. package/build/range-control/rail.js.map +1 -1
  205. package/build/range-control/styles/range-control-styles.js +32 -32
  206. package/build/range-control/styles/range-control-styles.js.map +1 -1
  207. package/build/range-control/tooltip.js +1 -1
  208. package/build/range-control/tooltip.js.map +1 -1
  209. package/build/range-control/utils.js.map +1 -1
  210. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  211. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  212. package/build/responsive-wrapper/index.js.map +1 -1
  213. package/build/sandbox/index.js +3 -6
  214. package/build/sandbox/index.js.map +1 -1
  215. package/build/sandbox/index.native.js +1 -3
  216. package/build/sandbox/index.native.js.map +1 -1
  217. package/build/search-control/index.js +6 -0
  218. package/build/search-control/index.js.map +1 -1
  219. package/build/search-control/index.native.js +1 -3
  220. package/build/search-control/index.native.js.map +1 -1
  221. package/build/search-control/types.js.map +1 -1
  222. package/build/select-control/index.js.map +1 -1
  223. package/build/select-control/index.native.js.map +1 -1
  224. package/build/slot-fill/bubbles-virtually/slot.js +1 -2
  225. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  226. package/build/slot-fill/fill.js +3 -6
  227. package/build/slot-fill/fill.js.map +1 -1
  228. package/build/slot-fill/index.js.map +1 -1
  229. package/build/spacer/hook.js +5 -3
  230. package/build/spacer/hook.js.map +1 -1
  231. package/build/spinner/styles.js.map +1 -1
  232. package/build/style-provider/index.js +1 -0
  233. package/build/style-provider/index.js.map +1 -1
  234. package/build/surface/hook.js.map +1 -1
  235. package/build/surface/styles.js.map +1 -1
  236. package/build/tab-panel/index.js +4 -1
  237. package/build/tab-panel/index.js.map +1 -1
  238. package/build/tabs/index.js +48 -113
  239. package/build/tabs/index.js.map +1 -1
  240. package/build/tabs/styles.js +31 -13
  241. package/build/tabs/styles.js.map +1 -1
  242. package/build/tabs/tab.js +30 -8
  243. package/build/tabs/tab.js.map +1 -1
  244. package/build/tabs/tablist.js +67 -56
  245. package/build/tabs/tablist.js.map +1 -1
  246. package/build/tabs/tabpanel.js.map +1 -1
  247. package/build/tabs/types.js.map +1 -1
  248. package/build/text/get-line-height.js.map +1 -1
  249. package/build/text/styles/text-mixins.native.js.map +1 -1
  250. package/build/text/utils.js.map +1 -1
  251. package/build/text-control/index.native.js.map +1 -1
  252. package/build/text-highlight/index.js.map +1 -1
  253. package/build/textarea-control/index.js.map +1 -1
  254. package/build/theme/color-algorithms.js.map +1 -1
  255. package/build/theme/styles.js.map +1 -1
  256. package/build/toggle-control/index.js.map +1 -1
  257. package/build/toggle-control/index.native.js.map +1 -1
  258. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -1
  259. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  260. package/build/toggle-group-control/toggle-group-control/component.js +4 -61
  261. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  262. package/build/toggle-group-control/toggle-group-control-option-base/component.js +10 -10
  263. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  264. package/build/toggle-group-control/types.js.map +1 -1
  265. package/build/toolbar/toolbar/index.js +3 -0
  266. package/build/toolbar/toolbar/index.js.map +1 -1
  267. package/build/tools-panel/styles.js.map +1 -1
  268. package/build/tools-panel/tools-panel-header/component.js +1 -1
  269. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  270. package/build/tools-panel/tools-panel-item/hook.js +0 -2
  271. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  272. package/build/tooltip/index.js +5 -1
  273. package/build/tooltip/index.js.map +1 -1
  274. package/build/tooltip/index.native.js +5 -15
  275. package/build/tooltip/index.native.js.map +1 -1
  276. package/build/unit-control/index.js.map +1 -1
  277. package/build/unit-control/index.native.js +2 -6
  278. package/build/unit-control/index.native.js.map +1 -1
  279. package/build/unit-control/utils.js.map +1 -1
  280. package/build/utils/breakpoint.js.map +1 -1
  281. package/build/utils/colors-values.js.map +1 -1
  282. package/build/utils/config-values.js.map +1 -1
  283. package/build/utils/deprecated-36px-size.js +27 -0
  284. package/build/utils/deprecated-36px-size.js.map +1 -0
  285. package/build/utils/element-rect.js +13 -2
  286. package/build/utils/element-rect.js.map +1 -1
  287. package/build/utils/font-size.js.map +1 -1
  288. package/build/utils/hooks/use-animated-offset-rect.js +81 -0
  289. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -0
  290. package/build/utils/hooks/use-cx.js.map +1 -1
  291. package/build/utils/hooks/use-update-effect.js +0 -2
  292. package/build/utils/hooks/use-update-effect.js.map +1 -1
  293. package/build/utils/math.js +2 -2
  294. package/build/utils/math.js.map +1 -1
  295. package/build/utils/space.js.map +1 -1
  296. package/build/utils/unit-values.js.map +1 -1
  297. package/build/utils/use-responsive-value.js.map +1 -1
  298. package/build-module/alignment-matrix-control/cell.js +1 -2
  299. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  300. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  301. package/build-module/alignment-matrix-control/types.js.map +1 -1
  302. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  303. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  304. package/build-module/angle-picker-control/index.js +1 -2
  305. package/build-module/angle-picker-control/index.js.map +1 -1
  306. package/build-module/autocomplete/autocompleter-ui.js +6 -12
  307. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  308. package/build-module/autocomplete/autocompleter-ui.native.js +3 -6
  309. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  310. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  311. package/build-module/autocomplete/index.js +6 -8
  312. package/build-module/autocomplete/index.js.map +1 -1
  313. package/build-module/base-control/hooks.js.map +1 -1
  314. package/build-module/base-control/index.js +1 -2
  315. package/build-module/base-control/index.js.map +1 -1
  316. package/build-module/base-control/index.native.js +1 -2
  317. package/build-module/base-control/index.native.js.map +1 -1
  318. package/build-module/base-control/types.js.map +1 -1
  319. package/build-module/border-box-control/border-box-control/component.js +2 -2
  320. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  321. package/build-module/border-box-control/border-box-control/hook.js +6 -0
  322. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  323. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -2
  324. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  325. package/build-module/border-box-control/styles.js.map +1 -1
  326. package/build-module/border-box-control/utils.js.map +1 -1
  327. package/build-module/border-control/border-control/component.js +2 -2
  328. package/build-module/border-control/border-control/component.js.map +1 -1
  329. package/build-module/border-control/border-control/hook.js +7 -0
  330. package/build-module/border-control/border-control/hook.js.map +1 -1
  331. package/build-module/border-control/border-control-dropdown/component.js +13 -15
  332. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  333. package/build-module/border-control/styles.js.map +1 -1
  334. package/build-module/box-control/all-input-control.js +1 -3
  335. package/build-module/box-control/all-input-control.js.map +1 -1
  336. package/build-module/box-control/axial-input-controls.js +1 -3
  337. package/build-module/box-control/axial-input-controls.js.map +1 -1
  338. package/build-module/box-control/icon.js +1 -2
  339. package/build-module/box-control/icon.js.map +1 -1
  340. package/build-module/box-control/index.js +1 -2
  341. package/build-module/box-control/index.js.map +1 -1
  342. package/build-module/box-control/input-controls.js +1 -3
  343. package/build-module/box-control/input-controls.js.map +1 -1
  344. package/build-module/button/index.js +1 -3
  345. package/build-module/button/index.js.map +1 -1
  346. package/build-module/button/index.native.js +2 -3
  347. package/build-module/button/index.native.js.map +1 -1
  348. package/build-module/card/card/component.js +2 -3
  349. package/build-module/card/card/component.js.map +1 -1
  350. package/build-module/card/styles.js.map +1 -1
  351. package/build-module/checkbox-control/index.js +1 -2
  352. package/build-module/checkbox-control/index.js.map +1 -1
  353. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -2
  354. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  355. package/build-module/circular-option-picker/circular-option-picker.js +1 -2
  356. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  357. package/build-module/color-indicator/index.native.js +1 -2
  358. package/build-module/color-indicator/index.native.js.map +1 -1
  359. package/build-module/color-palette/index.js +2 -3
  360. package/build-module/color-palette/index.js.map +1 -1
  361. package/build-module/color-palette/index.native.js +4 -6
  362. package/build-module/color-palette/index.native.js.map +1 -1
  363. package/build-module/color-picker/component.js +1 -2
  364. package/build-module/color-picker/component.js.map +1 -1
  365. package/build-module/color-picker/hsl-input.js +1 -3
  366. package/build-module/color-picker/hsl-input.js.map +1 -1
  367. package/build-module/color-picker/hsv-color-picker.native.js +1 -2
  368. package/build-module/color-picker/hsv-color-picker.native.js.map +1 -1
  369. package/build-module/color-picker/hue-picker.native.js +1 -2
  370. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  371. package/build-module/color-picker/index.native.js +1 -4
  372. package/build-module/color-picker/index.native.js.map +1 -1
  373. package/build-module/color-picker/input-with-slider.js +1 -2
  374. package/build-module/color-picker/input-with-slider.js.map +1 -1
  375. package/build-module/color-picker/rgb-input.js +1 -3
  376. package/build-module/color-picker/rgb-input.js.map +1 -1
  377. package/build-module/color-picker/saturation-picker.native.js +1 -2
  378. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  379. package/build-module/color-picker/styles.js.map +1 -1
  380. package/build-module/combobox-control/index.js +2 -3
  381. package/build-module/combobox-control/index.js.map +1 -1
  382. package/build-module/composite/legacy/index.js +5 -2
  383. package/build-module/composite/legacy/index.js.map +1 -1
  384. package/build-module/confirm-dialog/component.js +1 -3
  385. package/build-module/confirm-dialog/component.js.map +1 -1
  386. package/build-module/context/context-connect.js +1 -0
  387. package/build-module/context/context-connect.js.map +1 -1
  388. package/build-module/context/context-system-provider.js +1 -1
  389. package/build-module/context/context-system-provider.js.map +1 -1
  390. package/build-module/context/get-styled-class-name-from-key.js.map +1 -1
  391. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -4
  392. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  393. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
  394. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  395. package/build-module/custom-gradient-picker/index.js +1 -2
  396. package/build-module/custom-gradient-picker/index.js.map +1 -1
  397. package/build-module/custom-gradient-picker/index.native.js +1 -3
  398. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  399. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  400. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  401. package/build-module/custom-select-control/index.js +1 -3
  402. package/build-module/custom-select-control/index.js.map +1 -1
  403. package/build-module/custom-select-control-v2/custom-select.js +1 -2
  404. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  405. package/build-module/custom-select-control-v2/item.js +1 -2
  406. package/build-module/custom-select-control-v2/item.js.map +1 -1
  407. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  408. package/build-module/dashicon/index.js.map +1 -1
  409. package/build-module/date-time/date/index.js +1 -3
  410. package/build-module/date-time/date/index.js.map +1 -1
  411. package/build-module/date-time/date/styles.js.map +1 -1
  412. package/build-module/date-time/date-time/index.js +1 -3
  413. package/build-module/date-time/date-time/index.js.map +1 -1
  414. package/build-module/date-time/time/index.js +1 -2
  415. package/build-module/date-time/time/index.js.map +1 -1
  416. package/build-module/date-time/time/time-input/index.js +1 -2
  417. package/build-module/date-time/time/time-input/index.js.map +1 -1
  418. package/build-module/date-time/time/timezone.js.map +1 -1
  419. package/build-module/dimension-control/index.js +1 -3
  420. package/build-module/dimension-control/index.js.map +1 -1
  421. package/build-module/draggable/index.js +1 -3
  422. package/build-module/draggable/index.js.map +1 -1
  423. package/build-module/drop-zone/index.js +2 -4
  424. package/build-module/drop-zone/index.js.map +1 -1
  425. package/build-module/dropdown/index.js +1 -2
  426. package/build-module/dropdown/index.js.map +1 -1
  427. package/build-module/dropdown/index.native.js +1 -2
  428. package/build-module/dropdown/index.native.js.map +1 -1
  429. package/build-module/dropdown-menu/index.js +1 -2
  430. package/build-module/dropdown-menu/index.js.map +1 -1
  431. package/build-module/dropdown-menu/index.native.js +1 -2
  432. package/build-module/dropdown-menu/index.native.js.map +1 -1
  433. package/build-module/duotone-picker/color-list-picker/index.js +1 -3
  434. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  435. package/build-module/duotone-picker/duotone-picker.js +1 -2
  436. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  437. package/build-module/duotone-picker/utils.js.map +1 -1
  438. package/build-module/elevation/hook.js.map +1 -1
  439. package/build-module/external-link/index.js +21 -25
  440. package/build-module/external-link/index.js.map +1 -1
  441. package/build-module/external-link/index.native.js +1 -2
  442. package/build-module/external-link/index.native.js.map +1 -1
  443. package/build-module/focal-point-picker/controls.js +1 -2
  444. package/build-module/focal-point-picker/controls.js.map +1 -1
  445. package/build-module/focal-point-picker/focal-point.native.js +1 -2
  446. package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
  447. package/build-module/focal-point-picker/grid.js +1 -2
  448. package/build-module/focal-point-picker/grid.js.map +1 -1
  449. package/build-module/focal-point-picker/index.js +1 -2
  450. package/build-module/focal-point-picker/index.js.map +1 -1
  451. package/build-module/focal-point-picker/index.native.js +1 -2
  452. package/build-module/focal-point-picker/index.native.js.map +1 -1
  453. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  454. package/build-module/focal-point-picker/tooltip/index.native.js +1 -2
  455. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  456. package/build-module/font-size-picker/index.js +1 -2
  457. package/build-module/font-size-picker/index.js.map +1 -1
  458. package/build-module/font-size-picker/index.native.js +8 -10
  459. package/build-module/font-size-picker/index.native.js.map +1 -1
  460. package/build-module/form-file-upload/index.js +1 -2
  461. package/build-module/form-file-upload/index.js.map +1 -1
  462. package/build-module/form-toggle/index.js +1 -2
  463. package/build-module/form-toggle/index.js.map +1 -1
  464. package/build-module/form-token-field/index.js +3 -6
  465. package/build-module/form-token-field/index.js.map +1 -1
  466. package/build-module/form-token-field/suggestions-list.js +8 -5
  467. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  468. package/build-module/form-token-field/token-input.js.map +1 -1
  469. package/build-module/form-token-field/token.js +2 -3
  470. package/build-module/form-token-field/token.js.map +1 -1
  471. package/build-module/gradient-picker/index.js +1 -2
  472. package/build-module/gradient-picker/index.js.map +1 -1
  473. package/build-module/grid/hook.js.map +1 -1
  474. package/build-module/guide/index.js +1 -2
  475. package/build-module/guide/index.js.map +1 -1
  476. package/build-module/guide/page-control.js +1 -1
  477. package/build-module/guide/page-control.js.map +1 -1
  478. package/build-module/h-stack/hook.js.map +1 -1
  479. package/build-module/heading/hook.js.map +1 -1
  480. package/build-module/higher-order/with-fallback-styles/index.js +3 -4
  481. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  482. package/build-module/input-control/index.js.map +1 -1
  483. package/build-module/input-control/input-base.js +1 -2
  484. package/build-module/input-control/input-base.js.map +1 -1
  485. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  486. package/build-module/item-group/styles.js.map +1 -1
  487. package/build-module/keyboard-shortcuts/index.js +1 -3
  488. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  489. package/build-module/{dropdown-menu-v2 → menu}/checkbox-item.js +9 -10
  490. package/build-module/menu/checkbox-item.js.map +1 -0
  491. package/build-module/{dropdown-menu-v2 → menu}/context.js +1 -1
  492. package/build-module/menu/context.js.map +1 -0
  493. package/build-module/{dropdown-menu-v2 → menu}/group-label.js +5 -5
  494. package/build-module/menu/group-label.js.map +1 -0
  495. package/build-module/menu/group.js +21 -0
  496. package/build-module/menu/group.js.map +1 -0
  497. package/build-module/{dropdown-menu-v2 → menu}/index.js +47 -49
  498. package/build-module/menu/index.js.map +1 -0
  499. package/build-module/{dropdown-menu-v2 → menu}/item-help-text.js +2 -2
  500. package/build-module/menu/item-help-text.js.map +1 -0
  501. package/build-module/{dropdown-menu-v2 → menu}/item-label.js +2 -2
  502. package/build-module/menu/item-label.js.map +1 -0
  503. package/build-module/{dropdown-menu-v2 → menu}/item.js +8 -9
  504. package/build-module/menu/item.js.map +1 -0
  505. package/build-module/{dropdown-menu-v2 → menu}/radio-item.js +9 -10
  506. package/build-module/menu/radio-item.js.map +1 -0
  507. package/build-module/menu/separator.js +22 -0
  508. package/build-module/menu/separator.js.map +1 -0
  509. package/build-module/menu/styles.js +143 -0
  510. package/build-module/menu/styles.js.map +1 -0
  511. package/build-module/menu/types.js.map +1 -0
  512. package/build-module/menu/use-temporary-focus-visible-fix.js.map +1 -0
  513. package/build-module/menu-group/index.js +1 -2
  514. package/build-module/menu-group/index.js.map +1 -1
  515. package/build-module/menu-item/index.js +1 -2
  516. package/build-module/menu-item/index.js.map +1 -1
  517. package/build-module/menu-items-choice/index.js +1 -2
  518. package/build-module/menu-items-choice/index.js.map +1 -1
  519. package/build-module/mobile/badge/index.native.js +1 -3
  520. package/build-module/mobile/badge/index.native.js.map +1 -1
  521. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +4 -7
  522. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  523. package/build-module/mobile/bottom-sheet/cell.native.js +5 -6
  524. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  525. package/build-module/mobile/bottom-sheet/color-cell.native.js +1 -2
  526. package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  527. package/build-module/mobile/bottom-sheet/index.native.js +1 -3
  528. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  529. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
  530. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  531. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
  532. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  533. package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
  534. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  535. package/build-module/mobile/bottom-sheet/range-text-input.native.js +1 -2
  536. package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  537. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +2 -3
  538. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  539. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
  540. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  541. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
  542. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  543. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +2 -6
  544. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  545. package/build-module/mobile/bottom-sheet/switch-cell.native.js +4 -4
  546. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  547. package/build-module/mobile/bottom-sheet-select-control/index.native.js +3 -5
  548. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  549. package/build-module/mobile/bottom-sheet-text-control/index.native.js +1 -3
  550. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  551. package/build-module/mobile/color-settings/gradient-picker-screen.native.js +1 -2
  552. package/build-module/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
  553. package/build-module/mobile/color-settings/index.native.js +2 -5
  554. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  555. package/build-module/mobile/color-settings/palette.screen.native.js +1 -3
  556. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  557. package/build-module/mobile/color-settings/picker-screen.native.js +1 -3
  558. package/build-module/mobile/color-settings/picker-screen.native.js.map +1 -1
  559. package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
  560. package/build-module/mobile/focal-point-settings-panel/index.native.js +1 -2
  561. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  562. package/build-module/mobile/gradient/index.native.js +1 -2
  563. package/build-module/mobile/gradient/index.native.js.map +1 -1
  564. package/build-module/mobile/html-text-input/index.native.js +1 -2
  565. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  566. package/build-module/mobile/image/icon-retry.native.js +1 -2
  567. package/build-module/mobile/image/icon-retry.native.js.map +1 -1
  568. package/build-module/mobile/image/image-editing-button.native.js +1 -2
  569. package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
  570. package/build-module/mobile/image/index.native.js +2 -6
  571. package/build-module/mobile/image/index.native.js.map +1 -1
  572. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +2 -5
  573. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  574. package/build-module/mobile/link-picker/index.native.js +2 -3
  575. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  576. package/build-module/mobile/link-picker/link-picker-results.native.js +2 -5
  577. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  578. package/build-module/mobile/link-picker/link-picker-screen.native.js +1 -3
  579. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  580. package/build-module/mobile/link-settings/index.native.js +7 -21
  581. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  582. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -2
  583. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  584. package/build-module/mobile/link-settings/link-settings-screen.native.js +1 -3
  585. package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  586. package/build-module/mobile/picker/index.android.js +1 -2
  587. package/build-module/mobile/picker/index.android.js.map +1 -1
  588. package/build-module/mobile/segmented-control/index.native.js +3 -8
  589. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  590. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  591. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  592. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  593. package/build-module/modal/aria-helper.js +2 -1
  594. package/build-module/modal/aria-helper.js.map +1 -1
  595. package/build-module/modal/index.js +3 -4
  596. package/build-module/modal/index.js.map +1 -1
  597. package/build-module/modal/use-modal-exit-animation.js.map +1 -1
  598. package/build-module/navigation/back-button/index.js +1 -2
  599. package/build-module/navigation/back-button/index.js.map +1 -1
  600. package/build-module/navigation/group/index.js +1 -2
  601. package/build-module/navigation/group/index.js.map +1 -1
  602. package/build-module/navigation/index.js +1 -2
  603. package/build-module/navigation/index.js.map +1 -1
  604. package/build-module/navigation/item/base-content.js +1 -3
  605. package/build-module/navigation/item/base-content.js.map +1 -1
  606. package/build-module/navigation/item/base.js.map +1 -1
  607. package/build-module/navigation/item/index.js +1 -2
  608. package/build-module/navigation/item/index.js.map +1 -1
  609. package/build-module/navigation/item/use-navigation-tree-item.js +2 -2
  610. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  611. package/build-module/navigation/menu/index.js +1 -2
  612. package/build-module/navigation/menu/index.js.map +1 -1
  613. package/build-module/navigation/menu/menu-title-search.js +4 -4
  614. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  615. package/build-module/navigation/menu/menu-title.js +1 -2
  616. package/build-module/navigation/menu/menu-title.js.map +1 -1
  617. package/build-module/navigation/menu/search-no-results-found.js +1 -2
  618. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  619. package/build-module/navigation/menu/use-navigation-tree-menu.js +2 -2
  620. package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  621. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  622. package/build-module/navigator/navigator/component.js.map +1 -1
  623. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  624. package/build-module/notice/index.js +1 -2
  625. package/build-module/notice/index.js.map +1 -1
  626. package/build-module/notice/index.native.js +1 -3
  627. package/build-module/notice/index.native.js.map +1 -1
  628. package/build-module/number-control/index.js +1 -3
  629. package/build-module/number-control/index.js.map +1 -1
  630. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  631. package/build-module/palette-edit/index.js +31 -9
  632. package/build-module/palette-edit/index.js.map +1 -1
  633. package/build-module/palette-edit/styles.js +13 -29
  634. package/build-module/palette-edit/styles.js.map +1 -1
  635. package/build-module/panel/actions.native.js +1 -2
  636. package/build-module/panel/actions.native.js.map +1 -1
  637. package/build-module/panel/body.js +1 -2
  638. package/build-module/panel/body.js.map +1 -1
  639. package/build-module/panel/body.native.js +1 -2
  640. package/build-module/panel/body.native.js.map +1 -1
  641. package/build-module/panel/header.js +1 -2
  642. package/build-module/panel/header.js.map +1 -1
  643. package/build-module/panel/index.js +1 -2
  644. package/build-module/panel/index.js.map +1 -1
  645. package/build-module/placeholder/index.js +1 -2
  646. package/build-module/placeholder/index.js.map +1 -1
  647. package/build-module/popover/index.js +2 -4
  648. package/build-module/popover/index.js.map +1 -1
  649. package/build-module/popover/overlay-middlewares.js.map +1 -1
  650. package/build-module/popover/utils.js.map +1 -1
  651. package/build-module/private-apis.js +3 -3
  652. package/build-module/private-apis.js.map +1 -1
  653. package/build-module/progress-bar/index.js +1 -2
  654. package/build-module/progress-bar/index.js.map +1 -1
  655. package/build-module/progress-bar/styles.js.map +1 -1
  656. package/build-module/query-controls/index.js.map +1 -1
  657. package/build-module/query-controls/index.native.js +1 -3
  658. package/build-module/query-controls/index.native.js.map +1 -1
  659. package/build-module/radio-control/index.js +1 -2
  660. package/build-module/radio-control/index.js.map +1 -1
  661. package/build-module/radio-control/index.native.js +1 -2
  662. package/build-module/radio-control/index.native.js.map +1 -1
  663. package/build-module/radio-group/index.js +3 -1
  664. package/build-module/radio-group/index.js.map +1 -1
  665. package/build-module/range-control/index.js +1 -2
  666. package/build-module/range-control/index.js.map +1 -1
  667. package/build-module/range-control/index.native.js.map +1 -1
  668. package/build-module/range-control/mark.js +1 -3
  669. package/build-module/range-control/mark.js.map +1 -1
  670. package/build-module/range-control/rail.js +1 -3
  671. package/build-module/range-control/rail.js.map +1 -1
  672. package/build-module/range-control/styles/range-control-styles.js +32 -32
  673. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  674. package/build-module/range-control/tooltip.js +1 -1
  675. package/build-module/range-control/tooltip.js.map +1 -1
  676. package/build-module/range-control/utils.js.map +1 -1
  677. package/build-module/resizable-box/index.js +1 -2
  678. package/build-module/resizable-box/index.js.map +1 -1
  679. package/build-module/resizable-box/resize-tooltip/index.js +1 -2
  680. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  681. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  682. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  683. package/build-module/responsive-wrapper/index.js.map +1 -1
  684. package/build-module/sandbox/index.js +4 -8
  685. package/build-module/sandbox/index.js.map +1 -1
  686. package/build-module/sandbox/index.native.js +2 -5
  687. package/build-module/sandbox/index.native.js.map +1 -1
  688. package/build-module/search-control/index.js +6 -0
  689. package/build-module/search-control/index.js.map +1 -1
  690. package/build-module/search-control/index.native.js +2 -5
  691. package/build-module/search-control/index.native.js.map +1 -1
  692. package/build-module/search-control/types.js.map +1 -1
  693. package/build-module/select-control/index.js.map +1 -1
  694. package/build-module/select-control/index.native.js.map +1 -1
  695. package/build-module/slot-fill/bubbles-virtually/slot.js +1 -2
  696. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  697. package/build-module/slot-fill/fill.js +3 -6
  698. package/build-module/slot-fill/fill.js.map +1 -1
  699. package/build-module/slot-fill/index.js +1 -3
  700. package/build-module/slot-fill/index.js.map +1 -1
  701. package/build-module/slot-fill/slot.js +1 -2
  702. package/build-module/slot-fill/slot.js.map +1 -1
  703. package/build-module/snackbar/index.js +1 -2
  704. package/build-module/snackbar/index.js.map +1 -1
  705. package/build-module/snackbar/list.js +1 -2
  706. package/build-module/snackbar/list.js.map +1 -1
  707. package/build-module/spacer/hook.js +5 -3
  708. package/build-module/spacer/hook.js.map +1 -1
  709. package/build-module/spinner/index.js +1 -2
  710. package/build-module/spinner/index.js.map +1 -1
  711. package/build-module/spinner/styles.js.map +1 -1
  712. package/build-module/style-provider/index.js +1 -0
  713. package/build-module/style-provider/index.js.map +1 -1
  714. package/build-module/surface/hook.js.map +1 -1
  715. package/build-module/surface/styles.js.map +1 -1
  716. package/build-module/tab-panel/index.js +5 -3
  717. package/build-module/tab-panel/index.js.map +1 -1
  718. package/build-module/tabs/index.js +47 -112
  719. package/build-module/tabs/index.js.map +1 -1
  720. package/build-module/tabs/styles.js +29 -7
  721. package/build-module/tabs/styles.js.map +1 -1
  722. package/build-module/tabs/tab.js +30 -10
  723. package/build-module/tabs/tab.js.map +1 -1
  724. package/build-module/tabs/tablist.js +67 -56
  725. package/build-module/tabs/tablist.js.map +1 -1
  726. package/build-module/tabs/tabpanel.js.map +1 -1
  727. package/build-module/tabs/types.js.map +1 -1
  728. package/build-module/text/get-line-height.js.map +1 -1
  729. package/build-module/text/styles/text-mixins.native.js.map +1 -1
  730. package/build-module/text/utils.js.map +1 -1
  731. package/build-module/text-control/index.native.js.map +1 -1
  732. package/build-module/text-highlight/index.js +1 -2
  733. package/build-module/text-highlight/index.js.map +1 -1
  734. package/build-module/textarea-control/index.js.map +1 -1
  735. package/build-module/theme/color-algorithms.js.map +1 -1
  736. package/build-module/theme/styles.js.map +1 -1
  737. package/build-module/tip/index.js +1 -2
  738. package/build-module/tip/index.js.map +1 -1
  739. package/build-module/toggle-control/index.js +1 -2
  740. package/build-module/toggle-control/index.js.map +1 -1
  741. package/build-module/toggle-control/index.native.js.map +1 -1
  742. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +10 -2
  743. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  744. package/build-module/toggle-group-control/toggle-group-control/component.js +6 -66
  745. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  746. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +11 -12
  747. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  748. package/build-module/toggle-group-control/types.js.map +1 -1
  749. package/build-module/toolbar/toolbar/index.js +3 -0
  750. package/build-module/toolbar/toolbar/index.js.map +1 -1
  751. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js +2 -2
  752. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -1
  753. package/build-module/toolbar/toolbar-group/index.js +1 -2
  754. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  755. package/build-module/tools-panel/styles.js.map +1 -1
  756. package/build-module/tools-panel/tools-panel/component.js +1 -2
  757. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  758. package/build-module/tools-panel/tools-panel-header/component.js +2 -4
  759. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  760. package/build-module/tools-panel/tools-panel-item/hook.js +0 -2
  761. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  762. package/build-module/tooltip/index.js +6 -3
  763. package/build-module/tooltip/index.js.map +1 -1
  764. package/build-module/tooltip/index.native.js +6 -18
  765. package/build-module/tooltip/index.native.js.map +1 -1
  766. package/build-module/tree-grid/cell.js +1 -2
  767. package/build-module/tree-grid/cell.js.map +1 -1
  768. package/build-module/unit-control/index.js.map +1 -1
  769. package/build-module/unit-control/index.native.js +3 -9
  770. package/build-module/unit-control/index.native.js.map +1 -1
  771. package/build-module/unit-control/utils.js.map +1 -1
  772. package/build-module/utils/breakpoint.js.map +1 -1
  773. package/build-module/utils/colors-values.js.map +1 -1
  774. package/build-module/utils/config-values.js.map +1 -1
  775. package/build-module/utils/deprecated-36px-size.js +19 -0
  776. package/build-module/utils/deprecated-36px-size.js.map +1 -0
  777. package/build-module/utils/element-rect.js +13 -2
  778. package/build-module/utils/element-rect.js.map +1 -1
  779. package/build-module/utils/font-size.js.map +1 -1
  780. package/build-module/utils/hooks/use-animated-offset-rect.js +75 -0
  781. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -0
  782. package/build-module/utils/hooks/use-cx.js.map +1 -1
  783. package/build-module/utils/hooks/use-update-effect.js +0 -2
  784. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  785. package/build-module/utils/math.js +2 -2
  786. package/build-module/utils/math.js.map +1 -1
  787. package/build-module/utils/space.js.map +1 -1
  788. package/build-module/utils/unit-values.js.map +1 -1
  789. package/build-module/utils/use-responsive-value.js.map +1 -1
  790. package/build-style/style-rtl.css +14 -11
  791. package/build-style/style.css +14 -11
  792. package/build-types/alignment-matrix-control/types.d.ts +2 -0
  793. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  794. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  795. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  796. package/build-types/autocomplete/index.d.ts.map +1 -1
  797. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  798. package/build-types/base-control/types.d.ts +3 -0
  799. package/build-types/base-control/types.d.ts.map +1 -1
  800. package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
  801. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  802. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  803. package/build-types/border-control/border-control/component.d.ts +1 -0
  804. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  805. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  806. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  807. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  808. package/build-types/button/stories/index.story.d.ts.map +1 -1
  809. package/build-types/card/stories/index.story.d.ts.map +1 -1
  810. package/build-types/composite/legacy/index.d.ts.map +1 -1
  811. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  812. package/build-types/date-time/date/index.d.ts.map +1 -1
  813. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  814. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  815. package/build-types/drop-zone/index.d.ts.map +1 -1
  816. package/build-types/form-token-field/index.d.ts.map +1 -1
  817. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  818. package/build-types/item-group/stories/index.story.d.ts +1 -1
  819. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  820. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  821. package/build-types/menu/checkbox-item.d.ts +3 -0
  822. package/build-types/menu/checkbox-item.d.ts.map +1 -0
  823. package/build-types/menu/context.d.ts +6 -0
  824. package/build-types/menu/context.d.ts.map +1 -0
  825. package/build-types/menu/group-label.d.ts +3 -0
  826. package/build-types/menu/group-label.d.ts.map +1 -0
  827. package/build-types/menu/group.d.ts +3 -0
  828. package/build-types/menu/group.d.ts.map +1 -0
  829. package/build-types/menu/index.d.ts +40 -0
  830. package/build-types/menu/index.d.ts.map +1 -0
  831. package/build-types/{dropdown-menu-v2 → menu}/item-help-text.d.ts +1 -1
  832. package/build-types/menu/item-help-text.d.ts.map +1 -0
  833. package/build-types/{dropdown-menu-v2 → menu}/item-label.d.ts +1 -1
  834. package/build-types/menu/item-label.d.ts.map +1 -0
  835. package/build-types/menu/item.d.ts +3 -0
  836. package/build-types/menu/item.d.ts.map +1 -0
  837. package/build-types/menu/radio-item.d.ts +3 -0
  838. package/build-types/menu/radio-item.d.ts.map +1 -0
  839. package/build-types/menu/separator.d.ts +3 -0
  840. package/build-types/menu/separator.d.ts.map +1 -0
  841. package/build-types/menu/stories/index.story.d.ts +16 -0
  842. package/build-types/menu/stories/index.story.d.ts.map +1 -0
  843. package/build-types/{dropdown-menu-v2 → menu}/styles.d.ts +13 -13
  844. package/build-types/menu/styles.d.ts.map +1 -0
  845. package/build-types/menu/test/index.d.ts.map +1 -0
  846. package/build-types/{dropdown-menu-v2 → menu}/types.d.ts +22 -21
  847. package/build-types/menu/types.d.ts.map +1 -0
  848. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +1 -0
  849. package/build-types/modal/aria-helper.d.ts.map +1 -1
  850. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  851. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  852. package/build-types/navigation/index.d.ts.map +1 -1
  853. package/build-types/palette-edit/index.d.ts +3 -0
  854. package/build-types/palette-edit/index.d.ts.map +1 -1
  855. package/build-types/palette-edit/styles.d.ts +0 -256
  856. package/build-types/palette-edit/styles.d.ts.map +1 -1
  857. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  858. package/build-types/radio-group/index.d.ts.map +1 -1
  859. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  860. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  861. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  862. package/build-types/sandbox/index.d.ts.map +1 -1
  863. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  864. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  865. package/build-types/search-control/index.d.ts.map +1 -1
  866. package/build-types/search-control/stories/index.story.d.ts +0 -8
  867. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  868. package/build-types/search-control/types.d.ts +3 -0
  869. package/build-types/search-control/types.d.ts.map +1 -1
  870. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  871. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  872. package/build-types/slot-fill/fill.d.ts.map +1 -1
  873. package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
  874. package/build-types/spacer/hook.d.ts.map +1 -1
  875. package/build-types/tab-panel/index.d.ts.map +1 -1
  876. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  877. package/build-types/tabs/index.d.ts +21 -8
  878. package/build-types/tabs/index.d.ts.map +1 -1
  879. package/build-types/tabs/stories/index.story.d.ts +1 -1
  880. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  881. package/build-types/tabs/styles.d.ts +13 -3
  882. package/build-types/tabs/styles.d.ts.map +1 -1
  883. package/build-types/tabs/tab.d.ts +0 -3
  884. package/build-types/tabs/tab.d.ts.map +1 -1
  885. package/build-types/tabs/tablist.d.ts.map +1 -1
  886. package/build-types/tabs/types.d.ts +85 -48
  887. package/build-types/tabs/types.d.ts.map +1 -1
  888. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  889. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  890. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  891. package/build-types/toggle-group-control/types.d.ts +1 -0
  892. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  893. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  894. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  895. package/build-types/tooltip/index.d.ts.map +1 -1
  896. package/build-types/utils/deprecated-36px-size.d.ts +6 -0
  897. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -0
  898. package/build-types/utils/element-rect.d.ts +1 -1
  899. package/build-types/utils/element-rect.d.ts.map +1 -1
  900. package/build-types/utils/hooks/use-animated-offset-rect.d.ts +69 -0
  901. package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -0
  902. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  903. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  904. package/package.json +21 -20
  905. package/schemas/docs-manifest.json +38 -0
  906. package/src/alignment-matrix-control/README.md +45 -36
  907. package/src/alignment-matrix-control/docs-manifest.json +12 -0
  908. package/src/alignment-matrix-control/types.ts +2 -0
  909. package/src/angle-picker-control/README.md +35 -23
  910. package/src/angle-picker-control/docs-manifest.json +5 -0
  911. package/src/animate/stories/index.story.tsx +2 -1
  912. package/src/autocomplete/autocompleter-ui.native.js +2 -4
  913. package/src/autocomplete/autocompleter-ui.tsx +2 -6
  914. package/src/autocomplete/index.tsx +4 -5
  915. package/src/base-control/README.md +58 -47
  916. package/src/base-control/docs-manifest.json +12 -0
  917. package/src/base-control/stories/index.story.tsx +4 -0
  918. package/src/base-control/types.ts +3 -0
  919. package/src/border-box-control/border-box-control/README.md +1 -0
  920. package/src/border-box-control/border-box-control/component.tsx +1 -0
  921. package/src/border-box-control/border-box-control/hook.ts +7 -0
  922. package/src/border-box-control/stories/index.story.tsx +1 -0
  923. package/src/border-box-control/test/index.tsx +1 -0
  924. package/src/border-control/border-control/README.md +1 -0
  925. package/src/border-control/border-control/component.tsx +1 -0
  926. package/src/border-control/border-control/hook.ts +7 -1
  927. package/src/border-control/border-control-dropdown/component.tsx +24 -12
  928. package/src/border-control/stories/index.story.tsx +1 -0
  929. package/src/border-control/test/index.js +1 -0
  930. package/src/button/stories/index.story.tsx +2 -1
  931. package/src/button/style.scss +5 -1
  932. package/src/card/stories/index.story.tsx +2 -1
  933. package/src/color-palette/index.native.js +1 -2
  934. package/src/color-palette/index.tsx +1 -1
  935. package/src/color-palette/style.scss +2 -4
  936. package/src/color-picker/index.native.js +0 -1
  937. package/src/composite/legacy/index.tsx +5 -2
  938. package/src/composite/stories/index.story.tsx +2 -1
  939. package/src/composite/test/index.tsx +629 -38
  940. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +1 -1
  941. package/src/date-time/date/index.tsx +0 -1
  942. package/src/disabled/stories/index.story.tsx +2 -1
  943. package/src/draggable/stories/index.story.tsx +2 -1
  944. package/src/drop-zone/index.tsx +1 -2
  945. package/src/drop-zone/style.scss +1 -1
  946. package/src/font-size-picker/index.native.js +7 -7
  947. package/src/form-token-field/index.tsx +0 -3
  948. package/src/form-token-field/style.scss +4 -1
  949. package/src/form-token-field/suggestions-list.tsx +6 -0
  950. package/src/item-group/stories/index.story.tsx +8 -4
  951. package/src/keyboard-shortcuts/stories/index.story.tsx +2 -1
  952. package/src/{dropdown-menu-v2 → menu}/README.md +34 -34
  953. package/src/{dropdown-menu-v2 → menu}/checkbox-item.tsx +14 -14
  954. package/src/menu/context.tsx +13 -0
  955. package/src/{dropdown-menu-v2 → menu}/group-label.tsx +8 -8
  956. package/src/menu/group.tsx +26 -0
  957. package/src/{dropdown-menu-v2 → menu}/index.tsx +65 -70
  958. package/src/{dropdown-menu-v2 → menu}/item-help-text.tsx +3 -7
  959. package/src/{dropdown-menu-v2 → menu}/item-label.tsx +3 -7
  960. package/src/{dropdown-menu-v2 → menu}/item.tsx +13 -13
  961. package/src/{dropdown-menu-v2 → menu}/radio-item.tsx +14 -14
  962. package/src/menu/separator.tsx +27 -0
  963. package/src/menu/stories/index.story.tsx +542 -0
  964. package/src/{dropdown-menu-v2 → menu}/styles.ts +17 -17
  965. package/src/{dropdown-menu-v2 → menu}/test/index.tsx +145 -225
  966. package/src/{dropdown-menu-v2 → menu}/types.ts +24 -23
  967. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  968. package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
  969. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  970. package/src/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  971. package/src/mobile/bottom-sheet-select-control/index.native.js +2 -2
  972. package/src/mobile/color-settings/index.native.js +1 -3
  973. package/src/mobile/color-settings/picker-screen.native.js +1 -3
  974. package/src/mobile/image/index.native.js +1 -3
  975. package/src/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  976. package/src/mobile/link-picker/link-picker-results.native.js +2 -5
  977. package/src/mobile/link-picker/link-picker-screen.native.js +1 -3
  978. package/src/mobile/link-settings/index.native.js +6 -18
  979. package/src/mobile/link-settings/link-settings-screen.native.js +1 -3
  980. package/src/mobile/segmented-control/index.native.js +2 -6
  981. package/src/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  982. package/src/modal/aria-helper.ts +1 -0
  983. package/src/navigable-container/stories/navigable-menu.story.tsx +2 -1
  984. package/src/navigable-container/stories/tabbable-container.story.tsx +2 -1
  985. package/src/navigation/index.tsx +1 -2
  986. package/src/navigation/item/use-navigation-tree-item.tsx +2 -2
  987. package/src/navigation/menu/menu-title-search.tsx +2 -2
  988. package/src/navigation/menu/use-navigation-tree-menu.tsx +2 -2
  989. package/src/palette-edit/index.tsx +34 -10
  990. package/src/palette-edit/styles.ts +1 -67
  991. package/src/palette-edit/test/index.tsx +50 -1
  992. package/src/panel/stories/index.story.tsx +2 -1
  993. package/src/private-apis.ts +3 -3
  994. package/src/radio-group/index.tsx +2 -0
  995. package/src/range-control/styles/range-control-styles.ts +19 -10
  996. package/src/range-control/tooltip.tsx +1 -1
  997. package/src/resizable-box/stories/index.story.tsx +2 -1
  998. package/src/sandbox/index.native.js +1 -3
  999. package/src/sandbox/index.tsx +3 -6
  1000. package/src/sandbox/stories/index.story.tsx +2 -1
  1001. package/src/scroll-lock/stories/index.story.tsx +2 -1
  1002. package/src/search-control/README.md +2 -0
  1003. package/src/search-control/index.native.js +1 -3
  1004. package/src/search-control/index.tsx +7 -0
  1005. package/src/search-control/stories/index.story.tsx +0 -15
  1006. package/src/search-control/test/index.tsx +4 -1
  1007. package/src/search-control/types.ts +3 -0
  1008. package/src/shortcut/stories/index.story.tsx +2 -1
  1009. package/src/slot-fill/bubbles-virtually/slot.tsx +1 -2
  1010. package/src/slot-fill/fill.ts +3 -6
  1011. package/src/slot-fill/stories/index.story.tsx +2 -1
  1012. package/src/spacer/hook.ts +3 -2
  1013. package/src/tab-panel/index.tsx +3 -0
  1014. package/src/tab-panel/stories/index.story.tsx +2 -1
  1015. package/src/tab-panel/style.scss +1 -3
  1016. package/src/tabs/README.md +63 -21
  1017. package/src/tabs/index.tsx +112 -189
  1018. package/src/tabs/stories/index.story.tsx +5 -2
  1019. package/src/tabs/styles.ts +123 -46
  1020. package/src/tabs/tab.tsx +31 -5
  1021. package/src/tabs/tablist.tsx +74 -59
  1022. package/src/tabs/test/index.tsx +131 -118
  1023. package/src/tabs/types.ts +89 -49
  1024. package/src/theme/stories/index.story.tsx +2 -1
  1025. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -6
  1026. package/src/toggle-group-control/test/index.tsx +39 -0
  1027. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +11 -1
  1028. package/src/toggle-group-control/toggle-group-control/component.tsx +4 -98
  1029. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +15 -15
  1030. package/src/toggle-group-control/types.ts +1 -0
  1031. package/src/toolbar/toolbar/index.tsx +3 -0
  1032. package/src/tools-panel/tools-panel-header/component.tsx +1 -1
  1033. package/src/tools-panel/tools-panel-item/hook.ts +0 -2
  1034. package/src/tooltip/index.native.js +5 -15
  1035. package/src/tooltip/index.tsx +8 -1
  1036. package/src/tooltip/test/index.tsx +78 -0
  1037. package/src/unit-control/index.native.js +2 -6
  1038. package/src/utils/deprecated-36px-size.ts +24 -0
  1039. package/src/utils/element-rect.ts +14 -2
  1040. package/src/utils/hooks/use-animated-offset-rect.ts +119 -0
  1041. package/src/utils/hooks/use-update-effect.js +0 -2
  1042. package/src/visually-hidden/stories/index.story.tsx +2 -1
  1043. package/tsconfig.tsbuildinfo +1 -1
  1044. package/build/dropdown-menu-v2/checkbox-item.js.map +0 -1
  1045. package/build/dropdown-menu-v2/context.js.map +0 -1
  1046. package/build/dropdown-menu-v2/group-label.js.map +0 -1
  1047. package/build/dropdown-menu-v2/group.js.map +0 -1
  1048. package/build/dropdown-menu-v2/index.js.map +0 -1
  1049. package/build/dropdown-menu-v2/item-help-text.js.map +0 -1
  1050. package/build/dropdown-menu-v2/item-label.js.map +0 -1
  1051. package/build/dropdown-menu-v2/item.js.map +0 -1
  1052. package/build/dropdown-menu-v2/radio-item.js.map +0 -1
  1053. package/build/dropdown-menu-v2/separator.js.map +0 -1
  1054. package/build/dropdown-menu-v2/styles.js +0 -150
  1055. package/build/dropdown-menu-v2/styles.js.map +0 -1
  1056. package/build/dropdown-menu-v2/types.js.map +0 -1
  1057. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
  1058. package/build-module/dropdown-menu-v2/checkbox-item.js.map +0 -1
  1059. package/build-module/dropdown-menu-v2/context.js.map +0 -1
  1060. package/build-module/dropdown-menu-v2/group-label.js.map +0 -1
  1061. package/build-module/dropdown-menu-v2/group.js +0 -21
  1062. package/build-module/dropdown-menu-v2/group.js.map +0 -1
  1063. package/build-module/dropdown-menu-v2/index.js.map +0 -1
  1064. package/build-module/dropdown-menu-v2/item-help-text.js.map +0 -1
  1065. package/build-module/dropdown-menu-v2/item-label.js.map +0 -1
  1066. package/build-module/dropdown-menu-v2/item.js.map +0 -1
  1067. package/build-module/dropdown-menu-v2/radio-item.js.map +0 -1
  1068. package/build-module/dropdown-menu-v2/separator.js +0 -22
  1069. package/build-module/dropdown-menu-v2/separator.js.map +0 -1
  1070. package/build-module/dropdown-menu-v2/styles.js +0 -143
  1071. package/build-module/dropdown-menu-v2/styles.js.map +0 -1
  1072. package/build-module/dropdown-menu-v2/types.js.map +0 -1
  1073. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
  1074. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +0 -3
  1075. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +0 -1
  1076. package/build-types/dropdown-menu-v2/context.d.ts +0 -6
  1077. package/build-types/dropdown-menu-v2/context.d.ts.map +0 -1
  1078. package/build-types/dropdown-menu-v2/group-label.d.ts +0 -3
  1079. package/build-types/dropdown-menu-v2/group-label.d.ts.map +0 -1
  1080. package/build-types/dropdown-menu-v2/group.d.ts +0 -3
  1081. package/build-types/dropdown-menu-v2/group.d.ts.map +0 -1
  1082. package/build-types/dropdown-menu-v2/index.d.ts +0 -40
  1083. package/build-types/dropdown-menu-v2/index.d.ts.map +0 -1
  1084. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +0 -1
  1085. package/build-types/dropdown-menu-v2/item-label.d.ts.map +0 -1
  1086. package/build-types/dropdown-menu-v2/item.d.ts +0 -3
  1087. package/build-types/dropdown-menu-v2/item.d.ts.map +0 -1
  1088. package/build-types/dropdown-menu-v2/radio-item.d.ts +0 -3
  1089. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +0 -1
  1090. package/build-types/dropdown-menu-v2/separator.d.ts +0 -3
  1091. package/build-types/dropdown-menu-v2/separator.d.ts.map +0 -1
  1092. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +0 -16
  1093. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +0 -1
  1094. package/build-types/dropdown-menu-v2/styles.d.ts.map +0 -1
  1095. package/build-types/dropdown-menu-v2/test/index.d.ts.map +0 -1
  1096. package/build-types/dropdown-menu-v2/types.d.ts.map +0 -1
  1097. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +0 -1
  1098. package/src/dropdown-menu-v2/context.tsx +0 -13
  1099. package/src/dropdown-menu-v2/group.tsx +0 -26
  1100. package/src/dropdown-menu-v2/separator.tsx +0 -27
  1101. package/src/dropdown-menu-v2/stories/index.story.tsx +0 -639
  1102. /package/build/{dropdown-menu-v2 → menu}/types.js +0 -0
  1103. /package/build/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
  1104. /package/build-module/{dropdown-menu-v2 → menu}/types.js +0 -0
  1105. /package/build-module/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
  1106. /package/build-types/{dropdown-menu-v2 → menu}/test/index.d.ts +0 -0
  1107. /package/build-types/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.d.ts +0 -0
  1108. /package/src/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_numberControl","_interopRequireDefault","_utils","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","rangeHeightValue","railHeight","rangeHeight","css","height","minHeight","process","env","NODE_ENV","thumbSize","deprecatedHeight","__next40pxDefaultSize","Root","exports","_base","default","target","label","wrapperColor","color","COLORS","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","BeforeIconWrapper","rtl","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","backgroundDisabled","Rail","gray","CONFIG","radiusFull","trackBackgroundColor","trackColor","Track","MarksWrapper","name","styles","map","toString","markFill","isFilled","backgroundColor","Mark","markLabelFill","MarkLabel","left","transform","thumbColor","theme","accent","ThumbWrapper","radiusRound","thumbFocus","isFocused","Thumb","elevationXSmall","InputRange","tooltipShow","show","opacity","_ref","_ref2","tooltipPosition","position","isBottom","Tooltip","radiusSmall","InputNumber","NumberControl","space","ActionRightWrapper"],"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, rtl, CONFIG } from '../../utils';\nimport { space } from '../../utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n\tRangeControlProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nconst deprecatedHeight = ( {\n\t__next40pxDefaultSize,\n}: Pick< RangeControlProps, '__next40pxDefaultSize' > ) =>\n\t! __next40pxDefaultSize && css( { minHeight: rangeHeightValue } );\n\ntype RootProps = Pick< RangeControlProps, '__next40pxDefaultSize' >;\nexport const Root = styled.div< RootProps >`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: center;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n\tmin-height: 40px;\n\t/* TODO: remove after removing the __next40pxDefaultSize prop */\n\t${ deprecatedHeight };\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled.div< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.ui.backgroundDisabled;\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ CONFIG.radiusFull };\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ CONFIG.radiusFull };\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.gray[ 300 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: 9px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.gray[ 300 ] };\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 22px;\n\twhite-space: nowrap;\n\n\t${ rtl( { left: 0 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( -50% )' },\n\t\t{ transform: 'translateX( 50% )' }\n\t) };\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.gray[ 400 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: ${ CONFIG.radiusRound };\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: ${ CONFIG.radiusRound };\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: ${ CONFIG.radiusRound };\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\tbox-shadow: ${ CONFIG.elevationXSmall };\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css( {\n\t\topacity: show ? 1 : 0,\n\t} );\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tcolor: white;\n\tdisplay: inline-block;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\topacity: 0;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition: opacity 120ms ease;\n\t}\n\n\t${ tooltipShow };\n\t${ tooltipPosition };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo Refactor RangeControl with latest HStack configuration\n// @see: packages/components/src/h-stack\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA0C,SAAAK,iCAAA,gPAX1C;AACA;AACA,G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,IAAAgD,YAAK,EAAE,CAAE,CAAG;AAAa,CAAE,CAAC,SAAA3E,OAAA,CAAAC,GAAA,CAAAC,QAAA,g0UACtD;AAEM,MAAM0E,kBAAkB,GAAArE,OAAA,CAAAqE,kBAAA,oBAAApE,KAAA,CAAAC,OAAA,UAAAT,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAQ,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,uEAO1Bf,WAAW,QAGZ,IAAA4B,UAAG,EAAE;EAAEG,UAAU,EAAE;AAAE,CAAE,CAAC,SAAA3B,OAAA,CAAAC,GAAA,CAAAC,QAAA,g0UAC3B","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_numberControl","_interopRequireDefault","_utils","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","rangeHeightValue","railHeight","rangeHeight","css","height","minHeight","process","env","NODE_ENV","thumbSize","deprecatedHeight","__next40pxDefaultSize","Root","exports","_base","default","target","label","wrapperColor","color","COLORS","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","shouldForwardProp","prop","includes","BeforeIconWrapper","rtl","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","backgroundDisabled","Rail","gray","CONFIG","radiusFull","trackBackgroundColor","trackColor","Track","MarksWrapper","name","styles","map","toString","markFill","isFilled","backgroundColor","Mark","markLabelFill","MarkLabel","left","transform","thumbColor","theme","accent","ThumbWrapper","radiusRound","thumbFocus","isFocused","Thumb","elevationXSmall","InputRange","tooltipShow","show","_ref","_ref2","tooltipPosition","position","isBottom","Tooltip","radiusSmall","InputNumber","NumberControl","space","ActionRightWrapper"],"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, rtl, CONFIG } from '../../utils';\nimport { space } from '../../utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n\tRangeControlProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nconst deprecatedHeight = ( {\n\t__next40pxDefaultSize,\n}: Pick< RangeControlProps, '__next40pxDefaultSize' > ) =>\n\t! __next40pxDefaultSize && css( { minHeight: rangeHeightValue } );\n\ntype RootProps = Pick< RangeControlProps, '__next40pxDefaultSize' >;\nexport const Root = styled.div< RootProps >`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: center;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n\tmin-height: 40px;\n\t/* TODO: remove after removing the __next40pxDefaultSize prop */\n\t${ deprecatedHeight };\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled( 'div', {\n\tshouldForwardProp: ( prop: string ) =>\n\t\t! [ 'color', '__nextHasNoMarginBottom', 'marks' ].includes( prop ),\n} )< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.ui.backgroundDisabled;\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ CONFIG.radiusFull };\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ CONFIG.radiusFull };\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.gray[ 300 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: 9px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.gray[ 300 ] };\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 22px;\n\twhite-space: nowrap;\n\n\t${ rtl( { left: 0 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( -50% )' },\n\t\t{ transform: 'translateX( 50% )' }\n\t) };\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.gray[ 400 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: ${ CONFIG.radiusRound };\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: ${ CONFIG.radiusRound };\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: ${ CONFIG.radiusRound };\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\tbox-shadow: ${ CONFIG.elevationXSmall };\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css`\n\t\tdisplay: ${ show ? 'inline-block' : 'none' };\n\t\topacity: ${ show ? 1 : 0 };\n\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\ttransition:\n\t\t\t\topacity 120ms ease,\n\t\t\t\tdisplay 120ms ease allow-discrete;\n\t\t}\n\n\t\t@starting-style {\n\t\t\topacity: 0;\n\t\t}\n\t`;\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tcolor: white;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\n\t${ tooltipPosition };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo Refactor RangeControl with latest HStack configuration\n// @see: packages/components/src/h-stack\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA0C,SAAAK,iCAAA,gPAX1C;AACA;AACA,GAFA,CAMA;AACA;AACA;AAeA,MAAMC,gBAAgB,GAAG,EAAE;AAC3B,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,WAAW,GAAGA,CAAA,kBACnB,IAAAC,UAAG,EAAE;EAAEC,MAAM,EAAEJ,gBAAgB;EAAEK,SAAS,EAAEL;AAAiB,CAAC,EAAAM,OAAA,CAAAC,GAAA,CAAAC,QAAA,gDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,0oVAAC,CAAC;AACjE,MAAMC,SAAS,GAAG,EAAE;AAEpB,MAAMC,gBAAgB,GAAGA,CAAE;EAC1BC;AACmD,CAAC,KACpD,CAAEA,qBAAqB,iBAAI,IAAAR,UAAG,EAAE;EAAEE,SAAS,EAAEL;AAAiB,CAAC,EAAAM,OAAA,CAAAC,GAAA,CAAAC,QAAA,qDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,0oVAAC,CAAC;AAG3D,MAAMI,IAAI,GAAAC,OAAA,CAAAD,IAAA,oBAAAE,KAAA,CAAAC,OAAA,SAAAT,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAA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,7 +44,7 @@ function SimpleTooltip(props) {
44
44
  };
45
45
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_rangeControlStyles.Tooltip, {
46
46
  ...restProps,
47
- "aria-hidden": show,
47
+ "aria-hidden": "false",
48
48
  className: classes,
49
49
  position: position,
50
50
  show: show,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_rangeControlStyles","_jsxRuntime","SimpleTooltip","props","className","inputRef","tooltipPosition","show","style","value","renderTooltipContent","v","zIndex","restProps","position","useTooltipPosition","classes","clsx","styles","jsx","Tooltip","role","children","setPosition","useState","setTooltipPosition","useCallback","current","useEffect","window","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/range-control/tooltip.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Tooltip } from './styles/range-control-styles';\n\nimport type { TooltipProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport default function SimpleTooltip(\n\tprops: WordPressComponentProps< TooltipProps, 'span' >\n) {\n\tconst {\n\t\tclassName,\n\t\tinputRef,\n\t\ttooltipPosition,\n\t\tshow = false,\n\t\tstyle = {},\n\t\tvalue = 0,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tzIndex = 100,\n\t\t...restProps\n\t} = props;\n\tconst position = useTooltipPosition( { inputRef, tooltipPosition } );\n\tconst classes = clsx( 'components-simple-tooltip', className );\n\tconst styles = {\n\t\t...style,\n\t\tzIndex,\n\t};\n\n\treturn (\n\t\t<Tooltip\n\t\t\t{ ...restProps }\n\t\t\taria-hidden={ show }\n\t\t\tclassName={ classes }\n\t\t\tposition={ position }\n\t\t\tshow={ show }\n\t\t\trole=\"tooltip\"\n\t\t\tstyle={ styles }\n\t\t>\n\t\t\t{ renderTooltipContent( value ) }\n\t\t</Tooltip>\n\t);\n}\n\nfunction useTooltipPosition( { inputRef, tooltipPosition }: TooltipProps ) {\n\tconst [ position, setPosition ] = useState< string >();\n\n\tconst setTooltipPosition = useCallback( () => {\n\t\tif ( inputRef && inputRef.current ) {\n\t\t\tsetPosition( tooltipPosition );\n\t\t}\n\t}, [ tooltipPosition, inputRef ] );\n\n\tuseEffect( () => {\n\t\tsetTooltipPosition();\n\t}, [ setTooltipPosition ] );\n\n\tuseEffect( () => {\n\t\twindow.addEventListener( 'resize', setTooltipPosition );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'resize', setTooltipPosition );\n\t\t};\n\t} );\n\n\treturn position;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,mBAAA,GAAAF,OAAA;AAAwD,IAAAG,WAAA,GAAAH,OAAA;AAbxD;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAMe,SAASI,aAAaA,CACpCC,KAAsD,EACrD;EACD,MAAM;IACLC,SAAS;IACTC,QAAQ;IACRC,eAAe;IACfC,IAAI,GAAG,KAAK;IACZC,KAAK,GAAG,CAAC,CAAC;IACVC,KAAK,GAAG,CAAC;IACTC,oBAAoB,GAAKC,CAAC,IAAMA,CAAC;IACjCC,MAAM,GAAG,GAAG;IACZ,GAAGC;EACJ,CAAC,GAAGV,KAAK;EACT,MAAMW,QAAQ,GAAGC,kBAAkB,CAAE;IAAEV,QAAQ;IAAEC;EAAgB,CAAE,CAAC;EACpE,MAAMU,OAAO,GAAG,IAAAC,aAAI,EAAE,2BAA2B,EAAEb,SAAU,CAAC;EAC9D,MAAMc,MAAM,GAAG;IACd,GAAGV,KAAK;IACRI;EACD,CAAC;EAED,oBACC,IAAAX,WAAA,CAAAkB,GAAA,EAACnB,mBAAA,CAAAoB,OAAO;IAAA,GACFP,SAAS;IACd,eAAcN,IAAM;IACpBH,SAAS,EAAGY,OAAS;IACrBF,QAAQ,EAAGA,QAAU;IACrBP,IAAI,EAAGA,IAAM;IACbc,IAAI,EAAC,SAAS;IACdb,KAAK,EAAGU,MAAQ;IAAAI,QAAA,EAEdZ,oBAAoB,CAAED,KAAM;EAAC,CACvB,CAAC;AAEZ;AAEA,SAASM,kBAAkBA,CAAE;EAAEV,QAAQ;EAAEC;AAA8B,CAAC,EAAG;EAC1E,MAAM,CAAEQ,QAAQ,EAAES,WAAW,CAAE,GAAG,IAAAC,iBAAQ,EAAW,CAAC;EAEtD,MAAMC,kBAAkB,GAAG,IAAAC,oBAAW,EAAE,MAAM;IAC7C,IAAKrB,QAAQ,IAAIA,QAAQ,CAACsB,OAAO,EAAG;MACnCJ,WAAW,CAAEjB,eAAgB,CAAC;IAC/B;EACD,CAAC,EAAE,CAAEA,eAAe,EAAED,QAAQ,CAAG,CAAC;EAElC,IAAAuB,kBAAS,EAAE,MAAM;IAChBH,kBAAkB,CAAC,CAAC;EACrB,CAAC,EAAE,CAAEA,kBAAkB,CAAG,CAAC;EAE3B,IAAAG,kBAAS,EAAE,MAAM;IAChBC,MAAM,CAACC,gBAAgB,CAAE,QAAQ,EAAEL,kBAAmB,CAAC;IAEvD,OAAO,MAAM;MACZI,MAAM,CAACE,mBAAmB,CAAE,QAAQ,EAAEN,kBAAmB,CAAC;IAC3D,CAAC;EACF,CAAE,CAAC;EAEH,OAAOX,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_rangeControlStyles","_jsxRuntime","SimpleTooltip","props","className","inputRef","tooltipPosition","show","style","value","renderTooltipContent","v","zIndex","restProps","position","useTooltipPosition","classes","clsx","styles","jsx","Tooltip","role","children","setPosition","useState","setTooltipPosition","useCallback","current","useEffect","window","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/range-control/tooltip.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Tooltip } from './styles/range-control-styles';\n\nimport type { TooltipProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport default function SimpleTooltip(\n\tprops: WordPressComponentProps< TooltipProps, 'span' >\n) {\n\tconst {\n\t\tclassName,\n\t\tinputRef,\n\t\ttooltipPosition,\n\t\tshow = false,\n\t\tstyle = {},\n\t\tvalue = 0,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tzIndex = 100,\n\t\t...restProps\n\t} = props;\n\tconst position = useTooltipPosition( { inputRef, tooltipPosition } );\n\tconst classes = clsx( 'components-simple-tooltip', className );\n\tconst styles = {\n\t\t...style,\n\t\tzIndex,\n\t};\n\n\treturn (\n\t\t<Tooltip\n\t\t\t{ ...restProps }\n\t\t\taria-hidden=\"false\"\n\t\t\tclassName={ classes }\n\t\t\tposition={ position }\n\t\t\tshow={ show }\n\t\t\trole=\"tooltip\"\n\t\t\tstyle={ styles }\n\t\t>\n\t\t\t{ renderTooltipContent( value ) }\n\t\t</Tooltip>\n\t);\n}\n\nfunction useTooltipPosition( { inputRef, tooltipPosition }: TooltipProps ) {\n\tconst [ position, setPosition ] = useState< string >();\n\n\tconst setTooltipPosition = useCallback( () => {\n\t\tif ( inputRef && inputRef.current ) {\n\t\t\tsetPosition( tooltipPosition );\n\t\t}\n\t}, [ tooltipPosition, inputRef ] );\n\n\tuseEffect( () => {\n\t\tsetTooltipPosition();\n\t}, [ setTooltipPosition ] );\n\n\tuseEffect( () => {\n\t\twindow.addEventListener( 'resize', setTooltipPosition );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'resize', setTooltipPosition );\n\t\t};\n\t} );\n\n\treturn position;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,mBAAA,GAAAF,OAAA;AAAwD,IAAAG,WAAA,GAAAH,OAAA;AAbxD;AACA;AACA;;AAGA;AACA;A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rB,CAAC,EAAE,CAAEA,kBAAkB,CAAG,CAAC;EAE3B,IAAAG,kBAAS,EAAE,MAAM;IAChBC,MAAM,CAACC,gBAAgB,CAAE,QAAQ,EAAEL,kBAAmB,CAAC;IAEvD,OAAO,MAAM;MACZI,MAAM,CAACE,mBAAmB,CAAE,QAAQ,EAAEN,kBAAmB,CAAC;IAC3D,CAAC;EACF,CAAE,CAAC;EAEH,OAAOX,QAAQ;AAChB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_hooks","_math","floatClamp","value","min","max","parseFloat","clamp","useControlledRangeValue","settings","valueProp","initial","state","setInternalState","useControlledState","fallback","setState","useCallback","nextValue"],"sources":["@wordpress/components/src/range-control/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useControlledState } from '../utils/hooks';\nimport { clamp } from '../utils/math';\n\nimport type { UseControlledRangeValueArgs } from './types';\n\n/**\n * A float supported clamp function for a specific value.\n *\n * @param value The value to clamp.\n * @param min The minimum value.\n * @param max The maximum value.\n *\n * @return A (float) number\n */\nexport function floatClamp( value: number | null, min: number, max: number ) {\n\tif ( typeof value !== 'number' ) {\n\t\treturn null;\n\t}\n\n\treturn parseFloat( `${ clamp( value, min, max ) }` );\n}\n\n/**\n * Hook to store a clamped value, derived from props.\n *\n * @param settings\n * @return The controlled value and the value setter.\n */\nexport function useControlledRangeValue(\n\tsettings: UseControlledRangeValueArgs\n) {\n\tconst { min, max, value: valueProp, initial } = settings;\n\tconst [ state, setInternalState ] = useControlledState(\n\t\tfloatClamp( valueProp, min, max ),\n\t\t{\n\t\t\tinitial: floatClamp( initial ?? null, min, max ),\n\t\t\tfallback: null,\n\t\t}\n\t);\n\n\tconst setState = useCallback(\n\t\t( nextValue: number | null ) => {\n\t\t\tif ( nextValue === null ) {\n\t\t\t\tsetInternalState( null );\n\t\t\t} else {\n\t\t\t\tsetInternalState( floatClamp( nextValue, min, max ) );\n\t\t\t}\n\t\t},\n\t\t[ min, max, setInternalState ]\n\t);\n\n\t// `state` can't be an empty string because we specified a fallback value of\n\t// `null` in `useControlledState`\n\treturn [ state as Exclude< typeof state, '' >, setState ] as const;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,UAAUA,CAAEC,KAAoB,EAAEC,GAAW,EAAEC,GAAW,EAAG;EAC5E,IAAK,OAAOF,KAAK,KAAK,QAAQ,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OAAOG,UAAU,CAAG,GAAG,IAAAC,WAAK,EAAEJ,KAAK,EAAEC,GAAG,EAAEC,GAAI,CAAG,EAAE,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,uBAAuBA,CACtCC,QAAqC,EACpC;EACD,MAAM;IAAEL,GAAG;IAAEC,GAAG;IAAEF,KAAK,EAAEO,SAAS;IAAEC;EAAQ,CAAC,GAAGF,QAAQ;EACxD,MAAM,CAAEG,KAAK,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,yBAAkB,EACrDZ,UAAU,CAAEQ,SAAS,EAAEN,GAAG,EAAEC,GAAI,CAAC,EACjC;IACCM,OAAO,EAAET,UAAU,CAAES,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,IAAI,EAAEP,GAAG,EAAEC,GAAI,CAAC;IAChDU,QAAQ,EAAE;EACX,CACD,CAAC;EAED,MAAMC,QAAQ,GAAG,IAAAC,oBAAW,EACzBC,SAAwB,IAAM;IAC/B,IAAKA,SAAS,KAAK,IAAI,EAAG;MACzBL,gBAAgB,CAAE,IAAK,CAAC;IACzB,CAAC,MAAM;MACNA,gBAAgB,CAAEX,UAAU,CAAEgB,SAAS,EAAEd,GAAG,EAAEC,GAAI,CAAE,CAAC;IACtD;EACD,CAAC,EACD,CAAED,GAAG,EAAEC,GAAG,EAAEQ,gBAAgB,CAC7B,CAAC;;EAED;EACA;EACA,OAAO,CAAED,KAAK,EAAiCI,QAAQ,CAAE;AAC1D","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_hooks","_math","floatClamp","value","min","max","parseFloat","clamp","useControlledRangeValue","settings","valueProp","initial","state","setInternalState","useControlledState","fallback","setState","useCallback","nextValue"],"sources":["@wordpress/components/src/range-control/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useControlledState } from '../utils/hooks';\nimport { clamp } from '../utils/math';\n\nimport type { UseControlledRangeValueArgs } from './types';\n\n/**\n * A float supported clamp function for a specific value.\n *\n * @param value The value to clamp.\n * @param min The minimum value.\n * @param max The maximum value.\n *\n * @return A (float) number\n */\nexport function floatClamp( value: number | null, min: number, max: number ) {\n\tif ( typeof value !== 'number' ) {\n\t\treturn null;\n\t}\n\n\treturn parseFloat( `${ clamp( value, min, max ) }` );\n}\n\n/**\n * Hook to store a clamped value, derived from props.\n *\n * @param settings\n * @return The controlled value and the value setter.\n */\nexport function useControlledRangeValue(\n\tsettings: UseControlledRangeValueArgs\n) {\n\tconst { min, max, value: valueProp, initial } = settings;\n\tconst [ state, setInternalState ] = useControlledState(\n\t\tfloatClamp( valueProp, min, max ),\n\t\t{\n\t\t\tinitial: floatClamp( initial ?? null, min, max ),\n\t\t\tfallback: null,\n\t\t}\n\t);\n\n\tconst setState = useCallback(\n\t\t( nextValue: number | null ) => {\n\t\t\tif ( nextValue === null ) {\n\t\t\t\tsetInternalState( null );\n\t\t\t} else {\n\t\t\t\tsetInternalState( floatClamp( nextValue, min, max ) );\n\t\t\t}\n\t\t},\n\t\t[ min, max, setInternalState ]\n\t);\n\n\t// `state` can't be an empty string because we specified a fallback value of\n\t// `null` in `useControlledState`\n\treturn [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EACA;EACA,OAAO,CAAED,KAAK,EAAiCI,QAAQ,CAAE;AAC1D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_i18n","_utils","_resizeTooltip","_jsxRuntime","CORNER_OFFSET","CURSOR_OFFSET_TOP","Label","label","position","POSITIONS","corner","zIndex","props","ref","showLabel","isBottom","bottom","isCorner","style","opacity","undefined","labelStyle","left","transform","top","right","isRTL","jsx","TooltipWrapper","className","children","Tooltip","LabelText","as","ForwardedComponent","forwardRef","_default","exports","default"],"sources":["@wordpress/components/src/resizable-box/resize-tooltip/label.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { Position } from './utils';\nimport { POSITIONS } from './utils';\nimport {\n\tTooltipWrapper,\n\tTooltip,\n\tLabelText,\n} from './styles/resize-tooltip.styles';\n\nconst CORNER_OFFSET = 4;\nconst CURSOR_OFFSET_TOP = CORNER_OFFSET * 2.5;\n\ntype LabelProps = React.DetailedHTMLProps<\n\tReact.HTMLAttributes< HTMLDivElement >,\n\tHTMLDivElement\n> & {\n\tlabel?: string;\n\tposition: Position;\n\tzIndex: number;\n};\n\nfunction Label(\n\t{ label, position = POSITIONS.corner, zIndex = 1000, ...props }: LabelProps,\n\tref: ForwardedRef< HTMLDivElement >\n): JSX.Element | null {\n\tconst showLabel = !! label;\n\n\tconst isBottom = position === POSITIONS.bottom;\n\tconst isCorner = position === POSITIONS.corner;\n\n\tif ( ! showLabel ) {\n\t\treturn null;\n\t}\n\n\tlet style: React.CSSProperties = {\n\t\topacity: showLabel ? 1 : undefined,\n\t\tzIndex,\n\t};\n\n\tlet labelStyle = {};\n\n\tif ( isBottom ) {\n\t\tstyle = {\n\t\t\t...style,\n\t\t\tposition: 'absolute',\n\t\t\tbottom: CURSOR_OFFSET_TOP * -1,\n\t\t\tleft: '50%',\n\t\t\ttransform: 'translate(-50%, 0)',\n\t\t};\n\n\t\tlabelStyle = {\n\t\t\ttransform: `translate(0, 100%)`,\n\t\t};\n\t}\n\n\tif ( isCorner ) {\n\t\tstyle = {\n\t\t\t...style,\n\t\t\tposition: 'absolute',\n\t\t\ttop: CORNER_OFFSET,\n\t\t\tright: isRTL() ? undefined : CORNER_OFFSET,\n\t\t\tleft: isRTL() ? CORNER_OFFSET : undefined,\n\t\t};\n\t}\n\n\treturn (\n\t\t<TooltipWrapper\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"components-resizable-tooltip__tooltip-wrapper\"\n\t\t\tref={ ref }\n\t\t\tstyle={ style }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<Tooltip\n\t\t\t\tclassName=\"components-resizable-tooltip__tooltip\"\n\t\t\t\tstyle={ labelStyle }\n\t\t\t>\n\t\t\t\t<LabelText as=\"span\">{ label }</LabelText>\n\t\t\t</Tooltip>\n\t\t</TooltipWrapper>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( Label );\n\nexport default ForwardedComponent;\n"],"mappings":";;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAIwC,IAAAI,WAAA,GAAAJ,OAAA;AApBxC;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AASA,MAAMK,aAAa,GAAG,CAAC;AACvB,MAAMC,iBAAiB,GAAGD,aAAa,GAAG,GAAG;AAW7C,SAASE,KAAKA,CACb;EAAEC,KAAK;EAAEC,QAAQ,GAAGC,gBAAS,CAACC,MAAM;EAAEC,MAAM,GAAG,IAAI;EAAE,GAAGC;AAAkB,CAAC,EAC3EC,GAAmC,EACd;EACrB,MAAMC,SAAS,GAAG,CAAC,CAAEP,KAAK;EAE1B,MAAMQ,QAAQ,GAAGP,QAAQ,KAAKC,gBA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,CAAa;IAAC,CAClC;EAAC,CACK,CAAC;AAEnB;AAEA,MAAM2B,kBAAkB,GAAG,IAAAC,mBAAU,EAAE7B,KAAM,CAAC;AAAC,IAAA8B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEhCJ,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_i18n","_utils","_resizeTooltip","_jsxRuntime","CORNER_OFFSET","CURSOR_OFFSET_TOP","Label","label","position","POSITIONS","corner","zIndex","props","ref","showLabel","isBottom","bottom","isCorner","style","opacity","undefined","labelStyle","left","transform","top","right","isRTL","jsx","TooltipWrapper","className","children","Tooltip","LabelText","as","ForwardedComponent","forwardRef","_default","exports","default"],"sources":["@wordpress/components/src/resizable-box/resize-tooltip/label.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { Position } from './utils';\nimport { POSITIONS } from './utils';\nimport {\n\tTooltipWrapper,\n\tTooltip,\n\tLabelText,\n} from './styles/resize-tooltip.styles';\n\nconst CORNER_OFFSET = 4;\nconst CURSOR_OFFSET_TOP = CORNER_OFFSET * 2.5;\n\ntype LabelProps = React.DetailedHTMLProps<\n\tReact.HTMLAttributes< HTMLDivElement >,\n\tHTMLDivElement\n> & {\n\tlabel?: string;\n\tposition: Position;\n\tzIndex: number;\n};\n\nfunction Label(\n\t{ label, position = POSITIONS.corner, zIndex = 1000, ...props }: LabelProps,\n\tref: ForwardedRef< HTMLDivElement >\n): JSX.Element | null {\n\tconst showLabel = !! label;\n\n\tconst isBottom = position === POSITIONS.bottom;\n\tconst isCorner = position === POSITIONS.corner;\n\n\tif ( ! showLabel ) {\n\t\treturn null;\n\t}\n\n\tlet style: React.CSSProperties = {\n\t\topacity: showLabel ? 1 : undefined,\n\t\tzIndex,\n\t};\n\n\tlet labelStyle = {};\n\n\tif ( isBottom ) {\n\t\tstyle = {\n\t\t\t...style,\n\t\t\tposition: 'absolute',\n\t\t\tbottom: CURSOR_OFFSET_TOP * -1,\n\t\t\tleft: '50%',\n\t\t\ttransform: 'translate(-50%, 0)',\n\t\t};\n\n\t\tlabelStyle = {\n\t\t\ttransform: `translate(0, 100%)`,\n\t\t};\n\t}\n\n\tif ( isCorner ) {\n\t\tstyle = {\n\t\t\t...style,\n\t\t\tposition: 'absolute',\n\t\t\ttop: CORNER_OFFSET,\n\t\t\tright: isRTL() ? undefined : CORNER_OFFSET,\n\t\t\tleft: isRTL() ? CORNER_OFFSET : undefined,\n\t\t};\n\t}\n\n\treturn (\n\t\t<TooltipWrapper\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"components-resizable-tooltip__tooltip-wrapper\"\n\t\t\tref={ ref }\n\t\t\tstyle={ style }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<Tooltip\n\t\t\t\tclassName=\"components-resizable-tooltip__tooltip\"\n\t\t\t\tstyle={ labelStyle }\n\t\t\t>\n\t\t\t\t<LabelText as=\"span\">{ label }</LabelText>\n\t\t\t</Tooltip>\n\t\t</TooltipWrapper>\n\t);\n}\n\nconst ForwardedComponent = forwardRef( Label );\n\nexport default ForwardedComponent;\n"],"mappings":";;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAIwC,IAAAI,WAAA,GAAAJ,OAAA;AApBxC;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AASA,MAAMK,aAAa,GAAG,CAAC;AACvB,MAAMC,iBAAiB,GAAGD,aAAa,GAAG,GAAG;AAW7C,SAASE,KAAKA,CACb;EAAEC,KAAK;EAAEC,QAAQ,GAAGC,gBAAS,CAACC,MAAM;EAAEC,MAAM,GAAG,IAAI;EAAE,GAAGC;AAAkB,CAAC,EAC3EC,GA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A3B,WAAA,CAAAwB,GAAA,EAACzB,cAAA,CAAA8B,SAAS;QAACC,EAAE,EAAC,MAAM;QAAAH,QAAA,EAAGvB;MAAK,CAAa;IAAC,CAClC;EAAC,CACK,CAAC;AAEnB;AAEA,MAAM2B,kBAAkB,GAAG,IAAAC,mBAAU,EAAE7B,KAAM,CAAC;AAAC,IAAA8B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEhCJ,kBAAkB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_compose","noop","POSITIONS","exports","bottom","corner","useResizeLabel","axis","fadeTimeout","onResize","position","showPx","resizeListener","sizes","useResizeObserver","isAxisControlled","moveX","setMoveX","useState","moveY","setMoveY","width","height","heightRef","useRef","widthRef","moveTimeoutRef","debounceUnsetMoveXY","useCallback","unsetMoveXY","current","window","clearTimeout","setTimeout","useEffect","isRendered","didWidthChange","didHeightChange","label","getSizeLabel","undefined","labelUnit"],"sources":["@wordpress/components/src/resizable-box/resize-tooltip/utils.ts"],"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 ) {\n\t\t\t\treturn;\n\t\t\t}\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 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst didWidthChange = width !== widthRef.current;\n\t\tconst didHeightChange = height !== heightRef.current;\n\n\t\tif ( ! didWidthChange && ! didHeightChange ) {\n\t\t\treturn;\n\t\t}\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 ) {\n\t\treturn undefined;\n\t}\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"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAId,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACxBE,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACT,CAAU;AAmBV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAE;EAC/BC,IAAI;EACJC,WAAW,GAAG,GAAG;EACjBC,QAAQ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AAI;EACJe,MAAM;EACNN,KAAK,GAAG,KAAK;EACbG,KAAK,GAAG,KAAK;EACbT,QAAQ,GAAGR,SAAS,CAACE,MAAM;EAC3BO,MAAM,GAAG,KAAK;EACdU;AACiB,CAAC,EAAuB;EACzC,IAAK,CAAEL,KAAK,IAAI,CAAEG,KAAK,EAAG;IACzB,OAAOqB,SAAS;EACjB;;EAEA;AACD;AACA;AACA;EACC,IAAK9B,QAAQ,KAAKR,SAAS,CAACG,MAAM,EAAG;IACpC,OAAQ,GAAGgB,KAAO,MAAMC,MAAQ,EAAC;EAClC;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMmB,SAAS,GAAG9B,MAAM,GAAG,KAAK,GAAG,EAAE;EAErC,IAAKJ,IAAI,EAAG;IACX,IAAKA,IAAI,KAAK,GAAG,IAAIS,KAAK,EAAG;MAC5B,OAAQ,GAAGK,KAAO,GAAGoB,SAAW,EAAC;IAClC;IACA,IAAKlC,IAAI,KAAK,GAAG,IAAIY,KAAK,EAAG;MAC5B,OAAQ,GAAGG,MAAQ,GAAGmB,SAAW,EAAC;IACnC;EACD;EAEA,IAAKzB,KAAK,IAAIG,KAAK,EAAG;IACrB,OAAQ,GAAGE,KAAO,MAAMC,MAAQ,EAAC;EAClC;EACA,IAAKN,KAAK,EAAG;IACZ,OAAQ,GAAGK,KAAO,GAAGoB,SAAW,EAAC;EAClC;EACA,IAAKtB,KAAK,EAAG;IACZ,OAAQ,GAAGG,MAAQ,GAAGmB,SAAW,EAAC;EACnC;EAEA,OAAOD,SAAS;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_compose","noop","POSITIONS","exports","bottom","corner","useResizeLabel","axis","fadeTimeout","onResize","position","showPx","resizeListener","sizes","useResizeObserver","isAxisControlled","moveX","setMoveX","useState","moveY","setMoveY","width","height","heightRef","useRef","widthRef","moveTimeoutRef","debounceUnsetMoveXY","useCallback","unsetMoveXY","current","window","clearTimeout","setTimeout","useEffect","isRendered","didWidthChange","didHeightChange","label","getSizeLabel","undefined","labelUnit"],"sources":["@wordpress/components/src/resizable-box/resize-tooltip/utils.ts"],"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 ) {\n\t\t\t\treturn;\n\t\t\t}\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 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst didWidthChange = width !== widthRef.current;\n\t\tconst didHeightChange = height !== heightRef.current;\n\n\t\tif ( ! didWidthChange && ! didHeightChange ) {\n\t\t\treturn;\n\t\t}\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 ) {\n\t\treturn undefined;\n\t}\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"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAId,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACxBE,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACT,CAAU;AAmBV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAAE;EAC/BC,IAAI;EACJC,WAAW,GAAG,GAAG;EACjBC,QAAQ,GAAGR,IAAI;EACfS,QAAQ,GAAGR,SAAS,CAACE,MAAM;EAC3BO,MAAM,GAAG;AACU,CAAC,EAAwB;EAC5C;AACD;AACA;AACA;EACC,MAAM,CAAEC,cAAc,EAAEC,KAAK,CAAE,GAAG,IAAAC,0BAAiB,EAAC,CAAC;;EAErD;AACD;AACA;AACA;AACA;EACC,MAAMC,gBAAgB,GAAG,CAAC,CAAER,IAAI;;EAEhC;AACD;AACA;AACA;EACC,MAAM,CAAES,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAC7C,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAF,iBAAQ,EAAE,KAAM,CAAC;;EAE7C;AACD;AACA;AACA;EACC,MAAM;IAAEG,KAAK;IAAEC;EAAO,CAAC,GAAGT,KAAK;EAC/B,MAAMU,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AIK,KAAK,GAAKoB,SAAS,EAAG;IAClC;IACA,IAAKlC,IAAI,KAAK,GAAG,IAAIY,KAAK,EAAG;MAC5B,OAAO,GAAIG,MAAM,GAAKmB,SAAS,EAAG;IACnC;EACD;EAEA,IAAKzB,KAAK,IAAIG,KAAK,EAAG;IACrB,OAAO,GAAIE,KAAK,MAAQC,MAAM,EAAG;EAClC;EACA,IAAKN,KAAK,EAAG;IACZ,OAAO,GAAIK,KAAK,GAAKoB,SAAS,EAAG;EAClC;EACA,IAAKtB,KAAK,EAAG;IACZ,OAAO,GAAIG,MAAM,GAAKmB,SAAS,EAAG;EACnC;EAEA,OAAOD,SAAS;AACjB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_jsxRuntime","ResponsiveWrapper","naturalWidth","naturalHeight","children","isInline","Children","count","TagName","aspectRatio","jsx","className","cloneElement","clsx","props","style","_default","exports","default"],"sources":["@wordpress/components/src/responsive-wrapper/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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: clsx(\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAA4D,IAAAE,WAAA,GAAAF,OAAA;AAR5D;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,iBAAiBA,CAAE;EAC3BC,YAAY;EACZC,aAAa;EACbC,QAAQ;EACRC,QAAQ,GAAG;AACY,CAAC,EAAG;EAC3B,IAAKC,iBAAQ,CAACC,KAAK,CAAEH,QAAS,CAAC,KAAK,CAAC,EAAG;IACvC,OAAO,IAAI;EACZ;EAEA,MAAMI,OAAO,GAAGH,QAAQ,GAAG,MAAM,GAAG,KAAK;EACzC,IAAII,WAAW;EACf,IAAKP,YAAY,IAAIC,aAAa,EAAG;IACpCM,WAAW,GAAI,GAAGP,YAAc,MAAMC,aAAe,EAAC;EACvD;EAEA,oBACC,IAAAH,WAAA,CAAAU,GAAA,EAACF,OAAO;IAACG,SAAS,EAAC,+BAA+B;IAAAP,QAAA,eACjD,IAAAJ,WAAA,CAAAU,GAAA;MAAAN,QAAA,EACG,IAAAQ,qBAAY,EAAER,QAAQ,EAAE;QACzBO,SAAS,EAAE,IAAAE,aAAI,EACd,wCAAwC,EACxCT,QAAQ,CAACU,KAAK,CAACH,SAChB,CAAC;QACDI,KAAK,EAAE;UACN,GAAGX,QAAQ,CAACU,KAAK,CAACC,KAAK;UACvBN;QACD;MACD,CAAE;IAAC,CACC;EAAC,CACE,CAAC;AAEZ;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcjB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_jsxRuntime","ResponsiveWrapper","naturalWidth","naturalHeight","children","isInline","Children","count","TagName","aspectRatio","jsx","className","cloneElement","clsx","props","style","_default","exports","default"],"sources":["@wordpress/components/src/responsive-wrapper/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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: clsx(\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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAA4D,IAAAE,WAAA,GAAAF,OAAA;AAR5D;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,iBAAiBA,CAAE;EAC3BC,YAAY;EACZC,aAAa;EACbC,QAAQ;EACRC,QAAQ,GAAG;AACY,CAAC,EAAG;EAC3B,IAAKC,iBAAQ,CAACC,KAAK,CAAEH,QAAS,CAAC,KAAK,CAAC,EAAG;IACvC,OAAO,IAAI;EACZ;EAEA,MAAMI,OAAO,GAAGH,QAAQ,GAAG,MAAM,GAAG,KAAK;EACzC,IAAII,WAAW;EACf,IAAKP,YAAY,IAAIC,aAAa,EAAG;IACpCM,WAAW,GAAG,GAAIP,YAAY,MAAQC,aAAa,EAAG;EACvD;EAEA,oBACC,IAAAH,WAAA,CAAAU,GAAA,EAACF,OAAO;IAACG,SAAS,EAAC,+BAA+B;IAAAP,QAAA,eACjD,IAAAJ,WAAA,CAAAU,GAAA;MAAAN,QAAA,EACG,IAAAQ,qBAAY,EAAER,QAAQ,EAAE;QACzBO,SAAS,EAAE,IAAAE,aAAI,EACd,wCAAwC,EACxCT,QAAQ,CAACU,KAAK,CAACH,SAChB,CAAC;QACDI,KAAK,EAAE;UACN,GAAGX,QAAQ,CAACU,KAAK,CAACC,KAAK;UACvBN;QACD;MACD,CAAE;IAAC,CACC;EAAC,CACE,CAAC;AAEZ;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcjB,iBAAiB","ignoreList":[]}
@@ -219,21 +219,18 @@ function SandBox({
219
219
  iframe?.removeEventListener('load', tryNoForceSandBox, false);
220
220
  defaultView?.removeEventListener('message', checkMessageForResize);
221
221
  };
222
- // Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor.
222
+ // Passing `exhaustive-deps` will likely involve a more detailed refactor.
223
223
  // See https://github.com/WordPress/gutenberg/pull/44378
224
- // eslint-disable-next-line react-hooks/exhaustive-deps
225
224
  }, []);
226
225
  (0, _element.useEffect)(() => {
227
226
  trySandBox();
228
- // Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor.
227
+ // Passing `exhaustive-deps` will likely involve a more detailed refactor.
229
228
  // See https://github.com/WordPress/gutenberg/pull/44378
230
- // eslint-disable-next-line react-hooks/exhaustive-deps
231
229
  }, [title, styles, scripts]);
232
230
  (0, _element.useEffect)(() => {
233
231
  trySandBox(true);
234
- // Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor.
232
+ // Passing `exhaustive-deps` will likely involve a more detailed refactor.
235
233
  // See https://github.com/WordPress/gutenberg/pull/44378
236
- // eslint-disable-next-line react-hooks/exhaustive-deps
237
234
  }, [html, type]);
238
235
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("iframe", {
239
236
  ref: (0, _compose.useMergeRefs)([ref, (0, _compose.useFocusableIframe)()]),
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_compose","_jsxRuntime","observeAndResizeJS","MutationObserver","window","document","body","parent","sendResize","clientBoundingRect","getBoundingClientRect","postMessage","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","SandBox","html","title","type","styles","scripts","onFocus","tabIndex","ref","useRef","setWidth","useState","setHeight","isFrameAccessible","current","contentDocument","e","trySandBox","forceRerender","ownerDocument","getAttribute","htmlDoc","jsxs","lang","documentElement","className","children","jsx","dangerouslySetInnerHTML","__html","map","i","toString","src","open","write","renderToString","close","useEffect","tryNoForceSandBox","checkMessageForResize","event","iframe","contentWindow","source","data","JSON","parse","defaultView","removeEventListener","useMergeRefs","useFocusableIframe","sandbox","Math","ceil","_default","exports","default"],"sources":["@wordpress/components/src/sandbox/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseRef,\n\tuseState,\n\tuseEffect,\n} from '@wordpress/element';\nimport { useFocusableIframe, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { SandBoxProps } from './types';\n\nconst observeAndResizeJS = function () {\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\twindow.parent.postMessage(\n\t\t\t{\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\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: ElementCSSInlineStyle ) {\n\t\tif ( ruleOrNode.style ) {\n\t\t\t(\n\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ] as const\n\t\t\t ).forEach( function ( style ) {\n\t\t\t\tif (\n\t\t\t\t\t/^\\\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(\n\t\t\t\t\t\truleOrNode.style[ style ]\n\t\t\t\t\t)\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\n// TODO: These styles shouldn't be coupled with WordPress.\nconst style = `\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\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\n/**\n * This component provides an isolated environment for arbitrary HTML via iframes.\n *\n * ```jsx\n * import { SandBox } from '@wordpress/components';\n *\n * const MySandBox = () => (\n * \t<SandBox html=\"<p>Content</p>\" title=\"SandBox\" type=\"embed\" />\n * );\n * ```\n */\nfunction SandBox( {\n\thtml = '',\n\ttitle = '',\n\ttype,\n\tstyles = [],\n\tscripts = [],\n\tonFocus,\n\ttabIndex,\n}: SandBoxProps ) {\n\tconst ref = useRef< HTMLIFrameElement >();\n\tconst [ width, setWidth ] = useState( 0 );\n\tconst [ height, setHeight ] = useState( 0 );\n\n\tfunction isFrameAccessible() {\n\t\ttry {\n\t\t\treturn !! ref.current?.contentDocument?.body;\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction trySandBox( forceRerender = false ) {\n\t\tif ( ! isFrameAccessible() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { contentDocument, ownerDocument } =\n\t\t\tref.current as HTMLIFrameElement & {\n\t\t\t\tcontentDocument: Document;\n\t\t\t};\n\n\t\tif (\n\t\t\t! forceRerender &&\n\t\t\tnull !==\n\t\t\t\tcontentDocument?.body.getAttribute(\n\t\t\t\t\t'data-resizable-iframe-connected'\n\t\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Put the html snippet into a html document, and then write it to the iframe's document\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\n\t\t\t\tlang={ ownerDocument.documentElement.lang }\n\t\t\t\tclassName={ type }\n\t\t\t>\n\t\t\t\t<head>\n\t\t\t\t\t<title>{ title }</title>\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: `(${ 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\n\t\t// Writing the document like this makes it act in the same way as if it was\n\t\t// loaded over the network, so DOM creation and mutation, script execution, etc.\n\t\t// all work as expected.\n\t\tcontentDocument.open();\n\t\tcontentDocument.write( '<!DOCTYPE html>' + renderToString( htmlDoc ) );\n\t\tcontentDocument.close();\n\t}\n\n\tuseEffect( () => {\n\t\ttrySandBox();\n\n\t\tfunction tryNoForceSandBox() {\n\t\t\ttrySandBox( false );\n\t\t}\n\n\t\tfunction checkMessageForResize( event: MessageEvent ) {\n\t\t\tconst iframe = ref.current;\n\n\t\t\t// Verify that the mounted element is the source of the message.\n\t\t\tif ( ! iframe || iframe.contentWindow !== event.source ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Attempt to parse the message data as JSON if passed as string.\n\t\t\tlet data = event.data || {};\n\n\t\t\tif ( 'string' === typeof data ) {\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse( data );\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\t// Update the state only if the message is formatted as we expect,\n\t\t\t// i.e. as an object with a 'resize' action.\n\t\t\tif ( 'resize' !== data.action ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetWidth( data.width );\n\t\t\tsetHeight( data.height );\n\t\t}\n\n\t\tconst iframe = ref.current;\n\t\tconst defaultView = iframe?.ownerDocument?.defaultView;\n\n\t\t// This used to be registered using <iframe onLoad={} />, but it made the iframe blank\n\t\t// after reordering the containing block. See these two issues for more details:\n\t\t// https://github.com/WordPress/gutenberg/issues/6146\n\t\t// https://github.com/facebook/react/issues/18752\n\t\tiframe?.addEventListener( 'load', tryNoForceSandBox, false );\n\t\tdefaultView?.addEventListener( 'message', checkMessageForResize );\n\n\t\treturn () => {\n\t\t\tiframe?.removeEventListener( 'load', tryNoForceSandBox, false );\n\t\t\tdefaultView?.removeEventListener(\n\t\t\t\t'message',\n\t\t\t\tcheckMessageForResize\n\t\t\t);\n\t\t};\n\t\t// Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor.\n\t\t// See https://github.com/WordPress/gutenberg/pull/44378\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tuseEffect( () => {\n\t\ttrySandBox();\n\t\t// Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor.\n\t\t// See https://github.com/WordPress/gutenberg/pull/44378\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ title, styles, scripts ] );\n\n\tuseEffect( () => {\n\t\ttrySandBox( true );\n\t\t// Ignore reason: passing `exhaustive-deps` will likely involve a more detailed refactor.\n\t\t// See https://github.com/WordPress/gutenberg/pull/44378\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ html, type ] );\n\n\treturn (\n\t\t<iframe\n\t\t\tref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }\n\t\t\ttitle={ title }\n\t\t\ttabIndex={ tabIndex }\n\t\t\tclassName=\"components-sandbox\"\n\t\t\tsandbox=\"allow-scripts allow-same-origin allow-presentation\"\n\t\t\tonFocus={ onFocus }\n\t\t\twidth={ Math.ceil( width ) }\n\t\t\theight={ Math.ceil( height ) }\n\t\t/>\n\t);\n}\n\nexport default SandBox;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA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,KAAK,EAAG+E,IAAI,CAACC,IAAI,CAAEhF,KAAM,CAAG;IAC5BC,MAAM,EAAG8E,IAAI,CAACC,IAAI,CAAE/E,MAAO;EAAG,CAC9B,CAAC;AAEJ;AAAC,IAAAgF,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczD,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_compose","_jsxRuntime","observeAndResizeJS","MutationObserver","window","document","body","parent","sendResize","clientBoundingRect","getBoundingClientRect","postMessage","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","SandBox","html","title","type","styles","scripts","onFocus","tabIndex","ref","useRef","setWidth","useState","setHeight","isFrameAccessible","current","contentDocument","e","trySandBox","forceRerender","ownerDocument","getAttribute","htmlDoc","jsxs","lang","documentElement","className","children","jsx","dangerouslySetInnerHTML","__html","map","i","toString","src","open","write","renderToString","close","useEffect","tryNoForceSandBox","checkMessageForResize","event","iframe","contentWindow","source","data","JSON","parse","defaultView","removeEventListener","useMergeRefs","useFocusableIframe","sandbox","Math","ceil","_default","exports","default"],"sources":["@wordpress/components/src/sandbox/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseRef,\n\tuseState,\n\tuseEffect,\n} from '@wordpress/element';\nimport { useFocusableIframe, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { SandBoxProps } from './types';\n\nconst observeAndResizeJS = function () {\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\twindow.parent.postMessage(\n\t\t\t{\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\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: ElementCSSInlineStyle ) {\n\t\tif ( ruleOrNode.style ) {\n\t\t\t(\n\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ] as const\n\t\t\t ).forEach( function ( style ) {\n\t\t\t\tif (\n\t\t\t\t\t/^\\\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(\n\t\t\t\t\t\truleOrNode.style[ style ]\n\t\t\t\t\t)\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\n// TODO: These styles shouldn't be coupled with WordPress.\nconst style = `\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\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\n/**\n * This component provides an isolated environment for arbitrary HTML via iframes.\n *\n * ```jsx\n * import { SandBox } from '@wordpress/components';\n *\n * const MySandBox = () => (\n * \t<SandBox html=\"<p>Content</p>\" title=\"SandBox\" type=\"embed\" />\n * );\n * ```\n */\nfunction SandBox( {\n\thtml = '',\n\ttitle = '',\n\ttype,\n\tstyles = [],\n\tscripts = [],\n\tonFocus,\n\ttabIndex,\n}: SandBoxProps ) {\n\tconst ref = useRef< HTMLIFrameElement >();\n\tconst [ width, setWidth ] = useState( 0 );\n\tconst [ height, setHeight ] = useState( 0 );\n\n\tfunction isFrameAccessible() {\n\t\ttry {\n\t\t\treturn !! ref.current?.contentDocument?.body;\n\t\t} catch ( e ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tfunction trySandBox( forceRerender = false ) {\n\t\tif ( ! isFrameAccessible() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { contentDocument, ownerDocument } =\n\t\t\tref.current as HTMLIFrameElement & {\n\t\t\t\tcontentDocument: Document;\n\t\t\t};\n\n\t\tif (\n\t\t\t! forceRerender &&\n\t\t\tnull !==\n\t\t\t\tcontentDocument?.body.getAttribute(\n\t\t\t\t\t'data-resizable-iframe-connected'\n\t\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Put the html snippet into a html document, and then write it to the iframe's document\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\n\t\t\t\tlang={ ownerDocument.documentElement.lang }\n\t\t\t\tclassName={ type }\n\t\t\t>\n\t\t\t\t<head>\n\t\t\t\t\t<title>{ title }</title>\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: `(${ 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\n\t\t// Writing the document like this makes it act in the same way as if it was\n\t\t// loaded over the network, so DOM creation and mutation, script execution, etc.\n\t\t// all work as expected.\n\t\tcontentDocument.open();\n\t\tcontentDocument.write( '<!DOCTYPE html>' + renderToString( htmlDoc ) );\n\t\tcontentDocument.close();\n\t}\n\n\tuseEffect( () => {\n\t\ttrySandBox();\n\n\t\tfunction tryNoForceSandBox() {\n\t\t\ttrySandBox( false );\n\t\t}\n\n\t\tfunction checkMessageForResize( event: MessageEvent ) {\n\t\t\tconst iframe = ref.current;\n\n\t\t\t// Verify that the mounted element is the source of the message.\n\t\t\tif ( ! iframe || iframe.contentWindow !== event.source ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Attempt to parse the message data as JSON if passed as string.\n\t\t\tlet data = event.data || {};\n\n\t\t\tif ( 'string' === typeof data ) {\n\t\t\t\ttry {\n\t\t\t\t\tdata = JSON.parse( data );\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\t// Update the state only if the message is formatted as we expect,\n\t\t\t// i.e. as an object with a 'resize' action.\n\t\t\tif ( 'resize' !== data.action ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetWidth( data.width );\n\t\t\tsetHeight( data.height );\n\t\t}\n\n\t\tconst iframe = ref.current;\n\t\tconst defaultView = iframe?.ownerDocument?.defaultView;\n\n\t\t// This used to be registered using <iframe onLoad={} />, but it made the iframe blank\n\t\t// after reordering the containing block. See these two issues for more details:\n\t\t// https://github.com/WordPress/gutenberg/issues/6146\n\t\t// https://github.com/facebook/react/issues/18752\n\t\tiframe?.addEventListener( 'load', tryNoForceSandBox, false );\n\t\tdefaultView?.addEventListener( 'message', checkMessageForResize );\n\n\t\treturn () => {\n\t\t\tiframe?.removeEventListener( 'load', tryNoForceSandBox, false );\n\t\t\tdefaultView?.removeEventListener(\n\t\t\t\t'message',\n\t\t\t\tcheckMessageForResize\n\t\t\t);\n\t\t};\n\t\t// Passing `exhaustive-deps` will likely involve a more detailed refactor.\n\t\t// See https://github.com/WordPress/gutenberg/pull/44378\n\t}, [] );\n\n\tuseEffect( () => {\n\t\ttrySandBox();\n\t\t// Passing `exhaustive-deps` will likely involve a more detailed refactor.\n\t\t// See https://github.com/WordPress/gutenberg/pull/44378\n\t}, [ title, styles, scripts ] );\n\n\tuseEffect( () => {\n\t\ttrySandBox( true );\n\t\t// Passing `exhaustive-deps` will likely involve a more detailed refactor.\n\t\t// See https://github.com/WordPress/gutenberg/pull/44378\n\t}, [ html, type ] );\n\n\treturn (\n\t\t<iframe\n\t\t\tref={ useMergeRefs( [ ref, useFocusableIframe() ] ) }\n\t\t\ttitle={ title }\n\t\t\ttabIndex={ tabIndex }\n\t\t\tclassName=\"components-sandbox\"\n\t\t\tsandbox=\"allow-scripts allow-same-origin allow-presentation\"\n\t\t\tonFocus={ onFocus }\n\t\t\twidth={ Math.ceil( width ) }\n\t\t\theight={ Math.ceil( height ) }\n\t\t/>\n\t);\n}\n\nexport default SandBox;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAAsE,IAAAE,WAAA,GAAAF,OAAA;AATtE;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAMG,kBAAkB,GAAG,SAAAA,CAAA,EAAY;EACtC,MAAM;IAAEC;EAAiB,CAAC,GAAGC,MAAM;EAEnC,IAAK,CAAED,gBAAgB,IAAI,CAAEE,QAAQ,CAACC,IAAI,IAAI,CAAEF,MAAM,CAACG,MAAM,EAAG;IAC/D;EACD;EAEA,SAASC,UAAUA,CAAA,EAAG;IACrB,MAAMC,kBAAkB,GAAGJ,QAAQ,CAACC,IAAI,CAACI,qBAAqB,CAAC,CAAC;IAEhEN,MAAM,CAACG,MAAM,CAACI,WAAW,CACxB;MACCC,MAAM,EAAE,QAAQ;MAChBC,KAAK,EAAEJ,kBAAkB,CAACI,KAAK;MAC/BC,MAAM,EAAEL,kBAAkB,CAACK;IAC5B,CAAC,EACD,GACD,CAAC;EACF;EAEA,MAAMC,QAAQ,GAAG,IAAIZ,gBAAgB,CAAEK,UAAW,CAAC;EACnDO,QAAQ,CAACC,OAAO,CAAEX,QAAQ,CAACC,IAAI,EAAE;IAChCW,UAAU,EAAE,IAAI;IAChBC,iBAAiB,EAAE,KAAK;IACxBC,aAAa,EAAE,IAAI;IACnBC,qBAAqB,EAAE,KAAK;IAC5BC,SAAS,EAAE,IAAI;IACfC,OAAO,EAAE;EACV,CAAE,CAAC;EAEHlB,MAAM,CAACmB,gBAAgB,CAAE,MAAM,E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B,IAAI,EAAEE,IAAI,CAAG,CAAC;EAEnB,oBACC,IAAAzC,WAAA,CAAAiE,GAAA;IACCnB,GAAG,EAAG,IAAA0C,qBAAY,EAAE,CAAE1C,GAAG,EAAE,IAAA2C,2BAAkB,EAAC,CAAC,CAAG,CAAG;IACrDjD,KAAK,EAAGA,KAAO;IACfK,QAAQ,EAAGA,QAAU;IACrBkB,SAAS,EAAC,oBAAoB;IAC9B2B,OAAO,EAAC,oDAAoD;IAC5D9C,OAAO,EAAGA,OAAS;IACnBhC,KAAK,EAAG+E,IAAI,CAACC,IAAI,CAAEhF,KAAM,CAAG;IAC5BC,MAAM,EAAG8E,IAAI,CAACC,IAAI,CAAE/E,MAAO;EAAG,CAC9B,CAAC;AAEJ;AAAC,IAAAgF,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczD,OAAO","ignoreList":[]}
@@ -306,9 +306,7 @@ const Sandbox = (0, _element.forwardRef)(function Sandbox({
306
306
  }, []);
307
307
  (0, _element.useEffect)(() => {
308
308
  updateContentHtml();
309
- // Disable reason: deferring this refactor to the native team.
310
- // see https://github.com/WordPress/gutenberg/pull/41166
311
- // eslint-disable-next-line react-hooks/exhaustive-deps
309
+ // See https://github.com/WordPress/gutenberg/pull/41166
312
310
  }, [html, title, type, styles, scripts]);
313
311
  (0, _element.useEffect)(() => {
314
312
  // When device orientation changes we have to recalculate the size,
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_reactNativeWebview","_element","_compose","_style","_interopRequireDefault","_jsxRuntime","observeAndResizeJS","style","EMPTY_ARRAY","Sandbox","forwardRef","containerStyle","customJS","html","lang","providerUrl","scripts","styles","title","type","url","onWindowEvents","viewportProps","onLoadEnd","testID","ref","colorScheme","usePreferredColorScheme","height","setHeight","useState","contentHtml","setContentHtml","getHtmlDoc","windowSize","Dimensions","get","isLandscape","setIsLandscape","width","wasLandscape","useRef","key","Platform","select","android","ios","addViewportProps","trim","replace","htmlDoc","jsxs","children","jsx","name","content","dangerouslySetInnerHTML","__html","map","rules","i","className","src","renderToString","getInjectedJavaScript","useCallback","injectedJS","Object","keys","forEach","eventType","updateContentHtml","forceRerender","newContentHtml","setImmediate","getSizeStyle","contentHeight","Math","ceil","aspectRatio","onChangeDimensions","dimensions","window","onMessage","message","data","nativeEvent","JSON","parse","e","action","console","warn","useEffect","dimensionsChangeSubscription","addEventListener","remove","current","WebView","sandboxStyles","injectedJavaScript","source","baseUrl","originWhitelist","isAndroid","workaroundStyles","webView","scrollEnabled","setBuiltInZoomControls","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","mediaPlaybackRequiresUserAction","StyleSheet","create","opacity","_default","exports","default","memo"],"sources":["@wordpress/components/src/sandbox/index.native.js"],"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\tforwardRef,\n\tuseCallback,\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+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.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})();\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\nconst Sandbox = forwardRef( function Sandbox(\n\t{\n\t\tcontainerStyle,\n\t\tcustomJS,\n\t\thtml = '',\n\t\tlang = 'en',\n\t\tproviderUrl = '',\n\t\tscripts = EMPTY_ARRAY,\n\t\tstyles = EMPTY_ARRAY,\n\t\ttitle = '',\n\t\ttype,\n\t\turl,\n\t\tonWindowEvents = {},\n\t\tviewportProps = '',\n\t\tonLoadEnd = () => {},\n\t\ttestID,\n\t},\n\tref\n) {\n\tconst colorScheme = usePreferredColorScheme();\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\n\t\t// Avoid comma issues with props.viewportProps.\n\t\tconst addViewportProps = viewportProps\n\t\t\t.trim()\n\t\t\t.replace( /(^[^,])/, ', $1' );\n\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${ addViewportProps }` }\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\tconst getInjectedJavaScript = useCallback( () => {\n\t\t// Allow parent to override the resize observers with prop.customJS (legacy support)\n\t\tlet injectedJS = customJS || observeAndResizeJS;\n\n\t\t// Add any event listeners that were passed in.\n\t\tObject.keys( onWindowEvents ).forEach( ( eventType ) => {\n\t\t\tinjectedJS += `\n\t\t\t\twindow.addEventListener( '${ eventType }', function( event ) {\n\t\t\t\t\twindow.ReactNativeWebView.postMessage( JSON.stringify( { type: '${ eventType }', ...event.data } ) );\n\t\t\t\t});`;\n\t\t} );\n\n\t\treturn injectedJS;\n\t}, [ customJS, onWindowEvents ] );\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 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\tconst onMessage = useCallback(\n\t\t( message ) => {\n\t\t\tlet data = message?.nativeEvent?.data;\n\n\t\t\ttry {\n\t\t\t\tdata = JSON.parse( data );\n\t\t\t} catch ( e ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check for resize event\n\t\t\tif ( 'resize' === data?.action ) {\n\t\t\t\tsetHeight( data.height );\n\t\t\t}\n\n\t\t\t// Forward the event to parent event listeners\n\t\t\tObject.keys( onWindowEvents ).forEach( ( eventType ) => {\n\t\t\t\tif ( data?.type === eventType ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tonWindowEvents[ eventType ]( data );\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`Error handling event ${ eventType }`,\n\t\t\t\t\t\t\te\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\t\t[ onWindowEvents ]\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={ getInjectedJavaScript() }\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={ onMessage }\n\t\t\tscrollEnabled={ false }\n\t\t\tsetBuiltInZoomControls={ false }\n\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\tshowsVerticalScrollIndicator={ false }\n\t\t\tmediaPlaybackRequiresUserAction={ false }\n\t\t\tonLoadEnd={ onLoadEnd }\n\t\t\ttestID={ testID }\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"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAUA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAyC,IAAAM,WAAA,GAAAN,OAAA;AAxBzC;AACA;AACA;;AAIA;AACA;AACA;;AAaA;AACA;AACA;;AAGA,MAAMO,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,CAAC;AAED,MAAMC,KAAK,GAAI;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAMC,WAAW,GAAG,EAAE;AAEtB,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EAAE,SAASD,OAAOA,CAC3C;EACCE,cAAc;EACdC,QAAQ;EACRC,IAAI,GAAG,EAAE;EACTC,IAAI,GAAG,IAAI;EACXC,WAAW,GAAG,EAAE;EAChBC,OAAO,GAAGR,WAAW;EACrBS,MAAM,GAAGT,WAAW;EACpBU,KAAK,GAAG,EAAE;EACVC,IAAI;EACJC,GAAG;EACHC,cAAc,GAAG,CAAC,CAAC;EACnBC,aAAa,GAAG,EAAE;EAClBC,S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AsB,EAAG,KAAO;IAChCC,8BAA8B,EAAG,KAAO;IACxCC,4BAA4B,EAAG,KAAO;IACtCC,+BAA+B,EAAG,KAAO;IACzCxF,SAAS,EAAGA,SAAW;IACvBC,MAAM,EAAGA;EAAQ,GAlBXkB,GAmBN,CAAC;AAEJ,CAAE,CAAC;AAEH,MAAM+D,gBAAgB,GAAGO,uBAAU,CAACC,MAAM,CAAE;EAC3CP,OAAO,EAAE;IACR;AACF;AACA;AACA;AACA;IACEQ,OAAO,EAAE;EACV;AACD,CAAE,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEW,IAAAC,aAAI,EAAE7G,OAAQ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_reactNativeWebview","_element","_compose","_style","_interopRequireDefault","_jsxRuntime","observeAndResizeJS","style","EMPTY_ARRAY","Sandbox","forwardRef","containerStyle","customJS","html","lang","providerUrl","scripts","styles","title","type","url","onWindowEvents","viewportProps","onLoadEnd","testID","ref","colorScheme","usePreferredColorScheme","height","setHeight","useState","contentHtml","setContentHtml","getHtmlDoc","windowSize","Dimensions","get","isLandscape","setIsLandscape","width","wasLandscape","useRef","key","Platform","select","android","ios","addViewportProps","trim","replace","htmlDoc","jsxs","children","jsx","name","content","dangerouslySetInnerHTML","__html","map","rules","i","className","src","renderToString","getInjectedJavaScript","useCallback","injectedJS","Object","keys","forEach","eventType","updateContentHtml","forceRerender","newContentHtml","setImmediate","getSizeStyle","contentHeight","Math","ceil","aspectRatio","onChangeDimensions","dimensions","window","onMessage","message","data","nativeEvent","JSON","parse","e","action","console","warn","useEffect","dimensionsChangeSubscription","addEventListener","remove","current","WebView","sandboxStyles","injectedJavaScript","source","baseUrl","originWhitelist","isAndroid","workaroundStyles","webView","scrollEnabled","setBuiltInZoomControls","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","mediaPlaybackRequiresUserAction","StyleSheet","create","opacity","_default","exports","default","memo"],"sources":["@wordpress/components/src/sandbox/index.native.js"],"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\tforwardRef,\n\tuseCallback,\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+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.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})();\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\nconst Sandbox = forwardRef( function Sandbox(\n\t{\n\t\tcontainerStyle,\n\t\tcustomJS,\n\t\thtml = '',\n\t\tlang = 'en',\n\t\tproviderUrl = '',\n\t\tscripts = EMPTY_ARRAY,\n\t\tstyles = EMPTY_ARRAY,\n\t\ttitle = '',\n\t\ttype,\n\t\turl,\n\t\tonWindowEvents = {},\n\t\tviewportProps = '',\n\t\tonLoadEnd = () => {},\n\t\ttestID,\n\t},\n\tref\n) {\n\tconst colorScheme = usePreferredColorScheme();\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\n\t\t// Avoid comma issues with props.viewportProps.\n\t\tconst addViewportProps = viewportProps\n\t\t\t.trim()\n\t\t\t.replace( /(^[^,])/, ', $1' );\n\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${ addViewportProps }` }\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\tconst getInjectedJavaScript = useCallback( () => {\n\t\t// Allow parent to override the resize observers with prop.customJS (legacy support)\n\t\tlet injectedJS = customJS || observeAndResizeJS;\n\n\t\t// Add any event listeners that were passed in.\n\t\tObject.keys( onWindowEvents ).forEach( ( eventType ) => {\n\t\t\tinjectedJS += `\n\t\t\t\twindow.addEventListener( '${ eventType }', function( event ) {\n\t\t\t\t\twindow.ReactNativeWebView.postMessage( JSON.stringify( { type: '${ eventType }', ...event.data } ) );\n\t\t\t\t});`;\n\t\t} );\n\n\t\treturn injectedJS;\n\t}, [ customJS, onWindowEvents ] );\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 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\tconst onMessage = useCallback(\n\t\t( message ) => {\n\t\t\tlet data = message?.nativeEvent?.data;\n\n\t\t\ttry {\n\t\t\t\tdata = JSON.parse( data );\n\t\t\t} catch ( e ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// check for resize event\n\t\t\tif ( 'resize' === data?.action ) {\n\t\t\t\tsetHeight( data.height );\n\t\t\t}\n\n\t\t\t// Forward the event to parent event listeners\n\t\t\tObject.keys( onWindowEvents ).forEach( ( eventType ) => {\n\t\t\t\tif ( data?.type === eventType ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tonWindowEvents[ eventType ]( data );\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`Error handling event ${ eventType }`,\n\t\t\t\t\t\t\te\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\t\t[ onWindowEvents ]\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// See https://github.com/WordPress/gutenberg/pull/41166\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={ getInjectedJavaScript() }\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={ onMessage }\n\t\t\tscrollEnabled={ false }\n\t\t\tsetBuiltInZoomControls={ false }\n\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\tshowsVerticalScrollIndicator={ false }\n\t\t\tmediaPlaybackRequiresUserAction={ false }\n\t\t\tonLoadEnd={ onLoadEnd }\n\t\t\ttestID={ testID }\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"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAUA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAyC,IAAAM,WAAA,GAAAN,OAAA;AAxBzC;AACA;AACA;;AAIA;AACA;AACA;;AAaA;AACA;AACA;;AAGA,MAAMO,kBAAkB,GAAG;AAC3B;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;A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var _icons = require("@wordpress/icons");
12
12
  var _element = require("@wordpress/element");
13
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
13
14
  var _button = _interopRequireDefault(require("../button"));
14
15
  var _context = require("../context");
15
16
  var _styles = require("./styles");
@@ -37,6 +38,11 @@ function SuffixItem({
37
38
  icon: _icons.search
38
39
  });
39
40
  }
41
+ if (onClose) {
42
+ (0, _deprecated.default)('`onClose` prop in wp.components.SearchControl', {
43
+ since: '6.8'
44
+ });
45
+ }
40
46
  const onReset = () => {
41
47
  onChange('');
42
48
  searchRef.current?.focus();
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_i18n","_icons","_element","_button","_context","_styles","_jsxRuntime","SuffixItem","searchRef","value","onChange","onClose","jsx","Icon","icon","search","onReset","current","focus","default","size","closeSmall","label","__","onClick","UnforwardedSearchControl","__nextHasNoMarginBottom","className","placeholder","hideLabelFromVision","restProps","forwardedRef","disabled","filteredRestProps","useRef","instanceId","useInstanceId","SearchControl","contextValue","useMemo","BaseControl","_overrides","__associatedWPComponentName","InputBase","isBorderless","ContextSystemProvider","children","StyledInputControl","__next40pxDefaultSize","id","ref","useMergeRefs","type","clsx","nextValue","autoComplete","suffix","SuffixItemWrapper","exports","forwardRef","_default"],"sources":["@wordpress/components/src/search-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { SearchControlProps, SuffixItemProps } from './types';\nimport type { ForwardedRef } from 'react';\nimport { ContextSystemProvider } from '../context';\nimport { StyledInputControl, SuffixItemWrapper } from './styles';\n\nfunction SuffixItem( {\n\tsearchRef,\n\tvalue,\n\tonChange,\n\tonClose,\n}: SuffixItemProps ) {\n\tif ( ! onClose && ! value ) {\n\t\treturn <Icon icon={ search } />;\n\t}\n\n\tconst onReset = () => {\n\t\tonChange( '' );\n\t\tsearchRef.current?.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"small\"\n\t\t\ticon={ closeSmall }\n\t\t\tlabel={ onClose ? __( 'Close search' ) : __( 'Reset search' ) }\n\t\t\tonClick={ onClose ?? onReset }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tonChange,\n\t\tvalue,\n\t\tlabel = __( 'Search' ),\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\tonClose,\n\t\tsize = 'default',\n\t\t...restProps\n\t}: Omit<\n\t\tWordPressComponentProps< SearchControlProps, 'input', false >,\n\t\t// TODO: Background styling currently doesn't support a disabled state. Needs design work.\n\t\t'disabled'\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\t// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.\n\t// Work with the design team (@WordPress/gutenberg-design) if you need this feature.\n\tconst { disabled, ...filteredRestProps } = restProps;\n\n\tconst searchRef = useRef< HTMLInputElement >( null );\n\tconst instanceId = useInstanceId(\n\t\tSearchControl,\n\t\t'components-search-control'\n\t);\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tBaseControl: {\n\t\t\t\t// Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system\n\t\t\t\t// to provide backwards compatibile margin for SearchControl.\n\t\t\t\t// (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)\n\t\t\t\t_overrides: { __nextHasNoMarginBottom },\n\t\t\t\t__associatedWPComponentName: 'SearchControl',\n\t\t\t},\n\t\t\t// `isBorderless` is still experimental and not a public prop for InputControl yet.\n\t\t\tInputBase: { isBorderless: true },\n\t\t} ),\n\t\t[ __nextHasNoMarginBottom ]\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextValue }>\n\t\t\t<StyledInputControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tid={ instanceId }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tlabel={ label }\n\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\ttype=\"search\"\n\t\t\t\tsize={ size }\n\t\t\t\tclassName={ clsx( 'components-search-control', className ) }\n\t\t\t\tonChange={ ( nextValue?: string ) =>\n\t\t\t\t\tonChange( nextValue ?? '' )\n\t\t\t\t}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tvalue={ value ?? '' }\n\t\t\t\tsuffix={\n\t\t\t\t\t<SuffixItemWrapper size={ size }>\n\t\t\t\t\t\t<SuffixItem\n\t\t\t\t\t\t\tsearchRef={ searchRef }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SuffixItemWrapper>\n\t\t\t\t}\n\t\t\t\t{ ...filteredRestProps }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * SearchControl components let users display a search control.\n *\n * ```jsx\n * import { SearchControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function MySearchControl( { className, setState } ) {\n * const [ searchInput, setSearchInput ] = useState( '' );\n *\n * return (\n * <SearchControl\n * __nextHasNoMarginBottom\n * value={ searchInput }\n * onChange={ setSearchInput }\n * />\n * );\n * }\n * ```\n */\nexport const SearchControl = forwardRef( UnforwardedSearchControl );\n\nexport default SearchControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF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A,CAAAM,GAAA,EAACP,OAAA,CAAAoD,iBAAiB;QAACrC,IAAI,EAAGA,IAAM;QAAA0B,QAAA,eAC/B,IAAAxC,WAAA,CAAAM,GAAA,EAACL,UAAU;UACVC,SAAS,EAAGA,SAAW;UACvBC,KAAK,EAAGA,KAAO;UACfC,QAAQ,EAAGA,QAAU;UACrBC,OAAO,EAAGA;QAAS,CACnB;MAAC,CACgB,CACnB;MAAA,GACIsB;IAAiB,CACtB;EAAC,CACoB,CAAC;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,aAAa,GAAAqB,OAAA,CAAArB,aAAA,GAAG,IAAAsB,mBAAU,EAAElC,wBAAyB,CAAC;AAAC,IAAAmC,QAAA,GAAAF,OAAA,CAAAvC,OAAA,GAErDkB,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_i18n","_icons","_element","_deprecated","_button","_context","_styles","_jsxRuntime","SuffixItem","searchRef","value","onChange","onClose","jsx","Icon","icon","search","deprecated","since","onReset","current","focus","default","size","closeSmall","label","__","onClick","UnforwardedSearchControl","__nextHasNoMarginBottom","className","placeholder","hideLabelFromVision","restProps","forwardedRef","disabled","filteredRestProps","useRef","instanceId","useInstanceId","SearchControl","contextValue","useMemo","BaseControl","_overrides","__associatedWPComponentName","InputBase","isBorderless","ContextSystemProvider","children","StyledInputControl","__next40pxDefaultSize","id","ref","useMergeRefs","type","clsx","nextValue","autoComplete","suffix","SuffixItemWrapper","exports","forwardRef","_default"],"sources":["@wordpress/components/src/search-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, search, closeSmall } from '@wordpress/icons';\nimport { forwardRef, useMemo, useRef } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\nimport type { SearchControlProps, SuffixItemProps } from './types';\nimport type { ForwardedRef } from 'react';\nimport { ContextSystemProvider } from '../context';\nimport { StyledInputControl, SuffixItemWrapper } from './styles';\n\nfunction SuffixItem( {\n\tsearchRef,\n\tvalue,\n\tonChange,\n\tonClose,\n}: SuffixItemProps ) {\n\tif ( ! onClose && ! value ) {\n\t\treturn <Icon icon={ search } />;\n\t}\n\n\tif ( onClose ) {\n\t\tdeprecated( '`onClose` prop in wp.components.SearchControl', {\n\t\t\tsince: '6.8',\n\t\t} );\n\t}\n\n\tconst onReset = () => {\n\t\tonChange( '' );\n\t\tsearchRef.current?.focus();\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"small\"\n\t\t\ticon={ closeSmall }\n\t\t\tlabel={ onClose ? __( 'Close search' ) : __( 'Reset search' ) }\n\t\t\tonClick={ onClose ?? onReset }\n\t\t/>\n\t);\n}\n\nfunction UnforwardedSearchControl(\n\t{\n\t\t__nextHasNoMarginBottom = false,\n\t\tclassName,\n\t\tonChange,\n\t\tvalue,\n\t\tlabel = __( 'Search' ),\n\t\tplaceholder = __( 'Search' ),\n\t\thideLabelFromVision = true,\n\t\tonClose,\n\t\tsize = 'default',\n\t\t...restProps\n\t}: Omit<\n\t\tWordPressComponentProps< SearchControlProps, 'input', false >,\n\t\t// TODO: Background styling currently doesn't support a disabled state. Needs design work.\n\t\t'disabled'\n\t>,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\t// @ts-expect-error The `disabled` prop is not yet supported in the SearchControl component.\n\t// Work with the design team (@WordPress/gutenberg-design) if you need this feature.\n\tconst { disabled, ...filteredRestProps } = restProps;\n\n\tconst searchRef = useRef< HTMLInputElement >( null );\n\tconst instanceId = useInstanceId(\n\t\tSearchControl,\n\t\t'components-search-control'\n\t);\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tBaseControl: {\n\t\t\t\t// Overrides the underlying BaseControl `__nextHasNoMarginBottom` via the context system\n\t\t\t\t// to provide backwards compatibile margin for SearchControl.\n\t\t\t\t// (In a standard InputControl, the BaseControl `__nextHasNoMarginBottom` is always set to true.)\n\t\t\t\t_overrides: { __nextHasNoMarginBottom },\n\t\t\t\t__associatedWPComponentName: 'SearchControl',\n\t\t\t},\n\t\t\t// `isBorderless` is still experimental and not a public prop for InputControl yet.\n\t\t\tInputBase: { isBorderless: true },\n\t\t} ),\n\t\t[ __nextHasNoMarginBottom ]\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextValue }>\n\t\t\t<StyledInputControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tid={ instanceId }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tlabel={ label }\n\t\t\t\tref={ useMergeRefs( [ searchRef, forwardedRef ] ) }\n\t\t\t\ttype=\"search\"\n\t\t\t\tsize={ size }\n\t\t\t\tclassName={ clsx( 'components-search-control', className ) }\n\t\t\t\tonChange={ ( nextValue?: string ) =>\n\t\t\t\t\tonChange( nextValue ?? '' )\n\t\t\t\t}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tvalue={ value ?? '' }\n\t\t\t\tsuffix={\n\t\t\t\t\t<SuffixItemWrapper size={ size }>\n\t\t\t\t\t\t<SuffixItem\n\t\t\t\t\t\t\tsearchRef={ searchRef }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SuffixItemWrapper>\n\t\t\t\t}\n\t\t\t\t{ ...filteredRestProps }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * SearchControl components let users display a search control.\n *\n * ```jsx\n * import { SearchControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function MySearchControl( { className, setState } ) {\n * const [ searchInput, setSearchInput ] = useState( '' );\n *\n * return (\n * <SearchControl\n * __nextHasNoMarginBottom\n * value={ searchInput }\n * onChange={ setSearchInput }\n * />\n * );\n * }\n * ```\n */\nexport const SearchControl = forwardRef( UnforwardedSearchControl );\n\nexport default SearchControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AAIA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAiE,IAAAS,WAAA,GAAAT,OAAA;AAtBjE;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAQA,SAASU,UAAUA,CAAE;EACpBC,SAAS;EACTC,KAAK;EACLC,QAAQ;EACRC;AACgB,CAAC,EAAG;EACpB,IAAK,CAAEA,OAAO,IAAI,CAAEF,KAAK,EAAG;IAC3B,oBAAO,IAAAH,WAAA,CAAAM,GAAA,EAACZ,MAAA,CAAAa,IAAI;MAACC,IAAI,EAAGC;IAAQ,CAAE,CAAC;EAChC;EAEA,IAAKJ,OAAO,EAAG;IACd,IAAAK,mBAAU,EAAE,+CAA+C,EAAE;MAC5DC,KAAK,EAAE;IACR,CAAE,CAAC;EACJ;EAEA,MAAMC,OAAO,GAAGA,CAAA,KAAM;IACrBR,QAAQ,CAAE,EAAG,CAAC;IACdF,SAAS,CAACW,OAAO,EAAEC,KAAK,CAAC,CAAC;EAC3B,CAAC;EAED,oBACC,IAAAd,WAAA,CAAAM,GAAA,EAACT,OAAA,CAAAkB,OAAM;IACNC,IAAI,EAAC,OAAO;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mBAAqB;MAC3CP,KAAK,EAAGA,KAAO;MACf4B,GAAG,EAAG,IAAAC,qBAAY,EAAE,CAAE7C,SAAS,EAAEyB,YAAY,CAAG,CAAG;MACnDqB,IAAI,EAAC,QAAQ;MACbhC,IAAI,EAAGA,IAAM;MACbO,SAAS,EAAG,IAAA0B,aAAI,EAAE,2BAA2B,EAAE1B,SAAU,CAAG;MAC5DnB,QAAQ,EAAK8C,SAAkB,IAC9B9C,QAAQ,CAAE8C,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAG,CAC1B;MACDC,YAAY,EAAC,KAAK;MAClB3B,WAAW,EAAGA,WAAa;MAC3BrB,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAI;MACrBiD,MAAM,eACL,IAAApD,WAAA,CAAAM,GAAA,EAACP,OAAA,CAAAsD,iBAAiB;QAACrC,IAAI,EAAGA,IAAM;QAAA0B,QAAA,eAC/B,IAAA1C,WAAA,CAAAM,GAAA,EAACL,UAAU;UACVC,SAAS,EAAGA,SAAW;UACvBC,KAAK,EAAGA,KAAO;UACfC,QAAQ,EAAGA,QAAU;UACrBC,OAAO,EAAGA;QAAS,CACnB;MAAC,CACgB,CACnB;MAAA,GACIwB;IAAiB,CACtB;EAAC,CACoB,CAAC;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,aAAa,GAAAqB,OAAA,CAAArB,aAAA,GAAG,IAAAsB,mBAAU,EAAElC,wBAAyB,CAAC;AAAC,IAAAmC,QAAA,GAAAF,OAAA,CAAAvC,OAAA,GAErDkB,aAAa","ignoreList":[]}
@@ -88,9 +88,7 @@ function SearchControl({
88
88
  mergeFutureStyles(darkStyles, [isDark]);
89
89
  mergeFutureStyles(activeDarkStyles, [isActive, isDark]);
90
90
  setCurrentStyles(futureStyles);
91
- // Disable reason: deferring this refactor to the native team.
92
- // see https://github.com/WordPress/gutenberg/pull/41166
93
- // eslint-disable-next-line react-hooks/exhaustive-deps
91
+ // See https://github.com/WordPress/gutenberg/pull/41166
94
92
  }, [isActive, isDark]);
95
93
  const clearInput = (0, _element.useCallback)(() => {
96
94
  onChange('');