@expcat/tigercat-react 2.1.1 → 2.1.3

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 (591) hide show
  1. package/dist/{chunk-4C2X5PZO.mjs → chunk-25BKSXTX.mjs} +209 -98
  2. package/dist/{chunk-IGBQGR6G.mjs → chunk-2AVHOPKK.mjs} +112 -54
  3. package/dist/{chunk-34VGG7AK.mjs → chunk-2AVQQGL2.mjs} +6 -5
  4. package/dist/{chunk-Y6557RWE.mjs → chunk-2BRMZBQ2.mjs} +43 -15
  5. package/dist/{chunk-X4L3W7RQ.mjs → chunk-2FFAUB47.mjs} +34 -21
  6. package/dist/chunk-2N6WZ5Z5.mjs +427 -0
  7. package/dist/chunk-2PC625DX.mjs +88 -0
  8. package/dist/chunk-2QJGXENY.mjs +85 -0
  9. package/dist/chunk-2SN5JTST.mjs +99 -0
  10. package/dist/chunk-2STETY2J.mjs +160 -0
  11. package/dist/{chunk-GR3Y3XWP.mjs → chunk-34BU3D7L.mjs} +21 -3
  12. package/dist/chunk-3J2AUNWT.mjs +326 -0
  13. package/dist/chunk-3KBFOO2E.mjs +139 -0
  14. package/dist/{chunk-2YBLMVDT.mjs → chunk-3QSO6YK5.mjs} +40 -47
  15. package/dist/{chunk-YJ5T4XZN.mjs → chunk-3WP4PGHF.mjs} +24 -25
  16. package/dist/chunk-4BJCH6FI.mjs +454 -0
  17. package/dist/{chunk-QB5472NM.mjs → chunk-4DFN6RZ4.mjs} +25 -26
  18. package/dist/{chunk-YNDPQVEK.mjs → chunk-4ED2QCE6.mjs} +69 -36
  19. package/dist/{chunk-N2D7NPEW.mjs → chunk-4JVXADTJ.mjs} +30 -22
  20. package/dist/chunk-4KZETZUH.mjs +143 -0
  21. package/dist/chunk-4ZFZCNX5.mjs +96 -0
  22. package/dist/chunk-53RDSFKZ.mjs +320 -0
  23. package/dist/{chunk-TQ6RIFWR.mjs → chunk-57IHCV62.mjs} +30 -14
  24. package/dist/chunk-5D6BOIZB.mjs +104 -0
  25. package/dist/chunk-5I7FKHZO.mjs +768 -0
  26. package/dist/chunk-5J7EDMS7.mjs +13 -0
  27. package/dist/chunk-5P3OFNH3.mjs +290 -0
  28. package/dist/{chunk-2YOP55OF.mjs → chunk-5QTYD4XG.mjs} +244 -229
  29. package/dist/chunk-5XI3Q6A6.mjs +279 -0
  30. package/dist/{chunk-NT7GW2FD.mjs → chunk-635ACZQW.mjs} +3 -2
  31. package/dist/chunk-65CDWNRJ.mjs +314 -0
  32. package/dist/chunk-6D2VLITE.mjs +431 -0
  33. package/dist/chunk-6IJFLGCN.mjs +274 -0
  34. package/dist/chunk-6NCG4SLX.mjs +158 -0
  35. package/dist/chunk-6NJMDDL6.mjs +244 -0
  36. package/dist/chunk-6R66IQ5V.mjs +214 -0
  37. package/dist/chunk-7H7EKANG.mjs +145 -0
  38. package/dist/chunk-7KVHHNUI.mjs +297 -0
  39. package/dist/chunk-7VPMOGN3.mjs +205 -0
  40. package/dist/{chunk-F2ITBDUS.mjs → chunk-A4JRK5SM.mjs} +43 -22
  41. package/dist/chunk-A6PNUVY6.mjs +236 -0
  42. package/dist/chunk-ACV7IV3W.mjs +339 -0
  43. package/dist/{chunk-EW43YBPV.mjs → chunk-AFVKH2Z3.mjs} +66 -31
  44. package/dist/chunk-B2IFWWM5.mjs +352 -0
  45. package/dist/chunk-BKIINKEY.mjs +138 -0
  46. package/dist/{chunk-OKYMTHFQ.mjs → chunk-BKSYS4D6.mjs} +74 -77
  47. package/dist/chunk-BNCUJLRV.mjs +152 -0
  48. package/dist/chunk-BP24PM37.mjs +397 -0
  49. package/dist/{chunk-AYFKHWJS.mjs → chunk-C4UZFBFV.mjs} +127 -111
  50. package/dist/chunk-C6FS67EL.mjs +260 -0
  51. package/dist/chunk-CCTBNDCX.mjs +637 -0
  52. package/dist/chunk-CJSB5NOK.mjs +348 -0
  53. package/dist/chunk-CKKOBWER.mjs +182 -0
  54. package/dist/chunk-CMOSTUC3.mjs +296 -0
  55. package/dist/chunk-CQQRB4QZ.mjs +364 -0
  56. package/dist/chunk-CX7QZXU5.mjs +41 -0
  57. package/dist/chunk-DNDJAR2I.mjs +38 -0
  58. package/dist/chunk-E7OUCJ3U.mjs +34 -0
  59. package/dist/{chunk-FLYJVZED.mjs → chunk-ED7QR6PJ.mjs} +2 -2
  60. package/dist/chunk-EFZDKSTJ.mjs +279 -0
  61. package/dist/chunk-EJY3Y2XU.mjs +550 -0
  62. package/dist/{chunk-7EXOY7GD.mjs → chunk-FVA5VKN2.mjs} +25 -15
  63. package/dist/{chunk-ZJWUBR2X.mjs → chunk-G5NPND2T.mjs} +18 -2
  64. package/dist/chunk-GJRGMIB3.mjs +863 -0
  65. package/dist/{chunk-CQOLQAB5.mjs → chunk-GMHJWSQB.mjs} +770 -661
  66. package/dist/{chunk-U4M3DC2P.mjs → chunk-GOIJNJ5D.mjs} +17 -1
  67. package/dist/chunk-GRB667BG.mjs +442 -0
  68. package/dist/chunk-HAG7TGPS.mjs +157 -0
  69. package/dist/{chunk-L5KAXWQI.mjs → chunk-HHRU7TK3.mjs} +18 -2
  70. package/dist/chunk-HZGTQGSM.mjs +943 -0
  71. package/dist/chunk-I4P4T6LL.mjs +287 -0
  72. package/dist/{chunk-FPQMJFFM.mjs → chunk-IELUUOM4.mjs} +15 -7
  73. package/dist/chunk-IPI45RUK.mjs +80 -0
  74. package/dist/chunk-IR45LOEZ.mjs +376 -0
  75. package/dist/chunk-ITC2NU25.mjs +35 -0
  76. package/dist/chunk-IZC77KAN.mjs +497 -0
  77. package/dist/chunk-J3BDVC5F.mjs +107 -0
  78. package/dist/chunk-JML6CK44.mjs +483 -0
  79. package/dist/chunk-JVLLOOEE.mjs +248 -0
  80. package/dist/chunk-KDO5PUMV.mjs +368 -0
  81. package/dist/{chunk-QU3QXUTC.mjs → chunk-KJB2OIG7.mjs} +89 -70
  82. package/dist/chunk-KJSNUS45.mjs +23 -0
  83. package/dist/chunk-KTBAJ3TL.mjs +408 -0
  84. package/dist/chunk-KVXGNUIE.mjs +101 -0
  85. package/dist/{chunk-XJ7U2W7S.mjs → chunk-LHHRNRND.mjs} +7 -3
  86. package/dist/{chunk-2JMI7TCM.mjs → chunk-LMSEOGKK.mjs} +2 -11
  87. package/dist/{chunk-VJWSKJLJ.mjs → chunk-LPVE2LX3.mjs} +34 -21
  88. package/dist/chunk-LTIICOWN.mjs +115 -0
  89. package/dist/chunk-M7TSPEXC.mjs +826 -0
  90. package/dist/chunk-MADQ6KHD.mjs +116 -0
  91. package/dist/{chunk-FNK2VWPP.mjs → chunk-N53N6H54.mjs} +59 -25
  92. package/dist/chunk-NFDR7KTS.mjs +597 -0
  93. package/dist/chunk-NNDEPQJG.mjs +172 -0
  94. package/dist/{chunk-HKAZXG74.mjs → chunk-NPGU6VYD.mjs} +109 -22
  95. package/dist/chunk-NRLES2YZ.mjs +174 -0
  96. package/dist/chunk-NTCVAVYZ.mjs +182 -0
  97. package/dist/chunk-O3O5GBBY.mjs +181 -0
  98. package/dist/chunk-O7DJWXII.mjs +112 -0
  99. package/dist/{chunk-54HN5BXW.mjs → chunk-OES5DL3S.mjs} +148 -97
  100. package/dist/chunk-OIMP63RE.mjs +967 -0
  101. package/dist/{chunk-CUAXRBKO.mjs → chunk-OP77MPGN.mjs} +22 -12
  102. package/dist/chunk-OTABJT7Z.mjs +61 -0
  103. package/dist/chunk-OYQ6HTLQ.mjs +457 -0
  104. package/dist/chunk-PLEAZRIC.mjs +315 -0
  105. package/dist/chunk-PTKNRNH6.mjs +34 -0
  106. package/dist/{chunk-DECUASRW.mjs → chunk-PTKQJPLM.mjs} +134 -102
  107. package/dist/chunk-PV237GAZ.mjs +226 -0
  108. package/dist/chunk-PZ4LAI6G.mjs +365 -0
  109. package/dist/chunk-Q4TGJNVU.mjs +857 -0
  110. package/dist/{chunk-XT43B7ZI.mjs → chunk-QIGZOYBF.mjs} +28 -13
  111. package/dist/chunk-QUF2UX52.mjs +343 -0
  112. package/dist/chunk-R2VBVZIH.mjs +20 -0
  113. package/dist/chunk-R45ZPU5J.mjs +19 -0
  114. package/dist/{chunk-AUD3VOLO.mjs → chunk-R7J37DKJ.mjs} +115 -76
  115. package/dist/chunk-REJVXLW5.mjs +97 -0
  116. package/dist/chunk-RLUBTLOT.mjs +80 -0
  117. package/dist/chunk-RNH2I23I.mjs +341 -0
  118. package/dist/chunk-RNKUEEIX.mjs +350 -0
  119. package/dist/chunk-RTKPLZ5A.mjs +545 -0
  120. package/dist/chunk-RUIFGSVN.mjs +141 -0
  121. package/dist/chunk-S3B5QPUA.mjs +76 -0
  122. package/dist/{chunk-SDLMB34Y.mjs → chunk-ST4NN6XV.mjs} +5 -3
  123. package/dist/{chunk-ZATZRXMW.mjs → chunk-T5VXIYWF.mjs} +68 -62
  124. package/dist/chunk-TTYKX6G4.mjs +355 -0
  125. package/dist/chunk-TVVLCER6.mjs +540 -0
  126. package/dist/chunk-U7V7ZWJ6.mjs +256 -0
  127. package/dist/chunk-UAFA5GOL.mjs +160 -0
  128. package/dist/chunk-UJTAHHQT.mjs +41 -0
  129. package/dist/chunk-UK5NGPTQ.mjs +62 -0
  130. package/dist/chunk-UMJIDEXI.mjs +261 -0
  131. package/dist/chunk-UOF324U6.mjs +80 -0
  132. package/dist/chunk-UTVZUCKK.mjs +61 -0
  133. package/dist/chunk-UWQBY3CL.mjs +331 -0
  134. package/dist/chunk-V6FJYERX.mjs +501 -0
  135. package/dist/chunk-VDBLI5Y3.mjs +33 -0
  136. package/dist/chunk-WBESWSTS.mjs +121 -0
  137. package/dist/chunk-WCIUNNIN.mjs +108 -0
  138. package/dist/chunk-WFLXJOFU.mjs +124 -0
  139. package/dist/chunk-WKZZ4IQK.mjs +403 -0
  140. package/dist/{chunk-CN3QXWK3.mjs → chunk-WLCRBIZO.mjs} +53 -44
  141. package/dist/chunk-WN6ZHQTI.mjs +129 -0
  142. package/dist/chunk-WPRXOO6N.mjs +90 -0
  143. package/dist/{chunk-XZVQ3PJS.mjs → chunk-WQMOFDAY.mjs} +9 -18
  144. package/dist/{chunk-CC7IOSNI.mjs → chunk-WSN4Z4MC.mjs} +101 -76
  145. package/dist/{chunk-QXSUG7SN.mjs → chunk-WW6MFKTJ.mjs} +173 -189
  146. package/dist/chunk-WWZZRB7H.mjs +121 -0
  147. package/dist/chunk-X3KXJKLM.mjs +297 -0
  148. package/dist/chunk-X7NF2HZV.mjs +551 -0
  149. package/dist/{chunk-M6ZPTGBV.mjs → chunk-XAYOEQGB.mjs} +69 -46
  150. package/dist/chunk-XBDLXTF7.mjs +21 -0
  151. package/dist/chunk-XE34TOCS.mjs +294 -0
  152. package/dist/chunk-XI6KQAHW.mjs +256 -0
  153. package/dist/{chunk-Y3SGFGN6.mjs → chunk-XJHC6JEC.mjs} +16 -2
  154. package/dist/{chunk-WTHWLCRL.mjs → chunk-XKB7ECPU.mjs} +39 -28
  155. package/dist/{chunk-R7YZ6FKP.mjs → chunk-XXU5VQV5.mjs} +231 -207
  156. package/dist/chunk-XYW6RTRB.mjs +217 -0
  157. package/dist/chunk-XZFHPHV5.mjs +75 -0
  158. package/dist/{chunk-3HHEVMHE.mjs → chunk-YCVORYEO.mjs} +71 -66
  159. package/dist/chunk-YDO3V3SK.mjs +70 -0
  160. package/dist/{chunk-OTBXERJD.mjs → chunk-YLXEMZVI.mjs} +35 -32
  161. package/dist/chunk-ZATZSMQY.mjs +620 -0
  162. package/dist/chunk-ZG6WST55.mjs +188 -0
  163. package/dist/chunk-ZGXC47M5.mjs +361 -0
  164. package/dist/components/ActivityFeed.d.mts +2 -0
  165. package/dist/components/ActivityFeed.mjs +13 -12
  166. package/dist/components/Affix.d.mts +1 -2
  167. package/dist/components/Affix.mjs +1 -1
  168. package/dist/components/Alert.d.mts +5 -5
  169. package/dist/components/Alert.mjs +3 -2
  170. package/dist/components/Anchor.d.mts +11 -38
  171. package/dist/components/Anchor.mjs +3 -1
  172. package/dist/components/AreaChart.mjs +11 -9
  173. package/dist/components/AspectRatio.mjs +1 -1
  174. package/dist/components/AutoComplete.d.mts +11 -10
  175. package/dist/components/AutoComplete.mjs +6 -4
  176. package/dist/components/Avatar.d.mts +5 -6
  177. package/dist/components/Avatar.mjs +3 -4
  178. package/dist/components/AvatarGroup.d.mts +2 -3
  179. package/dist/components/AvatarGroup.mjs +2 -3
  180. package/dist/components/BackTop.d.mts +4 -13
  181. package/dist/components/BackTop.mjs +2 -1
  182. package/dist/components/Badge.d.mts +3 -1
  183. package/dist/components/Badge.mjs +1 -3
  184. package/dist/components/BarChart.mjs +11 -9
  185. package/dist/components/Breadcrumb.d.mts +11 -18
  186. package/dist/components/Breadcrumb.mjs +2 -1
  187. package/dist/components/Button.d.mts +3 -2
  188. package/dist/components/Button.mjs +2 -2
  189. package/dist/components/ButtonGroup.mjs +1 -1
  190. package/dist/components/Calendar.d.mts +3 -2
  191. package/dist/components/Calendar.mjs +3 -3
  192. package/dist/components/Card.d.mts +6 -22
  193. package/dist/components/Card.mjs +1 -1
  194. package/dist/components/Carousel.d.mts +1 -24
  195. package/dist/components/Carousel.mjs +3 -4
  196. package/dist/components/Cascader.d.mts +19 -13
  197. package/dist/components/Cascader.mjs +6 -4
  198. package/dist/components/ChartAxis.mjs +1 -1
  199. package/dist/components/ChartCanvas.d.mts +3 -2
  200. package/dist/components/ChartCanvas.mjs +1 -1
  201. package/dist/components/ChartGrid.d.mts +1 -1
  202. package/dist/components/ChartGrid.mjs +1 -1
  203. package/dist/components/ChartLegend.d.mts +3 -10
  204. package/dist/components/ChartLegend.mjs +2 -1
  205. package/dist/components/ChartSeries.d.mts +2 -2
  206. package/dist/components/ChartSeries.mjs +1 -1
  207. package/dist/components/ChartTooltip.d.mts +2 -1
  208. package/dist/components/ChartTooltip.mjs +2 -1
  209. package/dist/components/ChatWindow.d.mts +6 -4
  210. package/dist/components/ChatWindow.mjs +13 -13
  211. package/dist/components/Checkbox.d.mts +3 -40
  212. package/dist/components/Checkbox.mjs +4 -3
  213. package/dist/components/CheckboxGroup.d.mts +3 -19
  214. package/dist/components/CheckboxGroup.mjs +3 -2
  215. package/dist/components/Code.d.mts +3 -1
  216. package/dist/components/Code.mjs +2 -3
  217. package/dist/components/CodeEditor.d.mts +10 -7
  218. package/dist/components/CodeEditor.mjs +4 -1
  219. package/dist/components/Col.d.mts +1 -1
  220. package/dist/components/Col.mjs +1 -2
  221. package/dist/components/Collapse.d.mts +7 -10
  222. package/dist/components/Collapse.mjs +1 -1
  223. package/dist/components/CollapsePanel.d.mts +1 -13
  224. package/dist/components/CollapsePanel.mjs +2 -2
  225. package/dist/components/ColorPicker.d.mts +10 -4
  226. package/dist/components/ColorPicker.mjs +10 -4
  227. package/dist/components/ColorSwatch.d.mts +8 -1
  228. package/dist/components/ColorSwatch.mjs +4 -1
  229. package/dist/components/CommentThread.mjs +12 -12
  230. package/dist/components/ConfigProvider.d.mts +4 -14
  231. package/dist/components/ConfigProvider.mjs +1 -2
  232. package/dist/components/Container.d.mts +2 -2
  233. package/dist/components/Container.mjs +1 -1
  234. package/dist/components/Content.d.mts +2 -1
  235. package/dist/components/Content.mjs +2 -1
  236. package/dist/components/ContextMenu.d.mts +3 -2
  237. package/dist/components/ContextMenu.mjs +3 -2
  238. package/dist/components/Countdown.d.mts +7 -1
  239. package/dist/components/Countdown.mjs +1 -1
  240. package/dist/components/CronEditor.d.mts +4 -6
  241. package/dist/components/CronEditor.mjs +4 -3
  242. package/dist/components/CropUpload.d.mts +6 -39
  243. package/dist/components/CropUpload.mjs +11 -8
  244. package/dist/components/DataExport.d.mts +8 -4
  245. package/dist/components/DataExport.mjs +6 -5
  246. package/dist/components/DataTableWithToolbar.d.mts +20 -20
  247. package/dist/components/DataTableWithToolbar.mjs +21 -19
  248. package/dist/components/DatePicker.d.mts +11 -5
  249. package/dist/components/DatePicker.mjs +7 -5
  250. package/dist/components/Descriptions.d.mts +5 -43
  251. package/dist/components/Descriptions.mjs +2 -1
  252. package/dist/components/Divider.d.mts +3 -3
  253. package/dist/components/Divider.mjs +1 -1
  254. package/dist/components/DonutChart.d.mts +0 -6
  255. package/dist/components/DonutChart.mjs +9 -6
  256. package/dist/components/Drawer.d.mts +1 -6
  257. package/dist/components/Drawer.mjs +4 -4
  258. package/dist/components/Dropdown.d.mts +4 -18
  259. package/dist/components/Dropdown.mjs +4 -2
  260. package/dist/components/Empty.d.mts +1 -1
  261. package/dist/components/Empty.mjs +2 -3
  262. package/dist/components/FileManager.d.mts +2 -1
  263. package/dist/components/FileManager.mjs +4 -4
  264. package/dist/components/FloatButton.d.mts +5 -9
  265. package/dist/components/FloatButton.mjs +9 -3
  266. package/dist/components/Footer.d.mts +2 -1
  267. package/dist/components/Footer.mjs +1 -1
  268. package/dist/components/Form.d.mts +15 -64
  269. package/dist/components/Form.mjs +2 -3
  270. package/dist/components/FormItem.d.mts +1 -6
  271. package/dist/components/FormItem.mjs +4 -5
  272. package/dist/components/FormItemContext.d.mts +9 -1
  273. package/dist/components/FormWizard.d.mts +9 -2
  274. package/dist/components/FormWizard.mjs +8 -6
  275. package/dist/components/FunnelChart.d.mts +1 -2
  276. package/dist/components/FunnelChart.mjs +12 -7
  277. package/dist/components/Gantt.d.mts +1 -1
  278. package/dist/components/Gantt.mjs +3 -2
  279. package/dist/components/GaugeChart.d.mts +1 -1
  280. package/dist/components/GaugeChart.mjs +9 -5
  281. package/dist/components/Header.d.mts +1 -1
  282. package/dist/components/Header.mjs +1 -1
  283. package/dist/components/HeatmapChart.d.mts +2 -2
  284. package/dist/components/HeatmapChart.mjs +11 -6
  285. package/dist/components/Highlight.mjs +1 -1
  286. package/dist/components/Icon.d.mts +1 -1
  287. package/dist/components/Icon.mjs +1 -1
  288. package/dist/components/Image.d.mts +4 -2
  289. package/dist/components/Image.mjs +7 -7
  290. package/dist/components/ImageAnnotation.d.mts +3 -2
  291. package/dist/components/ImageAnnotation.mjs +3 -3
  292. package/dist/components/ImageCompare.mjs +3 -1
  293. package/dist/components/ImageCropper.d.mts +2 -7
  294. package/dist/components/ImageCropper.mjs +3 -3
  295. package/dist/components/ImageGroup.d.mts +6 -12
  296. package/dist/components/ImageGroup.mjs +4 -5
  297. package/dist/components/ImagePreview.d.mts +2 -12
  298. package/dist/components/ImagePreview.mjs +3 -4
  299. package/dist/components/ImageViewer.d.mts +5 -0
  300. package/dist/components/ImageViewer.mjs +4 -3
  301. package/dist/components/InfiniteScroll.d.mts +2 -12
  302. package/dist/components/InfiniteScroll.mjs +2 -3
  303. package/dist/components/Input.d.mts +3 -30
  304. package/dist/components/Input.mjs +5 -3
  305. package/dist/components/InputGroup.d.mts +0 -1
  306. package/dist/components/InputGroup.mjs +1 -1
  307. package/dist/components/InputNumber.d.mts +4 -13
  308. package/dist/components/InputNumber.mjs +5 -3
  309. package/dist/components/InputOTP.d.mts +4 -22
  310. package/dist/components/InputOTP.mjs +3 -4
  311. package/dist/components/Kanban.d.mts +13 -46
  312. package/dist/components/Kanban.mjs +4 -4
  313. package/dist/components/Kbd.mjs +1 -1
  314. package/dist/components/Layout.d.mts +1 -1
  315. package/dist/components/Layout.mjs +2 -1
  316. package/dist/components/LineChart.mjs +11 -9
  317. package/dist/components/Link.d.mts +1 -1
  318. package/dist/components/Link.mjs +1 -1
  319. package/dist/components/List.d.mts +8 -111
  320. package/dist/components/List.mjs +12 -7
  321. package/dist/components/Loading.d.mts +1 -0
  322. package/dist/components/Loading.mjs +3 -4
  323. package/dist/components/LoadingBar.d.mts +2 -3
  324. package/dist/components/LoadingBar.mjs +56 -83
  325. package/dist/components/LoadingBarContainer.d.mts +1 -1
  326. package/dist/components/LoadingBarContainer.mjs +2 -1
  327. package/dist/components/LoadingBarRoot.d.mts +3 -3
  328. package/dist/components/LoadingBarRoot.mjs +1 -1
  329. package/dist/components/MarkdownEditor.d.mts +7 -4
  330. package/dist/components/MarkdownEditor.mjs +4 -4
  331. package/dist/components/Marquee.mjs +1 -1
  332. package/dist/components/MaskInput.d.mts +3 -23
  333. package/dist/components/MaskInput.mjs +5 -2
  334. package/dist/components/Masonry.d.mts +0 -1
  335. package/dist/components/Masonry.mjs +1 -1
  336. package/dist/components/Mentions.d.mts +10 -10
  337. package/dist/components/Mentions.mjs +6 -2
  338. package/dist/components/Menu.d.mts +16 -59
  339. package/dist/components/Menu.mjs +6 -2
  340. package/dist/components/Message.d.mts +1 -2
  341. package/dist/components/Message.mjs +55 -120
  342. package/dist/components/MessageContainer.d.mts +6 -0
  343. package/dist/components/MessageContainer.mjs +4 -2
  344. package/dist/components/MessageRoot.d.mts +2 -2
  345. package/dist/components/MessageRoot.mjs +1 -1
  346. package/dist/components/Modal.d.mts +7 -23
  347. package/dist/components/Modal.mjs +6 -6
  348. package/dist/components/NavigationMenu.d.mts +11 -7
  349. package/dist/components/NavigationMenu.mjs +3 -2
  350. package/dist/components/Notification.d.mts +1 -2
  351. package/dist/components/Notification.mjs +72 -163
  352. package/dist/components/NotificationCenter.mjs +14 -13
  353. package/dist/components/NotificationContainer.d.mts +6 -0
  354. package/dist/components/NotificationContainer.mjs +4 -2
  355. package/dist/components/NotificationRoot.d.mts +3 -3
  356. package/dist/components/NotificationRoot.mjs +1 -1
  357. package/dist/components/NumberKeyboard.d.mts +4 -4
  358. package/dist/components/NumberKeyboard.mjs +5 -3
  359. package/dist/components/OrgChart.mjs +3 -2
  360. package/dist/components/PageHeader.d.mts +3 -1
  361. package/dist/components/PageHeader.mjs +5 -4
  362. package/dist/components/Pagination.mjs +2 -3
  363. package/dist/components/PieChart.mjs +8 -5
  364. package/dist/components/Popconfirm.d.mts +18 -7
  365. package/dist/components/Popconfirm.mjs +8 -3
  366. package/dist/components/Popover.d.mts +14 -5
  367. package/dist/components/Popover.mjs +5 -3
  368. package/dist/components/PrintLayout.d.mts +7 -12
  369. package/dist/components/PrintLayout.mjs +2 -1
  370. package/dist/components/Progress.mjs +2 -1
  371. package/dist/components/QRCode.d.mts +3 -11
  372. package/dist/components/QRCode.mjs +2 -3
  373. package/dist/components/RadarChart.d.mts +0 -16
  374. package/dist/components/RadarChart.mjs +8 -6
  375. package/dist/components/Radio.d.mts +2 -11
  376. package/dist/components/Radio.mjs +4 -3
  377. package/dist/components/RadioGroup.d.mts +3 -11
  378. package/dist/components/RadioGroup.mjs +3 -2
  379. package/dist/components/Rate.d.mts +4 -7
  380. package/dist/components/Rate.mjs +3 -3
  381. package/dist/components/Resizable.d.mts +6 -2
  382. package/dist/components/Resizable.mjs +3 -1
  383. package/dist/components/Result.d.mts +6 -2
  384. package/dist/components/Result.mjs +2 -2
  385. package/dist/components/RichTextEditor.d.mts +6 -16
  386. package/dist/components/RichTextEditor.mjs +4 -4
  387. package/dist/components/Row.d.mts +2 -6
  388. package/dist/components/Row.mjs +3 -5
  389. package/dist/components/ScatterChart.mjs +11 -11
  390. package/dist/components/ScrollArea.d.mts +3 -2
  391. package/dist/components/ScrollArea.mjs +2 -1
  392. package/dist/components/ScrollSpy.d.mts +5 -4
  393. package/dist/components/ScrollSpy.mjs +3 -1
  394. package/dist/components/Segmented.d.mts +2 -3
  395. package/dist/components/Segmented.mjs +3 -1
  396. package/dist/components/Select.d.mts +18 -5
  397. package/dist/components/Select.mjs +6 -4
  398. package/dist/components/Sidebar.d.mts +1 -1
  399. package/dist/components/Sidebar.mjs +3 -1
  400. package/dist/components/Signature.d.mts +5 -2
  401. package/dist/components/Signature.mjs +4 -3
  402. package/dist/components/Skeleton.d.mts +1 -1
  403. package/dist/components/Skeleton.mjs +1 -1
  404. package/dist/components/Slider.d.mts +3 -5
  405. package/dist/components/Slider.mjs +4 -1
  406. package/dist/components/Space.d.mts +5 -1
  407. package/dist/components/Space.mjs +1 -1
  408. package/dist/components/SplitButton.d.mts +1 -21
  409. package/dist/components/SplitButton.mjs +8 -5
  410. package/dist/components/Splitter.d.mts +2 -2
  411. package/dist/components/Splitter.mjs +2 -1
  412. package/dist/components/Spotlight.d.mts +4 -3
  413. package/dist/components/Spotlight.mjs +4 -5
  414. package/dist/components/Statistic.d.mts +5 -2
  415. package/dist/components/Statistic.mjs +2 -1
  416. package/dist/components/Stepper.d.mts +3 -5
  417. package/dist/components/Stepper.mjs +4 -2
  418. package/dist/components/Steps.d.mts +4 -1
  419. package/dist/components/Steps.mjs +2 -1
  420. package/dist/components/SunburstChart.d.mts +1 -2
  421. package/dist/components/SunburstChart.mjs +12 -7
  422. package/dist/components/Switch.d.mts +3 -8
  423. package/dist/components/Switch.mjs +3 -2
  424. package/dist/components/Table.d.mts +2 -2
  425. package/dist/components/Table.mjs +18 -12
  426. package/dist/components/Tabs.d.mts +6 -94
  427. package/dist/components/Tabs.mjs +2 -3
  428. package/dist/components/Tag.d.mts +13 -2
  429. package/dist/components/Tag.mjs +2 -3
  430. package/dist/components/TagsInput.d.mts +3 -26
  431. package/dist/components/TagsInput.mjs +6 -5
  432. package/dist/components/TaskBoard.d.mts +1 -3
  433. package/dist/components/TaskBoard.mjs +3 -3
  434. package/dist/components/Text.d.mts +4 -2
  435. package/dist/components/Text.mjs +1 -1
  436. package/dist/components/Textarea.d.mts +3 -0
  437. package/dist/components/Textarea.mjs +4 -3
  438. package/dist/components/TimePicker.d.mts +22 -19
  439. package/dist/components/TimePicker.mjs +6 -5
  440. package/dist/components/Timeline.d.mts +7 -27
  441. package/dist/components/Timeline.mjs +2 -3
  442. package/dist/components/Tooltip.d.mts +12 -2
  443. package/dist/components/Tooltip.mjs +5 -3
  444. package/dist/components/Tour.d.mts +8 -4
  445. package/dist/components/Tour.mjs +7 -5
  446. package/dist/components/Transfer.d.mts +8 -10
  447. package/dist/components/Transfer.mjs +7 -3
  448. package/dist/components/Tree.d.mts +30 -175
  449. package/dist/components/Tree.mjs +8 -4
  450. package/dist/components/TreeMapChart.d.mts +1 -2
  451. package/dist/components/TreeMapChart.mjs +12 -7
  452. package/dist/components/TreeSelect.d.mts +18 -9
  453. package/dist/components/TreeSelect.mjs +7 -5
  454. package/dist/components/Upload.d.mts +9 -9
  455. package/dist/components/Upload.mjs +9 -4
  456. package/dist/components/VirtualList.d.mts +7 -4
  457. package/dist/components/VirtualList.mjs +1 -1
  458. package/dist/components/VirtualTable.d.mts +8 -6
  459. package/dist/components/VirtualTable.mjs +2 -3
  460. package/dist/components/Watermark.d.mts +1 -1
  461. package/dist/components/Watermark.mjs +1 -1
  462. package/dist/hooks/useChartInteraction.d.mts +5 -56
  463. package/dist/hooks/useChartInteraction.mjs +1 -1
  464. package/dist/hooks/useControlledState.d.mts +25 -22
  465. package/dist/hooks/useControlledState.mjs +1 -1
  466. package/dist/hooks/useDrag.d.mts +3 -21
  467. package/dist/hooks/useDrag.mjs +1 -1
  468. package/dist/hooks/useFormController.d.mts +3 -16
  469. package/dist/hooks/useFormController.mjs +1 -1
  470. package/dist/hooks/useResponsiveChartSize.d.mts +15 -0
  471. package/dist/hooks/useResponsiveChartSize.mjs +6 -0
  472. package/dist/index.d.mts +20 -17
  473. package/dist/index.mjs +1385 -198
  474. package/dist/types-C11UWmeK.d.mts +10 -0
  475. package/package.json +23 -8
  476. package/dist/chunk-246DAUEF.mjs +0 -181
  477. package/dist/chunk-2HKFQ74Z.mjs +0 -127
  478. package/dist/chunk-2JYJPNW3.mjs +0 -280
  479. package/dist/chunk-32MCQMBJ.mjs +0 -332
  480. package/dist/chunk-3G5EJRD4.mjs +0 -152
  481. package/dist/chunk-3LACOSJQ.mjs +0 -65
  482. package/dist/chunk-3LDDXHW2.mjs +0 -217
  483. package/dist/chunk-3O3AQLNS.mjs +0 -172
  484. package/dist/chunk-3QNIFKVF.mjs +0 -232
  485. package/dist/chunk-5P5M656V.mjs +0 -81
  486. package/dist/chunk-5SEMRHBD.mjs +0 -327
  487. package/dist/chunk-5TE7KLE5.mjs +0 -92
  488. package/dist/chunk-5ZYZQXEM.mjs +0 -188
  489. package/dist/chunk-677VSTPW.mjs +0 -72
  490. package/dist/chunk-6H5Y7Y6E.mjs +0 -148
  491. package/dist/chunk-6SEPT4C5.mjs +0 -57
  492. package/dist/chunk-6UIVNRAR.mjs +0 -188
  493. package/dist/chunk-72CJNKDY.mjs +0 -222
  494. package/dist/chunk-AKNWUI7K.mjs +0 -82
  495. package/dist/chunk-ALSOPYM5.mjs +0 -705
  496. package/dist/chunk-ASLRAZZN.mjs +0 -191
  497. package/dist/chunk-AYHP2OAX.mjs +0 -14
  498. package/dist/chunk-BBK37UMR.mjs +0 -134
  499. package/dist/chunk-BUXHI6UK.mjs +0 -701
  500. package/dist/chunk-BXAH2GH3.mjs +0 -64
  501. package/dist/chunk-BYD7EAWK.mjs +0 -211
  502. package/dist/chunk-CFQKUMZV.mjs +0 -26
  503. package/dist/chunk-CRIEUKMD.mjs +0 -322
  504. package/dist/chunk-CT36XD5I.mjs +0 -412
  505. package/dist/chunk-CVYA3MI2.mjs +0 -653
  506. package/dist/chunk-D3KP72UC.mjs +0 -802
  507. package/dist/chunk-EAAWB3CK.mjs +0 -142
  508. package/dist/chunk-EG7EMDKK.mjs +0 -108
  509. package/dist/chunk-EPWAROC2.mjs +0 -73
  510. package/dist/chunk-FDKWHP2K.mjs +0 -352
  511. package/dist/chunk-FQS24AUH.mjs +0 -241
  512. package/dist/chunk-GBEDWXLL.mjs +0 -127
  513. package/dist/chunk-GOQ6ZG7H.mjs +0 -67
  514. package/dist/chunk-GV4F6X3C.mjs +0 -266
  515. package/dist/chunk-HAXRHSCN.mjs +0 -291
  516. package/dist/chunk-HLS4CHWX.mjs +0 -30
  517. package/dist/chunk-HS6KUPTI.mjs +0 -177
  518. package/dist/chunk-I2BENK5X.mjs +0 -149
  519. package/dist/chunk-I5TELDUV.mjs +0 -78
  520. package/dist/chunk-IIWUQK2P.mjs +0 -109
  521. package/dist/chunk-IXV5YBCZ.mjs +0 -65
  522. package/dist/chunk-J76R2S62.mjs +0 -161
  523. package/dist/chunk-JZZPLKTW.mjs +0 -173
  524. package/dist/chunk-KCPGFO5R.mjs +0 -51
  525. package/dist/chunk-KDURW5AS.mjs +0 -231
  526. package/dist/chunk-KKN7KLTB.mjs +0 -84
  527. package/dist/chunk-KL6YJIZ3.mjs +0 -220
  528. package/dist/chunk-KQ4ZKXXN.mjs +0 -118
  529. package/dist/chunk-KRDHM5KB.mjs +0 -259
  530. package/dist/chunk-KVCI2346.mjs +0 -732
  531. package/dist/chunk-MEFARVQI.mjs +0 -25
  532. package/dist/chunk-MFPVVGNA.mjs +0 -248
  533. package/dist/chunk-MJVSZ2UJ.mjs +0 -276
  534. package/dist/chunk-MOWK7CND.mjs +0 -120
  535. package/dist/chunk-MXXAJSRS.mjs +0 -240
  536. package/dist/chunk-MYI3FPG4.mjs +0 -251
  537. package/dist/chunk-NADODEZX.mjs +0 -285
  538. package/dist/chunk-NJWTZ5MO.mjs +0 -688
  539. package/dist/chunk-NLGLBTSM.mjs +0 -138
  540. package/dist/chunk-O6VYD4E4.mjs +0 -508
  541. package/dist/chunk-O7TV5OKS.mjs +0 -143
  542. package/dist/chunk-OJ6SHHOZ.mjs +0 -234
  543. package/dist/chunk-OL3RXYMG.mjs +0 -46
  544. package/dist/chunk-OO562MFD.mjs +0 -80
  545. package/dist/chunk-OPHYFC5W.mjs +0 -52
  546. package/dist/chunk-OQ6Z6U7R.mjs +0 -135
  547. package/dist/chunk-OQLP452R.mjs +0 -468
  548. package/dist/chunk-OXGAZPPS.mjs +0 -147
  549. package/dist/chunk-OZ5XLR22.mjs +0 -182
  550. package/dist/chunk-PAS347EX.mjs +0 -109
  551. package/dist/chunk-PD6Q36OO.mjs +0 -471
  552. package/dist/chunk-PMQJ6AYT.mjs +0 -100
  553. package/dist/chunk-PY2VUNEJ.mjs +0 -494
  554. package/dist/chunk-Q5JTIICP.mjs +0 -108
  555. package/dist/chunk-QOAOOD53.mjs +0 -318
  556. package/dist/chunk-RE5ZLA5D.mjs +0 -268
  557. package/dist/chunk-RGVU4EMA.mjs +0 -531
  558. package/dist/chunk-RQSQXQN6.mjs +0 -100
  559. package/dist/chunk-RRGPDFDI.mjs +0 -255
  560. package/dist/chunk-RUQ3F3MV.mjs +0 -333
  561. package/dist/chunk-SEOG5AGS.mjs +0 -72
  562. package/dist/chunk-SHT4TU3T.mjs +0 -32
  563. package/dist/chunk-SJ5RFU2O.mjs +0 -21
  564. package/dist/chunk-SPIPFOGD.mjs +0 -322
  565. package/dist/chunk-SVIJ2UZA.mjs +0 -186
  566. package/dist/chunk-SXWEFZOF.mjs +0 -766
  567. package/dist/chunk-TDFLUDRM.mjs +0 -283
  568. package/dist/chunk-TEVEXDY2.mjs +0 -570
  569. package/dist/chunk-TGXBCKOU.mjs +0 -35
  570. package/dist/chunk-TO6MZFNQ.mjs +0 -186
  571. package/dist/chunk-TULQETJ5.mjs +0 -45
  572. package/dist/chunk-U2ZXZ2KQ.mjs +0 -213
  573. package/dist/chunk-U7RLVY67.mjs +0 -303
  574. package/dist/chunk-UHK2ISKR.mjs +0 -282
  575. package/dist/chunk-UYQBXVFE.mjs +0 -72
  576. package/dist/chunk-V7HJ5HLC.mjs +0 -412
  577. package/dist/chunk-VSFDT2RS.mjs +0 -46
  578. package/dist/chunk-W7BC4I2Y.mjs +0 -68
  579. package/dist/chunk-WK45IRP7.mjs +0 -93
  580. package/dist/chunk-WX5VUIGT.mjs +0 -22
  581. package/dist/chunk-X6C6MNG5.mjs +0 -240
  582. package/dist/chunk-XVHTJQ4T.mjs +0 -140
  583. package/dist/chunk-Y5X3G2LD.mjs +0 -115
  584. package/dist/chunk-Y6UH3EKE.mjs +0 -328
  585. package/dist/chunk-YN5ZIWCE.mjs +0 -19
  586. package/dist/chunk-YORCCCQX.mjs +0 -83
  587. package/dist/chunk-YSIXURBW.mjs +0 -116
  588. package/dist/chunk-Z23KOLNU.mjs +0 -326
  589. package/dist/chunk-Z3CRHC5F.mjs +0 -430
  590. package/dist/types-0oVwMXtR.d.mts +0 -33
  591. /package/dist/{chunk-5JETWHLJ.mjs → chunk-7P4R3NVO.mjs} +0 -0
