@rpcbase/ui 0.181.0 → 0.183.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 (618) hide show
  1. package/dist/helpers/index.d.ts +1 -0
  2. package/dist/helpers/index.d.ts.map +1 -1
  3. package/dist/helpers/useScrollPagination.d.ts +23 -0
  4. package/dist/helpers/useScrollPagination.d.ts.map +1 -0
  5. package/dist/helpers/useScrollPagination.test.d.ts +2 -0
  6. package/dist/helpers/useScrollPagination.test.d.ts.map +1 -0
  7. package/dist/index.js +62 -60
  8. package/dist/index.js.map +1 -1
  9. package/dist/index10.js +23 -69
  10. package/dist/index10.js.map +1 -1
  11. package/dist/index100.js +5 -4
  12. package/dist/index100.js.map +1 -1
  13. package/dist/index101.js +3 -3
  14. package/dist/index101.js.map +1 -1
  15. package/dist/index102.js +4 -6
  16. package/dist/index102.js.map +1 -1
  17. package/dist/index103.js +6 -145
  18. package/dist/index103.js.map +1 -1
  19. package/dist/index104.js +144 -38
  20. package/dist/index104.js.map +1 -1
  21. package/dist/index105.js +39 -4
  22. package/dist/index105.js.map +1 -1
  23. package/dist/index106.js +4 -7
  24. package/dist/index106.js.map +1 -1
  25. package/dist/index107.js +6 -12
  26. package/dist/index107.js.map +1 -1
  27. package/dist/index108.js +13 -13
  28. package/dist/index108.js.map +1 -1
  29. package/dist/index109.js +13 -7
  30. package/dist/index109.js.map +1 -1
  31. package/dist/index11.js +62 -544
  32. package/dist/index11.js.map +1 -1
  33. package/dist/index110.js +6 -30
  34. package/dist/index110.js.map +1 -1
  35. package/dist/index111.js +31 -10
  36. package/dist/index111.js.map +1 -1
  37. package/dist/index112.js +10 -10
  38. package/dist/index112.js.map +1 -1
  39. package/dist/index113.js +10 -8
  40. package/dist/index113.js.map +1 -1
  41. package/dist/index114.js +8 -13
  42. package/dist/index114.js.map +1 -1
  43. package/dist/index115.js +13 -101
  44. package/dist/index115.js.map +1 -1
  45. package/dist/index116.js +102 -20
  46. package/dist/index116.js.map +1 -1
  47. package/dist/index117.js +20 -54
  48. package/dist/index117.js.map +1 -1
  49. package/dist/index118.js +51 -70
  50. package/dist/index118.js.map +1 -1
  51. package/dist/index119.js +72 -9
  52. package/dist/index119.js.map +1 -1
  53. package/dist/index12.js +535 -110
  54. package/dist/index12.js.map +1 -1
  55. package/dist/index120.js +9 -20
  56. package/dist/index120.js.map +1 -1
  57. package/dist/index121.js +20 -16
  58. package/dist/index121.js.map +1 -1
  59. package/dist/index122.js +16 -23
  60. package/dist/index122.js.map +1 -1
  61. package/dist/index123.js +23 -6
  62. package/dist/index123.js.map +1 -1
  63. package/dist/index124.js +6 -5
  64. package/dist/index124.js.map +1 -1
  65. package/dist/index125.js +5 -23
  66. package/dist/index125.js.map +1 -1
  67. package/dist/index126.js +24 -35
  68. package/dist/index126.js.map +1 -1
  69. package/dist/index127.js +35 -16
  70. package/dist/index127.js.map +1 -1
  71. package/dist/index128.js +16 -7
  72. package/dist/index128.js.map +1 -1
  73. package/dist/index129.js +6 -4
  74. package/dist/index129.js.map +1 -1
  75. package/dist/index13.js +122 -71
  76. package/dist/index13.js.map +1 -1
  77. package/dist/index130.js +4 -4
  78. package/dist/index130.js.map +1 -1
  79. package/dist/index131.js +4 -4
  80. package/dist/index131.js.map +1 -1
  81. package/dist/index132.js +4 -4
  82. package/dist/index132.js.map +1 -1
  83. package/dist/index133.js +4 -3
  84. package/dist/index133.js.map +1 -1
  85. package/dist/index134.js +3 -6
  86. package/dist/index134.js.map +1 -1
  87. package/dist/index135.js +7 -24
  88. package/dist/index135.js.map +1 -1
  89. package/dist/index136.js +24 -8
  90. package/dist/index136.js.map +1 -1
  91. package/dist/index137.js +7 -6
  92. package/dist/index137.js.map +1 -1
  93. package/dist/index138.js +6 -5
  94. package/dist/index138.js.map +1 -1
  95. package/dist/index139.js +5 -3
  96. package/dist/index139.js.map +1 -1
  97. package/dist/index14.js +61 -717
  98. package/dist/index14.js.map +1 -1
  99. package/dist/index140.js +3 -3
  100. package/dist/index140.js.map +1 -1
  101. package/dist/index141.js +3 -4
  102. package/dist/index141.js.map +1 -1
  103. package/dist/index142.js +4 -3
  104. package/dist/index142.js.map +1 -1
  105. package/dist/index143.js +3 -4
  106. package/dist/index143.js.map +1 -1
  107. package/dist/index144.js +4 -3
  108. package/dist/index144.js.map +1 -1
  109. package/dist/index145.js +3 -3
  110. package/dist/index145.js.map +1 -1
  111. package/dist/index146.js +3 -3
  112. package/dist/index146.js.map +1 -1
  113. package/dist/index147.js +3 -46
  114. package/dist/index147.js.map +1 -1
  115. package/dist/index148.js +2 -2
  116. package/dist/index15.js +727 -18
  117. package/dist/index15.js.map +1 -1
  118. package/dist/index150.js +2 -2
  119. package/dist/index152.js +3 -3
  120. package/dist/index153.js +40 -599
  121. package/dist/index153.js.map +1 -1
  122. package/dist/index154.js +605 -5
  123. package/dist/index154.js.map +1 -1
  124. package/dist/index155.js +5 -68
  125. package/dist/index155.js.map +1 -1
  126. package/dist/index156.js +69 -2
  127. package/dist/index156.js.map +1 -1
  128. package/dist/index157.js +2 -364
  129. package/dist/index157.js.map +1 -1
  130. package/dist/index158.js +303 -201
  131. package/dist/index158.js.map +1 -1
  132. package/dist/index159.js +247 -46
  133. package/dist/index159.js.map +1 -1
  134. package/dist/index16.js +19 -14
  135. package/dist/index16.js.map +1 -1
  136. package/dist/index160.js +56 -42
  137. package/dist/index160.js.map +1 -1
  138. package/dist/index161.js +46 -169
  139. package/dist/index161.js.map +1 -1
  140. package/dist/index162.js +156 -96
  141. package/dist/index162.js.map +1 -1
  142. package/dist/index163.js +109 -24
  143. package/dist/index163.js.map +1 -1
  144. package/dist/index164.js +25 -8
  145. package/dist/index164.js.map +1 -1
  146. package/dist/index165.js +8 -5
  147. package/dist/index165.js.map +1 -1
  148. package/dist/index166.js +4 -5
  149. package/dist/index166.js.map +1 -1
  150. package/dist/index167.js +5 -4
  151. package/dist/index167.js.map +1 -1
  152. package/dist/index168.js +4 -466
  153. package/dist/index168.js.map +1 -1
  154. package/dist/index169.js +420 -139
  155. package/dist/index169.js.map +1 -1
  156. package/dist/index17.js +13 -382
  157. package/dist/index17.js.map +1 -1
  158. package/dist/index170.js +149 -71
  159. package/dist/index170.js.map +1 -1
  160. package/dist/index171.js +74 -229
  161. package/dist/index171.js.map +1 -1
  162. package/dist/index172.js +262 -9
  163. package/dist/index172.js.map +1 -1
  164. package/dist/index173.js +9 -42
  165. package/dist/index173.js.map +1 -1
  166. package/dist/index174.js +42 -4
  167. package/dist/index174.js.map +1 -1
  168. package/dist/index175.js +4 -16
  169. package/dist/index175.js.map +1 -1
  170. package/dist/index176.js +57 -4
  171. package/dist/index176.js.map +1 -1
  172. package/dist/index177.js +8 -5
  173. package/dist/index177.js.map +1 -1
  174. package/dist/index178.js +55 -47
  175. package/dist/index178.js.map +1 -1
  176. package/dist/index179.js +17 -64
  177. package/dist/index179.js.map +1 -1
  178. package/dist/index18.js +363 -695
  179. package/dist/index18.js.map +1 -1
  180. package/dist/index180.js +16 -6
  181. package/dist/index180.js.map +1 -1
  182. package/dist/index181.js +5 -4
  183. package/dist/index181.js.map +1 -1
  184. package/dist/index182.js +5 -7
  185. package/dist/index182.js.map +1 -1
  186. package/dist/index183.js +6 -17
  187. package/dist/index183.js.map +1 -1
  188. package/dist/index184.js +4 -5
  189. package/dist/index184.js.map +1 -1
  190. package/dist/index185.js +7 -5
  191. package/dist/index185.js.map +1 -1
  192. package/dist/index186.js +17 -13
  193. package/dist/index186.js.map +1 -1
  194. package/dist/index187.js +5 -10
  195. package/dist/index187.js.map +1 -1
  196. package/dist/index188.js +5 -14
  197. package/dist/index188.js.map +1 -1
  198. package/dist/index189.js +13 -14
  199. package/dist/index189.js.map +1 -1
  200. package/dist/index19.js +685 -624
  201. package/dist/index19.js.map +1 -1
  202. package/dist/index190.js +10 -5
  203. package/dist/index190.js.map +1 -1
  204. package/dist/index191.js +14 -6
  205. package/dist/index191.js.map +1 -1
  206. package/dist/index192.js +14 -7
  207. package/dist/index192.js.map +1 -1
  208. package/dist/index193.js +5 -6
  209. package/dist/index193.js.map +1 -1
  210. package/dist/index194.js +6 -9
  211. package/dist/index194.js.map +1 -1
  212. package/dist/index195.js +7 -5
  213. package/dist/index195.js.map +1 -1
  214. package/dist/index196.js +6 -5
  215. package/dist/index196.js.map +1 -1
  216. package/dist/index197.js +9 -9
  217. package/dist/index197.js.map +1 -1
  218. package/dist/index198.js +5 -5
  219. package/dist/index198.js.map +1 -1
  220. package/dist/index199.js +5 -5
  221. package/dist/index199.js.map +1 -1
  222. package/dist/index2.js +2 -2
  223. package/dist/index20.js +640 -191
  224. package/dist/index20.js.map +1 -1
  225. package/dist/index200.js +9 -4
  226. package/dist/index200.js.map +1 -1
  227. package/dist/index201.js +5 -11
  228. package/dist/index201.js.map +1 -1
  229. package/dist/index202.js +5 -10
  230. package/dist/index202.js.map +1 -1
  231. package/dist/index203.js +4 -10
  232. package/dist/index203.js.map +1 -1
  233. package/dist/index204.js +11 -11
  234. package/dist/index204.js.map +1 -1
  235. package/dist/index205.js +10 -11
  236. package/dist/index205.js.map +1 -1
  237. package/dist/index206.js +10 -10
  238. package/dist/index206.js.map +1 -1
  239. package/dist/index207.js +11 -7
  240. package/dist/index207.js.map +1 -1
  241. package/dist/index208.js +11 -6
  242. package/dist/index208.js.map +1 -1
  243. package/dist/index209.js +10 -5
  244. package/dist/index209.js.map +1 -1
  245. package/dist/index21.js +209 -5
  246. package/dist/index21.js.map +1 -1
  247. package/dist/index210.js +7 -6
  248. package/dist/index210.js.map +1 -1
  249. package/dist/index211.js +6 -7
  250. package/dist/index211.js.map +1 -1
  251. package/dist/index212.js +5 -6
  252. package/dist/index212.js.map +1 -1
  253. package/dist/index213.js +6 -55
  254. package/dist/index213.js.map +1 -1
  255. package/dist/index214.js +7 -8
  256. package/dist/index214.js.map +1 -1
  257. package/dist/index215.js +6 -19
  258. package/dist/index215.js.map +1 -1
  259. package/dist/index216.js +54 -15
  260. package/dist/index216.js.map +1 -1
  261. package/dist/index217.js +16 -7
  262. package/dist/index217.js.map +1 -1
  263. package/dist/index218.js +7 -10
  264. package/dist/index218.js.map +1 -1
  265. package/dist/index219.js +9 -9
  266. package/dist/index219.js.map +1 -1
  267. package/dist/index22.js +5 -35
  268. package/dist/index22.js.map +1 -1
  269. package/dist/index220.js +10 -21
  270. package/dist/index220.js.map +1 -1
  271. package/dist/index221.js +21 -10
  272. package/dist/index221.js.map +1 -1
  273. package/dist/index222.js +10 -9
  274. package/dist/index222.js.map +1 -1
  275. package/dist/index223.js +6 -6
  276. package/dist/index223.js.map +1 -1
  277. package/dist/index224.js +9 -4
  278. package/dist/index224.js.map +1 -1
  279. package/dist/index225.js +4 -5
  280. package/dist/index225.js.map +1 -1
  281. package/dist/index226.js +5 -16
  282. package/dist/index226.js.map +1 -1
  283. package/dist/index227.js +16 -9
  284. package/dist/index227.js.map +1 -1
  285. package/dist/index228.js +9 -18
  286. package/dist/index228.js.map +1 -1
  287. package/dist/index229.js +15 -12
  288. package/dist/index229.js.map +1 -1
  289. package/dist/index23.js +24 -258
  290. package/dist/index23.js.map +1 -1
  291. package/dist/index230.js +12 -9
  292. package/dist/index230.js.map +1 -1
  293. package/dist/index231.js +12 -29
  294. package/dist/index231.js.map +1 -1
  295. package/dist/index232.js +28 -11
  296. package/dist/index232.js.map +1 -1
  297. package/dist/index233.js +10 -23
  298. package/dist/index233.js.map +1 -1
  299. package/dist/index234.js +25 -5
  300. package/dist/index234.js.map +1 -1
  301. package/dist/index235.js +5 -24
  302. package/dist/index235.js.map +1 -1
  303. package/dist/index236.js +24 -28
  304. package/dist/index236.js.map +1 -1
  305. package/dist/index237.js +29 -5
  306. package/dist/index237.js.map +1 -1
  307. package/dist/index238.js +5 -68
  308. package/dist/index238.js.map +1 -1
  309. package/dist/index239.js +64 -177
  310. package/dist/index239.js.map +1 -1
  311. package/dist/index24.js +254 -166
  312. package/dist/index24.js.map +1 -1
  313. package/dist/index240.js +176 -42
  314. package/dist/index240.js.map +1 -1
  315. package/dist/index241.js +45 -12
  316. package/dist/index241.js.map +1 -1
  317. package/dist/index242.js +13 -154
  318. package/dist/index242.js.map +1 -1
  319. package/dist/index243.js +151 -27
  320. package/dist/index243.js.map +1 -1
  321. package/dist/index244.js +30 -9
  322. package/dist/index244.js.map +1 -1
  323. package/dist/index245.js +9 -47
  324. package/dist/index245.js.map +1 -1
  325. package/dist/index246.js +46 -10
  326. package/dist/index246.js.map +1 -1
  327. package/dist/index247.js +11 -44
  328. package/dist/index247.js.map +1 -1
  329. package/dist/index248.js +40 -91
  330. package/dist/index248.js.map +1 -1
  331. package/dist/index249.js +85 -76
  332. package/dist/index249.js.map +1 -1
  333. package/dist/index25.js +180 -14
  334. package/dist/index25.js.map +1 -1
  335. package/dist/index250.js +69 -88
  336. package/dist/index250.js.map +1 -1
  337. package/dist/index251.js +92 -39
  338. package/dist/index251.js.map +1 -1
  339. package/dist/index252.js +51 -10
  340. package/dist/index252.js.map +1 -1
  341. package/dist/index253.js +10 -36
  342. package/dist/index253.js.map +1 -1
  343. package/dist/index254.js +37 -8
  344. package/dist/index254.js.map +1 -1
  345. package/dist/index255.js +8 -116
  346. package/dist/index255.js.map +1 -1
  347. package/dist/index256.js +115 -16
  348. package/dist/index256.js.map +1 -1
  349. package/dist/index257.js +17 -15
  350. package/dist/index257.js.map +1 -1
  351. package/dist/index258.js +15 -3
  352. package/dist/index258.js.map +1 -1
  353. package/dist/index259.js +3 -36
  354. package/dist/index259.js.map +1 -1
  355. package/dist/index26.js +15 -2763
  356. package/dist/index26.js.map +1 -1
  357. package/dist/index260.js +35 -19
  358. package/dist/index260.js.map +1 -1
  359. package/dist/index261.js +20 -9
  360. package/dist/index261.js.map +1 -1
  361. package/dist/index262.js +8 -7
  362. package/dist/index262.js.map +1 -1
  363. package/dist/index263.js +8 -19
  364. package/dist/index263.js.map +1 -1
  365. package/dist/index264.js +14 -23
  366. package/dist/index264.js.map +1 -1
  367. package/dist/index265.js +26 -14
  368. package/dist/index265.js.map +1 -1
  369. package/dist/index266.js +16 -4
  370. package/dist/index266.js.map +1 -1
  371. package/dist/index267.js +5 -19
  372. package/dist/index267.js.map +1 -1
  373. package/dist/index268.js +19 -13
  374. package/dist/index268.js.map +1 -1
  375. package/dist/index269.js +13 -5
  376. package/dist/index269.js.map +1 -1
  377. package/dist/index27.js +2761 -35
  378. package/dist/index27.js.map +1 -1
  379. package/dist/index270.js +5 -3
  380. package/dist/index270.js.map +1 -1
  381. package/dist/index271.js +3 -24
  382. package/dist/index271.js.map +1 -1
  383. package/dist/index272.js +22 -111
  384. package/dist/index272.js.map +1 -1
  385. package/dist/index273.js +111 -14
  386. package/dist/index273.js.map +1 -1
  387. package/dist/index274.js +14 -523
  388. package/dist/index274.js.map +1 -1
  389. package/dist/index275.js +511 -114
  390. package/dist/index275.js.map +1 -1
  391. package/dist/index276.js +111 -117
  392. package/dist/index276.js.map +1 -1
  393. package/dist/index277.js +133 -20
  394. package/dist/index277.js.map +1 -1
  395. package/dist/index278.js +20 -5
  396. package/dist/index278.js.map +1 -1
  397. package/dist/index279.js +5 -5
  398. package/dist/index279.js.map +1 -1
  399. package/dist/index28.js +37 -3
  400. package/dist/index28.js.map +1 -1
  401. package/dist/index280.js +6 -4
  402. package/dist/index280.js.map +1 -1
  403. package/dist/index281.js +4 -16
  404. package/dist/index281.js.map +1 -1
  405. package/dist/index282.js +14 -7
  406. package/dist/index282.js.map +1 -1
  407. package/dist/index283.js +8 -5
  408. package/dist/index283.js.map +1 -1
  409. package/dist/index284.js +5 -4
  410. package/dist/index284.js.map +1 -1
  411. package/dist/index285.js +4 -545
  412. package/dist/index285.js.map +1 -1
  413. package/dist/index286.js +544 -45
  414. package/dist/index286.js.map +1 -1
  415. package/dist/index287.js +47 -18
  416. package/dist/index287.js.map +1 -1
  417. package/dist/index288.js +17 -6
  418. package/dist/index288.js.map +1 -1
  419. package/dist/index289.js +6 -8
  420. package/dist/index289.js.map +1 -1
  421. package/dist/index29.js +3 -125
  422. package/dist/index29.js.map +1 -1
  423. package/dist/index290.js +8 -7
  424. package/dist/index290.js.map +1 -1
  425. package/dist/index291.js +7 -8
  426. package/dist/index291.js.map +1 -1
  427. package/dist/index292.js +8 -12
  428. package/dist/index292.js.map +1 -1
  429. package/dist/index293.js +12 -9
  430. package/dist/index293.js.map +1 -1
  431. package/dist/index294.js +9 -13
  432. package/dist/index294.js.map +1 -1
  433. package/dist/index295.js +14 -69
  434. package/dist/index295.js.map +1 -1
  435. package/dist/index296.js +68 -8
  436. package/dist/index296.js.map +1 -1
  437. package/dist/index297.js +9 -14
  438. package/dist/index297.js.map +1 -1
  439. package/dist/index298.js +14 -66
  440. package/dist/index298.js.map +1 -1
  441. package/dist/index299.js +65 -64
  442. package/dist/index299.js.map +1 -1
  443. package/dist/index30.js +120 -227
  444. package/dist/index30.js.map +1 -1
  445. package/dist/index300.js +64 -4
  446. package/dist/index300.js.map +1 -1
  447. package/dist/index301.js +5 -56
  448. package/dist/index301.js.map +1 -1
  449. package/dist/index302.js +54 -66
  450. package/dist/index302.js.map +1 -1
  451. package/dist/index303.js +67 -30
  452. package/dist/index303.js.map +1 -1
  453. package/dist/index304.js +31 -9
  454. package/dist/index304.js.map +1 -1
  455. package/dist/index305.js +9 -153
  456. package/dist/index305.js.map +1 -1
  457. package/dist/index306.js +142 -97
  458. package/dist/index306.js.map +1 -1
  459. package/dist/index307.js +108 -4
  460. package/dist/index307.js.map +1 -1
  461. package/dist/index308.js +3 -22
  462. package/dist/index308.js.map +1 -1
  463. package/dist/index309.js +22 -15
  464. package/dist/index309.js.map +1 -1
  465. package/dist/index31.js +229 -21
  466. package/dist/index31.js.map +1 -1
  467. package/dist/index310.js +14 -27
  468. package/dist/index310.js.map +1 -1
  469. package/dist/index311.js +27 -11
  470. package/dist/index311.js.map +1 -1
  471. package/dist/index312.js +11 -5
  472. package/dist/index312.js.map +1 -1
  473. package/dist/index313.js +6 -12
  474. package/dist/index313.js.map +1 -1
  475. package/dist/index314.js +20 -25
  476. package/dist/index314.js.map +1 -1
  477. package/dist/index315.js +12 -4
  478. package/dist/index315.js.map +1 -1
  479. package/dist/index316.js +25 -20
  480. package/dist/index316.js.map +1 -1
  481. package/dist/index317.js +8 -0
  482. package/dist/index317.js.map +1 -0
  483. package/dist/index32.js +23 -50
  484. package/dist/index32.js.map +1 -1
  485. package/dist/index33.js +50 -2640
  486. package/dist/index33.js.map +1 -1
  487. package/dist/index34.js +2598 -351
  488. package/dist/index34.js.map +1 -1
  489. package/dist/index35.js +375 -214
  490. package/dist/index35.js.map +1 -1
  491. package/dist/index36.js +230 -19
  492. package/dist/index36.js.map +1 -1
  493. package/dist/index37.js +18 -138
  494. package/dist/index37.js.map +1 -1
  495. package/dist/index38.js +125 -170
  496. package/dist/index38.js.map +1 -1
  497. package/dist/index39.js +174 -64
  498. package/dist/index39.js.map +1 -1
  499. package/dist/index40.js +72 -94
  500. package/dist/index40.js.map +1 -1
  501. package/dist/index41.js +98 -5
  502. package/dist/index41.js.map +1 -1
  503. package/dist/index42.js +5 -843
  504. package/dist/index42.js.map +1 -1
  505. package/dist/index43.js +832 -54
  506. package/dist/index43.js.map +1 -1
  507. package/dist/index44.js +66 -8
  508. package/dist/index44.js.map +1 -1
  509. package/dist/index45.js +8 -2
  510. package/dist/index45.js.map +1 -1
  511. package/dist/index46.js +2 -24
  512. package/dist/index46.js.map +1 -1
  513. package/dist/index47.js +22 -232
  514. package/dist/index47.js.map +1 -1
  515. package/dist/index48.js +233 -6
  516. package/dist/index48.js.map +1 -1
  517. package/dist/index49.js +203 -32
  518. package/dist/index49.js.map +1 -1
  519. package/dist/index5.js +1 -1
  520. package/dist/index50.js +3 -26
  521. package/dist/index50.js.map +1 -1
  522. package/dist/index51.js +6 -7
  523. package/dist/index51.js.map +1 -1
  524. package/dist/index52.js +47 -11
  525. package/dist/index52.js.map +1 -1
  526. package/dist/index53.js +26 -204
  527. package/dist/index53.js.map +1 -1
  528. package/dist/index54.js +50 -3
  529. package/dist/index54.js.map +1 -1
  530. package/dist/index55.js +7 -47
  531. package/dist/index55.js.map +1 -1
  532. package/dist/index56.js +12 -48
  533. package/dist/index56.js.map +1 -1
  534. package/dist/index57.js +133 -7
  535. package/dist/index57.js.map +1 -1
  536. package/dist/index58.js +10 -14
  537. package/dist/index58.js.map +1 -1
  538. package/dist/index59.js +210 -127
  539. package/dist/index59.js.map +1 -1
  540. package/dist/index6.js +138 -25
  541. package/dist/index6.js.map +1 -1
  542. package/dist/index60.js +12 -10
  543. package/dist/index60.js.map +1 -1
  544. package/dist/index61.js +32 -215
  545. package/dist/index61.js.map +1 -1
  546. package/dist/index62.js +47 -13
  547. package/dist/index62.js.map +1 -1
  548. package/dist/index63.js +7 -46
  549. package/dist/index63.js.map +1 -1
  550. package/dist/index67.js +2 -2
  551. package/dist/index69.js +3 -3
  552. package/dist/index7.js +26 -29
  553. package/dist/index7.js.map +1 -1
  554. package/dist/index70.js +11 -53
  555. package/dist/index70.js.map +1 -1
  556. package/dist/index71.js +54 -2
  557. package/dist/index71.js.map +1 -1
  558. package/dist/index72.js +6 -2
  559. package/dist/index72.js.map +1 -1
  560. package/dist/index73.js +7 -5
  561. package/dist/index73.js.map +1 -1
  562. package/dist/index74.js +4 -6
  563. package/dist/index74.js.map +1 -1
  564. package/dist/index75.js +2 -6
  565. package/dist/index75.js.map +1 -1
  566. package/dist/index76.js +2 -52
  567. package/dist/index76.js.map +1 -1
  568. package/dist/index77.js +52 -5
  569. package/dist/index77.js.map +1 -1
  570. package/dist/index78.js +4 -4
  571. package/dist/index78.js.map +1 -1
  572. package/dist/index79.js +4 -15
  573. package/dist/index79.js.map +1 -1
  574. package/dist/index8.js +28 -222
  575. package/dist/index8.js.map +1 -1
  576. package/dist/index80.js +15 -5
  577. package/dist/index80.js.map +1 -1
  578. package/dist/index81.js +5 -7
  579. package/dist/index81.js.map +1 -1
  580. package/dist/index82.js +6 -15
  581. package/dist/index82.js.map +1 -1
  582. package/dist/index83.js +16 -4
  583. package/dist/index83.js.map +1 -1
  584. package/dist/index84.js +1 -1
  585. package/dist/index84.js.map +1 -1
  586. package/dist/index85.js +4 -5
  587. package/dist/index85.js.map +1 -1
  588. package/dist/index86.js +4 -4
  589. package/dist/index86.js.map +1 -1
  590. package/dist/index87.js +5 -4
  591. package/dist/index87.js.map +1 -1
  592. package/dist/index88.js +2 -2
  593. package/dist/index88.js.map +1 -1
  594. package/dist/index89.js +3 -5
  595. package/dist/index89.js.map +1 -1
  596. package/dist/index9.js +226 -23
  597. package/dist/index9.js.map +1 -1
  598. package/dist/index90.js +6 -24
  599. package/dist/index90.js.map +1 -1
  600. package/dist/index91.js +24 -6
  601. package/dist/index91.js.map +1 -1
  602. package/dist/index92.js +6 -4
  603. package/dist/index92.js.map +1 -1
  604. package/dist/index93.js +3 -5
  605. package/dist/index93.js.map +1 -1
  606. package/dist/index94.js +6 -5
  607. package/dist/index94.js.map +1 -1
  608. package/dist/index95.js +5 -4
  609. package/dist/index95.js.map +1 -1
  610. package/dist/index96.js +3 -4
  611. package/dist/index96.js.map +1 -1
  612. package/dist/index97.js +5 -4
  613. package/dist/index97.js.map +1 -1
  614. package/dist/index98.js +4 -8
  615. package/dist/index98.js.map +1 -1
  616. package/dist/index99.js +8 -5
  617. package/dist/index99.js.map +1 -1
  618. package/package.json +1 -1
