@layers-app/editor 0.2.2-comments.4 → 0.2.3-specific.1
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 +10 -18
- package/dist/index.js +9 -8
- package/dist/{layers.BFD8Si4q.js → layers.-CCpeJAz.js} +1 -1
- package/dist/{layers.DEgsafsb.js → layers.-CsuSqln.js} +1 -1
- package/dist/{layers.Bx2xeXXm.js → layers.1DawzxLQ.js} +1 -1
- package/dist/layers.1_iCK_gH.js +1 -0
- package/dist/{layers.DbjP8pD1.js → layers.7Ne0l23D.js} +1 -1
- package/dist/{layers.Du_sKWdo.js → layers.7P7f1TiY.js} +1 -1
- package/dist/{layers.CW3lex4H.js → layers.7kvMTcVl.js} +1 -1
- package/dist/{layers.4Mp1HToi.js → layers.89RGGm6L.js} +1 -1
- package/dist/{layers.D2FToRbR.js → layers.A0tKHOFY.js} +1 -1
- package/dist/{layers.o3aNPN0H.js → layers.B2SaT29V.js} +1 -1
- package/dist/{layers.DXmOXFD2.js → layers.B3HTbhOH.js} +1 -1
- package/dist/{layers.CYLG3j3u.js → layers.B3Lc5LCp.js} +1 -1
- package/dist/{layers.Dqs9Ugcb.js → layers.B4Ld0s6L.js} +7 -6
- package/dist/{layers.Bo3YzY4o.js → layers.B4TvHj1g.js} +1 -1
- package/dist/{layers.C8D2ouxI.js → layers.B4hjagvO.js} +1 -1
- package/dist/{layers.B-G6Q662.js → layers.B5tAV8w2.js} +7 -6
- package/dist/{layers.Ypoo6YjR.js → layers.B6pJdj-2.js} +1 -1
- package/dist/{layers.DcrKMEZl.js → layers.BC1rJWaX.js} +1 -1
- package/dist/{layers.CIt2FRF8.js → layers.BCA4wEOk.js} +1 -1
- package/dist/{layers.H1SbjGSm.js → layers.BCpq0IJ_.js} +1 -1
- package/dist/{layers.DGhZQiN1.js → layers.BDxe74jj.js} +2 -2
- package/dist/{layers.DoB0qn9z.js → layers.BGJx5czs.js} +1 -1
- package/dist/{layers.oa5gJIGN.js → layers.BHTfqf65.js} +1 -1
- package/dist/{layers.B3Zz-M8X.js → layers.BHrcgdVX.js} +1 -1
- package/dist/{layers.Dq1lz3NR.js → layers.BHwxfWyI.js} +1 -1
- package/dist/{layers.CD_mAN8C.js → layers.BJcSp7wA.js} +1 -1
- package/dist/{layers.C6cVftiG.js → layers.BKXWbn3O.js} +1 -1
- package/dist/{layers.DVoDjHNC.js → layers.BMHqcWuW.js} +1 -1
- package/dist/{layers.XRaygmpJ.js → layers.BMJzHvtX.js} +27 -26
- package/dist/{layers.CGWdEEy3.js → layers.BN6NMD5s.js} +1 -1
- package/dist/layers.BOph-oP2.js +1 -0
- package/dist/{layers.D2ygBIom.js → layers.BPaO_bJu.js} +1 -1
- package/dist/{layers.BGnjSuZ2.js → layers.BQAMPECT.js} +1 -1
- package/dist/{layers.CrJzEHNd.js → layers.BS15TpKh.js} +1 -1
- package/dist/layers.BT0hf-ZU.js +342 -0
- package/dist/layers.BTr_uySn.js +8 -0
- package/dist/{layers.CWB-gelU.js → layers.BWQZAkgk.js} +39 -39
- package/dist/layers.B_ntCU1P.js +95 -0
- package/dist/{layers.C15-aPAO.js → layers.B_uS44RB.js} +1 -1
- package/dist/{layers.Hoa9jeMD.js → layers.Bal_gFu3.js} +1 -1
- package/dist/{layers.BaAFaMBJ.js → layers.Base8Uod.js} +1 -1
- package/dist/{layers.6eZC5acW.js → layers.BawR9D0t.js} +1 -1
- package/dist/layers.Bbd4cT11.js +230 -0
- package/dist/{layers.DUJ5CO8S.js → layers.Bc1M0sDR.js} +1 -1
- package/dist/{layers.DIeK_4dG.js → layers.BcCY10xp.js} +1 -1
- package/dist/{layers.BPFw88Y5.js → layers.BcVSuTMw.js} +1 -1
- package/dist/{layers.FXK9eL1F.js → layers.Bceq7ThS.js} +1 -1
- package/dist/{layers.D51l7NLD.js → layers.Bda4BZ4V.js} +1 -1
- package/dist/{layers.Bpq3_bFq.js → layers.BeZfVzmg.js} +4 -4
- package/dist/{layers.BWDwadK1.js → layers.BfX1yED3.js} +1 -1
- package/dist/layers.Bm486g8A.js +1 -0
- package/dist/{layers.BUE6DKJ6.js → layers.BnXWo_2S.js} +1 -1
- package/dist/{layers.fdRd0cJU.js → layers.BnkAKk5K.js} +1 -1
- package/dist/{layers.B7-JVIGV.js → layers.BoU8FN-i.js} +1 -1
- package/dist/{layers.D311S6Mc.js → layers.BomX9h5_.js} +3 -3
- package/dist/{layers.DqkYyg8J.js → layers.BsLzc4cm.js} +1 -1
- package/dist/{layers.D8YTfpoa.js → layers.BsRovMzA.js} +1 -1
- package/dist/{layers.C6MnC_wQ.js → layers.BtSNsQNS.js} +1 -1
- package/dist/{layers.BzZUIYsY.js → layers.BuCst22C.js} +1 -1
- package/dist/{layers.CGeek5Fq.js → layers.BuJMbwRU.js} +7 -6
- package/dist/{layers.BB8JANtc.js → layers.BwLzoWz7.js} +1 -1
- package/dist/{layers.dTOdH_ME.js → layers.By-9Q9VE.js} +1 -1
- package/dist/{layers._K8YgY5t.js → layers.ByavM5NS.js} +1 -1
- package/dist/{layers.fMMuxno9.js → layers.C0m7Cs7l.js} +1 -1
- package/dist/{layers.HmYnFQW8.js → layers.C0mXtiC2.js} +3 -3
- package/dist/{layers.Sj77DeHx.js → layers.C1Yt5kQD.js} +1 -1
- package/dist/{layers.bUq_fidO.js → layers.C3_51KUK.js} +1 -1
- package/dist/{layers.C11Yv9-K.js → layers.C3tmitL0.js} +1 -1
- package/dist/{layers.Dz7tyyEZ.js → layers.C4nk_2LP.js} +1 -1
- package/dist/{layers.8WL8L7Mv.js → layers.C6Fsr-4k.js} +1 -1
- package/dist/{layers.D8fSdEn_.js → layers.C9XH2LMl.js} +1 -1
- package/dist/{layers.DwxwSFsn.js → layers.CCGzQFe3.js} +1 -1
- package/dist/{layers.I9IiXoNv.js → layers.CC_ZNrjR.js} +1 -1
- package/dist/{layers.DHyq6sFT.js → layers.CFIfu-0-.js} +6 -5
- package/dist/{layers.BCgsvKyw.js → layers.CICt_WnZ.js} +1 -1
- package/dist/{layers.BSiIcjeT.js → layers.CJ-UcTJk.js} +1 -1
- package/dist/{layers.BzIwWXMS.js → layers.CJEusXLU.js} +1 -1
- package/dist/{layers.DHRTBpMJ.js → layers.CJ_9Czgi.js} +2 -2
- package/dist/{layers.qIbcaT50.js → layers.CKCkluXR.js} +1 -1
- package/dist/{layers.C-HwbKnM.js → layers.CME4Ag64.js} +14 -13
- package/dist/layers.CMga0YwW.js +1 -0
- package/dist/{layers.BgPxT78V.js → layers.CMlr7HUA.js} +21803 -18439
- package/dist/{layers.ULu7_TDY.js → layers.CNDfKgMR.js} +3 -3
- package/dist/{layers.DegKuZAL.js → layers.CR7X7syO.js} +1 -1
- package/dist/{layers.CDmlUj42.js → layers.CRWJHEAN.js} +4 -4
- package/dist/{layers.ComDAbHr.js → layers.CRnqpAiD.js} +1 -1
- package/dist/{layers.BS8K0dSr.js → layers.CUdsxvse.js} +1 -1
- package/dist/{layers.cjv6a7Bp.js → layers.CVXIWdQS.js} +1 -1
- package/dist/{layers.CLbrtdh2.js → layers.CVeltnOj.js} +2 -2
- package/dist/{layers.KFkR9X1o.js → layers.CXDsrJSU.js} +1 -1
- package/dist/{layers.CyjmgqpK.js → layers.CYM2YUlS.js} +1 -1
- package/dist/{layers.CqOLm6Vm.js → layers.CY_TaR8p.js} +1 -1
- package/dist/{layers.Dn5WvQhw.js → layers.CZQoIvyx.js} +6 -5
- package/dist/{layers.GqjSFMYL.js → layers.Caez65dl.js} +1 -1
- package/dist/{layers.BpgUgxDs.js → layers.CccTHubB.js} +1 -1
- package/dist/{layers.noJEre31.js → layers.Cfq6RrFE.js} +90 -89
- package/dist/{layers.Ckrhlpv8.js → layers.ClAIcjLp.js} +1 -1
- package/dist/{layers.ByocsCxo.js → layers.ClMM1y4L.js} +1 -1
- package/dist/{layers.CQVPBDKe.js → layers.CmMSuiFz.js} +1 -1
- package/dist/{layers.Ci3IuTYM.js → layers.CmPp2hfn.js} +1 -1
- package/dist/{layers.Ccug5P9p.js → layers.CojBAunT.js} +1 -1
- package/dist/{layers.D90G-CnV.js → layers.Cq7UWhCe.js} +1 -1
- package/dist/{layers.CWXFR2wL.js → layers.CrYBHHHM.js} +1 -1
- package/dist/{layers.DGbacYn1.js → layers.CskgYvOG.js} +7 -6
- package/dist/{layers.Dze3ZPTz.js → layers.Cu5DxPiP.js} +1 -1
- package/dist/layers.CuW62zQc.js +8 -0
- package/dist/layers.Cvrdp8HI.js +52846 -0
- package/dist/{layers.e087ufBh.js → layers.CxonHyF-.js} +9 -8
- package/dist/layers.CzD_Xpzc.js +1 -0
- package/dist/{layers.K1vQc8-l.js → layers.Cz_IvDrc.js} +1 -1
- package/dist/{layers.CP-mb1d8.js → layers.CzcbE7VI.js} +7 -6
- package/dist/{layers.DUODI6WJ.js → layers.D-s5Ye7x.js} +1 -1
- package/dist/{layers.DXAfyKbp.js → layers.D4rjNiz6.js} +1 -1
- package/dist/layers.D6eKzVJD.js +2 -0
- package/dist/{layers.C5yxAarb.js → layers.D8C-O3Ec.js} +1 -1
- package/dist/{layers.C-BlQfAk.js → layers.D8g5nL_q.js} +1 -1
- package/dist/{layers.dAQkMUSJ.js → layers.D8tbrcNy.js} +6 -6
- package/dist/{layers.Dir617kc.js → layers.D9wTfnw5.js} +1 -1
- package/dist/{layers.BZThXcw6.js → layers.DA3PPVNV.js} +1 -1
- package/dist/{layers.DEp-MvXH.js → layers.DAvtBoeR.js} +1 -1
- package/dist/{layers.BgHih0Tt.js → layers.DEtHjSzG.js} +1 -1
- package/dist/layers.DFmjiTrD.js +1 -0
- package/dist/{layers.Bcn9IAAz.js → layers.DGSwy7oV.js} +1 -1
- package/dist/{layers.B-iCJ1mD.js → layers.DHkYjcLh.js} +1 -1
- package/dist/{layers.BrmIdR3n.js → layers.DHmV-x4V.js} +1 -1
- package/dist/{layers.BT_hkMF1.js → layers.DLTaJ9tx.js} +6 -5
- package/dist/{layers.BGiqmbfN.js → layers.DLo_EAyX.js} +3 -3
- package/dist/{layers.BR4l_3qL.js → layers.DNT0guYV.js} +1 -1
- package/dist/{layers.DQ-Vrsdy.js → layers.DPmer6Kv.js} +1 -1
- package/dist/{layers.BHfwAQsR.js → layers.DQFz6wfj.js} +1 -1
- package/dist/{layers.DH7bnUXU.js → layers.DQV-bOHD.js} +1 -1
- package/dist/{layers.Bat0gKr_.js → layers.DRLm2eyR.js} +1 -1
- package/dist/{layers.BEVjJSTr.js → layers.DRUW-mcj.js} +1 -1
- package/dist/{layers.BMIGYpzw.js → layers.DSBAPojN.js} +5 -4
- package/dist/{layers.BAkbXScZ.js → layers.DSLT3pB1.js} +1 -1
- package/dist/{layers.NylC6bcc.js → layers.DTLqX3vj.js} +1 -1
- package/dist/{layers.C6hsMGfn.js → layers.DTjkfN9n.js} +1 -1
- package/dist/{layers.C5Otasjk.js → layers.DTvbOG9N.js} +1 -1
- package/dist/{layers.3izvHtyi.js → layers.DUhAvMGl.js} +1 -1
- package/dist/{layers.BM0mKNmp.js → layers.DWEPkX6r.js} +1 -1
- package/dist/{layers.gtk9ShEx.js → layers.DXfodum-.js} +1 -1
- package/dist/{layers.6GyZ9zg1.js → layers.DZNIrzEr.js} +1 -1
- package/dist/{layers.CQ6L_50R.js → layers.DaZNumge.js} +6 -5
- package/dist/layers.DatA2QfW.js +159 -0
- package/dist/{layers.CdhFsSGl.js → layers.DeIrgVfc.js} +1 -1
- package/dist/{layers.BP6iXHWE.js → layers.Dh0W0Rlv.js} +1 -1
- package/dist/{layers.DGVeK1li.js → layers.Dj3askUf.js} +1 -1
- package/dist/{layers.D_fxRJjO.js → layers.DjGSZPx3.js} +1 -1
- package/dist/{layers.ULFxPQy_.js → layers.DkUtuy4Z.js} +1 -1
- package/dist/{layers.tLA0vcHT.js → layers.DoUWpy_5.js} +1 -1
- package/dist/{layers.Bl8RpzVH.js → layers.DpBWr6sD.js} +1 -1
- package/dist/{layers.3bfhWWzw.js → layers.DrAF2uVI.js} +1 -1
- package/dist/{layers.DE6Vdmx2.js → layers.Dtpje27P.js} +12 -11
- package/dist/{layers.DhuI_8TZ.js → layers.DuJJnPMd.js} +8 -7
- package/dist/{layers.Dush5fl-.js → layers.DvGJ9-E3.js} +1 -1
- package/dist/{layers.CBDl94ol.js → layers.DyrZ91ae.js} +1 -1
- package/dist/{layers.BwVGs9WZ.js → layers.ETJ6389D.js} +6 -5
- package/dist/{layers.IH77ejM-.js → layers.FNYLisP9.js} +1 -1
- package/dist/{layers.hHb6XOXH.js → layers.Frdc-PTB.js} +1 -1
- package/dist/{layers.BZjmaZFR.js → layers.G9TFvgAd.js} +1 -1
- package/dist/layers.GHnZTJ9O.js +2 -0
- package/dist/{layers.Cs7t-ERg.js → layers.GMIwl7mk.js} +1 -1
- package/dist/{layers.D5oUvwD7.js → layers.H7yIzbTE.js} +1 -1
- package/dist/{layers.DaLFX3XW.js → layers.I8Ql_h2v.js} +1 -1
- package/dist/{layers.DobBVaUG.js → layers.IA-UvvKx.js} +1 -1
- package/dist/{layers.BhNfVwbF.js → layers.JDnQUzDV.js} +1 -1
- package/dist/{layers.BFqGSQbM.js → layers.JhHa0T-H.js} +1 -1
- package/dist/{layers.BxWePjrJ.js → layers.L2K4m76I.js} +1 -1
- package/dist/{layers.CwS5yLVf.js → layers.MF3UrbiP.js} +1 -1
- package/dist/{layers.DLRBzVNU.js → layers.NWONng2m.js} +8 -7
- package/dist/{layers.Db8PSmxx.js → layers.P9Gv9aa3.js} +1 -1
- package/dist/{layers.ntmzTHlr.js → layers.PiNn2mOX.js} +5 -4
- package/dist/{layers.4G849Vmo.js → layers.R3ttrU_g.js} +1 -1
- package/dist/{layers.C47RfRb_.js → layers.RSpgI6MN.js} +5 -4
- package/dist/{layers.CppCEsgo.js → layers.USEeOMJ1.js} +1 -1
- package/dist/{layers.WzHuBzUm.js → layers.UYttQ0Zb.js} +1 -1
- package/dist/{layers.Bu_SJcSy.js → layers.W84WsNiK.js} +1 -1
- package/dist/{layers.CeMOGFHn.js → layers.WZGUuwQw.js} +1 -1
- package/dist/{layers.BSHeJ507.js → layers.XNGTcQDn.js} +1 -1
- package/dist/{layers.v5PDT36l.js → layers.Y1LKjl9b.js} +1 -1
- package/dist/{layers.C1g3F9s0.js → layers.YPJHf8lc.js} +1 -1
- package/dist/{layers.Epz-0GGV.js → layers.Z9hCef4r.js} +1 -1
- package/dist/layers.b-hRtn7J.js +1 -0
- package/dist/layers.bzsDUVrr.js +257 -0
- package/dist/{layers.Bc51hCMr.js → layers.cIU9TFKX.js} +1 -1
- package/dist/{layers.D8n7aBmM.js → layers.dMkCBnnB.js} +1 -1
- package/dist/{layers.CFm0hZnM.js → layers.ddOQhXsv.js} +7 -6
- package/dist/layers.eYFoHPwR.js +528 -0
- package/dist/{layers.1LJ2jRRI.js → layers.gUHeHqVs.js} +9 -8
- package/dist/{layers.DKI6af_5.js → layers.hAKBQg_k.js} +7166 -7368
- package/dist/{layers.DXfOPp6a.js → layers.hXdZ84_y.js} +1 -1
- package/dist/{layers.DggoceC1.js → layers.iQakWJBP.js} +1 -1
- package/dist/layers.iu2L06o2.js +137 -0
- package/dist/{layers.BxuOkVZb.js → layers.jjMKm1YJ.js} +1 -1
- package/dist/{layers.7SQ-m2uF.js → layers.nl_0ZVgt.js} +74 -74
- package/dist/{layers.D_k73JT5.js → layers.pzY1tDPR.js} +1 -1
- package/dist/{layers.aWQ3XxdA.js → layers.qxVY1I_r.js} +1 -1
- package/dist/{layers.FpVAdc00.js → layers.r3EmKo-N.js} +1 -1
- package/dist/{layers.2HPedsvF.js → layers.rLEFJFgm.js} +1 -1
- package/dist/{layers.DhmhjTf7.js → layers.u-VDrr74.js} +1 -1
- package/dist/layers.v_AQPmpY.js +6 -0
- package/dist/layers.vdf-aXrK.js +2 -0
- package/dist/{layers.B-MQ-de1.js → layers.x7eyzWUN.js} +1 -1
- package/dist/{layers.BFQnBoH2.js → layers.y2dUz6fq.js} +2994 -3518
- package/package.json +4 -6
- package/dist/layers.5Ykgr7Jy.js +0 -2
- package/dist/layers.6-4gDOld.js +0 -233
- package/dist/layers.B6O_hwS1.js +0 -257
- package/dist/layers.BTEMViez.js +0 -96
- package/dist/layers.BeLVgQGL.js +0 -1
- package/dist/layers.BjdxIsg0.js +0 -1
- package/dist/layers.BqKeyqAV.js +0 -8
- package/dist/layers.BtSkqiH9.js +0 -230
- package/dist/layers.BvJAEsyo.js +0 -6
- package/dist/layers.C2Go6Teb.js +0 -1
- package/dist/layers.CAVNoIvf.js +0 -1
- package/dist/layers.CGKH9_AG.js +0 -1
- package/dist/layers.COrcM3Q4.js +0 -1
- package/dist/layers.CfLH66Jy.js +0 -8
- package/dist/layers.CpxAQfrk.js +0 -1
- package/dist/layers.DZQTSSFz.js +0 -1
- package/dist/layers.DxUpRC1A.js +0 -135
- package/dist/layers.apcfSNtJ.js +0 -2
- package/dist/layers.stmnFvo6.js +0 -58
package/dist/layers.BeLVgQGL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),n=require("react"),_=require("react-i18next"),i=require("./layers.DxUpRC1A.js"),B=require("@mantine/core"),G=require("@layers-app/shared"),k=t=>{const{width:f,height:d,isLoading:a,isError:h,src:m,id:p,altText:I,imageRef:x,maxWidth:c}=t;return g.jsxs("div",{className:"media-wrapper",style:{width:f,height:d,display:"inline-flex",position:"relative"},children:[g.jsx(B.LoadingOverlay,{visible:a,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),g.jsx(V,{className:null,src:m,altText:I,imageRef:x,width:"inherit",height:"inherit",maxWidth:c||"auto",id:p})]})};function V({altText:t,className:f,imageRef:d,src:a,width:h,height:m,maxWidth:p,id:I}){const[x,c]=n.useState(!1);return g.jsx("img",{className:`${f||void 0} ${x?"":"loading"}`,src:a,alt:t,ref:d,style:{height:m,maxWidth:p,width:h},onLoad:()=>{a.includes("splash")?setTimeout(()=>{c(!0)},100):c(!0)},draggable:"false","data-id":I})}function J({src:t,altText:f,nodeKey:d,width:a,height:h,maxWidth:m,showCaption:p,caption:I,id:x,create:c,alignment:F}){var A,$;const W=n.useRef(null),[v,S]=n.useState(!0),{isCollabActive:M}=i.l(),[u]=i.o(),[E,j]=n.useState(!0),[l,C]=n.useState({width:0,height:0}),{fetchUploadMedia:L,fetchDeleteMedia:P,maxFileSize:Q}=n.useContext(i.Context),N=((A=i.mediaMap.get(t))==null?void 0:A.mediaNodeKeys.length)===0||(($=i.mediaMap.get(t))==null?void 0:$.mediaNodeKeys.length)===void 0||t.trim()==="",{t:y}=_.useTranslation(),[X,H]=n.useState(0);n.useEffect(()=>u.registerDecoratorListener(()=>{H(e=>e+1)}),[N]),n.useEffect(()=>{if(!t||t.startsWith("data:image/")||!t.trim()){S(!1);return}const e=new Image;e.src=t,e.onload=()=>S(!1),e.onerror=()=>{S(!1)}},[t,N]);const U=(e,o)=>{u.update(()=>{i.ms(null);const s=i.us(d);i.$isImageNode(s)&&s.setWidthAndHeight(e,o)})},{historyState:R}=i.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:z}}=i.useSettings(),[b,w]=n.useState(!1);function D(e){return e.endsWith(".svg")||e.includes("image/svg+xml")}function T(e){return new Promise((o,s)=>{if(D(e)){o(0);return}const r=new Image;r.src=e,r.onload=()=>{o(r.width)},r.onerror=()=>{s(new Error("Failed to load image"))}})}n.useEffect(()=>{c&&w(!0)},[c]),n.useEffect(()=>{let e=a,o=h,s=100;(t.includes("unsplash")?t.trim():!N&&t.trim()||t.includes("upload-src-editor"))&&t!=="upload"&&T(t).then(r=>{typeof e=="number"&&e<s&&r<s?(j(!0),C({width:e,height:o})):r<s?(j(!0),C({width:"auto",height:"auto"})):(C({width:r,height:r}),j(!1))}).catch(r=>{console.warn("Ошибка при загрузке изображения:",r.message)})},[t,N]),n.useEffect(()=>{l.width&&l.height&&E&&u.update(()=>{const e=i.us(d);i.$isImageNode(e)&&e.setWidthAndHeight(l.width,l.height)})},[l.width,l.height,E]),n.useEffect(()=>{const e=document.documentElement;i.toggleLockScroll(b,e)},[b]),n.useEffect(()=>u.registerCommand(i.UPLOAD_IMAGE_COMMAND,e=>(t==="upload"&&q(e),!1),i.Ii),[t,v]);const O=(e,o)=>{S(!1),u.update(()=>{const s=i.us(d);i.$isImageNode(s)&&(s.setSrc(e),s.setId(o))})},q=e=>{S(!0),L&&L(e[0],(o,s)=>{O(o,s)},o=>{o&&G.showErrorNotification({message:y("editor.gallery.errorFile")}),O("","")})};return!t||t==="upload"?g.jsx(i.ImagePicker,{uploading:!1,onUpload:e=>{!L||!e.length||(q(e),w(!1))},popoverProps:{opened:b,position:"bottom",onChange:w},onChange:e=>{w(!1),u.update(()=>{const o=i.us(d);i.$isImageNode(o)&&o.setSrc(e)})},children:g.jsx(i.EmptyNodeButton,{title:y("editor.image.add_photo"),icon:"photo",onClick:()=>w(!b),isLoading:v})}):E?g.jsx(k,{width:l.width,height:l.height,isLoading:v,isError:!1,isIcon:E,src:t,id:x,editor:u,nodeKey:d,fetchDeleteMedia:P,altText:f,imageRef:W,maxWidth:m,showCaption:p,caption:I,isCollabActive:M,historyState:R,showNestedEditorTreeView:z,t:y}):g.jsx(i.ResizableContainer,{editor:u,isIcon:E,width:typeof a=="string"&&a.includes("%")?parseFloat(a):a,height:typeof h=="string"&&h.includes("%")?parseFloat(h):a,initialWidth:l.width||"",initialHeight:l.height||"",onResizeEnd:U,alignment:F,children:g.jsx(k,{width:"inherit",height:"inherit",isLoading:v,isError:!1,isIcon:E,src:t,id:x,editor:u,nodeKey:d,fetchDeleteMedia:P,altText:f,imageRef:W,maxWidth:m,showCaption:p,caption:I,isCollabActive:M,historyState:R,showNestedEditorTreeView:z,t:y})})}exports.default=J;
|
package/dist/layers.BjdxIsg0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),e=require("./layers.DxUpRC1A.js"),T=require("react-i18next"),k=require("./layers.BtSkqiH9.js"),x=require("@mantine/core"),z=require("@tabler/icons-react"),D=t=>{var h;const r=(h=t==null?void 0:t.firstElementChild)==null?void 0:h.firstElementChild,m=t.getAttribute("viewBox");if(m!=null){const o=m.split(" ");t.setAttribute("width",o[2]),t.setAttribute("height",o[3])}r&&r.tagName==="style"&&r.remove()};function q({elements:t,files:r,imageContainerRef:m,appState:h,editor:o,rootClassName:n=null,width:S="inherit",height:A="inherit",nodeKey:c,alignment:I,setModalOpen:N}){const[u,C]=l.useState(null),[p,w]=l.useState(!1);x.useMantineTheme();const{t:E}=T.useTranslation();l.useEffect(()=>{(async()=>{const a=await k.r9({appState:h,elements:t,files:r});D(a),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("display","block"),a.classList.add("excalidraw-svg"),C(a)})()},[t,r,h]);const b=(f,a)=>{o.update(()=>{e.ms(null);const j=e.us(c);return e.$isExcalidrawNode(j)&&j.setWidthAndHeight(f,a),!0})},v=f=>{e.deleteNode(o,c)};return i.jsx(e.ResizableContainer,{editor:o,isIcon:!1,isEmbed:!0,width:S,height:A,onResizeEnd:b,alignment:I,children:i.jsxs(x.Box,{className:"media-wrapper excaildraw",children:[i.jsxs("div",{className:"media-actions",children:[i.jsx(x.Tooltip,{label:E("editor.link.edit"),children:i.jsx(x.ActionIcon,{color:"gray","aria-label":"Settings",className:"media-action",variant:"default",size:24,onClick:()=>{N(!0)},children:i.jsx(z.IconEdit,{size:14})})}),i.jsx(e.AlignmentImage,{opened:p,setOpened:w,t:E,editor:o,nodeKey:c}),i.jsx(x.Tooltip,{label:E("editor.actions.delete"),children:i.jsx(x.ActionIcon,{color:"gray","aria-label":"Settings",className:"media-action",variant:"default",size:24,onClick:v,children:i.jsx(e.Icon,{name:"trash",size:"14"})})})]}),i.jsx(x.Box,{w:"100%",ref:f=>{f&&m&&(m.current=f)},className:n??"",dangerouslySetInnerHTML:{__html:(u==null?void 0:u.outerHTML)??""}})]})})}function y({nodeKey:t,data:r,width:m,height:h,alignment:o}){const[n]=e.o(),S=e.a(),[A,c]=l.useState(r==="[]"&&n.isEditable()),I=l.useRef(null),N=l.useRef(null),[u,C,p]=e.u(t),[w,E]=l.useState(!1),b=l.useCallback(s=>(u&&(s.preventDefault(),n.update(()=>{const d=e.us(t);d&&d.remove()})),!1),[n,u,t]);l.useEffect(()=>{if(!S){u&&p();return}return e.j(n.registerCommand(e.ae,s=>{const d=N.current,g=s.target;return w?!0:d!==null&&d.contains(g)?(s.shiftKey||p(),C(!u),s.detail>1&&(console.log("--- HUI"),c(!0)),!0):!1},e.Ii),n.registerCommand(e.De,b,e.Ii),n.registerCommand(e.Ae,b,e.Ii))},[p,n,u,w,b,C,S]);const v=l.useCallback(()=>(c(!1),n.update(()=>{const s=e.us(t);s&&s.remove()})),[n,t]),f=(s,d,g)=>n.update(()=>{const O=e.us(t);e.$isExcalidrawNode(O)&&(s&&s.length>0||Object.keys(g).length>0?O.setData(JSON.stringify({appState:d,elements:s,files:g})):O.remove())}),{elements:a=[],files:j={},appState:R={}}=l.useMemo(()=>JSON.parse(r),[r]),M=l.useCallback(()=>{c(!1),a.length===0&&n.update(()=>{const s=e.us(t);s&&s.remove()})},[n,t,a.length]);return i.jsxs(i.Fragment,{children:[i.jsx(k.ExcalidrawModal,{initialElements:a,initialFiles:j,initialAppState:R,isShown:A,onDelete:v,onClose:M,onSave:(s,d,g)=>{f(s,d,g),c(!1)},closeOnClickOutside:!1}),a.length>0&&i.jsx("div",{style:{display:"flex",justifyContent:o},children:i.jsx(q,{imageContainerRef:I,className:"image",elements:a,files:j,appState:R,width:m,height:h,editor:n,nodeKey:t,alignment:o,setModalOpen:c})})]})}exports.default=y;
|
package/dist/layers.BqKeyqAV.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./layers.BTEMViez.js");require("./layers.BtSkqiH9.js");const pt=require("./layers.B19hGmey.js"),mt=require("./layers.BIeVwYKL.js");function rt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s<a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s<u||s===void 0&&u>=u)&&(s=u)}return s}function ft(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function Z(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function kt(t){return t.target.depth}function _t(t){return t.depth}function xt(t,n){return n-1-t.height}function yt(t,n){return t.sourceLinks.length?t.depth:n-1}function vt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?ft(t.sourceLinks,kt)-1:0}function G(t){return function(){return t}}function ot(t,n){return Y(t.source,n.source)||t.index-n.index}function lt(t,n){return Y(t.target,n.target)||t.index-n.index}function Y(t,n){return t.y0-n.y0}function J(t){return t.value}function bt(t){return t.index}function wt(t){return t.nodes}function St(t){return t.links}function at(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function ct({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Lt(){let t=0,n=0,s=1,a=1,u=24,_=8,g,p=bt,i=yt,o,c,m=wt,b=St,y=6;function x(){const e={nodes:m.apply(null,arguments),links:b.apply(null,arguments)};return A(e),E(e),T(e),C(e),S(e),ct(e),e}x.update=function(e){return ct(e),e},x.nodeId=function(e){return arguments.length?(p=typeof e=="function"?e:G(e),x):p},x.nodeAlign=function(e){return arguments.length?(i=typeof e=="function"?e:G(e),x):i},x.nodeSort=function(e){return arguments.length?(o=e,x):o},x.nodeWidth=function(e){return arguments.length?(u=+e,x):u},x.nodePadding=function(e){return arguments.length?(_=g=+e,x):_},x.nodes=function(e){return arguments.length?(m=typeof e=="function"?e:G(e),x):m},x.links=function(e){return arguments.length?(b=typeof e=="function"?e:G(e),x):b},x.linkSort=function(e){return arguments.length?(c=e,x):c},x.size=function(e){return arguments.length?(t=n=0,s=+e[0],a=+e[1],x):[s-t,a-n]},x.extent=function(e){return arguments.length?(t=+e[0][0],s=+e[1][0],n=+e[0][1],a=+e[1][1],x):[[t,n],[s,a]]},x.iterations=function(e){return arguments.length?(y=+e,x):y};function A({nodes:e,links:f}){for(const[h,r]of e.entries())r.index=h,r.sourceLinks=[],r.targetLinks=[];const l=new Map(e.map((h,r)=>[p(h,r,e),h]));for(const[h,r]of f.entries()){r.index=h;let{source:k,target:v}=r;typeof k!="object"&&(k=r.source=at(l,k)),typeof v!="object"&&(v=r.target=at(l,v)),k.sourceLinks.push(r),v.targetLinks.push(r)}if(c!=null)for(const{sourceLinks:h,targetLinks:r}of e)h.sort(c),r.sort(c)}function E({nodes:e}){for(const f of e)f.value=f.fixedValue===void 0?Math.max(Z(f.sourceLinks,J),Z(f.targetLinks,J)):f.fixedValue}function T({nodes:e}){const f=e.length;let l=new Set(e),h=new Set,r=0;for(;l.size;){for(const k of l){k.depth=r;for(const{target:v}of k.sourceLinks)h.add(v)}if(++r>f)throw new Error("circular link");l=h,h=new Set}}function C({nodes:e}){const f=e.length;let l=new Set(e),h=new Set,r=0;for(;l.size;){for(const k of l){k.height=r;for(const{source:v}of k.targetLinks)h.add(v)}if(++r>f)throw new Error("circular link");l=h,h=new Set}}function O({nodes:e}){const f=rt(e,r=>r.depth)+1,l=(s-t-u)/(f-1),h=new Array(f);for(const r of e){const k=Math.max(0,Math.min(f-1,Math.floor(i.call(null,r,f))));r.layer=k,r.x0=t+k*l,r.x1=r.x0+u,h[k]?h[k].push(r):h[k]=[r]}if(o)for(const r of h)r.sort(o);return h}function j(e){const f=ft(e,l=>(a-n-(l.length-1)*g)/Z(l,J));for(const l of e){let h=n;for(const r of l){r.y0=h,r.y1=h+r.value*f,h=r.y1+g;for(const k of r.sourceLinks)k.width=k.value*f}h=(a-h+g)/(l.length+1);for(let r=0;r<l.length;++r){const k=l[r];k.y0+=h*(r+1),k.y1+=h*(r+1)}$(l)}}function S(e){const f=O(e);g=Math.min(_,(a-n)/(rt(f,l=>l.length)-1)),j(f);for(let l=0;l<y;++l){const h=Math.pow(.99,l),r=Math.max(1-h,(l+1)/y);D(f,h,r),N(f,h,r)}}function N(e,f,l){for(let h=1,r=e.length;h<r;++h){const k=e[h];for(const v of k){let U=0,z=0;for(const{source:F,value:K}of v.targetLinks){let q=K*(v.layer-F.layer);U+=M(F,v)*q,z+=q}if(!(z>0))continue;let W=(U/z-v.y0)*f;v.y0+=W,v.y1+=W,w(v)}o===void 0&&k.sort(Y),P(k,l)}}function D(e,f,l){for(let h=e.length,r=h-2;r>=0;--r){const k=e[r];for(const v of k){let U=0,z=0;for(const{target:F,value:K}of v.sourceLinks){let q=K*(F.layer-v.layer);U+=R(v,F)*q,z+=q}if(!(z>0))continue;let W=(U/z-v.y0)*f;v.y0+=W,v.y1+=W,w(v)}o===void 0&&k.sort(Y),P(k,l)}}function P(e,f){const l=e.length>>1,h=e[l];d(e,h.y0-g,l-1,f),I(e,h.y1+g,l+1,f),d(e,a,e.length-1,f),I(e,n,0,f)}function I(e,f,l,h){for(;l<e.length;++l){const r=e[l],k=(f-r.y0)*h;k>1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+g}}function d(e,f,l,h){for(;l>=0;--l){const r=e[l],k=(r.y1-f)*h;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-g}}function w({sourceLinks:e,targetLinks:f}){if(c===void 0){for(const{source:{sourceLinks:l}}of f)l.sort(lt);for(const{target:{targetLinks:l}}of e)l.sort(ot)}}function $(e){if(c===void 0)for(const{sourceLinks:f,targetLinks:l}of e)f.sort(lt),l.sort(ot)}function M(e,f){let l=e.y0-(e.sourceLinks.length-1)*g/2;for(const{target:h,width:r}of e.sourceLinks){if(h===f)break;l+=r+g}for(const{source:h,width:r}of f.targetLinks){if(h===e)break;l-=r}return l}function R(e,f){let l=f.y0-(f.targetLinks.length-1)*g/2;for(const{source:h,width:r}of f.targetLinks){if(h===e)break;l+=r+g}for(const{target:h,width:r}of e.sourceLinks){if(h===f)break;l-=r}return l}return x}var tt=Math.PI,et=2*tt,B=1e-6,Et=et-B;function nt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function dt(){return new nt}nt.prototype=dt.prototype={constructor:nt,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,_){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+_)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var _=this._x1,g=this._y1,p=s-t,i=a-n,o=_-t,c=g-n,m=o*o+c*c;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(m>B)if(!(Math.abs(c*p-i*o)>B)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var b=s-_,y=a-g,x=p*p+i*i,A=b*b+y*y,E=Math.sqrt(x),T=Math.sqrt(m),C=u*Math.tan((tt-Math.acos((x+m-A)/(2*E*T)))/2),O=C/T,j=C/E;Math.abs(O-1)>B&&(this._+="L"+(t+O*o)+","+(n+O*c)),this._+="A"+u+","+u+",0,0,"+ +(c*b>o*y)+","+(this._x1=t+j*p)+","+(this._y1=n+j*i)}},arc:function(t,n,s,a,u,_){t=+t,n=+n,s=+s,_=!!_;var g=s*Math.cos(a),p=s*Math.sin(a),i=t+g,o=n+p,c=1^_,m=_?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+i+","+o:(Math.abs(this._x1-i)>B||Math.abs(this._y1-o)>B)&&(this._+="L"+i+","+o),s&&(m<0&&(m=m%et+et),m>Et?this._+="A"+s+","+s+",0,1,"+c+","+(t-g)+","+(n-p)+"A"+s+","+s+",0,1,"+c+","+(this._x1=i)+","+(this._y1=o):m>B&&(this._+="A"+s+","+s+",0,"+ +(m>=tt)+","+c+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function ut(t){return function(){return t}}function At(t){return t[0]}function Tt(t){return t[1]}var Mt=Array.prototype.slice;function Nt(t){return t.source}function Ct(t){return t.target}function Pt(t){var n=Nt,s=Ct,a=At,u=Tt,_=null;function g(){var p,i=Mt.call(arguments),o=n.apply(this,i),c=s.apply(this,i);if(_||(_=p=dt()),t(_,+a.apply(this,(i[0]=o,i)),+u.apply(this,i),+a.apply(this,(i[0]=c,i)),+u.apply(this,i)),p)return _=null,p+""||null}return g.source=function(p){return arguments.length?(n=p,g):n},g.target=function(p){return arguments.length?(s=p,g):s},g.x=function(p){return arguments.length?(a=typeof p=="function"?p:ut(+p),g):a},g.y=function(p){return arguments.length?(u=typeof p=="function"?p:ut(+p),g):u},g.context=function(p){return arguments.length?(_=p??null,g):_},g}function It(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Ot(){return Pt(It)}function $t(t){return[t.source.x1,t.y0]}function Dt(t){return[t.target.x0,t.y1]}function jt(){return Ot().source($t).target(Dt)}var it=(function(){var t=function(p,i,o,c){for(o=o||{},c=p.length;c--;o[p[c]]=i);return o},n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:function(){},yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:function(i,o,c,m,b,y,x){var A=y.length-1;switch(b){case 7:const E=m.findOrCreateNode(y[A-4].trim().replaceAll('""','"')),T=m.findOrCreateNode(y[A-2].trim().replaceAll('""','"')),C=parseFloat(y[A].trim());m.addLink(E,T,C);break;case 8:case 9:case 11:this.$=y[A];break;case 10:this.$=y[A-1];break}},table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:function(i,o){if(o.recoverable)this.trace(i);else{var c=new Error(i);throw c.hash=o,c}},parse:function(i){var o=this,c=[0],m=[],b=[null],y=[],x=this.table,A="",E=0,T=0,C=2,O=1,j=y.slice.call(arguments,1),S=Object.create(this.lexer),N={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(N.yy[D]=this.yy[D]);S.setInput(i,N.yy),N.yy.lexer=S,N.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var P=S.yylloc;y.push(P);var I=S.options&&S.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function d(){var v;return v=m.pop()||S.lex()||O,typeof v!="number"&&(v instanceof Array&&(m=v,v=m.pop()),v=o.symbols_[v]||v),v}for(var w,$,M,R,e={},f,l,h,r;;){if($=c[c.length-1],this.defaultActions[$]?M=this.defaultActions[$]:((w===null||typeof w>"u")&&(w=d()),M=x[$]&&x[$][w]),typeof M>"u"||!M.length||!M[0]){var k="";r=[];for(f in x[$])this.terminals_[f]&&f>C&&r.push("'"+this.terminals_[f]+"'");S.showPosition?k="Parse error on line "+(E+1)+`:
|
|
2
|
-
`+S.showPosition()+`
|
|
3
|
-
Expecting `+r.join(", ")+", got '"+(this.terminals_[w]||w)+"'":k="Parse error on line "+(E+1)+": Unexpected "+(w==O?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(k,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:P,expected:r})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+w);switch(M[0]){case 1:c.push(w),b.push(S.yytext),y.push(S.yylloc),c.push(M[1]),w=null,T=S.yyleng,A=S.yytext,E=S.yylineno,P=S.yylloc;break;case 2:if(l=this.productions_[M[1]][1],e.$=b[b.length-l],e._$={first_line:y[y.length-(l||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(l||1)].first_column,last_column:y[y.length-1].last_column},I&&(e._$.range=[y[y.length-(l||1)].range[0],y[y.length-1].range[1]]),R=this.performAction.apply(e,[A,T,E,N.yy,M[1],b,y].concat(j)),typeof R<"u")return R;l&&(c=c.slice(0,-1*l*2),b=b.slice(0,-1*l),y=y.slice(0,-1*l)),c.push(this.productions_[M[1]][0]),b.push(e.$),y.push(e._$),h=x[c[c.length-2]][c[c.length-1]],c.push(h);break;case 3:return!0}}return!0}},_=(function(){var p={EOF:1,parseError:function(o,c){if(this.yy.parser)this.yy.parser.parseError(o,c);else throw new Error(o)},setInput:function(i,o){return this.yy=o||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},unput:function(i){var o=i.length,c=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var b=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===m.length?this.yylloc.first_column:0)+m[m.length-c.length].length-c[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[b[0],b[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
|
-
`+o+"^"},test_match:function(i,o){var c,m,b;if(this.options.backtrack_lexer&&(b={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(b.yylloc.range=this.yylloc.range.slice(0))),m=i[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],c=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var y in b)this[y]=b[y];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,c,m;this._more||(this.yytext="",this.match="");for(var b=this._currentRules(),y=0;y<b.length;y++)if(c=this._input.match(this.rules[b[y]]),c&&(!o||c[0].length>o[0].length)){if(o=c,m=y,this.options.backtrack_lexer){if(i=this.test_match(c,b[y]),i!==!1)return i;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(i=this.test_match(o,b[m]),i!==!1?i:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var o=this.next();return o||this.lex()},begin:function(o){this.conditionStack.push(o)},popState:function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},pushState:function(o){this.begin(o)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(o,c,m,b){switch(m){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}},rules:[/^(?:sankey-beta\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return p})();u.lexer=_;function g(){this.yy={}}return g.prototype=u,u.Parser=g,new g})();it.parser=it;const H=it;let X=[],Q=[],V={};const zt=()=>{X=[],Q=[],V={},L.clear()};class Bt{constructor(n,s,a=0){this.source=n,this.target=s,this.value=a}}const Vt=(t,n,s)=>{X.push(new Bt(t,n,s))};class Rt{constructor(n){this.ID=n}}const Ut=t=>(t=L.common$1.sanitizeText(t,L.getConfig()),V[t]||(V[t]=new Rt(t),Q.push(V[t])),V[t]),Wt=()=>Q,Ft=()=>X,qt=()=>({nodes:Q.map(t=>({id:t.ID})),links:X.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),Gt={nodesMap:V,getConfig:()=>L.getConfig().sankey,getNodes:Wt,getLinks:Ft,getGraph:qt,addLink:Vt,findOrCreateNode:Ut,getAccTitle:L.getAccTitle,setAccTitle:L.setAccTitle,getAccDescription:L.getAccDescription,setAccDescription:L.setAccDescription,getDiagramTitle:L.getDiagramTitle,setDiagramTitle:L.setDiagramTitle,clear:zt},gt=class st{static next(n){return new st(n+ ++st.count)}constructor(n){this.id=n,this.href=`#${n}`}toString(){return"url("+this.href+")"}};gt.count=0;let ht=gt;const Yt={left:_t,right:xt,center:vt,justify:yt},Ht=function(t,n,s,a){const{securityLevel:u,sankey:_}=L.getConfig(),g=L.defaultConfig.sankey;let p;u==="sandbox"&&(p=L.select("#i"+n));const i=u==="sandbox"?L.select(p.nodes()[0].contentDocument.body):L.select("body"),o=u==="sandbox"?i.select(`[id="${n}"]`):L.select(`[id="${n}"]`),c=(_==null?void 0:_.width)??g.width,m=(_==null?void 0:_.height)??g.width,b=(_==null?void 0:_.useMaxWidth)??g.useMaxWidth,y=(_==null?void 0:_.nodeAlignment)??g.nodeAlignment,x=(_==null?void 0:_.prefix)??g.prefix,A=(_==null?void 0:_.suffix)??g.suffix,E=(_==null?void 0:_.showValues)??g.showValues,T=a.db.getGraph(),C=Yt[y];Lt().nodeId(d=>d.id).nodeWidth(10).nodePadding(10+(E?15:0)).nodeAlign(C).extent([[0,0],[c,m]])(T);const S=pt.ordinal(mt.schemeTableau10);o.append("g").attr("class","nodes").selectAll(".node").data(T.nodes).join("g").attr("class","node").attr("id",d=>(d.uid=ht.next("node-")).id).attr("transform",function(d){return"translate("+d.x0+","+d.y0+")"}).attr("x",d=>d.x0).attr("y",d=>d.y0).append("rect").attr("height",d=>d.y1-d.y0).attr("width",d=>d.x1-d.x0).attr("fill",d=>S(d.id));const N=({id:d,value:w})=>E?`${d}
|
|
7
|
-
${x}${Math.round(w*100)/100}${A}`:d;o.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(T.nodes).join("text").attr("x",d=>d.x0<c/2?d.x1+6:d.x0-6).attr("y",d=>(d.y1+d.y0)/2).attr("dy",`${E?"0":"0.35"}em`).attr("text-anchor",d=>d.x0<c/2?"start":"end").text(N);const D=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(T.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),P=(_==null?void 0:_.linkColor)||"gradient";if(P==="gradient"){const d=D.append("linearGradient").attr("id",w=>(w.uid=ht.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",w=>w.source.x1).attr("x2",w=>w.target.x0);d.append("stop").attr("offset","0%").attr("stop-color",w=>S(w.source.id)),d.append("stop").attr("offset","100%").attr("stop-color",w=>S(w.target.id))}let I;switch(P){case"gradient":I=d=>d.uid;break;case"source":I=d=>S(d.source.id);break;case"target":I=d=>S(d.target.id);break;default:I=P}D.append("path").attr("d",jt()).attr("stroke",I).attr("stroke-width",d=>Math.max(1,d.width)),L.setupGraphViewbox$1(void 0,o,0,b)},Xt={draw:Ht},Qt=t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
|
|
8
|
-
`).trim(),Kt=H.parse.bind(H);H.parse=t=>Kt(Qt(t));const Zt={parser:H,db:Gt,renderer:Xt};exports.diagram=Zt;
|