@@ -0,0 +1,597 @@
1
+ import {
2
+ useControlledState
3
+ } from "./chunk-UJTAHHQT.mjs";
4
+ import {
5
+ useTigerConfig
6
+ } from "./chunk-RUIFGSVN.mjs";
7
+
8
+ // src/components/ImageAnnotation.tsx
9
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
10
+ import {
11
+ classNames,
12
+ isActivationKey,
13
+ addImageAnnotationPolygonPoint,
14
+ clampImageAnnotationShapeIndex,
15
+ commitImageAnnotationPolygon,
16
+ createCropperImageLoader,
17
+ createDocumentDragSession,
18
+ createImageAnnotationId,
19
+ defaultImageAnnotationTools,
20
+ draftImageAnnotationFromDraw,
21
+ finishImageAnnotationDraw,
22
+ getAnnotationDisplaySize,
23
+ getImageAnnotationCenter,
24
+ getImageAnnotationPathData,
25
+ getImageAnnotationPointFromClient,
26
+ getImageAnnotationShapeAriaLabel,
27
+ getImageAnnotationStrokeColor,
28
+ getImageAnnotationToolButtonClasses,
29
+ getImageAnnotationToolTypeLabel,
30
+ getImageEditorLabels,
31
+ getNextImageAnnotationTool,
32
+ getPreviousImageAnnotationTool,
33
+ imageAnnotationContainerClasses,
34
+ imageAnnotationDeleteButtonClasses,
35
+ imageAnnotationImageClasses,
36
+ imageAnnotationLabelClasses,
37
+ imageAnnotationOverlayClasses,
38
+ imageAnnotationReadonlyOverlayClasses,
39
+ imageAnnotationShapeClasses,
40
+ imageAnnotationStageClasses,
41
+ imageAnnotationToolbarClasses,
42
+ imageErrorClasses,
43
+ imageErrorIconPath,
44
+ imageLoadingSpinnerClasses,
45
+ imageLoadingSpinnerPath,
46
+ isImageAnnotationShapeTool,
47
+ mergeTigerLocale,
48
+ moveImageAnnotationDraw,
49
+ resolveImageAnnotationTool,
50
+ startImageAnnotationDraw
51
+ } from "@expcat/tigercat-core";
52
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
53
+ function renderErrorIcon() {
54
+ return /* @__PURE__ */ jsx(
55
+ "svg",
56
+ {
57
+ className: "h-8 w-8",
58
+ xmlns: "http://www.w3.org/2000/svg",
59
+ fill: "none",
60
+ viewBox: "0 0 24 24",
61
+ stroke: "currentColor",
62
+ "aria-hidden": "true",
63
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: imageErrorIconPath })
64
+ }
65
+ );
66
+ }
67
+ function renderLoadingSpinner() {
68
+ return /* @__PURE__ */ jsxs(
69
+ "svg",
70
+ {
71
+ className: imageLoadingSpinnerClasses,
72
+ xmlns: "http://www.w3.org/2000/svg",
73
+ fill: "none",
74
+ viewBox: "0 0 24 24",
75
+ "aria-hidden": "true",
76
+ children: [
77
+ /* @__PURE__ */ jsx(
78
+ "circle",
79
+ {
80
+ className: "opacity-25",
81
+ cx: "12",
82
+ cy: "12",
83
+ r: "10",
84
+ stroke: "currentColor",
85
+ strokeWidth: "4",
86
+ fill: "none"
87
+ }
88
+ ),
89
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: imageLoadingSpinnerPath })
90
+ ]
91
+ }
92
+ );
93
+ }
94
+ function ImageAnnotation({
95
+ locale,
96
+ src,
97
+ alt,
98
+ value,
99
+ defaultValue = [],
100
+ selectedId,
101
+ defaultSelectedId,
102
+ tool,
103
+ defaultTool = "select",
104
+ tools = defaultImageAnnotationTools,
105
+ disabled = false,
106
+ readonly = false,
107
+ minSize = 0.01,
108
+ strokeWidth = 2,
109
+ showLabels = true,
110
+ className,
111
+ style,
112
+ onChange,
113
+ onSelect,
114
+ onToolChange,
115
+ onReady,
116
+ onError,
117
+ ...rest
118
+ }) {
119
+ const config = useTigerConfig();
120
+ const mergedLocale = useMemo(
121
+ () => mergeTigerLocale(config.locale, locale),
122
+ [config.locale, locale]
123
+ );
124
+ const labels = useMemo(() => getImageEditorLabels(mergedLocale), [mergedLocale]);
125
+ const sizeHostRef = useRef(null);
126
+ const overlayRef = useRef(null);
127
+ const drawingRef = useRef(null);
128
+ const dragSessionRef = useRef(null);
129
+ const swallowClickRef = useRef(false);
130
+ const naturalRef = useRef({ w: 0, h: 0 });
131
+ const onReadyRef = useRef(onReady);
132
+ const onErrorRef = useRef(onError);
133
+ const loaderRef = useRef(createCropperImageLoader());
134
+ onReadyRef.current = onReady;
135
+ onErrorRef.current = onError;
136
+ const [status, setStatus] = useState("loading");
137
+ const [displayWidth, setDisplayWidth] = useState(0);
138
+ const [displayHeight, setDisplayHeight] = useState(0);
139
+ const [annotations, setAnnotations] = useControlledState({
140
+ value,
141
+ defaultValue,
142
+ onChange
143
+ });
144
+ const [activeSelectedId, setSelectedId] = useControlledState({
145
+ value: selectedId,
146
+ defaultValue: defaultSelectedId
147
+ });
148
+ const [activeTool, setActiveToolState] = useControlledState({
149
+ value: tool,
150
+ defaultValue: defaultTool,
151
+ onChange: onToolChange
152
+ });
153
+ const [draft, setDraft] = useState(null);
154
+ const [focusedShape, setFocusedShape] = useState(0);
155
+ const resolvedTool = resolveImageAnnotationTool(activeTool, tools);
156
+ const canEdit = !disabled && !readonly;
157
+ const canSelect = !disabled;
158
+ const imageAlt = alt ?? labels.defaultAnnotationAlt;
159
+ const focusedShapeIndex = clampImageAnnotationShapeIndex(focusedShape, annotations.length);
160
+ useEffect(() => {
161
+ const loader = loaderRef.current;
162
+ setStatus("loading");
163
+ setDraft(null);
164
+ drawingRef.current = null;
165
+ loader.load(src, {
166
+ onLoad: (_image, naturalWidth, naturalHeight) => {
167
+ naturalRef.current = { w: naturalWidth, h: naturalHeight };
168
+ const size = getAnnotationDisplaySize(
169
+ naturalWidth,
170
+ naturalHeight,
171
+ sizeHostRef.current?.clientWidth ?? 0
172
+ );
173
+ if (!size) {
174
+ setStatus("error");
175
+ onErrorRef.current?.(new Error("Image not loaded"));
176
+ return;
177
+ }
178
+ setDisplayWidth(size.width);
179
+ setDisplayHeight(size.height);
180
+ setStatus("ready");
181
+ onReadyRef.current?.();
182
+ },
183
+ onError: () => {
184
+ setStatus("error");
185
+ onErrorRef.current?.(new Error("Image not loaded"));
186
+ }
187
+ });
188
+ return () => loader.dispose();
189
+ }, [src]);
190
+ useEffect(() => {
191
+ const host = sizeHostRef.current;
192
+ if (!host || typeof ResizeObserver === "undefined") return;
193
+ const observer = new ResizeObserver(() => {
194
+ const { w, h } = naturalRef.current;
195
+ const size = getAnnotationDisplaySize(w, h, host.clientWidth);
196
+ if (!size) return;
197
+ setDisplayWidth(size.width);
198
+ setDisplayHeight(size.height);
199
+ });
200
+ observer.observe(host);
201
+ return () => observer.disconnect();
202
+ }, [status]);
203
+ useEffect(() => () => dragSessionRef.current?.dispose(), []);
204
+ const commitAnnotations = useCallback(
205
+ (next, meta) => {
206
+ setAnnotations(next, meta);
207
+ },
208
+ [setAnnotations]
209
+ );
210
+ const selectAnnotation = useCallback(
211
+ (annotation) => {
212
+ if (!canSelect) return;
213
+ setSelectedId(annotation?.id);
214
+ onSelect?.(annotation);
215
+ },
216
+ [canSelect, onSelect, setSelectedId]
217
+ );
218
+ const setActiveTool = useCallback(
219
+ (nextTool) => {
220
+ if (nextTool === resolvedTool) {
221
+ setActiveToolState(nextTool);
222
+ return;
223
+ }
224
+ setDraft(null);
225
+ drawingRef.current = null;
226
+ setActiveToolState(nextTool);
227
+ },
228
+ [resolvedTool, setActiveToolState]
229
+ );
230
+ const getPointFromEvent = useCallback((clientX, clientY) => {
231
+ const bounds = overlayRef.current?.getBoundingClientRect();
232
+ if (!bounds) return { x: 0, y: 0 };
233
+ return getImageAnnotationPointFromClient(clientX, clientY, bounds);
234
+ }, []);
235
+ const commitAnnotation = useCallback(
236
+ (annotation) => {
237
+ const next = [...annotations, annotation];
238
+ commitAnnotations(next, { type: "add", annotation });
239
+ selectAnnotation(annotation);
240
+ },
241
+ [annotations, commitAnnotations, selectAnnotation]
242
+ );
243
+ const nextId = useCallback(
244
+ (shape) => createImageAnnotationId(
245
+ shape,
246
+ annotations.map((item) => item.id)
247
+ ),
248
+ [annotations]
249
+ );
250
+ const commitPolygon = useCallback(() => {
251
+ const drawing = drawingRef.current;
252
+ if (!drawing) return;
253
+ const annotation = commitImageAnnotationPolygon(drawing, nextId("polygon"));
254
+ if (!annotation) return;
255
+ drawingRef.current = null;
256
+ setDraft(null);
257
+ swallowClickRef.current = true;
258
+ commitAnnotation(annotation);
259
+ }, [commitAnnotation, nextId]);
260
+ const handleStagePointerDown = useCallback(
261
+ (event) => {
262
+ if (event.button !== 0) return;
263
+ if (!canEdit || !isImageAnnotationShapeTool(resolvedTool) || resolvedTool === "polygon") {
264
+ return;
265
+ }
266
+ event.preventDefault();
267
+ const point = getPointFromEvent(event.clientX, event.clientY);
268
+ drawingRef.current = startImageAnnotationDraw(resolvedTool, point);
269
+ dragSessionRef.current?.dispose();
270
+ const session = createDocumentDragSession({
271
+ startX: event.clientX,
272
+ startY: event.clientY,
273
+ pointerId: event.pointerId,
274
+ pointerTarget: event.currentTarget,
275
+ dragThreshold: 0,
276
+ onMove: (payload) => {
277
+ const drawing = drawingRef.current;
278
+ if (!drawing) return;
279
+ const next = moveImageAnnotationDraw(
280
+ drawing,
281
+ getPointFromEvent(payload.currentX, payload.currentY)
282
+ );
283
+ drawingRef.current = next;
284
+ setDraft(draftImageAnnotationFromDraw(next));
285
+ },
286
+ onEnd: (payload) => {
287
+ const drawing = drawingRef.current;
288
+ drawingRef.current = null;
289
+ dragSessionRef.current = null;
290
+ if (!drawing || payload.cancelled) {
291
+ setDraft(null);
292
+ return;
293
+ }
294
+ const annotation = finishImageAnnotationDraw(
295
+ drawing,
296
+ getPointFromEvent(payload.currentX, payload.currentY),
297
+ nextId(drawing.tool),
298
+ minSize
299
+ );
300
+ setDraft(null);
301
+ if (annotation) {
302
+ swallowClickRef.current = true;
303
+ commitAnnotation(annotation);
304
+ }
305
+ }
306
+ });
307
+ dragSessionRef.current = session;
308
+ },
309
+ [canEdit, commitAnnotation, getPointFromEvent, minSize, nextId, resolvedTool]
310
+ );
311
+ const handleStageClick = useCallback(
312
+ (event) => {
313
+ if (swallowClickRef.current) {
314
+ swallowClickRef.current = false;
315
+ event.preventDefault();
316
+ return;
317
+ }
318
+ if (!canEdit && !canSelect) return;
319
+ if (resolvedTool === "select") {
320
+ selectAnnotation(null);
321
+ return;
322
+ }
323
+ if (!canEdit || resolvedTool !== "polygon" || event.detail > 1) return;
324
+ const point = getPointFromEvent(event.clientX, event.clientY);
325
+ const drawing = drawingRef.current;
326
+ const next = drawing ? addImageAnnotationPolygonPoint(drawing, point) : startImageAnnotationDraw("polygon", point);
327
+ drawingRef.current = next;
328
+ setDraft(draftImageAnnotationFromDraw(next));
329
+ },
330
+ [canEdit, canSelect, getPointFromEvent, resolvedTool, selectAnnotation]
331
+ );
332
+ const removeAnnotation = useCallback(
333
+ (annotation) => {
334
+ if (!canEdit) return;
335
+ const next = annotations.filter((item) => item.id !== annotation.id);
336
+ commitAnnotations(next, { type: "remove", annotation });
337
+ selectAnnotation(null);
338
+ },
339
+ [annotations, canEdit, commitAnnotations, selectAnnotation]
340
+ );
341
+ const removeSelectedAnnotation = useCallback(() => {
342
+ if (!canEdit || !activeSelectedId) return;
343
+ const removed = annotations.find((annotation) => annotation.id === activeSelectedId);
344
+ if (removed) removeAnnotation(removed);
345
+ }, [activeSelectedId, annotations, canEdit, removeAnnotation]);
346
+ const isCanvasTarget = (target) => {
347
+ if (!(target instanceof Element)) return false;
348
+ if (target.closest("button")) return false;
349
+ return Boolean(target.closest("[data-tiger-annotation-stage]"));
350
+ };
351
+ const handleKeyDown = useCallback(
352
+ (event) => {
353
+ if (event.key === "Escape") {
354
+ drawingRef.current = null;
355
+ setDraft(null);
356
+ return;
357
+ }
358
+ if (event.key === "Enter" && isCanvasTarget(event.target)) {
359
+ commitPolygon();
360
+ return;
361
+ }
362
+ if ((event.key === "Delete" || event.key === "Backspace") && isCanvasTarget(event.target)) {
363
+ event.preventDefault();
364
+ removeSelectedAnnotation();
365
+ }
366
+ },
367
+ [commitPolygon, removeSelectedAnnotation]
368
+ );
369
+ const handleToolbarKeyDown = useCallback(
370
+ (event) => {
371
+ if (event.key === "ArrowRight" || event.key === "ArrowLeft") {
372
+ event.preventDefault();
373
+ const next = event.key === "ArrowRight" ? getNextImageAnnotationTool(resolvedTool, tools) : getPreviousImageAnnotationTool(resolvedTool, tools);
374
+ setActiveTool(next);
375
+ }
376
+ },
377
+ [resolvedTool, setActiveTool, tools]
378
+ );
379
+ const renderAnnotation = useCallback(
380
+ (annotation, isDraft = false) => {
381
+ const selected = !isDraft && annotation.id === activeSelectedId;
382
+ const stroke = getImageAnnotationStrokeColor(annotation);
383
+ const index = annotations.findIndex((item) => item.id === annotation.id);
384
+ const tabIndex = isDraft || disabled ? -1 : index === focusedShapeIndex ? 0 : -1;
385
+ const onKeyDown = (event) => {
386
+ if (isDraft || disabled) return;
387
+ if (event.key === "ArrowRight" || event.key === "ArrowDown") {
388
+ event.preventDefault();
389
+ setFocusedShape((current) => (current + 1) % Math.max(annotations.length, 1));
390
+ return;
391
+ }
392
+ if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
393
+ event.preventDefault();
394
+ setFocusedShape(
395
+ (current) => (current - 1 + Math.max(annotations.length, 1)) % Math.max(annotations.length, 1)
396
+ );
397
+ return;
398
+ }
399
+ if (isActivationKey(event)) {
400
+ event.preventDefault();
401
+ event.stopPropagation();
402
+ selectAnnotation(annotation);
403
+ return;
404
+ }
405
+ if (event.key === "Delete" || event.key === "Backspace") {
406
+ event.preventDefault();
407
+ event.stopPropagation();
408
+ removeAnnotation(annotation);
409
+ }
410
+ };
411
+ const commonProps = {
412
+ stroke,
413
+ strokeWidth: selected ? strokeWidth + 1 : strokeWidth,
414
+ fill: stroke,
415
+ fillOpacity: annotation.type === "freehand" ? 0 : selected ? 0.18 : 0.1,
416
+ role: "option",
417
+ tabIndex,
418
+ "aria-label": getImageAnnotationShapeAriaLabel(annotation, labels),
419
+ "aria-selected": selected,
420
+ "aria-disabled": disabled || void 0,
421
+ className: classNames(!isDraft && !disabled && imageAnnotationShapeClasses),
422
+ onKeyDown: isDraft ? void 0 : onKeyDown,
423
+ onPointerDown: isDraft ? void 0 : (event) => {
424
+ if (disabled) return;
425
+ if (canEdit && isImageAnnotationShapeTool(resolvedTool)) return;
426
+ event.stopPropagation();
427
+ selectAnnotation(annotation);
428
+ setFocusedShape(index);
429
+ }
430
+ };
431
+ if (annotation.type === "rectangle") {
432
+ return /* @__PURE__ */ jsx(
433
+ "rect",
434
+ {
435
+ ...commonProps,
436
+ x: annotation.x * displayWidth,
437
+ y: annotation.y * displayHeight,
438
+ width: annotation.width * displayWidth,
439
+ height: annotation.height * displayHeight
440
+ },
441
+ annotation.id
442
+ );
443
+ }
444
+ if (annotation.type === "ellipse") {
445
+ return /* @__PURE__ */ jsx(
446
+ "ellipse",
447
+ {
448
+ ...commonProps,
449
+ cx: (annotation.x + annotation.width / 2) * displayWidth,
450
+ cy: (annotation.y + annotation.height / 2) * displayHeight,
451
+ rx: annotation.width * displayWidth / 2,
452
+ ry: annotation.height * displayHeight / 2
453
+ },
454
+ annotation.id
455
+ );
456
+ }
457
+ const pathAnnotation = annotation;
458
+ return /* @__PURE__ */ jsx(
459
+ "path",
460
+ {
461
+ ...commonProps,
462
+ d: getImageAnnotationPathData(pathAnnotation, displayWidth, displayHeight),
463
+ fillOpacity: pathAnnotation.type === "polygon" ? commonProps.fillOpacity : 0
464
+ },
465
+ annotation.id
466
+ );
467
+ },
468
+ [
469
+ activeSelectedId,
470
+ annotations,
471
+ canEdit,
472
+ disabled,
473
+ displayHeight,
474
+ displayWidth,
475
+ focusedShapeIndex,
476
+ labels,
477
+ removeAnnotation,
478
+ resolvedTool,
479
+ selectAnnotation,
480
+ strokeWidth
481
+ ]
482
+ );
483
+ const renderedLabels = showLabels ? annotations.filter((annotation) => annotation.label).map((annotation) => {
484
+ const center = getImageAnnotationCenter(annotation, displayWidth, displayHeight);
485
+ return /* @__PURE__ */ jsx(
486
+ "text",
487
+ {
488
+ x: center.x,
489
+ y: center.y,
490
+ textAnchor: "middle",
491
+ dominantBaseline: "middle",
492
+ className: imageAnnotationLabelClasses,
493
+ children: annotation.label
494
+ },
495
+ `${annotation.id}-label`
496
+ );
497
+ }) : null;
498
+ const containerClasses = classNames(imageAnnotationContainerClasses, className);
499
+ const stageLabel = status === "error" ? labels.loadAnnotationErrorAriaLabel : status === "ready" ? labels.annotationEditorAriaLabel : labels.loadingAnnotationImageAriaLabel;
500
+ return /* @__PURE__ */ jsxs("div", { ...rest, className: containerClasses, style, onKeyDown: handleKeyDown, children: [
501
+ /* @__PURE__ */ jsxs(
502
+ "div",
503
+ {
504
+ className: imageAnnotationToolbarClasses,
505
+ role: "toolbar",
506
+ "aria-label": labels.annotationToolbarAriaLabel,
507
+ onKeyDown: handleToolbarKeyDown,
508
+ children: [
509
+ tools.map((item) => /* @__PURE__ */ jsx(
510
+ "button",
511
+ {
512
+ type: "button",
513
+ className: getImageAnnotationToolButtonClasses(resolvedTool === item),
514
+ disabled: disabled || readonly,
515
+ "aria-pressed": resolvedTool === item,
516
+ onClick: () => setActiveTool(item),
517
+ children: getImageAnnotationToolTypeLabel(item, labels)
518
+ },
519
+ item
520
+ )),
521
+ /* @__PURE__ */ jsx(
522
+ "button",
523
+ {
524
+ type: "button",
525
+ className: imageAnnotationDeleteButtonClasses,
526
+ disabled: !canEdit || !activeSelectedId,
527
+ onClick: removeSelectedAnnotation,
528
+ children: labels.deleteText
529
+ }
530
+ )
531
+ ]
532
+ }
533
+ ),
534
+ /* @__PURE__ */ jsx(
535
+ "div",
536
+ {
537
+ ref: sizeHostRef,
538
+ className: imageAnnotationStageClasses,
539
+ "data-tiger-annotation-stage": "",
540
+ role: "group",
541
+ "aria-label": stageLabel,
542
+ children: status !== "ready" ? /* @__PURE__ */ jsx(
543
+ "div",
544
+ {
545
+ className: classNames(
546
+ "flex min-h-[200px] w-full items-center justify-center",
547
+ status === "error" && imageErrorClasses
548
+ ),
549
+ children: status === "error" ? renderErrorIcon() : renderLoadingSpinner()
550
+ }
551
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
552
+ /* @__PURE__ */ jsx(
553
+ "img",
554
+ {
555
+ src,
556
+ alt: imageAlt,
557
+ className: imageAnnotationImageClasses,
558
+ style: { width: `${displayWidth}px`, height: `${displayHeight}px` },
559
+ draggable: false
560
+ }
561
+ ),
562
+ /* @__PURE__ */ jsxs(
563
+ "svg",
564
+ {
565
+ ref: overlayRef,
566
+ className: classNames(
567
+ imageAnnotationOverlayClasses,
568
+ (!canEdit || resolvedTool === "select") && imageAnnotationReadonlyOverlayClasses,
569
+ disabled && "pointer-events-none"
570
+ ),
571
+ width: displayWidth,
572
+ height: displayHeight,
573
+ viewBox: `0 0 ${displayWidth} ${displayHeight}`,
574
+ tabIndex: disabled ? -1 : 0,
575
+ role: "listbox",
576
+ "aria-multiselectable": "false",
577
+ "aria-label": labels.annotationCanvasAriaLabel,
578
+ onPointerDown: handleStagePointerDown,
579
+ onClick: handleStageClick,
580
+ onDoubleClick: commitPolygon,
581
+ children: [
582
+ annotations.map((annotation) => renderAnnotation(annotation)),
583
+ draft ? renderAnnotation(draft, true) : null,
584
+ renderedLabels
585
+ ]
586
+ }
587
+ )
588
+ ] })
589
+ }
590
+ )
591
+ ] });
592
+ }
593
+ ImageAnnotation.displayName = "ImageAnnotation";
594
+
595
+ export {
596
+ ImageAnnotation
597
+ };