@wordpress/components 19.4.1-next.f435e9e01b.0 → 19.6.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 (944) hide show
  1. package/CHANGELOG.md +37 -4
  2. package/CONTRIBUTING.md +69 -2
  3. package/build/alignment-matrix-control/utils.js +1 -1
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/angle-picker-control/angle-circle.js +1 -1
  6. package/build/angle-picker-control/angle-circle.js.map +1 -1
  7. package/build/animation/index.js +0 -6
  8. package/build/animation/index.js.map +1 -1
  9. package/build/autocomplete/get-default-use-items.js +3 -3
  10. package/build/autocomplete/get-default-use-items.js.map +1 -1
  11. package/build/base-field/hook.js +1 -1
  12. package/build/base-field/hook.js.map +1 -1
  13. package/build/box-control/icon.js +1 -1
  14. package/build/box-control/icon.js.map +1 -1
  15. package/build/box-control/index.js +4 -4
  16. package/build/box-control/index.js.map +1 -1
  17. package/build/box-control/unit-control.js +2 -2
  18. package/build/box-control/unit-control.js.map +1 -1
  19. package/build/box-control/utils.js +12 -8
  20. package/build/box-control/utils.js.map +1 -1
  21. package/build/button/index.js +5 -5
  22. package/build/button/index.js.map +1 -1
  23. package/build/button/index.native.js +7 -7
  24. package/build/button/index.native.js.map +1 -1
  25. package/build/card/card/component.js +2 -2
  26. package/build/card/card/component.js.map +1 -1
  27. package/build/card/card-body/component.js +1 -1
  28. package/build/card/card-body/component.js.map +1 -1
  29. package/build/card/card-divider/component.js +1 -1
  30. package/build/card/card-divider/component.js.map +1 -1
  31. package/build/card/card-footer/component.js +1 -1
  32. package/build/card/card-footer/component.js.map +1 -1
  33. package/build/card/card-header/component.js +1 -1
  34. package/build/card/card-header/component.js.map +1 -1
  35. package/build/card/card-media/component.js +1 -1
  36. package/build/card/card-media/component.js.map +1 -1
  37. package/build/color-palette/index.native.js +35 -30
  38. package/build/color-palette/index.native.js.map +1 -1
  39. package/build/color-picker/color-display.js +1 -1
  40. package/build/color-picker/color-display.js.map +1 -1
  41. package/build/color-picker/component.js.map +1 -1
  42. package/build/color-picker/hex-input.js +6 -9
  43. package/build/color-picker/hex-input.js.map +1 -1
  44. package/build/color-picker/styles.js +8 -8
  45. package/build/color-picker/styles.js.map +1 -1
  46. package/build/combobox-control/index.js +1 -1
  47. package/build/combobox-control/index.js.map +1 -1
  48. package/build/confirm-dialog/component.js +4 -2
  49. package/build/confirm-dialog/component.js.map +1 -1
  50. package/build/date-time/time.js +7 -4
  51. package/build/date-time/time.js.map +1 -1
  52. package/build/divider/component.js +5 -4
  53. package/build/divider/component.js.map +1 -1
  54. package/build/draggable/index.js +3 -3
  55. package/build/draggable/index.js.map +1 -1
  56. package/build/elevation/component.js +1 -1
  57. package/build/elevation/component.js.map +1 -1
  58. package/build/flex/flex/component.js +1 -1
  59. package/build/flex/flex/component.js.map +1 -1
  60. package/build/flex/flex-block/component.js +1 -1
  61. package/build/flex/flex-block/component.js.map +1 -1
  62. package/build/flex/flex-item/component.js +1 -1
  63. package/build/flex/flex-item/component.js.map +1 -1
  64. package/build/flyout/flyout/component.js +1 -1
  65. package/build/flyout/flyout/component.js.map +1 -1
  66. package/build/flyout/flyout-content/component.js +1 -1
  67. package/build/flyout/flyout-content/component.js.map +1 -1
  68. package/build/focal-point-picker/index.js +18 -12
  69. package/build/focal-point-picker/index.js.map +1 -1
  70. package/build/focal-point-picker/index.native.js +7 -7
  71. package/build/focal-point-picker/index.native.js.map +1 -1
  72. package/build/focal-point-picker/tooltip/index.native.js +1 -1
  73. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  74. package/build/font-size-picker/index.js +1 -2
  75. package/build/font-size-picker/index.js.map +1 -1
  76. package/build/form-token-field/index.js +6 -6
  77. package/build/form-token-field/index.js.map +1 -1
  78. package/build/form-token-field/suggestions-list.js +2 -2
  79. package/build/form-token-field/suggestions-list.js.map +1 -1
  80. package/build/grid/component.js +1 -1
  81. package/build/grid/component.js.map +1 -1
  82. package/build/h-stack/component.js +1 -1
  83. package/build/h-stack/component.js.map +1 -1
  84. package/build/heading/component.js +6 -5
  85. package/build/heading/component.js.map +1 -1
  86. package/build/heading/hook.js +1 -1
  87. package/build/heading/hook.js.map +1 -1
  88. package/build/higher-order/with-notices/index.js +1 -1
  89. package/build/higher-order/with-notices/index.js.map +1 -1
  90. package/build/index.js +14 -2
  91. package/build/index.js.map +1 -1
  92. package/build/index.native.js +15 -1
  93. package/build/index.native.js.map +1 -1
  94. package/build/input-control/index.js.map +1 -1
  95. package/build/input-control/input-base.js +1 -1
  96. package/build/input-control/input-base.js.map +1 -1
  97. package/build/input-control/input-field.js +19 -17
  98. package/build/input-control/input-field.js.map +1 -1
  99. package/build/input-control/reducer/reducer.js +3 -0
  100. package/build/input-control/reducer/reducer.js.map +1 -1
  101. package/build/input-control/styles/input-control-styles.js +25 -25
  102. package/build/input-control/styles/input-control-styles.js.map +1 -1
  103. package/build/isolated-event-container/index.js +1 -1
  104. package/build/isolated-event-container/index.js.map +1 -1
  105. package/build/item-group/item/component.js.map +1 -1
  106. package/build/item-group/item-group/component.js.map +1 -1
  107. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  108. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  109. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  110. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  111. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  112. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  113. package/build/mobile/bottom-sheet/cell.native.js +1 -1
  114. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  115. package/build/mobile/bottom-sheet/index.native.js +11 -11
  116. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  117. package/build/mobile/bottom-sheet/link-cell.native.js +1 -1
  118. package/build/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  119. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  120. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  121. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  122. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  123. package/build/mobile/color-settings/palette.screen.native.js +26 -9
  124. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  125. package/build/mobile/global-styles-context/utils.native.js +73 -19
  126. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  127. package/build/mobile/gradient/index.native.js +2 -2
  128. package/build/mobile/gradient/index.native.js.map +1 -1
  129. package/build/mobile/html-text-input/container.ios.js +3 -3
  130. package/build/mobile/html-text-input/container.ios.js.map +1 -1
  131. package/build/mobile/html-text-input/index.native.js +1 -1
  132. package/build/mobile/html-text-input/index.native.js.map +1 -1
  133. package/build/mobile/image/index.native.js +1 -1
  134. package/build/mobile/image/index.native.js.map +1 -1
  135. package/build/mobile/inserter-button/index.native.js +3 -3
  136. package/build/mobile/inserter-button/index.native.js.map +1 -1
  137. package/build/mobile/inserter-button/sparkles.js +25 -0
  138. package/build/mobile/inserter-button/sparkles.js.map +1 -0
  139. package/build/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  140. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  141. package/build/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  142. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  143. package/build/mobile/link-picker/index.native.js +3 -3
  144. package/build/mobile/link-picker/index.native.js.map +1 -1
  145. package/build/mobile/link-picker/link-picker-results.native.js +8 -8
  146. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  147. package/build/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  148. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  149. package/build/mobile/link-settings/index.native.js +1 -1
  150. package/build/mobile/link-settings/index.native.js.map +1 -1
  151. package/build/modal/aria-helper.js +1 -1
  152. package/build/modal/aria-helper.js.map +1 -1
  153. package/build/modal/index.js +2 -2
  154. package/build/modal/index.js.map +1 -1
  155. package/build/navigable-container/container.js +2 -2
  156. package/build/navigable-container/container.js.map +1 -1
  157. package/build/navigable-container/tabbable.js +1 -1
  158. package/build/navigable-container/tabbable.js.map +1 -1
  159. package/build/navigation/item/index.js +1 -1
  160. package/build/navigation/item/index.js.map +1 -1
  161. package/build/navigation/menu/index.js +1 -1
  162. package/build/navigation/menu/index.js.map +1 -1
  163. package/build/navigator/index.js +16 -0
  164. package/build/navigator/index.js.map +1 -1
  165. package/build/navigator/navigator-back-button/component.js +72 -0
  166. package/build/navigator/navigator-back-button/component.js.map +1 -0
  167. package/build/navigator/navigator-back-button/hook.js +49 -0
  168. package/build/navigator/navigator-back-button/hook.js.map +1 -0
  169. package/build/navigator/navigator-back-button/index.js +16 -0
  170. package/build/navigator/navigator-back-button/index.js.map +1 -0
  171. package/build/navigator/navigator-button/component.js +71 -0
  172. package/build/navigator/navigator-button/component.js.map +1 -0
  173. package/build/navigator/navigator-button/hook.js +59 -0
  174. package/build/navigator/navigator-button/hook.js.map +1 -0
  175. package/build/navigator/navigator-button/index.js +16 -0
  176. package/build/navigator/navigator-button/index.js.map +1 -0
  177. package/build/navigator/navigator-provider/component.js +12 -22
  178. package/build/navigator/navigator-provider/component.js.map +1 -1
  179. package/build/navigator/navigator-screen/component.js +14 -22
  180. package/build/navigator/navigator-screen/component.js.map +1 -1
  181. package/build/number-control/index.js +1 -1
  182. package/build/number-control/index.js.map +1 -1
  183. package/build/panel/body.js +2 -2
  184. package/build/panel/body.js.map +1 -1
  185. package/build/popover/index.js +3 -3
  186. package/build/popover/index.js.map +1 -1
  187. package/build/popover/utils.js +6 -6
  188. package/build/popover/utils.js.map +1 -1
  189. package/build/radio-group/index.js +1 -1
  190. package/build/radio-group/index.js.map +1 -1
  191. package/build/range-control/styles/range-control-styles.js +29 -29
  192. package/build/range-control/styles/range-control-styles.js.map +1 -1
  193. package/build/resizable-box/index.js.map +1 -1
  194. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  195. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  196. package/build/sandbox/index.js +5 -5
  197. package/build/sandbox/index.js.map +1 -1
  198. package/build/sandbox/index.native.js +1 -1
  199. package/build/sandbox/index.native.js.map +1 -1
  200. package/build/scrollable/component.js +1 -1
  201. package/build/scrollable/component.js.map +1 -1
  202. package/build/select-control/index.js +1 -1
  203. package/build/select-control/index.js.map +1 -1
  204. package/build/select-control/styles/select-control-styles.js +5 -5
  205. package/build/select-control/styles/select-control-styles.js.map +1 -1
  206. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  207. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  208. package/build/slot-fill/bubbles-virtually/slot.js +1 -1
  209. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  210. package/build/slot-fill/fill.js +1 -1
  211. package/build/slot-fill/fill.js.map +1 -1
  212. package/build/slot-fill/provider.js +1 -1
  213. package/build/slot-fill/provider.js.map +1 -1
  214. package/build/snackbar/index.js +1 -1
  215. package/build/snackbar/index.js.map +1 -1
  216. package/build/snackbar/list.js +1 -1
  217. package/build/snackbar/list.js.map +1 -1
  218. package/build/spacer/component.js.map +1 -1
  219. package/build/style-provider/index.js +2 -2
  220. package/build/style-provider/index.js.map +1 -1
  221. package/build/surface/component.js +1 -1
  222. package/build/surface/component.js.map +1 -1
  223. package/build/text/component.js +1 -1
  224. package/build/text/component.js.map +1 -1
  225. package/build/text-control/index.js +2 -2
  226. package/build/text-control/index.js.map +1 -1
  227. package/build/toggle-group-control/toggle-group-control/component.js +2 -2
  228. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  229. package/build/toggle-group-control/toggle-group-control-option/component.js +1 -4
  230. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  231. package/build/toggle-group-control/toggle-group-control-option/styles.js +12 -19
  232. package/build/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  233. package/build/toolbar/index.js +1 -1
  234. package/build/toolbar/index.js.map +1 -1
  235. package/build/tools-panel/tools-panel/component.js.map +1 -1
  236. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  237. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  238. package/build/tooltip/index.js +3 -3
  239. package/build/tooltip/index.js.map +1 -1
  240. package/build/tooltip/index.native.js +7 -7
  241. package/build/tooltip/index.native.js.map +1 -1
  242. package/build/tree-grid/index.js +54 -7
  243. package/build/tree-grid/index.js.map +1 -1
  244. package/build/truncate/component.js +1 -1
  245. package/build/truncate/component.js.map +1 -1
  246. package/build/truncate/utils.js +1 -1
  247. package/build/truncate/utils.js.map +1 -1
  248. package/build/ui/context/context-connect.js +8 -15
  249. package/build/ui/context/context-connect.js.map +1 -1
  250. package/build/ui/context/context-system-provider.js +2 -2
  251. package/build/ui/context/context-system-provider.js.map +1 -1
  252. package/build/ui/context/index.js.map +1 -1
  253. package/build/ui/control-group/component.js +1 -1
  254. package/build/ui/control-group/component.js.map +1 -1
  255. package/build/ui/control-label/component.js +1 -1
  256. package/build/ui/control-label/component.js.map +1 -1
  257. package/build/ui/form-group/form-group.js +1 -1
  258. package/build/ui/form-group/form-group.js.map +1 -1
  259. package/build/ui/shortcut/component.js.map +1 -1
  260. package/build/ui/spinner/component.js +1 -1
  261. package/build/ui/spinner/component.js.map +1 -1
  262. package/build/ui/tooltip/component.js +1 -1
  263. package/build/ui/tooltip/component.js.map +1 -1
  264. package/build/ui/tooltip/content.js +1 -1
  265. package/build/ui/tooltip/content.js.map +1 -1
  266. package/build/ui/utils/colors.js +2 -2
  267. package/build/ui/utils/colors.js.map +1 -1
  268. package/build/ui/utils/space.js +2 -2
  269. package/build/ui/utils/space.js.map +1 -1
  270. package/build/unit-control/index.js +38 -29
  271. package/build/unit-control/index.js.map +1 -1
  272. package/build/unit-control/index.native.js +4 -2
  273. package/build/unit-control/index.native.js.map +1 -1
  274. package/build/unit-control/unit-select-control.js +1 -1
  275. package/build/unit-control/unit-select-control.js.map +1 -1
  276. package/build/unit-control/utils.js +96 -104
  277. package/build/unit-control/utils.js.map +1 -1
  278. package/build/utils/breakpoint-values.js +1 -1
  279. package/build/utils/breakpoint-values.js.map +1 -1
  280. package/build/utils/colors-values.js +1 -1
  281. package/build/utils/colors-values.js.map +1 -1
  282. package/build/v-stack/component.js +1 -1
  283. package/build/v-stack/component.js.map +1 -1
  284. package/build/visually-hidden/component.js +1 -1
  285. package/build/visually-hidden/component.js.map +1 -1
  286. package/build/z-stack/component.js.map +1 -1
  287. package/build-module/alignment-matrix-control/utils.js +1 -1
  288. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  289. package/build-module/angle-picker-control/angle-circle.js +1 -1
  290. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  291. package/build-module/animation/index.js +1 -1
  292. package/build-module/animation/index.js.map +1 -1
  293. package/build-module/autocomplete/get-default-use-items.js +3 -3
  294. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  295. package/build-module/base-field/hook.js +1 -1
  296. package/build-module/base-field/hook.js.map +1 -1
  297. package/build-module/box-control/icon.js +1 -1
  298. package/build-module/box-control/icon.js.map +1 -1
  299. package/build-module/box-control/index.js +5 -5
  300. package/build-module/box-control/index.js.map +1 -1
  301. package/build-module/box-control/unit-control.js +1 -1
  302. package/build-module/box-control/unit-control.js.map +1 -1
  303. package/build-module/box-control/utils.js +13 -9
  304. package/build-module/box-control/utils.js.map +1 -1
  305. package/build-module/button/index.js +5 -5
  306. package/build-module/button/index.js.map +1 -1
  307. package/build-module/button/index.native.js +7 -7
  308. package/build-module/button/index.native.js.map +1 -1
  309. package/build-module/card/card/component.js +2 -2
  310. package/build-module/card/card/component.js.map +1 -1
  311. package/build-module/card/card-body/component.js +1 -1
  312. package/build-module/card/card-body/component.js.map +1 -1
  313. package/build-module/card/card-divider/component.js +1 -1
  314. package/build-module/card/card-divider/component.js.map +1 -1
  315. package/build-module/card/card-footer/component.js +1 -1
  316. package/build-module/card/card-footer/component.js.map +1 -1
  317. package/build-module/card/card-header/component.js +1 -1
  318. package/build-module/card/card-header/component.js.map +1 -1
  319. package/build-module/card/card-media/component.js +1 -1
  320. package/build-module/card/card-media/component.js.map +1 -1
  321. package/build-module/color-palette/index.native.js +36 -31
  322. package/build-module/color-palette/index.native.js.map +1 -1
  323. package/build-module/color-picker/color-display.js +1 -1
  324. package/build-module/color-picker/color-display.js.map +1 -1
  325. package/build-module/color-picker/component.js.map +1 -1
  326. package/build-module/color-picker/hex-input.js +6 -9
  327. package/build-module/color-picker/hex-input.js.map +1 -1
  328. package/build-module/color-picker/styles.js +8 -8
  329. package/build-module/color-picker/styles.js.map +1 -1
  330. package/build-module/combobox-control/index.js +1 -1
  331. package/build-module/combobox-control/index.js.map +1 -1
  332. package/build-module/confirm-dialog/component.js +4 -5
  333. package/build-module/confirm-dialog/component.js.map +1 -1
  334. package/build-module/date-time/time.js +7 -4
  335. package/build-module/date-time/time.js.map +1 -1
  336. package/build-module/divider/component.js +3 -3
  337. package/build-module/divider/component.js.map +1 -1
  338. package/build-module/draggable/index.js +3 -3
  339. package/build-module/draggable/index.js.map +1 -1
  340. package/build-module/elevation/component.js +1 -1
  341. package/build-module/elevation/component.js.map +1 -1
  342. package/build-module/flex/flex/component.js +1 -1
  343. package/build-module/flex/flex/component.js.map +1 -1
  344. package/build-module/flex/flex-block/component.js +1 -1
  345. package/build-module/flex/flex-block/component.js.map +1 -1
  346. package/build-module/flex/flex-item/component.js +1 -1
  347. package/build-module/flex/flex-item/component.js.map +1 -1
  348. package/build-module/flyout/flyout/component.js +1 -1
  349. package/build-module/flyout/flyout/component.js.map +1 -1
  350. package/build-module/flyout/flyout-content/component.js +1 -1
  351. package/build-module/flyout/flyout-content/component.js.map +1 -1
  352. package/build-module/focal-point-picker/index.js +18 -12
  353. package/build-module/focal-point-picker/index.js.map +1 -1
  354. package/build-module/focal-point-picker/index.native.js +7 -7
  355. package/build-module/focal-point-picker/index.native.js.map +1 -1
  356. package/build-module/focal-point-picker/tooltip/index.native.js +1 -1
  357. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  358. package/build-module/font-size-picker/index.js +1 -2
  359. package/build-module/font-size-picker/index.js.map +1 -1
  360. package/build-module/form-token-field/index.js +6 -6
  361. package/build-module/form-token-field/index.js.map +1 -1
  362. package/build-module/form-token-field/suggestions-list.js +2 -2
  363. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  364. package/build-module/grid/component.js +1 -1
  365. package/build-module/grid/component.js.map +1 -1
  366. package/build-module/h-stack/component.js +1 -1
  367. package/build-module/h-stack/component.js.map +1 -1
  368. package/build-module/heading/component.js +4 -4
  369. package/build-module/heading/component.js.map +1 -1
  370. package/build-module/heading/hook.js +1 -1
  371. package/build-module/heading/hook.js.map +1 -1
  372. package/build-module/higher-order/with-notices/index.js +1 -1
  373. package/build-module/higher-order/with-notices/index.js.map +1 -1
  374. package/build-module/index.js +5 -5
  375. package/build-module/index.js.map +1 -1
  376. package/build-module/index.native.js +5 -5
  377. package/build-module/index.native.js.map +1 -1
  378. package/build-module/input-control/index.js.map +1 -1
  379. package/build-module/input-control/input-base.js +1 -1
  380. package/build-module/input-control/input-base.js.map +1 -1
  381. package/build-module/input-control/input-field.js +19 -16
  382. package/build-module/input-control/input-field.js.map +1 -1
  383. package/build-module/input-control/reducer/reducer.js +3 -0
  384. package/build-module/input-control/reducer/reducer.js.map +1 -1
  385. package/build-module/input-control/styles/input-control-styles.js +25 -25
  386. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  387. package/build-module/isolated-event-container/index.js +1 -1
  388. package/build-module/isolated-event-container/index.js.map +1 -1
  389. package/build-module/item-group/item/component.js.map +1 -1
  390. package/build-module/item-group/item-group/component.js.map +1 -1
  391. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  392. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  393. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  394. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  395. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  396. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  397. package/build-module/mobile/bottom-sheet/cell.native.js +1 -1
  398. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  399. package/build-module/mobile/bottom-sheet/index.native.js +11 -11
  400. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  401. package/build-module/mobile/bottom-sheet/link-cell.native.js +1 -1
  402. package/build-module/mobile/bottom-sheet/link-cell.native.js.map +1 -1
  403. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  404. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  405. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  406. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  407. package/build-module/mobile/color-settings/palette.screen.native.js +27 -10
  408. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  409. package/build-module/mobile/global-styles-context/utils.native.js +70 -20
  410. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  411. package/build-module/mobile/gradient/index.native.js +2 -2
  412. package/build-module/mobile/gradient/index.native.js.map +1 -1
  413. package/build-module/mobile/html-text-input/container.ios.js +3 -3
  414. package/build-module/mobile/html-text-input/container.ios.js.map +1 -1
  415. package/build-module/mobile/html-text-input/index.native.js +1 -1
  416. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  417. package/build-module/mobile/image/index.native.js +1 -1
  418. package/build-module/mobile/image/index.native.js.map +1 -1
  419. package/build-module/mobile/inserter-button/index.native.js +1 -1
  420. package/build-module/mobile/inserter-button/index.native.js.map +1 -1
  421. package/build-module/mobile/inserter-button/sparkles.js +16 -0
  422. package/build-module/mobile/inserter-button/sparkles.js.map +1 -0
  423. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  424. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  425. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  426. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  427. package/build-module/mobile/link-picker/index.native.js +3 -3
  428. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  429. package/build-module/mobile/link-picker/link-picker-results.native.js +8 -8
  430. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  431. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  432. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  433. package/build-module/mobile/link-settings/index.native.js +1 -1
  434. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  435. package/build-module/modal/aria-helper.js +1 -1
  436. package/build-module/modal/aria-helper.js.map +1 -1
  437. package/build-module/modal/index.js +2 -2
  438. package/build-module/modal/index.js.map +1 -1
  439. package/build-module/navigable-container/container.js +2 -2
  440. package/build-module/navigable-container/container.js.map +1 -1
  441. package/build-module/navigable-container/tabbable.js +1 -1
  442. package/build-module/navigable-container/tabbable.js.map +1 -1
  443. package/build-module/navigation/item/index.js +1 -1
  444. package/build-module/navigation/item/index.js.map +1 -1
  445. package/build-module/navigation/menu/index.js +1 -1
  446. package/build-module/navigation/menu/index.js.map +1 -1
  447. package/build-module/navigator/index.js +2 -0
  448. package/build-module/navigator/index.js.map +1 -1
  449. package/build-module/navigator/navigator-back-button/component.js +59 -0
  450. package/build-module/navigator/navigator-back-button/component.js.map +1 -0
  451. package/build-module/navigator/navigator-back-button/hook.js +36 -0
  452. package/build-module/navigator/navigator-back-button/hook.js.map +1 -0
  453. package/build-module/navigator/navigator-back-button/index.js +2 -0
  454. package/build-module/navigator/navigator-back-button/index.js.map +1 -0
  455. package/build-module/navigator/navigator-button/component.js +58 -0
  456. package/build-module/navigator/navigator-button/component.js.map +1 -0
  457. package/build-module/navigator/navigator-button/hook.js +46 -0
  458. package/build-module/navigator/navigator-button/hook.js.map +1 -0
  459. package/build-module/navigator/navigator-button/index.js +2 -0
  460. package/build-module/navigator/navigator-button/index.js.map +1 -0
  461. package/build-module/navigator/navigator-provider/component.js +12 -22
  462. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  463. package/build-module/navigator/navigator-screen/component.js +13 -22
  464. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  465. package/build-module/number-control/index.js +1 -1
  466. package/build-module/number-control/index.js.map +1 -1
  467. package/build-module/panel/body.js +2 -2
  468. package/build-module/panel/body.js.map +1 -1
  469. package/build-module/popover/index.js +3 -3
  470. package/build-module/popover/index.js.map +1 -1
  471. package/build-module/popover/utils.js +6 -6
  472. package/build-module/popover/utils.js.map +1 -1
  473. package/build-module/radio-group/index.js +1 -1
  474. package/build-module/radio-group/index.js.map +1 -1
  475. package/build-module/range-control/styles/range-control-styles.js +29 -29
  476. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  477. package/build-module/resizable-box/index.js.map +1 -1
  478. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  479. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  480. package/build-module/sandbox/index.js +5 -5
  481. package/build-module/sandbox/index.js.map +1 -1
  482. package/build-module/sandbox/index.native.js +1 -1
  483. package/build-module/sandbox/index.native.js.map +1 -1
  484. package/build-module/scrollable/component.js +1 -1
  485. package/build-module/scrollable/component.js.map +1 -1
  486. package/build-module/select-control/index.js +2 -2
  487. package/build-module/select-control/index.js.map +1 -1
  488. package/build-module/select-control/styles/select-control-styles.js +5 -5
  489. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  490. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  491. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  492. package/build-module/slot-fill/bubbles-virtually/slot.js +1 -1
  493. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  494. package/build-module/slot-fill/fill.js +1 -1
  495. package/build-module/slot-fill/fill.js.map +1 -1
  496. package/build-module/slot-fill/provider.js +1 -1
  497. package/build-module/slot-fill/provider.js.map +1 -1
  498. package/build-module/snackbar/index.js +1 -1
  499. package/build-module/snackbar/index.js.map +1 -1
  500. package/build-module/snackbar/list.js +1 -1
  501. package/build-module/snackbar/list.js.map +1 -1
  502. package/build-module/spacer/component.js.map +1 -1
  503. package/build-module/style-provider/index.js +2 -2
  504. package/build-module/style-provider/index.js.map +1 -1
  505. package/build-module/surface/component.js +1 -1
  506. package/build-module/surface/component.js.map +1 -1
  507. package/build-module/text/component.js +1 -1
  508. package/build-module/text/component.js.map +1 -1
  509. package/build-module/text-control/index.js +2 -2
  510. package/build-module/text-control/index.js.map +1 -1
  511. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -2
  512. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  513. package/build-module/toggle-group-control/toggle-group-control-option/component.js +1 -4
  514. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  515. package/build-module/toggle-group-control/toggle-group-control-option/styles.js +11 -17
  516. package/build-module/toggle-group-control/toggle-group-control-option/styles.js.map +1 -1
  517. package/build-module/toolbar/index.js +1 -1
  518. package/build-module/toolbar/index.js.map +1 -1
  519. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  520. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  521. package/build-module/tools-panel/tools-panel-item/component.js.map +1 -1
  522. package/build-module/tooltip/index.js +3 -3
  523. package/build-module/tooltip/index.js.map +1 -1
  524. package/build-module/tooltip/index.native.js +7 -7
  525. package/build-module/tooltip/index.native.js.map +1 -1
  526. package/build-module/tree-grid/index.js +55 -8
  527. package/build-module/tree-grid/index.js.map +1 -1
  528. package/build-module/truncate/component.js +1 -1
  529. package/build-module/truncate/component.js.map +1 -1
  530. package/build-module/truncate/utils.js +1 -1
  531. package/build-module/truncate/utils.js.map +1 -1
  532. package/build-module/ui/context/context-connect.js +9 -16
  533. package/build-module/ui/context/context-connect.js.map +1 -1
  534. package/build-module/ui/context/context-system-provider.js +2 -2
  535. package/build-module/ui/context/context-system-provider.js.map +1 -1
  536. package/build-module/ui/context/index.js.map +1 -1
  537. package/build-module/ui/control-group/component.js +1 -1
  538. package/build-module/ui/control-group/component.js.map +1 -1
  539. package/build-module/ui/control-label/component.js +1 -1
  540. package/build-module/ui/control-label/component.js.map +1 -1
  541. package/build-module/ui/form-group/form-group.js +1 -1
  542. package/build-module/ui/form-group/form-group.js.map +1 -1
  543. package/build-module/ui/shortcut/component.js.map +1 -1
  544. package/build-module/ui/spinner/component.js +1 -1
  545. package/build-module/ui/spinner/component.js.map +1 -1
  546. package/build-module/ui/tooltip/component.js +1 -1
  547. package/build-module/ui/tooltip/component.js.map +1 -1
  548. package/build-module/ui/tooltip/content.js +1 -1
  549. package/build-module/ui/tooltip/content.js.map +1 -1
  550. package/build-module/ui/utils/colors.js +2 -2
  551. package/build-module/ui/utils/colors.js.map +1 -1
  552. package/build-module/ui/utils/space.js +2 -2
  553. package/build-module/ui/utils/space.js.map +1 -1
  554. package/build-module/unit-control/index.js +39 -30
  555. package/build-module/unit-control/index.js.map +1 -1
  556. package/build-module/unit-control/index.native.js +5 -3
  557. package/build-module/unit-control/index.native.js.map +1 -1
  558. package/build-module/unit-control/unit-select-control.js +1 -1
  559. package/build-module/unit-control/unit-select-control.js.map +1 -1
  560. package/build-module/unit-control/utils.js +92 -100
  561. package/build-module/unit-control/utils.js.map +1 -1
  562. package/build-module/utils/breakpoint-values.js +1 -1
  563. package/build-module/utils/breakpoint-values.js.map +1 -1
  564. package/build-module/utils/colors-values.js +1 -1
  565. package/build-module/utils/colors-values.js.map +1 -1
  566. package/build-module/v-stack/component.js +1 -1
  567. package/build-module/v-stack/component.js.map +1 -1
  568. package/build-module/visually-hidden/component.js +1 -1
  569. package/build-module/visually-hidden/component.js.map +1 -1
  570. package/build-module/z-stack/component.js.map +1 -1
  571. package/build-style/style-rtl.css +8 -0
  572. package/build-style/style.css +8 -0
  573. package/build-types/base-field/hook.d.ts +2 -1
  574. package/build-types/base-field/hook.d.ts.map +1 -1
  575. package/build-types/card/card/hook.d.ts +2 -1
  576. package/build-types/card/card/hook.d.ts.map +1 -1
  577. package/build-types/card/card-body/hook.d.ts +2 -1
  578. package/build-types/card/card-body/hook.d.ts.map +1 -1
  579. package/build-types/card/card-divider/hook.d.ts +2 -3
  580. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  581. package/build-types/card/card-footer/hook.d.ts +2 -1
  582. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  583. package/build-types/card/card-header/hook.d.ts +2 -1
  584. package/build-types/card/card-header/hook.d.ts.map +1 -1
  585. package/build-types/card/card-media/hook.d.ts +2 -1
  586. package/build-types/card/card-media/hook.d.ts.map +1 -1
  587. package/build-types/color-picker/styles.d.ts +2 -4
  588. package/build-types/color-picker/styles.d.ts.map +1 -1
  589. package/build-types/confirm-dialog/component.d.ts +10 -6
  590. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  591. package/build-types/confirm-dialog/types.d.ts +2 -0
  592. package/build-types/confirm-dialog/types.d.ts.map +1 -1
  593. package/build-types/divider/component.d.ts +2 -2
  594. package/build-types/divider/component.d.ts.map +1 -1
  595. package/build-types/divider/stories/index.d.ts +10 -0
  596. package/build-types/divider/stories/index.d.ts.map +1 -0
  597. package/build-types/divider/types.d.ts +1 -1
  598. package/build-types/divider/types.d.ts.map +1 -1
  599. package/build-types/elevation/hook.d.ts +2 -1
  600. package/build-types/elevation/hook.d.ts.map +1 -1
  601. package/build-types/flex/flex/hook.d.ts +2 -1
  602. package/build-types/flex/flex/hook.d.ts.map +1 -1
  603. package/build-types/flex/flex-block/hook.d.ts +2 -1
  604. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  605. package/build-types/flex/flex-item/hook.d.ts +2 -1
  606. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  607. package/build-types/flyout/flyout/hook.d.ts +2 -2
  608. package/build-types/grid/hook.d.ts +2 -1
  609. package/build-types/grid/hook.d.ts.map +1 -1
  610. package/build-types/h-stack/hook.d.ts +3 -2
  611. package/build-types/h-stack/hook.d.ts.map +1 -1
  612. package/build-types/heading/component.d.ts +3 -3
  613. package/build-types/heading/component.d.ts.map +1 -1
  614. package/build-types/heading/hook.d.ts +2 -1
  615. package/build-types/heading/hook.d.ts.map +1 -1
  616. package/build-types/heading/stories/index.d.ts +12 -0
  617. package/build-types/heading/stories/index.d.ts.map +1 -0
  618. package/build-types/input-control/index.d.ts +3 -3
  619. package/build-types/input-control/index.d.ts.map +1 -1
  620. package/build-types/input-control/input-base.d.ts +2 -2
  621. package/build-types/input-control/input-base.d.ts.map +1 -1
  622. package/build-types/input-control/input-field.d.ts +1 -3
  623. package/build-types/input-control/input-field.d.ts.map +1 -1
  624. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  625. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  626. package/build-types/input-control/types.d.ts +1 -1
  627. package/build-types/input-control/types.d.ts.map +1 -1
  628. package/build-types/item-group/item/hook.d.ts +2 -1
  629. package/build-types/item-group/item/hook.d.ts.map +1 -1
  630. package/build-types/item-group/item-group/hook.d.ts +2 -1
  631. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  632. package/build-types/navigator/index.d.ts +2 -0
  633. package/build-types/navigator/index.d.ts.map +1 -1
  634. package/build-types/navigator/navigator-back-button/component.d.ts +38 -0
  635. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -0
  636. package/build-types/navigator/navigator-back-button/hook.d.ts +283 -0
  637. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -0
  638. package/build-types/navigator/navigator-back-button/index.d.ts +2 -0
  639. package/build-types/navigator/navigator-back-button/index.d.ts.map +1 -0
  640. package/build-types/navigator/navigator-button/component.d.ts +37 -0
  641. package/build-types/navigator/navigator-button/component.d.ts.map +1 -0
  642. package/build-types/navigator/navigator-button/hook.d.ts +283 -0
  643. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -0
  644. package/build-types/navigator/navigator-button/index.d.ts +2 -0
  645. package/build-types/navigator/navigator-button/index.d.ts.map +1 -0
  646. package/build-types/navigator/navigator-provider/component.d.ts +10 -20
  647. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  648. package/build-types/navigator/navigator-screen/component.d.ts +10 -20
  649. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  650. package/build-types/navigator/types.d.ts +21 -0
  651. package/build-types/navigator/types.d.ts.map +1 -1
  652. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  653. package/build-types/resizable-box/index.d.ts +2 -2
  654. package/build-types/resizable-box/index.d.ts.map +1 -1
  655. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  656. package/build-types/scrollable/hook.d.ts +2 -1
  657. package/build-types/scrollable/hook.d.ts.map +1 -1
  658. package/build-types/select-control/index.d.ts +1 -3
  659. package/build-types/select-control/index.d.ts.map +1 -1
  660. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  661. package/build-types/spacer/hook.d.ts +2 -1
  662. package/build-types/spacer/hook.d.ts.map +1 -1
  663. package/build-types/surface/hook.d.ts +2 -1
  664. package/build-types/surface/hook.d.ts.map +1 -1
  665. package/build-types/text/hook.d.ts +2 -1
  666. package/build-types/text/hook.d.ts.map +1 -1
  667. package/build-types/text/types.d.ts +1 -2
  668. package/build-types/text/types.d.ts.map +1 -1
  669. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  670. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts +0 -4
  671. package/build-types/toggle-group-control/toggle-group-control-option/styles.d.ts.map +1 -1
  672. package/build-types/tools-panel/tools-panel/hook.d.ts +2 -1
  673. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  674. package/build-types/tools-panel/tools-panel-header/hook.d.ts +2 -1
  675. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  676. package/build-types/tools-panel/tools-panel-item/hook.d.ts +2 -1
  677. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  678. package/build-types/truncate/hook.d.ts +2 -1
  679. package/build-types/truncate/hook.d.ts.map +1 -1
  680. package/build-types/ui/context/context-connect.d.ts +18 -16
  681. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  682. package/build-types/ui/context/index.d.ts +4 -4
  683. package/build-types/ui/context/index.d.ts.map +1 -1
  684. package/build-types/ui/context/wordpress-component.d.ts +3 -6
  685. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  686. package/build-types/ui/control-group/hook.d.ts +2 -1
  687. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  688. package/build-types/ui/control-label/hook.d.ts +2 -1
  689. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  690. package/build-types/ui/form-group/use-form-group.d.ts +6 -4
  691. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  692. package/build-types/unit-control/index.d.ts +3 -5
  693. package/build-types/unit-control/index.d.ts.map +1 -1
  694. package/build-types/unit-control/types.d.ts +4 -6
  695. package/build-types/unit-control/types.d.ts.map +1 -1
  696. package/build-types/unit-control/utils.d.ts +47 -38
  697. package/build-types/unit-control/utils.d.ts.map +1 -1
  698. package/build-types/v-stack/hook.d.ts +2 -1
  699. package/build-types/v-stack/hook.d.ts.map +1 -1
  700. package/build-types/z-stack/component.d.ts.map +1 -1
  701. package/package.json +19 -18
  702. package/src/alignment-matrix-control/README.md +4 -0
  703. package/src/alignment-matrix-control/stories/index.js +1 -1
  704. package/src/alignment-matrix-control/utils.js +1 -1
  705. package/src/angle-picker-control/angle-circle.js +1 -1
  706. package/src/animation/index.js +0 -1
  707. package/src/autocomplete/get-default-use-items.js +3 -3
  708. package/src/base-control/stories/index.js +65 -22
  709. package/src/base-field/hook.js +1 -1
  710. package/src/box-control/icon.js +1 -1
  711. package/src/box-control/index.js +5 -5
  712. package/src/box-control/stories/index.js +4 -1
  713. package/src/box-control/test/index.js +27 -7
  714. package/src/box-control/unit-control.js +1 -1
  715. package/src/box-control/utils.js +13 -9
  716. package/src/button/index.js +5 -5
  717. package/src/button/index.native.js +7 -7
  718. package/src/button/style.scss +1 -0
  719. package/src/card/card/component.js +1 -1
  720. package/src/card/card-body/component.js +1 -1
  721. package/src/card/card-divider/component.js +1 -1
  722. package/src/card/card-footer/component.js +1 -1
  723. package/src/card/card-header/component.js +1 -1
  724. package/src/card/card-media/component.js +1 -1
  725. package/src/color-palette/index.native.js +92 -75
  726. package/src/color-palette/style.native.scss +10 -5
  727. package/src/color-palette/style.scss +1 -0
  728. package/src/color-picker/color-display.tsx +1 -1
  729. package/src/color-picker/component.tsx +2 -2
  730. package/src/color-picker/hex-input.tsx +9 -9
  731. package/src/color-picker/styles.ts +1 -1
  732. package/src/color-picker/test/index.js +1 -1
  733. package/src/combobox-control/index.js +1 -1
  734. package/src/combobox-control/style.scss +1 -0
  735. package/src/confirm-dialog/README.md +56 -45
  736. package/src/confirm-dialog/component.tsx +6 -4
  737. package/src/confirm-dialog/stories/index.js +19 -0
  738. package/src/confirm-dialog/test/index.js +28 -0
  739. package/src/confirm-dialog/types.ts +2 -0
  740. package/src/date-time/style.scss +4 -0
  741. package/src/date-time/time.js +16 -5
  742. package/src/dimension-control/test/index.test.js +1 -1
  743. package/src/disabled/test/index.js +1 -1
  744. package/src/divider/component.tsx +5 -5
  745. package/src/divider/stories/index.tsx +70 -0
  746. package/src/divider/types.ts +3 -1
  747. package/src/draggable/index.js +3 -3
  748. package/src/draggable/stories/index.js +1 -1
  749. package/src/elevation/component.js +1 -1
  750. package/src/flex/flex/component.js +1 -1
  751. package/src/flex/flex-block/component.js +1 -1
  752. package/src/flex/flex-item/component.js +1 -1
  753. package/src/flyout/flyout/README.md +1 -1
  754. package/src/flyout/flyout/component.js +1 -1
  755. package/src/flyout/flyout-content/component.js +1 -1
  756. package/src/flyout/test/index.js +1 -1
  757. package/src/focal-point-picker/README.md +7 -0
  758. package/src/focal-point-picker/index.js +12 -7
  759. package/src/focal-point-picker/index.native.js +7 -7
  760. package/src/focal-point-picker/stories/index.js +30 -0
  761. package/src/focal-point-picker/test/index.js +44 -0
  762. package/src/focal-point-picker/tooltip/index.native.js +1 -1
  763. package/src/font-size-picker/README.md +1 -2
  764. package/src/font-size-picker/index.js +1 -2
  765. package/src/font-size-picker/stories/index.js +87 -108
  766. package/src/font-size-picker/test/index.js +0 -2
  767. package/src/form-file-upload/README.md +1 -1
  768. package/src/form-file-upload/stories/index.js +51 -0
  769. package/src/form-token-field/index.js +6 -6
  770. package/src/form-token-field/style.scss +1 -0
  771. package/src/form-token-field/suggestions-list.js +2 -2
  772. package/src/form-token-field/test/index.js +6 -6
  773. package/src/grid/component.js +1 -1
  774. package/src/h-stack/component.js +1 -1
  775. package/src/heading/component.tsx +6 -6
  776. package/src/heading/hook.ts +1 -1
  777. package/src/heading/stories/index.tsx +37 -0
  778. package/src/higher-order/with-filters/test/index.js +1 -1
  779. package/src/higher-order/with-focus-outside/test/index.js +1 -1
  780. package/src/higher-order/with-notices/index.js +1 -1
  781. package/src/higher-order/with-notices/test/index.js +3 -3
  782. package/src/index.js +6 -4
  783. package/src/index.native.js +9 -5
  784. package/src/input-control/index.tsx +2 -2
  785. package/src/input-control/input-base.tsx +3 -3
  786. package/src/input-control/input-field.tsx +16 -15
  787. package/src/input-control/reducer/reducer.ts +3 -0
  788. package/src/input-control/stories/index.js +1 -1
  789. package/src/input-control/styles/input-control-styles.tsx +1 -0
  790. package/src/input-control/test/index.js +4 -4
  791. package/src/input-control/types.ts +1 -1
  792. package/src/isolated-event-container/index.js +1 -1
  793. package/src/item-group/item/component.tsx +2 -2
  794. package/src/item-group/item-group/component.tsx +2 -2
  795. package/src/item-group/test/index.js +0 -1
  796. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +4 -4
  797. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -1
  798. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +10 -1
  799. package/src/mobile/bottom-sheet/cell.native.js +1 -1
  800. package/src/mobile/bottom-sheet/index.native.js +11 -11
  801. package/src/mobile/bottom-sheet/link-cell.native.js +1 -1
  802. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -1
  803. package/src/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -1
  804. package/src/mobile/color-settings/palette.screen.native.js +39 -9
  805. package/src/mobile/color-settings/style.native.scss +4 -0
  806. package/src/mobile/global-styles-context/test/fixtures/theme.native.js +27 -0
  807. package/src/mobile/global-styles-context/test/utils.native.js +2 -2
  808. package/src/mobile/global-styles-context/utils.native.js +85 -16
  809. package/src/mobile/gradient/index.native.js +2 -2
  810. package/src/mobile/html-text-input/container.ios.js +3 -3
  811. package/src/mobile/html-text-input/index.native.js +1 -1
  812. package/src/mobile/html-text-input/test/index.native.js +14 -14
  813. package/src/mobile/image/index.native.js +1 -1
  814. package/src/mobile/image/style.native.scss +1 -0
  815. package/src/mobile/inserter-button/index.native.js +1 -2
  816. package/src/mobile/inserter-button/sparkles.js +15 -0
  817. package/src/mobile/keyboard-aware-flat-list/index.android.js +1 -1
  818. package/src/mobile/keyboard-aware-flat-list/index.ios.js +2 -2
  819. package/src/mobile/link-picker/index.native.js +3 -3
  820. package/src/mobile/link-picker/link-picker-results.native.js +8 -8
  821. package/src/mobile/link-settings/image-link-destinations-screen.native.js +2 -2
  822. package/src/mobile/link-settings/index.native.js +1 -2
  823. package/src/mobile/link-settings/test/edit.native.js +15 -15
  824. package/src/modal/aria-helper.js +1 -1
  825. package/src/modal/index.js +2 -2
  826. package/src/navigable-container/container.js +2 -2
  827. package/src/navigable-container/tabbable.js +1 -1
  828. package/src/navigable-container/test/menu.js +5 -5
  829. package/src/navigable-container/test/tabbable.js +2 -2
  830. package/src/navigation/item/index.js +1 -1
  831. package/src/navigation/menu/index.js +1 -1
  832. package/src/navigation/stories/controlled-state.js +2 -2
  833. package/src/navigation/stories/index.js +1 -1
  834. package/src/navigator/index.ts +2 -0
  835. package/src/navigator/navigator-back-button/README.md +31 -0
  836. package/src/navigator/navigator-back-button/component.tsx +62 -0
  837. package/src/navigator/navigator-back-button/hook.ts +40 -0
  838. package/src/navigator/navigator-back-button/index.ts +1 -0
  839. package/src/navigator/navigator-button/README.md +38 -0
  840. package/src/navigator/navigator-button/component.tsx +61 -0
  841. package/src/navigator/navigator-button/hook.ts +55 -0
  842. package/src/navigator/navigator-button/index.ts +1 -0
  843. package/src/navigator/navigator-provider/README.md +20 -33
  844. package/src/navigator/navigator-provider/component.tsx +13 -23
  845. package/src/navigator/navigator-screen/README.md +1 -1
  846. package/src/navigator/navigator-screen/component.tsx +16 -25
  847. package/src/navigator/stories/index.js +24 -37
  848. package/src/navigator/test/index.js +105 -51
  849. package/src/navigator/types.ts +27 -1
  850. package/src/number-control/index.js +1 -1
  851. package/src/number-control/stories/index.js +1 -1
  852. package/src/panel/body.js +2 -2
  853. package/src/popover/index.js +3 -3
  854. package/src/popover/utils.js +6 -6
  855. package/src/radio/stories/index.js +1 -1
  856. package/src/radio-group/index.js +1 -1
  857. package/src/radio-group/stories/index.js +4 -1
  858. package/src/range-control/stories/index.js +1 -1
  859. package/src/range-control/styles/range-control-styles.js +1 -1
  860. package/src/range-control/test/index.js +2 -2
  861. package/src/resizable-box/index.tsx +2 -2
  862. package/src/resizable-box/resize-tooltip/index.tsx +2 -2
  863. package/src/resizable-box/resize-tooltip/label.tsx +2 -2
  864. package/src/sandbox/index.js +5 -5
  865. package/src/sandbox/index.native.js +1 -1
  866. package/src/scrollable/component.js +1 -1
  867. package/src/select-control/index.tsx +3 -4
  868. package/src/select-control/styles/select-control-styles.ts +1 -0
  869. package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  870. package/src/slot-fill/bubbles-virtually/slot.js +1 -2
  871. package/src/slot-fill/fill.js +1 -1
  872. package/src/slot-fill/provider.js +1 -1
  873. package/src/snackbar/index.js +1 -1
  874. package/src/snackbar/list.js +1 -1
  875. package/src/spacer/component.tsx +2 -2
  876. package/src/style-provider/index.js +2 -2
  877. package/src/surface/component.js +1 -1
  878. package/src/tab-panel/test/index.js +1 -1
  879. package/src/text/component.js +1 -1
  880. package/src/text/test/index.js +2 -2
  881. package/src/text/types.ts +6 -8
  882. package/src/text-control/index.js +2 -2
  883. package/src/text-highlight/test/index.js +4 -4
  884. package/src/toggle-control/test/index.js +3 -3
  885. package/src/toggle-group-control/stories/index.js +1 -1
  886. package/src/toggle-group-control/test/__snapshots__/index.js.snap +1 -27
  887. package/src/toggle-group-control/toggle-group-control/component.tsx +4 -4
  888. package/src/toggle-group-control/toggle-group-control-option/component.tsx +3 -6
  889. package/src/toggle-group-control/toggle-group-control-option/styles.ts +1 -12
  890. package/src/toolbar/index.js +1 -1
  891. package/src/toolbar-group/test/index.js +2 -2
  892. package/src/tools-panel/stories/index.js +0 -1
  893. package/src/tools-panel/tools-panel/component.tsx +2 -2
  894. package/src/tools-panel/tools-panel-header/component.tsx +2 -2
  895. package/src/tools-panel/tools-panel-item/component.tsx +2 -2
  896. package/src/tooltip/index.js +3 -3
  897. package/src/tooltip/index.native.js +7 -7
  898. package/src/tooltip/test/index.js +2 -2
  899. package/src/tooltip/test/index.native.js +2 -2
  900. package/src/tree-grid/README.md +24 -1
  901. package/src/tree-grid/index.js +70 -7
  902. package/src/tree-grid/stories/index.js +4 -1
  903. package/src/tree-grid/test/__snapshots__/index.js.snap +1 -14
  904. package/src/tree-grid/test/index.js +303 -8
  905. package/src/truncate/component.js +1 -1
  906. package/src/truncate/utils.js +1 -1
  907. package/src/ui/context/{context-connect.js → context-connect.ts} +27 -16
  908. package/src/ui/context/context-system-provider.js +2 -2
  909. package/src/ui/context/{index.js → index.ts} +0 -0
  910. package/src/ui/context/wordpress-component.ts +3 -2
  911. package/src/ui/control-group/component.js +1 -1
  912. package/src/ui/control-label/component.js +1 -1
  913. package/src/ui/form-group/form-group.js +1 -1
  914. package/src/ui/shortcut/component.tsx +2 -2
  915. package/src/ui/spinner/component.js +1 -1
  916. package/src/ui/tooltip/component.js +1 -1
  917. package/src/ui/tooltip/content.js +1 -1
  918. package/src/ui/tooltip/test/index.js +4 -4
  919. package/src/ui/utils/colors.js +2 -2
  920. package/src/ui/utils/space.ts +2 -2
  921. package/src/unit-control/README.md +1 -1
  922. package/src/unit-control/index.native.js +5 -3
  923. package/src/unit-control/index.tsx +66 -37
  924. package/src/unit-control/stories/index.js +1 -1
  925. package/src/unit-control/test/index.js +102 -3
  926. package/src/unit-control/test/utils.js +56 -15
  927. package/src/unit-control/types.ts +5 -8
  928. package/src/unit-control/unit-select-control.tsx +1 -1
  929. package/src/unit-control/utils.ts +128 -125
  930. package/src/utils/breakpoint-values.js +1 -1
  931. package/src/utils/colors-values.js +1 -1
  932. package/src/utils/hooks/test/use-controlled-state.js +1 -1
  933. package/src/utils/hooks/test/use-controlled-value.js +3 -3
  934. package/src/utils/hooks/test/use-latest-ref.js +1 -1
  935. package/src/utils/test/math.js +2 -2
  936. package/src/utils/test/rtl.js +12 -12
  937. package/src/v-stack/component.js +1 -1
  938. package/src/visually-hidden/component.js +1 -1
  939. package/src/z-stack/component.tsx +2 -2
  940. package/tsconfig.json +1 -1
  941. package/tsconfig.tsbuildinfo +1 -1
  942. package/src/divider/stories/index.js +0 -64
  943. package/src/heading/stories/index.js +0 -24
  944. package/src/tools-panel/stories/typography-panel.js +0 -215
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-provider/component.tsx"],"names":["NavigatorProvider","props","forwardedRef","initialPath","children","className","otherProps","locationHistory","setLocationHistory","path","goTo","options","isBack","goBack","length","slice","navigatorContextValue","location","isInitial","cx","classes","ConnectedNavigatorProvider"],"mappings":";;;;;;;;;AASA;;;;AALA;;AAUA;;AAKA;;AACA;;AACA;;;;;;;;;;;;;;AAOA,SAASA,iBAAT,CACCC,KADD,EAECC,YA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AAMM,EAAE,GAAG,mBAAX;AACA,QAAMC,OAAO,GAAG,uBACf;AACA,QAAMD,EAAE,OAAkCd,SAAlC,CAFO,EAGf,CAAEA,SAAF,EAAac,EAAb,CAHe,CAAhB;AAMA,SACC,4BAAC,UAAD;AAAM,IAAA,GAAG,EAAGjB,YAAZ;AAA2B,IAAA,SAAS,EAAGkB;AAAvC,KAAsDd,UAAtD,GACC,4BAAC,0BAAD,CAAkB,QAAlB;AAA2B,IAAA,KAAK,EAAGU;AAAnC,KACGZ,QADH,CADD,CADD;AAOA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMiB,0BAA0B,GAAG,6BAClCrB,iBADkC,EAElC,mBAFkC,CAAnC;eAKeqB,0B","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type {\n\tNavigatorProviderProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n} from '../types';\n\nfunction NavigatorProvider(\n\tprops: WordPressComponentProps< NavigatorProviderProps, 'div' >,\n\tforwardedRef: Ref< any >\n) {\n\tconst {\n\t\tinitialPath,\n\t\tchildren,\n\t\tclassName,\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorProvider' );\n\n\tconst [ locationHistory, setLocationHistory ] = useState<\n\t\tNavigatorLocation[]\n\t>( [\n\t\t{\n\t\t\tpath: initialPath,\n\t\t},\n\t] );\n\n\tconst goTo: NavigatorContextType[ 'goTo' ] = useCallback(\n\t\t( path, options = {} ) => {\n\t\t\tsetLocationHistory( [\n\t\t\t\t...locationHistory,\n\t\t\t\t{\n\t\t\t\t\t...options,\n\t\t\t\t\tpath,\n\t\t\t\t\tisBack: false,\n\t\t\t\t},\n\t\t\t] );\n\t\t},\n\t\t[ locationHistory ]\n\t);\n\n\tconst goBack: NavigatorContextType[ 'goBack' ] = useCallback( () => {\n\t\tif ( locationHistory.length > 1 ) {\n\t\t\tsetLocationHistory( [\n\t\t\t\t...locationHistory.slice( 0, -2 ),\n\t\t\t\t{\n\t\t\t\t\t...locationHistory[ locationHistory.length - 2 ],\n\t\t\t\t\tisBack: true,\n\t\t\t\t},\n\t\t\t] );\n\t\t}\n\t}, [ locationHistory ] );\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: {\n\t\t\t\t...locationHistory[ locationHistory.length - 1 ],\n\t\t\t\tisInitial: locationHistory.length === 1,\n\t\t\t},\n\t\t\tgoTo,\n\t\t\tgoBack,\n\t\t} ),\n\t\t[ locationHistory, goTo, goBack ]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t// Prevents horizontal overflow while animating screen transitions\n\t\t() => cx( css( { overflowX: 'hidden' } ), className ),\n\t\t[ className, cx ]\n\t);\n\n\treturn (\n\t\t<View ref={ forwardedRef } className={ classes } { ...otherProps }>\n\t\t\t<NavigatorContext.Provider value={ navigatorContextValue }>\n\t\t\t\t{ children }\n\t\t\t</NavigatorContext.Provider>\n\t\t</View>\n\t);\n}\n\n/**\n * The `NavigatorProvider` component allows rendering nested panels or menus (via the `NavigatorScreen` component) and navigate between these different states (via the `useNavigator` hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalUseNavigator as useNavigator,\n * } from '@wordpress/components';\n *\n * function NavigatorButton( { path, ...props } ) {\n * const { goTo } = useNavigator();\n * return (\n * <Button\n * variant=\"primary\"\n * onClick={ () => goTo( path ) }\n * { ...props }\n * />\n * );\n * }\n *\n * function NavigatorBackButton( props ) {\n * const { goBack } = useNavigator();\n * return <Button variant=\"secondary\" onClick={ () => goBack() } { ...props } />;\n * }\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * \t <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>Go back</NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorProvider = contextConnect(\n\tNavigatorProvider,\n\t'NavigatorProvider'\n);\n\nexport default ConnectedNavigatorProvider;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-provider/component.tsx"],"names":["NavigatorProvider","props","forwardedRef","initialPath","children","className","otherProps","locationHistory","setLocationHistory","path","goTo","options","isBack","goBack","length","slice","navigatorContextValue","location","isInitial","cx","classes","ConnectedNavigatorProvider"],"mappings":";;;;;;;;;AASA;;;;AALA;;AAUA;;AAKA;;AACA;;AACA;;;;;;;;;;;;;;AAOA,SAASA,iBAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AACLC,IAAAA,WADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,SAHK;AAIL,OAAGC;AAJE,MAKF,+BAAkBL,KAAlB,EAAyB,mBAAzB,CALJ;AAOA,QAAM,CAAEM,eAAF,EAAmBC,kBAAnB,IAA0C,uBAE7C,CACF;AACCC,IAAAA,IAAI,EAAEN;AADP,GADE,CAF6C,CAAhD;AAQA,QAAMO,IAAoC,GAAG,0BAC5C,UAAED,IAAF,EAA0B;AAAA,QAAlBE,OAAk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ADD,CADD;AAOA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMiB,0BAA0B,GAAG,6BAClCrB,iBADkC,EAElC,mBAFkC,CAAnC;eAKeqB,0B","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type {\n\tNavigatorProviderProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n} from '../types';\n\nfunction NavigatorProvider(\n\tprops: WordPressComponentProps< NavigatorProviderProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tinitialPath,\n\t\tchildren,\n\t\tclassName,\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorProvider' );\n\n\tconst [ locationHistory, setLocationHistory ] = useState<\n\t\tNavigatorLocation[]\n\t>( [\n\t\t{\n\t\t\tpath: initialPath,\n\t\t},\n\t] );\n\n\tconst goTo: NavigatorContextType[ 'goTo' ] = useCallback(\n\t\t( path, options = {} ) => {\n\t\t\tsetLocationHistory( [\n\t\t\t\t...locationHistory,\n\t\t\t\t{\n\t\t\t\t\t...options,\n\t\t\t\t\tpath,\n\t\t\t\t\tisBack: false,\n\t\t\t\t},\n\t\t\t] );\n\t\t},\n\t\t[ locationHistory ]\n\t);\n\n\tconst goBack: NavigatorContextType[ 'goBack' ] = useCallback( () => {\n\t\tif ( locationHistory.length > 1 ) {\n\t\t\tsetLocationHistory( [\n\t\t\t\t...locationHistory.slice( 0, -2 ),\n\t\t\t\t{\n\t\t\t\t\t...locationHistory[ locationHistory.length - 2 ],\n\t\t\t\t\tisBack: true,\n\t\t\t\t},\n\t\t\t] );\n\t\t}\n\t}, [ locationHistory ] );\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: {\n\t\t\t\t...locationHistory[ locationHistory.length - 1 ],\n\t\t\t\tisInitial: locationHistory.length === 1,\n\t\t\t},\n\t\t\tgoTo,\n\t\t\tgoBack,\n\t\t} ),\n\t\t[ locationHistory, goTo, goBack ]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t// Prevents horizontal overflow while animating screen transitions.\n\t\t() => cx( css( { overflowX: 'hidden' } ), className ),\n\t\t[ className, cx ]\n\t);\n\n\treturn (\n\t\t<View ref={ forwardedRef } className={ classes } { ...otherProps }>\n\t\t\t<NavigatorContext.Provider value={ navigatorContextValue }>\n\t\t\t\t{ children }\n\t\t\t</NavigatorContext.Provider>\n\t\t</View>\n\t);\n}\n\n/**\n * The `NavigatorProvider` component allows rendering nested views/panels/menus\n * (via the `NavigatorScreen` component and navigate between these different\n * view (via the `NavigatorButton` and `NavigatorBackButton` components or the\n * `useNavigator` hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorProvider = contextConnect(\n\tNavigatorProvider,\n\t'NavigatorProvider'\n);\n\nexport default ConnectedNavigatorProvider;\n"]}
@@ -21,6 +21,8 @@ var _compose = require("@wordpress/compose");
21
21
 
