@wordpress/components 28.5.0 → 28.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (968) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/CONTRIBUTING.md +178 -64
  3. package/build/alignment-matrix-control/cell.js +6 -9
  4. package/build/alignment-matrix-control/cell.js.map +1 -1
  5. package/build/alignment-matrix-control/icon.js +31 -19
  6. package/build/alignment-matrix-control/icon.js.map +1 -1
  7. package/build/alignment-matrix-control/index.js +57 -52
  8. package/build/alignment-matrix-control/index.js.map +1 -1
  9. package/build/alignment-matrix-control/styles.js +73 -0
  10. package/build/alignment-matrix-control/styles.js.map +1 -0
  11. package/build/alignment-matrix-control/types.js.map +1 -1
  12. package/build/angle-picker-control/angle-circle.js +9 -9
  13. package/build/angle-picker-control/angle-circle.js.map +1 -1
  14. package/build/angle-picker-control/styles/angle-picker-control-styles.js +4 -4
  15. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  16. package/build/base-control/index.js +54 -41
  17. package/build/base-control/index.js.map +1 -1
  18. package/build/base-control/types.js.map +1 -1
  19. package/build/border-control/border-control/component.js +18 -13
  20. package/build/border-control/border-control/component.js.map +1 -1
  21. package/build/border-control/styles.js +13 -13
  22. package/build/border-control/styles.js.map +1 -1
  23. package/build/checkbox-control/index.js +1 -0
  24. package/build/checkbox-control/index.js.map +1 -1
  25. package/build/circular-option-picker/circular-option-picker-option.js +17 -11
  26. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  27. package/build/circular-option-picker/circular-option-picker.js +17 -14
  28. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  29. package/build/circular-option-picker/types.js.map +1 -1
  30. package/build/clipboard-button/index.js +6 -6
  31. package/build/clipboard-button/index.js.map +1 -1
  32. package/build/color-palette/utils.js +16 -5
  33. package/build/color-palette/utils.js.map +1 -1
  34. package/build/color-picker/color-copy-button.js +8 -8
  35. package/build/color-picker/color-copy-button.js.map +1 -1
  36. package/build/color-picker/hex-input.js +8 -8
  37. package/build/color-picker/hex-input.js.map +1 -1
  38. package/build/color-picker/input-with-slider.js +9 -8
  39. package/build/color-picker/input-with-slider.js.map +1 -1
  40. package/build/color-picker/styles.js +8 -8
  41. package/build/color-picker/styles.js.map +1 -1
  42. package/build/combobox-control/index.js +1 -0
  43. package/build/combobox-control/index.js.map +1 -1
  44. package/build/combobox-control/types.js.map +1 -1
  45. package/build/composite/context.js +19 -0
  46. package/build/composite/context.js.map +1 -0
  47. package/build/composite/group-label.js +33 -0
  48. package/build/composite/group-label.js.map +1 -0
  49. package/build/composite/group.js +33 -0
  50. package/build/composite/group.js.map +1 -0
  51. package/build/composite/hover.js +33 -0
  52. package/build/composite/hover.js.map +1 -0
  53. package/build/composite/index.js +241 -9
  54. package/build/composite/index.js.map +1 -1
  55. package/build/composite/item.js +33 -0
  56. package/build/composite/item.js.map +1 -0
  57. package/build/composite/legacy/index.js +11 -8
  58. package/build/composite/legacy/index.js.map +1 -1
  59. package/build/composite/row.js +33 -0
  60. package/build/composite/row.js.map +1 -0
  61. package/build/composite/store.js +54 -0
  62. package/build/composite/store.js.map +1 -0
  63. package/build/composite/typeahead.js +33 -0
  64. package/build/composite/typeahead.js.map +1 -0
  65. package/build/composite/types.js +6 -0
  66. package/build/composite/types.js.map +1 -0
  67. package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  68. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  69. package/build/custom-select-control/types.js.map +1 -1
  70. package/build/custom-select-control-v2/custom-select.js +3 -2
  71. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  72. package/build/custom-select-control-v2/styles.js +12 -14
  73. package/build/custom-select-control-v2/styles.js.map +1 -1
  74. package/build/date-time/date/styles.js +8 -8
  75. package/build/date-time/date/styles.js.map +1 -1
  76. package/build/date-time/time/index.js +11 -3
  77. package/build/date-time/time/index.js.map +1 -1
  78. package/build/date-time/time/time-input/index.js +17 -19
  79. package/build/date-time/time/time-input/index.js.map +1 -1
  80. package/build/date-time/types.js.map +1 -1
  81. package/build/dimension-control/index.js +31 -9
  82. package/build/dimension-control/index.js.map +1 -1
  83. package/build/dimension-control/types.js.map +1 -1
  84. package/build/draggable/index.js +4 -4
  85. package/build/draggable/index.js.map +1 -1
  86. package/build/dropdown-menu-v2/checkbox-item.js +69 -0
  87. package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
  88. package/build/dropdown-menu-v2/context.js +17 -0
  89. package/build/dropdown-menu-v2/context.js.map +1 -0
  90. package/build/dropdown-menu-v2/group-label.js +40 -0
  91. package/build/dropdown-menu-v2/group-label.js.map +1 -0
  92. package/build/dropdown-menu-v2/group.js +29 -0
  93. package/build/dropdown-menu-v2/group.js.map +1 -0
  94. package/build/dropdown-menu-v2/index.js +60 -147
  95. package/build/dropdown-menu-v2/index.js.map +1 -1
  96. package/build/dropdown-menu-v2/item-help-text.js +27 -0
  97. package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
  98. package/build/dropdown-menu-v2/item-label.js +27 -0
  99. package/build/dropdown-menu-v2/item-label.js.map +1 -0
  100. package/build/dropdown-menu-v2/item.js +53 -0
  101. package/build/dropdown-menu-v2/item.js.map +1 -0
  102. package/build/dropdown-menu-v2/radio-item.js +79 -0
  103. package/build/dropdown-menu-v2/radio-item.js.map +1 -0
  104. package/build/dropdown-menu-v2/separator.js +30 -0
  105. package/build/dropdown-menu-v2/separator.js.map +1 -0
  106. package/build/dropdown-menu-v2/styles.js +63 -85
  107. package/build/dropdown-menu-v2/styles.js.map +1 -1
  108. package/build/dropdown-menu-v2/types.js.map +1 -1
  109. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
  110. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  111. package/build/focal-point-picker/controls.js +1 -3
  112. package/build/focal-point-picker/controls.js.map +1 -1
  113. package/build/focal-point-picker/index.js +1 -2
  114. package/build/focal-point-picker/index.js.map +1 -1
  115. package/build/focal-point-picker/styles/focal-point-picker-style.js +11 -11
  116. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  117. package/build/focal-point-picker/styles/focal-point-style.js +7 -2
  118. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  119. package/build/focal-point-picker/types.js.map +1 -1
  120. package/build/form-file-upload/types.js.map +1 -1
  121. package/build/form-token-field/types.js.map +1 -1
  122. package/build/index.js +11 -5
  123. package/build/index.js.map +1 -1
  124. package/build/input-control/index.js +2 -2
  125. package/build/input-control/index.js.map +1 -1
  126. package/build/input-control/input-base.js +5 -10
  127. package/build/input-control/input-base.js.map +1 -1
  128. package/build/input-control/input-prefix-wrapper.js +3 -3
  129. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  130. package/build/input-control/input-suffix-wrapper.js +2 -3
  131. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  132. package/build/input-control/reducer/reducer.js +8 -8
  133. package/build/input-control/reducer/reducer.js.map +1 -1
  134. package/build/input-control/styles/input-control-styles.js +75 -45
  135. package/build/input-control/styles/input-control-styles.js.map +1 -1
  136. package/build/input-control/types.js.map +1 -1
  137. package/build/input-control/utils.js +3 -3
  138. package/build/input-control/utils.js.map +1 -1
  139. package/build/item-group/styles.js +11 -11
  140. package/build/item-group/styles.js.map +1 -1
  141. package/build/mobile/utils/alignments.native.js +1 -1
  142. package/build/mobile/utils/alignments.native.js.map +1 -1
  143. package/build/modal/index.js +5 -5
  144. package/build/modal/index.js.map +1 -1
  145. package/build/navigation/index.js +4 -4
  146. package/build/navigation/index.js.map +1 -1
  147. package/build/navigation/styles/navigation-styles.js +13 -13
  148. package/build/navigation/styles/navigation-styles.js.map +1 -1
  149. package/build/navigator/index.js +12 -13
  150. package/build/navigator/index.js.map +1 -1
  151. package/build/navigator/navigator-back-button/component.js +1 -1
  152. package/build/navigator/navigator-back-button/component.js.map +1 -1
  153. package/build/navigator/navigator-back-button/hook.js +5 -11
  154. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  155. package/build/navigator/navigator-button/hook.js +2 -2
  156. package/build/navigator/navigator-button/hook.js.map +1 -1
  157. package/build/navigator/navigator-provider/component.js +116 -76
  158. package/build/navigator/navigator-provider/component.js.map +1 -1
  159. package/build/navigator/navigator-to-parent-button/component.js +13 -40
  160. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  161. package/build/navigator/types.js.map +1 -1
  162. package/build/navigator/use-navigator.js +1 -2
  163. package/build/navigator/use-navigator.js.map +1 -1
  164. package/build/palette-edit/index.js +2 -2
  165. package/build/palette-edit/index.js.map +1 -1
  166. package/build/palette-edit/styles.js +11 -11
  167. package/build/palette-edit/styles.js.map +1 -1
  168. package/build/popover/index.js +6 -1
  169. package/build/popover/index.js.map +1 -1
  170. package/build/private-apis.js +10 -14
  171. package/build/private-apis.js.map +1 -1
  172. package/build/progress-bar/styles.js +5 -5
  173. package/build/progress-bar/styles.js.map +1 -1
  174. package/build/query-controls/index.js +5 -6
  175. package/build/query-controls/index.js.map +1 -1
  176. package/build/query-controls/types.js.map +1 -1
  177. package/build/radio-control/index.js +20 -19
  178. package/build/radio-control/index.js.map +1 -1
  179. package/build/radio-group/radio.js +3 -2
  180. package/build/radio-group/radio.js.map +1 -1
  181. package/build/range-control/index.js +32 -9
  182. package/build/range-control/index.js.map +1 -1
  183. package/build/range-control/styles/range-control-styles.js +31 -31
  184. package/build/range-control/styles/range-control-styles.js.map +1 -1
  185. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  186. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  187. package/build/search-control/index.js +5 -4
  188. package/build/search-control/index.js.map +1 -1
  189. package/build/select-control/index.js +1 -0
  190. package/build/select-control/index.js.map +1 -1
  191. package/build/select-control/styles/select-control-styles.js +12 -12
  192. package/build/select-control/styles/select-control-styles.js.map +1 -1
  193. package/build/slot-fill/bubbles-virtually/fill.js +4 -4
  194. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  195. package/build/snackbar/index.js +4 -4
  196. package/build/snackbar/index.js.map +1 -1
  197. package/build/tab-panel/index.js +3 -2
  198. package/build/tab-panel/index.js.map +1 -1
  199. package/build/tabs/index.js +7 -6
  200. package/build/tabs/index.js.map +1 -1
  201. package/build/tabs/styles.js +3 -3
  202. package/build/tabs/styles.js.map +1 -1
  203. package/build/tabs/tablist.js +6 -4
  204. package/build/tabs/tablist.js.map +1 -1
  205. package/build/tabs/tabpanel.js +6 -1
  206. package/build/tabs/tabpanel.js.map +1 -1
  207. package/build/text/styles.js +7 -7
  208. package/build/text/styles.js.map +1 -1
  209. package/build/text-control/index.js +1 -0
  210. package/build/text-control/index.js.map +1 -1
  211. package/build/textarea-control/index.js +1 -0
  212. package/build/textarea-control/index.js.map +1 -1
  213. package/build/textarea-control/styles/textarea-control-styles.js +8 -2
  214. package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
  215. package/build/toggle-control/index.js +9 -1
  216. package/build/toggle-control/index.js.map +1 -1
  217. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +3 -2
  218. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  219. package/build/toggle-group-control/toggle-group-control/component.js +1 -0
  220. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  221. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  222. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  223. package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
  224. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  225. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  226. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  227. package/build/tools-panel/styles.js +13 -13
  228. package/build/tools-panel/styles.js.map +1 -1
  229. package/build/tools-panel/tools-panel/hook.js +6 -6
  230. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  231. package/build/tooltip/index.js +3 -2
  232. package/build/tooltip/index.js.map +1 -1
  233. package/build/tree-select/index.js +19 -6
  234. package/build/tree-select/index.js.map +1 -1
  235. package/build/unit-control/styles/unit-control-styles.js +7 -7
  236. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  237. package/build/utils/config-values.js +10 -7
  238. package/build/utils/config-values.js.map +1 -1
  239. package/build/utils/hooks/use-update-effect.js +4 -4
  240. package/build/utils/hooks/use-update-effect.js.map +1 -1
  241. package/build-module/alignment-matrix-control/cell.js +4 -7
  242. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  243. package/build-module/alignment-matrix-control/icon.js +31 -19
  244. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  245. package/build-module/alignment-matrix-control/index.js +56 -50
  246. package/build-module/alignment-matrix-control/index.js.map +1 -1
  247. package/build-module/alignment-matrix-control/styles.js +70 -0
  248. package/build-module/alignment-matrix-control/styles.js.map +1 -0
  249. package/build-module/alignment-matrix-control/types.js.map +1 -1
  250. package/build-module/angle-picker-control/angle-circle.js +9 -9
  251. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  252. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +4 -4
  253. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  254. package/build-module/base-control/index.js +54 -42
  255. package/build-module/base-control/index.js.map +1 -1
  256. package/build-module/base-control/types.js.map +1 -1
  257. package/build-module/border-control/border-control/component.js +18 -13
  258. package/build-module/border-control/border-control/component.js.map +1 -1
  259. package/build-module/border-control/styles.js +13 -13
  260. package/build-module/border-control/styles.js.map +1 -1
  261. package/build-module/checkbox-control/index.js +1 -0
  262. package/build-module/checkbox-control/index.js.map +1 -1
  263. package/build-module/circular-option-picker/circular-option-picker-option.js +18 -12
  264. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  265. package/build-module/circular-option-picker/circular-option-picker.js +16 -13
  266. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  267. package/build-module/circular-option-picker/types.js.map +1 -1
  268. package/build-module/clipboard-button/index.js +6 -6
  269. package/build-module/clipboard-button/index.js.map +1 -1
  270. package/build-module/color-palette/utils.js +16 -5
  271. package/build-module/color-palette/utils.js.map +1 -1
  272. package/build-module/color-picker/color-copy-button.js +8 -8
  273. package/build-module/color-picker/color-copy-button.js.map +1 -1
  274. package/build-module/color-picker/hex-input.js +7 -8
  275. package/build-module/color-picker/hex-input.js.map +1 -1
  276. package/build-module/color-picker/input-with-slider.js +8 -8
  277. package/build-module/color-picker/input-with-slider.js.map +1 -1
  278. package/build-module/color-picker/styles.js +8 -8
  279. package/build-module/color-picker/styles.js.map +1 -1
  280. package/build-module/combobox-control/index.js +1 -0
  281. package/build-module/combobox-control/index.js.map +1 -1
  282. package/build-module/combobox-control/types.js.map +1 -1
  283. package/build-module/composite/context.js +12 -0
  284. package/build-module/composite/context.js.map +1 -0
  285. package/build-module/composite/group-label.js +25 -0
  286. package/build-module/composite/group-label.js.map +1 -0
  287. package/build-module/composite/group.js +25 -0
  288. package/build-module/composite/group.js.map +1 -0
  289. package/build-module/composite/hover.js +25 -0
  290. package/build-module/composite/hover.js.map +1 -0
  291. package/build-module/composite/index.js +239 -6
  292. package/build-module/composite/index.js.map +1 -1
  293. package/build-module/composite/item.js +25 -0
  294. package/build-module/composite/item.js.map +1 -0
  295. package/build-module/composite/legacy/index.js +11 -6
  296. package/build-module/composite/legacy/index.js.map +1 -1
  297. package/build-module/composite/row.js +25 -0
  298. package/build-module/composite/row.js.map +1 -0
  299. package/build-module/composite/store.js +46 -0
  300. package/build-module/composite/store.js.map +1 -0
  301. package/build-module/composite/typeahead.js +25 -0
  302. package/build-module/composite/typeahead.js.map +1 -0
  303. package/build-module/composite/types.js +2 -0
  304. package/build-module/composite/types.js.map +1 -0
  305. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  306. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  307. package/build-module/custom-select-control/types.js.map +1 -1
  308. package/build-module/custom-select-control-v2/custom-select.js +2 -1
  309. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  310. package/build-module/custom-select-control-v2/styles.js +12 -14
  311. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  312. package/build-module/date-time/date/styles.js +8 -8
  313. package/build-module/date-time/date/styles.js.map +1 -1
  314. package/build-module/date-time/time/index.js +11 -3
  315. package/build-module/date-time/time/index.js.map +1 -1
  316. package/build-module/date-time/time/time-input/index.js +17 -19
  317. package/build-module/date-time/time/time-input/index.js.map +1 -1
  318. package/build-module/date-time/types.js.map +1 -1
  319. package/build-module/dimension-control/index.js +31 -9
  320. package/build-module/dimension-control/index.js.map +1 -1
  321. package/build-module/dimension-control/types.js.map +1 -1
  322. package/build-module/draggable/index.js +4 -4
  323. package/build-module/draggable/index.js.map +1 -1
  324. package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
  325. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
  326. package/build-module/dropdown-menu-v2/context.js +11 -0
  327. package/build-module/dropdown-menu-v2/context.js.map +1 -0
  328. package/build-module/dropdown-menu-v2/group-label.js +32 -0
  329. package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
  330. package/build-module/dropdown-menu-v2/group.js +21 -0
  331. package/build-module/dropdown-menu-v2/group.js.map +1 -0
  332. package/build-module/dropdown-menu-v2/index.js +58 -144
  333. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  334. package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
  335. package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
  336. package/build-module/dropdown-menu-v2/item-label.js +19 -0
  337. package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
  338. package/build-module/dropdown-menu-v2/item.js +46 -0
  339. package/build-module/dropdown-menu-v2/item.js.map +1 -0
  340. package/build-module/dropdown-menu-v2/radio-item.js +72 -0
  341. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
  342. package/build-module/dropdown-menu-v2/separator.js +22 -0
  343. package/build-module/dropdown-menu-v2/separator.js.map +1 -0
  344. package/build-module/dropdown-menu-v2/styles.js +63 -85
  345. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  346. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  347. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
  348. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  349. package/build-module/focal-point-picker/controls.js +1 -3
  350. package/build-module/focal-point-picker/controls.js.map +1 -1
  351. package/build-module/focal-point-picker/index.js +1 -2
  352. package/build-module/focal-point-picker/index.js.map +1 -1
  353. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +11 -11
  354. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  355. package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
  356. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  357. package/build-module/focal-point-picker/types.js.map +1 -1
  358. package/build-module/form-file-upload/types.js.map +1 -1
  359. package/build-module/form-token-field/types.js.map +1 -1
  360. package/build-module/index.js +3 -2
  361. package/build-module/index.js.map +1 -1
  362. package/build-module/input-control/index.js +2 -2
  363. package/build-module/input-control/index.js.map +1 -1
  364. package/build-module/input-control/input-base.js +6 -11
  365. package/build-module/input-control/input-base.js.map +1 -1
  366. package/build-module/input-control/input-prefix-wrapper.js +4 -3
  367. package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
  368. package/build-module/input-control/input-suffix-wrapper.js +3 -3
  369. package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
  370. package/build-module/input-control/reducer/reducer.js +8 -8
  371. package/build-module/input-control/reducer/reducer.js.map +1 -1
  372. package/build-module/input-control/styles/input-control-styles.js +74 -44
  373. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  374. package/build-module/input-control/types.js.map +1 -1
  375. package/build-module/input-control/utils.js +3 -3
  376. package/build-module/input-control/utils.js.map +1 -1
  377. package/build-module/item-group/styles.js +11 -11
  378. package/build-module/item-group/styles.js.map +1 -1
  379. package/build-module/mobile/utils/alignments.native.js +1 -1
  380. package/build-module/mobile/utils/alignments.native.js.map +1 -1
  381. package/build-module/modal/index.js +5 -5
  382. package/build-module/modal/index.js.map +1 -1
  383. package/build-module/navigation/index.js +4 -4
  384. package/build-module/navigation/index.js.map +1 -1
  385. package/build-module/navigation/styles/navigation-styles.js +14 -14
  386. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  387. package/build-module/navigator/index.js +6 -6
  388. package/build-module/navigator/index.js.map +1 -1
  389. package/build-module/navigator/navigator-back-button/component.js +1 -1
  390. package/build-module/navigator/navigator-back-button/component.js.map +1 -1
  391. package/build-module/navigator/navigator-back-button/hook.js +4 -10
  392. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  393. package/build-module/navigator/navigator-button/hook.js +1 -1
  394. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  395. package/build-module/navigator/navigator-provider/component.js +116 -76
  396. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  397. package/build-module/navigator/navigator-to-parent-button/component.js +12 -41
  398. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  399. package/build-module/navigator/types.js.map +1 -1
  400. package/build-module/navigator/use-navigator.js +1 -2
  401. package/build-module/navigator/use-navigator.js.map +1 -1
  402. package/build-module/palette-edit/index.js +2 -2
  403. package/build-module/palette-edit/index.js.map +1 -1
  404. package/build-module/palette-edit/styles.js +11 -11
  405. package/build-module/palette-edit/styles.js.map +1 -1
  406. package/build-module/popover/index.js +6 -1
  407. package/build-module/popover/index.js.map +1 -1
  408. package/build-module/private-apis.js +10 -14
  409. package/build-module/private-apis.js.map +1 -1
  410. package/build-module/progress-bar/styles.js +5 -5
  411. package/build-module/progress-bar/styles.js.map +1 -1
  412. package/build-module/query-controls/index.js +5 -6
  413. package/build-module/query-controls/index.js.map +1 -1
  414. package/build-module/query-controls/types.js.map +1 -1
  415. package/build-module/radio-control/index.js +20 -19
  416. package/build-module/radio-control/index.js.map +1 -1
  417. package/build-module/radio-group/radio.js +2 -1
  418. package/build-module/radio-group/radio.js.map +1 -1
  419. package/build-module/range-control/index.js +32 -9
  420. package/build-module/range-control/index.js.map +1 -1
  421. package/build-module/range-control/styles/range-control-styles.js +32 -32
  422. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  423. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  424. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  425. package/build-module/search-control/index.js +5 -4
  426. package/build-module/search-control/index.js.map +1 -1
  427. package/build-module/select-control/index.js +1 -0
  428. package/build-module/select-control/index.js.map +1 -1
  429. package/build-module/select-control/styles/select-control-styles.js +13 -13
  430. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  431. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
  432. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  433. package/build-module/snackbar/index.js +4 -4
  434. package/build-module/snackbar/index.js.map +1 -1
  435. package/build-module/tab-panel/index.js +2 -1
  436. package/build-module/tab-panel/index.js.map +1 -1
  437. package/build-module/tabs/index.js +6 -5
  438. package/build-module/tabs/index.js.map +1 -1
  439. package/build-module/tabs/styles.js +4 -4
  440. package/build-module/tabs/styles.js.map +1 -1
  441. package/build-module/tabs/tablist.js +5 -3
  442. package/build-module/tabs/tablist.js.map +1 -1
  443. package/build-module/tabs/tabpanel.js +6 -2
  444. package/build-module/tabs/tabpanel.js.map +1 -1
  445. package/build-module/text/styles.js +7 -7
  446. package/build-module/text/styles.js.map +1 -1
  447. package/build-module/text-control/index.js +1 -0
  448. package/build-module/text-control/index.js.map +1 -1
  449. package/build-module/textarea-control/index.js +1 -0
  450. package/build-module/textarea-control/index.js.map +1 -1
  451. package/build-module/textarea-control/styles/textarea-control-styles.js +9 -2
  452. package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
  453. package/build-module/toggle-control/index.js +9 -1
  454. package/build-module/toggle-control/index.js.map +1 -1
  455. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +2 -1
  456. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  457. package/build-module/toggle-group-control/toggle-group-control/component.js +1 -0
  458. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  459. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  460. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  461. package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
  462. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  463. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  464. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  465. package/build-module/tools-panel/styles.js +13 -13
  466. package/build-module/tools-panel/styles.js.map +1 -1
  467. package/build-module/tools-panel/tools-panel/hook.js +6 -6
  468. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  469. package/build-module/tooltip/index.js +2 -1
  470. package/build-module/tooltip/index.js.map +1 -1
  471. package/build-module/tree-select/index.js +19 -6
  472. package/build-module/tree-select/index.js.map +1 -1
  473. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  474. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  475. package/build-module/utils/config-values.js +10 -7
  476. package/build-module/utils/config-values.js.map +1 -1
  477. package/build-module/utils/hooks/use-update-effect.js +4 -4
  478. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  479. package/build-style/style-rtl.css +30 -32
  480. package/build-style/style.css +30 -32
  481. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  482. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  483. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  484. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  485. package/build-types/alignment-matrix-control/index.d.ts +16 -6
  486. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  487. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  488. package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
  489. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
  490. package/build-types/alignment-matrix-control/types.d.ts +12 -1
  491. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  492. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  493. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  494. package/build-types/base-control/hooks.d.ts +1 -0
  495. package/build-types/base-control/hooks.d.ts.map +1 -1
  496. package/build-types/base-control/index.d.ts +44 -0
  497. package/build-types/base-control/index.d.ts.map +1 -1
  498. package/build-types/base-control/types.d.ts +7 -0
  499. package/build-types/base-control/types.d.ts.map +1 -1
  500. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  501. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  502. package/build-types/checkbox-control/index.d.ts.map +1 -1
  503. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  504. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  505. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  506. package/build-types/circular-option-picker/types.d.ts +2 -3
  507. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  508. package/build-types/color-palette/utils.d.ts.map +1 -1
  509. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  510. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  511. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  512. package/build-types/color-picker/styles.d.ts.map +1 -1
  513. package/build-types/combobox-control/index.d.ts.map +1 -1
  514. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  515. package/build-types/combobox-control/types.d.ts +1 -0
  516. package/build-types/combobox-control/types.d.ts.map +1 -1
  517. package/build-types/composite/context.d.ts +7 -0
  518. package/build-types/composite/context.d.ts.map +1 -0
  519. package/build-types/composite/group-label.d.ts +3 -0
  520. package/build-types/composite/group-label.d.ts.map +1 -0
  521. package/build-types/composite/group.d.ts +3 -0
  522. package/build-types/composite/group.d.ts.map +1 -0
  523. package/build-types/composite/hover.d.ts +3 -0
  524. package/build-types/composite/hover.d.ts.map +1 -0
  525. package/build-types/composite/index.d.ts +185 -1
  526. package/build-types/composite/index.d.ts.map +1 -1
  527. package/build-types/composite/item.d.ts +3 -0
  528. package/build-types/composite/item.d.ts.map +1 -0
  529. package/build-types/composite/legacy/index.d.ts +7 -5
  530. package/build-types/composite/legacy/index.d.ts.map +1 -1
  531. package/build-types/composite/legacy/stories/utils.d.ts +19 -0
  532. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  533. package/build-types/composite/row.d.ts +3 -0
  534. package/build-types/composite/row.d.ts.map +1 -0
  535. package/build-types/composite/store.d.ts +25 -0
  536. package/build-types/composite/store.d.ts.map +1 -0
  537. package/build-types/composite/stories/index.story.d.ts +14 -0
  538. package/build-types/composite/stories/index.story.d.ts.map +1 -0
  539. package/build-types/composite/stories/utils.d.ts +29 -0
  540. package/build-types/composite/stories/utils.d.ts.map +1 -0
  541. package/build-types/composite/typeahead.d.ts +3 -0
  542. package/build-types/composite/typeahead.d.ts.map +1 -0
  543. package/build-types/composite/types.d.ts +288 -0
  544. package/build-types/composite/types.d.ts.map +1 -0
  545. package/build-types/custom-select-control/types.d.ts +3 -3
  546. package/build-types/custom-select-control/types.d.ts.map +1 -1
  547. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  548. package/build-types/date-time/date-time/index.d.ts +1 -1
  549. package/build-types/date-time/time/index.d.ts +1 -1
  550. package/build-types/date-time/time/index.d.ts.map +1 -1
  551. package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
  552. package/build-types/date-time/types.d.ts +7 -1
  553. package/build-types/date-time/types.d.ts.map +1 -1
  554. package/build-types/dimension-control/index.d.ts +2 -1
  555. package/build-types/dimension-control/index.d.ts.map +1 -1
  556. package/build-types/dimension-control/stories/index.story.d.ts +13 -1
  557. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  558. package/build-types/dimension-control/types.d.ts +2 -7
  559. package/build-types/dimension-control/types.d.ts.map +1 -1
  560. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
  561. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
  562. package/build-types/dropdown-menu-v2/context.d.ts +6 -0
  563. package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
  564. package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
  565. package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
  566. package/build-types/dropdown-menu-v2/group.d.ts +3 -0
  567. package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
  568. package/build-types/dropdown-menu-v2/index.d.ts +39 -18
  569. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  570. package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
  571. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
  572. package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
  573. package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
  574. package/build-types/dropdown-menu-v2/item.d.ts +3 -0
  575. package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
  576. package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
  577. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
  578. package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
  579. package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
  580. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
  581. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  582. package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
  583. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  584. package/build-types/dropdown-menu-v2/types.d.ts +6 -0
  585. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  586. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
  587. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
  588. package/build-types/focal-point-picker/controls.d.ts +1 -1
  589. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  590. package/build-types/focal-point-picker/index.d.ts +1 -1
  591. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  592. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  593. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  594. package/build-types/focal-point-picker/types.d.ts +2 -2
  595. package/build-types/focal-point-picker/types.d.ts.map +1 -1
  596. package/build-types/form-file-upload/types.d.ts +6 -0
  597. package/build-types/form-file-upload/types.d.ts.map +1 -1
  598. package/build-types/form-token-field/types.d.ts +1 -0
  599. package/build-types/form-token-field/types.d.ts.map +1 -1
  600. package/build-types/index.d.ts +4 -2
  601. package/build-types/index.d.ts.map +1 -1
  602. package/build-types/input-control/input-base.d.ts.map +1 -1
  603. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
  604. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  605. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
  606. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  607. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  608. package/build-types/input-control/stories/index.story.d.ts +9 -0
  609. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  610. package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
  611. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  612. package/build-types/input-control/types.d.ts +23 -6
  613. package/build-types/input-control/types.d.ts.map +1 -1
  614. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  615. package/build-types/navigator/index.d.ts +6 -6
  616. package/build-types/navigator/index.d.ts.map +1 -1
  617. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  618. package/build-types/navigator/navigator-back-button/hook.d.ts +2 -2
  619. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  620. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  621. package/build-types/navigator/navigator-to-parent-button/component.d.ts +6 -0
  622. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  623. package/build-types/navigator/stories/index.story.d.ts +1 -1
  624. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  625. package/build-types/navigator/types.d.ts +47 -9
  626. package/build-types/navigator/types.d.ts.map +1 -1
  627. package/build-types/navigator/use-navigator.d.ts +1 -2
  628. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  629. package/build-types/popover/index.d.ts +1 -1
  630. package/build-types/popover/index.d.ts.map +1 -1
  631. package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
  632. package/build-types/private-apis.d.ts.map +1 -1
  633. package/build-types/query-controls/index.d.ts +1 -1
  634. package/build-types/query-controls/index.d.ts.map +1 -1
  635. package/build-types/query-controls/types.d.ts +2 -1
  636. package/build-types/query-controls/types.d.ts.map +1 -1
  637. package/build-types/radio-control/index.d.ts.map +1 -1
  638. package/build-types/radio-group/radio.d.ts.map +1 -1
  639. package/build-types/range-control/index.d.ts.map +1 -1
  640. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  641. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  642. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  643. package/build-types/search-control/index.d.ts.map +1 -1
  644. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  645. package/build-types/select-control/index.d.ts.map +1 -1
  646. package/build-types/select-control/stories/index.story.d.ts +4 -2
  647. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  648. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  649. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  650. package/build-types/tab-panel/index.d.ts.map +1 -1
  651. package/build-types/tabs/index.d.ts.map +1 -1
  652. package/build-types/tabs/styles.d.ts.map +1 -1
  653. package/build-types/tabs/tablist.d.ts.map +1 -1
  654. package/build-types/tabs/tabpanel.d.ts +0 -3
  655. package/build-types/tabs/tabpanel.d.ts.map +1 -1
  656. package/build-types/text-control/index.d.ts.map +1 -1
  657. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  658. package/build-types/textarea-control/index.d.ts.map +1 -1
  659. package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
  660. package/build-types/toggle-control/index.d.ts.map +1 -1
  661. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  662. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  663. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  664. package/build-types/tooltip/index.d.ts.map +1 -1
  665. package/build-types/tree-select/index.d.ts.map +1 -1
  666. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  667. package/build-types/utils/config-values.d.ts +7 -6
  668. package/package.json +20 -20
  669. package/src/alignment-matrix-control/README.md +1 -5
  670. package/src/alignment-matrix-control/cell.tsx +6 -12
  671. package/src/alignment-matrix-control/icon.tsx +48 -30
  672. package/src/alignment-matrix-control/index.tsx +61 -50
  673. package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
  674. package/src/alignment-matrix-control/styles.ts +113 -0
  675. package/src/alignment-matrix-control/types.ts +12 -1
  676. package/src/angle-picker-control/angle-circle.tsx +11 -9
  677. package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +2 -2
  678. package/src/base-control/README.md +5 -2
  679. package/src/base-control/index.tsx +61 -41
  680. package/src/base-control/types.ts +7 -0
  681. package/src/border-box-control/border-box-control/README.md +7 -0
  682. package/src/border-control/border-control/README.md +7 -0
  683. package/src/border-control/border-control/component.tsx +23 -16
  684. package/src/border-control/styles.ts +1 -1
  685. package/src/button/README.md +7 -0
  686. package/src/button/style.scss +2 -2
  687. package/src/button-group/style.scss +2 -2
  688. package/src/checkbox-control/index.tsx +1 -0
  689. package/src/checkbox-control/stories/index.story.tsx +1 -0
  690. package/src/checkbox-control/test/index.tsx +8 -1
  691. package/src/circular-option-picker/circular-option-picker-option.tsx +19 -20
  692. package/src/circular-option-picker/circular-option-picker.tsx +26 -12
  693. package/src/circular-option-picker/style.scss +3 -3
  694. package/src/circular-option-picker/types.ts +2 -3
  695. package/src/clipboard-button/index.tsx +6 -6
  696. package/src/color-indicator/style.scss +1 -1
  697. package/src/color-palette/style.scss +2 -2
  698. package/src/color-palette/test/utils.ts +21 -2
  699. package/src/color-palette/utils.ts +22 -11
  700. package/src/color-picker/color-copy-button.tsx +10 -8
  701. package/src/color-picker/hex-input.tsx +6 -10
  702. package/src/color-picker/input-with-slider.tsx +7 -10
  703. package/src/color-picker/styles.ts +1 -1
  704. package/src/combobox-control/README.md +8 -0
  705. package/src/combobox-control/index.tsx +1 -0
  706. package/src/combobox-control/stories/index.story.tsx +3 -4
  707. package/src/combobox-control/test/index.tsx +5 -1
  708. package/src/combobox-control/types.ts +1 -0
  709. package/src/composite/README.md +325 -0
  710. package/src/composite/context.ts +14 -0
  711. package/src/composite/group-label.tsx +30 -0
  712. package/src/composite/group.tsx +30 -0
  713. package/src/composite/hover.tsx +30 -0
  714. package/src/composite/index.tsx +257 -0
  715. package/src/composite/item.tsx +30 -0
  716. package/src/composite/legacy/index.tsx +16 -14
  717. package/src/composite/legacy/stories/utils.tsx +19 -0
  718. package/src/composite/row.tsx +30 -0
  719. package/src/composite/store.ts +46 -0
  720. package/src/composite/stories/index.story.tsx +339 -0
  721. package/src/composite/{current/stories → stories}/utils.tsx +22 -7
  722. package/src/composite/typeahead.tsx +30 -0
  723. package/src/composite/types.ts +298 -0
  724. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
  725. package/src/custom-gradient-picker/style.scss +3 -22
  726. package/src/custom-select-control/README.md +7 -0
  727. package/src/custom-select-control/test/index.tsx +125 -0
  728. package/src/custom-select-control/types.ts +3 -3
  729. package/src/custom-select-control-v2/custom-select.tsx +2 -1
  730. package/src/custom-select-control-v2/styles.ts +4 -4
  731. package/src/date-time/date/styles.ts +2 -2
  732. package/src/date-time/time/index.tsx +26 -12
  733. package/src/date-time/time/test/index.tsx +3 -6
  734. package/src/date-time/time/time-input/index.tsx +25 -25
  735. package/src/date-time/time/time-input/test/index.tsx +6 -7
  736. package/src/date-time/types.ts +11 -1
  737. package/src/dimension-control/README.md +21 -0
  738. package/src/dimension-control/index.tsx +33 -10
  739. package/src/dimension-control/stories/index.story.tsx +8 -2
  740. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -32
  741. package/src/dimension-control/test/index.test.js +6 -1
  742. package/src/dimension-control/types.ts +5 -7
  743. package/src/draggable/index.tsx +4 -4
  744. package/src/drop-zone/style.scss +1 -1
  745. package/src/dropdown-menu-v2/README.md +73 -60
  746. package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
  747. package/src/dropdown-menu-v2/context.tsx +13 -0
  748. package/src/dropdown-menu-v2/group-label.tsx +37 -0
  749. package/src/dropdown-menu-v2/group.tsx +26 -0
  750. package/src/dropdown-menu-v2/index.tsx +61 -199
  751. package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
  752. package/src/dropdown-menu-v2/item-label.tsx +23 -0
  753. package/src/dropdown-menu-v2/item.tsx +50 -0
  754. package/src/dropdown-menu-v2/radio-item.tsx +70 -0
  755. package/src/dropdown-menu-v2/separator.tsx +27 -0
  756. package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
  757. package/src/dropdown-menu-v2/styles.ts +118 -80
  758. package/src/dropdown-menu-v2/test/index.tsx +159 -132
  759. package/src/dropdown-menu-v2/types.ts +7 -0
  760. package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
  761. package/src/focal-point-picker/README.md +9 -1
  762. package/src/focal-point-picker/controls.tsx +1 -3
  763. package/src/focal-point-picker/index.tsx +1 -2
  764. package/src/focal-point-picker/stories/index.story.tsx +3 -0
  765. package/src/focal-point-picker/styles/focal-point-picker-style.ts +1 -1
  766. package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
  767. package/src/focal-point-picker/test/index.tsx +5 -1
  768. package/src/focal-point-picker/types.ts +2 -2
  769. package/src/font-size-picker/README.md +7 -0
  770. package/src/form-file-upload/README.md +8 -0
  771. package/src/form-file-upload/types.ts +6 -0
  772. package/src/form-toggle/style.scss +1 -1
  773. package/src/form-token-field/README.md +1 -0
  774. package/src/form-token-field/style.scss +2 -3
  775. package/src/form-token-field/types.ts +1 -0
  776. package/src/guide/style.scss +0 -1
  777. package/src/index.ts +6 -2
  778. package/src/input-control/README.md +8 -0
  779. package/src/input-control/index.tsx +2 -2
  780. package/src/input-control/input-base.tsx +4 -14
  781. package/src/input-control/input-prefix-wrapper.tsx +8 -4
  782. package/src/input-control/input-suffix-wrapper.tsx +4 -6
  783. package/src/input-control/reducer/reducer.ts +13 -10
  784. package/src/input-control/stories/index.story.tsx +31 -12
  785. package/src/input-control/styles/input-control-styles.tsx +42 -11
  786. package/src/input-control/types.ts +23 -7
  787. package/src/input-control/utils.ts +3 -3
  788. package/src/item-group/styles.ts +4 -4
  789. package/src/item-group/test/__snapshots__/index.js.snap +3 -3
  790. package/src/mobile/utils/alignments.native.js +1 -0
  791. package/src/modal/index.tsx +5 -5
  792. package/src/modal/style.scss +8 -7
  793. package/src/navigation/index.tsx +4 -4
  794. package/src/navigation/styles/navigation-styles.tsx +3 -3
  795. package/src/navigator/index.ts +6 -6
  796. package/src/navigator/navigator-back-button/component.tsx +1 -1
  797. package/src/navigator/navigator-back-button/hook.ts +7 -11
  798. package/src/navigator/navigator-button/hook.ts +1 -1
  799. package/src/navigator/navigator-provider/README.md +37 -36
  800. package/src/navigator/navigator-provider/component.tsx +110 -89
  801. package/src/navigator/navigator-screen/README.md +13 -1
  802. package/src/navigator/navigator-to-parent-button/README.md +2 -0
  803. package/src/navigator/navigator-to-parent-button/component.tsx +14 -43
  804. package/src/navigator/stories/index.story.tsx +82 -253
  805. package/src/navigator/test/index.tsx +136 -6
  806. package/src/navigator/types.ts +47 -10
  807. package/src/navigator/use-navigator.ts +1 -3
  808. package/src/number-control/README.md +8 -0
  809. package/src/palette-edit/index.tsx +2 -2
  810. package/src/palette-edit/styles.ts +5 -5
  811. package/src/placeholder/style.scss +4 -1
  812. package/src/popover/index.tsx +9 -3
  813. package/src/popover/style.scss +2 -2
  814. package/src/popover/test/index.tsx +34 -0
  815. package/src/private-apis.ts +10 -29
  816. package/src/progress-bar/styles.ts +2 -2
  817. package/src/query-controls/README.md +7 -0
  818. package/src/query-controls/index.tsx +5 -6
  819. package/src/query-controls/types.ts +2 -1
  820. package/src/radio-control/index.tsx +28 -20
  821. package/src/radio-control/style.scss +13 -2
  822. package/src/radio-control/test/index.tsx +43 -40
  823. package/src/radio-group/radio.tsx +2 -1
  824. package/src/range-control/README.md +7 -0
  825. package/src/range-control/index.tsx +39 -9
  826. package/src/range-control/stories/index.story.tsx +7 -0
  827. package/src/range-control/styles/range-control-styles.ts +9 -9
  828. package/src/range-control/test/index.tsx +54 -14
  829. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
  830. package/src/resizable-box/style.scss +2 -2
  831. package/src/search-control/index.tsx +7 -4
  832. package/src/search-control/stories/index.story.tsx +1 -0
  833. package/src/search-control/test/index.tsx +1 -0
  834. package/src/select-control/README.md +8 -0
  835. package/src/select-control/index.tsx +1 -0
  836. package/src/select-control/stories/index.story.tsx +8 -5
  837. package/src/select-control/styles/select-control-styles.ts +5 -5
  838. package/src/select-control/test/select-control.tsx +12 -6
  839. package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
  840. package/src/snackbar/index.tsx +4 -4
  841. package/src/snackbar/style.scss +2 -2
  842. package/src/tab-panel/index.tsx +4 -1
  843. package/src/tab-panel/style.scss +1 -2
  844. package/src/tabs/index.tsx +10 -5
  845. package/src/tabs/styles.ts +2 -3
  846. package/src/tabs/tablist.tsx +6 -4
  847. package/src/tabs/tabpanel.tsx +6 -2
  848. package/src/text/styles.ts +1 -1
  849. package/src/text-control/README.md +8 -0
  850. package/src/text-control/index.tsx +1 -0
  851. package/src/text-control/stories/index.story.tsx +3 -1
  852. package/src/text-control/style.scss +3 -2
  853. package/src/text-control/test/text-control.tsx +5 -1
  854. package/src/textarea-control/index.tsx +1 -0
  855. package/src/textarea-control/stories/index.story.tsx +2 -0
  856. package/src/textarea-control/styles/textarea-control-styles.ts +75 -2
  857. package/src/toggle-control/index.tsx +9 -0
  858. package/src/toggle-control/stories/index.story.tsx +1 -0
  859. package/src/toggle-control/test/index.tsx +7 -1
  860. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +8 -24
  861. package/src/toggle-group-control/test/index.tsx +5 -1
  862. package/src/toggle-group-control/toggle-group-control/README.md +7 -0
  863. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +2 -1
  864. package/src/toggle-group-control/toggle-group-control/component.tsx +1 -0
  865. package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
  866. package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
  867. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +2 -2
  868. package/src/toolbar/toolbar/style.scss +2 -2
  869. package/src/tools-panel/styles.ts +1 -1
  870. package/src/tools-panel/tools-panel/hook.ts +6 -6
  871. package/src/tooltip/index.tsx +2 -1
  872. package/src/tooltip/style.scss +1 -1
  873. package/src/tree-select/index.tsx +16 -5
  874. package/src/tree-select/stories/index.story.tsx +1 -0
  875. package/src/unit-control/README.md +7 -0
  876. package/src/unit-control/styles/unit-control-styles.ts +3 -2
  877. package/src/utils/config-values.js +10 -7
  878. package/src/utils/hooks/use-update-effect.js +4 -4
  879. package/tsconfig.tsbuildinfo +1 -1
  880. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
  881. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  882. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -86
  883. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  884. package/build/composite/current/index.js +0 -43
  885. package/build/composite/current/index.js.map +0 -1
  886. package/build/composite/v2.js +0 -17
  887. package/build/composite/v2.js.map +0 -1
  888. package/build/navigator/navigator-back-button/index.js +0 -14
  889. package/build/navigator/navigator-back-button/index.js.map +0 -1
  890. package/build/navigator/navigator-button/index.js +0 -14
  891. package/build/navigator/navigator-button/index.js.map +0 -1
  892. package/build/navigator/navigator-provider/index.js +0 -14
  893. package/build/navigator/navigator-provider/index.js.map +0 -1
  894. package/build/navigator/navigator-screen/index.js +0 -14
  895. package/build/navigator/navigator-screen/index.js.map +0 -1
  896. package/build/navigator/navigator-to-parent-button/index.js +0 -14
  897. package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
  898. package/build/utils/input/base.js +0 -20
  899. package/build/utils/input/base.js.map +0 -1
  900. package/build/utils/input/index.js +0 -17
  901. package/build/utils/input/index.js.map +0 -1
  902. package/build/utils/input/input-control.js +0 -21
  903. package/build/utils/input/input-control.js.map +0 -1
  904. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
  905. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  906. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -81
  907. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  908. package/build-module/composite/current/index.js +0 -12
  909. package/build-module/composite/current/index.js.map +0 -1
  910. package/build-module/composite/v2.js +0 -5
  911. package/build-module/composite/v2.js.map +0 -1
  912. package/build-module/navigator/navigator-back-button/index.js +0 -2
  913. package/build-module/navigator/navigator-back-button/index.js.map +0 -1
  914. package/build-module/navigator/navigator-button/index.js +0 -2
  915. package/build-module/navigator/navigator-button/index.js.map +0 -1
  916. package/build-module/navigator/navigator-provider/index.js +0 -2
  917. package/build-module/navigator/navigator-provider/index.js.map +0 -1
  918. package/build-module/navigator/navigator-screen/index.js +0 -2
  919. package/build-module/navigator/navigator-screen/index.js.map +0 -1
  920. package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
  921. package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
  922. package/build-module/utils/input/base.js +0 -13
  923. package/build-module/utils/input/base.js.map +0 -1
  924. package/build-module/utils/input/index.js +0 -2
  925. package/build-module/utils/input/index.js.map +0 -1
  926. package/build-module/utils/input/input-control.js +0 -14
  927. package/build-module/utils/input/input-control.js.map +0 -1
  928. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
  929. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
  930. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
  931. package/build-types/composite/current/index.d.ts +0 -12
  932. package/build-types/composite/current/index.d.ts.map +0 -1
  933. package/build-types/composite/current/stories/index.story.d.ts +0 -13
  934. package/build-types/composite/current/stories/index.story.d.ts.map +0 -1
  935. package/build-types/composite/current/stories/utils.d.ts +0 -14
  936. package/build-types/composite/current/stories/utils.d.ts.map +0 -1
  937. package/build-types/composite/v2.d.ts +0 -2
  938. package/build-types/composite/v2.d.ts.map +0 -1
  939. package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
  940. package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
  941. package/build-types/navigator/navigator-button/index.d.ts +0 -2
  942. package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
  943. package/build-types/navigator/navigator-provider/index.d.ts +0 -2
  944. package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
  945. package/build-types/navigator/navigator-screen/index.d.ts +0 -2
  946. package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
  947. package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
  948. package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
  949. package/build-types/utils/input/base.d.ts +0 -3
  950. package/build-types/utils/input/base.d.ts.map +0 -1
  951. package/build-types/utils/input/index.d.ts +0 -2
  952. package/build-types/utils/input/index.d.ts.map +0 -1
  953. package/build-types/utils/input/input-control.d.ts +0 -2
  954. package/build-types/utils/input/input-control.d.ts.map +0 -1
  955. package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
  956. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
  957. package/src/composite/current/index.ts +0 -20
  958. package/src/composite/current/stories/index.story.tsx +0 -86
  959. package/src/composite/index.ts +0 -7
  960. package/src/composite/v2.ts +0 -4
  961. package/src/navigator/navigator-back-button/index.ts +0 -1
  962. package/src/navigator/navigator-button/index.ts +0 -1
  963. package/src/navigator/navigator-provider/index.ts +0 -1
  964. package/src/navigator/navigator-screen/index.ts +0 -1
  965. package/src/navigator/navigator-to-parent-button/index.ts +0 -1
  966. package/src/utils/input/base.js +0 -30
  967. package/src/utils/input/index.js +0 -1
  968. package/src/utils/input/input-control.js +0 -63
