@layers-app/editor 2.2.21 → 2.2.23

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.
Files changed (213) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +4 -3
  3. package/dist/index.js +11 -11
  4. package/dist/{layers.4Rlo7aiu.js → layers.-pZgWLbP.js} +3 -3
  5. package/dist/{layers.CGSbFcqt.js → layers.1iiJgWZO.js} +1 -1
  6. package/dist/{layers.DFmCi8NF.js → layers.303jw6zU.js} +1 -1
  7. package/dist/{layers.CxLKiKwf.js → layers.5LazKM62.js} +1 -1
  8. package/dist/{layers.Cmc6eswQ.js → layers.5V17qrtv.js} +1 -1
  9. package/dist/{layers.BOWYjv7F.js → layers.5bVLY60W.js} +1 -1
  10. package/dist/{layers.BkBbGHX8.js → layers.80moE6zJ.js} +1 -1
  11. package/dist/{layers.4Wx04F_a.js → layers.AE9ke10s.js} +1 -1
  12. package/dist/{layers.CFL3nJG5.js → layers.B-2xFIlc.js} +1 -1
  13. package/dist/{layers.CpyicZWl.js → layers.B-IKoeZd.js} +1 -1
  14. package/dist/{layers.DYCF0hg0.js → layers.B2rALZMt.js} +1 -1
  15. package/dist/{layers.C5CZfSaq.js → layers.B2vcIBLX.js} +1 -1
  16. package/dist/{layers.Coqd0Cmc.js → layers.B2wXcRG-.js} +1 -1
  17. package/dist/{layers.C1HsfBbb.js → layers.B3c8YyoG.js} +1 -1
  18. package/dist/{layers.D0ceI1ll.js → layers.B9F6b9gx.js} +1 -1
  19. package/dist/{layers.DYpr7mLq.js → layers.BBZ0R3My.js} +3 -3
  20. package/dist/layers.BCGc6DhI.js +1 -0
  21. package/dist/{layers.BHU1b_8q.js → layers.BECb1Fhb.js} +4 -4
  22. package/dist/{layers.BeJ03VGV.js → layers.BEfwP28X.js} +1 -1
  23. package/dist/{layers.Cu4QJ4rh.js → layers.BFwqfbV1.js} +1 -1
  24. package/dist/{layers.BKuwBiGd.js → layers.BGJd_rTa.js} +2 -2
  25. package/dist/{layers.CzeXVs6H.js → layers.BGlmy9rx.js} +2 -2
  26. package/dist/{layers.CvSWkMUn.js → layers.BHgvtp04.js} +1 -1
  27. package/dist/{layers.D00tDEPj.js → layers.BIDexqqq.js} +1 -1
  28. package/dist/{layers.D4J_2Ns_.js → layers.BKWbcYUB.js} +1 -1
  29. package/dist/{layers.BXqfSoxw.js → layers.BN8Ft6EZ.js} +1 -1
  30. package/dist/{layers.O3eKOG6F.js → layers.BP51oHnA.js} +3 -3
  31. package/dist/{layers.CvvgQ1cP.js → layers.BPQCUI_O.js} +1 -1
  32. package/dist/{layers.C_6dQFnr.js → layers.BPrqMNrC.js} +1 -1
  33. package/dist/{layers.CL-SYhlx.js → layers.BRmbEgM7.js} +1 -1
  34. package/dist/{layers.DPrQg1Ne.js → layers.BTlE572C.js} +2 -2
  35. package/dist/{layers.CvEsaRKA.js → layers.BUATqC34.js} +1 -1
  36. package/dist/{layers.CFOCTQK4.js → layers.BW1D5NYv.js} +1 -1
  37. package/dist/{layers.C4tXVmRG.js → layers.BXgJkKRA.js} +1 -1
  38. package/dist/{layers.zriUSv_J.js → layers.BaWkn6l7.js} +4 -4
  39. package/dist/{layers.Cc7QEce6.js → layers.Bb35f6sF.js} +1 -1
  40. package/dist/{layers.Dt3-M5h3.js → layers.BfHxiqDj.js} +1 -1
  41. package/dist/{layers.C4Ee69HG.js → layers.BnSmm6Mq.js} +1 -1
  42. package/dist/layers.BnmWLrxR.js +1 -0
  43. package/dist/{layers.DSPfLxfF.js → layers.Bno--Jch.js} +1 -1
  44. package/dist/layers.BnqBRGRW.js +6 -0
  45. package/dist/{layers.CW4lS8qs.js → layers.BodBNrG7.js} +1 -1
  46. package/dist/{layers.r4P2oTbA.js → layers.Bp8nFS79.js} +1 -1
  47. package/dist/{layers.CcaOnGRX.js → layers.BpGGiQLw.js} +1 -1
  48. package/dist/{layers.CQj5ip1H.js → layers.BqNljnoR.js} +1 -1
  49. package/dist/{layers.pJVdL6X_.js → layers.BqTGHX1X.js} +4 -4
  50. package/dist/{layers.CuD5z9zG.js → layers.BqYxxayV.js} +1 -1
  51. package/dist/{layers.XJgiPQke.js → layers.BrKmXIch.js} +1 -1
  52. package/dist/{layers.CmZQ1ncv.js → layers.BrlUnfE_.js} +1 -1
  53. package/dist/{layers.Dj4ftxSA.js → layers.BsGqRBrY.js} +1 -1
  54. package/dist/{layers.CebweuKK.js → layers.BsOvnE-H.js} +1 -1
  55. package/dist/{layers.Bs7IR3sR.js → layers.BumIfjwi.js} +1 -1
  56. package/dist/{layers.CpnlyWTj.js → layers.BvFppTS2.js} +4 -4
  57. package/dist/{layers.BDFtY7qa.js → layers.BwGnLnNn.js} +1 -1
  58. package/dist/{layers.CqICbP7f.js → layers.BzG5EW2w.js} +1 -1
  59. package/dist/{layers.BNFWWQ3P.js → layers.C0L8m1-N.js} +1 -1
  60. package/dist/{layers.BpBIvVXP.js → layers.C11VoNiU.js} +1 -1
  61. package/dist/{layers.BzC3_qmd.js → layers.C21xoTiw.js} +1 -1
  62. package/dist/{layers.Bq02QoCR.js → layers.C5KVAv5p.js} +1 -1
  63. package/dist/{layers.B-jf9j_q.js → layers.C6A71NSy.js} +1 -1
  64. package/dist/{layers.CgSMmqAz.js → layers.C7gcH7FE.js} +1 -1
  65. package/dist/{layers.CXT6TIak.js → layers.C9fCCGjU.js} +4 -4
  66. package/dist/{layers.CYf1Mx3n.js → layers.C9hwRUCg.js} +1 -1
  67. package/dist/{layers.Cs8f6Bap.js → layers.CAYcgK9X.js} +8 -8
  68. package/dist/{layers.DaKi9KeD.js → layers.CBGlqGCk.js} +2 -2
  69. package/dist/layers.CDl49PIr.js +1021 -0
  70. package/dist/{layers.AXJMsHe5.js → layers.CG44BOpx.js} +1 -1
  71. package/dist/{layers.BUx2V00W.js → layers.CGI2pHjE.js} +1 -1
  72. package/dist/{layers.v4VQ7VKK.js → layers.CGW2WoMv.js} +1 -1
  73. package/dist/{layers.BsAJCCg7.js → layers.CG_nZfg5.js} +1 -1
  74. package/dist/{layers.B-t_XXmL.js → layers.CIVrtYfC.js} +1 -1
  75. package/dist/{layers.D4fvzPjz.js → layers.CLStKcbr.js} +1 -1
  76. package/dist/{layers.yBNO0DSw.js → layers.COKdAgku.js} +3 -3
  77. package/dist/{layers.BQpG4Dl-.js → layers.CQkuZj2M.js} +3 -3
  78. package/dist/{layers.DZWZPEI9.js → layers.CSQFeEeZ.js} +7 -7
  79. package/dist/{layers.e4jeo5nw.js → layers.CTrePi13.js} +1 -1
  80. package/dist/{layers.CDtQsbno.js → layers.CUe9CZcQ.js} +1 -1
  81. package/dist/{layers.B3ZrKgla.js → layers.CV8BuUFq.js} +38384 -38011
  82. package/dist/{layers.CDb3OaEs.js → layers.CW2lZKdm.js} +1 -1
  83. package/dist/{layers.PsyTD5NB.js → layers.CWSH7Kri.js} +1 -1
  84. package/dist/{layers.D33j9TvF.js → layers.CXoX_buX.js} +1 -1
  85. package/dist/{layers.JB_vsBut.js → layers.CYA_ie6I.js} +1 -1
  86. package/dist/{layers.CBr1xT-v.js → layers.CZOnTm7o.js} +1 -1
  87. package/dist/{layers.BzRZpuFU.js → layers.CZdgPYgH.js} +1 -1
  88. package/dist/{layers.BQPCsazY.js → layers.CbgKJG2L.js} +1 -1
  89. package/dist/{layers.C92iSP5z.js → layers.CcaywdbZ.js} +1 -1
  90. package/dist/{layers.CH3OYC5h.js → layers.ChQOY7V7.js} +1 -1
  91. package/dist/{layers.DBYvfCeg.js → layers.CibQNjoO.js} +1 -1
  92. package/dist/{layers.zZ13TlWI.js → layers.Cij0xH6I.js} +1 -1
  93. package/dist/{layers.B7l2fW1q.js → layers.CjLAmjEr.js} +1 -1
  94. package/dist/{layers.BBAwGEPB.js → layers.CjehXAfL.js} +1 -1
  95. package/dist/{layers.meHN-Jep.js → layers.CjjPof9D.js} +1 -1
  96. package/dist/{layers.38netp0P.js → layers.CkYFevz2.js} +1 -1
  97. package/dist/{layers.D4yxhiCs.js → layers.CkYkmmZI.js} +1 -1
  98. package/dist/{layers.CEMKzoWc.js → layers.ClH30mCM.js} +1 -1
  99. package/dist/{layers.BRb75h3b.js → layers.ClHc4c5C.js} +1 -1
  100. package/dist/{layers.DM8yNQDs.js → layers.CmnCeX97.js} +4 -4
  101. package/dist/{layers.Bd7dnZnv.js → layers.CnttFYiP.js} +1 -1
  102. package/dist/{layers.gXrYSDtK.js → layers.Cp4rASqk.js} +1 -1
  103. package/dist/{layers.C3dW6VbW.js → layers.Cpyh3I87.js} +1 -1
  104. package/dist/{layers.2fRWyjhi.js → layers.CrrNWLGX.js} +1 -1
  105. package/dist/{layers.DG2iIC_6.js → layers.Ct3Ax4JM.js} +1 -1
  106. package/dist/{layers.FgPrgSQe.js → layers.Ctdld5P3.js} +1 -1
  107. package/dist/{layers.CZJ4QOX3.js → layers.Cu5S0yaJ.js} +3 -3
  108. package/dist/{layers.CAHzvtDu.js → layers.CuIKCJMf.js} +1 -1
  109. package/dist/{layers.99JuNWZ1.js → layers.Cw61gfIm.js} +1 -1
  110. package/dist/{layers.BsR8Yny_.js → layers.D-61zEQt.js} +1 -1
  111. package/dist/{layers.DHc7m1zn.js → layers.D274yvC5.js} +1 -1
  112. package/dist/{layers.C80C2PzO.js → layers.D2m3Bf_G.js} +1 -1
  113. package/dist/{layers.CVXI0emh.js → layers.D2oq4KZH.js} +1 -1
  114. package/dist/{layers.CZ-fw6aK.js → layers.D3CNBV_F.js} +1 -1
  115. package/dist/{layers.CIPPzDQ8.js → layers.D6pabyQK.js} +1 -1
  116. package/dist/{layers.DCNTuDoZ.js → layers.D7DIHlCT.js} +1 -1
  117. package/dist/{layers.DndYZD-T.js → layers.D7hO14mJ.js} +2 -2
  118. package/dist/{layers.AGnCsRuU.js → layers.D8nHCeQW.js} +1 -1
  119. package/dist/{layers.B2nqftPs.js → layers.D9CrMmwo.js} +1 -1
  120. package/dist/{layers.BB54c0q4.js → layers.D9jl6kRL.js} +4 -4
  121. package/dist/{layers.DHDIxFtw.js → layers.DATGYK71.js} +1 -1
  122. package/dist/{layers.C31EOq_h.js → layers.DDLQnXLv.js} +1 -1
  123. package/dist/{layers.C4I0i0xJ.js → layers.DDdYREDb.js} +1 -1
  124. package/dist/{layers.BVsgOW86.js → layers.DDhlWElS.js} +1 -1
  125. package/dist/{layers.CQu7cget.js → layers.DEKANJPm.js} +1 -1
  126. package/dist/{layers.BlAqZ0OO.js → layers.DJM3slfS.js} +1 -1
  127. package/dist/{layers.BpGI2FoR.js → layers.DJzcMd6p.js} +1 -1
  128. package/dist/{layers.D_QHdMDc.js → layers.DK3--ckm.js} +3 -3
  129. package/dist/{layers.BqjtA1gF.js → layers.DKFNA4rb.js} +1 -1
  130. package/dist/{layers.Dh5KfqV3.js → layers.DLvT6gQ1.js} +1 -1
  131. package/dist/{layers.DkokyA5Q.js → layers.DMbH6Ask.js} +1 -1
  132. package/dist/{layers.Cd1zGDLA.js → layers.DOqfKQpc.js} +5 -5
  133. package/dist/{layers.DQbJOPRI.js → layers.DQGP55au.js} +1 -1
  134. package/dist/{layers.C5ydcmWI.js → layers.DRPNtSTU.js} +1 -1
  135. package/dist/{layers.DDaOIJhr.js → layers.DRyrnGmA.js} +1 -1
  136. package/dist/{layers.C7YcNBm1.js → layers.DSQBBLug.js} +1 -1
  137. package/dist/{layers.BPCdUC1F.js → layers.DSVmQLxh.js} +1 -1
  138. package/dist/{layers.BaDN71EH.js → layers.DTcN8pQj.js} +1 -1
  139. package/dist/layers.DTj9voME.js +1 -0
  140. package/dist/{layers.PgP_VUbS.js → layers.DYBPHK7l.js} +1 -1
  141. package/dist/{layers.DJB5_LSp.js → layers.DZK749C2.js} +1 -1
  142. package/dist/{layers.CLosHMGv.js → layers.DbIltWwp.js} +1 -1
  143. package/dist/{layers.Dy4lnzwN.js → layers.DbOOCaz2.js} +1 -1
  144. package/dist/{layers.D_Xe2QS9.js → layers.DbX0rqwd.js} +4 -4
  145. package/dist/{layers.BHeuKIoS.js → layers.DcBdsZMc.js} +1 -1
  146. package/dist/{layers.DcC2k41Q.js → layers.DczSjP7Z.js} +1 -1
  147. package/dist/{layers.DpUup5rE.js → layers.DdK_Eonr.js} +1 -1
  148. package/dist/{layers.BC4Cttyc.js → layers.Dk9h7A2H.js} +1 -1
  149. package/dist/{layers.BNXta7e-.js → layers.DkZ2y88s.js} +1 -1
  150. package/dist/{layers.CzTykvY1.js → layers.DlHONqbm.js} +1 -1
  151. package/dist/{layers.B30iMHxE.js → layers.DmtA1lxX.js} +1 -1
  152. package/dist/{layers.CSFq-iOi.js → layers.DoBUNNqr.js} +1 -1
  153. package/dist/{layers.BvmrJvkb.js → layers.DrRJaIXp.js} +1 -1
  154. package/dist/{layers.D19RY98C.js → layers.DrlJyajh.js} +1 -1
  155. package/dist/{layers.BSMuWiDK.js → layers.DrxV4IOH.js} +1 -1
  156. package/dist/{layers.B7J2UJL8.js → layers.DsX_E9wz.js} +1 -1
  157. package/dist/{layers.B0kscDza.js → layers.DtQTAYqR.js} +3 -3
  158. package/dist/{layers.g3lwXMuE.js → layers.DthM8o7K.js} +5 -5
  159. package/dist/{layers.BCRB2Vl4.js → layers.Dup-WR4v.js} +1 -1
  160. package/dist/layers.Dw1JCQ9p.js +8 -0
  161. package/dist/{layers.DYqlSXDW.js → layers.DwM4UWNe.js} +1 -1
  162. package/dist/{layers.DAj2Hdxv.js → layers.Dyq4oE3u.js} +1 -1
  163. package/dist/{layers.DBedkl3F.js → layers.EfCSYazs.js} +1 -1
  164. package/dist/{layers.B-VoOGJ7.js → layers.FFyXe6z4.js} +1 -1
  165. package/dist/{layers.C31CPU0W.js → layers.FltZO6qp.js} +1 -1
  166. package/dist/{layers.DmbS56_O.js → layers.GFJuz4rb.js} +1 -1
  167. package/dist/{layers.z7rZESjE.js → layers.HegeQ-P4.js} +4 -4
  168. package/dist/{layers.CUxPaOR5.js → layers.LUuoVRak.js} +1 -1
  169. package/dist/{layers.Ck2T1Fx-.js → layers.MFxcehAN.js} +1 -1
  170. package/dist/{layers.BpT6nsEp.js → layers.MSZFpmoF.js} +1 -1
  171. package/dist/{layers.BETPq3qR.js → layers.PApLvi5E.js} +1 -1
  172. package/dist/{layers.Dm6-bFRw.js → layers.Re-Qwvas.js} +1 -1
  173. package/dist/{layers.NBZzOF6D.js → layers.RyXza-4N.js} +1 -1
  174. package/dist/{layers.CwCFkQTB.js → layers.SiAFUFZQ.js} +3 -3
  175. package/dist/{layers.DJY8WS0y.js → layers.Slg9jO18.js} +1 -1
  176. package/dist/{layers.PAwv2fkO.js → layers.WNzKEXKP.js} +1 -1
  177. package/dist/{layers.S0bwVKEo.js → layers.XEWUAZY7.js} +25 -25
  178. package/dist/{layers.CDQRPUmK.js → layers.Z3N6VKCo.js} +1 -1
  179. package/dist/{layers.CMiEZzfd.js → layers.aDMznPYN.js} +1 -1
  180. package/dist/{layers.Cj2oUf6q.js → layers.akhIY05g.js} +1 -1
  181. package/dist/{layers.BU4r-bDv.js → layers.bLjrmZDL.js} +6 -6
  182. package/dist/{layers.D_E_Kc96.js → layers.cGz39YHH.js} +1 -1
  183. package/dist/{layers.DSHWI91l.js → layers.cQtbmzr5.js} +1 -1
  184. package/dist/{layers.CBUeSYR6.js → layers.dLR82NXh.js} +1 -1
  185. package/dist/{layers.CsO2ftX5.js → layers.fylJTlmA.js} +1 -1
  186. package/dist/{layers.6cjoiz2W.js → layers.ioeV_8l8.js} +1 -1
  187. package/dist/{layers.Dq5zy6bE.js → layers.kerWpkns.js} +1 -1
  188. package/dist/{layers.JycQDBPR.js → layers.l1tMLbxO.js} +2 -2
  189. package/dist/{layers.BMQ2GCxI.js → layers.lSugZ2wN.js} +1 -1
  190. package/dist/{layers.DDQ11qGZ.js → layers.nZSIaS9j.js} +1 -1
  191. package/dist/{layers.d7xa1SM2.js → layers.nxWcP_cN.js} +1 -1
  192. package/dist/{layers.CkhXLjFB.js → layers.ocXiL6iA.js} +1 -1
  193. package/dist/{layers.rNX8_vfT.js → layers.oygdBfvT.js} +1 -1
  194. package/dist/{layers.ClQiuxJ3.js → layers.pCeD5WJi.js} +1 -1
  195. package/dist/{layers.yWuXA0n3.js → layers.r-J41ZpO.js} +1 -1
  196. package/dist/{layers.uWp6ndSe.js → layers.rEr11GDY.js} +1 -1
  197. package/dist/{layers.4mmjAxqQ.js → layers.sH9b5ZDp.js} +4 -4
  198. package/dist/{layers.CNq8JZbo.js → layers.tsvLhDct.js} +1 -1
  199. package/dist/{layers.CJMOCItJ.js → layers.ud0o393C.js} +3 -3
  200. package/dist/{layers.2OYX1Vp4.js → layers.vVtmFRDs.js} +1 -1
  201. package/dist/{layers.DdVPx6hl.js → layers.wLMWH0Zr.js} +4 -4
  202. package/dist/{layers.g3Beq7S5.js → layers.xprriLng.js} +1 -1
  203. package/dist/{layers.DZibrJ8k.js → layers.y8wgDE2H.js} +1 -1
  204. package/dist/layers.yNJ_hHNP.js +702 -0
  205. package/dist/{layers.TGudOLYA.js → layers.yyS8kCbd.js} +1 -1
  206. package/package.json +80 -80
  207. package/dist/layers.B8Tx9pBQ.js +0 -904
  208. package/dist/layers.BTVeP4qu.js +0 -1
  209. package/dist/layers.Cg0qq1SE.js +0 -952
  210. package/dist/layers.Ch6gFG1a.js +0 -1
  211. package/dist/layers.DT2FZdJ1.js +0 -8
  212. package/dist/layers.DYZtGZLm.js +0 -1
  213. package/dist/layers.Dn_hZrvQ.js +0 -6
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),U=require("react-i18next"),A=require("@lexical/react/LexicalComposerContext"),x=require("@mantine/core"),L=require("lexical"),n=require("./layers.B8Tx9pBQ.js"),_=require("@layers-app/shared"),re=require("@lexical/react/useLexicalEditable"),P=require("@mantine/hooks");require("@lexical/react/LexicalDecoratorBlockNode");require("@lexical/utils");require("@lexical/mark");require("@lexical/code");require("@lexical/selection");require("@lexical/react/LexicalBlockWithAlignableContents");require("@mantine/notifications");function ae(t,i){const o=document.createElement("a");o.href=t,o.download=i,o.rel="noopener",document.body.appendChild(o),o.click(),o.remove()}function q(t){try{const o=new URL(t,window.location.origin).pathname.split("/").pop()||"image";return o.includes(".")?o:`${o}.png`}catch{return"image"}}async function F(t,i){const o=await fetch(t);if(!o.ok)throw new Error("fetch failed");const a=await o.blob(),s=URL.createObjectURL(a);try{ae(s,i)}finally{setTimeout(()=>URL.revokeObjectURL(s),0)}}function se({editor:t,nodeKey:i,href:o,onClose:a}){const[s,d]=r.useState(()=>n.getLinkTypeFromUrl(o)),[c,g]=r.useState(()=>n.removeProtocol(o)),[f,w]=r.useState(!1),p=r.useCallback(m=>{d(m),w(!1)},[]),b=r.useCallback(m=>{g(m),w(!1)},[]),k=r.useCallback(()=>{const m=n.addProtocolIfNeeded(c.trim(),s);if(!m||!n.isValidUrl(m,s)){w(!0);return}n.$writeImageLinkToNode(t,i,n.sanitizeUrl(m)),a()},[t,i,c,s,a]),v=r.useCallback(()=>{n.$writeImageLinkToNode(t,i,""),a()},[t,i,a]),h=r.useCallback(m=>{m.key==="Enter"?(m.preventDefault(),k()):m.key==="Escape"&&(m.preventDefault(),a())},[k,a]);return{linkType:s,linkUrl:c,error:f,onLinkTypeChange:p,onUrlInputChange:b,onUrlInputKeyDown:h,onSave:k,onRemove:v}}function W({editor:t,nodeKey:i,href:o,onClose:a,mobile:s}){const d=r.useRef(null),c=se({editor:t,nodeKey:i,href:o,onClose:a});return r.useEffect(()=>{var g;(g=d.current)==null||g.focus({preventScroll:!0})},[]),e.jsx(n.CreateMode,{inputRef:d,linkUrl:c.linkUrl,linkType:c.linkType,error:c.error,mobile:s,onLinkTypeChange:c.onLinkTypeChange,onUrlInputChange:c.onUrlInputChange,onUrlInputKeyDown:c.onUrlInputKeyDown,onCancel:a,onSave:c.onSave,onRemove:o?c.onRemove:void 0})}function J({opened:t,onOpenChange:i,t:o,onDownload:a,onDelete:s,hasLink:d,onLinkAction:c}){return e.jsxs(x.Menu,{opened:t,onChange:i,transitionProps:n.animationMenu,shadow:"md",position:"bottom-start",offset:4,withinPortal:!0,closeOnItemClick:!0,children:[e.jsx(x.Menu.Target,{children:e.jsx(n.ActionIcon,{label:o("editor.toolbar.more"),icon:n.K1,iconColor:"var(--mantine-color-gray-text)","aria-label":o("editor.toolbar.more")})}),e.jsxs(x.Menu.Dropdown,{p:4,miw:164,w:"max-content",onMouseDown:g=>g.preventDefault(),children:[c&&e.jsx(x.Menu.Item,{leftSection:e.jsx(x.Flex,{align:"center",justify:"center",c:"gray.6",children:e.jsx(n.Icon,{name:"link",size:16})}),onClick:g=>{g.stopPropagation(),c()},children:o(d?"editor.link.editLink":"editor.link.addLink")}),e.jsx(x.Menu.Item,{leftSection:e.jsx(x.Flex,{align:"center",justify:"center",c:"gray.6",children:e.jsx(n.HugeiconsIcon,{icon:n.Tm,size:16})}),onClick:g=>{g.stopPropagation(),a()},children:o("editor.gallery.download")}),e.jsx(x.Menu.Item,{color:"red",leftSection:e.jsx(x.Flex,{align:"center",justify:"center",c:"red.6",children:e.jsx(n.HugeiconsIcon,{icon:n.lg,size:16})}),onClick:g=>{g.stopPropagation(),s()},children:o("editor.contextMenu.delete")})]})]})}const Q=({t,src:i,setShown:o,id:a})=>{const[s,{open:d,close:c}]=P.useDisclosure(!1),g=r.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]),f=w=>{w?d():c()};return e.jsxs(e.Fragment,{children:[e.jsx(_.AttachmentsGalleryModal,{opened:s,onOpenChange:f,attachments:g}),e.jsx(n.ActionIcon,{label:t("editor.image.preview"),icon:n.gn,iconColor:"var(--mantine-color-gray-text)","aria-label":t("editor.image.preview"),onClick:()=>{o(!1),d()}})]})},le=({nodeKey:t,src:i,href:o})=>{const[a]=A.useLexicalComposerContext(),s=re.useLexicalEditable(),[d,c]=r.useState(!1),[g,f]=r.useState(!1),[w,p]=r.useState(!1),{t:b}=U.useTranslation();r.useEffect(()=>{if(!w)return;const h=m=>{const u=m.target;u!=null&&u.closest(".floating-link-dropdown")||u!=null&&u.closest(".floating-link-type-combobox-dropdown")||p(!1)};return document.addEventListener("pointerdown",h,!0),()=>document.removeEventListener("pointerdown",h,!0)},[w]);const k=r.useCallback(()=>{a.update(()=>{const h=L.$getNodeByKey(t);n.$isImageNode(h)&&h.remove()})},[a,t]),v=r.useCallback(async()=>{if(i)try{await F(i,q(i))}catch{}},[i]);return e.jsxs(x.Popover,{opened:w,onChange:p,position:"bottom-end",offset:4,shadow:"md",radius:"md",withinPortal:!0,closeOnClickOutside:!1,children:[e.jsx(x.Popover.Target,{children:e.jsxs("div",{className:`media-actions ${s?"":"media-actions--readonly"}`,children:[e.jsx(Q,{t:b,src:i,setShown:()=>{}}),s&&e.jsxs(e.Fragment,{children:[e.jsx(n.NodeAlignmentMenu,{opened:d,setOpened:c,t:b,editor:a,nodeKey:t,setShown:()=>{}}),e.jsx(J,{opened:g,onOpenChange:f,t:b,onDownload:()=>void v(),onDelete:k,hasLink:!!o,onLinkAction:()=>p(!0)})]})]})}),e.jsx(x.Popover.Dropdown,{className:`floating-link-dropdown floating-link-dropdown--${o?"edit":"create"}-mode`,"data-test-id":"floating-link-dropdown",children:e.jsx(W,{editor:a,nodeKey:t,href:o,onClose:()=>p(!1)})})]})},ce=()=>{};function de({nodeKey:t,src:i,id:o,href:a}){const{t:s}=U.useTranslation(),[d]=A.useLexicalComposerContext(),[c,g]=r.useState(!1),[f,w]=r.useState(!1),[p,b]=r.useState(!1);r.useEffect(()=>{if(!p)return;const h=m=>{const u=m.target;u!=null&&u.closest(".floating-link-dropdown")||u!=null&&u.closest(".floating-link-type-combobox-dropdown")||b(!1)};return document.addEventListener("pointerdown",h,!0),()=>document.removeEventListener("pointerdown",h,!0)},[p]);const k=r.useCallback(()=>{w(!1),d.update(()=>{const h=L.$getNodeByKey(t);if(!n.$isImageNode(h))return;const m=h.getParent();n.$isImageOverlayWrapperNode(m)?m.remove():h.remove()})},[d,t]),v=r.useCallback(async()=>{if(i)try{await F(i,q(i))}catch{}},[i]);return e.jsxs(x.Popover,{opened:p,onChange:b,position:"bottom-end",offset:4,shadow:"md",radius:"md",withinPortal:!0,closeOnClickOutside:!1,children:[e.jsx(x.Popover.Target,{children:e.jsxs("div",{className:"media-actions visible",style:{position:"absolute",top:10,right:10,zIndex:10,pointerEvents:"auto",display:"flex",gap:4},onClick:h=>h.stopPropagation(),children:[e.jsx(Q,{t:s,src:i,setShown:ce,id:o}),e.jsx(n.NodeAlignmentMenu,{opened:c,setOpened:g,t:s,editor:d,nodeKey:t}),e.jsx(J,{opened:f,onOpenChange:w,t:s,onDownload:()=>void v(),onDelete:k,hasLink:!!a,onLinkAction:()=>b(!0)})]})}),e.jsx(x.Popover.Dropdown,{className:`floating-link-dropdown floating-link-dropdown--${a?"edit":"create"}-mode`,"data-test-id":"floating-link-dropdown",children:e.jsx(W,{editor:d,nodeKey:t,href:a,onClose:()=>b(!1)})})]})}function ue({nodeKey:t,src:i,id:o,href:a}){const{t:s}=U.useTranslation(),[d]=A.useLexicalComposerContext(),[c,{open:g,close:f}]=P.useDisclosure(!1),[w,{open:p,close:b}]=P.useDisclosure(!1),[k,{open:v,close:h}]=P.useDisclosure(!1),m=()=>{f(),v()},u=r.useMemo(()=>[{id:!o||o==="0"?"":o,Url:i??"",contentType:"",originalFileName:"",fileSize:0,storageType:"",storagePath:"",fileName:"",parentType:"",parentId:"",ownerId:"",createdAt:new Date,updatedAt:new Date,version:0,deleted:!1,deletedAt:new Date}],[i,o]),S=()=>{f(),p()},N=r.useCallback(async()=>{if(f(),!!i)try{await F(i,q(i))}catch{}},[i,f]),y=r.useCallback(()=>{f(),d.update(()=>{const D=L.$getNodeByKey(t);n.$isImageNode(D)&&D.remove()})},[d,t,f]);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"image-touch-actions",style:{position:"absolute",top:8,right:8,zIndex:10,pointerEvents:"auto"},onClick:D=>D.stopPropagation(),children:e.jsx(n.ActionIcon,{label:s("editor.toolbar.more"),icon:n.O1,iconColor:"var(--mantine-color-gray-text)","aria-label":s("editor.toolbar.more"),onClick:g})}),e.jsx(_.AttachmentsGalleryModal,{opened:w,onOpenChange:D=>D?p():b(),attachments:u}),e.jsx(n.MobileDrawer,{opened:c,onClose:f,title:s("editor.image.mobileActions"),children:e.jsxs(x.Stack,{gap:4,p:0,children:[e.jsx(x.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:S,leftSection:e.jsx(n.HugeiconsIcon,{icon:n.gn,size:16,color:"var(--mantine-color-dimmed)"}),children:s("editor.image.previewFullScreen")}),e.jsx(x.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:m,leftSection:e.jsx(n.HugeiconsIcon,{icon:n.zz,size:16,color:"var(--mantine-color-dimmed)"}),children:s(a?"editor.link.editLink":"editor.link.addLink")}),e.jsx(x.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:()=>void N(),leftSection:e.jsx(n.HugeiconsIcon,{icon:n.Tm,size:16,color:"var(--mantine-color-dimmed)"}),children:s("editor.gallery.download")}),e.jsx(x.Button,{type:"button",variant:"subtle",color:"red",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:y,leftSection:e.jsx(n.HugeiconsIcon,{icon:n.lg,size:16,color:"var(--mantine-color-red-6)"}),children:s("editor.actions.delete")})]})}),e.jsx(n.MobileDrawer,{opened:k,onClose:h,title:s(a?"editor.link.editLink":"editor.link.addLink"),children:e.jsx(W,{editor:d,nodeKey:t,href:a,onClose:h,mobile:!0})})]})}const Z=t=>{const{width:i,height:o,isLoading:a,isError:s,src:d,id:c,altText:g,imageRef:f,maxWidth:w,href:p}=t,b=r.useRef(null);return e.jsxs("div",{className:"media-wrapper",style:{width:i,height:o,display:"inline-flex",position:"relative"},children:[e.jsx(x.LoadingOverlay,{visible:a,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),e.jsx("a",{className:"editor-image-link","data-link":p?"true":void 0,"data-href":p?n.sanitizeUrl(p):void 0,role:p?"link":void 0,rel:p?"noopener noreferrer":void 0,draggable:!1,onMouseDown:p?k=>{b.current={x:k.clientX,y:k.clientY}}:void 0,onClick:p?k=>{k.preventDefault();const v=b.current;b.current=null,!(v&&Math.hypot(k.clientX-v.x,k.clientY-v.y)>5)&&window.open(n.sanitizeUrl(p),"_blank","noopener,noreferrer")}:void 0,children:e.jsx(ge,{className:null,src:d,altText:g,imageRef:f,width:"inherit",height:"inherit",maxWidth:w||"auto",id:c})}),n.IS_TOUCH_DEVICE&&e.jsx(ue,{nodeKey:t.nodeKey,src:d,id:c,href:p}),n.IS_TOUCH_TABLET&&e.jsx(de,{nodeKey:t.nodeKey,src:d,id:c,href:p}),n.IS_HOVER_CAPABLE&&!n.IS_TOUCH_DEVICE&&!n.IS_TOUCH_TABLET&&e.jsx(le,{nodeKey:t.nodeKey,src:d,href:p})]})};function ge({altText:t,className:i,imageRef:o,src:a,width:s,height:d,maxWidth:c,id:g}){const[f,w]=r.useState(!1);return e.jsx("img",{className:`${i||void 0} ${f?"":"loading"}`,src:a,alt:t,ref:o,style:{height:d,maxWidth:c,width:s},onLoad:()=>{a.includes("splash")?setTimeout(()=>{w(!0)},100):w(!0)},draggable:"false","data-id":g})}function pe(t){const{disable:i}=r.useContext(n.Context);return i&&n.ImageNode.isPlaceholderSrc(t.src)?null:e.jsx(me,{...t})}function me({src:t,altText:i,nodeKey:o,width:a,height:s,maxWidth:d,showCaption:c,caption:g,id:f,create:w,alignment:p,imagePickerTab:b,href:k}){var X,Y;const v=r.useRef(null),[h,m]=r.useState(!0),[u]=A.useLexicalComposerContext(),[S,N]=r.useState(!0),[y,D]=r.useState({width:0,height:0}),{start:H}=n.useCancelUpload(),[fe,z]=r.useState(0),{fetchUploadMedia:T,fetchDeleteMedia:B,maxFileSize:he,imperativeHandleRef:E,disable:K}=r.useContext(n.Context),O=n.mediaMap.has(t)&&(((X=n.mediaMap.get(t))==null?void 0:X.mediaNodeKeys.length)===0||((Y=n.mediaMap.get(t))==null?void 0:Y.mediaNodeKeys.length)===void 0||t.trim()===""),{t:M}=U.useTranslation(),[xe,ee]=r.useState(0);r.useEffect(()=>u.registerDecoratorListener(()=>{ee(l=>l+1)}),[O]),r.useEffect(()=>{if(!t||t.startsWith("data:image/")||!t.trim()){m(!1);return}const l=new Image;l.src=t,l.onload=()=>m(!1),l.onerror=()=>{m(!1)}},[t,O]);const te=(l,I)=>{u.update(()=>{L.$setSelection(null);const C=L.$getNodeByKey(o);n.$isImageNode(C)&&C.setWidthAndHeight(l,I)})},{historyState:V}=n.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:G}}=n.useSettings();function ne(l){return l.endsWith(".svg")||l.includes("image/svg+xml")}function oe(l){return new Promise((I,C)=>{if(ne(l)){I(0);return}const j=new Image;j.src=l,j.onload=()=>{I(j.width)},j.onerror=()=>{C(new Error("Failed to load image"))}})}r.useEffect(()=>{let l=a,I=s,C=100;(t.includes("unsplash")?t.trim():!O&&t.trim()||t.includes("upload-src-editor"))&&t!=="upload"&&oe(t).then(j=>{typeof l=="number"&&l<C&&j<C?(N(!0),D({width:l,height:I})):j<C?(N(!0),D({width:"auto",height:"auto"})):(D({width:j,height:j}),N(!1))}).catch(j=>{console.warn("Ошибка при загрузке изображения:",j.message)})},[t,O]),r.useEffect(()=>{y.width&&y.height&&S&&u.update(()=>{const l=L.$getNodeByKey(o);n.$isImageNode(l)&&l.setWidthAndHeight(y.width,y.height)})},[y.width,y.height,S]);const ie=r.useCallback(l=>n.$writeImagePickerTabToNode(u,o,l),[u,o]),R=r.useCallback((l,I)=>{m(!1),u.update(()=>{const C=L.$getNodeByKey(o);n.$isImageNode(C)&&(C.setSrc(l),C.setId(I))})},[u,o]),$=r.useCallback(l=>{m(!0);const I=H();T&&T(l[0],(C,j)=>{R(C,j),z(0)},C=>{C&&_.showErrorNotification({message:M("editor.gallery.errorFile")}),z(0),R("","")},I,C=>{z(C)})},[T,H,M,R]);return r.useEffect(()=>u.registerCommand(n.UPLOAD_IMAGE_COMMAND,l=>t!=="upload"||l.targetNodeKey!==o?!1:($(l.files),!0),L.COMMAND_PRIORITY_LOW),[u,$,o,t]),!t||t==="upload"?e.jsx(x.Box,{"data-editor-image-picker-drop-root":!0,w:"100%",children:e.jsx(n.ImagePicker,{inline:!0,nodeKey:o,defaultTabValue:b,onWriteTabToNode:ie,uploading:!1,onUpload:l=>{!T||!l.length||$(l)},popoverProps:{opened:!0,position:"bottom",zIndex:n.EDITOR_UI_MIN_Z_INDEX},onChange:l=>{u.update(()=>{const I=L.$getNodeByKey(o);n.$isImageNode(I)&&I.setSrc(l)})}})}):S?e.jsx(Z,{width:y.width,height:y.height,isLoading:h,isError:!1,isIcon:S,src:t,id:f,editor:u,nodeKey:o,fetchDeleteMedia:B,altText:i,imageRef:v,maxWidth:d,showCaption:c,caption:g,isCollabActive:!1,historyState:V,showNestedEditorTreeView:G,t:M,href:k}):e.jsx(n.ResizableContainer,{editor:u,isIcon:S,width:n.parseContainerSize(a),height:n.parseContainerSize(s),initialWidth:y.width||"",initialHeight:y.height||"",onResizeEnd:te,alignment:p,disable:K,onRegisterDecoratorEnter:l=>{E!=null&&E.current&&(E.current.decoratorEnterAction=l)},onActivate:()=>u.dispatchCommand(n.ON_CHANGE_COMMAND,"show_menu"),children:e.jsx(Z,{width:"inherit",height:"inherit",isLoading:h,isError:!1,isIcon:S,src:t,id:f,editor:u,nodeKey:o,fetchDeleteMedia:B,altText:i,imageRef:v,maxWidth:d,showCaption:c,caption:g,isCollabActive:!1,historyState:V,showNestedEditorTreeView:G,t:M,href:k})})}exports.default=pe;
@@ -1,8 +0,0 @@
1
- import { C as e, Q as t, N as m, A as r } from "./layers.v4VQ7VKK.js";
2
- import "./layers.Cs8f6Bap.js";
3
- export {
4
- e as Commands,
5
- t as subsetToBase64,
6
- m as subsetToBinary,
7
- r as toBase64
8
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.AGnCsRuU.js");require("./layers.DZWZPEI9.js");exports.Commands=e.CB;exports.subsetToBase64=e.QB;exports.subsetToBinary=e.NQ;exports.toBase64=e.AI;
@@ -1,6 +0,0 @@
1
- import { e as o, j as s, o as f } from "./layers.Cs8f6Bap.js";
2
- export {
3
- o as default,
4
- s as en,
5
- f as kaa
6
- };