@wordpress/components 23.3.2 → 23.4.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 (710) hide show
  1. package/CHANGELOG.md +20 -5
  2. package/build/alignment-matrix-control/utils.js +4 -4
  3. package/build/alignment-matrix-control/utils.js.map +1 -1
  4. package/build/angle-picker-control/angle-circle.js +37 -29
  5. package/build/angle-picker-control/angle-circle.js.map +1 -1
  6. package/build/angle-picker-control/index.js +44 -9
  7. package/build/angle-picker-control/index.js.map +1 -1
  8. package/build/angle-picker-control/styles/angle-picker-control-styles.js +13 -13
  9. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  10. package/build/{base-field → angle-picker-control}/types.js +0 -0
  11. package/build/angle-picker-control/types.js.map +1 -0
  12. package/build/autocomplete/autocompleter-ui.native.js +1 -0
  13. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  14. package/build/base-control/hooks.js +1 -1
  15. package/build/base-control/hooks.js.map +1 -1
  16. package/build/border-box-control/utils.js +1 -1
  17. package/build/border-box-control/utils.js.map +1 -1
  18. package/build/box-control/all-input-control.js +2 -2
  19. package/build/box-control/all-input-control.js.map +1 -1
  20. package/build/box-control/axial-input-controls.js +1 -1
  21. package/build/box-control/axial-input-controls.js.map +1 -1
  22. package/build/box-control/icon.js.map +1 -1
  23. package/build/box-control/index.js +32 -3
  24. package/build/box-control/index.js.map +1 -1
  25. package/build/box-control/input-controls.js +5 -5
  26. package/build/box-control/input-controls.js.map +1 -1
  27. package/build/box-control/linked-button.js.map +1 -1
  28. package/build/box-control/styles/box-control-icon-styles.js +28 -28
  29. package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
  30. package/build/box-control/styles/box-control-styles.js +23 -23
  31. package/build/box-control/styles/box-control-styles.js.map +1 -1
  32. package/build/box-control/styles/box-control-visualizer-styles.js +19 -19
  33. package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  34. package/build/box-control/types.js +6 -0
  35. package/build/box-control/types.js.map +1 -0
  36. package/build/box-control/unit-control.js.map +1 -1
  37. package/build/box-control/utils.js +23 -23
  38. package/build/box-control/utils.js.map +1 -1
  39. package/build/color-palette/index.js +8 -3
  40. package/build/color-palette/index.js.map +1 -1
  41. package/build/combobox-control/index.js +68 -12
  42. package/build/combobox-control/index.js.map +1 -1
  43. package/build/combobox-control/styles.js +2 -2
  44. package/build/combobox-control/styles.js.map +1 -1
  45. package/build/combobox-control/types.js +6 -0
  46. package/build/combobox-control/types.js.map +1 -0
  47. package/build/custom-gradient-picker/index.js +0 -1
  48. package/build/custom-gradient-picker/index.js.map +1 -1
  49. package/build/date-time/time/index.js +1 -1
  50. package/build/date-time/time/index.js.map +1 -1
  51. package/build/date-time/utils.js +1 -1
  52. package/build/date-time/utils.js.map +1 -1
  53. package/build/draggable/index.js +2 -2
  54. package/build/draggable/index.js.map +1 -1
  55. package/build/focal-point-picker/utils.js +3 -3
  56. package/build/focal-point-picker/utils.js.map +1 -1
  57. package/build/font-size-picker/utils.js +2 -2
  58. package/build/font-size-picker/utils.js.map +1 -1
  59. package/build/gradient-picker/index.js +9 -4
  60. package/build/gradient-picker/index.js.map +1 -1
  61. package/build/input-control/reducer/reducer.js +5 -5
  62. package/build/input-control/reducer/reducer.js.map +1 -1
  63. package/build/input-control/utils.js +1 -1
  64. package/build/input-control/utils.js.map +1 -1
  65. package/build/menu-items-choice/index.js +40 -3
  66. package/build/menu-items-choice/index.js.map +1 -1
  67. package/build/menu-items-choice/types.js +6 -0
  68. package/build/menu-items-choice/types.js.map +1 -0
  69. package/build/modal/index.js +41 -3
  70. package/build/modal/index.js.map +1 -1
  71. package/build/palette-edit/index.js +4 -1
  72. package/build/palette-edit/index.js.map +1 -1
  73. package/build/panel/header.js +9 -0
  74. package/build/panel/header.js.map +1 -1
  75. package/build/panel/index.js +21 -3
  76. package/build/panel/index.js.map +1 -1
  77. package/build/panel/row.js +10 -4
  78. package/build/panel/row.js.map +1 -1
  79. package/build/panel/types.js +6 -0
  80. package/build/panel/types.js.map +1 -0
  81. package/build/popover/index.js +15 -3
  82. package/build/popover/index.js.map +1 -1
  83. package/build/popover/overlay-middlewares.js +46 -0
  84. package/build/popover/overlay-middlewares.js.map +1 -0
  85. package/build/popover/utils.js +45 -6
  86. package/build/popover/utils.js.map +1 -1
  87. package/build/query-controls/terms.js +1 -1
  88. package/build/query-controls/terms.js.map +1 -1
  89. package/build/range-control/utils.js +4 -4
  90. package/build/range-control/utils.js.map +1 -1
  91. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +12 -12
  92. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  93. package/build/resizable-box/resize-tooltip/utils.js +14 -14
  94. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  95. package/build/snackbar/index.js +2 -2
  96. package/build/snackbar/index.js.map +1 -1
  97. package/build/toolbar/toolbar/index.js +25 -14
  98. package/build/toolbar/toolbar/index.js.map +1 -1
  99. package/build/toolbar/toolbar/toolbar-container.js +5 -4
  100. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  101. package/build/toolbar/toolbar/types.js +6 -0
  102. package/build/toolbar/toolbar/types.js.map +1 -0
  103. package/build/toolbar/toolbar-button/index.js +2 -0
  104. package/build/toolbar/toolbar-button/index.js.map +1 -1
  105. package/build/toolbar/toolbar-button/toolbar-button-container.js +1 -0
  106. package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  107. package/build/toolbar/toolbar-context/index.js +2 -0
  108. package/build/toolbar/toolbar-context/index.js.map +1 -1
  109. package/build/toolbar/toolbar-dropdown-menu/index.js +2 -0
  110. package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  111. package/build/toolbar/toolbar-group/index.js +2 -0
  112. package/build/toolbar/toolbar-group/index.js.map +1 -1
  113. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +2 -0
  114. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  115. package/build/toolbar/toolbar-group/toolbar-group-container.js +1 -0
  116. package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  117. package/build/toolbar/toolbar-item/index.js +2 -0
  118. package/build/toolbar/toolbar-item/index.js.map +1 -1
  119. package/build/tools-panel/tools-panel/component.js +61 -5
  120. package/build/tools-panel/tools-panel/component.js.map +1 -1
  121. package/build/tools-panel/tools-panel/hook.js +4 -2
  122. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  123. package/build/tools-panel/tools-panel-header/component.js +2 -1
  124. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  125. package/build/tools-panel/tools-panel-header/hook.js +2 -0
  126. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  127. package/build/tools-panel/tools-panel-item/component.js +5 -4
  128. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  129. package/build/tools-panel/tools-panel-item/hook.js +4 -2
  130. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  131. package/build/tree-grid/cell.js +15 -4
  132. package/build/tree-grid/cell.js.map +1 -1
  133. package/build/tree-grid/index.js +81 -19
  134. package/build/tree-grid/index.js.map +1 -1
  135. package/build/tree-grid/item.js +14 -3
  136. package/build/tree-grid/item.js.map +1 -1
  137. package/build/tree-grid/roving-tab-index-context.js +1 -1
  138. package/build/tree-grid/roving-tab-index-context.js.map +1 -1
  139. package/build/tree-grid/roving-tab-index-item.js +13 -6
  140. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  141. package/build/tree-grid/roving-tab-index.js +0 -3
  142. package/build/tree-grid/roving-tab-index.js.map +1 -1
  143. package/build/tree-grid/row.js +20 -18
  144. package/build/tree-grid/row.js.map +1 -1
  145. package/build/tree-grid/types.js +6 -0
  146. package/build/tree-grid/types.js.map +1 -0
  147. package/build/ui/context/context-connect.js +7 -7
  148. package/build/ui/context/context-connect.js.map +1 -1
  149. package/build/ui/context/get-styled-class-name-from-key.js +1 -1
  150. package/build/ui/context/get-styled-class-name-from-key.js.map +1 -1
  151. package/build/ui/utils/get-valid-children.js +1 -1
  152. package/build/ui/utils/get-valid-children.js.map +1 -1
  153. package/build/ui/utils/space.js +1 -1
  154. package/build/ui/utils/space.js.map +1 -1
  155. package/build/unit-control/index.js +2 -2
  156. package/build/unit-control/index.js.map +1 -1
  157. package/build/unit-control/utils.js +20 -20
  158. package/build/unit-control/utils.js.map +1 -1
  159. package/build/utils/events.js +4 -4
  160. package/build/utils/events.js.map +1 -1
  161. package/build/utils/hooks/use-controlled-state.js +2 -2
  162. package/build/utils/hooks/use-controlled-state.js.map +1 -1
  163. package/build/utils/hooks/use-controlled-value.js +4 -4
  164. package/build/utils/hooks/use-controlled-value.js.map +1 -1
  165. package/build/utils/hooks/use-latest-ref.js +1 -1
  166. package/build/utils/hooks/use-latest-ref.js.map +1 -1
  167. package/build/utils/unit-values.js +3 -3
  168. package/build/utils/unit-values.js.map +1 -1
  169. package/build-module/alignment-matrix-control/utils.js +4 -4
  170. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  171. package/build-module/angle-picker-control/angle-circle.js +37 -29
  172. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  173. package/build-module/angle-picker-control/index.js +42 -8
  174. package/build-module/angle-picker-control/index.js.map +1 -1
  175. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -13
  176. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  177. package/build-module/{base-field → angle-picker-control}/types.js +0 -0
  178. package/build-module/{base-field → angle-picker-control}/types.js.map +0 -0
  179. package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
  180. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  181. package/build-module/base-control/hooks.js +1 -1
  182. package/build-module/base-control/hooks.js.map +1 -1
  183. package/build-module/border-box-control/utils.js +1 -1
  184. package/build-module/border-box-control/utils.js.map +1 -1
  185. package/build-module/box-control/all-input-control.js +2 -2
  186. package/build-module/box-control/all-input-control.js.map +1 -1
  187. package/build-module/box-control/axial-input-controls.js +1 -1
  188. package/build-module/box-control/axial-input-controls.js.map +1 -1
  189. package/build-module/box-control/icon.js.map +1 -1
  190. package/build-module/box-control/index.js +31 -3
  191. package/build-module/box-control/index.js.map +1 -1
  192. package/build-module/box-control/input-controls.js +5 -5
  193. package/build-module/box-control/input-controls.js.map +1 -1
  194. package/build-module/box-control/linked-button.js.map +1 -1
  195. package/build-module/box-control/styles/box-control-icon-styles.js +28 -28
  196. package/build-module/box-control/styles/box-control-icon-styles.js.map +1 -1
  197. package/build-module/box-control/styles/box-control-styles.js +23 -23
  198. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  199. package/build-module/box-control/styles/box-control-visualizer-styles.js +19 -19
  200. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  201. package/build-module/box-control/types.js +2 -0
  202. package/{build/base-field → build-module/box-control}/types.js.map +0 -0
  203. package/build-module/box-control/unit-control.js.map +1 -1
  204. package/build-module/box-control/utils.js +23 -23
  205. package/build-module/box-control/utils.js.map +1 -1
  206. package/build-module/color-palette/index.js +8 -3
  207. package/build-module/color-palette/index.js.map +1 -1
  208. package/build-module/combobox-control/index.js +68 -12
  209. package/build-module/combobox-control/index.js.map +1 -1
  210. package/build-module/combobox-control/styles.js +2 -2
  211. package/build-module/combobox-control/styles.js.map +1 -1
  212. package/build-module/combobox-control/types.js +2 -0
  213. package/build-module/{resizable-box/styles/resizable-box.styles.js.map → combobox-control/types.js.map} +0 -0
  214. package/build-module/custom-gradient-picker/index.js +0 -1
  215. package/build-module/custom-gradient-picker/index.js.map +1 -1
  216. package/build-module/date-time/time/index.js +1 -1
  217. package/build-module/date-time/time/index.js.map +1 -1
  218. package/build-module/date-time/utils.js +1 -1
  219. package/build-module/date-time/utils.js.map +1 -1
  220. package/build-module/draggable/index.js +2 -2
  221. package/build-module/draggable/index.js.map +1 -1
  222. package/build-module/focal-point-picker/utils.js +3 -3
  223. package/build-module/focal-point-picker/utils.js.map +1 -1
  224. package/build-module/font-size-picker/utils.js +2 -2
  225. package/build-module/font-size-picker/utils.js.map +1 -1
  226. package/build-module/gradient-picker/index.js +9 -4
  227. package/build-module/gradient-picker/index.js.map +1 -1
  228. package/build-module/input-control/reducer/reducer.js +5 -5
  229. package/build-module/input-control/reducer/reducer.js.map +1 -1
  230. package/build-module/input-control/utils.js +1 -1
  231. package/build-module/input-control/utils.js.map +1 -1
  232. package/build-module/menu-items-choice/index.js +40 -4
  233. package/build-module/menu-items-choice/index.js.map +1 -1
  234. package/build-module/menu-items-choice/types.js +2 -0
  235. package/{build/resizable-box/styles/resizable-box.styles.js.map → build-module/menu-items-choice/types.js.map} +0 -0
  236. package/build-module/modal/index.js +41 -4
  237. package/build-module/modal/index.js.map +1 -1
  238. package/build-module/palette-edit/index.js +4 -1
  239. package/build-module/palette-edit/index.js.map +1 -1
  240. package/build-module/panel/header.js +9 -0
  241. package/build-module/panel/header.js.map +1 -1
  242. package/build-module/panel/index.js +20 -2
  243. package/build-module/panel/index.js.map +1 -1
  244. package/build-module/panel/row.js +9 -3
  245. package/build-module/panel/row.js.map +1 -1
  246. package/build-module/panel/types.js +2 -0
  247. package/build-module/panel/types.js.map +1 -0
  248. package/build-module/popover/index.js +14 -4
  249. package/build-module/popover/index.js.map +1 -1
  250. package/build-module/popover/overlay-middlewares.js +38 -0
  251. package/build-module/popover/overlay-middlewares.js.map +1 -0
  252. package/build-module/popover/utils.js +41 -5
  253. package/build-module/popover/utils.js.map +1 -1
  254. package/build-module/query-controls/terms.js +1 -1
  255. package/build-module/query-controls/terms.js.map +1 -1
  256. package/build-module/range-control/utils.js +4 -4
  257. package/build-module/range-control/utils.js.map +1 -1
  258. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +12 -12
  259. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  260. package/build-module/resizable-box/resize-tooltip/utils.js +14 -14
  261. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  262. package/build-module/snackbar/index.js +2 -2
  263. package/build-module/snackbar/index.js.map +1 -1
  264. package/build-module/toolbar/toolbar/index.js +25 -13
  265. package/build-module/toolbar/toolbar/index.js.map +1 -1
  266. package/build-module/toolbar/toolbar/toolbar-container.js +4 -3
  267. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  268. package/build-module/toolbar/toolbar/types.js +2 -0
  269. package/build-module/toolbar/toolbar/types.js.map +1 -0
  270. package/build-module/toolbar/toolbar-button/index.js +1 -0
  271. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  272. package/build-module/toolbar/toolbar-button/toolbar-button-container.js +1 -0
  273. package/build-module/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  274. package/build-module/toolbar/toolbar-context/index.js +2 -0
  275. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  276. package/build-module/toolbar/toolbar-dropdown-menu/index.js +1 -0
  277. package/build-module/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  278. package/build-module/toolbar/toolbar-group/index.js +1 -0
  279. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  280. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js +1 -0
  281. package/build-module/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  282. package/build-module/toolbar/toolbar-group/toolbar-group-container.js +1 -0
  283. package/build-module/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  284. package/build-module/toolbar/toolbar-item/index.js +1 -0
  285. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  286. package/build-module/tools-panel/tools-panel/component.js +59 -4
  287. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  288. package/build-module/tools-panel/tools-panel/hook.js +4 -2
  289. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  290. package/build-module/tools-panel/tools-panel-header/component.js +2 -1
  291. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  292. package/build-module/tools-panel/tools-panel-header/hook.js +2 -0
  293. package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
  294. package/build-module/tools-panel/tools-panel-item/component.js +3 -3
  295. package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
  296. package/build-module/tools-panel/tools-panel-item/hook.js +5 -2
  297. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  298. package/build-module/tree-grid/cell.js +16 -4
  299. package/build-module/tree-grid/cell.js.map +1 -1
  300. package/build-module/tree-grid/index.js +81 -21
  301. package/build-module/tree-grid/index.js.map +1 -1
  302. package/build-module/tree-grid/item.js +14 -2
  303. package/build-module/tree-grid/item.js.map +1 -1
  304. package/build-module/tree-grid/roving-tab-index-context.js +1 -1
  305. package/build-module/tree-grid/roving-tab-index-context.js.map +1 -1
  306. package/build-module/tree-grid/roving-tab-index-item.js +11 -4
  307. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  308. package/build-module/tree-grid/roving-tab-index.js +0 -3
  309. package/build-module/tree-grid/roving-tab-index.js.map +1 -1
  310. package/build-module/tree-grid/row.js +22 -17
  311. package/build-module/tree-grid/row.js.map +1 -1
  312. package/build-module/tree-grid/types.js +2 -0
  313. package/build-module/tree-grid/types.js.map +1 -0
  314. package/build-module/ui/context/context-connect.js +7 -7
  315. package/build-module/ui/context/context-connect.js.map +1 -1
  316. package/build-module/ui/context/get-styled-class-name-from-key.js +1 -1
  317. package/build-module/ui/context/get-styled-class-name-from-key.js.map +1 -1
  318. package/build-module/ui/utils/get-valid-children.js +1 -1
  319. package/build-module/ui/utils/get-valid-children.js.map +1 -1
  320. package/build-module/ui/utils/space.js +1 -1
  321. package/build-module/ui/utils/space.js.map +1 -1
  322. package/build-module/unit-control/index.js +2 -2
  323. package/build-module/unit-control/index.js.map +1 -1
  324. package/build-module/unit-control/utils.js +20 -20
  325. package/build-module/unit-control/utils.js.map +1 -1
  326. package/build-module/utils/events.js +4 -4
  327. package/build-module/utils/events.js.map +1 -1
  328. package/build-module/utils/hooks/use-controlled-state.js +2 -2
  329. package/build-module/utils/hooks/use-controlled-state.js.map +1 -1
  330. package/build-module/utils/hooks/use-controlled-value.js +4 -4
  331. package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
  332. package/build-module/utils/hooks/use-latest-ref.js +1 -1
  333. package/build-module/utils/hooks/use-latest-ref.js.map +1 -1
  334. package/build-module/utils/unit-values.js +3 -3
  335. package/build-module/utils/unit-values.js.map +1 -1
  336. package/build-style/style-rtl.css +5 -0
  337. package/build-style/style.css +5 -0
  338. package/build-types/alignment-matrix-control/utils.d.ts +4 -4
  339. package/build-types/angle-picker-control/angle-circle.d.ts +6 -0
  340. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -0
  341. package/build-types/angle-picker-control/index.d.ts +29 -0
  342. package/build-types/angle-picker-control/index.d.ts.map +1 -0
  343. package/build-types/angle-picker-control/stories/index.d.ts +15 -0
  344. package/build-types/angle-picker-control/stories/index.d.ts.map +1 -0
  345. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +20 -0
  346. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -0
  347. package/build-types/angle-picker-control/types.d.ts +26 -0
  348. package/build-types/angle-picker-control/types.d.ts.map +1 -0
  349. package/build-types/base-control/hooks.d.ts +1 -1
  350. package/build-types/border-box-control/border-box-control/component.d.ts +1 -1
  351. package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
  352. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
  353. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +1 -1
  354. package/build-types/border-box-control/stories/index.d.ts +1 -1
  355. package/build-types/{base-field → border-box-control}/test/index.d.ts +0 -0
  356. package/build-types/border-box-control/test/index.d.ts.map +1 -0
  357. package/build-types/border-box-control/test/utils.d.ts +2 -0
  358. package/build-types/border-box-control/test/utils.d.ts.map +1 -0
  359. package/build-types/box-control/all-input-control.d.ts +4 -0
  360. package/build-types/box-control/all-input-control.d.ts.map +1 -0
  361. package/build-types/box-control/axial-input-controls.d.ts +4 -0
  362. package/build-types/box-control/axial-input-controls.d.ts.map +1 -0
  363. package/build-types/box-control/icon.d.ts +8 -0
  364. package/build-types/box-control/icon.d.ts.map +1 -0
  365. package/build-types/box-control/index.d.ts +31 -0
  366. package/build-types/box-control/index.d.ts.map +1 -0
  367. package/build-types/box-control/input-controls.d.ts +4 -0
  368. package/build-types/box-control/input-controls.d.ts.map +1 -0
  369. package/build-types/box-control/linked-button.d.ts +9 -0
  370. package/build-types/box-control/linked-button.d.ts.map +1 -0
  371. package/build-types/box-control/styles/box-control-icon-styles.d.ts +42 -0
  372. package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -0
  373. package/build-types/box-control/styles/box-control-styles.d.ts +42 -0
  374. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -0
  375. package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +46 -0
  376. package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +1 -0
  377. package/build-types/box-control/test/index.d.ts +2 -0
  378. package/build-types/box-control/test/index.d.ts.map +1 -0
  379. package/build-types/box-control/types.d.ts +99 -0
  380. package/build-types/box-control/types.d.ts.map +1 -0
  381. package/build-types/box-control/unit-control.d.ts +4 -0
  382. package/build-types/box-control/unit-control.d.ts.map +1 -0
  383. package/build-types/box-control/utils.d.ts +84 -0
  384. package/build-types/box-control/utils.d.ts.map +1 -0
  385. package/build-types/color-palette/index.d.ts +3 -1
  386. package/build-types/color-palette/index.d.ts.map +1 -1
  387. package/build-types/color-palette/stories/index.d.ts +6 -2
  388. package/build-types/color-palette/stories/index.d.ts.map +1 -1
  389. package/build-types/color-palette/types.d.ts +8 -0
  390. package/build-types/color-palette/types.d.ts.map +1 -1
  391. package/build-types/combobox-control/index.d.ts +51 -0
  392. package/build-types/combobox-control/index.d.ts.map +1 -0
  393. package/build-types/combobox-control/stories/index.d.ts +18 -0
  394. package/build-types/combobox-control/stories/index.d.ts.map +1 -0
  395. package/build-types/combobox-control/styles.d.ts +8 -0
  396. package/build-types/combobox-control/styles.d.ts.map +1 -0
  397. package/build-types/combobox-control/test/index.d.ts +2 -0
  398. package/build-types/combobox-control/test/index.d.ts.map +1 -0
  399. package/build-types/combobox-control/types.d.ts +62 -0
  400. package/build-types/combobox-control/types.d.ts.map +1 -0
  401. package/build-types/date-time/utils.d.ts +1 -1
  402. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  403. package/build-types/focal-point-picker/utils.d.ts +3 -3
  404. package/build-types/font-size-picker/utils.d.ts +2 -2
  405. package/build-types/input-control/reducer/reducer.d.ts +3 -3
  406. package/build-types/input-control/utils.d.ts +1 -1
  407. package/build-types/menu-items-choice/index.d.ts +38 -0
  408. package/build-types/menu-items-choice/index.d.ts.map +1 -0
  409. package/build-types/menu-items-choice/stories/index.d.ts +12 -0
  410. package/build-types/menu-items-choice/stories/index.d.ts.map +1 -0
  411. package/build-types/menu-items-choice/types.d.ts +53 -0
  412. package/build-types/menu-items-choice/types.d.ts.map +1 -0
  413. package/build-types/modal/index.d.ts.map +1 -1
  414. package/build-types/modal/types.d.ts +2 -0
  415. package/build-types/modal/types.d.ts.map +1 -1
  416. package/build-types/panel/header.d.ts +13 -0
  417. package/build-types/panel/header.d.ts.map +1 -0
  418. package/build-types/panel/index.d.ts +21 -0
  419. package/build-types/panel/index.d.ts.map +1 -0
  420. package/build-types/panel/row.d.ts +12 -0
  421. package/build-types/panel/row.d.ts.map +1 -0
  422. package/build-types/panel/test/header.d.ts +2 -0
  423. package/build-types/panel/test/header.d.ts.map +1 -0
  424. package/build-types/panel/test/index.d.ts +2 -0
  425. package/build-types/{base-field → panel}/test/index.d.ts.map +1 -1
  426. package/build-types/panel/test/row.d.ts +2 -0
  427. package/build-types/panel/test/row.d.ts.map +1 -0
  428. package/build-types/panel/types.d.ts +38 -0
  429. package/build-types/panel/types.d.ts.map +1 -0
  430. package/build-types/popover/index.d.ts.map +1 -1
  431. package/build-types/popover/overlay-middlewares.d.ts +9 -0
  432. package/build-types/popover/overlay-middlewares.d.ts.map +1 -0
  433. package/build-types/popover/stories/index.d.ts.map +1 -1
  434. package/build-types/popover/types.d.ts +3 -2
  435. package/build-types/popover/types.d.ts.map +1 -1
  436. package/build-types/popover/utils.d.ts +12 -4
  437. package/build-types/popover/utils.d.ts.map +1 -1
  438. package/build-types/query-controls/terms.d.ts +1 -1
  439. package/build-types/range-control/utils.d.ts +4 -4
  440. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +5 -4
  441. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  442. package/build-types/resizable-box/resize-tooltip/utils.d.ts +6 -6
  443. package/build-types/toolbar/index.d.ts +7 -0
  444. package/build-types/toolbar/index.d.ts.map +1 -0
  445. package/build-types/toolbar/stories/index.d.ts +14 -0
  446. package/build-types/toolbar/stories/index.d.ts.map +1 -0
  447. package/build-types/toolbar/test/index.d.ts +2 -0
  448. package/build-types/toolbar/test/index.d.ts.map +1 -0
  449. package/build-types/toolbar/test/toolbar-group.d.ts +2 -0
  450. package/build-types/toolbar/test/toolbar-group.d.ts.map +1 -0
  451. package/build-types/toolbar/toolbar/index.d.ts +25 -0
  452. package/build-types/toolbar/toolbar/index.d.ts.map +1 -0
  453. package/build-types/toolbar/toolbar/toolbar-container.d.ts +5 -0
  454. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -0
  455. package/build-types/toolbar/toolbar/types.d.ts +15 -0
  456. package/build-types/toolbar/toolbar/types.d.ts.map +1 -0
  457. package/build-types/toolbar/toolbar-button/index.d.ts +12 -0
  458. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -0
  459. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +3 -0
  460. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -0
  461. package/build-types/toolbar/toolbar-context/index.d.ts +3 -0
  462. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -0
  463. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +3 -0
  464. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -0
  465. package/build-types/toolbar/toolbar-group/index.d.ts +39 -0
  466. package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -0
  467. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +7 -0
  468. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -0
  469. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +7 -0
  470. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -0
  471. package/build-types/toolbar/toolbar-item/index.d.ts +7 -0
  472. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -0
  473. package/build-types/tools-panel/stories/index.d.ts +17 -0
  474. package/build-types/tools-panel/stories/index.d.ts.map +1 -0
  475. package/build-types/tools-panel/tools-panel/component.d.ts +54 -2
  476. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  477. package/build-types/tools-panel/tools-panel/hook.d.ts +2 -1
  478. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  479. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  480. package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -1
  481. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  482. package/build-types/tools-panel/tools-panel-item/component.d.ts +2 -2
  483. package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
  484. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  485. package/build-types/tools-panel/types.d.ts +42 -15
  486. package/build-types/tools-panel/types.d.ts.map +1 -1
  487. package/build-types/tree-grid/cell.d.ts +13 -0
  488. package/build-types/tree-grid/cell.d.ts.map +1 -0
  489. package/build-types/tree-grid/index.d.ts +70 -0
  490. package/build-types/tree-grid/index.d.ts.map +1 -0
  491. package/build-types/tree-grid/item.d.ts +12 -0
  492. package/build-types/tree-grid/item.d.ts.map +1 -0
  493. package/build-types/tree-grid/roving-tab-index-context.d.ts +10 -0
  494. package/build-types/tree-grid/roving-tab-index-context.d.ts.map +1 -0
  495. package/build-types/tree-grid/roving-tab-index-item.d.ts +5 -0
  496. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -0
  497. package/build-types/tree-grid/roving-tab-index.d.ts +10 -0
  498. package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -0
  499. package/build-types/tree-grid/row.d.ts +12 -0
  500. package/build-types/tree-grid/row.d.ts.map +1 -0
  501. package/build-types/tree-grid/stories/index.d.ts +13 -0
  502. package/build-types/tree-grid/stories/index.d.ts.map +1 -0
  503. package/build-types/tree-grid/test/cell.d.ts +2 -0
  504. package/build-types/tree-grid/test/cell.d.ts.map +1 -0
  505. package/build-types/tree-grid/test/index.d.ts +2 -0
  506. package/build-types/tree-grid/test/index.d.ts.map +1 -0
  507. package/build-types/tree-grid/test/roving-tab-index-item.d.ts +2 -0
  508. package/build-types/tree-grid/test/roving-tab-index-item.d.ts.map +1 -0
  509. package/build-types/tree-grid/test/roving-tab-index.d.ts +2 -0
  510. package/build-types/tree-grid/test/roving-tab-index.d.ts.map +1 -0
  511. package/build-types/tree-grid/test/row.d.ts +2 -0
  512. package/build-types/tree-grid/test/row.d.ts.map +1 -0
  513. package/build-types/tree-grid/types.d.ts +109 -0
  514. package/build-types/tree-grid/types.d.ts.map +1 -0
  515. package/build-types/ui/context/context-connect.d.ts +7 -7
  516. package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -1
  517. package/build-types/ui/utils/get-valid-children.d.ts +1 -1
  518. package/build-types/ui/utils/space.d.ts +1 -1
  519. package/build-types/unit-control/index.d.ts +1 -1
  520. package/build-types/unit-control/utils.d.ts +20 -20
  521. package/build-types/utils/events.d.ts +2 -2
  522. package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
  523. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  524. package/build-types/utils/hooks/use-controlled-value.d.ts +4 -4
  525. package/build-types/utils/hooks/use-latest-ref.d.ts +1 -1
  526. package/build-types/utils/unit-values.d.ts +3 -3
  527. package/package.json +19 -19
  528. package/src/alignment-matrix-control/utils.tsx +4 -4
  529. package/src/angle-picker-control/README.md +17 -14
  530. package/src/angle-picker-control/{angle-circle.js → angle-circle.tsx} +44 -12
  531. package/src/angle-picker-control/{index.js → index.tsx} +54 -10
  532. package/src/angle-picker-control/stories/index.tsx +57 -0
  533. package/src/angle-picker-control/styles/{angle-picker-control-styles.js → angle-picker-control-styles.tsx} +5 -1
  534. package/src/angle-picker-control/types.ts +29 -0
  535. package/src/autocomplete/autocompleter-ui.native.js +1 -0
  536. package/src/base-control/hooks.ts +1 -1
  537. package/src/border-box-control/test/{index.js → index.tsx} +76 -102
  538. package/src/border-box-control/test/{utils.js → utils.ts} +20 -0
  539. package/src/border-box-control/utils.ts +1 -1
  540. package/src/box-control/README.md +17 -26
  541. package/src/box-control/{all-input-control.js → all-input-control.tsx} +10 -6
  542. package/src/box-control/{axial-input-controls.js → axial-input-controls.tsx} +29 -24
  543. package/src/box-control/{icon.js → icon.tsx} +9 -4
  544. package/src/box-control/{index.js → index.tsx} +43 -8
  545. package/src/box-control/{input-controls.js → input-controls.tsx} +26 -16
  546. package/src/box-control/{linked-button.js → linked-button.tsx} +4 -1
  547. package/src/box-control/styles/{box-control-icon-styles.js → box-control-icon-styles.ts} +1 -1
  548. package/src/box-control/styles/{box-control-styles.js → box-control-styles.ts} +10 -2
  549. package/src/box-control/styles/{box-control-visualizer-styles.js → box-control-visualizer-styles.ts} +6 -2
  550. package/src/box-control/test/{index.js → index.tsx} +12 -9
  551. package/src/box-control/types.ts +121 -0
  552. package/src/box-control/{unit-control.js → unit-control.tsx} +9 -2
  553. package/src/box-control/{utils.js → utils.ts} +47 -38
  554. package/src/button/test/index.tsx +38 -30
  555. package/src/color-palette/README.md +7 -0
  556. package/src/color-palette/index.tsx +6 -1
  557. package/src/color-palette/types.ts +8 -0
  558. package/src/combobox-control/README.md +8 -15
  559. package/src/combobox-control/{index.js → index.tsx} +91 -19
  560. package/src/combobox-control/stories/index.tsx +114 -0
  561. package/src/combobox-control/styles.ts +4 -1
  562. package/src/combobox-control/test/{index.js → index.tsx} +9 -7
  563. package/src/combobox-control/types.ts +69 -0
  564. package/src/custom-gradient-picker/index.js +0 -1
  565. package/src/custom-select-control/stories/index.js +1 -1
  566. package/src/date-time/time/index.tsx +1 -1
  567. package/src/date-time/utils.ts +1 -1
  568. package/src/draggable/index.tsx +2 -2
  569. package/src/dropdown-menu/test/index.js +3 -11
  570. package/src/focal-point-picker/utils.ts +3 -3
  571. package/src/font-size-picker/utils.ts +2 -2
  572. package/src/gradient-picker/README.md +8 -0
  573. package/src/gradient-picker/index.js +6 -1
  574. package/src/input-control/reducer/reducer.ts +5 -5
  575. package/src/input-control/utils.ts +1 -1
  576. package/src/menu-items-choice/index.tsx +83 -0
  577. package/src/menu-items-choice/stories/index.tsx +79 -0
  578. package/src/menu-items-choice/types.ts +54 -0
  579. package/src/modal/index.tsx +45 -1
  580. package/src/modal/style.scss +8 -0
  581. package/src/modal/types.ts +2 -0
  582. package/src/palette-edit/index.js +4 -1
  583. package/src/panel/README.md +2 -2
  584. package/src/panel/header.tsx +20 -0
  585. package/src/panel/index.tsx +48 -0
  586. package/src/panel/row.tsx +37 -0
  587. package/src/panel/stories/index.js +22 -0
  588. package/src/panel/test/__snapshots__/{header.js.snap → header.tsx.snap} +0 -0
  589. package/src/panel/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  590. package/src/panel/test/__snapshots__/{row.js.snap → row.tsx.snap} +0 -0
  591. package/src/panel/test/{header.js → header.tsx} +1 -1
  592. package/src/panel/test/{index.js → index.tsx} +6 -4
  593. package/src/panel/test/{row.js → row.tsx} +4 -2
  594. package/src/panel/types.ts +38 -0
  595. package/src/popover/README.md +4 -1
  596. package/src/popover/index.tsx +17 -1
  597. package/src/popover/overlay-middlewares.tsx +29 -0
  598. package/src/popover/stories/index.tsx +7 -1
  599. package/src/popover/test/index.tsx +29 -21
  600. package/src/popover/types.ts +4 -2
  601. package/src/popover/utils.ts +39 -3
  602. package/src/query-controls/terms.ts +1 -1
  603. package/src/range-control/utils.ts +4 -4
  604. package/src/resizable-box/resize-tooltip/styles/{resize-tooltip.styles.js → resize-tooltip.styles.ts} +0 -0
  605. package/src/resizable-box/resize-tooltip/utils.ts +14 -14
  606. package/src/snackbar/index.tsx +2 -2
  607. package/src/toolbar/stories/{index.js → index.tsx} +39 -26
  608. package/src/toolbar/test/{index.js → index.tsx} +0 -0
  609. package/src/toolbar/test/{toolbar-group.js → toolbar-group.tsx} +2 -2
  610. package/src/toolbar/toolbar/README.md +7 -2
  611. package/src/toolbar/toolbar/{index.js → index.tsx} +33 -12
  612. package/src/toolbar/toolbar/{toolbar-container.js → toolbar-container.tsx} +9 -2
  613. package/src/toolbar/toolbar/types.ts +15 -0
  614. package/src/toolbar/toolbar-button/index.js +2 -0
  615. package/src/toolbar/toolbar-button/toolbar-button-container.js +2 -0
  616. package/src/toolbar/toolbar-context/index.js +2 -0
  617. package/src/toolbar/toolbar-dropdown-menu/index.js +2 -0
  618. package/src/toolbar/toolbar-group/index.js +2 -0
  619. package/src/toolbar/toolbar-group/toolbar-group-collapsed.js +2 -0
  620. package/src/toolbar/toolbar-group/toolbar-group-container.js +2 -0
  621. package/src/toolbar/toolbar-item/index.js +2 -0
  622. package/src/tools-panel/stories/{index.js → index.tsx} +196 -95
  623. package/src/tools-panel/test/index.js +6 -6
  624. package/src/tools-panel/tools-panel/README.md +12 -4
  625. package/src/tools-panel/tools-panel/component.tsx +57 -3
  626. package/src/tools-panel/tools-panel/hook.ts +4 -2
  627. package/src/tools-panel/tools-panel-header/README.md +7 -0
  628. package/src/tools-panel/tools-panel-header/component.tsx +2 -1
  629. package/src/tools-panel/tools-panel-header/hook.ts +6 -4
  630. package/src/tools-panel/tools-panel-item/README.md +6 -4
  631. package/src/tools-panel/tools-panel-item/component.tsx +4 -4
  632. package/src/tools-panel/tools-panel-item/hook.ts +4 -2
  633. package/src/tools-panel/types.ts +43 -15
  634. package/src/tree-grid/README.md +18 -58
  635. package/src/tree-grid/cell.tsx +41 -0
  636. package/src/tree-grid/{index.js → index.tsx} +111 -35
  637. package/src/tree-grid/item.tsx +32 -0
  638. package/src/tree-grid/{roving-tab-index-context.js → roving-tab-index-context.ts} +9 -1
  639. package/src/tree-grid/roving-tab-index-item.tsx +50 -0
  640. package/src/tree-grid/{roving-tab-index.js → roving-tab-index.tsx} +7 -5
  641. package/src/tree-grid/row.tsx +47 -0
  642. package/src/tree-grid/stories/index.tsx +144 -0
  643. package/src/tree-grid/test/__snapshots__/{cell.js.snap → cell.tsx.snap} +0 -0
  644. package/src/tree-grid/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  645. package/src/tree-grid/test/__snapshots__/{roving-tab-index-item.js.snap → roving-tab-index-item.tsx.snap} +0 -0
  646. package/src/tree-grid/test/__snapshots__/{roving-tab-index.js.snap → roving-tab-index.tsx.snap} +0 -0
  647. package/src/tree-grid/test/__snapshots__/{row.js.snap → row.tsx.snap} +0 -0
  648. package/src/tree-grid/test/{cell.js → cell.tsx} +7 -4
  649. package/src/tree-grid/test/{index.js → index.tsx} +13 -5
  650. package/src/tree-grid/test/{roving-tab-index-item.js → roving-tab-index-item.tsx} +7 -4
  651. package/src/tree-grid/test/{roving-tab-index.js → roving-tab-index.tsx} +0 -0
  652. package/src/tree-grid/test/{row.js → row.tsx} +4 -4
  653. package/src/tree-grid/types.ts +116 -0
  654. package/src/ui/context/context-connect.ts +7 -7
  655. package/src/ui/context/get-styled-class-name-from-key.ts +1 -1
  656. package/src/ui/utils/get-valid-children.ts +1 -1
  657. package/src/ui/utils/space.ts +1 -1
  658. package/src/unit-control/index.tsx +2 -2
  659. package/src/unit-control/utils.ts +20 -20
  660. package/src/utils/events.ts +4 -4
  661. package/src/utils/hooks/use-controlled-state.js +2 -2
  662. package/src/utils/hooks/use-controlled-value.ts +4 -4
  663. package/src/utils/hooks/use-latest-ref.ts +1 -1
  664. package/src/utils/unit-values.ts +3 -3
  665. package/tsconfig.json +1 -7
  666. package/tsconfig.tsbuildinfo +1 -1
  667. package/build/base-field/hook.js +0 -54
  668. package/build/base-field/hook.js.map +0 -1
  669. package/build/base-field/index.js +0 -14
  670. package/build/base-field/index.js.map +0 -1
  671. package/build/base-field/styles.js +0 -33
  672. package/build/base-field/styles.js.map +0 -1
  673. package/build/resizable-box/styles/resizable-box.styles.js +0 -2
  674. package/build-module/base-field/hook.js +0 -37
  675. package/build-module/base-field/hook.js.map +0 -1
  676. package/build-module/base-field/index.js +0 -2
  677. package/build-module/base-field/index.js.map +0 -1
  678. package/build-module/base-field/styles.js +0 -18
  679. package/build-module/base-field/styles.js.map +0 -1
  680. package/build-module/resizable-box/styles/resizable-box.styles.js +0 -2
  681. package/build-types/base-field/hook.d.ts +0 -270
  682. package/build-types/base-field/hook.d.ts.map +0 -1
  683. package/build-types/base-field/index.d.ts +0 -2
  684. package/build-types/base-field/index.d.ts.map +0 -1
  685. package/build-types/base-field/styles.d.ts +0 -6
  686. package/build-types/base-field/styles.d.ts.map +0 -1
  687. package/build-types/base-field/types.d.ts +0 -29
  688. package/build-types/base-field/types.d.ts.map +0 -1
  689. package/build-types/resizable-box/styles/resizable-box.styles.d.ts +0 -1
  690. package/build-types/resizable-box/styles/resizable-box.styles.d.ts.map +0 -1
  691. package/src/angle-picker-control/stories/index.js +0 -29
  692. package/src/base-field/README.md +0 -66
  693. package/src/base-field/hook.ts +0 -51
  694. package/src/base-field/index.ts +0 -1
  695. package/src/base-field/styles.ts +0 -86
  696. package/src/base-field/test/__snapshots__/index.tsx.snap +0 -141
  697. package/src/base-field/test/index.tsx +0 -84
  698. package/src/base-field/types.ts +0 -29
  699. package/src/combobox-control/stories/index.js +0 -339
  700. package/src/menu-items-choice/index.js +0 -43
  701. package/src/panel/header.js +0 -10
  702. package/src/panel/index.js +0 -26
  703. package/src/panel/row.js +0 -20
  704. package/src/resizable-box/styles/resizable-box.styles.js +0 -0
  705. package/src/tools-panel/stories/utils/tools-panel-with-item-group-slot.js +0 -246
  706. package/src/tree-grid/cell.js +0 -24
  707. package/src/tree-grid/item.js +0 -20
  708. package/src/tree-grid/roving-tab-index-item.js +0 -33
  709. package/src/tree-grid/row.js +0 -31
  710. package/src/tree-grid/stories/index.js +0 -106
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.positionToPlacement = exports.placementToMotionAnimationProps = exports.getReferenceOwnerDocument = exports.getReferenceElement = exports.getFrameOffset = void 0;
6
+ exports.positionToPlacement = exports.placementToMotionAnimationProps = exports.getReferenceOwnerDocument = exports.getReferenceElement = exports.getFrameScale = exports.getFrameOffset = void 0;
7
7
 
