@layers-app/editor 2.2.21 → 2.2.22

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 +1 -1
  3. package/dist/index.js +11 -11
  4. package/dist/{layers.B3ZrKgla.js → layers.0_o7xyFB.js} +35839 -35861
  5. package/dist/{layers.TGudOLYA.js → layers.46GY3mh_.js} +1 -1
  6. package/dist/{layers.PgP_VUbS.js → layers.5k4kp1K9.js} +1 -1
  7. package/dist/{layers.BQPCsazY.js → layers.6szP7wNE.js} +1 -1
  8. package/dist/layers.8FdK9LMJ.js +6 -0
  9. package/dist/{layers.BaDN71EH.js → layers.8un-7X4h.js} +1 -1
  10. package/dist/{layers.DYCF0hg0.js → layers.A3TBCQ6E.js} +1 -1
  11. package/dist/{layers.CSFq-iOi.js → layers.AV_6LgdT.js} +1 -1
  12. package/dist/{layers.Dq5zy6bE.js → layers.B0F9vx_F.js} +1 -1
  13. package/dist/{layers.XJgiPQke.js → layers.B0ToPjF1.js} +1 -1
  14. package/dist/{layers.CmZQ1ncv.js → layers.B2GIc3En.js} +1 -1
  15. package/dist/{layers.C1HsfBbb.js → layers.B2bspQy6.js} +1 -1
  16. package/dist/{layers.D_Xe2QS9.js → layers.B32NgnPu.js} +4 -4
  17. package/dist/{layers.d7xa1SM2.js → layers.B3YVD67D.js} +1 -1
  18. package/dist/{layers.NBZzOF6D.js → layers.B3kATuHh.js} +1 -1
  19. package/dist/{layers.CDtQsbno.js → layers.B5Gj1Ue7.js} +1 -1
  20. package/dist/{layers.CebweuKK.js → layers.B5bLFKhh.js} +1 -1
  21. package/dist/{layers.D0ceI1ll.js → layers.B63y0Rpn.js} +1 -1
  22. package/dist/{layers.BsAJCCg7.js → layers.B7-uOQaL.js} +1 -1
  23. package/dist/{layers.BOWYjv7F.js → layers.B9ZtxZKD.js} +1 -1
  24. package/dist/{layers.2OYX1Vp4.js → layers.BBfhnLOa.js} +1 -1
  25. package/dist/layers.BBin4uXC.js +1 -0
  26. package/dist/{layers.CsO2ftX5.js → layers.BCu5Aujs.js} +1 -1
  27. package/dist/{layers.DZWZPEI9.js → layers.BENyixGk.js} +7 -7
  28. package/dist/{layers.JB_vsBut.js → layers.BEhg58AG.js} +1 -1
  29. package/dist/{layers.BkBbGHX8.js → layers.BEmJ1cvD.js} +1 -1
  30. package/dist/{layers.CNq8JZbo.js → layers.BIG3joYZ.js} +1 -1
  31. package/dist/{layers.D_QHdMDc.js → layers.BIz6anSR.js} +3 -3
  32. package/dist/{layers.D4J_2Ns_.js → layers.BK2hXhTr.js} +1 -1
  33. package/dist/{layers.D19RY98C.js → layers.BL5-YOdb.js} +1 -1
  34. package/dist/layers.BMHe7FVH.js +1 -0
  35. package/dist/{layers.C7YcNBm1.js → layers.BNfpljMH.js} +1 -1
  36. package/dist/{layers.BsR8Yny_.js → layers.BOqcQSvT.js} +1 -1
  37. package/dist/{layers.BHeuKIoS.js → layers.BPhlKQ1n.js} +1 -1
  38. package/dist/{layers.PAwv2fkO.js → layers.BQT_UW8f.js} +1 -1
  39. package/dist/{layers.DkokyA5Q.js → layers.BU5vikd4.js} +1 -1
  40. package/dist/{layers.CwCFkQTB.js → layers.BUHDbScM.js} +3 -3
  41. package/dist/{layers.4mmjAxqQ.js → layers.BUx-KQN_.js} +4 -4
  42. package/dist/{layers.Dy4lnzwN.js → layers.BV2DfFDz.js} +1 -1
  43. package/dist/{layers.DdVPx6hl.js → layers.BVqCJpzk.js} +4 -4
  44. package/dist/{layers.Dh5KfqV3.js → layers.BYTQeRxM.js} +1 -1
  45. package/dist/{layers.Cd1zGDLA.js → layers.BYlILlAo.js} +5 -5
  46. package/dist/{layers.CJMOCItJ.js → layers.B_H13cp_.js} +3 -3
  47. package/dist/{layers.pJVdL6X_.js → layers.BcDoHGQQ.js} +4 -4
  48. package/dist/{layers.CDb3OaEs.js → layers.BcMFUrsO.js} +1 -1
  49. package/dist/{layers.CQj5ip1H.js → layers.BcYnshZx.js} +1 -1
  50. package/dist/{layers.yBNO0DSw.js → layers.BdvKi5m2.js} +3 -3
  51. package/dist/{layers.yWuXA0n3.js → layers.BeB6nS-_.js} +1 -1
  52. package/dist/{layers.BQpG4Dl-.js → layers.Beu7hD93.js} +3 -3
  53. package/dist/{layers.DSHWI91l.js → layers.BfG2tfZn.js} +1 -1
  54. package/dist/layers.BgetbX1j.js +907 -0
  55. package/dist/{layers.CLosHMGv.js → layers.BhTzgvsL.js} +1 -1
  56. package/dist/{layers.C31EOq_h.js → layers.BiDTOYk_.js} +1 -1
  57. package/dist/{layers.Coqd0Cmc.js → layers.Bj6R7X3_.js} +1 -1
  58. package/dist/{layers.Ck2T1Fx-.js → layers.BjnNYmXq.js} +1 -1
  59. package/dist/{layers.CQu7cget.js → layers.BndFZ10A.js} +1 -1
  60. package/dist/{layers.zriUSv_J.js → layers.BnzemMDf.js} +4 -4
  61. package/dist/{layers.BPCdUC1F.js → layers.BvEEOMd2.js} +1 -1
  62. package/dist/{layers.zZ13TlWI.js → layers.BwbFeMWp.js} +1 -1
  63. package/dist/{layers.4Wx04F_a.js → layers.C-jjNwxe.js} +1 -1
  64. package/dist/{layers.CYf1Mx3n.js → layers.C0D2yoIm.js} +1 -1
  65. package/dist/{layers.BUx2V00W.js → layers.C3ionHGC.js} +1 -1
  66. package/dist/{layers.CUxPaOR5.js → layers.C9ylx_8s.js} +1 -1
  67. package/dist/{layers.meHN-Jep.js → layers.CBDrbvx3.js} +1 -1
  68. package/dist/{layers.BpT6nsEp.js → layers.CCCg9AB6.js} +1 -1
  69. package/dist/{layers.CpyicZWl.js → layers.CFSSdZIo.js} +1 -1
  70. package/dist/{layers.B-jf9j_q.js → layers.CGpkaxva.js} +1 -1
  71. package/dist/{layers.CuD5z9zG.js → layers.CI-npuwG.js} +1 -1
  72. package/dist/{layers.D4fvzPjz.js → layers.CJm6d8s4.js} +1 -1
  73. package/dist/{layers.C4I0i0xJ.js → layers.CM0RmSee.js} +1 -1
  74. package/dist/{layers.B7l2fW1q.js → layers.CMGavDUZ.js} +1 -1
  75. package/dist/{layers.CBr1xT-v.js → layers.CNLeU1dW.js} +1 -1
  76. package/dist/{layers.CZJ4QOX3.js → layers.CPRqBd5z.js} +3 -3
  77. package/dist/{layers.6cjoiz2W.js → layers.CPd7fh0F.js} +1 -1
  78. package/dist/{layers.Cu4QJ4rh.js → layers.CPjId6bM.js} +1 -1
  79. package/dist/{layers.C5CZfSaq.js → layers.CQpWcfwf.js} +1 -1
  80. package/dist/{layers.BNFWWQ3P.js → layers.CSQAIyOl.js} +1 -1
  81. package/dist/{layers.CGSbFcqt.js → layers.CWLwAnjN.js} +1 -1
  82. package/dist/{layers.B2nqftPs.js → layers.C_CamJj8.js} +1 -1
  83. package/dist/{layers.CW4lS8qs.js → layers.CaMnfmf4.js} +1 -1
  84. package/dist/{layers.DJB5_LSp.js → layers.CbD4AjjB.js} +1 -1
  85. package/dist/{layers.DBYvfCeg.js → layers.CbbykYL6.js} +1 -1
  86. package/dist/{layers.B0kscDza.js → layers.Cc0bK4Jx.js} +3 -3
  87. package/dist/{layers.DaKi9KeD.js → layers.CeghDZ5z.js} +2 -2
  88. package/dist/{layers.CH3OYC5h.js → layers.CgevOfiO.js} +1 -1
  89. package/dist/{layers.C4tXVmRG.js → layers.ChBsXB-p.js} +1 -1
  90. package/dist/{layers.C4Ee69HG.js → layers.Chij3QIH.js} +1 -1
  91. package/dist/{layers.CMiEZzfd.js → layers.CiOgdFrF.js} +1 -1
  92. package/dist/layers.Cjh9rgCs.js +702 -0
  93. package/dist/{layers.BB54c0q4.js → layers.CnLBpo7l.js} +4 -4
  94. package/dist/{layers.99JuNWZ1.js → layers.CoCdaAtg.js} +1 -1
  95. package/dist/{layers.CvvgQ1cP.js → layers.CoX17XV_.js} +1 -1
  96. package/dist/{layers.S0bwVKEo.js → layers.CpfZ5k-c.js} +25 -25
  97. package/dist/{layers.DHDIxFtw.js → layers.CrkOioIF.js} +1 -1
  98. package/dist/{layers.DZibrJ8k.js → layers.CtgqI59U.js} +1 -1
  99. package/dist/{layers.2fRWyjhi.js → layers.CucXAsor.js} +1 -1
  100. package/dist/{layers.PsyTD5NB.js → layers.CwDuD40M.js} +1 -1
  101. package/dist/{layers.AGnCsRuU.js → layers.CwiM9Q56.js} +1 -1
  102. package/dist/{layers.BSMuWiDK.js → layers.CzowIX7V.js} +1 -1
  103. package/dist/{layers.C80C2PzO.js → layers.D-WKQteE.js} +1 -1
  104. package/dist/{layers.DCNTuDoZ.js → layers.D-pjbwMg.js} +1 -1
  105. package/dist/{layers.Cs8f6Bap.js → layers.D-vM7CY8.js} +8 -8
  106. package/dist/{layers.BzRZpuFU.js → layers.D-y15iMe.js} +1 -1
  107. package/dist/{layers.Dj4ftxSA.js → layers.D0kytx50.js} +1 -1
  108. package/dist/{layers.BMQ2GCxI.js → layers.D1OQ4q92.js} +1 -1
  109. package/dist/{layers.DYpr7mLq.js → layers.D2rMgNQf.js} +3 -3
  110. package/dist/{layers.CpnlyWTj.js → layers.D31iEZFD.js} +4 -4
  111. package/dist/{layers.D33j9TvF.js → layers.D3Kbm5xt.js} +1 -1
  112. package/dist/{layers.CzeXVs6H.js → layers.D4caPv6c.js} +2 -2
  113. package/dist/{layers.DJY8WS0y.js → layers.D6ccqhvx.js} +1 -1
  114. package/dist/{layers.BU4r-bDv.js → layers.D7iqRuaR.js} +6 -6
  115. package/dist/{layers.BlAqZ0OO.js → layers.D8rQMbK_.js} +1 -1
  116. package/dist/{layers.CkhXLjFB.js → layers.DBh6j3jA.js} +1 -1
  117. package/dist/{layers.B7J2UJL8.js → layers.DCa5gchg.js} +1 -1
  118. package/dist/{layers.CL-SYhlx.js → layers.DEL0A8T6.js} +1 -1
  119. package/dist/{layers.BzC3_qmd.js → layers.DEMOp1ku.js} +1 -1
  120. package/dist/{layers.Bd7dnZnv.js → layers.DIGkuEI4.js} +1 -1
  121. package/dist/{layers.DpUup5rE.js → layers.DJ0z2vMP.js} +1 -1
  122. package/dist/{layers.CvSWkMUn.js → layers.DMby8wC2.js} +1 -1
  123. package/dist/{layers.BETPq3qR.js → layers.DMjBTphM.js} +1 -1
  124. package/dist/{layers.CqICbP7f.js → layers.DMliVl73.js} +1 -1
  125. package/dist/{layers.DFmCi8NF.js → layers.DOwVCT3y.js} +1 -1
  126. package/dist/{layers.BBAwGEPB.js → layers.DPQUF5pK.js} +1 -1
  127. package/dist/{layers.BpGI2FoR.js → layers.DQAvpZ0O.js} +1 -1
  128. package/dist/{layers.BvmrJvkb.js → layers.DRU3_G6o.js} +1 -1
  129. package/dist/{layers.DBedkl3F.js → layers.DTLpDoJM.js} +1 -1
  130. package/dist/{layers.C5ydcmWI.js → layers.DTZf5wR5.js} +1 -1
  131. package/dist/{layers.CZ-fw6aK.js → layers.DTjUi5Le.js} +1 -1
  132. package/dist/{layers.BVsgOW86.js → layers.DV1jaZ1i.js} +1 -1
  133. package/dist/{layers.BXqfSoxw.js → layers.DX62t_IW.js} +1 -1
  134. package/dist/{layers.BqjtA1gF.js → layers.DXE6q31f.js} +1 -1
  135. package/dist/{layers.Dm6-bFRw.js → layers.DXiYnKzr.js} +1 -1
  136. package/dist/{layers.C_6dQFnr.js → layers.DYUxmJPj.js} +1 -1
  137. package/dist/{layers.CEMKzoWc.js → layers.DYpl2yr-.js} +1 -1
  138. package/dist/{layers.DDaOIJhr.js → layers.DaVbJ1LA.js} +1 -1
  139. package/dist/{layers.Dt3-M5h3.js → layers.DbIcuUbL.js} +1 -1
  140. package/dist/{layers.ClQiuxJ3.js → layers.DdecoIKx.js} +1 -1
  141. package/dist/{layers.B30iMHxE.js → layers.DfKCNCmm.js} +1 -1
  142. package/dist/{layers.DmbS56_O.js → layers.DfUJwkLk.js} +1 -1
  143. package/dist/{layers.BHU1b_8q.js → layers.DfVVWVAL.js} +4 -4
  144. package/dist/{layers.DSPfLxfF.js → layers.DiIn1rfl.js} +1 -1
  145. package/dist/{layers.g3Beq7S5.js → layers.DikXRE8c.js} +1 -1
  146. package/dist/{layers.DQbJOPRI.js → layers.DjH8T5sT.js} +1 -1
  147. package/dist/{layers.DM8yNQDs.js → layers.DkAbsvwH.js} +4 -4
  148. package/dist/{layers.CcaOnGRX.js → layers.DnaYWIlB.js} +1 -1
  149. package/dist/{layers.r4P2oTbA.js → layers.Dnmgptfc.js} +1 -1
  150. package/dist/{layers.JycQDBPR.js → layers.DoHhOLdI.js} +2 -2
  151. package/dist/{layers.FgPrgSQe.js → layers.DqAsBItk.js} +1 -1
  152. package/dist/{layers.C31CPU0W.js → layers.DqM99Lfc.js} +1 -1
  153. package/dist/{layers.rNX8_vfT.js → layers.DrFvInpg.js} +1 -1
  154. package/dist/{layers.CAHzvtDu.js → layers.Drf95sgy.js} +1 -1
  155. package/dist/{layers.gXrYSDtK.js → layers.DsUTWT4F.js} +1 -1
  156. package/dist/{layers.CvEsaRKA.js → layers.DtW-qZtE.js} +1 -1
  157. package/dist/{layers.CXT6TIak.js → layers.DuUWtAKm.js} +4 -4
  158. package/dist/{layers.D4yxhiCs.js → layers.Duv1jJK3.js} +1 -1
  159. package/dist/{layers.CxLKiKwf.js → layers.DwuTV6GU.js} +1 -1
  160. package/dist/{layers.BpBIvVXP.js → layers.DzMzUTJI.js} +1 -1
  161. package/dist/{layers.v4VQ7VKK.js → layers.F9IvliIV.js} +1 -1
  162. package/dist/{layers.38netp0P.js → layers.G2bzJ31m.js} +1 -1
  163. package/dist/{layers.CFL3nJG5.js → layers.KQ6Ehsbw.js} +1 -1
  164. package/dist/{layers.BC4Cttyc.js → layers.LtObTP4s.js} +1 -1
  165. package/dist/{layers.e4jeo5nw.js → layers.OjUruzJk.js} +1 -1
  166. package/dist/{layers.DPrQg1Ne.js → layers.PZeYBSbk.js} +2 -2
  167. package/dist/{layers.Cc7QEce6.js → layers.RVfenvUo.js} +1 -1
  168. package/dist/{layers.g3lwXMuE.js → layers.Rtzeh3Fm.js} +5 -5
  169. package/dist/{layers.DDQ11qGZ.js → layers.S5_rh8fp.js} +1 -1
  170. package/dist/{layers.B-VoOGJ7.js → layers.T2uzm7S6.js} +1 -1
  171. package/dist/{layers.BDFtY7qa.js → layers.UaLbj79E.js} +1 -1
  172. package/dist/{layers.DcC2k41Q.js → layers.Up5eEXLJ.js} +1 -1
  173. package/dist/{layers.4Rlo7aiu.js → layers.VX_IrJYt.js} +3 -3
  174. package/dist/{layers.DHc7m1zn.js → layers.W0rM-0TG.js} +1 -1
  175. package/dist/{layers.Bq02QoCR.js → layers.YHkkWG0S.js} +1 -1
  176. package/dist/{layers.Cj2oUf6q.js → layers.ZLCj72_5.js} +1 -1
  177. package/dist/{layers.CFOCTQK4.js → layers.ZjrSTnp4.js} +1 -1
  178. package/dist/layers._WQpccnW.js +1 -0
  179. package/dist/{layers.z7rZESjE.js → layers._qZ7PmnI.js} +4 -4
  180. package/dist/{layers.BeJ03VGV.js → layers.b4pXlijt.js} +1 -1
  181. package/dist/{layers.C92iSP5z.js → layers.ffUYEwN4.js} +1 -1
  182. package/dist/{layers.BRb75h3b.js → layers.gEgCZvXy.js} +1 -1
  183. package/dist/layers.kOdq3GQw.js +8 -0
  184. package/dist/{layers.B-t_XXmL.js → layers.n9b2hhnM.js} +1 -1
  185. package/dist/{layers.DAj2Hdxv.js → layers.orWxvt3N.js} +1 -1
  186. package/dist/{layers.Cmc6eswQ.js → layers.pRwVCW0G.js} +1 -1
  187. package/dist/{layers.BNXta7e-.js → layers.pRyAFATa.js} +1 -1
  188. package/dist/{layers.CIPPzDQ8.js → layers.pr9eyR-Q.js} +1 -1
  189. package/dist/{layers.CzTykvY1.js → layers.prfqCpEA.js} +1 -1
  190. package/dist/{layers.Bs7IR3sR.js → layers.psrETnoP.js} +1 -1
  191. package/dist/{layers.D00tDEPj.js → layers.rsNk4u5r.js} +1 -1
  192. package/dist/{layers.BKuwBiGd.js → layers.syr3X38H.js} +2 -2
  193. package/dist/{layers.DG2iIC_6.js → layers.u5KGkYXg.js} +1 -1
  194. package/dist/{layers.CVXI0emh.js → layers.uCHz6Psq.js} +1 -1
  195. package/dist/{layers.uWp6ndSe.js → layers.uoQtwjlc.js} +1 -1
  196. package/dist/{layers.D_E_Kc96.js → layers.vOgpGFIt.js} +1 -1
  197. package/dist/{layers.AXJMsHe5.js → layers.vXA7G7-n.js} +1 -1
  198. package/dist/{layers.DndYZD-T.js → layers.wWHl-pSG.js} +2 -2
  199. package/dist/{layers.DYqlSXDW.js → layers.x7UpvoKs.js} +1 -1
  200. package/dist/{layers.C3dW6VbW.js → layers.xloaPUJ8.js} +1 -1
  201. package/dist/{layers.CgSMmqAz.js → layers.yWzNrmjk.js} +1 -1
  202. package/dist/{layers.CBUeSYR6.js → layers.yZ8BxTna.js} +1 -1
  203. package/dist/{layers.BCRB2Vl4.js → layers.ysM6MbVz.js} +1 -1
  204. package/dist/{layers.CDQRPUmK.js → layers.ytxll_qv.js} +1 -1
  205. package/dist/{layers.O3eKOG6F.js → layers.zI-ky_su.js} +3 -3
  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
- };