package/dist/index14.js CHANGED
@@ -1,735 +1,79 @@
1
- import { j as r } from "./index28.js";
2
- import { useRef as A, useState as H, useEffect as T, useMemo as re } from "react";
3
- import { createPortal as ie } from "react-dom";
4
- import { useSensors as ke, useSensor as ae, DndContext as Ne, closestCenter as Ue, KeyboardSensor as Re, PointerSensor as Se, DragOverlay as Ie } from "./index33.js";
5
- import { SortableContext as Ce, rectSortingStrategy as Le, arrayMove as Ae, sortableKeyboardCoordinates as ze, useSortable as Ee } from "./index34.js";
6
- import { CSS as Me } from "./index35.js";
7
- import { Plus as Pe, X as ce, Maximize2 as Te, Loader2 as De } from "lucide-react";
8
- import { cn as Q } from "./index2.js";
9
- const ue = "rb-tenant-id", Ke = async (t) => {
10
- if (typeof crypto > "u" || typeof crypto.subtle > "u") return null;
11
- try {
12
- const c = await crypto.subtle.digest("SHA-256", t);
13
- return Array.from(new Uint8Array(c)).map((p) => p.toString(16).padStart(2, "0")).join("");
14
- } catch {
15
- return null;
16
- }
17
- }, $e = () => {
18
- if (typeof window > "u") return null;
19
- const c = new URLSearchParams(window.location.search || "").get(ue)?.trim() ?? "";
20
- return c || null;
21
- }, J = (t, c) => {
22
- if (!c) return t;
23
- const i = t.includes("?") ? "&" : "?";
24
- return `${t}${i}${ue}=${encodeURIComponent(c)}`;
25
- }, le = async (t, c, i) => {
26
- const p = await fetch(t, {
27
- method: "POST",
28
- headers: { "Content-Type": "application/json", ...i?.headers ?? {} },
29
- credentials: "include",
30
- body: JSON.stringify(c),
31
- signal: i?.signal
32
- }), u = await p.json().catch(() => ({}));
33
- return { ok: p.ok, status: p.status, data: u };
34
- }, Oe = async (t, c) => {
35
- const i = await fetch(t, {
36
- credentials: "include",
37
- headers: c?.headers,
38
- signal: c?.signal
39
- }), p = await i.json().catch(() => ({}));
40
- return { ok: i.ok, status: i.status, data: p };
41
- }, Fe = async ({
42
- url: t,
43
- body: c,
44
- sha256: i,
45
- uploadKey: p,
46
- signal: u
1
+ import { j as a } from "./index29.js";
2
+ import { useState as m, useRef as w, useEffect as u } from "react";
3
+ import { decode as y } from "./index33.js";
4
+ const D = ({
5
+ src: o,
6
+ hash: n,
7
+ alt: f = "",
8
+ className: g
47
9
  }) => {
48
- const U = {
49
- "Content-Type": "application/octet-stream"
50
- };
51
- i && (U["X-Chunk-SHA256"] = i), p && (U["X-Upload-Key"] = p);
52
- const w = await fetch(t, {
53
- method: "PUT",
54
- credentials: "include",
55
- headers: U,
56
- body: c,
57
- signal: u
58
- });
59
- return { ok: w.ok, status: w.status };
60
- }, Be = async (t, c, i) => {
61
- const p = $e(), u = await le(
62
- J("/api/rb/file-uploads", p),
63
- {
64
- filename: t.name,
65
- mimeType: t.type || "application/octet-stream",
66
- ...typeof i?.isPublic == "boolean" ? { isPublic: i.isPublic } : {},
67
- totalSize: t.size
68
- },
69
- { signal: i?.signal }
70
- );
71
- if (!u.ok || !u.data?.ok)
72
- throw new Error(u.data?.error ?? `Init failed (${u.status})`);
73
- const U = String(u.data?.uploadId ?? ""), w = typeof u.data?.uploadKey == "string" ? String(u.data.uploadKey) : null, D = Number(u.data?.chunkSize ?? 0), z = Number(u.data?.chunksTotal ?? 0);
74
- if (!U || !D || !z)
75
- throw new Error("Upload init missing required fields");
76
- const _ = async (v) => {
77
- const R = v * D, g = Math.min(t.size, R + D), E = await t.slice(R, g).arrayBuffer(), P = await Ke(E), m = await Fe({
78
- url: J(`/api/rb/file-uploads/${encodeURIComponent(U)}/chunks/${v}`, p),
79
- body: E,
80
- sha256: P ?? void 0,
81
- uploadKey: w ?? void 0,
82
- signal: i?.signal
83
- });
84
- if (m.status !== 204)
85
- throw new Error(`Chunk ${v} failed (${m.status})`);
86
- }, O = async (v, R = 0) => {
87
- let g = R;
88
- for (const S of v) {
89
- await _(S), g += 1;
90
- const E = Math.min(99, Math.floor(g / z * 99));
91
- c(E);
92
- }
93
- }, X = Array.from({ length: z }, (v, R) => R);
94
- await O(X, 0);
95
- const l = async () => {
96
- const v = await le(
97
- J(`/api/rb/file-uploads/${encodeURIComponent(U)}/complete`, p),
98
- {},
99
- { headers: w ? { "X-Upload-Key": w } : void 0, signal: i?.signal }
100
- );
101
- if (v.ok && v.data?.ok) {
102
- const m = String(v.data?.fileId ?? "");
103
- if (!m) throw new Error("Upload completed without fileId");
104
- return m;
10
+ const [i, l] = m(!1), [c, p] = m(null), s = w(null);
11
+ u(() => {
12
+ if (!n) return;
13
+ const [e, r, j] = n, v = y(j, e, r), t = document.createElement("canvas"), d = t.getContext("2d");
14
+ if (d) {
15
+ t.width = e, t.height = r;
16
+ const b = new ImageData(
17
+ new Uint8ClampedArray(v),
18
+ e,
19
+ r
20
+ );
21
+ d.putImageData(b, 0, 0), p(t.toDataURL());
105
22
  }
106
- const R = String(v.data?.error ?? "");
107
- if (v.status !== 409 || R !== "missing_chunks")
108
- throw new Error(R || `Complete failed (${v.status})`);
109
- const g = await Oe(
110
- J(`/api/rb/file-uploads/${encodeURIComponent(U)}/status`, p),
111
- { headers: w ? { "X-Upload-Key": w } : void 0, signal: i?.signal }
112
- );
113
- if (!g.ok || !g.data?.ok)
114
- throw new Error(g.data?.error ?? `Status failed (${g.status})`);
115
- const S = Array.isArray(g.data?.received) ? g.data.received : [], E = new Set(S), P = [];
116
- for (let m = 0; m < z; m += 1)
117
- E.has(m) || P.push(m);
118
- if (!P.length)
119
- throw new Error("missing_chunks");
120
- return await O(P, E.size), l();
121
- }, j = await l();
122
- return c(100), {
123
- id: j,
124
- url: J(`/api/rb/files/${encodeURIComponent(j)}`, p),
125
- alt: t.name,
126
- ...w ? { uploadKey: w } : {}
23
+ }, [n]), u(() => {
24
+ s.current && s.current.complete && l(!0);
25
+ }, [o]);
26
+ const h = () => {
27
+ }, x = () => {
127
28
  };
128
- };
129
- function _e({
130
- item: t,
131
- isHovered: c,
132
- enableImagePreview: i,
133
- renderItem: p,
134
- onHoverEnter: u,
135
- onHoverLeave: U,
136
- onRemove: w,
137
- onRetry: D,
138
- startFullscreen: z,
139
- isUploading: _,
140
- isError: O,
141
- tileClasses: X,
142
- disabled: l,
143
- isDraggingExternal: j,
144
- removeButtonAriaLabel: v
145
- }) {
146
- const { setNodeRef: R, attributes: g, listeners: S, transform: E, transition: P, isDragging: m } = Ee({
147
- id: t.id,
148
- disabled: l
149
- }), K = A(null), $ = A(null), [F, V] = H(null), B = () => {
150
- const d = K.current;
151
- if (!d) return;
152
- const h = d.getBoundingClientRect();
153
- V({ left: h.left + h.width / 2, top: h.top - 10 });
154
- };
155
- T(() => {
156
- if (!i || !c) {
157
- V(null);
158
- return;
159
- }
160
- B();
161
- let d = 0;
162
- const h = () => {
163
- d && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
164
- d = 0, B();
165
- });
166
- };
167
- return window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
168
- d && cancelAnimationFrame(d), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
169
- };
170
- }, [i, c]);
171
- const W = {
172
- transform: Me.Transform.toString(E),
173
- transition: P
174
- }, q = p ? p({
175
- file: { id: t.id, url: t.url, alt: t.alt, uploadKey: t.uploadKey },
176
- previewUrl: t.previewUrl,
177
- status: t.status,
178
- progress: t.progress,
179
- fileName: t.fileName
180
- }) : i ? /* @__PURE__ */ r.jsx(
181
- "img",
182
- {
183
- src: t.previewUrl,
184
- alt: t.alt ?? "Uploaded file",
185
- className: Q(
186
- "size-full rounded-md object-cover",
187
- _ && "opacity-75",
188
- O && "grayscale"
189
- )
190
- }
191
- ) : /* @__PURE__ */ r.jsx("div", { className: "flex size-full items-center justify-center rounded-md bg-slate-100 px-2 text-center text-[10px] font-medium text-slate-700 dark:bg-slate-800 dark:text-slate-200", children: /* @__PURE__ */ r.jsx("span", { className: "w-full truncate", children: t.fileName ?? t.alt ?? "Fichier" }) });
192
- return /* @__PURE__ */ r.jsxs(
29
+ return /* @__PURE__ */ a.jsxs(
193
30
  "div",
194
31
  {
195
- ref: (d) => {
196
- K.current = d, R(d);
197
- },
198
- style: W,
199
- className: Q(
200
- X,
201
- m && "z-20 ring-2 ring-primary shadow-xl",
202
- j && "opacity-0",
203
- !l && "cursor-grab active:cursor-grabbing",
204
- m && "cursor-grabbing",
205
- l && "cursor-default"
206
- ),
207
- onMouseEnter: () => {
208
- B(), u();
209
- },
210
- onMouseLeave: (d) => {
211
- const h = d.relatedTarget;
212
- h instanceof Node && $.current?.contains(h) || U();
213
- },
214
- ...g,
215
- ...S,
32
+ style: { position: "relative", overflow: "hidden" },
33
+ className: g,
34
+ onMouseEnter: h,
35
+ onMouseLeave: x,
216
36
  children: [
217
- q,
218
- /* @__PURE__ */ r.jsx(
219
- "button",
37
+ c && !i && /* @__PURE__ */ a.jsx(
38
+ "img",
220
39
  {
221
- type: "button",
222
- onClick: () => {
223
- l || w(t.id);
224
- },
225
- disabled: l,
226
- className: "absolute right-1 top-1 inline-flex size-6 items-center justify-center rounded-full bg-white text-slate-700 shadow-sm transition hover:scale-105 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary dark:bg-slate-900 dark:text-slate-200",
227
- "aria-label": v,
228
- children: /* @__PURE__ */ r.jsx(ce, { className: "h-4 w-4" })
229
- }
230
- ),
231
- i && c && F && (() => {
232
- const d = /* @__PURE__ */ r.jsx(
233
- "div",
234
- {
235
- ref: $,
236
- className: "fixed z-[60] w-52 -translate-x-1/2 -translate-y-full rounded-xl border border-slate-200 bg-white/95 p-3 shadow-2xl backdrop-blur dark:border-slate-700 dark:bg-slate-900/95",
237
- style: { left: F.left, top: F.top },
238
- onMouseEnter: () => {
239
- B(), u();
240
- },
241
- onMouseLeave: (h) => {
242
- const x = h.relatedTarget;
243
- x instanceof Node && K.current?.contains(x) || U();
244
- },
245
- children: /* @__PURE__ */ r.jsxs("div", { className: "relative overflow-hidden rounded-lg", children: [
246
- /* @__PURE__ */ r.jsx("img", { src: t.url, alt: t.alt ?? "Preview", className: "h-40 w-full object-cover" }),
247
- /* @__PURE__ */ r.jsx(
248
- "button",
249
- {
250
- type: "button",
251
- onClick: () => z(t.id),
252
- className: "absolute right-2 top-2 inline-flex items-center justify-center rounded-full bg-black/70 p-2 text-white transition hover:bg-black",
253
- "aria-label": "Plein écran",
254
- children: /* @__PURE__ */ r.jsx(Te, { className: "h-3.5 w-3.5" })
255
- }
256
- )
257
- ] })
258
- }
259
- );
260
- return typeof document > "u" ? d : ie(d, document.body);
261
- })(),
262
- _ && /* @__PURE__ */ r.jsxs("div", { className: "absolute inset-0 z-20 flex flex-col items-center justify-center gap-2 rounded-lg bg-black/40 text-white", children: [
263
- /* @__PURE__ */ r.jsx(De, { className: "h-5 w-5 animate-spin" }),
264
- /* @__PURE__ */ r.jsx("div", { className: "h-1.5 w-5/6 rounded-full bg-white/20", children: /* @__PURE__ */ r.jsx("div", { className: "h-full rounded-full bg-primary", style: { width: `${t.progress}%` } }) }),
265
- /* @__PURE__ */ r.jsxs("div", { className: "text-xs font-semibold", children: [
266
- t.progress,
267
- "%"
268
- ] })
269
- ] }),
270
- O && /* @__PURE__ */ r.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-lg bg-red-600/70 text-white", children: [
271
- /* @__PURE__ */ r.jsx("div", { className: "text-xs font-semibold", children: "Échec" }),
272
- /* @__PURE__ */ r.jsx(
273
- "button",
274
- {
275
- type: "button",
276
- onClick: () => D(t.id),
277
- disabled: l,
278
- className: "rounded-full bg-white/90 px-3 py-1 text-xs font-semibold text-red-700 shadow-sm transition hover:bg-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",
279
- children: "Réessayer"
280
- }
281
- )
282
- ] })
283
- ]
284
- }
285
- );
286
- }
287
- function Xe(t) {
288
- return URL.createObjectURL(t);
289
- }
290
- function Ze({
291
- initialFiles: t = [],
292
- onChange: c,
293
- upload: i = Be,
294
- uploadIsPublic: p = !1,
295
- disabled: u = !1,
296
- onUploadingChange: U,
297
- accept: w,
298
- renderHeader: D,
299
- renderItem: z,
300
- addButtonAriaLabel: _ = "Ajouter un fichier",
301
- removeButtonAriaLabel: O = "Supprimer le fichier"
302
- }) {
303
- const X = A(null), [l, j] = H(
304
- () => t.map((e) => ({ ...e, previewUrl: e.url, status: "uploaded", progress: 100 }))
305
- ), [v, R] = H(!1), [g, S] = H(null), [E, P] = H(null), [m, K] = H(null), $ = A(null), F = A(!0), V = A([]), B = A(t), W = A(c), q = A(U), d = A(/* @__PURE__ */ new Map()), h = A(/* @__PURE__ */ new Map()), x = A(/* @__PURE__ */ new Map()), C = A(/* @__PURE__ */ new Map()), de = ke(
306
- ae(Se, { activationConstraint: { distance: 6 } }),
307
- ae(Re, { coordinateGetter: ze })
308
- );
309
- T(() => () => {
310
- for (const e of x.current.values())
311
- try {
312
- e.abort();
313
- } catch {
314
- }
315
- x.current.clear(), h.current.clear(), d.current.clear();
316
- for (const e of C.current.values())
317
- if (typeof URL < "u")
318
- try {
319
- URL.revokeObjectURL(e);
320
- } catch {
321
- }
322
- C.current.clear();
323
- }, []), T(() => {
324
- if (!(typeof document > "u")) {
325
- if (m)
326
- return document.body.style.cursor = "grabbing", () => {
327
- document.body.style.cursor = "";
328
- };
329
- document.body.style.cursor = "";
330
- }
331
- }, [m]), T(() => {
332
- V.current = l;
333
- }, [l]), T(() => {
334
- W.current = c;
335
- }, [c]), T(() => {
336
- q.current = U;
337
- }, [U]), T(() => {
338
- const e = B.current;
339
- if (e.length === t.length && e.every((n, f) => {
340
- const k = t[f];
341
- return k && n.id === k.id && n.url === k.url && n.alt === k.alt;
342
- })) return;
343
- B.current = t;
344
- const a = t.map((n) => ({
345
- ...n,
346
- previewUrl: n.url,
347
- status: "uploaded",
348
- progress: 100
349
- })), b = new Set(a.map((n) => n.id));
350
- for (const [n, f] of d.current.entries())
351
- b.has(f) && d.current.delete(n);
352
- const I = new Set(V.current.map((n) => n.id));
353
- if (a.some((n) => {
354
- const f = d.current.get(n.id);
355
- return f ? I.has(f) : !1;
356
- })) return;
357
- const y = new Set(a.map((n) => n.id));
358
- for (const n of V.current) {
359
- if (y.has(n.id)) continue;
360
- const f = x.current.get(n.id);
361
- if (f) {
362
- x.current.delete(n.id);
363
- try {
364
- f.abort();
365
- } catch {
366
- }
367
- }
368
- h.current.delete(n.id);
369
- const k = C.current.get(n.id);
370
- if (k) {
371
- C.current.delete(n.id);
372
- try {
373
- URL.revokeObjectURL(k);
374
- } catch {
375
- }
376
- }
377
- }
378
- j((n) => n.length === a.length && n.every((L, M) => {
379
- const N = a[M];
380
- return N && L.id === N.id && L.url === N.url && L.alt === N.alt && L.uploadKey === N.uploadKey;
381
- }) ? n : (F.current = !0, a));
382
- }, [t]), T(() => {
383
- if (F.current) {
384
- F.current = !1;
385
- return;
386
- }
387
- W.current?.(l.map(({ id: e, url: o, alt: a, uploadKey: b }) => ({ id: e, url: o, alt: a, uploadKey: b })));
388
- }, [l]), T(() => {
389
- q.current?.(l.some((e) => e.status === "uploading"));
390
- }, [l]), T(() => {
391
- if (g === null)
392
- return;
393
- const e = (o) => {
394
- if (o.key === "Escape") {
395
- S(null);
396
- return;
397
- }
398
- if (o.key === "ArrowRight") {
399
- S((a) => a === null ? a : (a + 1) % l.length);
400
- return;
401
- }
402
- o.key === "ArrowLeft" && S((a) => a === null ? a : (a - 1 + l.length) % l.length);
403
- };
404
- return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
405
- }, [g, l.length]);
406
- const ne = async (e) => {
407
- if (u) return;
408
- const a = Array.from(e).map((b) => {
409
- const I = Xe(b), s = crypto.randomUUID();
410
- C.current.set(s, I), h.current.set(s, b);
411
- const y = {
412
- id: s,
413
- url: I,
414
- previewUrl: I,
415
- alt: b.name,
416
- status: "uploading",
417
- progress: 0,
418
- fileName: b.name
419
- };
420
- j((k) => [...k, y]);
421
- const n = (k) => {
422
- const L = Math.max(0, Math.min(99, k));
423
- j(
424
- (M) => M.map(
425
- (N) => N.id === s ? { ...N, progress: L, status: "uploading" } : N
426
- )
427
- );
428
- };
429
- return (async () => {
430
- const k = new AbortController();
431
- x.current.set(s, k);
432
- try {
433
- const L = await i(b, n, { signal: k.signal, isPublic: p });
434
- d.current.set(s, L.id);
435
- const M = C.current.get(s);
436
- if (M) {
437
- C.current.delete(s);
438
- try {
439
- URL.revokeObjectURL(M);
440
- } catch {
441
- }
442
- }
443
- x.current.delete(s), h.current.delete(s), j(
444
- (N) => N.map(
445
- (te) => te.id === s ? {
446
- ...te,
447
- ...L,
448
- previewUrl: L.url,
449
- url: L.url,
450
- status: "uploaded",
451
- progress: 100
452
- } : te
453
- )
454
- );
455
- } catch (L) {
456
- if (x.current.delete(s), k.signal.aborted) {
457
- h.current.delete(s);
458
- const M = C.current.get(s);
459
- if (M) {
460
- C.current.delete(s);
461
- try {
462
- URL.revokeObjectURL(M);
463
- } catch {
464
- }
40
+ src: c,
41
+ style: {
42
+ position: "absolute",
43
+ top: 0,
44
+ left: 0,
45
+ width: "100%",
46
+ height: "100%",
47
+ objectFit: "cover"
465
48
  }
466
- return;
467
- }
468
- console.error("Upload failed", L), j(
469
- (M) => M.map(
470
- (N) => N.id === s ? { ...N, status: "error", progress: Math.max(0, Math.min(99, N.progress)) } : N
471
- )
472
- );
473
- }
474
- })();
475
- });
476
- await Promise.allSettled(a);
477
- }, fe = (e) => {
478
- e.target.files && (ne(e.target.files), e.target.value = "");
479
- }, pe = () => {
480
- u || X.current?.click();
481
- }, he = (e) => {
482
- const o = x.current.get(e);
483
- if (o) {
484
- x.current.delete(e);
485
- try {
486
- o.abort();
487
- } catch {
488
- }
489
- }
490
- h.current.delete(e);
491
- const a = C.current.get(e);
492
- if (a) {
493
- C.current.delete(e);
494
- try {
495
- URL.revokeObjectURL(a);
496
- } catch {
497
- }
498
- }
499
- j((b) => b.filter((I) => I.id !== e));
500
- }, ge = (e) => {
501
- if (u) return;
502
- const o = h.current.get(e);
503
- if (!o) return;
504
- const a = x.current.get(e);
505
- if (a) {
506
- try {
507
- a.abort();
508
- } catch {
509
- }
510
- x.current.delete(e);
511
- }
512
- j(
513
- (s) => s.map((y) => y.id === e ? { ...y, status: "uploading", progress: 0 } : y)
514
- );
515
- const b = (s) => {
516
- const y = Math.max(0, Math.min(99, s));
517
- j(
518
- (n) => n.map((f) => f.id === e ? { ...f, progress: y, status: "uploading" } : f)
519
- );
520
- }, I = new AbortController();
521
- x.current.set(e, I), (async () => {
522
- try {
523
- const s = await i(o, b, { signal: I.signal, isPublic: p });
524
- d.current.set(e, s.id);
525
- const y = C.current.get(e);
526
- if (y) {
527
- C.current.delete(e);
528
- try {
529
- URL.revokeObjectURL(y);
530
- } catch {
531
- }
532
- }
533
- x.current.delete(e), h.current.delete(e), j(
534
- (n) => n.map(
535
- (f) => f.id === e ? { ...f, ...s, previewUrl: s.url, url: s.url, status: "uploaded", progress: 100 } : f
536
- )
537
- );
538
- } catch (s) {
539
- if (x.current.delete(e), I.signal.aborted) return;
540
- console.error("Retry failed", s), j((y) => y.map((n) => n.id === e ? { ...n, status: "error" } : n));
541
- }
542
- })();
543
- }, me = (e) => {
544
- const o = l.findIndex((a) => a.id === e);
545
- o !== -1 && S(o);
546
- }, be = (e) => {
547
- K(String(e.active.id));
548
- }, we = (e) => {
549
- const { active: o, over: a } = e;
550
- if (!a) {
551
- K(null);
552
- return;
553
- }
554
- const b = String(o.id), I = String(a.id);
555
- b !== I && j((s) => {
556
- const y = s.findIndex((f) => f.id === b), n = s.findIndex((f) => f.id === I);
557
- return y === -1 || n === -1 ? s : Ae(s, y, n);
558
- }), K(null);
559
- }, ve = () => {
560
- K(null);
561
- }, se = () => {
562
- $.current !== null && (window.clearTimeout($.current), $.current = null);
563
- }, Y = re(() => g === null ? null : l[g] ?? null, [g, l]), xe = Q(
564
- "rounded-xl border border-dashed border-slate-300 bg-white/70 p-4 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/60",
565
- v && "border-primary ring-2 ring-primary/50",
566
- u && "opacity-70"
567
- ), oe = "group relative size-20 overflow-visible rounded-lg border border-slate-200 bg-slate-50 shadow-inner transition hover:shadow md:size-24 dark:border-slate-700 dark:bg-slate-800", G = re(() => {
568
- if (w)
569
- return Array.isArray(w) ? w.join(",") : w;
570
- }, [w]), Z = re(() => {
571
- if (z || !G) return !1;
572
- const e = G.split(",").map((o) => o.trim()).filter(Boolean);
573
- return e.length ? e.every((o) => o === "image/*" || o.startsWith("image/")) : !1;
574
- }, [G, z]), ye = (e) => ({
575
- file: { id: e.id, url: e.url, alt: e.alt, uploadKey: e.uploadKey },
576
- previewUrl: e.previewUrl,
577
- status: e.status,
578
- progress: e.progress,
579
- fileName: e.fileName
580
- }), ee = m ? (() => {
581
- const e = l.find((o) => o.id === m);
582
- if (!e) return null;
583
- if (z) {
584
- const o = z(ye(e));
585
- return o == null || o === !1 ? null : /* @__PURE__ */ r.jsx("div", { className: "pointer-events-none", children: /* @__PURE__ */ r.jsx("div", { className: "h-24 w-24 overflow-hidden rounded-lg shadow-2xl", children: o }) });
586
- }
587
- return Z ? /* @__PURE__ */ r.jsx("div", { className: "pointer-events-none", children: /* @__PURE__ */ r.jsx(
588
- "img",
589
- {
590
- src: e.previewUrl,
591
- alt: e.alt ?? "Dragged image",
592
- className: "h-24 w-24 rounded-lg object-cover shadow-2xl"
593
- }
594
- ) }) : null;
595
- })() : null, je = ee != null;
596
- return /* @__PURE__ */ r.jsxs(
597
- "div",
598
- {
599
- onDragOver: (e) => {
600
- e.preventDefault(), u || R(!0);
601
- },
602
- onDragLeave: () => R(!1),
603
- onDrop: (e) => {
604
- e.preventDefault(), R(!1), e.dataTransfer.files?.length && ne(e.dataTransfer.files);
605
- },
606
- className: xe,
607
- children: [
608
- D ? /* @__PURE__ */ r.jsx("div", { className: "mb-3", children: D() }) : null,
609
- /* @__PURE__ */ r.jsxs(
610
- Ne,
611
- {
612
- sensors: u ? void 0 : de,
613
- collisionDetection: Ue,
614
- onDragStart: be,
615
- onDragEnd: we,
616
- onDragCancel: ve,
617
- children: [
618
- /* @__PURE__ */ r.jsx(Ce, { items: l.map((e) => e.id), strategy: Le, children: /* @__PURE__ */ r.jsxs("div", { className: "flex flex-wrap gap-3", children: [
619
- l.map((e) => {
620
- const o = e.status === "uploading", a = e.status === "error";
621
- return /* @__PURE__ */ r.jsx(
622
- _e,
623
- {
624
- item: e,
625
- isHovered: E === e.id,
626
- enableImagePreview: Z,
627
- renderItem: z,
628
- onHoverEnter: () => {
629
- se(), P(e.id);
630
- },
631
- onHoverLeave: () => {
632
- se(), $.current = window.setTimeout(() => {
633
- P((b) => b === e.id ? null : b), $.current = null;
634
- }, 120);
635
- },
636
- onRemove: he,
637
- onRetry: ge,
638
- startFullscreen: me,
639
- isUploading: o,
640
- isError: a,
641
- tileClasses: oe,
642
- disabled: u,
643
- isDraggingExternal: je && m === e.id,
644
- removeButtonAriaLabel: O
645
- },
646
- e.id
647
- );
648
- }),
649
- /* @__PURE__ */ r.jsx(
650
- "button",
651
- {
652
- type: "button",
653
- onClick: pe,
654
- disabled: u,
655
- className: Q(
656
- oe,
657
- "flex items-center justify-center border-dashed bg-white text-slate-500 hover:border-slate-300 dark:bg-slate-900"
658
- ),
659
- "aria-label": _,
660
- children: /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col items-center gap-1", children: [
661
- /* @__PURE__ */ r.jsx("div", { className: "flex size-9 items-center justify-center rounded-full border border-slate-300 bg-slate-100 text-slate-600 shadow-inner dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200", children: /* @__PURE__ */ r.jsx(Pe, { className: "h-5 w-5" }) }),
662
- /* @__PURE__ */ r.jsx("span", { className: "text-xs font-medium", children: "Ajouter" })
663
- ] })
664
- }
665
- )
666
- ] }) }),
667
- (() => {
668
- const e = /* @__PURE__ */ r.jsx(Ie, { children: ee });
669
- return typeof document > "u" ? e : ie(e, document.body);
670
- })()
671
- ]
672
49
  }
673
50
  ),
674
- /* @__PURE__ */ r.jsx(
675
- "input",
51
+ /* @__PURE__ */ a.jsx(
52
+ "img",
676
53
  {
677
- ref: X,
678
- type: "file",
679
- accept: G,
680
- multiple: !0,
681
- className: "hidden",
682
- onChange: fe,
683
- "aria-hidden": !0
54
+ ref: s,
55
+ src: o,
56
+ alt: f,
57
+ style: {
58
+ width: "100%",
59
+ height: "100%",
60
+ objectFit: "cover",
61
+ display: i ? "block" : "none",
62
+ position: "absolute",
63
+ top: 0,
64
+ left: 0
65
+ },
66
+ onLoad: () => {
67
+ l(!0);
68
+ },
69
+ onError: (e) => console.error("Image failed to load:", o, e)
684
70
  }
685
- ),
686
- Z && Y && /* @__PURE__ */ r.jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/90", children: [
687
- /* @__PURE__ */ r.jsx(
688
- "button",
689
- {
690
- type: "button",
691
- className: "absolute left-6 top-1/2 -translate-y-1/2 rounded-full bg-white/10 p-3 text-white shadow-lg transition hover:bg-white/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",
692
- onClick: () => S((e) => e === null ? e : (e - 1 + l.length) % l.length),
693
- "aria-label": "Précédent",
694
- children: /* @__PURE__ */ r.jsx("svg", { viewBox: "0 0 24 24", className: "h-6 w-6", stroke: "currentColor", strokeWidth: 2, fill: "none", children: /* @__PURE__ */ r.jsx("path", { d: "M15 18l-6-6 6-6", strokeLinecap: "round", strokeLinejoin: "round" }) })
695
- }
696
- ),
697
- /* @__PURE__ */ r.jsxs("div", { className: "relative max-h-[80vh] max-w-4xl", children: [
698
- /* @__PURE__ */ r.jsx(
699
- "img",
700
- {
701
- src: Y.url,
702
- alt: Y.alt ?? "Fullscreen",
703
- className: "max-h-[80vh] max-w-full rounded-lg object-contain shadow-2xl"
704
- }
705
- ),
706
- /* @__PURE__ */ r.jsx(
707
- "button",
708
- {
709
- type: "button",
710
- className: "absolute right-3 top-3 inline-flex size-9 items-center justify-center rounded-full bg-black/70 text-white transition hover:bg-black focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",
711
- onClick: () => S(null),
712
- "aria-label": "Fermer",
713
- children: /* @__PURE__ */ r.jsx(ce, { className: "h-5 w-5" })
714
- }
715
- )
716
- ] }),
717
- /* @__PURE__ */ r.jsx(
718
- "button",
719
- {
720
- type: "button",
721
- className: "absolute right-6 top-1/2 -translate-y-1/2 rounded-full bg-white/10 p-3 text-white shadow-lg transition hover:bg-white/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",
722
- onClick: () => S((e) => e === null ? e : (e + 1) % l.length),
723
- "aria-label": "Suivant",
724
- children: /* @__PURE__ */ r.jsx("svg", { viewBox: "0 0 24 24", className: "h-6 w-6", stroke: "currentColor", strokeWidth: 2, fill: "none", children: /* @__PURE__ */ r.jsx("path", { d: "M9 6l6 6-6 6", strokeLinecap: "round", strokeLinejoin: "round" }) })
725
- }
726
- )
727
- ] })
71
+ )
728
72
  ]
729
73
  }
730
74
  );
731
- }
75
+ };
732
76
  export {
733
- Ze as FilesUploadField
77
+ D as Image
734
78
  };
735
79
  //# sourceMappingURL=index14.js.map