8
8
  /**
9
9
  * External dependencies
@@ -69,7 +69,7 @@ const POSITION_TO_PLACEMENT = {
69
69
  * Converts the `Popover`'s legacy "position" prop to the new "placement" prop
70
70
  * (used by `floating-ui`).
71
71
  *
72
- * @param position The legacy position
72
+ * @param position The legacy position
73
73
  * @return The corresponding placement
74
74
  */
75
75
 
@@ -146,14 +146,19 @@ const PLACEMENT_TO_ANIMATION_ORIGIN = {
146
146
  'left-end': {
147
147
  originX: 1,
148
148
  originY: 1
149
- } // open from bottom, right
149
+ },
150
+ // open from bottom, right
151
+ overlay: {
152
+ originX: 0.5,
153
+ originY: 0.5
154
+ } // open from center, center
150
155
 
151
156
  };
152
157
  /**
153
158
  * Given the floating-ui `placement`, compute the framer-motion props for the
154
159
  * popover's entry animation.
155
160
  *
156
- * @param placement A placement string from floating ui
161
+ * @param placement A placement string from floating ui
157
162
  * @return The object containing the motion props
158
163
  */
159
164
 
@@ -181,7 +186,7 @@ const placementToMotionAnimationProps = placement => {
181
186
  /**
182
187
  * Returns the offset of a document's frame element.
183
188
  *
184
- * @param document The iframe's owner document.
189
+ * @param document The iframe's owner document.
185
190
  *
186
191
  * @return The offset of the document's frame element, or undefined if the
187
192
  * document has no frame element.
@@ -208,6 +213,27 @@ const getFrameOffset = document => {
208
213
 
209
214
  exports.getFrameOffset = getFrameOffset;
210
215
 
216
+ const getFrameScale = document => {
217
+ var _document$defaultView2;
218
+
219
+ const frameElement = document === null || document === void 0 ? void 0 : (_document$defaultView2 = document.defaultView) === null || _document$defaultView2 === void 0 ? void 0 : _document$defaultView2.frameElement;
220
+
221
+ if (!frameElement) {
222
+ return {
223
+ x: 1,
224
+ y: 1
225
+ };
226
+ }
227
+
228
+ const rect = frameElement.getBoundingClientRect();
229
+ return {
230
+ x: rect.width / frameElement.offsetWidth,
231
+ y: rect.height / frameElement.offsetHeight
232
+ };
233
+ };
234
+
235
+ exports.getFrameScale = getFrameScale;
236
+
211
237
  const getReferenceOwnerDocument = _ref => {
212
238
  var _resultingReferenceOw;
213
239
 
@@ -260,7 +286,8 @@ const getReferenceElement = _ref2 => {
260
286
  anchorRef,
261
287
  anchorRect,
262
288
  getAnchorRect,
263
- fallbackReferenceElement
289
+ fallbackReferenceElement,
290
+ scale
264
291
  } = _ref2;
265
292
  let referenceElement = null;
266
293
 
@@ -309,6 +336,18 @@ const getReferenceElement = _ref2 => {
309
336
  // If no explicit ref is passed via props, fall back to
310
337
  // anchoring to the popover's parent node.
311
338
  referenceElement = fallbackReferenceElement.parentElement;
339
+ }
340
+
341
+ if (referenceElement && (scale.x !== 1 || scale.y !== 1)) {
342
+ // If the popover is inside an iframe, the coordinates of the
343
+ // reference element need to be scaled to match the iframe's scale.
344
+ const rect = referenceElement.getBoundingClientRect();
345
+ referenceElement = {
346
+ getBoundingClientRect() {
347
+ return new window.DOMRect(rect.x * scale.x, rect.y * scale.y, rect.width * scale.x, rect.height * scale.y);
348
+ }
349
+
350
+ };
312
351
  } // Convert any `undefined` value to `null`.
313
352
 
314
353
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/popover/utils.ts"],"names":["POSITION_TO_PLACEMENT","bottom","top","middle","positionToPlacement","position","PLACEMENT_TO_ANIMATION_ORIGIN","originX","originY","right","left","placementToMotionAnimationProps","placement","translateProp","startsWith","translateDirection","style","initial","opacity","scale","animate","transition","duration","ease","getFrameOffset","document","frameElement","defaultView","iframeRect","getBoundingClientRect","x","y","getReferenceOwnerDocument","anchor","anchorRef","anchorRect","getAnchorRect","fallbackReferenceElement","fallbackDocument","resultingReferenceOwnerDoc","ownerDocument","startContainer","current","getReferenceElement","referenceElement","topRect","bottomRect","window","DOMRect","width","rect","height","parentElement"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;;AAIA;AACA;AACA;AAOA,MAAMA,qBAGL,GAAG;AACHC,EAAAA,MAAM,EAAE,QADL;AAEHC,EAAAA,GAAG,EAAE,KAFF;AAGH,iBAAe,MAHZ;AAIH,kBAAgB,OAJb;AAKH,iBAAe,YALZ;AAMH,mBAAiB,QANd;AAOH,kBAAgB,cAPb;AAQH,cAAY,SART;AASH,gBAAc,KATX;AAUH,eAAa,WAVV;AAWH,sBAAoB,MAXjB;AAYH,uBAAqB,MAZlB;AAaH,wBAAsB,UAbnB;AAcH,qBAAmB,YAdhB;AAeH,uBAAqB,OAflB;AAgBH,wBAAsB,OAhBnB;AAiBH,yBAAuB,WAjBpB;AAkBH,sBAAoB,aAlBjB;AAmBH,sBAAoB,YAnBjB;AAoBH,uBAAqB,YApBlB;AAqBH,wBAAsB,YArBnB;AAsBH,qBAAmB,YAtBhB;AAuBH,wBAAsB,QAvBnB;AAwBH,yBAAuB,QAxBpB;AAyBH,0BAAwB,QAzBrB;AA0BH,uBAAqB,QA1BlB;AA2BH,uBAAqB,cA3BlB;AA4BH,wBAAsB,cA5BnB;AA6BH,yBAAuB,cA7BpB;AA8BH,sBAAoB,cA9BjB;AA+BH,mBAAiB,SA/Bd;AAgCH,oBAAkB,SAhCf;AAiCH,qBAAmB,SAjChB;AAkCH,kBAAgB,SAlCb;AAmCH,qBAAmB,KAnChB;AAoCH,sBAAoB,KApCjB;AAqCH,uBAAqB,KArClB;AAsCH,oBAAkB,KAtCf;AAuCH,oBAAkB,WAvCf;AAwCH,qBAAmB,WAxChB;AAyCH,sBAAoB,WAzCjB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A,gBAAgB,GAAKV,SAAF,CAA2CQ,OAA9D;AACA,GALM,MAKA,IAAKR,SAAL,EAAwC;AAC9C;AACA;AACAU,IAAAA,gBAAgB,GAAGV,SAAnB;AACA,GAJM,MAIA,IAAKC,UAAL,EAAkB;AACxB;AACAS,IAAAA,gBAAgB,GAAG;AAClBf,MAAAA,qBAAqB,GAAG;AACvB,eAAOM,UAAP;AACA;;AAHiB,KAAnB;AAKA,GAPM,MAOA,IAAKC,aAAL,EAAqB;AAC3B;AACAQ,IAAAA,gBAAgB,GAAG;AAClBf,MAAAA,qBAAqB,GAAG;AAAA;;AACvB,cAAMqB,IAAI,GAAGd,aAAa,CAAEC,wBAAF,CAA1B;AACA,eAAO,IAAIU,MAAM,CAACC,OAAX,YACNE,IAAI,CAACpB,CADC,6CACIoB,IAAI,CAACxC,IADT,aAENwC,IAAI,CAACnB,CAFC,6CAEImB,IAAI,CAAChD,GAFT,iBAGNgD,IAAI,CAACD,KAHC,qDAGQC,IAAI,CAACzC,KAAL,GAAayC,IAAI,CAACxC,IAH1B,kBAINwC,IAAI,CAACC,MAJC,uDAISD,IAAI,CAACjD,MAAL,GAAciD,IAAI,CAAChD,GAJ5B,CAAP;AAMA;;AATiB,KAAnB;AAWA,GAbM,MAaA,IAAKmC,wBAAL,EAAgC;AACtC;AACA;AACAO,IAAAA,gBAAgB,GAAGP,wBAAwB,CAACe,aAA5C;AACA,GA3D2B,CA6D5B;;;AACA,8BAAOR,gBAAP,iEAA2B,IAA3B;AACA,CA1EM","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { MotionProps } from 'framer-motion';\nimport type { ReferenceType } from '@floating-ui/react-dom';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\n\nconst POSITION_TO_PLACEMENT: Record<\n\tNonNullable< PopoverProps[ 'position' ] >,\n\tNonNullable< PopoverProps[ 'placement' ] >\n> = {\n\tbottom: 'bottom',\n\ttop: 'top',\n\t'middle left': 'left',\n\t'middle right': 'right',\n\t'bottom left': 'bottom-end',\n\t'bottom center': 'bottom',\n\t'bottom right': 'bottom-start',\n\t'top left': 'top-end',\n\t'top center': 'top',\n\t'top right': 'top-start',\n\t'middle left left': 'left',\n\t'middle left right': 'left',\n\t'middle left bottom': 'left-end',\n\t'middle left top': 'left-start',\n\t'middle right left': 'right',\n\t'middle right right': 'right',\n\t'middle right bottom': 'right-end',\n\t'middle right top': 'right-start',\n\t'bottom left left': 'bottom-end',\n\t'bottom left right': 'bottom-end',\n\t'bottom left bottom': 'bottom-end',\n\t'bottom left top': 'bottom-end',\n\t'bottom center left': 'bottom',\n\t'bottom center right': 'bottom',\n\t'bottom center bottom': 'bottom',\n\t'bottom center top': 'bottom',\n\t'bottom right left': 'bottom-start',\n\t'bottom right right': 'bottom-start',\n\t'bottom right bottom': 'bottom-start',\n\t'bottom right top': 'bottom-start',\n\t'top left left': 'top-end',\n\t'top left right': 'top-end',\n\t'top left bottom': 'top-end',\n\t'top left top': 'top-end',\n\t'top center left': 'top',\n\t'top center right': 'top',\n\t'top center bottom': 'top',\n\t'top center top': 'top',\n\t'top right left': 'top-start',\n\t'top right right': 'top-start',\n\t'top right bottom': 'top-start',\n\t'top right top': 'top-start',\n\t// `middle`/`middle center [corner?]` positions are associated to a fallback\n\t// `bottom` placement because there aren't any corresponding placement values.\n\tmiddle: 'bottom',\n\t'middle center': 'bottom',\n\t'middle center bottom': 'bottom',\n\t'middle center left': 'bottom',\n\t'middle center right': 'bottom',\n\t'middle center top': 'bottom',\n};\n\n/**\n * Converts the `Popover`'s legacy \"position\" prop to the new \"placement\" prop\n * (used by `floating-ui`).\n *\n * @param position The legacy position\n * @return The corresponding placement\n */\nexport const positionToPlacement = (\n\tposition: NonNullable< PopoverProps[ 'position' ] >\n): NonNullable< PopoverProps[ 'placement' ] > =>\n\tPOSITION_TO_PLACEMENT[ position ] ?? 'bottom';\n\n/**\n * @typedef AnimationOrigin\n * @type {Object}\n * @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is \"start\", 0.5 is \"center\", and 1 is \"end\")\n * @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)\n */\n\nconst PLACEMENT_TO_ANIMATION_ORIGIN: Record<\n\tNonNullable< PopoverProps[ 'placement' ] >,\n\t{ originX: number; originY: number }\n> = {\n\ttop: { originX: 0.5, originY: 1 }, // open from bottom, center\n\t'top-start': { originX: 0, originY: 1 }, // open from bottom, left\n\t'top-end': { originX: 1, originY: 1 }, // open from bottom, right\n\tright: { originX: 0, originY: 0.5 }, // open from middle, left\n\t'right-start': { originX: 0, originY: 0 }, // open from top, left\n\t'right-end': { originX: 0, originY: 1 }, // open from bottom, left\n\tbottom: { originX: 0.5, originY: 0 }, // open from top, center\n\t'bottom-start': { originX: 0, originY: 0 }, // open from top, left\n\t'bottom-end': { originX: 1, originY: 0 }, // open from top, right\n\tleft: { originX: 1, originY: 0.5 }, // open from middle, right\n\t'left-start': { originX: 1, originY: 0 }, // open from top, right\n\t'left-end': { originX: 1, originY: 1 }, // open from bottom, right\n};\n\n/**\n * Given the floating-ui `placement`, compute the framer-motion props for the\n * popover's entry animation.\n *\n * @param placement A placement string from floating ui\n * @return The object containing the motion props\n */\nexport const placementToMotionAnimationProps = (\n\tplacement: NonNullable< PopoverProps[ 'placement' ] >\n): MotionProps => {\n\tconst translateProp =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'bottom' )\n\t\t\t? 'translateY'\n\t\t\t: 'translateX';\n\tconst translateDirection =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'left' )\n\t\t\t? 1\n\t\t\t: -1;\n\n\treturn {\n\t\tstyle: PLACEMENT_TO_ANIMATION_ORIGIN[ placement ],\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t\t[ translateProp ]: `${ 2 * translateDirection }em`,\n\t\t},\n\t\tanimate: { opacity: 1, scale: 1, [ translateProp ]: 0 },\n\t\ttransition: { duration: 0.1, ease: [ 0, 0, 0.2, 1 ] },\n\t};\n};\n\n/**\n * Returns the offset of a document's frame element.\n *\n * @param document The iframe's owner document.\n *\n * @return The offset of the document's frame element, or undefined if the\n * document has no frame element.\n */\nexport const getFrameOffset = (\n\tdocument?: Document\n): { x: number; y: number } | undefined => {\n\tconst frameElement = document?.defaultView?.frameElement;\n\tif ( ! frameElement ) {\n\t\treturn;\n\t}\n\tconst iframeRect = frameElement.getBoundingClientRect();\n\treturn { x: iframeRect.left, y: iframeRect.top };\n};\n\nexport const getReferenceOwnerDocument = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n\tfallbackDocument,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n\tfallbackDocument: Document;\n} ): Document => {\n\t// In floating-ui's terms:\n\t// - \"reference\" refers to the popover's anchor element.\n\t// - \"floating\" refers the floating popover's element.\n\t// A floating element can also be positioned relative to a virtual element,\n\t// instead of a real one. A virtual element is represented by an object\n\t// with the `getBoundingClientRect()` function (like real elements).\n\t// See https://floating-ui.com/docs/virtual-elements for more info.\n\tlet resultingReferenceOwnerDoc;\n\tif ( anchor ) {\n\t\tresultingReferenceOwnerDoc = anchor.ownerDocument;\n\t} else if ( ( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top ) {\n\t\tresultingReferenceOwnerDoc = ( anchorRef as PopoverAnchorRefTopBottom )\n\t\t\t?.top.ownerDocument;\n\t} else if ( ( anchorRef as Range | undefined )?.startContainer ) {\n\t\tresultingReferenceOwnerDoc = ( anchorRef as Range ).startContainer\n\t\t\t.ownerDocument;\n\t} else if (\n\t\t( anchorRef as PopoverAnchorRefReference | undefined )?.current\n\t) {\n\t\tresultingReferenceOwnerDoc = (\n\t\t\t( anchorRef as PopoverAnchorRefReference ).current as Element\n\t\t ).ownerDocument;\n\t} else if ( anchorRef as Element | undefined ) {\n\t\t// This one should be deprecated.\n\t\tresultingReferenceOwnerDoc = ( anchorRef as Element ).ownerDocument;\n\t} else if ( anchorRect && anchorRect?.ownerDocument ) {\n\t\tresultingReferenceOwnerDoc = anchorRect.ownerDocument;\n\t} else if ( getAnchorRect ) {\n\t\tresultingReferenceOwnerDoc = getAnchorRect(\n\t\t\tfallbackReferenceElement\n\t\t)?.ownerDocument;\n\t}\n\n\treturn resultingReferenceOwnerDoc ?? fallbackDocument;\n};\n\nexport const getReferenceElement = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n} ): ReferenceType | null => {\n\tlet referenceElement = null;\n\n\tif ( anchor ) {\n\t\treferenceElement = anchor;\n\t} else if ( ( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top ) {\n\t\t// Create a virtual element for the ref. The expectation is that\n\t\t// if anchorRef.top is defined, then anchorRef.bottom is defined too.\n\t\t// Seems to be used by the block toolbar, when multiple blocks are selected\n\t\t// (top and bottom blocks are used to calculate the resulting rect).\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst topRect = (\n\t\t\t\t\tanchorRef as PopoverAnchorRefTopBottom\n\t\t\t\t ).top.getBoundingClientRect();\n\t\t\t\tconst bottomRect = (\n\t\t\t\t\tanchorRef as PopoverAnchorRefTopBottom\n\t\t\t\t ).bottom.getBoundingClientRect();\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\ttopRect.x,\n\t\t\t\t\ttopRect.y,\n\t\t\t\t\ttopRect.width,\n\t\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if (\n\t\t( anchorRef as PopoverAnchorRefReference | undefined )?.current\n\t) {\n\t\t// Standard React ref.\n\t\treferenceElement = ( anchorRef as PopoverAnchorRefReference ).current;\n\t} else if ( anchorRef as Element | undefined ) {\n\t\t// If `anchorRef` holds directly the element's value (no `current` key)\n\t\t// This is a weird scenario and should be deprecated.\n\t\treferenceElement = anchorRef as Element;\n\t} else if ( anchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn anchorRect;\n\t\t\t},\n\t\t};\n\t} else if ( getAnchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = getAnchorRect( fallbackReferenceElement );\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\trect.x ?? rect.left,\n\t\t\t\t\trect.y ?? rect.top,\n\t\t\t\t\trect.width ?? rect.right - rect.left,\n\t\t\t\t\trect.height ?? rect.bottom - rect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if ( fallbackReferenceElement ) {\n\t\t// If no explicit ref is passed via props, fall back to\n\t\t// anchoring to the popover's parent node.\n\t\treferenceElement = fallbackReferenceElement.parentElement;\n\t}\n\n\t// Convert any `undefined` value to `null`.\n\treturn referenceElement ?? null;\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/popover/utils.ts"],"names":["POSITION_TO_PLACEMENT","bottom","top","middle","positionToPlacement","position","PLACEMENT_TO_ANIMATION_ORIGIN","originX","originY","right","left","overlay","placementToMotionAnimationProps","placement","translateProp","startsWith","translateDirection","style","initial","opacity","scale","animate","transition","duration","ease","getFrameOffset","document","frameElement","defaultView","iframeRect","getBoundingClientRect","x","y","getFrameScale","rect","width","offsetWidth","height","offsetHeight","getReferenceOwnerDocument","anchor","anchorRef","anchorRect","getAnchorRect","fallbackReferenceElement","fallbackDocument","resultingReferenceOwnerDoc","ownerDocument","startContainer","current","getReferenceElement","referenceElement","topRect","bottomRect","window","DOMRect","parentElement"],"mappings":";;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B,GAAGP,wBAAwB,CAACY,aAA5C;AACA;;AAED,MAAKL,gBAAgB,KAAM/B,KAAK,CAACW,CAAN,KAAY,CAAZ,IAAiBX,KAAK,CAACY,CAAN,KAAY,CAAnC,CAArB,EAA8D;AAC7D;AACA;AACA,UAAME,IAAI,GAAGiB,gBAAgB,CAACrB,qBAAjB,EAAb;AACAqB,IAAAA,gBAAgB,GAAG;AAClBrB,MAAAA,qBAAqB,GAAG;AACvB,eAAO,IAAIwB,MAAM,CAACC,OAAX,CACNrB,IAAI,CAACH,CAAL,GAASX,KAAK,CAACW,CADT,EAENG,IAAI,CAACF,CAAL,GAASZ,KAAK,CAACY,CAFT,EAGNE,IAAI,CAACC,KAAL,GAAaf,KAAK,CAACW,CAHb,EAING,IAAI,CAACG,MAAL,GAAcjB,KAAK,CAACY,CAJd,CAAP;AAMA;;AARiB,KAAnB;AAUA,GA3E2B,CA6E5B;;;AACA,8BAAOmB,gBAAP,iEAA2B,IAA3B;AACA,CA5FM","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type { MotionProps } from 'framer-motion';\nimport type { ReferenceType } from '@floating-ui/react-dom';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\n\nconst POSITION_TO_PLACEMENT: Record<\n\tNonNullable< PopoverProps[ 'position' ] >,\n\tNonNullable< PopoverProps[ 'placement' ] >\n> = {\n\tbottom: 'bottom',\n\ttop: 'top',\n\t'middle left': 'left',\n\t'middle right': 'right',\n\t'bottom left': 'bottom-end',\n\t'bottom center': 'bottom',\n\t'bottom right': 'bottom-start',\n\t'top left': 'top-end',\n\t'top center': 'top',\n\t'top right': 'top-start',\n\t'middle left left': 'left',\n\t'middle left right': 'left',\n\t'middle left bottom': 'left-end',\n\t'middle left top': 'left-start',\n\t'middle right left': 'right',\n\t'middle right right': 'right',\n\t'middle right bottom': 'right-end',\n\t'middle right top': 'right-start',\n\t'bottom left left': 'bottom-end',\n\t'bottom left right': 'bottom-end',\n\t'bottom left bottom': 'bottom-end',\n\t'bottom left top': 'bottom-end',\n\t'bottom center left': 'bottom',\n\t'bottom center right': 'bottom',\n\t'bottom center bottom': 'bottom',\n\t'bottom center top': 'bottom',\n\t'bottom right left': 'bottom-start',\n\t'bottom right right': 'bottom-start',\n\t'bottom right bottom': 'bottom-start',\n\t'bottom right top': 'bottom-start',\n\t'top left left': 'top-end',\n\t'top left right': 'top-end',\n\t'top left bottom': 'top-end',\n\t'top left top': 'top-end',\n\t'top center left': 'top',\n\t'top center right': 'top',\n\t'top center bottom': 'top',\n\t'top center top': 'top',\n\t'top right left': 'top-start',\n\t'top right right': 'top-start',\n\t'top right bottom': 'top-start',\n\t'top right top': 'top-start',\n\t// `middle`/`middle center [corner?]` positions are associated to a fallback\n\t// `bottom` placement because there aren't any corresponding placement values.\n\tmiddle: 'bottom',\n\t'middle center': 'bottom',\n\t'middle center bottom': 'bottom',\n\t'middle center left': 'bottom',\n\t'middle center right': 'bottom',\n\t'middle center top': 'bottom',\n};\n\n/**\n * Converts the `Popover`'s legacy \"position\" prop to the new \"placement\" prop\n * (used by `floating-ui`).\n *\n * @param position The legacy position\n * @return The corresponding placement\n */\nexport const positionToPlacement = (\n\tposition: NonNullable< PopoverProps[ 'position' ] >\n): NonNullable< PopoverProps[ 'placement' ] > =>\n\tPOSITION_TO_PLACEMENT[ position ] ?? 'bottom';\n\n/**\n * @typedef AnimationOrigin\n * @type {Object}\n * @property {number} originX A number between 0 and 1 (in CSS logical properties jargon, 0 is \"start\", 0.5 is \"center\", and 1 is \"end\")\n * @property {number} originY A number between 0 and 1 (0 is top, 0.5 is center, and 1 is bottom)\n */\n\nconst PLACEMENT_TO_ANIMATION_ORIGIN: Record<\n\tNonNullable< PopoverProps[ 'placement' ] >,\n\t{ originX: number; originY: number }\n> = {\n\ttop: { originX: 0.5, originY: 1 }, // open from bottom, center\n\t'top-start': { originX: 0, originY: 1 }, // open from bottom, left\n\t'top-end': { originX: 1, originY: 1 }, // open from bottom, right\n\tright: { originX: 0, originY: 0.5 }, // open from middle, left\n\t'right-start': { originX: 0, originY: 0 }, // open from top, left\n\t'right-end': { originX: 0, originY: 1 }, // open from bottom, left\n\tbottom: { originX: 0.5, originY: 0 }, // open from top, center\n\t'bottom-start': { originX: 0, originY: 0 }, // open from top, left\n\t'bottom-end': { originX: 1, originY: 0 }, // open from top, right\n\tleft: { originX: 1, originY: 0.5 }, // open from middle, right\n\t'left-start': { originX: 1, originY: 0 }, // open from top, right\n\t'left-end': { originX: 1, originY: 1 }, // open from bottom, right\n\toverlay: { originX: 0.5, originY: 0.5 }, // open from center, center\n};\n\n/**\n * Given the floating-ui `placement`, compute the framer-motion props for the\n * popover's entry animation.\n *\n * @param placement A placement string from floating ui\n * @return The object containing the motion props\n */\nexport const placementToMotionAnimationProps = (\n\tplacement: NonNullable< PopoverProps[ 'placement' ] >\n): MotionProps => {\n\tconst translateProp =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'bottom' )\n\t\t\t? 'translateY'\n\t\t\t: 'translateX';\n\tconst translateDirection =\n\t\tplacement.startsWith( 'top' ) || placement.startsWith( 'left' )\n\t\t\t? 1\n\t\t\t: -1;\n\n\treturn {\n\t\tstyle: PLACEMENT_TO_ANIMATION_ORIGIN[ placement ],\n\t\tinitial: {\n\t\t\topacity: 0,\n\t\t\tscale: 0,\n\t\t\t[ translateProp ]: `${ 2 * translateDirection }em`,\n\t\t},\n\t\tanimate: { opacity: 1, scale: 1, [ translateProp ]: 0 },\n\t\ttransition: { duration: 0.1, ease: [ 0, 0, 0.2, 1 ] },\n\t};\n};\n\n/**\n * Returns the offset of a document's frame element.\n *\n * @param document The iframe's owner document.\n *\n * @return The offset of the document's frame element, or undefined if the\n * document has no frame element.\n */\nexport const getFrameOffset = (\n\tdocument?: Document\n): { x: number; y: number } | undefined => {\n\tconst frameElement = document?.defaultView?.frameElement;\n\tif ( ! frameElement ) {\n\t\treturn;\n\t}\n\tconst iframeRect = frameElement.getBoundingClientRect();\n\treturn { x: iframeRect.left, y: iframeRect.top };\n};\n\nexport const getFrameScale = (\n\tdocument?: Document\n): {\n\tx: number;\n\ty: number;\n} => {\n\tconst frameElement = document?.defaultView?.frameElement as HTMLElement;\n\tif ( ! frameElement ) {\n\t\treturn { x: 1, y: 1 };\n\t}\n\tconst rect = frameElement.getBoundingClientRect();\n\treturn {\n\t\tx: rect.width / frameElement.offsetWidth,\n\t\ty: rect.height / frameElement.offsetHeight,\n\t};\n};\n\nexport const getReferenceOwnerDocument = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n\tfallbackDocument,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n\tfallbackDocument: Document;\n} ): Document => {\n\t// In floating-ui's terms:\n\t// - \"reference\" refers to the popover's anchor element.\n\t// - \"floating\" refers the floating popover's element.\n\t// A floating element can also be positioned relative to a virtual element,\n\t// instead of a real one. A virtual element is represented by an object\n\t// with the `getBoundingClientRect()` function (like real elements).\n\t// See https://floating-ui.com/docs/virtual-elements for more info.\n\tlet resultingReferenceOwnerDoc;\n\tif ( anchor ) {\n\t\tresultingReferenceOwnerDoc = anchor.ownerDocument;\n\t} else if ( ( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top ) {\n\t\tresultingReferenceOwnerDoc = ( anchorRef as PopoverAnchorRefTopBottom )\n\t\t\t?.top.ownerDocument;\n\t} else if ( ( anchorRef as Range | undefined )?.startContainer ) {\n\t\tresultingReferenceOwnerDoc = ( anchorRef as Range ).startContainer\n\t\t\t.ownerDocument;\n\t} else if (\n\t\t( anchorRef as PopoverAnchorRefReference | undefined )?.current\n\t) {\n\t\tresultingReferenceOwnerDoc = (\n\t\t\t( anchorRef as PopoverAnchorRefReference ).current as Element\n\t\t ).ownerDocument;\n\t} else if ( anchorRef as Element | undefined ) {\n\t\t// This one should be deprecated.\n\t\tresultingReferenceOwnerDoc = ( anchorRef as Element ).ownerDocument;\n\t} else if ( anchorRect && anchorRect?.ownerDocument ) {\n\t\tresultingReferenceOwnerDoc = anchorRect.ownerDocument;\n\t} else if ( getAnchorRect ) {\n\t\tresultingReferenceOwnerDoc = getAnchorRect(\n\t\t\tfallbackReferenceElement\n\t\t)?.ownerDocument;\n\t}\n\n\treturn resultingReferenceOwnerDoc ?? fallbackDocument;\n};\n\nexport const getReferenceElement = ( {\n\tanchor,\n\tanchorRef,\n\tanchorRect,\n\tgetAnchorRect,\n\tfallbackReferenceElement,\n\tscale,\n}: Pick<\n\tPopoverProps,\n\t'anchorRef' | 'anchorRect' | 'getAnchorRect' | 'anchor'\n> & {\n\tfallbackReferenceElement: Element | null;\n\tscale: { x: number; y: number };\n} ): ReferenceType | null => {\n\tlet referenceElement = null;\n\n\tif ( anchor ) {\n\t\treferenceElement = anchor;\n\t} else if ( ( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top ) {\n\t\t// Create a virtual element for the ref. The expectation is that\n\t\t// if anchorRef.top is defined, then anchorRef.bottom is defined too.\n\t\t// Seems to be used by the block toolbar, when multiple blocks are selected\n\t\t// (top and bottom blocks are used to calculate the resulting rect).\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst topRect = (\n\t\t\t\t\tanchorRef as PopoverAnchorRefTopBottom\n\t\t\t\t ).top.getBoundingClientRect();\n\t\t\t\tconst bottomRect = (\n\t\t\t\t\tanchorRef as PopoverAnchorRefTopBottom\n\t\t\t\t ).bottom.getBoundingClientRect();\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\ttopRect.x,\n\t\t\t\t\ttopRect.y,\n\t\t\t\t\ttopRect.width,\n\t\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if (\n\t\t( anchorRef as PopoverAnchorRefReference | undefined )?.current\n\t) {\n\t\t// Standard React ref.\n\t\treferenceElement = ( anchorRef as PopoverAnchorRefReference ).current;\n\t} else if ( anchorRef as Element | undefined ) {\n\t\t// If `anchorRef` holds directly the element's value (no `current` key)\n\t\t// This is a weird scenario and should be deprecated.\n\t\treferenceElement = anchorRef as Element;\n\t} else if ( anchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn anchorRect;\n\t\t\t},\n\t\t};\n\t} else if ( getAnchorRect ) {\n\t\t// Create a virtual element for the ref.\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = getAnchorRect( fallbackReferenceElement );\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\trect.x ?? rect.left,\n\t\t\t\t\trect.y ?? rect.top,\n\t\t\t\t\trect.width ?? rect.right - rect.left,\n\t\t\t\t\trect.height ?? rect.bottom - rect.top\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t} else if ( fallbackReferenceElement ) {\n\t\t// If no explicit ref is passed via props, fall back to\n\t\t// anchoring to the popover's parent node.\n\t\treferenceElement = fallbackReferenceElement.parentElement;\n\t}\n\n\tif ( referenceElement && ( scale.x !== 1 || scale.y !== 1 ) ) {\n\t\t// If the popover is inside an iframe, the coordinates of the\n\t\t// reference element need to be scaled to match the iframe's scale.\n\t\tconst rect = referenceElement.getBoundingClientRect();\n\t\treferenceElement = {\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn new window.DOMRect(\n\t\t\t\t\trect.x * scale.x,\n\t\t\t\t\trect.y * scale.y,\n\t\t\t\t\trect.width * scale.x,\n\t\t\t\t\trect.height * scale.y\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t}\n\n\t// Convert any `undefined` value to `null`.\n\treturn referenceElement ?? null;\n};\n"]}
@@ -14,7 +14,7 @@ var _lodash = require("lodash");
14
14
  /**
15
15
  * Returns terms in a tree form.
16
16
  *
17
- * @param flatTerms Array of terms in flat format.
17
+ * @param flatTerms Array of terms in flat format.
18
18
  *
19
19
  * @return Terms in tree format.
20
20
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/query-controls/terms.ts"],"names":["buildTermsTree","flatTerms","flatTermsWithParentAndChildren","map","term","children","parent","id","String","termsByParent","null","length","fillWithChildren","terms"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyBC,SAAzB,EAAuE;AAC7E,QAAMC,8BAA2D,GAChED,SAAS,CAACE,GAAV,CAAiBC,IAAF,IAAY;AAC1B,WAAO;AACNC,MAAAA,QAAQ,EAAE,EADJ;AAENC,MAAAA,MAAM,EAAE,IAFF;AAGN,SAAGF,IAHG;AAING,MAAAA,EAAE,EAAEC,MAAM,CAAEJ,IAAI,CAACG,EAAP;AAJJ,KAAP;AAMA,GAPD,CADD;AAUA,QAAME,aAA4B,GAAG,qBACpCP,8BADoC,EAEpC,QAFoC,CAArC;;AAIA,MAAKO,aAAa,CAACC,IAAd,IAAsBD,aAAa,CAACC,IAAd,CAAmBC,MAA9C,EAAuD;AACtD,WAAOT,8BAAP;AACA;;AACD,QAAMU,gBAAgB,GACrBC,KADwB,IAES;AACjC,WAAOA,KAAK,CAACV,GAAN,CAAaC,IAAF,IAAY;AAC7B,YAAMC,QAAQ,GAAGI,aAAa,CAAEL,IAAI,CAACG,EAAP,CAA9B;AACA,aAAO,EACN,GAAGH,IADG;AAENC,QAAAA,QAAQ,EACPA,QAAQ,IAAIA,QAAQ,CAACM,MAArB,GACGC,gBAAgB,CAAEP,QAAF,CADnB,GAEG;AALE,OAAP;AAOA,KATM,CAAP;AAUA,GAbD;;AAeA,SAAOO,gBAAgB,CAAEH,aAAa,CAAE,GAAF,CAAb,IAAwB,EAA1B,CAAvB;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { groupBy } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tAuthor,\n\tCategory,\n\tTermWithParentAndChildren,\n\tTermsByParent,\n} from './types';\n\n/**\n * Returns terms in a tree form.\n *\n * @param flatTerms Array of terms in flat format.\n *\n * @return Terms in tree format.\n */\nexport function buildTermsTree( flatTerms: readonly ( Author | Category )[] ) {\n\tconst flatTermsWithParentAndChildren: TermWithParentAndChildren[] =\n\t\tflatTerms.map( ( term ) => {\n\t\t\treturn {\n\t\t\t\tchildren: [],\n\t\t\t\tparent: null,\n\t\t\t\t...term,\n\t\t\t\tid: String( term.id ),\n\t\t\t};\n\t\t} );\n\n\tconst termsByParent: TermsByParent = groupBy(\n\t\tflatTermsWithParentAndChildren,\n\t\t'parent'\n\t);\n\tif ( termsByParent.null && termsByParent.null.length ) {\n\t\treturn flatTermsWithParentAndChildren;\n\t}\n\tconst fillWithChildren = (\n\t\tterms: TermWithParentAndChildren[]\n\t): TermWithParentAndChildren[] => {\n\t\treturn terms.map( ( term ) => {\n\t\t\tconst children = termsByParent[ term.id ];\n\t\t\treturn {\n\t\t\t\t...term,\n\t\t\t\tchildren:\n\t\t\t\t\tchildren && children.length\n\t\t\t\t\t\t? fillWithChildren( children )\n\t\t\t\t\t\t: [],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/query-controls/terms.ts"],"names":["buildTermsTree","flatTerms","flatTermsWithParentAndChildren","map","term","children","parent","id","String","termsByParent","null","length","fillWithChildren","terms"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyBC,SAAzB,EAAuE;AAC7E,QAAMC,8BAA2D,GAChED,SAAS,CAACE,GAAV,CAAiBC,IAAF,IAAY;AAC1B,WAAO;AACNC,MAAAA,QAAQ,EAAE,EADJ;AAENC,MAAAA,MAAM,EAAE,IAFF;AAGN,SAAGF,IAHG;AAING,MAAAA,EAAE,EAAEC,MAAM,CAAEJ,IAAI,CAACG,EAAP;AAJJ,KAAP;AAMA,GAPD,CADD;AAUA,QAAME,aAA4B,GAAG,qBACpCP,8BADoC,EAEpC,QAFoC,CAArC;;AAIA,MAAKO,aAAa,CAACC,IAAd,IAAsBD,aAAa,CAACC,IAAd,CAAmBC,MAA9C,EAAuD;AACtD,WAAOT,8BAAP;AACA;;AACD,QAAMU,gBAAgB,GACrBC,KADwB,IAES;AACjC,WAAOA,KAAK,CAACV,GAAN,CAAaC,IAAF,IAAY;AAC7B,YAAMC,QAAQ,GAAGI,aAAa,CAAEL,IAAI,CAACG,EAAP,CAA9B;AACA,aAAO,EACN,GAAGH,IADG;AAENC,QAAAA,QAAQ,EACPA,QAAQ,IAAIA,QAAQ,CAACM,MAArB,GACGC,gBAAgB,CAAEP,QAAF,CADnB,GAEG;AALE,OAAP;AAOA,KATM,CAAP;AAUA,GAbD;;AAeA,SAAOO,gBAAgB,CAAEH,aAAa,CAAE,GAAF,CAAb,IAAwB,EAA1B,CAAvB;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { groupBy } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tAuthor,\n\tCategory,\n\tTermWithParentAndChildren,\n\tTermsByParent,\n} from './types';\n\n/**\n * Returns terms in a tree form.\n *\n * @param flatTerms Array of terms in flat format.\n *\n * @return Terms in tree format.\n */\nexport function buildTermsTree( flatTerms: readonly ( Author | Category )[] ) {\n\tconst flatTermsWithParentAndChildren: TermWithParentAndChildren[] =\n\t\tflatTerms.map( ( term ) => {\n\t\t\treturn {\n\t\t\t\tchildren: [],\n\t\t\t\tparent: null,\n\t\t\t\t...term,\n\t\t\t\tid: String( term.id ),\n\t\t\t};\n\t\t} );\n\n\tconst termsByParent: TermsByParent = groupBy(\n\t\tflatTermsWithParentAndChildren,\n\t\t'parent'\n\t);\n\tif ( termsByParent.null && termsByParent.null.length ) {\n\t\treturn flatTermsWithParentAndChildren;\n\t}\n\tconst fillWithChildren = (\n\t\tterms: TermWithParentAndChildren[]\n\t): TermWithParentAndChildren[] => {\n\t\treturn terms.map( ( term ) => {\n\t\t\tconst children = termsByParent[ term.id ];\n\t\t\treturn {\n\t\t\t\t...term,\n\t\t\t\tchildren:\n\t\t\t\t\tchildren && children.length\n\t\t\t\t\t\t? fillWithChildren( children )\n\t\t\t\t\t\t: [],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\n}\n"]}
@@ -23,9 +23,9 @@ var _math = require("../utils/math");
23
23
  /**
24
24
  * A float supported clamp function for a specific value.
25
25
  *
26
- * @param value The value to clamp.
27
- * @param min The minimum value.
28
- * @param max The maximum value.
26
+ * @param value The value to clamp.
27
+ * @param min The minimum value.
28
+ * @param max The maximum value.
29
29
  *
30
30
  * @return A (float) number
31
31
  */
@@ -39,7 +39,7 @@ function floatClamp(value, min, max) {
39
39
  /**
40
40
  * Hook to store a clamped value, derived from props.
41
41
  *
42
- * @param settings
42
+ * @param settings
43
43
  * @return The controlled value and the value setter.
44
44
  */
45
45
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/range-control/utils.ts"],"names":["floatClamp","value","min","max","parseFloat","useControlledRangeValue","settings","valueProp","initial","state","setInternalState","fallback","setState","nextValue"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAT,CAAqBC,KAArB,EAA2CC,GAA3C,EAAwDC,GAAxD,EAAsE;AAC5E,MAAK,OAAOF,KAAP,KAAiB,QAAtB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,SAAOG,UAAU,CAAG,GAAG,iBAAOH,KAAP,EAAcC,GAAd,EAAmBC,GAAnB,CAA0B,EAAhC,CAAjB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,uBAAT,CACNC,QADM,EAEL;AACD,QAAM;AAAEJ,IAAAA,GAAF;AAAOC,IAAAA,GAAP;AAAYF,IAAAA,KAAK,EAAEM,SAAnB;AAA8BC,IAAAA;AAA9B,MAA0CF,QAAhD;AACA,QAAM,CAAEG,KAAF,EAASC,gBAAT,IAA8B,+BACnCV,UAAU,CAAEO,SAAF,EAAaL,GAAb,EAAkBC,GAAlB,CADyB,EAEnC;AACCK,IAAAA,OAAO,EAAER,UAAU,CAAEQ,OAAF,aAAEA,OAAF,cAAEA,OAAF,GAAa,IAAb,EAAmBN,GAAnB,EAAwBC,GAAxB,CADpB;AAECQ,IAAAA,QAAQ,EAAE;AAFX,GAFmC,CAApC;AAQA,QAAMC,QAAQ,GAAG,0BACdC,SAAF,IAAgC;AAC/B,QAAKA,SAAS,KAAK,IAAnB,EAA0B;AACzBH,MAAAA,gBAAgB,CAAE,IAAF,CAAhB;AACA,KAFD,MAEO;AACNA,MAAAA,gBAAgB,CAAEV,UAAU,CAAEa,SAAF,EAAaX,GAAb,EAAkBC,GAAlB,CAAZ,CAAhB;AACA;AACD,GAPe,EAQhB,CAAED,GAAF,EAAOC,GAAP,EAAYO,gBAAZ,CARgB,CAAjB,CAVC,CAqBD;AACA;;AACA,SAAO,CAAED,KAAF,EAAwCG,QAAxC,CAAP;AACA","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"]}
1
+ {"version":3,"sources":["@wordpress/components/src/range-control/utils.ts"],"names":["floatClamp","value","min","max","parseFloat","useControlledRangeValue","settings","valueProp","initial","state","setInternalState","fallback","setState","nextValue"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,UAAT,CAAqBC,KAArB,EAA2CC,GAA3C,EAAwDC,GAAxD,EAAsE;AAC5E,MAAK,OAAOF,KAAP,KAAiB,QAAtB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,SAAOG,UAAU,CAAG,GAAG,iBAAOH,KAAP,EAAcC,GAAd,EAAmBC,GAAnB,CAA0B,EAAhC,CAAjB;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,uBAAT,CACNC,QADM,EAEL;AACD,QAAM;AAAEJ,IAAAA,GAAF;AAAOC,IAAAA,GAAP;AAAYF,IAAAA,KAAK,EAAEM,SAAnB;AAA8BC,IAAAA;AAA9B,MAA0CF,QAAhD;AACA,QAAM,CAAEG,KAAF,EAASC,gBAAT,IAA8B,+BACnCV,UAAU,CAAEO,SAAF,EAAaL,GAAb,EAAkBC,GAAlB,CADyB,EAEnC;AACCK,IAAAA,OAAO,EAAER,UAAU,CAAEQ,OAAF,aAAEA,OAAF,cAAEA,OAAF,GAAa,IAAb,EAAmBN,GAAnB,EAAwBC,GAAxB,CADpB;AAECQ,IAAAA,QAAQ,EAAE;AAFX,GAFmC,CAApC;AAQA,QAAMC,QAAQ,GAAG,0BACdC,SAAF,IAAgC;AAC/B,QAAKA,SAAS,KAAK,IAAnB,EAA0B;AACzBH,MAAAA,gBAAgB,CAAE,IAAF,CAAhB;AACA,KAFD,MAEO;AACNA,MAAAA,gBAAgB,CAAEV,UAAU,CAAEa,SAAF,EAAaX,GAAb,EAAkBC,GAAlB,CAAZ,CAAhB;AACA;AACD,GAPe,EAQhB,CAAED,GAAF,EAAOC,GAAP,EAAYO,gBAAZ,CARgB,CAAjB,CAVC,CAqBD;AACA;;AACA,SAAO,CAAED,KAAF,EAAwCG,QAAxC,CAAP;AACA","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"]}
@@ -16,9 +16,9 @@ var _utils = require("../../../utils");
16
16
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
17
17
 
18
18
  const Root = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
19
- target: "ekdag503"
19
+ target: "e1wq7y4k3"
20
20
  } : {
21
- target: "ekdag503",
21
+ target: "e1wq7y4k3",
22
22
  label: "Root"
23
23
  })(process.env.NODE_ENV === "production" ? {
24
24
  name: "1cd7zoc",
@@ -26,14 +26,14 @@ const Root = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
26
26
  } : {
27
27
  name: "1cd7zoc",
28
28
  styles: "bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0",
29
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVc4QiIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3Jlc2l6YWJsZS1ib3gvcmVzaXplLXRvb2x0aXAvc3R5bGVzL3Jlc2l6ZS10b29sdGlwLnN0eWxlcy5qcyIsInNvdXJjZXND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Xh0IClgXG5cdCYmJiB7XG5cdFx0Y29sb3I6ICR7IENPTE9SUy51aS50ZXh0RGFyayB9O1xuXHRcdGRpc3BsYXk6IGJsb2NrO1xuXHRcdGZvbnQtc2l6ZTogMTNweDtcblx0XHRsaW5lLWhlaWdodDogMS40O1xuXHRcdHdoaXRlLXNwYWNlOiBub3dyYXA7XG5cdH1cbmA7XG4iXX0= */",
30
30
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
31
31
  });
32
32
  exports.Root = Root;
33
33
  const TooltipWrapper = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
34
- target: "ekdag502"
34
+ target: "e1wq7y4k2"
35
35
  } : {
36
- target: "ekdag502",
36
+ target: "e1wq7y4k2",
37
37
  label: "TooltipWrapper"
38
38
  })(process.env.NODE_ENV === "production" ? {
39
39
  name: "ajymcs",
@@ -41,24 +41,24 @@ const TooltipWrapper = (0, _base.default)("div", process.env.NODE_ENV === "produ
41
41
  } : {
42
42
  name: "ajymcs",
43
43
  styles: "align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear",
44
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFCd0MiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW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NDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */",
45
45
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
46
46
  });
47
47
  exports.TooltipWrapper = TooltipWrapper;
48
48
  const Tooltip = (0, _base.default)("div", process.env.NODE_ENV === "production" ? {
49
- target: "ekdag501"
49
+ target: "e1wq7y4k1"
50
50
  } : {
51
- target: "ekdag501",
51
+ target: "e1wq7y4k1",
52
52
  label: "Tooltip"
53
- })("background:", _utils.COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-size:12px;color:", _utils.COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStCaUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG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DEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */")); // TODO: Resolve need to use &&& to increase specificity
53
+ })("background:", _utils.COLORS.gray[900], ";border-radius:2px;box-sizing:border-box;font-size:12px;color:", _utils.COLORS.ui.textDark, ";padding:4px 8px;position:relative;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStCaUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHJpZ2h0OiAwO1xuXHR0b3A6IDA7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRkaXNwbGF5OiBpbmxpbmUtZmxleDtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdG9wYWNpdHk6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */")); // TODO: Resolve need to use &&& to increase specificity
54
54
  // https://github.com/WordPress/gutenberg/issues/18483
