@layers-app/editor 2.2.45 → 2.3.0

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 (220) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.js +2 -2
  3. package/dist/{layers.CSsCFhvL.js → layers.-2KfQ6RG.js} +1 -1
  4. package/dist/{layers.C-TQ4gDg.js → layers.2VLsd23I.js} +1 -1
  5. package/dist/{layers.CjUQRZCf.js → layers.3t60RULo.js} +96 -95
  6. package/dist/{layers.0ohwJnJO.js → layers.5g-d1lPI.js} +361 -342
  7. package/dist/{layers.DGO5wxx-.js → layers.6fNZWRMy.js} +1 -1
  8. package/dist/{layers.cCd9G0s7.js → layers.6nxhuUZS.js} +1 -1
  9. package/dist/{layers.CKLSBcei.js → layers.77ToS0vJ.js} +1 -1
  10. package/dist/{layers.txhP70wF.js → layers.7oPXw6se.js} +1 -1
  11. package/dist/{layers.D2IuhDCQ.js → layers.8aC_7H6s.js} +1 -1
  12. package/dist/{layers.BKrToDbz.js → layers.9_5gtlo0.js} +1 -1
  13. package/dist/{layers.n-DYmU2Z.js → layers.A2b0zfpv.js} +1 -1
  14. package/dist/{layers.CmXdbn8_.js → layers.AHmwp-MB.js} +1 -1
  15. package/dist/{layers.CYW1WEKe.js → layers.B-EeOsPN.js} +1 -1
  16. package/dist/{layers.sKO5wWzt.js → layers.B-knJAmg.js} +1 -1
  17. package/dist/{layers.CQESVhxO.js → layers.B0YPk_J2.js} +1 -1
  18. package/dist/layers.B0aoB6yM.js +1 -0
  19. package/dist/{layers.BTBRVGFs.js → layers.B0c5OY_G.js} +1 -1
  20. package/dist/{layers.Dx2lhGzZ.js → layers.B1Asn8n_.js} +3 -3
  21. package/dist/{layers.DcYmpYNe.js → layers.B1QlqLSe.js} +1 -1
  22. package/dist/{layers.BaVDbZc-.js → layers.B1YHDbg8.js} +1 -1
  23. package/dist/{layers.Dd_MQmMI.js → layers.B4dgRxLi.js} +8 -8
  24. package/dist/{layers.B22dcdRZ.js → layers.B4n7r8Ul.js} +1 -1
  25. package/dist/{layers.CP2x77Hz.js → layers.B5AMuW0E.js} +1 -1
  26. package/dist/{layers.DinGcvYA.js → layers.B5R_HMQi.js} +33 -33
  27. package/dist/{layers.NEN1dVNO.js → layers.B7fR53su.js} +1 -1
  28. package/dist/{layers.DNqMXVNp.js → layers.B8XK-8I-.js} +1 -1
  29. package/dist/{layers.CY17OEce.js → layers.B9Xz7B4H.js} +1 -1
  30. package/dist/{layers.DvhAl2Y2.js → layers.BBT4Tvg5.js} +1 -1
  31. package/dist/{layers.mHLeiSFC.js → layers.BC_YpOSp.js} +1 -1
  32. package/dist/{layers.QhZDFUq4.js → layers.BD7kYiWS.js} +1 -1
  33. package/dist/{layers.DveF4Taj.js → layers.BDQtN1aD.js} +1 -1
  34. package/dist/{layers.Du94jGQf.js → layers.BExC2g6w.js} +1 -1
  35. package/dist/{layers.B028_Pfk.js → layers.BFreQdwW.js} +13 -13
  36. package/dist/{layers.BOkb4Kwr.js → layers.BJkqxsDC.js} +1 -1
  37. package/dist/{layers.CqFgGsQ4.js → layers.BKvhj3Jc.js} +3 -3
  38. package/dist/{layers.CAs2-nlo.js → layers.BKyKCEyP.js} +24 -24
  39. package/dist/{layers.Co4l7_YV.js → layers.BPdavEfb.js} +1 -1
  40. package/dist/{layers.Cvc8xBfw.js → layers.BQjo-s-b.js} +4104 -4138
  41. package/dist/{layers.DYK2Cc2v.js → layers.BQy5VO07.js} +6 -6
  42. package/dist/{layers.Bb6_oKs8.js → layers.BSWJm3U8.js} +1 -1
  43. package/dist/{layers.CGra3CE8.js → layers.BWD2tONt.js} +2 -2
  44. package/dist/{layers.wby51kRL.js → layers.BaZ9oGNz.js} +4 -4
  45. package/dist/{layers.DjG7qFHf.js → layers.BatQCiGf.js} +11 -11
  46. package/dist/{layers.BEIgYyne.js → layers.BccLIbKe.js} +1 -1
  47. package/dist/{layers.yftdzODL.js → layers.BfWe9IcW.js} +1 -1
  48. package/dist/layers.Bg7BQcmt.js +31 -0
  49. package/dist/{layers.BmnporKE.js → layers.Bgd7myyy.js} +1 -1
  50. package/dist/{layers.B7VPVY9m.js → layers.BhvmN99n.js} +1 -1
  51. package/dist/{layers.j6LRzfso.js → layers.Bi4--lcT.js} +1 -1
  52. package/dist/{layers.DiA7fPFt.js → layers.Bj2_ntq3.js} +3 -3
  53. package/dist/{layers.bWZDlvmW.js → layers.Blhb8ubC.js} +1 -1
  54. package/dist/{layers.9PIBmdB5.js → layers.Bnjo7X5G.js} +31 -31
  55. package/dist/{layers.B5yZJBoB.js → layers.Bnozyuub.js} +1 -1
  56. package/dist/{layers.oXNzpBlK.js → layers.Bptrc7aE.js} +27 -27
  57. package/dist/{layers.jg--vRcI.js → layers.BrPGpTKD.js} +9895 -9802
  58. package/dist/{layers.BaMwv1jF.js → layers.Brsx_95a.js} +1 -1
  59. package/dist/{layers.BqnQzZ9x.js → layers.Bs8dWBby.js} +1 -1
  60. package/dist/{layers.BcfRIrYG.js → layers.Bsr7C4ON.js} +1 -1
  61. package/dist/{layers.bk9EcYJr.js → layers.BtXZCoH_.js} +39 -39
  62. package/dist/{layers.DVZjfzxM.js → layers.BtXqThYa.js} +1 -1
  63. package/dist/layers.Bwc-8Isq.js +6 -0
  64. package/dist/{layers.CgtkYIke.js → layers.Bx77WE5O.js} +1 -1
  65. package/dist/{layers.CmSiqz4U.js → layers.C-78wB0V.js} +3 -3
  66. package/dist/{layers.CuZ6oi1Y.js → layers.C1rqQip5.js} +1 -1
  67. package/dist/{layers.JKpsQUa8.js → layers.C3_GElaJ.js} +1 -1
  68. package/dist/{layers.CZzgBinT.js → layers.C53iq2Ma.js} +1 -1
  69. package/dist/{layers.ByyJrMEp.js → layers.C6LbKv-M.js} +2 -2
  70. package/dist/{layers.BUZ2pvws.js → layers.C6ueC3Z0.js} +1 -1
  71. package/dist/{layers.Cof8D_jH.js → layers.C71O9vAp.js} +1 -1
  72. package/dist/{layers.C2CWUW0P.js → layers.C7b_RmTv.js} +1 -1
  73. package/dist/{layers.C2pTMR38.js → layers.C8Tfd7sP.js} +1 -1
  74. package/dist/{layers.DuNmb6iV.js → layers.C8WbGo3j.js} +1 -1
  75. package/dist/{layers.BC7Cg5cy.js → layers.C9Lko7YH.js} +1 -1
  76. package/dist/{layers.NCy-p2UI.js → layers.CAFSzILX.js} +21 -21
  77. package/dist/layers.CCHvuvhF.js +8 -0
  78. package/dist/{layers.Bmw_ImFW.js → layers.CFAdy1gb.js} +1 -1
  79. package/dist/{layers.BxaGfbS4.js → layers.CFL3W3X8.js} +2 -2
  80. package/dist/{layers.fnoJpR74.js → layers.CFcETIOb.js} +1 -1
  81. package/dist/{layers.CbG7bPrw.js → layers.CIvcS__9.js} +1 -1
  82. package/dist/{layers.CLP8NLxE.js → layers.COTQMo6A.js} +1 -1
  83. package/dist/{layers.CtFiU_U-.js → layers.CQ7hsV-G.js} +1 -1
  84. package/dist/{layers.Db7WC46z.js → layers.CRRnsu0U.js} +1 -1
  85. package/dist/layers.CSJKF8Yc.js +1 -0
  86. package/dist/{layers.BkUV4peM.js → layers.CT2g1VRg.js} +1 -1
  87. package/dist/{layers.DgBtq91i.js → layers.CUGBlmw8.js} +1 -1
  88. package/dist/{layers.DhOjjk4e.js → layers.CUV2M_pU.js} +1 -1
  89. package/dist/{layers.CwiLAF0n.js → layers.CWkQixNL.js} +1 -1
  90. package/dist/{layers.CDc-JAN1.js → layers.CXsKBYuP.js} +1 -1
  91. package/dist/{layers.Cx21Vx7C.js → layers.CZVAUi9T.js} +1 -1
  92. package/dist/{layers.Cjk9bUrz.js → layers.CZWgMRsn.js} +1 -1
  93. package/dist/layers.Ca29Mcjy.js +1 -0
  94. package/dist/{layers.YdWr9xoX.js → layers.CacnnrTU.js} +1 -1
  95. package/dist/{layers.CO180qeA.js → layers.CbuDjZaw.js} +1 -1
  96. package/dist/{layers.0O_y_PSM.js → layers.CcwJpgwT.js} +4 -4
  97. package/dist/{layers.D-dncXMv.js → layers.CfUup9qJ.js} +1 -1
  98. package/dist/{layers.vEoVIWoQ.js → layers.CgjZSo5b.js} +1 -1
  99. package/dist/{layers.BjDSCoZM.js → layers.ChRuHm3l.js} +1 -1
  100. package/dist/{layers.DxQF7DU5.js → layers.Chpc9546.js} +1 -1
  101. package/dist/{layers.DLiv2kEf.js → layers.Ciq1sahM.js} +1 -1
  102. package/dist/{layers.B5a2e-Mn.js → layers.CkpDbJMJ.js} +1 -1
  103. package/dist/{layers.DqCVQnl5.js → layers.ClDrIPRU.js} +1 -1
  104. package/dist/{layers.CHqw81xe.js → layers.CmupXZHN.js} +1 -1
  105. package/dist/{layers.C7E3l-g_.js → layers.Cn8CWsBB.js} +2 -2
  106. package/dist/{layers.BDmaTCfD.js → layers.Cr0gsM_j.js} +6 -6
  107. package/dist/{layers.BVrMVvbD.js → layers.CrRPE221.js} +1 -1
  108. package/dist/{layers.DKpytb6w.js → layers.CsN1TpE_.js} +1 -1
  109. package/dist/{layers.DzgpLhqO.js → layers.CvePRtuZ.js} +1 -1
  110. package/dist/{layers.km8iRn1X.js → layers.CwAI9EMJ.js} +95 -95
  111. package/dist/{layers.D2bgGfrE.js → layers.CwLijGjy.js} +5 -5
  112. package/dist/{layers.CiDAyBeD.js → layers.CxcPHDlk.js} +1 -1
  113. package/dist/layers.CyJLYOzo.js +1 -0
  114. package/dist/{layers.rkrNrIQd.js → layers.CyqBb3la.js} +1 -1
  115. package/dist/layers.CzQlolTW.js +1 -0
  116. package/dist/{layers.BEdP6w5G.js → layers.CzSHWBJE.js} +1 -1
  117. package/dist/{layers.BDSMUwmt.js → layers.CztSiz59.js} +1 -1
  118. package/dist/{layers.CT3XTF81.js → layers.D1ALzL8l.js} +1 -1
  119. package/dist/{layers.9chn1oBm.js → layers.D1q9XEqC.js} +1 -1
  120. package/dist/{layers.CwazPZdq.js → layers.D2P7q6AR.js} +2 -2
  121. package/dist/{layers.DFxl_E74.js → layers.D37qejd1.js} +4 -4
  122. package/dist/{layers.XAmXrnxl.js → layers.D53pVbAt.js} +1 -1
  123. package/dist/layers.D5gltjTL.js +1163 -0
  124. package/dist/{layers.Bf3CS2lb.js → layers.D8s5zGyA.js} +4 -4
  125. package/dist/{layers.C_M8g-oV.js → layers.DBQznnML.js} +1 -1
  126. package/dist/layers.DGptlsw9.js +8 -0
  127. package/dist/{layers.B68ca-eU.js → layers.DIDIuUgi.js} +1 -1
  128. package/dist/{layers.D53HW-OH.js → layers.DIk_oySe.js} +1 -1
  129. package/dist/layers.DLBYO9Pf.js +7 -0
  130. package/dist/{layers.BuPdI71w.js → layers.DLaija6u.js} +1 -1
  131. package/dist/{layers.t9b6t4Ii.js → layers.DLsrdKEz.js} +1 -1
  132. package/dist/{layers.DG26Vzsi.js → layers.DLyk5obs.js} +3 -3
  133. package/dist/{layers.CcfiG8Od.js → layers.DNSrh1pA.js} +1 -1
  134. package/dist/{layers.CABrQ2Zs.js → layers.DO1gXiNA.js} +1 -1
  135. package/dist/layers.DOK4tUdd.js +90 -0
  136. package/dist/{layers.a0ekgaAk.js → layers.DP7UYubA.js} +1 -1
  137. package/dist/{layers.C5spre2i.js → layers.DPlTEtvi.js} +1 -1
  138. package/dist/{layers.BWWFQbUs.js → layers.DQUdAZyr.js} +25 -25
  139. package/dist/{layers.CldflZpf.js → layers.DRN4BpGT.js} +1 -1
  140. package/dist/{layers.BadeIJgG.js → layers.DRoyt9-1.js} +4 -4
  141. package/dist/{layers.DoceYQaZ.js → layers.DUrkRJKo.js} +1 -1
  142. package/dist/{layers.D5naed4X.js → layers.DX9VTWiX.js} +1 -1
  143. package/dist/{layers.D1OY3B-n.js → layers.DY8_UsFK.js} +137 -137
  144. package/dist/{layers.Bex3-2F0.js → layers.DZ-JaYP3.js} +7 -7
  145. package/dist/{layers.QSp10MBY.js → layers.DZDZ3CuA.js} +1 -1
  146. package/dist/{layers.DRNjIrAp.js → layers.DZZUeo4N.js} +1 -1
  147. package/dist/{layers.C9bqqwGA.js → layers.DZqU-iL6.js} +40 -40
  148. package/dist/{layers.jcCRaKGd.js → layers.DaHHbgHM.js} +1 -1
  149. package/dist/{layers.DDTNqkEk.js → layers.DaLjgos9.js} +1 -1
  150. package/dist/{layers.ClSS_-JK.js → layers.DbcVW57C.js} +1 -1
  151. package/dist/{layers.DQbonqH1.js → layers.DbdtbmtQ.js} +1 -1
  152. package/dist/{layers.DheygGyD.js → layers.DcxJ1-U9.js} +1 -1
  153. package/dist/layers.DeT0xAwz.js +84 -0
  154. package/dist/{layers.P39es0O4.js → layers.Df3tBKAI.js} +1 -1
  155. package/dist/{layers.nXKHyTlo.js → layers.DhUwAghN.js} +1 -1
  156. package/dist/{layers.DXbA6oVt.js → layers.Dj860md7.js} +1 -1
  157. package/dist/{layers.Cg-zHhDe.js → layers.DkYYvaOJ.js} +2 -2
  158. package/dist/{layers.BJrL0_Rw.js → layers.Dn4qgJFc.js} +2 -2
  159. package/dist/{layers.B0sQe5D1.js → layers.Dodjwwv6.js} +3 -3
  160. package/dist/{layers.DvlQFVL_.js → layers.DohiIE20.js} +1 -1
  161. package/dist/{layers.Czx1TgLO.js → layers.DpKYGJRZ.js} +2 -2
  162. package/dist/{layers.BfHX9frV.js → layers.DsWcmm1l.js} +1 -1
  163. package/dist/{layers.CMB0mF82.js → layers.DvSTgxkV.js} +1 -1
  164. package/dist/{layers.B465LyPz.js → layers.Dvv8fKKk.js} +1 -1
  165. package/dist/{layers.CsgsF5Ft.js → layers.DwPIhine.js} +1 -1
  166. package/dist/{layers.ia3f0EYv.js → layers.DwS8V2Or.js} +1 -1
  167. package/dist/{layers.BVQVuKjJ.js → layers.DxABmn5O.js} +1 -1
  168. package/dist/layers.Dxr2o7ON.js +1 -0
  169. package/dist/{layers.C53wglsE.js → layers.DyciwgGK.js} +1 -1
  170. package/dist/{layers.Dvt-Szfl.js → layers.F57MyVA9.js} +1 -1
  171. package/dist/{layers.CEaPCwCe.js → layers.FzqiVsy_.js} +1 -1
  172. package/dist/{layers.Cg39QOHR.js → layers.HEL5QDoC.js} +1 -1
  173. package/dist/{layers.BunhC82l.js → layers.HhdqZtv5.js} +1 -1
  174. package/dist/{layers.Dt-Xolan.js → layers.IutlLti9.js} +1 -1
  175. package/dist/{layers.DnSDu3aj.js → layers.JZ7AxwMh.js} +1 -1
  176. package/dist/{layers.g-cZDg-J.js → layers.LGDbkgsv.js} +42 -42
  177. package/dist/{layers.DhROyrvJ.js → layers.LtQ1yaSI.js} +1 -1
  178. package/dist/{layers.DUD000-v.js → layers.SM9QTuDI.js} +16 -16
  179. package/dist/{layers.B5HuEtfE.js → layers.U7NY32uM.js} +1 -1
  180. package/dist/{layers.Ce54L6_R.js → layers.U8mTjpv_.js} +1 -1
  181. package/dist/{layers.DJTqJuKz.js → layers.WQRYkQdm.js} +15 -15
  182. package/dist/{layers.xMjrkzgP.js → layers.XCBehSH1.js} +1 -1
  183. package/dist/{layers.Cw289Pgg.js → layers.ZbGNGWJD.js} +12 -12
  184. package/dist/{layers.C2izS29k.js → layers.Zmw0un-f.js} +1 -1
  185. package/dist/{layers.C9O_XgoY.js → layers.aLsmNBld.js} +3 -3
  186. package/dist/{layers.vXZEDgHQ.js → layers.avpB9JpP.js} +1 -1
  187. package/dist/{layers.Cc98lCPt.js → layers.cnMJlmUn.js} +1 -1
  188. package/dist/{layers.oNZW8UBG.js → layers.dL8A7U4Q.js} +1 -1
  189. package/dist/{layers.DmmEgUMf.js → layers.eYOpCcnf.js} +1 -1
  190. package/dist/{layers.VNPeSDc5.js → layers.ehSnv8t3.js} +1 -1
  191. package/dist/{layers.DvfttTXQ.js → layers.fpcqoFdd.js} +1 -1
  192. package/dist/{layers.CJzs0OdD.js → layers.gG-4BCod.js} +1 -1
  193. package/dist/{layers.DIYV_Qgp.js → layers.iJv3YGd2.js} +1 -1
  194. package/dist/{layers.BpL4mYVq.js → layers.iT9k4umn.js} +1 -1
  195. package/dist/{layers.CIMF-Kx_.js → layers.iXNkI0ZC.js} +1 -1
  196. package/dist/{layers.C7LxBBYp.js → layers.mlObVGIf.js} +5 -5
  197. package/dist/{layers.D_LcSG5Y.js → layers.oaAarQby.js} +1 -1
  198. package/dist/{layers.Du37x8v3.js → layers.oeHgntpN.js} +1 -1
  199. package/dist/{layers.CFLly-Qe.js → layers.pRgndjxw.js} +1 -1
  200. package/dist/{layers.Cyy4XziO.js → layers.tZA_LmJa.js} +1 -1
  201. package/dist/{layers.DQNE7pSr.js → layers.teIuFApS.js} +1 -1
  202. package/dist/{layers.DWpAFgGF.js → layers.trRvrSLF.js} +1 -1
  203. package/dist/{layers.C4W6rbDZ.js → layers.visFusIB.js} +2982 -4133
  204. package/dist/{layers.VPQgHqCC.js → layers.wOUIpHWS.js} +1 -1
  205. package/dist/{layers.0KslT0iv.js → layers.xFbuP3DI.js} +1 -1
  206. package/dist/{layers.CCQQxd5s.js → layers.xI6XwkCk.js} +1 -1
  207. package/dist/{layers.C7y7h6VM.js → layers.xLIBX5yr.js} +1 -1
  208. package/dist/{layers.AL_UvFa5.js → layers.y9CU_epE.js} +1 -1
  209. package/dist/{layers.CM1BoU1E.js → layers.ywa822S7.js} +1 -1
  210. package/dist/layers.z2kEcNVH.js +5 -0
  211. package/package.json +2 -1
  212. package/dist/layers.BX2zMMPD.js +0 -6
  213. package/dist/layers.DXT1JSUZ.js +0 -5
  214. package/dist/layers.Dele1d2B.js +0 -1
  215. package/dist/layers.DfHZkVTD.js +0 -1
  216. package/dist/layers.DrZOHzCc.js +0 -84
  217. package/dist/layers.OYg34Rse.js +0 -1
  218. package/dist/layers.SIpDBTUg.js +0 -96
  219. package/dist/layers.nIE5wUh9.js +0 -1
  220. package/dist/layers.rE1cepGv.js +0 -8
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),R=require("react-i18next"),$=require("@lexical/react/LexicalComposerContext"),x=require("@mantine/core"),N=require("lexical"),o=require("./layers.CjUQRZCf.js"),F=require("@layers-app/shared"),q=require("@lexical/react/useLexicalEditable"),A=require("@mantine/hooks");require("@lexical/react/LexicalDecoratorBlockNode");require("@lexical/utils");require("@lexical/mark");require("@lexical/code");require("@lexical/selection");require("react-dom");require("@lexical/react/LexicalErrorBoundary");require("@lexical/react/LexicalBlockWithAlignableContents");require("@mantine/notifications");function xe(e,r){const n=document.createElement("a");n.href=e,n.download=r,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove()}function B(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 H(e,r){const n=await fetch(e);if(!n.ok)throw new Error("fetch failed");const s=await n.blob(),l=URL.createObjectURL(s);try{xe(l,r)}finally{setTimeout(()=>URL.revokeObjectURL(l),0)}}function be({editor:e,nodeKey:r,href:n,onClose:s}){const[l,d]=a.useState(()=>o.getLinkTypeFromUrl(n)),[c,u]=a.useState(()=>o.removeProtocol(n)),[I,v]=a.useState(!1),m=a.useCallback(g=>{d(g),v(!1)},[]),f=a.useCallback(g=>{u(g),v(!1)},[]),b=a.useCallback(()=>{const g=o.addProtocolIfNeeded(c.trim(),l);if(!g||!o.isValidUrl(g,l)){v(!0);return}o.$writeImageLinkToNode(e,r,o.sanitizeUrl(g)),s()},[e,r,c,l,s]),C=a.useCallback(()=>{o.$writeImageLinkToNode(e,r,""),s()},[e,r,s]),y=a.useCallback(g=>{g.key==="Enter"?(g.preventDefault(),b()):g.key==="Escape"&&(g.preventDefault(),s())},[b,s]);return{linkType:l,linkUrl:c,error:I,onLinkTypeChange:m,onUrlInputChange:f,onUrlInputKeyDown:y,onSave:b,onRemove:C}}function V({editor:e,nodeKey:r,href:n,onClose:s,mobile:l}){const d=a.useRef(null),c=be({editor:e,nodeKey:r,href:n,onClose:s});return a.useEffect(()=>{var u;(u=d.current)==null||u.focus({preventScroll:!0})},[]),t.jsx(o.CreateMode,{inputRef:d,linkUrl:c.linkUrl,linkType:c.linkType,error:c.error,mobile:l,onLinkTypeChange:c.onLinkTypeChange,onUrlInputChange:c.onUrlInputChange,onUrlInputKeyDown:c.onUrlInputKeyDown,onCancel:s,onSave:c.onSave,onRemove:n?c.onRemove:void 0})}function ae({opened:e,onOpenChange:r,t:n,onDownload:s,onDelete:l,hasLink:d,onLinkAction:c}){return t.jsxs(x.Menu,{opened:e,onChange:r,transitionProps:o.animationMenu,shadow:"md",position:"bottom-start",offset:4,withinPortal:!0,closeOnItemClick:!0,children:[t.jsx(x.Menu.Target,{children:t.jsx(o.ActionIcon,{label:n("editor.toolbar.more"),icon:o.K1,iconColor:"var(--mantine-color-gray-text)","aria-label":n("editor.toolbar.more")})}),t.jsxs(x.Menu.Dropdown,{p:4,miw:164,w:"max-content",onMouseDown:u=>u.preventDefault(),children:[c&&t.jsx(x.Menu.Item,{leftSection:t.jsx(x.Flex,{align:"center",justify:"center",c:"gray.6",children:t.jsx(o.Icon,{name:"link",size:16})}),onClick:u=>{u.stopPropagation(),c()},children:n(d?"editor.link.editLink":"editor.link.addLink")}),t.jsx(x.Menu.Item,{leftSection:t.jsx(x.Flex,{align:"center",justify:"center",c:"gray.6",children:t.jsx(o.HugeiconsIcon,{icon:o.Tm,size:16})}),onClick:u=>{u.stopPropagation(),s()},children:n("editor.gallery.download")}),t.jsx(x.Menu.Item,{color:"red",leftSection:t.jsx(x.Flex,{align:"center",justify:"center",c:"red.6",children:t.jsx(o.HugeiconsIcon,{icon:o.lg,size:16})}),onClick:u=>{u.stopPropagation(),l()},children:n("editor.contextMenu.delete")})]})]})}const re=({t:e,src:r,setShown:n,id:s})=>{const[l,{open:d,close:c}]=A.useDisclosure(!1),u=o.useCanDownload(),I=a.useMemo(()=>[{id:!s||s==="0"?"":s,Url:r??"",contentType:"image/*",originalFileName:"",fileSize:0,storageType:"",storagePath:"",fileName:"",parentType:"",parentId:"",ownerId:"",createdAt:new Date,updatedAt:new Date,version:0,deleted:!1,deletedAt:new Date}],[r,s]),v=m=>{m?d():c()};return t.jsxs(t.Fragment,{children:[t.jsx(F.AttachmentsGalleryModal,{opened:l,onOpenChange:v,attachments:I,allowDownload:u}),t.jsx(o.ActionIcon,{label:e("editor.image.preview"),icon:o.gn,iconColor:"var(--mantine-color-gray-text)","aria-label":e("editor.image.preview"),onClick:()=>{n(!1),d()}})]})},ke=({nodeKey:e,src:r,href:n})=>{const[s]=$.useLexicalComposerContext(),l=q.useLexicalEditable(),[d,c]=a.useState(!1),[u,I]=a.useState(!1),[v,m]=a.useState(!1),{t:f}=R.useTranslation();a.useEffect(()=>{if(!v)return;const y=g=>{const k=g.target;k!=null&&k.closest(".floating-link-dropdown")||k!=null&&k.closest(".floating-link-type-combobox-dropdown")||m(!1)};return document.addEventListener("pointerdown",y,!0),()=>document.removeEventListener("pointerdown",y,!0)},[v]);const b=a.useCallback(()=>{s.update(()=>{const y=N.$getNodeByKey(e);o.$isImageNode(y)&&y.remove()})},[s,e]),C=a.useCallback(async()=>{if(r)try{await H(r,B(r))}catch{}},[r]);return t.jsxs(x.Popover,{opened:v,onChange:m,position:"bottom-end",offset:4,shadow:"md",radius:"md",withinPortal:!0,closeOnClickOutside:!1,children:[t.jsx(x.Popover.Target,{children:t.jsxs("div",{className:`media-actions ${l?"":"media-actions--readonly"}`,children:[t.jsx(re,{t:f,src:r,setShown:()=>{}}),l&&t.jsxs(t.Fragment,{children:[t.jsx(o.NodeAlignmentMenu,{opened:d,setOpened:c,t:f,editor:s,nodeKey:e,setShown:()=>{}}),t.jsx(ae,{opened:u,onOpenChange:I,t:f,onDownload:()=>void C(),onDelete:b,hasLink:!!n,onLinkAction:()=>m(!0)})]})]})}),t.jsx(x.Popover.Dropdown,{className:`floating-link-dropdown floating-link-dropdown--${n?"edit":"create"}-mode`,"data-test-id":"floating-link-dropdown",children:t.jsx(V,{editor:s,nodeKey:e,href:n,onClose:()=>m(!1)})})]})},ve=()=>{};function ye({nodeKey:e,src:r,id:n,href:s}){const{t:l}=R.useTranslation(),[d]=$.useLexicalComposerContext(),c=q.useLexicalEditable(),[u,I]=a.useState(!1),[v,m]=a.useState(!1),[f,b]=a.useState(!1);a.useEffect(()=>{if(!f)return;const g=k=>{const p=k.target;p!=null&&p.closest(".floating-link-dropdown")||p!=null&&p.closest(".floating-link-type-combobox-dropdown")||b(!1)};return document.addEventListener("pointerdown",g,!0),()=>document.removeEventListener("pointerdown",g,!0)},[f]);const C=a.useCallback(()=>{m(!1),d.update(()=>{const g=N.$getNodeByKey(e);if(!o.$isImageNode(g))return;const k=g.getParent();o.$isImageOverlayWrapperNode(k)?k.remove():g.remove()})},[d,e]),y=a.useCallback(async()=>{if(r)try{await H(r,B(r))}catch{}},[r]);return t.jsxs(x.Popover,{opened:f,onChange:b,position:"bottom-end",offset:4,shadow:"md",radius:"md",withinPortal:!0,closeOnClickOutside:!1,children:[t.jsx(x.Popover.Target,{children:t.jsxs("div",{className:"media-actions visible",style:{position:"absolute",top:10,right:10,zIndex:10,pointerEvents:"auto",display:"flex",gap:4},onClick:g=>g.stopPropagation(),children:[t.jsx(re,{t:l,src:r,setShown:ve,id:n}),c&&t.jsxs(t.Fragment,{children:[t.jsx(o.NodeAlignmentMenu,{opened:u,setOpened:I,t:l,editor:d,nodeKey:e}),t.jsx(ae,{opened:v,onOpenChange:m,t:l,onDownload:()=>void y(),onDelete:C,hasLink:!!s,onLinkAction:()=>b(!0)})]})]})}),t.jsx(x.Popover.Dropdown,{className:`floating-link-dropdown floating-link-dropdown--${s?"edit":"create"}-mode`,"data-test-id":"floating-link-dropdown",children:t.jsx(V,{editor:d,nodeKey:e,href:s,onClose:()=>b(!1)})})]})}function Ce({nodeKey:e,src:r,id:n,href:s}){const{t:l}=R.useTranslation(),[d]=$.useLexicalComposerContext(),c=q.useLexicalEditable(),u=o.useCanDownload(),[I,{open:v,close:m}]=A.useDisclosure(!1),[f,{open:b,close:C}]=A.useDisclosure(!1),[y,{open:g,close:k}]=A.useDisclosure(!1),p=()=>{m(),g()},L=a.useMemo(()=>[{id:!n||n==="0"?"":n,Url:r??"",contentType:"image/*",originalFileName:"",fileSize:0,storageType:"",storagePath:"",fileName:"",parentType:"",parentId:"",ownerId:"",createdAt:new Date,updatedAt:new Date,version:0,deleted:!1,deletedAt:new Date}],[r,n]),E=()=>{m(),b()},D=a.useCallback(async()=>{if(m(),!!r)try{await H(r,B(r))}catch{}},[r,m]),T=a.useCallback(()=>{m(),d.update(()=>{const S=N.$getNodeByKey(e);o.$isImageNode(S)&&S.remove()})},[d,e,m]);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"image-touch-actions",style:{position:"absolute",top:8,right:8,zIndex:10,pointerEvents:"auto"},onClick:S=>S.stopPropagation(),children:t.jsx(o.ActionIcon,{label:l("editor.toolbar.more"),icon:o.O1,iconColor:"var(--mantine-color-gray-text)","aria-label":l("editor.toolbar.more"),onClick:v})}),t.jsx(F.AttachmentsGalleryModal,{opened:f,onOpenChange:S=>S?b():C(),attachments:L,allowDownload:u}),t.jsx(o.MobileDrawer,{opened:I,onClose:m,title:l("editor.image.mobileActions"),children:t.jsxs(x.Stack,{gap:4,p:0,children:[t.jsx(x.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:E,leftSection:t.jsx(o.HugeiconsIcon,{icon:o.gn,size:16,color:"var(--mantine-color-dimmed)"}),children:l("editor.image.previewFullScreen")}),c&&t.jsx(x.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:p,leftSection:t.jsx(o.HugeiconsIcon,{icon:o.zz,size:16,color:"var(--mantine-color-dimmed)"}),children:l(s?"editor.link.editLink":"editor.link.addLink")}),u&&t.jsx(x.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:()=>void D(),leftSection:t.jsx(o.HugeiconsIcon,{icon:o.Tm,size:16,color:"var(--mantine-color-dimmed)"}),children:l("editor.gallery.download")}),c&&t.jsx(x.Button,{type:"button",variant:"subtle",color:"red",fullWidth:!0,justify:"flex-start",bg:"var(--editor-action-bg)",onClick:T,leftSection:t.jsx(o.HugeiconsIcon,{icon:o.lg,size:16,color:"var(--mantine-color-red-6)"}),children:l("editor.actions.delete")})]})}),t.jsx(o.MobileDrawer,{opened:y,onClose:k,title:l(s?"editor.link.editLink":"editor.link.addLink"),children:t.jsx(V,{editor:d,nodeKey:e,href:s,onClose:k,mobile:!0})})]})}const ie=e=>{const{width:r,height:n,isLoading:s,isError:l,src:d,id:c,altText:u,imageRef:I,maxWidth:v,aspectRatio:m,href:f}=e,b=a.useRef(null);return t.jsxs("div",{className:"media-wrapper","data-reserved-box":m?"":void 0,style:{width:r,height:m?"auto":n,aspectRatio:m||void 0,display:"inline-flex",position:"relative"},children:[t.jsx(x.LoadingOverlay,{visible:s,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),t.jsx("a",{className:"editor-image-link","data-link":f?"true":void 0,"data-href":f?o.sanitizeUrl(f):void 0,role:f?"link":void 0,rel:f?"noopener noreferrer":void 0,draggable:!1,onMouseDown:f?C=>{b.current={x:C.clientX,y:C.clientY}}:void 0,onClick:f?C=>{C.preventDefault();const y=b.current;b.current=null,!(y&&Math.hypot(C.clientX-y.x,C.clientY-y.y)>5)&&window.open(o.sanitizeUrl(f),"_blank","noopener,noreferrer")}:void 0,children:t.jsx(Ie,{className:null,src:d,altText:u,imageRef:I,width:"inherit",height:"inherit",maxWidth:v||"auto",id:c})}),o.IS_TOUCH_DEVICE&&t.jsx(Ce,{nodeKey:e.nodeKey,src:d,id:c,href:f}),o.IS_TOUCH_TABLET&&t.jsx(ye,{nodeKey:e.nodeKey,src:d,id:c,href:f}),o.IS_HOVER_CAPABLE&&!o.IS_TOUCH_DEVICE&&!o.IS_TOUCH_TABLET&&t.jsx(ke,{nodeKey:e.nodeKey,src:d,href:f})]})};function Ie({altText:e,className:r,imageRef:n,src:s,width:l,height:d,maxWidth:c,id:u}){const[I,v]=a.useState(!1);return t.jsx("img",{className:`${r||void 0} ${I?"":"loading"}`,src:s,alt:e,ref:n,style:{height:d,maxWidth:c,width:l},onLoad:()=>{s.includes("splash")?setTimeout(()=>{v(!0)},100):v(!0)},draggable:"false","data-id":u})}function je(e){const{disable:r}=a.useContext(o.Context);return r&&o.ImageNode.isPlaceholderSrc(e.src)?null:t.jsx(De,{...e})}function De({src:e,altText:r,nodeKey:n,width:s,height:l,maxWidth:d,showCaption:c,caption:u,id:I,create:v,alignment:m,imagePickerTab:f,aspectRatio:b,href:C}){var oe,ne;const y=a.useRef(null),[g,k]=a.useState(!0),[p]=$.useLexicalComposerContext(),[L,E]=a.useState(!0),[D,T]=a.useState({width:0,height:0}),{start:S}=o.useCancelUpload(),[Ne,z]=a.useState(0),{fetchUploadMedia:P,fetchDeleteMedia:G,maxFileSize:Se,imperativeHandleRef:O,disable:se}=a.useContext(o.Context),M=o.mediaMap.has(e)&&(((oe=o.mediaMap.get(e))==null?void 0:oe.mediaNodeKeys.length)===0||((ne=o.mediaMap.get(e))==null?void 0:ne.mediaNodeKeys.length)===void 0||e.trim()===""),{t:U}=R.useTranslation(),X=i=>{if(typeof i=="number")return i>0?i:null;if(typeof i=="string"&&!i.includes("%")){const h=parseFloat(i);return Number.isFinite(h)&&h>0?h:null}return null},Y=X(s),Z=X(l),J=Y&&Z?Y/Z:void 0,[le,ce]=a.useState(void 0),Q=a.useMemo(()=>{try{const i=parseFloat(localStorage.getItem("layers-img-ratio:"+e)||"");return Number.isFinite(i)&&i>0?i:void 0}catch{return}},[e]),de=J??b??Q??le,[ue,K]=a.useState(!1),ge=!ue&&!J&&(b??Q)!=null,[Le,pe]=a.useState(0);a.useEffect(()=>p.registerDecoratorListener(()=>{pe(i=>i+1)}),[M]),a.useEffect(()=>{const i=p.getElementByKey(n);i&&(i.style.removeProperty("aspect-ratio"),i.style.removeProperty("width"))},[p,n]),a.useEffect(()=>{if(!e||e.startsWith("data:image/")||!e.trim()){k(!1);return}const i=new Image;i.src=e,i.onload=()=>{if(k(!1),i.naturalWidth){const h=i.naturalWidth/i.naturalHeight;if(ce(h),i.naturalWidth>=100)try{localStorage.setItem("layers-img-ratio:"+e,String(h))}catch{}!b&&i.naturalWidth>=100&&p.update(()=>{const w=N.$getNodeByKey(n);o.$isImageNode(w)&&w.getAspectRatio()==null&&w.setAspectRatio(h)},{tag:"history-merge"})}},i.onerror=()=>{k(!1)}},[e,M]);const me=(i,h)=>{p.update(()=>{N.$setSelection(null);const w=N.$getNodeByKey(n);o.$isImageNode(w)&&w.setWidthAndHeight(i,h)})},{historyState:ee}=o.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:te}}=o.useSettings();function fe(i){return i.endsWith(".svg")||i.includes("image/svg+xml")}function he(i){return new Promise((h,w)=>{if(fe(i)){h(0);return}const j=new Image;j.src=i,j.onload=()=>{h(j.width)},j.onerror=()=>{w(new Error("Failed to load image"))}})}a.useEffect(()=>{let i=s,h=l,w=100;(e.includes("unsplash")?e.trim():!M&&e.trim()||e.includes("upload-src-editor"))&&e!=="upload"&&he(e).then(j=>{typeof i=="number"&&i<w&&j<w?(E(!0),T({width:i,height:h})):j<w?(E(!0),T({width:"auto",height:"auto"})):(T({width:j,height:j}),E(!1)),K(!0)}).catch(j=>{K(!0),console.warn("Ошибка при загрузке изображения:",j.message)})},[e,M]),a.useEffect(()=>{D.width&&D.height&&L&&p.update(()=>{const i=N.$getNodeByKey(n);o.$isImageNode(i)&&i.setWidthAndHeight(D.width,D.height)})},[D.width,D.height,L]);const we=a.useCallback(i=>o.$writeImagePickerTabToNode(p,n,i),[p,n]),W=a.useCallback((i,h)=>{k(!1),p.update(()=>{const w=N.$getNodeByKey(n);o.$isImageNode(w)&&(w.setSrc(i),w.setId(h))})},[p,n]),_=a.useCallback(i=>{k(!0);const h=S();P&&P(i[0],(w,j)=>{W(w,j),z(0)},w=>{w&&F.showErrorNotification({message:U("editor.gallery.errorFile")}),z(0),W(e.startsWith("blob:")?"upload":"","")},h,w=>{z(w)})},[P,S,U,W,e]);return a.useEffect(()=>p.registerCommand(o.UPLOAD_IMAGE_COMMAND,i=>!e.startsWith("blob:")&&e!=="upload"||i.targetNodeKey!==n?!1:(_(i.files),!0),N.COMMAND_PRIORITY_LOW),[p,_,n,e]),!e||e==="upload"?t.jsx(x.Box,{"data-editor-image-picker-drop-root":!0,w:"100%",children:t.jsx(o.ImagePicker,{inline:!0,nodeKey:n,defaultTabValue:f,onWriteTabToNode:we,uploading:!1,onUpload:i=>{!P||!i.length||_(i)},popoverProps:{opened:!0,position:"bottom",zIndex:o.EDITOR_UI_MIN_Z_INDEX},onChange:i=>{p.update(()=>{const h=N.$getNodeByKey(n);o.$isImageNode(h)&&h.setSrc(i)})}})}):L&&!ge?t.jsx(ie,{width:D.width,height:D.height,isLoading:g,isError:!1,isIcon:L,src:e,id:I,editor:p,nodeKey:n,fetchDeleteMedia:G,altText:r,imageRef:y,maxWidth:d,showCaption:c,caption:u,isCollabActive:!1,historyState:ee,showNestedEditorTreeView:te,t:U,href:C}):t.jsx(o.ResizableContainer,{editor:p,isIcon:L,width:o.parseContainerSize(s),height:o.parseContainerSize(l),initialWidth:D.width||"",initialHeight:D.height||"",onResizeEnd:me,alignment:m,disable:se,onRegisterDecoratorEnter:i=>{O!=null&&O.current&&(O.current.decoratorEnterAction=i)},onActivate:()=>p.dispatchCommand(o.ON_CHANGE_COMMAND,"show_menu"),children:t.jsx(ie,{width:"inherit",height:"inherit",aspectRatio:de,isLoading:g,isError:!1,isIcon:L,src:e,id:I,editor:p,nodeKey:n,fetchDeleteMedia:G,altText:r,imageRef:y,maxWidth:d,showCaption:c,caption:u,isCollabActive:!1,historyState:ee,showNestedEditorTreeView:te,t:U,href:C})})}exports.default=je;
@@ -1,8 +0,0 @@
1
- import { C as e, Q as t, N as m, A as r } from "./layers.BqnQzZ9x.js";
2
- import "./layers.Cvc8xBfw.js";
3
- export {
4
- e as Commands,
5
- t as subsetToBase64,
6
- m as subsetToBinary,
7
- r as toBase64
8
- };