@layers-app/editor 0.0.29-ai.2 → 0.0.29

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 (219) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +1 -4
  3. package/dist/index.js +2 -2
  4. package/dist/{layers.BCaFbUH5.js → layers.-SoYlGZ4.js} +2 -2
  5. package/dist/{layers.6xk3k-22.js → layers.04hul7Cl.js} +1 -1
  6. package/dist/{layers.sYTC4UcY.js → layers.0Rb5RtgL.js} +1 -1
  7. package/dist/{layers.DAetmRiw.js → layers.0x5kHZ9j.js} +4 -4
  8. package/dist/{layers.D04EE0G1.js → layers.27ul8mtz.js} +1 -1
  9. package/dist/{layers.DA6QqPl0.js → layers.6D4d6rRA.js} +1 -1
  10. package/dist/{layers.DbsSLqx1.js → layers.7Vivg-r0.js} +1 -1
  11. package/dist/{layers.BPZOR_WG.js → layers.9IYRxPhZ.js} +1 -1
  12. package/dist/{layers.DQP5zFGu.js → layers.B0tEq2s6.js} +1 -1
  13. package/dist/layers.B16cpHno.js +1 -0
  14. package/dist/{layers.CfeZBkq5.js → layers.B2WF6t5X.js} +1 -1
  15. package/dist/{layers.1k8s8nug.js → layers.B2mVB3DA.js} +1 -1
  16. package/dist/{layers.CL3L1yEb.js → layers.B3fYd_9D.js} +1 -1
  17. package/dist/{layers.ClJq0fhk.js → layers.B3qykxUx.js} +1 -1
  18. package/dist/{layers.D-mxh2D7.js → layers.B45pZpRt.js} +1 -1
  19. package/dist/{layers.CPz--RvC.js → layers.B5lO7ma5.js} +1 -1
  20. package/dist/{layers.HYc5na9G.js → layers.B6xyTMaK.js} +1 -1
  21. package/dist/{layers.STNprqyG.js → layers.B7XBlGlW.js} +1 -1
  22. package/dist/{layers.3qDDUzEr.js → layers.B8AEniI_.js} +3 -3
  23. package/dist/layers.B8JPGn6r.js +1 -0
  24. package/dist/{layers.C3Bgzb00.js → layers.B8W0NJOR.js} +1 -1
  25. package/dist/{layers.D-sDoB3E.js → layers.B9C_ydJQ.js} +4 -4
  26. package/dist/{layers.CqPC_2HT.js → layers.BANAWfdK.js} +1 -1
  27. package/dist/{layers.mukS8SQj.js → layers.BBmTszje.js} +5 -5
  28. package/dist/{layers.BdFXUpiv.js → layers.BBoFnnN_.js} +1 -1
  29. package/dist/{layers.8eezRLjp.js → layers.BCSaOuQ1.js} +1 -1
  30. package/dist/{layers.CrIffBCO.js → layers.BD1xH803.js} +1 -1
  31. package/dist/{layers.Cay6s70C.js → layers.BE_G1PBu.js} +1 -1
  32. package/dist/{layers.zbkOw6hA.js → layers.BHiivtGZ.js} +1 -1
  33. package/dist/{layers.CvCPmxF8.js → layers.BIgwYIEr.js} +1 -1
  34. package/dist/{layers.DFm4ZFKl.js → layers.BIjbMXbG.js} +1 -1
  35. package/dist/{layers.DyuywlJj.js → layers.BJO1Euhs.js} +1 -1
  36. package/dist/{layers.DVUO853r.js → layers.BJmYGJpQ.js} +1 -1
  37. package/dist/{layers.DTe6zHEY.js → layers.BOibRrKY.js} +1 -1
  38. package/dist/{layers.Kh-FP78T.js → layers.BPn87Y-P.js} +1 -1
  39. package/dist/{layers.DZB5Lb12.js → layers.BRfZjBnJ.js} +1 -1
  40. package/dist/{layers.C_WIqWtx.js → layers.BShAEKRS.js} +1 -1
  41. package/dist/{layers.CH_OqGuS.js → layers.BXdZJYB5.js} +1 -1
  42. package/dist/{layers.B59FyYET.js → layers.BZDS7hkL.js} +1 -1
  43. package/dist/{layers.CsPOx2Z4.js → layers.BZ_QEbyO.js} +1 -1
  44. package/dist/{layers.Ce_429dW.js → layers.BZfpIslM.js} +5 -5
  45. package/dist/{layers.BG0OSpkH.js → layers.B_C67uGt.js} +9 -9
  46. package/dist/{layers.p3mFeO6J.js → layers.B_qqQYX7.js} +1 -1
  47. package/dist/{layers.yH55hKtZ.js → layers.BaOqzZDo.js} +65 -65
  48. package/dist/{layers.yEcLpnHh.js → layers.BaPJ377A.js} +1 -1
  49. package/dist/layers.BaqrGe4g.js +6 -0
  50. package/dist/{layers.Bvm33J0m.js → layers.BbfBmSj-.js} +1 -1
  51. package/dist/{layers.i3KAUZ45.js → layers.BbkCkr5n.js} +1 -1
  52. package/dist/{layers.oikIEZf3.js → layers.Bbma2TS_.js} +3 -3
  53. package/dist/layers.BcFk1Bpa.js +50 -0
  54. package/dist/{layers.ygoUWzdi.js → layers.BdhDkatQ.js} +1 -1
  55. package/dist/{layers.CykeY94q.js → layers.BeKx-2pI.js} +2 -2
  56. package/dist/{layers.Dw0QTfJD.js → layers.BgW_qdBy.js} +1 -1
  57. package/dist/{layers.CWfrzR6S.js → layers.Bh5qkD3w.js} +1 -1
  58. package/dist/layers.Bjq79IY_.js +1 -0
  59. package/dist/{layers.BfWdzxHN.js → layers.Bm4YRsyc.js} +1 -1
  60. package/dist/{layers.4cJXwh_w.js → layers.Bn7h0_PO.js} +1 -1
  61. package/dist/{layers.9UaRFwZt.js → layers.BoM7zzQh.js} +1 -1
  62. package/dist/{layers.L6IzuO_M.js → layers.BpF9jvwO.js} +3 -3
  63. package/dist/{layers.Crqy5oaD.js → layers.Bq-qzTVY.js} +1 -1
  64. package/dist/{layers.BDkKeCM6.js → layers.BqpiS_hE.js} +59 -59
  65. package/dist/{layers.DQAjxCCm.js → layers.BrFcTrkT.js} +5 -5
  66. package/dist/layers.BriP0h7v.js +8 -0
  67. package/dist/{layers.CywZHGGo.js → layers.BrznVoq-.js} +3 -3
  68. package/dist/{layers.BYwmAdRV.js → layers.BsukaZWB.js} +1 -1
  69. package/dist/{layers.C_lsuYqi.js → layers.BwO5_pmq.js} +4 -4
  70. package/dist/{layers.DHofVu3m.js → layers.BwdVvXjR.js} +1 -1
  71. package/dist/{layers.DcTScD6p.js → layers.By9vgCc0.js} +1 -1
  72. package/dist/{layers.DrCth8rd.js → layers.ByOfMpn8.js} +1 -1
  73. package/dist/{layers.-r9PBFCx.js → layers.BzUVZfrA.js} +1 -1
  74. package/dist/{layers.m6k69R7C.js → layers.C22z_lEr.js} +1 -1
  75. package/dist/{layers.z49tNHRn.js → layers.C2db1CP0.js} +1 -1
  76. package/dist/{layers.BG4esMjA.js → layers.C3A8FMWV.js} +1 -1
  77. package/dist/{layers.BbxA6RVX.js → layers.C5UfV0AW.js} +1 -1
  78. package/dist/{layers.BNpgk1Zu.js → layers.C6jbv5lL.js} +1 -1
  79. package/dist/{layers.Bm4ntdZp.js → layers.C6y_KErF.js} +1 -1
  80. package/dist/{layers.CC46d7_L.js → layers.C78DgiuT.js} +1 -1
  81. package/dist/{layers.Dicwh5_M.js → layers.C7NVHlX3.js} +1 -1
  82. package/dist/{layers.oumAsD5x.js → layers.C9uQS4gH.js} +2 -2
  83. package/dist/{layers.CMZZfkEI.js → layers.CAlgg2ba.js} +1 -1
  84. package/dist/{layers.CCKPvlpE.js → layers.CG1owC1Y.js} +1 -1
  85. package/dist/{layers.DKEi7ZM1.js → layers.CI4I5LhI.js} +1 -1
  86. package/dist/{layers.CMnvrcQS.js → layers.CKILvYTL.js} +1 -1
  87. package/dist/{layers.CrVDA2Mt.js → layers.CKeMjhDd.js} +13326 -14762
  88. package/dist/{layers.AXc8tLtl.js → layers.CLL6UFgy.js} +1 -1
  89. package/dist/{layers.Bt5VriYo.js → layers.CM6kSWDJ.js} +1 -1
  90. package/dist/{layers.Op6_HYGF.js → layers.CN3_dM2I.js} +2 -2
  91. package/dist/{layers.BV2p9Wss.js → layers.CNCaYY8I.js} +1 -1
  92. package/dist/{layers.B8K5o2rJ.js → layers.CPNW73dw.js} +1 -1
  93. package/dist/{layers.DtJWFCYA.js → layers.CQ5N9HVy.js} +1 -1
  94. package/dist/{layers.A7-_7-Xd.js → layers.CQfX1ChO.js} +1 -1
  95. package/dist/{layers.BmbhCrve.js → layers.CQhp9eGu.js} +1 -1
  96. package/dist/{layers.BJWOzSOh.js → layers.CRy22r23.js} +1 -1
  97. package/dist/{layers.D4mNtNOR.js → layers.CToiKOqz.js} +1 -1
  98. package/dist/{layers.Cvcv7t6J.js → layers.CVu6Qj2u.js} +1 -1
  99. package/dist/{layers.Dr2xhRne.js → layers.CW-PNnHn.js} +1 -1
  100. package/dist/{layers.CT7FfHmU.js → layers.CWRqqdLq.js} +27 -27
  101. package/dist/{layers.Bkr7Bw_G.js → layers.CX2bDKWP.js} +1 -1
  102. package/dist/{layers.AjnOT4tp.js → layers.CZvXq10g.js} +1 -1
  103. package/dist/{layers.CfqoL-1u.js → layers.CZwvWE0u.js} +1 -1
  104. package/dist/{layers.DCAjxcrf.js → layers.C_msKxOz.js} +1 -1
  105. package/dist/{layers.DAUquRPl.js → layers.CaUC2D92.js} +1 -1
  106. package/dist/{layers.DTuWnq4x.js → layers.Cct_kNIx.js} +1 -1
  107. package/dist/{layers.Bo8llfQq.js → layers.CfKxIk3q.js} +1 -1
  108. package/dist/{layers.CZVA1jkA.js → layers.CiV1e4MO.js} +1 -1
  109. package/dist/{layers.CgcKd-ky.js → layers.CimmUA4L.js} +1 -1
  110. package/dist/{layers.DECmH0_u.js → layers.CinkO13g.js} +1 -1
  111. package/dist/{layers.B5ufVRSo.js → layers.CkAtxxlT.js} +1 -1
  112. package/dist/{layers.nfABspkI.js → layers.CkagAevp.js} +2 -2
  113. package/dist/layers.Cm9X0X3T.js +1 -0
  114. package/dist/layers.Cn1jF2Gh.js +164 -0
  115. package/dist/{layers.P-lnVqTc.js → layers.CnIKr3HC.js} +1 -1
  116. package/dist/{layers.CZE-WuJk.js → layers.CoYjsfZV.js} +1 -1
  117. package/dist/{layers.BEeuuycr.js → layers.Cu69BtS3.js} +1 -1
  118. package/dist/{layers.HZkm9Xai.js → layers.Cv-WkeWI.js} +1 -1
  119. package/dist/{layers.B8KlM9TI.js → layers.CvxxnOJk.js} +1 -1
  120. package/dist/{layers.DcXUB30M.js → layers.Cw61uzWb.js} +1 -1
  121. package/dist/{layers.CJsA62ia.js → layers.CxMy14VF.js} +1 -1
  122. package/dist/{layers.BNASUTkV.js → layers.CyayEro7.js} +2 -2
  123. package/dist/{layers.CfLmyrW0.js → layers.D0ETVfjp.js} +1 -1
  124. package/dist/{layers.DG-dGtlY.js → layers.D0fpd89R.js} +1 -1
  125. package/dist/{layers.5U6WxiPk.js → layers.D1k7cW3x.js} +1 -1
  126. package/dist/{layers.CRYqykef.js → layers.D2JnATNe.js} +2 -2
  127. package/dist/{layers.BcF5Bg-K.js → layers.D2lX4RIx.js} +3 -3
  128. package/dist/{layers.-KcWqw-N.js → layers.D30Czgu4.js} +1 -1
  129. package/dist/{layers.CGupoK8d.js → layers.D4Huv7DR.js} +3 -3
  130. package/dist/{layers.JJYk40im.js → layers.D6fVFq7D.js} +1 -1
  131. package/dist/{layers.yxOoosOu.js → layers.D8biYzmQ.js} +1 -1
  132. package/dist/{layers.H97vXI7T.js → layers.D8naFy0w.js} +1 -1
  133. package/dist/{layers.YX2nVtPn.js → layers.D9ppEsRM.js} +1 -1
  134. package/dist/{layers.smN9kmfK.js → layers.DApRpkqG.js} +1 -1
  135. package/dist/{layers.DbX6sCkQ.js → layers.DBXl5ck_.js} +1 -1
  136. package/dist/{layers.D6Jp7XX-.js → layers.DCAlvV-0.js} +1 -1
  137. package/dist/{layers.ByByCChf.js → layers.DD-m7zXa.js} +1 -1
  138. package/dist/{layers.DkWrc3LT.js → layers.DD0FbLE_.js} +1 -1
  139. package/dist/{layers.HEJjMTbX.js → layers.DGcYEGT3.js} +1 -1
  140. package/dist/{layers.MwNbfoEb.js → layers.DJc7dVG5.js} +1 -1
  141. package/dist/{layers.BHqR-nMe.js → layers.DLLPqwb7.js} +3 -3
  142. package/dist/{layers.BKWlwTlz.js → layers.DLimLy7k.js} +1 -1
  143. package/dist/{layers.DWgKtoUZ.js → layers.DMb_rSqp.js} +1 -1
  144. package/dist/{layers.I005s62u.js → layers.DMnWrTAc.js} +1 -1
  145. package/dist/{layers.DfDpihH5.js → layers.DNI_NjEo.js} +1 -1
  146. package/dist/{layers.Cav557Tj.js → layers.DOC0Onpl.js} +1 -1
  147. package/dist/{layers.DuWiDec-.js → layers.DOToiIFB.js} +1 -1
  148. package/dist/{layers.txvjUEf1.js → layers.DQ778Ve4.js} +1 -1
  149. package/dist/{layers.IjO3w0wc.js → layers.DR78Ayid.js} +1 -1
  150. package/dist/{layers.Cgz3y9fW.js → layers.DTB5qpIW.js} +1 -1
  151. package/dist/{layers.DTSw3O8c.js → layers.DTrhwWOZ.js} +1041 -1041
  152. package/dist/layers.DW9YHURZ.js +233 -0
  153. package/dist/{layers.DC8j9aoF.js → layers.DZP8Sltj.js} +1 -1
  154. package/dist/{layers.DSXYOmnm.js → layers.DZZBGObz.js} +1 -1
  155. package/dist/{layers.CXdWNv4W.js → layers.D_I31YYn.js} +3 -3
  156. package/dist/{layers.VIRrGO2u.js → layers.D_w3Ag4t.js} +1 -1
  157. package/dist/{layers.B2pOPh01.js → layers.DcxU18i0.js} +1 -1
  158. package/dist/{layers.DNEXXx6g.js → layers.DdoahV7F.js} +1 -1
  159. package/dist/{layers.ChhDvwKP.js → layers.DgpUZDyj.js} +1 -1
  160. package/dist/{layers.DZ8v0Uat.js → layers.Dh23O9xV.js} +1 -1
  161. package/dist/{layers.CxS6GyTl.js → layers.Dhq1eSF7.js} +1 -1
  162. package/dist/{layers.CWbxoWFJ.js → layers.DiR16JGR.js} +1 -1
  163. package/dist/{layers.wCu2-GYI.js → layers.DjPPv1Er.js} +1 -1
  164. package/dist/{layers.D9pqIowU.js → layers.DlphdLPZ.js} +1 -1
  165. package/dist/{layers.Bgjpupv9.js → layers.DmzB8yYT.js} +4 -4
  166. package/dist/{layers.BAkEjbg4.js → layers.Dnbe3DHX.js} +1 -1
  167. package/dist/{layers.DTP603Rm.js → layers.DqdRd9i0.js} +1 -1
  168. package/dist/{layers.xTSsGk5R.js → layers.DsHueDi2.js} +1 -1
  169. package/dist/{layers.D7qwMvKV.js → layers.DvFRXt5t.js} +1 -1
  170. package/dist/layers.DvkA4OgA.js +116 -0
  171. package/dist/{layers.WKOeNrkx.js → layers.DyDL5yGh.js} +1 -1
  172. package/dist/{layers.DxBvZGG5.js → layers.FkWwK9pt.js} +1 -1
  173. package/dist/{layers.D7gJ7O2D.js → layers.G9aUJ7P0.js} +1 -1
  174. package/dist/{layers.BBVoFLmG.js → layers.GLhLUH5j.js} +3 -3
  175. package/dist/{layers.Iel_i8FO.js → layers.GPEwHHqp.js} +1 -1
  176. package/dist/{layers.DXnyJ4zI.js → layers.H0OmHWM2.js} +1 -1
  177. package/dist/{layers.y59VXq_d.js → layers.KjR3SHwr.js} +1 -1
  178. package/dist/{layers.DaJhbHQM.js → layers.LQGtraSs.js} +4 -4
  179. package/dist/{layers.BTuHjcLF.js → layers.MwcQPa9L.js} +1 -1
  180. package/dist/{layers.BzI3uWiI.js → layers.NIA62kKA.js} +3 -3
  181. package/dist/{layers.CWDqDLid.js → layers.PjvaYTA1.js} +1 -1
  182. package/dist/{layers.HpmDfTOZ.js → layers.QQaJgK-3.js} +10 -10
  183. package/dist/{layers.C7hvvKBy.js → layers.RQi4o0j5.js} +1 -1
  184. package/dist/{layers.DL7DQFWJ.js → layers.UAO4_g8C.js} +4 -4
  185. package/dist/{layers.DQPmVcgr.js → layers.UEG1bSm4.js} +1 -1
  186. package/dist/{layers.BThOHF2h.js → layers.V-vdqPil.js} +1 -1
  187. package/dist/{layers.T0LLB4if.js → layers.V029Ul2p.js} +24 -24
  188. package/dist/{layers.DI4G_IzO.js → layers.VTGR7224.js} +4 -4
  189. package/dist/{layers.DxUR9UVv.js → layers.XQUBdD95.js} +1 -1
  190. package/dist/{layers.DnxyBL8_.js → layers.XrKla-FL.js} +1 -1
  191. package/dist/{layers.DcHSJt0_.js → layers.YdsALZmG.js} +1 -1
  192. package/dist/layers.YyZAezbn.js +343 -0
  193. package/dist/{layers.BqLDdZqV.js → layers.Z6OA1iTo.js} +1 -1
  194. package/dist/layers._Eomtf_i.js +1 -0
  195. package/dist/{layers.Ew1pCNSe.js → layers._hGJtiFF.js} +4 -4
  196. package/dist/{layers.BjwnyVCl.js → layers.b-Z1T3Qk.js} +1 -1
  197. package/dist/{layers.DxN3lBhv.js → layers.cX1NN4ZB.js} +1 -1
  198. package/dist/layers.jO8In61o.js +4 -0
  199. package/dist/{layers.DP1Ubpbf.js → layers.pHZQrmSX.js} +1 -1
  200. package/dist/{layers.Dv0Vbj45.js → layers.qOpzfyD3.js} +1 -1
  201. package/dist/{layers.BMjG3Spg.js → layers.rbYb_9bp.js} +1 -1
  202. package/dist/{layers.BaKeHbS6.js → layers.sk0aRHl-.js} +1 -1
  203. package/dist/{layers.B85_kGEv.js → layers.uiYBVREy.js} +1 -1
  204. package/dist/{layers.Zarwz_N_.js → layers.y7XKfK2M.js} +1 -1
  205. package/dist/{layers.BcZgTq-d.js → layers.yx_3h5lO.js} +1 -1
  206. package/package.json +5 -5
  207. package/dist/layers.34Jeb_HS.js +0 -4
  208. package/dist/layers.BhV56J6v.js +0 -233
  209. package/dist/layers.Btd-eTFq.js +0 -1
  210. package/dist/layers.CRLhO6A0.js +0 -116
  211. package/dist/layers.C_skmqFi.js +0 -1
  212. package/dist/layers.CjpWMqwp.js +0 -1
  213. package/dist/layers.DTT4aj9y.js +0 -1
  214. package/dist/layers.DdHIpmQK.js +0 -1
  215. package/dist/layers.Dh7ZpW4m.js +0 -348
  216. package/dist/layers.DmWJdp39.js +0 -8
  217. package/dist/layers.Dy94cTt2.js +0 -6
  218. package/dist/layers.RpcHb2tp.js +0 -164
  219. package/dist/layers.ohUYbkTW.js +0 -52
