@rpcbase/ui 0.244.0 → 0.245.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 (694) hide show
  1. package/dist/index10.js +2 -2
  2. package/dist/index105.js +36 -36
  3. package/dist/index106.js +1 -1
  4. package/dist/index11.js +2 -2
  5. package/dist/index117.js +6 -6
  6. package/dist/index12.js +3 -3
  7. package/dist/index120.js +10 -10
  8. package/dist/index122.js +2 -2
  9. package/dist/index123.js +3 -3
  10. package/dist/index124.js +1 -1
  11. package/dist/index126.js +2 -2
  12. package/dist/index128.js +2 -2
  13. package/dist/index13.js +2 -2
  14. package/dist/index14.js +2 -2
  15. package/dist/index149.js +14 -5
  16. package/dist/index149.js.map +1 -1
  17. package/dist/index15.js +2 -2
  18. package/dist/index150.js +63 -63
  19. package/dist/index150.js.map +1 -1
  20. package/dist/index151.js +38 -2
  21. package/dist/index151.js.map +1 -1
  22. package/dist/index152.js +13 -385
  23. package/dist/index152.js.map +1 -1
  24. package/dist/index153.js +23 -261
  25. package/dist/index153.js.map +1 -1
  26. package/dist/index154.js +109 -58
  27. package/dist/index154.js.map +1 -1
  28. package/dist/index155.js +13 -47
  29. package/dist/index155.js.map +1 -1
  30. package/dist/index156.js +4 -169
  31. package/dist/index156.js.map +1 -1
  32. package/dist/index157.js +4 -110
  33. package/dist/index157.js.map +1 -1
  34. package/dist/index158.js +5 -25
  35. package/dist/index158.js.map +1 -1
  36. package/dist/index159.js +12 -8
  37. package/dist/index159.js.map +1 -1
  38. package/dist/index16.js +8 -8
  39. package/dist/index160.js +19 -4
  40. package/dist/index160.js.map +1 -1
  41. package/dist/index161.js +11 -6
  42. package/dist/index161.js.map +1 -1
  43. package/dist/index162.js +176 -4
  44. package/dist/index162.js.map +1 -1
  45. package/dist/index163.js +268 -476
  46. package/dist/index163.js.map +1 -1
  47. package/dist/index164.js +4 -189
  48. package/dist/index164.js.map +1 -1
  49. package/dist/index165.js +28 -14
  50. package/dist/index165.js.map +1 -1
  51. package/dist/index166.js +124 -105
  52. package/dist/index166.js.map +1 -1
  53. package/dist/index167.js +63 -262
  54. package/dist/index167.js.map +1 -1
  55. package/dist/index168.js +8 -6
  56. package/dist/index168.js.map +1 -1
  57. package/dist/index169.js +15 -40
  58. package/dist/index169.js.map +1 -1
  59. package/dist/index17.js +1 -1
  60. package/dist/index170.js +30 -4
  61. package/dist/index170.js.map +1 -1
  62. package/dist/index171.js +69 -58
  63. package/dist/index171.js.map +1 -1
  64. package/dist/index172.js +5 -8
  65. package/dist/index172.js.map +1 -1
  66. package/dist/index173.js +61 -80
  67. package/dist/index173.js.map +1 -1
  68. package/dist/index174.js +2 -20
  69. package/dist/index174.js.map +1 -1
  70. package/dist/index175.js +383 -14
  71. package/dist/index175.js.map +1 -1
  72. package/dist/index176.js +260 -4
  73. package/dist/index176.js.map +1 -1
  74. package/dist/index177.js +59 -4
  75. package/dist/index177.js.map +1 -1
  76. package/dist/index178.js +46 -6
  77. package/dist/index178.js.map +1 -1
  78. package/dist/index179.js +169 -4
  79. package/dist/index179.js.map +1 -1
  80. package/dist/index18.js +7 -7
  81. package/dist/index180.js +109 -6
  82. package/dist/index180.js.map +1 -1
  83. package/dist/index181.js +24 -16
  84. package/dist/index181.js.map +1 -1
  85. package/dist/index182.js +8 -5
  86. package/dist/index182.js.map +1 -1
  87. package/dist/index183.js +4 -4
  88. package/dist/index183.js.map +1 -1
  89. package/dist/index184.js +5 -12
  90. package/dist/index184.js.map +1 -1
  91. package/dist/index185.js +4 -9
  92. package/dist/index185.js.map +1 -1
  93. package/dist/index186.js +487 -13
  94. package/dist/index186.js.map +1 -1
  95. package/dist/index187.js +189 -13
  96. package/dist/index187.js.map +1 -1
  97. package/dist/index188.js +13 -4
  98. package/dist/index188.js.map +1 -1
  99. package/dist/index189.js +107 -5
  100. package/dist/index189.js.map +1 -1
  101. package/dist/index19.js +16 -16
  102. package/dist/index190.js +262 -6
  103. package/dist/index190.js.map +1 -1
  104. package/dist/index191.js +6 -5
  105. package/dist/index191.js.map +1 -1
  106. package/dist/index192.js +39 -53
  107. package/dist/index192.js.map +1 -1
  108. package/dist/index193.js +4 -8
  109. package/dist/index193.js.map +1 -1
  110. package/dist/index194.js +58 -4
  111. package/dist/index194.js.map +1 -1
  112. package/dist/index195.js +8 -4
  113. package/dist/index195.js.map +1 -1
  114. package/dist/index196.js +87 -8
  115. package/dist/index196.js.map +1 -1
  116. package/dist/index197.js +19 -4
  117. package/dist/index197.js.map +1 -1
  118. package/dist/index198.js +16 -4
  119. package/dist/index198.js.map +1 -1
  120. package/dist/index199.js +5 -3
  121. package/dist/index199.js.map +1 -1
  122. package/dist/index200.js +5 -10
  123. package/dist/index200.js.map +1 -1
  124. package/dist/index201.js +6 -9
  125. package/dist/index201.js.map +1 -1
  126. package/dist/index202.js +4 -9
  127. package/dist/index202.js.map +1 -1
  128. package/dist/index203.js +6 -10
  129. package/dist/index203.js.map +1 -1
  130. package/dist/index204.js +16 -10
  131. package/dist/index204.js.map +1 -1
  132. package/dist/index205.js +4 -9
  133. package/dist/index205.js.map +1 -1
  134. package/dist/index206.js +4 -6
  135. package/dist/index206.js.map +1 -1
  136. package/dist/index207.js +12 -5
  137. package/dist/index207.js.map +1 -1
  138. package/dist/index208.js +9 -4
  139. package/dist/index208.js.map +1 -1
  140. package/dist/index209.js +13 -5
  141. package/dist/index209.js.map +1 -1
  142. package/dist/index21.js +1 -1
  143. package/dist/index210.js +13 -6
  144. package/dist/index210.js.map +1 -1
  145. package/dist/index211.js +4 -5
  146. package/dist/index211.js.map +1 -1
  147. package/dist/index212.js +5 -16
  148. package/dist/index212.js.map +1 -1
  149. package/dist/index213.js +6 -7
  150. package/dist/index213.js.map +1 -1
  151. package/dist/index214.js +5 -10
  152. package/dist/index214.js.map +1 -1
  153. package/dist/index215.js +54 -10
  154. package/dist/index215.js.map +1 -1
  155. package/dist/index216.js +8 -21
  156. package/dist/index216.js.map +1 -1
  157. package/dist/index217.js +4 -8
  158. package/dist/index217.js.map +1 -1
  159. package/dist/index218.js +4 -9
  160. package/dist/index218.js.map +1 -1
  161. package/dist/index219.js +8 -9
  162. package/dist/index219.js.map +1 -1
  163. package/dist/index22.js +2 -2
  164. package/dist/index220.js +4 -4
  165. package/dist/index220.js.map +1 -1
  166. package/dist/index221.js +4 -5
  167. package/dist/index221.js.map +1 -1
  168. package/dist/index222.js +3 -16
  169. package/dist/index222.js.map +1 -1
  170. package/dist/index223.js +10 -9
  171. package/dist/index223.js.map +1 -1
  172. package/dist/index224.js +9 -18
  173. package/dist/index224.js.map +1 -1
  174. package/dist/index225.js +9 -20
  175. package/dist/index225.js.map +1 -1
  176. package/dist/index226.js +10 -12
  177. package/dist/index226.js.map +1 -1
  178. package/dist/index227.js +10 -29
  179. package/dist/index227.js.map +1 -1
  180. package/dist/index228.js +9 -12
  181. package/dist/index228.js.map +1 -1
  182. package/dist/index229.js +6 -25
  183. package/dist/index229.js.map +1 -1
  184. package/dist/index23.js +1 -1
  185. package/dist/index230.js +5 -5
  186. package/dist/index230.js.map +1 -1
  187. package/dist/index231.js +5 -20
  188. package/dist/index231.js.map +1 -1
  189. package/dist/index232.js +5 -66
  190. package/dist/index232.js.map +1 -1
  191. package/dist/index233.js +6 -6
  192. package/dist/index233.js.map +1 -1
  193. package/dist/index234.js +5 -5
  194. package/dist/index234.js.map +1 -1
  195. package/dist/index235.js +16 -11
  196. package/dist/index235.js.map +1 -1
  197. package/dist/index236.js +7 -3
  198. package/dist/index236.js.map +1 -1
  199. package/dist/index237.js +9 -49
  200. package/dist/index237.js.map +1 -1
  201. package/dist/index238.js +11 -4
  202. package/dist/index238.js.map +1 -1
  203. package/dist/index239.js +20 -28
  204. package/dist/index239.js.map +1 -1
  205. package/dist/index24.js +1 -1
  206. package/dist/index240.js +8 -16
  207. package/dist/index240.js.map +1 -1
  208. package/dist/index241.js +9 -5
  209. package/dist/index241.js.map +1 -1
  210. package/dist/index242.js +9 -21
  211. package/dist/index242.js.map +1 -1
  212. package/dist/index243.js +4 -53
  213. package/dist/index243.js.map +1 -1
  214. package/dist/index244.js +5 -20
  215. package/dist/index244.js.map +1 -1
  216. package/dist/index245.js +16 -41
  217. package/dist/index245.js.map +1 -1
  218. package/dist/index246.js +9 -39
  219. package/dist/index246.js.map +1 -1
  220. package/dist/index247.js +19 -46
  221. package/dist/index247.js.map +1 -1
  222. package/dist/index248.js +17 -20
  223. package/dist/index248.js.map +1 -1
  224. package/dist/index249.js +12 -19
  225. package/dist/index249.js.map +1 -1
  226. package/dist/index25.js +1 -1
  227. package/dist/index250.js +28 -19
  228. package/dist/index250.js.map +1 -1
  229. package/dist/index251.js +10 -68
  230. package/dist/index251.js.map +1 -1
  231. package/dist/index252.js +25 -17
  232. package/dist/index252.js.map +1 -1
  233. package/dist/index253.js +5 -3
  234. package/dist/index253.js.map +1 -1
  235. package/dist/index254.js +66 -11
  236. package/dist/index254.js.map +1 -1
  237. package/dist/index255.js +8 -30
  238. package/dist/index255.js.map +1 -1
  239. package/dist/index256.js +11 -13
  240. package/dist/index256.js.map +1 -1
  241. package/dist/index257.js +8 -18
  242. package/dist/index257.js.map +1 -1
  243. package/dist/index258.js +5 -36
  244. package/dist/index258.js.map +1 -1
  245. package/dist/index259.js +12 -68
  246. package/dist/index259.js.map +1 -1
  247. package/dist/index260.js +3 -239
  248. package/dist/index260.js.map +1 -1
  249. package/dist/index261.js +3 -252
  250. package/dist/index261.js.map +1 -1
  251. package/dist/index262.js +96 -65
  252. package/dist/index262.js.map +1 -1
  253. package/dist/index263.js +16 -98
  254. package/dist/index263.js.map +1 -1
  255. package/dist/index264.js +26 -173
  256. package/dist/index264.js.map +1 -1
  257. package/dist/index265.js +47 -79
  258. package/dist/index265.js.map +1 -1
  259. package/dist/index266.js +6 -13
  260. package/dist/index266.js.map +1 -1
  261. package/dist/index267.js +5 -3
  262. package/dist/index267.js.map +1 -1
  263. package/dist/index268.js +60 -28
  264. package/dist/index268.js.map +1 -1
  265. package/dist/index269.js +66 -16
  266. package/dist/index269.js.map +1 -1
  267. package/dist/index270.js +131 -35
  268. package/dist/index270.js.map +1 -1
  269. package/dist/index271.js +8 -34
  270. package/dist/index271.js.map +1 -1
  271. package/dist/index272.js +5 -69
  272. package/dist/index272.js.map +1 -1
  273. package/dist/index273.js +4 -18
  274. package/dist/index273.js.map +1 -1
  275. package/dist/index274.js +11 -3
  276. package/dist/index274.js.map +1 -1
  277. package/dist/index275.js +17 -107
  278. package/dist/index275.js.map +1 -1
  279. package/dist/index276.js +16 -26
  280. package/dist/index276.js.map +1 -1
  281. package/dist/index277.js +11 -28
  282. package/dist/index277.js.map +1 -1
  283. package/dist/index278.js +8 -4
  284. package/dist/index278.js.map +1 -1
  285. package/dist/index279.js +142 -124
  286. package/dist/index279.js.map +1 -1
  287. package/dist/index28.js +1 -1
  288. package/dist/index280.js +79 -4
  289. package/dist/index280.js.map +1 -1
  290. package/dist/index281.js +61 -78
  291. package/dist/index281.js.map +1 -1
  292. package/dist/index282.js +15 -273
  293. package/dist/index282.js.map +1 -1
  294. package/dist/index283.js +20 -12
  295. package/dist/index283.js.map +1 -1
  296. package/dist/index284.js +7 -28
  297. package/dist/index284.js.map +1 -1
  298. package/dist/index285.js +12 -16
  299. package/dist/index285.js.map +1 -1
  300. package/dist/index286.js +3 -10
  301. package/dist/index286.js.map +1 -1
  302. package/dist/index287.js +49 -24
  303. package/dist/index287.js.map +1 -1
  304. package/dist/index288.js +15 -15
  305. package/dist/index288.js.map +1 -1
  306. package/dist/index289.js +21 -125
  307. package/dist/index289.js.map +1 -1
  308. package/dist/index29.js +3 -56
  309. package/dist/index29.js.map +1 -1
  310. package/dist/index290.js +53 -5
  311. package/dist/index290.js.map +1 -1
  312. package/dist/index291.js +19 -64
  313. package/dist/index291.js.map +1 -1
  314. package/dist/index292.js +42 -14
  315. package/dist/index292.js.map +1 -1
  316. package/dist/index293.js +40 -14
  317. package/dist/index293.js.map +1 -1
  318. package/dist/index294.js +46 -8
  319. package/dist/index294.js.map +1 -1
  320. package/dist/index295.js +21 -11
  321. package/dist/index295.js.map +1 -1
  322. package/dist/index296.js +70 -5
  323. package/dist/index296.js.map +1 -1
  324. package/dist/index297.js +17 -3
  325. package/dist/index297.js.map +1 -1
  326. package/dist/index298.js +3 -10
  327. package/dist/index298.js.map +1 -1
  328. package/dist/index299.js +13 -7
  329. package/dist/index299.js.map +1 -1
  330. package/dist/index3.js +2 -2
  331. package/dist/index30.js +242 -3
  332. package/dist/index30.js.map +1 -1
  333. package/dist/index300.js +15 -130
  334. package/dist/index300.js.map +1 -1
  335. package/dist/index301.js +34 -277
  336. package/dist/index301.js.map +1 -1
  337. package/dist/index302.js +229 -389
  338. package/dist/index302.js.map +1 -1
  339. package/dist/index303.js +253 -5
  340. package/dist/index303.js.map +1 -1
  341. package/dist/index304.js +64 -48
  342. package/dist/index304.js.map +1 -1
  343. package/dist/index305.js +83 -11
  344. package/dist/index305.js.map +1 -1
  345. package/dist/index306.js +3 -27
  346. package/dist/index306.js.map +1 -1
  347. package/dist/index307.js +29 -11
  348. package/dist/index307.js.map +1 -1
  349. package/dist/index308.js +16 -4
  350. package/dist/index308.js.map +1 -1
  351. package/dist/index309.js +35 -15
  352. package/dist/index309.js.map +1 -1
  353. package/dist/index31.js +21 -239
  354. package/dist/index31.js.map +1 -1
  355. package/dist/index310.js +18 -4
  356. package/dist/index310.js.map +1 -1
  357. package/dist/index311.js +4 -5
  358. package/dist/index311.js.map +1 -1
  359. package/dist/index312.js +26 -11
  360. package/dist/index312.js.map +1 -1
  361. package/dist/index313.js +28 -63
  362. package/dist/index313.js.map +1 -1
  363. package/dist/index314.js +4 -9
  364. package/dist/index314.js.map +1 -1
  365. package/dist/index315.js +75 -151
  366. package/dist/index315.js.map +1 -1
  367. package/dist/index316.js +270 -30
  368. package/dist/index316.js.map +1 -1
  369. package/dist/index317.js +11 -11
  370. package/dist/index317.js.map +1 -1
  371. package/dist/index318.js +11 -50
  372. package/dist/index318.js.map +1 -1
  373. package/dist/index319.js +24 -8
  374. package/dist/index319.js.map +1 -1
  375. package/dist/index32.js +4 -23
  376. package/dist/index32.js.map +1 -1
  377. package/dist/index320.js +16 -11
  378. package/dist/index320.js.map +1 -1
  379. package/dist/index321.js +124 -42
  380. package/dist/index321.js.map +1 -1
  381. package/dist/index322.js +5 -97
  382. package/dist/index322.js.map +1 -1
  383. package/dist/index323.js +61 -82
  384. package/dist/index323.js.map +1 -1
  385. package/dist/index324.js +12 -104
  386. package/dist/index324.js.map +1 -1
  387. package/dist/index325.js +7 -52
  388. package/dist/index325.js.map +1 -1
  389. package/dist/index326.js +5 -11
  390. package/dist/index326.js.map +1 -1
  391. package/dist/index327.js +3 -4
  392. package/dist/index327.js.map +1 -1
  393. package/dist/index328.js +10 -37
  394. package/dist/index328.js.map +1 -1
  395. package/dist/index329.js +7 -8
  396. package/dist/index329.js.map +1 -1
  397. package/dist/index33.js +6 -3
  398. package/dist/index33.js.map +1 -1
  399. package/dist/index330.js +385 -121
  400. package/dist/index330.js.map +1 -1
  401. package/dist/index331.js +5 -18
  402. package/dist/index331.js.map +1 -1
  403. package/dist/index332.js +51 -14
  404. package/dist/index332.js.map +1 -1
  405. package/dist/index333.js +11 -3
  406. package/dist/index333.js.map +1 -1
  407. package/dist/index334.js +25 -34
  408. package/dist/index334.js.map +1 -1
  409. package/dist/index335.js +11 -20
  410. package/dist/index335.js.map +1 -1
  411. package/dist/index336.js +154 -9
  412. package/dist/index336.js.map +1 -1
  413. package/dist/index337.js +32 -8
  414. package/dist/index337.js.map +1 -1
  415. package/dist/index338.js +11 -24
  416. package/dist/index338.js.map +1 -1
  417. package/dist/index339.js +46 -25
  418. package/dist/index339.js.map +1 -1
  419. package/dist/index34.js +38 -8
  420. package/dist/index34.js.map +1 -1
  421. package/dist/index340.js +9 -16
  422. package/dist/index340.js.map +1 -1
  423. package/dist/index341.js +11 -4
  424. package/dist/index341.js.map +1 -1
  425. package/dist/index342.js +43 -17
  426. package/dist/index342.js.map +1 -1
  427. package/dist/index343.js +97 -12
  428. package/dist/index343.js.map +1 -1
  429. package/dist/index344.js +86 -8
  430. package/dist/index344.js.map +1 -1
  431. package/dist/index345.js +105 -11
  432. package/dist/index345.js.map +1 -1
  433. package/dist/index346.js +51 -7
  434. package/dist/index346.js.map +1 -1
  435. package/dist/index347.js +10 -12
  436. package/dist/index347.js.map +1 -1
  437. package/dist/index348.js +4 -3
  438. package/dist/index348.js.map +1 -1
  439. package/dist/index349.js +37 -3
  440. package/dist/index349.js.map +1 -1
  441. package/dist/index35.js +74 -35
  442. package/dist/index35.js.map +1 -1
  443. package/dist/index350.js +9 -4
  444. package/dist/index350.js.map +1 -1
  445. package/dist/index351.js +136 -15
  446. package/dist/index351.js.map +1 -1
  447. package/dist/index352.js +17 -11
  448. package/dist/index352.js.map +1 -1
  449. package/dist/index353.js +15 -5
  450. package/dist/index353.js.map +1 -1
  451. package/dist/index354.js +4 -5
  452. package/dist/index354.js.map +1 -1
  453. package/dist/index355.js +37 -3
  454. package/dist/index355.js.map +1 -1
  455. package/dist/index356.js +19 -7
  456. package/dist/index356.js.map +1 -1
  457. package/dist/index357.js +9 -51
  458. package/dist/index357.js.map +1 -1
  459. package/dist/index358.js +8 -16
  460. package/dist/index358.js.map +1 -1
  461. package/dist/index359.js +25 -8
  462. package/dist/index359.js.map +1 -1
  463. package/dist/index36.js +20 -74
  464. package/dist/index36.js.map +1 -1
  465. package/dist/index360.js +28 -5
  466. package/dist/index360.js.map +1 -1
  467. package/dist/index361.js +15 -19
  468. package/dist/index361.js.map +1 -1
  469. package/dist/index362.js +5 -45
  470. package/dist/index362.js.map +1 -1
  471. package/dist/index363.js +16 -16
  472. package/dist/index363.js.map +1 -1
  473. package/dist/index364.js +13 -5
  474. package/dist/index364.js.map +1 -1
  475. package/dist/index365.js +7 -199
  476. package/dist/index365.js.map +1 -1
  477. package/dist/index366.js +27 -74
  478. package/dist/index366.js.map +1 -1
  479. package/dist/index367.js +131 -117
  480. package/dist/index367.js.map +1 -1
  481. package/dist/index368.js +10 -15
  482. package/dist/index368.js.map +1 -1
  483. package/dist/index369.js +44 -59
  484. package/dist/index369.js.map +1 -1
  485. package/dist/index37.js +33 -18
  486. package/dist/index37.js.map +1 -1
  487. package/dist/index370.js +3 -66
  488. package/dist/index370.js.map +1 -1
  489. package/dist/index371.js +21 -11
  490. package/dist/index371.js.map +1 -1
  491. package/dist/index372.js +74 -20
  492. package/dist/index372.js.map +1 -1
  493. package/dist/index373.js +12 -145
  494. package/dist/index373.js.map +1 -1
  495. package/dist/index374.js +3 -79
  496. package/dist/index374.js.map +1 -1
  497. package/dist/index375.js +73 -61
  498. package/dist/index375.js.map +1 -1
  499. package/dist/index376.js +200 -4
  500. package/dist/index376.js.map +1 -1
  501. package/dist/index377.js +71 -20
  502. package/dist/index377.js.map +1 -1
  503. package/dist/index378.js +35 -4
  504. package/dist/index378.js.map +1 -1
  505. package/dist/index379.js +7 -5
  506. package/dist/index379.js.map +1 -1
  507. package/dist/index38.js +26 -36
  508. package/dist/index38.js.map +1 -1
  509. package/dist/index380.js +16 -4
  510. package/dist/index380.js.map +1 -1
  511. package/dist/index381.js +123 -15
  512. package/dist/index381.js.map +1 -1
  513. package/dist/index382.js +4 -9
  514. package/dist/index382.js.map +1 -1
  515. package/dist/index383.js +11 -5
  516. package/dist/index383.js.map +1 -1
  517. package/dist/index384.js +5 -4
  518. package/dist/index384.js.map +1 -1
  519. package/dist/index385.js +3 -546
  520. package/dist/index385.js.map +1 -1
  521. package/dist/index386.js +20 -46
  522. package/dist/index386.js.map +1 -1
  523. package/dist/index387.js +45 -18
  524. package/dist/index387.js.map +1 -1
  525. package/dist/index388.js +18 -6
  526. package/dist/index388.js.map +1 -1
  527. package/dist/index389.js +5 -8
  528. package/dist/index389.js.map +1 -1
  529. package/dist/index39.js +21 -26
  530. package/dist/index39.js.map +1 -1
  531. package/dist/index390.js +4 -6
  532. package/dist/index390.js.map +1 -1
  533. package/dist/index391.js +20 -7
  534. package/dist/index391.js.map +1 -1
  535. package/dist/index392.js +4 -11
  536. package/dist/index392.js.map +1 -1
  537. package/dist/index393.js +4 -8
  538. package/dist/index393.js.map +1 -1
  539. package/dist/index394.js +4 -13
  540. package/dist/index394.js.map +1 -1
  541. package/dist/index395.js +16 -3
  542. package/dist/index395.js.map +1 -1
  543. package/dist/index396.js +9 -3
  544. package/dist/index396.js.map +1 -1
  545. package/dist/index397.js +6 -7
  546. package/dist/index397.js.map +1 -1
  547. package/dist/index398.js +4 -12
  548. package/dist/index398.js.map +1 -1
  549. package/dist/index399.js +543 -44
  550. package/dist/index399.js.map +1 -1
  551. package/dist/index4.js +2 -2
  552. package/dist/index40.js +56 -20
  553. package/dist/index40.js.map +1 -1
  554. package/dist/index400.js +44 -135
  555. package/dist/index400.js.map +1 -1
  556. package/dist/index401.js +17 -8
  557. package/dist/index401.js.map +1 -1
  558. package/dist/index402.js +6 -27
  559. package/dist/index402.js.map +1 -1
  560. package/dist/index403.js +7 -3
  561. package/dist/index403.js.map +1 -1
  562. package/dist/index404.js +6 -21
  563. package/dist/index404.js.map +1 -1
  564. package/dist/index405.js +7 -75
  565. package/dist/index405.js.map +1 -1
  566. package/dist/index406.js +12 -12
  567. package/dist/index406.js.map +1 -1
  568. package/dist/index407.js +8 -3
  569. package/dist/index407.js.map +1 -1
  570. package/dist/index408.js +12 -71
  571. package/dist/index408.js.map +1 -1
  572. package/dist/index409.js +3 -36
  573. package/dist/index409.js.map +1 -1
  574. package/dist/index41.js +51 -59
  575. package/dist/index41.js.map +1 -1
  576. package/dist/index410.js +14 -15
  577. package/dist/index410.js.map +1 -1
  578. package/dist/index411.js +491 -4
  579. package/dist/index411.js.map +1 -1
  580. package/dist/index412.js +3 -56
  581. package/dist/index412.js.map +1 -1
  582. package/dist/index413.js +3 -68
  583. package/dist/index413.js.map +1 -1
  584. package/dist/index414.js +5 -31
  585. package/dist/index414.js.map +1 -1
  586. package/dist/index415.js +56 -9
  587. package/dist/index415.js.map +1 -1
  588. package/dist/index416.js +61 -146
  589. package/dist/index416.js.map +1 -1
  590. package/dist/index417.js +26 -103
  591. package/dist/index417.js.map +1 -1
  592. package/dist/index418.js +9 -8
  593. package/dist/index418.js.map +1 -1
  594. package/dist/index419.js +153 -2
  595. package/dist/index419.js.map +1 -1
  596. package/dist/index42.js +21 -50
  597. package/dist/index42.js.map +1 -1
  598. package/dist/index420.js +107 -43
  599. package/dist/index420.js.map +1 -1
  600. package/dist/index421.js +32 -55
  601. package/dist/index421.js.map +1 -1
  602. package/dist/index422.js +6 -6
  603. package/dist/index422.js.map +1 -1
  604. package/dist/index424.js +38 -49
  605. package/dist/index424.js.map +1 -1
  606. package/dist/index425.js +50 -50
  607. package/dist/index425.js.map +1 -1
  608. package/dist/index426.js +8 -3
  609. package/dist/index426.js.map +1 -1
  610. package/dist/index427.js +2 -15
  611. package/dist/index427.js.map +1 -1
  612. package/dist/index428.js +50 -487
  613. package/dist/index428.js.map +1 -1
  614. package/dist/index429.js +55 -32
  615. package/dist/index429.js.map +1 -1
  616. package/dist/index43.js +127 -18
  617. package/dist/index43.js.map +1 -1
  618. package/dist/index430.js +16 -2
  619. package/dist/index430.js.map +1 -1
  620. package/dist/index431.js +29 -2
  621. package/dist/index431.js.map +1 -1
  622. package/dist/index432.js +13 -2
  623. package/dist/index432.js.map +1 -1
  624. package/dist/index433.js +7 -2
  625. package/dist/index433.js.map +1 -1
  626. package/dist/index434.js +2 -16
  627. package/dist/index434.js.map +1 -1
  628. package/dist/index435.js +2 -29
  629. package/dist/index435.js.map +1 -1
  630. package/dist/index436.js +2 -13
  631. package/dist/index436.js.map +1 -1
  632. package/dist/index437.js +2 -7
  633. package/dist/index437.js.map +1 -1
  634. package/dist/index44.js +39 -122
  635. package/dist/index44.js.map +1 -1
  636. package/dist/index45.js +85 -42
  637. package/dist/index45.js.map +1 -1
  638. package/dist/index46.js +123 -87
  639. package/dist/index46.js.map +1 -1
  640. package/dist/index47.js +5 -126
  641. package/dist/index47.js.map +1 -1
  642. package/dist/index48.js +332 -5
  643. package/dist/index48.js.map +1 -1
  644. package/dist/index49.js +246 -321
  645. package/dist/index49.js.map +1 -1
  646. package/dist/index5.js +2 -2
  647. package/dist/index50.js +23 -254
  648. package/dist/index50.js.map +1 -1
  649. package/dist/index51.js +129 -25
  650. package/dist/index51.js.map +1 -1
  651. package/dist/index52.js +24 -129
  652. package/dist/index52.js.map +1 -1
  653. package/dist/index53.js +19 -22
  654. package/dist/index53.js.map +1 -1
  655. package/dist/index54.js +134 -19
  656. package/dist/index54.js.map +1 -1
  657. package/dist/index55.js +30 -133
  658. package/dist/index55.js.map +1 -1
  659. package/dist/index56.js +24 -30
  660. package/dist/index56.js.map +1 -1
  661. package/dist/index57.js +38 -26
  662. package/dist/index57.js.map +1 -1
  663. package/dist/index58.js +19 -39
  664. package/dist/index58.js.map +1 -1
  665. package/dist/index59.js +133 -18
  666. package/dist/index59.js.map +1 -1
  667. package/dist/index6.js +4 -4
  668. package/dist/index60.js +49 -134
  669. package/dist/index60.js.map +1 -1
  670. package/dist/index61.js +25 -48
  671. package/dist/index61.js.map +1 -1
  672. package/dist/index62.js +57 -28
  673. package/dist/index62.js.map +1 -1
  674. package/dist/index63.js +56 -57
  675. package/dist/index63.js.map +1 -1
  676. package/dist/index64.js +5 -5
  677. package/dist/index64.js.map +1 -1
  678. package/dist/index66.js +22 -10
  679. package/dist/index66.js.map +1 -1
  680. package/dist/index67.js +232 -17
  681. package/dist/index67.js.map +1 -1
  682. package/dist/index68.js +5 -5
  683. package/dist/index68.js.map +1 -1
  684. package/dist/index7.js +11 -11
  685. package/dist/index70.js +10 -22
  686. package/dist/index70.js.map +1 -1
  687. package/dist/index71.js +17 -232
  688. package/dist/index71.js.map +1 -1
  689. package/dist/index76.js +1 -1
  690. package/dist/index77.js +2 -2
  691. package/dist/index78.js +2 -2
  692. package/dist/index8.js +2 -2
  693. package/dist/index9.js +1 -1
  694. package/package.json +1 -1
