@layers-app/editor 0.7.93 → 0.7.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/README.md +831 -831
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.d.ts +5 -65
  4. package/dist/index.js +12 -14
  5. package/dist/{layers.yFxcgyah.js → layers.-E5ZL8uG.js} +2 -2
  6. package/dist/{layers._ram0v-H.js → layers.13yQCoaW.js} +1 -1
  7. package/dist/{layers.BPni5cr6.js → layers.2SbhtZ-F.js} +2 -2
  8. package/dist/{layers.l9IaJ8Na.js → layers.2kEY3VsX.js} +1 -1
  9. package/dist/{layers.sFmfgHo4.js → layers.2mP7D5Gk.js} +3 -3
  10. package/dist/layers.3Q8u36mg.js +76 -0
  11. package/dist/layers.4AD4x-dG.js +1 -0
  12. package/dist/{layers.DDQgSWZM.js → layers.4DlTMioA.js} +4 -4
  13. package/dist/{layers.Daizjhsk.js → layers.6yAkjn3_.js} +3 -3
  14. package/dist/{layers.4vqpsuc3.js → layers.75v9_J7l.js} +1 -1
  15. package/dist/{layers.DzZ61AN4.js → layers.93L1Omwe.js} +1 -1
  16. package/dist/{layers.zW7UNB56.js → layers.98qn79XI.js} +1 -1
  17. package/dist/{layers.DEkU827U.js → layers.9YdRm5Ps.js} +1 -1
  18. package/dist/layers.9naw7mjQ.js +276 -0
  19. package/dist/{layers.CNUJb-Qd.js → layers.Aw93WAhu.js} +1 -1
  20. package/dist/{layers.BDiPbruK.js → layers.B-jCO_Ab.js} +1 -1
  21. package/dist/{layers.DTCgqxVH.js → layers.B0JlC05E.js} +1 -1
  22. package/dist/{layers._TXR7_BW.js → layers.B0NJNWRr.js} +1 -1
  23. package/dist/{layers.Lm3yzugI.js → layers.B0YMRqML.js} +1 -1
  24. package/dist/{layers.BLpNviKk.js → layers.B17FuWom.js} +1 -1
  25. package/dist/{layers.BnBIaczk.js → layers.B18E95WW.js} +1 -1
  26. package/dist/layers.B3RezEDU.js +1 -0
  27. package/dist/{layers.BzoSDIc-.js → layers.B4PQefTU.js} +1 -1
  28. package/dist/{layers.DM5FQGwH.js → layers.B5UtlMbi.js} +1 -1
  29. package/dist/{layers.BGJFkxfG.js → layers.B79K0gu0.js} +1 -1
  30. package/dist/{layers.BHnL_Uok.js → layers.B7bFm27p.js} +1 -1
  31. package/dist/{layers.GsD0_GxX.js → layers.B8cRjTv5.js} +8 -8
  32. package/dist/{layers.CC44ZlQZ.js → layers.BFTJjwZU.js} +24 -24
  33. package/dist/{layers.DHzGmamJ.js → layers.BFxVLejv.js} +1 -1
  34. package/dist/{layers.DAvGftUZ.js → layers.BH4Gwh3Q.js} +4 -4
  35. package/dist/{layers.iCGkfdqe.js → layers.BMlZJCFk.js} +1 -1
  36. package/dist/{layers.D_CVQ8_U.js → layers.BNCzrHwP.js} +1 -1
  37. package/dist/{layers.vvoHMkog.js → layers.BQMnzD02.js} +1 -1
  38. package/dist/{layers.CRV0BKlE.js → layers.BRJqlys_.js} +1 -1
  39. package/dist/layers.BRj8XDiJ.js +6 -0
  40. package/dist/{layers.iYPrW38K.js → layers.BRkx-I0n.js} +1 -1
  41. package/dist/{layers.BalFy4Pd.js → layers.BSC2_swu.js} +1 -1
  42. package/dist/{layers.D0l4OEP1.js → layers.BTEq-3Ng.js} +1 -1
  43. package/dist/{layers.DxYNx_WJ.js → layers.BTcW771z.js} +1 -1
  44. package/dist/layers.BV7jD_UG.js +300 -0
  45. package/dist/layers.BVu5YqDM.js +1 -0
  46. package/dist/layers.BWOY5x_s.js +215 -0
  47. package/dist/layers.BXcX2RSV.js +295 -0
  48. package/dist/{layers.Bcb3CJTF.js → layers.BXoWrkcs.js} +2 -2
  49. package/dist/{layers.OFbtrZYp.js → layers.BY-BtZXU.js} +3 -3
  50. package/dist/{layers.Fp2xKhlB.js → layers.BYsTLzE6.js} +1 -1
  51. package/dist/{layers.UWbJSE_q.js → layers.BZb38RRY.js} +1 -1
  52. package/dist/{layers.DRGSxBgi.js → layers.BaOjlgv_.js} +1 -1
  53. package/dist/{layers.DTkHkrLG.js → layers.BaT31SFJ.js} +5 -5
  54. package/dist/layers.BbKbad0b.js +1 -0
  55. package/dist/{layers.DWAnuPjJ.js → layers.BcJegCaI.js} +1 -1
  56. package/dist/{layers.BaDwWFkk.js → layers.BdHWNfs-.js} +1 -1
  57. package/dist/{layers.mCNNRzMK.js → layers.BePEn0X4.js} +1 -1
  58. package/dist/{layers.D5ldRac_.js → layers.BerJ0Pg3.js} +1 -1
  59. package/dist/{layers.-qD_IlHz.js → layers.Bfe9Pp9D.js} +1 -1
  60. package/dist/{layers.B6rOc-Ti.js → layers.BgySFLMk.js} +1 -1
  61. package/dist/{layers.D1UqHxFG.js → layers.BhvHH_Ju.js} +1 -1
  62. package/dist/{layers.IkYeHNd-.js → layers.Bi9ySoON.js} +1 -1
  63. package/dist/{layers.CsqTB_b0.js → layers.Bkv9fsTk.js} +1 -1
  64. package/dist/{layers.CxiX7XmH.js → layers.Blxnf5Vj.js} +1 -1
  65. package/dist/{layers.GVr5uU5W.js → layers.BpFBNir0.js} +1 -1
  66. package/dist/{layers.DkwDMTq9.js → layers.BpbSyRnx.js} +1 -1
  67. package/dist/{layers.kpBucBt1.js → layers.BpsE8-NY.js} +1 -1
  68. package/dist/{layers.D_1KCN2L.js → layers.BqGHT5wm.js} +1 -1
  69. package/dist/layers.Br2e9Qz-.js +1 -0
  70. package/dist/{layers.CfocA5Re.js → layers.BrNQmBHb.js} +1 -1
  71. package/dist/{layers.Dyd9_aH-.js → layers.BrVjD0OE.js} +1 -1
  72. package/dist/{layers.BEKTKoir.js → layers.BrsLij4r.js} +1 -1
  73. package/dist/{layers.VBselTAE.js → layers.BtdZ-A8x.js} +1 -1
  74. package/dist/{layers.BLCWQ59V.js → layers.BvnrNMBr.js} +1 -1
  75. package/dist/{layers.DuqUo0oU.js → layers.BzeRvcdG.js} +1 -1
  76. package/dist/{layers.jI-GVlXe.js → layers.BzlLEXPU.js} +1 -1
  77. package/dist/{layers.Y7kZzQzI.js → layers.C0SzQIIy.js} +1 -1
  78. package/dist/{layers.VjAp6vpG.js → layers.C16hyb_d.js} +1 -1
  79. package/dist/{layers.Qr2h1-VC.js → layers.C25rwqWq.js} +1 -1
  80. package/dist/{layers.BtJnQ0mI.js → layers.C4sZy2bH.js} +1 -1
  81. package/dist/{layers.C-Q16oCj.js → layers.C8KnrbJP.js} +1 -1
  82. package/dist/{layers.QnTzffzI.js → layers.C8Vg5nct.js} +1 -1
  83. package/dist/{layers.DcVK6qgi.js → layers.C8s-IpyV.js} +1 -1
  84. package/dist/{layers.CM5hqLt_.js → layers.C9ylISWH.js} +1 -1
  85. package/dist/{layers.CBaBV2iZ.js → layers.CC1bWKza.js} +1 -1
  86. package/dist/{layers.CV9JMOd0.js → layers.CClda9ub.js} +1 -1
  87. package/dist/{layers.vU738QAp.js → layers.CDPzHrZq.js} +1 -1
  88. package/dist/{layers.BkHV48yv.js → layers.CDlXOuYY.js} +1 -1
  89. package/dist/{layers.czDrchz1.js → layers.CE1Ndc4E.js} +1 -1
  90. package/dist/{layers.B0R-ifEH.js → layers.CFDWiiQA.js} +1 -1
  91. package/dist/{layers.CWjT_Kbq.js → layers.CGavCtyF.js} +1 -1
  92. package/dist/{layers.BoOiKUQt.js → layers.CGqJjyC3.js} +65 -65
  93. package/dist/{layers.CjgXNJBg.js → layers.CKAQZ-0D.js} +1 -1
  94. package/dist/{layers.DNoj8uH2.js → layers.CMpczyu-.js} +1 -1
  95. package/dist/{layers.ChEJ2zyQ.js → layers.CMuPbUPi.js} +1 -1
  96. package/dist/{layers.Brrg4jj_.js → layers.CMuo3nXh.js} +1 -1
  97. package/dist/{layers.CjvUFr5W.js → layers.COJrFB7F.js} +1 -1
  98. package/dist/{layers.aZyt0ZhK.js → layers.COKgTzFb.js} +4 -4
  99. package/dist/{layers.FuV5aVfW.js → layers.COWvbQVp.js} +1 -1
  100. package/dist/{layers.fsKnbvfV.js → layers.CQ6la2e9.js} +1 -1
  101. package/dist/{layers.C8DpC6Mn.js → layers.CQfNfZlg.js} +1 -1
  102. package/dist/{layers.CGwmNznF.js → layers.CRHKyZqs.js} +5 -5
  103. package/dist/{layers.CWuSuPfS.js → layers.CTJeDsBu.js} +1 -1
  104. package/dist/{layers.5usI25Xs.js → layers.CV24J_Mp.js} +1 -1
  105. package/dist/{layers.JabcC5VX.js → layers.CVM7K8J4.js} +1 -1
  106. package/dist/{layers.CFZqbydb.js → layers.Ca7SArHb.js} +3 -3
  107. package/dist/{layers.C_ZG_NmP.js → layers.CbfcnlO3.js} +1 -1
  108. package/dist/{layers.CTGsC808.js → layers.Ce9XkdTw.js} +1 -1
  109. package/dist/{layers.D_gH0Is5.js → layers.Cewl7lsR.js} +1 -1
  110. package/dist/{layers.zE2Ag_LD.js → layers.Cmz7hc2R.js} +1 -1
  111. package/dist/{layers.9iTOFkOz.js → layers.Cnk5pS5i.js} +1 -1
  112. package/dist/{layers.Bzd_kEIv.js → layers.CoRn3fKC.js} +1 -1
  113. package/dist/{layers._LRYHSJ0.js → layers.Colb3gh6.js} +1 -1
  114. package/dist/{layers.CN2AORSh.js → layers.CpJXQf84.js} +1 -1
  115. package/dist/{layers.CmFR2uKv.js → layers.CquKLVv1.js} +1 -1
  116. package/dist/{layers.C01LyZL_.js → layers.CrkcoIS9.js} +1 -1
  117. package/dist/{layers.I1SLD0UK.js → layers.CtqVlJjA.js} +1 -1
  118. package/dist/{layers.BEGCfKQE.js → layers.CuxC1Aal.js} +1 -1
  119. package/dist/{layers.CXoinSNf.js → layers.D0Ggmjob.js} +4 -4
  120. package/dist/{layers.DTBSutEB.js → layers.D1Ji033n.js} +1 -1
  121. package/dist/{layers.CmNwAjIw.js → layers.D1oWAK49.js} +1 -1
  122. package/dist/{layers.CRgtKhyz.js → layers.D2GOeQIy.js} +1 -1
  123. package/dist/{layers.D4BL-_g4.js → layers.D2gAypcS.js} +1 -1
  124. package/dist/{layers.msmp08Xf.js → layers.D3_1Ua0e.js} +4 -4
  125. package/dist/{layers.Chx21Noj.js → layers.D41K-b5z.js} +1 -1
  126. package/dist/{layers.PvxtC1eC.js → layers.D4mim_ow.js} +1 -1
  127. package/dist/layers.D6gRryL0.js +1 -0
  128. package/dist/{layers.DYnnh-09.js → layers.D7NR5knE.js} +1 -1
  129. package/dist/{layers.B7ml1wOj.js → layers.D7WjeTgf.js} +3 -3
  130. package/dist/{layers.Dzvv_LWT.js → layers.D86lQuXS.js} +3 -3
  131. package/dist/layers.D8k8DGNi.js +1 -0
  132. package/dist/{layers.CF7penQ9.js → layers.D9VyZLzg.js} +2 -2
  133. package/dist/{layers.BufejxmY.js → layers.D9qkyzx8.js} +1 -1
  134. package/dist/{layers.DryQJgTf.js → layers.DASXYyHC.js} +1 -1
  135. package/dist/{layers.D4QdQ1B8.js → layers.DAszBVfh.js} +1 -1
  136. package/dist/{layers.BKTJE34P.js → layers.DBCBDR3b.js} +1 -1
  137. package/dist/{layers.DmvODDQ0.js → layers.DH_mqaBo.js} +4 -4
  138. package/dist/{layers.D9BOJQ5y.js → layers.DHetpaGH.js} +1 -1
  139. package/dist/{layers.CfDwsZU0.js → layers.DJoZHH64.js} +1 -1
  140. package/dist/layers.DL2tuvoX.js +32090 -0
  141. package/dist/{layers.DDZzHO2e.js → layers.DLcN8PIe.js} +1 -1
  142. package/dist/{layers.CeI3w2iY.js → layers.DMFI38mY.js} +1 -1
  143. package/dist/{layers.MqC_9V6k.js → layers.DN34PNqI.js} +1 -1
  144. package/dist/{layers.Csi-9lrm.js → layers.DQ2wvSLl.js} +1 -1
  145. package/dist/{layers.DOTdJgPv.js → layers.DU9HGoz0.js} +1 -1
  146. package/dist/{layers.Cz_0Xe5w.js → layers.DVCmLI6u.js} +1 -1
  147. package/dist/{layers.Bk7jKmXI.js → layers.DVuJFeFE.js} +1 -1
  148. package/dist/{layers.BUhQr1my.js → layers.D_jnzZSL.js} +1 -1
  149. package/dist/{layers.DFmZFu4s.js → layers.Da7oE5mU.js} +1 -1
  150. package/dist/{layers.D6sxU8A2.js → layers.Dad7Lsnl.js} +2 -2
  151. package/dist/{layers.cYc9Mkkl.js → layers.Dci5QVDS.js} +1 -1
  152. package/dist/{layers.CpvsNStS.js → layers.DdbTq5aA.js} +1 -1
  153. package/dist/{layers.BcCelUDj.js → layers.DeIv1hll.js} +1 -1
  154. package/dist/layers.DeprR50W.js +1 -0
  155. package/dist/{layers.DGh8drOs.js → layers.DjWDEJ8X.js} +1 -1
  156. package/dist/{layers.BUFOBCMy.js → layers.DnE2GcHE.js} +3 -3
  157. package/dist/{layers.CKJZJ_ts.js → layers.Dnqr53bm.js} +1 -1
  158. package/dist/{layers.Bksq8_Qt.js → layers.DoP3fAoc.js} +1 -1
  159. package/dist/{layers.7jwh_MfI.js → layers.DrM9csiN.js} +1 -1
  160. package/dist/{layers.Stx3Iboc.js → layers.DszQIpo4.js} +1 -1
  161. package/dist/{layers.DXe2VR26.js → layers.Dt6tiPdm.js} +1 -1
  162. package/dist/{layers.BV-g-xzT.js → layers.Dwrzi8nh.js} +1 -1
  163. package/dist/{layers.CNcMdVwf.js → layers.DxJaSE64.js} +1 -1
  164. package/dist/{layers.CWTCSE0f.js → layers.DzMwdIk6.js} +1 -1
  165. package/dist/{layers.CZ4Y6y3c.js → layers.DzRpsx95.js} +1 -1
  166. package/dist/{layers.D_m-25Ic.js → layers.Fum9dFUj.js} +3 -3
  167. package/dist/{layers.DFuWTxaW.js → layers.ISpgzsWD.js} +1 -1
  168. package/dist/{layers.qRe_lZMu.js → layers.JLbefGlL.js} +1 -1
  169. package/dist/{layers.268NfhIX.js → layers.JfTTob86.js} +1 -1
  170. package/dist/{layers.C2fhjYrc.js → layers.KGrV8VX2.js} +1 -1
  171. package/dist/{layers.rulLZ93L.js → layers.KK7ljVw5.js} +1 -1
  172. package/dist/layers.MxJMzalS.js +304 -0
  173. package/dist/{layers.ve-b1iUI.js → layers.N8mnQie3.js} +1 -1
  174. package/dist/{layers.DqwY2YKL.js → layers.NgClHNlL.js} +1 -1
  175. package/dist/{layers.DwFHPFXW.js → layers.O8nidRfN.js} +1 -1
  176. package/dist/{layers.BpnHi2Sm.js → layers.PI9aySDS.js} +1 -1
  177. package/dist/{layers.mRg6Wxq7.js → layers.PYM0IMGs.js} +1 -1
  178. package/dist/{layers.orgRZ2V9.js → layers.RxFUv3Bx.js} +1 -1
  179. package/dist/{layers.V9lJ9Ccb.js → layers.V3nYpF_O.js} +1 -1
  180. package/dist/{layers.SWM1KY20.js → layers.VvK0SOcd.js} +1 -1
  181. package/dist/{layers.811TSpOY.js → layers.WIreiaYt.js} +1 -1
  182. package/dist/{layers.DhR_eZa8.js → layers.WrlUzNAW.js} +1 -1
  183. package/dist/{layers.XxXB7ixR.js → layers.Y0NPe355.js} +1 -1
  184. package/dist/{layers.nltEsUBo.js → layers._9wKr3L_.js} +4 -4
  185. package/dist/{layers.yasiEV95.js → layers.atxKDiCs.js} +1 -1
  186. package/dist/{layers.DTUuZqOa.js → layers.ayZrrBx5.js} +3 -3
  187. package/dist/{layers.CDOF7D2m.js → layers.b4rn0Atm.js} +4 -4
  188. package/dist/{layers.LQ0WKJCL.js → layers.bBh5bzLb.js} +1 -1
  189. package/dist/{layers.hmEL7VCj.js → layers.c2Is_p3D.js} +1 -1
  190. package/dist/{layers.DFmhjbPv.js → layers.cJw8uJHc.js} +3 -3
  191. package/dist/{layers.DVTq8SE9.js → layers.g0SmonNN.js} +1 -1
  192. package/dist/{layers.gCS_1NW6.js → layers.hI4w-_CI.js} +1 -1
  193. package/dist/{layers.DUlvtU8P.js → layers.hYb_RCe5.js} +1 -1
  194. package/dist/{layers.DhwgnsWZ.js → layers.iivRqxRU.js} +1 -1
  195. package/dist/{layers.mCqe-cvO.js → layers.jO4OWeX_.js} +1 -1
  196. package/dist/layers.jx_O1wUV.js +8 -0
  197. package/dist/{layers.C94ZEZX8.js → layers.kVp2pqJH.js} +1 -1
  198. package/dist/{layers.BeIbAvhr.js → layers.nvOqxz3c.js} +1 -1
  199. package/dist/layers.o-pm_2Rk.js +271 -0
  200. package/dist/{layers.M4h6tkxO.js → layers.osawo8PK.js} +1 -1
  201. package/dist/{layers.BZp78mT0.js → layers.qKOcmQPG.js} +1 -1
  202. package/dist/{layers.Dhtl9hTt.js → layers.r7BDo2cG.js} +1 -1
  203. package/dist/{layers.igq8-CrV.js → layers.rZOTpVnw.js} +6 -6
  204. package/dist/{layers.CLVPhrnI.js → layers.sZGMBfa4.js} +7 -7
  205. package/dist/{layers.BRP3PhII.js → layers.smouwFHe.js} +3 -3
  206. package/dist/{layers.B5LuOdoA.js → layers.soKSk4Tf.js} +1 -1
  207. package/dist/{layers.DSzKKGJF.js → layers.xLYLKZWw.js} +1 -1
  208. package/dist/{layers.CFML777f.js → layers.yikAnJS7.js} +1 -1
  209. package/dist/{layers.BfyTGtGq.js → layers.ym_97Wes.js} +1 -1
  210. package/dist/{layers.CG4NZuoY.js → layers.yo62u_-M.js} +1 -1
  211. package/package.json +20 -46
  212. package/dist/layers.-tiwgsIy.js +0 -17
  213. package/dist/layers.BF5czbZm.js +0 -310
  214. package/dist/layers.Brbunzgb.js +0 -1
  215. package/dist/layers.C8scOXtX.js +0 -46873
  216. package/dist/layers.CNASfKEr.js +0 -1
  217. package/dist/layers.Ce5d3c4K.js +0 -1
  218. package/dist/layers.CmmYt3Ou.js +0 -1
  219. package/dist/layers.CnCND_tm.js +0 -533
  220. package/dist/layers.DBe4vr1J.js +0 -6
  221. package/dist/layers.DGYg3grQ.js +0 -346
  222. package/dist/layers.DH0uo8fs.js +0 -1
  223. package/dist/layers.Dh7vm0BH.js +0 -500
  224. package/dist/layers.DilA0qnM.js +0 -54
  225. package/dist/layers.Dybb-MrJ.js +0 -1
  226. package/dist/layers.UyyKG0j1.js +0 -8
  227. package/dist/layers.vgzUgI4K.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("react"),z=require("react-i18next"),$=require("@lexical/react/LexicalComposerContext"),y=require("@mantine/core"),w=require("lexical"),q=require("@layers-app/shared"),e=require("./layers.BF5czbZm.js"),R=require("@mantine/hooks"),J=()=>{};function Q({nodeKey:t,src:r,id:a}){const{t:l}=z.useTranslation(),[h]=$.useLexicalComposerContext(),[m,f]=i.useState(!1),[c,p]=i.useState(!1),x=i.useCallback(()=>{h.update(()=>{const v=w.$getNodeByKey(t);e.$isImageNode(v)&&v.remove()})},[h,t]),j=i.useCallback(async()=>{if(r)try{await e.downloadImageFromExternalUrl(r,e.inferImageFilenameFromUrl(r))}catch{}},[r]);return n.jsxs("div",{className:"media-actions visible",style:{position:"absolute",top:10,right:10,zIndex:10,pointerEvents:"auto",display:"flex",gap:4},onClick:v=>v.stopPropagation(),children:[n.jsx(e.PreviewImage,{t:l,src:r,setShown:J,id:a}),n.jsx(e.AlignmentImage,{opened:m,setOpened:f,t:l,editor:h,nodeKey:t}),n.jsx(e.MediaActionMenu,{opened:c,onOpenChange:p,t:l,onDownload:()=>void j(),onDelete:x})]})}function K({nodeKey:t,src:r,id:a}){const{t:l}=z.useTranslation(),[h]=$.useLexicalComposerContext(),[m,{open:f,close:c}]=R.useDisclosure(!1),[p,{open:x,close:j}]=R.useDisclosure(!1),v=i.useMemo(()=>[{id:!a||a==="0"?"":a,Url:r??"",contentType:"",originalFileName:"",fileSize:0,storageType:"",storagePath:"",fileName:"",parentType:"",parentId:"",ownerId:"",createdAt:new Date,updatedAt:new Date,version:0,deleted:!1,deletedAt:new Date}],[r,a]),N=()=>{c(),x()},S=i.useCallback(async()=>{if(c(),!!r)try{await e.downloadImageFromExternalUrl(r,e.inferImageFilenameFromUrl(r))}catch{}},[r,c]),C=i.useCallback(()=>{c(),h.update(()=>{const s=w.$getNodeByKey(t);e.$isImageNode(s)&&s.remove()})},[h,t,c]);return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"image-touch-actions",style:{position:"absolute",top:8,right:8,zIndex:10,pointerEvents:"auto"},onClick:s=>s.stopPropagation(),children:n.jsx(e.ActionIcon,{label:l("editor.toolbar.more"),icon:e.O1,iconColor:"var(--mantine-color-gray-text)","aria-label":l("editor.toolbar.more"),onClick:f})}),n.jsx(q.AttachmentsGalleryModal,{opened:p,onOpenChange:s=>s?x():j(),attachments:v}),n.jsx(e.MobileDrawer,{opened:m,onClose:c,title:l("editor.image.mobileActions"),children:n.jsxs(y.Stack,{gap:4,p:0,children:[n.jsx(y.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"light-dark(var(--mantine-color-gray-0), var(--mantine-color-gray-outline-hover))",onClick:N,leftSection:n.jsx(e.HugeiconsIcon,{icon:e.gn,size:16,color:"var(--mantine-color-dimmed)"}),children:l("editor.image.previewFullScreen")}),n.jsx(y.Button,{type:"button",variant:"subtle",color:"gray",fullWidth:!0,justify:"flex-start",bg:"light-dark(var(--mantine-color-gray-0), var(--mantine-color-gray-outline-hover))",onClick:()=>void S(),leftSection:n.jsx(e.HugeiconsIcon,{icon:e.Tm,size:16,color:"var(--mantine-color-dimmed)"}),children:l("editor.gallery.download")}),n.jsx(y.Button,{type:"button",variant:"subtle",color:"red",fullWidth:!0,justify:"flex-start",bg:"light-dark(var(--mantine-color-gray-0), var(--mantine-color-gray-outline-hover))",onClick:C,leftSection:n.jsx(e.HugeiconsIcon,{icon:e.lg,size:16,color:"var(--mantine-color-red-6)"}),children:l("editor.actions.delete")})]})})]})}const H=t=>{const{width:r,height:a,isLoading:l,isError:h,src:m,id:f,altText:c,imageRef:p,maxWidth:x}=t;return n.jsxs("div",{className:"media-wrapper",style:{width:r,height:a,display:"inline-flex",position:"relative"},children:[n.jsx(y.LoadingOverlay,{visible:l,zIndex:1e3,overlayProps:{backgroundOpacity:.5},loaderProps:{size:24,color:"black"}}),n.jsx(ee,{className:null,src:m,altText:c,imageRef:p,width:"inherit",height:"inherit",maxWidth:x||"auto",id:f}),e.IS_TOUCH_DEVICE&&n.jsx(K,{nodeKey:t.nodeKey,src:m,id:f}),e.IS_TOUCH_TABLET&&n.jsx(Q,{nodeKey:t.nodeKey,src:m,id:f})]})};function ee({altText:t,className:r,imageRef:a,src:l,width:h,height:m,maxWidth:f,id:c}){const[p,x]=i.useState(!1);return n.jsx("img",{className:`${r||void 0} ${p?"":"loading"}`,src:l,alt:t,ref:a,style:{height:m,maxWidth:f,width:h},onLoad:()=>{l.includes("splash")?setTimeout(()=>{x(!0)},100):x(!0)},draggable:"false","data-id":c})}function te(t){const{disable:r}=i.useContext(e.Context);return r&&e.ImageNode.isPlaceholderSrc(t.src)?null:n.jsx(oe,{...t})}function oe({src:t,altText:r,nodeKey:a,width:l,height:h,maxWidth:m,showCaption:f,caption:c,id:p,create:x,alignment:j,imagePickerTab:v}){var F,B;const N=i.useRef(null),[S,C]=i.useState(!0),[s]=$.useLexicalComposerContext(),[b,E]=i.useState(!0),[I,A]=i.useState({width:0,height:0}),{start:L}=e.useCancelUpload(),[ne,O]=i.useState(0),{fetchUploadMedia:T,fetchDeleteMedia:W,maxFileSize:ie}=i.useContext(e.Context),k=e.mediaMap.has(t)&&(((F=e.mediaMap.get(t))==null?void 0:F.mediaNodeKeys.length)===0||((B=e.mediaMap.get(t))==null?void 0:B.mediaNodeKeys.length)===void 0||t.trim()===""),{t:D}=z.useTranslation(),[ae,V]=i.useState(0);i.useEffect(()=>s.registerDecoratorListener(()=>{V(o=>o+1)}),[k]),i.useEffect(()=>{if(!t||t.startsWith("data:image/")||!t.trim()){C(!1);return}const o=new Image;o.src=t,o.onload=()=>C(!1),o.onerror=()=>{C(!1)}},[t,k]);const G=(o,u)=>{s.update(()=>{w.$setSelection(null);const d=w.$getNodeByKey(a);e.$isImageNode(d)&&d.setWidthAndHeight(o,u)})},{historyState:U}=e.useSharedHistoryContext(),{settings:{showNestedEditorTreeView:_}}=e.useSettings();function X(o){return o.endsWith(".svg")||o.includes("image/svg+xml")}function Y(o){return new Promise((u,d)=>{if(X(o)){u(0);return}const g=new Image;g.src=o,g.onload=()=>{u(g.width)},g.onerror=()=>{d(new Error("Failed to load image"))}})}i.useEffect(()=>{let o=l,u=h,d=100;(t.includes("unsplash")?t.trim():!k&&t.trim()||t.includes("upload-src-editor"))&&t!=="upload"&&Y(t).then(g=>{typeof o=="number"&&o<d&&g<d?(E(!0),A({width:o,height:u})):g<d?(E(!0),A({width:"auto",height:"auto"})):(A({width:g,height:g}),E(!1))}).catch(g=>{console.warn("Ошибка при загрузке изображения:",g.message)})},[t,k]),i.useEffect(()=>{I.width&&I.height&&b&&s.update(()=>{const o=w.$getNodeByKey(a);e.$isImageNode(o)&&o.setWidthAndHeight(I.width,I.height)})},[I.width,I.height,b]);const Z=i.useCallback(o=>e.$writeImagePickerTabToNode(s,a,o),[s,a]),M=i.useCallback((o,u)=>{C(!1),s.update(()=>{const d=w.$getNodeByKey(a);e.$isImageNode(d)&&(d.setSrc(o),d.setId(u))})},[s,a]),P=i.useCallback(o=>{C(!0);const u=L();T&&T(o[0],(d,g)=>{M(d,g),O(0)},d=>{d&&q.showErrorNotification({message:D("editor.gallery.errorFile")}),O(0),M("","")},u,d=>{O(d)})},[T,L,D,M]);return i.useEffect(()=>s.registerCommand(e.UPLOAD_IMAGE_COMMAND,o=>t!=="upload"||o.targetNodeKey!==a?!1:(P(o.files),!0),w.COMMAND_PRIORITY_LOW),[s,P,a,t]),!t||t==="upload"?n.jsx(y.Box,{"data-editor-image-picker-drop-root":!0,w:"100%",children:n.jsx(e.ImagePicker,{inline:!0,nodeKey:a,defaultTabValue:v,onWriteTabToNode:Z,uploading:!1,onUpload:o=>{!T||!o.length||P(o)},popoverProps:{opened:!0,position:"bottom",zIndex:e.EDITOR_UI_MIN_Z_INDEX},onChange:o=>{s.update(()=>{const u=w.$getNodeByKey(a);e.$isImageNode(u)&&u.setSrc(o)})}})}):b?n.jsx(H,{width:I.width,height:I.height,isLoading:S,isError:!1,isIcon:b,src:t,id:p,editor:s,nodeKey:a,fetchDeleteMedia:W,altText:r,imageRef:N,maxWidth:m,showCaption:f,caption:c,isCollabActive:!1,historyState:U,showNestedEditorTreeView:_,t:D}):n.jsx(e.ResizableContainer,{editor:s,isIcon:b,width:e.parseContainerSize(l),height:e.parseContainerSize(h),initialWidth:I.width||"",initialHeight:I.height||"",onResizeEnd:G,alignment:j,children:n.jsx(H,{width:"inherit",height:"inherit",isLoading:S,isError:!1,isIcon:b,src:t,id:p,editor:s,nodeKey:a,fetchDeleteMedia:W,altText:r,imageRef:N,maxWidth:m,showCaption:f,caption:c,isCollabActive:!1,historyState:U,showNestedEditorTreeView:_,t:D})})}exports.default=te;
