@layers-app/editor 0.7.90 → 0.7.92
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 +831 -831
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +65 -5
- package/dist/index.js +14 -12
- package/dist/{layers.DZSz_qcH.js → layers.-cNYa8FH.js} +1 -1
- package/dist/layers.-go0yqrB.js +346 -0
- package/dist/{layers.uebdwOKq.js → layers.-mDZECmb.js} +1 -1
- package/dist/{layers.D-ZGP1Xn.js → layers.2HPpqSIH.js} +1 -1
- package/dist/{layers.CY7XlSSp.js → layers.8fnCtugI.js} +1 -1
- package/dist/{layers.CaORVRrA.js → layers.8jZXu6Rm.js} +1 -1
- package/dist/{layers.Bshn8mWt.js → layers.9mcMwZEW.js} +4 -4
- package/dist/{layers.tHtpSE5k.js → layers.9mdVpQdh.js} +1 -1
- package/dist/{layers.BjZd_s7H.js → layers.B1ARxIqB.js} +1 -1
- package/dist/{layers.2X0cNWjm.js → layers.B1oYEFZP.js} +1 -1
- package/dist/{layers.DzNZFg56.js → layers.B3UEoC3V.js} +1 -1
- package/dist/{layers.DKIpiQlq.js → layers.B3mTVCFZ.js} +1 -1
- package/dist/{layers.COJEfyVy.js → layers.B5DNqRLR.js} +1 -1
- package/dist/{layers.C5k4ynsr.js → layers.B67YEwi2.js} +1 -1
- package/dist/{layers.CugBQAoy.js → layers.B6iDa8RT.js} +1 -1
- package/dist/{layers.CE0SHuy7.js → layers.B8MrCT1B.js} +1 -1
- package/dist/{layers.B3JN31_h.js → layers.B8Y8jR5X.js} +1 -1
- package/dist/{layers.CvhEIibf.js → layers.B9Jm8gWZ.js} +8 -8
- package/dist/{layers.D4rj-cy7.js → layers.BA-Hn-8i.js} +1 -1
- package/dist/{layers.Co9eTmwb.js → layers.BAJ2-bXH.js} +1 -1
- package/dist/{layers.1zs2Qv-c.js → layers.BBvJZ2gd.js} +2 -2
- package/dist/{layers.BuF2UUJr.js → layers.BFBYRXUj.js} +1 -1
- package/dist/layers.BFiBXBMU.js +1 -0
- package/dist/{layers.DaqlQ6l8.js → layers.BHIb7oOU.js} +1 -1
- package/dist/{layers.PqGzg4Wa.js → layers.BJ9hFtJT.js} +1 -1
- package/dist/{layers.BUtbUni3.js → layers.BNQ1MOkD.js} +1 -1
- package/dist/{layers.CAzggtgk.js → layers.BNi48siA.js} +1 -1
- package/dist/{layers.DsWuLdeN.js → layers.BOh-DK5k.js} +1 -1
- package/dist/{layers.CicD3V5E.js → layers.BQ-H3YLY.js} +4 -4
- package/dist/{layers.B8PPrHUo.js → layers.BR01ua_4.js} +1 -1
- package/dist/{layers.Dptsbk1a.js → layers.BUGORd_C.js} +4 -4
- package/dist/{layers.BkRSoXvG.js → layers.BV5O3Yjr.js} +1 -1
- package/dist/{layers.Brj5jmuH.js → layers.BX4qFBHZ.js} +2 -2
- package/dist/layers.BYU-0xYT.js +6 -0
- package/dist/{layers.DXz2vpQo.js → layers.BYtl3t4o.js} +1 -1
- package/dist/{layers.BEcN1aad.js → layers.Ba0lsCQC.js} +1 -1
- package/dist/{layers.CkWgmSL1.js → layers.BcpQT2YY.js} +1 -1
- package/dist/{layers.Dc19W8CG.js → layers.BcsRLUTx.js} +1 -1
- package/dist/{layers.CmrEgPZd.js → layers.BeWDYex5.js} +1 -1
- package/dist/{layers.B-NmPm-M.js → layers.BexTNd-c.js} +1 -1
- package/dist/{layers.CG38BVMd.js → layers.BfpJiswu.js} +65 -65
- package/dist/{layers.BxLMsfZS.js → layers.BgVF9Tny.js} +1 -1
- package/dist/{layers.C38EcvG7.js → layers.BhE4ByBZ.js} +1 -1
- package/dist/{layers.C-MqLihs.js → layers.BhIZgvhm.js} +1 -1
- package/dist/{layers.eSeNVzGh.js → layers.BhjR9hmy.js} +1 -1
- package/dist/{layers.DZSYa27_.js → layers.BjSFrA4f.js} +2 -2
- package/dist/{layers.DvUK3Ggv.js → layers.BltC4xgl.js} +1 -1
- package/dist/{layers.DqOAppIs.js → layers.Bmk77Nl5.js} +1 -1
- package/dist/{layers.9UczJ4vv.js → layers.Bn8tW8p5.js} +1 -1
- package/dist/{layers.B_WNyvAi.js → layers.BoPR0wQt.js} +3 -3
- package/dist/{layers.CGaAy3Xi.js → layers.BoX_Wqae.js} +1 -1
- package/dist/{layers.CtgMEq45.js → layers.BqCSz12w.js} +1 -1
- package/dist/{layers.Bx5KOkkY.js → layers.Bqqt2WZE.js} +1 -1
- package/dist/{layers.B181WnFI.js → layers.BrsKNoq-.js} +1 -1
- package/dist/{layers.BGQMU4xB.js → layers.BvhzLRzG.js} +1 -1
- package/dist/{layers.Bee4DHJ8.js → layers.Bvv96FkK.js} +7 -7
- package/dist/layers.Bvxpmu-2.js +1 -0
- package/dist/{layers.B0rPCgpv.js → layers.BvzEdEXm.js} +1 -1
- package/dist/{layers.j7s86aHJ.js → layers.Bx8how39.js} +1 -1
- package/dist/{layers.B_kGQGU-.js → layers.BxFztpj5.js} +1 -1
- package/dist/{layers.D5IdYbgv.js → layers.BxH_KvZM.js} +1 -1
- package/dist/{layers.CeayNQPT.js → layers.BxY27rS7.js} +1 -1
- package/dist/{layers.DesA1u0m.js → layers.By_kFoy7.js} +1 -1
- package/dist/{layers.C93k0YTq.js → layers.BzC8fzb9.js} +1 -1
- package/dist/{layers.DIMun4V1.js → layers.BzRIellV.js} +1 -1
- package/dist/{layers.DiEVfr13.js → layers.BzZqZM22.js} +1 -1
- package/dist/layers.C-hhGDUy.js +8 -0
- package/dist/{layers.BGyDRVRM.js → layers.C3l4W4QY.js} +1 -1
- package/dist/{layers.q9cS-tqP.js → layers.C4ZTYVln.js} +3 -3
- package/dist/{layers.DZfIleWT.js → layers.C5LXz2Dt.js} +1 -1
- package/dist/{layers.CNLbL98v.js → layers.C5Oq8KLD.js} +1 -1
- package/dist/{layers.D_AEQcCl.js → layers.C68ajHa1.js} +1 -1
- package/dist/{layers.C02KXUsb.js → layers.C6i05MYQ.js} +1 -1
- package/dist/{layers.CYGESLKC.js → layers.C9OSt3-B.js} +1 -1
- package/dist/{layers.BR6PIOSW.js → layers.CA75s71W.js} +1 -1
- package/dist/{layers.EEGob-u7.js → layers.CARdVtYx.js} +1 -1
- package/dist/{layers.DH3mSYIB.js → layers.CAoP3DTW.js} +1 -1
- package/dist/{layers.DWYXSDOM.js → layers.CCCrplmS.js} +1 -1
- package/dist/{layers.HvIWaOXy.js → layers.CCeryKPD.js} +1 -1
- package/dist/{layers.DKg10KZB.js → layers.CCyI84zh.js} +1 -1
- package/dist/{layers.P7na5DJY.js → layers.CD8wS95C.js} +1 -1
- package/dist/{layers.D6MTqech.js → layers.CE94zD9l.js} +1 -1
- package/dist/{layers.kQXCAPat.js → layers.CEResW_R.js} +1 -1
- package/dist/{layers.C_Ee9AkE.js → layers.CEoeaJQD.js} +1 -1
- package/dist/{layers.CPFyyRSF.js → layers.CFzM74P5.js} +1 -1
- package/dist/{layers.aOEKWS6D.js → layers.CHC4RiFK.js} +1 -1
- package/dist/{layers.BCnC5z1t.js → layers.CI16GYp5.js} +1 -1
- package/dist/layers.CIg6bGPB.js +1 -0
- package/dist/{layers.D2Mt8zQK.js → layers.CJ6TVAfM.js} +1 -1
- package/dist/{layers.DXqeJtVc.js → layers.CJfAmCMO.js} +1 -1
- package/dist/{layers.B4FVwgRF.js → layers.CKZ6gFse.js} +1 -1
- package/dist/{layers.B3KN6XJu.js → layers.CMnu34_U.js} +1 -1
- package/dist/{layers.CRRR8g8w.js → layers.CNUeObBK.js} +1 -1
- package/dist/{layers.CMybm99P.js → layers.CPaiSNny.js} +1 -1
- package/dist/{layers.rDezalXZ.js → layers.CRW9Fwvq.js} +1 -1
- package/dist/{layers.bgswgA43.js → layers.CTpPpYwM.js} +1 -1
- package/dist/{layers.CAvwD5QS.js → layers.CTsI8G5d.js} +1 -1
- package/dist/layers.CVCmClj2.js +1 -0
- package/dist/{layers.jaJzZVal.js → layers.CVFxZSWW.js} +1 -1
- package/dist/{layers.Cxlp5UHa.js → layers.CVH7bHbB.js} +1 -1
- package/dist/{layers.C5agR8-F.js → layers.CcvQrhZG.js} +4 -4
- package/dist/{layers.nEimMZ8b.js → layers.CdTCz5Y3.js} +1 -1
- package/dist/{layers.PYsLSU6b.js → layers.CeayngSI.js} +1 -1
- package/dist/{layers.i00CYzC1.js → layers.Cfdr-h4O.js} +1 -1
- package/dist/{layers.Dk8zEBKw.js → layers.CgkVp4lC.js} +1 -1
- package/dist/{layers.Cr01gCzZ.js → layers.ChzgxWon.js} +1 -1
- package/dist/{layers.Dxds0GzQ.js → layers.Cj01jo54.js} +1 -1
- package/dist/{layers.CrLbWNKh.js → layers.ClQJRYXj.js} +1 -1
- package/dist/layers.CmmYt3Ou.js +1 -0
- package/dist/{layers.rK6ewRwh.js → layers.CmyRYGoE.js} +3 -3
- package/dist/{layers.qtA_3tKG.js → layers.CpZ9aPMO.js} +3 -3
- package/dist/{layers.IfE8bLpj.js → layers.Cpw6B803.js} +1 -1
- package/dist/{layers.BJJPeSyw.js → layers.CqyzxURh.js} +1 -1
- package/dist/{layers.kW7tsVpS.js → layers.Cs7GlunF.js} +1 -1
- package/dist/{layers.DNpKxyt9.js → layers.CsEfNhVM.js} +1 -1
- package/dist/{layers.CTXd-FYQ.js → layers.CsMhgQ1t.js} +1 -1
- package/dist/{layers.BWMRirB2.js → layers.CsWdKhEu.js} +1 -1
- package/dist/{layers.DZrEzEsl.js → layers.CsvDJIZ7.js} +1 -1
- package/dist/{layers.DypVaTsA.js → layers.CuPX21JA.js} +1 -1
- package/dist/{layers.DpBixfTD.js → layers.CwB1NQbd.js} +1 -1
- package/dist/{layers.LT15-Q-_.js → layers.Cx-9Emh6.js} +1 -1
- package/dist/{layers.CdTLwbIf.js → layers.D1bCzAYq.js} +1 -1
- package/dist/{layers.Dm3Pbxlr.js → layers.D1dsXFS0.js} +1 -1
- package/dist/{layers.DhxESdI8.js → layers.D24Anxjv.js} +1 -1
- package/dist/layers.D3uB-jsE.js +1 -0
- package/dist/{layers.CvhW4MLA.js → layers.D4MDjmxL.js} +1 -1
- package/dist/{layers.Cw9CNne-.js → layers.D5hpoy9h.js} +2 -2
- package/dist/{layers.Dn5IGdx4.js → layers.D6oKUbDE.js} +1 -1
- package/dist/{layers.DzJItmZW.js → layers.D8An70uL.js} +1 -1
- package/dist/{layers.CnmnenRk.js → layers.D8yufb88.js} +1 -1
- package/dist/{layers.BM44FsqE.js → layers.D9FgdobB.js} +1 -1
- package/dist/{layers.Ckl5OieF.js → layers.D9OpTLfE.js} +1 -1
- package/dist/{layers.pBXgNI_H.js → layers.D9VTCVI3.js} +1 -1
- package/dist/{layers.D_urYm60.js → layers.DCMj-1Uf.js} +1 -1
- package/dist/{layers.zcnVAnt0.js → layers.DCv5ETXp.js} +1 -1
- package/dist/{layers.BEl6Mt7w.js → layers.DEKzHuSi.js} +1 -1
- package/dist/layers.DF05j1M2.js +17 -0
- package/dist/{layers.B6VnFAx8.js → layers.DFYEVVfs.js} +1 -1
- package/dist/{layers.KpcceaZu.js → layers.DFfOmmco.js} +1 -1
- package/dist/{layers.CXu2BABT.js → layers.DFjAixjy.js} +6 -6
- package/dist/{layers.DwTRhHxk.js → layers.DHa8WGDC.js} +1 -1
- package/dist/{layers.DM7ZdQpT.js → layers.DN0u5Yg6.js} +1 -1
- package/dist/{layers.D9KIFVJ3.js → layers.DOrY9DYv.js} +24 -24
- package/dist/{layers.66MvLO4S.js → layers.DPgn17B0.js} +1 -1
- package/dist/{layers.tSQSqHjR.js → layers.DVpWFLjR.js} +1 -1
- package/dist/{layers.CCQRVfuN.js → layers.DZT2dQyG.js} +1 -1
- package/dist/{layers.BBCFyocu.js → layers.D_H6PF0v.js} +1 -1
- package/dist/{layers.CJJDIEOx.js → layers.D_YdTiFW.js} +1 -1
- package/dist/{layers.BfZ6Mst_.js → layers.DbF4xVBE.js} +3 -3
- package/dist/{layers.DjcG9r8h.js → layers.Ddribg71.js} +1 -1
- package/dist/{layers.Dujw3bP1.js → layers.Dfq7GSQ2.js} +3 -3
- package/dist/{layers.DLBZs3M5.js → layers.DhHQZIJN.js} +1 -1
- package/dist/layers.DilA0qnM.js +54 -0
- package/dist/layers.DjVLYoWg.js +1 -0
- package/dist/{layers.DkjKFZ8B.js → layers.DkaXOqLh.js} +1 -1
- package/dist/{layers.rsbv22Ai.js → layers.DnVwZ2Cw.js} +1 -1
- package/dist/{layers.Bv91xv-u.js → layers.Do_EHOq8.js} +1 -1
- package/dist/{layers.Dx9DMAmE.js → layers.DowbTgQm.js} +1 -1
- package/dist/{layers.Dvlk9h6Y.js → layers.DpBgVacc.js} +1 -1
- package/dist/{layers.CWoSUxrU.js → layers.DpQ_bWul.js} +1 -1
- package/dist/{layers.hSyvo6b8.js → layers.DqC47xCC.js} +3 -3
- package/dist/layers.Drh9XlcG.js +309 -0
- package/dist/{layers.Dse005Td.js → layers.Du1TNcZd.js} +1 -1
- package/dist/{layers.BErhwaUR.js → layers.DuAvgcNM.js} +1 -1
- package/dist/{layers.Zh250Ssd.js → layers.DuE9Eexi.js} +3 -3
- package/dist/{layers.BTzSiuQ2.js → layers.DvHXCGpY.js} +1 -1
- package/dist/{layers.CDjhPok3.js → layers.DvSpirXT.js} +1 -1
- package/dist/{layers.GO8lOgpW.js → layers.Dvto57We.js} +1 -1
- package/dist/layers.DxydmUP3.js +533 -0
- package/dist/{layers.B9T4UM5C.js → layers.DyTr0iC-.js} +3 -3
- package/dist/{layers.k1ATmvz-.js → layers.EDqAD98V.js} +1 -1
- package/dist/{layers.cQ-qlNfh.js → layers.Fdk6MvMH.js} +1 -1
- package/dist/{layers.CjX4JQxt.js → layers.Kal-YH7y.js} +1 -1
- package/dist/{layers.BAKFkwhy.js → layers.L5G2E32S.js} +5 -5
- package/dist/{layers.BmoG90gX.js → layers.PxPuzt12.js} +1 -1
- package/dist/{layers._OUekajf.js → layers.QABnXFIR.js} +1 -1
- package/dist/{layers.Cdg-RQ1L.js → layers.QXq1glLQ.js} +3 -3
- package/dist/{layers.BJr2gHne.js → layers.Rd4Aez_o.js} +1 -1
- package/dist/layers.UCGv1oR7.js +46553 -0
- package/dist/{layers.DvQObHxB.js → layers.UNs4NPL2.js} +1 -1
- package/dist/{layers.BeCvdBEM.js → layers.VteHR-nD.js} +2 -2
- package/dist/{layers.Be1gZD22.js → layers.WS0tOiF9.js} +1 -1
- package/dist/layers.Wc4s15q8.js +500 -0
- package/dist/{layers.CkYercJO.js → layers.YmVu7Jyc.js} +1 -1
- package/dist/{layers.DUdFdurh.js → layers.c1g3UUys.js} +4 -4
- package/dist/{layers.CTd8v_h2.js → layers.cHiyhRv0.js} +1 -1
- package/dist/{layers.jSgLLqNz.js → layers.e4WMAP8p.js} +4 -4
- package/dist/{layers.CJboMklD.js → layers.gkJkfBXX.js} +1 -1
- package/dist/{layers.BUZV_oEF.js → layers.iUn6qHX-.js} +1 -1
- package/dist/{layers.CTj6BuBS.js → layers.jJYSd22J.js} +1 -1
- package/dist/{layers.Cj8SPWV6.js → layers.jNpPtSYq.js} +1 -1
- package/dist/{layers.Ds76sUmU.js → layers.nh-jugfR.js} +1 -1
- package/dist/{layers.10Bi4EHS.js → layers.noEAcBug.js} +1 -1
- package/dist/{layers.Dr9w4QMa.js → layers.o8IUzzuA.js} +4 -4
- package/dist/{layers.cmL8khG9.js → layers.poSPbB9X.js} +4 -4
- package/dist/{layers.osFw9BPT.js → layers.qH1Kvygt.js} +3 -3
- package/dist/{layers.g8Ev98Ji.js → layers.qfL_NxUA.js} +1 -1
- package/dist/{layers.NuhKP__R.js → layers.sxqdU83h.js} +1 -1
- package/dist/{layers.CrKCVFrl.js → layers.t-FrNIBD.js} +1 -1
- package/dist/{layers.DtZ5MHFk.js → layers.uLbLjX8b.js} +1 -1
- package/dist/{layers.CqczWgOo.js → layers.wZ8wbCG9.js} +1 -1
- package/dist/{layers.CfhWIEqU.js → layers.xI63-j2d.js} +1 -1
- package/dist/{layers.D56u-dDE.js → layers.yAPrlce6.js} +1 -1
- package/dist/{layers.hR6Du8ay.js → layers.zbHQRaAA.js} +5 -5
- package/package.json +192 -166
- package/dist/layers.BFXGrUiH.js +0 -32086
- package/dist/layers.BKc8Qoya.js +0 -1
- package/dist/layers.Bg8hFFcE.js +0 -215
- package/dist/layers.BiMx1FPw.js +0 -1
- package/dist/layers.C5w6wZ0t.js +0 -295
- package/dist/layers.C6eKIfoF.js +0 -1
- package/dist/layers.CPhHypWY.js +0 -1
- package/dist/layers.CQynkg93.js +0 -300
- package/dist/layers.CiKcQeoB.js +0 -76
- package/dist/layers.CilwCma3.js +0 -8
- package/dist/layers.D240lV9-.js +0 -6
- package/dist/layers.DaCzxiYh.js +0 -271
- package/dist/layers.Df8wf57V.js +0 -1
- package/dist/layers.DiA6OaHn.js +0 -1
- package/dist/layers.Dk8Fey47.js +0 -276
- package/dist/layers.ZfAh3Y9b.js +0 -1
- package/dist/layers.cvEfXQem.js +0 -1
- package/dist/layers.l9POGoKk.js +0 -304
package/dist/layers.BKc8Qoya.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),n=require("react"),V=require("react-i18next"),X=require("@lexical/react/LexicalComposerContext"),Y=require("@mantine/core"),C=require("lexical"),Z=require("@layers-app/shared"),i=require("./layers.l9POGoKk.js"),D=t=>{const{width:c,height:r,isLoading:g,isError:N,src:f,id:m,altText:p,imageRef:I,maxWidth:h}=t;return u.jsxs("div",{className:"media-wrapper",style:{width:c,height:r,display:"inline-flex",position:"relative"},children:[u.jsx(Y.LoadingOverlay,{visible:g,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),u.jsx(J,{className:null,src:f,altText:p,imageRef:I,width:"inherit",height:"inherit",maxWidth:h||"auto",id:m})]})};function J({altText:t,className:c,imageRef:r,src:g,width:N,height:f,maxWidth:m,id:p}){const[I,h]=n.useState(!1);return u.jsx("img",{className:`${c||void 0} ${I?"":"loading"}`,src:g,alt:t,ref:r,style:{height:f,maxWidth:m,width:N},onLoad:()=>{g.includes("splash")?setTimeout(()=>{h(!0)},100):h(!0)},draggable:"false","data-id":p})}function Q({src:t,altText:c,nodeKey:r,width:g,height:N,maxWidth:f,showCaption:m,caption:p,id:I,create:h,alignment:U}){var A,q;const R=n.useRef(null),[y,x]=n.useState(!0),[d]=X.useLexicalComposerContext(),[S,M]=n.useState(!0),[l,L]=n.useState({width:0,height:0}),{start:k,cancel:T}=i.useCancelUpload(),[B,j]=n.useState(0),{fetchUploadMedia:O,fetchDeleteMedia:W,maxFileSize:ee}=n.useContext(i.Context),E=i.mediaMap.has(t)&&(((A=i.mediaMap.get(t))==null?void 0:A.mediaNodeKeys.length)===0||((q=i.mediaMap.get(t))==null?void 0:q.mediaNodeKeys.length)===void 0||t.trim()===""),{t:b}=V.useTranslation(),[te,H]=n.useState(0);n.useEffect(()=>d.registerDecoratorListener(()=>{H(e=>e+1)}),[E]),n.useEffect(()=>{if(!t||t.startsWith("data:image/")||!t.trim()){x(!1);return}const e=new Image;e.src=t,e.onload=()=>x(!1),e.onerror=()=>{x(!1)}},[t,E]);const F=(e,s)=>{d.update(()=>{C.$setSelection(null);const o=C.$getNodeByKey(r);i.$isImageNode(o)&&o.setWidthAndHeight(e,s)})},{historyState:$}=i.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:z}}=i.useSettings(),[v,w]=n.useState(!1);function G(e){return e.endsWith(".svg")||e.includes("image/svg+xml")}function K(e){return new Promise((s,o)=>{if(G(e)){s(0);return}const a=new Image;a.src=e,a.onload=()=>{s(a.width)},a.onerror=()=>{o(new Error("Failed to load image"))}})}n.useEffect(()=>{h&&w(!0)},[h]),n.useEffect(()=>{let e=g,s=N,o=100;(t.includes("unsplash")?t.trim():!E&&t.trim()||t.includes("upload-src-editor"))&&t!=="upload"&&K(t).then(a=>{typeof e=="number"&&e<o&&a<o?(M(!0),L({width:e,height:s})):a<o?(M(!0),L({width:"auto",height:"auto"})):(L({width:a,height:a}),M(!1))}).catch(a=>{console.warn("Ошибка при загрузке изображения:",a.message)})},[t,E]),n.useEffect(()=>{l.width&&l.height&&S&&d.update(()=>{const e=C.$getNodeByKey(r);i.$isImageNode(e)&&e.setWidthAndHeight(l.width,l.height)})},[l.width,l.height,S]),n.useEffect(()=>{if(v)return i.blockScroll(),()=>{i.unblockScroll()}},[v]),n.useEffect(()=>d.registerCommand(i.UPLOAD_IMAGE_COMMAND,e=>(t==="upload"&&_(e),!1),C.COMMAND_PRIORITY_LOW),[t,y]);const P=(e,s)=>{x(!1),d.update(()=>{const o=C.$getNodeByKey(r);i.$isImageNode(o)&&(o.setSrc(e),o.setId(s))})},_=e=>{x(!0);const s=k();O&&O(e[0],(o,a)=>{P(o,a),j(0)},o=>{o&&Z.showErrorNotification({message:b("editor.gallery.errorFile")}),j(0),P("","")},s,o=>{j(o)})};return!t||t==="upload"?u.jsx(i.ImagePicker,{uploading:!1,onUpload:e=>{!O||!e.length||(_(e),w(!1))},popoverProps:{opened:v,position:"bottom",onChange:w,zIndex:i.EDITOR_UI_MIN_Z_INDEX},onChange:e=>{w(!1),d.update(()=>{const s=C.$getNodeByKey(r);i.$isImageNode(s)&&s.setSrc(e)})},children:u.jsx(i.EmptyNodeButton,{title:b("editor.image.add_photo"),icon:"photo",onClick:()=>w(!v),isLoading:y,progress:B,onAfterCancel:()=>{T(),x(!1)}})}):S?u.jsx(D,{width:l.width,height:l.height,isLoading:y,isError:!1,isIcon:S,src:t,id:I,editor:d,nodeKey:r,fetchDeleteMedia:W,altText:c,imageRef:R,maxWidth:f,showCaption:m,caption:p,isCollabActive:!1,historyState:$,showNestedEditorTreeView:z,t:b}):u.jsx(i.ResizableContainer,{editor:d,isIcon:S,width:i.parseContainerSize(g),height:i.parseContainerSize(N),initialWidth:l.width||"",initialHeight:l.height||"",onResizeEnd:F,alignment:U,children:u.jsx(D,{width:"inherit",height:"inherit",isLoading:y,isError:!1,isIcon:S,src:t,id:I,editor:d,nodeKey:r,fetchDeleteMedia:W,altText:c,imageRef:R,maxWidth:f,showCaption:m,caption:p,isCollabActive:!1,historyState:$,showNestedEditorTreeView:z,t:b})})}exports.default=Q;
|
package/dist/layers.Bg8hFFcE.js
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { jsx as i, jsxs as R, Fragment as J } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as Y, useState as k, useRef as I, useCallback as M, useEffect as q } from "react";
|
|
3
|
-
import { useLexicalComposerContext as Q } from "@lexical/react/LexicalComposerContext";
|
|
4
|
-
import { useLexicalEditable as U } from "@lexical/react/useLexicalEditable";
|
|
5
|
-
import { useLexicalNodeSelection as X } from "@lexical/react/useLexicalNodeSelection";
|
|
6
|
-
import { mergeRegister as Z } from "@lexical/utils";
|
|
7
|
-
import { $setSelection as K, $getNodeByKey as p, CLICK_COMMAND as ee, COMMAND_PRIORITY_LOW as _, KEY_DELETE_COMMAND as te, KEY_BACKSPACE_COMMAND as ie } from "lexical";
|
|
8
|
-
import { R as ae, p as T, A as ne, l as se, n as y, o as le } from "./layers.BFXGrUiH.js";
|
|
9
|
-
import { p as oe, C as re, E as ce } from "./layers.C5w6wZ0t.js";
|
|
10
|
-
import { useTranslation as de } from "react-i18next";
|
|
11
|
-
import { Box as j, Tooltip as $, ActionIcon as B } from "@mantine/core";
|
|
12
|
-
import { IconEdit as me } from "@tabler/icons-react";
|
|
13
|
-
function fe({
|
|
14
|
-
imageContainerRef: a,
|
|
15
|
-
editor: o,
|
|
16
|
-
rootClassName: S = null,
|
|
17
|
-
width: x = "inherit",
|
|
18
|
-
height: g = "inherit",
|
|
19
|
-
nodeKey: e,
|
|
20
|
-
alignment: C,
|
|
21
|
-
setModalOpen: r,
|
|
22
|
-
previewSVG: h
|
|
23
|
-
}) {
|
|
24
|
-
const N = Y(() => h ?? "", [h]), [c, E] = k(!1), { t: d } = de(), O = (l, m) => {
|
|
25
|
-
o.update(() => {
|
|
26
|
-
K(null);
|
|
27
|
-
const u = p(e);
|
|
28
|
-
return y(u) && u.setWidthAndHeight(l, m), !0;
|
|
29
|
-
});
|
|
30
|
-
}, w = () => {
|
|
31
|
-
le(o, e);
|
|
32
|
-
};
|
|
33
|
-
return /* @__PURE__ */ i(
|
|
34
|
-
ae,
|
|
35
|
-
{
|
|
36
|
-
editor: o,
|
|
37
|
-
isIcon: !1,
|
|
38
|
-
isEmbed: !0,
|
|
39
|
-
width: T(x),
|
|
40
|
-
height: T(g),
|
|
41
|
-
onResizeEnd: O,
|
|
42
|
-
alignment: C,
|
|
43
|
-
children: /* @__PURE__ */ R(j, { className: "media-wrapper excaildraw", children: [
|
|
44
|
-
/* @__PURE__ */ R("div", { className: "media-actions", children: [
|
|
45
|
-
/* @__PURE__ */ i($, { label: d("editor.link.edit"), children: /* @__PURE__ */ i(
|
|
46
|
-
B,
|
|
47
|
-
{
|
|
48
|
-
color: "gray",
|
|
49
|
-
"aria-label": "Settings",
|
|
50
|
-
className: "media-action",
|
|
51
|
-
variant: "default",
|
|
52
|
-
size: 32,
|
|
53
|
-
radius: 8,
|
|
54
|
-
onClick: () => {
|
|
55
|
-
E(!1), r(!0);
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ i(me, { size: 16 })
|
|
58
|
-
}
|
|
59
|
-
) }),
|
|
60
|
-
/* @__PURE__ */ i(
|
|
61
|
-
ne,
|
|
62
|
-
{
|
|
63
|
-
opened: c,
|
|
64
|
-
setOpened: E,
|
|
65
|
-
t: d,
|
|
66
|
-
editor: o,
|
|
67
|
-
nodeKey: e
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
/* @__PURE__ */ i($, { label: d("editor.actions.delete"), children: /* @__PURE__ */ i(
|
|
71
|
-
B,
|
|
72
|
-
{
|
|
73
|
-
color: "gray",
|
|
74
|
-
"aria-label": "Settings",
|
|
75
|
-
className: "media-action",
|
|
76
|
-
variant: "default",
|
|
77
|
-
size: 32,
|
|
78
|
-
radius: 8,
|
|
79
|
-
onClick: w,
|
|
80
|
-
children: /* @__PURE__ */ i(se, { name: "trash", size: "16" })
|
|
81
|
-
}
|
|
82
|
-
) })
|
|
83
|
-
] }),
|
|
84
|
-
/* @__PURE__ */ i(
|
|
85
|
-
j,
|
|
86
|
-
{
|
|
87
|
-
w: "100%",
|
|
88
|
-
ref: (l) => {
|
|
89
|
-
l && a && (a.current = l);
|
|
90
|
-
},
|
|
91
|
-
className: S ?? "",
|
|
92
|
-
dangerouslySetInnerHTML: { __html: N }
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
] })
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
function be({
|
|
100
|
-
nodeKey: a,
|
|
101
|
-
data: o,
|
|
102
|
-
width: S,
|
|
103
|
-
height: x,
|
|
104
|
-
alignment: g
|
|
105
|
-
}) {
|
|
106
|
-
var L;
|
|
107
|
-
const [e] = Q(), C = U(), r = Y(() => oe(o), [o]), h = ((L = r == null ? void 0 : r.elements) == null ? void 0 : L.length) === 0 && !r.previewSVG, [N, c] = k(
|
|
108
|
-
h && e.isEditable()
|
|
109
|
-
), [E, d] = k(!1), O = I(null), w = I(null), l = I(null), [m, u, b] = X(a), A = M(
|
|
110
|
-
(t) => (m && (t.preventDefault(), e.update(() => {
|
|
111
|
-
const s = p(a);
|
|
112
|
-
s && s.remove();
|
|
113
|
-
})), !1),
|
|
114
|
-
[e, m, a]
|
|
115
|
-
);
|
|
116
|
-
q(() => {
|
|
117
|
-
if (!C) {
|
|
118
|
-
m && b();
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
return Z(
|
|
122
|
-
e.registerCommand(
|
|
123
|
-
ee,
|
|
124
|
-
(t) => {
|
|
125
|
-
const s = w.current, f = t.target;
|
|
126
|
-
return s !== null && s.contains(f) ? (t.shiftKey || b(), u(!m), t.detail > 1 && c(!0), !0) : !1;
|
|
127
|
-
},
|
|
128
|
-
_
|
|
129
|
-
),
|
|
130
|
-
e.registerCommand(
|
|
131
|
-
te,
|
|
132
|
-
A,
|
|
133
|
-
_
|
|
134
|
-
),
|
|
135
|
-
e.registerCommand(
|
|
136
|
-
ie,
|
|
137
|
-
A,
|
|
138
|
-
_
|
|
139
|
-
)
|
|
140
|
-
);
|
|
141
|
-
}, [b, e, m, A, u, C]);
|
|
142
|
-
const F = M(() => (c(!1), e.update(() => {
|
|
143
|
-
const t = p(a);
|
|
144
|
-
t && t.remove();
|
|
145
|
-
})), [e, a]), G = (t, s, f, v) => e.update(() => {
|
|
146
|
-
const D = p(a);
|
|
147
|
-
y(D) && (t && t.length > 0 || Object.keys(f).length > 0 ? D.setData(
|
|
148
|
-
JSON.stringify({
|
|
149
|
-
appState: s,
|
|
150
|
-
elements: t,
|
|
151
|
-
files: f,
|
|
152
|
-
previewSVG: v
|
|
153
|
-
})
|
|
154
|
-
) : D.remove());
|
|
155
|
-
}), { elements: n = [], files: H = {}, appState: P = {}, previewSVG: V } = r, z = M(() => {
|
|
156
|
-
c(!1), d(!1), l.current = !1, (n == null ? void 0 : n.length) === 0 && e.update(() => {
|
|
157
|
-
const t = p(a);
|
|
158
|
-
t && t.remove();
|
|
159
|
-
});
|
|
160
|
-
}, [e, a, n == null ? void 0 : n.length]), W = M(() => {
|
|
161
|
-
l.current ? d(!0) : z();
|
|
162
|
-
}, []);
|
|
163
|
-
return /* @__PURE__ */ R(J, { children: [
|
|
164
|
-
/* @__PURE__ */ i(
|
|
165
|
-
re,
|
|
166
|
-
{
|
|
167
|
-
isCloseModal: E,
|
|
168
|
-
confirmClose: z,
|
|
169
|
-
setCloseModalOpen: d
|
|
170
|
-
}
|
|
171
|
-
),
|
|
172
|
-
/* @__PURE__ */ i(
|
|
173
|
-
ce,
|
|
174
|
-
{
|
|
175
|
-
initialElements: n,
|
|
176
|
-
isEdited: l,
|
|
177
|
-
initialFiles: H,
|
|
178
|
-
initialAppState: P,
|
|
179
|
-
isShown: N,
|
|
180
|
-
onDelete: F,
|
|
181
|
-
onClose: W,
|
|
182
|
-
onSave: (t, s, f, v) => {
|
|
183
|
-
G(t, s, f, v), c(!1);
|
|
184
|
-
},
|
|
185
|
-
closeOnClickOutside: !1
|
|
186
|
-
}
|
|
187
|
-
),
|
|
188
|
-
(n == null ? void 0 : n.length) && /* @__PURE__ */ i(
|
|
189
|
-
"div",
|
|
190
|
-
{
|
|
191
|
-
style: {
|
|
192
|
-
display: "flex",
|
|
193
|
-
justifyContent: g
|
|
194
|
-
},
|
|
195
|
-
children: /* @__PURE__ */ i(
|
|
196
|
-
fe,
|
|
197
|
-
{
|
|
198
|
-
imageContainerRef: O,
|
|
199
|
-
className: "image",
|
|
200
|
-
width: S,
|
|
201
|
-
height: x,
|
|
202
|
-
editor: e,
|
|
203
|
-
nodeKey: a,
|
|
204
|
-
alignment: g,
|
|
205
|
-
setModalOpen: c,
|
|
206
|
-
previewSVG: V
|
|
207
|
-
}
|
|
208
|
-
)
|
|
209
|
-
}
|
|
210
|
-
)
|
|
211
|
-
] });
|
|
212
|
-
}
|
|
213
|
-
export {
|
|
214
|
-
be as default
|
|
215
|
-
};
|
package/dist/layers.BiMx1FPw.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),t=require("react"),p=require("@lexical/react/LexicalComposerContext"),C=require("lexical"),l=require("./layers.l9POGoKk.js"),u=require("./layers.Df8wf57V.js"),f=C.createCommand("INSERT_EXCALIDRAW_COMMAND");function A(){const[s]=p.useLexicalComposerContext(),[x,n]=t.useState(!1),[e,E]=t.useState(null),r=t.useRef(null),[M,i]=t.useState(!1);t.useEffect(()=>{if(!s.hasNodes([l.ExcalidrawNode]))throw new Error("ExcalidrawPlugin: ExcalidrawNode not registered on editor");return s.registerCommand(f,()=>{n(!0);const a=l.getCurrentElement();return E(a),!0},C.COMMAND_PRIORITY_EDITOR)},[s]);const c=()=>{n(!1),i(!1),r.current=!1},m=()=>{r.current?i(!0):c()},O=()=>{n(!1)},N=(a,S,R,g)=>{s.update(()=>{const d=l.$createExcalidrawNode();d.setData(JSON.stringify({appState:S,elements:a,files:R,previewSVG:g})),e&&e.getParent()&&(e==null||e.replace(d))}),n(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(u.ConfirmModal,{isCloseModal:M,confirmClose:c,setCloseModalOpen:i}),o.jsx(u.ExcalidrawModal,{initialElements:[],initialAppState:{},initialFiles:{},isShown:x,onDelete:O,onClose:m,onSave:N,closeOnClickOutside:!1,isEdited:r})]})}exports.INSERT_EXCALIDRAW_COMMAND=f;exports.default=A;
|
package/dist/layers.C5w6wZ0t.js
DELETED
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import { jsx as u, jsxs as L } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation as D } from "react-i18next";
|
|
3
|
-
import { Modal as U, Text as X, Flex as J, Button as R, useMantineColorScheme as Y, Loader as Z } from "@mantine/core";
|
|
4
|
-
import { useRef as $, useState as T, useEffect as y, useCallback as j, Suspense as Q, lazy as P } from "react";
|
|
5
|
-
import { BottomDrawerWithoutHeader as ee } from "@layers-app/shared";
|
|
6
|
-
const ce = ({
|
|
7
|
-
isCloseModal: l,
|
|
8
|
-
setCloseModalOpen: t,
|
|
9
|
-
confirmClose: c
|
|
10
|
-
}) => {
|
|
11
|
-
const { t: d } = D();
|
|
12
|
-
return /* @__PURE__ */ u(
|
|
13
|
-
U,
|
|
14
|
-
{
|
|
15
|
-
opened: l,
|
|
16
|
-
onClose: () => {
|
|
17
|
-
t(!1);
|
|
18
|
-
},
|
|
19
|
-
centered: !0,
|
|
20
|
-
title: d("editor.unsavedChanges.title"),
|
|
21
|
-
closeOnClickOutside: !0,
|
|
22
|
-
closeOnEscape: !0,
|
|
23
|
-
size: "500",
|
|
24
|
-
zIndex: 999,
|
|
25
|
-
children: /* @__PURE__ */ L("div", { children: [
|
|
26
|
-
/* @__PURE__ */ u(X, { mb: "md", children: d("editor.unsavedChanges.message") }),
|
|
27
|
-
/* @__PURE__ */ L(J, { justify: "flex-end", gap: "sm", children: [
|
|
28
|
-
/* @__PURE__ */ u(
|
|
29
|
-
R,
|
|
30
|
-
{
|
|
31
|
-
variant: "default",
|
|
32
|
-
onClick: () => {
|
|
33
|
-
t(!1);
|
|
34
|
-
},
|
|
35
|
-
fullWidth: !0,
|
|
36
|
-
children: d("editor.unsavedChanges.cancel")
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
/* @__PURE__ */ u(R, { color: "red", onClick: c, fullWidth: !0, children: d("editor.unsavedChanges.closeWithoutSaving") })
|
|
40
|
-
] })
|
|
41
|
-
] })
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
}, A = {
|
|
45
|
-
elements: [],
|
|
46
|
-
files: {},
|
|
47
|
-
appState: {},
|
|
48
|
-
previewSVG: null
|
|
49
|
-
}, de = (l) => {
|
|
50
|
-
try {
|
|
51
|
-
const t = JSON.parse(l);
|
|
52
|
-
if (Array.isArray(t))
|
|
53
|
-
return { ...A, elements: t };
|
|
54
|
-
if (t && typeof t == "object")
|
|
55
|
-
return {
|
|
56
|
-
elements: Array.isArray(t.elements) ? t.elements : [],
|
|
57
|
-
files: t.files && typeof t.files == "object" ? t.files : {},
|
|
58
|
-
appState: t.appState && typeof t.appState == "object" ? t.appState : {},
|
|
59
|
-
previewSVG: typeof t.previewSVG == "string" ? t.previewSVG : typeof t.previewSvg == "string" ? t.previewSvg : null
|
|
60
|
-
};
|
|
61
|
-
} catch {
|
|
62
|
-
}
|
|
63
|
-
return { ...A };
|
|
64
|
-
}, te = {
|
|
65
|
-
en: "en-US",
|
|
66
|
-
ru: "ru-RU",
|
|
67
|
-
fr: "fr-FR",
|
|
68
|
-
de: "de-DE",
|
|
69
|
-
es: "es-ES",
|
|
70
|
-
it: "it-IT",
|
|
71
|
-
pt: "pt-BR",
|
|
72
|
-
zh: "zh-CN",
|
|
73
|
-
ja: "ja-JP",
|
|
74
|
-
ko: "ko-KR",
|
|
75
|
-
ar: "ar-SA",
|
|
76
|
-
hi: "hi-IN",
|
|
77
|
-
nl: "nl-NL",
|
|
78
|
-
tr: "tr-TR",
|
|
79
|
-
pl: "pl-PL",
|
|
80
|
-
sv: "sv-SE",
|
|
81
|
-
cs: "cs-CZ",
|
|
82
|
-
uk: "uk-UA",
|
|
83
|
-
ro: "ro-RO",
|
|
84
|
-
fi: "fi-FI",
|
|
85
|
-
da: "da-DK",
|
|
86
|
-
no: "no-NO",
|
|
87
|
-
el: "el-GR",
|
|
88
|
-
he: "he-IL",
|
|
89
|
-
th: "th-TH",
|
|
90
|
-
id: "id-ID",
|
|
91
|
-
ms: "ms-MY",
|
|
92
|
-
vi: "vi-VN"
|
|
93
|
-
};
|
|
94
|
-
let w = null;
|
|
95
|
-
const re = /* @__PURE__ */ P(async () => {
|
|
96
|
-
var t;
|
|
97
|
-
const l = await import("./layers.CvhEIibf.js").then((c) => c.M);
|
|
98
|
-
return !w && l && (w = l.exportToSvg || ((t = l.default) == null ? void 0 : t.exportToSvg) || l.default), { default: l.Excalidraw };
|
|
99
|
-
}), oe = () => {
|
|
100
|
-
const [l, t] = T(
|
|
101
|
-
null
|
|
102
|
-
), c = j(
|
|
103
|
-
(d) => t(d),
|
|
104
|
-
[]
|
|
105
|
-
);
|
|
106
|
-
return [l, c];
|
|
107
|
-
};
|
|
108
|
-
function ue({
|
|
109
|
-
onSave: l,
|
|
110
|
-
initialElements: t,
|
|
111
|
-
initialAppState: c,
|
|
112
|
-
initialFiles: d,
|
|
113
|
-
isShown: i = !1,
|
|
114
|
-
onDelete: B,
|
|
115
|
-
onClose: N,
|
|
116
|
-
isEdited: W
|
|
117
|
-
}) {
|
|
118
|
-
const [n, z] = oe(), { i18n: f, t: _ } = D(), { colorScheme: O } = Y(), E = $(!1), [g, G] = T(t), [C, V] = T(d), [F, H] = T(i);
|
|
119
|
-
y(() => {
|
|
120
|
-
i && H(!0);
|
|
121
|
-
}, [i]), y(() => {
|
|
122
|
-
!i || E.current || (E.current = !0, Promise.resolve({ }));
|
|
123
|
-
}, [i]), y(() => {
|
|
124
|
-
i && setTimeout(() => {
|
|
125
|
-
var e;
|
|
126
|
-
(e = n == null ? void 0 : n.refresh) == null || e.call(n);
|
|
127
|
-
}, 500);
|
|
128
|
-
}, [i, n]), y(() => {
|
|
129
|
-
if (!i)
|
|
130
|
-
return;
|
|
131
|
-
const e = (r, a) => {
|
|
132
|
-
const s = _(r);
|
|
133
|
-
return s.startsWith("editor.menu") ? a : s;
|
|
134
|
-
}, m = e(
|
|
135
|
-
"editor.menu.excalidraw.tools.frameTool",
|
|
136
|
-
f.language === "ru" ? "Инструмент рамки" : f.language === "es" ? "Herramienta de marco" : "Frame tool"
|
|
137
|
-
), o = e(
|
|
138
|
-
"editor.menu.excalidraw.tools.webEmbed",
|
|
139
|
-
f.language === "ru" ? "Веб-встраивание" : f.language === "es" ? "Incrustación web" : "Web Embed"
|
|
140
|
-
), h = e(
|
|
141
|
-
"editor.menu.excalidraw.tools.generate",
|
|
142
|
-
f.language === "ru" ? "Генерировать" : f.language === "es" ? "Generar" : "Generate"
|
|
143
|
-
), p = {
|
|
144
|
-
"Frame tool": m,
|
|
145
|
-
"Web Embed": o,
|
|
146
|
-
"Web embeded": o,
|
|
147
|
-
Generate: h
|
|
148
|
-
}, v = () => {
|
|
149
|
-
const r = document.querySelector(".App-toolbar__extra-tools-dropdown");
|
|
150
|
-
if (!r)
|
|
151
|
-
return;
|
|
152
|
-
const a = document.createTreeWalker(
|
|
153
|
-
r,
|
|
154
|
-
NodeFilter.SHOW_TEXT,
|
|
155
|
-
null
|
|
156
|
-
);
|
|
157
|
-
let s;
|
|
158
|
-
for (; s = a.nextNode(); )
|
|
159
|
-
if (s.nodeType === Node.TEXT_NODE && s.textContent) {
|
|
160
|
-
const M = s.textContent.trim();
|
|
161
|
-
for (const [S, k] of Object.entries(p))
|
|
162
|
-
if (M === S && k && !M.includes(k)) {
|
|
163
|
-
s.textContent = s.textContent.replace(S, k);
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, x = () => {
|
|
168
|
-
setTimeout(() => {
|
|
169
|
-
v();
|
|
170
|
-
}, 0);
|
|
171
|
-
}, b = setTimeout(() => {
|
|
172
|
-
const r = document.querySelector(
|
|
173
|
-
".excalidraw-container"
|
|
174
|
-
);
|
|
175
|
-
if (r) {
|
|
176
|
-
const a = r.querySelector(
|
|
177
|
-
".App-toolbar__extra-tools-trigger"
|
|
178
|
-
);
|
|
179
|
-
a && a.addEventListener("click", x);
|
|
180
|
-
}
|
|
181
|
-
}, 300);
|
|
182
|
-
return () => {
|
|
183
|
-
clearTimeout(b);
|
|
184
|
-
const r = document.querySelector(
|
|
185
|
-
".excalidraw-container"
|
|
186
|
-
);
|
|
187
|
-
if (r) {
|
|
188
|
-
const a = r.querySelector(
|
|
189
|
-
".App-toolbar__extra-tools-trigger"
|
|
190
|
-
);
|
|
191
|
-
a && a.removeEventListener("click", x);
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
}, [i, f.language]);
|
|
195
|
-
const q = j(async () => {
|
|
196
|
-
var v, x, b;
|
|
197
|
-
let e = w;
|
|
198
|
-
if (!e || typeof e != "function") {
|
|
199
|
-
const r = await import("./layers.CvhEIibf.js").then((a) => a.M);
|
|
200
|
-
e = r.exportToSvg || ((v = r.default) == null ? void 0 : v.exportToSvg) || r.default, e && typeof e == "function" && (w = e);
|
|
201
|
-
}
|
|
202
|
-
if (!e || typeof e != "function") {
|
|
203
|
-
const r = await import("./layers.CvhEIibf.js").then((s) => s.M), a = r ? Object.keys(r) : [];
|
|
204
|
-
throw console.error("Excalidraw module structure:", {
|
|
205
|
-
keys: a,
|
|
206
|
-
hasExportToSvg: r && "exportToSvg" in r,
|
|
207
|
-
hasDefault: r && "default" in r,
|
|
208
|
-
moduleType: typeof r,
|
|
209
|
-
module: r
|
|
210
|
-
}), new Error(
|
|
211
|
-
`exportToSvg is not available from @excalidraw/excalidraw. Module keys: ${a.join(", ")}. Please ensure @excalidraw/excalidraw is properly installed.`
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
const m = ((x = n == null ? void 0 : n.getAppState) == null ? void 0 : x.call(n)) ?? c, o = await e({
|
|
215
|
-
appState: m,
|
|
216
|
-
elements: g,
|
|
217
|
-
files: C
|
|
218
|
-
}), h = (b = o == null ? void 0 : o.firstElementChild) == null ? void 0 : b.firstElementChild, p = o.getAttribute("viewBox");
|
|
219
|
-
if (p != null) {
|
|
220
|
-
const r = p.split(" ");
|
|
221
|
-
o.setAttribute("width", r[2]), o.setAttribute("height", r[3]);
|
|
222
|
-
}
|
|
223
|
-
return h && h.tagName === "style" && h.remove(), o.setAttribute("width", "100%"), o.setAttribute("height", "100%"), o.setAttribute("display", "block"), o.classList.add("excalidraw-svg"), o.outerHTML;
|
|
224
|
-
}, [g, C, n, c]), I = () => {
|
|
225
|
-
if (g && g.filter((e) => !e.isDeleted).length > 0) {
|
|
226
|
-
const e = n == null ? void 0 : n.getAppState(), m = {
|
|
227
|
-
exportBackground: e == null ? void 0 : e.exportBackground,
|
|
228
|
-
exportScale: e == null ? void 0 : e.exportScale,
|
|
229
|
-
exportWithDarkMode: (e == null ? void 0 : e.theme) === "dark",
|
|
230
|
-
isBindingEnabled: e == null ? void 0 : e.isBindingEnabled,
|
|
231
|
-
isLoading: e == null ? void 0 : e.isLoading,
|
|
232
|
-
name: e == null ? void 0 : e.name,
|
|
233
|
-
theme: e == null ? void 0 : e.theme,
|
|
234
|
-
viewBackgroundColor: e == null ? void 0 : e.viewBackgroundColor,
|
|
235
|
-
viewModeEnabled: e == null ? void 0 : e.viewModeEnabled,
|
|
236
|
-
zenModeEnabled: e == null ? void 0 : e.zenModeEnabled,
|
|
237
|
-
zoom: e == null ? void 0 : e.zoom
|
|
238
|
-
};
|
|
239
|
-
(async () => {
|
|
240
|
-
const o = await q();
|
|
241
|
-
l(g, m, C, o);
|
|
242
|
-
})();
|
|
243
|
-
} else
|
|
244
|
-
B();
|
|
245
|
-
}, K = (e, m, o) => {
|
|
246
|
-
(e == null ? void 0 : e.length) !== (t == null ? void 0 : t.length) && (W.current = !0), G(e), V(o);
|
|
247
|
-
};
|
|
248
|
-
return /* @__PURE__ */ u(
|
|
249
|
-
ee,
|
|
250
|
-
{
|
|
251
|
-
opened: i,
|
|
252
|
-
onClose: N,
|
|
253
|
-
onSave: I,
|
|
254
|
-
className: "excaildraw-modal",
|
|
255
|
-
closeOnEscape: !1,
|
|
256
|
-
children: F && /* @__PURE__ */ u(
|
|
257
|
-
Q,
|
|
258
|
-
{
|
|
259
|
-
fallback: /* @__PURE__ */ u(
|
|
260
|
-
"div",
|
|
261
|
-
{
|
|
262
|
-
style: {
|
|
263
|
-
display: "flex",
|
|
264
|
-
justifyContent: "center",
|
|
265
|
-
alignItems: "center",
|
|
266
|
-
height: "100%",
|
|
267
|
-
minHeight: "400px"
|
|
268
|
-
},
|
|
269
|
-
children: /* @__PURE__ */ u(Z, { size: "sm" })
|
|
270
|
-
}
|
|
271
|
-
),
|
|
272
|
-
children: /* @__PURE__ */ u(
|
|
273
|
-
re,
|
|
274
|
-
{
|
|
275
|
-
langCode: te[f.language],
|
|
276
|
-
theme: O,
|
|
277
|
-
onChange: K,
|
|
278
|
-
excalidrawAPI: z,
|
|
279
|
-
initialData: {
|
|
280
|
-
appState: { ...c || { isLoading: !1 } },
|
|
281
|
-
elements: t,
|
|
282
|
-
files: d
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
)
|
|
286
|
-
}
|
|
287
|
-
)
|
|
288
|
-
}
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
export {
|
|
292
|
-
ce as C,
|
|
293
|
-
ue as E,
|
|
294
|
-
de as p
|
|
295
|
-
};
|
package/dist/layers.C6eKIfoF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.CTd8v_h2.js");require("./layers.Bee4DHJ8.js");exports.Commands=e.CB;exports.subsetToBase64=e.QB;exports.subsetToBinary=e.NQ;exports.toBase64=e.AI;
|
package/dist/layers.CPhHypWY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),P=require("@lexical/react/LexicalComposerContext"),v=require("@lexical/react/LexicalErrorBoundary"),y=require("@lexical/react/LexicalNestedComposer"),$=require("@lexical/react/LexicalRichTextPlugin"),k=require("@lexical/react/useLexicalNodeSelection"),q=require("@lexical/utils"),t=require("lexical"),x=require("./layers.l9POGoKk.js"),Y=require("@mantine/core");function w({children:n,className:l}){return e.jsx("div",{className:l||"Placeholder__root",children:n})}function B({label:n,value:l,onChange:o,placeholder:C="","data-test-id":i,type:d="text"}){return e.jsx(Y.TextInput,{type:d,placeholder:C,value:l,onChange:c=>{o(c.target.value)},label:n,"data-test-id":i,mb:10})}const b=new Set;function W(n){if(!b.has(n))throw new Promise(l=>{const o=new Image;o.src=n,o.onload=()=>{b.add(n),l(null)}})}function F({altText:n,className:l,imageRef:o,src:C,width:i,height:d,position:c}){return W(C),e.jsx("img",{className:l||void 0,src:C,alt:n,ref:o,"data-position":c,style:{display:"block",height:d,width:i},draggable:"false"})}function A({activeEditor:n,nodeKey:l,onClose:o}){const i=n.getEditorState().read(()=>t.$getNodeByKey(l)),[d,c]=s.useState(i.getAltText()),[h,S]=s.useState(i.getShowCaption()),[_,N]=s.useState(i.getPosition()),p=m=>{S(m.target.checked)},g=()=>{const m={altText:d,position:_,showCaption:h};i&&n.update(()=>{i.update(m)}),o()};return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{marginBottom:"1em"},children:e.jsx(B,{label:"Alt-текст",placeholder:"Альтернативный текст",onChange:c,value:d,"data-test-id":"image-modal-alt-text-input"})}),e.jsxs("div",{className:"Input__wrapper",children:[e.jsx("input",{id:"caption",type:"checkbox",checked:h,onChange:p}),e.jsx("label",{htmlFor:"caption",children:"Show Caption"})]}),e.jsx(x.Button,{"data-test-id":"image-modal-file-upload-btn",onClick:()=>g(),children:"Применить"})]})}function K({src:n,altText:l,nodeKey:o,width:C,height:i,showCaption:d,caption:c,position:h}){const[S,_]=x.useModal(),N=s.useRef(null),p=s.useRef(null),[g,m,M]=k.useLexicalNodeSelection(o),[a]=P.useLexicalComposerContext(),[D,L]=s.useState(null),O=s.useRef(null),E=s.useCallback(u=>{if(g&&t.$isNodeSelection(t.$getSelection())){u.preventDefault();const r=t.$getNodeByKey(o);x.$isInlineImageNode(r)&&r.remove()}return!1},[g,o]),R=s.useCallback(u=>{const f=t.$getSelection(),r=p.current;if(g&&t.$isNodeSelection(f)&&f.getNodes().length===1){if(d)return t.$setSelection(null),u.preventDefault(),c.focus(),!0;if(r!==null&&r!==document.activeElement)return u.preventDefault(),r.focus(),!0}return!1},[c,g,d]),j=s.useCallback(u=>O.current===c||p.current===u.target?(t.$setSelection(null),a.update(()=>{m(!0);const f=a.getRootElement();f!==null&&f.focus()}),!0):!1,[c,a,m]);s.useEffect(()=>{let u=!0;const f=q.mergeRegister(a.registerUpdateListener(({editorState:r})=>{u&&L(r.read(()=>t.$getSelection()))}),a.registerCommand(t.SELECTION_CHANGE_COMMAND,(r,I)=>(O.current=I,!1),t.COMMAND_PRIORITY_LOW),a.registerCommand(t.CLICK_COMMAND,r=>{const I=r;return I.target===N.current?(I.shiftKey?m(!g):(M(),m(!0)),!0):!1},t.COMMAND_PRIORITY_LOW),a.registerCommand(t.DRAGSTART_COMMAND,r=>r.target===N.current?(r.preventDefault(),!0):!1,t.COMMAND_PRIORITY_LOW),a.registerCommand(t.KEY_DELETE_COMMAND,E,t.COMMAND_PRIORITY_LOW),a.registerCommand(t.KEY_BACKSPACE_COMMAND,E,t.COMMAND_PRIORITY_LOW),a.registerCommand(t.KEY_ENTER_COMMAND,R,t.COMMAND_PRIORITY_LOW),a.registerCommand(t.KEY_ESCAPE_COMMAND,j,t.COMMAND_PRIORITY_LOW));return()=>{u=!1,f()}},[M,a,g,o,E,R,j,m]);const T=g;return e.jsxs(s.Suspense,{fallback:null,children:[e.jsxs(e.Fragment,{children:[e.jsxs("div",{draggable:!1,children:[e.jsx("button",{className:"image-edit-button",ref:p,onClick:()=>{_("Update Inline Image",u=>e.jsx(A,{activeEditor:a,nodeKey:o,onClose:u}))},children:"Edit"}),e.jsx(F,{className:T?`focused ${t.$isNodeSelection(D)?"draggable":""}`:null,src:n,altText:l,imageRef:N,width:C,height:i,position:h})]}),d&&e.jsx("div",{className:"image-caption-container",children:e.jsxs(y.LexicalNestedComposer,{initialEditor:c,children:[e.jsx(x.LinkPlugin,{}),e.jsx(x.FloatingTextFormatToolbarPlugin,{}),e.jsx($.RichTextPlugin,{contentEditable:e.jsx(x.LexicalContentEditable,{className:"InlineImageNode__contentEditable"}),placeholder:e.jsx(w,{className:"InlineImageNode__placeholder",children:"Enter a caption..."}),ErrorBoundary:v.LexicalErrorBoundary})]})})]}),S]})}exports.UpdateInlineImageDialog=A;exports.default=K;
|