@layers-app/editor 2.3.22 → 2.3.24

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 (215) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.js +6 -6
  3. package/dist/{layers.CbS3C__g.js → layers.0CpMH7Qd.js} +1 -1
  4. package/dist/{layers.BrP3wWRL.js → layers.4UUvIK2t.js} +1 -1
  5. package/dist/{layers.DLcDX70Z.js → layers.7sTg2ka1.js} +3 -3
  6. package/dist/{layers.DkNrb9ft.js → layers.AwhdZDwP.js} +354 -338
  7. package/dist/{layers.QRTVVRxj.js → layers.B-hQUarG.js} +1 -1
  8. package/dist/{layers.BfmOd0IG.js → layers.B2B2rB8R.js} +1 -1
  9. package/dist/{layers.BjBHnohY.js → layers.B3wtrxWs.js} +1 -1
  10. package/dist/{layers.BlflUhxJ.js → layers.B4roGXPG.js} +1 -1
  11. package/dist/{layers.Cg-UOum4.js → layers.B5-fG7P8.js} +1 -1
  12. package/dist/{layers.GSpa8h_2.js → layers.B7rjsYyQ.js} +1 -1
  13. package/dist/{layers.BpA2A1SP.js → layers.B8aPpU-3.js} +1 -1
  14. package/dist/{layers.1qWGMhpm.js → layers.B9XsK7sf.js} +1 -1
  15. package/dist/{layers.C8Prpr0O.js → layers.BB5xZerr.js} +1 -1
  16. package/dist/{layers.A-J34shn.js → layers.BBdzXGC6.js} +1 -1
  17. package/dist/{layers.DwL2pnlW.js → layers.BDZwabym.js} +1 -1
  18. package/dist/{layers.W_jMkNYj.js → layers.BEQSkQb5.js} +1 -1
  19. package/dist/{layers.nmt-R6cg.js → layers.BElnuJGo.js} +1 -1
  20. package/dist/{layers.Deu1cPA2.js → layers.BFMrrvO6.js} +1 -1
  21. package/dist/{layers.ClAcKiSi.js → layers.BH42eSHV.js} +1 -1
  22. package/dist/{layers.XfT19s41.js → layers.BJ4aigFR.js} +1 -1
  23. package/dist/{layers.BJ5t-bw_.js → layers.BJ6E1qlO.js} +1 -1
  24. package/dist/{layers.DB8zgJTz.js → layers.BL4_Vrtj.js} +1 -1
  25. package/dist/{layers.Cb2_zCXw.js → layers.BNG9-t-U.js} +5 -5
  26. package/dist/{layers.ompd91wY.js → layers.BPAXEqLu.js} +1 -1
  27. package/dist/{layers.Dir6S1sj.js → layers.BQiCz5VQ.js} +1 -1
  28. package/dist/{layers.C9hldwB8.js → layers.BVm7Nx47.js} +1 -1
  29. package/dist/{layers.BFY1gVOq.js → layers.BWMUkW4D.js} +1 -1
  30. package/dist/{layers.DQUOIIPB.js → layers.BWwL3Ve5.js} +1 -1
  31. package/dist/{layers.DsD85Ka3.js → layers.B_B2UGan.js} +1 -1
  32. package/dist/{layers.CsFMLTQi.js → layers.BaINgm3q.js} +1 -1
  33. package/dist/{layers.DCOc5pWl.js → layers.BcbGROAq.js} +1 -1
  34. package/dist/{layers.Dy9bHhxU.js → layers.Bf1K1fkU.js} +2 -2
  35. package/dist/{layers.CXN-z5qV.js → layers.BfKluevR.js} +4 -4
  36. package/dist/{layers.a9V6odf0.js → layers.BgotFTf5.js} +1 -1
  37. package/dist/{layers.XqrJuUP0.js → layers.Bgv2K37s.js} +1 -1
  38. package/dist/{layers.DAsr4tV-.js → layers.BhbnND3b.js} +1 -1
  39. package/dist/{layers.HKoBJXG-.js → layers.BjygM-VR.js} +1 -1
  40. package/dist/{layers.uIiS6YV-.js → layers.Bl9fmgeS.js} +1 -1
  41. package/dist/layers.BohN9r_4.js +8 -0
  42. package/dist/{layers.BR7jeDQP.js → layers.BqPMskjv.js} +1 -1
  43. package/dist/layers.BrDVZz1T.js +858 -0
  44. package/dist/{layers.CJ6Rg0lX.js → layers.Brigp_BM.js} +2 -2
  45. package/dist/{layers.AzEmDuuK.js → layers.Buwyevgo.js} +1 -1
  46. package/dist/{layers.C-VNVQ_M.js → layers.BvT1pOJ7.js} +1 -1
  47. package/dist/{layers.DimaJ3iX.js → layers.BxM08fK-.js} +1 -1
  48. package/dist/{layers.BsDRiufz.js → layers.BxcAE7-A.js} +2 -2
  49. package/dist/layers.ByUMS4pV.js +1 -0
  50. package/dist/{layers.CN6S0l1U.js → layers.C-EOUS7D.js} +2 -2
  51. package/dist/{layers.C4kyxHbT.js → layers.C1PtkGX3.js} +1 -1
  52. package/dist/{layers.BUHiSK2b.js → layers.C2JRWmoz.js} +1 -1
  53. package/dist/{layers.ByoOM1uY.js → layers.C3G0i3tG.js} +1 -1
  54. package/dist/{layers.D8ekFvdj.js → layers.C3Q2x4vM.js} +3 -3
  55. package/dist/{layers.CYJSOBmX.js → layers.C5zCKOAF.js} +1 -1
  56. package/dist/{layers.B5OPbl5O.js → layers.C8NgjywA.js} +1 -1
  57. package/dist/{layers.zlYYyRVj.js → layers.CBK3ExrE.js} +1 -1
  58. package/dist/{layers.DR6JVzHG.js → layers.CBKhhbj_.js} +1 -1
  59. package/dist/{layers.CvtU9F9h.js → layers.CBdq-aon.js} +1 -1
  60. package/dist/{layers.9S_U7WJt.js → layers.CCY9XOI0.js} +2 -2
  61. package/dist/{layers.Yf0OxZVn.js → layers.CD71nr4_.js} +1 -1
  62. package/dist/{layers.K3q1iEdP.js → layers.CDYV-VhD.js} +1 -1
  63. package/dist/{layers.C022zlhH.js → layers.CEe-N6eG.js} +3 -3
  64. package/dist/{layers.CzZ_Lw8x.js → layers.CFIW_fEO.js} +1 -1
  65. package/dist/{layers.Bc1ANehj.js → layers.CGNxynSI.js} +1 -1
  66. package/dist/{layers.BmVrOCMv.js → layers.CGtmQbiV.js} +1 -1
  67. package/dist/{layers.DePZG4Ik.js → layers.CHwK_NbH.js} +1 -1
  68. package/dist/{layers.CI3Mh_4i.js → layers.CHzUR2uh.js} +1 -1
  69. package/dist/{layers.BLNi4T18.js → layers.CIm79Ra1.js} +59 -59
  70. package/dist/{layers.DOhaef72.js → layers.CJgbI_A6.js} +2 -2
  71. package/dist/{layers.BAzG6mfN.js → layers.CKQ_7R8w.js} +1 -1
  72. package/dist/{layers.BfbRUhiR.js → layers.CLeeY6Zi.js} +1 -1
  73. package/dist/{layers.lz0ada28.js → layers.CLjq-kTO.js} +1 -1
  74. package/dist/{layers.Dj9ody1Y.js → layers.CNY3Xyfj.js} +1 -1
  75. package/dist/{layers.BVnH2iZU.js → layers.CNfT77xZ.js} +1 -1
  76. package/dist/{layers.Bnysev4o.js → layers.CNxKlWUs.js} +1 -1
  77. package/dist/{layers.C83JgyTY.js → layers.CORpX7r7.js} +1 -1
  78. package/dist/{layers.BhFXkdyO.js → layers.CPJeTos-.js} +1 -1
  79. package/dist/{layers.BDETfw7Y.js → layers.CSAoWA5M.js} +1 -1
  80. package/dist/{layers.C4thF7rY.js → layers.CV2Y68YA.js} +1 -1
  81. package/dist/{layers.CKXFnGMO.js → layers.CVJMrJM8.js} +1 -1
  82. package/dist/{layers.Zv5Q2kCL.js → layers.CVpip4qM.js} +1 -1
  83. package/dist/{layers.BAE80doB.js → layers.CWVq7Uy7.js} +1 -1
  84. package/dist/{layers.zgtgO7Zh.js → layers.CWi9bxx2.js} +1 -1
  85. package/dist/{layers.DB3cWXLP.js → layers.CZTvQbIJ.js} +1 -1
  86. package/dist/{layers.Dc582csS.js → layers.C_1xPfQN.js} +2 -2
  87. package/dist/{layers.BnApensJ.js → layers.C_x8dLfm.js} +1 -1
  88. package/dist/{layers.Bec2NPMN.js → layers.CaReiIEX.js} +1 -1
  89. package/dist/{layers.CxgdUK68.js → layers.CcDllE0Z.js} +1 -1
  90. package/dist/{layers.CZ0CmmBM.js → layers.CdVMpdra.js} +1 -1
  91. package/dist/{layers.D24zEVxP.js → layers.CdYNCOg7.js} +1 -1
  92. package/dist/layers.CeEEuJcv.js +1 -0
  93. package/dist/{layers.jOcyd8e6.js → layers.Cf8-96M8.js} +1 -1
  94. package/dist/{layers.GATEEFro.js → layers.ChO-FN9-.js} +1 -1
  95. package/dist/{layers.Dk7xH7i-.js → layers.Cim8IgKH.js} +1 -1
  96. package/dist/{layers.DdpWFXWy.js → layers.Cj_EqAWT.js} +1 -1
  97. package/dist/{layers.CerwdBZh.js → layers.ClHoBwGo.js} +1 -1
  98. package/dist/{layers.vfIPnMAR.js → layers.ClY73P1k.js} +1 -1
  99. package/dist/{layers.lngNinZ9.js → layers.ClnZvd9i.js} +1 -1
  100. package/dist/{layers.8q9B8kz1.js → layers.ClswqtpD.js} +1 -1
  101. package/dist/{layers.BWwBwOD4.js → layers.CnVOqy-h.js} +1 -1
  102. package/dist/{layers.Bwp7K1Fe.js → layers.Cq6Uaebt.js} +1 -1
  103. package/dist/{layers.B1W4QDhq.js → layers.CqeO-3EO.js} +1 -1
  104. package/dist/{layers.CT7M6On3.js → layers.CvOQ_oHk.js} +1 -1
  105. package/dist/{layers.nqiLr36J.js → layers.CwkZ6Ipi.js} +1 -1
  106. package/dist/{layers.auGuXsdN.js → layers.CxG2fQ_T.js} +1 -1
  107. package/dist/{layers.Bb1ZYnj6.js → layers.CyLTrS4x.js} +1 -1
  108. package/dist/{layers.DsIVqiyo.js → layers.CyqHpq0B.js} +1 -1
  109. package/dist/{layers.B1HffYv7.js → layers.CzbGQTNa.js} +1 -1
  110. package/dist/{layers.eaOgJ4Wu.js → layers.D0-QtSj4.js} +1 -1
  111. package/dist/{layers.CE0Njwxt.js → layers.D0FgHO-y.js} +1 -1
  112. package/dist/{layers.CryGe4d3.js → layers.D0ce_VhN.js} +3 -3
  113. package/dist/{layers.zmznhUJl.js → layers.D1Ng1ixT.js} +1 -1
  114. package/dist/{layers.C-gKhsjA.js → layers.D4eP5NqW.js} +1 -1
  115. package/dist/{layers.yTT4HagX.js → layers.D55-oG-_.js} +1 -1
  116. package/dist/{layers.Djv8mnBd.js → layers.D6NCqWh9.js} +1 -1
  117. package/dist/{layers.DZGPrqjE.js → layers.D8Wxx6-x.js} +4 -4
  118. package/dist/{layers.CjyIvmi8.js → layers.D9PPBeAk.js} +1 -1
  119. package/dist/{layers.ewnSao_N.js → layers.DAeqbGMo.js} +1 -1
  120. package/dist/{layers.IRm7rzMo.js → layers.DAn4p0sm.js} +1 -1
  121. package/dist/{layers.By_lv2Pn.js → layers.DB2pNf2i.js} +1 -1
  122. package/dist/{layers.D0zogLuJ.js → layers.DBT8nxxX.js} +1 -1
  123. package/dist/{layers.5e4HzkAG.js → layers.DBeX5TLo.js} +4 -4
  124. package/dist/{layers.BYfd0wSK.js → layers.DBvEUYd0.js} +1 -1
  125. package/dist/{layers.BM2oXKfk.js → layers.DCI-PU7V.js} +3 -3
  126. package/dist/{layers.B0-Ohe0x.js → layers.DD1nZQay.js} +1 -1
  127. package/dist/{layers.CQ0cQYXY.js → layers.DDtCoAUS.js} +1 -1
  128. package/dist/{layers.DtyL7pij.js → layers.DEVf_8IC.js} +1 -1
  129. package/dist/{layers.DfuhqG2u.js → layers.DFFWjOIN.js} +8 -8
  130. package/dist/{layers.Cb2eAkbB.js → layers.DGHhm0ig.js} +1 -1
  131. package/dist/{layers.DFQQpkyu.js → layers.DGJY2FkO.js} +1 -1
  132. package/dist/{layers.CjlLk4c2.js → layers.DHo3KKeF.js} +1 -1
  133. package/dist/{layers.BRizdMol.js → layers.DKKrMI1y.js} +1 -1
  134. package/dist/{layers.CRjYeg54.js → layers.DKOKkFda.js} +3 -3
  135. package/dist/{layers.B3HYN3oY.js → layers.DKpTuMTK.js} +1 -1
  136. package/dist/{layers.Dc9venkQ.js → layers.DLxiVk7N.js} +1 -1
  137. package/dist/{layers.9TjYB6Lm.js → layers.DPTnVoRy.js} +1 -1
  138. package/dist/{layers.BhJOc_53.js → layers.DQ0SYwRq.js} +1 -1
  139. package/dist/layers.DRzWJs0T.js +1 -0
  140. package/dist/{layers.BE9mWVfh.js → layers.DSCXzQ2d.js} +1 -1
  141. package/dist/{layers.CBAnwcdO.js → layers.DT3oYLNK.js} +1 -1
  142. package/dist/{layers._uw7YRIi.js → layers.DTHxplVc.js} +1 -1
  143. package/dist/{layers.CwP3lthA.js → layers.DTjXnAGW.js} +1 -1
  144. package/dist/{layers.lcbLy439.js → layers.DUcRoa8i.js} +3 -3
  145. package/dist/{layers.DgJjcdr-.js → layers.DXTeiF-e.js} +2 -2
  146. package/dist/{layers.DfOBXFHi.js → layers.DZwJH6W1.js} +1 -1
  147. package/dist/{layers.Bg2H7i8b.js → layers.D_7F5phf.js} +1 -1
  148. package/dist/{layers.CgVWLRcB.js → layers.Dd-wIXHi.js} +1 -1
  149. package/dist/{layers.8c3NMeFg.js → layers.DeQgcYwV.js} +1 -1
  150. package/dist/{layers.Ch2oXqKV.js → layers.DfPPz_X1.js} +1 -1
  151. package/dist/{layers.AGeuuPKs.js → layers.Dif1MzgT.js} +1 -1
  152. package/dist/{layers.BCoiZs-6.js → layers.DjmlUPia.js} +1 -1
  153. package/dist/{layers.BnOkWXKe.js → layers.DkGrVIsD.js} +1 -1
  154. package/dist/{layers.BHseXEJG.js → layers.Dlf6x2Ju.js} +1 -1
  155. package/dist/{layers.B_SghufF.js → layers.Dmh6stK3.js} +1 -1
  156. package/dist/{layers.CnMntrug.js → layers.Dqie3AbF.js} +1 -1
  157. package/dist/{layers.BZfaYHWc.js → layers.Dqjw6JqU.js} +7 -7
  158. package/dist/{layers.BPE4MhHl.js → layers.DtzgBbW_.js} +2 -2
  159. package/dist/{layers.DcqjZCy6.js → layers.Du79wVhh.js} +1 -1
  160. package/dist/{layers.Dl85KXes.js → layers.DuBANgoi.js} +2 -2
  161. package/dist/{layers.Dpg_nMfB.js → layers.DzRb8jra.js} +1 -1
  162. package/dist/{layers.B8VSx93-.js → layers.EffsiuNu.js} +1 -1
  163. package/dist/{layers.DMcnaW3o.js → layers.FpsTRMn5.js} +1 -1
  164. package/dist/{layers.B5-Y9hei.js → layers.GNukBRwS.js} +1 -1
  165. package/dist/{layers.BMgR6zim.js → layers.IP3dJr3G.js} +1 -1
  166. package/dist/{layers.H56VUT51.js → layers.Kz3zpi50.js} +1 -1
  167. package/dist/{layers.DmQ1wZpm.js → layers.LL7KnkpN.js} +1 -1
  168. package/dist/{layers.Bw9X3C0K.js → layers.O0qRaRpX.js} +1 -1
  169. package/dist/{layers.5hEvEW2h.js → layers.OVc7WJn6.js} +1 -1
  170. package/dist/{layers.DjZdXTYL.js → layers.PvYWyb5N.js} +3 -3
  171. package/dist/{layers.DS-kwiY3.js → layers.QU-k-nIw.js} +1 -1
  172. package/dist/{layers.D9aYJ_7L.js → layers.SpT_PVDP.js} +1 -1
  173. package/dist/{layers.CKUytNQF.js → layers.SqD4gItY.js} +24 -24
  174. package/dist/{layers.Wdz8I4TO.js → layers.U_MaUknB.js} +3 -3
  175. package/dist/{layers.J01QEWhB.js → layers.VGDmP6RB.js} +1 -1
  176. package/dist/{layers.BHtY7U65.js → layers.WA_t21W5.js} +1 -1
  177. package/dist/{layers.BMyHZLl7.js → layers.XVuP78OS.js} +1 -1
  178. package/dist/{layers.Cc9BNrA8.js → layers.XufwhRWn.js} +1 -1
  179. package/dist/{layers.BMGa3HCJ.js → layers.ZtfusTop.js} +1 -1
  180. package/dist/{layers.s0bl_qw4.js → layers.Zv74Kxrh.js} +1 -1
  181. package/dist/{layers.8o7bLXBz.js → layers.Zv83kZG8.js} +1 -1
  182. package/dist/{layers.DfItTiTT.js → layers.aHu_65DR.js} +1 -1
  183. package/dist/{layers.DOW1URZz.js → layers.b-D90IdJ.js} +1 -1
  184. package/dist/{layers.B7s98gVM.js → layers.bk6BoA31.js} +1 -1
  185. package/dist/{layers.4nJAZVHr.js → layers.eZOSE1Mz.js} +1 -1
  186. package/dist/{layers.DoHbEsor.js → layers.gctTNjH6.js} +1 -1
  187. package/dist/{layers.DTo56Kaw.js → layers.hM4mb7rr.js} +1 -1
  188. package/dist/{layers.Bhgwt_RD.js → layers.hQtFhwXx.js} +1 -1
  189. package/dist/{layers.Dda1UNZ_.js → layers.hkPgmxE-.js} +1 -1
  190. package/dist/{layers.CkeiW5Cy.js → layers.p99FvPzP.js} +1 -1
  191. package/dist/{layers.DwWROQZN.js → layers.ppcSfBF_.js} +1 -1
  192. package/dist/{layers.CChXVO_O.js → layers.qYo1swlB.js} +1 -1
  193. package/dist/{layers.P4I51qo6.js → layers.rxoXKzgA.js} +3 -3
  194. package/dist/{layers.CX0phJ8q.js → layers.sWOuZ1z8.js} +3 -3
  195. package/dist/{layers.DKQK8nuG.js → layers.taYJuEcx.js} +1 -1
  196. package/dist/{layers.BhQu4aCO.js → layers.u8DIrcKm.js} +1 -1
  197. package/dist/{layers.QXFv7QNP.js → layers.uOzxdMWN.js} +1 -1
  198. package/dist/{layers.DdqKEy7a.js → layers.v9JhgLGL.js} +1 -1
  199. package/dist/{layers.-uB6gAQf.js → layers.vhwfBfVO.js} +1 -1
  200. package/dist/{layers.C9IBQlri.js → layers.vl-FtmBd.js} +3 -3
  201. package/dist/{layers.CWF7Z6cc.js → layers.wSDWdOKk.js} +1 -1
  202. package/dist/{layers.D9wk0Seb.js → layers.xYL0u_aZ.js} +1 -1
  203. package/dist/{layers.Dao1nnCd.js → layers.xcpsF3RF.js} +1 -1
  204. package/dist/layers.xxa1nfz9.js +6 -0
  205. package/dist/{layers.jz_MWBi0.js → layers.yZEhq0RN.js} +1 -1
  206. package/dist/{layers.BKQYuzsa.js → layers.zTwito3k.js} +1 -1
  207. package/dist/{layers.5AMbHs6E.js → layers.z_BaOEVR.js} +1 -1
  208. package/dist/{layers.Bu2SrH4h.js → layers.zbwA3qRl.js} +18052 -17678
  209. package/package.json +1 -1
  210. package/dist/layers.BIi9GLEc.js +0 -8
  211. package/dist/layers.BYEIgAOB.js +0 -1
  212. package/dist/layers.BnatDFX7.js +0 -858
  213. package/dist/layers.DfImPHqB.js +0 -1
  214. package/dist/layers.MRYjEvWp.js +0 -1
  215. package/dist/layers.eBgRhwOk.js +0 -6