@@ -1,233 +0,0 @@
1
- import { jsx as n, jsxs as k, Fragment as L } from "react/jsx-runtime";
2
- import { useState as x, useEffect as y, useRef as R, useCallback as M, useMemo as _ } from "react";
3
- import { R as J, A as $, h as q, m as U, d as b, i as B, j as W, a as G, k as P, n as Q, p as V, q as X, r as O, D as Y, s as Z } from "./layers.CrVDA2Mt.js";
4
- import { useTranslation as K } from "react-i18next";
5
- import { M as ee, H as te } from "./layers.DTSw3O8c.js";
6
- import { useMantineTheme as se, Box as T, Tooltip as j, ActionIcon as H } from "@mantine/core";
7
- import { IconEdit as ie } from "@tabler/icons-react";
8
- const ne = (e) => {
9
- var u;
10
- const a = (u = e == null ? void 0 : e.firstElementChild) == null ? void 0 : u.firstElementChild, m = e.getAttribute("viewBox");
11
- if (m != null) {
12
- const l = m.split(" ");
13
- e.setAttribute("width", l[2]), e.setAttribute("height", l[3]);
14
- }
15
- a && a.tagName === "style" && a.remove();
16
- };
17
- function ae({
18
- elements: e,
19
- files: a,
20
- imageContainerRef: m,
21
- appState: u,
22
- editor: l,
23
- rootClassName: s = null,
24
- width: C = "inherit",
25
- height: E = "inherit",
26
- nodeKey: r,
27
- alignment: N,
28
- setModalOpen: v
29
- }) {
30
- const [o, w] = x(null), [h, A] = x(!1);
31
- se();
32
- const { t: S } = K();
33
- y(() => {
34
- (async () => {
35
- const i = await ee({
36
- appState: u,
37
- elements: e,
38
- files: a
39
- });
40
- ne(i), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("display", "block"), i.classList.add("excalidraw-svg"), w(i);
41
- })();
42
- }, [e, a, u]);
43
- const p = (d, i) => {
44
- l.update(() => {
45
- U(null);
46
- const g = b(r);
47
- return B(g) && g.setWidthAndHeight(d, i), !0;
48
- });
49
- }, I = (d) => {
50
- W(l, r);
51
- };
52
- return /* @__PURE__ */ n(
53
- J,
54
- {
55
- editor: l,
56
- isIcon: !1,
57
- isEmbed: !0,
58
- width: C,
59
- height: E,
60
- onResizeEnd: p,
61
- alignment: N,
62
- children: /* @__PURE__ */ k(T, { className: "media-wrapper excaildraw", children: [
63
- /* @__PURE__ */ k("div", { className: "media-actions", children: [
64
- /* @__PURE__ */ n(j, { label: S("editor.link.edit"), children: /* @__PURE__ */ n(
65
- H,
66
- {
67
- color: "gray",
68
- "aria-label": "Settings",
69
- className: "media-action",
70
- variant: "default",
71
- size: 24,
72
- onClick: () => {
73
- v(!0);
74
- },
75
- children: /* @__PURE__ */ n(ie, { size: 14 })
76
- }
77
- ) }),
78
- /* @__PURE__ */ n(
79
- $,
80
- {
81
- opened: h,
82
- setOpened: A,
83
- t: S,
84
- editor: l,
85
- nodeKey: r
86
- }
87
- ),
88
- /* @__PURE__ */ n(j, { label: S("editor.actions.delete"), children: /* @__PURE__ */ n(
89
- H,
90
- {
91
- color: "gray",
92
- "aria-label": "Settings",
93
- className: "media-action",
94
- variant: "default",
95
- size: 24,
96
- onClick: I,
97
- children: /* @__PURE__ */ n(q, { name: "trash", size: "14" })
98
- }
99
- ) })
100
- ] }),
101
- /* @__PURE__ */ n(
102
- T,
103
- {
104
- w: "100%",
105
- ref: (d) => {
106
- d && m && (m.current = d);
107
- },
108
- className: s ?? "",
109
- dangerouslySetInnerHTML: { __html: (o == null ? void 0 : o.outerHTML) ?? "" }
110
- }
111
- )
112
- ] })
113
- }
114
- );
115
- }
116
- function fe({
117
- nodeKey: e,
118
- data: a,
119
- width: m,
120
- height: u,
121
- alignment: l
122
- }) {
123
- const [s] = G(), C = P(), [E, r] = x(
124
- a === "[]" && s.isEditable()
125
- ), N = R(null), v = R(null), [o, w, h] = Q(e), [A, S] = x(!1), p = M(
126
- (t) => (o && (t.preventDefault(), s.update(() => {
127
- const c = b(e);
128
- c && c.remove();
129
- })), !1),
130
- [s, o, e]
131
- );
132
- y(() => {
133
- if (!C) {
134
- o && h();
135
- return;
136
- }
137
- return V(
138
- s.registerCommand(
139
- Z,
140
- (t) => {
141
- const c = v.current, f = t.target;
142
- return A ? !0 : c !== null && c.contains(f) ? (t.shiftKey || h(), w(!o), t.detail > 1 && (console.log("--- HUI"), r(!0)), !0) : !1;
143
- },
144
- O
145
- ),
146
- s.registerCommand(
147
- Y,
148
- p,
149
- O
150
- ),
151
- s.registerCommand(
152
- X,
153
- p,
154
- O
155
- )
156
- );
157
- }, [
158
- h,
159
- s,
160
- o,
161
- A,
162
- p,
163
- w,
164
- C
165
- ]);
166
- const I = M(() => (r(!1), s.update(() => {
167
- const t = b(e);
168
- t && t.remove();
169
- })), [s, e]), d = (t, c, f) => s.update(() => {
170
- const D = b(e);
171
- B(D) && (t && t.length > 0 || Object.keys(f).length > 0 ? D.setData(
172
- JSON.stringify({
173
- appState: c,
174
- elements: t,
175
- files: f
176
- })
177
- ) : D.remove());
178
- }), {
179
- elements: i = [],
180
- files: g = {},
181
- appState: z = {}
182
- } = _(() => JSON.parse(a), [a]), F = M(() => {
183
- r(!1), i.length === 0 && s.update(() => {
184
- const t = b(e);
185
- t && t.remove();
186
- });
187
- }, [s, e, i.length]);
188
- return /* @__PURE__ */ k(L, { children: [
189
- /* @__PURE__ */ n(
190
- te,
191
- {
192
- initialElements: i,
193
- initialFiles: g,
194
- initialAppState: z,
195
- isShown: E,
196
- onDelete: I,
197
- onClose: F,
198
- onSave: (t, c, f) => {
199
- d(t, c, f), r(!1);
200
- },
201
- closeOnClickOutside: !1
202
- }
203
- ),
204
- i.length > 0 && /* @__PURE__ */ n(
205
- "div",
206
- {
207
- style: {
208
- display: "flex",
209
- justifyContent: l
210
- },
211
- children: /* @__PURE__ */ n(
212
- ae,
213
- {
214
- imageContainerRef: N,
215
- className: "image",
216
- elements: i,
217
- files: g,
218
- appState: z,
219
- width: m,
220
- height: u,
221
- editor: s,
222
- nodeKey: e,
223
- alignment: l,
224
- setModalOpen: r
225
- }
226
- )
227
- }
228
- )
229
- ] });
230
- }
231
- export {
232
- fe as default
233
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("./layers.CywZHGGo.js"),s=(e,r)=>n.Utils.lang.round(n.Color.parse(e)[r]);exports.channel=s;
@@ -1,116 +0,0 @@
1
- "use strict";const G=require("./layers.9QK1wiQj.js"),r=require("./layers.CywZHGGo.js"),P=require("./layers.Bkr7Bw_G.js"),V=require("lodash-es"),j=require("./layers.Btd-eTFq.js");function F(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(o,i,a.get?a:{enumerable:!0,get:()=>e[i]})}}return o.default=e,Object.freeze(o)}const E=F(V);function N(e){return typeof e=="string"?new r.Selection([document.querySelectorAll(e)],[document.documentElement]):new r.Selection([r.array(e)],r.root)}function M(e,o){return!!e.children(o).length}function R(e){return _(e.v)+":"+_(e.w)+":"+_(e.name)}var H=/:/g;function _(e){return e?String(e).replace(H,"\\:"):""}function B(e,o){o&&e.attr("style",o)}function K(e,o,i){o&&e.attr("class",o).attr("class",i+" "+e.attr("class"))}function O(e,o){var i=o.graph();if(E.isPlainObject(i)){var a=i.transition;if(E.isFunction(a))return a(e)}return e}function D(e,o){var i=e.append("foreignObject").attr("width","100000"),a=i.append("xhtml:div");a.attr("xmlns","http://www.w3.org/1999/xhtml");var d=o.label;switch(typeof d){case"function":a.insert(d);break;case"object":a.insert(function(){return d});break;default:a.html(d)}B(a,o.labelStyle),a.style("display","inline-block"),a.style("white-space","nowrap");var p=a.node().getBoundingClientRect();return i.attr("width",p.width).attr("height",p.height),i}const I={},U=function(e){const o=Object.keys(e);for(const i of o)I[i]=e[i]},q=async function(e,o,i,a,d,p){const g=a.select(`[id="${i}"]`),s=Object.keys(e);for(const b of s){const l=e[b];let h="default";l.classes.length>0&&(h=l.classes.join(" ")),h=h+" flowchart-label";const w=r.getStylesFromArray(l.styles);let t=l.text!==void 0?l.text:l.id,c;if(r.log$1.info("vertex",l,l.labelType),l.labelType==="markdown")r.log$1.info("vertex",l,l.labelType);else if(r.evaluate(r.getConfig().flowchart.htmlLabels))c=D(g,{label:t}).node(),c.parentNode.removeChild(c);else{const k=d.createElementNS("http://www.w3.org/2000/svg","text");k.setAttribute("style",w.labelStyle.replace("color:","fill:"));const T=t.split(r.common$1.lineBreakRegex);for(const $ of T){const v=d.createElementNS("http://www.w3.org/2000/svg","tspan");v.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),v.setAttribute("dy","1em"),v.setAttribute("x","1"),v.textContent=$,k.appendChild(v)}c=k}let f=0,n="";switch(l.type){case"round":f=5,n="rect";break;case"square":n="rect";break;case"diamond":n="question";break;case"hexagon":n="hexagon";break;case"odd":n="rect_left_inv_arrow";break;case"lean_right":n="lean_right";break;case"lean_left":n="lean_left";break;case"trapezoid":n="trapezoid";break;case"inv_trapezoid":n="inv_trapezoid";break;case"odd_right":n="rect_left_inv_arrow";break;case"circle":n="circle";break;case"ellipse":n="ellipse";break;case"stadium":n="stadium";break;case"subroutine":n="subroutine";break;case"cylinder":n="cylinder";break;case"group":n="rect";break;case"doublecircle":n="doublecircle";break;default:n="rect"}const S=await r.renderKatex(t,r.getConfig());o.setNode(l.id,{labelStyle:w.labelStyle,shape:n,labelText:S,labelType:l.labelType,rx:f,ry:f,class:h,style:w.style,id:l.id,link:l.link,linkTarget:l.linkTarget,tooltip:p.db.getTooltip(l.id)||"",domId:p.db.lookUpDomId(l.id),haveCallback:l.haveCallback,width:l.type==="group"?500:void 0,dir:l.dir,type:l.type,props:l.props,padding:r.getConfig().flowchart.padding}),r.log$1.info("setNode",{labelStyle:w.labelStyle,labelType:l.labelType,shape:n,labelText:S,rx:f,ry:f,class:h,style:w.style,id:l.id,domId:p.db.lookUpDomId(l.id),width:l.type==="group"?500:void 0,type:l.type,dir:l.dir,props:l.props,padding:r.getConfig().flowchart.padding})}},z=async function(e,o,i){r.log$1.info("abc78 edges = ",e);let a=0,d={},p,g;if(e.defaultStyle!==void 0){const s=r.getStylesFromArray(e.defaultStyle);p=s.style,g=s.labelStyle}for(const s of e){a++;const b="L-"+s.start+"-"+s.end;d[b]===void 0?(d[b]=0,r.log$1.info("abc78 new entry",b,d[b])):(d[b]++,r.log$1.info("abc78 new entry",b,d[b]));let l=b+"-"+d[b];r.log$1.info("abc78 new link id to be used is",b,l,d[b]);const h="LS-"+s.start,w="LE-"+s.end,t={style:"",labelStyle:""};switch(t.minlen=s.length||1,s.type==="arrow_open"?t.arrowhead="none":t.arrowhead="normal",t.arrowTypeStart="arrow_open",t.arrowTypeEnd="arrow_open",s.type){case"double_arrow_cross":t.arrowTypeStart="arrow_cross";case"arrow_cross":t.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":t.arrowTypeStart="arrow_point";case"arrow_point":t.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":t.arrowTypeStart="arrow_circle";case"arrow_circle":t.arrowTypeEnd="arrow_circle";break}let c="",f="";switch(s.stroke){case"normal":c="fill:none;",p!==void 0&&(c=p),g!==void 0&&(f=g),t.thickness="normal",t.pattern="solid";break;case"dotted":t.thickness="normal",t.pattern="dotted",t.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":t.thickness="thick",t.pattern="solid",t.style="stroke-width: 3.5px;fill:none;";break;case"invisible":t.thickness="invisible",t.pattern="solid",t.style="stroke-width: 0;fill:none;";break}if(s.style!==void 0){const n=r.getStylesFromArray(s.style);c=n.style,f=n.labelStyle}t.style=t.style+=c,t.labelStyle=t.labelStyle+=f,s.interpolate!==void 0?t.curve=r.interpolateToCurve(s.interpolate,r.curveLinear):e.defaultInterpolate!==void 0?t.curve=r.interpolateToCurve(e.defaultInterpolate,r.curveLinear):t.curve=r.interpolateToCurve(I.curve,r.curveLinear),s.text===void 0?s.style!==void 0&&(t.arrowheadStyle="fill: #333"):(t.arrowheadStyle="fill: #333",t.labelpos="c"),t.labelType=s.labelType,t.label=await r.renderKatex(s.text.replace(r.common$1.lineBreakRegex,`
2
- `),r.getConfig()),s.style===void 0&&(t.style=t.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),t.labelStyle=t.labelStyle.replace("color:","fill:"),t.id=l,t.classes="flowchart-link "+h+" "+w,o.setEdge(s.start,s.end,t,a)}},W=function(e,o){return o.db.getClasses()},X=async function(e,o,i,a){r.log$1.info("Drawing flowchart");let d=a.db.getDirection();d===void 0&&(d="TD");const{securityLevel:p,flowchart:g}=r.getConfig(),s=g.nodeSpacing||50,b=g.rankSpacing||50;let l;p==="sandbox"&&(l=r.select("#i"+o));const h=p==="sandbox"?r.select(l.nodes()[0].contentDocument.body):r.select("body"),w=p==="sandbox"?l.nodes()[0].contentDocument:document,t=new G.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:s,ranksep:b,marginx:0,marginy:0}).setDefaultEdgeLabel(function(){return{}});let c;const f=a.db.getSubGraphs();r.log$1.info("Subgraphs - ",f);for(let u=f.length-1;u>=0;u--)c=f[u],r.log$1.info("Subgraph - ",c),a.db.addVertex(c.id,{text:c.title,type:c.labelType},"group",void 0,c.classes,c.dir);const n=a.db.getVertices(),S=a.db.getEdges();r.log$1.info("Edges",S);let k=0;for(k=f.length-1;k>=0;k--){c=f[k],N("cluster").append("text");for(let u=0;u<c.nodes.length;u++)r.log$1.info("Setting up subgraphs",c.nodes[u],c.id),t.setParent(c.nodes[u],c.id)}await q(n,t,o,h,w,a),await z(S,t);const T=h.select(`[id="${o}"]`),$=h.select("#"+o+" g");if(await P.render($,t,["point","circle","cross"],"flowchart",o),r.utils.insertTitle(T,"flowchartTitleText",g.titleTopMargin,a.db.getDiagramTitle()),r.setupGraphViewbox$1(t,T,g.diagramPadding,g.useMaxWidth),a.db.indexNodes("subGraph"+k),!g.htmlLabels){const u=w.querySelectorAll('[id="'+o+'"] .edgeLabel .label');for(const x of u){const m=x.getBBox(),y=w.createElementNS("http://www.w3.org/2000/svg","rect");y.setAttribute("rx",0),y.setAttribute("ry",0),y.setAttribute("width",m.width),y.setAttribute("height",m.height),x.insertBefore(y,x.firstChild)}}Object.keys(n).forEach(function(u){const x=n[u];if(x.link){const m=r.select("#"+o+' [id="'+u+'"]');if(m){const y=w.createElementNS("http://www.w3.org/2000/svg","a");y.setAttributeNS("http://www.w3.org/2000/svg","class",x.classes.join(" ")),y.setAttributeNS("http://www.w3.org/2000/svg","href",x.link),y.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),p==="sandbox"?y.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):x.linkTarget&&y.setAttributeNS("http://www.w3.org/2000/svg","target",x.linkTarget);const C=m.insert(function(){return y},":first-child"),L=m.select(".label-container");L&&C.append(function(){return L.node()});const A=m.select(".label");A&&C.append(function(){return A.node()})}}})},J={setConf:U,addVertices:q,addEdges:z,getClasses:W,draw:X},Q=(e,o)=>{const i=j.channel,a=i(e,"r"),d=i(e,"g"),p=i(e,"b");return r.rgba(a,d,p,o)},Y=e=>`.label {
3
- font-family: ${e.fontFamily};
4
- color: ${e.nodeTextColor||e.textColor};
5
- }
6
- .cluster-label text {
7
- fill: ${e.titleColor};
8
- }
9
- .cluster-label span,p {
10
- color: ${e.titleColor};
11
- }
12
-
13
- .label text,span,p {
14
- fill: ${e.nodeTextColor||e.textColor};
15
- color: ${e.nodeTextColor||e.textColor};
16
- }
17
-
18
- .node rect,
19
- .node circle,
20
- .node ellipse,
21
- .node polygon,
22
- .node path {
23
- fill: ${e.mainBkg};
24
- stroke: ${e.nodeBorder};
25
- stroke-width: 1px;
26
- }
27
- .flowchart-label text {
28
- text-anchor: middle;
29
- }
30
- // .flowchart-label .text-outer-tspan {
31
- // text-anchor: middle;
32
- // }
33
- // .flowchart-label .text-inner-tspan {
34
- // text-anchor: start;
35
- // }
36
-
37
- .node .katex path {
38
- fill: #000;
39
- stroke: #000;
40
- stroke-width: 1px;
41
- }
42
-
43
- .node .label {
44
- text-align: center;
45
- }
46
- .node.clickable {
47
- cursor: pointer;
48
- }
49
-
50
- .arrowheadPath {
51
- fill: ${e.arrowheadColor};
52
- }
53
-
54
- .edgePath .path {
55
- stroke: ${e.lineColor};
56
- stroke-width: 2.0px;
57
- }
58
-
59
- .flowchart-link {
60
- stroke: ${e.lineColor};
61
- fill: none;
62
- }
63
-
64
- .edgeLabel {
65
- background-color: ${e.edgeLabelBackground};
66
- rect {
67
- opacity: 0.5;
68
- background-color: ${e.edgeLabelBackground};
69
- fill: ${e.edgeLabelBackground};
70
- }
71
- text-align: center;
72
- }
73
-
74
- /* For html labels only */
75
- .labelBkg {
76
- background-color: ${Q(e.edgeLabelBackground,.5)};
77
- // background-color:
78
- }
79
-
80
- .cluster rect {
81
- fill: ${e.clusterBkg};
82
- stroke: ${e.clusterBorder};
83
- stroke-width: 1px;
84
- }
85
-
86
- .cluster text {
87
- fill: ${e.titleColor};
88
- }
89
-
90
- .cluster span,p {
91
- color: ${e.titleColor};
92
- }
93
- /* .cluster div {
94
- color: ${e.titleColor};
95
- } */
96
-
97
- div.mermaidTooltip {
98
- position: absolute;
99
- text-align: center;
100
- max-width: 200px;
101
- padding: 2px;
102
- font-family: ${e.fontFamily};
103
- font-size: 12px;
104
- background: ${e.tertiaryColor};
105
- border: 1px solid ${e.border2};
106
- border-radius: 2px;
107
- pointer-events: none;
108
- z-index: 100;
109
- }
110
-
111
- .flowchartTitleText {
112
- text-anchor: middle;
113
- font-size: 18px;
114
- fill: ${e.textColor};
115
- }
116
- `,Z=Y;exports.addHtmlLabel=D;exports.applyClass=K;exports.applyStyle=B;exports.applyTransition=O;exports.edgeToId=R;exports.flowRendererV2=J;exports.flowStyles=Z;exports.isSubgraph=M;exports.selectAll=N;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("react"),e=require("./layers.RpcHb2tp.js"),T=require("react-i18next"),k=require("./layers.CT7FfHmU.js"),x=require("@mantine/core"),z=require("@tabler/icons-react"),D=t=>{var h;const r=(h=t==null?void 0:t.firstElementChild)==null?void 0:h.firstElementChild,m=t.getAttribute("viewBox");if(m!=null){const o=m.split(" ");t.setAttribute("width",o[2]),t.setAttribute("height",o[3])}r&&r.tagName==="style"&&r.remove()};function q({elements:t,files:r,imageContainerRef:m,appState:h,editor:o,rootClassName:n=null,width:S="inherit",height:A="inherit",nodeKey:c,alignment:I,setModalOpen:N}){const[u,C]=l.useState(null),[p,w]=l.useState(!1);x.useMantineTheme();const{t:E}=T.useTranslation();l.useEffect(()=>{(async()=>{const a=await k.r9({appState:h,elements:t,files:r});D(a),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("display","block"),a.classList.add("excalidraw-svg"),C(a)})()},[t,r,h]);const b=(f,a)=>{o.update(()=>{e.ms(null);const j=e.us(c);return e.$isExcalidrawNode(j)&&j.setWidthAndHeight(f,a),!0})},v=f=>{e.deleteNode(o,c)};return i.jsx(e.ResizableContainer,{editor:o,isIcon:!1,isEmbed:!0,width:S,height:A,onResizeEnd:b,alignment:I,children:i.jsxs(x.Box,{className:"media-wrapper excaildraw",children:[i.jsxs("div",{className:"media-actions",children:[i.jsx(x.Tooltip,{label:E("editor.link.edit"),children:i.jsx(x.ActionIcon,{color:"gray","aria-label":"Settings",className:"media-action",variant:"default",size:24,onClick:()=>{N(!0)},children:i.jsx(z.IconEdit,{size:14})})}),i.jsx(e.AlignmentImage,{opened:p,setOpened:w,t:E,editor:o,nodeKey:c}),i.jsx(x.Tooltip,{label:E("editor.actions.delete"),children:i.jsx(x.ActionIcon,{color:"gray","aria-label":"Settings",className:"media-action",variant:"default",size:24,onClick:v,children:i.jsx(e.Icon,{name:"trash",size:"14"})})})]}),i.jsx(x.Box,{w:"100%",ref:f=>{f&&m&&(m.current=f)},className:n??"",dangerouslySetInnerHTML:{__html:(u==null?void 0:u.outerHTML)??""}})]})})}function y({nodeKey:t,data:r,width:m,height:h,alignment:o}){const[n]=e.o(),S=e.a(),[A,c]=l.useState(r==="[]"&&n.isEditable()),I=l.useRef(null),N=l.useRef(null),[u,C,p]=e.u(t),[w,E]=l.useState(!1),b=l.useCallback(s=>(u&&(s.preventDefault(),n.update(()=>{const d=e.us(t);d&&d.remove()})),!1),[n,u,t]);l.useEffect(()=>{if(!S){u&&p();return}return e.j(n.registerCommand(e.ae,s=>{const d=N.current,g=s.target;return w?!0:d!==null&&d.contains(g)?(s.shiftKey||p(),C(!u),s.detail>1&&(console.log("--- HUI"),c(!0)),!0):!1},e.Ii),n.registerCommand(e.De,b,e.Ii),n.registerCommand(e.Ae,b,e.Ii))},[p,n,u,w,b,C,S]);const v=l.useCallback(()=>(c(!1),n.update(()=>{const s=e.us(t);s&&s.remove()})),[n,t]),f=(s,d,g)=>n.update(()=>{const O=e.us(t);e.$isExcalidrawNode(O)&&(s&&s.length>0||Object.keys(g).length>0?O.setData(JSON.stringify({appState:d,elements:s,files:g})):O.remove())}),{elements:a=[],files:j={},appState:R={}}=l.useMemo(()=>JSON.parse(r),[r]),M=l.useCallback(()=>{c(!1),a.length===0&&n.update(()=>{const s=e.us(t);s&&s.remove()})},[n,t,a.length]);return i.jsxs(i.Fragment,{children:[i.jsx(k.ExcalidrawModal,{initialElements:a,initialFiles:j,initialAppState:R,isShown:A,onDelete:v,onClose:M,onSave:(s,d,g)=>{f(s,d,g),c(!1)},closeOnClickOutside:!1}),a.length>0&&i.jsx("div",{style:{display:"flex",justifyContent:o},children:i.jsx(q,{imageContainerRef:I,className:"image",elements:a,files:j,appState:R,width:m,height:h,editor:n,nodeKey:t,alignment:o,setModalOpen:c})})]})}exports.default=y;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),o=require("react"),e=require("./layers.RpcHb2tp.js"),N=require("./layers.CT7FfHmU.js"),a=e.oe("INSERT_EXCALIDRAW_COMMAND");function x(){const[t]=e.o(),[r,i]=o.useState(!1);o.useEffect(()=>{if(!t.hasNodes([e.ExcalidrawNode]))throw new Error("ExcalidrawPlugin: ExcalidrawNode not registered on editor");return t.registerCommand(a,()=>(i(!0),!0),e.Li)},[t]);const s=()=>{i(!1)},l=()=>{i(!1)},c=(d,u,E)=>{t.update(()=>{const n=e.$createExcalidrawNode();n.setData(JSON.stringify({appState:u,elements:d,files:E})),e.createMediaComponent(n)}),i(!1)};return f.jsx(N.ExcalidrawModal,{initialElements:[],initialAppState:{},initialFiles:{},isShown:r,onDelete:l,onClose:s,onSave:c,closeOnClickOutside:!1})}exports.INSERT_EXCALIDRAW_COMMAND=a;exports.default=x;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),e=require("./layers.RpcHb2tp.js"),D=require("@mantine/core");function T(t){const s=t.transform();return new Set(s?[s]:[])}function P({initialEditor:t,children:s,initialNodes:a,initialTheme:f,skipCollabChecks:i,skipEditableListener:u}){const c=o.useRef(!1),C=o.useContext(e.r);C==null&&function(l,...r){const v=new URL("https://lexical.dev/docs/error"),b=new URLSearchParams;b.append("code",l);for(const d of r)b.append("v",d);throw v.search=b.toString(),Error(`Minified Lexical error #${l}; visit ${v.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(9);const[g,{getTheme:w}]=C,_=o.useMemo(()=>{const l=f||w()||void 0,r=e.t(C,l);l!==void 0&&(t._config.theme=l),t._parentEditor=t._parentEditor||g;const v=t._createEditorArgs,b=v&&v.namespace;if(a){b||(t._config.namespace=g._config.namespace);for(let d of a){let I=null,x=null;if(typeof d!="function"){const k=d;d=k.replace,I=k.with,x=k.withKlass||null}const N=t._nodes.get(d.getType());t._nodes.set(d.getType(),{exportDOM:N?N.exportDOM:void 0,klass:d,replace:I,replaceWithKlass:x,transforms:T(d)})}}else if(v&&v.nodes)b||(t._config.namespace=g._config.namespace);else{const d=t._nodes=new Map(g._nodes);b||(t._config.namespace=g._config.namespace);for(const[I,x]of d)t._nodes.set(I,{exportDOM:x.exportDOM,klass:x.klass,replace:x.replace,replaceWithKlass:x.replaceWithKlass,transforms:T(x.klass)})}return[t,r]},[]),{isCollabActive:S,yjsDocMap:p}=e.l(),h=i||c.current||p.has(t.getKey());return o.useEffect(()=>{h&&(c.current=!0)},[h]),o.useEffect(()=>{if(!u){const l=r=>t.setEditable(r);return l(g.isEditable()),g.registerEditableListener(l)}},[t,g,u]),n.jsx(e.r.Provider,{value:_,children:!S||h?s:null})}function L({"data-test-id":t,children:s,className:a,onClick:f,disabled:i,small:u,title:c}){return n.jsx(D.Button,{onClick:f,disabled:i,variant:"filled",children:s})}function F({children:t,className:s}){return n.jsx("div",{className:s||"Placeholder__root",children:t})}function O({children:t,label:s,className:a,...f}){return n.jsxs("div",{className:"Input__wrapper",children:[n.jsx("label",{style:{marginTop:"-1em"},className:"Input__label",children:s}),n.jsx("select",{...f,className:a||"select",children:t})]})}function A({label:t,value:s,onChange:a,placeholder:f="","data-test-id":i,type:u="text"}){return n.jsx(D.TextInput,{type:u,placeholder:f,value:s,onChange:c=>{a(c.target.value)},label:t,"data-test-id":i,mb:10})}const y=new Set;function B(t){if(!y.has(t))throw new Promise(s=>{const a=new Image;a.src=t,a.onload=()=>{y.add(t),s(null)}})}function U({altText:t,className:s,imageRef:a,src:f,width:i,height:u,position:c}){return B(f),n.jsx("img",{className:s||void 0,src:f,alt:t,ref:a,"data-position":c,style:{display:"block",height:u,width:i},draggable:"false"})}function M({activeEditor:t,nodeKey:s,onClose:a}){const i=t.getEditorState().read(()=>e.us(s)),[u,c]=o.useState(i.getAltText()),[C,g]=o.useState(i.getShowCaption()),[w,_]=o.useState(i.getPosition()),S=l=>{g(l.target.checked)},p=l=>{_(l.target.value)},h=()=>{const l={altText:u,position:w,showCaption:C};i&&t.update(()=>{i.update(l)}),a()};return n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{marginBottom:"1em"},children:n.jsx(A,{label:"Alt-текст",placeholder:"Альтернативный текст",onChange:c,value:u,"data-test-id":"image-modal-alt-text-input"})}),n.jsxs(O,{style:{marginBottom:"1em",width:"208px"},value:w,label:"Position",name:"position",id:"position-select",onChange:p,children:[n.jsx("option",{value:"left",children:"Left"}),n.jsx("option",{value:"right",children:"Right"}),n.jsx("option",{value:"full",children:"Full Width"})]}),n.jsxs("div",{className:"Input__wrapper",children:[n.jsx("input",{id:"caption",type:"checkbox",checked:C,onChange:S}),n.jsx("label",{htmlFor:"caption",children:"Show Caption"})]}),n.jsx(L,{"data-test-id":"image-modal-file-upload-btn",onClick:()=>h(),children:"Применить"})]})}function $({src:t,altText:s,nodeKey:a,width:f,height:i,showCaption:u,caption:c,position:C}){const[g,w]=e.useModal(),_=o.useRef(null),S=o.useRef(null),[p,h,l]=e.u(a),[r]=e.o(),[v,b]=o.useState(null),d=o.useRef(null),I=o.useCallback(j=>{if(p&&e.ur(e.Nr())){j.preventDefault();const m=e.us(a);e.$isInlineImageNode(m)&&m.remove()}return!1},[p,a]),x=o.useCallback(j=>{const E=e.Nr(),m=S.current;if(p&&e.ur(E)&&E.getNodes().length===1){if(u)return e.ms(null),j.preventDefault(),c.focus(),!0;if(m!==null&&m!==document.activeElement)return j.preventDefault(),m.focus(),!0}return!1},[c,p,u]),N=o.useCallback(j=>d.current===c||S.current===j.target?(e.ms(null),r.update(()=>{h(!0);const E=r.getRootElement();E!==null&&E.focus()}),!0):!1,[c,r,h]);o.useEffect(()=>{let j=!0;const E=e.j(r.registerUpdateListener(({editorState:m})=>{j&&b(m.read(()=>e.Nr()))}),r.registerCommand(e.le,(m,R)=>(d.current=R,!1),e.Ii),r.registerCommand(e.ae,m=>{const R=m;return R.target===_.current?(R.shiftKey?h(!p):(l(),h(!0)),!0):!1},e.Ii),r.registerCommand(e.Be,m=>m.target===_.current?(m.preventDefault(),!0):!1,e.Ii),r.registerCommand(e.De,I,e.Ii),r.registerCommand(e.Ae,I,e.Ii),r.registerCommand(e.Ee,x,e.Ii),r.registerCommand(e.Oe,N,e.Ii));return()=>{j=!1,E()}},[l,r,p,a,I,x,N,h]);const k=p;return n.jsxs(o.Suspense,{fallback:null,children:[n.jsxs(n.Fragment,{children:[n.jsxs("div",{draggable:!1,children:[n.jsx("button",{className:"image-edit-button",ref:S,onClick:()=>{w("Update Inline Image",j=>n.jsx(M,{activeEditor:r,nodeKey:a,onClose:j}))},children:"Edit"}),n.jsx(U,{className:k?`focused ${e.ur(v)?"draggable":""}`:null,src:t,altText:s,imageRef:_,width:f,height:i,position:C})]}),u&&n.jsx("div",{className:"image-caption-container",children:n.jsxs(P,{initialEditor:c,children:[n.jsx(e.LinkPlugin,{}),n.jsx(e.FloatingTextFormatToolbarPlugin,{}),n.jsx(e.h,{contentEditable:n.jsx(e.LexicalContentEditable,{className:"InlineImageNode__contentEditable"}),placeholder:n.jsx(F,{className:"InlineImageNode__placeholder",children:"Enter a caption..."}),ErrorBoundary:e.a$1})]})})]}),g]})}exports.UpdateInlineImageDialog=M;exports.default=$;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.VIRrGO2u.js");require("./layers.CT7FfHmU.js");exports.Commands=e.CB;exports.subsetToBase64=e.QB;exports.subsetToBinary=e.NQ;exports.toBase64=e.AI;