package/dist/index264.js CHANGED
@@ -1,180 +1,33 @@
1
- import * as a from "react";
2
- import "react-dom";
3
- import { EMPTY_OBJECT as f } from "./index241.js";
4
- import { useId as T } from "./index368.js";
5
- import { useStableCallback as p } from "./index239.js";
6
- import { useIsoLayoutEffect as s } from "./index238.js";
7
- import { FOCUSABLE_ATTRIBUTE as v } from "./index397.js";
8
- import { useFloatingParentNodeId as C } from "./index406.js";
9
- import { useSyncedFloatingRootContext as E } from "./index409.js";
10
- import { useTransitionStatus as I } from "./index246.js";
11
- import { useOpenChangeComplete as O } from "./index249.js";
12
- import { createChangeEventDetails as S } from "./index248.js";
13
- import { none as P } from "./index266.js";
14
- const L = {
15
- tabIndex: -1,
16
- [v]: ""
17
- };
18
- function z(e) {
19
- return (t) => t === "touch" ? e.current : !0;
20
- }
21
- function V(e, t, i = !1) {
22
- const r = T(), u = C() != null, o = a.useRef(null);
23
- e === void 0 && o.current === null && (o.current = t(r, u));
24
- const n = e ?? o.current;
25
- return E({
26
- popupStore: n,
27
- treatPopupAsFloatingElement: i,
28
- floatingRootContext: n.state.floatingRootContext,
29
- floatingId: r,
30
- nested: u,
31
- onOpenChange: n.setOpen
32
- }), {
33
- store: n,
34
- internalStore: o.current
35
- };
36
- }
37
- function R(e, t) {
38
- const i = a.useRef(null), r = a.useRef(null);
39
- return a.useCallback((u) => {
40
- if (e === void 0)
41
- return;
42
- let o = !1;
43
- if (i.current !== null) {
44
- const n = i.current, g = r.current, l = t.context.triggerElements.getById(n);
45
- g && l === g && (t.context.triggerElements.delete(n), o = !0), i.current = null, r.current = null;
46
- }
47
- if (u !== null && (i.current = e, r.current = u, t.context.triggerElements.add(e, u), o = !0), o) {
48
- const n = t.context.triggerElements.size;
49
- t.select("open") && t.state.triggerCount !== n && t.set("triggerCount", n);
50
- }
51
- }, [t, e]);
52
- }
53
- function j(e, t, i, r = !1) {
54
- t ? e.preventUnmountingOnClose = !1 : r && (e.preventUnmountingOnClose = !0);
55
- const u = i?.id ?? null;
56
- (u || t) && (e.activeTriggerId = u, e.activeTriggerElement = i ?? null);
57
- }
58
- function q(e, t, i, r) {
59
- const u = i.useState("isMountedByTrigger", e), o = R(e, i), n = p((g) => {
60
- if (o(g), !g)
61
- return;
62
- const l = i.select("open"), c = i.select("activeTriggerId");
63
- if (c === e) {
64
- i.update({
65
- activeTriggerElement: g,
66
- ...l ? r : null
67
- });
68
- return;
1
+ import { SafeReact as a } from "./index272.js";
2
+ import { useRefWithInit as c } from "./index284.js";
3
+ const n = a.useInsertionEffect, r = (
4
+ // React 17 doesn't have useInsertionEffect.
5
+ n && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
6
+ n !== a.useLayoutEffect ? n : (e) => e()
7
+ );
8
+ function i(e) {
9
+ const t = c(o).current;
10
+ return t.next = e, r(t.effect), t.trampoline;
11
+ }
12
+ function o() {
13
+ const e = {
14
+ next: void 0,
15
+ callback: f,
16
+ trampoline: (...t) => e.callback?.(...t),
17
+ effect: () => {
18
+ e.callback = e.next;
69
19
  }
70
- c == null && l && i.update({
71
- activeTriggerId: e,
72
- activeTriggerElement: g,
73
- ...r
74
- });
75
- });
76
- return s(() => {
77
- u && i.update({
78
- activeTriggerElement: t.current,
79
- ...r
80
- });
81
- }, [u, i, t, ...Object.values(r)]), {
82
- registerTrigger: n,
83
- isMountedByThisTrigger: u
84
20
  };
21
+ return e;
85
22
  }
86
- function w(e, t = {}) {
87
- const {
88
- closeOnActiveTriggerUnmount: i = !1
89
- } = t, r = e.useState("open"), u = e.useState("triggerCount");
90
- s(() => {
91
- if (!r) {
92
- e.state.triggerCount !== 0 && e.set("triggerCount", 0);
93
- return;
94
- }
95
- const o = e.context.triggerElements.size, n = {};
96
- e.state.triggerCount !== o && (n.triggerCount = o);
97
- const g = e.select("activeTriggerId");
98
- let l = null;
99
- if (g) {
100
- const c = e.context.triggerElements.getById(g);
101
- c ? c !== e.state.activeTriggerElement && (n.activeTriggerElement = c) : l = g;
102
- }
103
- if (!l && !g && o === 1) {
104
- const c = e.context.triggerElements.entries().next();
105
- if (!c.done) {
106
- const [m, d] = c.value;
107
- n.activeTriggerId = m, n.activeTriggerElement = d;
108
- }
109
- }
110
- (n.triggerCount !== void 0 || n.activeTriggerId !== void 0 || n.activeTriggerElement !== void 0) && e.update(n), l && i && queueMicrotask(() => {
111
- if (e.select("open") && e.select("activeTriggerId") === l && !e.context.triggerElements.getById(l)) {
112
- const c = S(P);
113
- e.setOpen(!1, c), c.isCanceled || e.update({
114
- activeTriggerId: null,
115
- activeTriggerElement: null
116
- });
117
- }
118
- });
119
- }, [r, e, u, i]);
120
- }
121
- function J(e, t, i) {
122
- const {
123
- mounted: r,
124
- setMounted: u,
125
- transitionStatus: o
126
- } = I(e), n = t.useState("preventUnmountingOnClose"), g = e ? !1 : n;
127
- t.useSyncedValues({
128
- mounted: r,
129
- transitionStatus: o,
130
- preventUnmountingOnClose: g
131
- });
132
- const l = p(() => {
133
- u(!1), t.update({
134
- activeTriggerId: null,
135
- activeTriggerElement: null,
136
- mounted: !1,
137
- preventUnmountingOnClose: !1
138
- }), t.context.onOpenChangeComplete?.(!1);
139
- });
140
- return O({
141
- enabled: r && !e && !g,
142
- open: e,
143
- ref: t.context.popupRef,
144
- onComplete() {
145
- e || l();
146
- }
147
- }), {
148
- forceUnmount: l,
149
- transitionStatus: o
150
- };
151
- }
152
- function N(e, t) {
153
- e.useSyncedValues(t), s(() => () => {
154
- e.update({
155
- activeTriggerProps: f,
156
- inactiveTriggerProps: f,
157
- popupProps: f
158
- });
159
- }, [e]);
160
- }
161
- function Y(e, t) {
162
- s(() => {
163
- !t && e.state.openMethod !== null && e.set("openMethod", null);
164
- }, [t, e]), s(() => () => {
165
- e.state.openMethod !== null && e.set("openMethod", null);
166
- }, [e]);
23
+ function f() {
24
+ if (process.env.NODE_ENV !== "production")
25
+ throw (
26
+ /* minify-error-disabled */
27
+ new Error("Base UI: Cannot call an event handler while rendering.")
28
+ );
167
29
  }
168
30
  export {
169
- L as FOCUSABLE_POPUP_PROPS,
170
- z as createDefaultInitialFocus,
171
- j as setPopupOpenState,
172
- w as useImplicitActiveTrigger,
173
- J as useOpenStateTransitions,
174
- N as usePopupInteractionProps,
175
- Y as usePopupRootSync,
176
- V as usePopupStore,
177
- q as useTriggerDataForwarding,
178
- R as useTriggerRegistration
31
+ i as useStableCallback
179
32
  };
180
33
  //# sourceMappingURL=index264.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index264.js","sources":["../../../node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useId } from '@base-ui/utils/useId';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { FOCUSABLE_ATTRIBUTE } from \"../../floating-ui-react/utils/constants.mjs\";\nimport { useFloatingParentNodeId } from \"../../floating-ui-react/components/FloatingTree.mjs\";\nimport { useSyncedFloatingRootContext } from \"../../floating-ui-react/hooks/useSyncedFloatingRootContext.mjs\";\nimport { useTransitionStatus } from \"../../internals/useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"../../internals/useOpenChangeComplete.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nexport const FOCUSABLE_POPUP_PROPS = {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n};\n\n/**\n * Returns the default `initialFocus` resolver for a popup. When opened by touch it focuses the\n * popup element itself to prevent the virtual keyboard from opening (required for Android\n * specifically; iOS handles this automatically). Otherwise it falls back to the default behavior.\n */\nexport function createDefaultInitialFocus(popupRef) {\n return interactionType => interactionType === 'touch' ? popupRef.current : true;\n}\nexport function usePopupStore(externalStore, createStore, treatPopupAsFloatingElement = false) {\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n const internalStoreRef = React.useRef(null);\n if (externalStore === undefined && internalStoreRef.current === null) {\n internalStoreRef.current = createStore(floatingId, nested);\n }\n const store = externalStore ?? internalStoreRef.current;\n useSyncedFloatingRootContext({\n popupStore: store,\n treatPopupAsFloatingElement,\n floatingRootContext: store.state.floatingRootContext,\n floatingId,\n nested,\n onOpenChange: store.setOpen\n });\n return {\n store,\n internalStore: internalStoreRef.current\n };\n}\n\n/**\n * Returns a callback ref that registers/unregisters the trigger element in the store.\n *\n * @param store The Store instance where the trigger should be registered.\n */\nexport function useTriggerRegistration(id, store) {\n // Keep track of the currently registered element to unregister it on unmount or id change.\n const registeredElementIdRef = React.useRef(null);\n const registeredElementRef = React.useRef(null);\n return React.useCallback(element => {\n if (id === undefined) {\n return;\n }\n let shouldSyncTriggerCount = false;\n if (registeredElementIdRef.current !== null) {\n const registeredId = registeredElementIdRef.current;\n const registeredElement = registeredElementRef.current;\n const currentElement = store.context.triggerElements.getById(registeredId);\n if (registeredElement && currentElement === registeredElement) {\n store.context.triggerElements.delete(registeredId);\n shouldSyncTriggerCount = true;\n }\n registeredElementIdRef.current = null;\n registeredElementRef.current = null;\n }\n if (element !== null) {\n registeredElementIdRef.current = id;\n registeredElementRef.current = element;\n store.context.triggerElements.add(id, element);\n shouldSyncTriggerCount = true;\n }\n if (shouldSyncTriggerCount) {\n const triggerCount = store.context.triggerElements.size;\n if (store.select('open') && store.state.triggerCount !== triggerCount) {\n store.set('triggerCount', triggerCount);\n }\n }\n }, [store, id]);\n}\nexport function setPopupOpenState(state, open, trigger, preventUnmountOnClose = false) {\n if (open) {\n // Opening starts a new close cycle, so clear any previous request to keep the popup mounted.\n state.preventUnmountingOnClose = false;\n } else if (preventUnmountOnClose) {\n state.preventUnmountingOnClose = true;\n }\n const triggerId = trigger?.id ?? null;\n\n // If a popup is closing, the `trigger` may be undefined.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n if (triggerId || open) {\n state.activeTriggerId = triggerId;\n state.activeTriggerElement = trigger ?? null;\n }\n}\nexport function attachPreventUnmountOnClose(eventDetails) {\n let preventUnmountOnClose = false;\n eventDetails.preventUnmountOnClose = () => {\n preventUnmountOnClose = true;\n };\n return () => preventUnmountOnClose;\n}\n\n/**\n * Runs the shared open-change sequence for a popup store: notifies `onOpenChange`,\n * honors cancellation, dispatches the floating root change, maps the reason to an\n * `instantType`, and commits the state update (synchronously for hover so\n * `getAnimations()` observes it). Stores supply their own differences via\n * `extraState` (e.g. the last change reason) and `onBeforeDispatch` (e.g. updating\n * inline-rect coordinates).\n */\nexport function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {\n const reason = eventDetails.reason;\n const isHover = reason === REASONS.triggerHover;\n const isFocusOpen = nextOpen && reason === REASONS.triggerFocus;\n const isDismissClose = !nextOpen && (reason === REASONS.triggerPress || reason === REASONS.escapeKey);\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);\n store.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n options.onBeforeDispatch?.();\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n // Spread `extraState` first so `open` always reflects `nextOpen`, keeping it in\n // sync with the value already passed to `dispatchOpenChange`/`setPopupOpenState`.\n const updatedState = {\n ...options.extraState,\n open: nextOpen\n };\n if (isFocusOpen) {\n updatedState.instantType = 'focus';\n } else if (isDismissClose) {\n updatedState.instantType = 'dismiss';\n } else if (isHover) {\n updatedState.instantType = undefined;\n }\n setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());\n store.update(updatedState);\n };\n if (isHover) {\n // Flush synchronously for hover so `node.getAnimations()` sees the new state.\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n}\nexport function useInitialOpenSync(store, openProp, defaultOpen, defaultTriggerId) {\n useOnFirstRender(() => {\n if (openProp === undefined && store.state.open === false && defaultOpen) {\n // Avoid notifying detached trigger subscribers while the Root is rendering.\n store.state = {\n ...store.state,\n open: true,\n activeTriggerId: defaultTriggerId,\n preventUnmountingOnClose: false\n };\n }\n });\n}\n\n/**\n * Sets up trigger data forwarding to the store.\n *\n * @param triggerId Id of the trigger.\n * @param triggerElementRef Ref for the trigger DOM element.\n * @param store The Store instance managing the popup state.\n * @param stateUpdates An object with state updates to apply when the trigger is active.\n */\nexport function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {\n const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);\n const baseRegisterTrigger = useTriggerRegistration(triggerId, store);\n const registerTrigger = useStableCallback(element => {\n baseRegisterTrigger(element);\n if (!element) {\n return;\n }\n const open = store.select('open');\n const activeTriggerId = store.select('activeTriggerId');\n if (activeTriggerId === triggerId) {\n store.update({\n activeTriggerElement: element,\n ...(open ? stateUpdates : null)\n });\n return;\n }\n if (activeTriggerId == null && open) {\n // If a popup is already open, a detached trigger can mount before any active trigger\n // has been established. Claim the first registered trigger so trigger-owned focus\n // management and ARIA relationships work.\n store.update({\n activeTriggerId: triggerId,\n activeTriggerElement: element,\n ...stateUpdates\n });\n }\n });\n useIsoLayoutEffect(() => {\n if (isMountedByThisTrigger) {\n store.update({\n activeTriggerElement: triggerElementRef.current,\n ...stateUpdates\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);\n return {\n registerTrigger,\n isMountedByThisTrigger\n };\n}\n/**\n * Keeps trigger registration state synchronized while the popup is open.\n *\n * When a popup opens without an explicit trigger id and exactly one trigger is registered, that\n * trigger is claimed as the active trigger. When the active trigger id is still registered but its\n * element changed, the active element is refreshed. When the active trigger unregisters, the\n * default path preserves existing ownership so non-closing popup families do not silently claim a\n * different trigger while staying open.\n *\n * If `closeOnActiveTriggerUnmount` is enabled, unregistering the active trigger requests a close\n * after a microtask so a same-tick replacement trigger with the same id can register first.\n *\n * This should be called on the Root part.\n *\n * @param store The Store instance managing the popup state.\n * @param options Options for active trigger unmount behavior.\n */\nexport function useImplicitActiveTrigger(store, options = {}) {\n const {\n closeOnActiveTriggerUnmount = false\n } = options;\n const open = store.useState('open');\n const reactiveTriggerCount = store.useState('triggerCount');\n useIsoLayoutEffect(() => {\n if (!open) {\n if (store.state.triggerCount !== 0) {\n store.set('triggerCount', 0);\n }\n return;\n }\n const triggerCount = store.context.triggerElements.size;\n const stateUpdates = {};\n if (store.state.triggerCount !== triggerCount) {\n stateUpdates.triggerCount = triggerCount;\n }\n const activeTriggerId = store.select('activeTriggerId');\n let lostActiveTriggerId = null;\n if (activeTriggerId) {\n const activeTriggerElement = store.context.triggerElements.getById(activeTriggerId);\n if (!activeTriggerElement) {\n lostActiveTriggerId = activeTriggerId;\n } else if (activeTriggerElement !== store.state.activeTriggerElement) {\n stateUpdates.activeTriggerElement = activeTriggerElement;\n }\n }\n if (!lostActiveTriggerId && !activeTriggerId && triggerCount === 1) {\n const iteratorResult = store.context.triggerElements.entries().next();\n if (!iteratorResult.done) {\n const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;\n stateUpdates.activeTriggerId = implicitTriggerId;\n stateUpdates.activeTriggerElement = implicitTriggerElement;\n }\n }\n if (stateUpdates.triggerCount !== undefined || stateUpdates.activeTriggerId !== undefined || stateUpdates.activeTriggerElement !== undefined) {\n store.update(stateUpdates);\n }\n if (lostActiveTriggerId) {\n if (closeOnActiveTriggerUnmount) {\n // Defer so a same-tick replacement trigger with the same id can register first.\n queueMicrotask(() => {\n if (store.select('open') && store.select('activeTriggerId') === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {\n const eventDetails = createChangeEventDetails(REASONS.none);\n store.setOpen(false, eventDetails);\n // If closing is canceled, keep the previous active trigger ownership for the\n // still-open popup instead of claiming another trigger implicitly.\n if (!eventDetails.isCanceled) {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null\n });\n }\n }\n });\n }\n }\n }, [open, store, reactiveTriggerCount, closeOnActiveTriggerUnmount]);\n}\n\n/**\n * Manages the mounted state of the popup.\n * Sets up the transition status listeners and handles unmounting when needed.\n * Updates the `mounted`, `transitionStatus`, and `preventUnmountingOnClose` states in the store.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n * @param onUnmount Optional callback to be called when the popup is unmounted.\n *\n * @returns A function to forcibly unmount the popup.\n */\nexport function useOpenStateTransitions(open, store, onUnmount) {\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n const preventUnmountingOnClose = store.useState('preventUnmountingOnClose');\n // Opening starts a new close cycle. Clear during render so the close-completion hook below\n // reads the synchronized value on the same pass.\n const syncedPreventUnmountingOnClose = open ? false : preventUnmountingOnClose;\n store.useSyncedValues({\n mounted,\n transitionStatus,\n preventUnmountingOnClose: syncedPreventUnmountingOnClose\n });\n const forceUnmount = useStableCallback(() => {\n setMounted(false);\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null,\n mounted: false,\n preventUnmountingOnClose: false\n });\n onUnmount?.();\n store.context.onOpenChangeComplete?.(false);\n });\n useOpenChangeComplete({\n enabled: mounted && !open && !syncedPreventUnmountingOnClose,\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (!open) {\n forceUnmount();\n }\n }\n });\n return {\n forceUnmount,\n transitionStatus\n };\n}\nexport function usePopupInteractionProps(store, statePart) {\n store.useSyncedValues(statePart);\n useIsoLayoutEffect(() => () => {\n store.update({\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n });\n }, [store]);\n}\nexport function usePopupRootSync(store, open) {\n useIsoLayoutEffect(() => {\n if (!open && store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [open, store]);\n useIsoLayoutEffect(() => () => {\n if (store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [store]);\n}"],"names":["FOCUSABLE_POPUP_PROPS","FOCUSABLE_ATTRIBUTE","createDefaultInitialFocus","popupRef","interactionType","usePopupStore","externalStore","createStore","treatPopupAsFloatingElement","floatingId","useId","nested","useFloatingParentNodeId","internalStoreRef","React","store","useSyncedFloatingRootContext","useTriggerRegistration","id","registeredElementIdRef","registeredElementRef","element","shouldSyncTriggerCount","registeredId","registeredElement","currentElement","triggerCount","setPopupOpenState","state","open","trigger","preventUnmountOnClose","triggerId","useTriggerDataForwarding","triggerElementRef","stateUpdates","isMountedByThisTrigger","baseRegisterTrigger","registerTrigger","useStableCallback","activeTriggerId","useIsoLayoutEffect","useImplicitActiveTrigger","options","closeOnActiveTriggerUnmount","reactiveTriggerCount","lostActiveTriggerId","activeTriggerElement","iteratorResult","implicitTriggerId","implicitTriggerElement","eventDetails","createChangeEventDetails","REASONS.none","useOpenStateTransitions","onUnmount","mounted","setMounted","transitionStatus","useTransitionStatus","preventUnmountingOnClose","syncedPreventUnmountingOnClose","forceUnmount","useOpenChangeComplete","usePopupInteractionProps","statePart","EMPTY_OBJECT","usePopupRootSync"],"mappings":";;;;;;;;;;;;;AAgBY,MAACA,IAAwB;AAAA,EACnC,UAAU;AAAA,EACV,CAACC,CAAmB,GAAG;AACzB;AAOO,SAASC,EAA0BC,GAAU;AAClD,SAAO,CAAAC,MAAmBA,MAAoB,UAAUD,EAAS,UAAU;AAC7E;AACO,SAASE,EAAcC,GAAeC,GAAaC,IAA8B,IAAO;AAC7F,QAAMC,IAAaC,EAAK,GAClBC,IAASC,EAAuB,KAAM,MACtCC,IAAmBC,EAAM,OAAO,IAAI;AAC1C,EAAIR,MAAkB,UAAaO,EAAiB,YAAY,SAC9DA,EAAiB,UAAUN,EAAYE,GAAYE,CAAM;AAE3D,QAAMI,IAAQT,KAAiBO,EAAiB;AAChD,SAAAG,EAA6B;AAAA,IAC3B,YAAYD;AAAA,IACZ,6BAAAP;AAAA,IACA,qBAAqBO,EAAM,MAAM;AAAA,IACjC,YAAAN;AAAA,IACA,QAAAE;AAAA,IACA,cAAcI,EAAM;AAAA,EACxB,CAAG,GACM;AAAA,IACL,OAAAA;AAAA,IACA,eAAeF,EAAiB;AAAA,EACpC;AACA;AAOO,S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AAAA,EAC9B,CAAG;AACD,QAAMC,IAAevB,EAAkB,MAAM;AAC3C,IAAAkB,EAAW,EAAK,GAChB1C,EAAM,OAAO;AAAA,MACX,iBAAiB;AAAA,MACjB,sBAAsB;AAAA,MACtB,SAAS;AAAA,MACT,0BAA0B;AAAA,IAChC,CAAK,GAEDA,EAAM,QAAQ,uBAAuB,EAAK;AAAA,EAC5C,CAAC;AACD,SAAAgD,EAAsB;AAAA,IACpB,SAASP,KAAW,CAAC3B,KAAQ,CAACgC;AAAA,IAC9B,MAAAhC;AAAA,IACA,KAAKd,EAAM,QAAQ;AAAA,IACnB,aAAa;AACX,MAAKc,KACHiC,EAAY;AAAA,IAEhB;AAAA,EACJ,CAAG,GACM;AAAA,IACL,cAAAA;AAAA,IACA,kBAAAJ;AAAA,EACJ;AACA;AACO,SAASM,EAAyBjD,GAAOkD,GAAW;AACzD,EAAAlD,EAAM,gBAAgBkD,CAAS,GAC/BxB,EAAmB,MAAM,MAAM;AAC7B,IAAA1B,EAAM,OAAO;AAAA,MACX,oBAAoBmD;AAAA,MACpB,sBAAsBA;AAAA,MACtB,YAAYA;AAAA,IAClB,CAAK;AAAA,EACH,GAAG,CAACnD,CAAK,CAAC;AACZ;AACO,SAASoD,EAAiBpD,GAAOc,GAAM;AAC5C,EAAAY,EAAmB,MAAM;AACvB,IAAI,CAACZ,KAAQd,EAAM,MAAM,eAAe,QACtCA,EAAM,IAAI,cAAc,IAAI;AAAA,EAEhC,GAAG,CAACc,GAAMd,CAAK,CAAC,GAChB0B,EAAmB,MAAM,MAAM;AAC7B,IAAI1B,EAAM,MAAM,eAAe,QAC7BA,EAAM,IAAI,cAAc,IAAI;AAAA,EAEhC,GAAG,CAACA,CAAK,CAAC;AACZ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index264.js","sources":["../../../node_modules/@base-ui/utils/useStableCallback.mjs"],"sourcesContent":["'use client';\n\nimport { SafeReact } from \"./safeReact.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect =\n// React 17 doesn't have useInsertionEffect.\nuseInsertionEffect &&\n// Preact replaces useInsertionEffect with useLayoutEffect and fires too late.\nuseInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : fn => fn();\n/**\n * Stabilizes the function passed so it's always the same between renders.\n *\n * The function becomes non-reactive to any values it captures.\n * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.\n *\n * The function must only be called inside effects and event handlers, never during render (which throws an error).\n *\n * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.\n */\nexport function useStableCallback(callback) {\n const stable = useRefWithInit(createStableCallback).current;\n stable.next = callback;\n useSafeInsertionEffect(stable.effect);\n return stable.trampoline;\n}\nfunction createStableCallback() {\n const stable = {\n next: undefined,\n callback: assertNotCalled,\n trampoline: (...args) => stable.callback?.(...args),\n effect: () => {\n stable.callback = stable.next;\n }\n };\n return stable;\n}\nfunction assertNotCalled() {\n if (process.env.NODE_ENV !== 'production') {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');\n }\n}"],"names":["useInsertionEffect","SafeReact","useSafeInsertionEffect","fn","useStableCallback","callback","stable","useRefWithInit","createStableCallback","assertNotCalled","args"],"mappings":";;AAIA,MAAMA,IAAqBC,EAAU,oBAC/BC;AAAA;AAAA,EAENF;AAAA,EAEAA,MAAuBC,EAAU,kBAAkBD,IAAqB,CAAAG,MAAMA,EAAE;AAAA;AAWzE,SAASC,EAAkBC,GAAU;AAC1C,QAAMC,IAASC,EAAeC,CAAoB,EAAE;AACpD,SAAAF,EAAO,OAAOD,GACdH,EAAuBI,EAAO,MAAM,GAC7BA,EAAO;AAChB;AACA,SAASE,IAAuB;AAC9B,QAAMF,IAAS;AAAA,IACb,MAAM;AAAA,IACN,UAAUG;AAAA,IACV,YAAY,IAAIC,MAASJ,EAAO,WAAW,GAAGI,CAAI;AAAA,IAClD,QAAQ,MAAM;AACZ,MAAAJ,EAAO,WAAWA,EAAO;AAAA,IAC3B;AAAA,EACJ;AACE,SAAOA;AACT;AACA,SAASG,IAAkB;AACzB,MAAI,QAAQ,IAAI,aAAa;AAG3B;AAAA;AAAA,MAAiC,IAAI,MAAM,wDAAwD;AAAA;AAEvG;","x_google_ignoreList":[0]}
package/dist/index265.js CHANGED
@@ -1,87 +1,55 @@
1
- import { useStore as r } from "./index257.js";
2
- class n {
3
- /**
4
- * The current state of the store.
5
- * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
6
- * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
7
- * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
8
- *
9
- * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
10
- */
11
- // Internal state to handle recursive `setState()` calls
12
- constructor(t) {
13
- this.state = t, this.listeners = /* @__PURE__ */ new Set(), this.updateTick = 0;
14
- }
15
- /**
16
- * Registers a listener that will be called whenever the store's state changes.
17
- *
18
- * @param fn The listener function to be called on state changes.
19
- * @returns A function to unsubscribe the listener.
20
- */
21
- subscribe = (t) => (this.listeners.add(t), () => {
22
- this.listeners.delete(t);
23
- });
24
- /**
25
- * Returns the current state of the store.
26
- */
27
- getSnapshot = () => this.state;
28
- /**
29
- * Updates the entire store's state and notifies all registered listeners.
30
- *
31
- * @param newState The new state to set for the store.
32
- */
33
- setState(t) {
34
- if (this.state === t)
1
+ import * as l from "react-dom";
2
+ import { useAnimationFrame as b } from "./index323.js";
3
+ import { useStableCallback as A } from "./index264.js";
4
+ import { resolveRef as d } from "./index374.js";
5
+ import { TransitionStatusDataAttributes as h } from "./index152.js";
6
+ function y(c, f = !1, m = !0) {
7
+ const o = b();
8
+ return A((s, n = null) => {
9
+ o.cancel();
10
+ const a = d(c);
11
+ if (a == null)
35
12
  return;
36
- this.state = t, this.updateTick += 1;
37
- const s = this.updateTick;
38
- for (const e of this.listeners) {
39
- if (s !== this.updateTick)
40
- return;
41
- e(t);
13
+ const e = a, u = () => {
14
+ l.flushSync(s);
15
+ };
16
+ if (typeof e.getAnimations != "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
17
+ s();
18
+ return;
19
+ }
20
+ function i() {
21
+ Promise.all(e.getAnimations().map((t) => t.finished)).then(() => {
22
+ n?.aborted || u();
23
+ }).catch(() => {
24
+ if (m) {
25
+ n?.aborted || u();
26
+ return;
27
+ }
28
+ const t = e.getAnimations();
29
+ !n?.aborted && t.length > 0 && t.some((r) => r.pending || r.playState !== "finished") && i();
30
+ });
42
31
  }
43
- }
44
- /**
45
- * Merges the provided changes into the current state and notifies listeners if there are changes.
46
- *
47
- * @param changes An object containing the changes to apply to the current state.
48
- */
49
- update(t) {
50
- for (const s in t)
51
- if (!Object.is(this.state[s], t[s])) {
52
- this.setState({
53
- ...this.state,
54
- ...t
55
- });
32
+ if (f) {
33
+ const t = h.startingStyle;
34
+ if (!e.hasAttribute(t)) {
35
+ o.request(i);
56
36
  return;
57
37
  }
58
- }
59
- /**
60
- * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
61
- *
62
- * @param key The key in the store's state to update.
63
- * @param value The new value to set for the specified key.
64
- */
65
- set(t, s) {
66
- Object.is(this.state[t], s) || this.setState({
67
- ...this.state,
68
- [t]: s
69
- });
70
- }
71
- /**
72
- * Gives the state a new reference and updates all registered listeners.
73
- */
74
- notifyAll() {
75
- const t = {
76
- ...this.state
77
- };
78
- this.setState(t);
79
- }
80
- use(t, s, e, i) {
81
- return r(this, t, s, e, i);
82
- }
38
+ const r = new MutationObserver(() => {
39
+ e.hasAttribute(t) || (r.disconnect(), i());
40
+ });
41
+ r.observe(e, {
42
+ attributes: !0,
43
+ attributeFilter: [t]
44
+ }), n?.addEventListener("abort", () => r.disconnect(), {
45
+ once: !0
46
+ });
47
+ return;
48
+ }
49
+ o.request(i);
50
+ });
83
51
  }
84
52
  export {
85
- n as Store
53
+ y as useAnimationsFinished
86
54
  };
87
55
  //# sourceMappingURL=index265.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index265.js","sources":["../../../node_modules/@base-ui/utils/store/Store.mjs"],"sourcesContent":["import { useStore } from \"./useStore.mjs\";\n/**\n * A data store implementation that allows subscribing to state changes and updating the state.\n * It uses an observer pattern to notify subscribers when the state changes.\n */\nexport class Store {\n /**\n * The current state of the store.\n * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.\n * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).\n * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.\n *\n * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.\n */\n\n // Internal state to handle recursive `setState()` calls\n\n constructor(state) {\n this.state = state;\n this.listeners = new Set();\n this.updateTick = 0;\n }\n\n /**\n * Registers a listener that will be called whenever the store's state changes.\n *\n * @param fn The listener function to be called on state changes.\n * @returns A function to unsubscribe the listener.\n */\n subscribe = fn => {\n this.listeners.add(fn);\n return () => {\n this.listeners.delete(fn);\n };\n };\n\n /**\n * Returns the current state of the store.\n */\n getSnapshot = () => {\n return this.state;\n };\n\n /**\n * Updates the entire store's state and notifies all registered listeners.\n *\n * @param newState The new state to set for the store.\n */\n setState(newState) {\n if (this.state === newState) {\n return;\n }\n this.state = newState;\n this.updateTick += 1;\n const currentTick = this.updateTick;\n for (const listener of this.listeners) {\n if (currentTick !== this.updateTick) {\n // If the tick has changed, a recursive `setState` call has been made,\n // and it has already notified all listeners.\n return;\n }\n listener(newState);\n }\n }\n\n /**\n * Merges the provided changes into the current state and notifies listeners if there are changes.\n *\n * @param changes An object containing the changes to apply to the current state.\n */\n update(changes) {\n for (const key in changes) {\n if (!Object.is(this.state[key], changes[key])) {\n this.setState({\n ...this.state,\n ...changes\n });\n return;\n }\n }\n }\n\n /**\n * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.\n *\n * @param key The key in the store's state to update.\n * @param value The new value to set for the specified key.\n */\n set(key, value) {\n if (!Object.is(this.state[key], value)) {\n this.setState({\n ...this.state,\n [key]: value\n });\n }\n }\n\n /**\n * Gives the state a new reference and updates all registered listeners.\n */\n notifyAll() {\n const newState = {\n ...this.state\n };\n this.setState(newState);\n }\n use(selector, a1, a2, a3) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(this, selector, a1, a2, a3);\n }\n}"],"names":["Store","state","fn","newState","currentTick","listener","changes","key","value","selector","a1","a2","a3","useStore"],"mappings":";AAKO,MAAMA,EAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYjB,YAAYC,GAAO;AACjB,SAAK,QAAQA,GACb,KAAK,YAAY,oBAAI,IAAG,GACxB,KAAK,aAAa;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,YAAY,CAAAC,OACV,KAAK,UAAU,IAAIA,CAAE,GACd,MAAM;AACX,SAAK,UAAU,OAAOA,CAAE;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAMF,cAAc,MACL,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQd,SAASC,GAAU;AACjB,QAAI,KAAK,UAAUA;AACjB;AAEF,SAAK,QAAQA,GACb,KAAK,cAAc;AACnB,UAAMC,IAAc,KAAK;AACzB,eAAWC,KAAY,KAAK,WAAW;AACrC,UAAID,MAAgB,KAAK;AAGvB;AAEF,MAAAC,EAASF,CAAQ;AAAA,IACnB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAOG,GAAS;AACd,eAAWC,KAAOD;AAChB,UAAI,CAAC,OAAO,GAAG,KAAK,MAAMC,CAAG,GAAGD,EAAQC,CAAG,CAAC,GAAG;AAC7C,aAAK,SAAS;AAAA,UACZ,GAAG,KAAK;AAAA,UACR,GAAGD;AAAA,QACb,CAAS;AACD;AAAA,MACF;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAIC,GAAKC,GAAO;AACd,IAAK,OAAO,GAAG,KAAK,MAAMD,CAAG,GAAGC,CAAK,KACnC,KAAK,SAAS;AAAA,MACZ,GAAG,KAAK;AAAA,MACR,CAACD,CAAG,GAAGC;AAAA,IACf,CAAO;AAAA,EAEL;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY;AACV,UAAML,IAAW;AAAA,MACf,GAAG,KAAK;AAAA,IACd;AACI,SAAK,SAASA,CAAQ;AAAA,EACxB;AAAA,EACA,IAAIM,GAAUC,GAAIC,GAAIC,GAAI;AAExB,WAAOC,EAAS,MAAMJ,GAAUC,GAAIC,GAAIC,CAAE;AAAA,EAC5C;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index265.js","sources":["../../../node_modules/@base-ui/react/internals/useAnimationsFinished.mjs"],"sourcesContent":["'use client';\n\nimport * as ReactDOM from 'react-dom';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { resolveRef } from \"../utils/resolveRef.mjs\";\nimport { TransitionStatusDataAttributes } from \"./stateAttributesMapping.mjs\";\n\n/**\n * Executes a function once all animations have finished on the provided element.\n * @param elementOrRef - The element to watch for animations.\n * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.\n * @param treatAbortedAsFinished - Whether to treat aborted animations as finished. If `false`, and there are aborted animations,\n * the function will check again if any new animations have started and wait for them to finish.\n * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback\n */\nexport function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) {\n const frame = useAnimationFrame();\n return useStableCallback((fnToExecute,\n /**\n * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that\n * can be used to abort `fnToExecute` before all the animations have finished.\n * @default null\n */\n signal = null) => {\n frame.cancel();\n const element = resolveRef(elementOrRef);\n if (element == null) {\n return;\n }\n const resolvedElement = element;\n const done = () => {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n ReactDOM.flushSync(fnToExecute);\n };\n if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {\n fnToExecute();\n return;\n }\n function exec() {\n Promise.all(resolvedElement.getAnimations().map(animation => animation.finished)).then(() => {\n if (!signal?.aborted) {\n done();\n }\n }).catch(() => {\n if (treatAbortedAsFinished) {\n if (!signal?.aborted) {\n done();\n }\n return;\n }\n const currentAnimations = resolvedElement.getAnimations();\n if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {\n // Sometimes animations can be aborted because a property they depend on changes while the animation plays.\n // In such cases, we need to re-check if any new animations have started.\n exec();\n }\n });\n }\n if (waitForStartingStyleRemoved) {\n const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;\n\n // If `[data-starting-style]` isn't present, fall back to waiting one more frame\n // to give \"open\" animations a chance to be registered.\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n frame.request(exec);\n return;\n }\n\n // Wait for `[data-starting-style]` to have been removed.\n const attributeObserver = new MutationObserver(() => {\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n attributeObserver.disconnect();\n exec();\n }\n });\n attributeObserver.observe(resolvedElement, {\n attributes: true,\n attributeFilter: [startingStyleAttribute]\n });\n signal?.addEventListener('abort', () => attributeObserver.disconnect(), {\n once: true\n });\n return;\n }\n frame.request(exec);\n });\n}"],"names":["useAnimationsFinished","elementOrRef","waitForStartingStyleRemoved","treatAbortedAsFinished","frame","useAnimationFrame","useStableCallback","fnToExecute","signal","element","resolveRef","resolvedElement","done","ReactDOM","exec","animation","currentAnimations","startingStyleAttribute","TransitionStatusDataAttributes","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DT,GAAQ,iBAAiB,SAAS,MAAMW,EAAkB,WAAU,GAAI;AAAA,QACtE,MAAM;AAAA,MACd,CAAO;AACD;AAAA,IACF;AACA,IAAAf,EAAM,QAAQU,CAAI;AAAA,EACpB,CAAC;AACH;","x_google_ignoreList":[0]}
package/dist/index266.js CHANGED
@@ -1,16 +1,9 @@
1
- const e = "none", s = "trigger-press", o = "trigger-hover", t = "outside-press", n = "item-press", c = "close-press", i = "focus-out", r = "escape-key", a = "list-navigation", p = "cancel-open", g = "imperative-action", l = "window-resize";
1
+ import * as t from "react";
2
+ const e = parseInt(t.version, 10);
3
+ function o(r) {
4
+ return e >= r;
5
+ }
2
6
  export {
3
- p as cancelOpen,
4
- c as closePress,
5
- r as escapeKey,
6
- i as focusOut,
7
- g as imperativeAction,
8
- n as itemPress,
9
- a as listNavigation,
10
- e as none,
11
- t as outsidePress,
12
- o as triggerHover,
13
- s as triggerPress,
14
- l as windowResize
7
+ o as isReactVersionAtLeast
15
8
  };
16
9
  //# sourceMappingURL=index266.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index266.js","sources":["../../../node_modules/@base-ui/react/internals/reason-parts.mjs"],"sourcesContent":["export const none = 'none';\nexport const triggerPress = 'trigger-press';\nexport const triggerHover = 'trigger-hover';\nexport const triggerFocus = 'trigger-focus';\nexport const outsidePress = 'outside-press';\nexport const itemPress = 'item-press';\nexport const closePress = 'close-press';\nexport const linkPress = 'link-press';\nexport const clearPress = 'clear-press';\nexport const chipRemovePress = 'chip-remove-press';\nexport const trackPress = 'track-press';\nexport const incrementPress = 'increment-press';\nexport const decrementPress = 'decrement-press';\nexport const inputChange = 'input-change';\nexport const inputClear = 'input-clear';\nexport const inputBlur = 'input-blur';\nexport const inputPaste = 'input-paste';\nexport const inputPress = 'input-press';\nexport const focusOut = 'focus-out';\nexport const escapeKey = 'escape-key';\nexport const closeWatcher = 'close-watcher';\nexport const listNavigation = 'list-navigation';\nexport const keyboard = 'keyboard';\nexport const pointer = 'pointer';\nexport const drag = 'drag';\nexport const wheel = 'wheel';\nexport const scrub = 'scrub';\nexport const cancelOpen = 'cancel-open';\nexport const siblingOpen = 'sibling-open';\nexport const disabled = 'disabled';\nexport const missing = 'missing';\nexport const initial = 'initial';\nexport const imperativeAction = 'imperative-action';\nexport const swipe = 'swipe';\nexport const windowResize = 'window-resize';"],"names":["none","triggerPress","triggerHover","outsidePress","itemPress","closePress","focusOut","escapeKey","listNavigation","cancelOpen","imperativeAction","windowResize"],"mappings":"AAAY,MAACA,IAAO,QACPC,IAAe,iBACfC,IAAe,iBAEfC,IAAe,iBACfC,IAAY,cACZC,IAAa,eAYbC,IAAW,aACXC,IAAY,cAEZC,IAAiB,mBAMjBC,IAAa,eAKbC,IAAmB,qBAEnBC,IAAe;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index266.js","sources":["../../../node_modules/@base-ui/utils/reactVersion.mjs"],"sourcesContent":["import * as React from 'react';\nconst majorVersion = parseInt(React.version, 10);\nexport function isReactVersionAtLeast(reactVersionToCheck) {\n return majorVersion >= reactVersionToCheck;\n}"],"names":["majorVersion","React","isReactVersionAtLeast","reactVersionToCheck"],"mappings":";AACA,MAAMA,IAAe,SAASC,EAAM,SAAS,EAAE;AACxC,SAASC,EAAsBC,GAAqB;AACzD,SAAOH,KAAgBG;AACzB;","x_google_ignoreList":[0]}
package/dist/index267.js CHANGED
@@ -1,7 +1,9 @@
1
- function e(n) {
2
- return n?.ownerDocument || document;
1
+ import * as t from "react";
2
+ function n(r) {
3
+ const e = t.useRef(!0);
4
+ e.current && (e.current = !1, r());
3
5
  }
4
6
  export {
5
- e as ownerDocument
7
+ n as useOnFirstRender
6
8
  };
7
9
  //# sourceMappingURL=index267.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index267.js","sources":["../../../node_modules/@base-ui/utils/owner.mjs"],"sourcesContent":["export { getWindow as ownerWindow } from '@floating-ui/utils/dom';\nexport function ownerDocument(node) {\n return node?.ownerDocument || document;\n}"],"names":["ownerDocument","node"],"mappings":"AACO,SAASA,EAAcC,GAAM;AAClC,SAAOA,GAAM,iBAAiB;AAChC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index267.js","sources":["../../../node_modules/@base-ui/utils/useOnFirstRender.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nexport function useOnFirstRender(fn) {\n const ref = React.useRef(true);\n if (ref.current) {\n ref.current = false;\n fn();\n }\n}"],"names":["useOnFirstRender","fn","ref","React"],"mappings":";AAGO,SAASA,EAAiBC,GAAI;AACnC,QAAMC,IAAMC,EAAM,OAAO,EAAI;AAC7B,EAAID,EAAI,YACNA,EAAI,UAAU,IACdD,EAAE;AAEN;","x_google_ignoreList":[0]}
package/dist/index268.js CHANGED
@@ -1,33 +1,65 @@
1
- import { useRefWithInit as c } from "./index233.js";
2
- import { useOnMount as u } from "./index353.js";
3
- const t = 0;
4
- class r {
5
- static create() {
6
- return new r();
7
- }
8
- currentId = t;
9
- /**
10
- * Executes `fn` after `delay`, clearing any previously scheduled call.
11
- */
12
- start(s, i) {
13
- this.clear(), this.currentId = setTimeout(() => {
14
- this.currentId = t, i();
15
- }, s);
16
- }
17
- isStarted() {
18
- return this.currentId !== t;
19
- }
20
- clear = () => {
21
- this.currentId !== t && (clearTimeout(this.currentId), this.currentId = t);
22
- };
23
- disposeEffect = () => this.clear;
1
+ import * as r from "react";
2
+ import { useScrollLock as P } from "./index381.js";
3
+ import { EMPTY_OBJECT as f } from "./index258.js";
4
+ import { createChangeEventDetails as C } from "./index153.js";
5
+ import { usePopupRootSync as S, useImplicitActiveTrigger as k, useOpenStateTransitions as E, usePopupInteractionProps as T } from "./index162.js";
6
+ import { useDismiss as h } from "./index302.js";
7
+ import { getTarget as w, contains as x } from "./index313.js";
8
+ import { imperativeAction as I } from "./index155.js";
9
+ function L(e) {
10
+ const {
11
+ store: t,
12
+ actionsRef: a
13
+ } = e, o = t.useState("open");
14
+ S(t, o), k(t);
15
+ const {
16
+ forceUnmount: c
17
+ } = E(o, t), s = r.useCallback(() => {
18
+ t.setOpen(!1, C(I));
19
+ }, [t]);
20
+ r.useImperativeHandle(a, () => ({
21
+ unmount: c,
22
+ close: s
23
+ }), [c, s]);
24
24
  }
25
- function a() {
26
- const e = c(r.create).current;
27
- return u(e.disposeEffect), e;
25
+ function M({
26
+ store: e,
27
+ parentContext: t,
28
+ isDrawer: a
29
+ }) {
30
+ const o = e.useState("open"), c = e.useState("disablePointerDismissal"), s = e.useState("modal"), d = e.useState("popupElement"), O = e.useState("floatingRootContext"), [u, m] = r.useState(0), [l, g] = r.useState(0), D = u === 0, p = h(O, {
31
+ outsidePressEvent() {
32
+ return e.context.internalBackdropRef.current || e.context.backdropRef.current ? "intentional" : {
33
+ mouse: s === "trap-focus" ? "sloppy" : "intentional",
34
+ touch: "sloppy"
35
+ };
36
+ },
37
+ outsidePress(n) {
38
+ if (!e.context.outsidePressEnabledRef.current || "button" in n && n.button !== 0 || "touches" in n && n.touches.length !== 1)
39
+ return !1;
40
+ const i = w(n);
41
+ return D && !c ? s && (e.context.internalBackdropRef.current || e.context.backdropRef.current) ? e.context.internalBackdropRef.current === i || e.context.backdropRef.current === i || x(i, d) && !i?.hasAttribute("data-base-ui-portal") : !0 : !1;
42
+ },
43
+ escapeKey: D
44
+ });
45
+ P(o && s === !0, d), e.useContextCallback("onNestedDialogOpen", (n, i) => {
46
+ m(n), g(i);
47
+ }), e.useContextCallback("onNestedDialogClose", () => {
48
+ m(0), g(0);
49
+ }), r.useEffect(() => (t?.onNestedDialogOpen && o && t.onNestedDialogOpen(u + 1, l + (a ? 1 : 0)), t?.onNestedDialogClose && !o && t.onNestedDialogClose(), () => {
50
+ t?.onNestedDialogClose && o && t.onNestedDialogClose();
51
+ }), [a, o, u, l, t]);
52
+ const b = p.reference ?? f, R = p.trigger ?? f, N = p.floating ?? f;
53
+ return T(e, {
54
+ activeTriggerProps: b,
55
+ inactiveTriggerProps: R,
56
+ popupProps: N,
57
+ nestedOpenDialogCount: u,
58
+ nestedOpenDrawerCount: l
59
+ }), null;
28
60
  }
29
61
  export {
30
- r as Timeout,
31
- a as useTimeout
62
+ M as DialogInteractions,
63
+ L as useDialogRoot
32
64
  };
33
65
  //# sourceMappingURL=index268.js.map