@@ -1,13 +1,13 @@
1
- import { jsx as n, jsxs as N, Fragment as V } from "react/jsx-runtime";
2
- import { useState as v, useCallback as L, useRef as te, useEffect as P, useMemo as oe, useContext as Ne } from "react";
3
- import { useTranslation as X } from "react-i18next";
4
- import { useLexicalComposerContext as Y } from "@lexical/react/LexicalComposerContext";
5
- import { Menu as R, Flex as Q, Popover as z, Stack as Ye, Button as B, Box as be, LoadingOverlay as Ze } from "@mantine/core";
6
- import { $getNodeByKey as S, COMMAND_PRIORITY_LOW as qe, $setSelection as Je } from "lexical";
7
- import { D as Qe, F as Ke, G as et, J as tt, L as ve, N as ee, P as ot, Q as nt, A as ne, n as it, R as rt, H as M, S as Oe, q as Pe, U as Se, V as Ue, W as U, o as xe, X as at, Y as lt, s as ye, Z as st, C as Te, _ as dt, a0 as ct, a1 as K, a2 as ut, a3 as pt, a4 as mt, a5 as gt, a6 as ft, a7 as ht, a8 as wt, m as kt, k as Ie, O as bt, a9 as vt, K as Ce, aa as De, r as yt, ab as It, ac as Ct } from "./layers.Bu2SrH4h.js";
8
- import { AttachmentsGalleryModal as Ee, showErrorNotification as Dt } from "@layers-app/shared";
9
- import { useLexicalEditable as ie } from "@lexical/react/useLexicalEditable";
10
- import { useDisclosure as G } from "@mantine/hooks";
1
+ import { jsx as n, jsxs as N, Fragment as X } from "react/jsx-runtime";
2
+ import { useState as y, useCallback as L, useRef as ne, useEffect as E, useMemo as ie, useContext as Ue } from "react";
3
+ import { useTranslation as Y } from "react-i18next";
4
+ import { useLexicalComposerContext as Z } from "@lexical/react/LexicalComposerContext";
5
+ import { Menu as R, Flex as ee, Popover as z, Stack as et, Button as G, Box as Le, LoadingOverlay as tt } from "@mantine/core";
6
+ import { $getNodeByKey as P, COMMAND_PRIORITY_LOW as ot, $setSelection as nt } from "lexical";
7
+ import { z as it, B as rt, D as at, F as lt, G as Ne, J as oe, N as st, P as dt, L as re, K as ct, Q as ut, H as M, R as Ae, m as Re, S as Me, U as ze, W as O, w as We, X as pt, Y as mt, n as Se, Z as gt, C as Fe, _ as ht, a0 as ft, a1 as te, a2 as wt, a3 as kt, a4 as bt, a5 as vt, a6 as yt, a7 as It, a8 as Ct, y as Dt, k as Pe, O as Lt, a9 as Nt, aa as St, ab as Pt, V as Oe, ac as Ee, A as Ot } from "./layers.zbwA3qRl.js";
8
+ import { AttachmentsGalleryModal as _e, showErrorNotification as Et } from "@layers-app/shared";
9
+ import { useLexicalEditable as ae } from "@lexical/react/useLexicalEditable";
10
+ import { useDisclosure as V } from "@mantine/hooks";
11
11
  import "@lexical/react/LexicalDecoratorBlockNode";
