@layers-app/editor 0.7.65 → 0.7.66

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 (224) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +0 -9
  3. package/dist/index.js +4 -4
  4. package/dist/{layers.CcXmrDE1.js → layers.3QTo5o15.js} +1 -1
  5. package/dist/{layers.Do8i3xUE.js → layers.3YEE22Mk.js} +1 -1
  6. package/dist/{layers.Bzz2rASW.js → layers.4GNijh6t.js} +3 -3
  7. package/dist/{layers.Xr01ChcN.js → layers.7GRw0JV8.js} +1 -1
  8. package/dist/{layers.CAzsMIrH.js → layers.8eglOpZg.js} +4 -4
  9. package/dist/{layers.BwADj-O6.js → layers.9YrcXLCx.js} +1 -1
  10. package/dist/{layers.B2317_ZM.js → layers.B-gj-Dc8.js} +1 -1
  11. package/dist/{layers.D_k3uig8.js → layers.B0mQfM_7.js} +4 -4
  12. package/dist/{layers.BjdyHDbt.js → layers.B0uGvpXI.js} +1 -1
  13. package/dist/{layers.D4wOu0Zw.js → layers.B2QpNG6M.js} +1 -1
  14. package/dist/{layers.BSQyuUJG.js → layers.B4unb-lk.js} +1 -1
  15. package/dist/{layers.BSrBUqjU.js → layers.B5fYtTZT.js} +1 -1
  16. package/dist/{layers.CigjfBfH.js → layers.B7xQ9Bfy.js} +1 -1
  17. package/dist/{layers.DrVubpIj.js → layers.BA-11n7e.js} +1 -1
  18. package/dist/layers.BBF8yJ7K.js +1 -0
  19. package/dist/{layers.Bowdlm-5.js → layers.BE2v4SI1.js} +1 -1
  20. package/dist/{layers.CJGtUfLy.js → layers.BEtni9Q9.js} +3 -3
  21. package/dist/{layers.Cjy_Kuuf.js → layers.BFE-alwC.js} +1 -1
  22. package/dist/{layers.C5bmbQjc.js → layers.BFpmz0jf.js} +1 -1
  23. package/dist/{layers.Bep_3_5p.js → layers.BGWnNvfv.js} +1 -1
  24. package/dist/{layers.D9h-IxjW.js → layers.BGqpw-G8.js} +2 -2
  25. package/dist/{layers.6ktpMh5U.js → layers.BH_ae3SK.js} +1 -1
  26. package/dist/{layers.BG5AmoNd.js → layers.BJZMWw1r.js} +4 -4
  27. package/dist/{layers.B_MPT8Un.js → layers.BKLGHV1G.js} +1 -1
  28. package/dist/{layers.BT0tF7XN.js → layers.BP0Yk3nT.js} +1 -1
  29. package/dist/{layers.D9WX0rBf.js → layers.BQ2GdNHj.js} +1 -1
  30. package/dist/{layers.Bnbf9zn-.js → layers.BS5c-XRP.js} +1 -1
  31. package/dist/{layers.DJp9mbDw.js → layers.BUBqrcAN.js} +1 -1
  32. package/dist/{layers.C2XY7ddn.js → layers.BWl36pbb.js} +2 -2
  33. package/dist/{layers.BSurQ0go.js → layers.BXlVYam7.js} +1 -1
  34. package/dist/{layers.ty3px4y6.js → layers.BXtEOnC6.js} +1 -1
  35. package/dist/{layers.BuglBX77.js → layers.BYH3Kroe.js} +1 -1
  36. package/dist/{layers.C9bfFS-m.js → layers.BZ7MbQ5s.js} +1 -1
  37. package/dist/{layers.CMF0baBb.js → layers.BZrat4JT.js} +2 -2
  38. package/dist/{layers.CGDUhM_c.js → layers.B_4A9kFO.js} +1 -1
  39. package/dist/{layers.C7lOrmvp.js → layers.B_VfNyr8.js} +1 -1
  40. package/dist/{layers.BN1XFcxU.js → layers.B_rGlD5Q.js} +1 -1
  41. package/dist/{layers.CsQInoZf.js → layers.BaldGe_p.js} +1 -1
  42. package/dist/{layers.BgXhskt1.js → layers.BbMQXyBa.js} +1 -1
  43. package/dist/{layers.5V_J5q1f.js → layers.BcDhm33-.js} +1 -1
  44. package/dist/{layers.C6RU-G6e.js → layers.BcqOvuux.js} +1 -1
  45. package/dist/{layers.CVjkDD55.js → layers.BemQxE4r.js} +1 -1
  46. package/dist/layers.BexCcE7c.js +213 -0
  47. package/dist/{layers.BdWVgWiZ.js → layers.Bg4fDHxu.js} +1 -1
  48. package/dist/layers.BhbuA69c.js +1 -0
  49. package/dist/{layers.CwVen601.js → layers.BieQPNJX.js} +6 -6
  50. package/dist/{layers.B9j_N16l.js → layers.Bj3iwHlt.js} +4 -4
  51. package/dist/{layers.DylhMZsh.js → layers.BjdpFdaF.js} +4 -4
  52. package/dist/{layers.lmdY5L0V.js → layers.BlUlBkhp.js} +1 -1
  53. package/dist/{layers.BI1gUI-r.js → layers.BmLJ78sm.js} +1 -1
  54. package/dist/{layers.fb6SRbvV.js → layers.BnkHC_Oc.js} +1 -1
  55. package/dist/{layers.5rKT6j8r.js → layers.BqE1cEL_.js} +1 -1
  56. package/dist/{layers.DwAVuknl.js → layers.Bvz5P3lQ.js} +1 -1
  57. package/dist/{layers.B4aO-g4C.js → layers.Bwsv13Sa.js} +1 -1
  58. package/dist/{layers.Dim2CqHl.js → layers.BxX8NFri.js} +1 -1
  59. package/dist/{layers.DBrAWZUm.js → layers.By1AAp3-.js} +1 -1
  60. package/dist/{layers.0CM_qJjC.js → layers.ByAfdCHR.js} +7 -7
  61. package/dist/{layers.CdtHI9me.js → layers.ByWtFcWr.js} +1 -1
  62. package/dist/{layers.BBM4-YpW.js → layers.Bz7NH3Ja.js} +1 -1
  63. package/dist/{layers.DMgX-UEL.js → layers.BzXmprv5.js} +1 -1
  64. package/dist/{layers.BZFCh8XT.js → layers.C0ZmXPkk.js} +1 -1
  65. package/dist/{layers.De1CxG12.js → layers.C1ETK2KG.js} +1 -1
  66. package/dist/{layers.O01HEoW5.js → layers.C1PDlE34.js} +1 -1
  67. package/dist/{layers.CMudsIHl.js → layers.C2GnCJcv.js} +1 -1
  68. package/dist/{layers.CR3lwFpT.js → layers.C33jsIpE.js} +1 -1
  69. package/dist/{layers.eN_P1yYw.js → layers.C3903-fE.js} +1 -1
  70. package/dist/{layers.DeM2Gci8.js → layers.C42FV38m.js} +1 -1
  71. package/dist/{layers.CvDmCLh7.js → layers.C61WP72S.js} +3 -3
  72. package/dist/{layers.DDwq9y5k.js → layers.C6Tz5MCO.js} +1 -1
  73. package/dist/{layers.B67b-gaQ.js → layers.C7E8L6Xs.js} +4 -4
  74. package/dist/{layers.moYyxH_O.js → layers.C7WBszjx.js} +1 -1
  75. package/dist/{layers.A7Bs5T4F.js → layers.CBLL2LbE.js} +4 -4
  76. package/dist/{layers.CwTNKqe6.js → layers.CBMAZyP_.js} +1 -1
  77. package/dist/{layers.DHsqnWUs.js → layers.CCXdskK_.js} +1 -1
  78. package/dist/{layers.DcqLYT3y.js → layers.CDQemUkt.js} +1 -1
  79. package/dist/{layers.1EJbIfPW.js → layers.CGKEyQWx.js} +1 -1
  80. package/dist/{layers.DiKILn3E.js → layers.CGX9i522.js} +1 -1
  81. package/dist/{layers.CRn9cN6j.js → layers.CGkRi77t.js} +1 -1
  82. package/dist/{layers.DeLlmvdb.js → layers.CHD1zSYI.js} +1 -1
  83. package/dist/layers.CImef2Q4.js +1 -0
  84. package/dist/{layers.DYWAXnla.js → layers.CJO6gwir.js} +1 -1
  85. package/dist/{layers.DnilL9o_.js → layers.CKcjoLju.js} +1 -1
  86. package/dist/{layers.CVA7frBw.js → layers.CKgU8T7B.js} +1 -1
  87. package/dist/{layers.X81Myf6N.js → layers.CKmdrueW.js} +1 -1
  88. package/dist/{layers.YtIPDc_z.js → layers.CKy8MSLQ.js} +1 -1
  89. package/dist/{layers.BzR706O8.js → layers.CLU_XAad.js} +2 -2
  90. package/dist/{layers.4-6uPiZq.js → layers.CLiiWpJP.js} +1 -1
  91. package/dist/{layers.D3rCkuw-.js → layers.CLk3-xN-.js} +1 -1
  92. package/dist/{layers.Bi0Y8wqJ.js → layers.COBbOMbH.js} +1 -1
  93. package/dist/{layers.CDbrKIso.js → layers.COujLsln.js} +1 -1
  94. package/dist/{layers.BJHBikgX.js → layers.CPFZSGGh.js} +1 -1
  95. package/dist/{layers.CpFIW0sT.js → layers.CPrw4tSM.js} +4 -4
  96. package/dist/{layers.BY9IHzZX.js → layers.CSIz9FYs.js} +3 -3
  97. package/dist/{layers.zRX_KzR5.js → layers.CTmULLmg.js} +1 -1
  98. package/dist/{layers.zXAhyYfC.js → layers.CWVhbDR5.js} +2 -2
  99. package/dist/{layers.D29U8vj5.js → layers.Ca8Ub3pv.js} +1 -1
  100. package/dist/{layers.vxeiC96N.js → layers.CaCwyFce.js} +1 -1
  101. package/dist/{layers.ClY16p5b.js → layers.Cb18TKKb.js} +1 -1
  102. package/dist/layers.Cb7NfWSf.js +1 -0
  103. package/dist/{layers.D-XTNlrE.js → layers.Cbg5CZgX.js} +1 -1
  104. package/dist/{layers.md58J52I.js → layers.Cc7OCiEY.js} +1 -1
  105. package/dist/{layers.CpRTXkZx.js → layers.CcDpPRa3.js} +1 -1
  106. package/dist/{layers.CzFutfh-.js → layers.CcElfU4_.js} +1 -1
  107. package/dist/{layers.BTTkcUie.js → layers.ChbuRCNy.js} +1 -1
  108. package/dist/{layers.D4zv_sXo.js → layers.Ckv7p0Cl.js} +1 -1
  109. package/dist/{layers.CLWAiws9.js → layers.Cl_YVr0L.js} +1 -1
  110. package/dist/{layers.BbQV7ppZ.js → layers.CmoYcxXL.js} +3 -3
  111. package/dist/{layers.CoL12aBR.js → layers.CoGKSwpz.js} +3 -3
  112. package/dist/{layers.C3Ebak9C.js → layers.CrQV5evf.js} +1 -1
  113. package/dist/{layers.rPk2h-z7.js → layers.Cs-Qm16B.js} +1 -1
  114. package/dist/{layers.2w6v7FYB.js → layers.CutJsscp.js} +1 -1
  115. package/dist/layers.CvcZAwPC.js +1 -0
  116. package/dist/{layers.gyGGlR3I.js → layers.CxndOEZr.js} +1 -1
  117. package/dist/{layers.DVkmtTGY.js → layers.CzvGodqc.js} +1 -1
  118. package/dist/{layers.B0o1mJp3.js → layers.D-7CRcBZ.js} +1 -1
  119. package/dist/{layers.BuA9cC-B.js → layers.D05CXxB9.js} +1 -1
  120. package/dist/{layers.CUYP2m2D.js → layers.D0Cjrep0.js} +1 -1
  121. package/dist/{layers.B23b_kWf.js → layers.D0G30ty5.js} +5 -5
  122. package/dist/{layers.DRkExZyY.js → layers.D5P0WNvc.js} +1 -1
  123. package/dist/{layers.DqswN752.js → layers.D6TmtPfA.js} +1 -1
  124. package/dist/{layers.ibzB_7uL.js → layers.D73NqqYr.js} +1 -1
  125. package/dist/layers.D8f0gMfA.js +1 -0
  126. package/dist/{layers.BDJPHJFD.js → layers.DB-bRmCR.js} +1 -1
  127. package/dist/{layers.LMBD5WP6.js → layers.DCkAMq7J.js} +1 -1
  128. package/dist/{layers.B1F3xcln.js → layers.DCtyhmyY.js} +1 -1
  129. package/dist/{layers.BpGsmjO0.js → layers.DDO74hkK.js} +1 -1
  130. package/dist/layers.DDTcQc3-.js +8 -0
  131. package/dist/{layers.C3nJL_mk.js → layers.DEqYQU2G.js} +1 -1
  132. package/dist/{layers.DTrT0gZ7.js → layers.DFWMI5T9.js} +1 -1
  133. package/dist/{layers.DPieZXnh.js → layers.DFoutOw5.js} +1 -1
  134. package/dist/{layers.DAP7KkqI.js → layers.DGhyc9fD.js} +1 -1
  135. package/dist/{layers.IQ7hEiwp.js → layers.DGkNq70x.js} +1 -1
  136. package/dist/{layers.Cb2zfOK5.js → layers.DIBD80Su.js} +1 -1
  137. package/dist/{layers.3B0DBr4y.js → layers.DJCArebj.js} +1 -1
  138. package/dist/{layers.DtkfGQHD.js → layers.DJzRyUL9.js} +1 -1
  139. package/dist/{layers.BUyK6U6W.js → layers.DLU6YNaQ.js} +1 -1
  140. package/dist/{layers.Dy6q9eRK.js → layers.DNmH6yCl.js} +1 -1
  141. package/dist/{layers.DXkz47LQ.js → layers.DPRegaV-.js} +3 -3
  142. package/dist/{layers.Y-SSO8sM.js → layers.DPSZnsnE.js} +1 -1
  143. package/dist/{layers.DAf1DFSL.js → layers.DSAU81oH.js} +24 -24
  144. package/dist/{layers.DfByh4md.js → layers.DT1iTzdJ.js} +1 -1
  145. package/dist/{layers.DVgebCja.js → layers.DTlOqZvL.js} +1 -1
  146. package/dist/{layers.BrrJNgYQ.js → layers.DUDJ9Y4L.js} +8 -8
  147. package/dist/layers.DUIEminS.js +6 -0
  148. package/dist/{layers.CaHY4GRf.js → layers.DUxRk8L1.js} +1 -1
  149. package/dist/{layers.CcIfmKuH.js → layers.DVcwS5K-.js} +1 -1
  150. package/dist/{layers.Dbwb0-D6.js → layers.DVekwusD.js} +1 -1
  151. package/dist/layers.DWhv7F59.js +271 -0
  152. package/dist/{layers.Dhnu7hc0.js → layers.DYXwUH9e.js} +1 -1
  153. package/dist/{layers.Du__0TwC.js → layers.DYZDcvsd.js} +1 -1
  154. package/dist/{layers.ieGhX84c.js → layers.DYtT_2W_.js} +1 -1
  155. package/dist/{layers.eGNOo-ny.js → layers.DaekqInu.js} +1 -1
  156. package/dist/{layers.O1cmXr_W.js → layers.DayLOzeL.js} +1 -1
  157. package/dist/{layers.CnCus7Rr.js → layers.DdDhojq5.js} +3 -3
  158. package/dist/{layers.D_Ylh1Aw.js → layers.DdfcOJU0.js} +1 -1
  159. package/dist/{layers.Cw_ZI-Hq.js → layers.DdmoW3mc.js} +1 -1
  160. package/dist/layers.Dh_PSzU8.js +295 -0
  161. package/dist/layers.DituWlSm.js +1 -0
  162. package/dist/{layers.D66C6bLX.js → layers.Dkw-9t5C.js} +1 -1
  163. package/dist/{layers.9-KEaHkX.js → layers.Dl0FDpvW.js} +1 -1
  164. package/dist/layers.Dn1BTkKc.js +296 -0
  165. package/dist/{layers.D0RlfUJk.js → layers.DnQ9UMTA.js} +1 -1
  166. package/dist/{layers.7lP4HfoY.js → layers.Do3m_wfd.js} +1 -1
  167. package/dist/{layers.M-XOP0a5.js → layers.DpTbRUsM.js} +1 -1
  168. package/dist/layers.DrT4hDgx.js +129 -0
  169. package/dist/{layers.B3U2x_im.js → layers.DvilG5XZ.js} +1 -1
  170. package/dist/{layers.By0alzDr.js → layers.Dvt10_k0.js} +1 -1
  171. package/dist/layers.Dwr0t7IY.js +76 -0
  172. package/dist/{layers.Dt67PG6_.js → layers.DwrvpNkZ.js} +1 -1
  173. package/dist/{layers.u1CXiRKf.js → layers.DxLW-X_k.js} +1 -1
  174. package/dist/{layers.BCjvXR-y.js → layers.Dz4Dlb5F.js} +1 -1
  175. package/dist/{layers.BdLga8Nv.js → layers.G20tZlua.js} +1 -1
  176. package/dist/{layers.D6VP7MGr.js → layers.GQitM6w0.js} +1 -1
  177. package/dist/{layers.nAFrm5dJ.js → layers.GSikSHLI.js} +5 -5
  178. package/dist/{layers.Cj71cT8B.js → layers.LUsmvTUU.js} +1 -1
  179. package/dist/{layers.36zLwGBX.js → layers.NZbUzxh7.js} +1 -1
  180. package/dist/{layers.DJ0Wt_yu.js → layers.NZomDfcb.js} +4 -4
  181. package/dist/{layers.DXZgdRaQ.js → layers.O5z0GxDA.js} +1 -1
  182. package/dist/{layers.DiBi3-Wq.js → layers.PPRoUsAA.js} +1 -1
  183. package/dist/{layers.BUoM2Djz.js → layers.SLhPj_vV.js} +1 -1
  184. package/dist/{layers.BovSaTul.js → layers.ULeHg9zF.js} +1 -1
  185. package/dist/{layers.BM4acNbd.js → layers.Uo41Zp6F.js} +1 -1
  186. package/dist/{layers.zw6to3dF.js → layers.VO-7tMgV.js} +1 -1
  187. package/dist/{layers.C0waNfPB.js → layers.XL1rVltq.js} +1 -1
  188. package/dist/{layers.BvVxoAL-.js → layers.ZG9uhmWq.js} +1 -1
  189. package/dist/{layers.BDvXHQ8J.js → layers._o7boybA.js} +3 -3
  190. package/dist/{layers.BpfywZry.js → layers.bGVTEvFL.js} +1 -1
  191. package/dist/{layers.C4buKlCY.js → layers.bULRDowV.js} +4 -4
  192. package/dist/{layers.B4d8F6-j.js → layers.cHJyX5TP.js} +1 -1
  193. package/dist/{layers.BZd8VMlu.js → layers.cRpc9s53.js} +1 -1
  194. package/dist/{layers.BoMp3OS4.js → layers.eCTjZNfq.js} +1 -1
  195. package/dist/{layers.Ce-0cdvb.js → layers.eic5RVID.js} +1 -1
  196. package/dist/{layers.CKclLE5M.js → layers.fjqhJnO5.js} +3 -3
  197. package/dist/{layers.16EOCl2I.js → layers.hL7X5WQk.js} +1 -1
  198. package/dist/{layers.Clo6iX6B.js → layers.jTxzmm6D.js} +17675 -20445
  199. package/dist/{layers.BO6qsinL.js → layers.lkZWWku3.js} +1 -1
  200. package/dist/{layers.B98Li_m6.js → layers.ocXfhHqM.js} +1 -1
  201. package/dist/{layers.pKZp612W.js → layers.ri6EcUvz.js} +1 -1
  202. package/dist/{layers.DgGfSvTo.js → layers.rpjmq36c.js} +1 -1
  203. package/dist/{layers.mRLmPtDn.js → layers.svV_8pUP.js} +1 -1
  204. package/dist/{layers.De7rbtGA.js → layers.tMU6Ekb2.js} +3 -3
  205. package/dist/{layers.BYyKqky6.js → layers.vGcIPp04.js} +1 -1
  206. package/dist/{layers.Dl4T5_W-.js → layers.vJ-PLTQm.js} +1 -1
  207. package/dist/{layers.BkRg-ZTB.js → layers.x6Y0uO3K.js} +1 -1
  208. package/dist/{layers.CRtDdBVn.js → layers.ySNGTcm_.js} +1 -1
  209. package/dist/layers.yfFwHxeD.js +7 -0
  210. package/package.json +21 -46
  211. package/dist/layers.B4loBz9c.js +0 -1
  212. package/dist/layers.BAXEf8k3.js +0 -296
  213. package/dist/layers.BI9tBjOV.js +0 -1
  214. package/dist/layers.BrnLqwEP.js +0 -8
  215. package/dist/layers.BshYKlFH.js +0 -7
  216. package/dist/layers.BzFHkdth.js +0 -1
  217. package/dist/layers.C3xcgWg4.js +0 -471
  218. package/dist/layers.CmmYt3Ou.js +0 -1
  219. package/dist/layers.DAe5qYOU.js +0 -1
  220. package/dist/layers.DilA0qnM.js +0 -54
  221. package/dist/layers.DjZneq0V.js +0 -1
  222. package/dist/layers.Ds0KxrEv.js +0 -17
  223. package/dist/layers.TOlqWs5X.js +0 -129
  224. package/dist/layers.z69yXrSR.js +0 -6
