@layers-app/editor 0.7.39 → 0.7.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +2 -12
- package/dist/index.js +2 -2
- package/dist/{layers.BIsMamg3.js → layers.-dsGo4Df.js} +5 -5
- package/dist/{layers.DTowPZJ4.js → layers.0JBgf_FJ.js} +1 -1
- package/dist/{layers.BJzQM77j.js → layers.2EJTHuRT.js} +2 -2
- package/dist/{layers.BKFyWe8R.js → layers.3ZLm7KOH.js} +1 -1
- package/dist/{layers.NpRmshQ9.js → layers.3eWTtIcW.js} +1 -1
- package/dist/{layers.CDNTEZnd.js → layers.5RsDlpn-.js} +1 -1
- package/dist/{layers.BDsLJ4gG.js → layers.7uj7tRRY.js} +1 -1
- package/dist/{layers.BB9RNJhO.js → layers.8oCEAJSD.js} +3 -3
- package/dist/{layers.aznEikqM.js → layers.9kVYgib9.js} +1 -1
- package/dist/{layers.D061XrIx.js → layers.B0rV-UAE.js} +1 -1
- package/dist/{layers.CICAPJ-I.js → layers.B27kKuWV.js} +1 -1
- package/dist/{layers.0jrSlSLE.js → layers.B2BlPY57.js} +1 -1
- package/dist/{layers.qlwKdHvS.js → layers.B5-XPuJv.js} +1 -1
- package/dist/{layers.zZ3XNSeT.js → layers.B6ArVRX0.js} +1 -1
- package/dist/{layers.CD_E0kVG.js → layers.B7B4CTHy.js} +4 -4
- package/dist/{layers.CDATbFJz.js → layers.B8KeqzpX.js} +1 -1
- package/dist/{layers.C3LG4wI5.js → layers.B8jizJtX.js} +1 -1
- package/dist/{layers.Cb2I8XKT.js → layers.B8tW-rjh.js} +1 -1
- package/dist/{layers.BCVyJA1q.js → layers.BAoTQKSI.js} +1 -1
- package/dist/{layers.S5B1mnNV.js → layers.BCHs8gKs.js} +1 -1
- package/dist/{layers.BhGygACG.js → layers.BFmr5UbT.js} +1 -1
- package/dist/{layers.BF89DIk_.js → layers.BFqKqJVN.js} +1 -1
- package/dist/{layers.CrqzWAg4.js → layers.BGFAe4bs.js} +5 -5
- package/dist/{layers.D3Ok8e2V.js → layers.BIUjTpJv.js} +1 -1
- package/dist/{layers.CeFNbr4R.js → layers.BJj1yGOJ.js} +1 -1
- package/dist/{layers.Ms9A7LKs.js → layers.BLeGHXyR.js} +1 -1
- package/dist/{layers.MiYLhZhv.js → layers.BM7ei91l.js} +1 -1
- package/dist/{layers.D2gawlCf.js → layers.BNB65Q4G.js} +1 -1
- package/dist/{layers.aFMIBdF4.js → layers.BNYgVaAa.js} +7 -7
- package/dist/{layers.DSkr93d8.js → layers.BPnry5N0.js} +3 -3
- package/dist/{layers.CPOkh5aZ.js → layers.BSQgZJDT.js} +4 -4
- package/dist/{layers.C3a6E34u.js → layers.BVx4rgmy.js} +1 -1
- package/dist/{layers.D4Frc3Ey.js → layers.BX6utSIp.js} +1 -1
- package/dist/{layers.CHdJfoNJ.js → layers.BXntNGpc.js} +4 -4
- package/dist/{layers.DVGNkKTg.js → layers.BYKimWlf.js} +1 -1
- package/dist/{layers.RJkTRw8_.js → layers.BYZYjIt-.js} +1 -1
- package/dist/{layers.9RisrL_h.js → layers.BZdR6GD0.js} +1 -1
- package/dist/{layers.BSn5cU1e.js → layers.B_33RwNq.js} +3 -3
- package/dist/{layers.DqNKF8xY.js → layers.BbM08SoA.js} +1 -1
- package/dist/{layers.DYmNfLOt.js → layers.BdWr2G8y.js} +1 -1
- package/dist/{layers.CVqfUGWy.js → layers.BeKzsQyM.js} +3 -3
- package/dist/{layers.BJLmbBep.js → layers.Bep_FUmR.js} +1 -1
- package/dist/{layers.DiaW10eN.js → layers.BfTSDDvM.js} +1 -1
- package/dist/layers.BfnHUGGD.js +389 -0
- package/dist/layers.BfuL2TCO.js +8 -0
- package/dist/{layers.f9z_axJz.js → layers.BgpNIF9k.js} +1 -1
- package/dist/{layers.t3GV0adE.js → layers.Bhvv0n0d.js} +1 -1
- package/dist/{layers.BjdJo5iJ.js → layers.BjTH4BQY.js} +1 -1
- package/dist/layers.BkMx876N.js +39423 -0
- package/dist/{layers.BrBI9AmH.js → layers.BlBmCLNE.js} +1 -1
- package/dist/{layers.Bb51TVKu.js → layers.BlLUTm4m.js} +1 -1
- package/dist/{layers.9sG2KwOP.js → layers.BmN2OV4H.js} +1 -1
- package/dist/{layers.BDtLpMvz.js → layers.BmUEZiDu.js} +1 -1
- package/dist/{layers.DVO5iim5.js → layers.BnC5WgIB.js} +1 -1
- package/dist/{layers.BHN7dlOR.js → layers.BnveWyYr.js} +2 -2
- package/dist/{layers.amLQ0MW2.js → layers.BoboD8cn.js} +1 -1
- package/dist/{layers.qRYie_of.js → layers.Boj5qO1R.js} +1 -1
- package/dist/{layers.CFsqhkIY.js → layers.BqyAcw31.js} +1 -1
- package/dist/{layers.CALmgr41.js → layers.Brbuaj2u.js} +4 -4
- package/dist/{layers.DC9Du1IJ.js → layers.BrcxFxKk.js} +1 -1
- package/dist/{layers.BSSNEUj9.js → layers.BunbPF61.js} +1 -1
- package/dist/{layers.ozmFp8LW.js → layers.Bvsn5fDB.js} +1 -1
- package/dist/{layers.CN50w4Ms.js → layers.C-VCvdCo.js} +1 -1
- package/dist/{layers.B2ubfVh-.js → layers.C0xdDXQe.js} +1 -1
- package/dist/{layers.D8zyqqGB.js → layers.C1RlrHT0.js} +1 -1
- package/dist/{layers.C8x0--eM.js → layers.C1YFCKcW.js} +1 -1
- package/dist/{layers.BS1_b3ms.js → layers.C25OKQSF.js} +2 -2
- package/dist/{layers.1AtjUxzH.js → layers.C2KYF9xm.js} +1 -1
- package/dist/{layers.DaocpWiX.js → layers.C3BZTl0A.js} +6 -6
- package/dist/{layers.Bw4e3Qi0.js → layers.C3oHimh5.js} +3 -3
- package/dist/layers.C8EEJkwf.js +1 -0
- package/dist/{layers.CV4MGJrL.js → layers.C8V-NiD-.js} +1 -1
- package/dist/{layers.F5QoclSQ.js → layers.C9V89jIQ.js} +1 -1
- package/dist/{layers.C6aR43sh.js → layers.CAnd6eI1.js} +1 -1
- package/dist/{layers.TGF4MHPm.js → layers.CCR_grs7.js} +1 -1
- package/dist/{layers.ZhDh2H8o.js → layers.CChmIM27.js} +1 -1
- package/dist/{layers.DXU-u1k7.js → layers.CD3kQjVT.js} +1 -1
- package/dist/{layers.aNi27rLa.js → layers.CDBx1lG_.js} +25 -25
- package/dist/{layers.lOC14cWY.js → layers.CEcQ3Nbv.js} +3 -3
- package/dist/{layers.Bs5kAOch.js → layers.CGuDYEE_.js} +1 -1
- package/dist/{layers.B2jLKC1M.js → layers.CN_PPKdT.js} +2 -2
- package/dist/{layers.C3OKHcAR.js → layers.CO-iP9mk.js} +1 -1
- package/dist/{layers.BK_V_djM.js → layers.CT5IxN3a.js} +1 -1
- package/dist/{layers.2qojyNfW.js → layers.CTTMvgCQ.js} +3 -3
- package/dist/{layers.CIOidxym.js → layers.CVRdqJkl.js} +1 -1
- package/dist/{layers.CGueiLzP.js → layers.CY96Svkw.js} +1 -1
- package/dist/{layers.CvIdEabj.js → layers.C_vw-i1k.js} +3 -3
- package/dist/{layers.DaxcSYjN.js → layers.CaF29IuO.js} +1 -1
- package/dist/{layers.D5hoDBbb.js → layers.Cb3HgqbK.js} +3 -3
- package/dist/{layers.Ccpg3UtZ.js → layers.CcREZDm3.js} +1 -1
- package/dist/{layers.D_iaYquQ.js → layers.Cce8eowx.js} +4 -4
- package/dist/{layers.DN9mR4Vr.js → layers.Cdrea0-4.js} +1 -1
- package/dist/{layers.C12D75XL.js → layers.Cehn5Mi3.js} +1 -1
- package/dist/layers.CfQQOmhy.js +6 -0
- package/dist/{layers.D0yOK4QD.js → layers.Cfx80TWq.js} +1 -1
- package/dist/{layers.SNjI-_Ng.js → layers.CgxZxIsB.js} +1 -1
- package/dist/{layers.BypRjyoG.js → layers.Ch-OTWue.js} +1 -1
- package/dist/{layers.BIfnu4Hk.js → layers.CjDqX2Wb.js} +1 -1
- package/dist/{layers.BXp_bxP0.js → layers.CkIJsEZ3.js} +1 -1
- package/dist/{layers.CgZs2Ata.js → layers.CkO8feWE.js} +1 -1
- package/dist/{layers.D0J9KSz5.js → layers.Cl5YMVc1.js} +1 -1
- package/dist/{layers.D6ZfSS5L.js → layers.ClKCbO_Q.js} +2 -2
- package/dist/{layers.DpPuWs0z.js → layers.ClpDSHav.js} +1 -1
- package/dist/{layers.DYieneXU.js → layers.CnpL9Gpp.js} +1 -1
- package/dist/{layers.BlQ-U-Lx.js → layers.CqwiUJxu.js} +1 -1
- package/dist/{layers.BSjf-DYv.js → layers.CrKrtd_a.js} +3 -3
- package/dist/{layers.VRgNTTaj.js → layers.Crebv_je.js} +1 -1
- package/dist/{layers.DIqK8Aqq.js → layers.CrlccmbS.js} +1 -1
- package/dist/{layers.l3LfGa_W.js → layers.CsMhlUrc.js} +1 -1
- package/dist/{layers.Dq31QDjE.js → layers.CtDY6qdX.js} +1 -1
- package/dist/{layers.BRRAS5US.js → layers.CwXlcYLb.js} +7 -7
- package/dist/{layers.ymjYM8Ie.js → layers.CwsQh2Gq.js} +1 -1
- package/dist/{layers.CAKCb1Sd.js → layers.Cx8eL8XH.js} +1 -1
- package/dist/{layers.BZlpbrFu.js → layers.Cxemr3Df.js} +1 -1
- package/dist/{layers.C3m3Nbyn.js → layers.Cxv6Q3fg.js} +1 -1
- package/dist/{layers.BUl1Mlk8.js → layers.CyMVRquQ.js} +1 -1
- package/dist/{layers.Bac9fDyK.js → layers.CyS7ocmX.js} +1 -1
- package/dist/{layers.BRP4kKP0.js → layers.D-Ut3Wq5.js} +1 -1
- package/dist/{layers.J1Z2dr6i.js → layers.D0rQb1bZ.js} +4 -4
- package/dist/{layers.DkrPnKyG.js → layers.D1TYqMJ8.js} +1 -1
- package/dist/{layers.CZBDDeuI.js → layers.D2RZscBT.js} +1 -1
- package/dist/{layers.B0OFZgUX.js → layers.D2kmVEIQ.js} +1 -1
- package/dist/{layers.CgWconRc.js → layers.D3RRdEfU.js} +1 -1
- package/dist/{layers.CRtU5cl3.js → layers.D3Y4GnCY.js} +8 -8
- package/dist/{layers.D07fPoid.js → layers.D3uDbxNq.js} +1 -1
- package/dist/{layers.DdJXeTuF.js → layers.D5TvTW5g.js} +3 -3
- package/dist/{layers.D0Jj7PpR.js → layers.D6euAyZb.js} +1 -1
- package/dist/{layers.-6wEj9MW.js → layers.D74s8WqS.js} +1 -1
- package/dist/{layers.BwOkPzCt.js → layers.D7PNF8UM.js} +1 -1
- package/dist/{layers.B9a67xk6.js → layers.D9ivQY9F.js} +1 -1
- package/dist/{layers.7TS7tiHX.js → layers.DA2_TQmL.js} +1 -1
- package/dist/{layers.Dijqb1vE.js → layers.DBrHVMMn.js} +1 -1
- package/dist/{layers.BifUeJUy.js → layers.DC08wULq.js} +4 -4
- package/dist/{layers.DS52X1L2.js → layers.DDummMha.js} +1 -1
- package/dist/layers.DF5JPvvr.js +1 -0
- package/dist/{layers.CyDUQmWh.js → layers.DIDUlj92.js} +1 -1
- package/dist/{layers.B7nconCd.js → layers.DK0kSLxX.js} +1 -1
- package/dist/{layers.B3VX9pvp.js → layers.DK46OcUI.js} +1 -1
- package/dist/{layers.MdzRkef-.js → layers.DKLxH9_z.js} +1 -1
- package/dist/{layers.DNBrX6DM.js → layers.DKyOO6xD.js} +1 -1
- package/dist/{layers.0qILMlPX.js → layers.DLDSRda2.js} +1 -1
- package/dist/{layers.BuW-xb1F.js → layers.DLygjjc4.js} +1 -1
- package/dist/{layers.BmW2_oVF.js → layers.DMdyy5lE.js} +1 -1
- package/dist/{layers.vZ1Qn7nH.js → layers.DOiW4mD2.js} +1 -1
- package/dist/{layers.9RDjVlGM.js → layers.DP7AJi5M.js} +1 -1
- package/dist/{layers.BOhuRECC.js → layers.DUu7ZgAJ.js} +4 -4
- package/dist/{layers.B6GQoHoe.js → layers.DZ-LohMU.js} +1 -1
- package/dist/{layers.BFxUAeHt.js → layers.D_EIsxK4.js} +1 -1
- package/dist/{layers.CcL2dOSF.js → layers.D_ozDMf2.js} +1 -1
- package/dist/{layers.9gMMZqkj.js → layers.Da6E5uzx.js} +1 -1
- package/dist/{layers.Dx4T7SjM.js → layers.Db5REx0K.js} +4 -4
- package/dist/{layers.BTusbIi8.js → layers.Dc7TYw8K.js} +1 -1
- package/dist/{layers.CGhr15Ea.js → layers.DcKnucIX.js} +1 -1
- package/dist/{layers.Bqo_j8Fj.js → layers.DcsWnivt.js} +1 -1
- package/dist/{layers.CLiUqL1A.js → layers.DddU1P1X.js} +1 -1
- package/dist/{layers.DobbaVft.js → layers.Deqj0KhF.js} +1 -1
- package/dist/{layers.Oiteak7Z.js → layers.DhdTjv-I.js} +1 -1
- package/dist/{layers.C9DziFPJ.js → layers.DlJYEWAo.js} +2 -2
- package/dist/{layers.D_dVgmAt.js → layers.DpBIw4-t.js} +1 -1
- package/dist/{layers.DXlEVUtf.js → layers.Dpf3e0LU.js} +1 -1
- package/dist/{layers.CGIOuBNq.js → layers.Dq97b5vi.js} +1 -1
- package/dist/{layers.DnthNL6T.js → layers.DtagIW50.js} +1 -1
- package/dist/{layers.D6Z1xGtq.js → layers.DuWaDgO5.js} +1 -1
- package/dist/{layers.z8OQmpP7.js → layers.DujsH1Q_.js} +1 -1
- package/dist/{layers.Bjjbmg1f.js → layers.Dxrz-KQA.js} +1 -1
- package/dist/{layers.Bziplruv.js → layers.Dy12RYQh.js} +1 -1
- package/dist/{layers.BswFrB19.js → layers.Dy_ysjdI.js} +1 -1
- package/dist/{layers.cWuFASN4.js → layers.DzT6BmNY.js} +1 -1
- package/dist/{layers.Bl6PtBty.js → layers.DzqOy-oQ.js} +1 -1
- package/dist/{layers.3CLnvLD9.js → layers.GIy7n-LM.js} +1 -1
- package/dist/{layers.Dzp-ATXy.js → layers.GPfBF-5B.js} +1 -1
- package/dist/{layers.BD8m31hq.js → layers.GbvEmdou.js} +1 -1
- package/dist/{layers.GxNAGpkf.js → layers.HC7XTHrX.js} +1 -1
- package/dist/{layers.-N1Y5agH.js → layers.I3Rx3kYs.js} +1 -1
- package/dist/{layers.Cq1phM4Q.js → layers.IVe_Ys3f.js} +1 -1
- package/dist/{layers.CkTOErMi.js → layers.JHIXsJYC.js} +1 -1
- package/dist/{layers.BKhY3jGA.js → layers.JoFZVP9D.js} +1 -1
- package/dist/{layers.C0VYsb2b.js → layers.K11f8Nqy.js} +2 -2
- package/dist/{layers.jXqe3YV0.js → layers.Kn-F2ikL.js} +1 -1
- package/dist/{layers.Ca65I9Zw.js → layers.M-RlIcpU.js} +1 -1
- package/dist/{layers.BofkAKsy.js → layers.MUm4CFUK.js} +1 -1
- package/dist/{layers.DhI3S6P5.js → layers.OSH4kppq.js} +1 -1
- package/dist/{layers.DDak5riw.js → layers.QeKkWb7f.js} +1 -1
- package/dist/{layers.Drck2aF_.js → layers.RT_-zq2J.js} +1 -1
- package/dist/{layers.xLwU6G1Z.js → layers.T5MyLSpn.js} +1 -1
- package/dist/{layers.D-56I29O.js → layers.T5mDKJdQ.js} +1 -1
- package/dist/{layers.BlBy_LSk.js → layers.TVoTTCh2.js} +1 -1
- package/dist/{layers.BQ-IJKr0.js → layers.UpsOdQoy.js} +1 -1
- package/dist/{layers.wZ6CpSGr.js → layers.W6_pv4gE.js} +1 -1
- package/dist/{layers.Da1VoB-j.js → layers.a0DUrYQV.js} +1 -1
- package/dist/{layers.cs7pW5NR.js → layers.aRAHL4Se.js} +1 -1
- package/dist/{layers.Dr5r0Dfd.js → layers.b7WCIERl.js} +1 -1
- package/dist/{layers.DEgADOjJ.js → layers.esmxXiRv.js} +1 -1
- package/dist/{layers.uz3OyeLg.js → layers.iPj1rT3Y.js} +1 -1
- package/dist/{layers.XaiiILQx.js → layers.iaEPEuVw.js} +1 -1
- package/dist/{layers.gg2aP5GF.js → layers.kkSM0eG9.js} +4 -4
- package/dist/{layers.D5Jy3joM.js → layers.lf6J_8dB.js} +1 -1
- package/dist/{layers.BxFhR8Tg.js → layers.oJkDGOrD.js} +1 -1
- package/dist/{layers.BgxMOE37.js → layers.pB3ZlJhn.js} +1 -1
- package/dist/{layers.BxHr1naR.js → layers.qHj0-EEm.js} +1 -1
- package/dist/{layers.BrutKHH8.js → layers.sc3IyqAE.js} +1 -1
- package/dist/{layers.ALXBOtxg.js → layers.u44WeKW2.js} +1 -1
- package/dist/{layers.9dXNflbO.js → layers.x5NsounJ.js} +1 -1
- package/dist/{layers.C9l2Xaq-.js → layers.zAzrkTHW.js} +1 -1
- package/package.json +1 -1
- package/dist/layers.B68Ugj9v.js +0 -129
- package/dist/layers.Bz6EUwUe.js +0 -8
- package/dist/layers.CNZvZwph.js +0 -1
- package/dist/layers.CsK-wlei.js +0 -28047
- package/dist/layers.Cw_OTSMm.js +0 -1
- package/dist/layers.DE4FXBF6.js +0 -6
- package/dist/layers.DVQQPVC3.js +0 -261
- package/dist/layers.DWkB5Cy0.js +0 -1
- package/dist/layers.R8mPlCA0.js +0 -261
- package/dist/layers.b9B2NY7n.js +0 -11690
package/dist/layers.Cw_OTSMm.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("react"),T=require("react-dom"),d=require("./layers.B68Ugj9v.js"),$=require("@lexical/react/LexicalComposerContext"),R=require("@lexical/react/LexicalErrorBoundary"),F=require("@lexical/react/useLexicalEditable"),g=require("@mantine/core"),E=require("lexical"),H=require("./layers.R8mPlCA0.js");function y({equation:s,inline:a,onDoubleClick:c}){const r=o.useRef(null);return o.useEffect(()=>{const l=r.current;l!==null&&H.default.render(s,l,{displayMode:!a,errorColor:"#cc0000",output:"html",strict:"warn",throwOnError:!1,trust:!1})},[s,a]),t.jsxs(t.Fragment,{children:[t.jsx("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",width:0,height:0,alt:""}),t.jsx("span",{role:"button",tabIndex:-1,onDoubleClick:c,ref:r}),t.jsx("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",width:0,height:0,alt:""})]})}let L=!1;const P=new Map;function z(s){L||(L=!0,s.registerCommand(d.OPEN_EQUATION_POPUP_COMMAND,a=>{const c=P.get(a);return c?(c(),!0):!1},E.COMMAND_PRIORITY_EDITOR))}function G({equation:s,inline:a,nodeKey:c}){const[r]=$.useLexicalComposerContext(),l=F.useLexicalEditable(),m=o.useRef(null),N=o.useRef(null),[A,h]=o.useState(s),[i,f]=o.useState(!1),[_,S]=o.useState({top:0,left:0}),[v,B]=o.useState(!1),x=o.useCallback(()=>{const e=m.current;if(!e)return;const u=(e.closest(".editor-equation")||e).getBoundingClientRect();S({top:u.bottom+18,left:u.left}),B(!0)},[]);o.useEffect(()=>{z(r)},[r]),o.useEffect(()=>{const e=()=>{l&&f(!0)};return P.set(c,e),()=>{P.delete(c)}},[l,c]);const p=o.useCallback(()=>{if(l){if(i){f(!1);return}x(),f(!0)}},[l,i,x]),b=o.useCallback(()=>{const e=A.trim();r.update(()=>{const n=E.$getNodeByKey(c);if(d.$isEquationNode(n)){if(n.isInline&&n.isInline()&&e===""){n.remove();return}n.setEquation(e)}}),f(!1)},[r,c,A]),C=o.useCallback(()=>{if(!s&&a){r.update(()=>{const e=E.$getNodeByKey(c);d.$isEquationNode(e)&&e.remove()}),f(!1);return}h(s),s&&f(!1)},[r,s,a,c]);o.useEffect(()=>{i||h(s)},[s,i]),o.useEffect(()=>{if(!i){d.unblockScroll(r.getRootElement()),B(!1);return}d.blockScroll(r.getRootElement()),x();const e=window.requestAnimationFrame(()=>{const n=N.current;if(!n)return;const u=n.value.length;n.focus(),n.setSelectionRange(u,u)});return()=>{window.cancelAnimationFrame(e),d.unblockScroll(r.getRootElement())}},[i,x]),o.useEffect(()=>{if(!i)return;const e=n=>{const u=n.target,j=m.current,w=document.querySelector(".equation-block__popup");u&&(j!=null&&j.contains(u)||w instanceof HTMLElement&&w.contains(u))||(a&&!A.trim()&&r.update(()=>{const I=E.$getNodeByKey(c);d.$isEquationNode(I)&&I.remove()}),f(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r,a,i,c,A]);const k=(i?A:s).trim(),q=k.length>0,D=a&&!l?t.jsx("span",{className:"equation-inline-trigger",children:t.jsx(R.LexicalErrorBoundary,{onError:e=>{var n;return(n=r._onError)==null?void 0:n.call(r,e)},children:t.jsx(y,{equation:s,inline:a,onDoubleClick:p})})}):a?t.jsx("span",{className:`equation-inline-trigger${q?"":" equation-inline-trigger--empty"}`,onClick:p,ref:m,children:q?t.jsx(R.LexicalErrorBoundary,{onError:e=>{var n;return(n=r._onError)==null?void 0:n.call(r,e)},children:t.jsx(y,{equation:k,inline:a,onDoubleClick:p})}):t.jsxs("span",{className:"equation-inline-placeholder",children:[t.jsx(d.HugeiconsIcon,{icon:d.c4,size:24}),t.jsx("span",{children:"New equation"})]})}):t.jsx("div",{className:"equation-block",ref:m,children:t.jsx("div",{className:"equation-block__container",onClick:p,style:{cursor:l?"pointer":"default"},children:q?t.jsx(R.LexicalErrorBoundary,{onError:e=>{var n;return(n=r._onError)==null?void 0:n.call(r,e)},children:t.jsx(y,{equation:k,inline:a,onDoubleClick:p})}):t.jsx("div",{className:"equation-block__placeholder",children:"Add a TeX equation"})})}),O=o.useCallback(e=>{e.stopPropagation(),h(e.currentTarget.value)},[]),M=o.useCallback(e=>{if(e.stopPropagation(),e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey){e.preventDefault(),b();return}e.key==="Escape"&&(e.preventDefault(),C())},[b,C]);return t.jsxs(t.Fragment,{children:[D,i&&v&&T.createPortal(t.jsx("div",{className:"equation-block__popup",style:{position:"fixed",top:_.top,left:_.left,zIndex:103},children:t.jsxs("div",{className:"equation-block__editor",children:[t.jsx(g.Textarea,{autosize:!0,minRows:2,variant:"unstyled",value:A,onChange:O,onKeyDown:M,placeholder:"x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",classNames:{wrapper:"equation-block__textarea-wrapper"},autoFocus:!0,ref:N}),t.jsxs(g.Group,{justify:"flex-end",gap:"sm",children:[t.jsx(g.Button,{variant:"subtle",color:"gray",onClick:C,children:"Cancel"}),t.jsx(g.Button,{onClick:b,children:"Save"})]})]})}),document.body)]})}exports.default=G;
|
package/dist/layers.DE4FXBF6.js
DELETED
package/dist/layers.DVQQPVC3.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { jsxs as A, Fragment as H, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as I, useEffect as d, useState as E, useCallback as m } from "react";
|
|
3
|
-
import { createPortal as $ } from "react-dom";
|
|
4
|
-
import { i as x, j as S, k as U, H as V, l as X, O as Y } from "./layers.CsK-wlei.js";
|
|
5
|
-
import { useLexicalComposerContext as J } from "@lexical/react/LexicalComposerContext";
|
|
6
|
-
import { LexicalErrorBoundary as q } from "@lexical/react/LexicalErrorBoundary";
|
|
7
|
-
import { useLexicalEditable as W } from "@lexical/react/useLexicalEditable";
|
|
8
|
-
import { Textarea as Z, Group as K, Button as M } from "@mantine/core";
|
|
9
|
-
import { $getNodeByKey as w, COMMAND_PRIORITY_EDITOR as ee } from "lexical";
|
|
10
|
-
import te from "./layers.b9B2NY7n.js";
|
|
11
|
-
function N({
|
|
12
|
-
equation: n,
|
|
13
|
-
inline: a,
|
|
14
|
-
onDoubleClick: s
|
|
15
|
-
}) {
|
|
16
|
-
const t = I(null);
|
|
17
|
-
return d(() => {
|
|
18
|
-
const l = t.current;
|
|
19
|
-
l !== null && te.render(n, l, {
|
|
20
|
-
displayMode: !a,
|
|
21
|
-
errorColor: "#cc0000",
|
|
22
|
-
output: "html",
|
|
23
|
-
strict: "warn",
|
|
24
|
-
throwOnError: !1,
|
|
25
|
-
trust: !1
|
|
26
|
-
});
|
|
27
|
-
}, [n, a]), /* @__PURE__ */ A(H, { children: [
|
|
28
|
-
/* @__PURE__ */ o(
|
|
29
|
-
"img",
|
|
30
|
-
{
|
|
31
|
-
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
32
|
-
width: 0,
|
|
33
|
-
height: 0,
|
|
34
|
-
alt: ""
|
|
35
|
-
}
|
|
36
|
-
),
|
|
37
|
-
/* @__PURE__ */ o(
|
|
38
|
-
"span",
|
|
39
|
-
{
|
|
40
|
-
role: "button",
|
|
41
|
-
tabIndex: -1,
|
|
42
|
-
onDoubleClick: s,
|
|
43
|
-
ref: t
|
|
44
|
-
}
|
|
45
|
-
),
|
|
46
|
-
/* @__PURE__ */ o(
|
|
47
|
-
"img",
|
|
48
|
-
{
|
|
49
|
-
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
|
|
50
|
-
width: 0,
|
|
51
|
-
height: 0,
|
|
52
|
-
alt: ""
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
] });
|
|
56
|
-
}
|
|
57
|
-
let T = !1;
|
|
58
|
-
const y = /* @__PURE__ */ new Map();
|
|
59
|
-
function re(n) {
|
|
60
|
-
T || (T = !0, n.registerCommand(
|
|
61
|
-
Y,
|
|
62
|
-
(a) => {
|
|
63
|
-
const s = y.get(a);
|
|
64
|
-
return s ? (s(), !0) : !1;
|
|
65
|
-
},
|
|
66
|
-
ee
|
|
67
|
-
));
|
|
68
|
-
}
|
|
69
|
-
function de({
|
|
70
|
-
equation: n,
|
|
71
|
-
inline: a,
|
|
72
|
-
nodeKey: s
|
|
73
|
-
}) {
|
|
74
|
-
const [t] = J(), l = W(), h = I(null), v = I(null), [f, C] = E(n), [i, u] = E(!1), [B, j] = E({ top: 0, left: 0 }), [F, D] = E(!1), g = m(() => {
|
|
75
|
-
const e = h.current;
|
|
76
|
-
if (!e) return;
|
|
77
|
-
const c = (e.closest(
|
|
78
|
-
".editor-equation"
|
|
79
|
-
) || e).getBoundingClientRect();
|
|
80
|
-
j({
|
|
81
|
-
top: c.bottom + 18,
|
|
82
|
-
left: c.left
|
|
83
|
-
}), D(!0);
|
|
84
|
-
}, []);
|
|
85
|
-
d(() => {
|
|
86
|
-
re(t);
|
|
87
|
-
}, [t]), d(() => {
|
|
88
|
-
const e = () => {
|
|
89
|
-
l && u(!0);
|
|
90
|
-
};
|
|
91
|
-
return y.set(s, e), () => {
|
|
92
|
-
y.delete(s);
|
|
93
|
-
};
|
|
94
|
-
}, [l, s]);
|
|
95
|
-
const p = m(() => {
|
|
96
|
-
if (l) {
|
|
97
|
-
if (i) {
|
|
98
|
-
u(!1);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
g(), u(!0);
|
|
102
|
-
}
|
|
103
|
-
}, [l, i, g]), b = m(() => {
|
|
104
|
-
const e = f.trim();
|
|
105
|
-
t.update(() => {
|
|
106
|
-
const r = w(s);
|
|
107
|
-
if (x(r)) {
|
|
108
|
-
if (r.isInline && r.isInline() && e === "") {
|
|
109
|
-
r.remove();
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
r.setEquation(e);
|
|
113
|
-
}
|
|
114
|
-
}), u(!1);
|
|
115
|
-
}, [t, s, f]), k = m(() => {
|
|
116
|
-
if (!n && a) {
|
|
117
|
-
t.update(() => {
|
|
118
|
-
const e = w(s);
|
|
119
|
-
x(e) && e.remove();
|
|
120
|
-
}), u(!1);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
C(n), n && u(!1);
|
|
124
|
-
}, [t, n, a, s]);
|
|
125
|
-
d(() => {
|
|
126
|
-
i || C(n);
|
|
127
|
-
}, [n, i]), d(() => {
|
|
128
|
-
if (!i) {
|
|
129
|
-
S(t.getRootElement()), D(!1);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
U(t.getRootElement()), g();
|
|
133
|
-
const e = window.requestAnimationFrame(() => {
|
|
134
|
-
const r = v.current;
|
|
135
|
-
if (!r) return;
|
|
136
|
-
const c = r.value.length;
|
|
137
|
-
r.focus(), r.setSelectionRange(c, c);
|
|
138
|
-
});
|
|
139
|
-
return () => {
|
|
140
|
-
window.cancelAnimationFrame(e), S(t.getRootElement());
|
|
141
|
-
};
|
|
142
|
-
}, [i, g]), d(() => {
|
|
143
|
-
if (!i) return;
|
|
144
|
-
const e = (r) => {
|
|
145
|
-
const c = r.target, _ = h.current, O = document.querySelector(".equation-block__popup");
|
|
146
|
-
c && (_ != null && _.contains(c) || O instanceof HTMLElement && O.contains(c)) || (a && !f.trim() && t.update(() => {
|
|
147
|
-
const L = w(s);
|
|
148
|
-
x(L) && L.remove();
|
|
149
|
-
}), u(!1));
|
|
150
|
-
};
|
|
151
|
-
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
152
|
-
}, [t, a, i, s, f]);
|
|
153
|
-
const P = (i ? f : n).trim(), R = P.length > 0, z = a && !l ? /* @__PURE__ */ o("span", { className: "equation-inline-trigger", children: /* @__PURE__ */ o(q, { onError: (e) => {
|
|
154
|
-
var r;
|
|
155
|
-
return (r = t._onError) == null ? void 0 : r.call(t, e);
|
|
156
|
-
}, children: /* @__PURE__ */ o(
|
|
157
|
-
N,
|
|
158
|
-
{
|
|
159
|
-
equation: n,
|
|
160
|
-
inline: a,
|
|
161
|
-
onDoubleClick: p
|
|
162
|
-
}
|
|
163
|
-
) }) }) : a ? /* @__PURE__ */ o(
|
|
164
|
-
"span",
|
|
165
|
-
{
|
|
166
|
-
className: `equation-inline-trigger${R ? "" : " equation-inline-trigger--empty"}`,
|
|
167
|
-
onClick: p,
|
|
168
|
-
ref: h,
|
|
169
|
-
children: R ? /* @__PURE__ */ o(q, { onError: (e) => {
|
|
170
|
-
var r;
|
|
171
|
-
return (r = t._onError) == null ? void 0 : r.call(t, e);
|
|
172
|
-
}, children: /* @__PURE__ */ o(
|
|
173
|
-
N,
|
|
174
|
-
{
|
|
175
|
-
equation: P,
|
|
176
|
-
inline: a,
|
|
177
|
-
onDoubleClick: p
|
|
178
|
-
}
|
|
179
|
-
) }) : /* @__PURE__ */ A("span", { className: "equation-inline-placeholder", children: [
|
|
180
|
-
/* @__PURE__ */ o(V, { icon: X, size: 24 }),
|
|
181
|
-
/* @__PURE__ */ o("span", { children: "New equation" })
|
|
182
|
-
] })
|
|
183
|
-
}
|
|
184
|
-
) : /* @__PURE__ */ o("div", { className: "equation-block", ref: h, children: /* @__PURE__ */ o(
|
|
185
|
-
"div",
|
|
186
|
-
{
|
|
187
|
-
className: "equation-block__container",
|
|
188
|
-
onClick: p,
|
|
189
|
-
style: { cursor: l ? "pointer" : "default" },
|
|
190
|
-
children: R ? /* @__PURE__ */ o(q, { onError: (e) => {
|
|
191
|
-
var r;
|
|
192
|
-
return (r = t._onError) == null ? void 0 : r.call(t, e);
|
|
193
|
-
}, children: /* @__PURE__ */ o(
|
|
194
|
-
N,
|
|
195
|
-
{
|
|
196
|
-
equation: P,
|
|
197
|
-
inline: a,
|
|
198
|
-
onDoubleClick: p
|
|
199
|
-
}
|
|
200
|
-
) }) : /* @__PURE__ */ o("div", { className: "equation-block__placeholder", children: "Add a TeX equation" })
|
|
201
|
-
}
|
|
202
|
-
) }), G = m(
|
|
203
|
-
(e) => {
|
|
204
|
-
e.stopPropagation(), C(e.currentTarget.value);
|
|
205
|
-
},
|
|
206
|
-
[]
|
|
207
|
-
), Q = m(
|
|
208
|
-
(e) => {
|
|
209
|
-
if (e.stopPropagation(), e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey) {
|
|
210
|
-
e.preventDefault(), b();
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
e.key === "Escape" && (e.preventDefault(), k());
|
|
214
|
-
},
|
|
215
|
-
[b, k]
|
|
216
|
-
);
|
|
217
|
-
return /* @__PURE__ */ A(H, { children: [
|
|
218
|
-
z,
|
|
219
|
-
i && F && $(
|
|
220
|
-
/* @__PURE__ */ o(
|
|
221
|
-
"div",
|
|
222
|
-
{
|
|
223
|
-
className: "equation-block__popup",
|
|
224
|
-
style: {
|
|
225
|
-
position: "fixed",
|
|
226
|
-
top: B.top,
|
|
227
|
-
left: B.left,
|
|
228
|
-
zIndex: 103
|
|
229
|
-
},
|
|
230
|
-
children: /* @__PURE__ */ A("div", { className: "equation-block__editor", children: [
|
|
231
|
-
/* @__PURE__ */ o(
|
|
232
|
-
Z,
|
|
233
|
-
{
|
|
234
|
-
autosize: !0,
|
|
235
|
-
minRows: 2,
|
|
236
|
-
variant: "unstyled",
|
|
237
|
-
value: f,
|
|
238
|
-
onChange: G,
|
|
239
|
-
onKeyDown: Q,
|
|
240
|
-
placeholder: "x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",
|
|
241
|
-
classNames: {
|
|
242
|
-
wrapper: "equation-block__textarea-wrapper"
|
|
243
|
-
},
|
|
244
|
-
autoFocus: !0,
|
|
245
|
-
ref: v
|
|
246
|
-
}
|
|
247
|
-
),
|
|
248
|
-
/* @__PURE__ */ A(K, { justify: "flex-end", gap: "sm", children: [
|
|
249
|
-
/* @__PURE__ */ o(M, { variant: "subtle", color: "gray", onClick: k, children: "Cancel" }),
|
|
250
|
-
/* @__PURE__ */ o(M, { onClick: b, children: "Save" })
|
|
251
|
-
] })
|
|
252
|
-
] })
|
|
253
|
-
}
|
|
254
|
-
),
|
|
255
|
-
document.body
|
|
256
|
-
)
|
|
257
|
-
] });
|
|
258
|
-
}
|
|
259
|
-
export {
|
|
260
|
-
de as default
|
|
261
|
-
};
|
package/dist/layers.DWkB5Cy0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.RJkTRw8_.js");require("./layers.aFMIBdF4.js");exports.Commands=e.CB;exports.subsetToBase64=e.QB;exports.subsetToBinary=e.NQ;exports.toBase64=e.AI;
|