12
12
  import "@lexical/utils";
13
13
  import "@lexical/mark";
@@ -17,11 +17,11 @@ import "react-dom";
17
17
  import "@lexical/react/LexicalErrorBoundary";
18
18
  import "@lexical/react/LexicalBlockWithAlignableContents";
19
19
  import "@mantine/notifications";
20
- function Lt(e, i) {
20
+ function xt(e, i) {
21
21
  const t = document.createElement("a");
22
22
  t.href = e, t.download = i, t.rel = "noopener", document.body.appendChild(t), t.click(), t.remove();
23
23
  }
24
- function re(e) {
24
+ function le(e) {
25
25
  try {
26
26
  const t = new URL(e, window.location.origin).pathname.split("/").pop() || "image";
27
27
  return t.includes(".") ? t : `${t}.png`;
@@ -29,39 +29,39 @@ function re(e) {
29
29
  return "image";
30
30
  }
31
31
  }
32
- async function ae(e, i) {
32
+ async function se(e, i) {
33
33
  const t = await fetch(e);
34
34
  if (!t.ok)
35
35
  throw new Error("fetch failed");
36
36
  const r = await t.blob(), a = URL.createObjectURL(r);
37
37
  try {
38
- Lt(a, i);
38
+ xt(a, i);
39
39
  } finally {
40
40
  setTimeout(() => URL.revokeObjectURL(a), 0);
41
41
  }
42
42
  }
43
- function Nt({
43
+ function Tt({
44
44
  editor: e,
45
45
  nodeKey: i,
46
46
  href: t,
47
47
  onClose: r
48
48
  }) {
49
- const [a, d] = v(
50
- () => Qe(t)
51
- ), [l, c] = v(() => Ke(t)), [C, k] = v(!1), m = L((u) => {
52
- d(u), k(!1);
53
- }, []), g = L((u) => {
54
- c(u), k(!1);
49
+ const [a, d] = y(
50
+ () => it(t)
51
+ ), [l, c] = y(() => rt(t)), [D, b] = y(!1), p = L((u) => {
52
+ d(u), b(!1);
53
+ }, []), m = L((u) => {
54
+ c(u), b(!1);
55
55
  }, []), f = L(() => {
56
- const u = et(l.trim(), a);
57
- if (!u || !tt(u, a)) {
58
- k(!0);
56
+ const u = at(l.trim(), a);
57
+ if (!u || !lt(u, a)) {
58
+ b(!0);
59
59
  return;
60
60
  }
61
- ve(e, i, ee(u)), r();
62
- }, [e, i, l, a, r]), y = L(() => {
63
- ve(e, i, ""), r();
64
- }, [e, i, r]), b = L(
61
+ Ne(e, i, oe(u)), r();
62
+ }, [e, i, l, a, r]), I = L(() => {
63
+ Ne(e, i, ""), r();
64
+ }, [e, i, r]), v = L(
65
65
  (u) => {
66
66
  u.key === "Enter" ? (u.preventDefault(), f()) : u.key === "Escape" && (u.preventDefault(), r());
67
67
  },
@@ -70,27 +70,27 @@ function Nt({
70
70
  return {
71
71
  linkType: a,
72
72
  linkUrl: l,
73
- error: C,
74
- onLinkTypeChange: m,
75
- onUrlInputChange: g,
76
- onUrlInputKeyDown: b,
73
+ error: D,
74
+ onLinkTypeChange: p,
75
+ onUrlInputChange: m,
76
+ onUrlInputKeyDown: v,
77
77
  onSave: f,
78
- onRemove: y
78
+ onRemove: I
79
79
  };
80
80
  }
81
- function le({
81
+ function de({
82
82
  editor: e,
83
83
  nodeKey: i,
84
84
  href: t,
85
85
  onClose: r,
86
86
  mobile: a
87
87
  }) {
88
- const d = te(null), l = Nt({ editor: e, nodeKey: i, href: t, onClose: r });
89
- return P(() => {
88
+ const d = ne(null), l = Tt({ editor: e, nodeKey: i, href: t, onClose: r });
89
+ return E(() => {
90
90
  var c;
91
91
  (c = d.current) == null || c.focus({ preventScroll: !0 });
92
92
  }, []), /* @__PURE__ */ n(
93
- ot,
93
+ st,
94
94
  {
95
95
  inputRef: d,
96
96
  linkUrl: l.linkUrl,
@@ -106,7 +106,7 @@ function le({
106
106
  }
107
107
  );
108
108
  }
109
- function Ae({
109
+ function je({
110
110
  opened: e,
111
111
  onOpenChange: i,
112
112
  t,
@@ -120,7 +120,7 @@ function Ae({
120
120
  {
121
121
  opened: e,
122
122
  onChange: i,
123
- transitionProps: nt,
123
+ transitionProps: dt,
124
124
  shadow: "md",
125
125
  position: "bottom-start",
126
126
  offset: 4,
@@ -128,10 +128,10 @@ function Ae({
128
128
  closeOnItemClick: !0,
129
129
  children: [
130
130
  /* @__PURE__ */ n(R.Target, { children: /* @__PURE__ */ n(
131
- ne,
131
+ re,
132
132
  {
133
133
  label: t("editor.toolbar.more"),
134
- icon: it,
134
+ icon: ct,
135
135
  iconColor: "var(--mantine-color-gray-text)",
136
136
  "aria-label": t("editor.toolbar.more")
137
137
  }
@@ -147,7 +147,7 @@ function Ae({
147
147
  l && /* @__PURE__ */ n(
148
148
  R.Item,
149
149
  {
150
- leftSection: /* @__PURE__ */ n(Q, { align: "center", justify: "center", c: "gray.6", children: /* @__PURE__ */ n(rt, { name: "link", size: 16 }) }),
150
+ leftSection: /* @__PURE__ */ n(ee, { align: "center", justify: "center", c: "gray.6", children: /* @__PURE__ */ n(ut, { name: "link", size: 16 }) }),
151
151
  onClick: (c) => {
152
152
  c.stopPropagation(), l();
153
153
  },
@@ -157,7 +157,7 @@ function Ae({
157
157
  /* @__PURE__ */ n(
158
158
  R.Item,
159
159
  {
160
- leftSection: /* @__PURE__ */ n(Q, { align: "center", justify: "center", c: "gray.6", children: /* @__PURE__ */ n(M, { icon: Oe, size: 16 }) }),
160
+ leftSection: /* @__PURE__ */ n(ee, { align: "center", justify: "center", c: "gray.6", children: /* @__PURE__ */ n(M, { icon: Ae, size: 16 }) }),
161
161
  onClick: (c) => {
162
162
  c.stopPropagation(), r();
163
163
  },
@@ -168,7 +168,7 @@ function Ae({
168
168
  R.Item,
169
169
  {
170
170
  color: "red",
171
- leftSection: /* @__PURE__ */ n(Q, { align: "center", justify: "center", c: "red.6", children: /* @__PURE__ */ n(M, { icon: Pe, size: 16 }) }),
171
+ leftSection: /* @__PURE__ */ n(ee, { align: "center", justify: "center", c: "red.6", children: /* @__PURE__ */ n(M, { icon: Re, size: 16 }) }),
172
172
  onClick: (c) => {
173
173
  c.stopPropagation(), a();
174
174
  },
@@ -182,13 +182,13 @@ function Ae({
182
182
  }
183
183
  );
184
184
  }
185
- const Re = ({
185
+ const $e = ({
186
186
  t: e,
187
187
  src: i,
188
188
  setShown: t,
189
189
  id: r
190
190
  }) => {
191
- const [a, { open: d, close: l }] = G(!1), c = Se(), C = oe(() => [
191
+ const [a, { open: d, close: l }] = V(!1), c = Me(), D = ie(() => [
192
192
  {
193
193
  id: !r || r === "0" ? "" : r,
194
194
  Url: i ?? "",
@@ -208,23 +208,23 @@ const Re = ({
208
208
  deletedAt: /* @__PURE__ */ new Date()
209
209
  }
210
210
  ], [i, r]);
211
- return /* @__PURE__ */ N(V, { children: [
211
+ return /* @__PURE__ */ N(X, { children: [
212
212
  /* @__PURE__ */ n(
213
- Ee,
213
+ _e,
214
214
  {
215
215
  opened: a,
216
- onOpenChange: (m) => {
217
- m ? d() : l();
216
+ onOpenChange: (p) => {
217
+ p ? d() : l();
218
218
  },
219
- attachments: C,
219
+ attachments: D,
220
220
  allowDownload: c
221
221
  }
222
222
  ),
223
223
  /* @__PURE__ */ n(
224
- ne,
224
+ re,
225
225
  {
226
226
  label: e("editor.image.preview"),
227
- icon: Ue,
227
+ icon: ze,
228
228
  iconColor: "var(--mantine-color-gray-text)",
229
229
  "aria-label": e("editor.image.preview"),
230
230
  onClick: () => {
@@ -233,37 +233,37 @@ const Re = ({
233
233
  }
234
234
  )
235
235
  ] });
236
- }, Ot = ({
236
+ }, Ut = ({
237
237
  nodeKey: e,
238
238
  src: i,
239
239
  href: t
240
240
  }) => {
241
- const [r] = Y(), a = ie(), [d, l] = v(!1), [c, C] = v(!1), [k, m] = v(!1), { t: g } = X();
242
- P(() => {
243
- if (!k) return;
244
- const b = (u) => {
245
- const h = u.target;
246
- h != null && h.closest(".floating-link-dropdown") || h != null && h.closest(".floating-link-type-combobox-dropdown") || m(!1);
241
+ const [r] = Z(), a = ae(), [d, l] = y(!1), [c, D] = y(!1), [b, p] = y(!1), { t: m } = Y();
242
+ E(() => {
243
+ if (!b) return;
244
+ const v = (u) => {
245
+ const w = u.target;
246
+ w != null && w.closest(".floating-link-dropdown") || w != null && w.closest(".floating-link-type-combobox-dropdown") || p(!1);
247
247
  };
248
- return document.addEventListener("pointerdown", b, !0), () => document.removeEventListener("pointerdown", b, !0);
249
- }, [k]);
248
+ return document.addEventListener("pointerdown", v, !0), () => document.removeEventListener("pointerdown", v, !0);
249
+ }, [b]);
250
250
  const f = L(() => {
251
251
  r.update(() => {
252
- const b = S(e);
253
- U(b) && b.remove();
252
+ const v = P(e);
253
+ O(v) && v.remove();
254
254
  });
255
- }, [r, e]), y = L(async () => {
255
+ }, [r, e]), I = L(async () => {
256
256
  if (i)
257
257
  try {
258
- await ae(i, re(i));
258
+ await se(i, le(i));
259
259
  } catch {
260
260
  }
261
261
  }, [i]);
262
262
  return /* @__PURE__ */ N(
263
263
  z,
264
264
  {
265
- opened: k,
266
- onChange: m,
265
+ opened: b,
266
+ onChange: p,
267
267
  position: "bottom-end",
268
268
  offset: 4,
269
269
  shadow: "md",
@@ -276,15 +276,15 @@ const Re = ({
276
276
  {
277
277
  className: `media-actions ${a ? "" : "media-actions--readonly"}`,
278
278
  children: [
279
- /* @__PURE__ */ n(Re, { t: g, src: i, setShown: () => {
279
+ /* @__PURE__ */ n($e, { t: m, src: i, setShown: () => {
280
280
  } }),
281
- a && /* @__PURE__ */ N(V, { children: [
281
+ a && /* @__PURE__ */ N(X, { children: [
282
282
  /* @__PURE__ */ n(
283
- xe,
283
+ We,
284
284
  {
285
285
  opened: d,
286
286
  setOpened: l,
287
- t: g,
287
+ t: m,
288
288
  editor: r,
289
289
  nodeKey: e,
290
290
  setShown: () => {
@@ -292,15 +292,15 @@ const Re = ({
292
292
  }
293
293
  ),
294
294
  /* @__PURE__ */ n(
295
- Ae,
295
+ je,
296
296
  {
297
297
  opened: c,
298
- onOpenChange: C,
299
- t: g,
300
- onDownload: () => void y(),
298
+ onOpenChange: D,
299
+ t: m,
300
+ onDownload: () => void I(),
301
301
  onDelete: f,
302
302
  hasLink: !!t,
303
- onLinkAction: () => m(!0)
303
+ onLinkAction: () => p(!0)
304
304
  }
305
305
  )
306
306
  ] })
@@ -313,12 +313,12 @@ const Re = ({
313
313
  className: `floating-link-dropdown floating-link-dropdown--${t ? "edit" : "create"}-mode`,
314
314
  "data-test-id": "floating-link-dropdown",
315
315
  children: /* @__PURE__ */ n(
316
- le,
316
+ de,
317
317
  {
318
318
  editor: r,
319
319
  nodeKey: e,
320
320
  href: t,
321
- onClose: () => m(!1)
321
+ onClose: () => p(!1)
322
322
  }
323
323
  )
324
324
  }
@@ -326,36 +326,36 @@ const Re = ({
326
326
  ]
327
327
  }
328
328
  );
329
- }, Pt = () => {
329
+ }, At = () => {
330
330
  };
331
- function St({ nodeKey: e, src: i, id: t, href: r }) {
332
- const { t: a } = X(), [d] = Y(), l = ie(), [c, C] = v(!1), [k, m] = v(!1), [g, f] = v(!1);
333
- P(() => {
334
- if (!g) return;
335
- const u = (h) => {
336
- const O = h.target;
337
- O != null && O.closest(".floating-link-dropdown") || O != null && O.closest(".floating-link-type-combobox-dropdown") || f(!1);
331
+ function Rt({ nodeKey: e, src: i, id: t, href: r }) {
332
+ const { t: a } = Y(), [d] = Z(), l = ae(), [c, D] = y(!1), [b, p] = y(!1), [m, f] = y(!1);
333
+ E(() => {
334
+ if (!m) return;
335
+ const u = (w) => {
336
+ const S = w.target;
337
+ S != null && S.closest(".floating-link-dropdown") || S != null && S.closest(".floating-link-type-combobox-dropdown") || f(!1);
338
338
  };
339
339
  return document.addEventListener("pointerdown", u, !0), () => document.removeEventListener("pointerdown", u, !0);
340
- }, [g]);
341
- const y = L(() => {
342
- m(!1), d.update(() => {
343
- const u = S(e);
344
- if (!U(u)) return;
345
- const h = u.getParent();
346
- at(h) ? h.remove() : u.remove();
340
+ }, [m]);
341
+ const I = L(() => {
342
+ p(!1), d.update(() => {
343
+ const u = P(e);
344
+ if (!O(u)) return;
345
+ const w = u.getParent();
346
+ pt(w) ? w.remove() : u.remove();
347
347
  });
348
- }, [d, e]), b = L(async () => {
348
+ }, [d, e]), v = L(async () => {
349
349
  if (i)
350
350
  try {
351
- await ae(i, re(i));
351
+ await se(i, le(i));
352
352
  } catch {
353
353
  }
354
354
  }, [i]);
355
355
  return /* @__PURE__ */ N(
356
356
  z,
357
357
  {
358
- opened: g,
358
+ opened: m,
359
359
  onChange: f,
360
360
  position: "bottom-end",
361
361
  offset: 4,
@@ -379,26 +379,26 @@ function St({ nodeKey: e, src: i, id: t, href: r }) {
379
379
  },
380
380
  onClick: (u) => u.stopPropagation(),
381
381
  children: [
382
- /* @__PURE__ */ n(Re, { t: a, src: i, setShown: Pt, id: t }),
383
- l && /* @__PURE__ */ N(V, { children: [
382
+ /* @__PURE__ */ n($e, { t: a, src: i, setShown: At, id: t }),
383
+ l && /* @__PURE__ */ N(X, { children: [
384
384
  /* @__PURE__ */ n(
385
- xe,
385
+ We,
386
386
  {
387
387
  opened: c,
388
- setOpened: C,
388
+ setOpened: D,
389
389
  t: a,
390
390
  editor: d,
391
391
  nodeKey: e
392
392
  }
393
393
  ),
394
394
  /* @__PURE__ */ n(
395
- Ae,
395
+ je,
396
396
  {
397
- opened: k,
398
- onOpenChange: m,
397
+ opened: b,
398
+ onOpenChange: p,
399
399
  t: a,
400
- onDownload: () => void b(),
401
- onDelete: y,
400
+ onDownload: () => void v(),
401
+ onDelete: I,
402
402
  hasLink: !!r,
403
403
  onLinkAction: () => f(!0)
404
404
  }
@@ -413,7 +413,7 @@ function St({ nodeKey: e, src: i, id: t, href: r }) {
413
413
  className: `floating-link-dropdown floating-link-dropdown--${r ? "edit" : "create"}-mode`,
414
414
  "data-test-id": "floating-link-dropdown",
415
415
  children: /* @__PURE__ */ n(
416
- le,
416
+ de,
417
417
  {
418
418
  editor: d,
419
419
  nodeKey: e,
@@ -427,10 +427,10 @@ function St({ nodeKey: e, src: i, id: t, href: r }) {
427
427
  }
428
428
  );
429
429
  }
430
- function Ut({ nodeKey: e, src: i, id: t, href: r }) {
431
- const { t: a } = X(), [d] = Y(), l = ie(), c = Se(), [C, { open: k, close: m }] = G(!1), [g, { open: f, close: y }] = G(!1), [b, { open: u, close: h }] = G(!1), O = () => {
432
- m(), u();
433
- }, W = oe(
430
+ function Mt({ nodeKey: e, src: i, id: t, href: r }) {
431
+ const { t: a } = Y(), [d] = Z(), l = ae(), c = Me(), [D, { open: b, close: p }] = V(!1), [m, { open: f, close: I }] = V(!1), [v, { open: u, close: w }] = V(!1), S = () => {
432
+ p(), u();
433
+ }, W = ie(
434
434
  () => [
435
435
  {
436
436
  id: !t || t === "0" ? "" : t,
@@ -452,21 +452,21 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
452
452
  }
453
453
  ],
454
454
  [i, t]
455
- ), w = () => {
456
- m(), f();
455
+ ), h = () => {
456
+ p(), f();
457
457
  }, x = L(async () => {
458
- if (m(), !!i)
458
+ if (p(), !!i)
459
459
  try {
460
- await ae(i, re(i));
460
+ await se(i, le(i));
461
461
  } catch {
462
462
  }
463
- }, [i, m]), E = L(() => {
464
- m(), d.update(() => {
465
- const I = S(e);
466
- U(I) && I.remove();
463
+ }, [i, p]), A = L(() => {
464
+ p(), d.update(() => {
465
+ const C = P(e);
466
+ O(C) && C.remove();
467
467
  });
468
- }, [d, e, m]);
469
- return /* @__PURE__ */ N(V, { children: [
468
+ }, [d, e, p]);
469
+ return /* @__PURE__ */ N(X, { children: [
470
470
  /* @__PURE__ */ n(
471
471
  "div",
472
472
  {
@@ -478,37 +478,37 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
478
478
  zIndex: 10,
479
479
  pointerEvents: "auto"
480
480
  },
481
- onClick: (I) => I.stopPropagation(),
481
+ onClick: (C) => C.stopPropagation(),
482
482
  children: /* @__PURE__ */ n(
483
- ne,
483
+ re,
484
484
  {
485
485
  label: a("editor.toolbar.more"),
486
- icon: lt,
486
+ icon: mt,
487
487
  iconColor: "var(--mantine-color-gray-text)",
488
488
  "aria-label": a("editor.toolbar.more"),
489
- onClick: k
489
+ onClick: b
490
490
  }
491
491
  )
492
492
  }
493
493
  ),
494
494
  /* @__PURE__ */ n(
495
- Ee,
495
+ _e,
496
496
  {
497
- opened: g,
498
- onOpenChange: (I) => I ? f() : y(),
497
+ opened: m,
498
+ onOpenChange: (C) => C ? f() : I(),
499
499
  attachments: W,
500
500
  allowDownload: c
501
501
  }
502
502
  ),
503
503
  /* @__PURE__ */ n(
504
- ye,
504
+ Se,
505
505
  {
506
- opened: C,
507
- onClose: m,
506
+ opened: D,
507
+ onClose: p,
508
508
  title: a("editor.image.mobileActions"),
509
- children: /* @__PURE__ */ N(Ye, { gap: 4, p: 0, children: [
509
+ children: /* @__PURE__ */ N(et, { gap: 4, p: 0, children: [
510
510
  /* @__PURE__ */ n(
511
- B,
511
+ G,
512
512
  {
513
513
  type: "button",
514
514
  variant: "subtle",
@@ -516,11 +516,11 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
516
516
  fullWidth: !0,
517
517
  justify: "flex-start",
518
518
  bg: "var(--editor-action-bg)",
519
- onClick: w,
519
+ onClick: h,
520
520
  leftSection: /* @__PURE__ */ n(
521
521
  M,
522
522
  {
523
- icon: Ue,
523
+ icon: ze,
524
524
  size: 16,
525
525
  color: "var(--mantine-color-dimmed)"
526
526
  }
@@ -529,7 +529,7 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
529
529
  }
530
530
  ),
531
531
  l && /* @__PURE__ */ n(
532
- B,
532
+ G,
533
533
  {
534
534
  type: "button",
535
535
  variant: "subtle",
@@ -537,11 +537,11 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
537
537
  fullWidth: !0,
538
538
  justify: "flex-start",
539
539
  bg: "var(--editor-action-bg)",
540
- onClick: O,
540
+ onClick: S,
541
541
  leftSection: /* @__PURE__ */ n(
542
542
  M,
543
543
  {
544
- icon: st,
544
+ icon: gt,
545
545
  size: 16,
546
546
  color: "var(--mantine-color-dimmed)"
547
547
  }
@@ -550,7 +550,7 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
550
550
  }
551
551
  ),
552
552
  c && /* @__PURE__ */ n(
553
- B,
553
+ G,
554
554
  {
555
555
  type: "button",
556
556
  variant: "subtle",
@@ -562,7 +562,7 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
562
562
  leftSection: /* @__PURE__ */ n(
563
563
  M,
564
564
  {
565
- icon: Oe,
565
+ icon: Ae,
566
566
  size: 16,
567
567
  color: "var(--mantine-color-dimmed)"
568
568
  }
@@ -571,7 +571,7 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
571
571
  }
572
572
  ),
573
573
  l && /* @__PURE__ */ n(
574
- B,
574
+ G,
575
575
  {
576
576
  type: "button",
577
577
  variant: "subtle",
@@ -579,11 +579,11 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
579
579
  fullWidth: !0,
580
580
  justify: "flex-start",
581
581
  bg: "var(--editor-action-bg)",
582
- onClick: E,
582
+ onClick: A,
583
583
  leftSection: /* @__PURE__ */ n(
584
584
  M,
585
585
  {
586
- icon: Pe,
586
+ icon: Re,
587
587
  size: 16,
588
588
  color: "var(--mantine-color-red-6)"
589
589
  }
@@ -595,18 +595,18 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
595
595
  }
596
596
  ),
597
597
  /* @__PURE__ */ n(
598
- ye,
598
+ Se,
599
599
  {
600
- opened: b,
601
- onClose: h,
600
+ opened: v,
601
+ onClose: w,
602
602
  title: a(r ? "editor.link.editLink" : "editor.link.addLink"),
603
603
  children: /* @__PURE__ */ n(
604
- le,
604
+ de,
605
605
  {
606
606
  editor: d,
607
607
  nodeKey: e,
608
608
  href: r,
609
- onClose: h,
609
+ onClose: w,
610
610
  mobile: !0
611
611
  }
612
612
  )
@@ -614,7 +614,7 @@ function Ut({ nodeKey: e, src: i, id: t, href: r }) {
614
614
  )
615
615
  ] });
616
616
  }
617
- const Le = (e) => {
617
+ const xe = 75, Te = (e) => {
618
618
  const {
619
619
  width: i,
620
620
  height: t,
@@ -623,26 +623,26 @@ const Le = (e) => {
623
623
  src: d,
624
624
  id: l,
625
625
  altText: c,
626
- imageRef: C,
627
- maxWidth: k,
628
- aspectRatio: m,
629
- href: g
630
- } = e, f = te(null);
626
+ imageRef: D,
627
+ maxWidth: b,
628
+ aspectRatio: p,
629
+ href: m
630
+ } = e, f = ne(null);
631
631
  return /* @__PURE__ */ N(
632
632
  "div",
633
633
  {
634
634
  className: "media-wrapper",
635
- "data-reserved-box": m ? "" : void 0,
635
+ "data-reserved-box": p ? "" : void 0,
636
636
  style: {
637
637
  width: i,
638
- height: m ? "auto" : t,
639
- aspectRatio: m || void 0,
638
+ height: p ? "auto" : t,
639
+ aspectRatio: p || void 0,
640
640
  display: "inline-flex",
641
641
  position: "relative"
642
642
  },
643
643
  children: [
644
644
  /* @__PURE__ */ n(
645
- Ze,
645
+ tt,
646
646
  {
647
647
  visible: r,
648
648
  zIndex: 1e3,
@@ -654,58 +654,58 @@ const Le = (e) => {
654
654
  "a",
655
655
  {
656
656
  className: "editor-image-link",
657
- "data-link": g ? "true" : void 0,
658
- "data-href": g ? ee(g) : void 0,
659
- role: g ? "link" : void 0,
660
- rel: g ? "noopener noreferrer" : void 0,
657
+ "data-link": m ? "true" : void 0,
658
+ "data-href": m ? oe(m) : void 0,
659
+ role: m ? "link" : void 0,
660
+ rel: m ? "noopener noreferrer" : void 0,
661
661
  draggable: !1,
662
- onMouseDown: g ? (y) => {
663
- f.current = { x: y.clientX, y: y.clientY };
662
+ onMouseDown: m ? (I) => {
663
+ f.current = { x: I.clientX, y: I.clientY };
664
664
  } : void 0,
665
- onClick: g ? (y) => {
666
- y.preventDefault();
667
- const b = f.current;
668
- f.current = null, !(b && Math.hypot(y.clientX - b.x, y.clientY - b.y) > 5) && window.open(ee(g), "_blank", "noopener,noreferrer");
665
+ onClick: m ? (I) => {
666
+ I.preventDefault();
667
+ const v = f.current;
668
+ f.current = null, !(v && Math.hypot(I.clientX - v.x, I.clientY - v.y) > 5) && window.open(oe(m), "_blank", "noopener,noreferrer");
669
669
  } : void 0,
670
670
  children: /* @__PURE__ */ n(
671
- xt,
671
+ zt,
672
672
  {
673
673
  className: null,
674
674
  src: d,
675
675
  altText: c,
676
- imageRef: C,
676
+ imageRef: D,
677
677
  width: "inherit",
678
678
  height: "inherit",
679
- maxWidth: k || "auto",
679
+ maxWidth: b || "auto",
680
680
  id: l
681
681
  }
682
682
  )
683
683
  }
684
684
  ),
685
- Ce && /* @__PURE__ */ n(
686
- Ut,
685
+ Oe && /* @__PURE__ */ n(
686
+ Mt,
687
687
  {
688
688
  nodeKey: e.nodeKey,
689
689
  src: d,
690
690
  id: l,
691
- href: g
691
+ href: m
692
692
  }
693
693
  ),
694
- De && /* @__PURE__ */ n(
695
- St,
694
+ Ee && /* @__PURE__ */ n(
695
+ Rt,
696
696
  {
697
697
  nodeKey: e.nodeKey,
698
698
  src: d,
699
699
  id: l,
700
- href: g
700
+ href: m
701
701
  }
702
702
  ),
703
- yt && !Ce && !De && /* @__PURE__ */ n(Ot, { nodeKey: e.nodeKey, src: d, href: g })
703
+ Ot && !Oe && !Ee && /* @__PURE__ */ n(Ut, { nodeKey: e.nodeKey, src: d, href: m })
704
704
  ]
705
705
  }
706
706
  );
707
707
  };
708
- function xt({
708
+ function zt({
709
709
  altText: e,
710
710
  className: i,
711
711
  imageRef: t,
@@ -715,11 +715,11 @@ function xt({
715
715
  maxWidth: l,
716
716
  id: c
717
717
  }) {
718
- const [C, k] = v(!1);
718
+ const [D, b] = y(!1);
719
719
  return /* @__PURE__ */ n(
720
720
  "img",
721
721
  {
722
- className: `${i || void 0} ${C ? "" : "loading"}`,
722
+ className: `${i || void 0} ${D ? "" : "loading"}`,
723
723
  src: r,
724
724
  alt: e,
725
725
  ref: t,
@@ -730,19 +730,19 @@ function xt({
730
730
  },
731
731
  onLoad: () => {
732
732
  r.includes("splash") ? setTimeout(() => {
733
- k(!0);
734
- }, 100) : k(!0);
733
+ b(!0);
734
+ }, 100) : b(!0);
735
735
  },
736
736
  draggable: "false",
737
737
  "data-id": c
738
738
  }
739
739
  );
740
740
  }
741
- function to(e) {
742
- const { disable: i } = Ne(Te);
743
- return i && dt.isPlaceholderSrc(e.src) ? null : /* @__PURE__ */ n(Tt, { ...e });
741
+ function lo(e) {
742
+ const { disable: i } = Ue(Fe);
743
+ return i && ht.isPlaceholderSrc(e.src) ? null : /* @__PURE__ */ n(Wt, { ...e });
744
744
  }
745
- function Tt({
745
+ function Wt({
746
746
  src: e,
747
747
  altText: i,
748
748
  nodeKey: t,
@@ -751,33 +751,33 @@ function Tt({
751
751
  maxWidth: d,
752
752
  showCaption: l,
753
753
  caption: c,
754
- id: C,
755
- create: k,
756
- alignment: m,
757
- imagePickerTab: g,
754
+ id: D,
755
+ create: b,
756
+ alignment: p,
757
+ imagePickerTab: m,
758
758
  aspectRatio: f,
759
- href: y
759
+ href: I
760
760
  }) {
761
- var we, ke;
762
- const b = te(null), [u, h] = v(!0), [O, W] = v(!1), [w] = Y(), [x, E] = v(!0), [I, F] = v({
761
+ var be, ve;
762
+ const v = ne(null), [u, w] = y(!0), [S, W] = y(!1), [h] = Z(), [x, A] = y(!0), [C, F] = y({
763
763
  width: 0,
764
764
  height: 0
765
- }), { start: se, cancel: de } = ct(), [Et, _] = v(0), {
766
- fetchUploadMedia: $,
767
- fetchDeleteMedia: ce,
768
- maxFileSize: At,
765
+ }), { start: ce, cancel: ue } = ft(), [Ft, _] = y(0), {
766
+ fetchUploadMedia: j,
767
+ fetchDeleteMedia: pe,
768
+ maxFileSize: _t,
769
769
  imperativeHandleRef: T,
770
- disable: Me
771
- } = Ne(Te), j = K.has(e) && (((we = K.get(e)) == null ? void 0 : we.mediaNodeKeys.length) === 0 || ((ke = K.get(e)) == null ? void 0 : ke.mediaNodeKeys.length) === void 0 || e.trim() === ""), { t: H } = X(), ue = (o) => {
770
+ disable: Be
771
+ } = Ue(Fe), $ = te.has(e) && (((be = te.get(e)) == null ? void 0 : be.mediaNodeKeys.length) === 0 || ((ve = te.get(e)) == null ? void 0 : ve.mediaNodeKeys.length) === void 0 || e.trim() === ""), { t: B } = Y(), me = (o) => {
772
772
  if (typeof o == "number") return o > 0 ? o : null;
773
773
  if (typeof o == "string" && !o.includes("%")) {
774
- const p = parseFloat(o);
775
- return Number.isFinite(p) && p > 0 ? p : null;
774
+ const g = parseFloat(o);
775
+ return Number.isFinite(g) && g > 0 ? g : null;
776
776
  }
777
777
  return null;
778
- }, A = ue(r), pe = ue(a), me = A && pe ? A / pe : void 0, [ze, We] = v(
778
+ }, U = me(r), ge = me(a), he = U && ge ? U / ge : void 0, [He, Ge] = y(
779
779
  void 0
780
- ), ge = oe(() => {
780
+ ), fe = ie(() => {
781
781
  try {
782
782
  const o = parseFloat(
783
783
  localStorage.getItem("layers-img-ratio:" + e) || ""
@@ -786,231 +786,247 @@ function Tt({
786
786
  } catch {
787
787
  return;
788
788
  }
789
- }, [e]), Fe = me ?? f ?? ge ?? ze, [_e, Z] = v(!1), $e = !_e && !me && (f ?? ge) != null, [Rt, je] = v(0);
790
- P(() => w.registerDecoratorListener(() => {
791
- je((o) => o + 1);
792
- }), [j]), P(() => {
793
- const o = w.getElementByKey(t);
789
+ }, [e]), Ve = he ?? f ?? fe ?? He, [Xe, J] = y(!1), Ye = !Xe && !he && (f ?? fe) != null, [jt, Ze] = y(0);
790
+ E(() => h.registerDecoratorListener(() => {
791
+ Ze((o) => o + 1);
792
+ }), [$]), E(() => {
793
+ const o = h.getElementByKey(t);
794
794
  o && (o.style.removeProperty("aspect-ratio"), o.style.removeProperty("width"));
795
- }, [w, t]), P(() => {
795
+ }, [h, t]), E(() => {
796
796
  if (!e || e.startsWith("data:image/") || !e.trim()) {
797
- h(!1);
797
+ w(!1);
798
798
  return;
799
799
  }
800
800
  const o = new Image();
801
801
  o.src = e, o.onload = () => {
802
- if (h(!1), o.naturalWidth) {
803
- const p = o.naturalWidth / o.naturalHeight;
804
- if (We(p), o.naturalWidth >= 100)
802
+ if (w(!1), o.naturalWidth) {
803
+ const g = o.naturalWidth / o.naturalHeight;
804
+ if (Ge(g), o.naturalWidth >= 100)
805
805
  try {
806
- localStorage.setItem("layers-img-ratio:" + e, String(p));
806
+ localStorage.setItem("layers-img-ratio:" + e, String(g));
807
807
  } catch {
808
808
  }
809
- !f && o.naturalWidth >= 100 && w.update(
809
+ !f && o.naturalWidth >= 100 && h.update(
810
810
  () => {
811
- const s = S(t);
812
- U(s) && s.getAspectRatio() == null && s.setAspectRatio(p);
811
+ const s = P(t);
812
+ O(s) && s.getAspectRatio() == null && s.setAspectRatio(g);
813
813
  },
814
814
  { tag: "history-merge" }
815
815
  );
816
816
  }
817
817
  }, o.onerror = () => {
818
- h(!1);
818
+ w(!1);
819
819
  };
820
- }, [e, j]);
821
- const He = (o, p) => {
822
- w.update(() => {
823
- Je(null);
824
- const s = S(t);
825
- U(s) && s.setWidthAndHeight(o, p);
820
+ }, [e, $]);
821
+ const Je = (o, g) => {
822
+ h.update(() => {
823
+ nt(null);
824
+ const s = P(t);
825
+ O(s) && s.setWidthAndHeight(o, g);
826
826
  });
827
- }, { historyState: fe } = ut(), {
828
- settings: { showNestedEditorTreeView: he }
829
- } = pt();
830
- function Be(o) {
831
- const p = It(o);
832
- return p ? Ct(p).width : 0;
833
- }
834
- function Ge(o) {
835
- return new Promise((p, s) => {
836
- if (vt(o)) {
837
- p(Be(o));
827
+ }, { historyState: we } = wt(), {
828
+ settings: { showNestedEditorTreeView: ke }
829
+ } = kt();
830
+ function Qe(o) {
831
+ return new Promise((g, s) => {
832
+ if (Nt(o)) {
833
+ const H = St(o);
834
+ g(H ? Pt(H) : { width: 0, height: 0 });
838
835
  return;
839
836
  }
840
- const D = new Image();
841
- D.src = o, D.onload = () => {
842
- p(D.width);
843
- }, D.onerror = () => {
837
+ const k = new Image();
838
+ k.src = o, k.onload = () => {
839
+ g({ width: k.width, height: k.height });
840
+ }, k.onerror = () => {
844
841
  s(new Error("Failed to load image"));
845
842
  };
846
843
  });
847
844
  }
848
- P(() => {
849
- let o = r, p = a, s = 100;
850
- if ((e.includes("unsplash") ? e.trim() : !j && e.trim() || e.includes("upload-src-editor")) && e !== "upload") {
851
- if (A != null && A >= s) {
852
- E(!1), F({ width: A, height: A }), Z(!0);
845
+ E(() => {
846
+ let o = r, g = a, s = xe;
847
+ if ((e.includes("unsplash") ? e.trim() : !$ && e.trim() || e.includes("upload-src-editor")) && e !== "upload") {
848
+ if (U != null && U >= s) {
849
+ A(!1), F({ width: U, height: U }), J(!0);
853
850
  return;
854
851
  }
855
- Ge(e).then((D) => {
856
- typeof o == "number" && o < s && D < s ? (E(!0), F({
857
- width: o,
858
- height: p
859
- })) : D < s ? (E(!0), F({
860
- width: "auto",
861
- height: "auto"
862
- })) : (F({
863
- width: D,
864
- height: D
865
- }), E(!1)), Z(!0);
866
- }).catch((D) => {
867
- Z(!0), console.warn("Ошибка при загрузке изображения:", D.message);
852
+ Qe(e).then(({ width: k, height: H }) => {
853
+ var ye, Ie;
854
+ if (typeof o == "number" && o < s && k < s)
855
+ A(!0), F({
856
+ width: o,
857
+ height: g
858
+ });
859
+ else if (k < s)
860
+ A(!0), F({
861
+ width: k,
862
+ height: H
863
+ });
864
+ else if (F({
865
+ width: k,
866
+ height: k
867
+ }), A(!1), U == null) {
868
+ const K = ((Ie = (ye = h.getElementByKey(t)) == null ? void 0 : ye.parentElement) == null ? void 0 : Ie.getBoundingClientRect().width) ?? 0;
869
+ if (K > 0 && k < K) {
870
+ const Ce = k / K * 100;
871
+ h.update(
872
+ () => {
873
+ const De = P(t);
874
+ O(De) && De.setWidthAndHeight(Ce, Ce);
875
+ },
876
+ { tag: "history-merge" }
877
+ );
878
+ }
879
+ }
880
+ J(!0);
881
+ }).catch((k) => {
882
+ J(!0), console.warn("Ошибка при загрузке изображения:", k.message);
868
883
  });
869
884
  }
870
- }, [e, j]), P(() => {
871
- I.width && I.height && x && w.update(() => {
872
- const o = S(t);
873
- U(o) && o.setWidthAndHeight(I.width, I.height);
885
+ }, [e, $]), E(() => {
886
+ C.width && C.height && x && h.update(() => {
887
+ const o = P(t);
888
+ O(o) && o.setWidthAndHeight(C.width, C.height);
874
889
  });
875
- }, [I.width, I.height, x]);
876
- const Ve = L(
877
- (o) => mt(w, t, o),
878
- [w, t]
879
- ), q = L(
880
- (o, p) => {
881
- W(!1), h(!1), w.update(() => {
882
- const s = S(t);
883
- U(s) && (s.setSrc(o), s.setId(p));
890
+ }, [C.width, C.height, x]);
891
+ const qe = L(
892
+ (o) => bt(h, t, o),
893
+ [h, t]
894
+ ), Q = L(
895
+ (o, g) => {
896
+ W(!1), w(!1), h.update(() => {
897
+ const s = P(t);
898
+ O(s) && (s.setSrc(o), s.setId(g));
884
899
  });
885
900
  },
886
- [w, t]
887
- ), Xe = L(() => {
888
- de(), W(!1), h(!1), _(0);
889
- }, [de]), J = L(
901
+ [h, t]
902
+ ), Ke = L(() => {
903
+ ue(), W(!1), w(!1), _(0);
904
+ }, [ue]), q = L(
890
905
  (o) => {
891
- W(!0), h(!0);
892
- const p = se();
893
- $ && $(
906
+ W(!0), w(!0);
907
+ const g = ce();
908
+ j && j(
894
909
  o[0],
895
- (s, D) => {
896
- q(s, D), _(0);
910
+ (s, k) => {
911
+ Q(s, k), _(0);
897
912
  },
898
913
  (s) => {
899
- s && Dt({
900
- message: H("editor.gallery.errorFile")
901
- }), _(0), q(e.startsWith("blob:") ? "upload" : "", "");
914
+ s && Et({
915
+ message: B("editor.gallery.errorFile")
916
+ }), _(0), Q(e.startsWith("blob:") ? "upload" : "", "");
902
917
  },
903
- p,
918
+ g,
904
919
  (s) => {
905
920
  _(s);
906
921
  },
907
- w.getEditorState().read(() => {
908
- const s = S(t);
909
- return U(s) ? s.getId() : void 0;
922
+ h.getEditorState().read(() => {
923
+ const s = P(t);
924
+ return O(s) ? s.getId() : void 0;
910
925
  })
911
926
  );
912
927
  },
913
- [w, $, t, se, H, q, e]
928
+ [h, j, t, ce, B, Q, e]
914
929
  );
915
- return P(() => w.registerCommand(
916
- gt,
917
- (o) => !e.startsWith("blob:") && e !== "upload" || o.targetNodeKey !== t ? !1 : (J(o.files), !0),
918
- qe
919
- ), [w, J, t, e]), !e || e === "upload" ? O ? /* @__PURE__ */ n(be, { "data-editor-image-picker-drop-root": !0, w: "100%", children: /* @__PURE__ */ n(ft, { onCancel: Xe }) }) : /* @__PURE__ */ n(be, { "data-editor-image-picker-drop-root": !0, w: "100%", children: /* @__PURE__ */ n(
920
- ht,
930
+ return E(() => h.registerCommand(
931
+ vt,
932
+ (o) => !e.startsWith("blob:") && e !== "upload" || o.targetNodeKey !== t ? !1 : (q(o.files), !0),
933
+ ot
934
+ ), [h, q, t, e]), !e || e === "upload" ? S ? /* @__PURE__ */ n(Le, { "data-editor-image-picker-drop-root": !0, w: "100%", children: /* @__PURE__ */ n(yt, { onCancel: Ke }) }) : /* @__PURE__ */ n(Le, { "data-editor-image-picker-drop-root": !0, w: "100%", children: /* @__PURE__ */ n(
935
+ It,
921
936
  {
922
937
  inline: !0,
923
938
  nodeKey: t,
924
- defaultTabValue: g,
925
- onWriteTabToNode: Ve,
939
+ defaultTabValue: m,
940
+ onWriteTabToNode: qe,
926
941
  onUpload: (o) => {
927
- var s, D;
928
- if (!$ || !o.length) return;
929
- J([o[0]]);
930
- const p = o.slice(1);
931
- p.length && ((D = (s = T == null ? void 0 : T.current) == null ? void 0 : s.insertImages) == null || D.call(s, p));
942
+ var s, k;
943
+ if (!j || !o.length) return;
944
+ q([o[0]]);
945
+ const g = o.slice(1);
946
+ g.length && ((k = (s = T == null ? void 0 : T.current) == null ? void 0 : s.insertImages) == null || k.call(s, g));
932
947
  },
933
948
  popoverProps: {
934
949
  opened: !0,
935
950
  position: "bottom",
936
- zIndex: wt
951
+ zIndex: Ct
937
952
  },
938
953
  onChange: (o) => {
939
- w.update(() => {
940
- const p = S(t);
941
- U(p) && p.setSrc(o);
954
+ h.update(() => {
955
+ const g = P(t);
956
+ O(g) && g.setSrc(o);
942
957
  });
943
958
  }
944
959
  }
945
- ) }) : x && !$e ? /* @__PURE__ */ n(
946
- Le,
960
+ ) }) : x && !Ye ? /* @__PURE__ */ n(
961
+ Te,
947
962
  {
948
- width: I.width,
949
- height: I.height,
963
+ width: C.width,
964
+ height: C.height,
950
965
  isLoading: u,
951
966
  isError: !1,
952
967
  isIcon: x,
953
968
  src: e,
954
- id: C,
955
- editor: w,
969
+ id: D,
970
+ editor: h,
956
971
  nodeKey: t,
957
- fetchDeleteMedia: ce,
972
+ fetchDeleteMedia: pe,
958
973
  altText: i,
959
- imageRef: b,
974
+ imageRef: v,
960
975
  maxWidth: d,
961
976
  showCaption: l,
962
977
  caption: c,
963
978
  isCollabActive: !1,
964
- historyState: fe,
965
- showNestedEditorTreeView: he,
966
- t: H,
967
- href: y
979
+ historyState: we,
980
+ showNestedEditorTreeView: ke,
981
+ t: B,
982
+ href: I
968
983
  }
969
984
  ) : /* @__PURE__ */ n(
970
- kt,
985
+ Dt,
971
986
  {
972
- editor: w,
987
+ editor: h,
973
988
  isIcon: x,
974
- width: Ie(r),
975
- height: Ie(a),
976
- initialWidth: I.width || "",
977
- initialHeight: I.height || "",
978
- onResizeEnd: He,
979
- alignment: m,
980
- disable: Me,
989
+ minWidthPx: xe,
990
+ width: Pe(r),
991
+ height: Pe(a),
992
+ initialWidth: C.width || "",
993
+ initialHeight: C.height || "",
994
+ onResizeEnd: Je,
995
+ alignment: p,
996
+ disable: Be,
981
997
  onRegisterDecoratorEnter: (o) => {
982
998
  T != null && T.current && (T.current.decoratorEnterAction = o);
983
999
  },
984
- onActivate: () => w.dispatchCommand(bt, "show_menu"),
1000
+ onActivate: () => h.dispatchCommand(Lt, "show_menu"),
985
1001
  children: /* @__PURE__ */ n(
986
- Le,
1002
+ Te,
987
1003
  {
988
1004
  width: "inherit",
989
1005
  height: "inherit",
990
- aspectRatio: Fe,
1006
+ aspectRatio: Ve,
991
1007
  isLoading: u,
992
1008
  isError: !1,
993
1009
  isIcon: x,
994
1010
  src: e,
995
- id: C,
996
- editor: w,
1011
+ id: D,
1012
+ editor: h,
997
1013
  nodeKey: t,
998
- fetchDeleteMedia: ce,
1014
+ fetchDeleteMedia: pe,
999
1015
  altText: i,
1000
- imageRef: b,
1016
+ imageRef: v,
1001
1017
  maxWidth: d,
1002
1018
  showCaption: l,
1003
1019
  caption: c,
1004
1020
  isCollabActive: !1,
1005
- historyState: fe,
1006
- showNestedEditorTreeView: he,
1007
- t: H,
1008
- href: y
1021
+ historyState: we,
1022
+ showNestedEditorTreeView: ke,
1023
+ t: B,
1024
+ href: I
1009
1025
  }
1010
1026
  )
1011
1027
  }
1012
1028
  );
1013
1029
  }
1014
1030
  export {
1015
- to as default
1031
+ lo as default
1016
1032
  };