@layers-app/editor 2.2.36 → 2.2.38
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 -3
- package/dist/index.js +2 -2
- package/dist/layers.0REZn_lY.js +1313 -0
- package/dist/{layers.Cz75o1gB.js → layers.18PewKSy.js} +1 -1
- package/dist/{layers.B-VqpRTJ.js → layers.1OPuhAtX.js} +1 -1
- package/dist/{layers.C-0llwLm.js → layers.39F97dtp.js} +1 -1
- package/dist/{layers.1hh8Q0OY.js → layers.3dJPuU8_.js} +1 -1
- package/dist/{layers.BdGmepRT.js → layers.5T08ATfy.js} +1 -1
- package/dist/{layers.0tL7cCyA.js → layers.8jdW8wNI.js} +6 -6
- package/dist/{layers.CCM8eucg.js → layers.B0cfi1L1.js} +1 -1
- package/dist/{layers.DF3Cv-lk.js → layers.B1Sb1r6g.js} +4135 -4186
- package/dist/{layers.DSfcMuPf.js → layers.B6A6XOVj.js} +8 -8
- package/dist/{layers.BiJ8hfRt.js → layers.B7K7JjK6.js} +3 -3
- package/dist/{layers.BxP3pHCe.js → layers.B7MWiSyo.js} +1 -1
- package/dist/{layers.yLcmMwSb.js → layers.B8CcCyGq.js} +1 -1
- package/dist/layers.B9yP9rFp.js +425 -0
- package/dist/{layers.BQIoC8oD.js → layers.BAPoBwhs.js} +1 -1
- package/dist/{layers.bFlC9CTx.js → layers.BB5F1j8t.js} +1 -1
- package/dist/{layers.Bv_WFZuv.js → layers.BC39hHD7.js} +1 -1
- package/dist/{layers.DHy7HiWV.js → layers.BCn2P5my.js} +3 -3
- package/dist/{layers.D7ZjUmsb.js → layers.BCtAMA9L.js} +4 -4
- package/dist/{layers.oGEQUPI0.js → layers.BEoF-RPO.js} +7 -7
- package/dist/{layers.BrnNc5d5.js → layers.BHgHtVNx.js} +1 -1
- package/dist/{layers.CxfjINWe.js → layers.BI10_7mS.js} +3 -3
- package/dist/{layers.BVX_4aR3.js → layers.BKJNYiK7.js} +3 -3
- package/dist/{layers.Cjp2yB4p.js → layers.BKygcBtJ.js} +1 -1
- package/dist/{layers.Dp23WBPp.js → layers.BLdzO4JH.js} +1 -1
- package/dist/{layers.Czg-dOyH.js → layers.BMLkAOGA.js} +1 -1
- package/dist/{layers.Dkq662rK.js → layers.BQp1bwal.js} +1 -1
- package/dist/layers.BRsumulG.js +744 -0
- package/dist/{layers.DaeEJzts.js → layers.BS8a3e_w.js} +1 -1
- package/dist/{layers.CIdiniuS.js → layers.BSTqaRx7.js} +2 -2
- package/dist/{layers.DFLKtwbm.js → layers.BTQSS3gY.js} +1 -1
- package/dist/{layers.C2GXClEE.js → layers.BUQPhrnH.js} +1 -1
- package/dist/{layers.BqIss95A.js → layers.BVNqvPml.js} +20041 -20384
- package/dist/{layers.BpVkhqTo.js → layers.BVNt7qKu.js} +1 -1
- package/dist/{layers.BceC-XAG.js → layers.BXgWOcK7.js} +1 -1
- package/dist/{layers.DtE6Egwt.js → layers.BZfJKmok.js} +1 -1
- package/dist/{layers.CVLAK754.js → layers.B_KDNugq.js} +3 -3
- package/dist/{layers.DtXjC0PI.js → layers.BcOGTH0M.js} +1 -1
- package/dist/{layers.dIphR4o_.js → layers.BfhvTwc5.js} +1 -1
- package/dist/{layers.DTZIQb53.js → layers.Bg-U1_Ht.js} +1 -1
- package/dist/{layers.BYCUS4B-.js → layers.BiGvw_F9.js} +1 -1
- package/dist/{layers.CdGrAP4M.js → layers.BiO43Vjm.js} +1 -1
- package/dist/{layers.BLXzvpBJ.js → layers.BiwcvzvD.js} +4 -4
- package/dist/{layers.BCSOeuhN.js → layers.Bkj9jv30.js} +2 -2
- package/dist/{layers.ColjCpI9.js → layers.BmGU0cED.js} +1 -1
- package/dist/{layers.DQtDgB1T.js → layers.BnNYCaYc.js} +1 -1
- package/dist/layers.Bnm4ZdXZ.js +1 -0
- package/dist/{layers.DcrtcBqK.js → layers.BoG3ggj6.js} +3 -3
- package/dist/{layers.D2ztodua.js → layers.BpNQ5Otf.js} +1 -1
- package/dist/{layers.CfI8_k08.js → layers.BqmQGMxu.js} +1 -1
- package/dist/{layers.Cd9K4F_2.js → layers.BrFpY5NF.js} +1 -1
- package/dist/{layers.D3NJDt6R.js → layers.BroFhLCI.js} +4 -4
- package/dist/{layers.CBT3MylR.js → layers.Bs0vnjcU.js} +1 -1
- package/dist/layers.BsdtsKxp.js +6 -0
- package/dist/{layers.CTxK0kR8.js → layers.BshAYohY.js} +5 -5
- package/dist/{layers.DCCoxJkC.js → layers.Bt3vOCdl.js} +1 -1
- package/dist/{layers.CMMq2nK7.js → layers.BtGCdsOf.js} +1 -1
- package/dist/{layers.Ck2r3Yqw.js → layers.BxxCaJjb.js} +118 -118
- package/dist/{layers.BK4AWYDk.js → layers.C-raYyps.js} +1 -1
- package/dist/layers.C02HSyg6.js +1 -0
- package/dist/{layers.BRoUDrFy.js → layers.C0FzuphD.js} +1 -1
- package/dist/{layers.Ccc3NxVM.js → layers.C10hvRkZ.js} +1 -1
- package/dist/{layers.CPEktyA3.js → layers.C1QXg3Jt.js} +1 -1
- package/dist/{layers.Ch9b0Nie.js → layers.C26JqqkY.js} +319 -310
- package/dist/{layers.DTfihMmf.js → layers.C2A5jt12.js} +1 -1
- package/dist/layers.C33liaDA.js +51 -0
- package/dist/{layers.Bk_CPG0h.js → layers.C3pDDh0P.js} +1 -1
- package/dist/{layers.C29vt0nb.js → layers.C4nGWXlv.js} +1 -1
- package/dist/{layers.Ce3m-DaF.js → layers.C7hfQLjj.js} +1 -1
- package/dist/{layers.CUfP-jNe.js → layers.C8HXTeqs.js} +1 -1
- package/dist/{layers.By4OQ14L.js → layers.CAcRpQTd.js} +1 -1
- package/dist/{layers.BLRLK1FM.js → layers.CBp2sIr9.js} +6 -6
- package/dist/layers.CDw2v5qf.js +96 -0
- package/dist/{layers.DNySFsU-.js → layers.CHoVBcRa.js} +1 -1
- package/dist/{layers.ClNW-gDA.js → layers.CIokgheU.js} +11 -11
- package/dist/{layers.Ds2PAjq3.js → layers.CJiMwwjf.js} +1 -1
- package/dist/{layers.o-fA2TED.js → layers.CLErhGgC.js} +3 -3
- package/dist/{layers.CKOJE-AR.js → layers.CLsLUhwC.js} +1 -1
- package/dist/{layers.D_UIuqLt.js → layers.CMqJdfFP.js} +1 -1
- package/dist/{layers.C_KKVT88.js → layers.CN5H8V4s.js} +1 -1
- package/dist/{layers.Dn_wqDG9.js → layers.CQKdBJ4q.js} +1 -1
- package/dist/layers.CQM5VFyH.js +8 -0
- package/dist/{layers.BUQei9Us.js → layers.CSlhtaMo.js} +1 -1
- package/dist/{layers.CnvvjO7B.js → layers.CUXdHkqf.js} +22 -22
- package/dist/{layers.DOJT57K-.js → layers.CUiajwbr.js} +1 -1
- package/dist/layers.CV5ww3d4.js +1 -0
- package/dist/{layers.fdbpbOl5.js → layers.CVBgF8JI.js} +1 -1
- package/dist/{layers.VZkl6vtd.js → layers.CVxJ2voL.js} +1 -1
- package/dist/{layers.CYzumB_X.js → layers.CWQsM2fl.js} +1 -1
- package/dist/layers.CX-cT2As.js +16 -0
- package/dist/{layers.BgOa2ZQq.js → layers.C_IvrzZ3.js} +1 -1
- package/dist/{layers.BXeK8v8x.js → layers.C_YwmHCO.js} +1 -1
- package/dist/{layers.D4iEFs6v.js → layers.CaBWYvbi.js} +4 -4
- package/dist/{layers.DW6tdK3N.js → layers.Cbm9e7Ew.js} +1 -1
- package/dist/{layers.Bn7puudU.js → layers.Cbw9E5UO.js} +1 -1
- package/dist/{layers.Bk-aWV8W.js → layers.Cc40EBSn.js} +1 -1
- package/dist/{layers.Dn61U3rf.js → layers.CcyOeu91.js} +2 -2
- package/dist/{layers.BMwpqIK5.js → layers.Cgz71CwW.js} +1 -1
- package/dist/{layers.CjFKg7E3.js → layers.ChQueUxi.js} +1 -1
- package/dist/{layers.Dj5I7cJX.js → layers.CiuD34ko.js} +1 -1
- package/dist/{layers.DwUn0uDb.js → layers.Cj-xSFIY.js} +3 -3
- package/dist/{layers.DMQMMmAG.js → layers.CjTZIuJq.js} +1 -1
- package/dist/{layers.CbWeCajn.js → layers.Cn_PdJ2B.js} +1 -1
- package/dist/{layers.tvwd8C73.js → layers.Co23VtNJ.js} +1 -1
- package/dist/{layers.B5JiacAt.js → layers.Cp_fXl59.js} +1 -1
- package/dist/{layers.DrVeQ5KU.js → layers.CqTvrRTA.js} +207 -213
- package/dist/{layers.D2e6bIUh.js → layers.Cqra_U-X.js} +1 -1
- package/dist/{layers.Bn5zP3iK.js → layers.Cshrb3W9.js} +1 -1
- package/dist/{layers.EgcenEI2.js → layers.CtvGWfNj.js} +1 -1
- package/dist/{layers.D01NLLgQ.js → layers.Cufkqd4I.js} +1 -1
- package/dist/layers.CuqTRqUL.js +8590 -0
- package/dist/{layers.hOkTdHRY.js → layers.CztJonvH.js} +1 -1
- package/dist/{layers.CgKN8p30.js → layers.D-NMWRXq.js} +1 -1
- package/dist/{layers.DKZmKMOa.js → layers.D0H8geKT.js} +1 -1
- package/dist/{layers.whzfARFq.js → layers.D1UUgzSp.js} +1 -1
- package/dist/{layers.C_VniyN3.js → layers.D1XC8bmp.js} +1 -1
- package/dist/{layers.Bix9Z7gO.js → layers.D1h0kNVg.js} +1 -1
- package/dist/{layers.BAEQgDl9.js → layers.D1iXmmXk.js} +1 -1
- package/dist/{layers.C4h_Olnt.js → layers.D2dds0e6.js} +1 -1
- package/dist/{layers.D4xteTrT.js → layers.D5Dc6eF2.js} +1 -1
- package/dist/{layers.B1RdXCaP.js → layers.D5zGve-8.js} +1 -1
- package/dist/{layers.D2HkYJlz.js → layers.D80N7cbc.js} +1 -1
- package/dist/{layers.CrmgVFSe.js → layers.D9vIh6a-.js} +1 -1
- package/dist/{layers.BeUrtFXm.js → layers.DAMkemGY.js} +1 -1
- package/dist/{layers.BrC__RJJ.js → layers.DBXDnNVp.js} +1 -1
- package/dist/{layers.7kkFsP3c.js → layers.DCm6tSc0.js} +1 -1
- package/dist/{layers.5bLQnIrP.js → layers.DCuvvt5j.js} +1 -1
- package/dist/{layers.wHl59Fgx.js → layers.DD05DOl_.js} +1 -1
- package/dist/{layers.CVjkKS8B.js → layers.DDorG9PE.js} +1 -1
- package/dist/layers.DIo-cti0.js +198 -0
- package/dist/{layers.CVFGbTs6.js → layers.DJJMhnMZ.js} +1 -1
- package/dist/{layers.jnHf2suC.js → layers.DJPn3yQp.js} +1 -1
- package/dist/{layers.CwK2mbvW.js → layers.DOODZmBz.js} +1 -1
- package/dist/{layers.XwLoMlXI.js → layers.DS9wgLZm.js} +8485 -8821
- package/dist/{layers.qYt0TJJ4.js → layers.DSaFKz1N.js} +1 -1
- package/dist/{layers.Dg_slH_q.js → layers.DT0-ODzW.js} +1 -1
- package/dist/{layers.Bxw5Db4J.js → layers.DT9QLH7S.js} +6 -2
- package/dist/{layers.D9Do4RdE.js → layers.DU1QVYjU.js} +1 -1
- package/dist/{layers.PHvDuZg0.js → layers.DUtalWpc.js} +2 -2
- package/dist/{layers.Xp97Sz_N.js → layers.DVzfF32A.js} +1 -1
- package/dist/{layers.so4ZbbwR.js → layers.DWWtOd7h.js} +1 -1
- package/dist/{layers.WMHrMtsL.js → layers.DWh4SOPQ.js} +2 -2
- package/dist/{layers.C21C2aKs.js → layers.DX-D76ao.js} +1 -1
- package/dist/{layers.C7suL2YP.js → layers.DYgDJOz0.js} +1 -1
- package/dist/{layers.DVtzMzs3.js → layers.DZJpjSS0.js} +1 -1
- package/dist/{layers.D_I4Lw2m.js → layers.DZPWthr1.js} +1 -1
- package/dist/{layers.veUC8K3a.js → layers.D_Eu8K0-.js} +2 -2
- package/dist/{layers.DlPlr1KF.js → layers.DauXqWVq.js} +1 -1
- package/dist/{layers.CH5EQOay.js → layers.Dbf5X0q2.js} +4 -4
- package/dist/{layers.CeudNs4j.js → layers.DcHg-KZ0.js} +1 -1
- package/dist/layers.DdGRCNWp.js +6 -0
- package/dist/{layers.D_h7gZD3.js → layers.DdInQCwR.js} +1 -1
- package/dist/layers.DfjXbo09.js +1 -0
- package/dist/{layers.DpTzW4C2.js → layers.DgblS7iP.js} +1 -1
- package/dist/{layers.CYUr9c0r.js → layers.Dh5ftZI1.js} +1 -1
- package/dist/{layers.pnaj8V19.js → layers.Dh8z7jjz.js} +1 -1
- package/dist/layers.Dlsb9nLi.js +423 -0
- package/dist/{layers.D2ZjXy_d.js → layers.Do0HWb_v.js} +1 -1
- package/dist/{layers.iZo71OAc.js → layers.DsJnhL0B.js} +1 -1
- package/dist/{layers.BRcVu1b4.js → layers.DtjfmQe1.js} +1 -1
- package/dist/{layers.CO3vUnZ9.js → layers.Dvq-Zve_.js} +1 -1
- package/dist/{layers.DmRixUoZ.js → layers.DxuZv6E0.js} +1 -1
- package/dist/{layers.D4djJdmW.js → layers.DzRdMThr.js} +1 -1
- package/dist/{layers.wlbZ60FA.js → layers.Ey20o22M.js} +1 -1
- package/dist/{layers.DBj0hB3e.js → layers.G5cESaE_.js} +1 -1
- package/dist/{layers.CEDal4zK.js → layers.HEsS5y1T.js} +1 -1
- package/dist/{layers.CFTOwqWK.js → layers.IxNjRbJm.js} +1 -1
- package/dist/{layers.Cd5L-1u-.js → layers.JWCDyjQN.js} +1 -1
- package/dist/{layers.BRlmGZWu.js → layers.JaELAJHu.js} +1 -1
- package/dist/{layers.1ZkrPIEi.js → layers.KQSEtYT6.js} +1 -1
- package/dist/{layers.DKeFIsYL.js → layers.KkCagS35.js} +1 -1
- package/dist/{layers.BODQJEQB.js → layers.Lkvi5PkF.js} +1 -1
- package/dist/{layers.C8J9ZPEW.js → layers.LoV9Fa8_.js} +1 -1
- package/dist/{layers.CE3fIPGh.js → layers.MLYGzLOg.js} +1 -1
- package/dist/{layers.CyCf11X6.js → layers.Mjh6NBI9.js} +1 -1
- package/dist/{layers.CCtHpREt.js → layers.No2YPoks.js} +1 -1
- package/dist/{layers.H-stACgf.js → layers.NsYSQQa2.js} +1 -1
- package/dist/{layers.UU-ESUgI.js → layers.UTaNax7j.js} +1 -1
- package/dist/{layers.B7ZVoxI_.js → layers.VFCVYaIo.js} +1 -1
- package/dist/{layers.Dn0qwMcp.js → layers.VGptWvlf.js} +1 -1
- package/dist/layers.XCugOyqj.js +1 -0
- package/dist/{layers.BPDB61NR.js → layers.XJH4VrvG.js} +1 -1
- package/dist/{layers.y0XpFTPc.js → layers.Ycz-ExAm.js} +3 -3
- package/dist/{layers.DzE9Y2Jb.js → layers.YilSJcWq.js} +1 -1
- package/dist/{layers.C6OA5VSC.js → layers.Zi0v4fhS.js} +4 -4
- package/dist/{layers.eotcW9wC.js → layers._6EYO0XA.js} +4 -4
- package/dist/{layers.D3YdMa8T.js → layers.b-vA5ZmL.js} +1 -1
- package/dist/{layers.BT_IwW95.js → layers.c1ih72Jl.js} +1 -1
- package/dist/layers.eacBXb03.js +1 -0
- package/dist/{layers.DepRfjwq.js → layers.g78SKWlH.js} +3 -3
- package/dist/{layers.B4taJE9r.js → layers.gGrbVNvy.js} +1 -1
- package/dist/{layers.ehvTlE1d.js → layers.gPVwr0xW.js} +10 -10
- package/dist/{layers.DUDztruN.js → layers.gSVrhs75.js} +1 -1
- package/dist/{layers.CjaZcWis.js → layers.krPk3upT.js} +1 -1
- package/dist/{layers.DzIhUSyr.js → layers.mHfaD8cU.js} +1 -1
- package/dist/{layers.BKY9JF14.js → layers.o0sWUVwF.js} +5 -5
- package/dist/{layers.Y0K7KUXi.js → layers.pO-s3eCT.js} +1 -1
- package/dist/{layers.DqcyZcvc.js → layers.ruUv3Yt3.js} +1 -1
- package/dist/{layers.BpI7IACC.js → layers.u-oiw39m.js} +1 -1
- package/dist/{layers.BKyLGpPM.js → layers.v-opabce.js} +1 -1
- package/dist/{layers.CMztkCJ2.js → layers.vNAH5nuN.js} +1 -1
- package/dist/{layers.CmCqs2BF.js → layers.wVtjFs1w.js} +3 -3
- package/dist/{layers.DkOQ-BJH.js → layers.xQVzjSs-.js} +1 -1
- package/dist/{layers.BlZJxQ0P.js → layers.zYlP4pgB.js} +1 -1
- package/package.json +2 -2
- package/dist/layers.BCE8BkDd.js +0 -108
- package/dist/layers.BMTTjsyZ.js +0 -1
- package/dist/layers.BP8lmHgN.js +0 -198
- package/dist/layers.CKuU8C7I.js +0 -1
- package/dist/layers.CTbuQHTV.js +0 -10148
- package/dist/layers.C_uAWrxf.js +0 -1
- package/dist/layers.CfDfI_mb.js +0 -1309
- package/dist/layers.CiEcv1YI.js +0 -423
- package/dist/layers.DCTIBd3_.js +0 -6
- package/dist/layers.DS95By2X.js +0 -16
- package/dist/layers.DWciQNL5.js +0 -7
- package/dist/layers.Di0PWlz-.js +0 -51
- package/dist/layers.Do0Nu3f6.js +0 -425
- package/dist/layers.Duc23Wwh.js +0 -1
- package/dist/layers.E1j1nxcY.js +0 -712
- package/dist/layers.Gto0fECH.js +0 -8
- package/dist/layers.VcSYrjDg.js +0 -1
- package/dist/layers.afYOhdT_.js +0 -1
package/dist/layers.CKuU8C7I.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),A=require("react-i18next"),E=require("@lexical/react/LexicalComposerContext"),C=require("@mantine/core"),I=require("lexical"),n=require("./layers.CfDfI_mb.js"),z=require("@layers-app/shared"),ie=require("@lexical/react/useLexicalEditable"),_=require("@mantine/hooks");require("@lexical/react/LexicalDecoratorBlockNode");require("@lexical/utils");require("@lexical/mark");require("@lexical/code");require("@lexical/selection");require("react-dom");require("@lexical/react/LexicalErrorBoundary");require("@lexical/react/LexicalBlockWithAlignableContents");require("@mantine/notifications");const Y=[["path",{d:"M8.00001 3.09779C8.00001 3.09779 4.03375 2.74194 3.38784 3.38785C2.74192 4.03375 3.09784 8 3.09784 8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.00001 20.9022C8.00001 20.9022 4.03375 21.2581 3.38784 20.6122C2.74192 19.9662 3.09784 16 3.09784 16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M16 3.09779C16 3.09779 19.9663 2.74194 20.6122 3.38785C21.2581 4.03375 20.9022 8 20.9022 8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M16 20.9022C16 20.9022 19.9663 21.2581 20.6122 20.6122C21.2581 19.9662 20.9022 16 20.9022 16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14.0107 9.99847L20.0625 3.94678",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M9.99696 14.0024L3.63966 20.3807",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M9.99732 10.0024L3.84571 3.85889",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M13.9795 14.0024L20.5279 20.4983",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"7"}]];function re(e,i){const o=document.createElement("a");o.href=e,o.download=i,o.rel="noopener",document.body.appendChild(o),o.click(),o.remove()}function $(e){try{const o=new URL(e,window.location.origin).pathname.split("/").pop()||"image";return o.includes(".")?o:`${o}.png`}catch{return"image"}}async function q(e,i){const o=await fetch(e);if(!o.ok)throw new Error("fetch failed");const a=await o.blob(),d=URL.createObjectURL(a);try{re(d,i)}finally{setTimeout(()=>URL.revokeObjectURL(d),0)}}function Z({opened:e,onOpenChange:i,t:o,onDownload:a,onDelete:d}){return t.jsxs(C.Menu,{opened:e,onChange:i,transitionProps:n.animationMenu,shadow:"md",position:"bottom-start",offset:4,withinPortal:!0,closeOnItemClick:!0,children:[t.jsx(C.Menu.Target,{children:t.jsx(n.ActionIcon,{label:o("editor.toolbar.more"),icon:n.MoreHorizontalIcon,iconColor:"var(--mantine-color-gray-text)","aria-label":o("editor.toolbar.more")})}),t.jsxs(C.Menu.Dropdown,{p:4,w:164,onMouseDown:l=>l.preventDefault(),children:[t.jsx(C.Menu.Item,{leftSection:t.jsx(C.Flex,{align:"center",justify:"center",c:"gray.6",children:t.jsx(n.HugeiconsIcon,{icon:n.Download01Icon,size:16})}),onClick:l=>{l.stopPropagation(),a()},children:o("editor.gallery.download")}),t.jsx(C.Menu.Item,{color:"red",leftSection:t.jsx(C.Flex,{align:"center",justify:"center",c:"red.6",children:t.jsx(n.HugeiconsIcon,{icon:n.Delete03Icon,size:16})}),onClick:l=>{l.stopPropagation(),d()},children:o("editor.contextMenu.delete")})]})]})}const J=({t:e,src:i,setShown:o,id:a})=>{const[d,{open:l,close:p}]=_.useDisclosure(!1),u=s.useMemo(()=>[{id:!a||a==="0"?"":a,Url:i??"",contentType:"image/*",originalFileName:"",fileSize:0,storageType:"",storagePath:"",fileName:"",parentType:"",parentId:"",ownerId:"",createdAt:new Date,updatedAt:new Date,version:0,deleted:!1,deletedAt:new Date}],[i,a]),h=m=>{m?l():p()};return t.jsxs(t.Fragment,{children:[t.jsx(z.AttachmentsGalleryModal,{opened:d,onOpenChange:h,attachments:u}),t.jsx(n.ActionIcon,{label:e("editor.image.preview"),icon:Y,iconColor:"var(--mantine-color-gray-text)","aria-label":e("editor.image.preview"),onClick:()=>{o(!1),l()}})]})},ae=({nodeKey:e,src:i})=>{const[o]=E.useLexicalComposerContext(),a=ie.useLexicalEditable(),[d,l]=s.useState(!1),[p,u]=s.useState(!1),{t:h}=A.useTranslation(),m=s.useCallback(()=>{o.update(()=>{const w=I.$getNodeByKey(e);n.$isImageNode(w)&&w.remove()})},[o,e]),k=s.useCallback(async()=>{if(i)try{await q(i,$(i))}catch{}},[i]);return t.jsxs("div",{className:`media-actions ${a?"":"media-actions--readonly"}`,children:[t.jsx(J,{t:h,src:i,setShown:()=>{}}),a&&t.jsxs(t.Fragment,{children:[t.jsx(n.NodeAlignmentMenu,{opened:d,setOpened:l,t:h,editor:o,nodeKey:e,setShown:()=>{}}),t.jsx(Z,{opened:p,onOpenChange:u,t:h,onDownload:()=>void k(),onDelete:m})]})]})},se=()=>{};function le({nodeKey:e,src:i,id:o}){const{t:a}=A.useTranslation(),[d]=E.useLexicalComposerContext(),[l,p]=s.useState(!1),[u,h]=s.useState(!1),m=s.useCallback(()=>{h(!1),d.update(()=>{const w=I.$getNodeByKey(e);if(!n.$isImageNode(w))return;const y=w.getParent();n.$isImageOverlayWrapperNode(y)?y.remove():w.remove()})},[d,e]),k=s.useCallback(async()=>{if(i)try{await q(i,$(i))}catch{}},[i]);return t.jsxs("div",{className:"media-actions visible",style:{position:"absolute",top:10,right:10,zIndex:10,pointerEvents:"auto",display:"flex",gap:4},onClick:w=>w.stopPropagation(),children:[t.jsx(J,{t:a,src:i,setShown:se,id:o}),t.jsx(n.NodeAlignmentMenu,{opened:l,setOpened:p,t:a,editor:d,nodeKey:e}),t.jsx(Z,{opened:u,onOpenChange:h,t:a,onDownload:()=>void k(),onDelete:m})]})}function de({nodeKey:e,src:i,id:o}){const{t:a}=A.useTranslation(),[d]=E.useLexicalComposerContext(),[l,{open:p,close:u}]=_.useDisclosure(!1),[h,{open:m,close:k}]=_.useDisclosure(!1),w=s.useMemo(()=>[{id:!o||o==="0"?"":o,Url:i??"",contentType:"image/*",originalFileName:"",fileSize:0,storageType:"",storagePath:"",fileName:"",parentType:"",parentId:"",ownerId:"",createdAt:new Date,updatedAt:new Date,version:0,deleted:!1,deletedAt:new Date}],[i,o]),y=()=>{u(),m()},L=s.useCallback(async()=>{if(u(),!!i)try{await q(i,$(i))}catch{}},[i,u]),j=s.useCallback(()=>{u(),d.update(()=>{const c=I.$getNodeByKey(e);n.$isImageNode(c)&&c.remove()})},[d,e,u]);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"image-touch-actions",style:{position:"absolute",top:8,right:8,zIndex:10,pointerEvents:"auto"},onClick:c=>c.stopPropagation(),children:t.jsx(n.ActionIcon,{label:a("editor.toolbar.more"),icon:n.MoreHorizontalCircle01Icon,iconColor:"var(--mantine-color-gray-text)","aria-label":a("editor.toolbar.more"),onClick:p})}),t.jsx(z.AttachmentsGalleryModal,{opened:h,onOpenChange:c=>c?m():k(),attachments:w}),t.jsx(n.MobileDrawer,{opened:l,onClose:u,title:a("editor.image.mobileActions"),children:t.jsxs(C.Stack,{gap:4,p:0,children:[t.jsx(C.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:y,leftSection:t.jsx(n.HugeiconsIcon,{icon:Y,size:16,color:"var(--mantine-color-dimmed)"}),children:a("editor.image.previewFullScreen")}),t.jsx(C.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:()=>void L(),leftSection:t.jsx(n.HugeiconsIcon,{icon:n.Download01Icon,size:16,color:"var(--mantine-color-dimmed)"}),children:a("editor.gallery.download")}),t.jsx(C.Button,{type:"button",variant:"subtle",color:"red",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:j,leftSection:t.jsx(n.HugeiconsIcon,{icon:n.Delete03Icon,size:16,color:"var(--mantine-color-red-6)"}),children:a("editor.actions.delete")})]})})]})}const X=e=>{const{width:i,height:o,isLoading:a,isError:d,src:l,id:p,altText:u,imageRef:h,maxWidth:m}=e;return t.jsxs("div",{className:"media-wrapper",style:{width:i,height:o,display:"inline-flex",position:"relative"},children:[t.jsx(C.LoadingOverlay,{visible:a,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),t.jsx(ce,{className:null,src:l,altText:u,imageRef:h,width:"inherit",height:"inherit",maxWidth:m||"auto",id:p}),n.IS_TOUCH_DEVICE&&t.jsx(de,{nodeKey:e.nodeKey,src:l,id:p}),n.IS_TOUCH_TABLET&&t.jsx(le,{nodeKey:e.nodeKey,src:l,id:p}),n.IS_HOVER_CAPABLE&&!n.IS_TOUCH_DEVICE&&!n.IS_TOUCH_TABLET&&t.jsx(ae,{nodeKey:e.nodeKey,src:l})]})};function ce({altText:e,className:i,imageRef:o,src:a,width:d,height:l,maxWidth:p,id:u}){const[h,m]=s.useState(!1);return t.jsx("img",{className:`${i||void 0} ${h?"":"loading"}`,src:a,alt:e,ref:o,style:{height:l,maxWidth:p,width:d},onLoad:()=>{a.includes("splash")?setTimeout(()=>{m(!0)},100):m(!0)},draggable:"false","data-id":u})}function ue(e){const{disable:i}=s.useContext(n.Context);return i&&n.ImageNode.isPlaceholderSrc(e.src)?null:t.jsx(ge,{...e})}function ge({src:e,altText:i,nodeKey:o,width:a,height:d,maxWidth:l,showCaption:p,caption:u,id:h,create:m,alignment:k,imagePickerTab:w}){var V,G;const y=s.useRef(null),[L,j]=s.useState(!0),[c]=E.useLexicalComposerContext(),[v,T]=s.useState(!0),[b,O]=s.useState({width:0,height:0}),{start:R}=n.useCancelUpload(),[he,P]=s.useState(0),{fetchUploadMedia:M,fetchDeleteMedia:H,maxFileSize:pe,imperativeHandleRef:N,disable:K}=s.useContext(n.Context),D=n.mediaMap.has(e)&&(((V=n.mediaMap.get(e))==null?void 0:V.mediaNodeKeys.length)===0||((G=n.mediaMap.get(e))==null?void 0:G.mediaNodeKeys.length)===void 0||e.trim()===""),{t:S}=A.useTranslation(),[me,Q]=s.useState(0);s.useEffect(()=>c.registerDecoratorListener(()=>{Q(r=>r+1)}),[D]),s.useEffect(()=>{if(!e||e.startsWith("data:image/")||!e.trim()){j(!1);return}const r=new Image;r.src=e,r.onload=()=>j(!1),r.onerror=()=>{j(!1)}},[e,D]);const ee=(r,f)=>{c.update(()=>{I.$setSelection(null);const g=I.$getNodeByKey(o);n.$isImageNode(g)&&g.setWidthAndHeight(r,f)})},{historyState:B}=n.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:F}}=n.useSettings();function te(r){return r.endsWith(".svg")||r.includes("image/svg+xml")}function oe(r){return new Promise((f,g)=>{if(te(r)){f(0);return}const x=new Image;x.src=r,x.onload=()=>{f(x.width)},x.onerror=()=>{g(new Error("Failed to load image"))}})}s.useEffect(()=>{let r=a,f=d,g=100;(e.includes("unsplash")?e.trim():!D&&e.trim()||e.includes("upload-src-editor"))&&e!=="upload"&&oe(e).then(x=>{typeof r=="number"&&r<g&&x<g?(T(!0),O({width:r,height:f})):x<g?(T(!0),O({width:"auto",height:"auto"})):(O({width:x,height:x}),T(!1))}).catch(x=>{console.warn("Ошибка при загрузке изображения:",x.message)})},[e,D]),s.useEffect(()=>{b.width&&b.height&&v&&c.update(()=>{const r=I.$getNodeByKey(o);n.$isImageNode(r)&&r.setWidthAndHeight(b.width,b.height)})},[b.width,b.height,v]);const ne=s.useCallback(r=>n.$writeImagePickerTabToNode(c,o,r),[c,o]),W=s.useCallback((r,f)=>{j(!1),c.update(()=>{const g=I.$getNodeByKey(o);n.$isImageNode(g)&&(g.setSrc(r),g.setId(f))})},[c,o]),U=s.useCallback(r=>{j(!0);const f=R();M&&M(r[0],(g,x)=>{W(g,x),P(0)},g=>{g&&z.showErrorNotification({message:S("editor.gallery.errorFile")}),P(0),W(e.startsWith("blob:")?"upload":"","")},f,g=>{P(g)})},[M,R,S,W,e]);return s.useEffect(()=>c.registerCommand(n.UPLOAD_IMAGE_COMMAND,r=>!e.startsWith("blob:")&&e!=="upload"||r.targetNodeKey!==o?!1:(U(r.files),!0),I.COMMAND_PRIORITY_LOW),[c,U,o,e]),!e||e==="upload"?t.jsx(C.Box,{"data-editor-image-picker-drop-root":!0,w:"100%",children:t.jsx(n.ImagePicker,{inline:!0,nodeKey:o,defaultTabValue:w,onWriteTabToNode:ne,uploading:!1,onUpload:r=>{!M||!r.length||U(r)},popoverProps:{opened:!0,position:"bottom",zIndex:n.EDITOR_UI_MIN_Z_INDEX},onChange:r=>{c.update(()=>{const f=I.$getNodeByKey(o);n.$isImageNode(f)&&f.setSrc(r)})}})}):v?t.jsx(X,{width:b.width,height:b.height,isLoading:L,isError:!1,isIcon:v,src:e,id:h,editor:c,nodeKey:o,fetchDeleteMedia:H,altText:i,imageRef:y,maxWidth:l,showCaption:p,caption:u,isCollabActive:!1,historyState:B,showNestedEditorTreeView:F,t:S}):t.jsx(n.ResizableContainer,{editor:c,isIcon:v,width:n.parseContainerSize(a),height:n.parseContainerSize(d),initialWidth:b.width||"",initialHeight:b.height||"",onResizeEnd:ee,alignment:k,disable:K,onRegisterDecoratorEnter:r=>{N!=null&&N.current&&(N.current.decoratorEnterAction=r)},onActivate:()=>c.dispatchCommand(n.ON_CHANGE_COMMAND,"show_menu"),children:t.jsx(X,{width:"inherit",height:"inherit",isLoading:L,isError:!1,isIcon:v,src:e,id:h,editor:c,nodeKey:o,fetchDeleteMedia:H,altText:i,imageRef:y,maxWidth:l,showCaption:p,caption:u,isCollabActive:!1,historyState:B,showNestedEditorTreeView:F,t:S})})}exports.default=ue;
|