@wordpress/components 27.4.0 → 27.5.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 (474) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/build/alignment-matrix-control/index.js +3 -1
  3. package/build/alignment-matrix-control/index.js.map +1 -1
  4. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +8 -8
  5. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  6. package/build/alignment-matrix-control/utils.js +6 -2
  7. package/build/alignment-matrix-control/utils.js.map +1 -1
  8. package/build/autocomplete/autocompleter-ui.js +3 -1
  9. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  10. package/build/autocomplete/index.js +21 -7
  11. package/build/autocomplete/index.js.map +1 -1
  12. package/build/checkbox-control/index.js +9 -2
  13. package/build/checkbox-control/index.js.map +1 -1
  14. package/build/color-picker/hex-input.js +3 -1
  15. package/build/color-picker/hex-input.js.map +1 -1
  16. package/build/color-picker/hue-picker.native.js +6 -2
  17. package/build/color-picker/hue-picker.native.js.map +1 -1
  18. package/build/color-picker/index.native.js +9 -3
  19. package/build/color-picker/index.native.js.map +1 -1
  20. package/build/color-picker/saturation-picker.native.js +6 -2
  21. package/build/color-picker/saturation-picker.native.js.map +1 -1
  22. package/build/color-picker/use-deprecated-props.js +9 -3
  23. package/build/color-picker/use-deprecated-props.js.map +1 -1
  24. package/build/context/context-connect.js +6 -2
  25. package/build/context/context-connect.js.map +1 -1
  26. package/build/custom-select-control-v2/legacy-component/index.js +3 -1
  27. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  28. package/build/drop-zone/index.js +72 -64
  29. package/build/drop-zone/index.js.map +1 -1
  30. package/build/dropdown/styles.js +5 -3
  31. package/build/dropdown/styles.js.map +1 -1
  32. package/build/duotone-picker/utils.js +3 -1
  33. package/build/duotone-picker/utils.js.map +1 -1
  34. package/build/elevation/hook.js +5 -6
  35. package/build/elevation/hook.js.map +1 -1
  36. package/build/focal-point-picker/controls.js +3 -1
  37. package/build/focal-point-picker/controls.js.map +1 -1
  38. package/build/focal-point-picker/index.js +21 -7
  39. package/build/focal-point-picker/index.js.map +1 -1
  40. package/build/focal-point-picker/styles/focal-point-picker-style.js +12 -12
  41. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  42. package/build/focal-point-picker/tooltip/index.native.js +3 -8
  43. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  44. package/build/focal-point-picker/utils.js +3 -1
  45. package/build/focal-point-picker/utils.js.map +1 -1
  46. package/build/font-size-picker/index.js +3 -2
  47. package/build/font-size-picker/index.js.map +1 -1
  48. package/build/font-size-picker/types.js.map +1 -1
  49. package/build/input-control/input-field.js +3 -1
  50. package/build/input-control/input-field.js.map +1 -1
  51. package/build/input-control/label.js +3 -1
  52. package/build/input-control/label.js.map +1 -1
  53. package/build/input-control/styles/input-control-styles.js +31 -23
  54. package/build/input-control/styles/input-control-styles.js.map +1 -1
  55. package/build/input-control/utils.js +8 -4
  56. package/build/input-control/utils.js.map +1 -1
  57. package/build/item-group/item/hook.js +0 -4
  58. package/build/item-group/item/hook.js.map +1 -1
  59. package/build/mobile/gradient/index.native.js +3 -1
  60. package/build/mobile/gradient/index.native.js.map +1 -1
  61. package/build/mobile/keyboard-aware-flat-list/index.android.js +9 -3
  62. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  63. package/build/mobile/keyboard-aware-flat-list/index.ios.js +15 -13
  64. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  65. package/build/mobile/keyboard-aware-flat-list/shared.native.js +33 -0
  66. package/build/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
  67. package/build/modal/aria-helper.js +9 -3
  68. package/build/modal/aria-helper.js.map +1 -1
  69. package/build/modal/index.js +6 -2
  70. package/build/modal/index.js.map +1 -1
  71. package/build/navigation/styles/navigation-styles.js +12 -12
  72. package/build/navigation/styles/navigation-styles.js.map +1 -1
  73. package/build/panel/body.js +3 -1
  74. package/build/panel/body.js.map +1 -1
  75. package/build/popover/index.js +3 -1
  76. package/build/popover/index.js.map +1 -1
  77. package/build/popover/overlay-middlewares.js +3 -1
  78. package/build/popover/overlay-middlewares.js.map +1 -1
  79. package/build/query-controls/author-select.js +3 -1
  80. package/build/query-controls/author-select.js.map +1 -1
  81. package/build/range-control/rail.js +1 -1
  82. package/build/range-control/rail.js.map +1 -1
  83. package/build/range-control/styles/range-control-styles.js +29 -29
  84. package/build/range-control/styles/range-control-styles.js.map +1 -1
  85. package/build/resizable-box/resize-tooltip/index.js +3 -1
  86. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  87. package/build/resizable-box/resize-tooltip/label.js +3 -1
  88. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  89. package/build/resizable-box/resize-tooltip/utils.js +12 -4
  90. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  91. package/build/select-control/index.js +3 -1
  92. package/build/select-control/index.js.map +1 -1
  93. package/build/select-control/styles/select-control-styles.js +8 -6
  94. package/build/select-control/styles/select-control-styles.js.map +1 -1
  95. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -3
  96. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  97. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +3 -3
  98. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  99. package/build/slot-fill/bubbles-virtually/use-slot-fills.js +2 -2
  100. package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  101. package/build/slot-fill/bubbles-virtually/use-slot.js +2 -2
  102. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  103. package/build/slot-fill/types.js.map +1 -1
  104. package/build/text/get-line-height.js +6 -2
  105. package/build/text/get-line-height.js.map +1 -1
  106. package/build/text/utils.js +6 -2
  107. package/build/text/utils.js.map +1 -1
  108. package/build/theme/color-algorithms.js +6 -2
  109. package/build/theme/color-algorithms.js.map +1 -1
  110. package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
  111. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  112. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  113. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  114. package/build/tree-grid/roving-tab-index-item.js +3 -1
  115. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  116. package/build/unit-control/index.js +3 -1
  117. package/build/unit-control/index.js.map +1 -1
  118. package/build/utils/colors.js +21 -7
  119. package/build/utils/colors.js.map +1 -1
  120. package/build/utils/font-size.js +3 -1
  121. package/build/utils/font-size.js.map +1 -1
  122. package/build/utils/get-valid-children.js +3 -1
  123. package/build/utils/get-valid-children.js.map +1 -1
  124. package/build/utils/input/base.js +2 -3
  125. package/build/utils/input/base.js.map +1 -1
  126. package/build/utils/strings.js +11 -57
  127. package/build/utils/strings.js.map +1 -1
  128. package/build/utils/use-responsive-value.js +3 -1
  129. package/build/utils/use-responsive-value.js.map +1 -1
  130. package/build/view/component.js +26 -8
  131. package/build/view/component.js.map +1 -1
  132. package/build-module/alignment-matrix-control/index.js +3 -1
  133. package/build-module/alignment-matrix-control/index.js.map +1 -1
  134. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  135. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  136. package/build-module/alignment-matrix-control/utils.js +6 -2
  137. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  138. package/build-module/autocomplete/autocompleter-ui.js +3 -1
  139. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  140. package/build-module/autocomplete/index.js +21 -7
  141. package/build-module/autocomplete/index.js.map +1 -1
  142. package/build-module/checkbox-control/index.js +9 -2
  143. package/build-module/checkbox-control/index.js.map +1 -1
  144. package/build-module/color-picker/hex-input.js +3 -1
  145. package/build-module/color-picker/hex-input.js.map +1 -1
  146. package/build-module/color-picker/hue-picker.native.js +6 -2
  147. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  148. package/build-module/color-picker/index.native.js +9 -3
  149. package/build-module/color-picker/index.native.js.map +1 -1
  150. package/build-module/color-picker/saturation-picker.native.js +6 -2
  151. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  152. package/build-module/color-picker/use-deprecated-props.js +9 -3
  153. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  154. package/build-module/context/context-connect.js +6 -2
  155. package/build-module/context/context-connect.js.map +1 -1
  156. package/build-module/custom-select-control-v2/legacy-component/index.js +3 -1
  157. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  158. package/build-module/drop-zone/index.js +72 -64
  159. package/build-module/drop-zone/index.js.map +1 -1
  160. package/build-module/dropdown/styles.js +5 -3
  161. package/build-module/dropdown/styles.js.map +1 -1
  162. package/build-module/duotone-picker/utils.js +3 -1
  163. package/build-module/duotone-picker/utils.js.map +1 -1
  164. package/build-module/elevation/hook.js +6 -7
  165. package/build-module/elevation/hook.js.map +1 -1
  166. package/build-module/focal-point-picker/controls.js +3 -1
  167. package/build-module/focal-point-picker/controls.js.map +1 -1
  168. package/build-module/focal-point-picker/index.js +21 -7
  169. package/build-module/focal-point-picker/index.js.map +1 -1
  170. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -13
  171. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  172. package/build-module/focal-point-picker/tooltip/index.native.js +3 -8
  173. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  174. package/build-module/focal-point-picker/utils.js +3 -1
  175. package/build-module/focal-point-picker/utils.js.map +1 -1
  176. package/build-module/font-size-picker/index.js +3 -2
  177. package/build-module/font-size-picker/index.js.map +1 -1
  178. package/build-module/font-size-picker/types.js.map +1 -1
  179. package/build-module/input-control/input-field.js +3 -1
  180. package/build-module/input-control/input-field.js.map +1 -1
  181. package/build-module/input-control/label.js +3 -1
  182. package/build-module/input-control/label.js.map +1 -1
  183. package/build-module/input-control/styles/input-control-styles.js +31 -23
  184. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  185. package/build-module/input-control/utils.js +8 -4
  186. package/build-module/input-control/utils.js.map +1 -1
  187. package/build-module/item-group/item/hook.js +0 -4
  188. package/build-module/item-group/item/hook.js.map +1 -1
  189. package/build-module/mobile/gradient/index.native.js +3 -1
  190. package/build-module/mobile/gradient/index.native.js.map +1 -1
  191. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +9 -3
  192. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  193. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +16 -15
  194. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  195. package/build-module/mobile/keyboard-aware-flat-list/shared.native.js +27 -0
  196. package/build-module/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
  197. package/build-module/modal/aria-helper.js +9 -3
  198. package/build-module/modal/aria-helper.js.map +1 -1
  199. package/build-module/modal/index.js +6 -2
  200. package/build-module/modal/index.js.map +1 -1
  201. package/build-module/navigation/styles/navigation-styles.js +13 -13
  202. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  203. package/build-module/panel/body.js +3 -1
  204. package/build-module/panel/body.js.map +1 -1
  205. package/build-module/popover/index.js +3 -1
  206. package/build-module/popover/index.js.map +1 -1
  207. package/build-module/popover/overlay-middlewares.js +3 -1
  208. package/build-module/popover/overlay-middlewares.js.map +1 -1
  209. package/build-module/query-controls/author-select.js +3 -1
  210. package/build-module/query-controls/author-select.js.map +1 -1
  211. package/build-module/range-control/rail.js +1 -1
  212. package/build-module/range-control/rail.js.map +1 -1
  213. package/build-module/range-control/styles/range-control-styles.js +30 -30
  214. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  215. package/build-module/resizable-box/resize-tooltip/index.js +3 -1
  216. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  217. package/build-module/resizable-box/resize-tooltip/label.js +3 -1
  218. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  219. package/build-module/resizable-box/resize-tooltip/utils.js +12 -4
  220. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  221. package/build-module/select-control/index.js +3 -1
  222. package/build-module/select-control/index.js.map +1 -1
  223. package/build-module/select-control/styles/select-control-styles.js +8 -6
  224. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  225. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +2 -1
  226. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  227. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  228. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  229. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  230. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  231. package/build-module/slot-fill/bubbles-virtually/use-slot.js +1 -1
  232. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  233. package/build-module/slot-fill/types.js.map +1 -1
  234. package/build-module/text/get-line-height.js +6 -2
  235. package/build-module/text/get-line-height.js.map +1 -1
  236. package/build-module/text/utils.js +6 -2
  237. package/build-module/text/utils.js.map +1 -1
  238. package/build-module/theme/color-algorithms.js +6 -2
  239. package/build-module/theme/color-algorithms.js.map +1 -1
  240. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
  241. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  242. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +10 -10
  243. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  244. package/build-module/tree-grid/roving-tab-index-item.js +3 -1
  245. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  246. package/build-module/unit-control/index.js +3 -1
  247. package/build-module/unit-control/index.js.map +1 -1
  248. package/build-module/utils/colors.js +21 -7
  249. package/build-module/utils/colors.js.map +1 -1
  250. package/build-module/utils/font-size.js +3 -1
  251. package/build-module/utils/font-size.js.map +1 -1
  252. package/build-module/utils/get-valid-children.js +3 -1
  253. package/build-module/utils/get-valid-children.js.map +1 -1
  254. package/build-module/utils/input/base.js +2 -3
  255. package/build-module/utils/input/base.js.map +1 -1
  256. package/build-module/utils/strings.js +12 -57
  257. package/build-module/utils/strings.js.map +1 -1
  258. package/build-module/utils/use-responsive-value.js +3 -1
  259. package/build-module/utils/use-responsive-value.js.map +1 -1
  260. package/build-module/view/component.js +26 -8
  261. package/build-module/view/component.js.map +1 -1
  262. package/build-style/style-rtl.css +39 -36
  263. package/build-style/style.css +39 -36
  264. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  265. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -1
  266. package/build-types/alignment-matrix-control/utils.d.ts.map +1 -1
  267. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  268. package/build-types/autocomplete/index.d.ts.map +1 -1
  269. package/build-types/border-box-control/border-box-control/hook.d.ts +4 -4
  270. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +4 -4
  271. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -4
  272. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +4 -4
  273. package/build-types/border-control/border-control/hook.d.ts +4 -4
  274. package/build-types/border-control/border-control-dropdown/hook.d.ts +4 -4
  275. package/build-types/box-control/stories/index.story.d.ts +24 -24
  276. package/build-types/card/card/hook.d.ts +4 -4
  277. package/build-types/card/card-body/hook.d.ts +4 -4
  278. package/build-types/card/card-divider/hook.d.ts +4 -4
  279. package/build-types/card/card-footer/hook.d.ts +4 -4
  280. package/build-types/card/card-header/hook.d.ts +4 -4
  281. package/build-types/card/card-media/hook.d.ts +4 -4
  282. package/build-types/checkbox-control/index.d.ts.map +1 -1
  283. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  284. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  285. package/build-types/context/context-connect.d.ts.map +1 -1
  286. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  287. package/build-types/drop-zone/index.d.ts.map +1 -1
  288. package/build-types/dropdown/styles.d.ts.map +1 -1
  289. package/build-types/duotone-picker/utils.d.ts.map +1 -1
  290. package/build-types/elevation/hook.d.ts +4 -4
  291. package/build-types/elevation/hook.d.ts.map +1 -1
  292. package/build-types/flex/flex/hook.d.ts +4 -4
  293. package/build-types/flex/flex-block/hook.d.ts +4 -4
  294. package/build-types/flex/flex-item/hook.d.ts +4 -4
  295. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  296. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  297. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  298. package/build-types/focal-point-picker/utils.d.ts.map +1 -1
  299. package/build-types/font-size-picker/index.d.ts.map +1 -1
  300. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  301. package/build-types/font-size-picker/types.d.ts +2 -0
  302. package/build-types/font-size-picker/types.d.ts.map +1 -1
  303. package/build-types/grid/hook.d.ts +4 -4
  304. package/build-types/h-stack/hook.d.ts +4 -4
  305. package/build-types/heading/hook.d.ts +4 -4
  306. package/build-types/input-control/input-field.d.ts.map +1 -1
  307. package/build-types/input-control/label.d.ts.map +1 -1
  308. package/build-types/input-control/stories/index.story.d.ts +2 -1
  309. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  310. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  311. package/build-types/input-control/utils.d.ts.map +1 -1
  312. package/build-types/item-group/item/hook.d.ts +5 -5
  313. package/build-types/item-group/item/hook.d.ts.map +1 -1
  314. package/build-types/item-group/item-group/hook.d.ts +4 -4
  315. package/build-types/modal/aria-helper.d.ts.map +1 -1
  316. package/build-types/modal/index.d.ts.map +1 -1
  317. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  318. package/build-types/navigator/navigator-back-button/hook.d.ts +4 -4
  319. package/build-types/navigator/navigator-button/hook.d.ts +4 -4
  320. package/build-types/palette-edit/styles.d.ts +749 -10
  321. package/build-types/palette-edit/styles.d.ts.map +1 -1
  322. package/build-types/panel/body.d.ts.map +1 -1
  323. package/build-types/popover/index.d.ts.map +1 -1
  324. package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
  325. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  326. package/build-types/query-controls/author-select.d.ts.map +1 -1
  327. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  328. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  329. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  330. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  331. package/build-types/scrollable/hook.d.ts +4 -4
  332. package/build-types/select-control/index.d.ts.map +1 -1
  333. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  334. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  335. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  336. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  337. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  338. package/build-types/slot-fill/types.d.ts +2 -2
  339. package/build-types/slot-fill/types.d.ts.map +1 -1
  340. package/build-types/spacer/hook.d.ts +4 -4
  341. package/build-types/surface/hook.d.ts +4 -4
  342. package/build-types/text/get-line-height.d.ts.map +1 -1
  343. package/build-types/text/hook.d.ts +4 -4
  344. package/build-types/text/utils.d.ts.map +1 -1
  345. package/build-types/text-control/index.d.ts +1 -1
  346. package/build-types/theme/color-algorithms.d.ts.map +1 -1
  347. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  348. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  349. package/build-types/tools-panel/tools-panel/hook.d.ts +4 -4
  350. package/build-types/tools-panel/tools-panel-header/hook.d.ts +4 -4
  351. package/build-types/tools-panel/tools-panel-item/hook.d.ts +4 -4
  352. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  353. package/build-types/truncate/hook.d.ts +4 -4
  354. package/build-types/unit-control/index.d.ts.map +1 -1
  355. package/build-types/utils/colors.d.ts.map +1 -1
  356. package/build-types/utils/font-size.d.ts.map +1 -1
  357. package/build-types/utils/get-valid-children.d.ts.map +1 -1
  358. package/build-types/utils/input/base.d.ts.map +1 -1
  359. package/build-types/utils/strings.d.ts.map +1 -1
  360. package/build-types/utils/use-responsive-value.d.ts.map +1 -1
  361. package/build-types/v-stack/hook.d.ts +4 -4
  362. package/build-types/view/component.d.ts +253 -7
  363. package/build-types/view/component.d.ts.map +1 -1
  364. package/package.json +19 -19
  365. package/src/alignment-matrix-control/index.tsx +3 -1
  366. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +4 -3
  367. package/src/alignment-matrix-control/utils.tsx +6 -2
  368. package/src/autocomplete/autocompleter-ui.tsx +3 -1
  369. package/src/autocomplete/index.tsx +21 -7
  370. package/src/autocomplete/style.scss +10 -4
  371. package/src/box-control/test/index.tsx +22 -0
  372. package/src/card/test/__snapshots__/index.tsx.snap +44 -47
  373. package/src/checkbox-control/index.tsx +44 -35
  374. package/src/checkbox-control/style.scss +12 -1
  375. package/src/checkbox-control/test/__snapshots__/index.tsx.snap +27 -26
  376. package/src/checkbox-control/test/index.tsx +5 -0
  377. package/src/color-picker/hex-input.tsx +3 -1
  378. package/src/color-picker/hue-picker.native.js +6 -2
  379. package/src/color-picker/index.native.js +9 -3
  380. package/src/color-picker/saturation-picker.native.js +6 -2
  381. package/src/color-picker/use-deprecated-props.ts +9 -3
  382. package/src/context/context-connect.ts +6 -2
  383. package/src/custom-select-control-v2/README.md +0 -4
  384. package/src/custom-select-control-v2/legacy-component/index.tsx +3 -1
  385. package/src/custom-select-control-v2/stories/default.story.tsx +1 -1
  386. package/src/custom-select-control-v2/stories/legacy.story.tsx +1 -1
  387. package/src/drop-zone/index.tsx +66 -66
  388. package/src/dropdown/styles.ts +3 -1
  389. package/src/duotone-picker/utils.ts +3 -1
  390. package/src/elevation/hook.ts +6 -3
  391. package/src/elevation/test/__snapshots__/index.tsx.snap +18 -24
  392. package/src/flex/test/__snapshots__/index.tsx.snap +4 -4
  393. package/src/focal-point-picker/controls.tsx +3 -1
  394. package/src/focal-point-picker/index.tsx +20 -7
  395. package/src/focal-point-picker/styles/focal-point-picker-style.ts +4 -3
  396. package/src/focal-point-picker/tooltip/index.native.js +1 -7
  397. package/src/focal-point-picker/utils.ts +3 -1
  398. package/src/font-size-picker/README.md +1 -0
  399. package/src/font-size-picker/index.tsx +4 -2
  400. package/src/font-size-picker/stories/index.story.tsx +0 -1
  401. package/src/font-size-picker/types.ts +2 -0
  402. package/src/higher-order/navigate-regions/style.scss +3 -3
  403. package/src/input-control/input-field.tsx +3 -1
  404. package/src/input-control/label.tsx +3 -1
  405. package/src/input-control/stories/index.story.tsx +31 -1
  406. package/src/input-control/styles/input-control-styles.tsx +12 -4
  407. package/src/input-control/test/index.js +8 -4
  408. package/src/input-control/utils.ts +3 -2
  409. package/src/item-group/item/hook.ts +1 -10
  410. package/src/item-group/test/__snapshots__/index.js.snap +16 -16
  411. package/src/mobile/gradient/index.native.js +3 -1
  412. package/src/mobile/keyboard-aware-flat-list/index.android.js +11 -2
  413. package/src/mobile/keyboard-aware-flat-list/index.ios.js +30 -19
  414. package/src/mobile/keyboard-aware-flat-list/shared.native.js +26 -0
  415. package/src/mobile/keyboard-aware-flat-list/styles.native.scss +8 -0
  416. package/src/modal/aria-helper.ts +8 -3
  417. package/src/modal/index.tsx +6 -2
  418. package/src/modal/test/index.tsx +11 -4
  419. package/src/navigation/styles/navigation-styles.tsx +4 -3
  420. package/src/panel/body.tsx +3 -1
  421. package/src/panel/style.scss +1 -0
  422. package/src/placeholder/style.scss +12 -34
  423. package/src/popover/index.tsx +2 -1
  424. package/src/popover/overlay-middlewares.tsx +3 -1
  425. package/src/popover/stories/index.story.tsx +0 -2
  426. package/src/query-controls/author-select.tsx +3 -1
  427. package/src/range-control/rail.tsx +1 -1
  428. package/src/range-control/styles/range-control-styles.ts +5 -3
  429. package/src/resizable-box/resize-tooltip/index.tsx +3 -1
  430. package/src/resizable-box/resize-tooltip/label.tsx +3 -1
  431. package/src/resizable-box/resize-tooltip/utils.ts +12 -4
  432. package/src/select-control/index.tsx +3 -1
  433. package/src/select-control/styles/select-control-styles.ts +3 -1
  434. package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +2 -1
  435. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
  436. package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
  437. package/src/slot-fill/bubbles-virtually/use-slot.ts +1 -1
  438. package/src/slot-fill/types.ts +2 -2
  439. package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
  440. package/src/text/get-line-height.ts +6 -2
  441. package/src/text/utils.ts +6 -2
  442. package/src/theme/color-algorithms.ts +6 -2
  443. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -24
  444. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -1
  445. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +7 -6
  446. package/src/toolbar/toolbar/style.scss +2 -2
  447. package/src/tree-grid/roving-tab-index-item.tsx +3 -1
  448. package/src/unit-control/index.tsx +5 -1
  449. package/src/utils/colors.js +21 -7
  450. package/src/utils/font-size.ts +3 -1
  451. package/src/utils/get-valid-children.ts +3 -1
  452. package/src/utils/input/base.js +4 -3
  453. package/src/utils/strings.ts +11 -59
  454. package/src/utils/test/strings.js +62 -0
  455. package/src/utils/use-responsive-value.ts +2 -1
  456. package/src/view/component.tsx +18 -11
  457. package/tsconfig.json +1 -2
  458. package/tsconfig.tsbuildinfo +1 -1
  459. package/build/slot-fill/bubbles-virtually/observable-map.js +0 -68
  460. package/build/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
  461. package/build/view/types.js +0 -6
  462. package/build/view/types.js.map +0 -1
  463. package/build-module/slot-fill/bubbles-virtually/observable-map.js +0 -60
  464. package/build-module/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
  465. package/build-module/view/types.js +0 -2
  466. package/build-module/view/types.js.map +0 -1
  467. package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts +0 -19
  468. package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts.map +0 -1
  469. package/build-types/view/types.d.ts +0 -8
  470. package/build-types/view/types.d.ts.map +0 -1
  471. package/src/slot-fill/bubbles-virtually/observable-map.ts +0 -79
  472. package/src/slot-fill/test/observable-map.js +0 -83
  473. package/src/utils/hooks/stories/use-cx.js +0 -157
  474. package/src/view/types.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_colorsValues","_button","_interopRequireDefault","_text","_heading","_utils","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","NavigationUI","exports","_base","default","process","env","NODE_ENV","target","label","space","MenuUI","MenuBackButtonUI","Button","name","styles","map","toString","MenuTitleUI","MenuTitleSearchControlWrapper","MenuTitleActionsUI","GroupTitleUI","Heading","isRTL","ItemBaseUI","rtl","textAlign","COLORS","theme","accent","white","gray","ItemUI","ItemIconUI","ItemBadgeUI","reduceMotion","ItemTitleUI","Text"],"sources":["@wordpress/components/src/navigation/styles/navigation-styles.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { COLORS } from '../../utils/colors-values';\nimport Button from '../../button';\nimport { Text } from '../../text';\nimport { Heading } from '../../heading';\nimport { reduceMotion, rtl } from '../../utils';\nimport { space } from '../../utils/space';\n\nexport const NavigationUI = styled.div`\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tpadding: 0 ${ space( 4 ) };\n\toverflow: hidden;\n`;\n\nexport const MenuUI = styled.div`\n\tmargin-top: ${ space( 6 ) };\n\tmargin-bottom: ${ space( 6 ) };\n\tdisplay: flex;\n\tflex-direction: column;\n\tul {\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\tlist-style: none;\n\t}\n\t.components-navigation__back-button {\n\t\tmargin-bottom: ${ space( 6 ) };\n\t}\n\n\t.components-navigation__group + .components-navigation__group {\n\t\tmargin-top: ${ space( 6 ) };\n\t}\n`;\n\nexport const MenuBackButtonUI = styled( Button )`\n\t&.is-tertiary {\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\n\t\t&:hover:not( :disabled ) {\n\t\t\topacity: 1;\n\t\t\tbox-shadow: none;\n\t\t\tcolor: inherit;\n\t\t}\n\n\t\t&:active:not( :disabled ) {\n\t\t\tbackground: transparent;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n`;\n\nexport const MenuTitleUI = styled.div`\n\toverflow: hidden;\n\twidth: 100%;\n`;\n\nexport const MenuTitleSearchControlWrapper = styled.div`\n\tmargin: 11px 0; // non-ideal hardcoding to maintain same height as Heading, could be improved\n\tpadding: 1px; // so the focus border doesn't get cut off by the overflow hidden on MenuTitleUI\n`;\n\nexport const MenuTitleActionsUI = styled.span`\n\theight: ${ space( 6 ) }; // 24px, same height as the buttons inside\n\n\t.components-button.is-small {\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\t\tmargin-right: ${ space( 1 ) }; // Avoid hiding the focus outline\n\t\tpadding: 0;\n\n\t\t&:active:not( :disabled ) {\n\t\t\tbackground: none;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t\t&:hover:not( :disabled ) {\n\t\t\tbox-shadow: none;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n`;\n\nexport const GroupTitleUI = styled( Heading )`\n\tmin-height: ${ space( 12 ) };\n\talign-items: center;\n\tcolor: inherit;\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tmargin-bottom: ${ space( 2 ) };\n\tpadding: ${ () =>\n\t\tisRTL()\n\t\t\t? `${ space( 1 ) } ${ space( 4 ) } ${ space( 1 ) } ${ space( 2 ) }`\n\t\t\t: `${ space( 1 ) } ${ space( 2 ) } ${ space( 1 ) } ${ space(\n\t\t\t\t\t4\n\t\t\t ) }` };\n`;\n\nexport const ItemBaseUI = styled.li`\n\tborder-radius: 2px;\n\tcolor: inherit;\n\tmargin-bottom: 0;\n\n\t> button,\n\t> a.components-button,\n\t> a {\n\t\twidth: 100%;\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\t\tpadding: ${ space( 2 ) } ${ space( 4 ) }; /* 8px 16px */\n\t\t${ rtl( { textAlign: 'left' }, { textAlign: 'right' } ) }\n\n\t\t&:hover,\n\t\t&:focus:not( [aria-disabled='true'] ):active,\n\t\t&:active:not( [aria-disabled='true'] ):active {\n\t\t\tcolor: inherit;\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t&.is-active {\n\t\tbackground-color: ${ COLORS.theme.accent };\n\t\tcolor: ${ COLORS.white };\n\n\t\t> button,\n\t\t> a {\n\t\t\tcolor: ${ COLORS.white };\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t> svg path {\n\t\tcolor: ${ COLORS.gray[ 600 ] };\n\t}\n`;\n\nexport const ItemUI = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\theight: auto;\n\tmin-height: 40px;\n\tmargin: 0;\n\tpadding: ${ space( 1.5 ) } ${ space( 4 ) };\n\tfont-weight: 400;\n\tline-height: 20px;\n\twidth: 100%;\n\tcolor: inherit;\n\topacity: 0.7;\n`;\n\nexport const ItemIconUI = styled.span`\n\tdisplay: flex;\n\tmargin-right: ${ space( 2 ) };\n`;\n\nexport const ItemBadgeUI = styled.span`\n\tmargin-left: ${ () => ( isRTL() ? '0' : space( 2 ) ) };\n\tmargin-right: ${ () => ( isRTL() ? space( 2 ) : '0' ) };\n\tdisplay: inline-flex;\n\tpadding: ${ space( 1 ) } ${ space( 3 ) };\n\tborder-radius: 2px;\n\tanimation: fade-in 250ms ease-out;\n\n\t@keyframes fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t${ reduceMotion( 'animation' ) };\n`;\n\nexport const ItemTitleUI = styled( Text )`\n\t${ () => ( isRTL() ? 'margin-left: auto;' : 'margin-right: auto;' ) }\n\tfont-size: 14px;\n\tline-height: 20px;\n\tcolor: inherit;\n`;\n"],"mappings":";;;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAA0C,SAAAQ,iCAAA,gPAlB1C;AACA;AACA,GAFA,CAKA;AACA;AACA,GAFA,CAKA;AACA;AACA;AAQO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,oBAAAE,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,kDAGV,IAAAC,YAAK,EAAE,CAAE,CAAC,yBAAAL,OAAA,CAAAC,GAAA,CAAAC,QAAA,4mMAExB;AAEM,MAAMI,MAAM,GAAAT,OAAA,CAAAS,MAAA,oBAAAR,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,kBACH,IAAAC,YAAK,EAAE,CAAE,CAAC,qBACP,IAAAA,YAAK,EAAE,CAAE,CAAC,mIAST,IAAAA,YAAK,EAAE,CAAE,CAAC,+EAIb,IAAAA,YAAK,EAAE,CAAE,CAAC,UAAAL,OAAA,CAAAC,GAAA,CAAAC,QAAA,4mMAE1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AC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,CACrC,MAAQ,IAAAc,WAAK,EAAC,CAAC,GAAG,oBAAoB,GAAG,qBAAuB,uDAAAlB,OAAA,CAAAC,GAAA,CAAAC,QAAA,4mMAInE","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_colorsValues","_button","_interopRequireDefault","_text","_heading","_utils","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","NavigationUI","exports","_base","default","process","env","NODE_ENV","target","label","space","MenuUI","MenuBackButtonUI","Button","name","styles","map","toString","MenuTitleUI","MenuTitleSearchControlWrapper","MenuTitleActionsUI","GroupTitleUI","Heading","isRTL","ItemBaseUI","rtl","textAlign","COLORS","theme","accent","white","gray","ItemUI","ItemIconUI","ItemBadgeUI","ItemTitleUI","Text"],"sources":["@wordpress/components/src/navigation/styles/navigation-styles.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n\n/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { COLORS } from '../../utils/colors-values';\nimport Button from '../../button';\nimport { Text } from '../../text';\nimport { Heading } from '../../heading';\nimport { rtl } from '../../utils';\nimport { space } from '../../utils/space';\n\nexport const NavigationUI = styled.div`\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tpadding: 0 ${ space( 4 ) };\n\toverflow: hidden;\n`;\n\nexport const MenuUI = styled.div`\n\tmargin-top: ${ space( 6 ) };\n\tmargin-bottom: ${ space( 6 ) };\n\tdisplay: flex;\n\tflex-direction: column;\n\tul {\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\tlist-style: none;\n\t}\n\t.components-navigation__back-button {\n\t\tmargin-bottom: ${ space( 6 ) };\n\t}\n\n\t.components-navigation__group + .components-navigation__group {\n\t\tmargin-top: ${ space( 6 ) };\n\t}\n`;\n\nexport const MenuBackButtonUI = styled( Button )`\n\t&.is-tertiary {\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\n\t\t&:hover:not( :disabled ) {\n\t\t\topacity: 1;\n\t\t\tbox-shadow: none;\n\t\t\tcolor: inherit;\n\t\t}\n\n\t\t&:active:not( :disabled ) {\n\t\t\tbackground: transparent;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n`;\n\nexport const MenuTitleUI = styled.div`\n\toverflow: hidden;\n\twidth: 100%;\n`;\n\nexport const MenuTitleSearchControlWrapper = styled.div`\n\tmargin: 11px 0; // non-ideal hardcoding to maintain same height as Heading, could be improved\n\tpadding: 1px; // so the focus border doesn't get cut off by the overflow hidden on MenuTitleUI\n`;\n\nexport const MenuTitleActionsUI = styled.span`\n\theight: ${ space( 6 ) }; // 24px, same height as the buttons inside\n\n\t.components-button.is-small {\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\t\tmargin-right: ${ space( 1 ) }; // Avoid hiding the focus outline\n\t\tpadding: 0;\n\n\t\t&:active:not( :disabled ) {\n\t\t\tbackground: none;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t\t&:hover:not( :disabled ) {\n\t\t\tbox-shadow: none;\n\t\t\topacity: 1;\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n`;\n\nexport const GroupTitleUI = styled( Heading )`\n\tmin-height: ${ space( 12 ) };\n\talign-items: center;\n\tcolor: inherit;\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tmargin-bottom: ${ space( 2 ) };\n\tpadding: ${ () =>\n\t\tisRTL()\n\t\t\t? `${ space( 1 ) } ${ space( 4 ) } ${ space( 1 ) } ${ space( 2 ) }`\n\t\t\t: `${ space( 1 ) } ${ space( 2 ) } ${ space( 1 ) } ${ space(\n\t\t\t\t\t4\n\t\t\t ) }` };\n`;\n\nexport const ItemBaseUI = styled.li`\n\tborder-radius: 2px;\n\tcolor: inherit;\n\tmargin-bottom: 0;\n\n\t> button,\n\t> a.components-button,\n\t> a {\n\t\twidth: 100%;\n\t\tcolor: inherit;\n\t\topacity: 0.7;\n\t\tpadding: ${ space( 2 ) } ${ space( 4 ) }; /* 8px 16px */\n\t\t${ rtl( { textAlign: 'left' }, { textAlign: 'right' } ) }\n\n\t\t&:hover,\n\t\t&:focus:not( [aria-disabled='true'] ):active,\n\t\t&:active:not( [aria-disabled='true'] ):active {\n\t\t\tcolor: inherit;\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t&.is-active {\n\t\tbackground-color: ${ COLORS.theme.accent };\n\t\tcolor: ${ COLORS.white };\n\n\t\t> button,\n\t\t> a {\n\t\t\tcolor: ${ COLORS.white };\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t> svg path {\n\t\tcolor: ${ COLORS.gray[ 600 ] };\n\t}\n`;\n\nexport const ItemUI = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\theight: auto;\n\tmin-height: 40px;\n\tmargin: 0;\n\tpadding: ${ space( 1.5 ) } ${ space( 4 ) };\n\tfont-weight: 400;\n\tline-height: 20px;\n\twidth: 100%;\n\tcolor: inherit;\n\topacity: 0.7;\n`;\n\nexport const ItemIconUI = styled.span`\n\tdisplay: flex;\n\tmargin-right: ${ space( 2 ) };\n`;\n\nexport const ItemBadgeUI = styled.span`\n\tmargin-left: ${ () => ( isRTL() ? '0' : space( 2 ) ) };\n\tmargin-right: ${ () => ( isRTL() ? space( 2 ) : '0' ) };\n\tdisplay: inline-flex;\n\tpadding: ${ space( 1 ) } ${ space( 3 ) };\n\tborder-radius: 2px;\n\n\t@keyframes fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t@media not ( prefers-reduced-motion ) {\n\t\tanimation: fade-in 250ms ease-out;\n\t}\n`;\n\nexport const ItemTitleUI = styled( Text )`\n\t${ () => ( isRTL() ? 'margin-left: auto;' : 'margin-right: auto;' ) }\n\tfont-size: 14px;\n\tline-height: 20px;\n\tc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99
- if (!title) return null;
99
+ if (!title) {
100
+ return null;
101
+ }
100
102
  return (0, _react.createElement)("h2", {
101
103
  className: "components-panel__body-title"
102
104
  }, (0, _react.createElement)(_button.default, {
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_element","_icons","_button","_icon","_utils","noop","UnforwardedPanelBody","props","ref","buttonProps","children","className","icon","initialOpen","onToggle","opened","title","scrollAfterOpen","isOpened","setIsOpened","useControlledState","initial","undefined","fallback","nodeRef","useRef","scrollBehavior","useReducedMotion","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","useUpdateEffect","scrollIntoView","inline","block","behavior","classes","classnames","_react","createElement","useMergeRefs","PanelBodyTitle","Boolean","onClick","forwardRef","default","chevronUp","chevronDown","size","PanelBody","exports","_default"],"sources":["@wordpress/components/src/panel/body.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { PanelBodyProps, PanelBodyTitleProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nconst noop = () => {};\n\nexport function UnforwardedPanelBody(\n\tprops: PanelBodyProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t} = props;\n\tconst [ isOpened, setIsOpened ] = useControlledState< boolean | undefined >(\n\t\topened,\n\t\t{\n\t\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t\t\tfallback: false,\n\t\t}\n\t);\n\tconst nodeRef = useRef< HTMLElement >( null );\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event: React.MouseEvent ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n\tconst scrollAfterOpenRef = useRef< boolean | undefined >();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render.\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = classnames( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ Boolean( isOpened ) }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: Boolean( isOpened ) } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t(\n\t\t{\n\t\t\tisOpened,\n\t\t\ticon,\n\t\t\ttitle,\n\t\t\t...props\n\t\t}: WordPressComponentProps< PanelBodyTitleProps, 'button' >,\n\t\tref: React.ForwardedRef< any >\n\t) => {\n\t\tif ( ! title ) return null;\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nexport const PanelBody = forwardRef( UnforwardedPanelBody );\n\nexport default PanelBody;\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAOA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAMO,IAAI,GAAGA,CAA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EAAa,CAC3C,CACI,CAAC,EACLlC,KAAK,EACLJ,IAAI,IACL,IAAA6B,MAAA,CAAAC,aAAA,EAACvC,KAAA,CAAA6C,OAAI;IACJpC,IAAI,EAAGA,IAAM;IACbD,SAAS,EAAC,wBAAwB;IAClCwC,IAAI,EAAG;EAAI,CACX,CAEK,CACL,CAAC;AAEP,CACD,CAAC;AAEM,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAL,mBAAU,EAAEzC,oBAAqB,CAAC;AAAC,IAAAgD,QAAA,GAAAD,OAAA,CAAAL,OAAA,GAE7CI,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_element","_icons","_button","_icon","_utils","noop","UnforwardedPanelBody","props","ref","buttonProps","children","className","icon","initialOpen","onToggle","opened","title","scrollAfterOpen","isOpened","setIsOpened","useControlledState","initial","undefined","fallback","nodeRef","useRef","scrollBehavior","useReducedMotion","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","useUpdateEffect","scrollIntoView","inline","block","behavior","classes","classnames","_react","createElement","useMergeRefs","PanelBodyTitle","Boolean","onClick","forwardRef","default","chevronUp","chevronDown","size","PanelBody","exports","_default"],"sources":["@wordpress/components/src/panel/body.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { PanelBodyProps, PanelBodyTitleProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nconst noop = () => {};\n\nexport function UnforwardedPanelBody(\n\tprops: PanelBodyProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t} = props;\n\tconst [ isOpened, setIsOpened ] = useControlledState< boolean | undefined >(\n\t\topened,\n\t\t{\n\t\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t\t\tfallback: false,\n\t\t}\n\t);\n\tconst nodeRef = useRef< HTMLElement >( null );\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event: React.MouseEvent ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n\tconst scrollAfterOpenRef = useRef< boolean | undefined >();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render.\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = classnames( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ Boolean( isOpened ) }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: Boolean( isOpened ) } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t(\n\t\t{\n\t\t\tisOpened,\n\t\t\ticon,\n\t\t\ttitle,\n\t\t\t...props\n\t\t}: WordPressComponentProps< PanelBodyTitleProps, 'button' >,\n\t\tref: React.ForwardedRef< any >\n\t) => {\n\t\tif ( ! title ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nexport const PanelBody = forwardRef( UnforwardedPanelBody );\n\nexport default PanelBody;\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD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;IACNrC,SAAS,EAAC,+BAA+B;IACzC,iBAAgBO,QAAU;IAC1BV,GAAG,EAAGA,GAAK;IAAA,GACND;EAAK,GAMV,IAAAkC,MAAA,CAAAC,aAAA;IAAM,eAAY;EAAM,GACvB,IAAAD,MAAA,CAAAC,aAAA,EAACvC,KAAA,CAAA6C,OAAI;IACJrC,SAAS,EAAC,yBAAyB;IACnCC,IAAI,EAAGM,QAAQ,GAAG+B,gBAAS,GAAGC;EAAa,CAC3C,CACI,CAAC,EACLlC,KAAK,EACLJ,IAAI,IACL,IAAA6B,MAAA,CAAAC,aAAA,EAACvC,KAAA,CAAA6C,OAAI;IACJpC,IAAI,EAAGA,IAAM;IACbD,SAAS,EAAC,wBAAwB;IAClCwC,IAAI,EAAG;EAAI,CACX,CAEK,CACL,CAAC;AAEP,CACD,CAAC;AAEM,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAL,mBAAU,EAAEzC,oBAAqB,CAAC;AAAC,IAAAgD,QAAA,GAAAD,OAAA,CAAAL,OAAA,GAE7CI,SAAS","ignoreList":[]}
@@ -159,7 +159,9 @@ const UnforwardedPopover = (props, forwardedRef) => {
159
159
  } = (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 ? _refs$floating$curren : {};
160
160
 
161
161
  // Only HTMLElement instances have the `style` property.
162
- if (!(firstElementChild instanceof HTMLElement)) return;
162
+ if (!(firstElementChild instanceof HTMLElement)) {
163
+ return;
164
+ }
163
165
 
164
166
  // Reduce the height of the popover to the available space.
165
167
  Object.assign(firstElementChild.style, {
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_reactDom","_framerMotion","_element","_compose","_icons","_deprecated","_primitives","_button","_scrollLock","_slotFill","_utils","_context","_overlayMiddlewares","_styleProvider","SLOT_NAME","exports","ArrowTriangle","_react","createElement","SVG","xmlns","viewBox","className","role","Path","d","vectorEffect","slotNameContext","createContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","children","noArrow","position","placement","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","inline","variant","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","useContextSystem","computedFlipProp","computedResizeProp","deprecated","since","version","alternative","computedVariant","arrowRef","useRef","fallbackReferenceElement","setFallbackReferenceElement","useState","anchorRefFallback","useCallback","node","isMobileViewport","useViewportMatch","isExpanded","hasArrow","normalizedPlacementFromProps","positionToPlacement","middleware","overlayMiddlewares","offsetMiddleware","flipMiddleware","size","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","style","maxHeight","availableHeight","overflow","shiftMiddleware","crossAxis","limiter","limitShift","padding","arrow","element","slotName","useContext","slot","useSlot","onDialogClose","type","event","dialogRef","dialogProps","useDialog","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","useFloating","whileElementsMounted","referenceParam","floatingParam","updateParam","autoUpdate","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","useLayoutEffect","resultingReferenceElement","getReferenceElement","setReference","mergedFloatingRef","useMergeRefs","setFloating","left","computePopoverPosition","shouldReduceMotion","useReducedMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","useMemo","placementToMotionAnimationProps","animationProps","onAnimationComplete","isPositioned","content","motion","div","classnames","ref","tabIndex","default","icon","close","onClick","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","Fill","name","createPortal","StyleProvider","Fragment","Popover","contextConnect","PopoverSlot","Slot","bubblesVirtually","forwardRef","__unstableSlotNameProvider","Provider","_default"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport classnames from 'classnames';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\n// eslint-disable-next-line no-restricted-imports\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\n// eslint-disable-next-line no-restricted-imports\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox={ `0 0 100 100` }\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children`, which are re-defined in `PopoverProps`).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) )\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle,\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ classnames( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":";;;;;;;;AAIA,IAAAA,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B,OAAOf,OAAO;EACf;EAEA,OACC,IAAAzJ,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAA6K,QAAA,QACC,IAAA7K,MAAA,CAAAC,aAAA;IAAM4J,GAAG,EAAG9F;EAAmB,CAAE,CAAC,EAChC0F,OACD,CAAC;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMqB,OAAO,GAAAhL,OAAA,CAAAgL,OAAA,GAAG,IAAAC,uBAAc,EAAE3J,kBAAkB,EAAE,SAAU,CAAC;AAEtE,SAAS4J,WAAWA,CACnB;EAAEN,IAAI,GAAG7K;AAA6B,CAAC,EACvCgK,GAAwB,EACvB;EACD,OACC,IAAA7J,MAAA,CAAAC,aAAA,EAACT,SAAA,CAAAyL,IAAI;IACJC,gBAAgB;IAChBR,IAAI,EAAGA,IAAM;IACbrK,SAAS,EAAC,cAAc;IACxBwJ,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAiB,OAAO,CAACG,IAAI,GAAG,IAAAE,mBAAU,EAAEH,WAAY,CAAC;AACxC;AACAF,OAAO,CAACM,0BAA0B,GAAG1K,eAAe,CAAC2K,QAAQ;AAAC,IAAAC,QAAA,GAAAxL,OAAA,CAAAiK,OAAA,GAE/Ce,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_reactDom","_framerMotion","_element","_compose","_icons","_deprecated","_primitives","_button","_scrollLock","_slotFill","_utils","_context","_overlayMiddlewares","_styleProvider","SLOT_NAME","exports","ArrowTriangle","_react","createElement","SVG","xmlns","viewBox","className","role","Path","d","vectorEffect","slotNameContext","createContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","children","noArrow","position","placement","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","inline","variant","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","useContextSystem","computedFlipProp","computedResizeProp","deprecated","since","version","alternative","computedVariant","arrowRef","useRef","fallbackReferenceElement","setFallbackReferenceElement","useState","anchorRefFallback","useCallback","node","isMobileViewport","useViewportMatch","isExpanded","hasArrow","normalizedPlacementFromProps","positionToPlacement","middleware","overlayMiddlewares","offsetMiddleware","flipMiddleware","size","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","style","maxHeight","availableHeight","overflow","shiftMiddleware","crossAxis","limiter","limitShift","padding","arrow","element","slotName","useContext","slot","useSlot","onDialogClose","type","event","dialogRef","dialogProps","useDialog","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","useFloating","whileElementsMounted","referenceParam","floatingParam","updateParam","autoUpdate","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","useLayoutEffect","resultingReferenceElement","getReferenceElement","setReference","mergedFloatingRef","useMergeRefs","setFloating","left","computePopoverPosition","shouldReduceMotion","useReducedMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","useMemo","placementToMotionAnimationProps","animationProps","onAnimationComplete","isPositioned","content","motion","div","classnames","ref","tabIndex","default","icon","close","onClick","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","Fill","name","createPortal","StyleProvider","Fragment","Popover","contextConnect","PopoverSlot","Slot","bubblesVirtually","forwardRef","__unstableSlotNameProvider","Provider","_default"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport classnames from 'classnames';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\n// eslint-disable-next-line no-restricted-imports\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\n// eslint-disable-next-line no-restricted-imports\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox={ `0 0 100 100` }\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children`, which are re-defined in `PopoverProps`).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle,\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ classnames( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":";;;;;;;;AAIA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAaA,IAAAE,aAAA,GAAA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A6K,QAAA,QACC,IAAA7K,MAAA,CAAAC,aAAA;IAAM4J,GAAG,EAAG9F;EAAmB,CAAE,CAAC,EAChC0F,OACD,CAAC;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMqB,OAAO,GAAAhL,OAAA,CAAAgL,OAAA,GAAG,IAAAC,uBAAc,EAAE3J,kBAAkB,EAAE,SAAU,CAAC;AAEtE,SAAS4J,WAAWA,CACnB;EAAEN,IAAI,GAAG7K;AAA6B,CAAC,EACvCgK,GAAwB,EACvB;EACD,OACC,IAAA7J,MAAA,CAAAC,aAAA,EAACT,SAAA,CAAAyL,IAAI;IACJC,gBAAgB;IAChBR,IAAI,EAAGA,IAAM;IACbrK,SAAS,EAAC,cAAc;IACxBwJ,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAiB,OAAO,CAACG,IAAI,GAAG,IAAAE,mBAAU,EAAEH,WAAY,CAAC;AACxC;AACAF,OAAO,CAACM,0BAA0B,GAAG1K,eAAe,CAAC2K,QAAQ;AAAC,IAAAC,QAAA,GAAAxL,OAAA,CAAAiK,OAAA,GAE/Ce,OAAO","ignoreList":[]}
@@ -28,7 +28,9 @@ function overlayMiddlewares() {
28
28
  } = (_elements$floating = elements.floating) !== null && _elements$floating !== void 0 ? _elements$floating : {};
29
29
 
30
30
  // Only HTMLElement instances have the `style` property.
31
- if (!(firstElementChild instanceof HTMLElement)) return;
31
+ if (!(firstElementChild instanceof HTMLElement)) {
32
+ return;
33
+ }
32
34
 
33
35
  // Reduce the height of the popover to the available space.
34
36
  Object.assign(firstElementChild.style, {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactDom","require","overlayMiddlewares","name","fn","rects","reference","size","apply","elements","_elements$floating","firstElementChild","floating","HTMLElement","Object","assign","style","width","height"],"sources":["@wordpress/components/src/popover/overlay-middlewares.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MiddlewareState } from '@floating-ui/react-dom';\nimport { size } from '@floating-ui/react-dom';\n\nexport function overlayMiddlewares() {\n\treturn [\n\t\t{\n\t\t\tname: 'overlay',\n\t\t\tfn( { rects }: MiddlewareState ) {\n\t\t\t\treturn rects.reference;\n\t\t\t},\n\t\t},\n\t\tsize( {\n\t\t\tapply( { rects, elements } ) {\n\t\t\t\tconst { firstElementChild } = elements.floating ?? {};\n\n\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) return;\n\n\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\twidth: `${ rects.reference.width }px`,\n\t\t\t\t\theight: `${ rects.reference.height }px`,\n\t\t\t\t} );\n\t\t\t},\n\t\t} ),\n\t];\n}\n"],"mappings":";;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AAJA;AACA;AACA;;AAIO,SAASC,kBAAkBA,CAAA,EAAG;EACpC,OAAO,CACN;IACCC,IAAI,EAAE,SAAS;IACfC,EAAEA,CAAE;MAAEC;IAAuB,CAAC,EAAG;MAChC,OAAOA,KAAK,CAACC,SAAS;IACvB;EACD,CAAC,EACD,IAAAC,cAAI,EAAE;IACLC,KAAKA,CAAE;MAAEH,KAAK;MAAEI;IAAS,CAAC,EAAG;MAAA,IAAAC,kBAAA;MAC5B,MAAM;QAAEC;MAAkB,CAAC,IAAAD,kBAAA,GAAGD,QAAQ,CAACG,QAAQ,cAAAF,kBAAA,cAAAA,kBAAA,GAAI,CAAC,CAAC;;MAErD;MACA,IAAK,EAAIC,iBAAiB,YAAYE,WAAW,CAAE,EAAG;;MAEtD;MACAC,MAAM,CAACC,MAAM,CAAEJ,iBAAiB,CAACK,KAAK,EAAE;QACvCC,KAAK,EAAG,GAAGZ,KAAK,CAACC,SAAS,CAACW,KAAO,IAAG;QACrCC,MAAM,EAAG,GAAGb,KAAK,CAACC,SAAS,CAACY,MAAQ;MACrC,CAAE,CAAC;IACJ;EACD,CAAE,CAAC,CACH;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_reactDom","require","overlayMiddlewares","name","fn","rects","reference","size","apply","elements","_elements$floating","firstElementChild","floating","HTMLElement","Object","assign","style","width","height"],"sources":["@wordpress/components/src/popover/overlay-middlewares.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { MiddlewareState } from '@floating-ui/react-dom';\nimport { size } from '@floating-ui/react-dom';\n\nexport function overlayMiddlewares() {\n\treturn [\n\t\t{\n\t\t\tname: 'overlay',\n\t\t\tfn( { rects }: MiddlewareState ) {\n\t\t\t\treturn rects.reference;\n\t\t\t},\n\t\t},\n\t\tsize( {\n\t\t\tapply( { rects, elements } ) {\n\t\t\t\tconst { firstElementChild } = elements.floating ?? {};\n\n\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\twidth: `${ rects.reference.width }px`,\n\t\t\t\t\theight: `${ rects.reference.height }px`,\n\t\t\t\t} );\n\t\t\t},\n\t\t} ),\n\t];\n}\n"],"mappings":";;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AAJA;AACA;AACA;;AAIO,SAASC,kBAAkBA,CAAA,EAAG;EACpC,OAAO,CACN;IACCC,IAAI,EAAE,SAAS;IACfC,EAAEA,CAAE;MAAEC;IAAuB,CAAC,EAAG;MAChC,OAAOA,KAAK,CAACC,SAAS;IACvB;EACD,CAAC,EACD,IAAAC,cAAI,EAAE;IACLC,KAAKA,CAAE;MAAEH,KAAK;MAAEI;IAAS,CAAC,EAAG;MAAA,IAAAC,kBAAA;MAC5B,MAAM;QAAEC;MAAkB,CAAC,IAAAD,kBAAA,GAAGD,QAAQ,CAACG,QAAQ,cAAAF,kBAAA,cAAAA,kBAAA,GAAI,CAAC,CAAC;;MAErD;MACA,IAAK,EAAIC,iBAAiB,YAAYE,WAAW,CAAE,EAAG;QACrD;MACD;;MAEA;MACAC,MAAM,CAACC,MAAM,CAAEJ,iBAAiB,CAACK,KAAK,EAAE;QACvCC,KAAK,EAAG,GAAGZ,KAAK,CAACC,SAAS,CAACW,KAAO,IAAG;QACrCC,MAAM,EAAG,GAAGb,KAAK,CAACC,SAAS,CAACY,MAAQ;MACrC,CAAE,CAAC;IACJ;EACD,CAAE,CAAC,CACH;AACF","ignoreList":[]}
@@ -20,7 +20,9 @@ function AuthorSelect({
20
20
  selectedAuthorId,
21
21
  onChange: onChangeProp
22
22
  }) {
23
- if (!authorList) return null;
23
+ if (!authorList) {
24
+ return null;
25
+ }
24
26
  const termsTree = (0, _terms.buildTermsTree)(authorList);
25
27
  return (0, _react.createElement)(_treeSelect.default, {
26
28
  label,
@@ -1 +1 @@
1
- {"version":3,"names":["_terms","require","_treeSelect","_interopRequireDefault","AuthorSelect","__next40pxDefaultSize","label","noOptionLabel","authorList","selectedAuthorId","onChange","onChangeProp","termsTree","buildTermsTree","_react","createElement","default","tree","selectedId","undefined","String","__nextHasNoMarginBottom"],"sources":["@wordpress/components/src/query-controls/author-select.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { buildTermsTree } from './terms';\nimport TreeSelect from '../tree-select';\nimport type { AuthorSelectProps } from './types';\n\nexport default function AuthorSelect( {\n\t__next40pxDefaultSize,\n\tlabel,\n\tnoOptionLabel,\n\tauthorList,\n\tselectedAuthorId,\n\tonChange: onChangeProp,\n}: AuthorSelectProps ) {\n\tif ( ! authorList ) return null;\n\tconst termsTree = buildTermsTree( authorList );\n\treturn (\n\t\t<TreeSelect\n\t\t\t{ ...{\n\t\t\t\tlabel,\n\t\t\t\tnoOptionLabel,\n\t\t\t\tonChange: onChangeProp,\n\t\t\t} }\n\t\t\ttree={ termsTree }\n\t\t\tselectedId={\n\t\t\t\tselectedAuthorId !== undefined\n\t\t\t\t\t? String( selectedAuthorId )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAKe,SAASG,YAAYA,CAAE;EACrCC,qBAAqB;EACrBC,KAAK;EACLC,aAAa;EACbC,UAAU;EACVC,gBAAgB;EAChBC,QAAQ,EAAEC;AACQ,CAAC,EAAG;EACtB,IAAK,CAAEH,UAAU,EAAG,OAAO,IAAI;EAC/B,MAAMI,SAAS,GAAG,IAAAC,qBAAc,EAAEL,UAAW,CAAC;EAC9C,OACC,IAAAM,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAAc,OAAU;IAETV,KAAK;IACLC,aAAa;IACbG,QAAQ,EAAEC,YAAY;IAEvBM,IAAI,EAAGL,SAAW;IAClBM,UAAU,EACTT,gBAAgB,KAAKU,SAAS,GAC3BC,MAAM,CAAEX,gBAAiB,CAAC,GAC1BU,SACH;IACDE,uBAAuB;IACvBhB,qBAAqB,EAAGA;EAAuB,CAC/C,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_terms","require","_treeSelect","_interopRequireDefault","AuthorSelect","__next40pxDefaultSize","label","noOptionLabel","authorList","selectedAuthorId","onChange","onChangeProp","termsTree","buildTermsTree","_react","createElement","default","tree","selectedId","undefined","String","__nextHasNoMarginBottom"],"sources":["@wordpress/components/src/query-controls/author-select.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { buildTermsTree } from './terms';\nimport TreeSelect from '../tree-select';\nimport type { AuthorSelectProps } from './types';\n\nexport default function AuthorSelect( {\n\t__next40pxDefaultSize,\n\tlabel,\n\tnoOptionLabel,\n\tauthorList,\n\tselectedAuthorId,\n\tonChange: onChangeProp,\n}: AuthorSelectProps ) {\n\tif ( ! authorList ) {\n\t\treturn null;\n\t}\n\tconst termsTree = buildTermsTree( authorList );\n\treturn (\n\t\t<TreeSelect\n\t\t\t{ ...{\n\t\t\t\tlabel,\n\t\t\t\tnoOptionLabel,\n\t\t\t\tonChange: onChangeProp,\n\t\t\t} }\n\t\t\ttree={ termsTree }\n\t\t\tselectedId={\n\t\t\t\tselectedAuthorId !== undefined\n\t\t\t\t\t? String( selectedAuthorId )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAKe,SAASG,YAAYA,CAAE;EACrCC,qBAAqB;EACrBC,KAAK;EACLC,aAAa;EACbC,UAAU;EACVC,gBAAgB;EAChBC,QAAQ,EAAEC;AACQ,CAAC,EAAG;EACtB,IAAK,CAAEH,UAAU,EAAG;IACnB,OAAO,IAAI;EACZ;EACA,MAAMI,SAAS,GAAG,IAAAC,qBAAc,EAAEL,UAAW,CAAC;EAC9C,OACC,IAAAM,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAAc,OAAU;IAETV,KAAK;IACLC,aAAa;IACbG,QAAQ,EAAEC,YAAY;IAEvBM,IAAI,EAAGL,SAAW;IAClBM,UAAU,EACTT,gBAAgB,KAAKU,SAAS,GAC3BC,MAAM,CAAEX,gBAAiB,CAAC,GAC1BU,SACH;IACDE,uBAAuB;IACvBhB,qBAAqB,EAAGA;EAAuB,CAC/C,CAAC;AAEJ","ignoreList":[]}
@@ -82,7 +82,7 @@ function useMarks({
82
82
  const count = 1 + Math.round(range / step);
83
83
  while (count > marks.push({
84
84
  value: step * marks.length + min
85
- }));
85
+ })) {}
86
86
  }
87
87
  const placedMarks = [];
88
88
  marks.forEach((mark, index) => {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_mark","_interopRequireDefault","_rangeControlStyles","RangeRail","props","disabled","marks","min","max","step","value","restProps","_react","createElement","Fragment","Rail","Marks","stepProp","marksData","useMarks","MarksWrapper","className","map","mark","default","key","range","Array","isArray","count","Math","round","push","length","placedMarks","forEach","index","isFilled","offset","offsetStyle","isRTL","style"],"sources":["@wordpress/components/src/range-control/rail.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport RangeMark from './mark';\nimport { MarksWrapper, Rail } from './styles/range-control-styles';\n\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tMarksProps,\n\tRangeMarkProps,\n\tRailProps,\n\tUseMarksArgs,\n} from './types';\n\nexport default function RangeRail(\n\tprops: WordPressComponentProps< RailProps, 'span' >\n) {\n\tconst {\n\t\tdisabled = false,\n\t\tmarks = false,\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tstep = 1,\n\t\tvalue = 0,\n\t\t...restProps\n\t} = props;\n\n\treturn (\n\t\t<>\n\t\t\t<Rail disabled={ disabled } { ...restProps } />\n\t\t\t{ marks && (\n\t\t\t\t<Marks\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tmarks={ marks }\n\t\t\t\t\tmin={ min }\n\t\t\t\t\tmax={ max }\n\t\t\t\t\tstep={ step }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction Marks( props: WordPressComponentProps< MarksProps, 'span' > ) {\n\tconst {\n\t\tdisabled = false,\n\t\tmarks = false,\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tstep: stepProp = 1,\n\t\tvalue = 0,\n\t} = props;\n\n\tconst step = stepProp === 'any' ? 1 : stepProp;\n\tconst marksData = useMarks( { marks, min, max, step, value } );\n\n\treturn (\n\t\t<MarksWrapper\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"components-range-control__marks\"\n\t\t>\n\t\t\t{ marksData.map( ( mark ) => (\n\t\t\t\t<RangeMark\n\t\t\t\t\t{ ...mark }\n\t\t\t\t\tkey={ mark.key }\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</MarksWrapper>\n\t);\n}\n\nfunction useMarks( {\n\tmarks,\n\tmin = 0,\n\tmax = 100,\n\tstep = 1,\n\tvalue = 0,\n}: UseMarksArgs ) {\n\tif ( ! marks ) {\n\t\treturn [];\n\t}\n\n\tconst range = max - min;\n\tif ( ! Array.isArray( marks ) ) {\n\t\tmarks = [];\n\t\tconst count = 1 + Math.round( range / step );\n\t\twhile ( count > marks.push( { value: step * marks.length + min } ) );\n\t}\n\n\tconst placedMarks: RangeMarkProps[] = [];\n\tmarks.forEach( ( mark, index ) => {\n\t\tif ( mark.value < min || mark.value > max ) {\n\t\t\treturn;\n\t\t}\n\t\tconst key = `mark-${ index }`;\n\t\tconst isFilled = mark.value <= value;\n\t\tconst offset = `${ ( ( mark.value - min ) / range ) * 100 }%`;\n\n\t\tconst offsetStyle = {\n\t\t\t[ isRTL() ? 'right' : 'left' ]: offset,\n\t\t};\n\n\t\tplacedMarks.push( {\n\t\t\t...mark,\n\t\t\tisFilled,\n\t\t\tkey,\n\t\t\tstyle: offsetStyle,\n\t\t} );\n\t} );\n\n\treturn placedMarks;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAYe,SAASI,SAASA,CAChCC,KAAmD,EAClD;EACD,MAAM;IACLC,QAAQ,GAAG,KAAK;IAChBC,KAAK,GAAG,KAAK;IACbC,GAAG,GAAG,CAAC;IACPC,GAAG,GAAG,GAAG;IACTC,IAAI,GAAG,CAA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AAE,CAAC;EAEH,OAAOL,WAAW;AACnB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_mark","_interopRequireDefault","_rangeControlStyles","RangeRail","props","disabled","marks","min","max","step","value","restProps","_react","createElement","Fragment","Rail","Marks","stepProp","marksData","useMarks","MarksWrapper","className","map","mark","default","key","range","Array","isArray","count","Math","round","push","length","placedMarks","forEach","index","isFilled","offset","offsetStyle","isRTL","style"],"sources":["@wordpress/components/src/range-control/rail.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport RangeMark from './mark';\nimport { MarksWrapper, Rail } from './styles/range-control-styles';\n\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tMarksProps,\n\tRangeMarkProps,\n\tRailProps,\n\tUseMarksArgs,\n} from './types';\n\nexport default function RangeRail(\n\tprops: WordPressComponentProps< RailProps, 'span' >\n) {\n\tconst {\n\t\tdisabled = false,\n\t\tmarks = false,\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tstep = 1,\n\t\tvalue = 0,\n\t\t...restProps\n\t} = props;\n\n\treturn (\n\t\t<>\n\t\t\t<Rail disabled={ disabled } { ...restProps } />\n\t\t\t{ marks && (\n\t\t\t\t<Marks\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tmarks={ marks }\n\t\t\t\t\tmin={ min }\n\t\t\t\t\tmax={ max }\n\t\t\t\t\tstep={ step }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction Marks( props: WordPressComponentProps< MarksProps, 'span' > ) {\n\tconst {\n\t\tdisabled = false,\n\t\tmarks = false,\n\t\tmin = 0,\n\t\tmax = 100,\n\t\tstep: stepProp = 1,\n\t\tvalue = 0,\n\t} = props;\n\n\tconst step = stepProp === 'any' ? 1 : stepProp;\n\tconst marksData = useMarks( { marks, min, max, step, value } );\n\n\treturn (\n\t\t<MarksWrapper\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName=\"components-range-control__marks\"\n\t\t>\n\t\t\t{ marksData.map( ( mark ) => (\n\t\t\t\t<RangeMark\n\t\t\t\t\t{ ...mark }\n\t\t\t\t\tkey={ mark.key }\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</MarksWrapper>\n\t);\n}\n\nfunction useMarks( {\n\tmarks,\n\tmin = 0,\n\tmax = 100,\n\tstep = 1,\n\tvalue = 0,\n}: UseMarksArgs ) {\n\tif ( ! marks ) {\n\t\treturn [];\n\t}\n\n\tconst range = max - min;\n\tif ( ! Array.isArray( marks ) ) {\n\t\tmarks = [];\n\t\tconst count = 1 + Math.round( range / step );\n\t\twhile ( count > marks.push( { value: step * marks.length + min } ) ) {}\n\t}\n\n\tconst placedMarks: RangeMarkProps[] = [];\n\tmarks.forEach( ( mark, index ) => {\n\t\tif ( mark.value < min || mark.value > max ) {\n\t\t\treturn;\n\t\t}\n\t\tconst key = `mark-${ index }`;\n\t\tconst isFilled = mark.value <= value;\n\t\tconst offset = `${ ( ( mark.value - min ) / range ) * 100 }%`;\n\n\t\tconst offsetStyle = {\n\t\t\t[ isRTL() ? 'right' : 'left' ]: offset,\n\t\t};\n\n\t\tplacedMarks.push( {\n\t\t\t...mark,\n\t\t\tisFilled,\n\t\t\tkey,\n\t\t\tstyle: offsetStyle,\n\t\t} );\n\t} );\n\n\treturn placedMarks;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAYe,SAASI,SAASA,CAChCC,KAAmD,EAClD;EACD,MAAM;IACLC,QAAQ,GAAG,KAAK;IAChBC,KAAK,GAAG,KAAK;IACbC,GAAG,GAAG,CAAC;IACPC,GAAG,GAAG,G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