@layers-app/editor 0.7.78 → 0.7.80

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 (227) hide show
  1. package/README.md +831 -831
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.d.ts +5 -65
  4. package/dist/index.js +12 -14
  5. package/dist/{layers.D26fGq9e.js → layers.1RzIWkbc.js} +1 -1
  6. package/dist/{layers.D9n9z8YG.js → layers.22OwLzn6.js} +1 -1
  7. package/dist/{layers.CHjfZV3Y.js → layers.2cyuAZun.js} +2 -2
  8. package/dist/{layers.BgZ80nBG.js → layers.6pSekvvf.js} +1 -1
  9. package/dist/{layers.DiU6cOXj.js → layers.8WCrN2ad.js} +1 -1
  10. package/dist/{layers.CtDgzw74.js → layers.8mYPf7xD.js} +1 -1
  11. package/dist/{layers.RSlXJHc_.js → layers.B0u3In0b.js} +1 -1
  12. package/dist/{layers.B4Nujy-W.js → layers.B24JyoKk.js} +1 -1
  13. package/dist/{layers.oCWE0tph.js → layers.B3u4xcdj.js} +6 -6
  14. package/dist/{layers.D9X0FyWW.js → layers.B40IHM65.js} +1 -1
  15. package/dist/{layers.BnaFkLXr.js → layers.B6P6vQKV.js} +1 -1
  16. package/dist/{layers.CSp_fUX9.js → layers.B6dlNMff.js} +1 -1
  17. package/dist/{layers.Cs4W0xng.js → layers.B8An4u_b.js} +1 -1
  18. package/dist/{layers.DXHgwQSF.js → layers.B9Z3Ur7l.js} +1 -1
  19. package/dist/{layers.Cce3uOww.js → layers.BAMww3rb.js} +1 -1
  20. package/dist/{layers.CpsZt8D1.js → layers.BAeib8yb.js} +3 -3
  21. package/dist/{layers.BUe6Fley.js → layers.BAsKCofi.js} +1 -1
  22. package/dist/{layers.CH5sZ9y2.js → layers.BBro-hAN.js} +1 -1
  23. package/dist/{layers.DdGilF1y.js → layers.BBxbfugt.js} +1 -1
  24. package/dist/layers.BI7kcxqb.js +213 -0
  25. package/dist/{layers.zppDmomd.js → layers.BIwtYDXR.js} +1 -1
  26. package/dist/{layers.Cu51YqSE.js → layers.BJ1vit34.js} +4 -4
  27. package/dist/{layers.CD1wSFLR.js → layers.BJAcbSTt.js} +1 -1
  28. package/dist/{layers.CLlpta2X.js → layers.BMUfI2PN.js} +1 -1
  29. package/dist/layers.BM_5n4ZU.js +1 -0
  30. package/dist/{layers.B3r9apZY.js → layers.BMdiGswb.js} +1 -1
  31. package/dist/{layers.Bj_M3P16.js → layers.BMwFpHeV.js} +3 -3
  32. package/dist/{layers.vDkMOGSi.js → layers.BNev292u.js} +1 -1
  33. package/dist/{layers.s3JW7UmE.js → layers.BNh1FgZF.js} +2 -2
  34. package/dist/{layers.DkOOn3oi.js → layers.BOWLccgp.js} +1 -1
  35. package/dist/{layers.MEapmzkA.js → layers.BRvA5ifn.js} +1 -1
  36. package/dist/{layers.CGT8RNLy.js → layers.BSFP7tAA.js} +1 -1
  37. package/dist/{layers.D53ECpyT.js → layers.BTwe7VCT.js} +3 -3
  38. package/dist/{layers.DFkl1ZSl.js → layers.BUDEiu09.js} +1 -1
  39. package/dist/{layers.B4oqbc3n.js → layers.BURoXmdK.js} +1 -1
  40. package/dist/{layers.B2NmFuMF.js → layers.BW7kzRZc.js} +1 -1
  41. package/dist/{layers.BWY5OhEO.js → layers.BWc5_P-b.js} +1 -1
  42. package/dist/{layers.D82NsaKN.js → layers.BX3cFaBm.js} +1 -1
  43. package/dist/{layers.BxMs_uR-.js → layers.BXOoRhh6.js} +1 -1
  44. package/dist/{layers.CtX9oKVv.js → layers.BXbVpU9W.js} +1 -1
  45. package/dist/{layers.BiKZpDTt.js → layers.BXdXCgHV.js} +1 -1
  46. package/dist/{layers.CshIiX8i.js → layers.BXvhxGng.js} +1 -1
  47. package/dist/{layers.0fsVAKhk.js → layers.BZlspDVg.js} +1 -1
  48. package/dist/{layers.Dqb3E0zJ.js → layers.BaKveiRs.js} +1 -1
  49. package/dist/layers.Bca3vBlL.js +1 -0
  50. package/dist/{layers.CE2rGRKc.js → layers.BdEnN7Vm.js} +1 -1
  51. package/dist/{layers.Bu8DKvk7.js → layers.BgS5gwlo.js} +1 -1
  52. package/dist/{layers.aoBGq5VX.js → layers.BgyswSjW.js} +3 -3
  53. package/dist/{layers.DoAIxshB.js → layers.Bh9lr7K_.js} +1 -1
  54. package/dist/{layers.C1Hzs5fa.js → layers.BixUexvt.js} +24 -24
  55. package/dist/{layers.C2VEZ-qb.js → layers.BkTtj5hL.js} +3 -3
  56. package/dist/{layers.DbiqHLuu.js → layers.BlDV_oXy.js} +1 -1
  57. package/dist/layers.BnB1IrS5.js +76 -0
  58. package/dist/{layers.CqA113CL.js → layers.Brb6xMSO.js} +1 -1
  59. package/dist/layers.Bs9suENq.js +271 -0
  60. package/dist/{layers.CcgC0wyZ.js → layers.BuXF8ay4.js} +1 -1
  61. package/dist/{layers.BxyrBHL5.js → layers.BxF6m5NV.js} +1 -1
  62. package/dist/{layers.B9UxA7oB.js → layers.By0F4vmy.js} +1 -1
  63. package/dist/{layers.C9OM6nT3.js → layers.ByZhkPD0.js} +1 -1
  64. package/dist/{layers.D8T367jD.js → layers.BygYCyeB.js} +3 -3
  65. package/dist/{layers.C105wwo7.js → layers.ByjjyW9E.js} +1 -1
  66. package/dist/{layers.COMdL1L-.js → layers.Bywygiho.js} +2 -2
  67. package/dist/{layers.CCZ6_Wrw.js → layers.BzIeKO-1.js} +1 -1
  68. package/dist/{layers.D3U4gCDM.js → layers.BzkexDjQ.js} +4 -4
  69. package/dist/{layers.0Y1qnl1G.js → layers.C-Ji1hv9.js} +1 -1
  70. package/dist/{layers.C5mfAwKZ.js → layers.C0hVuG75.js} +1 -1
  71. package/dist/{layers.CHNwPCcP.js → layers.C1nvhv2R.js} +1 -1
  72. package/dist/{layers.jrw0SA_r.js → layers.C3M7cP8G.js} +1 -1
  73. package/dist/layers.C4dPTDZJ.js +295 -0
  74. package/dist/layers.C5vj9Xfk.js +304 -0
  75. package/dist/{layers.t69kU_aF.js → layers.C62v7DAV.js} +1 -1
  76. package/dist/{layers.UNT1qzd1.js → layers.C9n51KQz.js} +1 -1
  77. package/dist/{layers.1-NgjLB1.js → layers.CDME2TUW.js} +1 -1
  78. package/dist/{layers.CmxdGLsP.js → layers.CDlkbGxc.js} +1 -1
  79. package/dist/{layers.515YmFp2.js → layers.CGOuL7q8.js} +1 -1
  80. package/dist/{layers.BBVtioek.js → layers.CI4QWasd.js} +1 -1
  81. package/dist/{layers.NSLZMsAU.js → layers.CJ5ZKCxD.js} +1 -1
  82. package/dist/{layers.Din2GY_v.js → layers.CJ81GZER.js} +1 -1
  83. package/dist/{layers.CcxNr1WJ.js → layers.CJkUZEHi.js} +1 -1
  84. package/dist/{layers.DHgqjuG0.js → layers.CKVPSFQw.js} +1 -1
  85. package/dist/{layers.DH9O_NeT.js → layers.CL6cr7rG.js} +1 -1
  86. package/dist/{layers.BHbOQ8mW.js → layers.CMVK84Y8.js} +3 -3
  87. package/dist/{layers.CZFodX-E.js → layers.CO3Bgqlw.js} +1 -1
  88. package/dist/{layers.BxU87ICV.js → layers.COjvNfim.js} +5 -5
  89. package/dist/{layers.DLYZRcK4.js → layers.CQcCMJ9L.js} +1 -1
  90. package/dist/{layers.BL2-bsw_.js → layers.CR_nlgBX.js} +4 -4
  91. package/dist/{layers.C7umgYWg.js → layers.CSA7LxJ5.js} +1 -1
  92. package/dist/{layers.D6f5jje7.js → layers.CScjqhZm.js} +3 -3
  93. package/dist/{layers.CeElkwBf.js → layers.CSkHlzsj.js} +1 -1
  94. package/dist/{layers.DRQG0sOU.js → layers.CUNcapZL.js} +1 -1
  95. package/dist/{layers.BIGBZTJQ.js → layers.CUmEq8fL.js} +1 -1
  96. package/dist/{layers.B5yHbfHz.js → layers.CUyFgW9Q.js} +1 -1
  97. package/dist/{layers.KqM0XPII.js → layers.CZlMY12h.js} +1 -1
  98. package/dist/{layers.CU-KamiB.js → layers.C_21OuDa.js} +1 -1
  99. package/dist/{layers.Bf6lLK8a.js → layers.C_94Ju-e.js} +3 -3
  100. package/dist/{layers.BiYaXYfe.js → layers.C_JA6i-0.js} +1 -1
  101. package/dist/{layers.fHzcdU1b.js → layers.C_h21njd.js} +1 -1
  102. package/dist/layers.CamgypFQ.js +1 -0
  103. package/dist/layers.Cbi1qzaj.js +1 -0
  104. package/dist/{layers.M3VtTDPw.js → layers.CcU1FJEZ.js} +1 -1
  105. package/dist/{layers.VrUXD08v.js → layers.Ce8fenFl.js} +1 -1
  106. package/dist/{layers.akRKdkA-.js → layers.CeslTWO3.js} +1 -1
  107. package/dist/layers.Cf3GHQSy.js +276 -0
  108. package/dist/{layers.BjEcjDvl.js → layers.ChcS9NGO.js} +1 -1
  109. package/dist/{layers.RVU_H6uS.js → layers.CkpubkRV.js} +1 -1
  110. package/dist/{layers.4mXbqwQz.js → layers.Cm2YBfEQ.js} +1 -1
  111. package/dist/{layers.BtlBrRBE.js → layers.CqIhMHgg.js} +1 -1
  112. package/dist/{layers.r1vLQhL7.js → layers.CrSlQNI1.js} +1 -1
  113. package/dist/{layers.DBIp1-89.js → layers.Csgc40LS.js} +1 -1
  114. package/dist/{layers.BA-KmiPF.js → layers.CshghINR.js} +1 -1
  115. package/dist/{layers.80zZkFZy.js → layers.CssvMlV3.js} +1 -1
  116. package/dist/{layers.FzN5R_MI.js → layers.Ct6I-_CT.js} +4 -4
  117. package/dist/layers.CvKJtaJl.js +8 -0
  118. package/dist/{layers.BXwSSGOP.js → layers.Cwcf5wmo.js} +1 -1
  119. package/dist/{layers.CecVLcyQ.js → layers.CxzZNbmd.js} +4 -4
  120. package/dist/{layers.BZDPu4w6.js → layers.D0G_0PWs.js} +1 -1
  121. package/dist/{layers.DUfrGX_H.js → layers.D2rrxQAq.js} +1 -1
  122. package/dist/{layers.BENdLcO-.js → layers.D3jzVfba.js} +1 -1
  123. package/dist/{layers.CEs7S6fZ.js → layers.D6E5WLjx.js} +1 -1
  124. package/dist/{layers.cADCpzYZ.js → layers.D7enADLv.js} +4 -4
  125. package/dist/{layers.Ye9pNj24.js → layers.DA7jujLH.js} +1 -1
  126. package/dist/{layers.DGGRbYnV.js → layers.DAqWenY4.js} +4 -4
  127. package/dist/{layers.CD9Gpt1y.js → layers.DB12g02G.js} +1 -1
  128. package/dist/{layers.CRU1QNHI.js → layers.DBJTho9n.js} +1 -1
  129. package/dist/{layers.CjiGu82L.js → layers.DCGycCgX.js} +1 -1
  130. package/dist/{layers.BLGXeqHI.js → layers.DDFBDR2a.js} +1 -1
  131. package/dist/{layers.CvuuDQmg.js → layers.DDI5vtC5.js} +1 -1
  132. package/dist/{layers.DD1kaPgm.js → layers.DHi57hSd.js} +1 -1
  133. package/dist/{layers.7PYtla9F.js → layers.DKuZmyU-.js} +1 -1
  134. package/dist/{layers.DCngQBR0.js → layers.DLz0UkOT.js} +1 -1
  135. package/dist/{layers.pTNqmcpG.js → layers.DN--fCCv.js} +1 -1
  136. package/dist/{layers.BgYEljJ_.js → layers.DQhey3lL.js} +1 -1
  137. package/dist/{layers.BNwCX_a3.js → layers.DRQBZXbd.js} +1 -1
  138. package/dist/{layers.DAZX9DhM.js → layers.DSYyJ5vW.js} +1 -1
  139. package/dist/{layers.K3ZUUM9n.js → layers.DSha8bs_.js} +1 -1
  140. package/dist/{layers.CF6gZUn8.js → layers.DSq0IgCR.js} +1 -1
  141. package/dist/{layers.C27kGY5A.js → layers.DTGlDcSl.js} +1 -1
  142. package/dist/{layers.Co_5xN7g.js → layers.DVskSUWT.js} +3 -3
  143. package/dist/{layers.DA8ptbxj.js → layers.DXI2AgJt.js} +1 -1
  144. package/dist/{layers.Cj_3ai7F.js → layers.DXnMF9u3.js} +5 -5
  145. package/dist/{layers.IKs1cP2i.js → layers.D_PeCLKR.js} +1 -1
  146. package/dist/layers.D_WExqmZ.js +6 -0
  147. package/dist/{layers.CmxgG84N.js → layers.Da8n9gcP.js} +1 -1
  148. package/dist/{layers.C8orXEHJ.js → layers.DaHtgOD-.js} +1 -1
  149. package/dist/{layers.BHHU17Hh.js → layers.DbQCJ5RT.js} +1 -1
  150. package/dist/{layers.C-Y8p6cn.js → layers.DcaUgNVC.js} +2 -2
  151. package/dist/{layers.DpqsTBtA.js → layers.DciZD8JS.js} +1 -1
  152. package/dist/{layers.CYLLfE2A.js → layers.DfoqZh1E.js} +1 -1
  153. package/dist/{layers.CiJKn6R8.js → layers.DkLrwRSW.js} +1 -1
  154. package/dist/{layers.DvQ3ACdp.js → layers.DmJRVGXC.js} +1 -1
  155. package/dist/{layers.BPY_YIjN.js → layers.DmQBlHk_.js} +1 -1
  156. package/dist/{layers.DFYDyH7z.js → layers.DnsxB9_v.js} +1 -1
  157. package/dist/{layers.gtk1_Zb2.js → layers.Dpg89znh.js} +1 -1
  158. package/dist/layers.DsH1V8Rv.js +31944 -0
  159. package/dist/{layers.JJpurIJD.js → layers.DsUdgUIK.js} +4 -4
  160. package/dist/{layers.Du6LkFzU.js → layers.DxAddEHQ.js} +1 -1
  161. package/dist/layers.DxLTN2Mo.js +1 -0
  162. package/dist/{layers.Bny6sOA6.js → layers.DxQO0sSy.js} +1 -1
  163. package/dist/{layers.Dv7C-CRq.js → layers.Jd_TNHCm.js} +1 -1
  164. package/dist/{layers._TEMZO38.js → layers.JroGyFOZ.js} +1 -1
  165. package/dist/{layers.BdG3k_hs.js → layers.K0bGrkQj.js} +8 -8
  166. package/dist/{layers.DCMRe4s_.js → layers.Kx9nkbbg.js} +1 -1
  167. package/dist/{layers.BEYYOqjt.js → layers.McORqufp.js} +1 -1
  168. package/dist/{layers.ggRBsGE2.js → layers.NS5NT7K6.js} +1 -1
  169. package/dist/{layers.CcZ7lvE9.js → layers.O1OdWCre.js} +1 -1
  170. package/dist/{layers.CVyvMI9c.js → layers.PZpgzH37.js} +1 -1
  171. package/dist/{layers.AIWrQESY.js → layers.Qard_uHa.js} +1 -1
  172. package/dist/{layers.DvM6Rvuy.js → layers.RjfPClBy.js} +1 -1
  173. package/dist/{layers.CTmobPht.js → layers.SHcyxrBG.js} +1 -1
  174. package/dist/{layers.DyN9zqvw.js → layers.SIXGD_Wr.js} +1 -1
  175. package/dist/{layers.js2hd4k-.js → layers.ShXJ7OET.js} +1 -1
  176. package/dist/layers.TE4svPL3.js +1 -0
  177. package/dist/layers.TLYkReAr.js +1 -0
  178. package/dist/{layers.dNqRbTzt.js → layers.TdkG7Ays.js} +4 -4
  179. package/dist/{layers.BW-MhyT0.js → layers.UKheEsWW.js} +1 -1
  180. package/dist/{layers.BktNuMeg.js → layers.UkETTANE.js} +1 -1
  181. package/dist/{layers.BWvugbcq.js → layers.Xdi6V5yb.js} +1 -1
  182. package/dist/{layers.CKepCH9l.js → layers.Y-kA5-o9.js} +1 -1
  183. package/dist/{layers.Cr9LsWSp.js → layers.YpfBZMVu.js} +1 -1
  184. package/dist/layers.ZbH4IgXM.js +299 -0
  185. package/dist/{layers.V_xsoN8K.js → layers._8u2gRNd.js} +2 -2
  186. package/dist/{layers.Xkl8rP3s.js → layers.aJsGnnRx.js} +3 -3
  187. package/dist/{layers.CoBd9S7u.js → layers.aUjxOGly.js} +1 -1
  188. package/dist/{layers.Dl0nflkg.js → layers.cHz8j_4E.js} +1 -1
  189. package/dist/{layers.Mj8hqlJW.js → layers.cNfD-5El.js} +1 -1
  190. package/dist/{layers.D5f_UTqz.js → layers.gG7iFeZf.js} +1 -1
  191. package/dist/{layers.BSZN9Cbf.js → layers.hC6HcT3B.js} +1 -1
  192. package/dist/{layers.DRorHC-o.js → layers.hijD9oiN.js} +1 -1
  193. package/dist/{layers.BfY7AosZ.js → layers.hvHRaxKY.js} +1 -1
  194. package/dist/{layers.CTyeZA74.js → layers.lroOqYUM.js} +1 -1
  195. package/dist/{layers.KZgKtoDw.js → layers.lw30XOiC.js} +1 -1
  196. package/dist/{layers.SZFN9FKm.js → layers.mXRDgZ_h.js} +1 -1
  197. package/dist/{layers.DhATdRwD.js → layers.nUgG0KBM.js} +1 -1
  198. package/dist/{layers.BPqRxZ_9.js → layers.oax_YBGU.js} +1 -1
  199. package/dist/{layers.Bzua1pmT.js → layers.oqSjaDkp.js} +1 -1
  200. package/dist/{layers.p2Zn_qfy.js → layers.pOAtEfPj.js} +1 -1
  201. package/dist/{layers.DvnUP-Vo.js → layers.qPQizNgE.js} +1 -1
  202. package/dist/{layers.CcIycQA5.js → layers.qTMtdWyh.js} +1 -1
  203. package/dist/{layers.CggsYr0c.js → layers.sjS-Tk55.js} +1 -1
  204. package/dist/{layers.BB_9B4fo.js → layers.t1-aARQ3.js} +7 -7
  205. package/dist/{layers.C-JcVOgm.js → layers.t4sVoq0t.js} +1 -1
  206. package/dist/{layers.CN5kSOlp.js → layers.tDZ7vRKL.js} +1 -1
  207. package/dist/{layers.oASG8w4r.js → layers.tLIgGgA2.js} +1 -1
  208. package/dist/layers.vC5zm3ly.js +1 -0
  209. package/dist/{layers.CNWeM8YC.js → layers.wp3bvBuH.js} +1 -1
  210. package/dist/{layers.Cr3Askgk.js → layers.xKIzcqa6.js} +1 -1
  211. package/package.json +21 -47
  212. package/dist/layers.B0hzGWHm.js +0 -17
  213. package/dist/layers.B93mlMVg.js +0 -1
  214. package/dist/layers.BNUA11IQ.js +0 -1
  215. package/dist/layers.BPvkLXia.js +0 -43993
  216. package/dist/layers.BcBq8AlG.js +0 -1
  217. package/dist/layers.BeQ9YXA_.js +0 -6
  218. package/dist/layers.C0Me094z.js +0 -1
  219. package/dist/layers.CB9cfYZa.js +0 -1
  220. package/dist/layers.CLEDkiCk.js +0 -346
  221. package/dist/layers.CmmYt3Ou.js +0 -1
  222. package/dist/layers.CvcpAYuM.js +0 -296
  223. package/dist/layers.D05yrn3O.js +0 -1
  224. package/dist/layers.D0X8KZzh.js +0 -304
  225. package/dist/layers.DB-vtUk9.js +0 -454
  226. package/dist/layers.DilA0qnM.js +0 -54
  227. package/dist/layers.iYBuyc8i.js +0 -8
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.D5f_UTqz.js");require("./layers.BB_9B4fo.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.BdG3k_hs.js";
2
- export {
3
- o as default,
4
- s as en,
5
- f as kaa
6
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@lexical/react/LexicalComposerContext"),a=require("./layers.D0X8KZzh.js"),e=require("./layers.CmmYt3Ou.js");function o(){const[r]=i.useLexicalComposerContext();return a.useExcalidrawBehaviour(r),null}exports.$createExcalidrawNode=a.$createExcalidrawNode;exports.$isExcalidrawNode=a.$isExcalidrawNode;exports.ExcalidrawNode=a.ExcalidrawNode;exports.INSERT_EXCALIDRAW_COMMAND=a.INSERT_EXCALIDRAW_COMMAND;exports.languageToLocaleMap=e.languageToLocaleMap;exports.parseExcalidrawData=e.parseExcalidrawData;exports.ExcalidrawPlugin=o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),a=require("react"),G=require("react-i18next"),Y=require("@lexical/react/LexicalComposerContext"),O=require("@mantine/core"),I=require("lexical"),J=require("@layers-app/shared"),i=require("./layers.D0X8KZzh.js"),A=t=>{const{width:g,height:s,isLoading:c,isError:C,src:h,id:f,altText:m,imageRef:p,maxWidth:N}=t;return u.jsxs("div",{className:"media-wrapper",style:{width:g,height:s,display:"inline-flex",position:"relative"},children:[u.jsx(O.LoadingOverlay,{visible:c,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),u.jsx(Q,{className:null,src:h,altText:m,imageRef:p,width:"inherit",height:"inherit",maxWidth:N||"auto",id:f})]})};function Q({altText:t,className:g,imageRef:s,src:c,width:C,height:h,maxWidth:f,id:m}){const[p,N]=a.useState(!1);return u.jsx("img",{className:`${g||void 0} ${p?"":"loading"}`,src:c,alt:t,ref:s,style:{height:h,maxWidth:f,width:C},onLoad:()=>{c.includes("splash")?setTimeout(()=>{N(!0)},100):N(!0)},draggable:"false","data-id":m})}function X(t){const{disable:g}=a.useContext(i.Context);return g&&i.ImageNode.isPlaceholderSrc(t.src)?null:u.jsx(Z,{...t})}function Z({src:t,altText:g,nodeKey:s,width:c,height:C,maxWidth:h,showCaption:f,caption:m,id:p,create:N,alignment:U,imagePickerTab:B}){var k,q;const T=a.useRef(null),[W,w]=a.useState(!0),[n]=Y.useLexicalComposerContext(),[x,E]=a.useState(!0),[d,j]=a.useState({width:0,height:0}),{start:$}=i.useCancelUpload(),[K,y]=a.useState(0),{fetchUploadMedia:b,fetchDeleteMedia:P,maxFileSize:ee}=a.useContext(i.Context),S=i.mediaMap.has(t)&&(((k=i.mediaMap.get(t))==null?void 0:k.mediaNodeKeys.length)===0||((q=i.mediaMap.get(t))==null?void 0:q.mediaNodeKeys.length)===void 0||t.trim()===""),{t:v}=G.useTranslation(),[te,D]=a.useState(0);a.useEffect(()=>n.registerDecoratorListener(()=>{D(e=>e+1)}),[S]),a.useEffect(()=>{if(!t||t.startsWith("data:image/")||!t.trim()){w(!1);return}const e=new Image;e.src=t,e.onload=()=>w(!1),e.onerror=()=>{w(!1)}},[t,S]);const H=(e,r)=>{n.update(()=>{I.$setSelection(null);const o=I.$getNodeByKey(s);i.$isImageNode(o)&&o.setWidthAndHeight(e,r)})},{historyState:R}=i.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:z}}=i.useSettings();function _(e){return e.endsWith(".svg")||e.includes("image/svg+xml")}function F(e){return new Promise((r,o)=>{if(_(e)){r(0);return}const l=new Image;l.src=e,l.onload=()=>{r(l.width)},l.onerror=()=>{o(new Error("Failed to load image"))}})}a.useEffect(()=>{let e=c,r=C,o=100;(t.includes("unsplash")?t.trim():!S&&t.trim()||t.includes("upload-src-editor"))&&t!=="upload"&&F(t).then(l=>{typeof e=="number"&&e<o&&l<o?(E(!0),j({width:e,height:r})):l<o?(E(!0),j({width:"auto",height:"auto"})):(j({width:l,height:l}),E(!1))}).catch(l=>{console.warn("Ошибка при загрузке изображения:",l.message)})},[t,S]),a.useEffect(()=>{d.width&&d.height&&x&&n.update(()=>{const e=I.$getNodeByKey(s);i.$isImageNode(e)&&e.setWidthAndHeight(d.width,d.height)})},[d.width,d.height,x]);const V=a.useCallback(e=>i.$writeImagePickerTabToNode(n,s,e),[n,s]),L=a.useCallback((e,r)=>{w(!1),n.update(()=>{const o=I.$getNodeByKey(s);i.$isImageNode(o)&&(o.setSrc(e),o.setId(r))})},[n,s]),M=a.useCallback(e=>{w(!0);const r=$();b&&b(e[0],(o,l)=>{L(o,l),y(0)},o=>{o&&J.showErrorNotification({message:v("editor.gallery.errorFile")}),y(0),L("","")},r,o=>{y(o)})},[b,$,v,L]);return a.useEffect(()=>n.registerCommand(i.UPLOAD_IMAGE_COMMAND,e=>t!=="upload"||e.targetNodeKey!==s?!1:(M(e.files),!0),I.COMMAND_PRIORITY_LOW),[n,M,s,t]),!t||t==="upload"?u.jsx(O.Box,{"data-editor-image-picker-drop-root":!0,w:"100%",children:u.jsx(i.ImagePicker,{inline:!0,nodeKey:s,defaultTabValue:B,onWriteTabToNode:V,uploading:!1,onUpload:e=>{!b||!e.length||M(e)},popoverProps:{opened:!0,position:"bottom"},onChange:e=>{n.update(()=>{const r=I.$getNodeByKey(s);i.$isImageNode(r)&&r.setSrc(e)})}})}):x?u.jsx(A,{width:d.width,height:d.height,isLoading:W,isError:!1,isIcon:x,src:t,id:p,editor:n,nodeKey:s,fetchDeleteMedia:P,altText:g,imageRef:T,maxWidth:h,showCaption:f,caption:m,isCollabActive:!1,historyState:R,showNestedEditorTreeView:z,t:v}):u.jsx(i.ResizableContainer,{editor:n,isIcon:x,width:i.parseContainerSize(c),height:i.parseContainerSize(C),initialWidth:d.width||"",initialHeight:d.height||"",onResizeEnd:H,alignment:U,children:u.jsx(A,{width:"inherit",height:"inherit",isLoading:W,isError:!1,isIcon:x,src:t,id:p,editor:n,nodeKey:s,fetchDeleteMedia:P,altText:g,imageRef:T,maxWidth:h,showCaption:f,caption:m,isCollabActive:!1,historyState:R,showNestedEditorTreeView:z,t:v})})}exports.default=X;
@@ -1,346 +0,0 @@
1
- import { jsxs as E, Fragment as ce, jsx as n } from "react/jsx-runtime";
2
- import { useRef as M, useEffect as g, useState as L, useCallback as R, useLayoutEffect as fe } from "react";
3
- import { createPortal as Ae } from "react-dom";
4
- import { useTranslation as he } from "react-i18next";
5
- import { i as q, j as F, k as ee, l as Ee, H as ge, n as be, M as _e, o as we, O as Pe } from "./layers.BPvkLXia.js";
6
- import { useLexicalComposerContext as Ce } from "@lexical/react/LexicalComposerContext";
7
- import { LexicalErrorBoundary as G } from "@lexical/react/LexicalErrorBoundary";
8
- import { useLexicalEditable as Ie } from "@lexical/react/useLexicalEditable";
9
- import { Stack as te, Textarea as oe, Button as B, Group as ke } from "@mantine/core";
10
- import { $getNodeByKey as V, COMMAND_PRIORITY_EDITOR as Re } from "lexical";
11
- import qe from "./layers.b9B2NY7n.js";
12
- function W({
13
- equation: c,
14
- inline: a,
15
- onDoubleClick: i
16
- }) {
17
- const r = M(null);
18
- return g(() => {
19
- const d = r.current;
20
- d !== null && qe.render(c, d, {
21
- displayMode: !a,
22
- errorColor: "#cc0000",
23
- output: "html",
24
- strict: "warn",
25
- throwOnError: !1,
26
- trust: !1
27
- });
28
- }, [c, a]), /* @__PURE__ */ E(ce, { children: [
29
- /* @__PURE__ */ n(
30
- "img",
31
- {
32
- src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
33
- width: 0,
34
- height: 0,
35
- alt: ""
36
- }
37
- ),
38
- /* @__PURE__ */ n(
39
- "span",
40
- {
41
- role: "button",
42
- tabIndex: -1,
43
- onDoubleClick: i,
44
- ref: r
45
- }
46
- ),
47
- /* @__PURE__ */ n(
48
- "img",
49
- {
50
- src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
51
- width: 0,
52
- height: 0,
53
- alt: ""
54
- }
55
- )
56
- ] });
57
- }
58
- const ne = 18, xe = 8, re = 20, ae = 25, se = 20;
59
- let ie = !1;
60
- const j = /* @__PURE__ */ new Map();
61
- function Ne(c) {
62
- ie || (ie = !0, c.registerCommand(
63
- Pe,
64
- (a) => {
65
- const i = j.get(a);
66
- return i ? (i(), !0) : !1;
67
- },
68
- Re
69
- ));
70
- }
71
- function Qe({
72
- equation: c,
73
- inline: a,
74
- nodeKey: i
75
- }) {
76
- const [r] = Ce(), d = Ie(), { t: b } = he(), _ = M(null), U = M(null), y = M(null), [m, x] = L(c), [l, f] = L(!1), [$, X] = L({ top: 0, left: 0 }), [D, Y] = L(!1), N = R(() => {
77
- const t = _.current;
78
- if (!t) return;
79
- const s = (t.closest(
80
- ".editor-equation"
81
- ) || t).getBoundingClientRect(), o = ne - (a ? se : 0);
82
- X({
83
- top: s.bottom + o - re + ae,
84
- left: s.left
85
- }), Y(!0);
86
- }, [a]), J = R(() => {
87
- const t = _.current, e = U.current;
88
- if (!t || !e) return;
89
- const o = (t.closest(
90
- ".editor-equation"
91
- ) || t).getBoundingClientRect(), C = e.getBoundingClientRect(), h = C.height, Z = C.width, w = window.visualViewport, T = (w == null ? void 0 : w.height) ?? window.innerHeight, K = (w == null ? void 0 : w.width) ?? window.innerWidth, u = xe, v = ne - (a ? se : 0), Q = o.bottom + v, z = o.top - v - h, ue = Q + h <= T - u, pe = z >= u;
92
- let p, I;
93
- if (ue)
94
- p = Q, I = !0;
95
- else if (pe)
96
- p = z, I = !1;
97
- else {
98
- const de = T - u - (o.bottom + v), me = o.top - v - u;
99
- I = de >= me, p = I ? Q : z, p = Math.max(u, Math.min(p, T - h - u));
100
- }
101
- let k = o.left;
102
- k + Z > K - u && (k = K - Z - u), k = Math.max(u, k), p -= re, I && (p += ae), p = Math.max(u, Math.min(p, T - h - u)), X({ top: p, left: k });
103
- }, [a]);
104
- fe(() => {
105
- if (!l || q || !D) return;
106
- const t = U.current;
107
- if (!t) return;
108
- const e = () => {
109
- J();
110
- };
111
- e();
112
- const s = new ResizeObserver(e);
113
- s.observe(t);
114
- const o = window.visualViewport;
115
- return window.addEventListener("scroll", e, !0), o == null || o.addEventListener("resize", e), o == null || o.addEventListener("scroll", e), () => {
116
- s.disconnect(), window.removeEventListener("scroll", e, !0), o == null || o.removeEventListener("resize", e), o == null || o.removeEventListener("scroll", e);
117
- };
118
- }, [D, l, J]), g(() => {
119
- Ne(r);
120
- }, [r]), g(() => {
121
- const t = () => {
122
- d && f(!0);
123
- };
124
- return j.set(i, t), () => {
125
- j.delete(i);
126
- };
127
- }, [d, i]);
128
- const P = R(() => {
129
- if (d) {
130
- if (l) {
131
- f(!1);
132
- return;
133
- }
134
- N(), f(!0);
135
- }
136
- }, [d, l, N]), H = R(() => {
137
- const t = m.trim();
138
- r.update(() => {
139
- const e = V(i);
140
- if (F(e)) {
141
- if (e.isInline && e.isInline() && t === "") {
142
- e.remove();
143
- return;
144
- }
145
- e.setEquation(t);
146
- }
147
- }), f(!1);
148
- }, [r, i, m]), O = R(() => {
149
- if (!c && a) {
150
- r.update(() => {
151
- const t = V(i);
152
- F(t) && t.remove();
153
- }), f(!1);
154
- return;
155
- }
156
- x(c), f(!1);
157
- }, [r, c, a, i]);
158
- g(() => {
159
- l || x(c);
160
- }, [c, l]), g(() => {
161
- if (!l || q) {
162
- ee(), q || Y(!1);
163
- return;
164
- }
165
- Ee(), N();
166
- const t = window.requestAnimationFrame(() => {
167
- const e = y.current;
168
- if (!e) return;
169
- const s = e.value.length;
170
- e.focus(), e.setSelectionRange(s, s);
171
- });
172
- return () => {
173
- window.cancelAnimationFrame(t), ee();
174
- };
175
- }, [l, N]), g(() => {
176
- if (!l || q) return;
177
- const t = (e) => {
178
- const s = e.target, o = _.current, C = document.querySelector(".equation-block__popup");
179
- s && (o != null && o.contains(s) || C instanceof HTMLElement && C.contains(s)) || (a && !m.trim() && r.update(() => {
180
- const h = V(i);
181
- F(h) && h.remove();
182
- }), f(!1));
183
- };
184
- return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
185
- }, [r, a, l, i, m]);
186
- const A = (l ? m : c).trim(), S = A.length > 0;
187
- g(() => {
188
- const t = _.current;
189
- if (!t) return;
190
- const e = t.closest(".editor-equation");
191
- if (e) {
192
- if (!A) {
193
- e.removeAttribute("data-lexical-equation");
194
- return;
195
- }
196
- try {
197
- const s = btoa(unescape(encodeURIComponent(A)));
198
- e.setAttribute("data-lexical-equation", s);
199
- } catch {
200
- e.setAttribute("data-lexical-equation", A);
201
- }
202
- }
203
- }, [A]);
204
- const le = a && !d ? /* @__PURE__ */ n("span", { className: "equation-inline-trigger", children: /* @__PURE__ */ n(G, { onError: (t) => {
205
- var e;
206
- return (e = r._onError) == null ? void 0 : e.call(r, t);
207
- }, children: /* @__PURE__ */ n(
208
- W,
209
- {
210
- equation: c,
211
- inline: a,
212
- onDoubleClick: P
213
- }
214
- ) }) }) : a ? /* @__PURE__ */ n(
215
- "span",
216
- {
217
- className: `equation-inline-trigger${S ? "" : " equation-inline-trigger--empty"}`,
218
- onClick: P,
219
- ref: _,
220
- children: S ? /* @__PURE__ */ n(G, { onError: (t) => {
221
- var e;
222
- return (e = r._onError) == null ? void 0 : e.call(r, t);
223
- }, children: /* @__PURE__ */ n(
224
- W,
225
- {
226
- equation: A,
227
- inline: a,
228
- onDoubleClick: P
229
- }
230
- ) }) : /* @__PURE__ */ E("span", { className: "equation-inline-placeholder", children: [
231
- /* @__PURE__ */ n(ge, { icon: be, size: 24 }),
232
- /* @__PURE__ */ n("span", { children: "New equation" })
233
- ] })
234
- }
235
- ) : /* @__PURE__ */ n("div", { className: "equation-block", ref: _, children: /* @__PURE__ */ n(
236
- "div",
237
- {
238
- className: "equation-block__container",
239
- onClick: P,
240
- style: { cursor: d ? "pointer" : "default" },
241
- children: S ? /* @__PURE__ */ n(G, { onError: (t) => {
242
- var e;
243
- return (e = r._onError) == null ? void 0 : e.call(r, t);
244
- }, children: /* @__PURE__ */ n(
245
- W,
246
- {
247
- equation: A,
248
- inline: a,
249
- onDoubleClick: P
250
- }
251
- ) }) : /* @__PURE__ */ n("div", { className: "equation-block__placeholder", children: b("editor.menu.equation.placeholder.block") })
252
- }
253
- ) });
254
- return /* @__PURE__ */ E(ce, { children: [
255
- le,
256
- q ? /* @__PURE__ */ n(
257
- _e,
258
- {
259
- opened: l,
260
- onClose: O,
261
- title: b("editor.menu.other.equation.mobileTitle"),
262
- classNames: { content: "equation-mobile-drawer__content" },
263
- children: /* @__PURE__ */ E(te, { gap: "md", children: [
264
- /* @__PURE__ */ n(
265
- oe,
266
- {
267
- autosize: !0,
268
- minRows: 1,
269
- variant: "unstyled",
270
- value: m,
271
- onChange: (t) => {
272
- t.stopPropagation(), x(t.currentTarget.value);
273
- },
274
- placeholder: "x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",
275
- classNames: {
276
- wrapper: "equation-block__textarea-wrapper",
277
- input: "equation-mobile__textarea-input"
278
- },
279
- autoFocus: !0,
280
- ref: y
281
- }
282
- ),
283
- /* @__PURE__ */ E(te, { gap: 8, children: [
284
- /* @__PURE__ */ n(B, { fullWidth: !0, onClick: H, children: b("editor.link.save") }),
285
- /* @__PURE__ */ n(
286
- B,
287
- {
288
- variant: "subtle",
289
- color: "gray",
290
- fullWidth: !0,
291
- onClick: O,
292
- children: b("editor.cancel")
293
- }
294
- )
295
- ] })
296
- ] })
297
- }
298
- ) : l && D && Ae(
299
- /* @__PURE__ */ n(
300
- "div",
301
- {
302
- ref: U,
303
- className: "equation-block__popup",
304
- style: {
305
- position: "fixed",
306
- top: $.top,
307
- left: $.left,
308
- zIndex: 400
309
- },
310
- children: /* @__PURE__ */ E("div", { className: "equation-block__editor", children: [
311
- /* @__PURE__ */ n(
312
- oe,
313
- {
314
- autosize: !0,
315
- minRows: 2,
316
- variant: "unstyled",
317
- value: m,
318
- onChange: (t) => {
319
- t.stopPropagation(), x(t.currentTarget.value);
320
- },
321
- onKeyDown: we({
322
- onConfirm: H,
323
- onCancel: O
324
- }),
325
- placeholder: "x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",
326
- classNames: {
327
- wrapper: "equation-block__textarea-wrapper"
328
- },
329
- autoFocus: !0,
330
- ref: y
331
- }
332
- ),
333
- /* @__PURE__ */ E(ke, { justify: "flex-end", gap: "sm", children: [
334
- /* @__PURE__ */ n(B, { variant: "subtle", color: "gray", onClick: O, children: b("editor.cancel") }),
335
- /* @__PURE__ */ n(B, { onClick: H, children: b("editor.link.save") })
336
- ] })
337
- ] })
338
- }
339
- ),
340
- document.body
341
- )
342
- ] });
343
- }
344
- export {
345
- Qe as default
346
- };
@@ -1 +0,0 @@
1
- "use strict";const t={elements:[],files:{},appState:{},previewSVG:null},r=a=>{try{const e=JSON.parse(a);if(Array.isArray(e))return{...t,elements:e};if(e&&typeof e=="object")return{elements:Array.isArray(e.elements)?e.elements:[],files:e.files&&typeof e.files=="object"?e.files:{},appState:e.appState&&typeof e.appState=="object"?e.appState:{},previewSVG:typeof e.previewSVG=="string"?e.previewSVG:typeof e.previewSvg=="string"?e.previewSvg:null}}catch{}return{...t}},s={en:"en-US",ru:"ru-RU",fr:"fr-FR",de:"de-DE",es:"es-ES",it:"it-IT",pt:"pt-BR",zh:"zh-CN",ja:"ja-JP",ko:"ko-KR",ar:"ar-SA",hi:"hi-IN",nl:"nl-NL",tr:"tr-TR",pl:"pl-PL",sv:"sv-SE",cs:"cs-CZ",uk:"uk-UA",ro:"ro-RO",fi:"fi-FI",da:"da-DK",no:"no-NO",el:"el-GR",he:"he-IL",th:"th-TH",id:"id-ID",ms:"ms-MY",vi:"vi-VN"};exports.languageToLocaleMap=s;exports.parseExcalidrawData=r;
@@ -1,296 +0,0 @@
1
- import { jsx as l, jsxs as Z } from "react/jsx-runtime";
2
- import { useContext as j, useRef as K, useState as p, useEffect as C, useCallback as R } from "react";
3
- import { useTranslation as ee } from "react-i18next";
4
- import { useLexicalComposerContext as te } from "@lexical/react/LexicalComposerContext";
5
- import { Box as ie, LoadingOverlay as oe } from "@mantine/core";
6
- import { $getNodeByKey as S, COMMAND_PRIORITY_LOW as ae, $setSelection as re } from "lexical";
7
- import { showErrorNotification as ne } from "@layers-app/shared";
8
- import { C as B, I as se, u as le, m as z, a as de, b as he, $ as W, c as ue, U as ge, d as me, R as fe, p as y } from "./layers.BPvkLXia.js";
9
- const F = (t) => {
10
- const {
11
- width: d,
12
- height: o,
13
- isLoading: h,
14
- isError: I,
15
- src: u,
16
- id: g,
17
- altText: m,
18
- imageRef: f,
19
- maxWidth: w
20
- } = t;
21
- return /* @__PURE__ */ Z(
22
- "div",
23
- {
24
- className: "media-wrapper",
25
- style: {
26
- width: d,
27
- height: o,
28
- display: "inline-flex",
29
- position: "relative"
30
- },
31
- children: [
32
- /* @__PURE__ */ l(
33
- oe,
34
- {
35
- visible: h,
36
- zIndex: 1e3,
37
- overlayProps: { backgroundOpacity: 0.5 },
38
- loaderProps: { size: 24, color: "black" }
39
- }
40
- ),
41
- /* @__PURE__ */ l(
42
- ce,
43
- {
44
- className: null,
45
- src: u,
46
- altText: m,
47
- imageRef: f,
48
- width: "inherit",
49
- height: "inherit",
50
- maxWidth: w || "auto",
51
- id: g
52
- }
53
- )
54
- ]
55
- }
56
- );
57
- };
58
- function ce({
59
- altText: t,
60
- className: d,
61
- imageRef: o,
62
- src: h,
63
- width: I,
64
- height: u,
65
- maxWidth: g,
66
- id: m
67
- }) {
68
- const [f, w] = p(!1);
69
- return /* @__PURE__ */ l(
70
- "img",
71
- {
72
- className: `${d || void 0} ${f ? "" : "loading"}`,
73
- src: h,
74
- alt: t,
75
- ref: o,
76
- style: {
77
- height: u,
78
- maxWidth: g,
79
- width: I
80
- },
81
- onLoad: () => {
82
- h.includes("splash") ? setTimeout(() => {
83
- w(!0);
84
- }, 100) : w(!0);
85
- },
86
- draggable: "false",
87
- "data-id": m
88
- }
89
- );
90
- }
91
- function Pe(t) {
92
- const { disable: d } = j(B);
93
- return d && se.isPlaceholderSrc(t.src) ? null : /* @__PURE__ */ l(pe, { ...t });
94
- }
95
- function pe({
96
- src: t,
97
- altText: d,
98
- nodeKey: o,
99
- width: h,
100
- height: I,
101
- maxWidth: u,
102
- showCaption: g,
103
- caption: m,
104
- id: f,
105
- create: w,
106
- alignment: V,
107
- imagePickerTab: G
108
- }) {
109
- var H, _;
110
- const A = K(null), [O, b] = p(!0), [a] = te(), [c, L] = p(!0), [s, T] = p({
111
- width: 0,
112
- height: 0
113
- }), { start: U } = le(), [Ie, P] = p(0), { fetchUploadMedia: N, fetchDeleteMedia: $, maxFileSize: we } = j(B), x = z.has(t) && (((H = z.get(t)) == null ? void 0 : H.mediaNodeKeys.length) === 0 || ((_ = z.get(t)) == null ? void 0 : _.mediaNodeKeys.length) === void 0 || t.trim() === ""), { t: v } = ee(), [be, Y] = p(0);
114
- C(() => a.registerDecoratorListener(() => {
115
- Y((e) => e + 1);
116
- }), [x]), C(() => {
117
- if (!t || t.startsWith("data:image/") || !t.trim()) {
118
- b(!1);
119
- return;
120
- }
121
- const e = new Image();
122
- e.src = t, e.onload = () => b(!1), e.onerror = () => {
123
- b(!1);
124
- };
125
- }, [t, x]);
126
- const q = (e, r) => {
127
- a.update(() => {
128
- re(null);
129
- const i = S(o);
130
- W(i) && i.setWidthAndHeight(e, r);
131
- });
132
- }, { historyState: k } = de(), {
133
- settings: { showNestedEditorTreeView: D }
134
- } = he();
135
- function J(e) {
136
- return e.endsWith(".svg") || e.includes("image/svg+xml");
137
- }
138
- function Q(e) {
139
- return new Promise((r, i) => {
140
- if (J(e)) {
141
- r(0);
142
- return;
143
- }
144
- const n = new Image();
145
- n.src = e, n.onload = () => {
146
- r(n.width);
147
- }, n.onerror = () => {
148
- i(new Error("Failed to load image"));
149
- };
150
- });
151
- }
152
- C(() => {
153
- let e = h, r = I, i = 100;
154
- (t.includes("unsplash") ? t.trim() : !x && t.trim() || t.includes("upload-src-editor")) && t !== "upload" && Q(t).then((n) => {
155
- typeof e == "number" && e < i && n < i ? (L(!0), T({
156
- width: e,
157
- height: r
158
- })) : n < i ? (L(!0), T({
159
- width: "auto",
160
- height: "auto"
161
- })) : (T({
162
- width: n,
163
- height: n
164
- }), L(!1));
165
- }).catch((n) => {
166
- console.warn("Ошибка при загрузке изображения:", n.message);
167
- });
168
- }, [t, x]), C(() => {
169
- s.width && s.height && c && a.update(() => {
170
- const e = S(o);
171
- W(e) && e.setWidthAndHeight(s.width, s.height);
172
- });
173
- }, [s.width, s.height, c]);
174
- const X = R(
175
- (e) => ue(a, o, e),
176
- [a, o]
177
- ), E = R(
178
- (e, r) => {
179
- b(!1), a.update(() => {
180
- const i = S(o);
181
- W(i) && (i.setSrc(e), i.setId(r));
182
- });
183
- },
184
- [a, o]
185
- ), M = R(
186
- (e) => {
187
- b(!0);
188
- const r = U();
189
- N && N(
190
- e[0],
191
- (i, n) => {
192
- E(i, n), P(0);
193
- },
194
- (i) => {
195
- i && ne({
196
- message: v("editor.gallery.errorFile")
197
- }), P(0), E("", "");
198
- },
199
- r,
200
- (i) => {
201
- P(i);
202
- }
203
- );
204
- },
205
- [N, U, v, E]
206
- );
207
- return C(() => a.registerCommand(
208
- ge,
209
- (e) => t !== "upload" || e.targetNodeKey !== o ? !1 : (M(e.files), !0),
210
- ae
211
- ), [a, M, o, t]), !t || t === "upload" ? /* @__PURE__ */ l(ie, { "data-editor-image-picker-drop-root": !0, w: "100%", children: /* @__PURE__ */ l(
212
- me,
213
- {
214
- inline: !0,
215
- nodeKey: o,
216
- defaultTabValue: G,
217
- onWriteTabToNode: X,
218
- uploading: !1,
219
- onUpload: (e) => {
220
- !N || !e.length || M(e);
221
- },
222
- popoverProps: {
223
- opened: !0,
224
- position: "bottom"
225
- },
226
- onChange: (e) => {
227
- a.update(() => {
228
- const r = S(o);
229
- W(r) && r.setSrc(e);
230
- });
231
- }
232
- }
233
- ) }) : c ? /* @__PURE__ */ l(
234
- F,
235
- {
236
- width: s.width,
237
- height: s.height,
238
- isLoading: O,
239
- isError: !1,
240
- isIcon: c,
241
- src: t,
242
- id: f,
243
- editor: a,
244
- nodeKey: o,
245
- fetchDeleteMedia: $,
246
- altText: d,
247
- imageRef: A,
248
- maxWidth: u,
249
- showCaption: g,
250
- caption: m,
251
- isCollabActive: !1,
252
- historyState: k,
253
- showNestedEditorTreeView: D,
254
- t: v
255
- }
256
- ) : /* @__PURE__ */ l(
257
- fe,
258
- {
259
- editor: a,
260
- isIcon: c,
261
- width: y(h),
262
- height: y(I),
263
- initialWidth: s.width || "",
264
- initialHeight: s.height || "",
265
- onResizeEnd: q,
266
- alignment: V,
267
- children: /* @__PURE__ */ l(
268
- F,
269
- {
270
- width: "inherit",
271
- height: "inherit",
272
- isLoading: O,
273
- isError: !1,
274
- isIcon: c,
275
- src: t,
276
- id: f,
277
- editor: a,
278
- nodeKey: o,
279
- fetchDeleteMedia: $,
280
- altText: d,
281
- imageRef: A,
282
- maxWidth: u,
283
- showCaption: g,
284
- caption: m,
285
- isCollabActive: !1,
286
- historyState: k,
287
- showNestedEditorTreeView: D,
288
- t: v
289
- }
290
- )
291
- }
292
- );
293
- }
294
- export {
295
- Pe as default
296
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),se=require("react-dom"),ae=require("react-i18next"),c=require("./layers.D0X8KZzh.js"),ce=require("@lexical/react/LexicalComposerContext"),M=require("@lexical/react/LexicalErrorBoundary"),ie=require("@lexical/react/useLexicalEditable"),A=require("@mantine/core"),T=require("lexical"),le=require("./layers.R8mPlCA0.js");function H({equation:u,inline:a,onDoubleClick:l}){const s=r.useRef(null);return r.useEffect(()=>{const m=s.current;m!==null&&le.default.render(u,m,{displayMode:!a,errorColor:"#cc0000",output:"html",strict:"warn",throwOnError:!1,trust:!1})},[u,a]),n.jsxs(n.Fragment,{children:[n.jsx("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",width:0,height:0,alt:""}),n.jsx("span",{role:"button",tabIndex:-1,onDoubleClick:l,ref:s}),n.jsx("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",width:0,height:0,alt:""})]})}const X=18,ue=8,Y=20,J=25,Z=20;let K=!1;const V=new Map;function de(u){K||(K=!0,u.registerCommand(c.OPEN_EQUATION_POPUP_COMMAND,a=>{const l=V.get(a);return l?(l(),!0):!1},T.COMMAND_PRIORITY_EDITOR))}function pe({equation:u,inline:a,nodeKey:l}){const[s]=ce.useLexicalComposerContext(),m=ie.useLexicalEditable(),{t:b}=ae.useTranslation(),C=r.useRef(null),B=r.useRef(null),L=r.useRef(null),[E,R]=r.useState(u),[d,h]=r.useState(!1),[F,Q]=r.useState({top:0,left:0}),[S,$]=r.useState(!1),j=r.useCallback(()=>{const t=C.current;if(!t)return;const i=(t.closest(".editor-equation")||t).getBoundingClientRect(),o=X-(a?Z:0);Q({top:i.bottom+o-Y+J,left:i.left}),$(!0)},[a]),z=r.useCallback(()=>{const t=C.current,e=B.current;if(!t||!e)return;const o=(t.closest(".editor-equation")||t).getBoundingClientRect(),P=e.getBoundingClientRect(),g=P.height,G=P.width,_=window.visualViewport,O=(_==null?void 0:_.height)??window.innerHeight,W=(_==null?void 0:_.width)??window.innerWidth,p=ue,N=X-(a?Z:0),U=o.bottom+N,D=o.top-N-g,te=U+g<=O-p,ne=D>=p;let f,q;if(te)f=U,q=!0;else if(ne)f=D,q=!1;else{const oe=O-p-(o.bottom+N),re=o.top-N-p;q=oe>=re,f=q?U:D,f=Math.max(p,Math.min(f,O-g-p))}let I=o.left;I+G>W-p&&(I=W-G-p),I=Math.max(p,I),f-=Y,q&&(f+=J),f=Math.max(p,Math.min(f,O-g-p)),Q({top:f,left:I})},[a]);r.useLayoutEffect(()=>{if(!d||c.IS_TOUCH_DEVICE||!S)return;const t=B.current;if(!t)return;const e=()=>{z()};e();const i=new ResizeObserver(e);i.observe(t);const o=window.visualViewport;return window.addEventListener("scroll",e,!0),o==null||o.addEventListener("resize",e),o==null||o.addEventListener("scroll",e),()=>{i.disconnect(),window.removeEventListener("scroll",e,!0),o==null||o.removeEventListener("resize",e),o==null||o.removeEventListener("scroll",e)}},[S,d,z]),r.useEffect(()=>{de(s)},[s]),r.useEffect(()=>{const t=()=>{m&&h(!0)};return V.set(l,t),()=>{V.delete(l)}},[m,l]);const w=r.useCallback(()=>{if(m){if(d){h(!1);return}j(),h(!0)}},[m,d,j]),y=r.useCallback(()=>{const t=E.trim();s.update(()=>{const e=T.$getNodeByKey(l);if(c.$isEquationNode(e)){if(e.isInline&&e.isInline()&&t===""){e.remove();return}e.setEquation(t)}}),h(!1)},[s,l,E]),k=r.useCallback(()=>{if(!u&&a){s.update(()=>{const t=T.$getNodeByKey(l);c.$isEquationNode(t)&&t.remove()}),h(!1);return}R(u),h(!1)},[s,u,a,l]);r.useEffect(()=>{d||R(u)},[u,d]),r.useEffect(()=>{if(!d||c.IS_TOUCH_DEVICE){c.unblockScroll(),c.IS_TOUCH_DEVICE||$(!1);return}c.blockScroll(),j();const t=window.requestAnimationFrame(()=>{const e=L.current;if(!e)return;const i=e.value.length;e.focus(),e.setSelectionRange(i,i)});return()=>{window.cancelAnimationFrame(t),c.unblockScroll()}},[d,j]),r.useEffect(()=>{if(!d||c.IS_TOUCH_DEVICE)return;const t=e=>{const i=e.target,o=C.current,P=document.querySelector(".equation-block__popup");i&&(o!=null&&o.contains(i)||P instanceof HTMLElement&&P.contains(i))||(a&&!E.trim()&&s.update(()=>{const g=T.$getNodeByKey(l);c.$isEquationNode(g)&&g.remove()}),h(!1))};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[s,a,d,l,E]);const x=(d?E:u).trim(),v=x.length>0;r.useEffect(()=>{const t=C.current;if(!t)return;const e=t.closest(".editor-equation");if(e){if(!x){e.removeAttribute("data-lexical-equation");return}try{const i=btoa(unescape(encodeURIComponent(x)));e.setAttribute("data-lexical-equation",i)}catch{e.setAttribute("data-lexical-equation",x)}}},[x]);const ee=a&&!m?n.jsx("span",{className:"equation-inline-trigger",children:n.jsx(M.LexicalErrorBoundary,{onError:t=>{var e;return(e=s._onError)==null?void 0:e.call(s,t)},children:n.jsx(H,{equation:u,inline:a,onDoubleClick:w})})}):a?n.jsx("span",{className:`equation-inline-trigger${v?"":" equation-inline-trigger--empty"}`,onClick:w,ref:C,children:v?n.jsx(M.LexicalErrorBoundary,{onError:t=>{var e;return(e=s._onError)==null?void 0:e.call(s,t)},children:n.jsx(H,{equation:x,inline:a,onDoubleClick:w})}):n.jsxs("span",{className:"equation-inline-placeholder",children:[n.jsx(c.HugeiconsIcon,{icon:c.$tr,size:24}),n.jsx("span",{children:"New equation"})]})}):n.jsx("div",{className:"equation-block",ref:C,children:n.jsx("div",{className:"equation-block__container",onClick:w,style:{cursor:m?"pointer":"default"},children:v?n.jsx(M.LexicalErrorBoundary,{onError:t=>{var e;return(e=s._onError)==null?void 0:e.call(s,t)},children:n.jsx(H,{equation:x,inline:a,onDoubleClick:w})}):n.jsx("div",{className:"equation-block__placeholder",children:b("editor.menu.equation.placeholder.block")})})});return n.jsxs(n.Fragment,{children:[ee,c.IS_TOUCH_DEVICE?n.jsx(c.MobileDrawer,{opened:d,onClose:k,title:b("editor.menu.other.equation.mobileTitle"),classNames:{content:"equation-mobile-drawer__content"},children:n.jsxs(A.Stack,{gap:"md",children:[n.jsx(A.Textarea,{autosize:!0,minRows:1,variant:"unstyled",value:E,onChange:t=>{t.stopPropagation(),R(t.currentTarget.value)},placeholder:"x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",classNames:{wrapper:"equation-block__textarea-wrapper",input:"equation-mobile__textarea-input"},autoFocus:!0,ref:L}),n.jsxs(A.Stack,{gap:8,children:[n.jsx(A.Button,{fullWidth:!0,onClick:y,children:b("editor.link.save")}),n.jsx(A.Button,{variant:"subtle",color:"gray",fullWidth:!0,onClick:k,children:b("editor.cancel")})]})]})}):d&&S&&se.createPortal(n.jsx("div",{ref:B,className:"equation-block__popup",style:{position:"fixed",top:F.top,left:F.left,zIndex:400},children:n.jsxs("div",{className:"equation-block__editor",children:[n.jsx(A.Textarea,{autosize:!0,minRows:2,variant:"unstyled",value:E,onChange:t=>{t.stopPropagation(),R(t.currentTarget.value)},onKeyDown:c.createPopupKeyDownHandler({onConfirm:y,onCancel:k}),placeholder:"x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",classNames:{wrapper:"equation-block__textarea-wrapper"},autoFocus:!0,ref:L}),n.jsxs(A.Group,{justify:"flex-end",gap:"sm",children:[n.jsx(A.Button,{variant:"subtle",color:"gray",onClick:k,children:b("editor.cancel")}),n.jsx(A.Button,{onClick:y,children:b("editor.link.save")})]})]})}),document.body)]})}exports.default=pe;