@mieweb/ui 0.10.0-dev.4 → 0.10.0-dev.40
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 +4 -4
- package/agent/mieweb-ui.instructions.md +90 -1
- package/dist/CsvBlock-CFXSDPBI.js +9 -0
- package/dist/{CsvBlock-UWPMTLE2.js.map → CsvBlock-CFXSDPBI.js.map} +1 -1
- package/dist/CsvBlock-RGO7JXHJ.cjs +18 -0
- package/dist/{CsvBlock-ROJCKJDP.cjs.map → CsvBlock-RGO7JXHJ.cjs.map} +1 -1
- package/dist/HtmlPreviewBlock-VBYXCXVT.cjs +18 -0
- package/dist/{HtmlPreviewBlock-DWFN6EUB.cjs.map → HtmlPreviewBlock-VBYXCXVT.cjs.map} +1 -1
- package/dist/HtmlPreviewBlock-Z2GCK325.js +9 -0
- package/dist/{HtmlPreviewBlock-ME5U3XNS.js.map → HtmlPreviewBlock-Z2GCK325.js.map} +1 -1
- package/dist/MermaidBlock-I2R2BQOX.cjs +18 -0
- package/dist/{MermaidBlock-D2UC5M55.cjs.map → MermaidBlock-I2R2BQOX.cjs.map} +1 -1
- package/dist/MermaidBlock-XCAK7IA5.js +9 -0
- package/dist/{MermaidBlock-2B6CPD6Y.js.map → MermaidBlock-XCAK7IA5.js.map} +1 -1
- package/dist/SurveyBlock-KI5JOWCL.js +9 -0
- package/dist/{SurveyBlock-4DO62RBT.js.map → SurveyBlock-KI5JOWCL.js.map} +1 -1
- package/dist/SurveyBlock-UKSGISRT.cjs +18 -0
- package/dist/{SurveyBlock-4CD4AYMJ.cjs.map → SurveyBlock-UKSGISRT.cjs.map} +1 -1
- package/dist/ag-grid.d.cts +142 -1
- package/dist/ag-grid.d.ts +142 -1
- package/dist/brands/bluehive.cjs +3 -3
- package/dist/brands/bluehive.css +3 -0
- package/dist/brands/bluehive.js +1 -1
- package/dist/brands/index.cjs +14 -14
- package/dist/brands/index.js +4 -4
- package/dist/{chunk-3M7TAXNR.js → chunk-24AFHH4J.js} +3 -3
- package/dist/{chunk-3M7TAXNR.js.map → chunk-24AFHH4J.js.map} +1 -1
- package/dist/{chunk-JYZW2PZS.cjs → chunk-254QK722.cjs} +7 -7
- package/dist/chunk-254QK722.cjs.map +1 -0
- package/dist/{chunk-VPIYTQCV.cjs → chunk-2I4IRQQG.cjs} +12 -5
- package/dist/chunk-2I4IRQQG.cjs.map +1 -0
- package/dist/chunk-2X54ZLT6.js +874 -0
- package/dist/chunk-2X54ZLT6.js.map +1 -0
- package/dist/{chunk-5MCBWTIF.cjs → chunk-32ZCJOSR.cjs} +4 -4
- package/dist/{chunk-5MCBWTIF.cjs.map → chunk-32ZCJOSR.cjs.map} +1 -1
- package/dist/chunk-3YBS4WUQ.js +52 -0
- package/dist/chunk-3YBS4WUQ.js.map +1 -0
- package/dist/{chunk-WNJRS7Y7.cjs → chunk-3ZWCIPFT.cjs} +4 -2
- package/dist/chunk-3ZWCIPFT.cjs.map +1 -0
- package/dist/chunk-434L5RYF.js +314 -0
- package/dist/chunk-434L5RYF.js.map +1 -0
- package/dist/{chunk-TPWKM7JH.js → chunk-43K7OQ3E.js} +3 -3
- package/dist/{chunk-TPWKM7JH.js.map → chunk-43K7OQ3E.js.map} +1 -1
- package/dist/chunk-47P5QLX4.cjs +42 -0
- package/dist/chunk-47P5QLX4.cjs.map +1 -0
- package/dist/chunk-4IS3QCOQ.cjs +453 -0
- package/dist/chunk-4IS3QCOQ.cjs.map +1 -0
- package/dist/chunk-4NCDU5IG.cjs +56 -0
- package/dist/chunk-4NCDU5IG.cjs.map +1 -0
- package/dist/chunk-4ZB7RSMY.cjs +306 -0
- package/dist/chunk-4ZB7RSMY.cjs.map +1 -0
- package/dist/chunk-522WJIVI.js +99 -0
- package/dist/chunk-522WJIVI.js.map +1 -0
- package/dist/chunk-56VTM4OX.js +261 -0
- package/dist/chunk-56VTM4OX.js.map +1 -0
- package/dist/chunk-5HKZR6UG.js +248 -0
- package/dist/chunk-5HKZR6UG.js.map +1 -0
- package/dist/chunk-6BNZLN4B.cjs +548 -0
- package/dist/chunk-6BNZLN4B.cjs.map +1 -0
- package/dist/chunk-6N7NMOSV.js +233 -0
- package/dist/chunk-6N7NMOSV.js.map +1 -0
- package/dist/chunk-6TTCZY3P.cjs +4 -0
- package/dist/chunk-6TTCZY3P.cjs.map +1 -0
- package/dist/{chunk-YQDA366U.js → chunk-753ENNB6.js} +2 -2
- package/dist/{chunk-YQDA366U.js.map → chunk-753ENNB6.js.map} +1 -1
- package/dist/{chunk-N6IY47YA.cjs → chunk-7C5W744U.cjs} +8 -8
- package/dist/{chunk-N6IY47YA.cjs.map → chunk-7C5W744U.cjs.map} +1 -1
- package/dist/chunk-7E46YDOT.cjs +122 -0
- package/dist/chunk-7E46YDOT.cjs.map +1 -0
- package/dist/chunk-7HUTR6RX.js +178 -0
- package/dist/chunk-7HUTR6RX.js.map +1 -0
- package/dist/chunk-7IRTD4JT.cjs +61 -0
- package/dist/chunk-7IRTD4JT.cjs.map +1 -0
- package/dist/{chunk-KZFBQ7GY.js → chunk-7QW6TU4X.js} +3 -3
- package/dist/{chunk-KZFBQ7GY.js.map → chunk-7QW6TU4X.js.map} +1 -1
- package/dist/{chunk-MWVW4APN.cjs → chunk-7UTBDFFL.cjs} +4 -4
- package/dist/{chunk-MWVW4APN.cjs.map → chunk-7UTBDFFL.cjs.map} +1 -1
- package/dist/chunk-7WJ6MBF5.cjs +47 -0
- package/dist/chunk-7WJ6MBF5.cjs.map +1 -0
- package/dist/{chunk-FJ7YPVKV.js → chunk-7X6R3JIA.js} +3 -3
- package/dist/{chunk-FJ7YPVKV.js.map → chunk-7X6R3JIA.js.map} +1 -1
- package/dist/chunk-A4W5CSK7.cjs +216 -0
- package/dist/chunk-A4W5CSK7.cjs.map +1 -0
- package/dist/{chunk-2G75X6TS.cjs → chunk-AHHFFXJR.cjs} +3 -3
- package/dist/{chunk-2G75X6TS.cjs.map → chunk-AHHFFXJR.cjs.map} +1 -1
- package/dist/chunk-AJPFQF3H.cjs +896 -0
- package/dist/chunk-AJPFQF3H.cjs.map +1 -0
- package/dist/chunk-AMYFRY7K.js +3 -0
- package/dist/chunk-AMYFRY7K.js.map +1 -0
- package/dist/{chunk-VNYW4C4J.cjs → chunk-ANMX7YDL.cjs} +4 -84
- package/dist/chunk-ANMX7YDL.cjs.map +1 -0
- package/dist/chunk-ARIJ5OHW.cjs +139 -0
- package/dist/chunk-ARIJ5OHW.cjs.map +1 -0
- package/dist/{chunk-DVOQ3JNO.js → chunk-B4CKCNWD.js} +16 -8
- package/dist/chunk-B4CKCNWD.js.map +1 -0
- package/dist/chunk-BJ6ABRSQ.cjs +256 -0
- package/dist/chunk-BJ6ABRSQ.cjs.map +1 -0
- package/dist/chunk-BM35CACB.js +148 -0
- package/dist/chunk-BM35CACB.js.map +1 -0
- package/dist/{chunk-G3JX3UAU.cjs → chunk-BWSZ2BHJ.cjs} +6 -6
- package/dist/{chunk-G3JX3UAU.cjs.map → chunk-BWSZ2BHJ.cjs.map} +1 -1
- package/dist/chunk-BXRQ6HEP.cjs +4 -0
- package/dist/chunk-BXRQ6HEP.cjs.map +1 -0
- package/dist/{chunk-SGFYA22I.cjs → chunk-C77FAR3F.cjs} +8 -8
- package/dist/{chunk-SGFYA22I.cjs.map → chunk-C77FAR3F.cjs.map} +1 -1
- package/dist/chunk-CBBKWRLG.js +213 -0
- package/dist/chunk-CBBKWRLG.js.map +1 -0
- package/dist/{chunk-UAMXCMST.cjs → chunk-CFI3TQMA.cjs} +3 -3
- package/dist/{chunk-UAMXCMST.cjs.map → chunk-CFI3TQMA.cjs.map} +1 -1
- package/dist/chunk-CLQW724U.cjs +271 -0
- package/dist/chunk-CLQW724U.cjs.map +1 -0
- package/dist/chunk-CPDNX3LS.cjs +47 -0
- package/dist/chunk-CPDNX3LS.cjs.map +1 -0
- package/dist/chunk-CVNPNZMX.js +44 -0
- package/dist/chunk-CVNPNZMX.js.map +1 -0
- package/dist/{chunk-2YCERQWC.js → chunk-CVXESGXJ.js} +10 -9
- package/dist/chunk-CVXESGXJ.js.map +1 -0
- package/dist/chunk-DGHS5IVD.js +305 -0
- package/dist/chunk-DGHS5IVD.js.map +1 -0
- package/dist/chunk-DHGCLPFZ.js +91 -0
- package/dist/chunk-DHGCLPFZ.js.map +1 -0
- package/dist/{chunk-GD7EBGC4.cjs → chunk-DHU3FFC3.cjs} +49 -19
- package/dist/chunk-DHU3FFC3.cjs.map +1 -0
- package/dist/chunk-DO2YN46R.cjs +201 -0
- package/dist/chunk-DO2YN46R.cjs.map +1 -0
- package/dist/chunk-DVDT7TX7.js +151 -0
- package/dist/chunk-DVDT7TX7.js.map +1 -0
- package/dist/chunk-DXEPYK3I.cjs +92 -0
- package/dist/chunk-DXEPYK3I.cjs.map +1 -0
- package/dist/{chunk-X4XPNTCZ.cjs → chunk-DZ3JTMKM.cjs} +136 -58
- package/dist/chunk-DZ3JTMKM.cjs.map +1 -0
- package/dist/chunk-EACNRR3C.cjs +4 -0
- package/dist/chunk-EACNRR3C.cjs.map +1 -0
- package/dist/{chunk-ZGRCSNPK.js → chunk-EEOGIGIA.js} +4 -4
- package/dist/{chunk-ZGRCSNPK.js.map → chunk-EEOGIGIA.js.map} +1 -1
- package/dist/chunk-EPCUPHEO.js +193 -0
- package/dist/chunk-EPCUPHEO.js.map +1 -0
- package/dist/{chunk-7ZXAQTV4.cjs → chunk-ERACGSDY.cjs} +8 -8
- package/dist/{chunk-7ZXAQTV4.cjs.map → chunk-ERACGSDY.cjs.map} +1 -1
- package/dist/{chunk-OD47TTAW.cjs → chunk-F2FOG4EG.cjs} +9 -9
- package/dist/{chunk-OD47TTAW.cjs.map → chunk-F2FOG4EG.cjs.map} +1 -1
- package/dist/chunk-F3EWRDIT.js +312 -0
- package/dist/chunk-F3EWRDIT.js.map +1 -0
- package/dist/{chunk-XCP454Q6.js → chunk-F4N67NAF.js} +12 -3
- package/dist/chunk-F4N67NAF.js.map +1 -0
- package/dist/{chunk-WGPLUCBD.js → chunk-F6W62K4J.js} +4 -4
- package/dist/{chunk-WGPLUCBD.js.map → chunk-F6W62K4J.js.map} +1 -1
- package/dist/chunk-FBCDYTWM.js +385 -0
- package/dist/chunk-FBCDYTWM.js.map +1 -0
- package/dist/{chunk-V7D3YGUV.js → chunk-FGLIP6YR.js} +4 -4
- package/dist/{chunk-V7D3YGUV.js.map → chunk-FGLIP6YR.js.map} +1 -1
- package/dist/{chunk-VU6UTJRM.js → chunk-FIKO4WR6.js} +3 -3
- package/dist/{chunk-VU6UTJRM.js.map → chunk-FIKO4WR6.js.map} +1 -1
- package/dist/chunk-FSGJXCBG.cjs +318 -0
- package/dist/chunk-FSGJXCBG.cjs.map +1 -0
- package/dist/chunk-FSWHZY3T.cjs +328 -0
- package/dist/chunk-FSWHZY3T.cjs.map +1 -0
- package/dist/chunk-FTEZNCRI.js +29 -0
- package/dist/chunk-FTEZNCRI.js.map +1 -0
- package/dist/{chunk-YVPC65ZJ.cjs → chunk-GF2BE4FB.cjs} +91 -32
- package/dist/chunk-GF2BE4FB.cjs.map +1 -0
- package/dist/{chunk-JEIW7BSV.cjs → chunk-GKDHMNUA.cjs} +2 -52
- package/dist/chunk-GKDHMNUA.cjs.map +1 -0
- package/dist/chunk-GM32IDVL.cjs +356 -0
- package/dist/chunk-GM32IDVL.cjs.map +1 -0
- package/dist/chunk-GVM6DTR5.js +90 -0
- package/dist/chunk-GVM6DTR5.js.map +1 -0
- package/dist/{chunk-SQHMGT4W.js → chunk-GW4RFJZ5.js} +7 -7
- package/dist/chunk-GW4RFJZ5.js.map +1 -0
- package/dist/chunk-GY5SP4ST.js +3 -0
- package/dist/chunk-GY5SP4ST.js.map +1 -0
- package/dist/chunk-H2Y7HZV5.js +3 -0
- package/dist/chunk-H2Y7HZV5.js.map +1 -0
- package/dist/chunk-H3P7POFC.cjs +337 -0
- package/dist/chunk-H3P7POFC.cjs.map +1 -0
- package/dist/{chunk-JID7AZTO.cjs → chunk-H3ROMJYI.cjs} +4 -4
- package/dist/{chunk-JID7AZTO.cjs.map → chunk-H3ROMJYI.cjs.map} +1 -1
- package/dist/{chunk-462XSCP3.cjs → chunk-HCIXGFWR.cjs} +4 -4
- package/dist/{chunk-462XSCP3.cjs.map → chunk-HCIXGFWR.cjs.map} +1 -1
- package/dist/{chunk-H4ZXMQQW.js → chunk-HDY7YQFX.js} +3 -3
- package/dist/{chunk-H4ZXMQQW.js.map → chunk-HDY7YQFX.js.map} +1 -1
- package/dist/chunk-HNFFFFYH.cjs +114 -0
- package/dist/chunk-HNFFFFYH.cjs.map +1 -0
- package/dist/chunk-HNXLLDPN.js +25 -0
- package/dist/chunk-HNXLLDPN.js.map +1 -0
- package/dist/{chunk-NV2CWBI2.cjs → chunk-IEY3ZJIT.cjs} +12 -3
- package/dist/chunk-IEY3ZJIT.cjs.map +1 -0
- package/dist/{chunk-3QEVGSFG.cjs → chunk-IGDO62KR.cjs} +5 -5
- package/dist/{chunk-3QEVGSFG.cjs.map → chunk-IGDO62KR.cjs.map} +1 -1
- package/dist/chunk-IT775BYG.js +179 -0
- package/dist/chunk-IT775BYG.js.map +1 -0
- package/dist/{chunk-N5O47VGS.cjs → chunk-IVGI353O.cjs} +2 -2
- package/dist/{chunk-N5O47VGS.cjs.map → chunk-IVGI353O.cjs.map} +1 -1
- package/dist/chunk-IWRBJHO3.cjs +51 -0
- package/dist/chunk-IWRBJHO3.cjs.map +1 -0
- package/dist/{chunk-VILW53UZ.js → chunk-JMAZ2GKT.js} +3 -3
- package/dist/{chunk-VILW53UZ.js.map → chunk-JMAZ2GKT.js.map} +1 -1
- package/dist/{chunk-WWJIW2IH.cjs → chunk-JSXIB6EJ.cjs} +4 -4
- package/dist/{chunk-WWJIW2IH.cjs.map → chunk-JSXIB6EJ.cjs.map} +1 -1
- package/dist/{chunk-KRU6IGV7.js → chunk-JUJGWUAN.js} +28 -6
- package/dist/chunk-JUJGWUAN.js.map +1 -0
- package/dist/{chunk-FXO5ARBB.cjs → chunk-KDW6BD4O.cjs} +4 -4
- package/dist/{chunk-FXO5ARBB.cjs.map → chunk-KDW6BD4O.cjs.map} +1 -1
- package/dist/{chunk-Z5V7SAZ4.js → chunk-KFEN2SRZ.js} +3 -3
- package/dist/{chunk-Z5V7SAZ4.js.map → chunk-KFEN2SRZ.js.map} +1 -1
- package/dist/{chunk-XEAT7XJG.cjs → chunk-KQ6GLYFZ.cjs} +29 -13
- package/dist/chunk-KQ6GLYFZ.cjs.map +1 -0
- package/dist/chunk-L6K4PRZK.cjs +4 -0
- package/dist/chunk-L6K4PRZK.cjs.map +1 -0
- package/dist/{chunk-7ZDPD5ZX.cjs → chunk-LC3JL2HB.cjs} +11 -7
- package/dist/chunk-LC3JL2HB.cjs.map +1 -0
- package/dist/{chunk-P7UMS4E6.cjs → chunk-LC7PVBXH.cjs} +16 -8
- package/dist/chunk-LC7PVBXH.cjs.map +1 -0
- package/dist/{chunk-Y5HFM7LO.js → chunk-LDBNUJB7.js} +5 -5
- package/dist/{chunk-Y5HFM7LO.js.map → chunk-LDBNUJB7.js.map} +1 -1
- package/dist/chunk-LRAAJRE7.cjs +2707 -0
- package/dist/chunk-LRAAJRE7.cjs.map +1 -0
- package/dist/chunk-LUPRGPKP.js +2540 -0
- package/dist/chunk-LUPRGPKP.js.map +1 -0
- package/dist/chunk-M3VPGJMV.js +283 -0
- package/dist/chunk-M3VPGJMV.js.map +1 -0
- package/dist/{chunk-VKELAMAZ.js → chunk-N54FYWG6.js} +27 -11
- package/dist/chunk-N54FYWG6.js.map +1 -0
- package/dist/chunk-N5JDL4VE.js +3 -0
- package/dist/chunk-N5JDL4VE.js.map +1 -0
- package/dist/{chunk-2QKBTPUC.cjs → chunk-NAH65KPK.cjs} +8 -8
- package/dist/{chunk-2QKBTPUC.cjs.map → chunk-NAH65KPK.cjs.map} +1 -1
- package/dist/{chunk-PYJDVWXM.js → chunk-NUB5HRKS.js} +3 -3
- package/dist/{chunk-PYJDVWXM.js.map → chunk-NUB5HRKS.js.map} +1 -1
- package/dist/{chunk-WNZAYBVB.cjs → chunk-O6BJMVGT.cjs} +48 -48
- package/dist/{chunk-WNZAYBVB.cjs.map → chunk-O6BJMVGT.cjs.map} +1 -1
- package/dist/{chunk-SVSHA7XV.js → chunk-O6XDA3SI.js} +31 -33
- package/dist/chunk-O6XDA3SI.js.map +1 -0
- package/dist/chunk-OIF34LEN.cjs +425 -0
- package/dist/chunk-OIF34LEN.cjs.map +1 -0
- package/dist/chunk-OIMXMPH2.cjs +218 -0
- package/dist/chunk-OIMXMPH2.cjs.map +1 -0
- package/dist/{chunk-J5CSLNCN.cjs → chunk-OODVC2UD.cjs} +2 -2
- package/dist/{chunk-J5CSLNCN.cjs.map → chunk-OODVC2UD.cjs.map} +1 -1
- package/dist/{chunk-ACCAXVOG.js → chunk-OSTSZDQC.js} +134 -56
- package/dist/chunk-OSTSZDQC.js.map +1 -0
- package/dist/{chunk-LL6IWKI3.js → chunk-OW3SQJ7P.js} +3 -3
- package/dist/{chunk-LL6IWKI3.js.map → chunk-OW3SQJ7P.js.map} +1 -1
- package/dist/chunk-P22YCUVM.cjs +4 -0
- package/dist/chunk-P22YCUVM.cjs.map +1 -0
- package/dist/{chunk-CEQJGUAS.js → chunk-P4E3K3ND.js} +12 -5
- package/dist/chunk-P4E3K3ND.js.map +1 -0
- package/dist/{chunk-5GUOOLPR.cjs → chunk-P5CMZZRZ.cjs} +5 -5
- package/dist/{chunk-5GUOOLPR.cjs.map → chunk-P5CMZZRZ.cjs.map} +1 -1
- package/dist/{chunk-TMMVIUUN.js → chunk-P7D7BYFE.js} +4 -4
- package/dist/{chunk-TMMVIUUN.js.map → chunk-P7D7BYFE.js.map} +1 -1
- package/dist/{chunk-3T7QGLNB.js → chunk-PJEL5ZZV.js} +4 -2
- package/dist/chunk-PJEL5ZZV.js.map +1 -0
- package/dist/chunk-PYI2IWNX.cjs +281 -0
- package/dist/chunk-PYI2IWNX.cjs.map +1 -0
- package/dist/chunk-Q3YVLO52.cjs +174 -0
- package/dist/chunk-Q3YVLO52.cjs.map +1 -0
- package/dist/{chunk-WNM7IZJ7.js → chunk-QJ2L5RU6.js} +7 -7
- package/dist/{chunk-WNM7IZJ7.js.map → chunk-QJ2L5RU6.js.map} +1 -1
- package/dist/{chunk-X4LBUPJO.cjs → chunk-QX6AAVDE.cjs} +31 -33
- package/dist/chunk-QX6AAVDE.cjs.map +1 -0
- package/dist/{chunk-UV2FVNWT.cjs → chunk-RIUQP2QS.cjs} +5 -5
- package/dist/{chunk-UV2FVNWT.cjs.map → chunk-RIUQP2QS.cjs.map} +1 -1
- package/dist/chunk-RLVYWUXG.js +115 -0
- package/dist/chunk-RLVYWUXG.js.map +1 -0
- package/dist/{chunk-22CYDCXA.js → chunk-RM2HPQIC.js} +105 -14
- package/dist/chunk-RM2HPQIC.js.map +1 -0
- package/dist/{chunk-DEDN5HAG.js → chunk-RSJGTWLM.js} +3 -3
- package/dist/{chunk-DEDN5HAG.js.map → chunk-RSJGTWLM.js.map} +1 -1
- package/dist/{chunk-6EN3IQQI.cjs → chunk-RV45J2ZT.cjs} +8 -8
- package/dist/{chunk-6EN3IQQI.cjs.map → chunk-RV45J2ZT.cjs.map} +1 -1
- package/dist/chunk-RZSSQ7AT.js +333 -0
- package/dist/chunk-RZSSQ7AT.js.map +1 -0
- package/dist/{chunk-ENKFJJZX.js → chunk-S2JZL4JC.js} +6 -6
- package/dist/{chunk-ENKFJJZX.js.map → chunk-S2JZL4JC.js.map} +1 -1
- package/dist/{chunk-ELPW32ZI.cjs → chunk-S4XCPDEO.cjs} +60 -59
- package/dist/chunk-S4XCPDEO.cjs.map +1 -0
- package/dist/{chunk-OE5CKRUC.js → chunk-SACHTD7B.js} +34 -4
- package/dist/chunk-SACHTD7B.js.map +1 -0
- package/dist/{chunk-U42F3HLE.cjs → chunk-SAGJHL2Z.cjs} +275 -5
- package/dist/chunk-SAGJHL2Z.cjs.map +1 -0
- package/dist/{chunk-VROIMIHB.cjs → chunk-SHBCUXFS.cjs} +28 -6
- package/dist/chunk-SHBCUXFS.cjs.map +1 -0
- package/dist/{chunk-RJ6NTJHC.js → chunk-SRMTRD7F.js} +3 -3
- package/dist/{chunk-RJ6NTJHC.js.map → chunk-SRMTRD7F.js.map} +1 -1
- package/dist/{chunk-IX6KFB3K.cjs → chunk-SW2E7XKY.cjs} +9 -9
- package/dist/{chunk-IX6KFB3K.cjs.map → chunk-SW2E7XKY.cjs.map} +1 -1
- package/dist/chunk-SZSRGUVO.js +402 -0
- package/dist/chunk-SZSRGUVO.js.map +1 -0
- package/dist/{chunk-NJ6MY6V5.js → chunk-T5BBZQ66.js} +3 -3
- package/dist/{chunk-NJ6MY6V5.js.map → chunk-T5BBZQ66.js.map} +1 -1
- package/dist/{chunk-JI244Y7C.js → chunk-T5NOFXOL.js} +275 -5
- package/dist/chunk-T5NOFXOL.js.map +1 -0
- package/dist/{chunk-2IZLKPUW.js → chunk-THLIL6PY.js} +3 -3
- package/dist/{chunk-2IZLKPUW.js.map → chunk-THLIL6PY.js.map} +1 -1
- package/dist/{chunk-HZ4MBUC3.js → chunk-TI3TQQ7F.js} +4 -53
- package/dist/chunk-TI3TQQ7F.js.map +1 -0
- package/dist/chunk-TVU4KB27.cjs +353 -0
- package/dist/chunk-TVU4KB27.cjs.map +1 -0
- package/dist/{chunk-5JJ2DAE4.js → chunk-TWQSMUE6.js} +7 -3
- package/dist/chunk-TWQSMUE6.js.map +1 -0
- package/dist/{chunk-TAXD5ADA.cjs → chunk-UEDTZYGI.cjs} +3 -3
- package/dist/{chunk-TAXD5ADA.cjs.map → chunk-UEDTZYGI.cjs.map} +1 -1
- package/dist/{chunk-3QGS6CXD.js → chunk-UJDWFDKE.js} +3 -3
- package/dist/{chunk-3QGS6CXD.js.map → chunk-UJDWFDKE.js.map} +1 -1
- package/dist/chunk-UNFDIBKJ.js +258 -0
- package/dist/chunk-UNFDIBKJ.js.map +1 -0
- package/dist/{chunk-UQ3VVR6A.cjs → chunk-UPWIJC6I.cjs} +3 -3
- package/dist/{chunk-UQ3VVR6A.cjs.map → chunk-UPWIJC6I.cjs.map} +1 -1
- package/dist/chunk-UTIPENPW.cjs +286 -0
- package/dist/chunk-UTIPENPW.cjs.map +1 -0
- package/dist/{chunk-S7WCHDBO.js → chunk-VCI2Y7ST.js} +3 -3
- package/dist/{chunk-S7WCHDBO.js.map → chunk-VCI2Y7ST.js.map} +1 -1
- package/dist/chunk-VEE46VTX.js +166 -0
- package/dist/chunk-VEE46VTX.js.map +1 -0
- package/dist/chunk-VFFV7EMT.cjs +188 -0
- package/dist/chunk-VFFV7EMT.cjs.map +1 -0
- package/dist/chunk-VINZZQBD.cjs +323 -0
- package/dist/chunk-VINZZQBD.cjs.map +1 -0
- package/dist/chunk-VPTASZ2O.cjs +171 -0
- package/dist/chunk-VPTASZ2O.cjs.map +1 -0
- package/dist/{chunk-P2CA3XGI.js → chunk-VSRO4PAI.js} +23 -5
- package/dist/chunk-VSRO4PAI.js.map +1 -0
- package/dist/{chunk-L6MDULYB.js → chunk-VU3ZMJBN.js} +2 -2
- package/dist/{chunk-L6MDULYB.js.map → chunk-VU3ZMJBN.js.map} +1 -1
- package/dist/{chunk-XI34EGK5.cjs → chunk-VV2U36T6.cjs} +9 -9
- package/dist/{chunk-XI34EGK5.cjs.map → chunk-VV2U36T6.cjs.map} +1 -1
- package/dist/{chunk-VPWJCJCX.cjs → chunk-VXW7D5LR.cjs} +26 -8
- package/dist/chunk-VXW7D5LR.cjs.map +1 -0
- package/dist/chunk-W3HXHIDO.cjs +2573 -0
- package/dist/chunk-W3HXHIDO.cjs.map +1 -0
- package/dist/{chunk-GOALNQZ2.js → chunk-WFBUBT54.js} +4 -83
- package/dist/chunk-WFBUBT54.js.map +1 -0
- package/dist/chunk-WFL4N5PC.js +283 -0
- package/dist/chunk-WFL4N5PC.js.map +1 -0
- package/dist/chunk-WQHBMZSC.js +295 -0
- package/dist/chunk-WQHBMZSC.js.map +1 -0
- package/dist/chunk-X3RSNAMX.js +195 -0
- package/dist/chunk-X3RSNAMX.js.map +1 -0
- package/dist/chunk-X5JOEZVR.js +525 -0
- package/dist/chunk-X5JOEZVR.js.map +1 -0
- package/dist/chunk-XBAAHOCP.js +3 -0
- package/dist/chunk-XBAAHOCP.js.map +1 -0
- package/dist/chunk-XDIMTPZU.cjs +202 -0
- package/dist/chunk-XDIMTPZU.cjs.map +1 -0
- package/dist/chunk-XDU65GLW.js +21 -0
- package/dist/chunk-XDU65GLW.js.map +1 -0
- package/dist/chunk-XI74P5F2.cjs +424 -0
- package/dist/chunk-XI74P5F2.cjs.map +1 -0
- package/dist/chunk-XNPDZANN.cjs +238 -0
- package/dist/chunk-XNPDZANN.cjs.map +1 -0
- package/dist/{chunk-WIAQQNFU.cjs → chunk-XRVMYT5G.cjs} +106 -13
- package/dist/chunk-XRVMYT5G.cjs.map +1 -0
- package/dist/chunk-XVW5DPPP.js +429 -0
- package/dist/chunk-XVW5DPPP.js.map +1 -0
- package/dist/chunk-XXA4NZUC.js +3 -0
- package/dist/chunk-XXA4NZUC.js.map +1 -0
- package/dist/chunk-Y424YL55.js +59 -0
- package/dist/chunk-Y424YL55.js.map +1 -0
- package/dist/chunk-Y4QNLW7W.js +300 -0
- package/dist/chunk-Y4QNLW7W.js.map +1 -0
- package/dist/chunk-Y7ZJZLJY.js +2657 -0
- package/dist/chunk-Y7ZJZLJY.js.map +1 -0
- package/dist/chunk-YGS2TRMP.js +38 -0
- package/dist/chunk-YGS2TRMP.js.map +1 -0
- package/dist/chunk-YUMOM3KE.js +167 -0
- package/dist/chunk-YUMOM3KE.js.map +1 -0
- package/dist/chunk-YW2AKBLS.cjs +23 -0
- package/dist/chunk-YW2AKBLS.cjs.map +1 -0
- package/dist/chunk-ZNUMOJOI.cjs +4 -0
- package/dist/chunk-ZNUMOJOI.cjs.map +1 -0
- package/dist/chunk-ZSNFL736.cjs +306 -0
- package/dist/chunk-ZSNFL736.cjs.map +1 -0
- package/dist/components/Accordion/index.cjs +2 -2
- package/dist/components/Accordion/index.d.cts +6 -0
- package/dist/components/Accordion/index.d.ts +6 -0
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/ActionPlan/index.cjs +34 -0
- package/dist/components/ActionPlan/index.cjs.map +1 -0
- package/dist/components/ActionPlan/index.d.cts +65 -0
- package/dist/components/ActionPlan/index.d.ts +65 -0
- package/dist/components/ActionPlan/index.js +21 -0
- package/dist/components/ActionPlan/index.js.map +1 -0
- package/dist/components/ActivityFeed/index.cjs +31 -0
- package/dist/components/ActivityFeed/index.cjs.map +1 -0
- package/dist/components/ActivityFeed/index.d.cts +99 -0
- package/dist/components/ActivityFeed/index.d.ts +99 -0
- package/dist/components/ActivityFeed/index.js +18 -0
- package/dist/components/ActivityFeed/index.js.map +1 -0
- package/dist/components/Alert/index.d.cts +1 -1
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/AlertDialog/index.cjs +19 -5
- package/dist/components/AlertDialog/index.d.cts +94 -16
- package/dist/components/AlertDialog/index.d.ts +94 -16
- package/dist/components/AlertDialog/index.js +6 -4
- package/dist/components/AssociationList/index.cjs +29 -0
- package/dist/components/AssociationList/index.cjs.map +1 -0
- package/dist/components/AssociationList/index.d.cts +50 -0
- package/dist/components/AssociationList/index.d.ts +50 -0
- package/dist/components/AssociationList/index.js +16 -0
- package/dist/components/AssociationList/index.js.map +1 -0
- package/dist/components/AudioRecorder/index.d.cts +2 -2
- package/dist/components/AudioRecorder/index.d.ts +2 -2
- package/dist/components/Autocomplete/index.d.cts +8 -2
- package/dist/components/Autocomplete/index.d.ts +8 -2
- package/dist/components/Avatar/index.cjs +9 -7
- package/dist/components/Avatar/index.d.cts +46 -15
- package/dist/components/Avatar/index.d.ts +46 -15
- package/dist/components/Avatar/index.js +3 -1
- package/dist/components/AvatarGroup/index.cjs +20 -0
- package/dist/components/AvatarGroup/index.cjs.map +1 -0
- package/dist/components/AvatarGroup/index.d.cts +57 -0
- package/dist/components/AvatarGroup/index.d.ts +57 -0
- package/dist/components/AvatarGroup/index.js +7 -0
- package/dist/components/AvatarGroup/index.js.map +1 -0
- package/dist/components/Badge/index.cjs +3 -3
- package/dist/components/Badge/index.d.cts +16 -2
- package/dist/components/Badge/index.d.ts +16 -2
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/BoardView/index.cjs +24 -0
- package/dist/components/BoardView/index.cjs.map +1 -0
- package/dist/components/BoardView/index.d.cts +41 -0
- package/dist/components/BoardView/index.d.ts +41 -0
- package/dist/components/BoardView/index.js +7 -0
- package/dist/components/BoardView/index.js.map +1 -0
- package/dist/components/Button/index.cjs +5 -3
- package/dist/components/Button/index.d.cts +2 -1
- package/dist/components/Button/index.d.ts +2 -1
- package/dist/components/Button/index.js +3 -1
- package/dist/components/CalendarHeatmap/index.cjs +18 -0
- package/dist/components/CalendarHeatmap/index.cjs.map +1 -0
- package/dist/components/CalendarHeatmap/index.d.cts +47 -0
- package/dist/components/CalendarHeatmap/index.d.ts +47 -0
- package/dist/components/CalendarHeatmap/index.js +5 -0
- package/dist/components/CalendarHeatmap/index.js.map +1 -0
- package/dist/components/CalendarView/index.cjs +24 -0
- package/dist/components/CalendarView/index.cjs.map +1 -0
- package/dist/components/CalendarView/index.d.cts +39 -0
- package/dist/components/CalendarView/index.d.ts +39 -0
- package/dist/components/CalendarView/index.js +11 -0
- package/dist/components/CalendarView/index.js.map +1 -0
- package/dist/components/Card/index.d.cts +3 -3
- package/dist/components/Card/index.d.ts +3 -3
- package/dist/components/ClampedText/index.cjs +3 -2
- package/dist/components/ClampedText/index.js +2 -1
- package/dist/components/CollabStatus/index.cjs +6 -4
- package/dist/components/CollabStatus/index.d.cts +11 -0
- package/dist/components/CollabStatus/index.d.ts +11 -0
- package/dist/components/CollabStatus/index.js +3 -1
- package/dist/components/Collapsible/index.cjs +6 -6
- package/dist/components/Collapsible/index.d.cts +6 -0
- package/dist/components/Collapsible/index.d.ts +6 -0
- package/dist/components/Collapsible/index.js +3 -3
- package/dist/components/CompletenessMeter/index.cjs +23 -0
- package/dist/components/CompletenessMeter/index.cjs.map +1 -0
- package/dist/components/CompletenessMeter/index.d.cts +52 -0
- package/dist/components/CompletenessMeter/index.d.ts +52 -0
- package/dist/components/CompletenessMeter/index.js +6 -0
- package/dist/components/CompletenessMeter/index.js.map +1 -0
- package/dist/components/CountryCodeDropdown/index.cjs +5 -5
- package/dist/components/CountryCodeDropdown/index.js +2 -2
- package/dist/components/CustomizableDashboard/index.cjs +12 -10
- package/dist/components/CustomizableDashboard/index.js +5 -3
- package/dist/components/DateInput/index.d.cts +36 -4
- package/dist/components/DateInput/index.d.ts +36 -4
- package/dist/components/Dropdown/index.cjs +11 -10
- package/dist/components/Dropdown/index.d.cts +2 -1
- package/dist/components/Dropdown/index.d.ts +2 -1
- package/dist/components/Dropdown/index.js +4 -3
- package/dist/components/EmailEditor/index.cjs +67 -0
- package/dist/components/EmailEditor/index.cjs.map +1 -0
- package/dist/components/EmailEditor/index.d.cts +347 -0
- package/dist/components/EmailEditor/index.d.ts +347 -0
- package/dist/components/EmailEditor/index.js +26 -0
- package/dist/components/EmailEditor/index.js.map +1 -0
- package/dist/components/FieldHistory/index.cjs +34 -0
- package/dist/components/FieldHistory/index.cjs.map +1 -0
- package/dist/components/FieldHistory/index.d.cts +66 -0
- package/dist/components/FieldHistory/index.d.ts +66 -0
- package/dist/components/FieldHistory/index.js +21 -0
- package/dist/components/FieldHistory/index.js.map +1 -0
- package/dist/components/FloatingWindow/index.cjs +6 -4
- package/dist/components/FloatingWindow/index.js +4 -2
- package/dist/components/GanttView/index.cjs +20 -0
- package/dist/components/GanttView/index.cjs.map +1 -0
- package/dist/components/GanttView/index.d.cts +36 -0
- package/dist/components/GanttView/index.d.ts +36 -0
- package/dist/components/GanttView/index.js +7 -0
- package/dist/components/GanttView/index.js.map +1 -0
- package/dist/components/GlossaryTooltip/index.cjs +3 -3
- package/dist/components/GlossaryTooltip/index.js +2 -2
- package/dist/components/InlineEdit/index.cjs +20 -0
- package/dist/components/InlineEdit/index.cjs.map +1 -0
- package/dist/components/InlineEdit/index.d.cts +56 -0
- package/dist/components/InlineEdit/index.d.ts +56 -0
- package/dist/components/InlineEdit/index.js +7 -0
- package/dist/components/InlineEdit/index.js.map +1 -0
- package/dist/components/KeyboardShortcutsOverlay/index.cjs +5 -5
- package/dist/components/KeyboardShortcutsOverlay/index.js +3 -3
- package/dist/components/ListView/index.cjs +24 -0
- package/dist/components/ListView/index.cjs.map +1 -0
- package/dist/components/ListView/index.d.cts +124 -0
- package/dist/components/ListView/index.d.ts +124 -0
- package/dist/components/ListView/index.js +11 -0
- package/dist/components/ListView/index.js.map +1 -0
- package/dist/components/LogoUploader/index.cjs +18 -0
- package/dist/components/LogoUploader/index.cjs.map +1 -0
- package/dist/components/LogoUploader/index.d.cts +49 -0
- package/dist/components/LogoUploader/index.d.ts +49 -0
- package/dist/components/LogoUploader/index.js +5 -0
- package/dist/components/LogoUploader/index.js.map +1 -0
- package/dist/components/Markdown/index.cjs +21 -19
- package/dist/components/Markdown/index.js +9 -7
- package/dist/components/MediaEditor/index.cjs +16 -14
- package/dist/components/MediaEditor/index.d.cts +91 -2
- package/dist/components/MediaEditor/index.d.ts +91 -2
- package/dist/components/MediaEditor/index.js +11 -9
- package/dist/components/MediaFeed/index.cjs +29 -0
- package/dist/components/MediaFeed/index.cjs.map +1 -0
- package/dist/components/MediaFeed/index.d.cts +104 -0
- package/dist/components/MediaFeed/index.d.ts +104 -0
- package/dist/components/MediaFeed/index.js +20 -0
- package/dist/components/MediaFeed/index.js.map +1 -0
- package/dist/components/MediaPlayer/index.cjs +8 -6
- package/dist/components/MediaPlayer/index.d.cts +19 -1
- package/dist/components/MediaPlayer/index.d.ts +19 -1
- package/dist/components/MediaPlayer/index.js +5 -3
- package/dist/components/MegaMenu/index.cjs +7 -5
- package/dist/components/MegaMenu/index.js +4 -2
- package/dist/components/Modal/index.cjs +10 -10
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/Pagination/index.d.cts +1 -1
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/PhiMask/index.cjs +18 -0
- package/dist/components/PhiMask/index.cjs.map +1 -0
- package/dist/components/PhiMask/index.d.cts +45 -0
- package/dist/components/PhiMask/index.d.ts +45 -0
- package/dist/components/PhiMask/index.js +5 -0
- package/dist/components/PhiMask/index.js.map +1 -0
- package/dist/components/Progress/index.cjs +6 -6
- package/dist/components/Progress/index.d.cts +8 -2
- package/dist/components/Progress/index.d.ts +8 -2
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/PropertyList/index.cjs +25 -0
- package/dist/components/PropertyList/index.cjs.map +1 -0
- package/dist/components/PropertyList/index.d.cts +87 -0
- package/dist/components/PropertyList/index.d.ts +87 -0
- package/dist/components/PropertyList/index.js +12 -0
- package/dist/components/PropertyList/index.js.map +1 -0
- package/dist/components/Q/index.d.cts +2 -2
- package/dist/components/Q/index.d.ts +2 -2
- package/dist/components/QuickAction/index.d.cts +1 -1
- package/dist/components/QuickAction/index.d.ts +1 -1
- package/dist/components/RadialExplorer/index.cjs +7 -5
- package/dist/components/RadialExplorer/index.js +6 -4
- package/dist/components/Rating/index.cjs +28 -0
- package/dist/components/Rating/index.cjs.map +1 -0
- package/dist/components/Rating/index.d.cts +85 -0
- package/dist/components/Rating/index.d.ts +85 -0
- package/dist/components/Rating/index.js +7 -0
- package/dist/components/Rating/index.js.map +1 -0
- package/dist/components/RecordButton/index.d.cts +1 -1
- package/dist/components/RecordButton/index.d.ts +1 -1
- package/dist/components/RecordHeader/index.cjs +29 -0
- package/dist/components/RecordHeader/index.cjs.map +1 -0
- package/dist/components/RecordHeader/index.d.cts +96 -0
- package/dist/components/RecordHeader/index.d.ts +96 -0
- package/dist/components/RecordHeader/index.js +16 -0
- package/dist/components/RecordHeader/index.js.map +1 -0
- package/dist/components/RecordLayout/index.cjs +21 -0
- package/dist/components/RecordLayout/index.cjs.map +1 -0
- package/dist/components/RecordLayout/index.d.cts +40 -0
- package/dist/components/RecordLayout/index.d.ts +40 -0
- package/dist/components/RecordLayout/index.js +8 -0
- package/dist/components/RecordLayout/index.js.map +1 -0
- package/dist/components/RichTextEditor/index.cjs +11 -8
- package/dist/components/RichTextEditor/index.d.cts +12 -2
- package/dist/components/RichTextEditor/index.d.ts +12 -2
- package/dist/components/RichTextEditor/index.js +8 -5
- package/dist/components/ScrollArea/index.d.cts +1 -1
- package/dist/components/ScrollArea/index.d.ts +1 -1
- package/dist/components/SectionSpyNav/index.cjs +5 -3
- package/dist/components/SectionSpyNav/index.js +4 -2
- package/dist/components/Select/index.cjs +4 -4
- package/dist/components/Select/index.d.cts +2 -2
- package/dist/components/Select/index.d.ts +2 -2
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Skeleton/index.d.cts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/SliderCalculator/index.cjs +4 -4
- package/dist/components/SliderCalculator/index.js +2 -2
- package/dist/components/SourceTip/index.cjs +3 -3
- package/dist/components/SourceTip/index.js +2 -2
- package/dist/components/Spinner/index.d.cts +2 -2
- package/dist/components/Spinner/index.d.ts +2 -2
- package/dist/components/SuperChat/index.cjs +1300 -713
- package/dist/components/SuperChat/index.cjs.map +1 -1
- package/dist/components/SuperChat/index.d.cts +126 -8
- package/dist/components/SuperChat/index.d.ts +126 -8
- package/dist/components/SuperChat/index.js +1404 -817
- package/dist/components/SuperChat/index.js.map +1 -1
- package/dist/components/SuperChat/plugins/index.cjs +7 -6
- package/dist/components/SuperChat/plugins/index.cjs.map +1 -1
- package/dist/components/SuperChat/plugins/index.d.cts +2 -3
- package/dist/components/SuperChat/plugins/index.d.ts +2 -3
- package/dist/components/SuperChat/plugins/index.js +6 -5
- package/dist/components/SuperChat/plugins/index.js.map +1 -1
- package/dist/components/Tabs/index.cjs +9 -7
- package/dist/components/Tabs/index.d.cts +12 -1
- package/dist/components/Tabs/index.d.ts +12 -1
- package/dist/components/Tabs/index.js +3 -1
- package/dist/components/TagEditor/index.cjs +22 -0
- package/dist/components/TagEditor/index.cjs.map +1 -0
- package/dist/components/TagEditor/index.d.cts +46 -0
- package/dist/components/TagEditor/index.d.ts +46 -0
- package/dist/components/TagEditor/index.js +9 -0
- package/dist/components/TagEditor/index.js.map +1 -0
- package/dist/components/Text/index.d.cts +3 -3
- package/dist/components/Text/index.d.ts +3 -3
- package/dist/components/Textarea/index.d.cts +2 -2
- package/dist/components/Textarea/index.d.ts +2 -2
- package/dist/components/ThemeProvider/index.cjs +9 -9
- package/dist/components/ThemeProvider/index.d.cts +3 -1
- package/dist/components/ThemeProvider/index.d.ts +3 -1
- package/dist/components/ThemeProvider/index.js +3 -3
- package/dist/components/Tooltip/index.cjs +3 -3
- package/dist/components/Tooltip/index.js +2 -2
- package/dist/components/TranscriptView/index.d.cts +85 -4
- package/dist/components/TranscriptView/index.d.ts +85 -4
- package/dist/components/UserPicker/index.cjs +24 -0
- package/dist/components/UserPicker/index.cjs.map +1 -0
- package/dist/components/UserPicker/index.d.cts +60 -0
- package/dist/components/UserPicker/index.d.ts +60 -0
- package/dist/components/UserPicker/index.js +11 -0
- package/dist/components/UserPicker/index.js.map +1 -0
- package/dist/components/VideoCard/index.cjs +4 -4
- package/dist/components/VideoCard/index.js +2 -2
- package/dist/components/ViewSet/index.cjs +25 -0
- package/dist/components/ViewSet/index.cjs.map +1 -0
- package/dist/components/ViewSet/index.d.cts +201 -0
- package/dist/components/ViewSet/index.d.ts +201 -0
- package/dist/components/ViewSet/index.js +16 -0
- package/dist/components/ViewSet/index.js.map +1 -0
- package/dist/components/ViewSwitcher/index.cjs +20 -0
- package/dist/components/ViewSwitcher/index.cjs.map +1 -0
- package/dist/components/ViewSwitcher/index.d.cts +39 -0
- package/dist/components/ViewSwitcher/index.d.ts +39 -0
- package/dist/components/ViewSwitcher/index.js +7 -0
- package/dist/components/ViewSwitcher/index.js.map +1 -0
- package/dist/datavis.cjs +6 -4
- package/dist/datavis.cjs.map +1 -1
- package/dist/datavis.d.cts +167 -13
- package/dist/datavis.d.ts +167 -13
- package/dist/datavis.js +4 -2
- package/dist/datavis.js.map +1 -1
- package/dist/deck.cjs +3360 -0
- package/dist/deck.cjs.map +1 -0
- package/dist/deck.d.cts +712 -0
- package/dist/deck.d.ts +712 -0
- package/dist/deck.js +3316 -0
- package/dist/deck.js.map +1 -0
- package/dist/esheet.cjs +19 -16
- package/dist/esheet.cjs.map +1 -1
- package/dist/esheet.d.cts +183 -1
- package/dist/esheet.d.ts +183 -1
- package/dist/esheet.js +16 -13
- package/dist/esheet.js.map +1 -1
- package/dist/globe.cjs +2 -2
- package/dist/globe.js +1 -1
- package/dist/hooks/index.cjs +94 -35
- package/dist/hooks/index.d.cts +680 -36
- package/dist/hooks/index.d.ts +680 -36
- package/dist/hooks/index.js +10 -7
- package/dist/icons-wBacj6BW.d.cts +142 -0
- package/dist/icons-wBacj6BW.d.ts +142 -0
- package/dist/index.cjs +2152 -1276
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10375 -626
- package/dist/index.d.ts +10375 -626
- package/dist/index.js +740 -313
- package/dist/index.js.map +1 -1
- package/dist/kerebron.cjs +58 -19
- package/dist/kerebron.cjs.map +1 -1
- package/dist/kerebron.css +115 -0
- package/dist/kerebron.d.cts +37 -0
- package/dist/kerebron.d.ts +37 -0
- package/dist/kerebron.js +58 -19
- package/dist/kerebron.js.map +1 -1
- package/dist/maps.cjs +160 -0
- package/dist/maps.cjs.map +1 -0
- package/dist/maps.d.cts +42 -0
- package/dist/maps.d.ts +42 -0
- package/dist/maps.js +138 -0
- package/dist/maps.js.map +1 -0
- package/dist/motion.cjs +7 -7
- package/dist/motion.d.cts +186 -2
- package/dist/motion.d.ts +186 -2
- package/dist/motion.js +2 -2
- package/dist/org-chart.cjs +1302 -0
- package/dist/org-chart.cjs.map +1 -0
- package/dist/org-chart.d.cts +164 -0
- package/dist/org-chart.d.ts +164 -0
- package/dist/org-chart.js +1277 -0
- package/dist/org-chart.js.map +1 -0
- package/dist/q.d.cts +25 -3
- package/dist/q.d.ts +25 -3
- package/dist/styles/effects.css +133 -0
- package/dist/styles/init.css +22 -3
- package/dist/styles.css +1 -1
- package/dist/tailwind-preset.cjs +4 -4
- package/dist/tailwind-preset.js +1 -1
- package/dist/templates.cjs +156 -0
- package/dist/templates.cjs.map +1 -0
- package/dist/templates.d.cts +734 -0
- package/dist/templates.d.ts +734 -0
- package/dist/templates.js +11 -0
- package/dist/templates.js.map +1 -0
- package/dist/types-CDeBNZiE.d.cts +92 -0
- package/dist/types-CDeBNZiE.d.ts +92 -0
- package/dist/types-Cx1FHLq2.d.cts +548 -0
- package/dist/types-Cx1FHLq2.d.ts +548 -0
- package/dist/types-DsdZvEI1.d.cts +92 -0
- package/dist/types-DsdZvEI1.d.ts +92 -0
- package/dist/utils/index.cjs +9 -9
- package/dist/utils/index.d.cts +13 -2
- package/dist/utils/index.d.ts +13 -2
- package/dist/utils/index.js +1 -1
- package/package.json +82 -13
- package/dist/Animated-XmH6k8pZ.d.cts +0 -188
- package/dist/Animated-XmH6k8pZ.d.ts +0 -188
- package/dist/CsvBlock-ROJCKJDP.cjs +0 -16
- package/dist/CsvBlock-UWPMTLE2.js +0 -7
- package/dist/HtmlPreviewBlock-DWFN6EUB.cjs +0 -16
- package/dist/HtmlPreviewBlock-ME5U3XNS.js +0 -7
- package/dist/MedicationEditor-Bp4NLy7y.d.cts +0 -352
- package/dist/MedicationEditor-Bp4NLy7y.d.ts +0 -352
- package/dist/MermaidBlock-2B6CPD6Y.js +0 -7
- package/dist/MermaidBlock-D2UC5M55.cjs +0 -16
- package/dist/SurveyBlock-4CD4AYMJ.cjs +0 -16
- package/dist/SurveyBlock-4DO62RBT.js +0 -7
- package/dist/chunk-22CYDCXA.js.map +0 -1
- package/dist/chunk-2YCERQWC.js.map +0 -1
- package/dist/chunk-3T7QGLNB.js.map +0 -1
- package/dist/chunk-5JJ2DAE4.js.map +0 -1
- package/dist/chunk-6HFFWEM3.cjs +0 -22
- package/dist/chunk-6HFFWEM3.cjs.map +0 -1
- package/dist/chunk-7ZDPD5ZX.cjs.map +0 -1
- package/dist/chunk-7ZVTLTJF.js +0 -109
- package/dist/chunk-7ZVTLTJF.js.map +0 -1
- package/dist/chunk-ACCAXVOG.js.map +0 -1
- package/dist/chunk-BMSG4NBH.js +0 -56
- package/dist/chunk-BMSG4NBH.js.map +0 -1
- package/dist/chunk-CEQJGUAS.js.map +0 -1
- package/dist/chunk-DVOQ3JNO.js.map +0 -1
- package/dist/chunk-E4IBHYJ7.cjs +0 -80
- package/dist/chunk-E4IBHYJ7.cjs.map +0 -1
- package/dist/chunk-ELPW32ZI.cjs.map +0 -1
- package/dist/chunk-GD7EBGC4.cjs.map +0 -1
- package/dist/chunk-GOALNQZ2.js.map +0 -1
- package/dist/chunk-HB7C7NB5.js +0 -20
- package/dist/chunk-HB7C7NB5.js.map +0 -1
- package/dist/chunk-HZ4MBUC3.js.map +0 -1
- package/dist/chunk-JEIW7BSV.cjs.map +0 -1
- package/dist/chunk-JHULS3EC.js +0 -130
- package/dist/chunk-JHULS3EC.js.map +0 -1
- package/dist/chunk-JI244Y7C.js.map +0 -1
- package/dist/chunk-JYZW2PZS.cjs.map +0 -1
- package/dist/chunk-KRU6IGV7.js.map +0 -1
- package/dist/chunk-NV2CWBI2.cjs.map +0 -1
- package/dist/chunk-OE5CKRUC.js.map +0 -1
- package/dist/chunk-P2CA3XGI.js.map +0 -1
- package/dist/chunk-P7UMS4E6.cjs.map +0 -1
- package/dist/chunk-SQHMGT4W.js.map +0 -1
- package/dist/chunk-SVSHA7XV.js.map +0 -1
- package/dist/chunk-U42F3HLE.cjs.map +0 -1
- package/dist/chunk-VKELAMAZ.js.map +0 -1
- package/dist/chunk-VNYW4C4J.cjs.map +0 -1
- package/dist/chunk-VOKVG3ER.js +0 -78
- package/dist/chunk-VOKVG3ER.js.map +0 -1
- package/dist/chunk-VPIYTQCV.cjs.map +0 -1
- package/dist/chunk-VPWJCJCX.cjs.map +0 -1
- package/dist/chunk-VROIMIHB.cjs.map +0 -1
- package/dist/chunk-WIAQQNFU.cjs.map +0 -1
- package/dist/chunk-WNAA6CLE.cjs +0 -143
- package/dist/chunk-WNAA6CLE.cjs.map +0 -1
- package/dist/chunk-WNJRS7Y7.cjs.map +0 -1
- package/dist/chunk-X4LBUPJO.cjs.map +0 -1
- package/dist/chunk-X4XPNTCZ.cjs.map +0 -1
- package/dist/chunk-XCP454Q6.js.map +0 -1
- package/dist/chunk-XEAT7XJG.cjs.map +0 -1
- package/dist/chunk-YVL3XATO.cjs +0 -79
- package/dist/chunk-YVL3XATO.cjs.map +0 -1
- package/dist/chunk-YVPC65ZJ.cjs.map +0 -1
- package/dist/html-MdxqSzjD.d.cts +0 -13
- package/dist/html-MdxqSzjD.d.ts +0 -13
- package/dist/orderRows-BUJYgSc7.d.cts +0 -221
- package/dist/orderRows-BUJYgSc7.d.ts +0 -221
- package/dist/transcript-Cg7uSW-C.d.cts +0 -84
- package/dist/transcript-Cg7uSW-C.d.ts +0 -84
- package/dist/types-B97JNRNQ.d.cts +0 -251
- package/dist/types-CnPEwzlp.d.cts +0 -254
- package/dist/types-CnPEwzlp.d.ts +0 -254
- package/dist/types-gZXrfLj6.d.ts +0 -251
- package/dist/useAnchoredPosition-CKwLSQW8.d.cts +0 -76
- package/dist/useAnchoredPosition-CKwLSQW8.d.ts +0 -76
- package/dist/useTheme-B9SWu6ui.d.cts +0 -24
- package/dist/useTheme-B9SWu6ui.d.ts +0 -24
- package/dist/useTranscriptEdits-CGzlemHT.d.cts +0 -182
- package/dist/useTranscriptEdits-D32bLs0l.d.ts +0 -182
|
@@ -1,418 +1,239 @@
|
|
|
1
1
|
import { TextRenderContext } from '../../chunk-I6CY5C6A.js';
|
|
2
2
|
export { TextRenderContext, useTextRenderContext } from '../../chunk-I6CY5C6A.js';
|
|
3
|
-
import { ChatBubble, MCPToolCallDisplay, AITypingIndicator, SparklesIcon, CloseIcon } from '../../chunk-
|
|
4
|
-
import { notifyComposerMigrationOnce, ChatComposer } from '../../chunk-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import '../../chunk-
|
|
3
|
+
import { ChatBubble, MCPToolCallDisplay, AITypingIndicator, SparklesIcon, ButtonGroup, CloseIcon, JumpToBottomButton } from '../../chunk-RM2HPQIC.js';
|
|
4
|
+
import { notifyComposerMigrationOnce, ChatComposer } from '../../chunk-OSTSZDQC.js';
|
|
5
|
+
import { MediaFeed } from '../../chunk-2X54ZLT6.js';
|
|
6
|
+
import '../../chunk-RISZWWEQ.js';
|
|
7
|
+
import { MediaPlayer } from '../../chunk-N54FYWG6.js';
|
|
8
|
+
import '../../chunk-AMYFRY7K.js';
|
|
9
|
+
import { Dropdown, DropdownSubmenu, DropdownItem } from '../../chunk-EEOGIGIA.js';
|
|
8
10
|
import '../../chunk-VVDE4CHU.js';
|
|
11
|
+
import '../../chunk-IQ4KQJAO.js';
|
|
12
|
+
import { useStickToBottom, useStreamEndedBelowFold } from '../../chunk-BM35CACB.js';
|
|
13
|
+
import '../../chunk-GW4RFJZ5.js';
|
|
14
|
+
import '../../chunk-H2Y7HZV5.js';
|
|
15
|
+
import '../../chunk-DVDT7TX7.js';
|
|
16
|
+
import { Avatar } from '../../chunk-TI3TQQ7F.js';
|
|
17
|
+
import '../../chunk-TWQSMUE6.js';
|
|
9
18
|
import '../../chunk-6NZXWKUE.js';
|
|
10
19
|
import '../../chunk-3IMM2PM4.js';
|
|
20
|
+
import '../../chunk-4SMSH4OY.js';
|
|
21
|
+
import '../../chunk-T4ME7QCT.js';
|
|
11
22
|
import '../../chunk-62ZOA6PX.js';
|
|
12
23
|
import '../../chunk-WSNMQQ4P.js';
|
|
13
|
-
import '../../chunk-
|
|
24
|
+
import '../../chunk-VSQF22GL.js';
|
|
14
25
|
import '../../chunk-BKSPDTX4.js';
|
|
15
|
-
import {
|
|
16
|
-
import '../../chunk-
|
|
26
|
+
import { usePrefersReducedMotion } from '../../chunk-XDU65GLW.js';
|
|
27
|
+
import { Badge } from '../../chunk-522WJIVI.js';
|
|
28
|
+
import '../../chunk-N5JDL4VE.js';
|
|
29
|
+
import { Button } from '../../chunk-WFBUBT54.js';
|
|
30
|
+
import '../../chunk-GVM6DTR5.js';
|
|
31
|
+
import { AnimatedPresence, Animated } from '../../chunk-F4N67NAF.js';
|
|
17
32
|
import { cn } from '../../chunk-TQONQSJO.js';
|
|
18
33
|
import '../../chunk-PX6F3LHL.js';
|
|
19
|
-
import * as
|
|
34
|
+
import * as React3 from 'react';
|
|
35
|
+
import { createElement } from 'react';
|
|
36
|
+
import { Ellipsis, Check, Clipboard, Pencil, Play, ArrowLeft } from 'lucide-react';
|
|
37
|
+
import { cva } from 'class-variance-authority';
|
|
38
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
20
39
|
import Markdown, { defaultUrlTransform } from 'react-markdown';
|
|
21
40
|
import remarkGfm from 'remark-gfm';
|
|
22
41
|
import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
|
|
23
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
24
|
-
import { cva } from 'class-variance-authority';
|
|
25
|
-
import { Ellipsis, Check, Clipboard, Pencil } from 'lucide-react';
|
|
26
42
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
27
43
|
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
function MessageMedia({
|
|
45
|
+
attachment,
|
|
46
|
+
onOpen,
|
|
47
|
+
openLabel,
|
|
48
|
+
playLabel,
|
|
49
|
+
errorLabel,
|
|
50
|
+
retryLabel,
|
|
51
|
+
launchId
|
|
52
|
+
}) {
|
|
53
|
+
const playable = attachment.kind !== "image";
|
|
54
|
+
const actionLabel = playable ? playLabel : openLabel;
|
|
55
|
+
return /* @__PURE__ */ jsxs(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "superchat-message-media",
|
|
59
|
+
className: "mt-3 flex w-72 max-w-full flex-col gap-2",
|
|
60
|
+
children: [
|
|
61
|
+
attachment.title && /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: attachment.title }),
|
|
62
|
+
attachment.kind === "image" && attachment.src ? /* @__PURE__ */ jsx(
|
|
63
|
+
"img",
|
|
64
|
+
{
|
|
65
|
+
src: attachment.src,
|
|
66
|
+
alt: attachment.alt ?? attachment.title ?? "",
|
|
67
|
+
loading: "lazy",
|
|
68
|
+
className: "max-h-72 w-full rounded-lg object-contain"
|
|
69
|
+
}
|
|
70
|
+
) : (attachment.kind === "video" || attachment.kind === "audio") && attachment.src ? (
|
|
71
|
+
// An opaque themed surface: the player's semi-transparent states
|
|
72
|
+
// (error, loading) must never compose onto a colored chat bubble.
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: "bg-background overflow-hidden rounded-lg", children: /* @__PURE__ */ jsx(
|
|
74
|
+
MediaPlayer,
|
|
75
|
+
{
|
|
76
|
+
src: attachment.src,
|
|
77
|
+
kind: attachment.kind,
|
|
78
|
+
poster: attachment.poster,
|
|
79
|
+
"aria-label": attachment.alt ?? attachment.title ?? openLabel,
|
|
80
|
+
controls: !onOpen,
|
|
81
|
+
preload: "metadata",
|
|
82
|
+
labels: { error: errorLabel, retry: retryLabel },
|
|
83
|
+
className: "max-h-72"
|
|
84
|
+
}
|
|
85
|
+
) })
|
|
86
|
+
) : attachment.poster ? /* @__PURE__ */ jsx(
|
|
87
|
+
"img",
|
|
88
|
+
{
|
|
89
|
+
src: attachment.poster,
|
|
90
|
+
alt: attachment.alt ?? attachment.title ?? "",
|
|
91
|
+
loading: "lazy",
|
|
92
|
+
className: "max-h-72 w-full rounded-lg object-contain"
|
|
93
|
+
}
|
|
94
|
+
) : null,
|
|
95
|
+
attachment.caption && /* @__PURE__ */ jsx("p", { className: "text-sm", children: attachment.caption }),
|
|
96
|
+
onOpen && /* @__PURE__ */ jsx(ButtonGroup, { children: /* @__PURE__ */ jsx(
|
|
97
|
+
Button,
|
|
98
|
+
{
|
|
99
|
+
"data-media-launch-id": launchId,
|
|
100
|
+
variant: "secondary",
|
|
101
|
+
size: "sm",
|
|
102
|
+
leftIcon: playable ? /* @__PURE__ */ jsx(Play, { className: "size-4", "aria-hidden": "true" }) : void 0,
|
|
103
|
+
"aria-label": playable && attachment.title ? `${playLabel} ${attachment.title}` : actionLabel,
|
|
104
|
+
onClick: () => onOpen(playable),
|
|
105
|
+
children: actionLabel
|
|
106
|
+
}
|
|
107
|
+
) })
|
|
108
|
+
]
|
|
43
109
|
}
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
return (tree) => splitNode(tree);
|
|
110
|
+
);
|
|
47
111
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const withoutClass = existing.filter(
|
|
54
|
-
(a) => !(Array.isArray(a) && a[0] === "className")
|
|
55
|
-
);
|
|
56
|
-
attributes[tag] = [...withoutClass, "className"];
|
|
57
|
-
};
|
|
58
|
-
allowClass("code");
|
|
59
|
-
allowClass("pre");
|
|
60
|
-
allowClass("span");
|
|
61
|
-
allowClass("div");
|
|
62
|
-
schema.attributes = attributes;
|
|
63
|
-
return schema;
|
|
112
|
+
function formatTime(time) {
|
|
113
|
+
return new Date(time).toLocaleTimeString(void 0, {
|
|
114
|
+
hour: "numeric",
|
|
115
|
+
minute: "2-digit"
|
|
116
|
+
});
|
|
64
117
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
118
|
+
function byTime(a, b) {
|
|
119
|
+
return new Date(a.time).getTime() - new Date(b.time).getTime();
|
|
120
|
+
}
|
|
121
|
+
function lastActivityOf(c) {
|
|
122
|
+
if (c.lastActivity) return new Date(c.lastActivity).getTime();
|
|
123
|
+
const last = lastMessageByTime(c.thread);
|
|
124
|
+
return last ? new Date(last.time).getTime() : 0;
|
|
125
|
+
}
|
|
126
|
+
function escapeRegExp(value) {
|
|
127
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
128
|
+
}
|
|
129
|
+
function detectMentions(text, participants) {
|
|
130
|
+
const ids = [];
|
|
131
|
+
for (const p of participants) {
|
|
132
|
+
if (p.kind === "system") continue;
|
|
133
|
+
const token = "@" + p.name.split(" ")[0];
|
|
134
|
+
const pattern = new RegExp(
|
|
135
|
+
`(?<![\\w@])${escapeRegExp(token)}(?![\\w])`,
|
|
136
|
+
"i"
|
|
137
|
+
);
|
|
138
|
+
if (pattern.test(text)) ids.push(p.id);
|
|
71
139
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
))
|
|
79
|
-
|
|
140
|
+
return ids;
|
|
141
|
+
}
|
|
142
|
+
function lastMessageByTime(thread) {
|
|
143
|
+
let latest;
|
|
144
|
+
let latestTime = -Infinity;
|
|
145
|
+
for (const message of thread) {
|
|
146
|
+
const t = new Date(message.time).getTime();
|
|
147
|
+
if (t >= latestTime) {
|
|
148
|
+
latest = message;
|
|
149
|
+
latestTime = t;
|
|
80
150
|
}
|
|
81
|
-
out.attributes = baseAttrs;
|
|
82
151
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
152
|
+
return latest;
|
|
153
|
+
}
|
|
154
|
+
function parseHexColor(value) {
|
|
155
|
+
const hex = value.trim();
|
|
156
|
+
if (!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(hex)) return null;
|
|
157
|
+
const normalized = hex.length === 4 ? "#" + [...hex.slice(1)].map((char) => char + char).join("") : hex;
|
|
158
|
+
return [1, 3, 5].map(
|
|
159
|
+
(start) => parseInt(normalized.slice(start, start + 2), 16)
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
function relativeLuminanceChannel(channel) {
|
|
163
|
+
const normalized = channel / 255;
|
|
164
|
+
return normalized <= 0.03928 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
165
|
+
}
|
|
166
|
+
function relativeLuminance(value) {
|
|
167
|
+
const rgb = parseHexColor(value);
|
|
168
|
+
if (!rgb) return null;
|
|
169
|
+
const [red, green, blue] = rgb;
|
|
170
|
+
return 0.2126 * relativeLuminanceChannel(red) + 0.7152 * relativeLuminanceChannel(green) + 0.0722 * relativeLuminanceChannel(blue);
|
|
171
|
+
}
|
|
172
|
+
function contrastRatio(foreground, background) {
|
|
173
|
+
const foregroundLuminance = relativeLuminance(foreground);
|
|
174
|
+
const backgroundLuminance = relativeLuminance(background);
|
|
175
|
+
if (foregroundLuminance === null || backgroundLuminance === null) return null;
|
|
176
|
+
const lighter = Math.max(foregroundLuminance, backgroundLuminance);
|
|
177
|
+
const darker = Math.min(foregroundLuminance, backgroundLuminance);
|
|
178
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
179
|
+
}
|
|
180
|
+
function minimumContrastRatio(value, backgrounds) {
|
|
181
|
+
const contrasts = backgrounds.map((background) => contrastRatio(value, background)).filter((contrast) => contrast !== null);
|
|
182
|
+
if (contrasts.length !== backgrounds.length) return null;
|
|
183
|
+
return Math.min(...contrasts);
|
|
184
|
+
}
|
|
185
|
+
function accessibleAccentTextColor(value) {
|
|
186
|
+
if (!value) return void 0;
|
|
187
|
+
const contrast = minimumContrastRatio(value, ["#f5f5f5", "#262626"]);
|
|
188
|
+
if (contrast === null) return value;
|
|
189
|
+
return contrast < 4.5 ? void 0 : value;
|
|
190
|
+
}
|
|
191
|
+
function ParticipantAvatar({
|
|
192
|
+
participant
|
|
193
|
+
}) {
|
|
194
|
+
const isAgent = participant?.kind === "agent";
|
|
195
|
+
const backgroundColor = participant?.color ?? (isAgent ? "var(--mieweb-primary-700, #1f2937)" : "#64748b");
|
|
196
|
+
return /* @__PURE__ */ jsx(
|
|
197
|
+
Avatar,
|
|
198
|
+
{
|
|
199
|
+
size: "xs",
|
|
200
|
+
src: participant?.avatar,
|
|
201
|
+
alt: "",
|
|
202
|
+
name: participant?.name ?? "?",
|
|
203
|
+
fallback: isAgent ? /* @__PURE__ */ jsx(SparklesIcon, { size: "sm" }) : void 0,
|
|
204
|
+
style: { backgroundColor },
|
|
205
|
+
"aria-hidden": "true",
|
|
206
|
+
className: "shrink-0"
|
|
93
207
|
}
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
for (const [k, v] of Object.entries(extra)) {
|
|
97
|
-
if (k === "tagNames" || k === "attributes" || k === "protocols") continue;
|
|
98
|
-
out[k] = v;
|
|
99
|
-
}
|
|
100
|
-
return out;
|
|
208
|
+
);
|
|
101
209
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
210
|
+
function ReferenceChip({
|
|
211
|
+
reference,
|
|
212
|
+
linkBuilder,
|
|
213
|
+
onReferenceClick
|
|
214
|
+
}) {
|
|
215
|
+
const href = linkBuilder?.(reference);
|
|
216
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
217
|
+
/* @__PURE__ */ jsx(
|
|
218
|
+
Badge,
|
|
106
219
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
),
|
|
112
|
-
target: props.target ?? "_blank",
|
|
113
|
-
rel: props.rel ?? "noopener noreferrer",
|
|
114
|
-
children
|
|
220
|
+
variant: "default",
|
|
221
|
+
size: "sm",
|
|
222
|
+
className: "rounded px-1.5 text-[10px] font-semibold tracking-wide uppercase",
|
|
223
|
+
children: reference.refType
|
|
115
224
|
}
|
|
116
225
|
),
|
|
117
|
-
|
|
118
|
-
|
|
226
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: reference.title })
|
|
227
|
+
] });
|
|
228
|
+
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";
|
|
229
|
+
if (href) {
|
|
230
|
+
return /* @__PURE__ */ jsx(
|
|
231
|
+
"a",
|
|
119
232
|
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
props.className
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
code: ({ node: _node, ...props }) => {
|
|
129
|
-
const isBlock = typeof props.className === "string" && props.className.includes("language-");
|
|
130
|
-
return /* @__PURE__ */ jsx(
|
|
131
|
-
"code",
|
|
132
|
-
{
|
|
133
|
-
...props,
|
|
134
|
-
className: cn(
|
|
135
|
-
!isBlock && "rounded bg-neutral-200 px-1 py-0.5 text-[0.85em] text-neutral-800 dark:bg-neutral-700 dark:text-neutral-100",
|
|
136
|
-
props.className
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
},
|
|
141
|
-
input: ({ node: _node, ...props }) => {
|
|
142
|
-
if (props.type === "checkbox") {
|
|
143
|
-
return /* @__PURE__ */ jsx(
|
|
144
|
-
"input",
|
|
145
|
-
{
|
|
146
|
-
...props,
|
|
147
|
-
"aria-label": props["aria-label"] ?? (props["aria-labelledby"] ? void 0 : "Task list item")
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
return /* @__PURE__ */ jsx("input", { ...props });
|
|
152
|
-
},
|
|
153
|
-
table: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("div", { className: "my-2 overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
154
|
-
"table",
|
|
155
|
-
{
|
|
156
|
-
...props,
|
|
157
|
-
className: cn(
|
|
158
|
-
"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-start dark:[&_th]:border-neutral-700",
|
|
159
|
-
props.className
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
) }),
|
|
163
|
-
// Tailwind's preflight resets list markers/padding; restore them explicitly
|
|
164
|
-
// so bullets/numbers show without depending on the typography plugin.
|
|
165
|
-
ul: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("ul", { ...props, className: cn("list-disc ps-5", props.className) }),
|
|
166
|
-
ol: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("ol", { ...props, className: cn("list-decimal ps-5", props.className) }),
|
|
167
|
-
li: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("li", { ...props, className: cn("ps-1", props.className) }),
|
|
168
|
-
// Preflight also flattens headings to body size/weight; restore a sensible
|
|
169
|
-
// hierarchy without depending on the typography plugin.
|
|
170
|
-
h1: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
171
|
-
"h1",
|
|
172
|
-
{
|
|
173
|
-
...props,
|
|
174
|
-
className: cn("mt-3 mb-1 text-xl font-semibold", props.className),
|
|
175
|
-
children
|
|
176
|
-
}
|
|
177
|
-
),
|
|
178
|
-
h2: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
179
|
-
"h2",
|
|
180
|
-
{
|
|
181
|
-
...props,
|
|
182
|
-
className: cn("mt-3 mb-1 text-lg font-semibold", props.className),
|
|
183
|
-
children
|
|
184
|
-
}
|
|
185
|
-
),
|
|
186
|
-
h3: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
187
|
-
"h3",
|
|
188
|
-
{
|
|
189
|
-
...props,
|
|
190
|
-
className: cn("mt-2 mb-1 text-base font-semibold", props.className),
|
|
191
|
-
children
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
h4: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
195
|
-
"h4",
|
|
196
|
-
{
|
|
197
|
-
...props,
|
|
198
|
-
className: cn("mt-2 mb-1 text-sm font-semibold", props.className),
|
|
199
|
-
children
|
|
200
|
-
}
|
|
201
|
-
),
|
|
202
|
-
h5: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
203
|
-
"h5",
|
|
204
|
-
{
|
|
205
|
-
...props,
|
|
206
|
-
className: cn("mt-2 mb-1 text-sm font-semibold", props.className),
|
|
207
|
-
children
|
|
208
|
-
}
|
|
209
|
-
),
|
|
210
|
-
h6: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
211
|
-
"h6",
|
|
212
|
-
{
|
|
213
|
-
...props,
|
|
214
|
-
className: cn(
|
|
215
|
-
"mt-2 mb-1 text-xs font-semibold tracking-wide uppercase",
|
|
216
|
-
props.className
|
|
217
|
-
),
|
|
218
|
-
children
|
|
219
|
-
}
|
|
220
|
-
),
|
|
221
|
-
hr: ({ node: _node, ...props }) => /* @__PURE__ */ jsx(
|
|
222
|
-
"hr",
|
|
223
|
-
{
|
|
224
|
-
...props,
|
|
225
|
-
className: cn(
|
|
226
|
-
"my-2 border-neutral-300 dark:border-neutral-600",
|
|
227
|
-
props.className
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
)
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function createMarkdownRenderer(options = {}) {
|
|
234
|
-
const { plugins = [], trusted = false } = options;
|
|
235
|
-
const remarkPlugins = [
|
|
236
|
-
remarkGfm,
|
|
237
|
-
remarkPreserveLineBreaks,
|
|
238
|
-
...plugins.flatMap((p) => p.remarkPlugins ?? [])
|
|
239
|
-
];
|
|
240
|
-
const pluginRehype = plugins.flatMap(
|
|
241
|
-
(p) => p.rehypePlugins ?? []
|
|
242
|
-
);
|
|
243
|
-
const sanitizeSchema = plugins.reduce(
|
|
244
|
-
(acc, p) => mergeSanitizeSchema(acc, p.sanitizeSchema),
|
|
245
|
-
baseSanitizeSchema()
|
|
246
|
-
);
|
|
247
|
-
const rehypePlugins = trusted ? pluginRehype : [...pluginRehype, [rehypeSanitize, sanitizeSchema]];
|
|
248
|
-
const components = plugins.reduce(
|
|
249
|
-
(acc, p) => ({ ...acc, ...p.components }),
|
|
250
|
-
baseComponents()
|
|
251
|
-
);
|
|
252
|
-
const MarkdownRenderer = (text, ctx) => /* @__PURE__ */ jsx(
|
|
253
|
-
MarkdownContent,
|
|
254
|
-
{
|
|
255
|
-
text,
|
|
256
|
-
messageId: ctx.messageId,
|
|
257
|
-
streaming: ctx.streaming,
|
|
258
|
-
remarkPlugins,
|
|
259
|
-
rehypePlugins,
|
|
260
|
-
components
|
|
261
|
-
},
|
|
262
|
-
ctx.messageId
|
|
263
|
-
);
|
|
264
|
-
return MarkdownRenderer;
|
|
265
|
-
}
|
|
266
|
-
var transformUrl = (url, key, node) => {
|
|
267
|
-
if (key === "src" && node.tagName === "img" && (/^data:image\//i.test(url) || /^blob:/i.test(url))) {
|
|
268
|
-
return url;
|
|
269
|
-
}
|
|
270
|
-
return defaultUrlTransform(url);
|
|
271
|
-
};
|
|
272
|
-
var MarkdownContent = React2.memo(function MarkdownContent2({
|
|
273
|
-
text,
|
|
274
|
-
messageId,
|
|
275
|
-
streaming,
|
|
276
|
-
remarkPlugins,
|
|
277
|
-
rehypePlugins,
|
|
278
|
-
components
|
|
279
|
-
}) {
|
|
280
|
-
return /* @__PURE__ */ jsx(TextRenderContext.Provider, { value: { messageId, streaming }, children: /* @__PURE__ */ jsx(
|
|
281
|
-
Markdown,
|
|
282
|
-
{
|
|
283
|
-
remarkPlugins,
|
|
284
|
-
rehypePlugins,
|
|
285
|
-
urlTransform: transformUrl,
|
|
286
|
-
components,
|
|
287
|
-
children: text
|
|
288
|
-
}
|
|
289
|
-
) });
|
|
290
|
-
});
|
|
291
|
-
function formatTime(time) {
|
|
292
|
-
return new Date(time).toLocaleTimeString(void 0, {
|
|
293
|
-
hour: "numeric",
|
|
294
|
-
minute: "2-digit"
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function byTime(a, b) {
|
|
298
|
-
return new Date(a.time).getTime() - new Date(b.time).getTime();
|
|
299
|
-
}
|
|
300
|
-
function lastActivityOf(c) {
|
|
301
|
-
if (c.lastActivity) return new Date(c.lastActivity).getTime();
|
|
302
|
-
const last = lastMessageByTime(c.thread);
|
|
303
|
-
return last ? new Date(last.time).getTime() : 0;
|
|
304
|
-
}
|
|
305
|
-
function escapeRegExp(value) {
|
|
306
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
307
|
-
}
|
|
308
|
-
function detectMentions(text, participants) {
|
|
309
|
-
const ids = [];
|
|
310
|
-
for (const p of participants) {
|
|
311
|
-
if (p.kind === "system") continue;
|
|
312
|
-
const token = "@" + p.name.split(" ")[0];
|
|
313
|
-
const pattern = new RegExp(
|
|
314
|
-
`(?<![\\w@])${escapeRegExp(token)}(?![\\w])`,
|
|
315
|
-
"i"
|
|
316
|
-
);
|
|
317
|
-
if (pattern.test(text)) ids.push(p.id);
|
|
318
|
-
}
|
|
319
|
-
return ids;
|
|
320
|
-
}
|
|
321
|
-
function lastMessageByTime(thread) {
|
|
322
|
-
let latest;
|
|
323
|
-
let latestTime = -Infinity;
|
|
324
|
-
for (const message of thread) {
|
|
325
|
-
const t = new Date(message.time).getTime();
|
|
326
|
-
if (t >= latestTime) {
|
|
327
|
-
latest = message;
|
|
328
|
-
latestTime = t;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
return latest;
|
|
332
|
-
}
|
|
333
|
-
function parseHexColor(value) {
|
|
334
|
-
const hex = value.trim();
|
|
335
|
-
if (!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(hex)) return null;
|
|
336
|
-
const normalized = hex.length === 4 ? "#" + [...hex.slice(1)].map((char) => char + char).join("") : hex;
|
|
337
|
-
return [1, 3, 5].map(
|
|
338
|
-
(start) => parseInt(normalized.slice(start, start + 2), 16)
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
function relativeLuminanceChannel(channel) {
|
|
342
|
-
const normalized = channel / 255;
|
|
343
|
-
return normalized <= 0.03928 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
344
|
-
}
|
|
345
|
-
function relativeLuminance(value) {
|
|
346
|
-
const rgb = parseHexColor(value);
|
|
347
|
-
if (!rgb) return null;
|
|
348
|
-
const [red, green, blue] = rgb;
|
|
349
|
-
return 0.2126 * relativeLuminanceChannel(red) + 0.7152 * relativeLuminanceChannel(green) + 0.0722 * relativeLuminanceChannel(blue);
|
|
350
|
-
}
|
|
351
|
-
function contrastRatio(foreground, background) {
|
|
352
|
-
const foregroundLuminance = relativeLuminance(foreground);
|
|
353
|
-
const backgroundLuminance = relativeLuminance(background);
|
|
354
|
-
if (foregroundLuminance === null || backgroundLuminance === null) return null;
|
|
355
|
-
const lighter = Math.max(foregroundLuminance, backgroundLuminance);
|
|
356
|
-
const darker = Math.min(foregroundLuminance, backgroundLuminance);
|
|
357
|
-
return (lighter + 0.05) / (darker + 0.05);
|
|
358
|
-
}
|
|
359
|
-
function minimumContrastRatio(value, backgrounds) {
|
|
360
|
-
const contrasts = backgrounds.map((background) => contrastRatio(value, background)).filter((contrast) => contrast !== null);
|
|
361
|
-
if (contrasts.length !== backgrounds.length) return null;
|
|
362
|
-
return Math.min(...contrasts);
|
|
363
|
-
}
|
|
364
|
-
function accessibleAccentTextColor(value) {
|
|
365
|
-
if (!value) return void 0;
|
|
366
|
-
const contrast = minimumContrastRatio(value, ["#f5f5f5", "#262626"]);
|
|
367
|
-
if (contrast === null) return value;
|
|
368
|
-
return contrast < 4.5 ? void 0 : value;
|
|
369
|
-
}
|
|
370
|
-
function ParticipantAvatar({
|
|
371
|
-
participant
|
|
372
|
-
}) {
|
|
373
|
-
const isAgent = participant?.kind === "agent";
|
|
374
|
-
const backgroundColor = participant?.color ?? (isAgent ? "var(--mieweb-primary-700, #1f2937)" : "#64748b");
|
|
375
|
-
return /* @__PURE__ */ jsx(
|
|
376
|
-
Avatar,
|
|
377
|
-
{
|
|
378
|
-
size: "xs",
|
|
379
|
-
src: participant?.avatar,
|
|
380
|
-
alt: "",
|
|
381
|
-
name: participant?.name ?? "?",
|
|
382
|
-
fallback: isAgent ? /* @__PURE__ */ jsx(SparklesIcon, { size: "sm" }) : void 0,
|
|
383
|
-
style: { backgroundColor },
|
|
384
|
-
"aria-hidden": "true",
|
|
385
|
-
className: "shrink-0"
|
|
386
|
-
}
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
function ReferenceChip({
|
|
390
|
-
reference,
|
|
391
|
-
linkBuilder,
|
|
392
|
-
onReferenceClick
|
|
393
|
-
}) {
|
|
394
|
-
const href = linkBuilder?.(reference);
|
|
395
|
-
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
396
|
-
/* @__PURE__ */ jsx(
|
|
397
|
-
Badge,
|
|
398
|
-
{
|
|
399
|
-
variant: "default",
|
|
400
|
-
size: "sm",
|
|
401
|
-
className: "rounded px-1.5 text-[10px] font-semibold tracking-wide uppercase",
|
|
402
|
-
children: reference.refType
|
|
403
|
-
}
|
|
404
|
-
),
|
|
405
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: reference.title })
|
|
406
|
-
] });
|
|
407
|
-
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";
|
|
408
|
-
if (href) {
|
|
409
|
-
return /* @__PURE__ */ jsx(
|
|
410
|
-
"a",
|
|
411
|
-
{
|
|
412
|
-
href,
|
|
413
|
-
className,
|
|
414
|
-
onClick: () => onReferenceClick?.(reference),
|
|
415
|
-
children: content
|
|
233
|
+
href,
|
|
234
|
+
className,
|
|
235
|
+
onClick: () => onReferenceClick?.(reference),
|
|
236
|
+
children: content
|
|
416
237
|
}
|
|
417
238
|
);
|
|
418
239
|
}
|
|
@@ -472,11 +293,11 @@ function useMessageCopy({
|
|
|
472
293
|
getText,
|
|
473
294
|
defaultFormat
|
|
474
295
|
}) {
|
|
475
|
-
const [copied, setCopied] =
|
|
476
|
-
const copiedTimer =
|
|
296
|
+
const [copied, setCopied] = React3.useState(false);
|
|
297
|
+
const copiedTimer = React3.useRef(
|
|
477
298
|
void 0
|
|
478
299
|
);
|
|
479
|
-
|
|
300
|
+
React3.useEffect(() => () => window.clearTimeout(copiedTimer.current), []);
|
|
480
301
|
const flash = () => {
|
|
481
302
|
setCopied(true);
|
|
482
303
|
window.clearTimeout(copiedTimer.current);
|
|
@@ -529,7 +350,7 @@ function FooterActionButton({
|
|
|
529
350
|
action,
|
|
530
351
|
isSelf
|
|
531
352
|
}) {
|
|
532
|
-
const [open, setOpen] =
|
|
353
|
+
const [open, setOpen] = React3.useState(false);
|
|
533
354
|
const onClickCapture = action.submenu ? (e) => {
|
|
534
355
|
if (e.metaKey || e.ctrlKey) {
|
|
535
356
|
e.preventDefault();
|
|
@@ -572,17 +393,13 @@ function FooterActionButton({
|
|
|
572
393
|
}
|
|
573
394
|
);
|
|
574
395
|
}
|
|
575
|
-
var MessageActionsBar =
|
|
396
|
+
var MessageActionsBar = React3.forwardRef(function MessageActionsBar2({ actions, isSelf }, ref) {
|
|
576
397
|
return /* @__PURE__ */ jsx(
|
|
577
398
|
"div",
|
|
578
399
|
{
|
|
579
400
|
ref,
|
|
580
401
|
"data-slot": "superchat-message-actions",
|
|
581
|
-
className: cn(
|
|
582
|
-
"flex items-center gap-0.5",
|
|
583
|
-
isSelf && "justify-end",
|
|
584
|
-
actionRevealClass
|
|
585
|
-
),
|
|
402
|
+
className: cn("flex flex-col items-center gap-0.5", actionRevealClass),
|
|
586
403
|
children: actions.map((action) => /* @__PURE__ */ jsx(FooterActionButton, { action, isSelf }, action.id))
|
|
587
404
|
}
|
|
588
405
|
);
|
|
@@ -592,7 +409,7 @@ function MessageOverflowMenu({
|
|
|
592
409
|
actions,
|
|
593
410
|
footerVisible
|
|
594
411
|
}) {
|
|
595
|
-
const [open, setOpen] =
|
|
412
|
+
const [open, setOpen] = React3.useState(false);
|
|
596
413
|
const select = (fn) => {
|
|
597
414
|
setOpen(false);
|
|
598
415
|
fn();
|
|
@@ -601,7 +418,7 @@ function MessageOverflowMenu({
|
|
|
601
418
|
"div",
|
|
602
419
|
{
|
|
603
420
|
className: cn(
|
|
604
|
-
"sticky bottom-2 shrink-0
|
|
421
|
+
"sticky bottom-2 mt-auto shrink-0 transition-opacity",
|
|
605
422
|
// Rich content (e.g. NITRO tables) layers internals up to z-50, so the
|
|
606
423
|
// open menu's stacking context must clear that.
|
|
607
424
|
open ? "z-[60]" : "z-10",
|
|
@@ -645,7 +462,7 @@ function MessageOverflowMenu({
|
|
|
645
462
|
}
|
|
646
463
|
);
|
|
647
464
|
}
|
|
648
|
-
var MessageRow =
|
|
465
|
+
var MessageRow = React3.memo(function MessageRow2({
|
|
649
466
|
message,
|
|
650
467
|
participant,
|
|
651
468
|
isSelf,
|
|
@@ -654,21 +471,27 @@ var MessageRow = React2.memo(function MessageRow2({
|
|
|
654
471
|
onReferenceClick,
|
|
655
472
|
editable,
|
|
656
473
|
onMessageEdited,
|
|
657
|
-
defaultCopyFormat = "rich"
|
|
474
|
+
defaultCopyFormat = "rich",
|
|
475
|
+
onOpenMedia,
|
|
476
|
+
openMediaLabel = "Open in media feed",
|
|
477
|
+
playMediaLabel = "Play",
|
|
478
|
+
mediaErrorLabel,
|
|
479
|
+
mediaRetryLabel
|
|
658
480
|
}) {
|
|
659
481
|
const streaming = message.status === "streaming";
|
|
660
|
-
const hasBody = !!message.text || (message.content?.length ?? 0) > 0;
|
|
661
|
-
const [isEditing, setIsEditing] =
|
|
662
|
-
const [draft, setDraft] =
|
|
663
|
-
const
|
|
664
|
-
const
|
|
665
|
-
const
|
|
482
|
+
const hasBody = !!message.text || (message.content?.length ?? 0) > 0 || (message.media?.length ?? 0) > 0;
|
|
483
|
+
const [isEditing, setIsEditing] = React3.useState(false);
|
|
484
|
+
const [draft, setDraft] = React3.useState(message.text ?? "");
|
|
485
|
+
const [editMinWidth, setEditMinWidth] = React3.useState();
|
|
486
|
+
const editRef = React3.useRef(null);
|
|
487
|
+
const bubbleRef = React3.useRef(null);
|
|
488
|
+
const autosize = React3.useCallback(() => {
|
|
666
489
|
const el = editRef.current;
|
|
667
490
|
if (!el) return;
|
|
668
491
|
el.style.height = "auto";
|
|
669
492
|
el.style.height = `${el.scrollHeight}px`;
|
|
670
493
|
}, []);
|
|
671
|
-
|
|
494
|
+
React3.useEffect(() => {
|
|
672
495
|
if (!isEditing) return;
|
|
673
496
|
const el = editRef.current;
|
|
674
497
|
if (!el) return;
|
|
@@ -683,337 +506,662 @@ var MessageRow = React2.memo(function MessageRow2({
|
|
|
683
506
|
${block.text}
|
|
684
507
|
\`\`\``;
|
|
685
508
|
}
|
|
686
|
-
if ((block.type === "text" || block.type === "thinking") && block.text) {
|
|
687
|
-
return block.text;
|
|
509
|
+
if ((block.type === "text" || block.type === "thinking") && block.text) {
|
|
510
|
+
return block.text;
|
|
511
|
+
}
|
|
512
|
+
return "";
|
|
513
|
+
}).filter(Boolean).join("\n\n") ?? "";
|
|
514
|
+
const canCopy = !isEditing && (!!message.content?.length || typeof message.text === "string" && message.text.length > 0);
|
|
515
|
+
const showEditAction = canEdit && !isEditing;
|
|
516
|
+
const actionCount = (canCopy ? 1 : 0) + (showEditAction ? 1 : 0);
|
|
517
|
+
const hasActions = actionCount > 0;
|
|
518
|
+
const collapseToMenu = actionCount > 1;
|
|
519
|
+
const copy = useMessageCopy({
|
|
520
|
+
markdown: markdownSource,
|
|
521
|
+
getHtml: () => bubbleRef.current?.innerHTML ?? "",
|
|
522
|
+
getText: () => bubbleRef.current?.textContent ?? "",
|
|
523
|
+
defaultFormat: defaultCopyFormat
|
|
524
|
+
});
|
|
525
|
+
const actionsBarRef = React3.useRef(null);
|
|
526
|
+
const [footerVisible, setFooterVisible] = React3.useState(true);
|
|
527
|
+
React3.useEffect(() => {
|
|
528
|
+
const el = actionsBarRef.current;
|
|
529
|
+
if (!el || typeof globalThis.IntersectionObserver === "undefined") return;
|
|
530
|
+
const observer = new globalThis.IntersectionObserver(([entry]) => {
|
|
531
|
+
setFooterVisible(entry?.isIntersecting ?? false);
|
|
532
|
+
});
|
|
533
|
+
observer.observe(el);
|
|
534
|
+
return () => observer.disconnect();
|
|
535
|
+
}, [hasActions, collapseToMenu]);
|
|
536
|
+
if (message.type === "system") {
|
|
537
|
+
return /* @__PURE__ */ jsx(
|
|
538
|
+
"div",
|
|
539
|
+
{
|
|
540
|
+
"data-slot": "superchat-system-message",
|
|
541
|
+
role: "status",
|
|
542
|
+
className: "my-1 text-center text-xs text-neutral-500 dark:text-neutral-400",
|
|
543
|
+
children: message.text
|
|
544
|
+
}
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
if (message.type === "ref" && message.ref) {
|
|
548
|
+
return /* @__PURE__ */ jsx(
|
|
549
|
+
"div",
|
|
550
|
+
{
|
|
551
|
+
"data-slot": "superchat-reference",
|
|
552
|
+
className: cn("flex", isSelf && "justify-end"),
|
|
553
|
+
children: /* @__PURE__ */ jsx(
|
|
554
|
+
ReferenceChip,
|
|
555
|
+
{
|
|
556
|
+
reference: message.ref,
|
|
557
|
+
linkBuilder,
|
|
558
|
+
onReferenceClick
|
|
559
|
+
}
|
|
560
|
+
)
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
const accent = participant?.color;
|
|
565
|
+
const accentTextColor = accessibleAccentTextColor(accent);
|
|
566
|
+
const authorName = participant?.name ?? "Unknown";
|
|
567
|
+
const startEdit = () => {
|
|
568
|
+
const el = bubbleRef.current;
|
|
569
|
+
if (el) {
|
|
570
|
+
const cs = getComputedStyle(el);
|
|
571
|
+
const contentWidth = el.clientWidth - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight);
|
|
572
|
+
setEditMinWidth(contentWidth > 0 ? contentWidth : void 0);
|
|
573
|
+
}
|
|
574
|
+
setDraft(message.text ?? "");
|
|
575
|
+
setIsEditing(true);
|
|
576
|
+
};
|
|
577
|
+
const cancelEdit = () => setIsEditing(false);
|
|
578
|
+
const saveEdit = () => {
|
|
579
|
+
const next = draft.trim();
|
|
580
|
+
if (next && next !== message.text) onMessageEdited?.(message.id, next);
|
|
581
|
+
setIsEditing(false);
|
|
582
|
+
};
|
|
583
|
+
const handleEditPaste = (e) => {
|
|
584
|
+
const files = Array.from(e.clipboardData.items).filter((item) => item.kind === "file" && item.type.startsWith("image/")).map((item) => item.getAsFile()).filter((f) => f !== null);
|
|
585
|
+
if (files.length === 0) return;
|
|
586
|
+
e.preventDefault();
|
|
587
|
+
const el = e.currentTarget;
|
|
588
|
+
const start = el.selectionStart ?? draft.length;
|
|
589
|
+
const end = el.selectionEnd ?? draft.length;
|
|
590
|
+
Promise.all(
|
|
591
|
+
files.map(
|
|
592
|
+
(file, i) => new Promise((resolve) => {
|
|
593
|
+
const reader = new window.FileReader();
|
|
594
|
+
reader.onload = () => {
|
|
595
|
+
const dataUrl = typeof reader.result === "string" ? reader.result : "";
|
|
596
|
+
const name = file.name || `pasted-image-${i + 1}.png`;
|
|
597
|
+
resolve(dataUrl ? `` : "");
|
|
598
|
+
};
|
|
599
|
+
reader.readAsDataURL(file);
|
|
600
|
+
})
|
|
601
|
+
)
|
|
602
|
+
).then((snippets) => {
|
|
603
|
+
const insert = snippets.filter(Boolean).join("\n");
|
|
604
|
+
if (!insert) return;
|
|
605
|
+
el.focus();
|
|
606
|
+
el.setSelectionRange(start, end);
|
|
607
|
+
const text = `${insert}
|
|
608
|
+
`;
|
|
609
|
+
const inserted = typeof document !== "undefined" && typeof document.execCommand === "function" && document.execCommand("insertText", false, text);
|
|
610
|
+
if (!inserted) {
|
|
611
|
+
setDraft((prev) => `${prev.slice(0, start)}${text}${prev.slice(end)}`);
|
|
612
|
+
}
|
|
613
|
+
requestAnimationFrame(autosize);
|
|
614
|
+
});
|
|
615
|
+
};
|
|
616
|
+
const actions = [
|
|
617
|
+
...canCopy ? [
|
|
618
|
+
{
|
|
619
|
+
id: "copy",
|
|
620
|
+
label: "Copy message",
|
|
621
|
+
title: "Copy message (\u2318/Ctrl-click: default format)",
|
|
622
|
+
icon: copy.copied ? /* @__PURE__ */ jsx(Check, { size: 14, "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Clipboard, { size: 14, "aria-hidden": "true" }),
|
|
623
|
+
onSelect: copy.copyDefault,
|
|
624
|
+
submenu: {
|
|
625
|
+
label: "Copy as",
|
|
626
|
+
items: [
|
|
627
|
+
{
|
|
628
|
+
id: "copy-rich",
|
|
629
|
+
label: "Copy as rich text",
|
|
630
|
+
description: "Rich text + Markdown",
|
|
631
|
+
onSelect: copy.copyRich
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
id: "copy-markdown",
|
|
635
|
+
label: "Copy as Markdown",
|
|
636
|
+
onSelect: copy.copyMarkdown
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
id: "copy-plain",
|
|
640
|
+
label: "Copy as plain text",
|
|
641
|
+
onSelect: copy.copyPlain
|
|
642
|
+
}
|
|
643
|
+
]
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
] : [],
|
|
647
|
+
...showEditAction ? [
|
|
648
|
+
{
|
|
649
|
+
id: "edit",
|
|
650
|
+
label: "Edit message",
|
|
651
|
+
icon: /* @__PURE__ */ jsx(Pencil, { size: 14, "aria-hidden": "true" }),
|
|
652
|
+
onSelect: startEdit
|
|
653
|
+
}
|
|
654
|
+
] : []
|
|
655
|
+
];
|
|
656
|
+
return /* @__PURE__ */ jsxs(
|
|
657
|
+
"div",
|
|
658
|
+
{
|
|
659
|
+
"data-slot": "superchat-message",
|
|
660
|
+
role: "article",
|
|
661
|
+
"aria-label": `${authorName}, ${formatTime(message.time)}`,
|
|
662
|
+
className: cn(
|
|
663
|
+
"group flex gap-2",
|
|
664
|
+
isSelf ? "flex-row-reverse" : "flex-row"
|
|
665
|
+
),
|
|
666
|
+
children: [
|
|
667
|
+
/* @__PURE__ */ jsxs(
|
|
668
|
+
"div",
|
|
669
|
+
{
|
|
670
|
+
"data-slot": "superchat-message-gutter",
|
|
671
|
+
className: "flex shrink-0 flex-col items-center gap-1",
|
|
672
|
+
children: [
|
|
673
|
+
/* @__PURE__ */ jsx(ParticipantAvatar, { participant }),
|
|
674
|
+
hasActions && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
675
|
+
/* @__PURE__ */ jsx(
|
|
676
|
+
MessageOverflowMenu,
|
|
677
|
+
{
|
|
678
|
+
isSelf,
|
|
679
|
+
actions,
|
|
680
|
+
footerVisible: collapseToMenu ? false : footerVisible
|
|
681
|
+
}
|
|
682
|
+
),
|
|
683
|
+
!collapseToMenu && /* @__PURE__ */ jsx(
|
|
684
|
+
MessageActionsBar,
|
|
685
|
+
{
|
|
686
|
+
ref: actionsBarRef,
|
|
687
|
+
actions,
|
|
688
|
+
isSelf
|
|
689
|
+
}
|
|
690
|
+
)
|
|
691
|
+
] })
|
|
692
|
+
]
|
|
693
|
+
}
|
|
694
|
+
),
|
|
695
|
+
/* @__PURE__ */ jsxs(
|
|
696
|
+
"div",
|
|
697
|
+
{
|
|
698
|
+
className: cn(
|
|
699
|
+
"flex min-w-0 flex-1 flex-col gap-1",
|
|
700
|
+
isSelf && "items-end"
|
|
701
|
+
),
|
|
702
|
+
children: [
|
|
703
|
+
/* @__PURE__ */ jsxs(
|
|
704
|
+
"div",
|
|
705
|
+
{
|
|
706
|
+
"data-slot": "superchat-message-meta",
|
|
707
|
+
className: "flex items-baseline gap-2",
|
|
708
|
+
children: [
|
|
709
|
+
/* @__PURE__ */ jsx(
|
|
710
|
+
"span",
|
|
711
|
+
{
|
|
712
|
+
className: "text-xs font-medium",
|
|
713
|
+
style: accentTextColor ? { color: accentTextColor } : void 0,
|
|
714
|
+
children: authorName
|
|
715
|
+
}
|
|
716
|
+
),
|
|
717
|
+
participant?.role && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: participant.role }),
|
|
718
|
+
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: formatTime(message.time) }),
|
|
719
|
+
message.editedAt && /* @__PURE__ */ jsx(
|
|
720
|
+
"span",
|
|
721
|
+
{
|
|
722
|
+
"data-slot": "superchat-edited-indicator",
|
|
723
|
+
className: "text-[10px] text-neutral-500 dark:text-neutral-400",
|
|
724
|
+
title: `Edited ${formatTime(message.editedAt)}`,
|
|
725
|
+
children: "(edited)"
|
|
726
|
+
}
|
|
727
|
+
)
|
|
728
|
+
]
|
|
729
|
+
}
|
|
730
|
+
),
|
|
731
|
+
/* @__PURE__ */ jsx(
|
|
732
|
+
"div",
|
|
733
|
+
{
|
|
734
|
+
className: cn(
|
|
735
|
+
"flex w-full items-center gap-1",
|
|
736
|
+
isSelf ? "flex-row-reverse" : "flex-row"
|
|
737
|
+
),
|
|
738
|
+
children: /* @__PURE__ */ jsx(
|
|
739
|
+
ChatBubble,
|
|
740
|
+
{
|
|
741
|
+
ref: bubbleRef,
|
|
742
|
+
"data-slot": "superchat-bubble",
|
|
743
|
+
variant: isSelf ? "user" : "assistant",
|
|
744
|
+
hasError: message.status === "error",
|
|
745
|
+
className: "text-sm has-[[data-slot=superchat-nitro-table]]:w-full has-[[data-slot=superchat-nitro-table]]:max-w-full",
|
|
746
|
+
children: isEditing ? /* @__PURE__ */ jsxs(
|
|
747
|
+
"div",
|
|
748
|
+
{
|
|
749
|
+
"data-slot": "superchat-message-editor",
|
|
750
|
+
className: "flex w-80 max-w-full flex-col gap-2",
|
|
751
|
+
style: editMinWidth ? { minWidth: editMinWidth } : void 0,
|
|
752
|
+
children: [
|
|
753
|
+
/* @__PURE__ */ jsx(
|
|
754
|
+
"textarea",
|
|
755
|
+
{
|
|
756
|
+
value: draft,
|
|
757
|
+
ref: editRef,
|
|
758
|
+
rows: 2,
|
|
759
|
+
onChange: (e) => {
|
|
760
|
+
setDraft(e.target.value);
|
|
761
|
+
autosize();
|
|
762
|
+
},
|
|
763
|
+
onPaste: handleEditPaste,
|
|
764
|
+
onKeyDown: (e) => {
|
|
765
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
766
|
+
e.preventDefault();
|
|
767
|
+
saveEdit();
|
|
768
|
+
} else if (e.key === "Escape") {
|
|
769
|
+
e.preventDefault();
|
|
770
|
+
cancelEdit();
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
"aria-label": "Edit message",
|
|
774
|
+
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"
|
|
775
|
+
}
|
|
776
|
+
),
|
|
777
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
778
|
+
/* @__PURE__ */ jsx(
|
|
779
|
+
"button",
|
|
780
|
+
{
|
|
781
|
+
type: "button",
|
|
782
|
+
onClick: cancelEdit,
|
|
783
|
+
className: "rounded-md px-2.5 py-1 text-xs font-medium text-neutral-200 hover:bg-white/10",
|
|
784
|
+
children: "Cancel"
|
|
785
|
+
}
|
|
786
|
+
),
|
|
787
|
+
/* @__PURE__ */ jsx(
|
|
788
|
+
"button",
|
|
789
|
+
{
|
|
790
|
+
type: "button",
|
|
791
|
+
onClick: saveEdit,
|
|
792
|
+
disabled: !draft.trim() || draft.trim() === message.text,
|
|
793
|
+
className: "rounded-md bg-white px-2.5 py-1 text-xs font-medium text-neutral-900 hover:bg-neutral-100 disabled:opacity-40",
|
|
794
|
+
children: "Save"
|
|
795
|
+
}
|
|
796
|
+
)
|
|
797
|
+
] })
|
|
798
|
+
]
|
|
799
|
+
}
|
|
800
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
801
|
+
message.content?.map((block, i) => {
|
|
802
|
+
if (block.type === "tool_use" && block.toolCall) {
|
|
803
|
+
return /* @__PURE__ */ jsx(MCPToolCallDisplay, { toolCall: block.toolCall }, i);
|
|
804
|
+
}
|
|
805
|
+
if ((block.type === "text" || block.type === "thinking") && block.text) {
|
|
806
|
+
return /* @__PURE__ */ jsx(
|
|
807
|
+
"div",
|
|
808
|
+
{
|
|
809
|
+
className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
|
|
810
|
+
children: renderText(block.text, {
|
|
811
|
+
messageId: message.id,
|
|
812
|
+
streaming,
|
|
813
|
+
role: participant?.kind === "human" ? "user" : "assistant"
|
|
814
|
+
})
|
|
815
|
+
},
|
|
816
|
+
i
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
if (block.type === "code" && block.text) {
|
|
820
|
+
const fenced = `\`\`\`${block.language ?? ""}
|
|
821
|
+
${block.text}
|
|
822
|
+
\`\`\``;
|
|
823
|
+
return /* @__PURE__ */ jsx(
|
|
824
|
+
"div",
|
|
825
|
+
{
|
|
826
|
+
className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
|
|
827
|
+
children: renderText(fenced, {
|
|
828
|
+
messageId: message.id,
|
|
829
|
+
streaming,
|
|
830
|
+
role: participant?.kind === "human" ? "user" : "assistant"
|
|
831
|
+
})
|
|
832
|
+
},
|
|
833
|
+
i
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
return null;
|
|
837
|
+
}),
|
|
838
|
+
message.text && /* @__PURE__ */ jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word", children: renderText(message.text, {
|
|
839
|
+
messageId: message.id,
|
|
840
|
+
streaming,
|
|
841
|
+
role: participant?.kind === "human" ? "user" : "assistant"
|
|
842
|
+
}) }),
|
|
843
|
+
message.media?.map((attachment) => /* @__PURE__ */ jsx(
|
|
844
|
+
MessageMedia,
|
|
845
|
+
{
|
|
846
|
+
attachment,
|
|
847
|
+
openLabel: openMediaLabel,
|
|
848
|
+
playLabel: playMediaLabel,
|
|
849
|
+
errorLabel: mediaErrorLabel,
|
|
850
|
+
retryLabel: mediaRetryLabel,
|
|
851
|
+
launchId: JSON.stringify([message.id, attachment.id]),
|
|
852
|
+
onOpen: onOpenMedia ? (play) => onOpenMedia(message.id, attachment.id, play) : void 0
|
|
853
|
+
},
|
|
854
|
+
attachment.id
|
|
855
|
+
)),
|
|
856
|
+
streaming && !hasBody && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(AITypingIndicator, {}) })
|
|
857
|
+
] })
|
|
858
|
+
}
|
|
859
|
+
)
|
|
860
|
+
}
|
|
861
|
+
)
|
|
862
|
+
]
|
|
863
|
+
}
|
|
864
|
+
)
|
|
865
|
+
]
|
|
866
|
+
}
|
|
867
|
+
);
|
|
868
|
+
});
|
|
869
|
+
var sidebarItem = cva(
|
|
870
|
+
"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-start text-sm transition-colors",
|
|
871
|
+
{
|
|
872
|
+
variants: {
|
|
873
|
+
active: {
|
|
874
|
+
true: "bg-primary-100 text-primary-900 dark:bg-primary-900/40 dark:text-primary-100",
|
|
875
|
+
false: "text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800"
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
defaultVariants: { active: false }
|
|
879
|
+
}
|
|
880
|
+
);
|
|
881
|
+
|
|
882
|
+
// src/components/SuperChat/media.ts
|
|
883
|
+
function getConversationMediaItems(conversation) {
|
|
884
|
+
const participants = new Map(
|
|
885
|
+
conversation.participants.map((participant) => [
|
|
886
|
+
participant.id,
|
|
887
|
+
participant
|
|
888
|
+
])
|
|
889
|
+
);
|
|
890
|
+
return [...conversation.thread].sort(byTime).flatMap(
|
|
891
|
+
(message) => (message.media ?? []).map((attachment) => ({
|
|
892
|
+
// Tuple encoding prevents collisions when ids themselves contain a
|
|
893
|
+
// delimiter. Including the conversation keeps selection scoped to it.
|
|
894
|
+
id: JSON.stringify([conversation.id, message.id, attachment.id]),
|
|
895
|
+
conversationId: conversation.id,
|
|
896
|
+
message,
|
|
897
|
+
attachment,
|
|
898
|
+
participant: participants.get(message.participantId)
|
|
899
|
+
}))
|
|
900
|
+
);
|
|
901
|
+
}
|
|
902
|
+
function remarkPreserveLineBreaks() {
|
|
903
|
+
const splitNode = (node) => {
|
|
904
|
+
if (!node.children) return;
|
|
905
|
+
const next = [];
|
|
906
|
+
for (const child of node.children) {
|
|
907
|
+
if (child.type === "text" && child.value && child.value.includes("\n")) {
|
|
908
|
+
const segments = child.value.split("\n");
|
|
909
|
+
segments.forEach((segment, i) => {
|
|
910
|
+
if (i > 0) next.push({ type: "break" });
|
|
911
|
+
if (segment) next.push({ type: "text", value: segment });
|
|
912
|
+
});
|
|
913
|
+
} else {
|
|
914
|
+
splitNode(child);
|
|
915
|
+
next.push(child);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
node.children = next;
|
|
919
|
+
};
|
|
920
|
+
return (tree) => splitNode(tree);
|
|
921
|
+
}
|
|
922
|
+
function baseSanitizeSchema() {
|
|
923
|
+
const schema = JSON.parse(JSON.stringify(defaultSchema));
|
|
924
|
+
const attributes = schema.attributes ?? {};
|
|
925
|
+
const allowClass = (tag) => {
|
|
926
|
+
const existing = attributes[tag] ?? [];
|
|
927
|
+
const withoutClass = existing.filter(
|
|
928
|
+
(a) => !(Array.isArray(a) && a[0] === "className")
|
|
929
|
+
);
|
|
930
|
+
attributes[tag] = [...withoutClass, "className"];
|
|
931
|
+
};
|
|
932
|
+
allowClass("code");
|
|
933
|
+
allowClass("pre");
|
|
934
|
+
allowClass("span");
|
|
935
|
+
allowClass("div");
|
|
936
|
+
schema.attributes = attributes;
|
|
937
|
+
return schema;
|
|
938
|
+
}
|
|
939
|
+
function mergeSanitizeSchema(base, extra) {
|
|
940
|
+
if (!extra) return base;
|
|
941
|
+
const out = { ...base };
|
|
942
|
+
if (Array.isArray(extra.tagNames)) {
|
|
943
|
+
const a = base.tagNames ?? [];
|
|
944
|
+
out.tagNames = Array.from(/* @__PURE__ */ new Set([...a, ...extra.tagNames]));
|
|
945
|
+
}
|
|
946
|
+
if (extra.attributes && typeof extra.attributes === "object") {
|
|
947
|
+
const baseAttrs = {
|
|
948
|
+
...base.attributes ?? {}
|
|
949
|
+
};
|
|
950
|
+
for (const [tag, attrs] of Object.entries(
|
|
951
|
+
extra.attributes
|
|
952
|
+
)) {
|
|
953
|
+
baseAttrs[tag] = [...baseAttrs[tag] ?? [], ...attrs];
|
|
954
|
+
}
|
|
955
|
+
out.attributes = baseAttrs;
|
|
956
|
+
}
|
|
957
|
+
if (extra.protocols && typeof extra.protocols === "object") {
|
|
958
|
+
const baseProtocols = {
|
|
959
|
+
...base.protocols ?? {}
|
|
960
|
+
};
|
|
961
|
+
for (const [attr, protocols] of Object.entries(
|
|
962
|
+
extra.protocols
|
|
963
|
+
)) {
|
|
964
|
+
baseProtocols[attr] = Array.from(
|
|
965
|
+
/* @__PURE__ */ new Set([...baseProtocols[attr] ?? [], ...protocols])
|
|
966
|
+
);
|
|
688
967
|
}
|
|
689
|
-
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
React2.useEffect(() => {
|
|
702
|
-
const el = actionsBarRef.current;
|
|
703
|
-
if (!el || typeof globalThis.IntersectionObserver === "undefined") return;
|
|
704
|
-
const observer = new globalThis.IntersectionObserver(([entry]) => {
|
|
705
|
-
setFooterVisible(entry?.isIntersecting ?? false);
|
|
706
|
-
});
|
|
707
|
-
observer.observe(el);
|
|
708
|
-
return () => observer.disconnect();
|
|
709
|
-
}, [hasActions]);
|
|
710
|
-
if (message.type === "system") {
|
|
711
|
-
return /* @__PURE__ */ jsx(
|
|
712
|
-
"div",
|
|
968
|
+
out.protocols = baseProtocols;
|
|
969
|
+
}
|
|
970
|
+
for (const [k, v] of Object.entries(extra)) {
|
|
971
|
+
if (k === "tagNames" || k === "attributes" || k === "protocols") continue;
|
|
972
|
+
out[k] = v;
|
|
973
|
+
}
|
|
974
|
+
return out;
|
|
975
|
+
}
|
|
976
|
+
function baseComponents() {
|
|
977
|
+
return {
|
|
978
|
+
a: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
979
|
+
"a",
|
|
713
980
|
{
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
981
|
+
...props,
|
|
982
|
+
className: cn(
|
|
983
|
+
"text-primary-800 hover:text-primary-900 dark:text-primary-300 underline underline-offset-2",
|
|
984
|
+
props.className
|
|
985
|
+
),
|
|
986
|
+
target: props.target ?? "_blank",
|
|
987
|
+
rel: props.rel ?? "noopener noreferrer",
|
|
988
|
+
children
|
|
718
989
|
}
|
|
719
|
-
)
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
return /* @__PURE__ */ jsx(
|
|
723
|
-
"div",
|
|
990
|
+
),
|
|
991
|
+
pre: ({ node: _node, ...props }) => /* @__PURE__ */ jsx(
|
|
992
|
+
"pre",
|
|
724
993
|
{
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
994
|
+
...props,
|
|
995
|
+
tabIndex: 0,
|
|
996
|
+
className: cn(
|
|
997
|
+
"overflow-x-auto rounded-lg bg-neutral-900 p-3 text-sm text-neutral-100 dark:bg-neutral-950",
|
|
998
|
+
props.className
|
|
999
|
+
)
|
|
1000
|
+
}
|
|
1001
|
+
),
|
|
1002
|
+
code: ({ node: _node, ...props }) => {
|
|
1003
|
+
const isBlock = typeof props.className === "string" && props.className.includes("language-");
|
|
1004
|
+
return /* @__PURE__ */ jsx(
|
|
1005
|
+
"code",
|
|
1006
|
+
{
|
|
1007
|
+
...props,
|
|
1008
|
+
className: cn(
|
|
1009
|
+
!isBlock && "rounded bg-neutral-200 px-1 py-0.5 text-[0.85em] text-neutral-800 dark:bg-neutral-700 dark:text-neutral-100",
|
|
1010
|
+
props.className
|
|
1011
|
+
)
|
|
1012
|
+
}
|
|
1013
|
+
);
|
|
1014
|
+
},
|
|
1015
|
+
input: ({ node: _node, ...props }) => {
|
|
1016
|
+
if (props.type === "checkbox") {
|
|
1017
|
+
return /* @__PURE__ */ jsx(
|
|
1018
|
+
"input",
|
|
729
1019
|
{
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
onReferenceClick
|
|
1020
|
+
...props,
|
|
1021
|
+
"aria-label": props["aria-label"] ?? (props["aria-labelledby"] ? void 0 : "Task list item")
|
|
733
1022
|
}
|
|
1023
|
+
);
|
|
1024
|
+
}
|
|
1025
|
+
return /* @__PURE__ */ jsx("input", { ...props });
|
|
1026
|
+
},
|
|
1027
|
+
table: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("div", { className: "my-2 overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
1028
|
+
"table",
|
|
1029
|
+
{
|
|
1030
|
+
...props,
|
|
1031
|
+
className: cn(
|
|
1032
|
+
"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-start dark:[&_th]:border-neutral-700",
|
|
1033
|
+
props.className
|
|
734
1034
|
)
|
|
735
1035
|
}
|
|
736
|
-
)
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
};
|
|
751
|
-
const handleEditPaste = (e) => {
|
|
752
|
-
const files = Array.from(e.clipboardData.items).filter((item) => item.kind === "file" && item.type.startsWith("image/")).map((item) => item.getAsFile()).filter((f) => f !== null);
|
|
753
|
-
if (files.length === 0) return;
|
|
754
|
-
e.preventDefault();
|
|
755
|
-
const el = e.currentTarget;
|
|
756
|
-
const start = el.selectionStart ?? draft.length;
|
|
757
|
-
const end = el.selectionEnd ?? draft.length;
|
|
758
|
-
Promise.all(
|
|
759
|
-
files.map(
|
|
760
|
-
(file, i) => new Promise((resolve) => {
|
|
761
|
-
const reader = new window.FileReader();
|
|
762
|
-
reader.onload = () => {
|
|
763
|
-
const dataUrl = typeof reader.result === "string" ? reader.result : "";
|
|
764
|
-
const name = file.name || `pasted-image-${i + 1}.png`;
|
|
765
|
-
resolve(dataUrl ? `` : "");
|
|
766
|
-
};
|
|
767
|
-
reader.readAsDataURL(file);
|
|
768
|
-
})
|
|
769
|
-
)
|
|
770
|
-
).then((snippets) => {
|
|
771
|
-
const insert = snippets.filter(Boolean).join("\n");
|
|
772
|
-
if (!insert) return;
|
|
773
|
-
el.focus();
|
|
774
|
-
el.setSelectionRange(start, end);
|
|
775
|
-
const text = `${insert}
|
|
776
|
-
`;
|
|
777
|
-
const inserted = typeof document !== "undefined" && typeof document.execCommand === "function" && document.execCommand("insertText", false, text);
|
|
778
|
-
if (!inserted) {
|
|
779
|
-
setDraft((prev) => `${prev.slice(0, start)}${text}${prev.slice(end)}`);
|
|
1036
|
+
) }),
|
|
1037
|
+
// Tailwind's preflight resets list markers/padding; restore them explicitly
|
|
1038
|
+
// so bullets/numbers show without depending on the typography plugin.
|
|
1039
|
+
ul: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("ul", { ...props, className: cn("list-disc ps-5", props.className) }),
|
|
1040
|
+
ol: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("ol", { ...props, className: cn("list-decimal ps-5", props.className) }),
|
|
1041
|
+
li: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("li", { ...props, className: cn("ps-1", props.className) }),
|
|
1042
|
+
// Preflight also flattens headings to body size/weight; restore a sensible
|
|
1043
|
+
// hierarchy without depending on the typography plugin.
|
|
1044
|
+
h1: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
1045
|
+
"h1",
|
|
1046
|
+
{
|
|
1047
|
+
...props,
|
|
1048
|
+
className: cn("mt-3 mb-1 text-xl font-semibold", props.className),
|
|
1049
|
+
children
|
|
780
1050
|
}
|
|
781
|
-
|
|
782
|
-
})
|
|
783
|
-
|
|
784
|
-
const actions = [
|
|
785
|
-
...canCopy ? [
|
|
1051
|
+
),
|
|
1052
|
+
h2: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
1053
|
+
"h2",
|
|
786
1054
|
{
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
{
|
|
807
|
-
id: "copy-plain",
|
|
808
|
-
label: "Copy as plain text",
|
|
809
|
-
onSelect: copy.copyPlain
|
|
810
|
-
}
|
|
811
|
-
]
|
|
812
|
-
}
|
|
1055
|
+
...props,
|
|
1056
|
+
className: cn("mt-3 mb-1 text-lg font-semibold", props.className),
|
|
1057
|
+
children
|
|
1058
|
+
}
|
|
1059
|
+
),
|
|
1060
|
+
h3: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
1061
|
+
"h3",
|
|
1062
|
+
{
|
|
1063
|
+
...props,
|
|
1064
|
+
className: cn("mt-2 mb-1 text-base font-semibold", props.className),
|
|
1065
|
+
children
|
|
1066
|
+
}
|
|
1067
|
+
),
|
|
1068
|
+
h4: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
1069
|
+
"h4",
|
|
1070
|
+
{
|
|
1071
|
+
...props,
|
|
1072
|
+
className: cn("mt-2 mb-1 text-sm font-semibold", props.className),
|
|
1073
|
+
children
|
|
813
1074
|
}
|
|
814
|
-
|
|
815
|
-
...
|
|
1075
|
+
),
|
|
1076
|
+
h5: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
1077
|
+
"h5",
|
|
816
1078
|
{
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
onSelect: startEdit
|
|
1079
|
+
...props,
|
|
1080
|
+
className: cn("mt-2 mb-1 text-sm font-semibold", props.className),
|
|
1081
|
+
children
|
|
821
1082
|
}
|
|
822
|
-
|
|
1083
|
+
),
|
|
1084
|
+
h6: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsx(
|
|
1085
|
+
"h6",
|
|
1086
|
+
{
|
|
1087
|
+
...props,
|
|
1088
|
+
className: cn(
|
|
1089
|
+
"mt-2 mb-1 text-xs font-semibold tracking-wide uppercase",
|
|
1090
|
+
props.className
|
|
1091
|
+
),
|
|
1092
|
+
children
|
|
1093
|
+
}
|
|
1094
|
+
),
|
|
1095
|
+
hr: ({ node: _node, ...props }) => /* @__PURE__ */ jsx(
|
|
1096
|
+
"hr",
|
|
1097
|
+
{
|
|
1098
|
+
...props,
|
|
1099
|
+
className: cn(
|
|
1100
|
+
"my-2 border-neutral-300 dark:border-neutral-600",
|
|
1101
|
+
props.className
|
|
1102
|
+
)
|
|
1103
|
+
}
|
|
1104
|
+
)
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
function createMarkdownRenderer(options = {}) {
|
|
1108
|
+
const { plugins = [], trusted = false } = options;
|
|
1109
|
+
const remarkPlugins = [
|
|
1110
|
+
remarkGfm,
|
|
1111
|
+
remarkPreserveLineBreaks,
|
|
1112
|
+
...plugins.flatMap((p) => p.remarkPlugins ?? [])
|
|
823
1113
|
];
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
{
|
|
827
|
-
"data-slot": "superchat-message",
|
|
828
|
-
role: "article",
|
|
829
|
-
"aria-label": `${authorName}, ${formatTime(message.time)}`,
|
|
830
|
-
className: cn(
|
|
831
|
-
"group flex gap-2",
|
|
832
|
-
isSelf ? "flex-row-reverse" : "flex-row"
|
|
833
|
-
),
|
|
834
|
-
children: [
|
|
835
|
-
/* @__PURE__ */ jsx(ParticipantAvatar, { participant }),
|
|
836
|
-
/* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-col gap-1", isSelf && "items-end"), children: [
|
|
837
|
-
/* @__PURE__ */ jsxs(
|
|
838
|
-
"div",
|
|
839
|
-
{
|
|
840
|
-
"data-slot": "superchat-message-meta",
|
|
841
|
-
className: "flex items-baseline gap-2",
|
|
842
|
-
children: [
|
|
843
|
-
/* @__PURE__ */ jsx(
|
|
844
|
-
"span",
|
|
845
|
-
{
|
|
846
|
-
className: "text-xs font-medium",
|
|
847
|
-
style: accentTextColor ? { color: accentTextColor } : void 0,
|
|
848
|
-
children: authorName
|
|
849
|
-
}
|
|
850
|
-
),
|
|
851
|
-
participant?.role && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: participant.role }),
|
|
852
|
-
/* @__PURE__ */ jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: formatTime(message.time) }),
|
|
853
|
-
message.editedAt && /* @__PURE__ */ jsx(
|
|
854
|
-
"span",
|
|
855
|
-
{
|
|
856
|
-
"data-slot": "superchat-edited-indicator",
|
|
857
|
-
className: "text-[10px] text-neutral-500 dark:text-neutral-400",
|
|
858
|
-
title: `Edited ${formatTime(message.editedAt)}`,
|
|
859
|
-
children: "(edited)"
|
|
860
|
-
}
|
|
861
|
-
)
|
|
862
|
-
]
|
|
863
|
-
}
|
|
864
|
-
),
|
|
865
|
-
/* @__PURE__ */ jsxs(
|
|
866
|
-
"div",
|
|
867
|
-
{
|
|
868
|
-
className: cn(
|
|
869
|
-
"flex items-center gap-1",
|
|
870
|
-
isSelf ? "flex-row-reverse" : "flex-row"
|
|
871
|
-
),
|
|
872
|
-
children: [
|
|
873
|
-
hasActions && /* @__PURE__ */ jsx(
|
|
874
|
-
MessageOverflowMenu,
|
|
875
|
-
{
|
|
876
|
-
isSelf,
|
|
877
|
-
actions,
|
|
878
|
-
footerVisible
|
|
879
|
-
}
|
|
880
|
-
),
|
|
881
|
-
/* @__PURE__ */ jsx(
|
|
882
|
-
ChatBubble,
|
|
883
|
-
{
|
|
884
|
-
ref: bubbleRef,
|
|
885
|
-
"data-slot": "superchat-bubble",
|
|
886
|
-
variant: isSelf ? "user" : "assistant",
|
|
887
|
-
hasError: message.status === "error",
|
|
888
|
-
className: "text-sm has-[[data-slot=superchat-nitro-table]]:w-full has-[[data-slot=superchat-nitro-table]]:max-w-full",
|
|
889
|
-
children: isEditing ? /* @__PURE__ */ jsxs(
|
|
890
|
-
"div",
|
|
891
|
-
{
|
|
892
|
-
"data-slot": "superchat-message-editor",
|
|
893
|
-
className: "flex w-80 max-w-full flex-col gap-2",
|
|
894
|
-
children: [
|
|
895
|
-
/* @__PURE__ */ jsx(
|
|
896
|
-
"textarea",
|
|
897
|
-
{
|
|
898
|
-
value: draft,
|
|
899
|
-
ref: editRef,
|
|
900
|
-
rows: 2,
|
|
901
|
-
onChange: (e) => {
|
|
902
|
-
setDraft(e.target.value);
|
|
903
|
-
autosize();
|
|
904
|
-
},
|
|
905
|
-
onPaste: handleEditPaste,
|
|
906
|
-
onKeyDown: (e) => {
|
|
907
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
908
|
-
e.preventDefault();
|
|
909
|
-
saveEdit();
|
|
910
|
-
} else if (e.key === "Escape") {
|
|
911
|
-
e.preventDefault();
|
|
912
|
-
cancelEdit();
|
|
913
|
-
}
|
|
914
|
-
},
|
|
915
|
-
"aria-label": "Edit message",
|
|
916
|
-
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"
|
|
917
|
-
}
|
|
918
|
-
),
|
|
919
|
-
/* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
920
|
-
/* @__PURE__ */ jsx(
|
|
921
|
-
"button",
|
|
922
|
-
{
|
|
923
|
-
type: "button",
|
|
924
|
-
onClick: cancelEdit,
|
|
925
|
-
className: "rounded-md px-2.5 py-1 text-xs font-medium text-neutral-200 hover:bg-white/10",
|
|
926
|
-
children: "Cancel"
|
|
927
|
-
}
|
|
928
|
-
),
|
|
929
|
-
/* @__PURE__ */ jsx(
|
|
930
|
-
"button",
|
|
931
|
-
{
|
|
932
|
-
type: "button",
|
|
933
|
-
onClick: saveEdit,
|
|
934
|
-
disabled: !draft.trim() || draft.trim() === message.text,
|
|
935
|
-
className: "rounded-md bg-white px-2.5 py-1 text-xs font-medium text-neutral-900 hover:bg-neutral-100 disabled:opacity-40",
|
|
936
|
-
children: "Save"
|
|
937
|
-
}
|
|
938
|
-
)
|
|
939
|
-
] })
|
|
940
|
-
]
|
|
941
|
-
}
|
|
942
|
-
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
943
|
-
message.content?.map((block, i) => {
|
|
944
|
-
if (block.type === "tool_use" && block.toolCall) {
|
|
945
|
-
return /* @__PURE__ */ jsx(MCPToolCallDisplay, { toolCall: block.toolCall }, i);
|
|
946
|
-
}
|
|
947
|
-
if ((block.type === "text" || block.type === "thinking") && block.text) {
|
|
948
|
-
return /* @__PURE__ */ jsx(
|
|
949
|
-
"div",
|
|
950
|
-
{
|
|
951
|
-
className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
|
|
952
|
-
children: renderText(block.text, {
|
|
953
|
-
messageId: message.id,
|
|
954
|
-
streaming,
|
|
955
|
-
role: participant?.kind === "human" ? "user" : "assistant"
|
|
956
|
-
})
|
|
957
|
-
},
|
|
958
|
-
i
|
|
959
|
-
);
|
|
960
|
-
}
|
|
961
|
-
if (block.type === "code" && block.text) {
|
|
962
|
-
const fenced = `\`\`\`${block.language ?? ""}
|
|
963
|
-
${block.text}
|
|
964
|
-
\`\`\``;
|
|
965
|
-
return /* @__PURE__ */ jsx(
|
|
966
|
-
"div",
|
|
967
|
-
{
|
|
968
|
-
className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
|
|
969
|
-
children: renderText(fenced, {
|
|
970
|
-
messageId: message.id,
|
|
971
|
-
streaming,
|
|
972
|
-
role: participant?.kind === "human" ? "user" : "assistant"
|
|
973
|
-
})
|
|
974
|
-
},
|
|
975
|
-
i
|
|
976
|
-
);
|
|
977
|
-
}
|
|
978
|
-
return null;
|
|
979
|
-
}),
|
|
980
|
-
message.text && /* @__PURE__ */ jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word", children: renderText(message.text, {
|
|
981
|
-
messageId: message.id,
|
|
982
|
-
streaming,
|
|
983
|
-
role: participant?.kind === "human" ? "user" : "assistant"
|
|
984
|
-
}) }),
|
|
985
|
-
streaming && !hasBody && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(AITypingIndicator, {}) })
|
|
986
|
-
] })
|
|
987
|
-
}
|
|
988
|
-
)
|
|
989
|
-
]
|
|
990
|
-
}
|
|
991
|
-
),
|
|
992
|
-
hasActions && /* @__PURE__ */ jsx(
|
|
993
|
-
MessageActionsBar,
|
|
994
|
-
{
|
|
995
|
-
ref: actionsBarRef,
|
|
996
|
-
actions,
|
|
997
|
-
isSelf
|
|
998
|
-
}
|
|
999
|
-
)
|
|
1000
|
-
] })
|
|
1001
|
-
]
|
|
1002
|
-
}
|
|
1114
|
+
const pluginRehype = plugins.flatMap(
|
|
1115
|
+
(p) => p.rehypePlugins ?? []
|
|
1003
1116
|
);
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1117
|
+
const sanitizeSchema = plugins.reduce(
|
|
1118
|
+
(acc, p) => mergeSanitizeSchema(acc, p.sanitizeSchema),
|
|
1119
|
+
baseSanitizeSchema()
|
|
1120
|
+
);
|
|
1121
|
+
const rehypePlugins = trusted ? pluginRehype : [...pluginRehype, [rehypeSanitize, sanitizeSchema]];
|
|
1122
|
+
const components = plugins.reduce(
|
|
1123
|
+
(acc, p) => ({ ...acc, ...p.components }),
|
|
1124
|
+
baseComponents()
|
|
1125
|
+
);
|
|
1126
|
+
const MarkdownRenderer = (text, ctx) => /* @__PURE__ */ jsx(
|
|
1127
|
+
MarkdownContent,
|
|
1128
|
+
{
|
|
1129
|
+
text,
|
|
1130
|
+
messageId: ctx.messageId,
|
|
1131
|
+
streaming: ctx.streaming,
|
|
1132
|
+
remarkPlugins,
|
|
1133
|
+
rehypePlugins,
|
|
1134
|
+
components
|
|
1013
1135
|
},
|
|
1014
|
-
|
|
1136
|
+
ctx.messageId
|
|
1137
|
+
);
|
|
1138
|
+
return MarkdownRenderer;
|
|
1139
|
+
}
|
|
1140
|
+
var transformUrl = (url, key, node) => {
|
|
1141
|
+
if (key === "src" && node.tagName === "img" && (/^data:image\//i.test(url) || /^blob:/i.test(url))) {
|
|
1142
|
+
return url;
|
|
1015
1143
|
}
|
|
1016
|
-
);
|
|
1144
|
+
return defaultUrlTransform(url);
|
|
1145
|
+
};
|
|
1146
|
+
var MarkdownContent = React3.memo(function MarkdownContent2({
|
|
1147
|
+
text,
|
|
1148
|
+
messageId,
|
|
1149
|
+
streaming,
|
|
1150
|
+
remarkPlugins,
|
|
1151
|
+
rehypePlugins,
|
|
1152
|
+
components
|
|
1153
|
+
}) {
|
|
1154
|
+
return /* @__PURE__ */ jsx(TextRenderContext.Provider, { value: { messageId, streaming }, children: /* @__PURE__ */ jsx(
|
|
1155
|
+
Markdown,
|
|
1156
|
+
{
|
|
1157
|
+
remarkPlugins,
|
|
1158
|
+
rehypePlugins,
|
|
1159
|
+
urlTransform: transformUrl,
|
|
1160
|
+
components,
|
|
1161
|
+
children: text
|
|
1162
|
+
}
|
|
1163
|
+
) });
|
|
1164
|
+
});
|
|
1017
1165
|
function VirtualThread({
|
|
1018
1166
|
items,
|
|
1019
1167
|
participantById,
|
|
@@ -1024,32 +1172,28 @@ function VirtualThread({
|
|
|
1024
1172
|
editable,
|
|
1025
1173
|
onMessageEdited,
|
|
1026
1174
|
defaultCopyFormat,
|
|
1027
|
-
|
|
1028
|
-
|
|
1175
|
+
onOpenMedia,
|
|
1176
|
+
openMediaLabel,
|
|
1177
|
+
playMediaLabel,
|
|
1178
|
+
mediaErrorLabel,
|
|
1179
|
+
mediaRetryLabel,
|
|
1180
|
+
scrollRef,
|
|
1181
|
+
contentRef,
|
|
1029
1182
|
containerProps
|
|
1030
1183
|
}) {
|
|
1031
|
-
const parentRef = React2.useRef(null);
|
|
1032
1184
|
const virtualizer = useVirtualizer({
|
|
1033
1185
|
count: items.length,
|
|
1034
|
-
getScrollElement: () =>
|
|
1186
|
+
getScrollElement: () => scrollRef.current,
|
|
1035
1187
|
// Rough first guess; real heights are measured via measureElement.
|
|
1036
1188
|
estimateSize: () => 88,
|
|
1037
1189
|
overscan: 10,
|
|
1038
1190
|
getItemKey: (index) => items[index]?.id ?? index
|
|
1039
1191
|
});
|
|
1040
|
-
const count = items.length;
|
|
1041
|
-
React2.useEffect(() => {
|
|
1042
|
-
if (count === 0) return;
|
|
1043
|
-
if (order === "desc") {
|
|
1044
|
-
virtualizer.scrollToIndex(0, { align: "start" });
|
|
1045
|
-
} else {
|
|
1046
|
-
virtualizer.scrollToIndex(count - 1, { align: "end" });
|
|
1047
|
-
}
|
|
1048
|
-
}, [count, conversationId, order]);
|
|
1049
1192
|
const virtualItems = virtualizer.getVirtualItems();
|
|
1050
|
-
return /* @__PURE__ */ jsx("div", { ...containerProps, ref:
|
|
1193
|
+
return /* @__PURE__ */ jsx("div", { ...containerProps, ref: scrollRef, children: /* @__PURE__ */ jsx(
|
|
1051
1194
|
"div",
|
|
1052
1195
|
{
|
|
1196
|
+
ref: contentRef,
|
|
1053
1197
|
style: {
|
|
1054
1198
|
height: virtualizer.getTotalSize(),
|
|
1055
1199
|
position: "relative",
|
|
@@ -1081,7 +1225,12 @@ function VirtualThread({
|
|
|
1081
1225
|
onReferenceClick,
|
|
1082
1226
|
editable,
|
|
1083
1227
|
onMessageEdited,
|
|
1084
|
-
defaultCopyFormat
|
|
1228
|
+
defaultCopyFormat,
|
|
1229
|
+
onOpenMedia,
|
|
1230
|
+
openMediaLabel,
|
|
1231
|
+
playMediaLabel,
|
|
1232
|
+
mediaErrorLabel,
|
|
1233
|
+
mediaRetryLabel
|
|
1085
1234
|
}
|
|
1086
1235
|
) })
|
|
1087
1236
|
},
|
|
@@ -1093,6 +1242,11 @@ function VirtualThread({
|
|
|
1093
1242
|
}
|
|
1094
1243
|
function SuperChat({
|
|
1095
1244
|
conversation,
|
|
1245
|
+
view,
|
|
1246
|
+
defaultView = "thread",
|
|
1247
|
+
onViewChange,
|
|
1248
|
+
mediaFeedProps,
|
|
1249
|
+
mediaLabels,
|
|
1096
1250
|
currentParticipantId,
|
|
1097
1251
|
renderPlugins,
|
|
1098
1252
|
renderTextContent,
|
|
@@ -1104,44 +1258,366 @@ function SuperChat({
|
|
|
1104
1258
|
linkBuilder,
|
|
1105
1259
|
defaultCopyFormat,
|
|
1106
1260
|
className,
|
|
1261
|
+
showHeader = true,
|
|
1262
|
+
placeholder,
|
|
1263
|
+
allowAttachments,
|
|
1264
|
+
agents,
|
|
1265
|
+
selectedAgent,
|
|
1266
|
+
onAgentChange,
|
|
1267
|
+
agentSelectorLabel,
|
|
1268
|
+
modelSelectorProps,
|
|
1269
|
+
isStreaming,
|
|
1270
|
+
onStop,
|
|
1271
|
+
stopLabel,
|
|
1107
1272
|
onMessageSent,
|
|
1108
1273
|
onMessageEdited,
|
|
1109
1274
|
onConversationClosed,
|
|
1110
1275
|
onReferenceClick,
|
|
1111
1276
|
onBack
|
|
1112
1277
|
}) {
|
|
1113
|
-
const headingId =
|
|
1114
|
-
|
|
1278
|
+
const headingId = React3.useId();
|
|
1279
|
+
const [internalView, setInternalView] = React3.useState({
|
|
1280
|
+
conversationId: conversation.id,
|
|
1281
|
+
view: defaultView
|
|
1282
|
+
});
|
|
1283
|
+
const activeView = view ?? (internalView.conversationId === conversation.id ? internalView.view : "thread");
|
|
1284
|
+
const labels = {
|
|
1285
|
+
backToConversation: "Back to conversation",
|
|
1286
|
+
openMedia: "Open in media feed",
|
|
1287
|
+
playMedia: "Play",
|
|
1288
|
+
unknownAuthor: "Unknown",
|
|
1289
|
+
...mediaLabels
|
|
1290
|
+
};
|
|
1291
|
+
const mediaItems = React3.useMemo(() => {
|
|
1292
|
+
const items = getConversationMediaItems(conversation);
|
|
1293
|
+
return order === "desc" ? items.reverse() : items;
|
|
1294
|
+
}, [conversation, order]);
|
|
1295
|
+
const [mediaSelection, setMediaSelection] = React3.useState();
|
|
1296
|
+
const [manualPlaybackRequest, setManualPlaybackRequest] = React3.useState();
|
|
1297
|
+
const playbackRequestCounter = React3.useRef(0);
|
|
1298
|
+
const mediaFeedRef = React3.useRef(null);
|
|
1299
|
+
const backToConversationRef = React3.useRef(null);
|
|
1300
|
+
const focusMediaOnOpenRef = React3.useRef(false);
|
|
1301
|
+
const focusThreadOnBackRef = React3.useRef(false);
|
|
1302
|
+
const mediaReturnTargetRef = React3.useRef(void 0);
|
|
1303
|
+
const mediaContextRef = React3.useRef({
|
|
1304
|
+
conversation,
|
|
1305
|
+
view,
|
|
1306
|
+
onViewChange,
|
|
1307
|
+
mediaFeedProps,
|
|
1308
|
+
mediaItems
|
|
1309
|
+
});
|
|
1310
|
+
mediaContextRef.current = {
|
|
1311
|
+
conversation,
|
|
1312
|
+
view,
|
|
1313
|
+
onViewChange,
|
|
1314
|
+
mediaFeedProps,
|
|
1315
|
+
mediaItems
|
|
1316
|
+
};
|
|
1317
|
+
const setView = React3.useCallback((next) => {
|
|
1318
|
+
const context = mediaContextRef.current;
|
|
1319
|
+
if (context.view === void 0)
|
|
1320
|
+
setInternalView({ conversationId: context.conversation.id, view: next });
|
|
1321
|
+
context.onViewChange?.(next, { conversation: context.conversation });
|
|
1322
|
+
}, []);
|
|
1323
|
+
const handleMediaSelection = React3.useCallback((item) => {
|
|
1324
|
+
setMediaSelection({ conversationId: item.conversationId, itemId: item.id });
|
|
1325
|
+
mediaContextRef.current.mediaFeedProps?.onActiveItemChange?.(item);
|
|
1326
|
+
}, []);
|
|
1327
|
+
const handleOpenMedia = React3.useCallback(
|
|
1328
|
+
(messageId, attachmentId, play = false) => {
|
|
1329
|
+
const item = mediaContextRef.current.mediaItems.find(
|
|
1330
|
+
(candidate) => candidate.message.id === messageId && candidate.attachment.id === attachmentId
|
|
1331
|
+
);
|
|
1332
|
+
if (!item) return;
|
|
1333
|
+
handleMediaSelection(item);
|
|
1334
|
+
mediaReturnTargetRef.current = {
|
|
1335
|
+
conversationId: item.conversationId,
|
|
1336
|
+
messageId,
|
|
1337
|
+
attachmentId
|
|
1338
|
+
};
|
|
1339
|
+
focusMediaOnOpenRef.current = true;
|
|
1340
|
+
setManualPlaybackRequest(
|
|
1341
|
+
play ? {
|
|
1342
|
+
conversationId: item.conversationId,
|
|
1343
|
+
itemId: item.id,
|
|
1344
|
+
requestId: ++playbackRequestCounter.current
|
|
1345
|
+
} : void 0
|
|
1346
|
+
);
|
|
1347
|
+
setView("media");
|
|
1348
|
+
},
|
|
1349
|
+
[handleMediaSelection, setView]
|
|
1350
|
+
);
|
|
1351
|
+
const handleBackToConversation = React3.useCallback(() => {
|
|
1352
|
+
focusMediaOnOpenRef.current = false;
|
|
1353
|
+
focusThreadOnBackRef.current = true;
|
|
1354
|
+
setManualPlaybackRequest(void 0);
|
|
1355
|
+
setView("thread");
|
|
1356
|
+
}, [setView]);
|
|
1357
|
+
const hostPlaybackRequest = mediaFeedProps?.playbackRequest;
|
|
1358
|
+
const hostPlaybackKey = hostPlaybackRequest ? `${hostPlaybackRequest.itemId}\0${hostPlaybackRequest.requestId}` : void 0;
|
|
1359
|
+
React3.useEffect(() => {
|
|
1360
|
+
if (hostPlaybackKey === void 0) return;
|
|
1361
|
+
setManualPlaybackRequest(void 0);
|
|
1362
|
+
}, [hostPlaybackKey]);
|
|
1363
|
+
React3.useEffect(() => {
|
|
1364
|
+
if (internalView.conversationId !== conversation.id) {
|
|
1365
|
+
setInternalView({ conversationId: conversation.id, view: "thread" });
|
|
1366
|
+
}
|
|
1367
|
+
if (mediaReturnTargetRef.current?.conversationId !== conversation.id) {
|
|
1368
|
+
mediaReturnTargetRef.current = void 0;
|
|
1369
|
+
focusMediaOnOpenRef.current = false;
|
|
1370
|
+
focusThreadOnBackRef.current = false;
|
|
1371
|
+
setManualPlaybackRequest(void 0);
|
|
1372
|
+
}
|
|
1373
|
+
}, [conversation.id, internalView.conversationId]);
|
|
1374
|
+
React3.useEffect(() => {
|
|
1375
|
+
if (activeView !== "media" || !focusMediaOnOpenRef.current) return;
|
|
1376
|
+
const target = mediaFeedRef.current?.querySelector(
|
|
1377
|
+
'article[tabindex="0"]'
|
|
1378
|
+
) ?? mediaFeedRef.current?.querySelector('[role="feed"]');
|
|
1379
|
+
if (target) focusMediaOnOpenRef.current = false;
|
|
1380
|
+
(target ?? backToConversationRef.current)?.focus({ preventScroll: true });
|
|
1381
|
+
}, [
|
|
1382
|
+
activeView,
|
|
1383
|
+
mediaFeedProps?.loading,
|
|
1384
|
+
mediaFeedProps?.error,
|
|
1385
|
+
mediaItems.length
|
|
1386
|
+
]);
|
|
1387
|
+
React3.useEffect(() => {
|
|
1115
1388
|
notifyComposerMigrationOnce("SuperChat");
|
|
1116
1389
|
}, []);
|
|
1117
|
-
const renderText =
|
|
1390
|
+
const renderText = React3.useMemo(
|
|
1118
1391
|
() => renderTextContent ?? createMarkdownRenderer({
|
|
1119
1392
|
plugins: renderPlugins,
|
|
1120
1393
|
trusted: trustedContent
|
|
1121
1394
|
}),
|
|
1122
1395
|
[renderTextContent, renderPlugins, trustedContent]
|
|
1123
1396
|
);
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1397
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
1398
|
+
const {
|
|
1399
|
+
containerRef: threadRef,
|
|
1400
|
+
contentRef: threadContentRef,
|
|
1401
|
+
isAtBottom,
|
|
1402
|
+
scrollToBottom,
|
|
1403
|
+
anchorToTurnStart,
|
|
1404
|
+
followIfPinned,
|
|
1405
|
+
stopFollowing
|
|
1406
|
+
} = useStickToBottom({
|
|
1407
|
+
disabled: order === "desc" || activeView === "media"
|
|
1408
|
+
});
|
|
1409
|
+
React3.useEffect(() => {
|
|
1410
|
+
if (activeView !== "thread") return;
|
|
1411
|
+
setManualPlaybackRequest(void 0);
|
|
1412
|
+
if (!focusThreadOnBackRef.current) return;
|
|
1413
|
+
focusThreadOnBackRef.current = false;
|
|
1414
|
+
const source = mediaReturnTargetRef.current;
|
|
1415
|
+
const launchId = source ? JSON.stringify([source.messageId, source.attachmentId]) : void 0;
|
|
1416
|
+
const launcher = source?.conversationId === conversation.id ? Array.from(
|
|
1417
|
+
threadRef.current?.querySelectorAll(
|
|
1418
|
+
"[data-media-launch-id]"
|
|
1419
|
+
) ?? []
|
|
1420
|
+
).find((button) => button.dataset.mediaLaunchId === launchId) : void 0;
|
|
1421
|
+
(launcher ?? threadRef.current)?.focus({ preventScroll: true });
|
|
1422
|
+
}, [activeView, conversation.id, threadRef]);
|
|
1423
|
+
const [hasNewBelow, setHasNewBelow] = React3.useState(false);
|
|
1424
|
+
const [turnStartId, setTurnStartId] = React3.useState(null);
|
|
1425
|
+
const [turnMinHeight, setTurnMinHeight] = React3.useState();
|
|
1426
|
+
const anchoredTurnRef = React3.useRef(null);
|
|
1427
|
+
const threadSnapshotRef = React3.useRef(void 0);
|
|
1428
|
+
const atBottomRef = React3.useRef(isAtBottom);
|
|
1429
|
+
atBottomRef.current = isAtBottom;
|
|
1430
|
+
const pendingMediaOwnSendRef = React3.useRef(false);
|
|
1431
|
+
const pendingMediaAppendRef = React3.useRef(false);
|
|
1432
|
+
React3.useEffect(() => {
|
|
1433
|
+
threadSnapshotRef.current = void 0;
|
|
1434
|
+
pendingMediaOwnSendRef.current = false;
|
|
1435
|
+
pendingMediaAppendRef.current = false;
|
|
1436
|
+
setTurnStartId(null);
|
|
1437
|
+
anchoredTurnRef.current = null;
|
|
1438
|
+
if (order === "desc") {
|
|
1439
|
+
const el = threadRef.current;
|
|
1440
|
+
if (el) el.scrollTop = 0;
|
|
1441
|
+
} else {
|
|
1442
|
+
scrollToBottom("auto");
|
|
1443
|
+
}
|
|
1444
|
+
setHasNewBelow(false);
|
|
1445
|
+
}, [conversation.id, order]);
|
|
1446
|
+
const threadLength = conversation.thread.length;
|
|
1447
|
+
const prevThreadLengthRef = React3.useRef(threadLength);
|
|
1448
|
+
const prevMessageIdsRef = React3.useRef(
|
|
1449
|
+
new Set(conversation.thread.map((message) => message.id))
|
|
1450
|
+
);
|
|
1451
|
+
const policyConversationRef = React3.useRef(conversation.id);
|
|
1452
|
+
const policyBaselinedRef = React3.useRef(false);
|
|
1453
|
+
React3.useEffect(() => {
|
|
1454
|
+
if (!policyBaselinedRef.current || policyConversationRef.current !== conversation.id) {
|
|
1455
|
+
policyBaselinedRef.current = true;
|
|
1456
|
+
policyConversationRef.current = conversation.id;
|
|
1457
|
+
prevThreadLengthRef.current = threadLength;
|
|
1458
|
+
prevMessageIdsRef.current = new Set(
|
|
1459
|
+
conversation.thread.map((message) => message.id)
|
|
1460
|
+
);
|
|
1461
|
+
if (order !== "desc" && [...conversation.thread].sort(byTime).at(-1)?.status === "streaming") {
|
|
1462
|
+
stopFollowing();
|
|
1463
|
+
}
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
if (threadLength === prevThreadLengthRef.current) return;
|
|
1467
|
+
const grew = threadLength > prevThreadLengthRef.current;
|
|
1468
|
+
prevThreadLengthRef.current = threadLength;
|
|
1469
|
+
if (grew && activeView === "media") pendingMediaAppendRef.current = true;
|
|
1470
|
+
if (order === "desc") {
|
|
1471
|
+
const el = threadRef.current;
|
|
1472
|
+
if (el) el.scrollTop = 0;
|
|
1473
|
+
return;
|
|
1474
|
+
}
|
|
1475
|
+
const prevIds = prevMessageIdsRef.current;
|
|
1476
|
+
let turnStart;
|
|
1477
|
+
if (grew && currentParticipantId) {
|
|
1478
|
+
for (const message of [...conversation.thread].sort(byTime)) {
|
|
1479
|
+
if (!prevIds.has(message.id) && message.participantId === currentParticipantId) {
|
|
1480
|
+
turnStart = message.id;
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
if (turnStart) {
|
|
1485
|
+
if (activeView === "media") pendingMediaOwnSendRef.current = true;
|
|
1486
|
+
if (virtualized) {
|
|
1487
|
+
scrollToBottom("auto");
|
|
1488
|
+
} else {
|
|
1489
|
+
setTurnStartId(turnStart);
|
|
1490
|
+
}
|
|
1491
|
+
} else if (grew) {
|
|
1492
|
+
const newest = [...conversation.thread].sort(byTime).at(-1);
|
|
1493
|
+
if (newest?.status === "streaming") {
|
|
1494
|
+
followIfPinned("auto");
|
|
1495
|
+
stopFollowing();
|
|
1496
|
+
} else if (!followIfPinned("auto")) {
|
|
1497
|
+
setHasNewBelow(true);
|
|
1498
|
+
}
|
|
1499
|
+
} else {
|
|
1500
|
+
followIfPinned("auto");
|
|
1501
|
+
}
|
|
1502
|
+
}, [threadLength, order, isAtBottom, conversation.id, activeView]);
|
|
1503
|
+
React3.useLayoutEffect(() => {
|
|
1504
|
+
if (activeView !== "thread") return;
|
|
1505
|
+
const container = threadRef.current;
|
|
1506
|
+
if (!container) return;
|
|
1507
|
+
const snapshot = threadSnapshotRef.current;
|
|
1508
|
+
const sameThread = snapshot?.conversationId === conversation.id && snapshot.order === order;
|
|
1509
|
+
const ownSend = pendingMediaOwnSendRef.current;
|
|
1510
|
+
const appended = pendingMediaAppendRef.current;
|
|
1511
|
+
pendingMediaOwnSendRef.current = false;
|
|
1512
|
+
pendingMediaAppendRef.current = false;
|
|
1513
|
+
if (order === "desc") {
|
|
1514
|
+
container.scrollTop = sameThread && !appended ? snapshot.scrollTop : 0;
|
|
1515
|
+
} else if (ownSend && !virtualized) ; else if (sameThread && !ownSend && (!snapshot.atBottom || !appended)) {
|
|
1516
|
+
container.scrollTop = snapshot.scrollTop;
|
|
1517
|
+
if (!snapshot.atBottom) stopFollowing();
|
|
1518
|
+
} else {
|
|
1519
|
+
scrollToBottom("auto");
|
|
1520
|
+
if ([...conversation.thread].sort(byTime).at(-1)?.status === "streaming")
|
|
1521
|
+
stopFollowing();
|
|
1522
|
+
}
|
|
1523
|
+
return () => {
|
|
1524
|
+
threadSnapshotRef.current = {
|
|
1525
|
+
conversationId: conversation.id,
|
|
1526
|
+
order,
|
|
1527
|
+
scrollTop: container.scrollTop,
|
|
1528
|
+
atBottom: atBottomRef.current
|
|
1529
|
+
};
|
|
1530
|
+
};
|
|
1531
|
+
}, [conversation.id, order, activeView, virtualized]);
|
|
1532
|
+
React3.useLayoutEffect(() => {
|
|
1533
|
+
if (!turnStartId || anchoredTurnRef.current === turnStartId) return;
|
|
1534
|
+
const container = threadRef.current;
|
|
1535
|
+
if (!container) return;
|
|
1536
|
+
const reserve = Math.max(0, container.clientHeight - 32);
|
|
1537
|
+
if (turnMinHeight !== reserve) {
|
|
1538
|
+
setTurnMinHeight(reserve);
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
const target = container.querySelector(
|
|
1542
|
+
'[data-slot="superchat-turn"]'
|
|
1543
|
+
);
|
|
1544
|
+
if (target) {
|
|
1545
|
+
anchorToTurnStart(target, prefersReducedMotion ? "auto" : "smooth");
|
|
1546
|
+
anchoredTurnRef.current = turnStartId;
|
|
1547
|
+
}
|
|
1548
|
+
}, [
|
|
1549
|
+
turnStartId,
|
|
1550
|
+
turnMinHeight,
|
|
1551
|
+
anchorToTurnStart,
|
|
1552
|
+
prefersReducedMotion,
|
|
1553
|
+
threadRef,
|
|
1554
|
+
activeView
|
|
1555
|
+
]);
|
|
1556
|
+
React3.useEffect(() => {
|
|
1557
|
+
prevMessageIdsRef.current = new Set(
|
|
1558
|
+
conversation.thread.map((message) => message.id)
|
|
1559
|
+
);
|
|
1560
|
+
});
|
|
1561
|
+
React3.useEffect(() => {
|
|
1562
|
+
if (isAtBottom) setHasNewBelow(false);
|
|
1563
|
+
}, [isAtBottom]);
|
|
1564
|
+
const newestMessage = React3.useMemo(
|
|
1565
|
+
() => [...conversation.thread].sort(byTime).at(-1),
|
|
1566
|
+
[conversation]
|
|
1567
|
+
);
|
|
1568
|
+
const raiseNewBelow = React3.useCallback(() => {
|
|
1569
|
+
if (order !== "desc") setHasNewBelow(true);
|
|
1570
|
+
}, [order]);
|
|
1571
|
+
const resumeFollowing = React3.useCallback(() => {
|
|
1572
|
+
if (order !== "desc") scrollToBottom("auto");
|
|
1573
|
+
}, [order, scrollToBottom]);
|
|
1574
|
+
useStreamEndedBelowFold(
|
|
1575
|
+
newestMessage,
|
|
1576
|
+
isAtBottom,
|
|
1577
|
+
raiseNewBelow,
|
|
1578
|
+
resumeFollowing
|
|
1579
|
+
);
|
|
1580
|
+
const handleJumpToBottom = React3.useCallback(() => {
|
|
1581
|
+
scrollToBottom(prefersReducedMotion ? "auto" : "smooth");
|
|
1582
|
+
}, [scrollToBottom, prefersReducedMotion]);
|
|
1583
|
+
const participantById = React3.useMemo(() => {
|
|
1132
1584
|
const map = /* @__PURE__ */ new Map();
|
|
1133
1585
|
conversation.participants.forEach((p) => map.set(p.id, p));
|
|
1134
1586
|
return map;
|
|
1135
1587
|
}, [conversation]);
|
|
1136
|
-
const orderedThread =
|
|
1588
|
+
const orderedThread = React3.useMemo(() => {
|
|
1137
1589
|
const sorted = [...conversation.thread].sort(byTime);
|
|
1138
1590
|
return order === "desc" ? sorted.reverse() : sorted;
|
|
1139
1591
|
}, [conversation, order]);
|
|
1140
|
-
const
|
|
1592
|
+
const turnIndex = React3.useMemo(
|
|
1593
|
+
() => turnStartId && order !== "desc" ? orderedThread.findIndex((message) => message.id === turnStartId) : -1,
|
|
1594
|
+
[orderedThread, turnStartId, order]
|
|
1595
|
+
);
|
|
1596
|
+
const renderMessageRow = (m) => /* @__PURE__ */ jsx(
|
|
1597
|
+
MessageRow,
|
|
1598
|
+
{
|
|
1599
|
+
message: m,
|
|
1600
|
+
participant: participantById.get(m.participantId),
|
|
1601
|
+
isSelf: !!currentParticipantId && m.participantId === currentParticipantId,
|
|
1602
|
+
renderText,
|
|
1603
|
+
linkBuilder,
|
|
1604
|
+
onReferenceClick,
|
|
1605
|
+
editable,
|
|
1606
|
+
onMessageEdited: handleMessageEdited,
|
|
1607
|
+
defaultCopyFormat,
|
|
1608
|
+
onOpenMedia: handleOpenMedia,
|
|
1609
|
+
openMediaLabel: labels.openMedia,
|
|
1610
|
+
playMediaLabel: labels.playMedia,
|
|
1611
|
+
mediaErrorLabel: mediaFeedProps?.labels?.mediaError,
|
|
1612
|
+
mediaRetryLabel: mediaFeedProps?.labels?.retry
|
|
1613
|
+
},
|
|
1614
|
+
m.id
|
|
1615
|
+
);
|
|
1616
|
+
const onMessageEditedRef = React3.useRef(onMessageEdited);
|
|
1141
1617
|
onMessageEditedRef.current = onMessageEdited;
|
|
1142
|
-
const conversationRef =
|
|
1618
|
+
const conversationRef = React3.useRef(conversation);
|
|
1143
1619
|
conversationRef.current = conversation;
|
|
1144
|
-
const handleMessageEdited =
|
|
1620
|
+
const handleMessageEdited = React3.useCallback(
|
|
1145
1621
|
(messageId, text) => {
|
|
1146
1622
|
onMessageEditedRef.current?.(messageId, text, {
|
|
1147
1623
|
conversation: conversationRef.current
|
|
@@ -1150,7 +1626,7 @@ function SuperChat({
|
|
|
1150
1626
|
[]
|
|
1151
1627
|
);
|
|
1152
1628
|
const editable = !readOnly && !!onMessageEdited;
|
|
1153
|
-
const mentionOptions =
|
|
1629
|
+
const mentionOptions = React3.useMemo(
|
|
1154
1630
|
() => conversation.participants.filter((p) => p.kind !== "system").map((p) => ({
|
|
1155
1631
|
id: p.id,
|
|
1156
1632
|
label: p.name,
|
|
@@ -1160,17 +1636,17 @@ function SuperChat({
|
|
|
1160
1636
|
})),
|
|
1161
1637
|
[conversation.participants]
|
|
1162
1638
|
);
|
|
1163
|
-
const composerAccept =
|
|
1639
|
+
const composerAccept = React3.useMemo(
|
|
1164
1640
|
() => acceptTokensFor(acceptedFileTypes),
|
|
1165
1641
|
[acceptedFileTypes]
|
|
1166
1642
|
);
|
|
1167
|
-
const [draft, setDraft] =
|
|
1168
|
-
const draftEpochRef =
|
|
1169
|
-
const handleDraftChange =
|
|
1643
|
+
const [draft, setDraft] = React3.useState("");
|
|
1644
|
+
const draftEpochRef = React3.useRef(0);
|
|
1645
|
+
const handleDraftChange = React3.useCallback((value) => {
|
|
1170
1646
|
draftEpochRef.current += 1;
|
|
1171
1647
|
setDraft(value);
|
|
1172
1648
|
}, []);
|
|
1173
|
-
const handleComposerSend =
|
|
1649
|
+
const handleComposerSend = React3.useCallback(
|
|
1174
1650
|
async (message) => {
|
|
1175
1651
|
const epoch = draftEpochRef.current;
|
|
1176
1652
|
try {
|
|
@@ -1201,7 +1677,7 @@ function SuperChat({
|
|
|
1201
1677
|
className
|
|
1202
1678
|
),
|
|
1203
1679
|
children: [
|
|
1204
|
-
/* @__PURE__ */ jsxs(
|
|
1680
|
+
showHeader ? /* @__PURE__ */ jsxs(
|
|
1205
1681
|
"header",
|
|
1206
1682
|
{
|
|
1207
1683
|
"data-slot": "superchat-header",
|
|
@@ -1265,56 +1741,133 @@ function SuperChat({
|
|
|
1265
1741
|
)
|
|
1266
1742
|
]
|
|
1267
1743
|
}
|
|
1744
|
+
) : (
|
|
1745
|
+
// Keeps the panel's aria-labelledby reference valid without a visible header.
|
|
1746
|
+
/* @__PURE__ */ jsx("h2", { id: headingId, className: "sr-only", children: conversation.title })
|
|
1268
1747
|
),
|
|
1269
|
-
|
|
1270
|
-
|
|
1748
|
+
activeView === "media" ? /* @__PURE__ */ jsxs(
|
|
1749
|
+
"div",
|
|
1271
1750
|
{
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1751
|
+
"data-slot": "superchat-media-view",
|
|
1752
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
1753
|
+
children: [
|
|
1754
|
+
/* @__PURE__ */ jsx("div", { className: "px-4 pt-2", children: /* @__PURE__ */ jsx(ButtonGroup, { className: "justify-start", children: /* @__PURE__ */ jsx(
|
|
1755
|
+
Button,
|
|
1756
|
+
{
|
|
1757
|
+
ref: backToConversationRef,
|
|
1758
|
+
variant: "ghost",
|
|
1759
|
+
size: "sm",
|
|
1760
|
+
leftIcon: /* @__PURE__ */ jsx(
|
|
1761
|
+
ArrowLeft,
|
|
1762
|
+
{
|
|
1763
|
+
className: "size-4 rtl:rotate-180",
|
|
1764
|
+
"aria-hidden": "true"
|
|
1765
|
+
}
|
|
1766
|
+
),
|
|
1767
|
+
onClick: handleBackToConversation,
|
|
1768
|
+
children: labels.backToConversation
|
|
1769
|
+
}
|
|
1770
|
+
) }) }),
|
|
1771
|
+
/* @__PURE__ */ createElement(
|
|
1772
|
+
MediaFeed,
|
|
1773
|
+
{
|
|
1774
|
+
...mediaFeedProps,
|
|
1775
|
+
ref: mediaFeedRef,
|
|
1776
|
+
key: conversation.id,
|
|
1777
|
+
items: mediaItems,
|
|
1778
|
+
getId: (item) => item.id,
|
|
1779
|
+
getMedia: (item) => item.attachment,
|
|
1780
|
+
getTitle: (item) => item.attachment.title ?? "",
|
|
1781
|
+
getCaption: (item) => item.attachment.caption ?? item.message.text,
|
|
1782
|
+
getAuthor: (item) => ({
|
|
1783
|
+
name: item.participant?.name ?? labels.unknownAuthor,
|
|
1784
|
+
avatar: item.participant?.avatar
|
|
1785
|
+
}),
|
|
1786
|
+
activeItemId: mediaFeedProps?.activeItemId ?? (mediaSelection?.conversationId === conversation.id ? mediaSelection.itemId : void 0),
|
|
1787
|
+
onActiveItemChange: handleMediaSelection,
|
|
1788
|
+
playbackRequest: manualPlaybackRequest?.conversationId === conversation.id ? manualPlaybackRequest : mediaFeedProps?.playbackRequest,
|
|
1789
|
+
className: cn("min-h-0 flex-1", mediaFeedProps?.className)
|
|
1790
|
+
}
|
|
1791
|
+
)
|
|
1792
|
+
]
|
|
1292
1793
|
}
|
|
1293
|
-
) : /* @__PURE__ */
|
|
1794
|
+
) : /* @__PURE__ */ jsxs(
|
|
1294
1795
|
"div",
|
|
1295
1796
|
{
|
|
1296
|
-
"data-slot": "superchat-thread",
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1797
|
+
"data-slot": "superchat-thread-viewport",
|
|
1798
|
+
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1799
|
+
children: [
|
|
1800
|
+
virtualized ? /* @__PURE__ */ jsx(
|
|
1801
|
+
VirtualThread,
|
|
1802
|
+
{
|
|
1803
|
+
items: orderedThread,
|
|
1804
|
+
participantById,
|
|
1805
|
+
currentParticipantId,
|
|
1806
|
+
renderText,
|
|
1807
|
+
linkBuilder,
|
|
1808
|
+
onReferenceClick,
|
|
1809
|
+
editable,
|
|
1810
|
+
onMessageEdited: handleMessageEdited,
|
|
1811
|
+
defaultCopyFormat,
|
|
1812
|
+
onOpenMedia: handleOpenMedia,
|
|
1813
|
+
openMediaLabel: labels.openMedia,
|
|
1814
|
+
playMediaLabel: labels.playMedia,
|
|
1815
|
+
mediaErrorLabel: mediaFeedProps?.labels?.mediaError,
|
|
1816
|
+
mediaRetryLabel: mediaFeedProps?.labels?.retry,
|
|
1817
|
+
scrollRef: threadRef,
|
|
1818
|
+
contentRef: threadContentRef,
|
|
1819
|
+
containerProps: {
|
|
1820
|
+
"data-slot": "superchat-thread",
|
|
1821
|
+
role: "log",
|
|
1822
|
+
"aria-label": "Messages",
|
|
1823
|
+
"aria-live": "polite",
|
|
1824
|
+
// Focusable so keyboard-only users can scroll the message history.
|
|
1825
|
+
tabIndex: 0,
|
|
1826
|
+
className: "flex-1 overflow-y-auto p-4"
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
) : /* @__PURE__ */ jsx(
|
|
1830
|
+
"div",
|
|
1831
|
+
{
|
|
1832
|
+
"data-slot": "superchat-thread",
|
|
1833
|
+
ref: threadRef,
|
|
1834
|
+
role: "log",
|
|
1835
|
+
"aria-label": "Messages",
|
|
1836
|
+
"aria-live": "polite",
|
|
1837
|
+
tabIndex: 0,
|
|
1838
|
+
className: "flex-1 overflow-y-auto p-4",
|
|
1839
|
+
children: /* @__PURE__ */ jsxs("div", { ref: threadContentRef, className: "space-y-4", children: [
|
|
1840
|
+
(turnIndex === -1 ? orderedThread : orderedThread.slice(0, turnIndex)).map(renderMessageRow),
|
|
1841
|
+
turnIndex !== -1 && /* @__PURE__ */ jsx(
|
|
1842
|
+
"div",
|
|
1843
|
+
{
|
|
1844
|
+
"data-slot": "superchat-turn",
|
|
1845
|
+
className: "space-y-4",
|
|
1846
|
+
style: { minHeight: turnMinHeight },
|
|
1847
|
+
children: orderedThread.slice(turnIndex).map(renderMessageRow)
|
|
1848
|
+
}
|
|
1849
|
+
)
|
|
1850
|
+
] })
|
|
1851
|
+
}
|
|
1852
|
+
),
|
|
1853
|
+
/* @__PURE__ */ jsx(AnimatedPresence, { children: order !== "desc" && !isAtBottom && /* @__PURE__ */ jsx(
|
|
1854
|
+
Animated,
|
|
1855
|
+
{
|
|
1856
|
+
preset: "fade",
|
|
1857
|
+
mode: "presence",
|
|
1858
|
+
className: "absolute inset-x-0 bottom-0 z-20",
|
|
1859
|
+
children: /* @__PURE__ */ jsx(
|
|
1860
|
+
JumpToBottomButton,
|
|
1861
|
+
{
|
|
1862
|
+
dataSlot: "superchat-jump-to-bottom",
|
|
1863
|
+
hasNewMessages: hasNewBelow,
|
|
1864
|
+
onClick: handleJumpToBottom
|
|
1865
|
+
}
|
|
1866
|
+
)
|
|
1867
|
+
},
|
|
1868
|
+
"jump-to-bottom"
|
|
1869
|
+
) })
|
|
1870
|
+
]
|
|
1318
1871
|
}
|
|
1319
1872
|
),
|
|
1320
1873
|
/* @__PURE__ */ jsx(
|
|
@@ -1324,13 +1877,24 @@ function SuperChat({
|
|
|
1324
1877
|
onValueChange: handleDraftChange,
|
|
1325
1878
|
onSend: handleComposerSend,
|
|
1326
1879
|
disabled: readOnly,
|
|
1327
|
-
|
|
1880
|
+
className: "px-4 pb-4",
|
|
1881
|
+
placeholder: readOnly ? "Read-only conversation" : placeholder ?? "Type a message\u2026 use @ to address an agent",
|
|
1328
1882
|
mentionOptions,
|
|
1329
|
-
allowAttachments: !readOnly,
|
|
1883
|
+
allowAttachments: !readOnly && (allowAttachments ?? true),
|
|
1330
1884
|
acceptedFileTypes: composerAccept,
|
|
1331
1885
|
maxFileSize: 25 * 1024 * 1024,
|
|
1332
1886
|
maxLength: 1e5,
|
|
1333
|
-
inputLabel: "Message"
|
|
1887
|
+
inputLabel: "Message",
|
|
1888
|
+
showAgentSelector: !!agents?.length,
|
|
1889
|
+
agents,
|
|
1890
|
+
selectedAgent,
|
|
1891
|
+
onAgentChange,
|
|
1892
|
+
agentSelectorLabel,
|
|
1893
|
+
showModelSelector: !!modelSelectorProps,
|
|
1894
|
+
modelSelectorProps,
|
|
1895
|
+
isStreaming,
|
|
1896
|
+
onStop,
|
|
1897
|
+
stopLabel
|
|
1334
1898
|
}
|
|
1335
1899
|
)
|
|
1336
1900
|
]
|
|
@@ -1345,12 +1909,14 @@ function SuperChatConversations({
|
|
|
1345
1909
|
onConversationOpened,
|
|
1346
1910
|
onNewConversation
|
|
1347
1911
|
}) {
|
|
1348
|
-
const [internalActive, setInternalActive] =
|
|
1912
|
+
const [internalActive, setInternalActive] = React3.useState(
|
|
1349
1913
|
defaultActiveConversationId ?? conversations[0]?.id
|
|
1350
1914
|
);
|
|
1915
|
+
const [hasMounted, setHasMounted] = React3.useState(false);
|
|
1916
|
+
React3.useEffect(() => setHasMounted(true), []);
|
|
1351
1917
|
const requestedId = activeConversationId ?? internalActive;
|
|
1352
1918
|
const activeId = conversations.some((c) => c.id === requestedId) ? requestedId : conversations[0]?.id;
|
|
1353
|
-
const sortedConversations =
|
|
1919
|
+
const sortedConversations = React3.useMemo(
|
|
1354
1920
|
() => [...conversations].sort((a, b) => lastActivityOf(b) - lastActivityOf(a)),
|
|
1355
1921
|
[conversations]
|
|
1356
1922
|
);
|
|
@@ -1402,10 +1968,21 @@ function SuperChatConversations({
|
|
|
1402
1968
|
/* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: c.title }),
|
|
1403
1969
|
last?.text && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-neutral-600 dark:text-neutral-400", children: last.text })
|
|
1404
1970
|
] }),
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1971
|
+
/* @__PURE__ */ jsx(AnimatedPresence, { initial: hasMounted, children: !!c.unread && /* @__PURE__ */ jsxs(
|
|
1972
|
+
Animated,
|
|
1973
|
+
{
|
|
1974
|
+
as: "span",
|
|
1975
|
+
preset: "pop",
|
|
1976
|
+
mode: "presence",
|
|
1977
|
+
"data-slot": "superchat-unread-badge",
|
|
1978
|
+
className: "bg-primary-600 ms-1 inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[10px] font-semibold text-white",
|
|
1979
|
+
children: [
|
|
1980
|
+
c.unread,
|
|
1981
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: " unread messages" })
|
|
1982
|
+
]
|
|
1983
|
+
},
|
|
1984
|
+
"unread"
|
|
1985
|
+
) })
|
|
1409
1986
|
]
|
|
1410
1987
|
}
|
|
1411
1988
|
) }, c.id);
|
|
@@ -1418,6 +1995,11 @@ function SuperChatConversations({
|
|
|
1418
1995
|
}
|
|
1419
1996
|
function SuperChatInbox({
|
|
1420
1997
|
conversations,
|
|
1998
|
+
view,
|
|
1999
|
+
defaultView,
|
|
2000
|
+
onViewChange,
|
|
2001
|
+
mediaFeedProps,
|
|
2002
|
+
mediaLabels,
|
|
1421
2003
|
activeConversationId,
|
|
1422
2004
|
defaultActiveConversationId,
|
|
1423
2005
|
currentParticipantId,
|
|
@@ -1439,13 +2021,13 @@ function SuperChatInbox({
|
|
|
1439
2021
|
onNewConversation,
|
|
1440
2022
|
onReferenceClick
|
|
1441
2023
|
}) {
|
|
1442
|
-
const [internalActive, setInternalActive] =
|
|
2024
|
+
const [internalActive, setInternalActive] = React3.useState(
|
|
1443
2025
|
defaultActiveConversationId ?? conversations[0]?.id
|
|
1444
2026
|
);
|
|
1445
2027
|
const requestedId = activeConversationId ?? internalActive;
|
|
1446
2028
|
const active = conversations.find((c) => c.id === requestedId) ?? conversations[0];
|
|
1447
2029
|
const activeId = active?.id;
|
|
1448
|
-
const [mobileView, setMobileView] =
|
|
2030
|
+
const [mobileView, setMobileView] = React3.useState("list");
|
|
1449
2031
|
const handleOpen = (c) => {
|
|
1450
2032
|
if (activeConversationId === void 0) setInternalActive(c.id);
|
|
1451
2033
|
setMobileView("chat");
|
|
@@ -1479,6 +2061,11 @@ function SuperChatInbox({
|
|
|
1479
2061
|
SuperChat,
|
|
1480
2062
|
{
|
|
1481
2063
|
conversation: active,
|
|
2064
|
+
view,
|
|
2065
|
+
defaultView,
|
|
2066
|
+
onViewChange,
|
|
2067
|
+
mediaFeedProps,
|
|
2068
|
+
mediaLabels,
|
|
1482
2069
|
currentParticipantId,
|
|
1483
2070
|
renderPlugins,
|
|
1484
2071
|
renderTextContent,
|
|
@@ -1514,6 +2101,6 @@ function SuperChatInbox({
|
|
|
1514
2101
|
);
|
|
1515
2102
|
}
|
|
1516
2103
|
|
|
1517
|
-
export { SuperChat, SuperChatConversations, SuperChatInbox, createMarkdownRenderer };
|
|
2104
|
+
export { SuperChat, SuperChatConversations, SuperChatInbox, createMarkdownRenderer, getConversationMediaItems };
|
|
1518
2105
|
//# sourceMappingURL=index.js.map
|
|
1519
2106
|
//# sourceMappingURL=index.js.map
|