@mieweb/ui 0.6.1 → 0.7.0-dev.178
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 +90 -53
- package/dist/CsvBlock-2A5VEDD3.cjs +15 -0
- package/dist/CsvBlock-2A5VEDD3.cjs.map +1 -0
- package/dist/CsvBlock-D6PWAJ5X.js +6 -0
- package/dist/CsvBlock-D6PWAJ5X.js.map +1 -0
- package/dist/HtmlPreviewBlock-PEHTJ6C3.js +6 -0
- package/dist/HtmlPreviewBlock-PEHTJ6C3.js.map +1 -0
- package/dist/HtmlPreviewBlock-SYXCV5RH.cjs +15 -0
- package/dist/HtmlPreviewBlock-SYXCV5RH.cjs.map +1 -0
- package/dist/MedicationEditor-Bp4NLy7y.d.cts +352 -0
- package/dist/MedicationEditor-Bp4NLy7y.d.ts +352 -0
- package/dist/MermaidBlock-7NK3AVK2.js +6 -0
- package/dist/MermaidBlock-7NK3AVK2.js.map +1 -0
- package/dist/MermaidBlock-AFXNP5NK.cjs +15 -0
- package/dist/MermaidBlock-AFXNP5NK.cjs.map +1 -0
- package/dist/SurveyBlock-6KRNKFH5.cjs +15 -0
- package/dist/SurveyBlock-6KRNKFH5.cjs.map +1 -0
- package/dist/SurveyBlock-NNDGXGG4.js +6 -0
- package/dist/SurveyBlock-NNDGXGG4.js.map +1 -0
- package/dist/ag-grid.cjs +6 -6
- package/dist/ag-grid.cjs.map +1 -1
- package/dist/ag-grid.js +2 -2
- package/dist/ag-grid.js.map +1 -1
- package/dist/brands/index.cjs +17 -17
- package/dist/brands/index.js +4 -4
- package/dist/chunk-372IIHUA.cjs +2017 -0
- package/dist/chunk-372IIHUA.cjs.map +1 -0
- package/dist/{chunk-2DS3RJ2D.js → chunk-3TERETXH.js} +112 -3
- package/dist/chunk-3TERETXH.js.map +1 -0
- package/dist/chunk-44CK4CT2.cjs +336 -0
- package/dist/chunk-44CK4CT2.cjs.map +1 -0
- package/dist/{chunk-FSBFQBNE.cjs → chunk-4GXECTPS.cjs} +2 -2
- package/dist/{chunk-FSBFQBNE.cjs.map → chunk-4GXECTPS.cjs.map} +1 -1
- package/dist/chunk-4LVPQ44A.js +228 -0
- package/dist/chunk-4LVPQ44A.js.map +1 -0
- package/dist/{chunk-6555OYRU.js → chunk-5BQE6BEL.js} +2 -2
- package/dist/{chunk-6555OYRU.js.map → chunk-5BQE6BEL.js.map} +1 -1
- package/dist/chunk-62ZOA6PX.js +31 -0
- package/dist/chunk-62ZOA6PX.js.map +1 -0
- package/dist/chunk-63KVQHGQ.cjs +1802 -0
- package/dist/chunk-63KVQHGQ.cjs.map +1 -0
- package/dist/chunk-6AHYYWVB.js +78 -0
- package/dist/chunk-6AHYYWVB.js.map +1 -0
- package/dist/chunk-6I7IDZ4A.js +51 -0
- package/dist/chunk-6I7IDZ4A.js.map +1 -0
- package/dist/chunk-6ZYE6JUK.cjs +80 -0
- package/dist/chunk-6ZYE6JUK.cjs.map +1 -0
- package/dist/chunk-7QXG5BBB.cjs +164 -0
- package/dist/chunk-7QXG5BBB.cjs.map +1 -0
- package/dist/chunk-7WMSUXOQ.js +182 -0
- package/dist/chunk-7WMSUXOQ.js.map +1 -0
- package/dist/chunk-7XUN3OQT.js +3 -0
- package/dist/{chunk-V2DF2GUE.js.map → chunk-7XUN3OQT.js.map} +1 -1
- package/dist/chunk-7ZVTLTJF.js +109 -0
- package/dist/chunk-7ZVTLTJF.js.map +1 -0
- package/dist/chunk-AES2BKEW.cjs +229 -0
- package/dist/chunk-AES2BKEW.cjs.map +1 -0
- package/dist/chunk-AFKKJEV5.cjs +72 -0
- package/dist/chunk-AFKKJEV5.cjs.map +1 -0
- package/dist/chunk-AT732HC6.cjs +4 -0
- package/dist/{chunk-74K3RRU7.cjs.map → chunk-AT732HC6.cjs.map} +1 -1
- package/dist/chunk-BB4WQ4LV.cjs +137 -0
- package/dist/chunk-BB4WQ4LV.cjs.map +1 -0
- package/dist/chunk-BIT27PPD.js +49 -0
- package/dist/chunk-BIT27PPD.js.map +1 -0
- package/dist/chunk-BLPCYP4D.cjs +537 -0
- package/dist/chunk-BLPCYP4D.cjs.map +1 -0
- package/dist/chunk-BT3ZQJGT.cjs +130 -0
- package/dist/chunk-BT3ZQJGT.cjs.map +1 -0
- package/dist/chunk-BX6BTDTR.js +34 -0
- package/dist/chunk-BX6BTDTR.js.map +1 -0
- package/dist/chunk-C2544GKZ.js +313 -0
- package/dist/chunk-C2544GKZ.js.map +1 -0
- package/dist/chunk-C7RVKV25.cjs +25 -0
- package/dist/chunk-C7RVKV25.cjs.map +1 -0
- package/dist/chunk-CKD554XR.cjs +100 -0
- package/dist/chunk-CKD554XR.cjs.map +1 -0
- package/dist/chunk-CVC4NWFA.cjs +154 -0
- package/dist/chunk-CVC4NWFA.cjs.map +1 -0
- package/dist/{chunk-K3IVCUPP.js → chunk-CYMZ2QS5.js} +2 -2
- package/dist/{chunk-K3IVCUPP.js.map → chunk-CYMZ2QS5.js.map} +1 -1
- package/dist/{chunk-FRT6RQND.cjs → chunk-DAPZPT5N.cjs} +92 -56
- package/dist/chunk-DAPZPT5N.cjs.map +1 -0
- package/dist/chunk-DHKYGVP7.js +3 -0
- package/dist/{chunk-LEMY57MI.js.map → chunk-DHKYGVP7.js.map} +1 -1
- package/dist/chunk-DLNJLCNO.cjs +101 -0
- package/dist/chunk-DLNJLCNO.cjs.map +1 -0
- package/dist/chunk-DUPR6FEL.js +43 -0
- package/dist/chunk-DUPR6FEL.js.map +1 -0
- package/dist/{chunk-4FALCEJI.cjs → chunk-EL2RSQTJ.cjs} +2 -2
- package/dist/{chunk-4FALCEJI.cjs.map → chunk-EL2RSQTJ.cjs.map} +1 -1
- package/dist/chunk-ERLPVXOV.js +22 -0
- package/dist/chunk-ERLPVXOV.js.map +1 -0
- package/dist/chunk-FIWKHLWY.js +197 -0
- package/dist/chunk-FIWKHLWY.js.map +1 -0
- package/dist/chunk-FJH7P5WG.js +513 -0
- package/dist/chunk-FJH7P5WG.js.map +1 -0
- package/dist/chunk-FSGEDDF2.cjs +33 -0
- package/dist/chunk-FSGEDDF2.cjs.map +1 -0
- package/dist/chunk-GLXTVCHN.cjs +4 -0
- package/dist/{chunk-4ZU53GNR.cjs.map → chunk-GLXTVCHN.cjs.map} +1 -1
- package/dist/chunk-HRS6W74P.js +1568 -0
- package/dist/chunk-HRS6W74P.js.map +1 -0
- package/dist/chunk-I2W24RHW.js +196 -0
- package/dist/chunk-I2W24RHW.js.map +1 -0
- package/dist/chunk-I6CY5C6A.js +12 -0
- package/dist/chunk-I6CY5C6A.js.map +1 -0
- package/dist/chunk-IQ4KQJAO.js +3 -0
- package/dist/chunk-IQ4KQJAO.js.map +1 -0
- package/dist/chunk-IWDQPSJN.cjs +1452 -0
- package/dist/chunk-IWDQPSJN.cjs.map +1 -0
- package/dist/chunk-J7KWQJOB.js +14 -0
- package/dist/chunk-J7KWQJOB.js.map +1 -0
- package/dist/{chunk-R25H4N4Z.js → chunk-J7Z7467B.js} +92 -56
- package/dist/chunk-J7Z7467B.js.map +1 -0
- package/dist/{chunk-NINI4WVS.cjs → chunk-JC6Y3LGF.cjs} +297 -84
- package/dist/chunk-JC6Y3LGF.cjs.map +1 -0
- package/dist/chunk-JCNPVK74.cjs +347 -0
- package/dist/chunk-JCNPVK74.cjs.map +1 -0
- package/dist/chunk-JFLC7SHM.cjs +35 -0
- package/dist/chunk-JFLC7SHM.cjs.map +1 -0
- package/dist/chunk-JHYFHEHS.js +1967 -0
- package/dist/chunk-JHYFHEHS.js.map +1 -0
- package/dist/{chunk-IBZXDX4L.cjs → chunk-JQEY53SH.cjs} +112 -3
- package/dist/chunk-JQEY53SH.cjs.map +1 -0
- package/dist/chunk-JTBQNOSL.cjs +1605 -0
- package/dist/chunk-JTBQNOSL.cjs.map +1 -0
- package/dist/chunk-JYZW2PZS.cjs +166 -0
- package/dist/chunk-JYZW2PZS.cjs.map +1 -0
- package/dist/chunk-KBEKQMVY.cjs +198 -0
- package/dist/chunk-KBEKQMVY.cjs.map +1 -0
- package/dist/chunk-KJ5BSGEO.cjs +258 -0
- package/dist/chunk-KJ5BSGEO.cjs.map +1 -0
- package/dist/{chunk-DNPRRYPQ.js → chunk-KL2S36FM.js} +2 -2
- package/dist/chunk-KL2S36FM.js.map +1 -0
- package/dist/chunk-LIH3IZYK.js +689 -0
- package/dist/chunk-LIH3IZYK.js.map +1 -0
- package/dist/chunk-MAMY5HTT.cjs +1177 -0
- package/dist/chunk-MAMY5HTT.cjs.map +1 -0
- package/dist/{chunk-WFS6R2F5.js → chunk-MKWGKASO.js} +114 -101
- package/dist/chunk-MKWGKASO.js.map +1 -0
- package/dist/{chunk-CV4CVGLO.cjs → chunk-MZPF2QGM.cjs} +95 -74
- package/dist/chunk-MZPF2QGM.cjs.map +1 -0
- package/dist/chunk-NQME7MCK.js +1416 -0
- package/dist/chunk-NQME7MCK.js.map +1 -0
- package/dist/chunk-NTYGCBCL.js +543 -0
- package/dist/chunk-NTYGCBCL.js.map +1 -0
- package/dist/chunk-OF7NTZ2I.js +3 -0
- package/dist/chunk-OF7NTZ2I.js.map +1 -0
- package/dist/chunk-OXYFTCRW.cjs +57 -0
- package/dist/chunk-OXYFTCRW.cjs.map +1 -0
- package/dist/chunk-QA6ZDHFP.js +117 -0
- package/dist/chunk-QA6ZDHFP.js.map +1 -0
- package/dist/chunk-RHNPILZQ.cjs +4 -0
- package/dist/chunk-RHNPILZQ.cjs.map +1 -0
- package/dist/chunk-RHYIFIT5.js +98 -0
- package/dist/chunk-RHYIFIT5.js.map +1 -0
- package/dist/chunk-RI56YPED.cjs +201 -0
- package/dist/chunk-RI56YPED.cjs.map +1 -0
- package/dist/chunk-RISZWWEQ.js +3 -0
- package/dist/chunk-RISZWWEQ.js.map +1 -0
- package/dist/chunk-S6Z3KDEM.js +140 -0
- package/dist/chunk-S6Z3KDEM.js.map +1 -0
- package/dist/chunk-S7JQ3FV5.cjs +16 -0
- package/dist/chunk-S7JQ3FV5.cjs.map +1 -0
- package/dist/{chunk-OXGUG57G.cjs → chunk-SNEQXSC5.cjs} +2 -2
- package/dist/{chunk-OXGUG57G.cjs.map → chunk-SNEQXSC5.cjs.map} +1 -1
- package/dist/chunk-SQHMGT4W.js +164 -0
- package/dist/chunk-SQHMGT4W.js.map +1 -0
- package/dist/{chunk-JHPFOG2N.cjs → chunk-ST2RE5UB.cjs} +30 -18
- package/dist/chunk-ST2RE5UB.cjs.map +1 -0
- package/dist/{chunk-QVJBUWJQ.js → chunk-STPK44AU.js} +46 -12
- package/dist/chunk-STPK44AU.js.map +1 -0
- package/dist/chunk-T3C4RNJ4.js +106 -0
- package/dist/chunk-T3C4RNJ4.js.map +1 -0
- package/dist/chunk-T3RWXOCM.js +148 -0
- package/dist/chunk-T3RWXOCM.js.map +1 -0
- package/dist/{chunk-DCER2QQB.js → chunk-T42BCIUA.js} +2 -2
- package/dist/{chunk-DCER2QQB.js.map → chunk-T42BCIUA.js.map} +1 -1
- package/dist/{chunk-OYKS2JBB.cjs → chunk-TN33E2VN.cjs} +2 -2
- package/dist/chunk-TN33E2VN.cjs.map +1 -0
- package/dist/{chunk-K7IGBNZA.cjs → chunk-TR2OJKQ4.cjs} +46 -12
- package/dist/chunk-TR2OJKQ4.cjs.map +1 -0
- package/dist/chunk-UFYXU7KV.js +135 -0
- package/dist/chunk-UFYXU7KV.js.map +1 -0
- package/dist/chunk-UM6NA7HL.js +1145 -0
- package/dist/chunk-UM6NA7HL.js.map +1 -0
- package/dist/chunk-UO3KEUYK.cjs +220 -0
- package/dist/chunk-UO3KEUYK.cjs.map +1 -0
- package/dist/chunk-UOOH356R.cjs +66 -0
- package/dist/chunk-UOOH356R.cjs.map +1 -0
- package/dist/{chunk-4ZU53GNR.cjs → chunk-UTYUT5YY.cjs} +62 -2
- package/dist/chunk-UTYUT5YY.cjs.map +1 -0
- package/dist/chunk-UVSODK6V.cjs +53 -0
- package/dist/chunk-UVSODK6V.cjs.map +1 -0
- package/dist/chunk-V25Z5GR6.cjs +184 -0
- package/dist/chunk-V25Z5GR6.cjs.map +1 -0
- package/dist/chunk-VBWRH4UW.cjs +4 -0
- package/dist/chunk-VBWRH4UW.cjs.map +1 -0
- package/dist/chunk-VJOVJTFP.cjs +370 -0
- package/dist/chunk-VJOVJTFP.cjs.map +1 -0
- package/dist/{chunk-7BARESXI.cjs → chunk-VPNURIAY.cjs} +114 -101
- package/dist/chunk-VPNURIAY.cjs.map +1 -0
- package/dist/{chunk-I56VBDSC.js → chunk-XDFDVF2O.js} +30 -18
- package/dist/chunk-XDFDVF2O.js.map +1 -0
- package/dist/chunk-XL7TTKHP.js +327 -0
- package/dist/chunk-XL7TTKHP.js.map +1 -0
- package/dist/chunk-Y2S6QMKU.js +78 -0
- package/dist/chunk-Y2S6QMKU.js.map +1 -0
- package/dist/chunk-Y4ESBDQ5.cjs +552 -0
- package/dist/chunk-Y4ESBDQ5.cjs.map +1 -0
- package/dist/chunk-Y5KEFV5O.js +192 -0
- package/dist/chunk-Y5KEFV5O.js.map +1 -0
- package/dist/chunk-YBLIDESO.js +365 -0
- package/dist/chunk-YBLIDESO.js.map +1 -0
- package/dist/chunk-YVLP3ATI.js +1776 -0
- package/dist/chunk-YVLP3ATI.js.map +1 -0
- package/dist/chunk-YVPC65ZJ.cjs +134 -0
- package/dist/chunk-YVPC65ZJ.cjs.map +1 -0
- package/dist/{chunk-MPOWJVV4.js → chunk-YZT62IMX.js} +95 -74
- package/dist/chunk-YZT62IMX.js.map +1 -0
- package/dist/chunk-ZAIEQWRA.js +207 -0
- package/dist/chunk-ZAIEQWRA.js.map +1 -0
- package/dist/chunk-ZDEYV373.cjs +139 -0
- package/dist/chunk-ZDEYV373.cjs.map +1 -0
- package/dist/{chunk-Q7NBJFEB.js → chunk-ZGSC2CB2.js} +2 -2
- package/dist/{chunk-Q7NBJFEB.js.map → chunk-ZGSC2CB2.js.map} +1 -1
- package/dist/{chunk-3M4P2KMG.cjs → chunk-ZHBANUBI.cjs} +2 -2
- package/dist/{chunk-3M4P2KMG.cjs.map → chunk-ZHBANUBI.cjs.map} +1 -1
- package/dist/components/AlertDialog/index.cjs +18 -0
- package/dist/components/AlertDialog/index.cjs.map +1 -0
- package/dist/components/AlertDialog/index.d.cts +56 -0
- package/dist/components/AlertDialog/index.d.ts +56 -0
- package/dist/components/AlertDialog/index.js +9 -0
- package/dist/components/AlertDialog/index.js.map +1 -0
- package/dist/components/AudioRecorder/index.d.cts +1 -1
- package/dist/components/AudioRecorder/index.d.ts +1 -1
- package/dist/components/Autocomplete/index.cjs +16 -0
- package/dist/components/Autocomplete/index.cjs.map +1 -0
- package/dist/components/Autocomplete/index.d.cts +77 -0
- package/dist/components/Autocomplete/index.d.ts +77 -0
- package/dist/components/Autocomplete/index.js +7 -0
- package/dist/components/Autocomplete/index.js.map +1 -0
- package/dist/components/Badge/index.cjs +4 -3
- package/dist/components/Badge/index.js +2 -1
- package/dist/components/Card/index.cjs +16 -15
- package/dist/components/Card/index.js +2 -1
- package/dist/components/Collapsible/index.cjs +21 -0
- package/dist/components/Collapsible/index.cjs.map +1 -0
- package/dist/components/Collapsible/index.d.cts +33 -0
- package/dist/components/Collapsible/index.d.ts +33 -0
- package/dist/components/Collapsible/index.js +4 -0
- package/dist/components/Collapsible/index.js.map +1 -0
- package/dist/components/CountryCodeDropdown/index.cjs +6 -5
- package/dist/components/CountryCodeDropdown/index.js +3 -2
- package/dist/components/DateInput/index.cjs +2 -2
- package/dist/components/DateInput/index.d.cts +8 -2
- package/dist/components/DateInput/index.d.ts +8 -2
- package/dist/components/DateInput/index.js +1 -1
- package/dist/components/Dropdown/index.cjs +9 -8
- package/dist/components/Dropdown/index.d.cts +2 -1
- package/dist/components/Dropdown/index.d.ts +2 -1
- package/dist/components/Dropdown/index.js +3 -2
- package/dist/components/FloatingWindow/index.cjs +18 -0
- package/dist/components/FloatingWindow/index.cjs.map +1 -0
- package/dist/components/FloatingWindow/index.d.cts +64 -0
- package/dist/components/FloatingWindow/index.d.ts +64 -0
- package/dist/components/FloatingWindow/index.js +5 -0
- package/dist/components/FloatingWindow/index.js.map +1 -0
- package/dist/components/Label/index.cjs +17 -0
- package/dist/components/Label/index.cjs.map +1 -0
- package/dist/components/Label/index.d.cts +23 -0
- package/dist/components/Label/index.d.ts +23 -0
- package/dist/components/Label/index.js +4 -0
- package/dist/components/Label/index.js.map +1 -0
- package/dist/components/Markdown/index.cjs +51 -0
- package/dist/components/Markdown/index.cjs.map +1 -0
- package/dist/components/Markdown/index.css +331 -0
- package/dist/components/Markdown/index.css.map +1 -0
- package/dist/components/Markdown/index.d.cts +82 -0
- package/dist/components/Markdown/index.d.ts +82 -0
- package/dist/components/Markdown/index.js +10 -0
- package/dist/components/Markdown/index.js.map +1 -0
- package/dist/components/Markdown/styles.css +354 -0
- package/dist/components/MediaEditor/index.cjs +44 -0
- package/dist/components/MediaEditor/index.cjs.map +1 -0
- package/dist/components/MediaEditor/index.d.cts +151 -0
- package/dist/components/MediaEditor/index.d.ts +151 -0
- package/dist/components/MediaEditor/index.js +19 -0
- package/dist/components/MediaEditor/index.js.map +1 -0
- package/dist/components/MediaPlayer/index.cjs +24 -0
- package/dist/components/MediaPlayer/index.cjs.map +1 -0
- package/dist/components/MediaPlayer/index.d.cts +71 -0
- package/dist/components/MediaPlayer/index.d.ts +71 -0
- package/dist/components/MediaPlayer/index.js +7 -0
- package/dist/components/MediaPlayer/index.js.map +1 -0
- package/dist/components/RecordButton/index.cjs +4 -4
- package/dist/components/RecordButton/index.js +1 -1
- package/dist/components/RichTextEditor/index.cjs +33 -0
- package/dist/components/RichTextEditor/index.cjs.map +1 -0
- package/dist/components/RichTextEditor/index.d.cts +62 -0
- package/dist/components/RichTextEditor/index.d.ts +62 -0
- package/dist/components/RichTextEditor/index.js +12 -0
- package/dist/components/RichTextEditor/index.js.map +1 -0
- package/dist/components/ScrollArea/index.cjs +17 -0
- package/dist/components/ScrollArea/index.cjs.map +1 -0
- package/dist/components/ScrollArea/index.d.cts +22 -0
- package/dist/components/ScrollArea/index.d.ts +22 -0
- package/dist/components/ScrollArea/index.js +4 -0
- package/dist/components/ScrollArea/index.js.map +1 -0
- package/dist/components/Select/index.cjs +5 -3
- package/dist/components/Select/index.js +3 -1
- package/dist/components/Separator/index.cjs +17 -0
- package/dist/components/Separator/index.cjs.map +1 -0
- package/dist/components/Separator/index.d.cts +27 -0
- package/dist/components/Separator/index.d.ts +27 -0
- package/dist/components/Separator/index.js +4 -0
- package/dist/components/Separator/index.js.map +1 -0
- package/dist/components/Sheet/index.cjs +48 -0
- package/dist/components/Sheet/index.cjs.map +1 -0
- package/dist/components/Sheet/index.d.cts +62 -0
- package/dist/components/Sheet/index.d.ts +62 -0
- package/dist/components/Sheet/index.js +7 -0
- package/dist/components/Sheet/index.js.map +1 -0
- package/dist/components/SuperChat/index.cjs +1373 -0
- package/dist/components/SuperChat/index.cjs.map +1 -0
- package/dist/components/SuperChat/index.d.cts +189 -0
- package/dist/components/SuperChat/index.d.ts +189 -0
- package/dist/components/SuperChat/index.js +1336 -0
- package/dist/components/SuperChat/index.js.map +1 -0
- package/dist/components/SuperChat/plugins/index.cjs +1292 -0
- package/dist/components/SuperChat/plugins/index.cjs.map +1 -0
- package/dist/components/SuperChat/plugins/index.d.cts +233 -0
- package/dist/components/SuperChat/plugins/index.d.ts +233 -0
- package/dist/components/SuperChat/plugins/index.js +1252 -0
- package/dist/components/SuperChat/plugins/index.js.map +1 -0
- package/dist/components/Table/index.cjs +9 -9
- package/dist/components/Table/index.d.cts +4 -0
- package/dist/components/Table/index.d.ts +4 -0
- package/dist/components/Table/index.js +1 -1
- package/dist/components/ThemeProvider/index.cjs +7 -7
- package/dist/components/ThemeProvider/index.js +1 -1
- package/dist/components/Toggle/index.cjs +17 -0
- package/dist/components/Toggle/index.cjs.map +1 -0
- package/dist/components/Toggle/index.d.cts +28 -0
- package/dist/components/Toggle/index.d.ts +28 -0
- package/dist/components/Toggle/index.js +4 -0
- package/dist/components/Toggle/index.js.map +1 -0
- package/dist/components/TranscriptView/index.cjs +21 -0
- package/dist/components/TranscriptView/index.cjs.map +1 -0
- package/dist/components/TranscriptView/index.d.cts +55 -0
- package/dist/components/TranscriptView/index.d.ts +55 -0
- package/dist/components/TranscriptView/index.js +4 -0
- package/dist/components/TranscriptView/index.js.map +1 -0
- package/dist/datavis.cjs +268 -227
- package/dist/datavis.cjs.map +1 -1
- package/dist/datavis.d.cts +83 -9
- package/dist/datavis.d.ts +83 -9
- package/dist/datavis.js +235 -229
- package/dist/datavis.js.map +1 -1
- package/dist/esheet.cjs +184 -0
- package/dist/esheet.cjs.map +1 -1
- package/dist/esheet.d.cts +117 -0
- package/dist/esheet.d.ts +117 -0
- package/dist/esheet.js +163 -0
- package/dist/esheet.js.map +1 -1
- package/dist/hey-buddy-CLUVAY2X.cjs +1133 -0
- package/dist/hey-buddy-CLUVAY2X.cjs.map +1 -0
- package/dist/hey-buddy-NMSWZ4TN.js +1131 -0
- package/dist/hey-buddy-NMSWZ4TN.js.map +1 -0
- package/dist/hooks/index.cjs +76 -16
- package/dist/hooks/index.d.cts +151 -2
- package/dist/hooks/index.d.ts +151 -2
- package/dist/hooks/index.js +6 -2
- package/dist/html-MdxqSzjD.d.cts +13 -0
- package/dist/html-MdxqSzjD.d.ts +13 -0
- package/dist/index.cjs +10394 -6565
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +331 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +2020 -249
- package/dist/index.d.ts +2020 -249
- package/dist/index.js +9223 -5969
- package/dist/index.js.map +1 -1
- package/dist/kerebron.cjs +119 -0
- package/dist/kerebron.cjs.map +1 -0
- package/dist/kerebron.css +11 -0
- package/dist/kerebron.d.cts +23 -0
- package/dist/kerebron.d.ts +23 -0
- package/dist/kerebron.js +116 -0
- package/dist/kerebron.js.map +1 -0
- package/dist/nitroTableGrid-3J2GY6CK.cjs +47 -0
- package/dist/nitroTableGrid-3J2GY6CK.cjs.map +1 -0
- package/dist/nitroTableGrid-SIMT7635.js +25 -0
- package/dist/nitroTableGrid-SIMT7635.js.map +1 -0
- package/dist/orderRows-BUJYgSc7.d.cts +221 -0
- package/dist/orderRows-BUJYgSc7.d.ts +221 -0
- package/dist/speaker-verify-5GTWAN5Y.cjs +357 -0
- package/dist/speaker-verify-5GTWAN5Y.cjs.map +1 -0
- package/dist/speaker-verify-R67P433H.js +355 -0
- package/dist/speaker-verify-R67P433H.js.map +1 -0
- package/dist/styles/init.css +5 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/dist/transcript-oaWqY3yr.d.cts +81 -0
- package/dist/transcript-oaWqY3yr.d.ts +81 -0
- package/dist/types-BYnLjEFg.d.cts +248 -0
- package/dist/types-BYnLjEFg.d.ts +248 -0
- package/dist/types-CBh8Zlje.d.cts +240 -0
- package/dist/types-CyCwYBlr.d.ts +240 -0
- package/dist/useAnchoredPosition-nXdSFKHf.d.cts +65 -0
- package/dist/useAnchoredPosition-nXdSFKHf.d.ts +65 -0
- package/dist/useTranscriptEdits-BUylQFg0.d.cts +168 -0
- package/dist/useTranscriptEdits-CWYnjbGP.d.ts +168 -0
- package/dist/utils/index.cjs +27 -18
- package/dist/utils/index.d.cts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +3 -2
- package/package.json +180 -55
- package/dist/chunk-2DS3RJ2D.js.map +0 -1
- package/dist/chunk-74K3RRU7.cjs +0 -4
- package/dist/chunk-7BARESXI.cjs.map +0 -1
- package/dist/chunk-CV4CVGLO.cjs.map +0 -1
- package/dist/chunk-DNPRRYPQ.js.map +0 -1
- package/dist/chunk-FRT6RQND.cjs.map +0 -1
- package/dist/chunk-HYEJLKXI.js +0 -476
- package/dist/chunk-HYEJLKXI.js.map +0 -1
- package/dist/chunk-I56VBDSC.js.map +0 -1
- package/dist/chunk-IBZXDX4L.cjs.map +0 -1
- package/dist/chunk-IKMR2ADM.cjs +0 -25
- package/dist/chunk-IKMR2ADM.cjs.map +0 -1
- package/dist/chunk-JHPFOG2N.cjs.map +0 -1
- package/dist/chunk-K7IGBNZA.cjs.map +0 -1
- package/dist/chunk-LEMY57MI.js +0 -3
- package/dist/chunk-MPOWJVV4.js.map +0 -1
- package/dist/chunk-NINI4WVS.cjs.map +0 -1
- package/dist/chunk-OKBR6PX4.js +0 -23
- package/dist/chunk-OKBR6PX4.js.map +0 -1
- package/dist/chunk-OYKS2JBB.cjs.map +0 -1
- package/dist/chunk-QVJBUWJQ.js.map +0 -1
- package/dist/chunk-R25H4N4Z.js.map +0 -1
- package/dist/chunk-V2DF2GUE.js +0 -3
- package/dist/chunk-WFS6R2F5.js.map +0 -1
- package/dist/ozwell.cjs +0 -385
- package/dist/ozwell.cjs.map +0 -1
- package/dist/ozwell.d.cts +0 -15
- package/dist/ozwell.d.ts +0 -15
- package/dist/ozwell.js +0 -360
- package/dist/ozwell.js.map +0 -1
|
@@ -0,0 +1,1336 @@
|
|
|
1
|
+
import { TextRenderContext } from '../../chunk-I6CY5C6A.js';
|
|
2
|
+
export { TextRenderContext, useTextRenderContext } from '../../chunk-I6CY5C6A.js';
|
|
3
|
+
import { ChatBubble, MCPToolCallDisplay, AITypingIndicator, SparklesIcon, CloseIcon } from '../../chunk-NQME7MCK.js';
|
|
4
|
+
import { MessageComposer } from '../../chunk-UM6NA7HL.js';
|
|
5
|
+
import { Dropdown, DropdownItem } from '../../chunk-YZT62IMX.js';
|
|
6
|
+
import '../../chunk-KAKH2UZA.js';
|
|
7
|
+
import { Avatar } from '../../chunk-WO5CAOAN.js';
|
|
8
|
+
import '../../chunk-IQ4KQJAO.js';
|
|
9
|
+
import '../../chunk-PVUDXJAI.js';
|
|
10
|
+
import { Badge } from '../../chunk-T42BCIUA.js';
|
|
11
|
+
import '../../chunk-T4ME7QCT.js';
|
|
12
|
+
import '../../chunk-62ZOA6PX.js';
|
|
13
|
+
import '../../chunk-QA6ZDHFP.js';
|
|
14
|
+
import { cn } from '../../chunk-F3SOEIN2.js';
|
|
15
|
+
import * as React4 from 'react';
|
|
16
|
+
import Markdown, { defaultUrlTransform } from 'react-markdown';
|
|
17
|
+
import remarkGfm from 'remark-gfm';
|
|
18
|
+
import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
|
|
19
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
20
|
+
import { cva } from 'class-variance-authority';
|
|
21
|
+
import { Pencil, Check, Clipboard } from 'lucide-react';
|
|
22
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
23
|
+
|
|
24
|
+
function remarkPreserveLineBreaks() {
|
|
25
|
+
const splitNode = (node) => {
|
|
26
|
+
if (!node.children) return;
|
|
27
|
+
const next = [];
|
|
28
|
+
for (const child of node.children) {
|
|
29
|
+
if (child.type === "text" && child.value && child.value.includes("\n")) {
|
|
30
|
+
const segments = child.value.split("\n");
|
|
31
|
+
segments.forEach((segment, i) => {
|
|
32
|
+
if (i > 0) next.push({ type: "break" });
|
|
33
|
+
if (segment) next.push({ type: "text", value: segment });
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
splitNode(child);
|
|
37
|
+
next.push(child);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
node.children = next;
|
|
41
|
+
};
|
|
42
|
+
return (tree) => splitNode(tree);
|
|
43
|
+
}
|
|
44
|
+
function baseSanitizeSchema() {
|
|
45
|
+
const schema = JSON.parse(JSON.stringify(defaultSchema));
|
|
46
|
+
const attributes = schema.attributes ?? {};
|
|
47
|
+
const allowClass = (tag) => {
|
|
48
|
+
const existing = attributes[tag] ?? [];
|
|
49
|
+
const withoutClass = existing.filter(
|
|
50
|
+
(a) => !(Array.isArray(a) && a[0] === "className")
|
|
51
|
+
);
|
|
52
|
+
attributes[tag] = [...withoutClass, "className"];
|
|
53
|
+
};
|
|
54
|
+
allowClass("code");
|
|
55
|
+
allowClass("pre");
|
|
56
|
+
allowClass("span");
|
|
57
|
+
allowClass("div");
|
|
58
|
+
schema.attributes = attributes;
|
|
59
|
+
return schema;
|
|
60
|
+
}
|
|
61
|
+
function mergeSanitizeSchema(base, extra) {
|
|
62
|
+
if (!extra) return base;
|
|
63
|
+
const out = { ...base };
|
|
64
|
+
if (Array.isArray(extra.tagNames)) {
|
|
65
|
+
const a = base.tagNames ?? [];
|
|
66
|
+
out.tagNames = Array.from(/* @__PURE__ */ new Set([...a, ...extra.tagNames]));
|
|
67
|
+
}
|
|
68
|
+
if (extra.attributes && typeof extra.attributes === "object") {
|
|
69
|
+
const baseAttrs = {
|
|
70
|
+
...base.attributes ?? {}
|
|
71
|
+
};
|
|
72
|
+
for (const [tag, attrs] of Object.entries(
|
|
73
|
+
extra.attributes
|
|
74
|
+
)) {
|
|
75
|
+
baseAttrs[tag] = [...baseAttrs[tag] ?? [], ...attrs];
|
|
76
|
+
}
|
|
77
|
+
out.attributes = baseAttrs;
|
|
78
|
+
}
|
|
79
|
+
if (extra.protocols && typeof extra.protocols === "object") {
|
|
80
|
+
const baseProtocols = {
|
|
81
|
+
...base.protocols ?? {}
|
|
82
|
+
};
|
|
83
|
+
for (const [attr, protocols] of Object.entries(
|
|
84
|
+
extra.protocols
|
|
85
|
+
)) {
|
|
86
|
+
baseProtocols[attr] = Array.from(
|
|
87
|
+
/* @__PURE__ */ new Set([...baseProtocols[attr] ?? [], ...protocols])
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
out.protocols = baseProtocols;
|
|
91
|
+
}
|
|
92
|
+
for (const [k, v] of Object.entries(extra)) {
|
|
93
|
+
if (k === "tagNames" || k === "attributes" || k === "protocols") continue;
|
|
94
|
+
out[k] = v;
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
}
|
|
98
|
+
function baseComponents() {
|
|
99
|
+
return {
|
|
100
|
+
a: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
101
|
+
"a",
|
|
102
|
+
{
|
|
103
|
+
...props,
|
|
104
|
+
className: cn(
|
|
105
|
+
"text-primary-800 hover:text-primary-900 dark:text-primary-300 underline underline-offset-2",
|
|
106
|
+
props.className
|
|
107
|
+
),
|
|
108
|
+
target: props.target ?? "_blank",
|
|
109
|
+
rel: props.rel ?? "noopener noreferrer",
|
|
110
|
+
children
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
pre: ({ node: _node, ...props }) => /* @__PURE__ */ jsx(
|
|
114
|
+
"pre",
|
|
115
|
+
{
|
|
116
|
+
...props,
|
|
117
|
+
tabIndex: 0,
|
|
118
|
+
className: cn(
|
|
119
|
+
"overflow-x-auto rounded-lg bg-neutral-900 p-3 text-sm text-neutral-100 dark:bg-neutral-950",
|
|
120
|
+
props.className
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
code: ({ node: _node, ...props }) => {
|
|
125
|
+
const isBlock = typeof props.className === "string" && props.className.includes("language-");
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
"code",
|
|
128
|
+
{
|
|
129
|
+
...props,
|
|
130
|
+
className: cn(
|
|
131
|
+
!isBlock && "rounded bg-neutral-200 px-1 py-0.5 text-[0.85em] text-neutral-800 dark:bg-neutral-700 dark:text-neutral-100",
|
|
132
|
+
props.className
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
},
|
|
137
|
+
input: ({ node: _node, ...props }) => {
|
|
138
|
+
if (props.type === "checkbox") {
|
|
139
|
+
return /* @__PURE__ */ jsx(
|
|
140
|
+
"input",
|
|
141
|
+
{
|
|
142
|
+
...props,
|
|
143
|
+
"aria-label": props["aria-label"] ?? (props["aria-labelledby"] ? void 0 : "Task list item")
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
return /* @__PURE__ */ jsx("input", { ...props });
|
|
148
|
+
},
|
|
149
|
+
table: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("div", { className: "my-2 overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
150
|
+
"table",
|
|
151
|
+
{
|
|
152
|
+
...props,
|
|
153
|
+
className: cn(
|
|
154
|
+
"w-full border-collapse text-sm [&_td]:border [&_td]:border-neutral-200 [&_td]:px-2 [&_td]:py-1 dark:[&_td]:border-neutral-700 [&_th]:border [&_th]:border-neutral-200 [&_th]:px-2 [&_th]:py-1 [&_th]:text-left dark:[&_th]:border-neutral-700",
|
|
155
|
+
props.className
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
) }),
|
|
159
|
+
// Tailwind's preflight resets list markers/padding; restore them explicitly
|
|
160
|
+
// so bullets/numbers show without depending on the typography plugin.
|
|
161
|
+
ul: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("ul", { ...props, className: cn("list-disc ps-5", props.className) }),
|
|
162
|
+
ol: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("ol", { ...props, className: cn("list-decimal ps-5", props.className) }),
|
|
163
|
+
li: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("li", { ...props, className: cn("ps-1", props.className) }),
|
|
164
|
+
// Preflight also flattens headings to body size/weight; restore a sensible
|
|
165
|
+
// hierarchy without depending on the typography plugin.
|
|
166
|
+
h1: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
167
|
+
"h1",
|
|
168
|
+
{
|
|
169
|
+
...props,
|
|
170
|
+
className: cn("mt-3 mb-1 text-xl font-semibold", props.className),
|
|
171
|
+
children
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
h2: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
175
|
+
"h2",
|
|
176
|
+
{
|
|
177
|
+
...props,
|
|
178
|
+
className: cn("mt-3 mb-1 text-lg font-semibold", props.className),
|
|
179
|
+
children
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
h3: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
183
|
+
"h3",
|
|
184
|
+
{
|
|
185
|
+
...props,
|
|
186
|
+
className: cn("mt-2 mb-1 text-base font-semibold", props.className),
|
|
187
|
+
children
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
h4: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
191
|
+
"h4",
|
|
192
|
+
{
|
|
193
|
+
...props,
|
|
194
|
+
className: cn("mt-2 mb-1 text-sm font-semibold", props.className),
|
|
195
|
+
children
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
h5: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
199
|
+
"h5",
|
|
200
|
+
{
|
|
201
|
+
...props,
|
|
202
|
+
className: cn("mt-2 mb-1 text-sm font-semibold", props.className),
|
|
203
|
+
children
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
h6: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
207
|
+
"h6",
|
|
208
|
+
{
|
|
209
|
+
...props,
|
|
210
|
+
className: cn(
|
|
211
|
+
"mt-2 mb-1 text-xs font-semibold tracking-wide uppercase",
|
|
212
|
+
props.className
|
|
213
|
+
),
|
|
214
|
+
children
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
hr: ({ node: _node, ...props }) => /* @__PURE__ */ jsx(
|
|
218
|
+
"hr",
|
|
219
|
+
{
|
|
220
|
+
...props,
|
|
221
|
+
className: cn(
|
|
222
|
+
"my-2 border-neutral-300 dark:border-neutral-600",
|
|
223
|
+
props.className
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
function createMarkdownRenderer(options = {}) {
|
|
230
|
+
const { plugins = [], trusted = false } = options;
|
|
231
|
+
const remarkPlugins = [
|
|
232
|
+
remarkGfm,
|
|
233
|
+
remarkPreserveLineBreaks,
|
|
234
|
+
...plugins.flatMap((p) => p.remarkPlugins ?? [])
|
|
235
|
+
];
|
|
236
|
+
const pluginRehype = plugins.flatMap(
|
|
237
|
+
(p) => p.rehypePlugins ?? []
|
|
238
|
+
);
|
|
239
|
+
const sanitizeSchema = plugins.reduce(
|
|
240
|
+
(acc, p) => mergeSanitizeSchema(acc, p.sanitizeSchema),
|
|
241
|
+
baseSanitizeSchema()
|
|
242
|
+
);
|
|
243
|
+
const rehypePlugins = trusted ? pluginRehype : [...pluginRehype, [rehypeSanitize, sanitizeSchema]];
|
|
244
|
+
const components = plugins.reduce(
|
|
245
|
+
(acc, p) => ({ ...acc, ...p.components }),
|
|
246
|
+
baseComponents()
|
|
247
|
+
);
|
|
248
|
+
const MarkdownRenderer = (text, ctx) => /* @__PURE__ */ jsx(
|
|
249
|
+
MarkdownContent,
|
|
250
|
+
{
|
|
251
|
+
text,
|
|
252
|
+
messageId: ctx.messageId,
|
|
253
|
+
streaming: ctx.streaming,
|
|
254
|
+
remarkPlugins,
|
|
255
|
+
rehypePlugins,
|
|
256
|
+
components
|
|
257
|
+
},
|
|
258
|
+
ctx.messageId
|
|
259
|
+
);
|
|
260
|
+
return MarkdownRenderer;
|
|
261
|
+
}
|
|
262
|
+
var transformUrl = (url, key, node) => {
|
|
263
|
+
if (key === "src" && node.tagName === "img" && (/^data:image\//i.test(url) || /^blob:/i.test(url))) {
|
|
264
|
+
return url;
|
|
265
|
+
}
|
|
266
|
+
return defaultUrlTransform(url);
|
|
267
|
+
};
|
|
268
|
+
var MarkdownContent = React4.memo(function MarkdownContent2({
|
|
269
|
+
text,
|
|
270
|
+
messageId,
|
|
271
|
+
streaming,
|
|
272
|
+
remarkPlugins,
|
|
273
|
+
rehypePlugins,
|
|
274
|
+
components
|
|
275
|
+
}) {
|
|
276
|
+
return /* @__PURE__ */ jsx(TextRenderContext.Provider, { value: { messageId, streaming }, children: /* @__PURE__ */ jsx(
|
|
277
|
+
Markdown,
|
|
278
|
+
{
|
|
279
|
+
remarkPlugins,
|
|
280
|
+
rehypePlugins,
|
|
281
|
+
urlTransform: transformUrl,
|
|
282
|
+
components,
|
|
283
|
+
children: text
|
|
284
|
+
}
|
|
285
|
+
) });
|
|
286
|
+
});
|
|
287
|
+
function formatTime(time) {
|
|
288
|
+
return new Date(time).toLocaleTimeString(void 0, {
|
|
289
|
+
hour: "numeric",
|
|
290
|
+
minute: "2-digit"
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
function byTime(a, b) {
|
|
294
|
+
return new Date(a.time).getTime() - new Date(b.time).getTime();
|
|
295
|
+
}
|
|
296
|
+
function lastActivityOf(c) {
|
|
297
|
+
if (c.lastActivity) return new Date(c.lastActivity).getTime();
|
|
298
|
+
const last = lastMessageByTime(c.thread);
|
|
299
|
+
return last ? new Date(last.time).getTime() : 0;
|
|
300
|
+
}
|
|
301
|
+
function escapeRegExp(value) {
|
|
302
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
303
|
+
}
|
|
304
|
+
function detectMentions(text, participants) {
|
|
305
|
+
const ids = [];
|
|
306
|
+
for (const p of participants) {
|
|
307
|
+
if (p.kind === "system") continue;
|
|
308
|
+
const token = "@" + p.name.split(" ")[0];
|
|
309
|
+
const pattern = new RegExp(
|
|
310
|
+
`(?<![\\w@])${escapeRegExp(token)}(?![\\w])`,
|
|
311
|
+
"i"
|
|
312
|
+
);
|
|
313
|
+
if (pattern.test(text)) ids.push(p.id);
|
|
314
|
+
}
|
|
315
|
+
return ids;
|
|
316
|
+
}
|
|
317
|
+
function lastMessageByTime(thread) {
|
|
318
|
+
let latest;
|
|
319
|
+
let latestTime = -Infinity;
|
|
320
|
+
for (const message of thread) {
|
|
321
|
+
const t = new Date(message.time).getTime();
|
|
322
|
+
if (t >= latestTime) {
|
|
323
|
+
latest = message;
|
|
324
|
+
latestTime = t;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return latest;
|
|
328
|
+
}
|
|
329
|
+
function parseHexColor(value) {
|
|
330
|
+
const hex = value.trim();
|
|
331
|
+
if (!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(hex)) return null;
|
|
332
|
+
const normalized = hex.length === 4 ? "#" + [...hex.slice(1)].map((char) => char + char).join("") : hex;
|
|
333
|
+
return [1, 3, 5].map(
|
|
334
|
+
(start) => parseInt(normalized.slice(start, start + 2), 16)
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
function relativeLuminanceChannel(channel) {
|
|
338
|
+
const normalized = channel / 255;
|
|
339
|
+
return normalized <= 0.03928 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
340
|
+
}
|
|
341
|
+
function relativeLuminance(value) {
|
|
342
|
+
const rgb = parseHexColor(value);
|
|
343
|
+
if (!rgb) return null;
|
|
344
|
+
const [red, green, blue] = rgb;
|
|
345
|
+
return 0.2126 * relativeLuminanceChannel(red) + 0.7152 * relativeLuminanceChannel(green) + 0.0722 * relativeLuminanceChannel(blue);
|
|
346
|
+
}
|
|
347
|
+
function contrastRatio(foreground, background) {
|
|
348
|
+
const foregroundLuminance = relativeLuminance(foreground);
|
|
349
|
+
const backgroundLuminance = relativeLuminance(background);
|
|
350
|
+
if (foregroundLuminance === null || backgroundLuminance === null) return null;
|
|
351
|
+
const lighter = Math.max(foregroundLuminance, backgroundLuminance);
|
|
352
|
+
const darker = Math.min(foregroundLuminance, backgroundLuminance);
|
|
353
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
354
|
+
}
|
|
355
|
+
function minimumContrastRatio(value, backgrounds) {
|
|
356
|
+
const contrasts = backgrounds.map((background) => contrastRatio(value, background)).filter((contrast) => contrast !== null);
|
|
357
|
+
if (contrasts.length !== backgrounds.length) return null;
|
|
358
|
+
return Math.min(...contrasts);
|
|
359
|
+
}
|
|
360
|
+
function accessibleAccentTextColor(value) {
|
|
361
|
+
if (!value) return void 0;
|
|
362
|
+
const contrast = minimumContrastRatio(value, ["#f5f5f5", "#262626"]);
|
|
363
|
+
if (contrast === null) return value;
|
|
364
|
+
return contrast < 4.5 ? void 0 : value;
|
|
365
|
+
}
|
|
366
|
+
function ParticipantAvatar({
|
|
367
|
+
participant
|
|
368
|
+
}) {
|
|
369
|
+
const isAgent = participant?.kind === "agent";
|
|
370
|
+
const backgroundColor = participant?.color ?? (isAgent ? "var(--mieweb-primary-700, #1f2937)" : "#64748b");
|
|
371
|
+
return /* @__PURE__ */ jsx(
|
|
372
|
+
Avatar,
|
|
373
|
+
{
|
|
374
|
+
size: "xs",
|
|
375
|
+
src: participant?.avatar,
|
|
376
|
+
alt: "",
|
|
377
|
+
name: participant?.name ?? "?",
|
|
378
|
+
fallback: isAgent ? /* @__PURE__ */ jsx(SparklesIcon, { size: "sm" }) : void 0,
|
|
379
|
+
style: { backgroundColor },
|
|
380
|
+
"aria-hidden": "true",
|
|
381
|
+
className: "shrink-0"
|
|
382
|
+
}
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
function ReferenceChip({
|
|
386
|
+
reference,
|
|
387
|
+
linkBuilder,
|
|
388
|
+
onReferenceClick
|
|
389
|
+
}) {
|
|
390
|
+
const href = linkBuilder?.(reference);
|
|
391
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
392
|
+
/* @__PURE__ */ jsx(
|
|
393
|
+
Badge,
|
|
394
|
+
{
|
|
395
|
+
variant: "default",
|
|
396
|
+
size: "sm",
|
|
397
|
+
className: "rounded px-1.5 text-[10px] font-semibold tracking-wide uppercase",
|
|
398
|
+
children: reference.refType
|
|
399
|
+
}
|
|
400
|
+
),
|
|
401
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: reference.title })
|
|
402
|
+
] });
|
|
403
|
+
const className = "inline-flex max-w-full items-center gap-2 rounded-lg border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-700 hover:border-primary-300 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200";
|
|
404
|
+
if (href) {
|
|
405
|
+
return /* @__PURE__ */ jsx(
|
|
406
|
+
"a",
|
|
407
|
+
{
|
|
408
|
+
href,
|
|
409
|
+
className,
|
|
410
|
+
onClick: () => onReferenceClick?.(reference),
|
|
411
|
+
children: content
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
return /* @__PURE__ */ jsx(
|
|
416
|
+
"button",
|
|
417
|
+
{
|
|
418
|
+
type: "button",
|
|
419
|
+
className,
|
|
420
|
+
onClick: () => onReferenceClick?.(reference),
|
|
421
|
+
children: content
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
var ATTACHMENT_KIND_CONFIG = {
|
|
426
|
+
image: { accept: "image/*", match: (t) => t.startsWith("image/") },
|
|
427
|
+
video: { accept: "video/*", match: (t) => t.startsWith("video/") },
|
|
428
|
+
audio: { accept: "audio/*", match: (t) => t.startsWith("audio/") },
|
|
429
|
+
pdf: { accept: "application/pdf", match: (t) => t === "application/pdf" }
|
|
430
|
+
};
|
|
431
|
+
var DEFAULT_ACCEPTED_FILE_TYPES = [
|
|
432
|
+
"image",
|
|
433
|
+
"video",
|
|
434
|
+
"audio",
|
|
435
|
+
"pdf"
|
|
436
|
+
];
|
|
437
|
+
function acceptTokensFor(kinds = DEFAULT_ACCEPTED_FILE_TYPES) {
|
|
438
|
+
const source = kinds.length > 0 ? kinds : DEFAULT_ACCEPTED_FILE_TYPES;
|
|
439
|
+
return Array.from(
|
|
440
|
+
new Set(source.map((k) => ATTACHMENT_KIND_CONFIG[k].accept))
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
function filesToComposerAttachments(files) {
|
|
444
|
+
return Promise.all(
|
|
445
|
+
files.map(
|
|
446
|
+
(file, i) => new Promise((resolve, reject) => {
|
|
447
|
+
const reader = new window.FileReader();
|
|
448
|
+
reader.onload = () => {
|
|
449
|
+
const dataUrl = typeof reader.result === "string" ? reader.result : "";
|
|
450
|
+
resolve({
|
|
451
|
+
id: `att-${Date.now()}-${i}`,
|
|
452
|
+
name: file.name || `attachment-${i}`,
|
|
453
|
+
type: file.type || "application/octet-stream",
|
|
454
|
+
dataUrl
|
|
455
|
+
});
|
|
456
|
+
};
|
|
457
|
+
reader.onerror = () => reject(reader.error);
|
|
458
|
+
reader.readAsDataURL(file);
|
|
459
|
+
})
|
|
460
|
+
)
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
function CopyMenu({ isSelf, markdown, getHtml, getText }) {
|
|
464
|
+
const [open, setOpen] = React4.useState(false);
|
|
465
|
+
const [copied, setCopied] = React4.useState(false);
|
|
466
|
+
const copiedTimer = React4.useRef(
|
|
467
|
+
void 0
|
|
468
|
+
);
|
|
469
|
+
React4.useEffect(() => () => window.clearTimeout(copiedTimer.current), []);
|
|
470
|
+
const flash = () => {
|
|
471
|
+
setCopied(true);
|
|
472
|
+
window.clearTimeout(copiedTimer.current);
|
|
473
|
+
copiedTimer.current = setTimeout(() => setCopied(false), 1200);
|
|
474
|
+
};
|
|
475
|
+
const writeText = async (value) => {
|
|
476
|
+
if (!navigator.clipboard?.writeText) {
|
|
477
|
+
throw new Error("Clipboard API unavailable");
|
|
478
|
+
}
|
|
479
|
+
await navigator.clipboard.writeText(value);
|
|
480
|
+
};
|
|
481
|
+
const writeBoth = async () => {
|
|
482
|
+
const html = getHtml();
|
|
483
|
+
const text = markdown || getText();
|
|
484
|
+
try {
|
|
485
|
+
if (typeof window !== "undefined" && "ClipboardItem" in window && navigator.clipboard?.write) {
|
|
486
|
+
await navigator.clipboard.write([
|
|
487
|
+
new window.ClipboardItem({
|
|
488
|
+
"text/html": new Blob([html], { type: "text/html" }),
|
|
489
|
+
"text/plain": new Blob([text], { type: "text/plain" })
|
|
490
|
+
})
|
|
491
|
+
]);
|
|
492
|
+
} else {
|
|
493
|
+
await writeText(text);
|
|
494
|
+
}
|
|
495
|
+
} catch {
|
|
496
|
+
await writeText(text);
|
|
497
|
+
}
|
|
498
|
+
};
|
|
499
|
+
const run = (fn) => {
|
|
500
|
+
setOpen(false);
|
|
501
|
+
void fn().then(flash, () => {
|
|
502
|
+
});
|
|
503
|
+
};
|
|
504
|
+
return /* @__PURE__ */ jsx(
|
|
505
|
+
"div",
|
|
506
|
+
{
|
|
507
|
+
className: cn(
|
|
508
|
+
"sticky bottom-2 shrink-0 self-end",
|
|
509
|
+
// Rich content (e.g. NITRO tables) layers internals up to z-50, so the
|
|
510
|
+
// open menu's stacking context must clear that.
|
|
511
|
+
open ? "z-[60]" : "z-10"
|
|
512
|
+
),
|
|
513
|
+
children: /* @__PURE__ */ jsxs(
|
|
514
|
+
Dropdown,
|
|
515
|
+
{
|
|
516
|
+
open,
|
|
517
|
+
onOpenChange: setOpen,
|
|
518
|
+
placement: isSelf ? "top-end" : "top-start",
|
|
519
|
+
trigger: /* @__PURE__ */ jsx(
|
|
520
|
+
"button",
|
|
521
|
+
{
|
|
522
|
+
type: "button",
|
|
523
|
+
"data-slot": "superchat-copy-button",
|
|
524
|
+
"aria-label": "Copy message",
|
|
525
|
+
className: "rounded p-1 text-neutral-400 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 hover:text-neutral-600 focus-visible:opacity-100 dark:hover:text-neutral-200",
|
|
526
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { size: 14, "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Clipboard, { size: 14, "aria-hidden": "true" })
|
|
527
|
+
}
|
|
528
|
+
),
|
|
529
|
+
children: [
|
|
530
|
+
/* @__PURE__ */ jsx(DropdownItem, { onClick: () => run(writeBoth), children: /* @__PURE__ */ jsxs("span", { className: "flex flex-col items-start", children: [
|
|
531
|
+
/* @__PURE__ */ jsx("span", { children: "Copy" }),
|
|
532
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] font-normal text-neutral-400", children: "Rich text + Markdown" })
|
|
533
|
+
] }) }),
|
|
534
|
+
/* @__PURE__ */ jsx(
|
|
535
|
+
DropdownItem,
|
|
536
|
+
{
|
|
537
|
+
onClick: () => run(() => writeText(markdown || getText())),
|
|
538
|
+
children: "Copy as Markdown"
|
|
539
|
+
}
|
|
540
|
+
),
|
|
541
|
+
/* @__PURE__ */ jsx(DropdownItem, { onClick: () => run(() => writeText(getText())), children: "Copy as plain text" })
|
|
542
|
+
]
|
|
543
|
+
}
|
|
544
|
+
)
|
|
545
|
+
}
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
var MessageRow = React4.memo(function MessageRow2({
|
|
549
|
+
message,
|
|
550
|
+
participant,
|
|
551
|
+
isSelf,
|
|
552
|
+
renderText,
|
|
553
|
+
linkBuilder,
|
|
554
|
+
onReferenceClick,
|
|
555
|
+
editable,
|
|
556
|
+
onMessageEdited
|
|
557
|
+
}) {
|
|
558
|
+
const streaming = message.status === "streaming";
|
|
559
|
+
const hasBody = !!message.text || (message.content?.length ?? 0) > 0;
|
|
560
|
+
const [isEditing, setIsEditing] = React4.useState(false);
|
|
561
|
+
const [draft, setDraft] = React4.useState(message.text ?? "");
|
|
562
|
+
const editRef = React4.useRef(null);
|
|
563
|
+
const bubbleRef = React4.useRef(null);
|
|
564
|
+
const autosize = React4.useCallback(() => {
|
|
565
|
+
const el = editRef.current;
|
|
566
|
+
if (!el) return;
|
|
567
|
+
el.style.height = "auto";
|
|
568
|
+
el.style.height = `${el.scrollHeight}px`;
|
|
569
|
+
}, []);
|
|
570
|
+
React4.useEffect(() => {
|
|
571
|
+
if (!isEditing) return;
|
|
572
|
+
const el = editRef.current;
|
|
573
|
+
if (!el) return;
|
|
574
|
+
el.focus();
|
|
575
|
+
el.setSelectionRange(el.value.length, el.value.length);
|
|
576
|
+
autosize();
|
|
577
|
+
}, [isEditing, autosize]);
|
|
578
|
+
if (message.type === "system") {
|
|
579
|
+
return /* @__PURE__ */ jsx(
|
|
580
|
+
"div",
|
|
581
|
+
{
|
|
582
|
+
"data-slot": "superchat-system-message",
|
|
583
|
+
role: "status",
|
|
584
|
+
className: "my-1 text-center text-xs text-neutral-500 dark:text-neutral-400",
|
|
585
|
+
children: message.text
|
|
586
|
+
}
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
if (message.type === "ref" && message.ref) {
|
|
590
|
+
return /* @__PURE__ */ jsx(
|
|
591
|
+
"div",
|
|
592
|
+
{
|
|
593
|
+
"data-slot": "superchat-reference",
|
|
594
|
+
className: cn("flex", isSelf && "justify-end"),
|
|
595
|
+
children: /* @__PURE__ */ jsx(
|
|
596
|
+
ReferenceChip,
|
|
597
|
+
{
|
|
598
|
+
reference: message.ref,
|
|
599
|
+
linkBuilder,
|
|
600
|
+
onReferenceClick
|
|
601
|
+
}
|
|
602
|
+
)
|
|
603
|
+
}
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
const accent = participant?.color;
|
|
607
|
+
const accentTextColor = accessibleAccentTextColor(accent);
|
|
608
|
+
const authorName = participant?.name ?? "Unknown";
|
|
609
|
+
const canEdit = !!editable && isSelf && !streaming && typeof message.text === "string" && !message.content?.length;
|
|
610
|
+
const startEdit = () => {
|
|
611
|
+
setDraft(message.text ?? "");
|
|
612
|
+
setIsEditing(true);
|
|
613
|
+
};
|
|
614
|
+
const cancelEdit = () => setIsEditing(false);
|
|
615
|
+
const saveEdit = () => {
|
|
616
|
+
const next = draft.trim();
|
|
617
|
+
if (next && next !== message.text) onMessageEdited?.(message.id, next);
|
|
618
|
+
setIsEditing(false);
|
|
619
|
+
};
|
|
620
|
+
const handleEditPaste = (e) => {
|
|
621
|
+
const files = Array.from(e.clipboardData.items).filter((item) => item.kind === "file" && item.type.startsWith("image/")).map((item) => item.getAsFile()).filter((f) => f !== null);
|
|
622
|
+
if (files.length === 0) return;
|
|
623
|
+
e.preventDefault();
|
|
624
|
+
const el = e.currentTarget;
|
|
625
|
+
const start = el.selectionStart ?? draft.length;
|
|
626
|
+
const end = el.selectionEnd ?? draft.length;
|
|
627
|
+
Promise.all(
|
|
628
|
+
files.map(
|
|
629
|
+
(file, i) => new Promise((resolve) => {
|
|
630
|
+
const reader = new window.FileReader();
|
|
631
|
+
reader.onload = () => {
|
|
632
|
+
const dataUrl = typeof reader.result === "string" ? reader.result : "";
|
|
633
|
+
const name = file.name || `pasted-image-${i + 1}.png`;
|
|
634
|
+
resolve(dataUrl ? `` : "");
|
|
635
|
+
};
|
|
636
|
+
reader.readAsDataURL(file);
|
|
637
|
+
})
|
|
638
|
+
)
|
|
639
|
+
).then((snippets) => {
|
|
640
|
+
const insert = snippets.filter(Boolean).join("\n");
|
|
641
|
+
if (!insert) return;
|
|
642
|
+
el.focus();
|
|
643
|
+
el.setSelectionRange(start, end);
|
|
644
|
+
const text = `${insert}
|
|
645
|
+
`;
|
|
646
|
+
const inserted = typeof document !== "undefined" && typeof document.execCommand === "function" && document.execCommand("insertText", false, text);
|
|
647
|
+
if (!inserted) {
|
|
648
|
+
setDraft((prev) => `${prev.slice(0, start)}${text}${prev.slice(end)}`);
|
|
649
|
+
}
|
|
650
|
+
requestAnimationFrame(autosize);
|
|
651
|
+
});
|
|
652
|
+
};
|
|
653
|
+
const markdownSource = typeof message.text === "string" && message.text ? message.text : message.content?.map((block) => {
|
|
654
|
+
if (block.type === "code" && block.text) {
|
|
655
|
+
return `\`\`\`${block.language ?? ""}
|
|
656
|
+
${block.text}
|
|
657
|
+
\`\`\``;
|
|
658
|
+
}
|
|
659
|
+
if ((block.type === "text" || block.type === "thinking") && block.text) {
|
|
660
|
+
return block.text;
|
|
661
|
+
}
|
|
662
|
+
return "";
|
|
663
|
+
}).filter(Boolean).join("\n\n") ?? "";
|
|
664
|
+
const canCopy = !isEditing && (!!message.content?.length || typeof message.text === "string" && message.text.length > 0);
|
|
665
|
+
return /* @__PURE__ */ jsxs(
|
|
666
|
+
"div",
|
|
667
|
+
{
|
|
668
|
+
"data-slot": "superchat-message",
|
|
669
|
+
role: "article",
|
|
670
|
+
"aria-label": `${authorName}, ${formatTime(message.time)}`,
|
|
671
|
+
className: cn(
|
|
672
|
+
"group flex gap-2",
|
|
673
|
+
isSelf ? "flex-row-reverse" : "flex-row"
|
|
674
|
+
),
|
|
675
|
+
children: [
|
|
676
|
+
/* @__PURE__ */ jsx(ParticipantAvatar, { participant }),
|
|
677
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-col gap-1", isSelf && "items-end"), children: [
|
|
678
|
+
/* @__PURE__ */ jsxs(
|
|
679
|
+
"div",
|
|
680
|
+
{
|
|
681
|
+
"data-slot": "superchat-message-meta",
|
|
682
|
+
className: "flex items-baseline gap-2",
|
|
683
|
+
children: [
|
|
684
|
+
/* @__PURE__ */ jsx(
|
|
685
|
+
"span",
|
|
686
|
+
{
|
|
687
|
+
className: "text-xs font-medium",
|
|
688
|
+
style: accentTextColor ? { color: accentTextColor } : void 0,
|
|
689
|
+
children: authorName
|
|
690
|
+
}
|
|
691
|
+
),
|
|
692
|
+
participant?.role && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: participant.role }),
|
|
693
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: formatTime(message.time) }),
|
|
694
|
+
message.editedAt && /* @__PURE__ */ jsx(
|
|
695
|
+
"span",
|
|
696
|
+
{
|
|
697
|
+
"data-slot": "superchat-edited-indicator",
|
|
698
|
+
className: "text-[10px] text-neutral-500 dark:text-neutral-400",
|
|
699
|
+
title: `Edited ${formatTime(message.editedAt)}`,
|
|
700
|
+
children: "(edited)"
|
|
701
|
+
}
|
|
702
|
+
),
|
|
703
|
+
canEdit && !isEditing && /* @__PURE__ */ jsx(
|
|
704
|
+
"button",
|
|
705
|
+
{
|
|
706
|
+
type: "button",
|
|
707
|
+
"data-slot": "superchat-edit-button",
|
|
708
|
+
onClick: startEdit,
|
|
709
|
+
"aria-label": "Edit message",
|
|
710
|
+
className: "rounded p-0.5 text-neutral-400 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 hover:text-neutral-600 focus-visible:opacity-100 dark:hover:text-neutral-200",
|
|
711
|
+
children: /* @__PURE__ */ jsx(Pencil, { size: 14, "aria-hidden": "true" })
|
|
712
|
+
}
|
|
713
|
+
)
|
|
714
|
+
]
|
|
715
|
+
}
|
|
716
|
+
),
|
|
717
|
+
/* @__PURE__ */ jsxs(
|
|
718
|
+
"div",
|
|
719
|
+
{
|
|
720
|
+
className: cn(
|
|
721
|
+
"flex items-center gap-1",
|
|
722
|
+
isSelf ? "flex-row-reverse" : "flex-row"
|
|
723
|
+
),
|
|
724
|
+
children: [
|
|
725
|
+
canCopy && /* @__PURE__ */ jsx(
|
|
726
|
+
CopyMenu,
|
|
727
|
+
{
|
|
728
|
+
isSelf,
|
|
729
|
+
markdown: markdownSource,
|
|
730
|
+
getHtml: () => bubbleRef.current?.innerHTML ?? "",
|
|
731
|
+
getText: () => bubbleRef.current?.textContent ?? ""
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
/* @__PURE__ */ jsx(
|
|
735
|
+
ChatBubble,
|
|
736
|
+
{
|
|
737
|
+
ref: bubbleRef,
|
|
738
|
+
"data-slot": "superchat-bubble",
|
|
739
|
+
variant: isSelf ? "user" : "assistant",
|
|
740
|
+
hasError: message.status === "error",
|
|
741
|
+
className: "text-sm has-[[data-slot=superchat-nitro-table]]:w-full has-[[data-slot=superchat-nitro-table]]:max-w-full",
|
|
742
|
+
children: isEditing ? /* @__PURE__ */ jsxs(
|
|
743
|
+
"div",
|
|
744
|
+
{
|
|
745
|
+
"data-slot": "superchat-message-editor",
|
|
746
|
+
className: "flex w-80 max-w-full flex-col gap-2",
|
|
747
|
+
children: [
|
|
748
|
+
/* @__PURE__ */ jsx(
|
|
749
|
+
"textarea",
|
|
750
|
+
{
|
|
751
|
+
value: draft,
|
|
752
|
+
ref: editRef,
|
|
753
|
+
rows: 2,
|
|
754
|
+
onChange: (e) => {
|
|
755
|
+
setDraft(e.target.value);
|
|
756
|
+
autosize();
|
|
757
|
+
},
|
|
758
|
+
onPaste: handleEditPaste,
|
|
759
|
+
onKeyDown: (e) => {
|
|
760
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
761
|
+
e.preventDefault();
|
|
762
|
+
saveEdit();
|
|
763
|
+
} else if (e.key === "Escape") {
|
|
764
|
+
e.preventDefault();
|
|
765
|
+
cancelEdit();
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
"aria-label": "Edit message",
|
|
769
|
+
className: "focus:ring-primary-500 max-h-60 min-h-16 w-full resize-none rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 focus:ring-1 focus:outline-none dark:border-neutral-600 dark:bg-neutral-900 dark:text-white"
|
|
770
|
+
}
|
|
771
|
+
),
|
|
772
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
773
|
+
/* @__PURE__ */ jsx(
|
|
774
|
+
"button",
|
|
775
|
+
{
|
|
776
|
+
type: "button",
|
|
777
|
+
onClick: cancelEdit,
|
|
778
|
+
className: "rounded-md px-2.5 py-1 text-xs font-medium text-neutral-200 hover:bg-white/10",
|
|
779
|
+
children: "Cancel"
|
|
780
|
+
}
|
|
781
|
+
),
|
|
782
|
+
/* @__PURE__ */ jsx(
|
|
783
|
+
"button",
|
|
784
|
+
{
|
|
785
|
+
type: "button",
|
|
786
|
+
onClick: saveEdit,
|
|
787
|
+
disabled: !draft.trim() || draft.trim() === message.text,
|
|
788
|
+
className: "rounded-md bg-white px-2.5 py-1 text-xs font-medium text-neutral-900 hover:bg-neutral-100 disabled:opacity-40",
|
|
789
|
+
children: "Save"
|
|
790
|
+
}
|
|
791
|
+
)
|
|
792
|
+
] })
|
|
793
|
+
]
|
|
794
|
+
}
|
|
795
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
796
|
+
message.content?.map((block, i) => {
|
|
797
|
+
if (block.type === "tool_use" && block.toolCall) {
|
|
798
|
+
return /* @__PURE__ */ jsx(MCPToolCallDisplay, { toolCall: block.toolCall }, i);
|
|
799
|
+
}
|
|
800
|
+
if ((block.type === "text" || block.type === "thinking") && block.text) {
|
|
801
|
+
return /* @__PURE__ */ jsx(
|
|
802
|
+
"div",
|
|
803
|
+
{
|
|
804
|
+
className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
|
|
805
|
+
children: renderText(block.text, {
|
|
806
|
+
messageId: message.id,
|
|
807
|
+
streaming,
|
|
808
|
+
role: participant?.kind === "human" ? "user" : "assistant"
|
|
809
|
+
})
|
|
810
|
+
},
|
|
811
|
+
i
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
if (block.type === "code" && block.text) {
|
|
815
|
+
const fenced = `\`\`\`${block.language ?? ""}
|
|
816
|
+
${block.text}
|
|
817
|
+
\`\`\``;
|
|
818
|
+
return /* @__PURE__ */ jsx(
|
|
819
|
+
"div",
|
|
820
|
+
{
|
|
821
|
+
className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
|
|
822
|
+
children: renderText(fenced, {
|
|
823
|
+
messageId: message.id,
|
|
824
|
+
streaming,
|
|
825
|
+
role: participant?.kind === "human" ? "user" : "assistant"
|
|
826
|
+
})
|
|
827
|
+
},
|
|
828
|
+
i
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
return null;
|
|
832
|
+
}),
|
|
833
|
+
message.text && /* @__PURE__ */ jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word", children: renderText(message.text, {
|
|
834
|
+
messageId: message.id,
|
|
835
|
+
streaming,
|
|
836
|
+
role: participant?.kind === "human" ? "user" : "assistant"
|
|
837
|
+
}) }),
|
|
838
|
+
streaming && !hasBody && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(AITypingIndicator, {}) })
|
|
839
|
+
] })
|
|
840
|
+
}
|
|
841
|
+
)
|
|
842
|
+
]
|
|
843
|
+
}
|
|
844
|
+
)
|
|
845
|
+
] })
|
|
846
|
+
]
|
|
847
|
+
}
|
|
848
|
+
);
|
|
849
|
+
});
|
|
850
|
+
var sidebarItem = cva(
|
|
851
|
+
"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors",
|
|
852
|
+
{
|
|
853
|
+
variants: {
|
|
854
|
+
active: {
|
|
855
|
+
true: "bg-primary-100 text-primary-900 dark:bg-primary-900/40 dark:text-primary-100",
|
|
856
|
+
false: "text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800"
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
defaultVariants: { active: false }
|
|
860
|
+
}
|
|
861
|
+
);
|
|
862
|
+
function VirtualThread({
|
|
863
|
+
items,
|
|
864
|
+
participantById,
|
|
865
|
+
currentParticipantId,
|
|
866
|
+
renderText,
|
|
867
|
+
linkBuilder,
|
|
868
|
+
onReferenceClick,
|
|
869
|
+
editable,
|
|
870
|
+
onMessageEdited,
|
|
871
|
+
order,
|
|
872
|
+
conversationId,
|
|
873
|
+
containerProps
|
|
874
|
+
}) {
|
|
875
|
+
const parentRef = React4.useRef(null);
|
|
876
|
+
const virtualizer = useVirtualizer({
|
|
877
|
+
count: items.length,
|
|
878
|
+
getScrollElement: () => parentRef.current,
|
|
879
|
+
// Rough first guess; real heights are measured via measureElement.
|
|
880
|
+
estimateSize: () => 88,
|
|
881
|
+
overscan: 10,
|
|
882
|
+
getItemKey: (index) => items[index]?.id ?? index
|
|
883
|
+
});
|
|
884
|
+
const count = items.length;
|
|
885
|
+
React4.useEffect(() => {
|
|
886
|
+
if (count === 0) return;
|
|
887
|
+
if (order === "desc") {
|
|
888
|
+
virtualizer.scrollToIndex(0, { align: "start" });
|
|
889
|
+
} else {
|
|
890
|
+
virtualizer.scrollToIndex(count - 1, { align: "end" });
|
|
891
|
+
}
|
|
892
|
+
}, [count, conversationId, order]);
|
|
893
|
+
const virtualItems = virtualizer.getVirtualItems();
|
|
894
|
+
return /* @__PURE__ */ jsx("div", { ...containerProps, ref: parentRef, children: /* @__PURE__ */ jsx(
|
|
895
|
+
"div",
|
|
896
|
+
{
|
|
897
|
+
style: {
|
|
898
|
+
height: virtualizer.getTotalSize(),
|
|
899
|
+
position: "relative",
|
|
900
|
+
width: "100%"
|
|
901
|
+
},
|
|
902
|
+
children: virtualItems.map((virtualRow) => {
|
|
903
|
+
const message = items[virtualRow.index];
|
|
904
|
+
if (!message) return null;
|
|
905
|
+
return /* @__PURE__ */ jsx(
|
|
906
|
+
"div",
|
|
907
|
+
{
|
|
908
|
+
"data-index": virtualRow.index,
|
|
909
|
+
ref: virtualizer.measureElement,
|
|
910
|
+
style: {
|
|
911
|
+
position: "absolute",
|
|
912
|
+
top: 0,
|
|
913
|
+
left: 0,
|
|
914
|
+
width: "100%",
|
|
915
|
+
transform: `translateY(${virtualRow.start}px)`
|
|
916
|
+
},
|
|
917
|
+
children: /* @__PURE__ */ jsx("div", { className: "pb-4", children: /* @__PURE__ */ jsx(
|
|
918
|
+
MessageRow,
|
|
919
|
+
{
|
|
920
|
+
message,
|
|
921
|
+
participant: participantById.get(message.participantId),
|
|
922
|
+
isSelf: !!currentParticipantId && message.participantId === currentParticipantId,
|
|
923
|
+
renderText,
|
|
924
|
+
linkBuilder,
|
|
925
|
+
onReferenceClick,
|
|
926
|
+
editable,
|
|
927
|
+
onMessageEdited
|
|
928
|
+
}
|
|
929
|
+
) })
|
|
930
|
+
},
|
|
931
|
+
virtualRow.key
|
|
932
|
+
);
|
|
933
|
+
})
|
|
934
|
+
}
|
|
935
|
+
) });
|
|
936
|
+
}
|
|
937
|
+
function SuperChat({
|
|
938
|
+
conversation,
|
|
939
|
+
currentParticipantId,
|
|
940
|
+
renderPlugins,
|
|
941
|
+
renderTextContent,
|
|
942
|
+
trustedContent,
|
|
943
|
+
readOnly,
|
|
944
|
+
acceptedFileTypes,
|
|
945
|
+
order = "asc",
|
|
946
|
+
virtualized = false,
|
|
947
|
+
linkBuilder,
|
|
948
|
+
className,
|
|
949
|
+
onMessageSent,
|
|
950
|
+
onMessageEdited,
|
|
951
|
+
onConversationClosed,
|
|
952
|
+
onReferenceClick,
|
|
953
|
+
onBack
|
|
954
|
+
}) {
|
|
955
|
+
const headingId = React4.useId();
|
|
956
|
+
const renderText = React4.useMemo(
|
|
957
|
+
() => renderTextContent ?? createMarkdownRenderer({
|
|
958
|
+
plugins: renderPlugins,
|
|
959
|
+
trusted: trustedContent
|
|
960
|
+
}),
|
|
961
|
+
[renderTextContent, renderPlugins, trustedContent]
|
|
962
|
+
);
|
|
963
|
+
const threadRef = React4.useRef(null);
|
|
964
|
+
React4.useEffect(() => {
|
|
965
|
+
if (virtualized) return;
|
|
966
|
+
const el = threadRef.current;
|
|
967
|
+
if (!el) return;
|
|
968
|
+
el.scrollTop = order === "desc" ? 0 : el.scrollHeight;
|
|
969
|
+
}, [conversation.thread.length, conversation.id, order, virtualized]);
|
|
970
|
+
const participantById = React4.useMemo(() => {
|
|
971
|
+
const map = /* @__PURE__ */ new Map();
|
|
972
|
+
conversation.participants.forEach((p) => map.set(p.id, p));
|
|
973
|
+
return map;
|
|
974
|
+
}, [conversation]);
|
|
975
|
+
const orderedThread = React4.useMemo(() => {
|
|
976
|
+
const sorted = [...conversation.thread].sort(byTime);
|
|
977
|
+
return order === "desc" ? sorted.reverse() : sorted;
|
|
978
|
+
}, [conversation, order]);
|
|
979
|
+
const onMessageEditedRef = React4.useRef(onMessageEdited);
|
|
980
|
+
onMessageEditedRef.current = onMessageEdited;
|
|
981
|
+
const conversationRef = React4.useRef(conversation);
|
|
982
|
+
conversationRef.current = conversation;
|
|
983
|
+
const handleMessageEdited = React4.useCallback(
|
|
984
|
+
(messageId, text) => {
|
|
985
|
+
onMessageEditedRef.current?.(messageId, text, {
|
|
986
|
+
conversation: conversationRef.current
|
|
987
|
+
});
|
|
988
|
+
},
|
|
989
|
+
[]
|
|
990
|
+
);
|
|
991
|
+
const editable = !readOnly && !!onMessageEdited;
|
|
992
|
+
const mentionOptions = React4.useMemo(
|
|
993
|
+
() => conversation.participants.filter((p) => p.kind !== "system").map((p) => ({
|
|
994
|
+
id: p.id,
|
|
995
|
+
label: p.name,
|
|
996
|
+
description: p.role,
|
|
997
|
+
meta: p.kind,
|
|
998
|
+
icon: /* @__PURE__ */ jsx(ParticipantAvatar, { participant: p })
|
|
999
|
+
})),
|
|
1000
|
+
[conversation.participants]
|
|
1001
|
+
);
|
|
1002
|
+
const composerAccept = React4.useMemo(
|
|
1003
|
+
() => acceptTokensFor(acceptedFileTypes),
|
|
1004
|
+
[acceptedFileTypes]
|
|
1005
|
+
);
|
|
1006
|
+
const handleComposerSend = React4.useCallback(
|
|
1007
|
+
async (message) => {
|
|
1008
|
+
const text = message.content;
|
|
1009
|
+
const mentions = detectMentions(text, conversation.participants);
|
|
1010
|
+
const attachments = await filesToComposerAttachments(
|
|
1011
|
+
message.attachments ?? []
|
|
1012
|
+
);
|
|
1013
|
+
onMessageSent?.(text, { conversation, mentions, attachments });
|
|
1014
|
+
},
|
|
1015
|
+
[conversation, onMessageSent]
|
|
1016
|
+
);
|
|
1017
|
+
return /* @__PURE__ */ jsxs(
|
|
1018
|
+
"section",
|
|
1019
|
+
{
|
|
1020
|
+
"data-slot": "superchat",
|
|
1021
|
+
role: "group",
|
|
1022
|
+
"aria-labelledby": headingId,
|
|
1023
|
+
className: cn(
|
|
1024
|
+
"flex min-w-0 flex-1 flex-col bg-white dark:bg-neutral-900",
|
|
1025
|
+
className
|
|
1026
|
+
),
|
|
1027
|
+
children: [
|
|
1028
|
+
/* @__PURE__ */ jsxs(
|
|
1029
|
+
"header",
|
|
1030
|
+
{
|
|
1031
|
+
"data-slot": "superchat-header",
|
|
1032
|
+
className: "flex items-center justify-between gap-2 border-b border-neutral-200 p-3 dark:border-neutral-700",
|
|
1033
|
+
children: [
|
|
1034
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
1035
|
+
onBack && /* @__PURE__ */ jsx(
|
|
1036
|
+
"button",
|
|
1037
|
+
{
|
|
1038
|
+
type: "button",
|
|
1039
|
+
onClick: onBack,
|
|
1040
|
+
"aria-label": "Back to conversations",
|
|
1041
|
+
className: "-ml-1 shrink-0 rounded-md p-1 text-neutral-500 hover:bg-neutral-100 sm:hidden dark:text-neutral-300 dark:hover:bg-neutral-800",
|
|
1042
|
+
children: /* @__PURE__ */ jsx(
|
|
1043
|
+
"svg",
|
|
1044
|
+
{
|
|
1045
|
+
viewBox: "0 0 24 24",
|
|
1046
|
+
width: "20",
|
|
1047
|
+
height: "20",
|
|
1048
|
+
fill: "none",
|
|
1049
|
+
stroke: "currentColor",
|
|
1050
|
+
strokeWidth: "2",
|
|
1051
|
+
strokeLinecap: "round",
|
|
1052
|
+
strokeLinejoin: "round",
|
|
1053
|
+
"aria-hidden": "true",
|
|
1054
|
+
children: /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" })
|
|
1055
|
+
}
|
|
1056
|
+
)
|
|
1057
|
+
}
|
|
1058
|
+
),
|
|
1059
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
1060
|
+
/* @__PURE__ */ jsx(
|
|
1061
|
+
"h2",
|
|
1062
|
+
{
|
|
1063
|
+
id: headingId,
|
|
1064
|
+
className: "truncate text-sm font-semibold text-neutral-800 dark:text-neutral-100",
|
|
1065
|
+
children: conversation.title
|
|
1066
|
+
}
|
|
1067
|
+
),
|
|
1068
|
+
/* @__PURE__ */ jsx(
|
|
1069
|
+
"div",
|
|
1070
|
+
{
|
|
1071
|
+
"data-slot": "superchat-participants",
|
|
1072
|
+
role: "group",
|
|
1073
|
+
"aria-label": "Participants",
|
|
1074
|
+
className: "mt-0.5 flex items-center gap-1",
|
|
1075
|
+
children: conversation.participants.slice(0, 6).map((p) => /* @__PURE__ */ jsx("span", { role: "img", "aria-label": p.name, children: /* @__PURE__ */ jsx(ParticipantAvatar, { participant: p }) }, p.id))
|
|
1076
|
+
}
|
|
1077
|
+
)
|
|
1078
|
+
] })
|
|
1079
|
+
] }),
|
|
1080
|
+
onConversationClosed && /* @__PURE__ */ jsx(
|
|
1081
|
+
"button",
|
|
1082
|
+
{
|
|
1083
|
+
type: "button",
|
|
1084
|
+
onClick: () => onConversationClosed(conversation),
|
|
1085
|
+
"aria-label": "Close conversation",
|
|
1086
|
+
className: "rounded-md p-1 text-neutral-400 hover:bg-neutral-100 dark:hover:bg-neutral-800",
|
|
1087
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
1088
|
+
}
|
|
1089
|
+
)
|
|
1090
|
+
]
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
virtualized ? /* @__PURE__ */ jsx(
|
|
1094
|
+
VirtualThread,
|
|
1095
|
+
{
|
|
1096
|
+
items: orderedThread,
|
|
1097
|
+
participantById,
|
|
1098
|
+
currentParticipantId,
|
|
1099
|
+
renderText,
|
|
1100
|
+
linkBuilder,
|
|
1101
|
+
onReferenceClick,
|
|
1102
|
+
editable,
|
|
1103
|
+
onMessageEdited: handleMessageEdited,
|
|
1104
|
+
order,
|
|
1105
|
+
conversationId: conversation.id,
|
|
1106
|
+
containerProps: {
|
|
1107
|
+
"data-slot": "superchat-thread",
|
|
1108
|
+
role: "log",
|
|
1109
|
+
"aria-label": "Messages",
|
|
1110
|
+
"aria-live": "polite",
|
|
1111
|
+
// Focusable so keyboard-only users can scroll the message history.
|
|
1112
|
+
tabIndex: 0,
|
|
1113
|
+
className: "flex-1 overflow-y-auto p-4"
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
) : /* @__PURE__ */ jsx(
|
|
1117
|
+
"div",
|
|
1118
|
+
{
|
|
1119
|
+
"data-slot": "superchat-thread",
|
|
1120
|
+
ref: threadRef,
|
|
1121
|
+
role: "log",
|
|
1122
|
+
"aria-label": "Messages",
|
|
1123
|
+
"aria-live": "polite",
|
|
1124
|
+
tabIndex: 0,
|
|
1125
|
+
className: "flex-1 space-y-4 overflow-y-auto p-4",
|
|
1126
|
+
children: orderedThread.map((m) => /* @__PURE__ */ jsx(
|
|
1127
|
+
MessageRow,
|
|
1128
|
+
{
|
|
1129
|
+
message: m,
|
|
1130
|
+
participant: participantById.get(m.participantId),
|
|
1131
|
+
isSelf: !!currentParticipantId && m.participantId === currentParticipantId,
|
|
1132
|
+
renderText,
|
|
1133
|
+
linkBuilder,
|
|
1134
|
+
onReferenceClick,
|
|
1135
|
+
editable,
|
|
1136
|
+
onMessageEdited: handleMessageEdited
|
|
1137
|
+
},
|
|
1138
|
+
m.id
|
|
1139
|
+
))
|
|
1140
|
+
}
|
|
1141
|
+
),
|
|
1142
|
+
/* @__PURE__ */ jsx(
|
|
1143
|
+
MessageComposer,
|
|
1144
|
+
{
|
|
1145
|
+
onSend: handleComposerSend,
|
|
1146
|
+
disabled: readOnly,
|
|
1147
|
+
placeholder: readOnly ? "Read-only conversation" : "Type a message\u2026 use @ to address an agent",
|
|
1148
|
+
mentionOptions,
|
|
1149
|
+
showAttachmentPicker: !readOnly,
|
|
1150
|
+
showCameraButton: false,
|
|
1151
|
+
acceptedFileTypes: composerAccept,
|
|
1152
|
+
maxLength: 1e5
|
|
1153
|
+
}
|
|
1154
|
+
)
|
|
1155
|
+
]
|
|
1156
|
+
}
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
|
+
function SuperChatConversations({
|
|
1160
|
+
conversations,
|
|
1161
|
+
activeConversationId,
|
|
1162
|
+
defaultActiveConversationId,
|
|
1163
|
+
className,
|
|
1164
|
+
onConversationOpened,
|
|
1165
|
+
onNewConversation
|
|
1166
|
+
}) {
|
|
1167
|
+
const [internalActive, setInternalActive] = React4.useState(
|
|
1168
|
+
defaultActiveConversationId ?? conversations[0]?.id
|
|
1169
|
+
);
|
|
1170
|
+
const requestedId = activeConversationId ?? internalActive;
|
|
1171
|
+
const activeId = conversations.some((c) => c.id === requestedId) ? requestedId : conversations[0]?.id;
|
|
1172
|
+
const sortedConversations = React4.useMemo(
|
|
1173
|
+
() => [...conversations].sort((a, b) => lastActivityOf(b) - lastActivityOf(a)),
|
|
1174
|
+
[conversations]
|
|
1175
|
+
);
|
|
1176
|
+
const selectConversation = (c) => {
|
|
1177
|
+
if (activeConversationId === void 0) setInternalActive(c.id);
|
|
1178
|
+
onConversationOpened?.(c);
|
|
1179
|
+
};
|
|
1180
|
+
return /* @__PURE__ */ jsxs(
|
|
1181
|
+
"aside",
|
|
1182
|
+
{
|
|
1183
|
+
"data-slot": "superchat-conversations",
|
|
1184
|
+
"aria-label": "Conversations",
|
|
1185
|
+
className: cn(
|
|
1186
|
+
"flex w-64 shrink-0 flex-col border-r border-neutral-200 dark:border-neutral-700",
|
|
1187
|
+
className
|
|
1188
|
+
),
|
|
1189
|
+
children: [
|
|
1190
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3", children: [
|
|
1191
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-neutral-700 dark:text-neutral-200", children: "Conversations" }),
|
|
1192
|
+
onNewConversation && /* @__PURE__ */ jsx(
|
|
1193
|
+
"button",
|
|
1194
|
+
{
|
|
1195
|
+
type: "button",
|
|
1196
|
+
onClick: onNewConversation,
|
|
1197
|
+
"aria-label": "New conversation",
|
|
1198
|
+
className: "rounded-md px-2 py-1 text-lg leading-none text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",
|
|
1199
|
+
children: "+"
|
|
1200
|
+
}
|
|
1201
|
+
)
|
|
1202
|
+
] }),
|
|
1203
|
+
/* @__PURE__ */ jsx(
|
|
1204
|
+
"div",
|
|
1205
|
+
{
|
|
1206
|
+
"data-slot": "superchat-conversation-list",
|
|
1207
|
+
role: "list",
|
|
1208
|
+
className: "flex-1 space-y-1 overflow-y-auto px-2 pb-2",
|
|
1209
|
+
children: sortedConversations.map((c) => {
|
|
1210
|
+
const last = lastMessageByTime(c.thread);
|
|
1211
|
+
const isActive = c.id === activeId;
|
|
1212
|
+
return /* @__PURE__ */ jsx("div", { role: "listitem", children: /* @__PURE__ */ jsxs(
|
|
1213
|
+
"button",
|
|
1214
|
+
{
|
|
1215
|
+
type: "button",
|
|
1216
|
+
"aria-current": isActive ? "true" : void 0,
|
|
1217
|
+
onClick: () => selectConversation(c),
|
|
1218
|
+
className: sidebarItem({ active: isActive }),
|
|
1219
|
+
children: [
|
|
1220
|
+
/* @__PURE__ */ jsxs("span", { className: "flex-1 truncate", children: [
|
|
1221
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: c.title }),
|
|
1222
|
+
last?.text && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-neutral-600 dark:text-neutral-400", children: last.text })
|
|
1223
|
+
] }),
|
|
1224
|
+
!!c.unread && /* @__PURE__ */ jsxs("span", { className: "bg-primary-600 ml-1 inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[10px] font-semibold text-white", children: [
|
|
1225
|
+
c.unread,
|
|
1226
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: " unread messages" })
|
|
1227
|
+
] })
|
|
1228
|
+
]
|
|
1229
|
+
}
|
|
1230
|
+
) }, c.id);
|
|
1231
|
+
})
|
|
1232
|
+
}
|
|
1233
|
+
)
|
|
1234
|
+
]
|
|
1235
|
+
}
|
|
1236
|
+
);
|
|
1237
|
+
}
|
|
1238
|
+
function SuperChatInbox({
|
|
1239
|
+
conversations,
|
|
1240
|
+
activeConversationId,
|
|
1241
|
+
defaultActiveConversationId,
|
|
1242
|
+
currentParticipantId,
|
|
1243
|
+
renderPlugins,
|
|
1244
|
+
renderTextContent,
|
|
1245
|
+
trustedContent,
|
|
1246
|
+
readOnly,
|
|
1247
|
+
acceptedFileTypes,
|
|
1248
|
+
order,
|
|
1249
|
+
virtualized,
|
|
1250
|
+
showSidebar = true,
|
|
1251
|
+
linkBuilder,
|
|
1252
|
+
className,
|
|
1253
|
+
onMessageSent,
|
|
1254
|
+
onMessageEdited,
|
|
1255
|
+
onConversationOpened,
|
|
1256
|
+
onConversationClosed,
|
|
1257
|
+
onNewConversation,
|
|
1258
|
+
onReferenceClick
|
|
1259
|
+
}) {
|
|
1260
|
+
const [internalActive, setInternalActive] = React4.useState(
|
|
1261
|
+
defaultActiveConversationId ?? conversations[0]?.id
|
|
1262
|
+
);
|
|
1263
|
+
const requestedId = activeConversationId ?? internalActive;
|
|
1264
|
+
const active = conversations.find((c) => c.id === requestedId) ?? conversations[0];
|
|
1265
|
+
const activeId = active?.id;
|
|
1266
|
+
const [mobileView, setMobileView] = React4.useState("list");
|
|
1267
|
+
const handleOpen = (c) => {
|
|
1268
|
+
if (activeConversationId === void 0) setInternalActive(c.id);
|
|
1269
|
+
setMobileView("chat");
|
|
1270
|
+
onConversationOpened?.(c);
|
|
1271
|
+
};
|
|
1272
|
+
return /* @__PURE__ */ jsxs(
|
|
1273
|
+
"div",
|
|
1274
|
+
{
|
|
1275
|
+
"data-slot": "superchat-inbox",
|
|
1276
|
+
role: "group",
|
|
1277
|
+
"aria-label": active ? `Chat: ${active.title}` : "Chat",
|
|
1278
|
+
className: cn(
|
|
1279
|
+
"flex h-full overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-700 dark:bg-neutral-900",
|
|
1280
|
+
className
|
|
1281
|
+
),
|
|
1282
|
+
children: [
|
|
1283
|
+
showSidebar && /* @__PURE__ */ jsx(
|
|
1284
|
+
SuperChatConversations,
|
|
1285
|
+
{
|
|
1286
|
+
conversations,
|
|
1287
|
+
activeConversationId: activeId,
|
|
1288
|
+
onConversationOpened: handleOpen,
|
|
1289
|
+
onNewConversation,
|
|
1290
|
+
className: cn(
|
|
1291
|
+
"w-full sm:w-64",
|
|
1292
|
+
mobileView === "chat" && "hidden sm:flex"
|
|
1293
|
+
)
|
|
1294
|
+
}
|
|
1295
|
+
),
|
|
1296
|
+
active ? /* @__PURE__ */ jsx(
|
|
1297
|
+
SuperChat,
|
|
1298
|
+
{
|
|
1299
|
+
conversation: active,
|
|
1300
|
+
currentParticipantId,
|
|
1301
|
+
renderPlugins,
|
|
1302
|
+
renderTextContent,
|
|
1303
|
+
trustedContent,
|
|
1304
|
+
readOnly,
|
|
1305
|
+
acceptedFileTypes,
|
|
1306
|
+
order,
|
|
1307
|
+
virtualized,
|
|
1308
|
+
linkBuilder,
|
|
1309
|
+
onMessageSent,
|
|
1310
|
+
onMessageEdited,
|
|
1311
|
+
onConversationClosed,
|
|
1312
|
+
onReferenceClick,
|
|
1313
|
+
onBack: showSidebar ? () => setMobileView("list") : void 0,
|
|
1314
|
+
className: cn(
|
|
1315
|
+
showSidebar && mobileView === "list" && "hidden sm:flex"
|
|
1316
|
+
)
|
|
1317
|
+
}
|
|
1318
|
+
) : /* @__PURE__ */ jsx(
|
|
1319
|
+
"section",
|
|
1320
|
+
{
|
|
1321
|
+
"data-slot": "superchat",
|
|
1322
|
+
className: cn(
|
|
1323
|
+
"min-w-0 flex-1 items-center justify-center text-sm text-neutral-400",
|
|
1324
|
+
showSidebar && mobileView === "list" ? "hidden sm:flex" : "flex"
|
|
1325
|
+
),
|
|
1326
|
+
children: "No conversation selected"
|
|
1327
|
+
}
|
|
1328
|
+
)
|
|
1329
|
+
]
|
|
1330
|
+
}
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
export { SuperChat, SuperChatConversations, SuperChatInbox, createMarkdownRenderer };
|
|
1335
|
+
//# sourceMappingURL=index.js.map
|
|
1336
|
+
//# sourceMappingURL=index.js.map
|