@mieweb/ui 0.10.0-dev.4 → 0.10.0-dev.41
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 +2215 -1321
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10386 -628
- package/dist/index.d.ts +10386 -628
- package/dist/index.js +805 -360
- 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
package/dist/kerebron.cjs
CHANGED
|
@@ -6,37 +6,65 @@ var react = require('react');
|
|
|
6
6
|
var editor = require('@kerebron/editor');
|
|
7
7
|
var web = require('@kerebron/wasm/web');
|
|
8
8
|
var AdvancedEditorKit = require('@kerebron/editor-kits/AdvancedEditorKit');
|
|
9
|
+
var ExtensionMediaUpload = require('@kerebron/extension-basic-editor/ExtensionMediaUpload');
|
|
9
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
11
|
var CodeEditorKit = require('@kerebron/editor-kits/CodeEditorKit');
|
|
11
12
|
|
|
12
13
|
var unsafeExtensions = ["autocomplete", "hover"];
|
|
13
14
|
var SafeAdvancedEditorKit = class {
|
|
14
|
-
constructor(forCollab) {
|
|
15
|
+
constructor(forCollab, mediaUpload) {
|
|
15
16
|
this.forCollab = forCollab;
|
|
17
|
+
this.mediaUpload = mediaUpload;
|
|
16
18
|
}
|
|
17
19
|
forCollab;
|
|
20
|
+
mediaUpload;
|
|
18
21
|
name = "advanced-editor";
|
|
19
22
|
getExtensions() {
|
|
20
23
|
const dropped = [...unsafeExtensions];
|
|
21
24
|
if (this.forCollab) dropped.push("history");
|
|
22
|
-
|
|
25
|
+
if (this.mediaUpload) dropped.push("mediaUpload");
|
|
26
|
+
const extensions = new AdvancedEditorKit.AdvancedEditorKit().getExtensions().filter(
|
|
23
27
|
(extension) => !("name" in extension && dropped.includes(extension.name))
|
|
24
28
|
);
|
|
29
|
+
if (this.mediaUpload) {
|
|
30
|
+
extensions.push(new ExtensionMediaUpload.ExtensionMediaUpload(this.mediaUpload));
|
|
31
|
+
}
|
|
32
|
+
return extensions;
|
|
25
33
|
}
|
|
26
34
|
};
|
|
27
|
-
async function createEditorKits(config) {
|
|
28
|
-
if (!config)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
async function createEditorKits(config, mediaUpload) {
|
|
36
|
+
if (!config) {
|
|
37
|
+
return {
|
|
38
|
+
kits: [new SafeAdvancedEditorKit(false, mediaUpload)],
|
|
39
|
+
collaborative: false
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const { HuddleYjsKit, defaultWsUrl } = await import('./collabKit-GCRHP25F.cjs');
|
|
44
|
+
const url = config.wsUrl ?? defaultWsUrl();
|
|
45
|
+
return {
|
|
46
|
+
kits: [
|
|
47
|
+
new SafeAdvancedEditorKit(true, mediaUpload),
|
|
48
|
+
new HuddleYjsKit(
|
|
49
|
+
url,
|
|
50
|
+
config.params ?? {},
|
|
51
|
+
config.WebSocketPolyfill,
|
|
52
|
+
config.user
|
|
53
|
+
)
|
|
54
|
+
],
|
|
55
|
+
collaborative: true
|
|
56
|
+
};
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.warn(
|
|
59
|
+
"[RichEditor] Collaborative editing unavailable \u2014 the Yjs kit failed to load. Continuing as a local editor.",
|
|
60
|
+
error
|
|
61
|
+
);
|
|
62
|
+
config.onUnavailable?.(error);
|
|
63
|
+
return {
|
|
64
|
+
kits: [new SafeAdvancedEditorKit(false, mediaUpload)],
|
|
65
|
+
collaborative: false
|
|
66
|
+
};
|
|
67
|
+
}
|
|
40
68
|
}
|
|
41
69
|
var MARKDOWN_TYPE = "text/x-markdown";
|
|
42
70
|
var initialLoadQueue = Promise.resolve();
|
|
@@ -56,7 +84,8 @@ var RichEditor = react.forwardRef(
|
|
|
56
84
|
className,
|
|
57
85
|
"aria-label": ariaLabel,
|
|
58
86
|
"aria-labelledby": ariaLabelledBy,
|
|
59
|
-
assetLoad
|
|
87
|
+
assetLoad,
|
|
88
|
+
mediaUpload
|
|
60
89
|
}, ref) {
|
|
61
90
|
const isDark = chunkNMBYU7D7_cjs.useIsDarkMode();
|
|
62
91
|
const hostRef = react.useRef(null);
|
|
@@ -68,6 +97,9 @@ var RichEditor = react.forwardRef(
|
|
|
68
97
|
const loadingRef = react.useRef(false);
|
|
69
98
|
const disabledRef = react.useRef(disabled);
|
|
70
99
|
const [md, setMd] = react.useState("");
|
|
100
|
+
const lastSerializedDoc = react.useRef(null);
|
|
101
|
+
const showPreviewRef = react.useRef(showPreview);
|
|
102
|
+
showPreviewRef.current = showPreview;
|
|
71
103
|
react.useEffect(() => {
|
|
72
104
|
disabledRef.current = disabled;
|
|
73
105
|
editorInstance.current?.view.setProps({
|
|
@@ -93,19 +125,26 @@ var RichEditor = react.forwardRef(
|
|
|
93
125
|
host.appendChild(mount);
|
|
94
126
|
const onTransaction = async () => {
|
|
95
127
|
if (loadingRef.current || !editorInstance.current) return;
|
|
128
|
+
const { doc } = editorInstance.current.view.state;
|
|
129
|
+
if (doc === lastSerializedDoc.current) return;
|
|
130
|
+
lastSerializedDoc.current = doc;
|
|
96
131
|
try {
|
|
97
132
|
const buffer = await editorInstance.current.saveDocument(MARKDOWN_TYPE);
|
|
98
133
|
const markdown = new globalThis.TextDecoder().decode(buffer);
|
|
99
134
|
if (disposed) return;
|
|
100
135
|
valueRef.current = markdown;
|
|
101
|
-
setMd(markdown);
|
|
136
|
+
if (showPreviewRef.current) setMd(markdown);
|
|
102
137
|
onChangeRef.current?.(markdown);
|
|
103
138
|
} catch (err) {
|
|
139
|
+
lastSerializedDoc.current = null;
|
|
104
140
|
console.error("Failed to save markdown:", err);
|
|
105
141
|
}
|
|
106
142
|
};
|
|
107
143
|
const setup = async () => {
|
|
108
|
-
const editorKits = await createEditorKits(
|
|
144
|
+
const { kits: editorKits, collaborative } = await createEditorKits(
|
|
145
|
+
collab,
|
|
146
|
+
mediaUpload
|
|
147
|
+
);
|
|
109
148
|
if (disposed) return;
|
|
110
149
|
editor$1 = editor.CoreEditor.create({
|
|
111
150
|
element: mount,
|
|
@@ -127,7 +166,7 @@ var RichEditor = react.forwardRef(
|
|
|
127
166
|
});
|
|
128
167
|
editor$1.addEventListener("transaction", onTransaction);
|
|
129
168
|
const joinRoom = () => {
|
|
130
|
-
if (collab && editor$1 && !disposed) {
|
|
169
|
+
if (collaborative && collab && editor$1 && !disposed) {
|
|
131
170
|
editor$1.run.changeRoom?.(collab.room);
|
|
132
171
|
reseedWhenRoomStaysEmpty();
|
|
133
172
|
}
|
package/dist/kerebron.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/RichEditor/editorKits.ts","../src/components/RichEditor/RichEditor.tsx","../src/components/RichEditor/CodeEditor.tsx"],"names":["AdvancedEditorKit","forwardRef","RichEditor","useIsDarkMode","useRef","useState","useEffect","editor","CoreEditor","createAssetLoad","useImperativeHandle","jsx","jsxs","CodeEditorKit"],"mappings":";;;;;;;;;;;AA4DA,IAAM,gBAAA,GAAmB,CAAC,cAAA,EAAgB,OAAO,CAAA;AAIjD,IAAM,wBAAN,MAAiD;AAAA,EAE/C,YAA6B,SAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AAAA,EAAqB;AAAA,EAArB,SAAA;AAAA,EAD7B,IAAA,GAAO,iBAAA;AAAA,EAGP,aAAA,GAAgB;AACd,IAAA,MAAM,OAAA,GAAoB,CAAC,GAAG,gBAAgB,CAAA;AAC9C,IAAA,IAAI,IAAA,CAAK,SAAA,EAAW,OAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AAE1C,IAAA,OAAO,IAAIA,mCAAA,EAAkB,CAC1B,aAAA,EAAc,CACd,MAAA;AAAA,MACC,CAAC,cACC,EAAE,MAAA,IAAU,aAAa,OAAA,CAAQ,QAAA,CAAS,UAAU,IAAI,CAAA;AAAA,KAC5D;AAAA,EACJ;AACF,CAAA;AAWA,eAAsB,iBACpB,MAAA,EACsB;AACtB,EAAA,IAAI,CAAC,MAAA,EAAQ,OAAO,CAAC,IAAI,qBAAA,CAAsB,KAAK,CAAC,CAAA;AAErD,EAAA,MAAM,EAAE,YAAA,EAAc,YAAA,EAAa,GAAI,MAAM,OAAO,0BAAa,CAAA;AACjE,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,KAAA,IAAS,YAAA,EAAa;AACzC,EAAA,OAAO;AAAA,IACL,IAAI,sBAAsB,IAAI,CAAA;AAAA,IAC9B,IAAI,YAAA;AAAA,MACF,GAAA;AAAA,MACA,MAAA,CAAO,UAAU,EAAC;AAAA,MAClB,MAAA,CAAO,iBAAA;AAAA,MACP,MAAA,CAAO;AAAA;AACT,GACF;AACF;ACxFA,IAAM,aAAA,G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@link RichEditor}, for both plain and collaborative\n * (Yjs) mode.\n *\n * Both modes start from {@link AdvancedEditorKit} and drop the extensions that\n * are unsafe for our usage — see {@link unsafeExtensions} — then collaborative\n * mode adds the Yjs pieces on top.\n *\n * The Yjs pieces live in `collabKit.ts` behind a dynamic `import()`, so\n * `@kerebron/extension-yjs`, `yjs` and `y-protocols` remain truly optional\n * peers — plain-mode consumers never load them.\n */\nimport type { EditorKit } from '@kerebron/editor';\nimport { AdvancedEditorKit } from '@kerebron/editor-kits/AdvancedEditorKit';\n\nexport interface CollabConfig {\n /** Room id — one shared document per room (e.g. a post id). */\n room: string;\n /**\n * WebSocket base URL for the Yjs relay. Defaults to\n * `<ws|wss>://<location.host>/yjs`. The room id is appended by the provider.\n */\n wsUrl?: string;\n /** Extra query params for the socket (e.g. `{ token }` for auth). */\n params?: Record<string, string>;\n /**\n * Who this editor is, published on awareness (`kerebron:user`) so peers see\n * a named, coloured cursor. Without it remote cursors do not render — the\n * position plugin skips awareness states that carry no user — and the\n * `id` is what the cursor colour is derived from (kerebron's `User` shape).\n */\n user?: { id: string; name: string; color?: string };\n /**\n * Custom WebSocket implementation handed to the Yjs provider — e.g. a\n * loopback socket for demos/tests, or a polyfill outside the browser.\n * Defaults to `globalThis.WebSocket`.\n */\n WebSocketPolyfill?: typeof globalThis.WebSocket;\n}\n\n/**\n * Extensions dropped from {@link AdvancedEditorKit}, and why.\n *\n * `autocomplete` and `hover` debounce their DOM handlers (200ms) and then call\n * `dispatchMeta`, which reads `this.editor.state` with no guard that the editor\n * is still alive. Any teardown or document swap inside that debounce window\n * lands the deferred call on a dead view and throws\n * `null.matchesNode()` inside ProseMirror's `EditorView.updateStateInner`,\n * leaving the view permanently broken. Two ways to hit it:\n * - remount (e.g. a `key` change) while the pointer is over the editor, which\n * fires the debounced `onMouseLeave` after the view is destroyed;\n * - a Yjs remote update replacing the document tree under a pending callback.\n * The first applies to *every* editor, so both extensions come out in both\n * modes. No functional cost — autocomplete popups and node-hover tooltips are\n * compositor conveniences, not required for editing.\n *\n * `history` is collab-only: ExtensionYjs supplies its own CRDT-aware undo/redo\n * and the editor throws `Extension conflict: yjs vs history` if both are\n * present. Plain mode keeps it, so undo/redo still works there.\n */\nconst unsafeExtensions = ['autocomplete', 'hover'] as const;\n\n/** {@link AdvancedEditorKit} minus {@link unsafeExtensions} (and, for collab\n * mode, minus `history`). */\nclass SafeAdvancedEditorKit implements EditorKit {\n name = 'advanced-editor';\n constructor(private readonly forCollab: boolean) {}\n\n getExtensions() {\n const dropped: string[] = [...unsafeExtensions];\n if (this.forCollab) dropped.push('history');\n\n return new AdvancedEditorKit()\n .getExtensions()\n .filter(\n (extension) =>\n !('name' in extension && dropped.includes(extension.name))\n );\n }\n}\n\n/** MarkYChange + ExtensionYjs live in `collabKit.ts` (lazy-loaded). */\n\n/**\n * Build the editor kits for a session. Pass `config` to join a collaborative\n * room; omit it for a plain local editor.\n *\n * Async because collaborative mode lazy-loads the Yjs kit (and its optional\n * peer deps) on first use; plain mode resolves immediately.\n */\nexport async function createEditorKits(\n config?: CollabConfig\n): Promise<EditorKit[]> {\n if (!config) return [new SafeAdvancedEditorKit(false)];\n\n const { HuddleYjsKit, defaultWsUrl } = await import('./collabKit');\n const url = config.wsUrl ?? defaultWsUrl();\n return [\n new SafeAdvancedEditorKit(true),\n new HuddleYjsKit(\n url,\n config.params ?? {},\n config.WebSocketPolyfill,\n config.user\n ),\n ];\n}\n","'use client';\n\nimport {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\n\nimport { CoreEditor, type AssetLoad } from '@kerebron/editor';\nimport { createAssetLoad } from '@kerebron/wasm/web';\n\nimport { useIsDarkMode } from '../../hooks/useIsDarkMode';\nimport { createEditorKits, type CollabConfig } from './editorKits';\n\nexport type { CollabConfig } from './editorKits';\n\nconst MARKDOWN_TYPE = 'text/x-markdown';\n\n/**\n * The markdown converter's tree-sitter WASM init is not concurrency-safe, so\n * every editor's *first* load queues behind the previous one. Later loads (a\n * `value` change) are free — by then the grammars are warm.\n */\nlet initialLoadQueue: Promise<unknown> = Promise.resolve();\n\nfunction queueInitialLoad(load: () => Promise<void>): Promise<void> {\n const queued = initialLoadQueue.catch(() => undefined).then(load);\n initialLoadQueue = queued.catch(() => undefined);\n return queued;\n}\n\nexport interface RichEditorProps {\n /** Markdown to load. Changing it reloads the editor unless `collab` is set. */\n value?: string;\n /** Called with the editor's markdown content whenever it changes. */\n onChange?: (value: string) => void;\n /** Whether to render the live markdown output preview. Defaults to `false`. */\n showPreview?: boolean;\n /**\n * Enable live collaborative editing (Yjs) for the given room. When set, the\n * editor connects to the `/yjs` websocket relay and every peer in the same\n * `room` co-edits one shared document. Uncontrolled like `value` — remount via\n * `key` to switch rooms.\n */\n collab?: CollabConfig;\n /** Read-only surface: no typing, and the content dims. */\n disabled?: boolean;\n /**\n * Id for the editor host element — an `aria-labelledby`/`aria-describedby`\n * anchor. The host is a `div`, not a labelable control, so a\n * `<label htmlFor>` will not associate; name the editor with `aria-label`\n * or `aria-labelledby` instead.\n */\n id?: string;\n /** Extra classes on the editor surface, beside `kb-component`. */\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /**\n * Where the tree-sitter WASM grammars load from. Defaults to\n * `createAssetLoad('/kerebron-wasm')`; supply your own when the host serves\n * `@kerebron/wasm`'s `assets/` somewhere else.\n */\n assetLoad?: AssetLoad;\n}\n\nexport interface RichEditorHandle {\n /**\n * The editor's markdown, awaiting the initial load. `onChange` can lag the\n * last keystroke, so read this on submit rather than trusting mirrored state.\n */\n getContent: () => Promise<string>;\n /** Focus the editor, restoring the caret where the writer left it. */\n focus: () => void;\n}\n\n/**\n * Markdown editor over Kerebron's `CoreEditor`.\n *\n * The editor mounts into a **disposable child div**: `CoreEditor.destroy()`\n * replaces its host element with a clone, which would strand React's ref (and,\n * under StrictMode's double-mount, leave the live editor detached behind a\n * dead clone).\n */\nconst RichEditor = forwardRef<RichEditorHandle, RichEditorProps>(\n function RichEditor(\n {\n value = '',\n onChange,\n showPreview = false,\n collab,\n disabled = false,\n id,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n assetLoad,\n },\n ref\n ) {\n const isDark = useIsDarkMode();\n const hostRef = useRef<HTMLDivElement>(null);\n const editorInstance = useRef<CoreEditor | null>(null);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n // Mirrors what the editor last held, so an echo of our own `onChange`\n // doesn't reload the document out from under the caret.\n const valueRef = useRef(value);\n const readyRef = useRef<Promise<void> | null>(null);\n const loadingRef = useRef(false);\n const disabledRef = useRef(disabled);\n\n const [md, setMd] = useState<string>('');\n\n useEffect(() => {\n disabledRef.current = disabled;\n editorInstance.current?.view.setProps({\n editable: () => !disabledRef.current,\n });\n }, [disabled]);\n\n useEffect(() => {\n // In collab mode the CRDT owns the content; reloading would fight it.\n if (collab || value === valueRef.current) return;\n valueRef.current = value;\n const editor = editorInstance.current;\n if (!editor) return;\n\n loadingRef.current = true;\n void editor\n .loadDocumentText(MARKDOWN_TYPE, value)\n .catch(() => undefined)\n .finally(() => {\n if (editorInstance.current === editor) loadingRef.current = false;\n });\n // `collab` is fixed for the lifetime of the instance.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n useEffect(() => {\n if (!hostRef.current) return;\n const host = hostRef.current;\n\n // Set on cleanup so async continuations (kit loading and the\n // `loadDocumentText` chain) don't touch the editor after `destroy()`.\n let disposed = false;\n let editor: CoreEditor | null = null;\n\n const mount = document.createElement('div');\n host.appendChild(mount);\n\n // Listen to transactions and update markdown preview\n const onTransaction = async () => {\n // Programmatic loads are not edits — reporting them would echo the\n // caller's own `value` back through `onChange`.\n if (loadingRef.current || !editorInstance.current) return;\n\n try {\n const buffer =\n await editorInstance.current.saveDocument(MARKDOWN_TYPE);\n const markdown = new globalThis.TextDecoder().decode(buffer);\n if (disposed) return;\n valueRef.current = markdown;\n setMd(markdown);\n onChangeRef.current?.(markdown);\n } catch (err) {\n console.error('Failed to save markdown:', err);\n }\n };\n\n // Initialize the editor. Both modes drop the teardown-unsafe extensions;\n // collaborative mode additionally swaps `history` for the Yjs CRDT sync\n // and lazy-loads the Yjs kit (see `editorKits.ts` for why).\n const setup = async () => {\n const editorKits = await createEditorKits(collab);\n if (disposed) return;\n\n editor = CoreEditor.create({\n element: mount,\n uri: 'file:///untitled.md',\n assetLoad: assetLoad ?? createAssetLoad('/kerebron-wasm'),\n editorKits,\n readOnly: disabledRef.current,\n });\n\n editorInstance.current = editor;\n // The contenteditable surface has no implicit ARIA role, so labeling\n // attributes are only permitted alongside an explicit textbox role.\n const surfaceAttributes =\n ariaLabel || ariaLabelledBy\n ? {\n role: 'textbox',\n 'aria-multiline': 'true',\n ...(ariaLabel ? { 'aria-label': ariaLabel } : {}),\n ...(ariaLabelledBy\n ? { 'aria-labelledby': ariaLabelledBy }\n : {}),\n }\n : null;\n editor.view.setProps({\n editable: () => !disabledRef.current,\n ...(surfaceAttributes ? { attributes: surfaceAttributes } : {}),\n });\n editor.addEventListener('transaction', onTransaction);\n\n // Seed initial content, then populate the preview once on mount.\n //\n // In collaborative mode we still load the local markdown first, then\n // join the room: the Yjs binding seeds an *empty* shared document from\n // this content on the first join, and overwrites the editor with the\n // shared content when the room already has edits — so the stored\n // markdown is the starting point without ever double-inserting.\n const joinRoom = () => {\n if (collab && editor && !disposed) {\n (\n editor.run as Record<string, (...args: unknown[]) => boolean>\n ).changeRoom?.(collab.room);\n reseedWhenRoomStaysEmpty();\n }\n };\n\n // The Yjs binding is supposed to seed an empty room from the local\n // content, but the sync import can land as an overwrite that blanks\n // the just-loaded seed (observed with extension-yjs 0.8.x). Heal it:\n // once the join settles, an empty document with a non-empty seed\n // means nobody's content won — reload the seed, which the binding\n // then pushes into the room. Joiners pass no value, so exactly one\n // participant ever does this.\n const seed = valueRef.current;\n const reseedWhenRoomStaysEmpty = () => {\n if (!seed) return;\n const check = async (attempt: number) => {\n if (disposed || !editorInstance.current) return;\n try {\n const buffer =\n await editorInstance.current.saveDocument(MARKDOWN_TYPE);\n const current = new globalThis.TextDecoder()\n .decode(buffer)\n .trim();\n if (disposed || !editorInstance.current) return;\n if (current) return; // somebody's content arrived — done\n if (attempt >= 2) {\n await editorInstance.current.loadDocumentText(\n MARKDOWN_TYPE,\n seed\n );\n return;\n }\n setTimeout(() => void check(attempt + 1), 300);\n } catch {\n // A failed probe must not break the editor; the room stays as-is.\n }\n };\n setTimeout(() => void check(0), 300);\n };\n\n if (valueRef.current) {\n await queueInitialLoad(() =>\n editor!.loadDocumentText(MARKDOWN_TYPE, valueRef.current)\n );\n await onTransaction();\n joinRoom();\n } else {\n void onTransaction();\n joinRoom();\n }\n };\n\n readyRef.current = setup().catch((err) =>\n console.error('Failed to set up editor:', err)\n );\n\n // Cleanup on unmount\n return () => {\n disposed = true;\n editorInstance.current = null; // makes onTransaction's guard effective\n editor?.removeEventListener('transaction', onTransaction);\n editor?.destroy();\n readyRef.current = null;\n host.replaceChildren();\n };\n // Initial `value`/`collab` are intentionally only applied on mount\n // (uncontrolled). Remount via `key` to switch rooms.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n getContent: async (): Promise<string> => {\n await readyRef.current;\n const editor = editorInstance.current;\n if (!editor) return valueRef.current;\n const buffer = await editor.saveDocument(MARKDOWN_TYPE);\n const markdown = new globalThis.TextDecoder().decode(buffer);\n valueRef.current = markdown;\n return markdown;\n },\n focus: (): void => {\n const apply = (): void => {\n const view = editorInstance.current?.view as\n | { focus?: () => void }\n | undefined;\n if (view?.focus) {\n view.focus();\n return;\n }\n hostRef.current\n ?.querySelector<HTMLElement>('[contenteditable=\"true\"], textarea')\n ?.focus();\n };\n // Callers focus on mount; the editor may still be loading its kits.\n if (editorInstance.current) apply();\n else void readyRef.current?.then(apply);\n },\n }),\n []\n );\n\n return (\n <div>\n <div>\n <div\n ref={hostRef}\n id={id}\n className={[\n 'kb-component',\n isDark ? 'kb-component--dark' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-disabled={disabled || undefined}\n style={{\n isolation: 'isolate',\n opacity: disabled ? 0.65 : undefined,\n pointerEvents: disabled ? 'none' : undefined,\n }}\n />\n </div>\n\n {showPreview && (\n <div>\n <div>\n <h5>Markdown Output</h5>\n <pre>{md}</pre>\n </div>\n </div>\n )}\n </div>\n );\n }\n);\n\nRichEditor.displayName = 'RichEditor';\n\nexport { RichEditor };\n","import React, { useEffect, useRef } from 'react';\n\nimport { CoreEditor } from '@kerebron/editor';\nimport { CodeEditorKit } from '@kerebron/editor-kits/CodeEditorKit';\nimport { createAssetLoad } from '@kerebron/wasm/web';\n\nexport interface CodeEditorProps {\n /** Initial source code to load into the editor. */\n value?: string;\n /** Called with the editor's contents whenever they change. */\n onChange?: (value: string) => void;\n /** Language/grammar to use for syntax highlighting. Defaults to `typescript`. */\n lang?: string;\n}\n\nconst CodeEditor: React.FC<CodeEditorProps> = ({\n value = '',\n onChange,\n lang = 'typescript',\n}) => {\n const editorRef = useRef<HTMLDivElement>(null);\n const editorInstance = useRef<CoreEditor | null>(null);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n useEffect(() => {\n const root = editorRef.current;\n if (!root) return;\n\n const applySelectLabel = () => {\n root.querySelectorAll('select.codejar-select').forEach((element) => {\n if (!element.getAttribute('aria-label')) {\n element.setAttribute('aria-label', 'Code editor language');\n }\n });\n };\n\n applySelectLabel();\n const observer = new MutationObserver(() => applySelectLabel());\n observer.observe(root, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, []);\n\n useEffect(() => {\n if (!editorRef.current) return;\n\n // Initialize the editor\n const editor = CoreEditor.create({\n element: editorRef.current,\n uri: 'file:///untitled.ts',\n assetLoad: createAssetLoad('/kerebron-wasm'),\n editorKits: [new CodeEditorKit(lang)],\n });\n\n editorInstance.current = editor;\n\n // Surface edits to callers.\n const onTransaction = async () => {\n if (!editorInstance.current) return;\n\n try {\n const buffer = await editorInstance.current.saveDocument('text/plain');\n onChangeRef.current?.(new globalThis.TextDecoder().decode(buffer));\n } catch (err) {\n console.error('Failed to read code:', err);\n }\n };\n\n editor.addEventListener('transaction', onTransaction);\n\n // Seed initial content on mount.\n if (value) {\n editor\n .loadDocumentText('text/plain', value)\n .catch((err) => console.error('Failed to load code:', err));\n }\n\n // Cleanup on unmount\n return () => {\n editor.removeEventListener('transaction', onTransaction);\n editor.destroy();\n };\n // Initial `value`/`lang` are intentionally only applied on mount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div>\n <div>\n <div ref={editorRef} className=\"kb-component\" />\n </div>\n </div>\n );\n};\n\nCodeEditor.displayName = 'CodeEditor';\n\nexport { CodeEditor };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/RichEditor/editorKits.ts","../src/components/RichEditor/RichEditor.tsx","../src/components/RichEditor/CodeEditor.tsx"],"names":["AdvancedEditorKit","ExtensionMediaUpload","forwardRef","RichEditor","useIsDarkMode","useRef","useState","useEffect","editor","CoreEditor","createAssetLoad","useImperativeHandle","jsx","jsxs","CodeEditorKit"],"mappings":";;;;;;;;;;;;AAyFA,IAAM,gBAAA,GAAmB,CAAC,cAAA,EAAgB,OAAO,CAAA;AAUjD,IAAM,wBAAN,MAAiD;AAAA,EAE/C,WAAA,CACmB,WACA,WAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AACA,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA;AAAA,EAChB;AAAA,EAFgB,SAAA;AAAA,EACA,WAAA;AAAA,EAHnB,IAAA,GAAO,iBAAA;AAAA,EAMP,aAAA,GAAgB;AACd,IAAA,MAAM,OAAA,GAAoB,CAAC,GAAG,gBAAgB,CAAA;AAC9C,IAAA,IAAI,IAAA,CAAK,SAAA,EAAW,OAAA,CAAQ,IAAA,CAAK,SAAS,CAAA;AAC1C,IAAA,IAAI,IAAA,C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AO;AACT,MAAAA,QAAA,CACG,gBAAA,CAAiB,YAAA,EAAc,KAAK,CAAA,CACpC,KAAA,CAAM,CAAC,GAAA,KAAQ,OAAA,CAAQ,KAAA,CAAM,sBAAA,EAAwB,GAAG,CAAC,CAAA;AAAA,IAC9D;AAGA,IAAA,OAAO,MAAM;AACX,MAAAA,QAAA,CAAO,mBAAA,CAAoB,eAAe,aAAa,CAAA;AACvD,MAAAA,QAAA,CAAO,OAAA,EAAQ;AAAA,IACjB,CAAA;AAAA,EAGF,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,uBACEI,cAAAA,CAAC,KAAA,EAAA,EACC,QAAA,kBAAAA,eAAC,KAAA,EAAA,EACC,QAAA,kBAAAA,cAAAA,CAAC,KAAA,EAAA,EAAI,GAAA,EAAK,SAAA,EAAW,SAAA,EAAU,cAAA,EAAe,GAChD,CAAA,EACF,CAAA;AAEJ;AAEA,UAAA,CAAW,WAAA,GAAc,YAAA","file":"kerebron.cjs","sourcesContent":["/**\n * Editor kit assembly for {@link RichEditor}, for both plain and collaborative\n * (Yjs) mode.\n *\n * Both modes start from {@link AdvancedEditorKit} and drop the extensions that\n * are unsafe for our usage — see {@link unsafeExtensions} — then collaborative\n * mode adds the Yjs pieces on top.\n *\n * The Yjs pieces live in `collabKit.ts` behind a dynamic `import()`, so\n * `@kerebron/extension-yjs`, `yjs` and `y-protocols` remain truly optional\n * peers — plain-mode consumers never load them.\n */\nimport type { EditorKit } from '@kerebron/editor';\nimport { AdvancedEditorKit } from '@kerebron/editor-kits/AdvancedEditorKit';\nimport {\n ExtensionMediaUpload,\n type MediaUploadOptions,\n} from '@kerebron/extension-basic-editor/ExtensionMediaUpload';\n\nexport type { MediaUploadOptions };\n\nexport interface CollabConfig {\n /** Room id — one shared document per room (e.g. a post id). */\n room: string;\n /**\n * WebSocket base URL for the Yjs relay. Defaults to\n * `<ws|wss>://<location.host>/yjs`. The room id is appended by the provider.\n */\n wsUrl?: string;\n /** Extra query params for the socket (e.g. `{ token }` for auth). */\n params?: Record<string, string>;\n /**\n * Who this editor is, published on awareness (`kerebron:user`) so peers see\n * a named, coloured cursor. Without it remote cursors do not render — the\n * position plugin skips awareness states that carry no user — and the\n * `id` is what the cursor colour is derived from (kerebron's `User` shape).\n */\n user?: { id: string; name: string; color?: string };\n /**\n * Custom WebSocket implementation handed to the Yjs provider — e.g. a\n * loopback socket for demos/tests, or a polyfill outside the browser.\n * Defaults to `globalThis.WebSocket`.\n */\n WebSocketPolyfill?: typeof globalThis.WebSocket;\n /**\n * Called when collaborative editing could not be started at all — the Yjs\n * kit failed to load (see {@link createEditorKits}). The editor mounts\n * anyway, as a local one; this is how the host finds out that edits are no\n * longer shared, so it can say so, or tear its own editor down if unshared\n * editing would be unsafe.\n *\n * Not for connection trouble: a room that is reachable but currently\n * disconnected still has the Yjs kit loaded, and the provider retries on its\n * own. This fires once, before the editor is created.\n */\n onUnavailable?: (error: unknown) => void;\n}\n\n/** What {@link createEditorKits} resolves to. */\nexport interface EditorKits {\n kits: EditorKit[];\n /**\n * Whether the returned kits can actually collaborate. False when `config`\n * asked for a room but the Yjs kit could not be loaded, so callers know not\n * to join one.\n */\n collaborative: boolean;\n}\n\n/**\n * Extensions dropped from {@link AdvancedEditorKit}, and why.\n *\n * `autocomplete` and `hover` debounce their DOM handlers (200ms) and then call\n * `dispatchMeta`, which reads `this.editor.state` with no guard that the editor\n * is still alive. Any teardown or document swap inside that debounce window\n * lands the deferred call on a dead view and throws\n * `null.matchesNode()` inside ProseMirror's `EditorView.updateStateInner`,\n * leaving the view permanently broken. Two ways to hit it:\n * - remount (e.g. a `key` change) while the pointer is over the editor, which\n * fires the debounced `onMouseLeave` after the view is destroyed;\n * - a Yjs remote update replacing the document tree under a pending callback.\n * The first applies to *every* editor, so both extensions come out in both\n * modes. No functional cost — autocomplete popups and node-hover tooltips are\n * compositor conveniences, not required for editing.\n *\n * `history` is collab-only: ExtensionYjs supplies its own CRDT-aware undo/redo\n * and the editor throws `Extension conflict: yjs vs history` if both are\n * present. Plain mode keeps it, so undo/redo still works there.\n */\nconst unsafeExtensions = ['autocomplete', 'hover'] as const;\n\n/**\n * {@link AdvancedEditorKit} minus {@link unsafeExtensions} (and, for collab\n * mode, minus `history`), with `mediaUpload` reconfigured when the host asks.\n *\n * `AdvancedEditorKit` constructs `ExtensionMediaUpload` with no options, and an\n * extension's options are fixed at construction — so the only way to configure\n * it is to drop that instance and append one of our own.\n */\nclass SafeAdvancedEditorKit implements EditorKit {\n name = 'advanced-editor';\n constructor(\n private readonly forCollab: boolean,\n private readonly mediaUpload?: MediaUploadOptions\n ) {}\n\n getExtensions() {\n const dropped: string[] = [...unsafeExtensions];\n if (this.forCollab) dropped.push('history');\n if (this.mediaUpload) dropped.push('mediaUpload');\n\n const extensions = new AdvancedEditorKit()\n .getExtensions()\n .filter(\n (extension) =>\n !('name' in extension && dropped.includes(extension.name))\n );\n\n if (this.mediaUpload) {\n extensions.push(new ExtensionMediaUpload(this.mediaUpload));\n }\n return extensions;\n }\n}\n\n/** MarkYChange + ExtensionYjs live in `collabKit.ts` (lazy-loaded). */\n\n/**\n * Build the editor kits for a session. Pass `config` to join a collaborative\n * room; omit it for a plain local editor. Pass `mediaUpload` to configure how\n * pasted/dropped files are handled — most importantly `uploadHandler`, without\n * which every image is embedded in the document as a base64 `data:` URL.\n *\n * Async because collaborative mode lazy-loads the Yjs kit (and its optional\n * peer deps) on first use; plain mode resolves immediately.\n *\n * That lazy load is allowed to fail. `@kerebron/extension-yjs`, `yjs` and\n * `y-protocols` are optional peers, so the chunk can be absent (peers never\n * installed), stale (a dev server's dependency hash moved under a running\n * page) or simply unreachable (a partial deploy, an offline client). None of\n * that is a reason to leave the caller without an editor: collaboration is an\n * enhancement, editing is the feature. So a failed load degrades to the local\n * kit and reports itself through {@link CollabConfig.onUnavailable} rather\n * than rejecting.\n */\nexport async function createEditorKits(\n config?: CollabConfig,\n mediaUpload?: MediaUploadOptions\n): Promise<EditorKits> {\n if (!config) {\n return {\n kits: [new SafeAdvancedEditorKit(false, mediaUpload)],\n collaborative: false,\n };\n }\n\n try {\n const { HuddleYjsKit, defaultWsUrl } = await import('./collabKit');\n const url = config.wsUrl ?? defaultWsUrl();\n return {\n kits: [\n new SafeAdvancedEditorKit(true, mediaUpload),\n new HuddleYjsKit(\n url,\n config.params ?? {},\n config.WebSocketPolyfill,\n config.user\n ),\n ],\n collaborative: true,\n };\n } catch (error) {\n console.warn(\n '[RichEditor] Collaborative editing unavailable — the Yjs kit failed to load. Continuing as a local editor.',\n error\n );\n config.onUnavailable?.(error);\n // Degrading to a local editor must not also drop `mediaUpload`: without it\n // the stock extension comes back and pasted files are embedded as base64.\n return {\n kits: [new SafeAdvancedEditorKit(false, mediaUpload)],\n collaborative: false,\n };\n }\n}\n","'use client';\n\nimport {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\n\nimport { CoreEditor, type AssetLoad } from '@kerebron/editor';\nimport { createAssetLoad } from '@kerebron/wasm/web';\n\nimport { useIsDarkMode } from '../../hooks/useIsDarkMode';\nimport {\n createEditorKits,\n type CollabConfig,\n type MediaUploadOptions,\n} from './editorKits';\n\nexport type { CollabConfig, MediaUploadOptions } from './editorKits';\n\nconst MARKDOWN_TYPE = 'text/x-markdown';\n\n/**\n * The markdown converter's tree-sitter WASM init is not concurrency-safe, so\n * every editor's *first* load queues behind the previous one. Later loads (a\n * `value` change) are free — by then the grammars are warm.\n */\nlet initialLoadQueue: Promise<unknown> = Promise.resolve();\n\nfunction queueInitialLoad(load: () => Promise<void>): Promise<void> {\n const queued = initialLoadQueue.catch(() => undefined).then(load);\n initialLoadQueue = queued.catch(() => undefined);\n return queued;\n}\n\nexport interface RichEditorProps {\n /** Markdown to load. Changing it reloads the editor unless `collab` is set. */\n value?: string;\n /** Called with the editor's markdown content whenever it changes. */\n onChange?: (value: string) => void;\n /** Whether to render the live markdown output preview. Defaults to `false`. */\n showPreview?: boolean;\n /**\n * Enable live collaborative editing (Yjs) for the given room. When set, the\n * editor connects to the `/yjs` websocket relay and every peer in the same\n * `room` co-edits one shared document. Uncontrolled like `value` — remount via\n * `key` to switch rooms.\n *\n * Best-effort: if the Yjs kit cannot be loaded the editor still mounts, as a\n * local one, and `collab.onUnavailable` is called. Pass that callback if\n * unshared editing is something your users need to be told about.\n */\n collab?: CollabConfig;\n /** Read-only surface: no typing, and the content dims. */\n disabled?: boolean;\n /**\n * Id for the editor host element — an `aria-labelledby`/`aria-describedby`\n * anchor. The host is a `div`, not a labelable control, so a\n * `<label htmlFor>` will not associate; name the editor with `aria-label`\n * or `aria-labelledby` instead.\n */\n id?: string;\n /** Extra classes on the editor surface, beside `kb-component`. */\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /**\n * Where the tree-sitter WASM grammars load from. Defaults to\n * `createAssetLoad('/kerebron-wasm')`; supply your own when the host serves\n * `@kerebron/wasm`'s `assets/` somewhere else.\n */\n assetLoad?: AssetLoad;\n /**\n * How files pasted or dropped into the editor are handled.\n *\n * **Set `uploadHandler` if your documents are persisted anywhere.** Without\n * it, a pasted image is embedded in the document as a base64 `data:` URL and\n * a video as a blob object URL: a 4 MB screenshot becomes ~5.8 MB of\n * markdown, which most APIs will refuse, and an object URL is dead as soon as\n * the page reloads. `uploadHandler` receives the file and returns the URL to\n * reference it by, so the document carries a link instead of the bytes.\n *\n * ```tsx\n * <RichEditor\n * mediaUpload={{ uploadHandler: (file) => uploadToMyMediaStore(file) }}\n * />\n * ```\n *\n * Read once, when the editor mounts — like {@link collab}, remount via `key`\n * to change it.\n */\n mediaUpload?: MediaUploadOptions;\n}\n\nexport interface RichEditorHandle {\n /**\n * The editor's markdown, awaiting the initial load. `onChange` can lag the\n * last keystroke, so read this on submit rather than trusting mirrored state.\n */\n getContent: () => Promise<string>;\n /** Focus the editor, restoring the caret where the writer left it. */\n focus: () => void;\n}\n\n/**\n * Markdown editor over Kerebron's `CoreEditor`.\n *\n * The editor mounts into a **disposable child div**: `CoreEditor.destroy()`\n * replaces its host element with a clone, which would strand React's ref (and,\n * under StrictMode's double-mount, leave the live editor detached behind a\n * dead clone).\n */\nconst RichEditor = forwardRef<RichEditorHandle, RichEditorProps>(\n function RichEditor(\n {\n value = '',\n onChange,\n showPreview = false,\n collab,\n disabled = false,\n id,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n assetLoad,\n mediaUpload,\n },\n ref\n ) {\n const isDark = useIsDarkMode();\n const hostRef = useRef<HTMLDivElement>(null);\n const editorInstance = useRef<CoreEditor | null>(null);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n // Mirrors what the editor last held, so an echo of our own `onChange`\n // doesn't reload the document out from under the caret.\n const valueRef = useRef(value);\n const readyRef = useRef<Promise<void> | null>(null);\n const loadingRef = useRef(false);\n const disabledRef = useRef(disabled);\n\n const [md, setMd] = useState<string>('');\n // Serializing the document is the expensive part of a transaction, so the\n // last doc that was serialized is kept to recognise the transactions that\n // did not change it. ProseMirror documents are immutable, so identity is an\n // exact test.\n const lastSerializedDoc = useRef<unknown>(null);\n // Read inside the transaction handler, which is created once on mount.\n const showPreviewRef = useRef(showPreview);\n showPreviewRef.current = showPreview;\n\n useEffect(() => {\n disabledRef.current = disabled;\n editorInstance.current?.view.setProps({\n editable: () => !disabledRef.current,\n });\n }, [disabled]);\n\n useEffect(() => {\n // In collab mode the CRDT owns the content; reloading would fight it.\n if (collab || value === valueRef.current) return;\n valueRef.current = value;\n const editor = editorInstance.current;\n if (!editor) return;\n\n loadingRef.current = true;\n void editor\n .loadDocumentText(MARKDOWN_TYPE, value)\n .catch(() => undefined)\n .finally(() => {\n if (editorInstance.current === editor) loadingRef.current = false;\n });\n // `collab` is fixed for the lifetime of the instance.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n useEffect(() => {\n if (!hostRef.current) return;\n const host = hostRef.current;\n\n // Set on cleanup so async continuations (kit loading and the\n // `loadDocumentText` chain) don't touch the editor after `destroy()`.\n let disposed = false;\n let editor: CoreEditor | null = null;\n\n const mount = document.createElement('div');\n host.appendChild(mount);\n\n // Listen to transactions and update markdown preview\n const onTransaction = async () => {\n // Programmatic loads are not edits — reporting them would echo the\n // caller's own `value` back through `onChange`.\n if (loadingRef.current || !editorInstance.current) return;\n\n // ProseMirror fires a transaction for every selection change too —\n // arrow keys, clicks, a blur. Serializing the whole document to\n // markdown for those costs a full tree-sitter pass and two React\n // renders for a caret move, so only a changed document is re-read.\n const { doc } = editorInstance.current.view.state;\n if (doc === lastSerializedDoc.current) return;\n lastSerializedDoc.current = doc;\n\n try {\n const buffer =\n await editorInstance.current.saveDocument(MARKDOWN_TYPE);\n const markdown = new globalThis.TextDecoder().decode(buffer);\n if (disposed) return;\n valueRef.current = markdown;\n // `md` only feeds the preview pane; setting it with the preview off\n // re-renders the editor on every keystroke for nothing.\n if (showPreviewRef.current) setMd(markdown);\n onChangeRef.current?.(markdown);\n } catch (err) {\n // The document was marked as serialized before the attempt, to keep\n // selection-only transactions arriving mid-save from re-entering.\n // A failure has to undo that, or this document is never retried.\n lastSerializedDoc.current = null;\n console.error('Failed to save markdown:', err);\n }\n };\n\n // Initialize the editor. Both modes drop the teardown-unsafe extensions;\n // collaborative mode additionally swaps `history` for the Yjs CRDT sync\n // and lazy-loads the Yjs kit (see `editorKits.ts` for why).\n const setup = async () => {\n // `collaborative` is false when a room was asked for but the Yjs kit\n // could not be loaded — the editor is still created, just a local one,\n // so there is no room to join below.\n const { kits: editorKits, collaborative } = await createEditorKits(\n collab,\n mediaUpload\n );\n if (disposed) return;\n\n editor = CoreEditor.create({\n element: mount,\n uri: 'file:///untitled.md',\n assetLoad: assetLoad ?? createAssetLoad('/kerebron-wasm'),\n editorKits,\n readOnly: disabledRef.current,\n });\n\n editorInstance.current = editor;\n // The contenteditable surface has no implicit ARIA role, so labeling\n // attributes are only permitted alongside an explicit textbox role.\n const surfaceAttributes =\n ariaLabel || ariaLabelledBy\n ? {\n role: 'textbox',\n 'aria-multiline': 'true',\n ...(ariaLabel ? { 'aria-label': ariaLabel } : {}),\n ...(ariaLabelledBy\n ? { 'aria-labelledby': ariaLabelledBy }\n : {}),\n }\n : null;\n editor.view.setProps({\n editable: () => !disabledRef.current,\n ...(surfaceAttributes ? { attributes: surfaceAttributes } : {}),\n });\n editor.addEventListener('transaction', onTransaction);\n\n // Seed initial content, then populate the preview once on mount.\n //\n // In collaborative mode we still load the local markdown first, then\n // join the room: the Yjs binding seeds an *empty* shared document from\n // this content on the first join, and overwrites the editor with the\n // shared content when the room already has edits — so the stored\n // markdown is the starting point without ever double-inserting.\n const joinRoom = () => {\n if (collaborative && collab && editor && !disposed) {\n (\n editor.run as Record<string, (...args: unknown[]) => boolean>\n ).changeRoom?.(collab.room);\n reseedWhenRoomStaysEmpty();\n }\n };\n\n // The Yjs binding is supposed to seed an empty room from the local\n // content, but the sync import can land as an overwrite that blanks\n // the just-loaded seed (observed with extension-yjs 0.8.x). Heal it:\n // once the join settles, an empty document with a non-empty seed\n // means nobody's content won — reload the seed, which the binding\n // then pushes into the room. Joiners pass no value, so exactly one\n // participant ever does this.\n const seed = valueRef.current;\n const reseedWhenRoomStaysEmpty = () => {\n if (!seed) return;\n const check = async (attempt: number) => {\n if (disposed || !editorInstance.current) return;\n try {\n const buffer =\n await editorInstance.current.saveDocument(MARKDOWN_TYPE);\n const current = new globalThis.TextDecoder()\n .decode(buffer)\n .trim();\n if (disposed || !editorInstance.current) return;\n if (current) return; // somebody's content arrived — done\n if (attempt >= 2) {\n await editorInstance.current.loadDocumentText(\n MARKDOWN_TYPE,\n seed\n );\n return;\n }\n setTimeout(() => void check(attempt + 1), 300);\n } catch {\n // A failed probe must not break the editor; the room stays as-is.\n }\n };\n setTimeout(() => void check(0), 300);\n };\n\n if (valueRef.current) {\n await queueInitialLoad(() =>\n editor!.loadDocumentText(MARKDOWN_TYPE, valueRef.current)\n );\n await onTransaction();\n joinRoom();\n } else {\n void onTransaction();\n joinRoom();\n }\n };\n\n readyRef.current = setup().catch((err) =>\n console.error('Failed to set up editor:', err)\n );\n\n // Cleanup on unmount\n return () => {\n disposed = true;\n editorInstance.current = null; // makes onTransaction's guard effective\n editor?.removeEventListener('transaction', onTransaction);\n editor?.destroy();\n readyRef.current = null;\n host.replaceChildren();\n };\n // Initial `value`/`collab` are intentionally only applied on mount\n // (uncontrolled). Remount via `key` to switch rooms.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n getContent: async (): Promise<string> => {\n await readyRef.current;\n const editor = editorInstance.current;\n if (!editor) return valueRef.current;\n const buffer = await editor.saveDocument(MARKDOWN_TYPE);\n const markdown = new globalThis.TextDecoder().decode(buffer);\n valueRef.current = markdown;\n return markdown;\n },\n focus: (): void => {\n const apply = (): void => {\n const view = editorInstance.current?.view as\n | { focus?: () => void }\n | undefined;\n if (view?.focus) {\n view.focus();\n return;\n }\n hostRef.current\n ?.querySelector<HTMLElement>('[contenteditable=\"true\"], textarea')\n ?.focus();\n };\n // Callers focus on mount; the editor may still be loading its kits.\n if (editorInstance.current) apply();\n else void readyRef.current?.then(apply);\n },\n }),\n []\n );\n\n return (\n <div>\n <div>\n <div\n ref={hostRef}\n id={id}\n className={[\n 'kb-component',\n isDark ? 'kb-component--dark' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ')}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-disabled={disabled || undefined}\n style={{\n isolation: 'isolate',\n opacity: disabled ? 0.65 : undefined,\n pointerEvents: disabled ? 'none' : undefined,\n }}\n />\n </div>\n\n {showPreview && (\n <div>\n <div>\n <h5>Markdown Output</h5>\n <pre>{md}</pre>\n </div>\n </div>\n )}\n </div>\n );\n }\n);\n\nRichEditor.displayName = 'RichEditor';\n\nexport { RichEditor };\n","import React, { useEffect, useRef } from 'react';\n\nimport { CoreEditor } from '@kerebron/editor';\nimport { CodeEditorKit } from '@kerebron/editor-kits/CodeEditorKit';\nimport { createAssetLoad } from '@kerebron/wasm/web';\n\nexport interface CodeEditorProps {\n /** Initial source code to load into the editor. */\n value?: string;\n /** Called with the editor's contents whenever they change. */\n onChange?: (value: string) => void;\n /** Language/grammar to use for syntax highlighting. Defaults to `typescript`. */\n lang?: string;\n}\n\nconst CodeEditor: React.FC<CodeEditorProps> = ({\n value = '',\n onChange,\n lang = 'typescript',\n}) => {\n const editorRef = useRef<HTMLDivElement>(null);\n const editorInstance = useRef<CoreEditor | null>(null);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n useEffect(() => {\n const root = editorRef.current;\n if (!root) return;\n\n const applySelectLabel = () => {\n root.querySelectorAll('select.codejar-select').forEach((element) => {\n if (!element.getAttribute('aria-label')) {\n element.setAttribute('aria-label', 'Code editor language');\n }\n });\n };\n\n applySelectLabel();\n const observer = new MutationObserver(() => applySelectLabel());\n observer.observe(root, { childList: true, subtree: true });\n return () => observer.disconnect();\n }, []);\n\n useEffect(() => {\n if (!editorRef.current) return;\n\n // Initialize the editor\n const editor = CoreEditor.create({\n element: editorRef.current,\n uri: 'file:///untitled.ts',\n assetLoad: createAssetLoad('/kerebron-wasm'),\n editorKits: [new CodeEditorKit(lang)],\n });\n\n editorInstance.current = editor;\n\n // Surface edits to callers.\n const onTransaction = async () => {\n if (!editorInstance.current) return;\n\n try {\n const buffer = await editorInstance.current.saveDocument('text/plain');\n onChangeRef.current?.(new globalThis.TextDecoder().decode(buffer));\n } catch (err) {\n console.error('Failed to read code:', err);\n }\n };\n\n editor.addEventListener('transaction', onTransaction);\n\n // Seed initial content on mount.\n if (value) {\n editor\n .loadDocumentText('text/plain', value)\n .catch((err) => console.error('Failed to load code:', err));\n }\n\n // Cleanup on unmount\n return () => {\n editor.removeEventListener('transaction', onTransaction);\n editor.destroy();\n };\n // Initial `value`/`lang` are intentionally only applied on mount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <div>\n <div>\n <div ref={editorRef} className=\"kb-component\" />\n </div>\n </div>\n );\n};\n\nCodeEditor.displayName = 'CodeEditor';\n\nexport { CodeEditor };\n"]}
|
package/dist/kerebron.css
CHANGED
|
@@ -119,6 +119,34 @@
|
|
|
119
119
|
color: var(--kb-menu-dropdown-text) !important;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/*
|
|
123
|
+
* Kerebron leaves headings, lists, links and code to browser defaults, which
|
|
124
|
+
* Tailwind's preflight strips (headings `inherit`, lists `list-style: none`,
|
|
125
|
+
* links `color: inherit`) — so "# " and "- " produced real h1/ul nodes that
|
|
126
|
+
* rendered as plain text while editing. `revert` hands these back to the
|
|
127
|
+
* browser. (Adapted from mieweb/timehuddle#620.)
|
|
128
|
+
*
|
|
129
|
+
* Deliberately NOT in `@layer base`: @mieweb/q ships an *unlayered* preflight
|
|
130
|
+
* copy, and unlayered author rules beat any layered rule. Unlayered here with
|
|
131
|
+
* `:where()` keeps specificity at 0,1,0 — above preflight's bare element
|
|
132
|
+
* selectors (0,0,1) but below Kerebron's own `.kb-editor pre` / `.kb-editor
|
|
133
|
+
* ul` rules (0,1,1), so its pre-wrap and list padding stay in charge.
|
|
134
|
+
*/
|
|
135
|
+
.kb-editor :where(h1, h2, h3, h4, h5, h6, ol, ul, a, code, pre) {
|
|
136
|
+
all: revert;
|
|
137
|
+
}
|
|
138
|
+
/* The browser's default link blue is unreadable on the dark editor surface,
|
|
139
|
+
and the brand blue fails 4.5:1 on white, so each theme gets its own shade.
|
|
140
|
+
Dark uses primary-400: primary-500 (#64748b) is only ~3.9:1 on the default
|
|
141
|
+
brand's #0f172a background, while primary-400 (#94a3b8) is ~7:1. */
|
|
142
|
+
.kb-editor :where(a) {
|
|
143
|
+
color: var(--mieweb-primary-800, #0f749c);
|
|
144
|
+
}
|
|
145
|
+
[data-theme='dark'] .kb-editor :where(a),
|
|
146
|
+
.dark .kb-editor :where(a) {
|
|
147
|
+
color: var(--mieweb-primary-400, #94a3b8);
|
|
148
|
+
}
|
|
149
|
+
|
|
122
150
|
/*
|
|
123
151
|
* Kerebron's base.css paints inline shortcode pills green without setting a
|
|
124
152
|
* text color, so the inherited foreground fails WCAG AA contrast. Pin an
|
|
@@ -129,6 +157,93 @@
|
|
|
129
157
|
color: #ffffff;
|
|
130
158
|
}
|
|
131
159
|
|
|
160
|
+
/*
|
|
161
|
+
* codecrock's light syntax palette fails WCAG AA on white: keyword #d73 is
|
|
162
|
+
* 3.1:1, number #099 3.5:1, string #690 3.4:1, comment #998 2.9:1, etc.
|
|
163
|
+
* (axe color-contrast, caught by the Storybook a11y CI job). Darken each
|
|
164
|
+
* failing token to a hue-preserving shade ≥4.5:1; tokens already passing
|
|
165
|
+
* (property, function, type, variable, tag) are left to upstream.
|
|
166
|
+
*/
|
|
167
|
+
.kb-editor .ts-keyword,
|
|
168
|
+
.kb-editor .ts-keyword_operator,
|
|
169
|
+
.kb-editor .ts-function_builtin {
|
|
170
|
+
color: #b03a00; /* was #d73 (3.1:1) → 6.1:1 */
|
|
171
|
+
}
|
|
172
|
+
.kb-editor .ts-number {
|
|
173
|
+
color: #007272; /* was #099 (3.5:1) → 5.8:1 */
|
|
174
|
+
}
|
|
175
|
+
.kb-editor .ts-string {
|
|
176
|
+
color: #557700; /* was #690 (3.4:1) → 5.2:1 */
|
|
177
|
+
}
|
|
178
|
+
.kb-editor .ts-string_special {
|
|
179
|
+
color: #c22f2f; /* was #d44 (4.2:1) → 5.6:1 */
|
|
180
|
+
}
|
|
181
|
+
.kb-editor .ts-comment {
|
|
182
|
+
color: #716d5e; /* was #998 (2.9:1) → 5.2:1 */
|
|
183
|
+
}
|
|
184
|
+
.kb-editor .ts-operator {
|
|
185
|
+
color: #637226; /* upstream #9a6 (2.5:1, misspelt .ts-perator) → 5.3:1 */
|
|
186
|
+
}
|
|
187
|
+
.kb-editor .ts-punctuation,
|
|
188
|
+
.kb-editor .ts-punctuation_bracket {
|
|
189
|
+
color: #707070; /* was #999 (2.9:1) → 5.0:1 */
|
|
190
|
+
}
|
|
191
|
+
.kb-editor .ts-attribute {
|
|
192
|
+
color: #8a5c00; /* was #e90 (2.3:1) → 5.8:1 */
|
|
193
|
+
}
|
|
194
|
+
.kb-editor .ts-constant,
|
|
195
|
+
.kb-editor .ts-constant_builtin {
|
|
196
|
+
color: #006a8e; /* was #0086b3 (4.2:1) → 6.1:1 */
|
|
197
|
+
}
|
|
198
|
+
/*
|
|
199
|
+
* Dark: codecrock only switches its palette via prefers-color-scheme, which
|
|
200
|
+
* a class-based dark toggle never matches — so dark surfaces were showing
|
|
201
|
+
* the light tokens. Re-assert codecrock's own dark (VS Code) palette for
|
|
202
|
+
* the tokens overridden above under the app's dark selectors.
|
|
203
|
+
*/
|
|
204
|
+
[data-theme='dark'] .kb-editor .ts-keyword,
|
|
205
|
+
[data-theme='dark'] .kb-editor .ts-keyword_operator,
|
|
206
|
+
.dark .kb-editor .ts-keyword,
|
|
207
|
+
.dark .kb-editor .ts-keyword_operator {
|
|
208
|
+
color: #c586c0;
|
|
209
|
+
}
|
|
210
|
+
[data-theme='dark'] .kb-editor .ts-function_builtin,
|
|
211
|
+
.dark .kb-editor .ts-function_builtin {
|
|
212
|
+
color: #dcdcaa;
|
|
213
|
+
}
|
|
214
|
+
[data-theme='dark'] .kb-editor .ts-number,
|
|
215
|
+
.dark .kb-editor .ts-number {
|
|
216
|
+
color: #b5cea8;
|
|
217
|
+
}
|
|
218
|
+
[data-theme='dark'] .kb-editor .ts-string,
|
|
219
|
+
[data-theme='dark'] .kb-editor .ts-string_special,
|
|
220
|
+
.dark .kb-editor .ts-string,
|
|
221
|
+
.dark .kb-editor .ts-string_special {
|
|
222
|
+
color: #ce9178;
|
|
223
|
+
}
|
|
224
|
+
[data-theme='dark'] .kb-editor .ts-comment,
|
|
225
|
+
.dark .kb-editor .ts-comment {
|
|
226
|
+
color: #6a9955;
|
|
227
|
+
}
|
|
228
|
+
[data-theme='dark'] .kb-editor .ts-operator,
|
|
229
|
+
[data-theme='dark'] .kb-editor .ts-punctuation,
|
|
230
|
+
[data-theme='dark'] .kb-editor .ts-punctuation_bracket,
|
|
231
|
+
.dark .kb-editor .ts-operator,
|
|
232
|
+
.dark .kb-editor .ts-punctuation,
|
|
233
|
+
.dark .kb-editor .ts-punctuation_bracket {
|
|
234
|
+
color: #d4d4d4;
|
|
235
|
+
}
|
|
236
|
+
[data-theme='dark'] .kb-editor .ts-attribute,
|
|
237
|
+
.dark .kb-editor .ts-attribute {
|
|
238
|
+
color: #9cdcfe;
|
|
239
|
+
}
|
|
240
|
+
[data-theme='dark'] .kb-editor .ts-constant,
|
|
241
|
+
[data-theme='dark'] .kb-editor .ts-constant_builtin,
|
|
242
|
+
.dark .kb-editor .ts-constant,
|
|
243
|
+
.dark .kb-editor .ts-constant_builtin {
|
|
244
|
+
color: #4fc1ff;
|
|
245
|
+
}
|
|
246
|
+
|
|
132
247
|
/* Overflow-menu icons declare min sizes that burst their compact buttons. */
|
|
133
248
|
.kb-custom-menu__overflow-menu .kb-icon {
|
|
134
249
|
display: inline-flex !important;
|
package/dist/kerebron.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { AssetLoad } from '@kerebron/editor';
|
|
4
|
+
import { MediaUploadOptions } from '@kerebron/extension-basic-editor/ExtensionMediaUpload';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Editor kit assembly for {@link RichEditor}, for both plain and collaborative
|
|
@@ -42,6 +43,18 @@ interface CollabConfig {
|
|
|
42
43
|
* Defaults to `globalThis.WebSocket`.
|
|
43
44
|
*/
|
|
44
45
|
WebSocketPolyfill?: typeof globalThis.WebSocket;
|
|
46
|
+
/**
|
|
47
|
+
* Called when collaborative editing could not be started at all — the Yjs
|
|
48
|
+
* kit failed to load (see {@link createEditorKits}). The editor mounts
|
|
49
|
+
* anyway, as a local one; this is how the host finds out that edits are no
|
|
50
|
+
* longer shared, so it can say so, or tear its own editor down if unshared
|
|
51
|
+
* editing would be unsafe.
|
|
52
|
+
*
|
|
53
|
+
* Not for connection trouble: a room that is reachable but currently
|
|
54
|
+
* disconnected still has the Yjs kit loaded, and the provider retries on its
|
|
55
|
+
* own. This fires once, before the editor is created.
|
|
56
|
+
*/
|
|
57
|
+
onUnavailable?: (error: unknown) => void;
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
interface RichEditorProps {
|
|
@@ -56,6 +69,10 @@ interface RichEditorProps {
|
|
|
56
69
|
* editor connects to the `/yjs` websocket relay and every peer in the same
|
|
57
70
|
* `room` co-edits one shared document. Uncontrolled like `value` — remount via
|
|
58
71
|
* `key` to switch rooms.
|
|
72
|
+
*
|
|
73
|
+
* Best-effort: if the Yjs kit cannot be loaded the editor still mounts, as a
|
|
74
|
+
* local one, and `collab.onUnavailable` is called. Pass that callback if
|
|
75
|
+
* unshared editing is something your users need to be told about.
|
|
59
76
|
*/
|
|
60
77
|
collab?: CollabConfig;
|
|
61
78
|
/** Read-only surface: no typing, and the content dims. */
|
|
@@ -77,6 +94,26 @@ interface RichEditorProps {
|
|
|
77
94
|
* `@kerebron/wasm`'s `assets/` somewhere else.
|
|
78
95
|
*/
|
|
79
96
|
assetLoad?: AssetLoad;
|
|
97
|
+
/**
|
|
98
|
+
* How files pasted or dropped into the editor are handled.
|
|
99
|
+
*
|
|
100
|
+
* **Set `uploadHandler` if your documents are persisted anywhere.** Without
|
|
101
|
+
* it, a pasted image is embedded in the document as a base64 `data:` URL and
|
|
102
|
+
* a video as a blob object URL: a 4 MB screenshot becomes ~5.8 MB of
|
|
103
|
+
* markdown, which most APIs will refuse, and an object URL is dead as soon as
|
|
104
|
+
* the page reloads. `uploadHandler` receives the file and returns the URL to
|
|
105
|
+
* reference it by, so the document carries a link instead of the bytes.
|
|
106
|
+
*
|
|
107
|
+
* ```tsx
|
|
108
|
+
* <RichEditor
|
|
109
|
+
* mediaUpload={{ uploadHandler: (file) => uploadToMyMediaStore(file) }}
|
|
110
|
+
* />
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* Read once, when the editor mounts — like {@link collab}, remount via `key`
|
|
114
|
+
* to change it.
|
|
115
|
+
*/
|
|
116
|
+
mediaUpload?: MediaUploadOptions;
|
|
80
117
|
}
|
|
81
118
|
interface RichEditorHandle {
|
|
82
119
|
/**
|
package/dist/kerebron.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { AssetLoad } from '@kerebron/editor';
|
|
4
|
+
import { MediaUploadOptions } from '@kerebron/extension-basic-editor/ExtensionMediaUpload';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Editor kit assembly for {@link RichEditor}, for both plain and collaborative
|
|
@@ -42,6 +43,18 @@ interface CollabConfig {
|
|
|
42
43
|
* Defaults to `globalThis.WebSocket`.
|
|
43
44
|
*/
|
|
44
45
|
WebSocketPolyfill?: typeof globalThis.WebSocket;
|
|
46
|
+
/**
|
|
47
|
+
* Called when collaborative editing could not be started at all — the Yjs
|
|
48
|
+
* kit failed to load (see {@link createEditorKits}). The editor mounts
|
|
49
|
+
* anyway, as a local one; this is how the host finds out that edits are no
|
|
50
|
+
* longer shared, so it can say so, or tear its own editor down if unshared
|
|
51
|
+
* editing would be unsafe.
|
|
52
|
+
*
|
|
53
|
+
* Not for connection trouble: a room that is reachable but currently
|
|
54
|
+
* disconnected still has the Yjs kit loaded, and the provider retries on its
|
|
55
|
+
* own. This fires once, before the editor is created.
|
|
56
|
+
*/
|
|
57
|
+
onUnavailable?: (error: unknown) => void;
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
interface RichEditorProps {
|
|
@@ -56,6 +69,10 @@ interface RichEditorProps {
|
|
|
56
69
|
* editor connects to the `/yjs` websocket relay and every peer in the same
|
|
57
70
|
* `room` co-edits one shared document. Uncontrolled like `value` — remount via
|
|
58
71
|
* `key` to switch rooms.
|
|
72
|
+
*
|
|
73
|
+
* Best-effort: if the Yjs kit cannot be loaded the editor still mounts, as a
|
|
74
|
+
* local one, and `collab.onUnavailable` is called. Pass that callback if
|
|
75
|
+
* unshared editing is something your users need to be told about.
|
|
59
76
|
*/
|
|
60
77
|
collab?: CollabConfig;
|
|
61
78
|
/** Read-only surface: no typing, and the content dims. */
|
|
@@ -77,6 +94,26 @@ interface RichEditorProps {
|
|
|
77
94
|
* `@kerebron/wasm`'s `assets/` somewhere else.
|
|
78
95
|
*/
|
|
79
96
|
assetLoad?: AssetLoad;
|
|
97
|
+
/**
|
|
98
|
+
* How files pasted or dropped into the editor are handled.
|
|
99
|
+
*
|
|
100
|
+
* **Set `uploadHandler` if your documents are persisted anywhere.** Without
|
|
101
|
+
* it, a pasted image is embedded in the document as a base64 `data:` URL and
|
|
102
|
+
* a video as a blob object URL: a 4 MB screenshot becomes ~5.8 MB of
|
|
103
|
+
* markdown, which most APIs will refuse, and an object URL is dead as soon as
|
|
104
|
+
* the page reloads. `uploadHandler` receives the file and returns the URL to
|
|
105
|
+
* reference it by, so the document carries a link instead of the bytes.
|
|
106
|
+
*
|
|
107
|
+
* ```tsx
|
|
108
|
+
* <RichEditor
|
|
109
|
+
* mediaUpload={{ uploadHandler: (file) => uploadToMyMediaStore(file) }}
|
|
110
|
+
* />
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* Read once, when the editor mounts — like {@link collab}, remount via `key`
|
|
114
|
+
* to change it.
|
|
115
|
+
*/
|
|
116
|
+
mediaUpload?: MediaUploadOptions;
|
|
80
117
|
}
|
|
81
118
|
interface RichEditorHandle {
|
|
82
119
|
/**
|