@mieweb/ui 0.8.0 → 0.9.0-dev.1
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.
- package/README.md +162 -739
- package/agent/mieweb-ui.instructions.md +34 -16
- package/dist/Animated-Cs-naa2g.d.cts +175 -0
- package/dist/Animated-Cs-naa2g.d.ts +175 -0
- package/dist/CsvBlock-D7Z6ZCRP.js +6 -0
- package/dist/{CsvBlock-PUSTBQ5B.js.map → CsvBlock-D7Z6ZCRP.js.map} +1 -1
- package/dist/CsvBlock-QXXZ7ZUM.cjs +15 -0
- package/dist/{CsvBlock-OTFG3PYZ.cjs.map → CsvBlock-QXXZ7ZUM.cjs.map} +1 -1
- package/dist/HtmlPreviewBlock-AADG7MVB.cjs +15 -0
- package/dist/{HtmlPreviewBlock-QHLSIMWJ.cjs.map → HtmlPreviewBlock-AADG7MVB.cjs.map} +1 -1
- package/dist/HtmlPreviewBlock-F5VDM2EN.js +6 -0
- package/dist/{HtmlPreviewBlock-YF2YVKKX.js.map → HtmlPreviewBlock-F5VDM2EN.js.map} +1 -1
- package/dist/MermaidBlock-6PLITRBZ.js +6 -0
- package/dist/{MermaidBlock-H3TWNC4D.js.map → MermaidBlock-6PLITRBZ.js.map} +1 -1
- package/dist/MermaidBlock-TQ2O5CLV.cjs +15 -0
- package/dist/{MermaidBlock-ZLLBO3VY.cjs.map → MermaidBlock-TQ2O5CLV.cjs.map} +1 -1
- package/dist/SurveyBlock-OYL3VNU5.cjs +15 -0
- package/dist/{SurveyBlock-M2ZRTGVJ.cjs.map → SurveyBlock-OYL3VNU5.cjs.map} +1 -1
- package/dist/SurveyBlock-W5PSQ62F.js +6 -0
- package/dist/{SurveyBlock-JLHS3YQD.js.map → SurveyBlock-W5PSQ62F.js.map} +1 -1
- package/dist/ag-grid.cjs +5 -5
- package/dist/ag-grid.js +1 -1
- package/dist/brands/index.cjs +7 -7
- package/dist/brands/index.js +2 -2
- package/dist/{chunk-XS35KPBZ.cjs → chunk-2A2FLQJC.cjs} +1140 -14
- package/dist/chunk-2A2FLQJC.cjs.map +1 -0
- package/dist/{chunk-OTQ72WX3.js → chunk-2BPIVWAK.js} +3 -3
- package/dist/{chunk-OTQ72WX3.js.map → chunk-2BPIVWAK.js.map} +1 -1
- package/dist/{chunk-6EWJGRC3.js → chunk-3JWAABYI.js} +6 -6
- package/dist/chunk-3JWAABYI.js.map +1 -0
- package/dist/{chunk-5JZIDILK.cjs → chunk-3LHICE4I.cjs} +6 -6
- package/dist/chunk-3LHICE4I.cjs.map +1 -0
- package/dist/{chunk-JHZW3Y62.js → chunk-3RB35GYK.js} +5 -5
- package/dist/chunk-3RB35GYK.js.map +1 -0
- package/dist/{chunk-BOW7ZGI2.cjs → chunk-4SM3I7WE.cjs} +170 -10
- package/dist/chunk-4SM3I7WE.cjs.map +1 -0
- package/dist/{chunk-QHTDWIED.js → chunk-5H7SAEQO.js} +5 -5
- package/dist/{chunk-QHTDWIED.js.map → chunk-5H7SAEQO.js.map} +1 -1
- package/dist/chunk-5VXRKOPR.cjs +735 -0
- package/dist/chunk-5VXRKOPR.cjs.map +1 -0
- package/dist/{chunk-EMMYFHOT.js → chunk-5WOB4UBD.js} +3 -3
- package/dist/{chunk-EMMYFHOT.js.map → chunk-5WOB4UBD.js.map} +1 -1
- package/dist/{chunk-4CUFXCC5.cjs → chunk-5Z6UPVGC.cjs} +6 -6
- package/dist/{chunk-4CUFXCC5.cjs.map → chunk-5Z6UPVGC.cjs.map} +1 -1
- package/dist/{chunk-YIXTGWT4.cjs → chunk-6QKMMKRY.cjs} +5 -5
- package/dist/{chunk-YIXTGWT4.cjs.map → chunk-6QKMMKRY.cjs.map} +1 -1
- package/dist/{chunk-F57VRLKP.js → chunk-6SAYPXHX.js} +4 -4
- package/dist/{chunk-F57VRLKP.js.map → chunk-6SAYPXHX.js.map} +1 -1
- package/dist/{chunk-SK7H3Z67.cjs → chunk-6XDPJWSC.cjs} +99 -83
- package/dist/chunk-6XDPJWSC.cjs.map +1 -0
- package/dist/{chunk-4AE2L6AO.cjs → chunk-7FTBPLA6.cjs} +8 -8
- package/dist/chunk-7FTBPLA6.cjs.map +1 -0
- package/dist/{chunk-KVE7PQ5P.cjs → chunk-7KN6J7XV.cjs} +20 -20
- package/dist/{chunk-KVE7PQ5P.cjs.map → chunk-7KN6J7XV.cjs.map} +1 -1
- package/dist/{chunk-K4S4FAYX.cjs → chunk-AHINB2TP.cjs} +11 -11
- package/dist/{chunk-K4S4FAYX.cjs.map → chunk-AHINB2TP.cjs.map} +1 -1
- package/dist/{chunk-MYFZYUPR.cjs → chunk-AOHJILLU.cjs} +38 -3
- package/dist/chunk-AOHJILLU.cjs.map +1 -0
- package/dist/chunk-BKSPDTX4.js +3 -0
- package/dist/{chunk-3PXOIAF6.js.map → chunk-BKSPDTX4.js.map} +1 -1
- package/dist/chunk-BN75TLUN.cjs +163 -0
- package/dist/chunk-BN75TLUN.cjs.map +1 -0
- package/dist/{chunk-WWJIW2IH.cjs → chunk-BVMABVC4.cjs} +3 -3
- package/dist/{chunk-WWJIW2IH.cjs.map → chunk-BVMABVC4.cjs.map} +1 -1
- package/dist/{chunk-H7QSGFMZ.cjs → chunk-BZAGP5W6.cjs} +17 -10
- package/dist/chunk-BZAGP5W6.cjs.map +1 -0
- package/dist/{chunk-RS5VA6QU.cjs → chunk-C3DUS2VE.cjs} +3 -3
- package/dist/{chunk-RS5VA6QU.cjs.map → chunk-C3DUS2VE.cjs.map} +1 -1
- package/dist/{chunk-NLBT5O2X.js → chunk-CK3KLRNF.js} +3 -3
- package/dist/{chunk-NLBT5O2X.js.map → chunk-CK3KLRNF.js.map} +1 -1
- package/dist/{chunk-L6D4CKLV.cjs → chunk-CXDMZT45.cjs} +135 -4
- package/dist/chunk-CXDMZT45.cjs.map +1 -0
- package/dist/{chunk-TXRQQMG5.js → chunk-CYMZ2QS5.js} +2 -2
- package/dist/{chunk-TXRQQMG5.js.map → chunk-CYMZ2QS5.js.map} +1 -1
- package/dist/{chunk-DX64KLSN.js → chunk-D25WH7MH.js} +7 -7
- package/dist/{chunk-DX64KLSN.js.map → chunk-D25WH7MH.js.map} +1 -1
- package/dist/{chunk-XBKOZRDO.js → chunk-DFYMIRMW.js} +4 -4
- package/dist/{chunk-XBKOZRDO.js.map → chunk-DFYMIRMW.js.map} +1 -1
- package/dist/{chunk-AESFOMSH.js → chunk-DGRXAIWK.js} +135 -4
- package/dist/chunk-DGRXAIWK.js.map +1 -0
- package/dist/{chunk-UZ5NGGMI.js → chunk-EG7XFZ3W.js} +4 -4
- package/dist/{chunk-UZ5NGGMI.js.map → chunk-EG7XFZ3W.js.map} +1 -1
- package/dist/{chunk-LQHI44OZ.cjs → chunk-FUFBRKOG.cjs} +59 -59
- package/dist/{chunk-LQHI44OZ.cjs.map → chunk-FUFBRKOG.cjs.map} +1 -1
- package/dist/{chunk-DG7KE4YJ.cjs → chunk-FYAKUU2A.cjs} +38 -21
- package/dist/chunk-FYAKUU2A.cjs.map +1 -0
- package/dist/{chunk-7L7OPISJ.cjs → chunk-H4AVMUOC.cjs} +12 -6
- package/dist/chunk-H4AVMUOC.cjs.map +1 -0
- package/dist/{chunk-I2ECTLON.cjs → chunk-HXSA6QC5.cjs} +3 -3
- package/dist/{chunk-I2ECTLON.cjs.map → chunk-HXSA6QC5.cjs.map} +1 -1
- package/dist/{chunk-DCBMTFLE.js → chunk-HZ4MBUC3.js} +3 -3
- package/dist/{chunk-DCBMTFLE.js.map → chunk-HZ4MBUC3.js.map} +1 -1
- package/dist/{chunk-X5ZPYYMS.js → chunk-I3DQXUSC.js} +3 -3
- package/dist/{chunk-X5ZPYYMS.js.map → chunk-I3DQXUSC.js.map} +1 -1
- package/dist/{chunk-FN6VHMLM.cjs → chunk-IB54SKWB.cjs} +8 -8
- package/dist/{chunk-FN6VHMLM.cjs.map → chunk-IB54SKWB.cjs.map} +1 -1
- package/dist/chunk-IF3X2WZP.js +705 -0
- package/dist/chunk-IF3X2WZP.js.map +1 -0
- package/dist/{chunk-JP5SGIXA.cjs → chunk-IFDC4TXM.cjs} +4 -4
- package/dist/{chunk-JP5SGIXA.cjs.map → chunk-IFDC4TXM.cjs.map} +1 -1
- package/dist/{chunk-RDGRKYQ5.cjs → chunk-IINZWUGK.cjs} +58 -6
- package/dist/chunk-IINZWUGK.cjs.map +1 -0
- package/dist/{chunk-U3JU6BI5.cjs → chunk-JEIW7BSV.cjs} +3 -3
- package/dist/{chunk-U3JU6BI5.cjs.map → chunk-JEIW7BSV.cjs.map} +1 -1
- package/dist/{chunk-RZJXCI53.js → chunk-KATEJG2F.js} +1138 -14
- package/dist/chunk-KATEJG2F.js.map +1 -0
- package/dist/{chunk-D2GID3YK.js → chunk-KREUYVMZ.js} +58 -6
- package/dist/chunk-KREUYVMZ.js.map +1 -0
- package/dist/{chunk-Y6YSJPVC.js → chunk-KRU6IGV7.js} +11 -3
- package/dist/chunk-KRU6IGV7.js.map +1 -0
- package/dist/{chunk-LZU7YBXG.js → chunk-KU3XRHWA.js} +169 -10
- package/dist/chunk-KU3XRHWA.js.map +1 -0
- package/dist/{chunk-P2VTQ5AR.cjs → chunk-L52N6BEN.cjs} +39 -23
- package/dist/chunk-L52N6BEN.cjs.map +1 -0
- package/dist/{chunk-XWYKLEKG.js → chunk-L5W7TJQ5.js} +11 -5
- package/dist/chunk-L5W7TJQ5.js.map +1 -0
- package/dist/{chunk-PAM5UUBL.cjs → chunk-L7L5S2HO.cjs} +18 -2
- package/dist/{chunk-PAM5UUBL.cjs.map → chunk-L7L5S2HO.cjs.map} +1 -1
- package/dist/{chunk-SEPYBAML.js → chunk-LAEIVOIY.js} +38 -21
- package/dist/chunk-LAEIVOIY.js.map +1 -0
- package/dist/{chunk-Z5KFXHDP.cjs → chunk-MM7QKUE3.cjs} +5 -5
- package/dist/{chunk-Z5KFXHDP.cjs.map → chunk-MM7QKUE3.cjs.map} +1 -1
- package/dist/{chunk-FJ7YPVKV.js → chunk-MUIDWFYJ.js} +3 -3
- package/dist/{chunk-FJ7YPVKV.js.map → chunk-MUIDWFYJ.js.map} +1 -1
- package/dist/{chunk-YMHOF6WA.cjs → chunk-MYAU2ZUC.cjs} +3 -3
- package/dist/{chunk-YMHOF6WA.cjs.map → chunk-MYAU2ZUC.cjs.map} +1 -1
- package/dist/{chunk-5J5PEUUA.js → chunk-NHN6A3ZO.js} +6 -6
- package/dist/{chunk-5J5PEUUA.js.map → chunk-NHN6A3ZO.js.map} +1 -1
- package/dist/{chunk-EPQPUFS6.cjs → chunk-NYJIXR4Y.cjs} +6 -6
- package/dist/chunk-NYJIXR4Y.cjs.map +1 -0
- package/dist/{chunk-RYQ3S3KO.cjs → chunk-O425FKDI.cjs} +581 -70
- package/dist/chunk-O425FKDI.cjs.map +1 -0
- package/dist/{chunk-WIYQI35R.cjs → chunk-O7XHHTTP.cjs} +8 -8
- package/dist/{chunk-WIYQI35R.cjs.map → chunk-O7XHHTTP.cjs.map} +1 -1
- package/dist/{chunk-IILJGFI5.js → chunk-OAZUDUGX.js} +8 -6
- package/dist/chunk-OAZUDUGX.js.map +1 -0
- package/dist/{chunk-JHGMZX4I.cjs → chunk-OCV33S5Q.cjs} +6 -6
- package/dist/{chunk-JHGMZX4I.cjs.map → chunk-OCV33S5Q.cjs.map} +1 -1
- package/dist/{chunk-IYXCFIMP.js → chunk-ODYQYLO2.js} +33 -17
- package/dist/chunk-ODYQYLO2.js.map +1 -0
- package/dist/{chunk-FPVRQCCL.js → chunk-OHDIJOGG.js} +4 -4
- package/dist/{chunk-FPVRQCCL.js.map → chunk-OHDIJOGG.js.map} +1 -1
- package/dist/{chunk-GQVL2JKQ.cjs → chunk-OHKO5THF.cjs} +3 -3
- package/dist/{chunk-GQVL2JKQ.cjs.map → chunk-OHKO5THF.cjs.map} +1 -1
- package/dist/{chunk-LMBXJZLG.js → chunk-ON4JULCA.js} +3 -3
- package/dist/{chunk-LMBXJZLG.js.map → chunk-ON4JULCA.js.map} +1 -1
- package/dist/{chunk-A5YOIJKL.js → chunk-ONNY7UO4.js} +15 -15
- package/dist/{chunk-A5YOIJKL.js.map → chunk-ONNY7UO4.js.map} +1 -1
- package/dist/{chunk-DWCYEPTT.js → chunk-OSPTA4UR.js} +4 -4
- package/dist/{chunk-DWCYEPTT.js.map → chunk-OSPTA4UR.js.map} +1 -1
- package/dist/{chunk-FDUA6OGN.js → chunk-PFKRHNYV.js} +8 -8
- package/dist/chunk-PFKRHNYV.js.map +1 -0
- package/dist/{chunk-XMECP2MD.js → chunk-PHK4XBO5.js} +4 -4
- package/dist/{chunk-XMECP2MD.js.map → chunk-PHK4XBO5.js.map} +1 -1
- package/dist/{chunk-ZZJ4ZVYR.cjs → chunk-PJ6CC53R.cjs} +3 -3
- package/dist/{chunk-ZZJ4ZVYR.cjs.map → chunk-PJ6CC53R.cjs.map} +1 -1
- package/dist/{chunk-N3Y43KOB.js → chunk-PYHFVYVZ.js} +12 -5
- package/dist/chunk-PYHFVYVZ.js.map +1 -0
- package/dist/{chunk-XMCIXHGH.js → chunk-Q7G56ZIO.js} +39 -23
- package/dist/chunk-Q7G56ZIO.js.map +1 -0
- package/dist/{chunk-4PIW3Y5M.js → chunk-QAKASRE6.js} +34 -26
- package/dist/chunk-QAKASRE6.js.map +1 -0
- package/dist/{chunk-QGZC43L7.js → chunk-QAQOCS2J.js} +5 -5
- package/dist/{chunk-QGZC43L7.js.map → chunk-QAQOCS2J.js.map} +1 -1
- package/dist/{chunk-YVIH26FG.cjs → chunk-QKAYRHWP.cjs} +12 -12
- package/dist/{chunk-YVIH26FG.cjs.map → chunk-QKAYRHWP.cjs.map} +1 -1
- package/dist/{chunk-FDV7EQWH.js → chunk-RPG2ZP2T.js} +575 -68
- package/dist/chunk-RPG2ZP2T.js.map +1 -0
- package/dist/{chunk-P3JEMF6E.cjs → chunk-RSCA5AZW.cjs} +4 -4
- package/dist/{chunk-P3JEMF6E.cjs.map → chunk-RSCA5AZW.cjs.map} +1 -1
- package/dist/{chunk-5Y5FSR4N.js → chunk-SCXELRRZ.js} +3 -3
- package/dist/{chunk-5Y5FSR4N.js.map → chunk-SCXELRRZ.js.map} +1 -1
- package/dist/{chunk-JWTCEWQ4.cjs → chunk-SNEQXSC5.cjs} +2 -2
- package/dist/{chunk-JWTCEWQ4.cjs.map → chunk-SNEQXSC5.cjs.map} +1 -1
- package/dist/{chunk-U5TTXN45.cjs → chunk-SRA2L3SQ.cjs} +9 -7
- package/dist/chunk-SRA2L3SQ.cjs.map +1 -0
- package/dist/{chunk-5U6GETAW.js → chunk-TQDZLRIE.js} +3 -3
- package/dist/chunk-TQDZLRIE.js.map +1 -0
- package/dist/{chunk-HK3AMH3Q.cjs → chunk-VROIMIHB.cjs} +11 -3
- package/dist/chunk-VROIMIHB.cjs.map +1 -0
- package/dist/{chunk-3SHLOF4V.cjs → chunk-VTR2KGLY.cjs} +9 -9
- package/dist/{chunk-3SHLOF4V.cjs.map → chunk-VTR2KGLY.cjs.map} +1 -1
- package/dist/{chunk-XO3WLK65.js → chunk-VVDE4CHU.js} +3 -3
- package/dist/{chunk-XO3WLK65.js.map → chunk-VVDE4CHU.js.map} +1 -1
- package/dist/{chunk-BOOJDRJO.js → chunk-WSNMQQ4P.js} +38 -3
- package/dist/chunk-WSNMQQ4P.js.map +1 -0
- package/dist/chunk-WYMO3IIK.js +136 -0
- package/dist/chunk-WYMO3IIK.js.map +1 -0
- package/dist/{chunk-SPWVKDGC.cjs → chunk-X5QRRMGB.cjs} +35 -27
- package/dist/chunk-X5QRRMGB.cjs.map +1 -0
- package/dist/{chunk-SH6B4MG5.js → chunk-XBXDUAIM.js} +4 -4
- package/dist/{chunk-SH6B4MG5.js.map → chunk-XBXDUAIM.js.map} +1 -1
- package/dist/{chunk-56QJHQ5C.cjs → chunk-XEEVDZDK.cjs} +5 -5
- package/dist/{chunk-56QJHQ5C.cjs.map → chunk-XEEVDZDK.cjs.map} +1 -1
- package/dist/{chunk-GXODR6V4.js → chunk-XOIIUO6O.js} +3 -3
- package/dist/{chunk-GXODR6V4.js.map → chunk-XOIIUO6O.js.map} +1 -1
- package/dist/{chunk-ELYGV32O.cjs → chunk-XTHMC76F.cjs} +5 -5
- package/dist/{chunk-ELYGV32O.cjs.map → chunk-XTHMC76F.cjs.map} +1 -1
- package/dist/{chunk-FF235PKY.cjs → chunk-XWZEECEX.cjs} +3 -3
- package/dist/chunk-XWZEECEX.cjs.map +1 -0
- package/dist/{chunk-TVLZZI5Q.cjs → chunk-YJP6DUFO.cjs} +9 -9
- package/dist/{chunk-TVLZZI5Q.cjs.map → chunk-YJP6DUFO.cjs.map} +1 -1
- package/dist/{chunk-EHQ77LL5.js → chunk-ZB54MTMQ.js} +3 -3
- package/dist/{chunk-EHQ77LL5.js.map → chunk-ZB54MTMQ.js.map} +1 -1
- package/dist/components/Accordion/index.cjs +2 -2
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/Alert/index.cjs +5 -5
- package/dist/components/Alert/index.d.cts +1 -1
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/AlertDialog/index.cjs +6 -5
- package/dist/components/AlertDialog/index.js +5 -4
- package/dist/components/AudioPlayer/index.cjs +6 -6
- package/dist/components/AudioPlayer/index.js +1 -1
- package/dist/components/Autocomplete/index.cjs +4 -4
- package/dist/components/Autocomplete/index.js +3 -3
- package/dist/components/Avatar/index.cjs +5 -5
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/index.d.cts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Breadcrumb/index.cjs +3 -3
- package/dist/components/Breadcrumb/index.js +1 -1
- package/dist/components/Button/index.cjs +3 -3
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Card/index.d.cts +2 -2
- package/dist/components/Card/index.d.ts +2 -2
- package/dist/components/CountryCodeDropdown/index.cjs +6 -6
- package/dist/components/CountryCodeDropdown/index.d.cts +11 -1
- package/dist/components/CountryCodeDropdown/index.d.ts +11 -1
- package/dist/components/CountryCodeDropdown/index.js +3 -3
- package/dist/components/CustomizableDashboard/index.cjs +11 -11
- package/dist/components/CustomizableDashboard/index.js +4 -4
- package/dist/components/DateInput/index.cjs +4 -4
- package/dist/components/DateInput/index.js +3 -3
- package/dist/components/Dropdown/index.cjs +13 -9
- package/dist/components/Dropdown/index.d.cts +38 -2
- package/dist/components/Dropdown/index.d.ts +38 -2
- package/dist/components/Dropdown/index.js +3 -3
- package/dist/components/FloatingWindow/index.cjs +4 -4
- package/dist/components/FloatingWindow/index.js +2 -2
- package/dist/components/GlossaryTooltip/index.cjs +4 -4
- package/dist/components/GlossaryTooltip/index.js +3 -3
- package/dist/components/KeyboardShortcutsOverlay/index.cjs +6 -5
- package/dist/components/KeyboardShortcutsOverlay/index.js +4 -3
- package/dist/components/Markdown/index.cjs +19 -19
- package/dist/components/Markdown/index.js +7 -7
- package/dist/components/MediaEditor/index.cjs +15 -14
- package/dist/components/MediaEditor/index.js +10 -9
- package/dist/components/MediaPlayer/index.cjs +6 -6
- package/dist/components/MediaPlayer/index.js +3 -3
- package/dist/components/Modal/index.cjs +11 -10
- package/dist/components/Modal/index.d.cts +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.js +3 -2
- package/dist/components/Pagination/index.cjs +4 -4
- package/dist/components/Pagination/index.d.cts +1 -1
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/PhoneInput/index.cjs +4 -4
- package/dist/components/PhoneInput/index.js +2 -2
- package/dist/components/Progress/index.d.cts +1 -1
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/QuickAction/index.cjs +6 -6
- package/dist/components/QuickAction/index.js +1 -1
- package/dist/components/RecordButton/index.d.cts +1 -1
- package/dist/components/RecordButton/index.d.ts +1 -1
- package/dist/components/RichTextEditor/index.cjs +9 -9
- package/dist/components/RichTextEditor/index.js +6 -6
- package/dist/components/SectionSpyNav/index.cjs +4 -4
- package/dist/components/SectionSpyNav/index.js +3 -3
- package/dist/components/Select/index.cjs +5 -5
- package/dist/components/Select/index.js +3 -3
- package/dist/components/Sheet/index.cjs +11 -11
- package/dist/components/Sheet/index.js +2 -2
- package/dist/components/Slider/index.cjs +5 -5
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/SourceTip/index.cjs +4 -4
- package/dist/components/SourceTip/index.js +3 -3
- package/dist/components/SuperChat/index.cjs +292 -115
- package/dist/components/SuperChat/index.cjs.map +1 -1
- package/dist/components/SuperChat/index.d.cts +29 -8
- package/dist/components/SuperChat/index.d.ts +29 -8
- package/dist/components/SuperChat/index.js +284 -107
- package/dist/components/SuperChat/index.js.map +1 -1
- package/dist/components/SuperChat/plugins/index.cjs +7 -7
- package/dist/components/SuperChat/plugins/index.cjs.map +1 -1
- package/dist/components/SuperChat/plugins/index.d.cts +2 -2
- package/dist/components/SuperChat/plugins/index.d.ts +2 -2
- package/dist/components/SuperChat/plugins/index.js +6 -6
- package/dist/components/SuperChat/plugins/index.js.map +1 -1
- package/dist/components/Text/index.d.cts +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/ThemeProvider/index.cjs +9 -9
- package/dist/components/ThemeProvider/index.d.cts +1 -1
- package/dist/components/ThemeProvider/index.d.ts +1 -1
- package/dist/components/ThemeProvider/index.js +3 -3
- package/dist/components/Toggle/index.d.cts +1 -1
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/Tooltip/index.cjs +3 -3
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/TranscriptView/index.cjs +3 -3
- package/dist/components/TranscriptView/index.js +1 -1
- package/dist/datavis.cjs +2 -2
- package/dist/datavis.js +1 -1
- package/dist/esheet.cjs +15 -14
- package/dist/esheet.cjs.map +1 -1
- package/dist/esheet.js +12 -11
- package/dist/esheet.js.map +1 -1
- package/dist/hooks/index.cjs +3 -3
- package/dist/hooks/index.d.cts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/index.cjs +2509 -2860
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +278 -43
- package/dist/index.d.ts +278 -43
- package/dist/index.js +1305 -1700
- package/dist/index.js.map +1 -1
- package/dist/motion.cjs +87 -0
- package/dist/motion.cjs.map +1 -0
- package/dist/motion.d.cts +52 -0
- package/dist/motion.d.ts +52 -0
- package/dist/motion.js +50 -0
- package/dist/motion.js.map +1 -0
- package/dist/styles/init.css +25 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/dist/{types-BoTeTPdH.d.ts → types-9vK_YdEb.d.ts} +12 -1
- package/dist/{types-DyIB9HYT.d.cts → types-DZDroUW8.d.cts} +12 -1
- package/dist/{useAnchoredPosition-C7PNglzD.d.ts → useAnchoredPosition-CKwLSQW8.d.cts} +10 -3
- package/dist/{useAnchoredPosition-C7PNglzD.d.cts → useAnchoredPosition-CKwLSQW8.d.ts} +10 -3
- package/package.json +21 -2
- package/dist/CsvBlock-OTFG3PYZ.cjs +0 -15
- package/dist/CsvBlock-PUSTBQ5B.js +0 -6
- package/dist/HtmlPreviewBlock-QHLSIMWJ.cjs +0 -15
- package/dist/HtmlPreviewBlock-YF2YVKKX.js +0 -6
- package/dist/MermaidBlock-H3TWNC4D.js +0 -6
- package/dist/MermaidBlock-ZLLBO3VY.cjs +0 -15
- package/dist/SurveyBlock-JLHS3YQD.js +0 -6
- package/dist/SurveyBlock-M2ZRTGVJ.cjs +0 -15
- package/dist/chunk-26DPQUSB.cjs +0 -1177
- package/dist/chunk-26DPQUSB.cjs.map +0 -1
- package/dist/chunk-3PXOIAF6.js +0 -3
- package/dist/chunk-4AE2L6AO.cjs.map +0 -1
- package/dist/chunk-4PIW3Y5M.js.map +0 -1
- package/dist/chunk-5JZIDILK.cjs.map +0 -1
- package/dist/chunk-5U6GETAW.js.map +0 -1
- package/dist/chunk-6EWJGRC3.js.map +0 -1
- package/dist/chunk-7L7OPISJ.cjs.map +0 -1
- package/dist/chunk-AESFOMSH.js.map +0 -1
- package/dist/chunk-BOOJDRJO.js.map +0 -1
- package/dist/chunk-BOW7ZGI2.cjs.map +0 -1
- package/dist/chunk-D2GID3YK.js.map +0 -1
- package/dist/chunk-DG7KE4YJ.cjs.map +0 -1
- package/dist/chunk-EKRT7K2K.js +0 -1145
- package/dist/chunk-EKRT7K2K.js.map +0 -1
- package/dist/chunk-EPQPUFS6.cjs.map +0 -1
- package/dist/chunk-FDUA6OGN.js.map +0 -1
- package/dist/chunk-FDV7EQWH.js.map +0 -1
- package/dist/chunk-FF235PKY.cjs.map +0 -1
- package/dist/chunk-H7QSGFMZ.cjs.map +0 -1
- package/dist/chunk-HK3AMH3Q.cjs.map +0 -1
- package/dist/chunk-IILJGFI5.js.map +0 -1
- package/dist/chunk-IYXCFIMP.js.map +0 -1
- package/dist/chunk-JHZW3Y62.js.map +0 -1
- package/dist/chunk-L6D4CKLV.cjs.map +0 -1
- package/dist/chunk-LZU7YBXG.js.map +0 -1
- package/dist/chunk-MYFZYUPR.cjs.map +0 -1
- package/dist/chunk-N3Y43KOB.js.map +0 -1
- package/dist/chunk-P2VTQ5AR.cjs.map +0 -1
- package/dist/chunk-RDGRKYQ5.cjs.map +0 -1
- package/dist/chunk-RYQ3S3KO.cjs.map +0 -1
- package/dist/chunk-RZJXCI53.js.map +0 -1
- package/dist/chunk-SEPYBAML.js.map +0 -1
- package/dist/chunk-SK7H3Z67.cjs.map +0 -1
- package/dist/chunk-SPWVKDGC.cjs.map +0 -1
- package/dist/chunk-U5TTXN45.cjs.map +0 -1
- package/dist/chunk-XMCIXHGH.js.map +0 -1
- package/dist/chunk-XS35KPBZ.cjs.map +0 -1
- package/dist/chunk-XWYKLEKG.js.map +0 -1
- package/dist/chunk-Y6YSJPVC.js.map +0 -1
|
@@ -1,9 +1,513 @@
|
|
|
1
|
-
import { DragDropZone,
|
|
1
|
+
import { useMentionAutocomplete, DragDropZone, AttachmentPreviewItem, AttachmentPicker, CameraButton, MentionMenu, getFileType, generateAttachmentId } from './chunk-IF3X2WZP.js';
|
|
2
2
|
import { cn } from './chunk-TQONQSJO.js';
|
|
3
|
-
import * as
|
|
3
|
+
import * as React6 from 'react';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
+
function isFileAccepted(file, accepted) {
|
|
8
|
+
if (!accepted || accepted.length === 0) return true;
|
|
9
|
+
const mime = file.type;
|
|
10
|
+
const name = file.name.toLowerCase();
|
|
11
|
+
return accepted.some((token) => {
|
|
12
|
+
if (token.startsWith(".")) return name.endsWith(token.toLowerCase());
|
|
13
|
+
if (token.endsWith("/*")) return mime.startsWith(token.slice(0, -1));
|
|
14
|
+
if (token.includes("/")) return mime === token;
|
|
15
|
+
return false;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function CharacterCounter({
|
|
19
|
+
current,
|
|
20
|
+
max,
|
|
21
|
+
showWarningAt = 0.9,
|
|
22
|
+
className
|
|
23
|
+
}) {
|
|
24
|
+
const percentage = current / max;
|
|
25
|
+
const isWarning = percentage >= showWarningAt && percentage < 1;
|
|
26
|
+
const isOver = current > max;
|
|
27
|
+
return /* @__PURE__ */ jsxs(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
className: cn(
|
|
31
|
+
"text-xs tabular-nums",
|
|
32
|
+
isOver ? "font-medium text-red-700 dark:text-red-400" : isWarning ? "text-amber-700 dark:text-amber-400" : "text-neutral-600 dark:text-neutral-400",
|
|
33
|
+
className
|
|
34
|
+
),
|
|
35
|
+
"aria-live": "polite",
|
|
36
|
+
"aria-label": `${current} of ${max} characters`,
|
|
37
|
+
children: [
|
|
38
|
+
current,
|
|
39
|
+
"/",
|
|
40
|
+
max
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
CharacterCounter.displayName = "CharacterCounter";
|
|
46
|
+
var sendButtonVariants = cva(
|
|
47
|
+
[
|
|
48
|
+
"inline-flex items-center justify-center",
|
|
49
|
+
"rounded-full p-3 self-start",
|
|
50
|
+
"transition-all duration-200",
|
|
51
|
+
"focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
52
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
53
|
+
],
|
|
54
|
+
{
|
|
55
|
+
variants: {
|
|
56
|
+
variant: {
|
|
57
|
+
primary: [
|
|
58
|
+
"bg-primary-800 text-white",
|
|
59
|
+
"hover:bg-primary-900",
|
|
60
|
+
"active:scale-95"
|
|
61
|
+
],
|
|
62
|
+
subtle: [
|
|
63
|
+
"bg-transparent text-primary-800",
|
|
64
|
+
"hover:bg-primary-50 dark:hover:bg-primary-900/20"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
canSend: {
|
|
68
|
+
true: "",
|
|
69
|
+
false: "opacity-50 cursor-not-allowed"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
defaultVariants: {
|
|
73
|
+
variant: "primary",
|
|
74
|
+
canSend: false
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
var SendButton = React6.forwardRef(
|
|
79
|
+
({ className, variant, canSend, isLoading, disabled, ...props }, ref) => {
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
ref,
|
|
84
|
+
type: "submit",
|
|
85
|
+
disabled: disabled || !canSend || isLoading,
|
|
86
|
+
"data-slot": "composer-send-button",
|
|
87
|
+
className: cn(sendButtonVariants({ variant, canSend }), className),
|
|
88
|
+
"aria-label": isLoading ? "Sending message" : "Send message",
|
|
89
|
+
...props,
|
|
90
|
+
children: isLoading ? /* @__PURE__ */ jsxs(
|
|
91
|
+
"svg",
|
|
92
|
+
{
|
|
93
|
+
"aria-hidden": "true",
|
|
94
|
+
className: "h-5 w-5 animate-spin",
|
|
95
|
+
fill: "none",
|
|
96
|
+
viewBox: "0 0 24 24",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
"circle",
|
|
100
|
+
{
|
|
101
|
+
className: "opacity-25",
|
|
102
|
+
cx: "12",
|
|
103
|
+
cy: "12",
|
|
104
|
+
r: "10",
|
|
105
|
+
stroke: "currentColor",
|
|
106
|
+
strokeWidth: "4"
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
"path",
|
|
111
|
+
{
|
|
112
|
+
className: "opacity-75",
|
|
113
|
+
fill: "currentColor",
|
|
114
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
) : /* @__PURE__ */ jsx(
|
|
120
|
+
"svg",
|
|
121
|
+
{
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
className: "h-5 w-5",
|
|
124
|
+
fill: "none",
|
|
125
|
+
viewBox: "0 0 24 24",
|
|
126
|
+
stroke: "currentColor",
|
|
127
|
+
children: /* @__PURE__ */ jsx(
|
|
128
|
+
"path",
|
|
129
|
+
{
|
|
130
|
+
strokeLinecap: "round",
|
|
131
|
+
strokeLinejoin: "round",
|
|
132
|
+
strokeWidth: 2,
|
|
133
|
+
d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8"
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
SendButton.displayName = "SendButton";
|
|
143
|
+
var MessageComposer = React6.forwardRef(
|
|
144
|
+
({
|
|
145
|
+
onSend,
|
|
146
|
+
onTypingStart,
|
|
147
|
+
onTypingStop,
|
|
148
|
+
value: controlledValue,
|
|
149
|
+
onValueChange,
|
|
150
|
+
placeholder = "Type a message...",
|
|
151
|
+
maxLength = 1600,
|
|
152
|
+
showCharacterCount = false,
|
|
153
|
+
disabled = false,
|
|
154
|
+
isSending = false,
|
|
155
|
+
showAttachmentPicker = true,
|
|
156
|
+
showCameraButton = false,
|
|
157
|
+
acceptedFileTypes = ["image/*", "video/*", ".pdf", ".doc", ".docx"],
|
|
158
|
+
maxFileSize = 25 * 1024 * 1024,
|
|
159
|
+
maxAttachments = 10,
|
|
160
|
+
onError,
|
|
161
|
+
autoFocus = false,
|
|
162
|
+
replyTo = null,
|
|
163
|
+
onCancelReply,
|
|
164
|
+
variant = "default",
|
|
165
|
+
inputTrailing,
|
|
166
|
+
mentionOptions,
|
|
167
|
+
className
|
|
168
|
+
}, ref) => {
|
|
169
|
+
const textareaRef = React6.useRef(null);
|
|
170
|
+
const [internalContent, setInternalContent] = React6.useState("");
|
|
171
|
+
const isControlled = controlledValue !== void 0;
|
|
172
|
+
const content = isControlled ? controlledValue : internalContent;
|
|
173
|
+
const setContent = React6.useCallback(
|
|
174
|
+
(val) => {
|
|
175
|
+
if (isControlled) {
|
|
176
|
+
const newVal = typeof val === "function" ? val(controlledValue) : val;
|
|
177
|
+
onValueChange?.(newVal);
|
|
178
|
+
} else {
|
|
179
|
+
setInternalContent(val);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
[isControlled, controlledValue, onValueChange]
|
|
183
|
+
);
|
|
184
|
+
const [attachments, setAttachments] = React6.useState(
|
|
185
|
+
[]
|
|
186
|
+
);
|
|
187
|
+
const [isTyping, setIsTyping] = React6.useState(false);
|
|
188
|
+
const typingTimeoutRef = React6.useRef(null);
|
|
189
|
+
React6.useImperativeHandle(ref, () => textareaRef.current);
|
|
190
|
+
React6.useEffect(() => {
|
|
191
|
+
const textarea = textareaRef.current;
|
|
192
|
+
if (textarea) {
|
|
193
|
+
textarea.style.height = "auto";
|
|
194
|
+
textarea.style.height = `${Math.min(textarea.scrollHeight, 150)}px`;
|
|
195
|
+
}
|
|
196
|
+
}, [content]);
|
|
197
|
+
React6.useEffect(() => {
|
|
198
|
+
if (content.length > 0 && !isTyping) {
|
|
199
|
+
setIsTyping(true);
|
|
200
|
+
onTypingStart?.();
|
|
201
|
+
}
|
|
202
|
+
if (typingTimeoutRef.current) {
|
|
203
|
+
clearTimeout(typingTimeoutRef.current);
|
|
204
|
+
}
|
|
205
|
+
typingTimeoutRef.current = setTimeout(() => {
|
|
206
|
+
if (isTyping) {
|
|
207
|
+
setIsTyping(false);
|
|
208
|
+
onTypingStop?.();
|
|
209
|
+
}
|
|
210
|
+
}, 2e3);
|
|
211
|
+
return () => {
|
|
212
|
+
if (typingTimeoutRef.current) {
|
|
213
|
+
clearTimeout(typingTimeoutRef.current);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
}, [content, isTyping, onTypingStart, onTypingStop]);
|
|
217
|
+
React6.useEffect(() => {
|
|
218
|
+
if (autoFocus) {
|
|
219
|
+
textareaRef.current?.focus();
|
|
220
|
+
}
|
|
221
|
+
}, [autoFocus]);
|
|
222
|
+
React6.useEffect(() => {
|
|
223
|
+
if (replyTo) {
|
|
224
|
+
textareaRef.current?.focus();
|
|
225
|
+
}
|
|
226
|
+
}, [replyTo]);
|
|
227
|
+
const mention = useMentionAutocomplete({
|
|
228
|
+
options: mentionOptions,
|
|
229
|
+
value: content,
|
|
230
|
+
setValue: setContent,
|
|
231
|
+
textareaRef
|
|
232
|
+
});
|
|
233
|
+
const canSend = (content.trim().length > 0 || attachments.length > 0) && content.length <= maxLength && !disabled && !isSending;
|
|
234
|
+
const handleSubmit = async (event) => {
|
|
235
|
+
event.preventDefault();
|
|
236
|
+
if (!canSend) return;
|
|
237
|
+
const message = {
|
|
238
|
+
content: content.trim(),
|
|
239
|
+
attachments: attachments.map((a) => a.file),
|
|
240
|
+
replyToId: replyTo?.id
|
|
241
|
+
};
|
|
242
|
+
setContent("");
|
|
243
|
+
setAttachments([]);
|
|
244
|
+
setIsTyping(false);
|
|
245
|
+
onTypingStop?.();
|
|
246
|
+
try {
|
|
247
|
+
await onSend(message);
|
|
248
|
+
} catch {
|
|
249
|
+
setContent(message.content);
|
|
250
|
+
onError?.("Failed to send message");
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
const handleKeyDown = (event) => {
|
|
254
|
+
if (mention.handleKeyDown(event)) return;
|
|
255
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
256
|
+
event.preventDefault();
|
|
257
|
+
if (canSend) {
|
|
258
|
+
handleSubmit(event);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
const handleFilesSelected = (files) => {
|
|
263
|
+
const remainingSlots = maxAttachments - attachments.length;
|
|
264
|
+
const filesToAdd = files.slice(0, remainingSlots);
|
|
265
|
+
if (files.length > remainingSlots) {
|
|
266
|
+
onError?.(`Maximum ${maxAttachments} attachments allowed`);
|
|
267
|
+
}
|
|
268
|
+
const newAttachments = filesToAdd.map((file) => {
|
|
269
|
+
const type = getFileType(file.type);
|
|
270
|
+
let previewUrl;
|
|
271
|
+
if (type === "image" || type === "video") {
|
|
272
|
+
previewUrl = URL.createObjectURL(file);
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
id: generateAttachmentId(),
|
|
276
|
+
file,
|
|
277
|
+
previewUrl,
|
|
278
|
+
type,
|
|
279
|
+
state: "pending"
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
setAttachments((prev) => [...prev, ...newAttachments]);
|
|
283
|
+
};
|
|
284
|
+
const handlePaste = (event) => {
|
|
285
|
+
if (!showAttachmentPicker || disabled) return;
|
|
286
|
+
const pasted = Array.from(event.clipboardData.items).filter((item) => item.kind === "file").map((item) => item.getAsFile()).filter((f) => f !== null).filter((f) => isFileAccepted(f, acceptedFileTypes));
|
|
287
|
+
if (pasted.length === 0) return;
|
|
288
|
+
event.preventDefault();
|
|
289
|
+
handleFilesSelected(pasted);
|
|
290
|
+
};
|
|
291
|
+
const handleRemoveAttachment = (attachmentId) => {
|
|
292
|
+
setAttachments((prev) => {
|
|
293
|
+
const attachment = prev.find((a) => a.id === attachmentId);
|
|
294
|
+
if (attachment?.previewUrl) {
|
|
295
|
+
URL.revokeObjectURL(attachment.previewUrl);
|
|
296
|
+
}
|
|
297
|
+
return prev.filter((a) => a.id !== attachmentId);
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
React6.useEffect(() => {
|
|
301
|
+
const currentAttachments = attachments;
|
|
302
|
+
return () => {
|
|
303
|
+
currentAttachments.forEach((a) => {
|
|
304
|
+
if (a.previewUrl) {
|
|
305
|
+
URL.revokeObjectURL(a.previewUrl);
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
}, [attachments]);
|
|
310
|
+
return /* @__PURE__ */ jsx(
|
|
311
|
+
DragDropZone,
|
|
312
|
+
{
|
|
313
|
+
onFilesDropped: handleFilesSelected,
|
|
314
|
+
acceptedTypes: acceptedFileTypes,
|
|
315
|
+
maxFileSize,
|
|
316
|
+
maxFiles: maxAttachments - attachments.length,
|
|
317
|
+
disabled: disabled || attachments.length >= maxAttachments,
|
|
318
|
+
onError,
|
|
319
|
+
className: cn("w-full", className),
|
|
320
|
+
children: /* @__PURE__ */ jsxs(
|
|
321
|
+
"form",
|
|
322
|
+
{
|
|
323
|
+
onSubmit: handleSubmit,
|
|
324
|
+
"data-slot": "message-composer",
|
|
325
|
+
className: "w-full",
|
|
326
|
+
children: [
|
|
327
|
+
replyTo && /* @__PURE__ */ jsxs(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
"data-slot": "composer-reply-preview",
|
|
331
|
+
className: cn(
|
|
332
|
+
"flex items-center gap-2 px-4 py-2",
|
|
333
|
+
"bg-neutral-50 dark:bg-neutral-800/50",
|
|
334
|
+
"border-primary-500 border-s-4"
|
|
335
|
+
),
|
|
336
|
+
children: [
|
|
337
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
338
|
+
/* @__PURE__ */ jsxs("span", { className: "text-primary-800 dark:text-primary-400 text-xs font-medium", children: [
|
|
339
|
+
"Replying to ",
|
|
340
|
+
replyTo.senderName
|
|
341
|
+
] }),
|
|
342
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-sm text-neutral-600 dark:text-neutral-300", children: replyTo.content })
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ jsx(
|
|
345
|
+
"button",
|
|
346
|
+
{
|
|
347
|
+
type: "button",
|
|
348
|
+
onClick: onCancelReply,
|
|
349
|
+
className: cn(
|
|
350
|
+
"shrink-0 rounded p-1",
|
|
351
|
+
"text-neutral-500 hover:text-neutral-700",
|
|
352
|
+
"dark:text-neutral-400 dark:hover:text-neutral-200",
|
|
353
|
+
"focus:ring-primary-500 focus:ring-2 focus:outline-none"
|
|
354
|
+
),
|
|
355
|
+
"aria-label": "Cancel reply",
|
|
356
|
+
children: /* @__PURE__ */ jsx(
|
|
357
|
+
"svg",
|
|
358
|
+
{
|
|
359
|
+
"aria-hidden": "true",
|
|
360
|
+
className: "h-4 w-4",
|
|
361
|
+
fill: "none",
|
|
362
|
+
viewBox: "0 0 24 24",
|
|
363
|
+
stroke: "currentColor",
|
|
364
|
+
children: /* @__PURE__ */ jsx(
|
|
365
|
+
"path",
|
|
366
|
+
{
|
|
367
|
+
strokeLinecap: "round",
|
|
368
|
+
strokeLinejoin: "round",
|
|
369
|
+
strokeWidth: 2,
|
|
370
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
371
|
+
}
|
|
372
|
+
)
|
|
373
|
+
}
|
|
374
|
+
)
|
|
375
|
+
}
|
|
376
|
+
)
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
),
|
|
380
|
+
attachments.length > 0 && /* @__PURE__ */ jsx(
|
|
381
|
+
"div",
|
|
382
|
+
{
|
|
383
|
+
"data-slot": "composer-attachments",
|
|
384
|
+
className: cn(
|
|
385
|
+
"flex flex-wrap gap-2 p-3",
|
|
386
|
+
"border-t border-neutral-200 dark:border-neutral-700"
|
|
387
|
+
),
|
|
388
|
+
children: attachments.map((attachment) => /* @__PURE__ */ jsx(
|
|
389
|
+
AttachmentPreviewItem,
|
|
390
|
+
{
|
|
391
|
+
attachment,
|
|
392
|
+
onRemove: () => handleRemoveAttachment(attachment.id)
|
|
393
|
+
},
|
|
394
|
+
attachment.id
|
|
395
|
+
))
|
|
396
|
+
}
|
|
397
|
+
),
|
|
398
|
+
/* @__PURE__ */ jsxs(
|
|
399
|
+
"div",
|
|
400
|
+
{
|
|
401
|
+
"data-slot": "composer-input-area",
|
|
402
|
+
className: cn(
|
|
403
|
+
"flex items-center gap-2 p-3",
|
|
404
|
+
"bg-white dark:bg-neutral-900",
|
|
405
|
+
variant === "default" && "border-t border-neutral-200 dark:border-neutral-700"
|
|
406
|
+
),
|
|
407
|
+
children: [
|
|
408
|
+
showAttachmentPicker && /* @__PURE__ */ jsx(
|
|
409
|
+
AttachmentPicker,
|
|
410
|
+
{
|
|
411
|
+
onFilesSelected: handleFilesSelected,
|
|
412
|
+
acceptedTypes: acceptedFileTypes,
|
|
413
|
+
maxFileSize,
|
|
414
|
+
maxFiles: maxAttachments - attachments.length,
|
|
415
|
+
disabled: disabled || attachments.length >= maxAttachments,
|
|
416
|
+
onError
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
showCameraButton && /* @__PURE__ */ jsx(
|
|
420
|
+
CameraButton,
|
|
421
|
+
{
|
|
422
|
+
onCapture: (file) => handleFilesSelected([file]),
|
|
423
|
+
disabled: disabled || attachments.length >= maxAttachments
|
|
424
|
+
}
|
|
425
|
+
),
|
|
426
|
+
/* @__PURE__ */ jsxs(
|
|
427
|
+
"div",
|
|
428
|
+
{
|
|
429
|
+
"data-slot": "composer-input-wrapper",
|
|
430
|
+
className: "relative flex-1",
|
|
431
|
+
ref: mention.anchorRef,
|
|
432
|
+
children: [
|
|
433
|
+
/* @__PURE__ */ jsx(MentionMenu, { mention }),
|
|
434
|
+
/* @__PURE__ */ jsx(
|
|
435
|
+
"textarea",
|
|
436
|
+
{
|
|
437
|
+
ref: textareaRef,
|
|
438
|
+
"data-slot": "composer-input",
|
|
439
|
+
value: content,
|
|
440
|
+
onChange: (e) => {
|
|
441
|
+
setContent(e.target.value);
|
|
442
|
+
mention.sync(
|
|
443
|
+
e.target.value,
|
|
444
|
+
e.target.selectionStart ?? e.target.value.length
|
|
445
|
+
);
|
|
446
|
+
},
|
|
447
|
+
onClick: (e) => {
|
|
448
|
+
const el = e.currentTarget;
|
|
449
|
+
mention.sync(el.value, el.selectionStart ?? el.value.length);
|
|
450
|
+
},
|
|
451
|
+
onKeyDown: handleKeyDown,
|
|
452
|
+
onPaste: handlePaste,
|
|
453
|
+
placeholder,
|
|
454
|
+
disabled: disabled || isSending,
|
|
455
|
+
rows: 1,
|
|
456
|
+
className: cn(
|
|
457
|
+
"w-full resize-none rounded-2xl py-2.5",
|
|
458
|
+
inputTrailing ? "ps-4 pe-10" : "px-4",
|
|
459
|
+
"bg-neutral-100 dark:bg-neutral-800",
|
|
460
|
+
"text-neutral-900 dark:text-neutral-100",
|
|
461
|
+
"placeholder:text-neutral-400 dark:placeholder:text-neutral-500",
|
|
462
|
+
"focus:ring-primary-500 focus:ring-2 focus:outline-none",
|
|
463
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
464
|
+
"transition-colors",
|
|
465
|
+
"max-h-[150px]"
|
|
466
|
+
),
|
|
467
|
+
"aria-label": "Message",
|
|
468
|
+
"aria-describedby": showCharacterCount ? "char-count" : void 0,
|
|
469
|
+
...mention.inputProps
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
inputTrailing && /* @__PURE__ */ jsx(
|
|
473
|
+
"div",
|
|
474
|
+
{
|
|
475
|
+
"data-slot": "composer-input-trailing",
|
|
476
|
+
className: "pointer-events-none absolute end-1 top-0 flex h-[44px] items-center [&>*]:pointer-events-auto",
|
|
477
|
+
children: inputTrailing
|
|
478
|
+
}
|
|
479
|
+
),
|
|
480
|
+
showCharacterCount && /* @__PURE__ */ jsx(
|
|
481
|
+
"div",
|
|
482
|
+
{
|
|
483
|
+
"data-slot": "composer-char-count",
|
|
484
|
+
id: "char-count",
|
|
485
|
+
className: "absolute end-3 bottom-1.5",
|
|
486
|
+
children: /* @__PURE__ */ jsx(CharacterCounter, { current: content.length, max: maxLength })
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
/* @__PURE__ */ jsx(
|
|
493
|
+
SendButton,
|
|
494
|
+
{
|
|
495
|
+
canSend,
|
|
496
|
+
isLoading: isSending,
|
|
497
|
+
disabled
|
|
498
|
+
}
|
|
499
|
+
)
|
|
500
|
+
]
|
|
501
|
+
}
|
|
502
|
+
)
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
)
|
|
506
|
+
}
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
MessageComposer.displayName = "MessageComposer";
|
|
7
511
|
var statusIconVariants = cva(
|
|
8
512
|
"inline-flex items-center gap-0.5 text-current",
|
|
9
513
|
{
|
|
@@ -147,7 +651,10 @@ function ReadReceiptIndicator({
|
|
|
147
651
|
return /* @__PURE__ */ jsxs(
|
|
148
652
|
"div",
|
|
149
653
|
{
|
|
150
|
-
className: cn(
|
|
654
|
+
className: cn(
|
|
655
|
+
"flex items-center -space-x-1 rtl:space-x-reverse",
|
|
656
|
+
className
|
|
657
|
+
),
|
|
151
658
|
"aria-label": `Read by ${receipts.map((r) => r.participant.name).join(", ")}`,
|
|
152
659
|
children: [
|
|
153
660
|
visibleReceipts.map((receipt) => /* @__PURE__ */ jsx(
|
|
@@ -324,7 +831,7 @@ function AttachmentPreview({
|
|
|
324
831
|
)
|
|
325
832
|
}
|
|
326
833
|
) }),
|
|
327
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 text-
|
|
834
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 text-start", children: [
|
|
328
835
|
/* @__PURE__ */ jsx("p", { className: "truncate text-sm font-medium", children: attachment.filename }),
|
|
329
836
|
/* @__PURE__ */ jsx("p", { className: "text-xs opacity-70", children: formatFileSize(attachment.size) })
|
|
330
837
|
] })
|
|
@@ -346,12 +853,12 @@ var bubbleVariants = cva(
|
|
|
346
853
|
{
|
|
347
854
|
variants: {
|
|
348
855
|
variant: {
|
|
349
|
-
outgoing: ["bg-primary-800 text-white", "rounded-
|
|
856
|
+
outgoing: ["bg-primary-800 text-white", "rounded-ee-md", "ms-auto"],
|
|
350
857
|
incoming: [
|
|
351
858
|
"bg-neutral-100 text-neutral-900",
|
|
352
859
|
"dark:bg-neutral-800 dark:text-neutral-100",
|
|
353
|
-
"rounded-
|
|
354
|
-
"
|
|
860
|
+
"rounded-es-md",
|
|
861
|
+
"me-auto"
|
|
355
862
|
],
|
|
356
863
|
system: [
|
|
357
864
|
"mx-auto max-w-none",
|
|
@@ -381,7 +888,7 @@ function defaultFormatTimestamp(timestamp) {
|
|
|
381
888
|
minute: "2-digit"
|
|
382
889
|
});
|
|
383
890
|
}
|
|
384
|
-
var MessageBubble =
|
|
891
|
+
var MessageBubble = React6.forwardRef(
|
|
385
892
|
({
|
|
386
893
|
className,
|
|
387
894
|
message,
|
|
@@ -491,7 +998,7 @@ var MessageBubble = React5.forwardRef(
|
|
|
491
998
|
attachment.id
|
|
492
999
|
)) }),
|
|
493
1000
|
hasText && /* @__PURE__ */ jsx("p", { className: "break-words whitespace-pre-wrap", children: message.isDeleted ? /* @__PURE__ */ jsx("span", { className: "italic opacity-60", children: "This message was deleted" }) : message.content }),
|
|
494
|
-
message.isEdited && !message.isDeleted && /* @__PURE__ */ jsx("span", { className: "
|
|
1001
|
+
message.isEdited && !message.isDeleted && /* @__PURE__ */ jsx("span", { className: "ms-1 text-xs opacity-60", children: "(edited)" })
|
|
495
1002
|
]
|
|
496
1003
|
}
|
|
497
1004
|
),
|
|
@@ -664,7 +1171,7 @@ function SkeletonMessage({
|
|
|
664
1171
|
"data-slot": "skeleton-bubble",
|
|
665
1172
|
className: cn(
|
|
666
1173
|
"animate-pulse rounded-2xl",
|
|
667
|
-
isOutgoing ? "bg-primary-800/30 rounded-
|
|
1174
|
+
isOutgoing ? "bg-primary-800/30 rounded-ee-md" : "rounded-es-md bg-neutral-200 dark:bg-neutral-700",
|
|
668
1175
|
"h-10 w-48"
|
|
669
1176
|
)
|
|
670
1177
|
}
|
|
@@ -688,7 +1195,7 @@ function TypingIndicator({ typingState, className }) {
|
|
|
688
1195
|
"aria-live": "polite",
|
|
689
1196
|
"aria-label": typingText,
|
|
690
1197
|
children: [
|
|
691
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 rounded-2xl rounded-
|
|
1198
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 rounded-2xl rounded-es-md bg-neutral-200 px-4 py-3 dark:bg-neutral-700", children: [
|
|
692
1199
|
/* @__PURE__ */ jsx(
|
|
693
1200
|
"span",
|
|
694
1201
|
{
|
|
@@ -856,7 +1363,7 @@ function LoadMoreButton({
|
|
|
856
1363
|
);
|
|
857
1364
|
}
|
|
858
1365
|
LoadMoreButton.displayName = "LoadMoreButton";
|
|
859
|
-
var MessageList =
|
|
1366
|
+
var MessageList = React6.forwardRef(
|
|
860
1367
|
({
|
|
861
1368
|
messages,
|
|
862
1369
|
currentUser,
|
|
@@ -875,19 +1382,19 @@ var MessageList = React5.forwardRef(
|
|
|
875
1382
|
className,
|
|
876
1383
|
autoScroll = "onNewMessage"
|
|
877
1384
|
}, ref) => {
|
|
878
|
-
const scrollContainerRef =
|
|
879
|
-
const bottomRef =
|
|
880
|
-
const [isUserScrolled, setIsUserScrolled] =
|
|
881
|
-
const prevMessageCountRef =
|
|
882
|
-
|
|
883
|
-
const handleScroll =
|
|
1385
|
+
const scrollContainerRef = React6.useRef(null);
|
|
1386
|
+
const bottomRef = React6.useRef(null);
|
|
1387
|
+
const [isUserScrolled, setIsUserScrolled] = React6.useState(false);
|
|
1388
|
+
const prevMessageCountRef = React6.useRef(messages.length);
|
|
1389
|
+
React6.useImperativeHandle(ref, () => scrollContainerRef.current);
|
|
1390
|
+
const handleScroll = React6.useCallback(() => {
|
|
884
1391
|
const container = scrollContainerRef.current;
|
|
885
1392
|
if (!container) return;
|
|
886
1393
|
const { scrollTop, scrollHeight, clientHeight } = container;
|
|
887
1394
|
const isAtBottom = scrollHeight - scrollTop - clientHeight < 100;
|
|
888
1395
|
setIsUserScrolled(!isAtBottom);
|
|
889
1396
|
}, []);
|
|
890
|
-
|
|
1397
|
+
React6.useEffect(() => {
|
|
891
1398
|
const container = scrollContainerRef.current;
|
|
892
1399
|
const bottom = bottomRef.current;
|
|
893
1400
|
if (!container || !bottom) return;
|
|
@@ -903,7 +1410,7 @@ var MessageList = React5.forwardRef(
|
|
|
903
1410
|
}
|
|
904
1411
|
}
|
|
905
1412
|
}, [messages, currentUser.id, autoScroll, isUserScrolled]);
|
|
906
|
-
|
|
1413
|
+
React6.useEffect(() => {
|
|
907
1414
|
const bottom = bottomRef.current;
|
|
908
1415
|
if (bottom && !isLoading) {
|
|
909
1416
|
bottom.scrollIntoView();
|
|
@@ -956,7 +1463,7 @@ var MessageList = React5.forwardRef(
|
|
|
956
1463
|
{
|
|
957
1464
|
"data-slot": "message-list-content",
|
|
958
1465
|
className: "flex flex-col gap-1 p-4",
|
|
959
|
-
children: messageGroups.map((group) => /* @__PURE__ */ jsxs(
|
|
1466
|
+
children: messageGroups.map((group) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
960
1467
|
groupByDate && group.label && /* @__PURE__ */ jsx(DateSeparator, { label: group.label }),
|
|
961
1468
|
group.messages.map((message, index) => {
|
|
962
1469
|
const prevMessage = group.messages[index - 1];
|
|
@@ -1000,7 +1507,7 @@ var MessageList = React5.forwardRef(
|
|
|
1000
1507
|
bottomRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
1001
1508
|
},
|
|
1002
1509
|
className: cn(
|
|
1003
|
-
"fixed
|
|
1510
|
+
"fixed end-4 bottom-24 z-10",
|
|
1004
1511
|
"rounded-full p-3 shadow-lg",
|
|
1005
1512
|
"bg-white dark:bg-neutral-800",
|
|
1006
1513
|
"border border-neutral-200 dark:border-neutral-700",
|
|
@@ -1095,7 +1602,7 @@ function formatLastSeen(date) {
|
|
|
1095
1602
|
if (diffDays < 7) return `${diffDays}d ago`;
|
|
1096
1603
|
return date.toLocaleDateString();
|
|
1097
1604
|
}
|
|
1098
|
-
var ConversationHeader =
|
|
1605
|
+
var ConversationHeader = React6.forwardRef(
|
|
1099
1606
|
({
|
|
1100
1607
|
className,
|
|
1101
1608
|
size,
|
|
@@ -1130,7 +1637,7 @@ var ConversationHeader = React5.forwardRef(
|
|
|
1130
1637
|
type: "button",
|
|
1131
1638
|
onClick: onBack,
|
|
1132
1639
|
className: cn(
|
|
1133
|
-
"-
|
|
1640
|
+
"-ms-2 rounded-full p-2",
|
|
1134
1641
|
"text-neutral-500 hover:text-neutral-700",
|
|
1135
1642
|
"dark:text-neutral-400 dark:hover:text-neutral-200",
|
|
1136
1643
|
"hover:bg-neutral-100 dark:hover:bg-neutral-800",
|
|
@@ -1186,7 +1693,7 @@ var ConversationHeader = React5.forwardRef(
|
|
|
1186
1693
|
"span",
|
|
1187
1694
|
{
|
|
1188
1695
|
className: cn(
|
|
1189
|
-
"absolute
|
|
1696
|
+
"absolute end-0 bottom-0",
|
|
1190
1697
|
"h-3 w-3 rounded-full",
|
|
1191
1698
|
"bg-green-500 ring-2 ring-white dark:ring-neutral-900"
|
|
1192
1699
|
),
|
|
@@ -1217,7 +1724,7 @@ var ConversationHeader = React5.forwardRef(
|
|
|
1217
1724
|
}
|
|
1218
1725
|
);
|
|
1219
1726
|
ConversationHeader.displayName = "ConversationHeader";
|
|
1220
|
-
var ConversationListItem =
|
|
1727
|
+
var ConversationListItem = React6.forwardRef(({ className, conversation, isSelected, onSelect, ...props }, ref) => {
|
|
1221
1728
|
const participant = conversation.participants.find((p) => !p.isCurrentUser);
|
|
1222
1729
|
const title = getConversationTitle(conversation, participant);
|
|
1223
1730
|
const avatarUrl = conversation.avatarUrl || participant?.avatarUrl;
|
|
@@ -1257,7 +1764,7 @@ var ConversationListItem = React5.forwardRef(({ className, conversation, isSelec
|
|
|
1257
1764
|
"data-slot": "conversation-list-item",
|
|
1258
1765
|
className: cn(
|
|
1259
1766
|
"flex w-full items-center gap-3 px-4 py-3",
|
|
1260
|
-
"text-
|
|
1767
|
+
"text-start transition-colors",
|
|
1261
1768
|
isSelected ? "bg-primary-50 dark:bg-primary-900/20" : "hover:bg-neutral-50 dark:hover:bg-neutral-800/50",
|
|
1262
1769
|
"focus:bg-neutral-50 focus:outline-none dark:focus:bg-neutral-800/50",
|
|
1263
1770
|
className
|
|
@@ -1292,7 +1799,7 @@ var ConversationListItem = React5.forwardRef(({ className, conversation, isSelec
|
|
|
1292
1799
|
"span",
|
|
1293
1800
|
{
|
|
1294
1801
|
className: cn(
|
|
1295
|
-
"absolute
|
|
1802
|
+
"absolute end-0 bottom-0",
|
|
1296
1803
|
"h-3 w-3 rounded-full",
|
|
1297
1804
|
"bg-green-500 ring-2 ring-white dark:ring-neutral-900"
|
|
1298
1805
|
)
|
|
@@ -1425,7 +1932,7 @@ function ConversationListSkeleton({
|
|
|
1425
1932
|
}
|
|
1426
1933
|
ConversationListSkeleton.displayName = "ConversationListSkeleton";
|
|
1427
1934
|
function LightboxModal({ attachment, onClose }) {
|
|
1428
|
-
|
|
1935
|
+
React6.useEffect(() => {
|
|
1429
1936
|
const handleKeyDown = (event) => {
|
|
1430
1937
|
if (event.key === "Escape") {
|
|
1431
1938
|
onClose();
|
|
@@ -1467,7 +1974,7 @@ function LightboxModal({ attachment, onClose }) {
|
|
|
1467
1974
|
type: "button",
|
|
1468
1975
|
onClick: onClose,
|
|
1469
1976
|
className: cn(
|
|
1470
|
-
"absolute
|
|
1977
|
+
"absolute end-4 top-4 z-10",
|
|
1471
1978
|
"rounded-full p-2",
|
|
1472
1979
|
"bg-white/10 text-white",
|
|
1473
1980
|
"hover:bg-white/20",
|
|
@@ -1522,7 +2029,7 @@ function LightboxModal({ attachment, onClose }) {
|
|
|
1522
2029
|
);
|
|
1523
2030
|
}
|
|
1524
2031
|
LightboxModal.displayName = "LightboxModal";
|
|
1525
|
-
var MessageThread =
|
|
2032
|
+
var MessageThread = React6.forwardRef(
|
|
1526
2033
|
({
|
|
1527
2034
|
conversation,
|
|
1528
2035
|
messages,
|
|
@@ -1553,8 +2060,8 @@ var MessageThread = React5.forwardRef(
|
|
|
1553
2060
|
onError,
|
|
1554
2061
|
className
|
|
1555
2062
|
}, ref) => {
|
|
1556
|
-
const [lightboxAttachment, setLightboxAttachment] =
|
|
1557
|
-
const [replyTo, setReplyTo] =
|
|
2063
|
+
const [lightboxAttachment, setLightboxAttachment] = React6.useState(null);
|
|
2064
|
+
const [replyTo, setReplyTo] = React6.useState(null);
|
|
1558
2065
|
const participant = conversation?.type === "direct" ? conversation.participants.find((p) => p.id !== currentUser.id) : void 0;
|
|
1559
2066
|
const handleAttachmentClick = (attachment, message) => {
|
|
1560
2067
|
if (attachment.type === "image" || attachment.type === "video") {
|
|
@@ -1693,7 +2200,7 @@ function MessagingSplitView({
|
|
|
1693
2200
|
"data-slot": "messaging-list-pane",
|
|
1694
2201
|
className: cn(
|
|
1695
2202
|
"h-full w-full flex-shrink-0",
|
|
1696
|
-
"border-
|
|
2203
|
+
"border-e border-neutral-200 dark:border-neutral-700",
|
|
1697
2204
|
hideMobileClasses[mobileBreakpoint]
|
|
1698
2205
|
),
|
|
1699
2206
|
style: {
|
|
@@ -1726,13 +2233,13 @@ function useMessages(options) {
|
|
|
1726
2233
|
onRetry,
|
|
1727
2234
|
onLoadMore
|
|
1728
2235
|
} = options;
|
|
1729
|
-
const [messages, setMessages] =
|
|
1730
|
-
const [isSending, setIsSending] =
|
|
1731
|
-
const [isLoadingMore, setIsLoadingMore] =
|
|
1732
|
-
|
|
2236
|
+
const [messages, setMessages] = React6.useState(initialMessages);
|
|
2237
|
+
const [isSending, setIsSending] = React6.useState(false);
|
|
2238
|
+
const [isLoadingMore, setIsLoadingMore] = React6.useState(false);
|
|
2239
|
+
React6.useEffect(() => {
|
|
1733
2240
|
setMessages(initialMessages);
|
|
1734
2241
|
}, [initialMessages]);
|
|
1735
|
-
const addMessage =
|
|
2242
|
+
const addMessage = React6.useCallback((message) => {
|
|
1736
2243
|
setMessages((prev) => {
|
|
1737
2244
|
if (prev.some((m) => m.id === message.id)) {
|
|
1738
2245
|
return prev;
|
|
@@ -1740,7 +2247,7 @@ function useMessages(options) {
|
|
|
1740
2247
|
return [...prev, message];
|
|
1741
2248
|
});
|
|
1742
2249
|
}, []);
|
|
1743
|
-
const updateMessage =
|
|
2250
|
+
const updateMessage = React6.useCallback(
|
|
1744
2251
|
(messageId, updates) => {
|
|
1745
2252
|
setMessages(
|
|
1746
2253
|
(prev) => prev.map((m) => m.id === messageId ? { ...m, ...updates } : m)
|
|
@@ -1748,22 +2255,22 @@ function useMessages(options) {
|
|
|
1748
2255
|
},
|
|
1749
2256
|
[]
|
|
1750
2257
|
);
|
|
1751
|
-
const removeMessage =
|
|
2258
|
+
const removeMessage = React6.useCallback((messageId) => {
|
|
1752
2259
|
setMessages((prev) => prev.filter((m) => m.id !== messageId));
|
|
1753
2260
|
}, []);
|
|
1754
|
-
const updateStatus =
|
|
2261
|
+
const updateStatus = React6.useCallback(
|
|
1755
2262
|
(messageId, status) => {
|
|
1756
2263
|
updateMessage(messageId, { status });
|
|
1757
2264
|
},
|
|
1758
2265
|
[updateMessage]
|
|
1759
2266
|
);
|
|
1760
|
-
const markAsRead =
|
|
2267
|
+
const markAsRead = React6.useCallback(
|
|
1761
2268
|
(messageId) => {
|
|
1762
2269
|
updateStatus(messageId, "read");
|
|
1763
2270
|
},
|
|
1764
2271
|
[updateStatus]
|
|
1765
2272
|
);
|
|
1766
|
-
const sendMessage =
|
|
2273
|
+
const sendMessage = React6.useCallback(
|
|
1767
2274
|
async (newMessage) => {
|
|
1768
2275
|
const optimisticId = `optimistic-${Date.now()}`;
|
|
1769
2276
|
const optimisticMessage = {
|
|
@@ -1795,7 +2302,7 @@ function useMessages(options) {
|
|
|
1795
2302
|
},
|
|
1796
2303
|
[currentUser, onSend, addMessage, updateStatus]
|
|
1797
2304
|
);
|
|
1798
|
-
const retryMessage =
|
|
2305
|
+
const retryMessage = React6.useCallback(
|
|
1799
2306
|
async (messageId) => {
|
|
1800
2307
|
updateStatus(messageId, "sending");
|
|
1801
2308
|
try {
|
|
@@ -1809,7 +2316,7 @@ function useMessages(options) {
|
|
|
1809
2316
|
},
|
|
1810
2317
|
[onRetry, updateStatus]
|
|
1811
2318
|
);
|
|
1812
|
-
const loadMore =
|
|
2319
|
+
const loadMore = React6.useCallback(async () => {
|
|
1813
2320
|
if (isLoadingMore || !onLoadMore) return;
|
|
1814
2321
|
setIsLoadingMore(true);
|
|
1815
2322
|
try {
|
|
@@ -1840,13 +2347,13 @@ function useTypingIndicator(options = {}) {
|
|
|
1840
2347
|
onTypingStart,
|
|
1841
2348
|
onTypingStop
|
|
1842
2349
|
} = options;
|
|
1843
|
-
const [participants, setParticipants] =
|
|
1844
|
-
const [isLocalTyping, setIsLocalTyping] =
|
|
1845
|
-
const typingTimeoutRef =
|
|
1846
|
-
|
|
2350
|
+
const [participants, setParticipants] = React6.useState(initialParticipants);
|
|
2351
|
+
const [isLocalTyping, setIsLocalTyping] = React6.useState(false);
|
|
2352
|
+
const typingTimeoutRef = React6.useRef(null);
|
|
2353
|
+
React6.useEffect(() => {
|
|
1847
2354
|
setParticipants(initialParticipants);
|
|
1848
2355
|
}, [initialParticipants]);
|
|
1849
|
-
const startTyping =
|
|
2356
|
+
const startTyping = React6.useCallback(() => {
|
|
1850
2357
|
if (!isLocalTyping) {
|
|
1851
2358
|
setIsLocalTyping(true);
|
|
1852
2359
|
onTypingStart?.();
|
|
@@ -1859,21 +2366,21 @@ function useTypingIndicator(options = {}) {
|
|
|
1859
2366
|
onTypingStop?.();
|
|
1860
2367
|
}, debounceTime);
|
|
1861
2368
|
}, [isLocalTyping, debounceTime, onTypingStart, onTypingStop]);
|
|
1862
|
-
const stopTyping =
|
|
2369
|
+
const stopTyping = React6.useCallback(() => {
|
|
1863
2370
|
if (typingTimeoutRef.current) {
|
|
1864
2371
|
clearTimeout(typingTimeoutRef.current);
|
|
1865
2372
|
}
|
|
1866
2373
|
setIsLocalTyping(false);
|
|
1867
2374
|
onTypingStop?.();
|
|
1868
2375
|
}, [onTypingStop]);
|
|
1869
|
-
|
|
2376
|
+
React6.useEffect(() => {
|
|
1870
2377
|
return () => {
|
|
1871
2378
|
if (typingTimeoutRef.current) {
|
|
1872
2379
|
clearTimeout(typingTimeoutRef.current);
|
|
1873
2380
|
}
|
|
1874
2381
|
};
|
|
1875
2382
|
}, []);
|
|
1876
|
-
const typingState =
|
|
2383
|
+
const typingState = React6.useMemo(
|
|
1877
2384
|
() => ({
|
|
1878
2385
|
participants,
|
|
1879
2386
|
lastUpdated: /* @__PURE__ */ new Date()
|
|
@@ -1889,11 +2396,11 @@ function useTypingIndicator(options = {}) {
|
|
|
1889
2396
|
}
|
|
1890
2397
|
function useMessageScroll(options) {
|
|
1891
2398
|
const { messages, currentUserId, threshold = 100 } = options;
|
|
1892
|
-
const scrollContainerRef =
|
|
1893
|
-
const bottomRef =
|
|
1894
|
-
const [isScrolledUp, setIsScrolledUp] =
|
|
1895
|
-
const prevMessageCountRef =
|
|
1896
|
-
|
|
2399
|
+
const scrollContainerRef = React6.useRef(null);
|
|
2400
|
+
const bottomRef = React6.useRef(null);
|
|
2401
|
+
const [isScrolledUp, setIsScrolledUp] = React6.useState(false);
|
|
2402
|
+
const prevMessageCountRef = React6.useRef(messages.length);
|
|
2403
|
+
React6.useEffect(() => {
|
|
1897
2404
|
const container = scrollContainerRef.current;
|
|
1898
2405
|
if (!container) return;
|
|
1899
2406
|
const handleScroll = () => {
|
|
@@ -1904,12 +2411,12 @@ function useMessageScroll(options) {
|
|
|
1904
2411
|
container.addEventListener("scroll", handleScroll);
|
|
1905
2412
|
return () => container.removeEventListener("scroll", handleScroll);
|
|
1906
2413
|
}, [threshold]);
|
|
1907
|
-
const scrollToBottom =
|
|
2414
|
+
const scrollToBottom = React6.useCallback((smooth = true) => {
|
|
1908
2415
|
bottomRef.current?.scrollIntoView({
|
|
1909
2416
|
behavior: smooth ? "smooth" : "auto"
|
|
1910
2417
|
});
|
|
1911
2418
|
}, []);
|
|
1912
|
-
|
|
2419
|
+
React6.useEffect(() => {
|
|
1913
2420
|
const messageCountChanged = messages.length !== prevMessageCountRef.current;
|
|
1914
2421
|
prevMessageCountRef.current = messages.length;
|
|
1915
2422
|
if (!messageCountChanged) return;
|
|
@@ -1928,9 +2435,9 @@ function useMessageScroll(options) {
|
|
|
1928
2435
|
}
|
|
1929
2436
|
function useReadReceipts(options) {
|
|
1930
2437
|
const { currentUserId, onMarkRead, threshold = 0.5 } = options;
|
|
1931
|
-
const observerRef =
|
|
1932
|
-
const observedMessagesRef =
|
|
1933
|
-
|
|
2438
|
+
const observerRef = React6.useRef(null);
|
|
2439
|
+
const observedMessagesRef = React6.useRef(/* @__PURE__ */ new Set());
|
|
2440
|
+
React6.useEffect(() => {
|
|
1934
2441
|
observerRef.current = new IntersectionObserver(
|
|
1935
2442
|
(entries) => {
|
|
1936
2443
|
entries.forEach((entry) => {
|
|
@@ -1949,7 +2456,7 @@ function useReadReceipts(options) {
|
|
|
1949
2456
|
observerRef.current?.disconnect();
|
|
1950
2457
|
};
|
|
1951
2458
|
}, [onMarkRead, threshold]);
|
|
1952
|
-
const observeMessage =
|
|
2459
|
+
const observeMessage = React6.useCallback(
|
|
1953
2460
|
(element, message) => {
|
|
1954
2461
|
if (!element || !observerRef.current) return;
|
|
1955
2462
|
if (message.sender.id !== currentUserId && message.status !== "read" && !observedMessagesRef.current.has(message.id)) {
|
|
@@ -1962,6 +2469,6 @@ function useReadReceipts(options) {
|
|
|
1962
2469
|
return { observeMessage };
|
|
1963
2470
|
}
|
|
1964
2471
|
|
|
1965
|
-
export { AttachmentPreview, ConversationHeader, ConversationListItem, ConversationListSkeleton, DateSeparator, EmptyState, LightboxModal, LoadMoreButton, MessageBubble, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, ReadReceiptIndicator, SkeletonMessage, TypingIndicator, bubbleVariants, formatDateLabel, formatFileSize, formatLastSeen, getConversationSubtitle, getConversationTitle, groupMessagesByDate, headerVariants, isSameSenderGroup, useMessageScroll, useMessages, useReadReceipts, useTypingIndicator };
|
|
1966
|
-
//# sourceMappingURL=chunk-
|
|
1967
|
-
//# sourceMappingURL=chunk-
|
|
2472
|
+
export { AttachmentPreview, CharacterCounter, ConversationHeader, ConversationListItem, ConversationListSkeleton, DateSeparator, EmptyState, LightboxModal, LoadMoreButton, MessageBubble, MessageComposer, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, ReadReceiptIndicator, SendButton, SkeletonMessage, TypingIndicator, bubbleVariants, formatDateLabel, formatFileSize, formatLastSeen, getConversationSubtitle, getConversationTitle, groupMessagesByDate, headerVariants, isSameSenderGroup, sendButtonVariants, useMessageScroll, useMessages, useReadReceipts, useTypingIndicator };
|
|
2473
|
+
//# sourceMappingURL=chunk-RPG2ZP2T.js.map
|
|
2474
|
+
//# sourceMappingURL=chunk-RPG2ZP2T.js.map
|