@@ -1 +0,0 @@
1
- "use strict";const n=require("./layers.DTUuZqOa.js"),s=(e,r)=>n.Utils.lang.round(n.Color.parse(e)[r]);exports.channel=s;
@@ -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,533 +0,0 @@
1
- import { jsx as n, jsxs as S, Fragment as oe } from "react/jsx-runtime";
2
- import { useMemo as re, useState as _, useEffect as z, useRef as F, useCallback as R, Suspense as le, lazy as ie } from "react";
3
- import { useLexicalComposerContext as ae } from "@lexical/react/LexicalComposerContext";
4
- import { useLexicalEditable as se } from "@lexical/react/useLexicalEditable";
5
- import { useLexicalNodeSelection as ce } from "@lexical/react/useLexicalNodeSelection";
6
- import { mergeRegister as de } from "@lexical/utils";
7
- import { $setSelection as ue, $getNodeByKey as H, CLICK_COMMAND as fe, COMMAND_PRIORITY_LOW as $, KEY_DELETE_COMMAND as me, KEY_BACKSPACE_COMMAND as ge } from "lexical";
8
- import { R as he, b as q, y as Q, m as Y, K as be, F as Z, A as pe, p as K, G as xe, M as Ce, H as P, a as ne, J as ee } from "./layers.C8scOXtX.js";
9
- import { l as ve, p as Ee } from "./layers.DilA0qnM.js";
10
- import { useTranslation as J } from "react-i18next";
11
- import { Modal as we, Text as ye, Flex as Te, Button as G, Box as te, Stack as ke, useMantineColorScheme as Me, Loader as De } from "@mantine/core";
12
- import { useDisclosure as Oe } from "@mantine/hooks";
13
- import { BottomDrawerWithoutHeader as Se } from "@layers-app/shared";
14
- const _e = ({
15
- isCloseModal: r,
16
- setCloseModalOpen: i,
17
- confirmClose: b
18
- }) => {
19
- const { t: p } = J();
20
- return /* @__PURE__ */ n(
21
- we,
22
- {
23
- opened: r,
24
- onClose: () => {
25
- i(!1);
26
- },
27
- centered: !0,
28
- title: p("editor.unsavedChanges.title"),
29
- closeOnClickOutside: !0,
30
- closeOnEscape: !0,
31
- size: "500",
32
- zIndex: 999,
33
- children: /* @__PURE__ */ S("div", { children: [
34
- /* @__PURE__ */ n(ye, { mb: "md", children: p("editor.unsavedChanges.message") }),
35
- /* @__PURE__ */ S(Te, { justify: "flex-end", gap: "sm", children: [
36
- /* @__PURE__ */ n(
37
- G,
38
- {
39
- variant: "default",
40
- onClick: () => {
41
- i(!1);
42
- },
43
- fullWidth: !0,
44
- children: p("editor.unsavedChanges.cancel")
45
- }
46
- ),
47
- /* @__PURE__ */ n(G, { color: "red", onClick: b, fullWidth: !0, children: p("editor.unsavedChanges.closeWithoutSaving") })
48
- ] })
49
- ] })
50
- }
51
- );
52
- };
53
- function Ne({
54
- imageContainerRef: r,
55
- editor: i,
56
- rootClassName: b = null,
57
- width: p = "inherit",
58
- height: f = "inherit",
59
- nodeKey: a,
60
- alignment: N,
61
- setModalOpen: C,
62
- previewSVG: o,
63
- isModalOpen: k
64
- }) {
65
- const u = re(() => o ?? "", [o]), [B, y] = _(!1), [
66
- L,
67
- { open: v, close: E }
68
- ] = Oe(!1), { t: c } = J();
69
- z(() => {
70
- k && y(!1);
71
- }, [k]);
72
- const A = (T, g) => {
73
- i.update(() => {
74
- ue(null);
75
- const e = H(a);
76
- return ne(e) && e.setWidthAndHeight(T, g), !0;
77
- });
78
- }, M = () => {
79
- ee(i, a);
80
- }, D = () => {
81
- E(), C(!0);
82
- }, j = () => {
83
- E(), ee(i, a);
84
- };
85
- return /* @__PURE__ */ S(
86
- he,
87
- {
88
- editor: i,
89
- isIcon: !1,
90
- isEmbed: !0,
91
- width: Q(p),
92
- height: Q(f),
93
- onResizeEnd: A,
94
- alignment: N,
95
- children: [
96
- /* @__PURE__ */ S(te, { className: "media-wrapper excaildraw", children: [
97
- /* @__PURE__ */ n(
98
- "div",
99
- {
100
- className: `media-actions${q || !xe ? " visible" : ""}`,
101
- children: q ? /* @__PURE__ */ n(
102
- Y,
103
- {
104
- "aria-label": c("editor.toolbar.more"),
105
- label: c("editor.toolbar.more"),
106
- flexBorder: !0,
107
- onClick: v,
108
- icon: be,
109
- iconColor: "var(--mantine-color-gray-text)"
110
- }
111
- ) : /* @__PURE__ */ S(oe, { children: [
112
- /* @__PURE__ */ n(
113
- Y,
114
- {
115
- "aria-label": "Settings",
116
- label: c("editor.link.edit"),
117
- flexBorder: !0,
118
- onClick: () => {
119
- C(!0);
120
- },
121
- icon: Z,
122
- iconColor: "var(--mantine-color-gray-text)"
123
- }
124
- ),
125
- /* @__PURE__ */ n(
126
- pe,
127
- {
128
- opened: B,
129
- setOpened: y,
130
- t: c,
131
- editor: i,
132
- nodeKey: a,
133
- flexBorder: !0
134
- }
135
- ),
136
- /* @__PURE__ */ n(
137
- Y,
138
- {
139
- "aria-label": "Delete",
140
- label: c("editor.actions.delete"),
141
- flexBorder: !0,
142
- onClick: M,
143
- icon: K,
144
- iconColor: "var(--mantine-color-red-outline)"
145
- }
146
- )
147
- ] })
148
- }
149
- ),
150
- /* @__PURE__ */ n(
151
- te,
152
- {
153
- w: "100%",
154
- ref: (T) => {
155
- T && r && (r.current = T);
156
- },
157
- className: b ?? "",
158
- dangerouslySetInnerHTML: { __html: u }
159
- }
160
- )
161
- ] }),
162
- q && /* @__PURE__ */ n(
163
- Ce,
164
- {
165
- opened: L,
166
- onClose: E,
167
- title: c("editor.image.mobileActions"),
168
- children: /* @__PURE__ */ S(ke, { gap: 4, p: 0, children: [
169
- /* @__PURE__ */ n(
170
- G,
171
- {
172
- type: "button",
173
- variant: "subtle",
174
- color: "gray",
175
- fullWidth: !0,
176
- justify: "flex-start",
177
- bg: "light-dark(var(--mantine-color-gray-0), var(--mantine-color-gray-outline-hover))",
178
- onClick: D,
179
- leftSection: /* @__PURE__ */ n(
180
- P,
181
- {
182
- icon: Z,
183
- size: 16,
184
- color: "var(--mantine-color-dimmed)"
185
- }
186
- ),
187
- children: c("editor.link.edit")
188
- }
189
- ),
190
- /* @__PURE__ */ n(
191
- G,
192
- {
193
- type: "button",
194
- variant: "subtle",
195
- color: "red",
196
- fullWidth: !0,
197
- justify: "flex-start",
198
- bg: "light-dark(var(--mantine-color-gray-0), var(--mantine-color-gray-outline-hover))",
199
- onClick: j,
200
- leftSection: /* @__PURE__ */ n(
201
- P,
202
- {
203
- icon: K,
204
- size: 16,
205
- color: "var(--mantine-color-red-6)"
206
- }
207
- ),
208
- children: c("editor.actions.delete")
209
- }
210
- )
211
- ] })
212
- }
213
- )
214
- ]
215
- }
216
- );
217
- }
218
- let V = null;
219
- const Be = /* @__PURE__ */ ie(async () => {
220
- var i;
221
- const r = await import("./layers.GsD0_GxX.js").then((b) => b.M);
222
- return !V && r && (V = r.exportToSvg || ((i = r.default) == null ? void 0 : i.exportToSvg) || r.default), { default: r.Excalidraw };
223
- }), Le = () => {
224
- const [r, i] = _(
225
- null
226
- ), b = R(
227
- (p) => i(p),
228
- []
229
- );
230
- return [r, b];
231
- };
232
- function Ae({
233
- onSave: r,
234
- initialElements: i,
235
- initialAppState: b,
236
- initialFiles: p,
237
- isShown: f = !1,
238
- onDelete: a,
239
- onClose: N,
240
- isEdited: C
241
- }) {
242
- const [o, k] = Le(), { i18n: u, t: B } = J(), { colorScheme: y } = Me(), L = F(!1), [v, E] = _(i), [c, A] = _(p), [M, D] = _(f);
243
- z(() => {
244
- f && D(!0);
245
- }, [f]), z(() => {
246
- !f || L.current || (L.current = !0, Promise.resolve({ }));
247
- }, [f]), z(() => {
248
- f && setTimeout(() => {
249
- var e, x;
250
- (e = o == null ? void 0 : o.refresh) == null || e.call(o), (x = o == null ? void 0 : o.scrollToContent) == null || x.call(o);
251
- }, 500);
252
- }, [f, o]), z(() => {
253
- if (!f)
254
- return;
255
- const e = (t, d) => {
256
- const m = B(t);
257
- return m.startsWith("editor.menu") ? d : m;
258
- }, x = e(
259
- "editor.menu.excalidraw.tools.frameTool",
260
- u.language === "ru" ? "Инструмент рамки" : u.language === "es" ? "Herramienta de marco" : "Frame tool"
261
- ), s = e(
262
- "editor.menu.excalidraw.tools.webEmbed",
263
- u.language === "ru" ? "Веб-встраивание" : u.language === "es" ? "Incrustación web" : "Web Embed"
264
- ), w = e(
265
- "editor.menu.excalidraw.tools.generate",
266
- u.language === "ru" ? "Генерировать" : u.language === "es" ? "Generar" : "Generate"
267
- ), W = {
268
- "Frame tool": x,
269
- "Web Embed": s,
270
- "Web embeded": s,
271
- Generate: w
272
- }, O = () => {
273
- const t = document.querySelector(".App-toolbar__extra-tools-dropdown");
274
- if (!t)
275
- return;
276
- const d = document.createTreeWalker(
277
- t,
278
- NodeFilter.SHOW_TEXT,
279
- null
280
- );
281
- let m;
282
- for (; m = d.nextNode(); )
283
- if (m.nodeType === Node.TEXT_NODE && m.textContent) {
284
- const X = m.textContent.trim();
285
- for (const [U, I] of Object.entries(W))
286
- if (X === U && I && !X.includes(I)) {
287
- m.textContent = m.textContent.replace(U, I);
288
- break;
289
- }
290
- }
291
- }, l = () => {
292
- setTimeout(() => {
293
- O();
294
- }, 0);
295
- }, h = setTimeout(() => {
296
- const t = document.querySelector(
297
- ".excalidraw-container"
298
- );
299
- if (t) {
300
- const d = t.querySelector(
301
- ".App-toolbar__extra-tools-trigger"
302
- );
303
- d && d.addEventListener("click", l);
304
- }
305
- }, 300);
306
- return () => {
307
- clearTimeout(h);
308
- const t = document.querySelector(
309
- ".excalidraw-container"
310
- );
311
- if (t) {
312
- const d = t.querySelector(
313
- ".App-toolbar__extra-tools-trigger"
314
- );
315
- d && d.removeEventListener("click", l);
316
- }
317
- };
318
- }, [f, u.language, B]);
319
- const j = R(async () => {
320
- var O, l, h;
321
- let e = V;
322
- if (!e || typeof e != "function") {
323
- const t = await import("./layers.GsD0_GxX.js").then((d) => d.M);
324
- e = t.exportToSvg || ((O = t.default) == null ? void 0 : O.exportToSvg) || t.default, e && typeof e == "function" && (V = e);
325
- }
326
- if (!e || typeof e != "function") {
327
- const t = await import("./layers.GsD0_GxX.js").then((m) => m.M), d = t ? Object.keys(t) : [];
328
- throw console.error("Excalidraw module structure:", {
329
- keys: d,
330
- hasExportToSvg: t && "exportToSvg" in t,
331
- hasDefault: t && "default" in t,
332
- moduleType: typeof t,
333
- module: t
334
- }), new Error(
335
- `exportToSvg is not available from @excalidraw/excalidraw. Module keys: ${d.join(", ")}. Please ensure @excalidraw/excalidraw is properly installed.`
336
- );
337
- }
338
- const x = ((l = o == null ? void 0 : o.getAppState) == null ? void 0 : l.call(o)) ?? b, s = await e({
339
- appState: x,
340
- elements: v,
341
- files: c
342
- }), w = (h = s == null ? void 0 : s.firstElementChild) == null ? void 0 : h.firstElementChild, W = s.getAttribute("viewBox");
343
- if (W != null) {
344
- const t = W.split(" ");
345
- s.setAttribute("width", t[2]), s.setAttribute("height", t[3]);
346
- }
347
- return w && w.tagName === "style" && w.remove(), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("display", "block"), s.classList.add("excalidraw-svg"), s.outerHTML;
348
- }, [v, c, o, b]), T = () => {
349
- if (v && v.filter((e) => !e.isDeleted).length > 0) {
350
- const e = o == null ? void 0 : o.getAppState(), x = {
351
- exportBackground: e == null ? void 0 : e.exportBackground,
352
- exportScale: e == null ? void 0 : e.exportScale,
353
- exportWithDarkMode: (e == null ? void 0 : e.theme) === "dark",
354
- isBindingEnabled: e == null ? void 0 : e.isBindingEnabled,
355
- isLoading: e == null ? void 0 : e.isLoading,
356
- name: e == null ? void 0 : e.name,
357
- theme: e == null ? void 0 : e.theme,
358
- viewBackgroundColor: e == null ? void 0 : e.viewBackgroundColor,
359
- viewModeEnabled: e == null ? void 0 : e.viewModeEnabled,
360
- zenModeEnabled: e == null ? void 0 : e.zenModeEnabled,
361
- zoom: e == null ? void 0 : e.zoom
362
- };
363
- (async () => {
364
- const s = await j();
365
- r(v, x, c, s);
366
- })();
367
- } else
368
- a();
369
- }, g = (e, x, s) => {
370
- (e == null ? void 0 : e.length) !== (i == null ? void 0 : i.length) && (C.current = !0), E(e), A(s);
371
- };
372
- return /* @__PURE__ */ n(
373
- Se,
374
- {
375
- opened: f,
376
- onClose: N,
377
- onSave: T,
378
- className: "excaildraw-modal",
379
- closeOnEscape: !1,
380
- children: M && /* @__PURE__ */ n(
381
- le,
382
- {
383
- fallback: /* @__PURE__ */ n(
384
- "div",
385
- {
386
- style: {
387
- display: "flex",
388
- justifyContent: "center",
389
- alignItems: "center",
390
- height: "100%",
391
- minHeight: "400px"
392
- },
393
- children: /* @__PURE__ */ n(De, { size: "sm" })
394
- }
395
- ),
396
- children: /* @__PURE__ */ n(
397
- Be,
398
- {
399
- langCode: ve[u.language],
400
- theme: y,
401
- onChange: g,
402
- excalidrawAPI: k,
403
- initialData: {
404
- appState: { ...b || { isLoading: !1 } },
405
- elements: i,
406
- files: p,
407
- scrollToContent: !0
408
- }
409
- }
410
- )
411
- }
412
- )
413
- }
414
- );
415
- }
416
- function Xe({
417
- nodeKey: r,
418
- data: i,
419
- width: b,
420
- height: p,
421
- alignment: f
422
- }) {
423
- var O;
424
- const [a] = ae(), N = se(), C = re(() => Ee(i), [i]), o = ((O = C == null ? void 0 : C.elements) == null ? void 0 : O.length) === 0 && !C.previewSVG, [k, u] = _(
425
- o && a.isEditable()
426
- ), [B, y] = _(!1), L = F(null), v = F(null), E = F(null), [c, A, M] = ce(r), D = R(
427
- (l) => (c && (l.preventDefault(), a.update(() => {
428
- const h = H(r);
429
- h && h.remove();
430
- })), !1),
431
- [a, c, r]
432
- );
433
- z(() => {
434
- if (!N) {
435
- c && M();
436
- return;
437
- }
438
- return de(
439
- a.registerCommand(
440
- fe,
441
- (l) => {
442
- const h = v.current, t = l.target;
443
- return h !== null && h.contains(t) ? (l.shiftKey || M(), A(!c), l.detail > 1 && u(!0), !0) : !1;
444
- },
445
- $
446
- ),
447
- a.registerCommand(
448
- me,
449
- D,
450
- $
451
- ),
452
- a.registerCommand(
453
- ge,
454
- D,
455
- $
456
- )
457
- );
458
- }, [M, a, c, D, A, N]);
459
- const j = R(() => (u(!1), a.update(() => {
460
- const l = H(r);
461
- l && l.remove();
462
- })), [a, r]), T = (l, h, t, d) => a.update(() => {
463
- const m = H(r);
464
- ne(m) && (l && l.length > 0 || Object.keys(t).length > 0 ? m.setData(
465
- JSON.stringify({
466
- appState: h,
467
- elements: l,
468
- files: t,
469
- previewSVG: d
470
- })
471
- ) : m.remove());
472
- }), { elements: g = [], files: e = {}, appState: x = {}, previewSVG: s } = C, w = R(() => {
473
- u(!1), y(!1), E.current = !1, (g == null ? void 0 : g.length) === 0 && a.update(() => {
474
- const l = H(r);
475
- l && l.remove();
476
- });
477
- }, [a, r, g == null ? void 0 : g.length]), W = R(() => {
478
- E.current ? y(!0) : w();
479
- }, [w]);
480
- return /* @__PURE__ */ S(oe, { children: [
481
- /* @__PURE__ */ n(
482
- _e,
483
- {
484
- isCloseModal: B,
485
- confirmClose: w,
486
- setCloseModalOpen: y
487
- }
488
- ),
489
- /* @__PURE__ */ n(
490
- Ae,
491
- {
492
- initialElements: g,
493
- isEdited: E,
494
- initialFiles: e,
495
- initialAppState: x,
496
- isShown: k,
497
- onDelete: j,
498
- onClose: W,
499
- onSave: (l, h, t, d) => {
500
- T(l, h, t, d), u(!1);
501
- },
502
- closeOnClickOutside: !1
503
- }
504
- ),
505
- (g == null ? void 0 : g.length) && /* @__PURE__ */ n(
506
- "div",
507
- {
508
- style: {
509
- display: "flex",
510
- justifyContent: f
511
- },
512
- children: /* @__PURE__ */ n(
513
- Ne,
514
- {
515
- imageContainerRef: L,
516
- className: "image",
517
- width: b,
518
- height: p,
519
- editor: a,
520
- nodeKey: r,
521
- alignment: f,
522
- setModalOpen: u,
523
- previewSVG: s,
524
- isModalOpen: k
525
- }
526
- )
527
- }
528
- )
529
- ] });
530
- }
531
- export {
532
- Xe as default
533
- };
@@ -1,6 +0,0 @@
1
- import { e as o, j as s, o as f } from "./layers.GsD0_GxX.js";
2
- export {
3
- o as default,
4
- s as en,
5
- f as kaa
6
- };