22
22
  var _i18n = require("@wordpress/i18n");
23
23
 
24
+ var _escapeHtml = require("@wordpress/escape-html");
25
+
24
26
  var _context = require("../../ui/context");
25
27
 
26
28
  var _useCx = require("../../utils/hooks/use-cx");
@@ -43,7 +45,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
43
45
  } : {
44
46
  name: "1ulogbc-classes",
45
47
  styles: "overflow-x:auto;max-height:100%;label:classes;",
46
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbmF2aWdhdG9yL25hdmlnYXRvci1zY3JlZW4vY29tcG9uZW50LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE4REkiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9uYXZpZ2F0b3IvbmF2aWdhdG9yLXNjcmVlbi9jb21wb25lbnQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHR5cGUgeyBSZWYgfSBmcm9tICdyZWFjdCc7XG4vLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tcmVzdHJpY3RlZC1pbXBvcnRzXG5pbXBvcnQgeyBtb3Rpb24sIE1vdGlvblByb3BzIH0gZnJvbSAnZnJhbWVyLW1vdGlvbic7XG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogV29yZFByZXNzIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBmb2N1cyB9IGZyb20gJ0B3b3J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 -58,7 +60,7 @@ function NavigatorScreen(props, forwardedRef) {
58
60
  const {
59
61
  location
60
62
  } = (0, _element.useContext)(_context2.NavigatorContext);
61
- const isMatch = location.path === path;
63
+ const isMatch = location.path === (0, _escapeHtml.escapeAttribute)(path);
62
64
  const wrapperRef = (0, _element.useRef)(null);
63
65
  const previousLocation = (0, _compose.usePrevious)(location);
64
66
  const cx = (0, _useCx.useCx)();
@@ -137,44 +139,34 @@ function NavigatorScreen(props, forwardedRef) {
137
139
  }, otherProps, animatedProps), children);