55
55
 
56
56
  exports.Tooltip = Tooltip;
57
57
  const LabelText = ( /*#__PURE__*/0, _base.default)(_text.Text, process.env.NODE_ENV === "production" ? {
58
- target: "ekdag500"
58
+ target: "e1wq7y4k0"
59
59
  } : {
60
- target: "ekdag500",
60
+ target: "e1wq7y4k0",
61
61
  label: "LabelText"
62
- })("&&&{color:", _utils.COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRDdUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGlvbjogYWJzb2x1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:", _utils.COLORS.ui.textDark, ";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvcmVzaXphYmxlLWJveC9yZXNpemUtdG9vbHRpcC9zdHlsZXMvcmVzaXplLXRvb2x0aXAuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRDdUMiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9yZXNpemFibGUtYm94L3Jlc2l6ZS10b29sdGlwL3N0eWxlcy9yZXNpemUtdG9vbHRpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi8uLi8uLi90ZXh0JztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20gJy4uLy4uLy4uL3V0aWxzJztcblxuZXhwb3J0IGNvbnN0IFJvb3QgPSBzdHlsZWQuZGl2YFxuXHRib3R0b206IDA7XG5cdGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG5cdGxlZnQ6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdHJpZ2h0OiAwO1xuXHR0b3A6IDA7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFdyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHRhbGlnbi1pdGVtczogY2VudGVyO1xuXHRib3gtc2l6aW5nOiBib3JkZXItYm94O1xuXHRkaXNwbGF5OiBpbmxpbmUtZmxleDtcblx0anVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG5cdG9wYWNpdHk6IDA7XG5cdHBvaW50ZXItZXZlbnRzOiBub25lO1xuXHR0cmFuc2l0aW9uOiBvcGFjaXR5IDEyMG1zIGxpbmVhcjtcbmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwID0gc3R5bGVkLmRpdmBcblx0YmFja2dyb3VuZDogJHsgQ09MT1JTLmdyYXlbIDkwMCBdIH07XG5cdGJvcmRlci1yYWRpdXM6IDJweDtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0Zm9udC1zaXplOiAxMnB4O1xuXHRjb2xvcjogJHsgQ09MT1JTLnVpLnRleHREYXJrIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5cdHBvc2l0aW9uOiByZWxhdGl2ZTtcbmA7XG5cbi8vIFRPRE86IFJlc29sdmUgbmVlZCB0byB1c2UgJiYmIHRvIGluY3JlYXNlIHNwZWNpZmljaXR5XG4vLyBodHRwczovL2dpdGh1Yi5jb20vV29yZFByZXNzL2d1dGVuYmVyZy9pc3N1ZXMvMTg0ODNcblxuZXhwb3J0IGNvbnN0IExhYmVsVGV4dCA9IHN0eWxlZCggVGV4dCApYFxuXHQmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGV4dERhcmsgfTtcblx0XHRkaXNwbGF5OiBibG9jaztcblx0XHRmb250LXNpemU6IDEzcHg7XG5cdFx0bGluZS1oZWlnaHQ6IDEuNDtcblx0XHR3aGl0ZS1zcGFjZTogbm93cmFwO1xuXHR9XG5gO1xuIl19 */"));
63
63
  exports.LabelText = LabelText;
64
64
  //# sourceMappingURL=resize-tooltip.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js"],"names":["Root","TooltipWrapper","Tooltip","COLORS","gray","ui","textDark","LabelText","Text"],"mappings":";;;;;;;;;;;AAQA;;AACA;;;;AAEO,MAAMA,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;;AAUA,MAAMC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;;AAUA,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,kBACJC,cAAOC,IAAP,CAAa,GAAb,CADI,oEAKTD,cAAOE,EAAP,CAAUC,QALD,29DAAb,C,CAUP;AACA;;;AAEO,MAAMC,SAAS,GAAG,iCAAQC,UAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,eAEVL,cAAOE,EAAP,CAAUC,QAFA,0/DAAf","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../../../text';\nimport { COLORS } from '../../../utils';\n\nexport const Root = styled.div`\n\tbottom: 0;\n\tbox-sizing: border-box;\n\tleft: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n`;\n\nexport const TooltipWrapper = styled.div`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\topacity: 0;\n\tpointer-events: none;\n\ttransition: opacity 120ms linear;\n`;\n\nexport const Tooltip = styled.div`\n\tbackground: ${ COLORS.gray[ 900 ] };\n\tborder-radius: 2px;\n\tbox-sizing: border-box;\n\tfont-size: 12px;\n\tcolor: ${ COLORS.ui.textDark };\n\tpadding: 4px 8px;\n\tposition: relative;\n`;\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const LabelText = styled( Text )`\n\t&&& {\n\t\tcolor: ${ COLORS.ui.textDark };\n\t\tdisplay: block;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\twhite-space: nowrap;\n\t}\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts"],"names":["Root","TooltipWrapper","Tooltip","COLORS","gray","ui","textDark","LabelText","Text"],"mappings":";;;;;;;;;;;AAQA;;AACA;;;;AAEO,MAAMA,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAV;;AAUA,MAAMC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAApB;;AAUA,MAAMC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,kBACJC,cAAOC,IAAP,CAAa,GAAb,CADI,oEAKTD,cAAOE,EAAP,CAAUC,QALD,29DAAb,C,CAUP;AACA;;;AAEO,MAAMC,SAAS,GAAG,iCAAQC,UAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,eAEVL,cAAOE,EAAP,CAAUC,QAFA,0/DAAf","sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { Text } from '../../../text';\nimport { COLORS } from '../../../utils';\n\nexport const Root = styled.div`\n\tbottom: 0;\n\tbox-sizing: border-box;\n\tleft: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n`;\n\nexport const TooltipWrapper = styled.div`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\topacity: 0;\n\tpointer-events: none;\n\ttransition: opacity 120ms linear;\n`;\n\nexport const Tooltip = styled.div`\n\tbackground: ${ COLORS.gray[ 900 ] };\n\tborder-radius: 2px;\n\tbox-sizing: border-box;\n\tfont-size: 12px;\n\tcolor: ${ COLORS.ui.textDark };\n\tpadding: 4px 8px;\n\tposition: relative;\n`;\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const LabelText = styled( Text )`\n\t&&& {\n\t\tcolor: ${ COLORS.ui.textDark };\n\t\tdisplay: block;\n\t\tfont-size: 13px;\n\t\tline-height: 1.4;\n\t\twhite-space: nowrap;\n\t}\n`;\n"]}
@@ -25,12 +25,12 @@ exports.POSITIONS = POSITIONS;
25
25
  * Custom hook that manages resize listener events. It also provides a label
26
26
  * based on current resize width x height values.
27
27
  *
28
- * @param props
29
- * @param props.axis Only shows the label corresponding to the axis.
30
- * @param props.fadeTimeout Duration (ms) before deactivating the resize label.
31
- * @param props.onResize Callback when a resize occurs. Provides { width, height } callback.
32
- * @param props.position Adjusts label value.
33
- * @param props.showPx Whether to add `PX` to the label.
28
+ * @param props
29
+ * @param props.axis Only shows the label corresponding to the axis.
30
+ * @param props.fadeTimeout Duration (ms) before deactivating the resize label.
31
+ * @param props.onResize Callback when a resize occurs. Provides { width, height } callback.
32
+ * @param props.position Adjusts label value.
33
+ * @param props.showPx Whether to add `PX` to the label.
34
34
  *
35
35
  * @return Properties for hook.
36
36
  */
@@ -157,14 +157,14 @@ function useResizeLabel(_ref) {
157
157
  /**
158
158
  * Gets the resize label based on width and height values (as well as recent changes).
159
159
  *
160
- * @param props
161
- * @param props.axis Only shows the label corresponding to the axis.
162
- * @param props.height Height value.
163
- * @param props.moveX Recent width (x axis) changes.
164
- * @param props.moveY Recent width (y axis) changes.
165
- * @param props.position Adjusts label value.
166
- * @param props.showPx Whether to add `PX` to the label.
167
- * @param props.width Width value.
160
+ * @param props
161
+ * @param props.axis Only shows the label corresponding to the axis.
162
+ * @param props.height Height value.
163
+ * @param props.moveX Recent width (x axis) changes.
164
+ * @param props.moveY Recent width (y axis) changes.
165
+ * @param props.position Adjusts label value.
166
+ * @param props.showPx Whether to add `PX` to the label.
167
+ * @param props.width Width value.
168
168
  *
169
169
  * @return The rendered label.
170
170
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/utils.ts"],"names":["noop","POSITIONS","bottom","corner","useResizeLabel","axis","fadeTimeout","onResize","position","showPx","resizeListener","sizes","isAxisControlled","moveX","setMoveX","moveY","setMoveY","width","height","heightRef","widthRef","moveTimeoutRef","debounceUnsetMoveXY","unsetMoveXY","current","window","clearTimeout","setTimeout","isRendered","didWidthChange","didHeightChange","label","getSizeLabel","undefined","labelUnit"],"mappings":";;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAIO,MAAMC,SAAS,GAAG;AACxBC,EAAAA,MAAM,EAAE,QADgB;AAExBC,EAAAA,MAAM,EAAE;AAFgB,CAAlB;;;AAsBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAT,OAMsC;AAAA,MANb;AAC/BC,IAAAA,IAD+B;AAE/BC,IAAAA,WAAW,GAAG,GAFiB;AAG/BC,IAAAA,QAAQ,GAAGP,IAHoB;AAI/BQ,IAAAA,QAAQ,GAAGP,SAAS,CAACC,MAJU;AAK/BO,IAAAA,MAAM,GAAG;AALsB,GAMa;;AAC5C;AACD;AACA;AACA;AACC,QAAM,CAAEC,cAAF,EAAkBC,KAAlB,IAA4B,iCAAlC;AAEA;AACD;AACA;AACA;AACA;;AACC,QAAMC,gBAAgB,GAAG,CAAC,CAAEP,IAA5B;AAEA;AACD;AACA;AACA;;AACC,QAAM,CAAEQ,KAAF,EAASC,QAAT,IAAsB,uBAAU,KAAV,CAA5B;AACA,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsB,uBAAU,KAAV,CAA5B;AAEA;AACD;AACA;AACA;;AACC,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAoBP,KAA1B;AACA,QAAMQ,SAAS,GAAG,qBAAQD,MAAR,CAAlB;AACA,QAAME,QAAQ,GAAG,qBAAQH,KAAR,CAAjB;AAEA;AACD;AACA;AACA;;AACC,QAAMI,cAAc,GAAG,sBAAvB;AAEA,QAAMC,mBAAmB,GAAG,0BAAa,MAAM;A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B,SAAW,EAAhC;AACA;;AACD,QAAK7B,IAAI,KAAK,GAAT,IAAgBU,KAArB,EAA6B;AAC5B,aAAQ,GAAGG,MAAQ,GAAGgB,SAAW,EAAjC;AACA;AACD;;AAED,MAAKrB,KAAK,IAAIE,KAAd,EAAsB;AACrB,WAAQ,GAAGE,KAAO,MAAMC,MAAQ,EAAhC;AACA;;AACD,MAAKL,KAAL,EAAa;AACZ,WAAQ,GAAGI,KAAO,GAAGiB,SAAW,EAAhC;AACA;;AACD,MAAKnB,KAAL,EAAa;AACZ,WAAQ,GAAGG,MAAQ,GAAGgB,SAAW,EAAjC;AACA;;AAED,SAAOD,SAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\nimport { useResizeObserver } from '@wordpress/compose';\n\nconst noop = () => {};\n\nexport type Axis = 'x' | 'y';\n\nexport const POSITIONS = {\n\tbottom: 'bottom',\n\tcorner: 'corner',\n} as const;\n\nexport type Position = typeof POSITIONS[ keyof typeof POSITIONS ];\n\ninterface UseResizeLabelProps {\n\t/** The label value. */\n\tlabel?: string;\n\t/** Element to be rendered for resize listening events. */\n\tresizeListener: JSX.Element;\n}\n\ninterface UseResizeLabelArgs {\n\taxis?: Axis;\n\tfadeTimeout: number;\n\tonResize( data: { width: number | null; height: number | null } ): void;\n\tposition: Position;\n\tshowPx: boolean;\n}\n\n/**\n * Custom hook that manages resize listener events. It also provides a label\n * based on current resize width x height values.\n *\n * @param props\n * @param props.axis Only shows the label corresponding to the axis.\n * @param props.fadeTimeout Duration (ms) before deactivating the resize label.\n * @param props.onResize Callback when a resize occurs. Provides { width, height } callback.\n * @param props.position Adjusts label value.\n * @param props.showPx Whether to add `PX` to the label.\n *\n * @return Properties for hook.\n */\nexport function useResizeLabel( {\n\taxis,\n\tfadeTimeout = 180,\n\tonResize = noop,\n\tposition = POSITIONS.bottom,\n\tshowPx = false,\n}: UseResizeLabelArgs ): UseResizeLabelProps {\n\t/*\n\t * The width/height values derive from this special useResizeObserver hook.\n\t * This custom hook uses the ResizeObserver API to listen for resize events.\n\t */\n\tconst [ resizeListener, sizes ] = useResizeObserver();\n\n\t/*\n\t * Indicates if the x/y axis is preferred.\n\t * If set, we will avoid resetting the moveX and moveY values.\n\t * This will allow for the preferred axis values to persist in the label.\n\t */\n\tconst isAxisControlled = !! axis;\n\n\t/*\n\t * The moveX and moveY values are used to track whether the label should\n\t * display width, height, or width x height.\n\t */\n\tconst [ moveX, setMoveX ] = useState( false );\n\tconst [ moveY, setMoveY ] = useState( false );\n\n\t/*\n\t * Cached dimension values to check for width/height updates from the\n\t * sizes property from useResizeAware()\n\t */\n\tconst { width, height } = sizes;\n\tconst heightRef = useRef( height );\n\tconst widthRef = useRef( width );\n\n\t/*\n\t * This timeout is used with setMoveX and setMoveY to determine of\n\t * both width and height values have changed at (roughly) the same time.\n\t */\n\tconst moveTimeoutRef = useRef< number >();\n\n\tconst debounceUnsetMoveXY = useCallback( () => {\n\t\tconst unsetMoveXY = () => {\n\t\t\t/*\n\t\t\t * If axis is controlled, we will avoid resetting the moveX and moveY values.\n\t\t\t * This will allow for the preferred axis values to persist in the label.\n\t\t\t */\n\t\t\tif ( isAxisControlled ) return;\n\t\t\tsetMoveX( false );\n\t\t\tsetMoveY( false );\n\t\t};\n\n\t\tif ( moveTimeoutRef.current ) {\n\t\t\twindow.clearTimeout( moveTimeoutRef.current );\n\t\t}\n\n\t\tmoveTimeoutRef.current = window.setTimeout( unsetMoveXY, fadeTimeout );\n\t}, [ fadeTimeout, isAxisControlled ] );\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * On the initial render of useResizeAware, the height and width values are\n\t\t * null. They are calculated then set using via an internal useEffect hook.\n\t\t */\n\t\tconst isRendered = width !== null || height !== null;\n\n\t\tif ( ! isRendered ) return;\n\n\t\tconst didWidthChange = width !== widthRef.current;\n\t\tconst didHeightChange = height !== heightRef.current;\n\n\t\tif ( ! didWidthChange && ! didHeightChange ) return;\n\n\t\t/*\n\t\t * After the initial render, the useResizeAware will set the first\n\t\t * width and height values. We'll sync those values with our\n\t\t * width and height refs. However, we shouldn't render our Tooltip\n\t\t * label on this first cycle.\n\t\t */\n\t\tif ( width && ! widthRef.current && height && ! heightRef.current ) {\n\t\t\twidthRef.current = width;\n\t\t\theightRef.current = height;\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * After the first cycle, we can track width and height changes.\n\t\t */\n\t\tif ( didWidthChange ) {\n\t\t\tsetMoveX( true );\n\t\t\twidthRef.current = width;\n\t\t}\n\n\t\tif ( didHeightChange ) {\n\t\t\tsetMoveY( true );\n\t\t\theightRef.current = height;\n\t\t}\n\n\t\tonResize( { width, height } );\n\t\tdebounceUnsetMoveXY();\n\t}, [ width, height, onResize, debounceUnsetMoveXY ] );\n\n\tconst label = getSizeLabel( {\n\t\taxis,\n\t\theight,\n\t\tmoveX,\n\t\tmoveY,\n\t\tposition,\n\t\tshowPx,\n\t\twidth,\n\t} );\n\n\treturn {\n\t\tlabel,\n\t\tresizeListener,\n\t};\n}\n\ninterface GetSizeLabelArgs {\n\taxis?: Axis;\n\theight: number | null;\n\tmoveX: boolean;\n\tmoveY: boolean;\n\tposition: Position;\n\tshowPx: boolean;\n\twidth: number | null;\n}\n\n/**\n * Gets the resize label based on width and height values (as well as recent changes).\n *\n * @param props\n * @param props.axis Only shows the label corresponding to the axis.\n * @param props.height Height value.\n * @param props.moveX Recent width (x axis) changes.\n * @param props.moveY Recent width (y axis) changes.\n * @param props.position Adjusts label value.\n * @param props.showPx Whether to add `PX` to the label.\n * @param props.width Width value.\n *\n * @return The rendered label.\n */\nfunction getSizeLabel( {\n\taxis,\n\theight,\n\tmoveX = false,\n\tmoveY = false,\n\tposition = POSITIONS.bottom,\n\tshowPx = false,\n\twidth,\n}: GetSizeLabelArgs ): string | undefined {\n\tif ( ! moveX && ! moveY ) return undefined;\n\n\t/*\n\t * Corner position...\n\t * We want the label to appear like width x height.\n\t */\n\tif ( position === POSITIONS.corner ) {\n\t\treturn `${ width } x ${ height }`;\n\t}\n\n\t/*\n\t * Other POSITIONS...\n\t * The label will combine both width x height values if both\n\t * values have recently been changed.\n\t *\n\t * Otherwise, only width or height will be displayed.\n\t * The `PX` unit will be added, if specified by the `showPx` prop.\n\t */\n\tconst labelUnit = showPx ? ' px' : '';\n\n\tif ( axis ) {\n\t\tif ( axis === 'x' && moveX ) {\n\t\t\treturn `${ width }${ labelUnit }`;\n\t\t}\n\t\tif ( axis === 'y' && moveY ) {\n\t\t\treturn `${ height }${ labelUnit }`;\n\t\t}\n\t}\n\n\tif ( moveX && moveY ) {\n\t\treturn `${ width } x ${ height }`;\n\t}\n\tif ( moveX ) {\n\t\treturn `${ width }${ labelUnit }`;\n\t}\n\tif ( moveY ) {\n\t\treturn `${ height }${ labelUnit }`;\n\t}\n\n\treturn undefined;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/resizable-box/resize-tooltip/utils.ts"],"names":["noop","POSITIONS","bottom","corner","useResizeLabel","axis","fadeTimeout","onResize","position","showPx","resizeListener","sizes","isAxisControlled","moveX","setMoveX","moveY","setMoveY","width","height","heightRef","widthRef","moveTimeoutRef","debounceUnsetMoveXY","unsetMoveXY","current","window","clearTimeout","setTimeout","isRendered","didWidthChange","didHeightChange","label","getSizeLabel","undefined","labelUnit"],"mappings":";;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAIO,MAAMC,SAAS,GAAG;AACxBC,EAAAA,MAAM,EAAE,QADgB;AAExBC,EAAAA,MAAM,EAAE;AAFgB,CAAlB;;;AAsBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAT,OAMsC;AAAA,MANb;AAC/BC,IAAAA,IAD+B;AAE/BC,IAAAA,WAAW,GAAG,GAFiB;AAG/BC,IAAAA,QAAQ,GAAGP,IAHoB;AAI/BQ,IAAAA,QAAQ,GAAG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ARnB;AACtB3B,IAAAA,IADsB;AAEtBa,IAAAA,MAFsB;AAGtBL,IAAAA,KAAK,GAAG,KAHc;AAItBE,IAAAA,KAAK,GAAG,KAJc;AAKtBP,IAAAA,QAAQ,GAAGP,SAAS,CAACC,MALC;AAMtBO,IAAAA,MAAM,GAAG,KANa;AAOtBQ,IAAAA;AAPsB,GAQmB;AACzC,MAAK,CAAEJ,KAAF,IAAW,CAAEE,KAAlB,EAA0B,OAAOkB,SAAP;AAE1B;AACD;AACA;AACA;;AACC,MAAKzB,QAAQ,KAAKP,SAAS,CAACE,MAA5B,EAAqC;AACpC,WAAQ,GAAGc,KAAO,MAAMC,MAAQ,EAAhC;AACA;AAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;AACC,QAAMgB,SAAS,GAAGzB,MAAM,GAAG,KAAH,GAAW,EAAnC;;AAEA,MAAKJ,IAAL,EAAY;AACX,QAAKA,IAAI,KAAK,GAAT,IAAgBQ,KAArB,EAA6B;AAC5B,aAAQ,GAAGI,KAAO,GAAGiB,SAAW,EAAhC;AACA;;AACD,QAAK7B,IAAI,KAAK,GAAT,IAAgBU,KAArB,EAA6B;AAC5B,aAAQ,GAAGG,MAAQ,GAAGgB,SAAW,EAAjC;AACA;AACD;;AAED,MAAKrB,KAAK,IAAIE,KAAd,EAAsB;AACrB,WAAQ,GAAGE,KAAO,MAAMC,MAAQ,EAAhC;AACA;;AACD,MAAKL,KAAL,EAAa;AACZ,WAAQ,GAAGI,KAAO,GAAGiB,SAAW,EAAhC;AACA;;AACD,MAAKnB,KAAL,EAAa;AACZ,WAAQ,GAAGG,MAAQ,GAAGgB,SAAW,EAAjC;AACA;;AAED,SAAOD,SAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef, useState } from '@wordpress/element';\nimport { useResizeObserver } from '@wordpress/compose';\n\nconst noop = () => {};\n\nexport type Axis = 'x' | 'y';\n\nexport const POSITIONS = {\n\tbottom: 'bottom',\n\tcorner: 'corner',\n} as const;\n\nexport type Position = typeof POSITIONS[ keyof typeof POSITIONS ];\n\ninterface UseResizeLabelProps {\n\t/** The label value. */\n\tlabel?: string;\n\t/** Element to be rendered for resize listening events. */\n\tresizeListener: JSX.Element;\n}\n\ninterface UseResizeLabelArgs {\n\taxis?: Axis;\n\tfadeTimeout: number;\n\tonResize( data: { width: number | null; height: number | null } ): void;\n\tposition: Position;\n\tshowPx: boolean;\n}\n\n/**\n * Custom hook that manages resize listener events. It also provides a label\n * based on current resize width x height values.\n *\n * @param props\n * @param props.axis Only shows the label corresponding to the axis.\n * @param props.fadeTimeout Duration (ms) before deactivating the resize label.\n * @param props.onResize Callback when a resize occurs. Provides { width, height } callback.\n * @param props.position Adjusts label value.\n * @param props.showPx Whether to add `PX` to the label.\n *\n * @return Properties for hook.\n */\nexport function useResizeLabel( {\n\taxis,\n\tfadeTimeout = 180,\n\tonResize = noop,\n\tposition = POSITIONS.bottom,\n\tshowPx = false,\n}: UseResizeLabelArgs ): UseResizeLabelProps {\n\t/*\n\t * The width/height values derive from this special useResizeObserver hook.\n\t * This custom hook uses the ResizeObserver API to listen for resize events.\n\t */\n\tconst [ resizeListener, sizes ] = useResizeObserver();\n\n\t/*\n\t * Indicates if the x/y axis is preferred.\n\t * If set, we will avoid resetting the moveX and moveY values.\n\t * This will allow for the preferred axis values to persist in the label.\n\t */\n\tconst isAxisControlled = !! axis;\n\n\t/*\n\t * The moveX and moveY values are used to track whether the label should\n\t * display width, height, or width x height.\n\t */\n\tconst [ moveX, setMoveX ] = useState( false );\n\tconst [ moveY, setMoveY ] = useState( false );\n\n\t/*\n\t * Cached dimension values to check for width/height updates from the\n\t * sizes property from useResizeAware()\n\t */\n\tconst { width, height } = sizes;\n\tconst heightRef = useRef( height );\n\tconst widthRef = useRef( width );\n\n\t/*\n\t * This timeout is used with setMoveX and setMoveY to determine of\n\t * both width and height values have changed at (roughly) the same time.\n\t */\n\tconst moveTimeoutRef = useRef< number >();\n\n\tconst debounceUnsetMoveXY = useCallback( () => {\n\t\tconst unsetMoveXY = () => {\n\t\t\t/*\n\t\t\t * If axis is controlled, we will avoid resetting the moveX and moveY values.\n\t\t\t * This will allow for the preferred axis values to persist in the label.\n\t\t\t */\n\t\t\tif ( isAxisControlled ) return;\n\t\t\tsetMoveX( false );\n\t\t\tsetMoveY( false );\n\t\t};\n\n\t\tif ( moveTimeoutRef.current ) {\n\t\t\twindow.clearTimeout( moveTimeoutRef.current );\n\t\t}\n\n\t\tmoveTimeoutRef.current = window.setTimeout( unsetMoveXY, fadeTimeout );\n\t}, [ fadeTimeout, isAxisControlled ] );\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * On the initial render of useResizeAware, the height and width values are\n\t\t * null. They are calculated then set using via an internal useEffect hook.\n\t\t */\n\t\tconst isRendered = width !== null || height !== null;\n\n\t\tif ( ! isRendered ) return;\n\n\t\tconst didWidthChange = width !== widthRef.current;\n\t\tconst didHeightChange = height !== heightRef.current;\n\n\t\tif ( ! didWidthChange && ! didHeightChange ) return;\n\n\t\t/*\n\t\t * After the initial render, the useResizeAware will set the first\n\t\t * width and height values. We'll sync those values with our\n\t\t * width and height refs. However, we shouldn't render our Tooltip\n\t\t * label on this first cycle.\n\t\t */\n\t\tif ( width && ! widthRef.current && height && ! heightRef.current ) {\n\t\t\twidthRef.current = width;\n\t\t\theightRef.current = height;\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * After the first cycle, we can track width and height changes.\n\t\t */\n\t\tif ( didWidthChange ) {\n\t\t\tsetMoveX( true );\n\t\t\twidthRef.current = width;\n\t\t}\n\n\t\tif ( didHeightChange ) {\n\t\t\tsetMoveY( true );\n\t\t\theightRef.current = height;\n\t\t}\n\n\t\tonResize( { width, height } );\n\t\tdebounceUnsetMoveXY();\n\t}, [ width, height, onResize, debounceUnsetMoveXY ] );\n\n\tconst label = getSizeLabel( {\n\t\taxis,\n\t\theight,\n\t\tmoveX,\n\t\tmoveY,\n\t\tposition,\n\t\tshowPx,\n\t\twidth,\n\t} );\n\n\treturn {\n\t\tlabel,\n\t\tresizeListener,\n\t};\n}\n\ninterface GetSizeLabelArgs {\n\taxis?: Axis;\n\theight: number | null;\n\tmoveX: boolean;\n\tmoveY: boolean;\n\tposition: Position;\n\tshowPx: boolean;\n\twidth: number | null;\n}\n\n/**\n * Gets the resize label based on width and height values (as well as recent changes).\n *\n * @param props\n * @param props.axis Only shows the label corresponding to the axis.\n * @param props.height Height value.\n * @param props.moveX Recent width (x axis) changes.\n * @param props.moveY Recent width (y axis) changes.\n * @param props.position Adjusts label value.\n * @param props.showPx Whether to add `PX` to the label.\n * @param props.width Width value.\n *\n * @return The rendered label.\n */\nfunction getSizeLabel( {\n\taxis,\n\theight,\n\tmoveX = false,\n\tmoveY = false,\n\tposition = POSITIONS.bottom,\n\tshowPx = false,\n\twidth,\n}: GetSizeLabelArgs ): string | undefined {\n\tif ( ! moveX && ! moveY ) return undefined;\n\n\t/*\n\t * Corner position...\n\t * We want the label to appear like width x height.\n\t */\n\tif ( position === POSITIONS.corner ) {\n\t\treturn `${ width } x ${ height }`;\n\t}\n\n\t/*\n\t * Other POSITIONS...\n\t * The label will combine both width x height values if both\n\t * values have recently been changed.\n\t *\n\t * Otherwise, only width or height will be displayed.\n\t * The `PX` unit will be added, if specified by the `showPx` prop.\n\t */\n\tconst labelUnit = showPx ? ' px' : '';\n\n\tif ( axis ) {\n\t\tif ( axis === 'x' && moveX ) {\n\t\t\treturn `${ width }${ labelUnit }`;\n\t\t}\n\t\tif ( axis === 'y' && moveY ) {\n\t\t\treturn `${ height }${ labelUnit }`;\n\t\t}\n\t}\n\n\tif ( moveX && moveY ) {\n\t\treturn `${ width } x ${ height }`;\n\t}\n\tif ( moveX ) {\n\t\treturn `${ width }${ labelUnit }`;\n\t}\n\tif ( moveY ) {\n\t\treturn `${ height }${ labelUnit }`;\n\t}\n\n\treturn undefined;\n}\n"]}
@@ -35,8 +35,8 @@ const NOTICE_TIMEOUT = 10000;
35
35
  * Custom hook which announces the message with the given politeness, if a