@@ -1,471 +0,0 @@
1
- import { jsx as o, jsxs as W, Fragment as te } from "react/jsx-runtime";
2
- import { useMemo as K, useState as k, useRef as j, useEffect as B, useCallback as _, Suspense as ne, lazy as oe } from "react";
3
- import { useLexicalComposerContext as re } from "@lexical/react/LexicalComposerContext";
4
- import { useLexicalEditable as le } from "@lexical/react/useLexicalEditable";
5
- import { useLexicalNodeSelection as ae } from "@lexical/react/useLexicalNodeSelection";
6
- import { mergeRegister as ie } from "@lexical/utils";
7
- import { $setSelection as se, $getNodeByKey as R, CLICK_COMMAND as ce, COMMAND_PRIORITY_LOW as G, KEY_DELETE_COMMAND as de, KEY_BACKSPACE_COMMAND as ue } from "lexical";
8
- import { R as fe, H as X, P as me, A as ge, q as he, p as J, h as ee, r as xe } from "./layers.Clo6iX6B.js";
9
- import { useTranslation as V } from "react-i18next";
10
- import { Modal as pe, Text as Ce, Flex as be, Button as Q, Box as U, Tooltip as Z, ActionIcon as P, useMantineColorScheme as ve, Loader as we } from "@mantine/core";
11
- import { BottomDrawerWithoutHeader as Ee } from "@layers-app/shared";
12
- import { l as Te, p as ye } from "./layers.DilA0qnM.js";
13
- const Me = ({
14
- isCloseModal: n,
15
- setCloseModalOpen: l,
16
- confirmClose: g
17
- }) => {
18
- const { t: h } = V();
19
- return /* @__PURE__ */ o(
20
- pe,
21
- {
22
- opened: n,
23
- onClose: () => {
24
- l(!1);
25
- },
26
- centered: !0,
27
- title: h("editor.unsavedChanges.title"),
28
- closeOnClickOutside: !0,
29
- closeOnEscape: !0,
30
- size: "500",
31
- zIndex: 999,
32
- children: /* @__PURE__ */ W("div", { children: [
33
- /* @__PURE__ */ o(Ce, { mb: "md", children: h("editor.unsavedChanges.message") }),
34
- /* @__PURE__ */ W(be, { justify: "flex-end", gap: "sm", children: [
35
- /* @__PURE__ */ o(
36
- Q,
37
- {
38
- variant: "default",
39
- onClick: () => {
40
- l(!1);
41
- },
42
- fullWidth: !0,
43
- children: h("editor.unsavedChanges.cancel")
44
- }
45
- ),
46
- /* @__PURE__ */ o(Q, { color: "red", onClick: g, fullWidth: !0, children: h("editor.unsavedChanges.closeWithoutSaving") })
47
- ] })
48
- ] })
49
- }
50
- );
51
- };
52
- function ke({
53
- imageContainerRef: n,
54
- editor: l,
55
- rootClassName: g = null,
56
- width: h = "inherit",
57
- height: u = "inherit",
58
- nodeKey: s,
59
- alignment: O,
60
- setModalOpen: b,
61
- previewSVG: a
62
- }) {
63
- const S = K(() => a ?? "", [a]), [d, N] = k(!1), { t: v } = V(), D = (C, p) => {
64
- l.update(() => {
65
- se(null);
66
- const y = R(s);
67
- return ee(y) && y.setWidthAndHeight(C, p), !0;
68
- });
69
- }, w = () => {
70
- xe(l, s);
71
- };
72
- return /* @__PURE__ */ o(
73
- fe,
74
- {
75
- editor: l,
76
- isIcon: !1,
77
- isEmbed: !0,
78
- width: J(h),
79
- height: J(u),
80
- onResizeEnd: D,
81
- alignment: O,
82
- children: /* @__PURE__ */ W(U, { className: "media-wrapper excaildraw", children: [
83
- /* @__PURE__ */ W("div", { className: "media-actions", children: [
84
- /* @__PURE__ */ o(Z, { label: v("editor.link.edit"), children: /* @__PURE__ */ o(
85
- P,
86
- {
87
- color: "gray",
88
- "aria-label": "Settings",
89
- className: "media-action",
90
- variant: "default",
91
- size: 32,
92
- radius: 8,
93
- onClick: () => {
94
- b(!0);
95
- },
96
- children: /* @__PURE__ */ o(
97
- "span",
98
- {
99
- style: {
100
- color: "var(--mantine-color-gray-text)",
101
- display: "flex",
102
- alignItems: "center"
103
- },
104
- children: /* @__PURE__ */ o(X, { icon: me, size: 16 })
105
- }
106
- )
107
- }
108
- ) }),
109
- /* @__PURE__ */ o(
110
- ge,
111
- {
112
- opened: d,
113
- setOpened: N,
114
- t: v,
115
- editor: l,
116
- nodeKey: s
117
- }
118
- ),
119
- /* @__PURE__ */ o(Z, { label: v("editor.actions.delete"), children: /* @__PURE__ */ o(
120
- P,
121
- {
122
- color: "gray",
123
- "aria-label": "Delete",
124
- className: "media-action",
125
- variant: "default",
126
- size: 32,
127
- radius: 8,
128
- onClick: w,
129
- children: /* @__PURE__ */ o(
130
- "span",
131
- {
132
- style: {
133
- color: "var(--mantine-color-red-outline)",
134
- display: "flex",
135
- alignItems: "center"
136
- },
137
- children: /* @__PURE__ */ o(X, { icon: he, size: 16 })
138
- }
139
- )
140
- }
141
- ) })
142
- ] }),
143
- /* @__PURE__ */ o(
144
- U,
145
- {
146
- w: "100%",
147
- ref: (C) => {
148
- C && n && (n.current = C);
149
- },
150
- className: g ?? "",
151
- dangerouslySetInnerHTML: { __html: S }
152
- }
153
- )
154
- ] })
155
- }
156
- );
157
- }
158
- let H = null;
159
- const Oe = /* @__PURE__ */ oe(async () => {
160
- var l;
161
- const n = await import("./layers.BrrJNgYQ.js").then((g) => g.M);
162
- return !H && n && (H = n.exportToSvg || ((l = n.default) == null ? void 0 : l.exportToSvg) || n.default), { default: n.Excalidraw };
163
- }), Ne = () => {
164
- const [n, l] = k(
165
- null
166
- ), g = _(
167
- (h) => l(h),
168
- []
169
- );
170
- return [n, g];
171
- };
172
- function De({
173
- onSave: n,
174
- initialElements: l,
175
- initialAppState: g,
176
- initialFiles: h,
177
- isShown: u = !1,
178
- onDelete: s,
179
- onClose: O,
180
- isEdited: b
181
- }) {
182
- const [a, S] = Ne(), { i18n: d, t: N } = V(), { colorScheme: v } = ve(), D = j(!1), [w, C] = k(l), [p, y] = k(h), [z, A] = k(u);
183
- B(() => {
184
- u && A(!0);
185
- }, [u]), B(() => {
186
- !u || D.current || (D.current = !0, Promise.resolve({ }));
187
- }, [u]), B(() => {
188
- u && setTimeout(() => {
189
- var e;
190
- (e = a == null ? void 0 : a.refresh) == null || e.call(a);
191
- }, 500);
192
- }, [u, a]), B(() => {
193
- if (!u)
194
- return;
195
- const e = (t, c) => {
196
- const f = N(t);
197
- return f.startsWith("editor.menu") ? c : f;
198
- }, T = e(
199
- "editor.menu.excalidraw.tools.frameTool",
200
- d.language === "ru" ? "Инструмент рамки" : d.language === "es" ? "Herramienta de marco" : "Frame tool"
201
- ), i = e(
202
- "editor.menu.excalidraw.tools.webEmbed",
203
- d.language === "ru" ? "Веб-встраивание" : d.language === "es" ? "Incrustación web" : "Web Embed"
204
- ), E = e(
205
- "editor.menu.excalidraw.tools.generate",
206
- d.language === "ru" ? "Генерировать" : d.language === "es" ? "Generar" : "Generate"
207
- ), L = {
208
- "Frame tool": T,
209
- "Web Embed": i,
210
- "Web embeded": i,
211
- Generate: E
212
- }, M = () => {
213
- const t = document.querySelector(".App-toolbar__extra-tools-dropdown");
214
- if (!t)
215
- return;
216
- const c = document.createTreeWalker(
217
- t,
218
- NodeFilter.SHOW_TEXT,
219
- null
220
- );
221
- let f;
222
- for (; f = c.nextNode(); )
223
- if (f.nodeType === Node.TEXT_NODE && f.textContent) {
224
- const $ = f.textContent.trim();
225
- for (const [Y, q] of Object.entries(L))
226
- if ($ === Y && q && !$.includes(q)) {
227
- f.textContent = f.textContent.replace(Y, q);
228
- break;
229
- }
230
- }
231
- }, r = () => {
232
- setTimeout(() => {
233
- M();
234
- }, 0);
235
- }, m = setTimeout(() => {
236
- const t = document.querySelector(
237
- ".excalidraw-container"
238
- );
239
- if (t) {
240
- const c = t.querySelector(
241
- ".App-toolbar__extra-tools-trigger"
242
- );
243
- c && c.addEventListener("click", r);
244
- }
245
- }, 300);
246
- return () => {
247
- clearTimeout(m);
248
- const t = document.querySelector(
249
- ".excalidraw-container"
250
- );
251
- if (t) {
252
- const c = t.querySelector(
253
- ".App-toolbar__extra-tools-trigger"
254
- );
255
- c && c.removeEventListener("click", r);
256
- }
257
- };
258
- }, [u, d.language, N]);
259
- const I = _(async () => {
260
- var M, r, m;
261
- let e = H;
262
- if (!e || typeof e != "function") {
263
- const t = await import("./layers.BrrJNgYQ.js").then((c) => c.M);
264
- e = t.exportToSvg || ((M = t.default) == null ? void 0 : M.exportToSvg) || t.default, e && typeof e == "function" && (H = e);
265
- }
266
- if (!e || typeof e != "function") {
267
- const t = await import("./layers.BrrJNgYQ.js").then((f) => f.M), c = t ? Object.keys(t) : [];
268
- throw console.error("Excalidraw module structure:", {
269
- keys: c,
270
- hasExportToSvg: t && "exportToSvg" in t,
271
- hasDefault: t && "default" in t,
272
- moduleType: typeof t,
273
- module: t
274
- }), new Error(
275
- `exportToSvg is not available from @excalidraw/excalidraw. Module keys: ${c.join(", ")}. Please ensure @excalidraw/excalidraw is properly installed.`
276
- );
277
- }
278
- const T = ((r = a == null ? void 0 : a.getAppState) == null ? void 0 : r.call(a)) ?? g, i = await e({
279
- appState: T,
280
- elements: w,
281
- files: p
282
- }), E = (m = i == null ? void 0 : i.firstElementChild) == null ? void 0 : m.firstElementChild, L = i.getAttribute("viewBox");
283
- if (L != null) {
284
- const t = L.split(" ");
285
- i.setAttribute("width", t[2]), i.setAttribute("height", t[3]);
286
- }
287
- return E && E.tagName === "style" && E.remove(), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("display", "block"), i.classList.add("excalidraw-svg"), i.outerHTML;
288
- }, [w, p, a, g]), F = () => {
289
- if (w && w.filter((e) => !e.isDeleted).length > 0) {
290
- const e = a == null ? void 0 : a.getAppState(), T = {
291
- exportBackground: e == null ? void 0 : e.exportBackground,
292
- exportScale: e == null ? void 0 : e.exportScale,
293
- exportWithDarkMode: (e == null ? void 0 : e.theme) === "dark",
294
- isBindingEnabled: e == null ? void 0 : e.isBindingEnabled,
295
- isLoading: e == null ? void 0 : e.isLoading,
296
- name: e == null ? void 0 : e.name,
297
- theme: e == null ? void 0 : e.theme,
298
- viewBackgroundColor: e == null ? void 0 : e.viewBackgroundColor,
299
- viewModeEnabled: e == null ? void 0 : e.viewModeEnabled,
300
- zenModeEnabled: e == null ? void 0 : e.zenModeEnabled,
301
- zoom: e == null ? void 0 : e.zoom
302
- };
303
- (async () => {
304
- const i = await I();
305
- n(w, T, p, i);
306
- })();
307
- } else
308
- s();
309
- }, x = (e, T, i) => {
310
- (e == null ? void 0 : e.length) !== (l == null ? void 0 : l.length) && (b.current = !0), C(e), y(i);
311
- };
312
- return /* @__PURE__ */ o(
313
- Ee,
314
- {
315
- opened: u,
316
- onClose: O,
317
- onSave: F,
318
- className: "excaildraw-modal",
319
- closeOnEscape: !1,
320
- children: z && /* @__PURE__ */ o(
321
- ne,
322
- {
323
- fallback: /* @__PURE__ */ o(
324
- "div",
325
- {
326
- style: {
327
- display: "flex",
328
- justifyContent: "center",
329
- alignItems: "center",
330
- height: "100%",
331
- minHeight: "400px"
332
- },
333
- children: /* @__PURE__ */ o(we, { size: "sm" })
334
- }
335
- ),
336
- children: /* @__PURE__ */ o(
337
- Oe,
338
- {
339
- langCode: Te[d.language],
340
- theme: v,
341
- onChange: x,
342
- excalidrawAPI: S,
343
- initialData: {
344
- appState: { ...g || { isLoading: !1 } },
345
- elements: l,
346
- files: h
347
- }
348
- }
349
- )
350
- }
351
- )
352
- }
353
- );
354
- }
355
- function qe({
356
- nodeKey: n,
357
- data: l,
358
- width: g,
359
- height: h,
360
- alignment: u
361
- }) {
362
- var M;
363
- const [s] = re(), O = le(), b = K(() => ye(l), [l]), a = ((M = b == null ? void 0 : b.elements) == null ? void 0 : M.length) === 0 && !b.previewSVG, [S, d] = k(
364
- a && s.isEditable()
365
- ), [N, v] = k(!1), D = j(null), w = j(null), C = j(null), [p, y, z] = ae(n), A = _(
366
- (r) => (p && (r.preventDefault(), s.update(() => {
367
- const m = R(n);
368
- m && m.remove();
369
- })), !1),
370
- [s, p, n]
371
- );
372
- B(() => {
373
- if (!O) {
374
- p && z();
375
- return;
376
- }
377
- return ie(
378
- s.registerCommand(
379
- ce,
380
- (r) => {
381
- const m = w.current, t = r.target;
382
- return m !== null && m.contains(t) ? (r.shiftKey || z(), y(!p), r.detail > 1 && d(!0), !0) : !1;
383
- },
384
- G
385
- ),
386
- s.registerCommand(
387
- de,
388
- A,
389
- G
390
- ),
391
- s.registerCommand(
392
- ue,
393
- A,
394
- G
395
- )
396
- );
397
- }, [z, s, p, A, y, O]);
398
- const I = _(() => (d(!1), s.update(() => {
399
- const r = R(n);
400
- r && r.remove();
401
- })), [s, n]), F = (r, m, t, c) => s.update(() => {
402
- const f = R(n);
403
- ee(f) && (r && r.length > 0 || Object.keys(t).length > 0 ? f.setData(
404
- JSON.stringify({
405
- appState: m,
406
- elements: r,
407
- files: t,
408
- previewSVG: c
409
- })
410
- ) : f.remove());
411
- }), { elements: x = [], files: e = {}, appState: T = {}, previewSVG: i } = b, E = _(() => {
412
- d(!1), v(!1), C.current = !1, (x == null ? void 0 : x.length) === 0 && s.update(() => {
413
- const r = R(n);
414
- r && r.remove();
415
- });
416
- }, [s, n, x == null ? void 0 : x.length]), L = _(() => {
417
- C.current ? v(!0) : E();
418
- }, [E]);
419
- return /* @__PURE__ */ W(te, { children: [
420
- /* @__PURE__ */ o(
421
- Me,
422
- {
423
- isCloseModal: N,
424
- confirmClose: E,
425
- setCloseModalOpen: v
426
- }
427
- ),
428
- /* @__PURE__ */ o(
429
- De,
430
- {
431
- initialElements: x,
432
- isEdited: C,
433
- initialFiles: e,
434
- initialAppState: T,
435
- isShown: S,
436
- onDelete: I,
437
- onClose: L,
438
- onSave: (r, m, t, c) => {
439
- F(r, m, t, c), d(!1);
440
- },
441
- closeOnClickOutside: !1
442
- }
443
- ),
444
- (x == null ? void 0 : x.length) && /* @__PURE__ */ o(
445
- "div",
446
- {
447
- style: {
448
- display: "flex",
449
- justifyContent: u
450
- },
451
- children: /* @__PURE__ */ o(
452
- ke,
453
- {
454
- imageContainerRef: D,
455
- className: "image",
456
- width: g,
457
- height: h,
458
- editor: s,
459
- nodeKey: n,
460
- alignment: u,
461
- setModalOpen: d,
462
- previewSVG: i
463
- }
464
- )
465
- }
466
- )
467
- ] });
468
- }
469
- export {
470
- qe as default
471
- };
@@ -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 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),P=require("@lexical/react/LexicalComposerContext"),V=require("@lexical/react/useLexicalEditable"),Y=require("@lexical/react/useLexicalNodeSelection"),X=require("@lexical/utils"),v=require("lexical"),E=require("./layers.TOlqWs5X.js"),$=require("react-i18next"),C=require("@mantine/core"),J=require("@layers-app/shared"),G=require("./layers.CmmYt3Ou.js"),K=({isCloseModal:r,setCloseModalOpen:l,confirmClose:x})=>{const{t:h}=$.useTranslation();return n.jsx(C.Modal,{opened:r,onClose:()=>{l(!1)},centered:!0,title:h("editor.unsavedChanges.title"),closeOnClickOutside:!0,closeOnEscape:!0,size:"500",zIndex:999,children:n.jsxs("div",{children:[n.jsx(C.Text,{mb:"md",children:h("editor.unsavedChanges.message")}),n.jsxs(C.Flex,{justify:"flex-end",gap:"sm",children:[n.jsx(C.Button,{variant:"default",onClick:()=>{l(!1)},fullWidth:!0,children:h("editor.unsavedChanges.cancel")}),n.jsx(C.Button,{color:"red",onClick:x,fullWidth:!0,children:h("editor.unsavedChanges.closeWithoutSaving")})]})]})})};function Q({imageContainerRef:r,editor:l,rootClassName:x=null,width:h="inherit",height:f="inherit",nodeKey:c,alignment:S,setModalOpen:T,previewSVG:i}){const q=o.useMemo(()=>i??"",[i]),[d,L]=o.useState(!1),{t:w}=$.useTranslation(),D=(y,p)=>{l.update(()=>{v.$setSelection(null);const N=v.$getNodeByKey(c);return E.$isExcalidrawNode(N)&&N.setWidthAndHeight(y,p),!0})},j=()=>{E.deleteNode(l,c)};return n.jsx(E.ResizableContainer,{editor:l,isIcon:!1,isEmbed:!0,width:E.parseContainerSize(h),height:E.parseContainerSize(f),onResizeEnd:D,alignment:S,children:n.jsxs(C.Box,{className:"media-wrapper excaildraw",children:[n.jsxs("div",{className:"media-actions",children:[n.jsx(C.Tooltip,{label:w("editor.link.edit"),children:n.jsx(C.ActionIcon,{color:"gray","aria-label":"Settings",className:"media-action",variant:"default",size:32,radius:8,onClick:()=>{T(!0)},children:n.jsx("span",{style:{color:"var(--mantine-color-gray-text)",display:"flex",alignItems:"center"},children:n.jsx(E.HugeiconsIcon,{icon:E.P4,size:16})})})}),n.jsx(E.AlignmentImage,{opened:d,setOpened:L,t:w,editor:l,nodeKey:c}),n.jsx(C.Tooltip,{label:w("editor.actions.delete"),children:n.jsx(C.ActionIcon,{color:"gray","aria-label":"Delete",className:"media-action",variant:"default",size:32,radius:8,onClick:j,children:n.jsx("span",{style:{color:"var(--mantine-color-red-outline)",display:"flex",alignItems:"center"},children:n.jsx(E.HugeiconsIcon,{icon:E.lg,size:16})})})})]}),n.jsx(C.Box,{w:"100%",ref:y=>{y&&r&&(r.current=y)},className:x??"",dangerouslySetInnerHTML:{__html:q}})]})})}let A=null;const U=o.lazy(async()=>{var l;const r=await Promise.resolve().then(()=>require("./layers.0CM_qJjC.js")).then(x=>x.index);return!A&&r&&(A=r.exportToSvg||((l=r.default)==null?void 0:l.exportToSvg)||r.default),{default:r.Excalidraw}}),Z=()=>{const[r,l]=o.useState(null),x=o.useCallback(h=>l(h),[]);return[r,x]};function ee({onSave:r,initialElements:l,initialAppState:x,initialFiles:h,isShown:f=!1,onDelete:c,onClose:S,isEdited:T}){const[i,q]=Z(),{i18n:d,t:L}=$.useTranslation(),{colorScheme:w}=C.useMantineColorScheme(),D=o.useRef(!1),[j,y]=o.useState(l),[p,N]=o.useState(h),[R,B]=o.useState(f);o.useEffect(()=>{f&&B(!0)},[f]),o.useEffect(()=>{!f||D.current||(D.current=!0,Promise.resolve().then(()=>require("./layers.Dyvby5gX.js")))},[f]),o.useEffect(()=>{f&&setTimeout(()=>{var e;(e=i==null?void 0:i.refresh)==null||e.call(i)},500)},[f,i]),o.useEffect(()=>{if(!f)return;const e=(t,u)=>{const g=L(t);return g.startsWith("editor.menu")?u:g},k=e("editor.menu.excalidraw.tools.frameTool",d.language==="ru"?"Инструмент рамки":d.language==="es"?"Herramienta de marco":"Frame tool"),a=e("editor.menu.excalidraw.tools.webEmbed",d.language==="ru"?"Веб-встраивание":d.language==="es"?"Incrustación web":"Web Embed"),M=e("editor.menu.excalidraw.tools.generate",d.language==="ru"?"Генерировать":d.language==="es"?"Generar":"Generate"),_={"Frame tool":k,"Web Embed":a,"Web embeded":a,Generate:M},O=()=>{const t=document.querySelector(".App-toolbar__extra-tools-dropdown");if(!t)return;const u=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let g;for(;g=u.nextNode();)if(g.nodeType===Node.TEXT_NODE&&g.textContent){const H=g.textContent.trim();for(const[F,W]of Object.entries(_))if(H===F&&W&&!H.includes(W)){g.textContent=g.textContent.replace(F,W);break}}},s=()=>{setTimeout(()=>{O()},0)},m=setTimeout(()=>{const t=document.querySelector(".excalidraw-container");if(t){const u=t.querySelector(".App-toolbar__extra-tools-trigger");u&&u.addEventListener("click",s)}},300);return()=>{clearTimeout(m);const t=document.querySelector(".excalidraw-container");if(t){const u=t.querySelector(".App-toolbar__extra-tools-trigger");u&&u.removeEventListener("click",s)}}},[f,d.language,L]);const z=o.useCallback(async()=>{var O,s,m;let e=A;if(!e||typeof e!="function"){const t=await Promise.resolve().then(()=>require("./layers.0CM_qJjC.js")).then(u=>u.index);e=t.exportToSvg||((O=t.default)==null?void 0:O.exportToSvg)||t.default,e&&typeof e=="function"&&(A=e)}if(!e||typeof e!="function"){const t=await Promise.resolve().then(()=>require("./layers.0CM_qJjC.js")).then(g=>g.index),u=t?Object.keys(t):[];throw console.error("Excalidraw module structure:",{keys:u,hasExportToSvg:t&&"exportToSvg"in t,hasDefault:t&&"default"in t,moduleType:typeof t,module:t}),new Error(`exportToSvg is not available from @excalidraw/excalidraw. Module keys: ${u.join(", ")}. Please ensure @excalidraw/excalidraw is properly installed.`)}const k=((s=i==null?void 0:i.getAppState)==null?void 0:s.call(i))??x,a=await e({appState:k,elements:j,files:p}),M=(m=a==null?void 0:a.firstElementChild)==null?void 0:m.firstElementChild,_=a.getAttribute("viewBox");if(_!=null){const t=_.split(" ");a.setAttribute("width",t[2]),a.setAttribute("height",t[3])}return M&&M.tagName==="style"&&M.remove(),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("display","block"),a.classList.add("excalidraw-svg"),a.outerHTML},[j,p,i,x]),I=()=>{if(j&&j.filter(e=>!e.isDeleted).length>0){const e=i==null?void 0:i.getAppState(),k={exportBackground:e==null?void 0:e.exportBackground,exportScale:e==null?void 0:e.exportScale,exportWithDarkMode:(e==null?void 0:e.theme)==="dark",isBindingEnabled:e==null?void 0:e.isBindingEnabled,isLoading:e==null?void 0:e.isLoading,name:e==null?void 0:e.name,theme:e==null?void 0:e.theme,viewBackgroundColor:e==null?void 0:e.viewBackgroundColor,viewModeEnabled:e==null?void 0:e.viewModeEnabled,zenModeEnabled:e==null?void 0:e.zenModeEnabled,zoom:e==null?void 0:e.zoom};(async()=>{const a=await z();r(j,k,p,a)})()}else c()},b=(e,k,a)=>{(e==null?void 0:e.length)!==(l==null?void 0:l.length)&&(T.current=!0),y(e),N(a)};return n.jsx(J.BottomDrawerWithoutHeader,{opened:f,onClose:S,onSave:I,className:"excaildraw-modal",closeOnEscape:!1,children:R&&n.jsx(o.Suspense,{fallback:n.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",minHeight:"400px"},children:n.jsx(C.Loader,{size:"sm"})}),children:n.jsx(U,{langCode:G.languageToLocaleMap[d.language],theme:w,onChange:b,excalidrawAPI:q,initialData:{appState:{...x||{isLoading:!1}},elements:l,files:h}})})})}function te({nodeKey:r,data:l,width:x,height:h,alignment:f}){var O;const[c]=P.useLexicalComposerContext(),S=V.useLexicalEditable(),T=o.useMemo(()=>G.parseExcalidrawData(l),[l]),i=((O=T==null?void 0:T.elements)==null?void 0:O.length)===0&&!T.previewSVG,[q,d]=o.useState(i&&c.isEditable()),[L,w]=o.useState(!1),D=o.useRef(null),j=o.useRef(null),y=o.useRef(null),[p,N,R]=Y.useLexicalNodeSelection(r),B=o.useCallback(s=>(p&&(s.preventDefault(),c.update(()=>{const m=v.$getNodeByKey(r);m&&m.remove()})),!1),[c,p,r]);o.useEffect(()=>{if(!S){p&&R();return}return X.mergeRegister(c.registerCommand(v.CLICK_COMMAND,s=>{const m=j.current,t=s.target;return m!==null&&m.contains(t)?(s.shiftKey||R(),N(!p),s.detail>1&&d(!0),!0):!1},v.COMMAND_PRIORITY_LOW),c.registerCommand(v.KEY_DELETE_COMMAND,B,v.COMMAND_PRIORITY_LOW),c.registerCommand(v.KEY_BACKSPACE_COMMAND,B,v.COMMAND_PRIORITY_LOW))},[R,c,p,B,N,S]);const z=o.useCallback(()=>(d(!1),c.update(()=>{const s=v.$getNodeByKey(r);s&&s.remove()})),[c,r]),I=(s,m,t,u)=>c.update(()=>{const g=v.$getNodeByKey(r);E.$isExcalidrawNode(g)&&(s&&s.length>0||Object.keys(t).length>0?g.setData(JSON.stringify({appState:m,elements:s,files:t,previewSVG:u})):g.remove())}),{elements:b=[],files:e={},appState:k={},previewSVG:a}=T,M=o.useCallback(()=>{d(!1),w(!1),y.current=!1,(b==null?void 0:b.length)===0&&c.update(()=>{const s=v.$getNodeByKey(r);s&&s.remove()})},[c,r,b==null?void 0:b.length]),_=o.useCallback(()=>{y.current?w(!0):M()},[M]);return n.jsxs(n.Fragment,{children:[n.jsx(K,{isCloseModal:L,confirmClose:M,setCloseModalOpen:w}),n.jsx(ee,{initialElements:b,isEdited:y,initialFiles:e,initialAppState:k,isShown:q,onDelete:z,onClose:_,onSave:(s,m,t,u)=>{I(s,m,t,u),d(!1)},closeOnClickOutside:!1}),(b==null?void 0:b.length)&&n.jsx("div",{style:{display:"flex",justifyContent:f},children:n.jsx(Q,{imageContainerRef:D,className:"image",width:x,height:h,editor:c,nodeKey:r,alignment:f,setModalOpen:d,previewSVG:a})})]})}exports.default=te;
@@ -1,54 +0,0 @@
1
- const t = {
2
- elements: [],
3
- files: {},
4
- appState: {},
5
- previewSVG: null
6
- }, a = (r) => {
7
- try {
8
- const e = JSON.parse(r);
9
- if (Array.isArray(e))
10
- return { ...t, elements: e };
11
- if (e && typeof e == "object")
12
- return {
13
- elements: Array.isArray(e.elements) ? e.elements : [],
14
- files: e.files && typeof e.files == "object" ? e.files : {},
15
- appState: e.appState && typeof e.appState == "object" ? e.appState : {},
16
- previewSVG: typeof e.previewSVG == "string" ? e.previewSVG : typeof e.previewSvg == "string" ? e.previewSvg : null
17
- };
18
- } catch {
19
- }
20
- return { ...t };
21
- }, p = {
22
- en: "en-US",
23
- ru: "ru-RU",
24
- fr: "fr-FR",
25
- de: "de-DE",
26
- es: "es-ES",
27
- it: "it-IT",
28
- pt: "pt-BR",
29
- zh: "zh-CN",
30
- ja: "ja-JP",
31
- ko: "ko-KR",
32
- ar: "ar-SA",
33
- hi: "hi-IN",
34
- nl: "nl-NL",
35
- tr: "tr-TR",
36
- pl: "pl-PL",
37
- sv: "sv-SE",
38
- cs: "cs-CZ",
39
- uk: "uk-UA",
40
- ro: "ro-RO",
41
- fi: "fi-FI",
42
- da: "da-DK",
43
- no: "no-NO",
44
- el: "el-GR",
45
- he: "he-IL",
46
- th: "th-TH",
47
- id: "id-ID",
48
- ms: "ms-MY",
49
- vi: "vi-VN"
50
- };
51
- export {
52
- p as l,
53
- a as p
54
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@lexical/react/LexicalComposerContext"),a=require("./layers.TOlqWs5X.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,17 +0,0 @@
1
- import { useLexicalComposerContext as r } from "@lexical/react/LexicalComposerContext";
2
- import { e as o, f as l } from "./layers.Clo6iX6B.js";
3
- import { g as x, h as d, E as p } from "./layers.Clo6iX6B.js";
4
- import { l as n, p as u } from "./layers.DilA0qnM.js";
5
- function s() {
6
- const [a] = r();
7
- return o(a), null;
8
- }
9
- export {
10
- x as $createExcalidrawNode,
11
- d as $isExcalidrawNode,
12
- p as ExcalidrawNode,
13
- s as ExcalidrawPlugin,
14
- l as INSERT_EXCALIDRAW_COMMAND,
15
- n as languageToLocaleMap,
16
- u as parseExcalidrawData
17
- };