138
140
  }
139
141
  /**
140
- * The `NavigatorScreen` component represents a single view/screen/panel/menu and is supposed to be used in combination with the `NavigatorProvider` component.
142
+ * The `NavigatorScreen` component represents a single view/screen/panel and
143
+ * should be used in combination with the `NavigatorProvider`, the
144
+ * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`
145
+ * hook).
141
146
  *
142
147
  * @example
143
148
  * ```jsx
144
149
  * import {
145
150
  * __experimentalNavigatorProvider as NavigatorProvider,
146
151
  * __experimentalNavigatorScreen as NavigatorScreen,
147
- * __experimentalUseNavigator as useNavigator,
152
+ * __experimentalNavigatorButton as NavigatorButton,
153
+ * __experimentalNavigatorBackButton as NavigatorBackButton,
148
154
  * } from '@wordpress/components';
149
155
  *
150
- * function NavigatorButton( { path, ...props } ) {
151
- * const { goTo } = useNavigator();
152
- * return (
153
- * <Button
154
- * variant="primary"
155
- * onClick={ () => goTo( path ) }
156
- * { ...props }
157
- * />
158
- * );
159
- * }
160
- *
161
- * function NavigatorBackButton( props ) {
162
- * const { goBack } = useNavigator();
163
- * return <Button variant="secondary" onClick={ () => goBack() } { ...props } />;
164
- * }
165
- *
166
156
  * const MyNavigation = () => (
167
157
  * <NavigatorProvider initialPath="/">
168
158
  * <NavigatorScreen path="/">
169
159
  * <p>This is the home screen.</p>
170
- * <NavigatorButton path="/child">
160
+ * <NavigatorButton path="/child">
171
161
  * Navigate to child screen.
172
162
  * </NavigatorButton>
173
163
  * </NavigatorScreen>
174
164
  *
175
165
  * <NavigatorScreen path="/child">
176
166
  * <p>This is the child screen.</p>
177
- * <NavigatorBackButton>Go back</NavigatorBackButton>
167
+ * <NavigatorBackButton>
168
+ * Go back
169
+ * </NavigatorBackButton>
178
170
  * </NavigatorScreen>
179
171
  * </NavigatorProvider>
180
172
  * );
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","NavigatorScreen","props","forwardedRef","children","className","path","otherProps","prefersReducedMotion","location","NavigatorContext","isMatch","wrapperRef","previousLocation","cx","classes","isInitialLocation","isInitial","isBack","current","elementToFocus","focusTargetSelector","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","ConnectedNavigatorScreen"],"mappings":";;;;;;;;;AAYA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AAKA;;AAKA;;AACA;;AACA;;;;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,eAAT,CAA0BC,KAA1B,EAAwCC,YAAxC,EAAmE;AAClE,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+C,+BACpDL,KADoD,EAEpD,iBAFoD,CAArD;AAKA,QAAMM,oBAAoB,GAAG,gCAA7B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAe,yBAAYC,0BAAZ,CAArB;AACA,QAAMC,OAAO,GAAGF,QAAQ,CAACH,IAAT,KAAkBA,IAAlC;AACA,QAAMM,UAAU,GAAG,qBAA0B,IAA1B,CAAnB;AAEA,QAAMC,gBAAgB,GAAG,0BAAaJ,QAAb,CAAz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AACA;AACA;AACA;AACA;;;AACA,MAAMkC,wBAAwB,GAAG,6BAChCrC,eADgC,EAEhC,iBAFgC,CAAjC;eAKeqC,wB","sourcesContent":["/**\n * External dependencies\n */\nimport type { Ref } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { useContext, useEffect, useMemo, useRef } from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseMergeRefs,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tkeyof MotionProps\n>;\n\nfunction NavigatorScreen( props: Props, forwardedRef: Ref< any > ) {\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location } = useContext( NavigatorContext );\n\tconst isMatch = location.path === path;\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tconst previousLocation = usePrevious( location );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\tif ( isInitialLocation || ! isMatch || ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && previousLocation?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tpreviousLocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = ( focus.tabbable.find(\n\t\t\t\twrapperRef.current\n\t\t\t) as HTMLElement[] )[ 0 ];\n\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\telementToFocus.focus();\n\t}, [ isInitialLocation, isMatch ] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\tconst initial = {\n\t\topacity: 0,\n\t\tx:\n\t\t\t( isRTL() && location.isBack ) || ( ! isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t};\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel/menu and is supposed to be used in combination with the `NavigatorProvider` component.\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalUseNavigator as useNavigator,\n * } from '@wordpress/components';\n *\n * function NavigatorButton( { path, ...props } ) {\n * const { goTo } = useNavigator();\n * return (\n * <Button\n * variant=\"primary\"\n * onClick={ () => goTo( path ) }\n * { ...props }\n * />\n * );\n * }\n *\n * function NavigatorBackButton( props ) {\n * const { goBack } = useNavigator();\n * return <Button variant=\"secondary\" onClick={ () => goBack() } { ...props } />;\n * }\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * \t <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>Go back</NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorScreen = contextConnect(\n\tNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default ConnectedNavigatorScreen;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","NavigatorScreen","props","forwardedRef","children","className","path","otherProps","prefersReducedMotion","location","NavigatorContext","isMatch","wrapperRef","previousLocation","cx","classes","isInitialLocation","isInitial","isBack","current","elementToFocus","focusTargetSelector","querySelector","firstTabbable","focus","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","ConnectedNavigatorScreen"],"mappings":";;;;;;;;;AAYA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;;;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,eAAT,CAA0BC,KAA1B,EAAwCC,YAAxC,EAA4E;AAC3E,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+C,+BACpDL,KADoD,EAEpD,iBAFoD,CAArD;AAKA,QAAMM,oBAAoB,GAAG,gCAA7B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAe,yBAAYC,0BAAZ,CAArB;AACA,QAAMC,OAAO,GAAGF,QAAQ,CAACH,IAAT,KAAkB,iCAAiBA,IAAjB,CAAlC;AACA,QAAMM,UAAU,GAAG,qBAA0B,IAA1B,CAAnB;AAEA,QAAMC,gBAAgB,GAAG,0BAAaJ,QAAb,CAAzB;AAEA,QAAMK,EAAE,GAAG,mBAAX;AACA,QAA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eqC,wB","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { useContext, useEffect, useMemo, useRef } from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseMergeRefs,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tkeyof MotionProps\n>;\n\nfunction NavigatorScreen( props: Props, forwardedRef: ForwardedRef< any > ) {\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location } = useContext( NavigatorContext );\n\tconst isMatch = location.path === escapeAttribute( path );\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tconst previousLocation = usePrevious( location );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\tif ( isInitialLocation || ! isMatch || ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && previousLocation?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tpreviousLocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = ( focus.tabbable.find(\n\t\t\t\twrapperRef.current\n\t\t\t) as HTMLElement[] )[ 0 ];\n\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\telementToFocus.focus();\n\t}, [ isInitialLocation, isMatch ] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\tconst initial = {\n\t\topacity: 0,\n\t\tx:\n\t\t\t( isRTL() && location.isBack ) || ( ! isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t};\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorScreen = contextConnect(\n\tNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default ConnectedNavigatorScreen;\n"]}
@@ -66,7 +66,7 @@ function NumberControl(_ref, ref) {
66
66
  const baseValue = (0, _math.roundClamp)(0, min, max, baseStep);
67
67
 
68
68
  const constrainValue = (value, stepOverride) => {
69
- // When step is "any" clamp the value, otherwise round and clamp it
69
+ // When step is "any" clamp the value, otherwise round and clamp it.
70
70
  return isStepAny ? Math.min(max, Math.max(min, value)) : (0, _math.roundClamp)(value, min, max, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
71
71
  };
72
72
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/number-control/index.js"],"names":["NumberControl","ref","__unstableStateReducer","stateReducer","state","className","dragDirection","hideHTMLArrows","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","type","typeProp","value","valueProp","props","isStepAny","baseStep","parseFloat","baseValue","constrainValue","stepOverride","Math","autoComplete","classes","numberControlStateReducer","action","payload","event","currentValue","inputControlActionTypes","PRESS_UP","PRESS_DOWN","enableShift","shiftKey","incrementalValue","nextValue","preventDefault","DRAG","x","y","delta","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue"],"mappings":";;;;;;;;;;AASA;;;;AALA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAnBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAOO,SAASA,aAAT,OAkBNC,GAlBM,EAmBL;AAAA,MAlBD;AACCC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KADrD;AAECC,IAAAA,SAFD;AAGCC,IAAAA,aAAa,GAAG,GAHjB;AAICC,IAAAA,cAAc,GAAG,KAJlB;AAKCC,IAAAA,aAAa,GAAG,IALjB;AAMCC,IAAAA,kBAAkB,GAAG,IANtB;AAOCC,IAAAA,KAPD;AAQCC,IAAAA,GAAG,GAAGC,QARP;AASCC,IAAAA,GAAG,GAAG,CAACD,QATR;AAUCE,IAAAA,QAAQ,GAAG,KAVZ;AAWCC,IAAAA,SAAS,GAAG,E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EAAGE,KART;AASC,IAAA,GAAG,EAAGC,GATP;AAUC,IAAA,GAAG,EAAGE,GAVP;AAWC,IAAA,GAAG,EAAGZ,GAXP;AAYC,IAAA,QAAQ,EAAGa,QAZZ;AAaC,IAAA,IAAI,EAAGE,IAbR;AAcC,IAAA,IAAI,EAAGE,QAdR;AAeC,IAAA,KAAK,EAAGE,SAfT;AAgBC,IAAA,sBAAsB,EAAG,mCACxBW,yBADwB,EAExB5B,YAFwB;AAhB1B,KADD;AAuBA;;eAEc,yBAAYH,aAAZ,C","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Input } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { composeStateReducers } from '../input-control/reducer/reducer';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { isValueEmpty } from '../utils/values';\n\nexport function NumberControl(\n\t{\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\t...props\n\t},\n\tref\n) {\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : parseFloat( step );\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = ( value, stepOverride ) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it\n\t\treturn isStepAny\n\t\t\t? Math.min( max, Math.max( min, value ) )\n\t\t\t: roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : null;\n\tconst classes = classNames( 'components-number-control', className );\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @param {Object} state State from InputControl\n\t * @param {Object} action Action triggering state change\n\t * @return {Object} The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer = ( state, action ) => {\n\t\tconst { type, payload } = action;\n\t\tconst event = payload?.event;\n\t\tconst currentValue = state.value;\n\n\t\t/**\n\t\t * Handles custom UP and DOWN Keyboard events\n\t\t */\n\t\tif (\n\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t) {\n\t\t\tconst enableShift = event.shiftKey && isShiftStepEnabled;\n\n\t\t\tconst incrementalValue = enableShift\n\t\t\t\t? parseFloat( shiftStep ) * baseStep\n\t\t\t\t: baseStep;\n\t\t\tlet nextValue = isValueEmpty( currentValue )\n\t\t\t\t? baseValue\n\t\t\t\t: currentValue;\n\n\t\t\tif ( event?.preventDefault ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\tif ( type === inputControlActionTypes.PRESS_UP ) {\n\t\t\t\tnextValue = add( nextValue, incrementalValue );\n\t\t\t}\n\n\t\t\tif ( type === inputControlActionTypes.PRESS_DOWN ) {\n\t\t\t\tnextValue = subtract( nextValue, incrementalValue );\n\t\t\t}\n\n\t\t\tstate.value = constrainValue(\n\t\t\t\tnextValue,\n\t\t\t\tenableShift ? incrementalValue : null\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Handles drag to update events\n\t\t */\n\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\tconst [ x, y ] = payload.delta;\n\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\tconst modifier = enableShift\n\t\t\t\t? parseFloat( shiftStep ) * baseStep\n\t\t\t\t: baseStep;\n\n\t\t\tlet directionModifier;\n\t\t\tlet delta;\n\n\t\t\tswitch ( dragDirection ) {\n\t\t\t\tcase 'n':\n\t\t\t\t\tdelta = y;\n\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'e':\n\t\t\t\t\tdelta = x;\n\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 's':\n\t\t\t\t\tdelta = y;\n\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'w':\n\t\t\t\t\tdelta = x;\n\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( delta !== 0 ) {\n\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\tstate.value = constrainValue(\n\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\tenableShift ? modifier : null\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Handles commit (ENTER key press or on blur if isPressEnterToChange)\n\t\t */\n\t\tif (\n\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t) {\n\t\t\tconst applyEmptyValue = required === false && currentValue === '';\n\n\t\t\tstate.value = applyEmptyValue\n\t\t\t\t? currentValue\n\t\t\t\t: constrainValue( currentValue );\n\t\t}\n\n\t\treturn state;\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ hideHTMLArrows }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ ref }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ composeStateReducers(\n\t\t\t\tnumberControlStateReducer,\n\t\t\t\tstateReducer\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( NumberControl );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/number-control/index.js"],"names":["NumberControl","ref","__unstableStateReducer","stateReducer","state","className","dragDirection","hideHTMLArrows","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","type","typeProp","value","valueProp","props","isStepAny","baseStep","parseFloat","baseValue","constrainValue","stepOverride","Math","autoComplete","classes","numberControlStateReducer","action","payload","event","currentValue","inputControlActionTypes","PRESS_UP","PRESS_DOWN","enableShift","shiftKey","incrementalValue","nextValue","preventDefault","DRAG","x","y","delta","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue"],"mappings":";;;;;;;;;;AASA;;;;AALA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAnBA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAOO,SAASA,aAAT,OAkBNC,GAlBM,EAmBL;AAAA,MAlBD;AACCC,IAAAA,sBAAsB,EAAEC,YAAY,GAAKC,KAAF,IAAaA,KADrD;AAECC,IAAAA,SAFD;AAGCC,IAAAA,aAAa,GAAG,GAHjB;AAICC,IAAAA,cAAc,GAAG,KAJlB;AAKCC,IAAAA,aAAa,GAAG,IALjB;AAMCC,IAAAA,kBAAkB,GAAG,IANtB;AAOCC,IAAAA,KAPD;AAQCC,IAAAA,GAAG,GAAGC,QARP;AASCC,IAAAA,GAAG,GAAG,CAACD,QATR;AAUCE,IAAAA,QAAQ,GAAG,KAVZ;AAWCC,IAAAA,SAAS,GAAG,EAXb;AAYCC,IAAAA,IAAI,GAAG,CAZR;AAaCC,IAAAA,IAAI,EAAEC,QAAQ,GAAG,QAblB;AAcCC,IAAAA,KAAK,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AYC,IAAA,QAAQ,EAAGa,QAZZ;AAaC,IAAA,IAAI,EAAGE,IAbR;AAcC,IAAA,IAAI,EAAGE,QAdR;AAeC,IAAA,KAAK,EAAGE,SAfT;AAgBC,IAAA,sBAAsB,EAAG,mCACxBW,yBADwB,EAExB5B,YAFwB;AAhB1B,KADD;AAuBA;;eAEc,yBAAYH,aAAZ,C","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Input } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { composeStateReducers } from '../input-control/reducer/reducer';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { isValueEmpty } from '../utils/values';\n\nexport function NumberControl(\n\t{\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\t...props\n\t},\n\tref\n) {\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : parseFloat( step );\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = ( value, stepOverride ) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\treturn isStepAny\n\t\t\t? Math.min( max, Math.max( min, value ) )\n\t\t\t: roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : null;\n\tconst classes = classNames( 'components-number-control', className );\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @param {Object} state State from InputControl\n\t * @param {Object} action Action triggering state change\n\t * @return {Object} The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer = ( state, action ) => {\n\t\tconst { type, payload } = action;\n\t\tconst event = payload?.event;\n\t\tconst currentValue = state.value;\n\n\t\t/**\n\t\t * Handles custom UP and DOWN Keyboard events\n\t\t */\n\t\tif (\n\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t) {\n\t\t\tconst enableShift = event.shiftKey && isShiftStepEnabled;\n\n\t\t\tconst incrementalValue = enableShift\n\t\t\t\t? parseFloat( shiftStep ) * baseStep\n\t\t\t\t: baseStep;\n\t\t\tlet nextValue = isValueEmpty( currentValue )\n\t\t\t\t? baseValue\n\t\t\t\t: currentValue;\n\n\t\t\tif ( event?.preventDefault ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\tif ( type === inputControlActionTypes.PRESS_UP ) {\n\t\t\t\tnextValue = add( nextValue, incrementalValue );\n\t\t\t}\n\n\t\t\tif ( type === inputControlActionTypes.PRESS_DOWN ) {\n\t\t\t\tnextValue = subtract( nextValue, incrementalValue );\n\t\t\t}\n\n\t\t\tstate.value = constrainValue(\n\t\t\t\tnextValue,\n\t\t\t\tenableShift ? incrementalValue : null\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Handles drag to update events\n\t\t */\n\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\tconst [ x, y ] = payload.delta;\n\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\tconst modifier = enableShift\n\t\t\t\t? parseFloat( shiftStep ) * baseStep\n\t\t\t\t: baseStep;\n\n\t\t\tlet directionModifier;\n\t\t\tlet delta;\n\n\t\t\tswitch ( dragDirection ) {\n\t\t\t\tcase 'n':\n\t\t\t\t\tdelta = y;\n\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'e':\n\t\t\t\t\tdelta = x;\n\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 's':\n\t\t\t\t\tdelta = y;\n\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'w':\n\t\t\t\t\tdelta = x;\n\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ( delta !== 0 ) {\n\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\tstate.value = constrainValue(\n\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\tenableShift ? modifier : null\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Handles commit (ENTER key press or on blur if isPressEnterToChange)\n\t\t */\n\t\tif (\n\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t) {\n\t\t\tconst applyEmptyValue = required === false && currentValue === '';\n\n\t\t\tstate.value = applyEmptyValue\n\t\t\t\t? currentValue\n\t\t\t\t: constrainValue( currentValue );\n\t\t}\n\n\t\treturn state;\n\t};\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ hideHTMLArrows }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ ref }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ composeStateReducers(\n\t\t\t\tnumberControlStateReducer,\n\t\t\t\tstateReducer\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( NumberControl );\n"]}
@@ -62,11 +62,11 @@ function PanelBody(_ref, ref) {
62
62
  const next = !isOpened;
63
63
  setIsOpened(next);
64
64
  onToggle(next);
65
- }; // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value
65
+ }; // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.
66
66
 
67
67
 
68
68
  const scrollAfterOpenRef = (0, _element.useRef)();
69
- scrollAfterOpenRef.current = scrollAfterOpen; // Runs after initial render
69
+ scrollAfterOpenRef.current = scrollAfterOpen; // Runs after initial render.
70
70
 
71
71
  (0, _utils.useUpdateEffect)(() => {
72
72
  var _nodeRef$current;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/panel/body.js"],"names":["PanelBody","ref","buttonProps","children","className","icon","initialOpen","onToggle","noop","opened","title","scrollAfterOpen","isOpened","setIsOpened","initial","undefined","nodeRef","scrollBehavior","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","scrollIntoView","inline","block","behavior","classes","PanelBodyTitle","props","chevronUp","chevronDown","ForwardedComponent","displayName"],"mappings":";;;;;;;;;;AAUA;;;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AAKO,SAASA,SAAT,OAYNC,GAZM,EAaL;AAAA,MAZD;AACCC,IAAAA,WAAW,GAAG,EADf;AAECC,IAAAA,QAFD;AAGCC,IAAAA,SAHD;AAICC,IAAAA,IAJD;AAKCC,IAAAA,WALD;AAMCC,IAAAA,QAAQ,GAAGC,YANZ;AAOCC,IAAAA,MAPD;AAQCC,IAAAA,KARD;AASCC,IAAAA,eAAe,GAAG;AATnB,GAYC;AACD,QAAM,CAAEC,QAAF,EAAYC,WAAZ,IAA4B,+BAAoBJ,MAApB,EAA4B;AAC7DK,IAAAA,OAAO,EAAER,WAAW,KAAKS,SA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,OAAOC,QAAP,KAAoB,UAApB,GACCA,QAAQ,CAAE;AAAEM,IAAAA,MAAM,EAAEG;AAAV,GAAF,CADT,GAECA,QAAQ,IAAIT,QAVhB,CADD;AAcA;;AAED,MAAM0B,cAAc,GAAG,yBACtB,QAAuC5B,GAAvC,KAAgD;AAAA,MAA9C;AAAEW,IAAAA,QAAF;AAAYP,IAAAA,IAAZ;AAAkBK,IAAAA,KAAlB;AAAyB,OAAGoB;AAA5B,GAA8C;AAC/C,MAAK,CAAEpB,KAAP,EAAe,OAAO,IAAP;AAEf,SACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACC,4BAAC,eAAD;AACC,IAAA,SAAS,EAAC,+BADX;AAEC,qBAAgBE,QAFjB;AAGC,IAAA,GAAG,EAAGX;AAHP,KAIM6B,KAJN,GAUC;AAAM,mBAAY;AAAlB,KACC,4BAAC,aAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,IAAI,EAAGlB,QAAQ,GAAGmB,gBAAH,GAAeC;AAF/B,IADD,CAVD,EAgBGtB,KAhBH,EAiBGL,IAAI,IACL,4BAAC,aAAD;AACC,IAAA,IAAI,EAAGA,IADR;AAEC,IAAA,SAAS,EAAC,wBAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAlBF,CADD,CADD;AA6BA,CAjCqB,CAAvB;AAoCA,MAAM4B,kBAAkB,GAAG,yBAAYjC,SAAZ,CAA3B;AACAiC,kBAAkB,CAACC,WAAnB,GAAiC,WAAjC;eAEeD,kB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { noop } from 'lodash';\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 Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nexport function PanelBody(\n\t{\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},\n\tref\n) {\n\tconst [ isOpened, setIsOpened ] = useControlledState( opened, {\n\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t} );\n\tconst nodeRef = useRef();\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 ) => {\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();\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={ 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: isOpened } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t( { isOpened, icon, title, ...props }, ref ) => {\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\nconst ForwardedComponent = forwardRef( PanelBody );\nForwardedComponent.displayName = 'PanelBody';\n\nexport default ForwardedComponent;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/panel/body.js"],"names":["PanelBody","ref","buttonProps","children","className","icon","initialOpen","onToggle","noop","opened","title","scrollAfterOpen","isOpened","setIsOpened","initial","undefined","nodeRef","scrollBehavior","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","scrollIntoView","inline","block","behavior","classes","PanelBodyTitle","props","chevronUp","chevronDown","ForwardedComponent","displayName"],"mappings":";;;;;;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AAS,EAAC,wBAFX;AAGC,IAAA,IAAI,EAAG;AAHR,IAlBF,CADD,CADD;AA6BA,CAjCqB,CAAvB;AAoCA,MAAM4B,kBAAkB,GAAG,yBAAYjC,SAAZ,CAA3B;AACAiC,kBAAkB,CAACC,WAAnB,GAAiC,WAAjC;eAEeD,kB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { noop } from 'lodash';\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 Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nexport function PanelBody(\n\t{\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},\n\tref\n) {\n\tconst [ isOpened, setIsOpened ] = useControlledState( opened, {\n\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t} );\n\tconst nodeRef = useRef();\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 ) => {\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();\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={ 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: isOpened } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t( { isOpened, icon, title, ...props }, ref ) => {\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\nconst ForwardedComponent = forwardRef( PanelBody );\nForwardedComponent.displayName = 'PanelBody';\n\nexport default ForwardedComponent;\n"]}
@@ -74,14 +74,14 @@ function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect) {
74
74
  return;
75
75
  } // Duck-type to check if `anchorRef` is an instance of Range
76
76
  // `anchorRef instanceof window.Range` checks will break across document boundaries
77
- // such as in an iframe
77
+ // such as in an iframe.
78
78
 
79
79
 
80
80
  if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.cloneRange) === 'function') {
81
81
  return (0, _utils.offsetIframe)((0, _dom.getRectangleFromRange)(anchorRef), anchorRef.endContainer.ownerDocument, container);
82
82
  } // Duck-type to check if `anchorRef` is an instance of Element
83
83
  // `anchorRef instanceof window.Element` checks will break across document boundaries
84
- // such as in an iframe
84
+ // such as in an iframe.
85
85
 
86
86
 
87
87
  if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.getBoundingClientRect) === 'function') {
@@ -333,7 +333,7 @@ const Popover = (_ref, ref) => {
333
333
  setAttribute(containerRef.current, 'data-x-axis', xAxis);
334
334
  setAttribute(containerRef.current, 'data-y-axis', yAxis);
335
335
  setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : '');
336
- setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position
336
+ setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position.
337
337
 
338
338
  const yAxisMapping = {
339
339
  top: 'bottom',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/popover/index.js"],"names":["SLOT_NAME","slotNameContext","computeAnchorRect","anchorRefFallback","anchorRect","getAnchorRect","anchorRef","shouldAnchorIncludePadding","container","current","rect","ownerDocument","window","Range","Element","DOMRect","cloneRange","endContainer","getBoundingClientRect","withoutPadding","top","bottom","topRect","bottomRect","left","width","parentNode","getComputedStyle","node","defaultView","element","paddingTop","paddingBottom","paddingLeft","paddingRight","parseInt","right","x","y","height","setAttribute","name","value","hasAttribute","removeAttribute","getAttribute","setStyle","property","style","setClass","toggle","classList","contains","add","remove","getAnchorDocument","anchor","Popover","ref","headerTitle","onClose","children","className","noArrow","isAlternate","position","range","focusOnMount","expandOnMobile","animate","onFocusOutside","__unstableStickyBoundaryElement","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent","__unstableForcePosition","__unstableForceXAlignment","__unstableEditorCanvasWrapper","contentProps","contentRef","containerRef","isMobileViewport","animateOrigin","setAnimateOrigin","slotName","slot","isExpanded","containerResizeListener","contentSize","refresh","offsetParent","relativeOffsetTop","body","offsetParentRect","boundaryElement","parentElement","usedContentSize","popoverTop","popoverLeft","xAxis","yAxis","contentHeight","contentWidth","yAxisMapping","xAxisMapping","animateYAxis","animateXAxis","intervalHandle","setInterval","rafId","refreshOnAnimationFrame","cancelAnimationFrame","requestAnimationFrame","addEventListener","anchorDocument","observer","MutationObserver","observe","attributes","clearInterval","removeEventListener","disconnect","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","mergedRefs","animateClassName","Boolean","origin","content","close","PopoverContainer","PopoverSlot","Slot","__unstableSlotNameProvider","Provider"],"mappings":";;;;;;;;;AASA;;;;AALA;;AAaA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAjCA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA,MAAMA,SAAS,GAAG,SAAlB;AAEA,MAAMC,eAAe,GAAG,6BAAxB;;AAEA,SAASC,iBAAT,CACCC,iBADD,EAECC,UAFD,EAGCC,aAHD,EAOE;AAAA,MAHDC,SAGC,uE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External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseState,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport { getRectangleFromRange } from '@wordpress/dom';\nimport {\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { computePopoverPosition, offsetIframe } from './utils';\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport { getAnimateClassName } from '../animate';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nconst SLOT_NAME = 'Popover';\n\nconst slotNameContext = createContext();\n\nfunction computeAnchorRect(\n\tanchorRefFallback,\n\tanchorRect,\n\tgetAnchorRect,\n\tanchorRef = false,\n\tshouldAnchorIncludePadding,\n\tcontainer\n) {\n\tif ( anchorRect ) {\n\t\treturn anchorRect;\n\t}\n\n\tif ( getAnchorRect ) {\n\t\tif ( ! anchorRefFallback.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rect = getAnchorRect( anchorRefFallback.current );\n\t\treturn offsetIframe(\n\t\t\trect,\n\t\t\trect.ownerDocument || anchorRefFallback.current.ownerDocument,\n\t\t\tcontainer\n\t\t);\n\t}\n\n\tif ( anchorRef !== false ) {\n\t\tif (\n\t\t\t! anchorRef ||\n\t\t\t! window.Range ||\n\t\t\t! window.Element ||\n\t\t\t! window.DOMRect\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Duck-type to check if `anchorRef` is an instance of Range\n\t\t// `anchorRef instanceof window.Range` checks will break across document boundaries\n\t\t// such as in an iframe\n\t\tif ( typeof anchorRef?.cloneRange === 'function' ) {\n\t\t\treturn offsetIframe(\n\t\t\t\tgetRectangleFromRange( anchorRef ),\n\t\t\t\tanchorRef.endContainer.ownerDocument,\n\t\t\t\tcontainer\n\t\t\t);\n\t\t}\n\n\t\t// Duck-type to check if `anchorRef` is an instance of Element\n\t\t// `anchorRef instanceof window.Element` checks will break across document boundaries\n\t\t// such as in an iframe\n\t\tif ( typeof anchorRef?.getBoundingClientRect === 'function' ) {\n\t\t\tconst rect = offsetIframe(\n\t\t\t\tanchorRef.getBoundingClientRect(),\n\t\t\t\tanchorRef.ownerDocument,\n\t\t\t\tcontainer\n\t\t\t);\n\n\t\t\tif ( shouldAnchorIncludePadding ) {\n\t\t\t\treturn rect;\n\t\t\t}\n\n\t\t\treturn withoutPadding( rect, anchorRef );\n\t\t}\n\n\t\tconst { top, bottom } = anchorRef;\n\t\tconst topRect = top.getBoundingClientRect();\n\t\tconst bottomRect = bottom.getBoundingClientRect();\n\t\tconst rect = offsetIframe(\n\t\t\tnew window.DOMRect(\n\t\t\t\ttopRect.left,\n\t\t\t\ttopRect.top,\n\t\t\t\ttopRect.width,\n\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t),\n\t\t\ttop.ownerDocument,\n\t\t\tcontainer\n\t\t);\n\n\t\tif ( shouldAnchorIncludePadding ) {\n\t\t\treturn rect;\n\t\t}\n\n\t\treturn withoutPadding( rect, anchorRef );\n\t}\n\n\tif ( ! anchorRefFallback.current ) {\n\t\treturn;\n\t}\n\n\tconst { parentNode } = anchorRefFallback.current;\n\tconst rect = offsetIframe(\n\t\tparentNode.getBoundingClientRect(),\n\t\tparentNode.ownerDocument,\n\t\tcontainer\n\t);\n\n\tif ( shouldAnchorIncludePadding ) {\n\t\treturn rect;\n\t}\n\n\treturn withoutPadding( rect, parentNode );\n}\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nfunction withoutPadding( rect, element ) {\n\tconst {\n\t\tpaddingTop,\n\t\tpaddingBottom,\n\t\tpaddingLeft,\n\t\tpaddingRight,\n\t} = getComputedStyle( element );\n\tconst top = paddingTop ? parseInt( paddingTop, 10 ) : 0;\n\tconst bottom = paddingBottom ? parseInt( paddingBottom, 10 ) : 0;\n\tconst left = paddingLeft ? parseInt( paddingLeft, 10 ) : 0;\n\tconst right = paddingRight ? parseInt( paddingRight, 10 ) : 0;\n\n\treturn {\n\t\tx: rect.left + left,\n\t\ty: rect.top + top,\n\t\twidth: rect.width - left - right,\n\t\theight: rect.height - top - bottom,\n\t\tleft: rect.left + left,\n\t\tright: rect.right - right,\n\t\ttop: rect.top + top,\n\t\tbottom: rect.bottom - bottom,\n\t};\n}\n\n/**\n * Sets or removes an element attribute.\n *\n * @param {Element} element The element to modify.\n * @param {string} name The attribute name to set or remove.\n * @param {?string} value The value to set. A falsy value will remove the\n * attribute.\n */\nfunction setAttribute( element, name, value ) {\n\tif ( ! value ) {\n\t\tif ( element.hasAttribute( name ) ) {\n\t\t\telement.removeAttribute( name );\n\t\t}\n\t} else if ( element.getAttribute( name ) !== value ) {\n\t\telement.setAttribute( name, value );\n\t}\n}\n\n/**\n * Sets or removes an element style property.\n *\n * @param {Element} element The element to modify.\n * @param {string} property The property to set or remove.\n * @param {?string} value The value to set. A falsy value will remove the\n * property.\n */\nfunction setStyle( element, property, value = '' ) {\n\tif ( element.style[ property ] !== value ) {\n\t\telement.style[ property ] = value;\n\t}\n}\n\n/**\n * Sets or removes an element class.\n *\n * @param {Element} element The element to modify.\n * @param {string} name The class to set or remove.\n * @param {boolean} toggle True to set the class, false to remove.\n */\nfunction setClass( element, name, toggle ) {\n\tif ( toggle ) {\n\t\tif ( ! element.classList.contains( name ) ) {\n\t\t\telement.classList.add( name );\n\t\t}\n\t} else if ( element.classList.contains( name ) ) {\n\t\telement.classList.remove( name );\n\t}\n}\n\nfunction getAnchorDocument( anchor ) {\n\tif ( ! anchor ) {\n\t\treturn;\n\t}\n\n\tif ( anchor.endContainer ) {\n\t\treturn anchor.endContainer.ownerDocument;\n\t}\n\n\tif ( anchor.top ) {\n\t\treturn anchor.top.ownerDocument;\n\t}\n\n\treturn anchor.ownerDocument;\n}\n\nconst Popover = (\n\t{\n\t\theaderTitle,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tisAlternate,\n\t\t// Disable reason: We generate the `...contentProps` rest as remainder\n\t\t// of props which aren't explicitly handled by this component.\n\t\t/* eslint-disable no-unused-vars */\n\t\tposition = 'bottom right',\n\t\trange,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchorRef,\n\t\tshouldAnchorIncludePadding,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\texpandOnMobile,\n\t\tanimate = true,\n\t\tonFocusOutside,\n\t\t__unstableStickyBoundaryElement,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\t__unstableObserveElement,\n\t\t__unstableBoundaryParent,\n\t\t__unstableForcePosition,\n\t\t__unstableForceXAlignment,\n\t\t__unstableEditorCanvasWrapper,\n\t\t/* eslint-enable no-unused-vars */\n\t\t...contentProps\n\t},\n\tref\n) => {\n\tconst anchorRefFallback = useRef( null );\n\tconst contentRef = useRef( null );\n\tconst containerRef = useRef();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ animateOrigin, setAnimateOrigin ] = useState();\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst [ containerResizeListener, contentSize ] = useResizeObserver();\n\tnoArrow = isExpanded || noArrow;\n\n\tuseLayoutEffect( () => {\n\t\tif ( isExpanded ) {\n\t\t\tsetClass( containerRef.current, 'is-without-arrow', noArrow );\n\t\t\tsetClass( containerRef.current, 'is-alternate', isAlternate );\n\t\t\tsetAttribute( containerRef.current, 'data-x-axis' );\n\t\t\tsetAttribute( containerRef.current, 'data-y-axis' );\n\t\t\tsetStyle( containerRef.current, 'top' );\n\t\t\tsetStyle( containerRef.current, 'left' );\n\t\t\tsetStyle( contentRef.current, 'maxHeight' );\n\t\t\tsetStyle( contentRef.current, 'maxWidth' );\n\t\t\treturn;\n\t\t}\n\n\t\tconst refresh = () => {\n\t\t\tif ( ! containerRef.current || ! contentRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet anchor = computeAnchorRect(\n\t\t\t\tanchorRefFallback,\n\t\t\t\tanchorRect,\n\t\t\t\tgetAnchorRect,\n\t\t\t\tanchorRef,\n\t\t\t\tshouldAnchorIncludePadding,\n\t\t\t\tcontainerRef.current\n\t\t\t);\n\n\t\t\tif ( ! anchor ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { offsetParent, ownerDocument } = containerRef.current;\n\n\t\t\tlet relativeOffsetTop = 0;\n\n\t\t\t// If there is a positioned ancestor element that is not the body,\n\t\t\t// subtract the position from the anchor rect. If the position of\n\t\t\t// the popover is fixed, the offset parent is null or the body\n\t\t\t// element, in which case the position is relative to the viewport.\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n\t\t\tif ( offsetParent && offsetParent !== ownerDocument.body ) {\n\t\t\t\tconst offsetParentRect = offsetParent.getBoundingClientRect();\n\n\t\t\t\trelativeOffsetTop = offsetParentRect.top;\n\t\t\t\tanchor = new window.DOMRect(\n\t\t\t\t\tanchor.left - offsetParentRect.left,\n\t\t\t\t\tanchor.top - offsetParentRect.top,\n\t\t\t\t\tanchor.width,\n\t\t\t\t\tanchor.height\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet boundaryElement;\n\t\t\tif ( __unstableBoundaryParent ) {\n\t\t\t\tboundaryElement = containerRef.current.parentElement;\n\t\t\t}\n\n\t\t\tconst usedContentSize = ! contentSize.height\n\t\t\t\t? contentRef.current.getBoundingClientRect()\n\t\t\t\t: contentSize;\n\n\t\t\tconst {\n\t\t\t\tpopoverTop,\n\t\t\t\tpopoverLeft,\n\t\t\t\txAxis,\n\t\t\t\tyAxis,\n\t\t\t\tcontentHeight,\n\t\t\t\tcontentWidth,\n\t\t\t} = computePopoverPosition(\n\t\t\t\tanchor,\n\t\t\t\tusedContentSize,\n\t\t\t\tposition,\n\t\t\t\t__unstableStickyBoundaryElement,\n\t\t\t\tcontainerRef.current,\n\t\t\t\trelativeOffsetTop,\n\t\t\t\tboundaryElement,\n\t\t\t\t__unstableForcePosition,\n\t\t\t\t__unstableForceXAlignment,\n\t\t\t\t__unstableEditorCanvasWrapper\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\ttypeof popoverTop === 'number' &&\n\t\t\t\ttypeof popoverLeft === 'number'\n\t\t\t) {\n\t\t\t\tsetStyle( containerRef.current, 'top', popoverTop + 'px' );\n\t\t\t\tsetStyle( containerRef.current, 'left', popoverLeft + 'px' );\n\t\t\t}\n\n\t\t\tsetClass(\n\t\t\t\tcontainerRef.current,\n\t\t\t\t'is-without-arrow',\n\t\t\t\tnoArrow || ( xAxis === 'center' && yAxis === 'middle' )\n\t\t\t);\n\t\t\tsetClass( containerRef.current, 'is-alternate', isAlternate );\n\t\t\tsetAttribute( containerRef.current, 'data-x-axis', xAxis );\n\t\t\tsetAttribute( containerRef.current, 'data-y-axis', yAxis );\n\t\t\tsetStyle(\n\t\t\t\tcontentRef.current,\n\t\t\t\t'maxHeight',\n\t\t\t\ttypeof contentHeight === 'number' ? contentHeight + 'px' : ''\n\t\t\t);\n\t\t\tsetStyle(\n\t\t\t\tcontentRef.current,\n\t\t\t\t'maxWidth',\n\t\t\t\ttypeof contentWidth === 'number' ? contentWidth + 'px' : ''\n\t\t\t);\n\n\t\t\t// Compute the animation position\n\t\t\tconst yAxisMapping = {\n\t\t\t\ttop: 'bottom',\n\t\t\t\tbottom: 'top',\n\t\t\t};\n\t\t\tconst xAxisMapping = {\n\t\t\t\tleft: 'right',\n\t\t\t\tright: 'left',\n\t\t\t};\n\t\t\tconst animateYAxis = yAxisMapping[ yAxis ] || 'middle';\n\t\t\tconst animateXAxis = xAxisMapping[ xAxis ] || 'center';\n\n\t\t\tsetAnimateOrigin( animateXAxis + ' ' + animateYAxis );\n\t\t};\n\n\t\trefresh();\n\n\t\tconst { ownerDocument } = containerRef.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t/*\n\t\t * There are sometimes we need to reposition or resize the popover that\n\t\t * are not handled by the resize/scroll window events (i.e. CSS changes\n\t\t * in the layout that changes the position of the anchor).\n\t\t *\n\t\t * For these situations, we refresh the popover every 0.5s\n\t\t */\n\t\tconst intervalHandle = defaultView.setInterval( refresh, 500 );\n\n\t\tlet rafId;\n\n\t\tconst refreshOnAnimationFrame = () => {\n\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\t\t\trafId = defaultView.requestAnimationFrame( refresh );\n\t\t};\n\n\t\t// Sometimes a click trigger a layout change that affects the popover\n\t\t// position. This is an opportunity to immediately refresh rather than\n\t\t// at the interval.\n\t\tdefaultView.addEventListener( 'click', refreshOnAnimationFrame );\n\t\tdefaultView.addEventListener( 'resize', refresh );\n\t\tdefaultView.addEventListener( 'scroll', refresh, true );\n\n\t\tconst anchorDocument = getAnchorDocument( anchorRef );\n\n\t\t// If the anchor is within an iframe, the popover position also needs\n\t\t// to refrest when the iframe content is scrolled or resized.\n\t\tif ( anchorDocument && anchorDocument !== ownerDocument ) {\n\t\t\tanchorDocument.defaultView.addEventListener( 'resize', refresh );\n\t\t\tanchorDocument.defaultView.addEventListener(\n\t\t\t\t'scroll',\n\t\t\t\trefresh,\n\t\t\t\ttrue\n\t\t\t);\n\t\t}\n\n\t\tlet observer;\n\n\t\tif ( __unstableObserveElement ) {\n\t\t\tobserver = new defaultView.MutationObserver( refresh );\n\t\t\tobserver.observe( __unstableObserveElement, { attributes: true } );\n\t\t}\n\n\t\treturn () => {\n\t\t\tdefaultView.clearInterval( intervalHandle );\n\t\t\tdefaultView.removeEventListener( 'resize', refresh );\n\t\t\tdefaultView.removeEventListener( 'scroll', refresh, true );\n\t\t\tdefaultView.removeEventListener( 'click', refreshOnAnimationFrame );\n\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\n\t\t\tif ( anchorDocument && anchorDocument !== ownerDocument ) {\n\t\t\t\tanchorDocument.defaultView?.removeEventListener(\n\t\t\t\t\t'resize',\n\t\t\t\t\trefresh\n\t\t\t\t);\n\t\t\t\tanchorDocument.defaultView?.removeEventListener(\n\t\t\t\t\t'scroll',\n\t\t\t\t\trefresh,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( observer ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t};\n\t}, [\n\t\tisExpanded,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tanchorRef,\n\t\tshouldAnchorIncludePadding,\n\t\tposition,\n\t\tcontentSize,\n\t\t__unstableStickyBoundaryElement,\n\t\t__unstableObserveElement,\n\t\t__unstableBoundaryParent,\n\t] );\n\n\tconst onDialogClose = ( type, event ) => {\n\t\t// Ideally the popover should have just a single onClose prop and\n\t\t// not three props that potentially do the same thing.\n\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\tonFocusOutside( event );\n\t\t} else if ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t};\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst mergedRefs = useMergeRefs( [ containerRef, dialogRef, ref ] );\n\n\t/** @type {false | string} */\n\tconst animateClassName =\n\t\tBoolean( animate && animateOrigin ) &&\n\t\tgetAnimateClassName( {\n\t\t\ttype: 'appear',\n\t\t\torigin: animateOrigin,\n\t\t} );\n\n\t// Disable reason: We care to capture the _bubbled_ events from inputs\n\t// within popover as inferring close intent.\n\n\tlet content = (\n\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-popover',\n\t\t\t\tclassName,\n\t\t\t\tanimateClassName,\n\t\t\t\t{\n\t\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t\t'is-without-arrow': noArrow,\n\t\t\t\t\t'is-alternate': isAlternate,\n\t\t\t\t}\n\t\t\t) }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedRefs }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex=\"-1\"\n\t\t>\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 ref={ contentRef } className=\"components-popover__content\">\n\t\t\t\t<div style={ { position: 'relative' } }>\n\t\t\t\t\t{ containerResizeListener }\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\tif ( slot.ref ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t}\n\n\tif ( anchorRef || anchorRect ) {\n\t\treturn content;\n\t}\n\n\treturn <span ref={ anchorRefFallback }>{ content }</span>;\n};\n\nconst PopoverContainer = forwardRef( Popover );\n\nfunction PopoverSlot( { name = SLOT_NAME }, ref ) {\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\nPopoverContainer.Slot = forwardRef( PopoverSlot );\nPopoverContainer.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default PopoverContainer;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/popover/index.js"],"names":["SLOT_NAME","slotNameContext","computeAnchorRect","anchorRefFallback","anchorRect","getAnchorRect","anchorRef","shouldAnchorIncludePadding","container","current","rect","ownerDocument","window","Range","Element","DOMRect","cloneRange","endContainer","getBoundingClientRect","withoutPadding","top","bottom","topRect","bottomRect","left","width","parentNode","getComputedStyle","node","defaultView","element","paddingTop","paddingBottom","paddingLeft","paddingRight","parseInt","right","x","y","height","setAttribute","name","value","hasAttribute","removeAttribute","getAttribute","setStyle","property","style","setClass","toggle","classList","contains","add","remove","getAnchorDocument","anchor","Popover","ref","headerTitle","onClose","children","className","noArrow","isAlternate","position","range","focusOnMount","expandOnMobile","animate","onFocusOutside","__unstableStickyBoundaryElement","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent","__unstableForcePosition","__unstableForceXAlignment","__unstableEditorCanvasWrapper","contentProps","contentRef","containerRef","isMobileViewport","animateOrigin","setAnimateOrigin","slotName","slot","isExpanded","containerResizeListener","contentSize","refresh","offsetParent","relativeOffsetTop","body","offsetParentRect","boundaryElement","parentElement","usedContentSize","popoverTop","popoverLeft","xAxis","yAxis","contentHeight","contentWidth","yAxisMapping","xAxisMapping","animateYAxis","animateXAxis","intervalHandle","setInterval","rafId","refreshOnAnimationFrame","cancelAnimationFrame","requestAnimationFrame","addEventListener","anchorDocument","observer","MutationObserver","observe","attributes","clearInterval","removeEventListener","disconnect","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","mergedRefs","animateClassName","Boolean","origin","content","close","PopoverContainer","PopoverSlot","Slot","__unstableSlotNameProvider","Provider"],"mappings":";;;;;;;;;AASA;;;;AALA;;AAaA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAjCA;;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA,MAAMA,SAAS,GAAG,SAAlB;AAEA,MAAMC,eAAe,GAAG,6BAAxB;;AAEA,SAASC,iBAAT,CACCC,iBADD,EAECC,UAFD,EAGCC,aAHD,EAOE;AAAA,MAHDC,SAGC,uEAHW,KAGX;AAAA,MAFDC,0BAEC;AAAA,MADDC,SACC;;AACD,MAAKJ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AAU,IACX;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG3B,WADH,CADD,EAIC,4BAAC,eAAD;AACC,IAAA,SAAS,EAAC,2BADX;AAEC,IAAA,IAAI,EAAG0E,YAFR;AAGC,IAAA,OAAO,EAAGzE;AAHX,IAJD,CAlBF,EA6BC;AAAK,IAAA,GAAG,EAAGmB,UAAX;AAAwB,IAAA,SAAS,EAAC;AAAlC,KACC;AAAK,IAAA,KAAK,EAAG;AAAEd,MAAAA,QAAQ,EAAE;AAAZ;AAAb,KACGsB,uBADH,EAEG1B,QAFH,CADD,CA7BD,CAHD;;AAyCA,MAAKwB,IAAI,CAAC3B,GAAV,EAAgB;AACf0E,IAAAA,OAAO,GAAG,4BAAC,cAAD;AAAM,MAAA,IAAI,EAAGhD;AAAb,OAA0BgD,OAA1B,CAAV;AACA;;AAED,MAAK9H,SAAS,IAAIF,UAAlB,EAA+B;AAC9B,WAAOgI,OAAP;AACA;;AAED,SAAO;AAAM,IAAA,GAAG,EAAGjI;AAAZ,KAAkCiI,OAAlC,CAAP;AACA,CA1UD;;AA4UA,MAAME,gBAAgB,GAAG,yBAAY7E,OAAZ,CAAzB;;AAEA,SAAS8E,WAAT,QAA4C7E,GAA5C,EAAkD;AAAA,MAA5B;AAAEjB,IAAAA,IAAI,GAAGzC;AAAT,GAA4B;AACjD,SACC,4BAAC,cAAD;AACC,IAAA,gBAAgB,MADjB;AAEC,IAAA,IAAI,EAAGyC,IAFR;AAGC,IAAA,SAAS,EAAC,cAHX;AAIC,IAAA,GAAG,EAAGiB;AAJP,IADD;AAQA;;AAED4E,gBAAgB,CAACE,IAAjB,GAAwB,yBAAYD,WAAZ,CAAxB;AACAD,gBAAgB,CAACG,0BAAjB,GAA8CxI,eAAe,CAACyI,QAA9D;eAEeJ,gB","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseState,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport { getRectangleFromRange } from '@wordpress/dom';\nimport {\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { computePopoverPosition, offsetIframe } from './utils';\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport { getAnimateClassName } from '../animate';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nconst SLOT_NAME = 'Popover';\n\nconst slotNameContext = createContext();\n\nfunction computeAnchorRect(\n\tanchorRefFallback,\n\tanchorRect,\n\tgetAnchorRect,\n\tanchorRef = false,\n\tshouldAnchorIncludePadding,\n\tcontainer\n) {\n\tif ( anchorRect ) {\n\t\treturn anchorRect;\n\t}\n\n\tif ( getAnchorRect ) {\n\t\tif ( ! anchorRefFallback.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rect = getAnchorRect( anchorRefFallback.current );\n\t\treturn offsetIframe(\n\t\t\trect,\n\t\t\trect.ownerDocument || anchorRefFallback.current.ownerDocument,\n\t\t\tcontainer\n\t\t);\n\t}\n\n\tif ( anchorRef !== false ) {\n\t\tif (\n\t\t\t! anchorRef ||\n\t\t\t! window.Range ||\n\t\t\t! window.Element ||\n\t\t\t! window.DOMRect\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Duck-type to check if `anchorRef` is an instance of Range\n\t\t// `anchorRef instanceof window.Range` checks will break across document boundaries\n\t\t// such as in an iframe.\n\t\tif ( typeof anchorRef?.cloneRange === 'function' ) {\n\t\t\treturn offsetIframe(\n\t\t\t\tgetRectangleFromRange( anchorRef ),\n\t\t\t\tanchorRef.endContainer.ownerDocument,\n\t\t\t\tcontainer\n\t\t\t);\n\t\t}\n\n\t\t// Duck-type to check if `anchorRef` is an instance of Element\n\t\t// `anchorRef instanceof window.Element` checks will break across document boundaries\n\t\t// such as in an iframe.\n\t\tif ( typeof anchorRef?.getBoundingClientRect === 'function' ) {\n\t\t\tconst rect = offsetIframe(\n\t\t\t\tanchorRef.getBoundingClientRect(),\n\t\t\t\tanchorRef.ownerDocument,\n\t\t\t\tcontainer\n\t\t\t);\n\n\t\t\tif ( shouldAnchorIncludePadding ) {\n\t\t\t\treturn rect;\n\t\t\t}\n\n\t\t\treturn withoutPadding( rect, anchorRef );\n\t\t}\n\n\t\tconst { top, bottom } = anchorRef;\n\t\tconst topRect = top.getBoundingClientRect();\n\t\tconst bottomRect = bottom.getBoundingClientRect();\n\t\tconst rect = offsetIframe(\n\t\t\tnew window.DOMRect(\n\t\t\t\ttopRect.left,\n\t\t\t\ttopRect.top,\n\t\t\t\ttopRect.width,\n\t\t\t\tbottomRect.bottom - topRect.top\n\t\t\t),\n\t\t\ttop.ownerDocument,\n\t\t\tcontainer\n\t\t);\n\n\t\tif ( shouldAnchorIncludePadding ) {\n\t\t\treturn rect;\n\t\t}\n\n\t\treturn withoutPadding( rect, anchorRef );\n\t}\n\n\tif ( ! anchorRefFallback.current ) {\n\t\treturn;\n\t}\n\n\tconst { parentNode } = anchorRefFallback.current;\n\tconst rect = offsetIframe(\n\t\tparentNode.getBoundingClientRect(),\n\t\tparentNode.ownerDocument,\n\t\tcontainer\n\t);\n\n\tif ( shouldAnchorIncludePadding ) {\n\t\treturn rect;\n\t}\n\n\treturn withoutPadding( rect, parentNode );\n}\n\nfunction getComputedStyle( node ) {\n\treturn node.ownerDocument.defaultView.getComputedStyle( node );\n}\n\nfunction withoutPadding( rect, element ) {\n\tconst {\n\t\tpaddingTop,\n\t\tpaddingBottom,\n\t\tpaddingLeft,\n\t\tpaddingRight,\n\t} = getComputedStyle( element );\n\tconst top = paddingTop ? parseInt( paddingTop, 10 ) : 0;\n\tconst bottom = paddingBottom ? parseInt( paddingBottom, 10 ) : 0;\n\tconst left = paddingLeft ? parseInt( paddingLeft, 10 ) : 0;\n\tconst right = paddingRight ? parseInt( paddingRight, 10 ) : 0;\n\n\treturn {\n\t\tx: rect.left + left,\n\t\ty: rect.top + top,\n\t\twidth: rect.width - left - right,\n\t\theight: rect.height - top - bottom,\n\t\tleft: rect.left + left,\n\t\tright: rect.right - right,\n\t\ttop: rect.top + top,\n\t\tbottom: rect.bottom - bottom,\n\t};\n}\n\n/**\n * Sets or removes an element attribute.\n *\n * @param {Element} element The element to modify.\n * @param {string} name The attribute name to set or remove.\n * @param {?string} value The value to set. A falsy value will remove the\n * attribute.\n */\nfunction setAttribute( element, name, value ) {\n\tif ( ! value ) {\n\t\tif ( element.hasAttribute( name ) ) {\n\t\t\telement.removeAttribute( name );\n\t\t}\n\t} else if ( element.getAttribute( name ) !== value ) {\n\t\telement.setAttribute( name, value );\n\t}\n}\n\n/**\n * Sets or removes an element style property.\n *\n * @param {Element} element The element to modify.\n * @param {string} property The property to set or remove.\n * @param {?string} value The value to set. A falsy value will remove the\n * property.\n */\nfunction setStyle( element, property, value = '' ) {\n\tif ( element.style[ property ] !== value ) {\n\t\telement.style[ property ] = value;\n\t}\n}\n\n/**\n * Sets or removes an element class.\n *\n * @param {Element} element The element to modify.\n * @param {string} name The class to set or remove.\n * @param {boolean} toggle True to set the class, false to remove.\n */\nfunction setClass( element, name, toggle ) {\n\tif ( toggle ) {\n\t\tif ( ! element.classList.contains( name ) ) {\n\t\t\telement.classList.add( name );\n\t\t}\n\t} else if ( element.classList.contains( name ) ) {\n\t\telement.classList.remove( name );\n\t}\n}\n\nfunction getAnchorDocument( anchor ) {\n\tif ( ! anchor ) {\n\t\treturn;\n\t}\n\n\tif ( anchor.endContainer ) {\n\t\treturn anchor.endContainer.ownerDocument;\n\t}\n\n\tif ( anchor.top ) {\n\t\treturn anchor.top.ownerDocument;\n\t}\n\n\treturn anchor.ownerDocument;\n}\n\nconst Popover = (\n\t{\n\t\theaderTitle,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tisAlternate,\n\t\t// Disable reason: We generate the `...contentProps` rest as remainder\n\t\t// of props which aren't explicitly handled by this component.\n\t\t/* eslint-disable no-unused-vars */\n\t\tposition = 'bottom right',\n\t\trange,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchorRef,\n\t\tshouldAnchorIncludePadding,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\texpandOnMobile,\n\t\tanimate = true,\n\t\tonFocusOutside,\n\t\t__unstableStickyBoundaryElement,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\t__unstableObserveElement,\n\t\t__unstableBoundaryParent,\n\t\t__unstableForcePosition,\n\t\t__unstableForceXAlignment,\n\t\t__unstableEditorCanvasWrapper,\n\t\t/* eslint-enable no-unused-vars */\n\t\t...contentProps\n\t},\n\tref\n) => {\n\tconst anchorRefFallback = useRef( null );\n\tconst contentRef = useRef( null );\n\tconst containerRef = useRef();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ animateOrigin, setAnimateOrigin ] = useState();\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst [ containerResizeListener, contentSize ] = useResizeObserver();\n\tnoArrow = isExpanded || noArrow;\n\n\tuseLayoutEffect( () => {\n\t\tif ( isExpanded ) {\n\t\t\tsetClass( containerRef.current, 'is-without-arrow', noArrow );\n\t\t\tsetClass( containerRef.current, 'is-alternate', isAlternate );\n\t\t\tsetAttribute( containerRef.current, 'data-x-axis' );\n\t\t\tsetAttribute( containerRef.current, 'data-y-axis' );\n\t\t\tsetStyle( containerRef.current, 'top' );\n\t\t\tsetStyle( containerRef.current, 'left' );\n\t\t\tsetStyle( contentRef.current, 'maxHeight' );\n\t\t\tsetStyle( contentRef.current, 'maxWidth' );\n\t\t\treturn;\n\t\t}\n\n\t\tconst refresh = () => {\n\t\t\tif ( ! containerRef.current || ! contentRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet anchor = computeAnchorRect(\n\t\t\t\tanchorRefFallback,\n\t\t\t\tanchorRect,\n\t\t\t\tgetAnchorRect,\n\t\t\t\tanchorRef,\n\t\t\t\tshouldAnchorIncludePadding,\n\t\t\t\tcontainerRef.current\n\t\t\t);\n\n\t\t\tif ( ! anchor ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { offsetParent, ownerDocument } = containerRef.current;\n\n\t\t\tlet relativeOffsetTop = 0;\n\n\t\t\t// If there is a positioned ancestor element that is not the body,\n\t\t\t// subtract the position from the anchor rect. If the position of\n\t\t\t// the popover is fixed, the offset parent is null or the body\n\t\t\t// element, in which case the position is relative to the viewport.\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n\t\t\tif ( offsetParent && offsetParent !== ownerDocument.body ) {\n\t\t\t\tconst offsetParentRect = offsetParent.getBoundingClientRect();\n\n\t\t\t\trelativeOffsetTop = offsetParentRect.top;\n\t\t\t\tanchor = new window.DOMRect(\n\t\t\t\t\tanchor.left - offsetParentRect.left,\n\t\t\t\t\tanchor.top - offsetParentRect.top,\n\t\t\t\t\tanchor.width,\n\t\t\t\t\tanchor.height\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tlet boundaryElement;\n\t\t\tif ( __unstableBoundaryParent ) {\n\t\t\t\tboundaryElement = containerRef.current.parentElement;\n\t\t\t}\n\n\t\t\tconst usedContentSize = ! contentSize.height\n\t\t\t\t? contentRef.current.getBoundingClientRect()\n\t\t\t\t: contentSize;\n\n\t\t\tconst {\n\t\t\t\tpopoverTop,\n\t\t\t\tpopoverLeft,\n\t\t\t\txAxis,\n\t\t\t\tyAxis,\n\t\t\t\tcontentHeight,\n\t\t\t\tcontentWidth,\n\t\t\t} = computePopoverPosition(\n\t\t\t\tanchor,\n\t\t\t\tusedContentSize,\n\t\t\t\tposition,\n\t\t\t\t__unstableStickyBoundaryElement,\n\t\t\t\tcontainerRef.current,\n\t\t\t\trelativeOffsetTop,\n\t\t\t\tboundaryElement,\n\t\t\t\t__unstableForcePosition,\n\t\t\t\t__unstableForceXAlignment,\n\t\t\t\t__unstableEditorCanvasWrapper\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\ttypeof popoverTop === 'number' &&\n\t\t\t\ttypeof popoverLeft === 'number'\n\t\t\t) {\n\t\t\t\tsetStyle( containerRef.current, 'top', popoverTop + 'px' );\n\t\t\t\tsetStyle( containerRef.current, 'left', popoverLeft + 'px' );\n\t\t\t}\n\n\t\t\tsetClass(\n\t\t\t\tcontainerRef.current,\n\t\t\t\t'is-without-arrow',\n\t\t\t\tnoArrow || ( xAxis === 'center' && yAxis === 'middle' )\n\t\t\t);\n\t\t\tsetClass( containerRef.current, 'is-alternate', isAlternate );\n\t\t\tsetAttribute( containerRef.current, 'data-x-axis', xAxis );\n\t\t\tsetAttribute( containerRef.current, 'data-y-axis', yAxis );\n\t\t\tsetStyle(\n\t\t\t\tcontentRef.current,\n\t\t\t\t'maxHeight',\n\t\t\t\ttypeof contentHeight === 'number' ? contentHeight + 'px' : ''\n\t\t\t);\n\t\t\tsetStyle(\n\t\t\t\tcontentRef.current,\n\t\t\t\t'maxWidth',\n\t\t\t\ttypeof contentWidth === 'number' ? contentWidth + 'px' : ''\n\t\t\t);\n\n\t\t\t// Compute the animation position.\n\t\t\tconst yAxisMapping = {\n\t\t\t\ttop: 'bottom',\n\t\t\t\tbottom: 'top',\n\t\t\t};\n\t\t\tconst xAxisMapping = {\n\t\t\t\tleft: 'right',\n\t\t\t\tright: 'left',\n\t\t\t};\n\t\t\tconst animateYAxis = yAxisMapping[ yAxis ] || 'middle';\n\t\t\tconst animateXAxis = xAxisMapping[ xAxis ] || 'center';\n\n\t\t\tsetAnimateOrigin( animateXAxis + ' ' + animateYAxis );\n\t\t};\n\n\t\trefresh();\n\n\t\tconst { ownerDocument } = containerRef.current;\n\t\tconst { defaultView } = ownerDocument;\n\n\t\t/*\n\t\t * There are sometimes we need to reposition or resize the popover that\n\t\t * are not handled by the resize/scroll window events (i.e. CSS changes\n\t\t * in the layout that changes the position of the anchor).\n\t\t *\n\t\t * For these situations, we refresh the popover every 0.5s\n\t\t */\n\t\tconst intervalHandle = defaultView.setInterval( refresh, 500 );\n\n\t\tlet rafId;\n\n\t\tconst refreshOnAnimationFrame = () => {\n\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\t\t\trafId = defaultView.requestAnimationFrame( refresh );\n\t\t};\n\n\t\t// Sometimes a click trigger a layout change that affects the popover\n\t\t// position. This is an opportunity to immediately refresh rather than\n\t\t// at the interval.\n\t\tdefaultView.addEventListener( 'click', refreshOnAnimationFrame );\n\t\tdefaultView.addEventListener( 'resize', refresh );\n\t\tdefaultView.addEventListener( 'scroll', refresh, true );\n\n\t\tconst anchorDocument = getAnchorDocument( anchorRef );\n\n\t\t// If the anchor is within an iframe, the popover position also needs\n\t\t// to refrest when the iframe content is scrolled or resized.\n\t\tif ( anchorDocument && anchorDocument !== ownerDocument ) {\n\t\t\tanchorDocument.defaultView.addEventListener( 'resize', refresh );\n\t\t\tanchorDocument.defaultView.addEventListener(\n\t\t\t\t'scroll',\n\t\t\t\trefresh,\n\t\t\t\ttrue\n\t\t\t);\n\t\t}\n\n\t\tlet observer;\n\n\t\tif ( __unstableObserveElement ) {\n\t\t\tobserver = new defaultView.MutationObserver( refresh );\n\t\t\tobserver.observe( __unstableObserveElement, { attributes: true } );\n\t\t}\n\n\t\treturn () => {\n\t\t\tdefaultView.clearInterval( intervalHandle );\n\t\t\tdefaultView.removeEventListener( 'resize', refresh );\n\t\t\tdefaultView.removeEventListener( 'scroll', refresh, true );\n\t\t\tdefaultView.removeEventListener( 'click', refreshOnAnimationFrame );\n\t\t\tdefaultView.cancelAnimationFrame( rafId );\n\n\t\t\tif ( anchorDocument && anchorDocument !== ownerDocument ) {\n\t\t\t\tanchorDocument.defaultView?.removeEventListener(\n\t\t\t\t\t'resize',\n\t\t\t\t\trefresh\n\t\t\t\t);\n\t\t\t\tanchorDocument.defaultView?.removeEventListener(\n\t\t\t\t\t'scroll',\n\t\t\t\t\trefresh,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( observer ) {\n\t\t\t\tobserver.disconnect();\n\t\t\t}\n\t\t};\n\t}, [\n\t\tisExpanded,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tanchorRef,\n\t\tshouldAnchorIncludePadding,\n\t\tposition,\n\t\tcontentSize,\n\t\t__unstableStickyBoundaryElement,\n\t\t__unstableObserveElement,\n\t\t__unstableBoundaryParent,\n\t] );\n\n\tconst onDialogClose = ( type, event ) => {\n\t\t// Ideally the popover should have just a single onClose prop and\n\t\t// not three props that potentially do the same thing.\n\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\tonFocusOutside( event );\n\t\t} else if ( onClose ) {\n\t\t\tonClose();\n\t\t}\n\t};\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst mergedRefs = useMergeRefs( [ containerRef, dialogRef, ref ] );\n\n\t/** @type {false | string} */\n\tconst animateClassName =\n\t\tBoolean( animate && animateOrigin ) &&\n\t\tgetAnimateClassName( {\n\t\t\ttype: 'appear',\n\t\t\torigin: animateOrigin,\n\t\t} );\n\n\t// Disable reason: We care to capture the _bubbled_ events from inputs\n\t// within popover as inferring close intent.\n\n\tlet content = (\n\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-popover',\n\t\t\t\tclassName,\n\t\t\t\tanimateClassName,\n\t\t\t\t{\n\t\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t\t'is-without-arrow': noArrow,\n\t\t\t\t\t'is-alternate': isAlternate,\n\t\t\t\t}\n\t\t\t) }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedRefs }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex=\"-1\"\n\t\t>\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 ref={ contentRef } className=\"components-popover__content\">\n\t\t\t\t<div style={ { position: 'relative' } }>\n\t\t\t\t\t{ containerResizeListener }\n\t\t\t\t\t{ children }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\tif ( slot.ref ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t}\n\n\tif ( anchorRef || anchorRect ) {\n\t\treturn content;\n\t}\n\n\treturn <span ref={ anchorRefFallback }>{ content }</span>;\n};\n\nconst PopoverContainer = forwardRef( Popover );\n\nfunction PopoverSlot( { name = SLOT_NAME }, ref ) {\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\nPopoverContainer.Slot = forwardRef( PopoverSlot );\nPopoverContainer.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default PopoverContainer;\n"]}
@@ -19,7 +19,7 @@ var _i18n = require("@wordpress/i18n");
19
19
  /**
20
20
  * Module constants
21
21
  */
22
- const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
22
+ const HEIGHT_OFFSET = 10; // Used by the arrow and a bit of empty space.
23
23
 
24
24
  /**
25
25
  * Utility used to compute the popover position over the xAxis
@@ -42,7 +42,7 @@ const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
42
42
  function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) {
43
43
  const {
44
44
  width
45
- } = contentSize; // Correct xAxis for RTL support
45
+ } = contentSize; // Correct xAxis for RTL support.
46
46
 
47
47
  if (xAxis === 'left' && (0, _i18n.isRTL)()) {
48
48
  xAxis = 'right';
@@ -54,7 +54,7 @@ function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sti
54
54
  corner = 'right';
55
55
  } else if (corner === 'right' && (0, _i18n.isRTL)()) {
56
56
  corner = 'left';
57
- } // x axis alignment choices
57
+ } // X axis alignment choices.
58
58
 
59
59
 
60
60
  const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
@@ -85,7 +85,7 @@ function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sti
85
85
  const rightAlignment = {
86
86
  popoverLeft: rightAlignmentX,
87
87
  contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
88
- }; // Choosing the x axis
88
+ }; // Choosing the x axis.
89
89
 
90
90
  let chosenXAxis = xAxis;
91
91
  let contentWidth = null;
@@ -196,7 +196,7 @@ function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sti
196
196
  popoverTop: Math.min(anchorRect.bottom, stickyPositionTop)
197
197
  };
198
198
  }
199
- } // y axis alignment choices
199
+ } // Y axis alignment choices.
200
200
 
201
201
 
202
202
  let anchorMidPoint = anchorRect.top + anchorRect.height / 2;
@@ -218,7 +218,7 @@ function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sti
218
218
  const bottomAlignment = {
219
219
  popoverTop: anchorRect.bottom,
220
220
  contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
221
- }; // Choosing the y axis
221
+ }; // Choosing the y axis.
222
222
 
223
223
  let chosenYAxis = yAxis;
224
224
  let contentHeight = null;