36
36
  * valid message is provided.
37
37
  *
38
- * @param message Message to announce.
39
- * @param politeness Politeness to announce.
38
+ * @param message Message to announce.
39
+ * @param politeness Politeness to announce.
40
40
  */
41
41
 
42
42
  function useSpokenMessage(message, politeness) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/snackbar/index.tsx"],"names":["NOTICE_TIMEOUT","useSpokenMessage","message","politeness","spokenMessage","UnforwardedSnackbar","ref","className","children","actions","onRemove","icon","explicitDismiss","onDismiss","listRef","dismissMe","event","preventDefault","current","focus","onActionClick","onClick","stopPropagation","timeoutHandle","setTimeout","clearTimeout","classes","length","snackbarContentClassnames","undefined","map","index","label","url","Snackbar"],"mappings":";;;;;;;;;AAUA;;AANA;;AAKA;;AAEA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;AAMA,MAAMA,cAAc,GAAG,KAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CACCC,OADD,EAECC,UAFD,EAGE;AACD,QAAMC,aAAa,GAClB,OAAOF,OAAP,KAAmB,QAAnB,GAA8BA,OAA9B,GAAwC,6BAAgBA,OAAhB,CADzC;AAGA,0BAAW,MAAM;AAChB,QAAKE,aAAL,EAAqB;AACpB,uBAAOA,aAAP,EAAsBD,UAAtB;AACA;AACD,GAJD,EAIG,CAAEC,aAAF,EAAiBD,UAAjB,CAJH;AAKA;;AAED,SAASE,mBAAT,OAgBCC,GAhBD,EAiBE;AAAA,MAhBD;AACCC,IAAAA,SADD;AAECC,IAAAA,QAFD;AAGCJ,IAAAA,aAAa,GAAGI,QAHjB;AAICL,IAAAA,UAAU,GAAG,QAJd;AAKCM,IAAAA,OAAO,GAAG,EALX;AAMCC,IAAAA,QAND;AAOCC,IAAAA,IAAI,GAAG,IAPR;AAQCC,IAAAA,eAAe,GAAG,KARnB;AASC;AACA;AACA;AACAC,IAAAA,SAZD;AAaCC,IAAAA;AAbD,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G,SALX;AAMC,IAAA,UAAU,EAAGA;AANd,cArBF,CATD,CADD;AA6CA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMmB,QAAQ,GAAG,yBAAY7B,mBAAZ,CAAjB;;eAEQ6B,Q","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { useEffect, forwardRef, renderToString } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { SnackbarProps } from './types';\nimport type { NoticeAction } from '../notice/types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nconst NOTICE_TIMEOUT = 10000;\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param message Message to announce.\n * @param politeness Politeness to announce.\n */\nfunction useSpokenMessage(\n\tmessage: SnackbarProps[ 'spokenMessage' ],\n\tpoliteness: NonNullable< SnackbarProps[ 'politeness' ] >\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction UnforwardedSnackbar(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tspokenMessage = children,\n\t\tpoliteness = 'polite',\n\t\tactions = [],\n\t\tonRemove,\n\t\ticon = null,\n\t\texplicitDismiss = false,\n\t\t// onDismiss is a callback executed when the snackbar is dismissed.\n\t\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t\t// actually the function to call to remove the snackbar from the UI.\n\t\tonDismiss,\n\t\tlistRef,\n\t}: WordPressComponentProps< SnackbarProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tfunction dismissMe( event: KeyboardEvent | MouseEvent ) {\n\t\tif ( event && event.preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// Prevent focus loss by moving it to the list element.\n\t\tlistRef?.current?.focus();\n\n\t\tonDismiss?.();\n\t\tonRemove?.();\n\t}\n\n\tfunction onActionClick(\n\t\tevent: MouseEvent< HTMLButtonElement >,\n\t\tonClick: NoticeAction[ 'onClick' ]\n\t) {\n\t\tevent.stopPropagation();\n\n\t\tonRemove?.();\n\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\t// Only set up the timeout dismiss if we're not explicitly dismissing.\n\tuseEffect( () => {\n\t\tconst timeoutHandle = setTimeout( () => {\n\t\t\tif ( ! explicitDismiss ) {\n\t\t\t\tonDismiss?.();\n\t\t\t\tonRemove?.();\n\t\t\t}\n\t\t}, NOTICE_TIMEOUT );\n\n\t\treturn () => clearTimeout( timeoutHandle );\n\t}, [ onDismiss, onRemove, explicitDismiss ] );\n\n\tconst classes = classnames( className, 'components-snackbar', {\n\t\t'components-snackbar-explicit-dismiss': !! explicitDismiss,\n\t} );\n\tif ( actions && actions.length > 1 ) {\n\t\t// We need to inform developers that snackbar only accepts 1 action.\n\t\twarning(\n\t\t\t'Snackbar can only have 1 action, use Notice if your message require many messages'\n\t\t);\n\t\t// return first element only while keeping it inside an array\n\t\tactions = [ actions[ 0 ] ];\n\t}\n\n\tconst snackbarContentClassnames = classnames(\n\t\t'components-snackbar__content',\n\t\t{\n\t\t\t'components-snackbar__content-with-icon': !! icon,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classes }\n\t\t\tonClick={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\ttabIndex={ 0 }\n\t\t\trole={ ! explicitDismiss ? 'button' : '' }\n\t\t\tonKeyPress={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\taria-label={ ! explicitDismiss ? __( 'Dismiss this notice' ) : '' }\n\t\t>\n\t\t\t<div className={ snackbarContentClassnames }>\n\t\t\t\t{ icon && (\n\t\t\t\t\t<div className=\"components-snackbar__icon\">{ icon }</div>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ actions.map( ( { label, onClick, url }, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\tevent: MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t) => onActionClick( event, onClick ) }\n\t\t\t\t\t\t\tclassName=\"components-snackbar__action\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ explicitDismiss && (\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label=\"Dismiss this notice\"\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\tclassName=\"components-snackbar__dismiss-button\"\n\t\t\t\t\t\tonClick={ dismissMe }\n\t\t\t\t\t\tonKeyPress={ dismissMe }\n\t\t\t\t\t>\n\t\t\t\t\t\t&#x2715;\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * A Snackbar displays a succinct message that is cleared out after a small delay.\n *\n * It can also offer the user options, like viewing a published post.\n * But these options should also be available elsewhere in the UI.\n *\n * ```jsx\n * const MySnackbarNotice = () => (\n * <Snackbar>Post published successfully.</Snackbar>\n * );\n * ```\n */\nexport const Snackbar = forwardRef( UnforwardedSnackbar );\n\nexport default Snackbar;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/snackbar/index.tsx"],"names":["NOTICE_TIMEOUT","useSpokenMessage","message","politeness","spokenMessage","UnforwardedSnackbar","ref","className","children","actions","onRemove","icon","explicitDismiss","onDismiss","listRef","dismissMe","event","preventDefault","current","focus","onActionClick","onClick","stopPropagation","timeoutHandle","setTimeout","clearTimeout","classes","length","snackbarContentClassnames","undefined","map","index","label","url","Snackbar"],"mappings":";;;;;;;;;AAUA;;AANA;;AAKA;;AAEA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;AAMA,MAAMA,cAAc,GAAG,KAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CACCC,OADD,EAECC,UAFD,EAGE;AACD,QAAMC,aAAa,GAClB,OAAOF,OAAP,KAAmB,QAAnB,GAA8BA,OAA9B,GAAwC,6BAAgBA,OAAhB,CADzC;AAGA,0BAAW,MAAM;AAChB,QAAKE,aAAL,EAAqB;AACpB,uBAAOA,aAAP,EAAsBD,UAAtB;AACA;AACD,GAJD,EAIG,CAAEC,aAAF,EAAiBD,UAAjB,CAJH;AAKA;;AAED,SAASE,mBAAT,OAgBCC,GAhBD,EAiBE;AAAA,MAhBD;AACCC,IAAAA,SADD;AAECC,IAAAA,QAFD;AAGCJ,IAAAA,aAAa,GAAGI,QAHjB;AAICL,IAAAA,UAAU,GAAG,QAJd;AAKCM,IAAAA,OAAO,GAAG,EALX;AAMCC,IAAAA,QAND;AAOCC,IAAAA,IAAI,GAAG,IAPR;AAQCC,IAAAA,eAAe,GAAG,KARnB;AASC;AACA;AACA;AACAC,IAAAA,SAZD;AAaCC,IAAAA;AAbD,GAgBC;;AACD,WAASC,SAAT,CAAoBC,KAApB,EAAwD;AAAA;;AACvD,QAAKA,KAAK,IAAIA,KAAK,CAACC,cAApB,EAAqC;AACpCD,MAAAA,KAAK,CAACC,cAAN;AACA,KAHsD,CAKvD;;;AACAH,IAAAA,OAAO,SAAP,IAAAA,OAAO,WAAP,gCAAAA,OAAO,CAAEI,OAAT,sEAAkBC,KAAlB;AAEAN,IAAAA,SAAS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IAAA,OAAO,EAAG,CAAEd,eAAF,GAAoBG,SAApB,GAAgCc,SAH3C;AAIC,IAAA,QAAQ,EAAG,CAJZ;AAKC,IAAA,IAAI,EAAG,CAAEjB,eAAF,GAAoB,QAApB,GAA+B,EALvC;AAMC,IAAA,UAAU,EAAG,CAAEA,eAAF,GAAoBG,SAApB,GAAgCc,SAN9C;AAOC,kBAAa,CAAEjB,eAAF,GAAoB,cAAI,qBAAJ,CAApB,GAAkD;AAPhE,KASC;AAAK,IAAA,SAAS,EAAGgB;AAAjB,KACGjB,IAAI,IACL;AAAK,IAAA,SAAS,EAAC;AAAf,KAA6CA,IAA7C,CAFF,EAIGH,QAJH,EAKGC,OAAO,CAACqB,GAAR,CAAa,QAA2BC,KAA3B,KAAsC;AAAA,QAApC;AAAEC,MAAAA,KAAF;AAASX,MAAAA,OAAT;AAAkBY,MAAAA;AAAlB,KAAoC;AACpD,WACC,4BAAC,eAAD;AACC,MAAA,GAAG,EAAGF,KADP;AAEC,MAAA,IAAI,EAAGE,GAFR;AAGC,MAAA,OAAO,EAAC,UAHT;AAIC,MAAA,OAAO,EACNjB,KADS,IAELI,aAAa,CAAEJ,KAAF,EAASK,OAAT,CANnB;AAOC,MAAA,SAAS,EAAC;AAPX,OASGW,KATH,CADD;AAaA,GAdC,CALH,EAoBGpB,eAAe,IAChB;AACC,IAAA,IAAI,EAAC,QADN;AAEC,kBAAW,qBAFZ;AAGC,IAAA,QAAQ,EAAG,CAHZ;AAIC,IAAA,SAAS,EAAC,qCAJX;AAKC,IAAA,OAAO,EAAGG,SALX;AAMC,IAAA,UAAU,EAAGA;AANd,cArBF,CATD,CADD;AA6CA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMmB,QAAQ,GAAG,yBAAY7B,mBAAZ,CAAjB;;eAEQ6B,Q","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport { useEffect, forwardRef, renderToString } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { SnackbarProps } from './types';\nimport type { NoticeAction } from '../notice/types';\nimport type { WordPressComponentProps } from '../ui/context';\n\nconst NOTICE_TIMEOUT = 10000;\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param message Message to announce.\n * @param politeness Politeness to announce.\n */\nfunction useSpokenMessage(\n\tmessage: SnackbarProps[ 'spokenMessage' ],\n\tpoliteness: NonNullable< SnackbarProps[ 'politeness' ] >\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction UnforwardedSnackbar(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tspokenMessage = children,\n\t\tpoliteness = 'polite',\n\t\tactions = [],\n\t\tonRemove,\n\t\ticon = null,\n\t\texplicitDismiss = false,\n\t\t// onDismiss is a callback executed when the snackbar is dismissed.\n\t\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t\t// actually the function to call to remove the snackbar from the UI.\n\t\tonDismiss,\n\t\tlistRef,\n\t}: WordPressComponentProps< SnackbarProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tfunction dismissMe( event: KeyboardEvent | MouseEvent ) {\n\t\tif ( event && event.preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// Prevent focus loss by moving it to the list element.\n\t\tlistRef?.current?.focus();\n\n\t\tonDismiss?.();\n\t\tonRemove?.();\n\t}\n\n\tfunction onActionClick(\n\t\tevent: MouseEvent< HTMLButtonElement >,\n\t\tonClick: NoticeAction[ 'onClick' ]\n\t) {\n\t\tevent.stopPropagation();\n\n\t\tonRemove?.();\n\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\t// Only set up the timeout dismiss if we're not explicitly dismissing.\n\tuseEffect( () => {\n\t\tconst timeoutHandle = setTimeout( () => {\n\t\t\tif ( ! explicitDismiss ) {\n\t\t\t\tonDismiss?.();\n\t\t\t\tonRemove?.();\n\t\t\t}\n\t\t}, NOTICE_TIMEOUT );\n\n\t\treturn () => clearTimeout( timeoutHandle );\n\t}, [ onDismiss, onRemove, explicitDismiss ] );\n\n\tconst classes = classnames( className, 'components-snackbar', {\n\t\t'components-snackbar-explicit-dismiss': !! explicitDismiss,\n\t} );\n\tif ( actions && actions.length > 1 ) {\n\t\t// We need to inform developers that snackbar only accepts 1 action.\n\t\twarning(\n\t\t\t'Snackbar can only have 1 action, use Notice if your message require many messages'\n\t\t);\n\t\t// return first element only while keeping it inside an array\n\t\tactions = [ actions[ 0 ] ];\n\t}\n\n\tconst snackbarContentClassnames = classnames(\n\t\t'components-snackbar__content',\n\t\t{\n\t\t\t'components-snackbar__content-with-icon': !! icon,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classes }\n\t\t\tonClick={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\ttabIndex={ 0 }\n\t\t\trole={ ! explicitDismiss ? 'button' : '' }\n\t\t\tonKeyPress={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\taria-label={ ! explicitDismiss ? __( 'Dismiss this notice' ) : '' }\n\t\t>\n\t\t\t<div className={ snackbarContentClassnames }>\n\t\t\t\t{ icon && (\n\t\t\t\t\t<div className=\"components-snackbar__icon\">{ icon }</div>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ actions.map( ( { label, onClick, url }, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\tevent: MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t) => onActionClick( event, onClick ) }\n\t\t\t\t\t\t\tclassName=\"components-snackbar__action\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ explicitDismiss && (\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label=\"Dismiss this notice\"\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\tclassName=\"components-snackbar__dismiss-button\"\n\t\t\t\t\t\tonClick={ dismissMe }\n\t\t\t\t\t\tonKeyPress={ dismissMe }\n\t\t\t\t\t>\n\t\t\t\t\t\t&#x2715;\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * A Snackbar displays a succinct message that is cleared out after a small delay.\n *\n * It can also offer the user options, like viewing a published post.\n * But these options should also be available elsewhere in the UI.\n *\n * ```jsx\n * const MySnackbarNotice = () => (\n * <Snackbar>Post published successfully.</Snackbar>\n * );\n * ```\n */\nexport const Snackbar = forwardRef( UnforwardedSnackbar );\n\nexport default Snackbar;\n"]}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.default = exports.Toolbar = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
@@ -30,18 +30,7 @@ var _toolbarContainer = _interopRequireDefault(require("./toolbar-container"));
30
30
  /**
31
31
  * Internal dependencies
32
32
  */
33
-
34
- /**
35
- * Renders a toolbar.
36
- *
37
- * To add controls, simply pass `ToolbarButton` components as children.
38
- *
39
- * @param {Object} props Component props.
40
- * @param {string} [props.className] Class to set on the container div.
41
- * @param {string} [props.label] ARIA label for toolbar container.
42
- * @param {Object} ref React Element ref.
43
- */
44
- function Toolbar(_ref, ref) {
33
+ function UnforwardedToolbar(_ref, ref) {
45
34
  let {
46
35
  className,
47
36
  label,
@@ -67,8 +56,30 @@ function Toolbar(_ref, ref) {
67
56
  ref: ref
68
57
  }, props));
69
58
  }
59
+ /**
60
+ * Renders a toolbar.
61
+ *
62
+ * To add controls, simply pass `ToolbarButton` components as children.
63
+ *
64
+ * ```jsx
65
+ * import { Toolbar, ToolbarButton } from '@wordpress/components';
66
+ * import { formatBold, formatItalic, link } from '@wordpress/icons';
67
+ *
68
+ * function MyToolbar() {
69
+ * return (
70
+ * <Toolbar label="Options">
71
+ * <ToolbarButton icon={ formatBold } label="Bold" />
72
+ * <ToolbarButton icon={ formatItalic } label="Italic" />
73
+ * <ToolbarButton icon={ link } label="Link" />
74
+ * </Toolbar>
75
+ * );
76
+ * }
77
+ * ```
78
+ */
70
79
 
71
- var _default = (0, _element.forwardRef)(Toolbar);
72
80
 
81
+ const Toolbar = (0, _element.forwardRef)(UnforwardedToolbar);
82
+ exports.Toolbar = Toolbar;
83
+ var _default = Toolbar;
73
84
  exports.default = _default;
74
85
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/toolbar/toolbar/index.js"],"names":["Toolbar","ref","className","label","props","since","alternative","link","finalClassName"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AAKA;;AACA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,OAAkDC,GAAlD,EAAwD;AAAA,MAAtC;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,KAAb;AAAoB,OAAGC;AAAvB,GAAsC;;AACvD,MAAK,CAAED,KAAP,EAAe;AACd,6BAAY,kCAAZ,EAAgD;AAC/CE,MAAAA,KAAK,EAAE,KADwC;AAE/CC,MAAAA,WAAW,EAAE,wBAFkC;AAG/CC,MAAAA,IAAI,EAAE;AAHyC,KAAhD;AAKA,WAAO,4BAAC,qBAAD,6BAAmBH,KAAnB;AAA2B,MAAA,SAAS,EAAGF;AAAvC,OAAP;AACA,GARsD,CASvD;;;AACA,QAAMM,cAAc,GAAG,yBACtB,+BADsB,EAEtBN,SAFsB,CAAvB;AAIA,SACC,4BAAC,yBAAD;AACC,IAAA,SAAS,EAAGM,cADb;AAEC,IAAA,KAAK,EAAGL,KAFT;AAGC,IAAA,GAAG,EAAGF;AAHP,KAIMG,KAJN,EADD;AAQA;;eAEc,yBAAYJ,OAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport ToolbarGroup from '../toolbar-group';\nimport ToolbarContainer from './toolbar-container';\n\n/**\n * Renders a toolbar.\n *\n * To add controls, simply pass `ToolbarButton` components as children.\n *\n * @param {Object} props Component props.\n * @param {string} [props.className] Class to set on the container div.\n * @param {string} [props.label] ARIA label for toolbar container.\n * @param {Object} ref React Element ref.\n */\nfunction Toolbar( { className, label, ...props }, ref ) {\n\tif ( ! label ) {\n\t\tdeprecated( 'Using Toolbar without label prop', {\n\t\t\tsince: '5.6',\n\t\t\talternative: 'ToolbarGroup component',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/components/toolbar/',\n\t\t} );\n\t\treturn <ToolbarGroup { ...props } className={ className } />;\n\t}\n\t// `ToolbarGroup` already uses components-toolbar for compatibility reasons.\n\tconst finalClassName = classnames(\n\t\t'components-accessible-toolbar',\n\t\tclassName\n\t);\n\treturn (\n\t\t<ToolbarContainer\n\t\t\tclassName={ finalClassName }\n\t\t\tlabel={ label }\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( Toolbar );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/toolbar/toolbar/index.tsx"],"names":["UnforwardedToolbar","ref","className","label","props","since","alternative","link","finalClassName","Toolbar"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAOA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AAMA,SAASA,kBAAT,OAMCC,GAND,EAOE;AAAA,MAND;AACCC,IAAAA,SADD;AAECC,IAAAA,KAFD;AAGC,OAAGC;AAHJ,GAMC;;AACD,MAAK,CAAED,KAAP,EAAe;AACd,6BAAY,kCAAZ,EAAgD;AAC/CE,MAAAA,KAAK,EAAE,KADwC;AAE/CC,MAAAA,WAAW,EAAE,wBAFkC;AAG/CC,MAAAA,IAAI,EAAE;AAHyC,KAAhD;AAKA,WAAO,4BAAC,qBAAD,6BAAmBH,KAAnB;AAA2B,MAAA,SAAS,EAAGF;AAAvC,OAAP;AACA,GARA,CASD;;;AACA,QAAMM,cAAc,GAAG,yBACtB,+BADsB,EAEtBN,SAFsB,CAAvB;AAIA,SACC,4BAAC,yBAAD;AACC,IAAA,SAAS,EAAGM,cADb;AAEC,IAAA,KAAK,EAAGL,KAFT;AAGC,IAAA,GAAG,EAAGF;AAHP,KAIMG,KAJN,EADD;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMK,OAAO,GAAG,yBAAYT,kBAAZ,CAAhB;;eACQS,O","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport ToolbarGroup from '../toolbar-group';\nimport ToolbarContainer from './toolbar-container';\nimport type { ToolbarProps } from './types';\nimport type { WordPressComponentProps } from '../../ui/context';\n\nfunction UnforwardedToolbar(\n\t{\n\t\tclassName,\n\t\tlabel,\n\t\t...props\n\t}: WordPressComponentProps< ToolbarProps, 'div', false >,\n\tref: ForwardedRef< any >\n) {\n\tif ( ! label ) {\n\t\tdeprecated( 'Using Toolbar without label prop', {\n\t\t\tsince: '5.6',\n\t\t\talternative: 'ToolbarGroup component',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/components/toolbar/',\n\t\t} );\n\t\treturn <ToolbarGroup { ...props } className={ className } />;\n\t}\n\t// `ToolbarGroup` already uses components-toolbar for compatibility reasons.\n\tconst finalClassName = classnames(\n\t\t'components-accessible-toolbar',\n\t\tclassName\n\t);\n\treturn (\n\t\t<ToolbarContainer\n\t\t\tclassName={ finalClassName }\n\t\t\tlabel={ label }\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a toolbar.\n *\n * To add controls, simply pass `ToolbarButton` components as children.\n *\n * ```jsx\n * import { Toolbar, ToolbarButton } from '@wordpress/components';\n * import { formatBold, formatItalic, link } from '@wordpress/icons';\n *\n * function MyToolbar() {\n * return (\n * <Toolbar label=\"Options\">\n * <ToolbarButton icon={ formatBold } label=\"Bold\" />\n * <ToolbarButton icon={ formatItalic } label=\"Italic\" />\n * <ToolbarButton icon={ link } label=\"Link\" />\n * </Toolbar>\n * );\n * }\n * ```\n */\nexport const Toolbar = forwardRef( UnforwardedToolbar );\nexport default Toolbar;\n"]}