@@ -8,7 +8,7 @@ exports.useNavigatorBackButton = useNavigatorBackButton;
8
8
  var _element = require("@wordpress/element");
9
9
  var _context = require("../../context");
10
10
  var _button = _interopRequireDefault(require("../../button"));
11
- var _useNavigator = _interopRequireDefault(require("../use-navigator"));
11
+ var _useNavigator = require("../use-navigator");
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
@@ -21,22 +21,16 @@ function useNavigatorBackButton(props) {
21
21
  const {
22
22
  onClick,
23
23
  as = _button.default,
24
- goToParent: goToParentProp = false,
25
24
  ...otherProps
26
25
  } = (0, _context.useContextSystem)(props, 'NavigatorBackButton');
27
26
  const {
28
- goBack,
29
- goToParent
30
- } = (0, _useNavigator.default)();
27
+ goBack
28
+ } = (0, _useNavigator.useNavigator)();
31
29
  const handleClick = (0, _element.useCallback)(e => {
32
30
  e.preventDefault();
33
- if (goToParentProp) {
34
- goToParent();
35
- } else {
36
- goBack();
37
- }
31
+ goBack();
38
32
  onClick?.(e);
39
- }, [goToParentProp, goToParent, goBack, onClick]);
33
+ }, [goBack, onClick]);
40
34
  return {
41
35
  as,
42
36
  onClick: handleClick,
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_context","_button","_interopRequireDefault","_useNavigator","useNavigatorBackButton","props","onClick","as","Button","goToParent","goToParentProp","otherProps","useContextSystem","goBack","useNavigator","handleClick","useCallback","e","preventDefault"],"sources":["@wordpress/components/src/navigator/navigator-back-button/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport Button from '../../button';\nimport useNavigator from '../use-navigator';\nimport type { NavigatorBackButtonHookProps } from '../types';\n\nexport function useNavigatorBackButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonHookProps, 'button' >\n) {\n\tconst {\n\t\tonClick,\n\t\tas = Button,\n\t\tgoToParent: goToParentProp = false,\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorBackButton' );\n\n\tconst { goBack, goToParent } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tif ( goToParentProp ) {\n\t\t\t\t\tgoToParent();\n\t\t\t\t} else {\n\t\t\t\t\tgoBack();\n\t\t\t\t}\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goToParentProp, goToParent, goBack, onClick ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAOO,SAASK,sBAAsBA,CACrCC,KAAwE,EACvE;EACD,MAAM;IACLC,OAAO;IACPC,EAAE,GAAGC,eAAM;IACXC,UAAU,EAAEC,cAAc,GAAG,KAAK;IAClC,GAAGC;EACJ,CAAC,GAAG,IAAAC,yBAAgB,EAAEP,KAAK,EAAE,qBAAsB,CAAC;EAEpD,MAAM;IAAEQ,MAAM;IAAEJ;EAAW,CAAC,GAAG,IAAAK,qBAAY,EAAC,CAAC;EAC7C,MAAMC,WAAyD,GAC9D,IAAAC,oBAAW,EACRC,CAAC,IAAM;IACRA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClB,IAAKR,cAAc,EAAG;MACrBD,UAAU,CAAC,CAAC;IACb,CAAC,MAAM;MACNI,MAAM,CAAC,CAAC;IACT;IACAP,OAAO,GAAIW,CAAE,CAAC;EACf,CAAC,EACD,CAAEP,cAAc,EAAED,UAAU,EAAEI,MAAM,EAAEP,OAAO,CAC9C,CAAC;EAEF,OAAO;IACNC,EAAE;IACFD,OAAO,EAAES,WAAW;IACpB,GAAGJ;EACJ,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_context","_button","_interopRequireDefault","_useNavigator","useNavigatorBackButton","props","onClick","as","Button","otherProps","useContextSystem","goBack","useNavigator","handleClick","useCallback","e","preventDefault"],"sources":["@wordpress/components/src/navigator/navigator-back-button/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport Button from '../../button';\nimport { useNavigator } from '../use-navigator';\nimport type { NavigatorBackButtonProps } from '../types';\n\nexport function useNavigatorBackButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonProps, 'button' >\n) {\n\tconst {\n\t\tonClick,\n\t\tas = Button,\n\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorBackButton' );\n\n\tconst { goBack } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoBack();\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goBack, onClick ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAOO,SAASK,sBAAsBA,CACrCC,KAAoE,EACnE;EACD,MAAM;IACLC,OAAO;IACPC,EAAE,GAAGC,eAAM;IAEX,GAAGC;EACJ,CAAC,GAAG,IAAAC,yBAAgB,EAAEL,KAAK,EAAE,qBAAsB,CAAC;EAEpD,MAAM;IAAEM;EAAO,CAAC,GAAG,IAAAC,0BAAY,EAAC,CAAC;EACjC,MAAMC,WAAyD,GAC9D,IAAAC,oBAAW,EACRC,CAAC,IAAM;IACRA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClBL,MAAM,CAAC,CAAC;IACRL,OAAO,GAAIS,CAAE,CAAC;EACf,CAAC,EACD,CAAEJ,MAAM,EAAEL,OAAO,CAClB,CAAC;EAEF,OAAO;IACNC,EAAE;IACFD,OAAO,EAAEO,WAAW;IACpB,GAAGJ;EACJ,CAAC;AACF","ignoreList":[]}
@@ -9,7 +9,7 @@ var _element = require("@wordpress/element");
9
9
  var _escapeHtml = require("@wordpress/escape-html");
10
10
  var _context = require("../../context");
11
11
  var _button = _interopRequireDefault(require("../../button"));
12
- var _useNavigator = _interopRequireDefault(require("../use-navigator"));
12
+ var _useNavigator = require("../use-navigator");
13
13
  /**
14
14
  * WordPress dependencies
15
15
  */
@@ -30,7 +30,7 @@ function useNavigatorButton(props) {
30
30
  const escapedPath = (0, _escapeHtml.escapeAttribute)(path);
31
31
  const {
32
32
  goTo
33
- } = (0, _useNavigator.default)();
33
+ } = (0, _useNavigator.useNavigator)();
34
34
  const handleClick = (0, _element.useCallback)(e => {
35
35
  e.preventDefault();
36
36
  goTo(escapedPath, {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_escapeHtml","_context","_button","_interopRequireDefault","_useNavigator","cssSelectorForAttribute","attrName","attrValue","useNavigatorButton","props","path","onClick","as","Button","attributeName","otherProps","useContextSystem","escapedPath","escapeAttribute","goTo","useNavigator","handleClick","useCallback","e","preventDefault","focusTargetSelector"],"sources":["@wordpress/components/src/navigator/navigator-button/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport Button from '../../button';\nimport useNavigator from '../use-navigator';\nimport type { NavigatorButtonProps } from '../types';\n\nconst cssSelectorForAttribute = ( attrName: string, attrValue: string ) =>\n\t`[${ attrName }=\"${ attrValue }\"]`;\n\nexport function useNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >\n) {\n\tconst {\n\t\tpath,\n\t\tonClick,\n\t\tas = Button,\n\t\tattributeName = 'id',\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorButton' );\n\n\tconst escapedPath = escapeAttribute( path );\n\n\tconst { goTo } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoTo( escapedPath, {\n\t\t\t\t\tfocusTargetSelector: cssSelectorForAttribute(\n\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\tescapedPath\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goTo, onClick, attributeName, escapedPath ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t\t[ attributeName ]: escapedPath,\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAZA;AACA;AACA;;AAIA;AACA;AACA;;AAOA,MAAMM,uBAAuB,GAAGA,CAAEC,QAAgB,EAAEC,SAAiB,KACnE,IAAID,QAAU,KAAKC,SAAW,IAAG;AAE5B,SAASC,kBAAkBA,CACjCC,KAAgE,EAC/D;EACD,MAAM;IACLC,IAAI;IACJC,OAAO;IACPC,EAAE,GAAGC,eAAM;IACXC,aAAa,GAAG,IAAI;IACpB,GAAGC;EACJ,CAAC,GAAG,IAAAC,yBAAgB,EAAEP,KAAK,EAAE,iBAAkB,CAAC;EAEhD,MAAMQ,WAAW,GAAG,IAAAC,2BAAe,EAAER,IAAK,CAAC;EAE3C,MAAM;IAAES;EAAK,CAAC,GAAG,IAAAC,qBAAY,EAAC,CAAC;EAC/B,MAAMC,WAAyD,GAC9D,IAAAC,oBAAW,EACRC,CAAC,IAAM;IACRA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClBL,IAAI,CAAEF,WAAW,EAAE;MAClBQ,mBAAmB,EAAEpB,uBAAuB,CAC3CS,aAAa,EACbG,WACD;IACD,CAAE,CAAC;IACHN,OAAO,GAAIY,CAAE,CAAC;EACf,CAAC,EACD,CAAEJ,IAAI,EAAER,OAAO,EAAEG,aAAa,EAAEG,WAAW,CAC5C,CAAC;EAEF,OAAO;IACNL,EAAE;IACFD,OAAO,EAAEU,WAAW;IACpB,GAAGN,UAAU;IACb,CAAED,aAAa,GAAIG;EACpB,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_escapeHtml","_context","_button","_interopRequireDefault","_useNavigator","cssSelectorForAttribute","attrName","attrValue","useNavigatorButton","props","path","onClick","as","Button","attributeName","otherProps","useContextSystem","escapedPath","escapeAttribute","goTo","useNavigator","handleClick","useCallback","e","preventDefault","focusTargetSelector"],"sources":["@wordpress/components/src/navigator/navigator-button/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport Button from '../../button';\nimport { useNavigator } from '../use-navigator';\nimport type { NavigatorButtonProps } from '../types';\n\nconst cssSelectorForAttribute = ( attrName: string, attrValue: string ) =>\n\t`[${ attrName }=\"${ attrValue }\"]`;\n\nexport function useNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >\n) {\n\tconst {\n\t\tpath,\n\t\tonClick,\n\t\tas = Button,\n\t\tattributeName = 'id',\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorButton' );\n\n\tconst escapedPath = escapeAttribute( path );\n\n\tconst { goTo } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoTo( escapedPath, {\n\t\t\t\t\tfocusTargetSelector: cssSelectorForAttribute(\n\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\tescapedPath\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goTo, onClick, attributeName, escapedPath ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t\t[ attributeName ]: escapedPath,\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAIA;AACA;AACA;;AAOA,MAAMM,uBAAuB,GAAGA,CAAEC,QAAgB,EAAEC,SAAiB,KACnE,IAAID,QAAU,KAAKC,SAAW,IAAG;AAE5B,SAASC,kBAAkBA,CACjCC,KAAgE,EAC/D;EACD,MAAM;IACLC,IAAI;IACJC,OAAO;IACPC,EAAE,GAAGC,eAAM;IACXC,aAAa,GAAG,IAAI;IACpB,GAAGC;EACJ,CAAC,GAAG,IAAAC,yBAAgB,EAAEP,KAAK,EAAE,iBAAkB,CAAC;EAEhD,MAAMQ,WAAW,GAAG,IAAAC,2BAAe,EAAER,IAAK,CAAC;EAE3C,MAAM;IAAES;EAAK,CAAC,GAAG,IAAAC,0BAAY,EAAC,CAAC;EAC/B,MAAMC,WAAyD,GAC9D,IAAAC,oBAAW,EACRC,CAAC,IAAM;IACRA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClBL,IAAI,CAAEF,WAAW,EAAE;MAClBQ,mBAAmB,EAAEpB,uBAAuB,CAC3CS,aAAa,EACbG,WACD;IACD,CAAE,CAAC;IACHN,OAAO,GAAIY,CAAE,CAAC;EACf,CAAC,EACD,CAAEJ,IAAI,EAAER,OAAO,EAAEG,aAAa,EAAEG,WAAW,CAC5C,CAAC;EAEF,OAAO;IACNL,EAAE;IACFD,OAAO,EAAEU,WAAW;IACpB,GAAGN,UAAU;IACb,CAAED,aAAa,GAAIG;EACpB,CAAC;AACF","ignoreList":[]}
@@ -7,12 +7,14 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = exports.NavigatorProvider = void 0;
8
8
  var _element = require("@wordpress/element");
9
9
  var _isShallowEqual = _interopRequireDefault(require("@wordpress/is-shallow-equal"));
10
+ var _warning = _interopRequireDefault(require("@wordpress/warning"));
10
11
  var _context = require("../../context");
11
12
  var _useCx = require("../../utils/hooks/use-cx");
12
13
  var _router = require("../utils/router");
13
14
  var _view = require("../../view");
14
15
  var _context2 = require("../context");
15
16
  var styles = _interopRequireWildcard(require("../styles"));
17
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
16
18
  var _jsxRuntime = require("react/jsx-runtime");
17
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
20
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -28,10 +30,14 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
28
30
  * Internal dependencies
29
31
  */
30
32
 
31
- const MAX_HISTORY_LENGTH = 50;
32
33
  function addScreen({
33
34
  screens
34
35
  }, screen) {
36
+ if (screens.some(s => s.path === screen.path)) {
37
+ globalThis.SCRIPT_DEBUG === true ? (0, _warning.default)(`Navigator: a screen with path ${screen.path} already exists.
38
+ The screen with id ${screen.id} will not be added.`) : void 0;
39
+ return screens;
40
+ }
35
41
  return [...screens, screen];
36
42
  }
37
43
  function removeScreen({
@@ -39,72 +45,89 @@ function removeScreen({
39
45
  }, screen) {
40
46
  return screens.filter(s => s.id !== screen.id);
41
47
  }
42
- function goBack({
43
- locationHistory
44
- }) {
45
- if (locationHistory.length <= 1) {
46
- return locationHistory;
47
- }
48
- return [...locationHistory.slice(0, -2), {
49
- ...locationHistory[locationHistory.length - 2],
50
- isBack: true,
51
- hasRestoredFocus: false
52
- }];
53
- }
54
48
  function goTo(state, path, options = {}) {
49
+ var _focusSelectorsCopy2;
55
50
  const {
56
- locationHistory
51
+ focusSelectors
57
52
  } = state;
53
+ const currentLocation = {
54
+ ...state.currentLocation,
55
+ isInitial: false
56
+ };
58
57
  const {
59
- focusTargetSelector,
58
+ // Default assignments
60
59
  isBack = false,
61
60
  skipFocus = false,
62
- replace = false,
61
+ // Extract to avoid forwarding
62
+ replace,
63
+ focusTargetSelector,
64
+ // Rest
63
65
  ...restOptions
64
66
  } = options;
65
- const isNavigatingToSamePath = locationHistory.length > 0 && locationHistory[locationHistory.length - 1].path === path;
66
- if (isNavigatingToSamePath) {
67
- return locationHistory;
67
+ if (currentLocation.path === path) {
68
+ return {
69
+ currentLocation,
70
+ focusSelectors
71
+ };
68
72
  }
69
- const isNavigatingToPreviousPath = isBack && locationHistory.length > 1 && locationHistory[locationHistory.length - 2].path === path;
70
- if (isNavigatingToPreviousPath) {
71
- return goBack(state);
73
+ let focusSelectorsCopy;
74
+ function getFocusSelectorsCopy() {
75
+ var _focusSelectorsCopy;
76
+ focusSelectorsCopy = (_focusSelectorsCopy = focusSelectorsCopy) !== null && _focusSelectorsCopy !== void 0 ? _focusSelectorsCopy : new Map(state.focusSelectors);
77
+ return focusSelectorsCopy;
72
78
  }
73
- const newLocation = {
74
- ...restOptions,
75
- path,
76
- isBack,
77
- hasRestoredFocus: false,
78
- skipFocus
79
- };
80
- if (locationHistory.length === 0) {
81
- return replace ? [] : [newLocation];
79
+
80
+ // Set a focus selector that will be used when navigating
81
+ // back to the current location.
82
+ if (focusTargetSelector && currentLocation.path) {
83
+ getFocusSelectorsCopy().set(currentLocation.path, focusTargetSelector);
82
84
  }
83
- const newLocationHistory = locationHistory.slice(locationHistory.length > MAX_HISTORY_LENGTH - 1 ? 1 : 0, -1);
84
- if (!replace) {
85
- newLocationHistory.push(
86
- // Assign `focusTargetSelector` to the previous location in history
87
- // (the one we just navigated from).
88
- {
89
- ...locationHistory[locationHistory.length - 1],
90
- focusTargetSelector
91
- });
85
+
86
+ // Get the focus selector for the new location.
87
+ let currentFocusSelector;
88
+ if (focusSelectors.get(path)) {
89
+ if (isBack) {
90
+ // Use the found focus selector only when navigating back.
91
+ currentFocusSelector = focusSelectors.get(path);
92
+ }
93
+ // Make a copy of the focusSelectors map to remove the focus selector
94
+ // only if necessary (ie. a focus selector was found).
95
+ getFocusSelectorsCopy().delete(path);
92
96
  }
93
- newLocationHistory.push(newLocation);
94
- return newLocationHistory;
97
+ return {
98
+ currentLocation: {
99
+ ...restOptions,
100
+ path,
101
+ isBack,
102
+ hasRestoredFocus: false,
103
+ focusTargetSelector: currentFocusSelector,
104
+ skipFocus
105
+ },
106
+ focusSelectors: (_focusSelectorsCopy2 = focusSelectorsCopy) !== null && _focusSelectorsCopy2 !== void 0 ? _focusSelectorsCopy2 : focusSelectors
107
+ };
95
108
  }
96
109
  function goToParent(state, options = {}) {
97
110
  const {
98
- locationHistory,
99
- screens
111
+ screens,
112
+ focusSelectors
100
113
  } = state;
101
- const currentPath = locationHistory[locationHistory.length - 1].path;
114
+ const currentLocation = {
115
+ ...state.currentLocation,
116
+ isInitial: false
117
+ };
118
+ const currentPath = currentLocation.path;
102
119
  if (currentPath === undefined) {
103
- return locationHistory;
120
+ return {
121
+ currentLocation,
122
+ focusSelectors
123
+ };
104
124
  }
105
125
  const parentPath = (0, _router.findParent)(currentPath, screens);
106
126
  if (parentPath === undefined) {
107
- return locationHistory;
127
+ return {
128
+ currentLocation,
129
+ focusSelectors
130
+ };
108
131
  }
109
132
  return goTo(state, parentPath, {
110
133
  ...options,
@@ -114,8 +137,10 @@ function goToParent(state, options = {}) {
114
137
  function routerReducer(state, action) {
115
138
  let {
116
139
  screens,
117
- locationHistory,
118
- matchedPath
140
+ currentLocation,
141
+ matchedPath,
142
+ focusSelectors,
143
+ ...restState
119
144
  } = state;
120
145
  switch (action.type) {
121
146
  case 'add':
@@ -124,24 +149,27 @@ function routerReducer(state, action) {
124
149
  case 'remove':
125
150
  screens = removeScreen(state, action.screen);
126
151
  break;
127
- case 'goback':
128
- locationHistory = goBack(state);
129
- break;
130
152
  case 'goto':
131
- locationHistory = goTo(state, action.path, action.options);
153
+ ({
154
+ currentLocation,
155
+ focusSelectors
156
+ } = goTo(state, action.path, action.options));
132
157
  break;
133
158
  case 'gotoparent':
134
- locationHistory = goToParent(state, action.options);
159
+ ({
160
+ currentLocation,
161
+ focusSelectors
162
+ } = goToParent(state, action.options));
135
163
  break;
136
164
  }
137
165
 
138
166
  // Return early in case there is no change
139
- if (screens === state.screens && locationHistory === state.locationHistory) {
167
+ if (screens === state.screens && currentLocation === state.currentLocation) {
140
168
  return state;
141
169
  }
142
170
 
143
171
  // Compute the matchedPath
144
- const currentPath = locationHistory.length > 0 ? locationHistory[locationHistory.length - 1].path : undefined;
172
+ const currentPath = currentLocation.path;
145
173
  matchedPath = currentPath !== undefined ? (0, _router.patternMatch)(currentPath, screens) : undefined;
146
174
 
147
175
  // If the new match is the same as the previous match,
@@ -150,40 +178,55 @@ function routerReducer(state, action) {
150
178
  matchedPath = state.matchedPath;
151
179
  }
152
180
  return {
181
+ ...restState,
153
182
  screens,
154
- locationHistory,
155
- matchedPath
183
+ currentLocation,
184
+ matchedPath,
185
+ focusSelectors
156
186
  };
157
187
  }
158
188
  function UnconnectedNavigatorProvider(props, forwardedRef) {
159
189
  const {
160
- initialPath,
190
+ initialPath: initialPathProp,
161
191
  children,
162
192
  className,
163
193
  ...otherProps
164
194
  } = (0, _context.useContextSystem)(props, 'NavigatorProvider');
165
- const [routerState, dispatch] = (0, _element.useReducer)(routerReducer, initialPath, path => ({
195
+ const [routerState, dispatch] = (0, _element.useReducer)(routerReducer, initialPathProp, path => ({
166
196
  screens: [],
167
- locationHistory: [{
168
- path
169
- }],
170
- matchedPath: undefined
197
+ currentLocation: {
198
+ path,
199
+ isInitial: true
200
+ },
201
+ matchedPath: undefined,
202
+ focusSelectors: new Map(),
203
+ initialPath: initialPathProp
171
204
  }));
172
205
 
173
206
  // The methods are constant forever, create stable references to them.
174
207
  const methods = (0, _element.useMemo)(() => ({
175
- goBack: () => dispatch({
176
- type: 'goback'
208
+ // Note: calling goBack calls `goToParent` internally, as it was established
209
+ // that `goBack` should behave like `goToParent`, and `goToParent` should
210
+ // be marked as deprecated.
211
+ goBack: options => dispatch({
212
+ type: 'gotoparent',
213
+ options
177
214
  }),
178
215
  goTo: (path, options) => dispatch({
179
216
  type: 'goto',
180
217
  path,
181
218
  options
182
219
  }),
183
- goToParent: options => dispatch({
184
- type: 'gotoparent',
185
- options
186
- }),
220
+ goToParent: options => {
221
+ (0, _deprecated.default)(`wp.components.useNavigator().goToParent`, {
222
+ since: '6.7',
223
+ alternative: 'wp.components.useNavigator().goBack'
224
+ });
225
+ dispatch({
226
+ type: 'gotoparent',
227
+ options
228
+ });
229
+ },
187
230
  addScreen: screen => dispatch({
188
231
  type: 'add',
189
232
  screen
@@ -194,21 +237,18 @@ function UnconnectedNavigatorProvider(props, forwardedRef) {
194
237
  })
195
238
  }), []);
196
239
  const {
197
- locationHistory,
240
+ currentLocation,
198
241
  matchedPath
199
242
  } = routerState;
200
243
  const navigatorContextValue = (0, _element.useMemo)(() => {
201
244
  var _matchedPath$params;
202
245
  return {
203
- location: {
204
- ...locationHistory[locationHistory.length - 1],
205
- isInitial: locationHistory.length === 1
206
- },
246
+ location: currentLocation,
207
247
  params: (_matchedPath$params = matchedPath?.params) !== null && _matchedPath$params !== void 0 ? _matchedPath$params : {},
208
248
  match: matchedPath?.id,
209
249
  ...methods
210
250
  };
211
- }, [locationHistory, matchedPath, methods]);
251
+ }, [currentLocation, matchedPath, methods]);
212
252
  const cx = (0, _useCx.useCx)();
213
253
  const classes = (0, _element.useMemo)(() => cx(styles.navigatorProviderWrapper, className), [className, cx]);
214
254
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_view.View, {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_isShallowEqual","_interopRequireDefault","_context","_useCx","_router","_view","_context2","styles","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MAX_HISTORY_LENGTH","addScreen","screens","screen","removeScreen","filter","s","id","goBack","locationHistory","length","slice","isBack","hasRestoredFocus","goTo","state","path","options","focusTargetSelector","skipFocus","replace","restOptions","isNavigatingToSamePath","isNavigatingToPreviousPath","newLocation","newLocationHistory","push","goToParent","currentPath","undefined","parentPath","findParent","routerReducer","action","matchedPath","type","patternMatch","isShallowEqual","params","UnconnectedNavigatorProvider","props","forwardedRef","initialPath","children","className","otherProps","useContextSystem","routerState","dispatch","useReducer","methods","useMemo","navigatorContextValue","_matchedPath$params","location","isInitial","match","cx","useCx","classes","navigatorProviderWrapper","jsx","View","ref","NavigatorContext","Provider","value","NavigatorProvider","exports","contextConnect","_default"],"sources":["@wordpress/components/src/navigator/navigator-provider/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useReducer } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { patternMatch, findParent } from '../utils/router';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type {\n\tNavigatorProviderProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n\tNavigateOptions,\n\tScreen,\n\tNavigateToParentOptions,\n} from '../types';\n\ntype MatchedPath = ReturnType< typeof patternMatch >;\n\ntype RouterAction =\n\t| { type: 'add' | 'remove'; screen: Screen }\n\t| { type: 'goback' }\n\t| { type: 'goto'; path: string; options?: NavigateOptions }\n\t| { type: 'gotoparent'; options?: NavigateToParentOptions };\n\ntype RouterState = {\n\tscreens: Screen[];\n\tlocationHistory: NavigatorLocation[];\n\tmatchedPath: MatchedPath;\n};\n\nconst MAX_HISTORY_LENGTH = 50;\n\nfunction addScreen( { screens }: RouterState, screen: Screen ) {\n\treturn [ ...screens, screen ];\n}\n\nfunction removeScreen( { screens }: RouterState, screen: Screen ) {\n\treturn screens.filter( ( s ) => s.id !== screen.id );\n}\n\nfunction goBack( { locationHistory }: RouterState ) {\n\tif ( locationHistory.length <= 1 ) {\n\t\treturn locationHistory;\n\t}\n\treturn [\n\t\t...locationHistory.slice( 0, -2 ),\n\t\t{\n\t\t\t...locationHistory[ locationHistory.length - 2 ],\n\t\t\tisBack: true,\n\t\t\thasRestoredFocus: false,\n\t\t},\n\t];\n}\n\nfunction goTo(\n\tstate: RouterState,\n\tpath: string,\n\toptions: NavigateOptions = {}\n) {\n\tconst { locationHistory } = state;\n\tconst {\n\t\tfocusTargetSelector,\n\t\tisBack = false,\n\t\tskipFocus = false,\n\t\treplace = false,\n\t\t...restOptions\n\t} = options;\n\n\tconst isNavigatingToSamePath =\n\t\tlocationHistory.length > 0 &&\n\t\tlocationHistory[ locationHistory.length - 1 ].path === path;\n\tif ( isNavigatingToSamePath ) {\n\t\treturn locationHistory;\n\t}\n\n\tconst isNavigatingToPreviousPath =\n\t\tisBack &&\n\t\tlocationHistory.length > 1 &&\n\t\tlocationHistory[ locationHistory.length - 2 ].path === path;\n\n\tif ( isNavigatingToPreviousPath ) {\n\t\treturn goBack( state );\n\t}\n\n\tconst newLocation = {\n\t\t...restOptions,\n\t\tpath,\n\t\tisBack,\n\t\thasRestoredFocus: false,\n\t\tskipFocus,\n\t};\n\n\tif ( locationHistory.length === 0 ) {\n\t\treturn replace ? [] : [ newLocation ];\n\t}\n\n\tconst newLocationHistory = locationHistory.slice(\n\t\tlocationHistory.length > MAX_HISTORY_LENGTH - 1 ? 1 : 0,\n\t\t-1\n\t);\n\n\tif ( ! replace ) {\n\t\tnewLocationHistory.push(\n\t\t\t// Assign `focusTargetSelector` to the previous location in history\n\t\t\t// (the one we just navigated from).\n\t\t\t{\n\t\t\t\t...locationHistory[ locationHistory.length - 1 ],\n\t\t\t\tfocusTargetSelector,\n\t\t\t}\n\t\t);\n\t}\n\n\tnewLocationHistory.push( newLocation );\n\n\treturn newLocationHistory;\n}\n\nfunction goToParent(\n\tstate: RouterState,\n\toptions: NavigateToParentOptions = {}\n) {\n\tconst { locationHistory, screens } = state;\n\tconst currentPath = locationHistory[ locationHistory.length - 1 ].path;\n\tif ( currentPath === undefined ) {\n\t\treturn locationHistory;\n\t}\n\tconst parentPath = findParent( currentPath, screens );\n\tif ( parentPath === undefined ) {\n\t\treturn locationHistory;\n\t}\n\treturn goTo( state, parentPath, {\n\t\t...options,\n\t\tisBack: true,\n\t} );\n}\n\nfunction routerReducer(\n\tstate: RouterState,\n\taction: RouterAction\n): RouterState {\n\tlet { screens, locationHistory, matchedPath } = state;\n\tswitch ( action.type ) {\n\t\tcase 'add':\n\t\t\tscreens = addScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'remove':\n\t\t\tscreens = removeScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'goback':\n\t\t\tlocationHistory = goBack( state );\n\t\t\tbreak;\n\t\tcase 'goto':\n\t\t\tlocationHistory = goTo( state, action.path, action.options );\n\t\t\tbreak;\n\t\tcase 'gotoparent':\n\t\t\tlocationHistory = goToParent( state, action.options );\n\t\t\tbreak;\n\t}\n\n\t// Return early in case there is no change\n\tif (\n\t\tscreens === state.screens &&\n\t\tlocationHistory === state.locationHistory\n\t) {\n\t\treturn state;\n\t}\n\n\t// Compute the matchedPath\n\tconst currentPath =\n\t\tlocationHistory.length > 0\n\t\t\t? locationHistory[ locationHistory.length - 1 ].path\n\t\t\t: undefined;\n\tmatchedPath =\n\t\tcurrentPath !== undefined\n\t\t\t? patternMatch( currentPath, screens )\n\t\t\t: undefined;\n\n\t// If the new match is the same as the previous match,\n\t// return the previous one to keep immutability.\n\tif (\n\t\tmatchedPath &&\n\t\tstate.matchedPath &&\n\t\tmatchedPath.id === state.matchedPath.id &&\n\t\tisShallowEqual( matchedPath.params, state.matchedPath.params )\n\t) {\n\t\tmatchedPath = state.matchedPath;\n\t}\n\n\treturn { screens, locationHistory, matchedPath };\n}\n\nfunction UnconnectedNavigatorProvider(\n\tprops: WordPressComponentProps< NavigatorProviderProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { initialPath, children, className, ...otherProps } =\n\t\tuseContextSystem( props, 'NavigatorProvider' );\n\n\tconst [ routerState, dispatch ] = useReducer(\n\t\trouterReducer,\n\t\tinitialPath,\n\t\t( path ) => ( {\n\t\t\tscreens: [],\n\t\t\tlocationHistory: [ { path } ],\n\t\t\tmatchedPath: undefined,\n\t\t} )\n\t);\n\n\t// The methods are constant forever, create stable references to them.\n\tconst methods = useMemo(\n\t\t() => ( {\n\t\t\tgoBack: () => dispatch( { type: 'goback' } ),\n\t\t\tgoTo: ( path: string, options?: NavigateOptions ) =>\n\t\t\t\tdispatch( { type: 'goto', path, options } ),\n\t\t\tgoToParent: ( options: NavigateToParentOptions | undefined ) =>\n\t\t\t\tdispatch( { type: 'gotoparent', options } ),\n\t\t\taddScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'add', screen } ),\n\t\t\tremoveScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'remove', screen } ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { locationHistory, matchedPath } = routerState;\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\tparams: matchedPath?.params ?? {},\n\t\t\tmatch: matchedPath?.id,\n\t\t\t...methods,\n\t\t} ),\n\t\t[ locationHistory, matchedPath, methods ]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorProviderWrapper, 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 * ```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 */\nexport const NavigatorProvider = contextConnect(\n\tUnconnectedNavigatorProvider,\n\t'NavigatorProvider'\n);\n\nexport default NavigatorProvider;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAC,uBAAA,CAAAT,OAAA;AAAoC,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAW,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,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,MAAM,KAAK;MACvC,CAAC;MACD4B,MAAM,GAAAe,mBAAA,GAAEnB,WAAW,EAAEI,MAAM,cAAAe,mBAAA,cAAAA,mBAAA,GAAI,CAAC,CAAC;MACjCG,KAAK,EAAEtB,WAAW,EAAE3B,EAAE;MACtB,GAAG2C;IACJ,CAAC;EAAA,CAAE,EACH,CAAEzC,eAAe,EAAEyB,WAAW,EAAEgB,OAAO,CACxC,CAAC;EAED,MAAMO,EAAE,GAAG,IAAAC,YAAK,EAAC,CAAC;EAClB,MAAMC,OAAO,GAAG,IAAAR,gBAAO,EACtB,MAAMM,EAAE,CAAEhF,MAAM,CAACmF,wBAAwB,EAAEhB,SAAU,CAAC,EACtD,CAAEA,SAAS,EAAEa,EAAE,CAChB,CAAC;EAED,oBACC,IAAA9E,WAAA,CAAAkF,GAAA,EAACtF,KAAA,CAAAuF,IAAI;IAACC,GAAG,EAAGtB,YAAc;IAACG,SAAS,EAAGe,OAAS;IAAA,GAAMd,UAAU;IAAAF,QAAA,eAC/D,IAAAhE,WAAA,CAAAkF,GAAA,EAACrF,SAAA,CAAAwF,gBAAgB,CAACC,QAAQ;MAACC,KAAK,EAAGd,qBAAuB;MAAAT,QAAA,EACvDA;IAAQ,CACgB;EAAC,CACvB,CAAC;AAET;;AAEA;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;AACO,MAAMwB,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,uBAAc,EAC9C9B,4BAA4B,EAC5B,mBACD,CAAC;AAAC,IAAA+B,QAAA,GAAAF,OAAA,CAAAlF,OAAA,GAEaiF,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_isShallowEqual","_interopRequireDefault","_warning","_context","_useCx","_router","_view","_context2","styles","_interopRequireWildcard","_deprecated","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","addScreen","screens","screen","some","s","path","globalThis","SCRIPT_DEBUG","warning","id","removeScreen","filter","goTo","state","options","_focusSelectorsCopy2","focusSelectors","currentLocation","isInitial","isBack","skipFocus","replace","focusTargetSelector","restOptions","focusSelectorsCopy","getFocusSelectorsCopy","_focusSelectorsCopy","Map","currentFocusSelector","delete","hasRestoredFocus","goToParent","currentPath","undefined","parentPath","findParent","routerReducer","action","matchedPath","restState","type","patternMatch","isShallowEqual","params","UnconnectedNavigatorProvider","props","forwardedRef","initialPath","initialPathProp","children","className","otherProps","useContextSystem","routerState","dispatch","useReducer","methods","useMemo","goBack","deprecated","since","alternative","navigatorContextValue","_matchedPath$params","location","match","cx","useCx","classes","navigatorProviderWrapper","jsx","View","ref","NavigatorContext","Provider","value","NavigatorProvider","exports","contextConnect","_default"],"sources":["@wordpress/components/src/navigator/navigator-provider/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useReducer } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { patternMatch, findParent } from '../utils/router';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type {\n\tNavigatorProviderProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n\tNavigateOptions,\n\tScreen,\n\tNavigateToParentOptions,\n} from '../types';\nimport deprecated from '@wordpress/deprecated';\n\ntype MatchedPath = ReturnType< typeof patternMatch >;\n\ntype RouterAction =\n\t| { type: 'add' | 'remove'; screen: Screen }\n\t| { type: 'goto'; path: string; options?: NavigateOptions }\n\t| { type: 'gotoparent'; options?: NavigateToParentOptions };\n\ntype RouterState = {\n\tinitialPath: string;\n\tscreens: Screen[];\n\tcurrentLocation: NavigatorLocation;\n\tmatchedPath: MatchedPath;\n\tfocusSelectors: Map< string, string >;\n};\n\nfunction addScreen( { screens }: RouterState, screen: Screen ) {\n\tif ( screens.some( ( s ) => s.path === screen.path ) ) {\n\t\twarning(\n\t\t\t`Navigator: a screen with path ${ screen.path } already exists.\nThe screen with id ${ screen.id } will not be added.`\n\t\t);\n\t\treturn screens;\n\t}\n\treturn [ ...screens, screen ];\n}\n\nfunction removeScreen( { screens }: RouterState, screen: Screen ) {\n\treturn screens.filter( ( s ) => s.id !== screen.id );\n}\n\nfunction goTo(\n\tstate: RouterState,\n\tpath: string,\n\toptions: NavigateOptions = {}\n) {\n\tconst { focusSelectors } = state;\n\tconst currentLocation = { ...state.currentLocation, isInitial: false };\n\n\tconst {\n\t\t// Default assignments\n\t\tisBack = false,\n\t\tskipFocus = false,\n\t\t// Extract to avoid forwarding\n\t\treplace,\n\t\tfocusTargetSelector,\n\t\t// Rest\n\t\t...restOptions\n\t} = options;\n\n\tif ( currentLocation.path === path ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\n\tlet focusSelectorsCopy: typeof focusSelectors | undefined;\n\tfunction getFocusSelectorsCopy() {\n\t\tfocusSelectorsCopy =\n\t\t\tfocusSelectorsCopy ?? new Map( state.focusSelectors );\n\t\treturn focusSelectorsCopy;\n\t}\n\n\t// Set a focus selector that will be used when navigating\n\t// back to the current location.\n\tif ( focusTargetSelector && currentLocation.path ) {\n\t\tgetFocusSelectorsCopy().set(\n\t\t\tcurrentLocation.path,\n\t\t\tfocusTargetSelector\n\t\t);\n\t}\n\n\t// Get the focus selector for the new location.\n\tlet currentFocusSelector;\n\tif ( focusSelectors.get( path ) ) {\n\t\tif ( isBack ) {\n\t\t\t// Use the found focus selector only when navigating back.\n\t\t\tcurrentFocusSelector = focusSelectors.get( path );\n\t\t}\n\t\t// Make a copy of the focusSelectors map to remove the focus selector\n\t\t// only if necessary (ie. a focus selector was found).\n\t\tgetFocusSelectorsCopy().delete( path );\n\t}\n\n\treturn {\n\t\tcurrentLocation: {\n\t\t\t...restOptions,\n\t\t\tpath,\n\t\t\tisBack,\n\t\t\thasRestoredFocus: false,\n\t\t\tfocusTargetSelector: currentFocusSelector,\n\t\t\tskipFocus,\n\t\t},\n\t\tfocusSelectors: focusSelectorsCopy ?? focusSelectors,\n\t};\n}\n\nfunction goToParent(\n\tstate: RouterState,\n\toptions: NavigateToParentOptions = {}\n) {\n\tconst { screens, focusSelectors } = state;\n\tconst currentLocation = { ...state.currentLocation, isInitial: false };\n\tconst currentPath = currentLocation.path;\n\tif ( currentPath === undefined ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\tconst parentPath = findParent( currentPath, screens );\n\tif ( parentPath === undefined ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\treturn goTo( state, parentPath, {\n\t\t...options,\n\t\tisBack: true,\n\t} );\n}\n\nfunction routerReducer(\n\tstate: RouterState,\n\taction: RouterAction\n): RouterState {\n\tlet {\n\t\tscreens,\n\t\tcurrentLocation,\n\t\tmatchedPath,\n\t\tfocusSelectors,\n\t\t...restState\n\t} = state;\n\tswitch ( action.type ) {\n\t\tcase 'add':\n\t\t\tscreens = addScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'remove':\n\t\t\tscreens = removeScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'goto':\n\t\t\t( { currentLocation, focusSelectors } = goTo(\n\t\t\t\tstate,\n\t\t\t\taction.path,\n\t\t\t\taction.options\n\t\t\t) );\n\t\t\tbreak;\n\t\tcase 'gotoparent':\n\t\t\t( { currentLocation, focusSelectors } = goToParent(\n\t\t\t\tstate,\n\t\t\t\taction.options\n\t\t\t) );\n\t\t\tbreak;\n\t}\n\n\t// Return early in case there is no change\n\tif (\n\t\tscreens === state.screens &&\n\t\tcurrentLocation === state.currentLocation\n\t) {\n\t\treturn state;\n\t}\n\n\t// Compute the matchedPath\n\tconst currentPath = currentLocation.path;\n\tmatchedPath =\n\t\tcurrentPath !== undefined\n\t\t\t? patternMatch( currentPath, screens )\n\t\t\t: undefined;\n\n\t// If the new match is the same as the previous match,\n\t// return the previous one to keep immutability.\n\tif (\n\t\tmatchedPath &&\n\t\tstate.matchedPath &&\n\t\tmatchedPath.id === state.matchedPath.id &&\n\t\tisShallowEqual( matchedPath.params, state.matchedPath.params )\n\t) {\n\t\tmatchedPath = state.matchedPath;\n\t}\n\n\treturn {\n\t\t...restState,\n\t\tscreens,\n\t\tcurrentLocation,\n\t\tmatchedPath,\n\t\tfocusSelectors,\n\t};\n}\n\nfunction UnconnectedNavigatorProvider(\n\tprops: WordPressComponentProps< NavigatorProviderProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tinitialPath: initialPathProp,\n\t\tchildren,\n\t\tclassName,\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorProvider' );\n\n\tconst [ routerState, dispatch ] = useReducer(\n\t\trouterReducer,\n\t\tinitialPathProp,\n\t\t( path ) => ( {\n\t\t\tscreens: [],\n\t\t\tcurrentLocation: { path, isInitial: true },\n\t\t\tmatchedPath: undefined,\n\t\t\tfocusSelectors: new Map(),\n\t\t\tinitialPath: initialPathProp,\n\t\t} )\n\t);\n\n\t// The methods are constant forever, create stable references to them.\n\tconst methods = useMemo(\n\t\t() => ( {\n\t\t\t// Note: calling goBack calls `goToParent` internally, as it was established\n\t\t\t// that `goBack` should behave like `goToParent`, and `goToParent` should\n\t\t\t// be marked as deprecated.\n\t\t\tgoBack: ( options: NavigateToParentOptions | undefined ) =>\n\t\t\t\tdispatch( { type: 'gotoparent', options } ),\n\t\t\tgoTo: ( path: string, options?: NavigateOptions ) =>\n\t\t\t\tdispatch( { type: 'goto', path, options } ),\n\t\t\tgoToParent: ( options: NavigateToParentOptions | undefined ) => {\n\t\t\t\tdeprecated( `wp.components.useNavigator().goToParent`, {\n\t\t\t\t\tsince: '6.7',\n\t\t\t\t\talternative: 'wp.components.useNavigator().goBack',\n\t\t\t\t} );\n\t\t\t\tdispatch( { type: 'gotoparent', options } );\n\t\t\t},\n\t\t\taddScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'add', screen } ),\n\t\t\tremoveScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'remove', screen } ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { currentLocation, matchedPath } = routerState;\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: currentLocation,\n\t\t\tparams: matchedPath?.params ?? {},\n\t\t\tmatch: matchedPath?.id,\n\t\t\t...methods,\n\t\t} ),\n\t\t[ currentLocation, matchedPath, methods ]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorProviderWrapper, 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 * ```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 */\nexport const NavigatorProvider = contextConnect(\n\tUnconnectedNavigatorProvider,\n\t'NavigatorProvider'\n);\n\nexport default NavigatorProvider;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAD,sBAAA,CAAAF,OAAA;AAMA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAC,uBAAA,CAAAV,OAAA;AASA,IAAAW,WAAA,GAAAT,sBAAA,CAAAF,OAAA;AAA+C,IAAAY,WAAA,GAAAZ,OAAA;AAAA,SAAAa,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,I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,CAAC;EAClB,MAAMC,OAAO,GAAG,IAAAX,gBAAO,EACtB,MAAMS,EAAE,CAAE1F,MAAM,CAAC6F,wBAAwB,EAAEnB,SAAU,CAAC,EACtD,CAAEA,SAAS,EAAEgB,EAAE,CAChB,CAAC;EAED,oBACC,IAAAvF,WAAA,CAAA2F,GAAA,EAAChG,KAAA,CAAAiG,IAAI;IAACC,GAAG,EAAG1B,YAAc;IAACI,SAAS,EAAGkB,OAAS;IAAA,GAAMjB,UAAU;IAAAF,QAAA,eAC/D,IAAAtE,WAAA,CAAA2F,GAAA,EAAC/F,SAAA,CAAAkG,gBAAgB,CAACC,QAAQ;MAACC,KAAK,EAAGb,qBAAuB;MAAAb,QAAA,EACvDA;IAAQ,CACgB;EAAC,CACvB,CAAC;AAET;;AAEA;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;AACO,MAAM2B,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,uBAAc,EAC9ClC,4BAA4B,EAC5B,mBACD,CAAC;AAAC,IAAAmC,QAAA,GAAAF,OAAA,CAAA3F,OAAA,GAEa0F,iBAAiB","ignoreList":[]}
@@ -1,15 +1,16 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = exports.NavigatorToParentButton = void 0;
8
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
9
+ var _component = require("../navigator-back-button/component");
7
10
  var _context = require("../../context");
8
- var _view = require("../../view");
9
- var _hook = require("../navigator-back-button/hook");
10
11
  var _jsxRuntime = require("react/jsx-runtime");
11
12
  /**
12
- * External dependencies
13
+ * WordPress dependencies
13
14
  */
14
15
 
15
16
  /**
@@ -17,49 +18,21 @@ var _jsxRuntime = require("react/jsx-runtime");
17
18
  */
18
19
 
19
20
  function UnconnectedNavigatorToParentButton(props, forwardedRef) {
20
- const navigatorToParentButtonProps = (0, _hook.useNavigatorBackButton)({
21
- ...props,
22
- goToParent: true
21
+ (0, _deprecated.default)('wp.components.NavigatorToParentButton', {
22
+ since: '6.7',
23
+ alternative: 'wp.components.NavigatorBackButton'
23
24
  });
24
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_view.View, {
25
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_component.NavigatorBackButton, {
25
26
  ref: forwardedRef,
26
- ...navigatorToParentButtonProps
27
+ ...props
27
28
  });
28
29
  }
29
30
 
30
- /*
31
- * The `NavigatorToParentButton` component can be used to navigate to a screen and
32
- * should be used in combination with the `NavigatorProvider`, the
33
- * `NavigatorScreen` and the `NavigatorButton` components (or the `useNavigator`
34
- * hook).
35
- *
36
- * @example
37
- * ```jsx
38
- * import {
39
- * __experimentalNavigatorProvider as NavigatorProvider,
40
- * __experimentalNavigatorScreen as NavigatorScreen,
41
- * __experimentalNavigatorButton as NavigatorButton,
42
- * __experimentalNavigatorToParentButton as NavigatorToParentButton,
43
- * } from '@wordpress/components';
44
- *
45
- * const MyNavigation = () => (
46
- * <NavigatorProvider initialPath="/">
47
- * <NavigatorScreen path="/">
48
- * <p>This is the home screen.</p>
49
- * <NavigatorButton path="/child">
50
- * Navigate to child screen.
51
- * </NavigatorButton>
52
- * </NavigatorScreen>
31
+ /**
32
+ * _Note: this component is deprecated. Please use the `NavigatorBackButton`
33
+ * component instead._
53
34
  *
54
- * <NavigatorScreen path="/child">
55
- * <p>This is the child screen.</p>
56
- * <NavigatorToParentButton>
57
- * Go to parent
58
- * </NavigatorToParentButton>
59
- * </NavigatorScreen>
60
- * </NavigatorProvider>
61
- * );
62
- * ```
35
+ * @deprecated
63
36
  */
64
37
  const NavigatorToParentButton = exports.NavigatorToParentButton = (0, _context.contextConnect)(UnconnectedNavigatorToParentButton, 'NavigatorToParentButton');
65
38
  var _default = exports.default = NavigatorToParentButton;
@@ -1 +1 @@
1
- {"version":3,"names":["_context","require","_view","_hook","_jsxRuntime","UnconnectedNavigatorToParentButton","props","forwardedRef","navigatorToParentButtonProps","useNavigatorBackButton","goToParent","jsx","View","ref","NavigatorToParentButton","exports","contextConnect","_default","default"],"sources":["@wordpress/components/src/navigator/navigator-to-parent-button/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { View } from '../../view';\nimport { useNavigatorBackButton } from '../navigator-back-button/hook';\nimport type { NavigatorToParentButtonProps } from '../types';\n\nfunction UnconnectedNavigatorToParentButton(\n\tprops: WordPressComponentProps< NavigatorToParentButtonProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst navigatorToParentButtonProps = useNavigatorBackButton( {\n\t\t...props,\n\t\tgoToParent: true,\n\t} );\n\n\treturn <View ref={ forwardedRef } { ...navigatorToParentButtonProps } />;\n}\n\n/*\n * The `NavigatorToParentButton` component can be used to navigate to a screen and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorScreen` and the `NavigatorButton` 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 * __experimentalNavigatorToParentButton as NavigatorToParentButton,\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 * <NavigatorToParentButton>\n * Go to parent\n * </NavigatorToParentButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorToParentButton = contextConnect(\n\tUnconnectedNavigatorToParentButton,\n\t'NavigatorToParentButton'\n);\n\nexport default NavigatorToParentButton;\n"],"mappings":";;;;;;AASA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAAuE,IAAAG,WAAA,GAAAH,OAAA;AAXvE;AACA;AACA;;AAGA;AACA;AACA;;AAOA,SAASI,kCAAkCA,CAC1CC,KAAwE,EACxEC,YAAiC,EAChC;EACD,MAAMC,4BAA4B,GAAG,IAAAC,4BAAsB,EAAE;IAC5D,GAAGH,KAAK;IACRI,UAAU,EAAE;EACb,CAAE,CAAC;EAEH,oBAAO,IAAAN,WAAA,CAAAO,GAAA,EAACT,KAAA,CAAAU,IAAI;IAACC,GAAG,EAAGN,YAAc;IAAA,GAAMC;EAA4B,CAAI,CAAC;AACzE;;AAEA;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;AACO,MAAMM,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAAE,uBAAc,EACpDX,kCAAkC,EAClC,yBACD,CAAC;AAAC,IAAAY,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEaJ,uBAAuB","ignoreList":[]}
1
+ {"version":3,"names":["_deprecated","_interopRequireDefault","require","_component","_context","_jsxRuntime","UnconnectedNavigatorToParentButton","props","forwardedRef","deprecated","since","alternative","jsx","NavigatorBackButton","ref","NavigatorToParentButton","exports","contextConnect","_default","default"],"sources":["@wordpress/components/src/navigator/navigator-to-parent-button/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { NavigatorBackButton } from '../navigator-back-button/component';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport type { NavigatorBackButtonProps } from '../types';\n\nfunction UnconnectedNavigatorToParentButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonProps, 'button' >,\n\tforwardedRef: React.ForwardedRef< any >\n) {\n\tdeprecated( 'wp.components.NavigatorToParentButton', {\n\t\tsince: '6.7',\n\t\talternative: 'wp.components.NavigatorBackButton',\n\t} );\n\n\treturn <NavigatorBackButton ref={ forwardedRef } { ...props } />;\n}\n\n/**\n * _Note: this component is deprecated. Please use the `NavigatorBackButton`\n * component instead._\n *\n * @deprecated\n */\nexport const NavigatorToParentButton = contextConnect(\n\tUnconnectedNavigatorToParentButton,\n\t'NavigatorToParentButton'\n);\n\nexport default NavigatorToParentButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAA+C,IAAAG,WAAA,GAAAH,OAAA;AAV/C;AACA;AACA;;AAGA;AACA;AACA;;AAMA,SAASI,kCAAkCA,CAC1CC,KAAoE,EACpEC,YAAuC,EACtC;EACD,IAAAC,mBAAU,EAAE,uCAAuC,EAAE;IACpDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EAEH,oBAAO,IAAAN,WAAA,CAAAO,GAAA,EAACT,UAAA,CAAAU,mBAAmB;IAACC,GAAG,EAAGN,YAAc;IAAA,GAAMD;EAAK,CAAI,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMQ,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAAE,uBAAc,EACpDX,kCAAkC,EAClC,yBACD,CAAC;AAAC,IAAAY,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEaJ,uBAAuB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/navigator/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport type MatchParams = Record< string, string | string[] >;\n\nexport type NavigateOptions = {\n\tfocusTargetSelector?: string;\n\tisBack?: boolean;\n\tskipFocus?: boolean;\n\treplace?: boolean;\n};\n\nexport type NavigateToParentOptions = Omit< NavigateOptions, 'isBack' >;\n\nexport type NavigatorLocation = NavigateOptions & {\n\tisInitial?: boolean;\n\tpath?: string;\n\thasRestoredFocus?: boolean;\n};\n\n// Returned by the `useNavigator` hook.\nexport type Navigator = {\n\tlocation: NavigatorLocation;\n\tparams: MatchParams;\n\tgoTo: ( path: string, options?: NavigateOptions ) => void;\n\tgoBack: () => void;\n\tgoToParent: ( options?: NavigateToParentOptions ) => void;\n};\n\nexport type NavigatorContext = Navigator & {\n\taddScreen: ( screen: Screen ) => void;\n\tremoveScreen: ( screen: Screen ) => void;\n\tmatch?: string;\n};\n\nexport type NavigatorProviderProps = {\n\t/**\n\t * The initial active path.\n\t */\n\tinitialPath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorScreenProps = {\n\t/**\n\t * The screen's path, matched against the current path stored in the navigator.\n\t */\n\tpath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorBackButtonProps = ButtonAsButtonProps;\n\nexport type NavigatorBackButtonHookProps = NavigatorBackButtonProps & {\n\t/**\n\t * Whether we should navigate to the parent screen.\n\t *\n\t * @default 'false'\n\t */\n\tgoToParent?: boolean;\n};\n\nexport type NavigatorToParentButtonProps = NavigatorBackButtonProps;\n\nexport type NavigatorButtonProps = NavigatorBackButtonProps & {\n\t/**\n\t * The path of the screen to navigate to. The value of this prop needs to be\n\t * a valid value for an HTML attribute.\n\t */\n\tpath: string;\n\t/**\n\t * The HTML attribute used to identify the `NavigatorButton`, which is used\n\t * by `Navigator` to restore focus.\n\t *\n\t * @default 'id'\n\t */\n\tattributeName?: string;\n};\n\nexport type Screen = {\n\tid: string;\n\tpath: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/navigator/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport type MatchParams = Record< string, string | string[] >;\n\nexport type NavigateOptions = {\n\t/**\n\t * Specify the CSS selector used to restore focus on an given element when\n\t * navigating back. When not provided, the component will attempt to restore\n\t * focus on the element that originated the forward navigation.\n\t */\n\tfocusTargetSelector?: string;\n\t/**\n\t * Whether the navigation is a backwards navigation. This enables focus\n\t * restoration (when possible), and causes the animation to be backwards.\n\t */\n\tisBack?: boolean;\n\t/**\n\t * Opt out of focus management. Useful when the consumer of the component\n\t * wants to manage focus themselves.\n\t */\n\tskipFocus?: boolean;\n\t/**\n\t * Note: this option is deprecated and currently doesn't have any effect.\n\t * @deprecated\n\t * @ignore\n\t */\n\treplace?: boolean;\n};\n\nexport type NavigateToParentOptions = Omit< NavigateOptions, 'isBack' >;\n\nexport type NavigatorLocation = NavigateOptions & {\n\t/**\n\t * Whether the current location is the initial one (ie. first in the stack).\n\t */\n\tisInitial?: boolean;\n\t/**\n\t * The path associated to the location.\n\t */\n\tpath?: string;\n\t/**\n\t * Whether focus was already restored for this location (in case of\n\t * backwards navigation).\n\t */\n\thasRestoredFocus?: boolean;\n};\n\n// Returned by the `useNavigator` hook.\nexport type Navigator = {\n\t/**\n\t * The current location.\n\t */\n\tlocation: NavigatorLocation;\n\t/**\n\t * Params associated with the current location\n\t */\n\tparams: MatchParams;\n\t/**\n\t * Navigate to a new location.\n\t */\n\tgoTo: ( path: string, options?: NavigateOptions ) => void;\n\t/**\n\t * Go back to the parent location (ie. \"/some/path\" will navigate back\n\t * to \"/some\")\n\t */\n\tgoBack: ( options?: NavigateToParentOptions ) => void;\n\t/**\n\t * _Note: This function is deprecated. Please use `goBack` instead._\n\t * @deprecated\n\t * @ignore\n\t */\n\tgoToParent: ( options?: NavigateToParentOptions ) => void;\n};\n\nexport type NavigatorContext = Navigator & {\n\taddScreen: ( screen: Screen ) => void;\n\tremoveScreen: ( screen: Screen ) => void;\n\tmatch?: string;\n};\n\nexport type NavigatorProviderProps = {\n\t/**\n\t * The initial active path.\n\t */\n\tinitialPath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorScreenProps = {\n\t/**\n\t * The screen's path, matched against the current path stored in the navigator.\n\t */\n\tpath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorBackButtonProps = ButtonAsButtonProps;\n\nexport type NavigatorToParentButtonProps = NavigatorBackButtonProps;\n\nexport type NavigatorButtonProps = NavigatorBackButtonProps & {\n\t/**\n\t * The path of the screen to navigate to. The value of this prop needs to be\n\t * a valid value for an HTML attribute.\n\t */\n\tpath: string;\n\t/**\n\t * The HTML attribute used to identify the `NavigatorButton`, which is used\n\t * by `Navigator` to restore focus.\n\t *\n\t * @default 'id'\n\t */\n\tattributeName?: string;\n};\n\nexport type Screen = {\n\tid: string;\n\tpath: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.useNavigator = useNavigator;
7
7
  var _element = require("@wordpress/element");
8
8
  var _context = require("./context");
9
9
  /**
@@ -33,5 +33,4 @@ function useNavigator() {
33
33
  params
34
34
  };
35
35
  }
36
- var _default = exports.default = useNavigator;
37
36
  //# sourceMappingURL=use-navigator.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_context","useNavigator","location","params","goTo","goBack","goToParent","useContext","NavigatorContext","_default","exports","default"],"sources":["@wordpress/components/src/navigator/use-navigator.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigatorContext } from './context';\nimport type { Navigator } from './types';\n\n/**\n * Retrieves a `navigator` instance.\n */\nfunction useNavigator(): Navigator {\n\tconst { location, params, goTo, goBack, goToParent } =\n\t\tuseContext( NavigatorContext );\n\n\treturn {\n\t\tlocation,\n\t\tgoTo,\n\t\tgoBack,\n\t\tgoToParent,\n\t\tparams,\n\t};\n}\n\nexport default useNavigator;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA,SAASE,YAAYA,CAAA,EAAc;EAClC,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC;EAAW,CAAC,GACnD,IAAAC,mBAAU,EAAEC,yBAAiB,CAAC;EAE/B,OAAO;IACNN,QAAQ;IACRE,IAAI;IACJC,MAAM;IACNC,UAAU;IACVH;EACD,CAAC;AACF;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcV,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_context","useNavigator","location","params","goTo","goBack","goToParent","useContext","NavigatorContext"],"sources":["@wordpress/components/src/navigator/use-navigator.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigatorContext } from './context';\nimport type { Navigator } from './types';\n\n/**\n * Retrieves a `navigator` instance.\n */\nexport function useNavigator(): Navigator {\n\tconst { location, params, goTo, goBack, goToParent } =\n\t\tuseContext( NavigatorContext );\n\n\treturn {\n\t\tlocation,\n\t\tgoTo,\n\t\tgoBack,\n\t\tgoToParent,\n\t\tparams,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACO,SAASE,YAAYA,CAAA,EAAc;EACzC,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC;EAAW,CAAC,GACnD,IAAAC,mBAAU,EAAEC,yBAAiB,CAAC;EAE/B,OAAO;IACNN,QAAQ;IACRE,IAAI;IACJC,MAAM;IACNC,UAAU;IACVH;EACD,CAAC;AACF","ignoreList":[]}
@@ -210,9 +210,9 @@ function PaletteEditListView({
210
210
  addColorRef
211
211
  }) {
212
212
  // When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.
213
- const elementsReference = (0, _element.useRef)();
213
+ const elementsReferenceRef = (0, _element.useRef)();
214
214
  (0, _element.useEffect)(() => {
215
- elementsReference.current = elements;
215
+ elementsReferenceRef.current = elements;
216
216
  }, [elements]);
217
217
  const debounceOnChange = (0, _compose.useDebounce)(onChange, 100);
218
218
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_vStack.VStack, {