@layers-app/editor 2.2.18 → 2.2.20

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 (212) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +6 -6
  4. package/dist/{layers.D6o8IINL.js → layers.-upBSzpx.js} +1 -1
  5. package/dist/{layers.BaBiiBtb.js → layers.0LNf9wea.js} +1 -1
  6. package/dist/{layers.DJg6zKak.js → layers.0_51eSVe.js} +1 -1
  7. package/dist/{layers.Dy7O3mc8.js → layers.1TGJYusT.js} +1 -1
  8. package/dist/{layers.CYpQ_wUM.js → layers.1e5qHm0J.js} +1 -1
  9. package/dist/{layers.CtV4SgvM.js → layers.3OcJm3Ed.js} +1 -1
  10. package/dist/{layers.DNEGAIWq.js → layers.3tFPy2sk.js} +1 -1
  11. package/dist/{layers.DLypuDPQ.js → layers.3vPmC5wY.js} +1 -1
  12. package/dist/{layers.AVRvc3b_.js → layers.3wKIhKFs.js} +1 -1
  13. package/dist/{layers.CbKyt9cv.js → layers.6GJr4R5a.js} +1 -1
  14. package/dist/{layers.C-eErcQk.js → layers.7_mMT6j0.js} +1 -1
  15. package/dist/{layers.BdSViCHC.js → layers.9E-A35i_.js} +1 -1
  16. package/dist/{layers.BGsZBubK.js → layers.9Ln9OibX.js} +3 -3
  17. package/dist/{layers.CX5ieB7J.js → layers.9y0j73C2.js} +1 -1
  18. package/dist/{layers.ipQ-5kVQ.js → layers.B-n0tzE6.js} +64 -64
  19. package/dist/{layers.DlKO38LD.js → layers.B18sbnzv.js} +1 -1
  20. package/dist/{layers.61d7zZGi.js → layers.B18yyB-G.js} +1 -1
  21. package/dist/{layers.CAZ0LII4.js → layers.B1AhS2mA.js} +1 -1
  22. package/dist/{layers.w-oCjNMj.js → layers.B1Z3FBSW.js} +12266 -11852
  23. package/dist/{layers.D87XBDNG.js → layers.B2C41f-X.js} +1 -1
  24. package/dist/{layers.R72tkfyd.js → layers.B2dM7Tbt.js} +1 -1
  25. package/dist/{layers.wBiauaA9.js → layers.B3TU0mEp.js} +1 -1
  26. package/dist/{layers.DAXNpW9-.js → layers.B5wJPieL.js} +1 -1
  27. package/dist/{layers.B_V1Xkdr.js → layers.B7JBTHrI.js} +1 -1
  28. package/dist/{layers.Cx9juXwN.js → layers.B9R0kUwf.js} +1 -1
  29. package/dist/{layers.9rjfJZO2.js → layers.BB1IOMSC.js} +1 -1
  30. package/dist/{layers.UJ3fLllo.js → layers.BFGdqF5_.js} +3 -3
  31. package/dist/{layers.CxGVnKLP.js → layers.BFP9xss0.js} +2 -2
  32. package/dist/{layers.Cu1tsc6l.js → layers.BI0Qw-Cc.js} +3 -3
  33. package/dist/{layers.C2uCKjek.js → layers.BKFMltyU.js} +1 -1
  34. package/dist/layers.BNj2VdZj.js +1 -0
  35. package/dist/{layers.B5aGJv9Q.js → layers.BOushxNJ.js} +2 -2
  36. package/dist/{layers.DhPpQhum.js → layers.BQWSSCZq.js} +1 -1
  37. package/dist/{layers.B6i8qSIS.js → layers.BQkXkuk4.js} +1 -1
  38. package/dist/{layers.B9nmXEkv.js → layers.BTaoyA-H.js} +1 -1
  39. package/dist/{layers.l3JOltw6.js → layers.BUvl-p6R.js} +1 -1
  40. package/dist/{layers.Cn9aSI40.js → layers.BXJxwhsP.js} +1 -1
  41. package/dist/{layers.DrSzQhyF.js → layers.BaScx_6u.js} +4 -4
  42. package/dist/{layers.l5rFGGrM.js → layers.BaVFk6SN.js} +1 -1
  43. package/dist/{layers.CUKSFvv4.js → layers.BahyPrPG.js} +1 -1
  44. package/dist/{layers.DZtN5eys.js → layers.Bcb-73eF.js} +1 -1
  45. package/dist/{layers.CR9Rkptx.js → layers.BengJoS4.js} +1 -1
  46. package/dist/{layers.wilm-vT-.js → layers.BfbBFPcu.js} +1 -1
  47. package/dist/{layers.DBESR2Ms.js → layers.BgFdVBTk.js} +1 -1
  48. package/dist/{layers.C6QU3nHs.js → layers.BgPqY2JZ.js} +1 -1
  49. package/dist/{layers.DZUmkYn9.js → layers.BhSEN6dL.js} +1 -1
  50. package/dist/{layers.CY_n1kU-.js → layers.BjF2fnON.js} +1 -1
  51. package/dist/{layers.CIYAcVqX.js → layers.Bjuy0V1E.js} +7 -7
  52. package/dist/{layers.XSx7vDg5.js → layers.BkcNUG1w.js} +1 -1
  53. package/dist/{layers.CoPon8S1.js → layers.BmZLc04X.js} +1 -1
  54. package/dist/{layers.DBH57QiP.js → layers.Bmvmyfgx.js} +1 -1
  55. package/dist/{layers.D5WppJWM.js → layers.Bn4l8o8h.js} +1 -1
  56. package/dist/{layers.BnU5QUvm.js → layers.BoVCwhri.js} +1 -1
  57. package/dist/{layers.DbUNjzu4.js → layers.Bq7Gooda.js} +1 -1
  58. package/dist/{layers.D4nONNkn.js → layers.BqczWje4.js} +1 -1
  59. package/dist/{layers.Bl-6GH8M.js → layers.BwRjgk3l.js} +3 -3
  60. package/dist/{layers.JJIfWfyq.js → layers.BxlBrqjJ.js} +1 -1
  61. package/dist/{layers.DPzElbHo.js → layers.BxtuK-gH.js} +1 -1
  62. package/dist/{layers.CIwjXI_5.js → layers.BzKk84BW.js} +1 -1
  63. package/dist/{layers.WLoTtZGk.js → layers.C-EM8GWm.js} +1 -1
  64. package/dist/{layers.CMLsP3Qv.js → layers.C-GOXxAH.js} +1 -1
  65. package/dist/{layers.DejsvbkY.js → layers.C0Y9loxf.js} +1 -1
  66. package/dist/{layers.B3qRx2xr.js → layers.C2qyth5A.js} +1 -1
  67. package/dist/{layers.D_tz0e5e.js → layers.C3qGR0Em.js} +4 -4
  68. package/dist/{layers.DdfmP78A.js → layers.C3qje6kD.js} +1 -1
  69. package/dist/{layers.DNPTZ77l.js → layers.C5z-O4vl.js} +4 -4
  70. package/dist/{layers.DpNLR7Qm.js → layers.C6G7tcGn.js} +5 -5
  71. package/dist/{layers.BQjF1E4c.js → layers.C6TggUya.js} +1 -1
  72. package/dist/{layers.DZrZaGMU.js → layers.C6ZN6GpB.js} +1 -1
  73. package/dist/{layers.DvqoxUUG.js → layers.C7BOdhXB.js} +1 -1
  74. package/dist/{layers.B3NW3EIA.js → layers.C7k7FfgJ.js} +4 -4
  75. package/dist/{layers.Doms1ShT.js → layers.C8zsZFqE.js} +1 -1
  76. package/dist/{layers.DVqmJ5cz.js → layers.C9a1xgQe.js} +1 -1
  77. package/dist/{layers.CP6AKlqr.js → layers.C9cyYPQh.js} +1 -1
  78. package/dist/{layers.ce4FYquw.js → layers.CCGtHR4D.js} +1 -1
  79. package/dist/{layers.BSuvp7s_.js → layers.CF2XTKs7.js} +25 -25
  80. package/dist/{layers.C0_drxP8.js → layers.CFnqsqIg.js} +1 -1
  81. package/dist/{layers.lYoDQdh1.js → layers.CIrm8gfg.js} +1 -1
  82. package/dist/{layers.RuCorTYa.js → layers.CJEefGZu.js} +1 -1
  83. package/dist/{layers.CIqmMBTF.js → layers.CR-J7X7B.js} +1 -1
  84. package/dist/{layers.D9S_vY42.js → layers.CRPM8fya.js} +1 -1
  85. package/dist/{layers.BKMjqPu7.js → layers.CRtRlfWf.js} +1 -1
  86. package/dist/{layers.lovZOt5m.js → layers.CTC8zPrF.js} +1 -1
  87. package/dist/{layers.CWxvsn2r.js → layers.CUCT67uo.js} +1 -1
  88. package/dist/{layers.Dxih-jtd.js → layers.CUHrkUsV.js} +1 -1
  89. package/dist/{layers.BXVyk6Xk.js → layers.CVaHbb_-.js} +1 -1
  90. package/dist/{layers.BMF1jFI8.js → layers.CXWcXSX9.js} +1 -1
  91. package/dist/{layers.DHxD3cht.js → layers.CXoqcnEu.js} +1 -1
  92. package/dist/{layers.DgOx8vlG.js → layers.C_Q6OUQV.js} +1 -1
  93. package/dist/{layers.CJ9vr5Vf.js → layers.CaixRq7v.js} +2 -2
  94. package/dist/{layers.B81BefeI.js → layers.CcD5luc6.js} +1 -1
  95. package/dist/{layers.CvSlPLGX.js → layers.CcY2n7aU.js} +1 -1
  96. package/dist/{layers.Cu1zOvID.js → layers.Cd5TfPqd.js} +1 -1
  97. package/dist/{layers.URg5cNEd.js → layers.Cd9LTT03.js} +1 -1
  98. package/dist/{layers.BEzhOtU9.js → layers.CfQPz1Aw.js} +1 -1
  99. package/dist/{layers.HHnJQaaq.js → layers.CiyxhcNk.js} +1 -1
  100. package/dist/{layers.NB_0BDUr.js → layers.CkyjaB8W.js} +1 -1
  101. package/dist/layers.ClRsT66E.js +215 -0
  102. package/dist/{layers._FDf75jT.js → layers.CmL3QVyb.js} +6 -6
  103. package/dist/{layers.DdZJmzUn.js → layers.CpAc8yN6.js} +1 -1
  104. package/dist/{layers.Dl07r5hO.js → layers.CpOzVG7B.js} +1 -1
  105. package/dist/{layers.CJFN1uRl.js → layers.CqsG0OBS.js} +1 -1
  106. package/dist/{layers.CnW1qKer.js → layers.CrqbYRzf.js} +1 -1
  107. package/dist/{layers.CEv_zN3i.js → layers.Cs37Gb-Z.js} +1 -1
  108. package/dist/{layers.Gt67bXQ-.js → layers.CsY4eDYx.js} +1 -1
  109. package/dist/{layers.fPZ3f96g.js → layers.Cty8lMmS.js} +3 -3
  110. package/dist/{layers.ChAouMLG.js → layers.CwXWh9dp.js} +1 -1
  111. package/dist/{layers.DL_ujTVX.js → layers.CwzRnl4s.js} +1 -1
  112. package/dist/{layers.B1TmpiL3.js → layers.Cxj08exa.js} +1 -1
  113. package/dist/{layers.DRlUNbN4.js → layers.Cz2oCZes.js} +3 -3
  114. package/dist/{layers.DJcout75.js → layers.CzdcKOzv.js} +1 -1
  115. package/dist/layers.CzjOVTJE.js +6 -0
  116. package/dist/{layers.BJ6pf8mi.js → layers.D-kTQ9UK.js} +1 -1
  117. package/dist/{layers.C0mrYPud.js → layers.D0Z4j1r3.js} +1 -1
  118. package/dist/{layers.CMGMWLE1.js → layers.D0eSZ1Ss.js} +1 -1
  119. package/dist/{layers.BnTTSPcY.js → layers.D0eSoEbO.js} +1 -1
  120. package/dist/{layers.DJy_VY1N.js → layers.D5CCIEga.js} +4 -4
  121. package/dist/{layers.BjkQGI4N.js → layers.DAVxIkpH.js} +1 -1
  122. package/dist/{layers.Oiu4ibj1.js → layers.DAzfB806.js} +1 -1
  123. package/dist/{layers.B5L-jEAZ.js → layers.DC_kDhBY.js} +2 -2
  124. package/dist/{layers.Dw9Wg5FA.js → layers.DEv1V6DU.js} +1 -1
  125. package/dist/{layers.joZxEM2o.js → layers.DFgJMzMf.js} +4 -4
  126. package/dist/{layers.ATac6ALS.js → layers.DIks0MY9.js} +1 -1
  127. package/dist/{layers.Bb_U97T8.js → layers.DJbjONgo.js} +1 -1
  128. package/dist/{layers.CXxeMCwo.js → layers.DLIKqcXR.js} +1 -1
  129. package/dist/{layers.DV79SaLX.js → layers.DLxFKMA6.js} +1 -1
  130. package/dist/{layers.CvwzEBYN.js → layers.DNqsTxWV.js} +4 -4
  131. package/dist/{layers.DtU1CpvW.js → layers.DPDYskll.js} +1 -1
  132. package/dist/{layers.sKuPKiKy.js → layers.DPjb-zgI.js} +1 -1
  133. package/dist/{layers.B15Kncqu.js → layers.DRmkEnhl.js} +1 -1
  134. package/dist/layers.DUmaVqZq.js +952 -0
  135. package/dist/{layers.YIkbysYD.js → layers.DVJu88V3.js} +1 -1
  136. package/dist/{layers.DEz8RIqh.js → layers.DXf4Hpdv.js} +1 -1
  137. package/dist/{layers.CHeQ71z1.js → layers.DYUNvSRB.js} +88 -88
  138. package/dist/{layers.FbYnuOAN.js → layers.DYwksr5a.js} +1 -1
  139. package/dist/{layers.CAolJOCy.js → layers.DZ663X1x.js} +1 -1
  140. package/dist/{layers.9M3YcVSn.js → layers.DZoDi3Tr.js} +1 -1
  141. package/dist/{layers.Bx4IVLom.js → layers.D_C7_fbk.js} +4 -4
  142. package/dist/{layers.BOOPSoR_.js → layers.Da_0RKZH.js} +1 -1
  143. package/dist/{layers.DOlERP6f.js → layers.Da_jnd8_.js} +1 -1
  144. package/dist/{layers.DNF0aiV8.js → layers.DcN4v2dG.js} +5 -5
  145. package/dist/{layers.D1_inELr.js → layers.DcSevYiy.js} +1 -1
  146. package/dist/{layers.CwUR5ZoJ.js → layers.DfQnSjc2.js} +1 -1
  147. package/dist/{layers.D3KX-iZk.js → layers.Dh0MP18i.js} +1 -1
  148. package/dist/{layers._rvFfcms.js → layers.DhWg6e7n.js} +1 -1
  149. package/dist/{layers.ByGTruBc.js → layers.DiLkFPsw.js} +1 -1
  150. package/dist/{layers.CPB61IO_.js → layers.Dkx15TQL.js} +1 -1
  151. package/dist/layers.Dl5QV_sK.js +8 -0
  152. package/dist/{layers.C-qtxpeR.js → layers.DlGDSg5E.js} +1 -1
  153. package/dist/{layers.CkVkhu2B.js → layers.DluN6hsf.js} +1 -1
  154. package/dist/{layers.DBFv5nAq.js → layers.Dm3_m-K7.js} +1 -1
  155. package/dist/{layers.-WR8okbg.js → layers.DmgFUvCA.js} +1 -1
  156. package/dist/layers.DmvvbpXX.js +1 -0
  157. package/dist/{layers.DaLSJBnI.js → layers.Dn7VKVHU.js} +1 -1
  158. package/dist/{layers.CNj7ArmO.js → layers.DobSzbxw.js} +1 -1
  159. package/dist/{layers.BcTXvbzk.js → layers.DqGkxIFj.js} +8 -8
  160. package/dist/{layers.DS7IexOL.js → layers.DrH31GR-.js} +1 -1
  161. package/dist/{layers.B2w_EW2K.js → layers.DrNOhvhI.js} +2 -2
  162. package/dist/{layers.LxOBeMGm.js → layers.DuwP74N5.js} +4 -4
  163. package/dist/{layers.ChADCKep.js → layers.Dv0670fB.js} +1 -1
  164. package/dist/{layers.CsGlHMD9.js → layers.DxuuPlD2.js} +3 -3
  165. package/dist/{layers.fraJ3IAE.js → layers.DxzcPaNN.js} +1 -1
  166. package/dist/{layers.DKv0QONo.js → layers.DzJlRjgG.js} +1 -1
  167. package/dist/{layers.D6FAbeQa.js → layers.ERJ1aRjT.js} +1 -1
  168. package/dist/{layers.DGkeBM-R.js → layers.GoIyuc8H.js} +1 -1
  169. package/dist/{layers.B9lw8o8N.js → layers.I63XEeky.js} +1 -1
  170. package/dist/{layers.Bxwd-YPa.js → layers.IidMqMn2.js} +1 -1
  171. package/dist/{layers.BxhkgFHD.js → layers.JjO2paMU.js} +1 -1
  172. package/dist/{layers.cDZYE1u6.js → layers.NpQzTXqt.js} +1 -1
  173. package/dist/layers.O7nYuFCq.js +1 -0
  174. package/dist/{layers.BOsZuZLG.js → layers.PBduzFW5.js} +1 -1
  175. package/dist/{layers.DJldBd5p.js → layers.PWXwriWA.js} +1 -1
  176. package/dist/{layers.YG6v5fn-.js → layers.SjMxlWcq.js} +1 -1
  177. package/dist/{layers.B4j25OR2.js → layers.Uf5PZKYh.js} +1 -1
  178. package/dist/{layers.BdJ9_g7b.js → layers.Uu0_d58r.js} +1 -1
  179. package/dist/{layers.CIp6NAUy.js → layers.YEFmzwMw.js} +1 -1
  180. package/dist/{layers.DSv-eRyc.js → layers.a-LARbKt.js} +1 -1
  181. package/dist/{layers.CyTbcryg.js → layers.bR2nu10Q.js} +1 -1
  182. package/dist/{layers.CDR-T-ar.js → layers.cN8x9nW3.js} +1 -1
  183. package/dist/{layers.Cy6Tk-SH.js → layers.d2VMyzu0.js} +1 -1
  184. package/dist/layers.e-nRxhLh.js +1 -0
  185. package/dist/{layers.x10LP07F.js → layers.fccCpjtd.js} +3 -3
  186. package/dist/{layers.I3J0bq4-.js → layers.lAIs4XlW.js} +1 -1
  187. package/dist/{layers.qrcAZ53y.js → layers.lanlvW5Y.js} +1 -1
  188. package/dist/{layers.BYpNVhDS.js → layers.mMhiQdia.js} +1 -1
  189. package/dist/{layers.xIifkUte.js → layers.n9EbKm0x.js} +1 -1
  190. package/dist/{layers.DEojyrIS.js → layers.nIQkD9ci.js} +1 -1
  191. package/dist/{layers.DNYkUypM.js → layers.np_JJLpj.js} +1 -1
  192. package/dist/{layers.B8gcBITS.js → layers.opYuZNud.js} +1 -1
  193. package/dist/{layers.D89ZOtwL.js → layers.p-1j8BER.js} +3 -3
  194. package/dist/{layers.B6vO2PcA.js → layers.qKmpeiA7.js} +1 -1
  195. package/dist/{layers.BU1sqdpn.js → layers.rDvhupy_.js} +3 -3
  196. package/dist/{layers.CGQPDpjo.js → layers.sJHNaLMA.js} +2 -2
  197. package/dist/{layers.D-qWGpa_.js → layers.uWCQyrfS.js} +1 -1
  198. package/dist/{layers.oyf5VtLz.js → layers.uwChRl22.js} +1 -1
  199. package/dist/{layers.Cr8rbeLb.js → layers.vDS9PGcx.js} +1 -1
  200. package/dist/{layers.CON7wpEz.js → layers.v_prPZ9A.js} +1 -1
  201. package/dist/{layers.CdzPKNLN.js → layers.vuLooH9f.js} +1 -1
  202. package/dist/{layers.leezBuVo.js → layers.w6Rzpp65.js} +1 -1
  203. package/dist/{layers.QWNIgGPE.js → layers.x9vw7v3U.js} +4 -4
  204. package/dist/{layers.Cogd7-wX.js → layers.xyYWgeil.js} +1 -1
  205. package/dist/{layers.DOHeqQXY.js → layers.zP72_PG1.js} +1 -1
  206. package/package.json +1 -1
  207. package/dist/layers.5YnPXK6O.js +0 -700
  208. package/dist/layers.C2j8mmjW.js +0 -1
  209. package/dist/layers.Cozu7SOV.js +0 -6
  210. package/dist/layers.CurpGDXC.js +0 -1
  211. package/dist/layers.D49wqdTT.js +0 -1
  212. package/dist/layers.DprJ2kTf.js +0 -8
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),s=require("react"),M=require("react-i18next"),O=require("@lexical/react/LexicalComposerContext"),w=require("@mantine/core"),C=require("lexical"),t=require("./layers.ipQ-5kVQ.js"),z=require("@layers-app/shared"),ne=require("@lexical/react/useLexicalEditable"),$=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 ie(e,i){const n=document.createElement("a");n.href=e,n.download=i,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove()}function R(e){try{const n=new URL(e,window.location.origin).pathname.split("/").pop()||"image";return n.includes(".")?n:`${n}.png`}catch{return"image"}}async function q(e,i){const n=await fetch(e);if(!n.ok)throw new Error("fetch failed");const r=await n.blob(),c=URL.createObjectURL(r);try{ie(c,i)}finally{setTimeout(()=>URL.revokeObjectURL(c),0)}}function X({opened:e,onOpenChange:i,t:n,onDownload:r,onDelete:c}){return o.jsxs(w.Menu,{opened:e,onChange:i,transitionProps:t.animationMenu,shadow:"md",position:"bottom-start",offset:4,withinPortal:!0,closeOnItemClick:!0,children:[o.jsx(w.Menu.Target,{children:o.jsx(t.ActionIcon,{label:n("editor.toolbar.more"),icon:t.K1,iconColor:"var(--mantine-color-gray-text)","aria-label":n("editor.toolbar.more")})}),o.jsxs(w.Menu.Dropdown,{p:4,w:164,onMouseDown:l=>l.preventDefault(),children:[o.jsx(w.Menu.Item,{leftSection:o.jsx(w.Flex,{align:"center",justify:"center",c:"gray.6",children:o.jsx(t.HugeiconsIcon,{icon:t.Tm,size:16})}),onClick:l=>{l.stopPropagation(),r()},children:n("editor.gallery.download")}),o.jsx(w.Menu.Item,{color:"red",leftSection:o.jsx(w.Flex,{align:"center",justify:"center",c:"red.6",children:o.jsx(t.HugeiconsIcon,{icon:t.lg,size:16})}),onClick:l=>{l.stopPropagation(),c()},children:n("editor.contextMenu.delete")})]})]})}const Y=({t:e,src:i,setShown:n,id:r})=>{const[c,{open:l,close:h}]=$.useDisclosure(!1),u=s.useMemo(()=>[{id:!r||r==="0"?"":r,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,r]),m=p=>{p?l():h()};return o.jsxs(o.Fragment,{children:[o.jsx(z.AttachmentsGalleryModal,{opened:c,onOpenChange:m,attachments:u}),o.jsx(t.ActionIcon,{label:e("editor.image.preview"),icon:t.gn,iconColor:"var(--mantine-color-gray-text)","aria-label":e("editor.image.preview"),onClick:()=>{n(!1),l()}})]})},ae=({nodeKey:e,src:i})=>{const[n]=O.useLexicalComposerContext(),r=ne.useLexicalEditable(),[c,l]=s.useState(!1),[h,u]=s.useState(!1),{t:m}=M.useTranslation(),p=s.useCallback(()=>{n.update(()=>{const b=C.$getNodeByKey(e);t.$isImageNode(b)&&b.remove()})},[n,e]),y=s.useCallback(async()=>{if(i)try{await q(i,R(i))}catch{}},[i]);return o.jsxs("div",{className:`media-actions ${r?"":"media-actions--readonly"}`,children:[o.jsx(Y,{t:m,src:i,setShown:()=>{}}),r&&o.jsxs(o.Fragment,{children:[o.jsx(t.NodeAlignmentMenu,{opened:c,setOpened:l,t:m,editor:n,nodeKey:e,setShown:()=>{}}),o.jsx(X,{opened:h,onOpenChange:u,t:m,onDownload:()=>void y(),onDelete:p})]})]})},re=()=>{};function se({nodeKey:e,src:i,id:n}){const{t:r}=M.useTranslation(),[c]=O.useLexicalComposerContext(),[l,h]=s.useState(!1),[u,m]=s.useState(!1),p=s.useCallback(()=>{m(!1),c.update(()=>{const b=C.$getNodeByKey(e);if(!t.$isImageNode(b))return;const j=b.getParent();t.$isImageOverlayWrapperNode(j)?j.remove():b.remove()})},[c,e]),y=s.useCallback(async()=>{if(i)try{await q(i,R(i))}catch{}},[i]);return o.jsxs("div",{className:"media-actions visible",style:{position:"absolute",top:10,right:10,zIndex:10,pointerEvents:"auto",display:"flex",gap:4},onClick:b=>b.stopPropagation(),children:[o.jsx(Y,{t:r,src:i,setShown:re,id:n}),o.jsx(t.NodeAlignmentMenu,{opened:l,setOpened:h,t:r,editor:c,nodeKey:e}),o.jsx(X,{opened:u,onOpenChange:m,t:r,onDownload:()=>void y(),onDelete:p})]})}function le({nodeKey:e,src:i,id:n}){const{t:r}=M.useTranslation(),[c]=O.useLexicalComposerContext(),[l,{open:h,close:u}]=$.useDisclosure(!1),[m,{open:p,close:y}]=$.useDisclosure(!1),b=s.useMemo(()=>[{id:!n||n==="0"?"":n,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,n]),j=()=>{u(),p()},S=s.useCallback(async()=>{if(u(),!!i)try{await q(i,R(i))}catch{}},[i,u]),v=s.useCallback(()=>{u(),c.update(()=>{const d=C.$getNodeByKey(e);t.$isImageNode(d)&&d.remove()})},[c,e,u]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"image-touch-actions",style:{position:"absolute",top:8,right:8,zIndex:10,pointerEvents:"auto"},onClick:d=>d.stopPropagation(),children:o.jsx(t.ActionIcon,{label:r("editor.toolbar.more"),icon:t.O1,iconColor:"var(--mantine-color-gray-text)","aria-label":r("editor.toolbar.more"),onClick:h})}),o.jsx(z.AttachmentsGalleryModal,{opened:m,onOpenChange:d=>d?p():y(),attachments:b}),o.jsx(t.MobileDrawer,{opened:l,onClose:u,title:r("editor.image.mobileActions"),children:o.jsxs(w.Stack,{gap:4,p:0,children:[o.jsx(w.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:j,leftSection:o.jsx(t.HugeiconsIcon,{icon:t.gn,size:16,color:"var(--mantine-color-dimmed)"}),children:r("editor.image.previewFullScreen")}),o.jsx(w.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:()=>void S(),leftSection:o.jsx(t.HugeiconsIcon,{icon:t.Tm,size:16,color:"var(--mantine-color-dimmed)"}),children:r("editor.gallery.download")}),o.jsx(w.Button,{type:"button",variant:"subtle",color:"red",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:v,leftSection:o.jsx(t.HugeiconsIcon,{icon:t.lg,size:16,color:"var(--mantine-color-red-6)"}),children:r("editor.actions.delete")})]})})]})}const K=e=>{const{width:i,height:n,isLoading:r,isError:c,src:l,id:h,altText:u,imageRef:m,maxWidth:p}=e;return o.jsxs("div",{className:"media-wrapper",style:{width:i,height:n,display:"inline-flex",position:"relative"},children:[o.jsx(w.LoadingOverlay,{visible:r,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),o.jsx(ce,{className:null,src:l,altText:u,imageRef:m,width:"inherit",height:"inherit",maxWidth:p||"auto",id:h}),t.IS_TOUCH_DEVICE&&o.jsx(le,{nodeKey:e.nodeKey,src:l,id:h}),t.IS_TOUCH_TABLET&&o.jsx(se,{nodeKey:e.nodeKey,src:l,id:h}),t.IS_HOVER_CAPABLE&&!t.IS_TOUCH_DEVICE&&!t.IS_TOUCH_TABLET&&o.jsx(ae,{nodeKey:e.nodeKey,src:l})]})};function ce({altText:e,className:i,imageRef:n,src:r,width:c,height:l,maxWidth:h,id:u}){const[m,p]=s.useState(!1);return o.jsx("img",{className:`${i||void 0} ${m?"":"loading"}`,src:r,alt:e,ref:n,style:{height:l,maxWidth:h,width:c},onLoad:()=>{r.includes("splash")?setTimeout(()=>{p(!0)},100):p(!0)},draggable:"false","data-id":u})}function de(e){const{disable:i}=s.useContext(t.Context);return i&&t.ImageNode.isPlaceholderSrc(e.src)?null:o.jsx(ue,{...e})}function ue({src:e,altText:i,nodeKey:n,width:r,height:c,maxWidth:l,showCaption:h,caption:u,id:m,create:p,alignment:y,imagePickerTab:b}){var V,G;const j=s.useRef(null),[S,v]=s.useState(!0),[d]=O.useLexicalComposerContext(),[N,k]=s.useState(!0),[I,L]=s.useState({width:0,height:0}),{start:W}=t.useCancelUpload(),[ge,P]=s.useState(0),{fetchUploadMedia:D,fetchDeleteMedia:H,maxFileSize:me,imperativeHandleRef:A,disable:Z}=s.useContext(t.Context),T=t.mediaMap.has(e)&&(((V=t.mediaMap.get(e))==null?void 0:V.mediaNodeKeys.length)===0||((G=t.mediaMap.get(e))==null?void 0:G.mediaNodeKeys.length)===void 0||e.trim()===""),{t:E}=M.useTranslation(),[he,J]=s.useState(0);s.useEffect(()=>d.registerDecoratorListener(()=>{J(a=>a+1)}),[T]),s.useEffect(()=>{if(!e||e.startsWith("data:image/")||!e.trim()){v(!1);return}const a=new Image;a.src=e,a.onload=()=>v(!1),a.onerror=()=>{v(!1)}},[e,T]);const Q=(a,f)=>{d.update(()=>{C.$setSelection(null);const g=C.$getNodeByKey(n);t.$isImageNode(g)&&g.setWidthAndHeight(a,f)})},{historyState:B}=t.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:F}}=t.useSettings();function ee(a){return a.endsWith(".svg")||a.includes("image/svg+xml")}function te(a){return new Promise((f,g)=>{if(ee(a)){f(0);return}const x=new Image;x.src=a,x.onload=()=>{f(x.width)},x.onerror=()=>{g(new Error("Failed to load image"))}})}s.useEffect(()=>{let a=r,f=c,g=100;(e.includes("unsplash")?e.trim():!T&&e.trim()||e.includes("upload-src-editor"))&&e!=="upload"&&te(e).then(x=>{typeof a=="number"&&a<g&&x<g?(k(!0),L({width:a,height:f})):x<g?(k(!0),L({width:"auto",height:"auto"})):(L({width:x,height:x}),k(!1))}).catch(x=>{console.warn("Ошибка при загрузке изображения:",x.message)})},[e,T]),s.useEffect(()=>{I.width&&I.height&&N&&d.update(()=>{const a=C.$getNodeByKey(n);t.$isImageNode(a)&&a.setWidthAndHeight(I.width,I.height)})},[I.width,I.height,N]);const oe=s.useCallback(a=>t.$writeImagePickerTabToNode(d,n,a),[d,n]),U=s.useCallback((a,f)=>{v(!1),d.update(()=>{const g=C.$getNodeByKey(n);t.$isImageNode(g)&&(g.setSrc(a),g.setId(f))})},[d,n]),_=s.useCallback(a=>{v(!0);const f=W();D&&D(a[0],(g,x)=>{U(g,x),P(0)},g=>{g&&z.showErrorNotification({message:E("editor.gallery.errorFile")}),P(0),U("","")},f,g=>{P(g)})},[D,W,E,U]);return s.useEffect(()=>d.registerCommand(t.UPLOAD_IMAGE_COMMAND,a=>e!=="upload"||a.targetNodeKey!==n?!1:(_(a.files),!0),C.COMMAND_PRIORITY_LOW),[d,_,n,e]),!e||e==="upload"?o.jsx(w.Box,{"data-editor-image-picker-drop-root":!0,w:"100%",children:o.jsx(t.ImagePicker,{inline:!0,nodeKey:n,defaultTabValue:b,onWriteTabToNode:oe,uploading:!1,onUpload:a=>{!D||!a.length||_(a)},popoverProps:{opened:!0,position:"bottom",zIndex:t.EDITOR_UI_MIN_Z_INDEX},onChange:a=>{d.update(()=>{const f=C.$getNodeByKey(n);t.$isImageNode(f)&&f.setSrc(a)})}})}):N?o.jsx(K,{width:I.width,height:I.height,isLoading:S,isError:!1,isIcon:N,src:e,id:m,editor:d,nodeKey:n,fetchDeleteMedia:H,altText:i,imageRef:j,maxWidth:l,showCaption:h,caption:u,isCollabActive:!1,historyState:B,showNestedEditorTreeView:F,t:E}):o.jsx(t.ResizableContainer,{editor:d,isIcon:N,width:t.parseContainerSize(r),height:t.parseContainerSize(c),initialWidth:I.width||"",initialHeight:I.height||"",onResizeEnd:Q,alignment:y,disable:Z,onRegisterDecoratorEnter:a=>{A!=null&&A.current&&(A.current.decoratorEnterAction=a)},onActivate:()=>d.dispatchCommand(t.ON_CHANGE_COMMAND,"show_menu"),children:o.jsx(K,{width:"inherit",height:"inherit",isLoading:S,isError:!1,isIcon:N,src:e,id:m,editor:d,nodeKey:n,fetchDeleteMedia:H,altText:i,imageRef:j,maxWidth:l,showCaption:h,caption:u,isCollabActive:!1,historyState:B,showNestedEditorTreeView:F,t:E})})}exports.default=de;
@@ -1,8 +0,0 @@
1
- import { C as e, Q as t, N as m, A as r } from "./layers.-WR8okbg.js";
2
- import "./layers.BcTXvbzk.js";
3
- export {
4
- e as Commands,
5
- t as subsetToBase64,
6
- m as subsetToBinary,
7
- r as toBase64
8
- };