@layers-app/editor 0.7.50 → 0.7.52-beta.0

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/README.md +840 -830
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.d.ts +11 -16
  4. package/dist/index.js +2 -2
  5. package/dist/{layers.DDwbrkJ7.js → layers.-2ye0MXq.js} +1 -1
  6. package/dist/{layers.BdbCAcMB.js → layers.-kRMqyvU.js} +2 -2
  7. package/dist/{layers.BDScHFFb.js → layers.0Og7-uB9.js} +1 -1
  8. package/dist/{layers.BqRYYYDY.js → layers.0Q0fZJrc.js} +2 -2
  9. package/dist/{layers.DsIzryKP.js → layers.1ClwbdpV.js} +1 -1
  10. package/dist/{layers.CfvOQRhs.js → layers.1KvLma-C.js} +1 -1
  11. package/dist/{layers.CG6bKjYX.js → layers.1ajUpNFy.js} +1 -1
  12. package/dist/{layers.CQ1NYJyu.js → layers.4Y78mBA-.js} +1 -1
  13. package/dist/{layers.B6p_mCsn.js → layers.5fQO6yIC.js} +1 -1
  14. package/dist/layers.6wJVr6HL.js +8 -0
  15. package/dist/{layers.Bn1xaFL_.js → layers.7kXs0UDw.js} +6 -6
  16. package/dist/{layers.gB6oLdoR.js → layers.A0vNNUYf.js} +3 -3
  17. package/dist/{layers.DQRY7Guo.js → layers.B2wGrD_0.js} +1 -1
  18. package/dist/{layers.58yPULfi.js → layers.B37t365Y.js} +1 -1
  19. package/dist/{layers.D1aeIyNe.js → layers.B3CPA-e3.js} +1 -1
  20. package/dist/{layers.xiVInG4V.js → layers.B3Nf4F_Y.js} +1 -1
  21. package/dist/{layers.xiQfa4bG.js → layers.B3vMVAjh.js} +4 -4
  22. package/dist/{layers.C0dli79q.js → layers.BAk9s6n-.js} +1 -1
  23. package/dist/{layers.q3MMzbLf.js → layers.BArjASEZ.js} +1 -1
  24. package/dist/{layers.C7-iHZCJ.js → layers.BB0w7fMR.js} +1 -1
  25. package/dist/{layers.CDx3lD3k.js → layers.BB_BX154.js} +2 -2
  26. package/dist/{layers.R7RkrwMg.js → layers.BDAwT_Sz.js} +4 -4
  27. package/dist/{layers.C_K6g_RZ.js → layers.BDpLT4wT.js} +3 -3
  28. package/dist/{layers.jcz-f-1N.js → layers.BGtxxJx2.js} +1 -1
  29. package/dist/{layers.1mjftL5_.js → layers.BJWykyjJ.js} +1 -1
  30. package/dist/{layers.BXa2oBIA.js → layers.BL1RXD27.js} +1 -1
  31. package/dist/{layers.BV5BtGLJ.js → layers.BLAqmfb0.js} +4 -4
  32. package/dist/{layers.DEsG2AJ8.js → layers.BM-XePM3.js} +1 -1
  33. package/dist/{layers.BgyArnWi.js → layers.BODht-sU.js} +1 -1
  34. package/dist/{layers.Cxv6CQpf.js → layers.BPRELpiX.js} +1 -1
  35. package/dist/{layers.Le84-6v2.js → layers.BPgkeyPQ.js} +1 -1
  36. package/dist/layers.BSw4dawR.js +1 -0
  37. package/dist/{layers.uAlglow-.js → layers.BTabrcN8.js} +1 -1
  38. package/dist/{layers.DdzFDfrQ.js → layers.BUooFwfn.js} +1 -1
  39. package/dist/{layers.wB6eAqy3.js → layers.BVA_KC7B.js} +1 -1
  40. package/dist/{layers.DCqBdD35.js → layers.BXkYV52Q.js} +1 -1
  41. package/dist/{layers.D_bmwAO7.js → layers.BXkvnmNp.js} +1 -1
  42. package/dist/{layers.wxKwp3ix.js → layers.BYX8GYB0.js} +1 -1
  43. package/dist/layers.B_BVeVoQ.js +297 -0
  44. package/dist/{layers.DJ-TXXK-.js → layers.B_kLQ5H9.js} +1 -1
  45. package/dist/{layers.Di4vAFIL.js → layers.Bahm53_7.js} +1 -1
  46. package/dist/layers.Bbi9UZ1m.js +304 -0
  47. package/dist/{layers.D4wawipo.js → layers.BfbbNckm.js} +1 -1
  48. package/dist/layers.Bgd4Je2I.js +30336 -0
  49. package/dist/{layers.CRyKXZWJ.js → layers.BhSyvgx_.js} +1 -1
  50. package/dist/{layers.BBKe52Uo.js → layers.BhqGAwxb.js} +1 -1
  51. package/dist/{layers.CwWX8zGN.js → layers.Bi34xupz.js} +1 -1
  52. package/dist/{layers.ChEBIivl.js → layers.BjAwXFRU.js} +1 -1
  53. package/dist/{layers.V076uva3.js → layers.BjP8Y1L0.js} +1 -1
  54. package/dist/{layers.CA9VoM2H.js → layers.BlKlDMuR.js} +1 -1
  55. package/dist/{layers.D4ux331b.js → layers.BlMrsAwL.js} +1 -1
  56. package/dist/{layers.B8Hn_OAw.js → layers.BlkQNK7e.js} +1 -1
  57. package/dist/{layers.Dy0_d8sy.js → layers.Blu7cWaW.js} +1 -1
  58. package/dist/{layers.XHFonTzg.js → layers.BmU0vZ4U.js} +1 -1
  59. package/dist/{layers.CjbTAdEW.js → layers.BnDaaS2Q.js} +1 -1
  60. package/dist/{layers.DEqoN5t9.js → layers.BoNi_2cc.js} +2 -2
  61. package/dist/{layers.DIpmB2fY.js → layers.BpVD2bm5.js} +1 -1
  62. package/dist/{layers.Bs28qDoH.js → layers.BpeEpE9v.js} +2 -2
  63. package/dist/layers.BqHK0Hma.js +6 -0
  64. package/dist/{layers.BHwltXyg.js → layers.BqXSCbHd.js} +1 -1
  65. package/dist/{layers.DXYNzQcn.js → layers.BrL0esd9.js} +1 -1
  66. package/dist/{layers.BwGwij_7.js → layers.BulhpEct.js} +7 -7
  67. package/dist/{layers.BuIZNx04.js → layers.BwU0T4Qn.js} +1 -1
  68. package/dist/{layers.CQPWr4ja.js → layers.BxXh15wC.js} +1 -1
  69. package/dist/{layers.CNgaTRJ-.js → layers.BxocqCk8.js} +1 -1
  70. package/dist/{layers.bcVe3ETQ.js → layers.BynGqIwC.js} +1 -1
  71. package/dist/{layers.UBfu9gOa.js → layers.C3ssBlYh.js} +1 -1
  72. package/dist/{layers.DRRS2jlo.js → layers.C5DJhNFO.js} +8 -8
  73. package/dist/{layers.jC6aocln.js → layers.C6o9Zdhe.js} +1 -1
  74. package/dist/{layers.BKPBoKkb.js → layers.C7K5-XTv.js} +1 -1
  75. package/dist/{layers.pdLO1I3r.js → layers.CDqSDBIZ.js} +1 -1
  76. package/dist/{layers.jWkWors_.js → layers.CE9VzTqs.js} +1 -1
  77. package/dist/{layers.3JXckrih.js → layers.CGhKg2UA.js} +1 -1
  78. package/dist/{layers.SnwkWMxe.js → layers.CH2qry8d.js} +1 -1
  79. package/dist/{layers.DMOBZ1PN.js → layers.CHa9oDF7.js} +1 -1
  80. package/dist/{layers.L84VNWVC.js → layers.CIugMVpt.js} +3 -3
  81. package/dist/{layers.DNpvQTAN.js → layers.CJLKJmjo.js} +4 -4
  82. package/dist/{layers.DqApeiVR.js → layers.CL9fZ5oN.js} +1 -1
  83. package/dist/{layers.B8gGx5xB.js → layers.CLUJFeIE.js} +1 -1
  84. package/dist/{layers.C3fbshH1.js → layers.CMlCT5wk.js} +1 -1
  85. package/dist/{layers.BdCm5nsP.js → layers.CNvCp7fk.js} +3 -3
  86. package/dist/{layers.BtLgDqWJ.js → layers.CPI5I0VX.js} +1 -1
  87. package/dist/{layers.6E1FN3Gw.js → layers.CPjZu8k3.js} +1 -1
  88. package/dist/{layers.BFcaKMVs.js → layers.CSN5L4CF.js} +1 -1
  89. package/dist/{layers.BgCxoaRC.js → layers.CVSMXJX_.js} +1 -1
  90. package/dist/{layers.Dmt21zPO.js → layers.CVqJ_hEU.js} +1 -1
  91. package/dist/{layers.BR9pTmlh.js → layers.CWd6YseR.js} +1 -1
  92. package/dist/{layers.DsILMPxx.js → layers.CXZZoUze.js} +1 -1
  93. package/dist/{layers.LJHQMlT0.js → layers.CYO38oDa.js} +1 -1
  94. package/dist/{layers.RKdvjOr6.js → layers.CYvtqCN1.js} +2 -2
  95. package/dist/{layers.DvFYAtyT.js → layers.C_5_djOt.js} +1 -1
  96. package/dist/{layers.CACUEJaG.js → layers.C_vcPPv8.js} +1 -1
  97. package/dist/{layers.DU7ahD_K.js → layers.CbMLqAlS.js} +1 -1
  98. package/dist/{layers.z6oZNgry.js → layers.Cd7iDbCg.js} +4 -4
  99. package/dist/{layers.CEKs_5eg.js → layers.Cddq0ynj.js} +1 -1
  100. package/dist/{layers.Dp3X_nKL.js → layers.CfCF_I4t.js} +1 -1
  101. package/dist/{layers.keI5Goq3.js → layers.ChyjvpdM.js} +1 -1
  102. package/dist/{layers.CcYMOS8s.js → layers.CjyBasgq.js} +1 -1
  103. package/dist/{layers.CuVAs93H.js → layers.CkuzFxOG.js} +1 -1
  104. package/dist/{layers.CYwVCSVL.js → layers.ClIpv9ZP.js} +3 -3
  105. package/dist/{layers.CwpSHhII.js → layers.CnQb0AZ9.js} +1 -1
  106. package/dist/{layers.B0dL3fXU.js → layers.CnWS6y8A.js} +1 -1
  107. package/dist/{layers.C50u5ySP.js → layers.Cqcd8Q_s.js} +1 -1
  108. package/dist/{layers.BLPNAoB-.js → layers.CrzoloMo.js} +1 -1
  109. package/dist/{layers.BRQ8Rakg.js → layers.CsnKMCrr.js} +1 -1
  110. package/dist/{layers.B7hwts8I.js → layers.CuErZqKp.js} +1 -1
  111. package/dist/{layers.D0_V79x-.js → layers.Cv09a7zu.js} +1 -1
  112. package/dist/{layers.DTlPaqWP.js → layers.CwGbYQR9.js} +4 -4
  113. package/dist/{layers.t7qLpJLj.js → layers.CzpfDcSy.js} +1 -1
  114. package/dist/{layers.CDikJZ2W.js → layers.D0KYUoD3.js} +1 -1
  115. package/dist/{layers.CeyKROa7.js → layers.D0_VgPjn.js} +1 -1
  116. package/dist/{layers.BuI2oSla.js → layers.D1NKpCeQ.js} +1 -1
  117. package/dist/{layers.yLGauwjn.js → layers.D2Q_zFew.js} +1 -1
  118. package/dist/{layers.C4nKGTUz.js → layers.D314p-Db.js} +1 -1
  119. package/dist/{layers.edZiHsGP.js → layers.D3ecNV-e.js} +1 -1
  120. package/dist/{layers.DQ1WWqpA.js → layers.D5QPGVKj.js} +1 -1
  121. package/dist/{layers.DeYs-AEk.js → layers.D5UK3w0N.js} +1 -1
  122. package/dist/{layers.CCo5f0hk.js → layers.D8lV1Fbb.js} +2 -2
  123. package/dist/layers.DB-Qj1rJ.js +1 -0
  124. package/dist/{layers.1pRcTAar.js → layers.DC4ZjUbh.js} +1 -1
  125. package/dist/{layers.CAqgsL0i.js → layers.DDOb2tYL.js} +1 -1
  126. package/dist/{layers.DSpUxWRG.js → layers.DF5ljOWG.js} +1 -1
  127. package/dist/{layers.DCX8NEnp.js → layers.DHC1IyWF.js} +1 -1
  128. package/dist/{layers.BkW7EiM5.js → layers.DHUW1gO1.js} +5 -5
  129. package/dist/{layers.Co6P5CE7.js → layers.DJKATbv3.js} +1 -1
  130. package/dist/{layers.BDY-rgOH.js → layers.DJSWklBq.js} +1 -1
  131. package/dist/{layers.J6whSTQH.js → layers.DNLzZ3QX.js} +1 -1
  132. package/dist/{layers.Cuc-6v66.js → layers.DNP5RcnK.js} +1 -1
  133. package/dist/{layers.CfScX4Xp.js → layers.DPD9pwd0.js} +1 -1
  134. package/dist/{layers.D0orgThI.js → layers.DPJrZ1OC.js} +1 -1
  135. package/dist/{layers.CHCH4-qZ.js → layers.DQ77mGjs.js} +1 -1
  136. package/dist/{layers.BjY7SGpJ.js → layers.DRl3B4Mu.js} +1 -1
  137. package/dist/{layers.DL_yuNyM.js → layers.DS4mFHU2.js} +1 -1
  138. package/dist/{layers.CF4DS7sM.js → layers.DTJF2RNA.js} +1 -1
  139. package/dist/{layers.2pSBvthX.js → layers.DTKZ5xsM.js} +1 -1
  140. package/dist/{layers.Db35yVXF.js → layers.DUzSXUju.js} +4 -4
  141. package/dist/{layers.4j2l65V8.js → layers.DVWWq4Vp.js} +1 -1
  142. package/dist/{layers.ytE8hnTP.js → layers.DWQBfUMc.js} +1 -1
  143. package/dist/{layers.C9zmEpRR.js → layers.DWbke12O.js} +24 -24
  144. package/dist/{layers.G_rEgJ84.js → layers.DY-2miJk.js} +3 -3
  145. package/dist/{layers.Dr5P-2nS.js → layers.DZueIiOc.js} +1 -1
  146. package/dist/{layers.Db13D9Lm.js → layers.D_JcxpOr.js} +1 -1
  147. package/dist/{layers.BdltJpW4.js → layers.Da0GMq4-.js} +1 -1
  148. package/dist/{layers.BlkzlESM.js → layers.DbQhoaC_.js} +1 -1
  149. package/dist/{layers.BB2g2hcV.js → layers.DbuyfXAE.js} +1 -1
  150. package/dist/{layers.BSyWYa3T.js → layers.DdgREJMv.js} +3 -3
  151. package/dist/{layers.Bdab4W1k.js → layers.DdsAJh8K.js} +1 -1
  152. package/dist/{layers.BoVtCUMM.js → layers.DeHfWWVd.js} +1 -1
  153. package/dist/{layers.CdL5EoO0.js → layers.DejBmdEo.js} +1 -1
  154. package/dist/{layers.X49qbjji.js → layers.Df6PLFG0.js} +1 -1
  155. package/dist/{layers.Diok03ZC.js → layers.DfDk_3Ql.js} +1 -1
  156. package/dist/{layers.vC_TTmtv.js → layers.DgZNGpPI.js} +1 -1
  157. package/dist/{layers.wJ0Ei-KJ.js → layers.DgqFFfqK.js} +1 -1
  158. package/dist/{layers.CnZCSA5C.js → layers.DieiCBSw.js} +4 -4
  159. package/dist/{layers.CFtL25G1.js → layers.DlDzl2Gj.js} +1 -1
  160. package/dist/{layers.DJ1pPC0B.js → layers.Dm3L7Efi.js} +1 -1
  161. package/dist/{layers.BGJqh0OM.js → layers.DmGiLTq2.js} +1 -1
  162. package/dist/{layers.ChclGF62.js → layers.Dp-kSNg2.js} +1 -1
  163. package/dist/{layers.BsJtor_a.js → layers.DptU0IkH.js} +5 -5
  164. package/dist/{layers.BC_ZzUWF.js → layers.Dr9LShD_.js} +1 -1
  165. package/dist/{layers.BOEO7h2L.js → layers.DrvtPf-a.js} +1 -1
  166. package/dist/{layers.CGq2KScB.js → layers.DvFF5HkH.js} +1 -1
  167. package/dist/{layers.D2v5C1Zh.js → layers.Dw6ynhTo.js} +1 -1
  168. package/dist/{layers.B4Xxyv-P.js → layers.Dwq5JQl2.js} +1 -1
  169. package/dist/{layers.Bbofe3QV.js → layers.Dx57415L.js} +1 -1
  170. package/dist/{layers.CHqJrpuR.js → layers.DxUy8jg-.js} +1 -1
  171. package/dist/{layers.1nccyZ0e.js → layers.DyFs5seX.js} +1 -1
  172. package/dist/{layers.DAXmK7To.js → layers.Dza3WQmC.js} +4 -4
  173. package/dist/{layers.Caik8bd0.js → layers.E-Rhpau7.js} +3 -3
  174. package/dist/{layers.ClRPqAmB.js → layers.EH_BPb9X.js} +1 -1
  175. package/dist/{layers.Dnp1wYox.js → layers.FVAePrjU.js} +1 -1
  176. package/dist/{layers.Cv2tWVj6.js → layers.LS9tlY-u.js} +1 -1
  177. package/dist/{layers.B4dWK-K8.js → layers.MjvAptKt.js} +1 -1
  178. package/dist/{layers.DHeprtVO.js → layers.Mkn1Xncg.js} +1 -1
  179. package/dist/{layers.DHfNY0sD.js → layers.OYjzpz8N.js} +1 -1
  180. package/dist/{layers.DB4p71Eg.js → layers.U3X7bkxS.js} +1 -1
  181. package/dist/{layers.D_OFJwBR.js → layers.Uyh9wSdL.js} +1 -1
  182. package/dist/{layers.Bxq-2tXA.js → layers.Uztx5z8j.js} +1 -1
  183. package/dist/{layers.KVhv5i6f.js → layers.XfW6Naha.js} +1 -1
  184. package/dist/{layers.Dqq8v1Fa.js → layers.Z11k1LK5.js} +1 -1
  185. package/dist/{layers.Be7-Mg8o.js → layers._qdi8-XU.js} +1 -1
  186. package/dist/{layers.BAmQXqE2.js → layers.aBQZRuxR.js} +1 -1
  187. package/dist/layers.aPZvoU_9.js +1 -0
  188. package/dist/{layers.BO5Rnnbi.js → layers.b-mBUJEu.js} +1 -1
  189. package/dist/{layers.fll1ACjX.js → layers.bTfhzGT6.js} +1 -1
  190. package/dist/{layers.nhJMOX68.js → layers.cMlL3F3L.js} +1 -1
  191. package/dist/{layers.Bqs3EtDP.js → layers.cwTVYhnB.js} +1 -1
  192. package/dist/{layers.GsapfAQ1.js → layers.dWC7vfyd.js} +1 -1
  193. package/dist/{layers.4sLD6Mq9.js → layers.gLWGR5Gf.js} +1 -1
  194. package/dist/{layers.OT2d5b4q.js → layers.hhjKxI2O.js} +1 -1
  195. package/dist/{layers.BP97fFOU.js → layers.iQ3E2D2b.js} +3 -3
  196. package/dist/{layers.vuHWhvQ2.js → layers.jWBQxSg2.js} +3 -3
  197. package/dist/{layers.BZaCE8PX.js → layers.l7CbMi-1.js} +1 -1
  198. package/dist/{layers.B6HKvTiY.js → layers.l80yoYdy.js} +1 -1
  199. package/dist/{layers.Bgc68Fpd.js → layers.mVLjzy0q.js} +1 -1
  200. package/dist/{layers.DyXmvM5f.js → layers.m_uvzCJX.js} +1 -1
  201. package/dist/{layers.DWssEV6g.js → layers.nN6d1bcG.js} +1 -1
  202. package/dist/{layers.EhBvVbsw.js → layers.szlf0bkp.js} +1 -1
  203. package/dist/{layers.D6ye796m.js → layers.thIXAbGl.js} +3 -3
  204. package/dist/{layers.1F1nIa5G.js → layers.uL60912X.js} +1 -1
  205. package/dist/{layers.45jDKhSX.js → layers.vrrCthD2.js} +1 -1
  206. package/dist/{layers.BwouAPMu.js → layers.wOTJ8UtR.js} +1 -1
  207. package/dist/{layers.C3de1GwK.js → layers.yiHpDSNc.js} +1 -1
  208. package/dist/{layers.CihLa4Cq.js → layers.zV1bIfv1.js} +3 -3
  209. package/package.json +166 -160
  210. package/dist/layers.2pNC5vyF.js +0 -6
  211. package/dist/layers.B7TvkfLg.js +0 -1
  212. package/dist/layers.BXpIsVts.js +0 -1
  213. package/dist/layers.BraKlhHd.js +0 -276
  214. package/dist/layers.C0-S-Ikq.js +0 -1
  215. package/dist/layers.CFPwQcye.js +0 -296
  216. package/dist/layers.CrglsE47.js +0 -129
  217. package/dist/layers.D7Q4uE4E.js +0 -28299
  218. package/dist/layers.DJCmZhRu.js +0 -8
  219. package/dist/layers.DjjL4__-.js +0 -1
package/package.json CHANGED
@@ -1,160 +1,166 @@
1
- {
2
- "name": "@layers-app/editor",
3
- "private": false,
4
- "version": "0.7.50",
5
- "type": "module",
6
- "scripts": {
7
- "start": "cross-env VITE_LAYERS=true vite --mode full ",
8
- "start:specific": "VITE_LAYERS=false vite --mode full ",
9
- "build": "cross-env VITE_LAYERS=true vite build",
10
- "build:specific": "VITE_LAYERS=false vite build",
11
- "lint": "eslint . --ext .ts,.tsx",
12
- "lint:fix": "eslint . --ext .ts,.tsx --fix",
13
- "preview": "vite preview",
14
- "generate-dts": "tsc --project tsconfig.lib.json",
15
- "dev:local": "cross-env NODE_ENV=development concurrently \"npm:server:ws\" \"vite --host\"",
16
- "server:ws": "concurrently \"cd server && npm start\"",
17
- "format": "prettier --write .",
18
- "format:check": "prettier --check .",
19
- "test:e2e": "playwright test",
20
- "test:e2e:ui": "playwright test --ui",
21
- "test:e2e:debug": "playwright test --debug",
22
- "test:e2e:headed": "playwright test --headed",
23
- "start-test-server": "VITE_LAYERS=true vite --mode full --port 3000 --strictPort --host localhost"
24
- },
25
- "publishConfig": {
26
- "access": "public"
27
- },
28
- "files": [
29
- "dist"
30
- ],
31
- "main": "dist/index.js",
32
- "types": "dist/index.d.ts",
33
- "dependencies": {
34
- "@excalidraw/excalidraw": "^0.18.0",
35
- "@floating-ui/react": "^0.27.16",
36
- "@layers-app/editor-video": "^0.1.6",
37
- "@lexical/file": "^0.38.2",
38
- "@lexical/headless": "^0.38.2",
39
- "@lexical/markdown": "^0.38.2",
40
- "@lexical/react": "^0.38.2",
41
- "@tanstack/react-query": "^5.52.2",
42
- "lexical": "^0.38.2",
43
- "react-selecto": "^1.26.3",
44
- "y-websocket": "^1.5.3",
45
- "yjs": "^13.6.20"
46
- },
47
- "devDependencies": {
48
- "@eslint/js": "^9.9.0",
49
- "@hugeicons/core-free-icons": "^2.0.0",
50
- "@hugeicons/react": "^1.1.1",
51
- "@layers-app/shared": "^0.2.5",
52
- "@mantine/core": "8.3.5",
53
- "@mantine/dropzone": "8.3.5",
54
- "@mantine/form": "8.3.5",
55
- "@mantine/hooks": "8.3.5",
56
- "@mantine/modals": "8.3.5",
57
- "@mantine/notifications": "8.3.5",
58
- "@playwright/test": "^1.40.0",
59
- "@rollup/plugin-typescript": "^11.1.6",
60
- "@tabler/icons-react": "^3.7.0",
61
- "@trivago/prettier-plugin-sort-imports": "^5.2.1",
62
- "@types/eslint__js": "^8.42.3",
63
- "@types/lodash": "^4.14.202",
64
- "@types/lodash-es": "^4.17.12",
65
- "@types/node": "^20.14.11",
66
- "@types/prettier": "2.7.3",
67
- "@types/react": "^18.3.22",
68
- "@types/react-dom": "^18.3.7",
69
- "@types/swagger-ui-react": "^5.18.0",
70
- "@typescript-eslint/eslint-plugin": "^8.27.0",
71
- "@typescript-eslint/parser": "^8.27.0",
72
- "@vitejs/plugin-basic-ssl": "^1.1.0",
73
- "@vitejs/plugin-react": "^4.2.1",
74
- "concurrently": "^8.2.2",
75
- "cross-env": "^7.0.3",
76
- "eslint": "^9.22.0",
77
- "eslint-config-prettier": "^10.1.1",
78
- "eslint-plugin-prettier": "^5.2.3",
79
- "eslint-plugin-react": "^7.37.4",
80
- "eslint-plugin-react-refresh": "^0.4.19",
81
- "eslint-plugin-unused-imports": "^4.1.4",
82
- "glob": "^10.3.10",
83
- "i18next": "^25.5.2",
84
- "lodash-es": "^4.17.21",
85
- "postcss-import": "^16.1.0",
86
- "postcss-preset-mantine": "^1.17.0",
87
- "prettier": "^3.4.2",
88
- "prettier-plugin-organize-attributes": "^1.0.0",
89
- "proper-lockfile": "^4.1.2",
90
- "react-i18next": "^15.7.3",
91
- "rollup-plugin-typescript-paths": "^1.5.0",
92
- "rollup-plugin-visualizer": "^5.12.0",
93
- "sass": "^1.71.1",
94
- "terser": "^5.39.0",
95
- "typescript": "^5.5.4",
96
- "typescript-eslint": "^8.2.0",
97
- "vite": "^6.2.2",
98
- "vite-plugin-commonjs": "^0.10.1",
99
- "vite-plugin-css-injected-by-js": "^3.5.0",
100
- "vite-plugin-dts": "^4.0.0-beta.1",
101
- "vite-plugin-static-copy": "^2.3.2",
102
- "vite-plugin-svgr": "^4.2.0"
103
- },
104
- "overrides": {
105
- "nanoid": "^5.0.9",
106
- "prismjs": "^1.30.0",
107
- "dompurify": "^3.2.4",
108
- "mermaid": "^10.9.4",
109
- "i18next": "^25.5.2",
110
- "@mantine/core": "8.3.5",
111
- "@mantine/hooks": "8.3.5",
112
- "@mantine/form": "8.3.5",
113
- "@mantine/dropzone": "8.3.5",
114
- "@mantine/modals": "8.3.5",
115
- "@mantine/notifications": "8.3.5",
116
- "@excalidraw/mermaid-to-excalidraw": {
117
- "nanoid": "^5.0.9"
118
- },
119
- "@excalidraw/excalidraw": {
120
- "nanoid": "^5.0.9"
121
- },
122
- "postcss": {
123
- "nanoid": "^5.0.9"
124
- },
125
- "ajv": "^8.18.0",
126
- "minimatch": "^10.2.1"
127
- },
128
- "peerDependencies": {
129
- "@dnd-kit/modifiers": ">=6",
130
- "@emotion/react": ">=11",
131
- "@emotion/styled": ">=11",
132
- "@hugeicons/core-free-icons": ">=1",
133
- "@hugeicons/react": ">=1",
134
- "@mantine/carousel": ">=8.0.0",
135
- "@mantine/colors-generator": ">=8.0.0",
136
- "@mantine/core": ">=8.0.0",
137
- "@mantine/dropzone": ">=8.0.0",
138
- "@mantine/form": ">=8.0.0",
139
- "@mantine/hooks": ">=8.0.0",
140
- "@mantine/modals": ">=8.0.0",
141
- "@mantine/notifications": ">=8.0.0",
142
- "@mantine/tiptap": ">=8.0.0",
143
- "@tabler/icons-react": ">=3.7.0",
144
- "@tanstack/react-query": "^5.52.2",
145
- "@tanstack/react-virtual": ">=3",
146
- "date-fns-tz": ">=3",
147
- "i18next": "^25.5.2",
148
- "js-confetti": ">=0.12",
149
- "lodash-es": ">=4.17.21",
150
- "react": "^18.3.1",
151
- "react-dom": "^18.3.1",
152
- "react-i18next": "^15.7.3",
153
- "swagger-ui-react": "^5.27.1"
154
- },
155
- "peerDependenciesMeta": {
156
- "swagger-ui-react": {
157
- "optional": true
158
- }
159
- }
160
- }
1
+ {
2
+ "name": "@layers-app/editor",
3
+ "private": false,
4
+ "version": "0.7.52-beta.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "start": "VITE_LAYERS=true vite --mode full ",
8
+ "start:specific": "VITE_LAYERS=false vite --mode full ",
9
+ "build": "VITE_LAYERS=true vite build",
10
+ "build:specific": "VITE_LAYERS=false vite build",
11
+ "lint": "eslint . --ext .ts,.tsx",
12
+ "lint:fix": "eslint . --ext .ts,.tsx --fix",
13
+ "preview": "vite preview",
14
+ "generate-dts": "tsc --project tsconfig.lib.json",
15
+ "dev:local": "cross-env NODE_ENV=development concurrently \"npm:server:ws\" \"vite --host\"",
16
+ "server:ws": "concurrently \"cd server && npm start\"",
17
+ "server:smart-paste": "cd server && npm start",
18
+ "dev:full": "concurrently \"npm run start\" \"npm run server:smart-paste\"",
19
+ "format": "prettier --write .",
20
+ "format:check": "prettier --check .",
21
+ "test:e2e": "playwright test",
22
+ "test:e2e:ui": "playwright test --ui",
23
+ "test:e2e:debug": "playwright test --debug",
24
+ "test:e2e:headed": "playwright test --headed",
25
+ "start-test-server": "VITE_LAYERS=true vite --mode full --port 3000 --strictPort --host localhost",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
+ "test:coverage": "vitest run --coverage"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "main": "dist/index.js",
37
+ "types": "dist/index.d.ts",
38
+ "dependencies": {
39
+ "@excalidraw/excalidraw": "^0.18.0",
40
+ "@floating-ui/react": "^0.27.16",
41
+ "@layers-app/editor-video": "^0.1.5",
42
+ "@lexical/file": "^0.38.2",
43
+ "@lexical/headless": "^0.38.2",
44
+ "@lexical/markdown": "^0.38.2",
45
+ "@lexical/react": "^0.38.2",
46
+ "@tanstack/react-query": "^5.52.2",
47
+ "lexical": "^0.38.2",
48
+ "react-selecto": "^1.26.3",
49
+ "y-websocket": "^1.5.3",
50
+ "yjs": "^13.6.20"
51
+ },
52
+ "devDependencies": {
53
+ "@eslint/js": "^9.9.0",
54
+ "@hugeicons/core-free-icons": "^2.0.0",
55
+ "@hugeicons/react": "^1.1.1",
56
+ "@layers-app/shared": "^0.2.7",
57
+ "@mantine/core": "8.3.5",
58
+ "@mantine/dropzone": "8.3.5",
59
+ "@mantine/form": "8.3.5",
60
+ "@mantine/hooks": "8.3.5",
61
+ "@mantine/modals": "8.3.5",
62
+ "@mantine/notifications": "8.3.5",
63
+ "@playwright/test": "^1.40.0",
64
+ "@rollup/plugin-typescript": "^11.1.6",
65
+ "@tabler/icons-react": "^3.7.0",
66
+ "@trivago/prettier-plugin-sort-imports": "^5.2.1",
67
+ "@types/eslint__js": "^8.42.3",
68
+ "@types/lodash": "^4.14.202",
69
+ "@types/lodash-es": "^4.17.12",
70
+ "@types/node": "^20.14.11",
71
+ "@types/prettier": "2.7.3",
72
+ "@types/react": "^18.3.22",
73
+ "@types/react-dom": "^18.3.7",
74
+ "@types/swagger-ui-react": "^5.18.0",
75
+ "@typescript-eslint/eslint-plugin": "^8.27.0",
76
+ "@typescript-eslint/parser": "^8.27.0",
77
+ "@vitejs/plugin-basic-ssl": "^1.1.0",
78
+ "@vitejs/plugin-react": "^4.2.1",
79
+ "concurrently": "^8.2.2",
80
+ "cross-env": "^7.0.3",
81
+ "eslint": "^9.22.0",
82
+ "eslint-config-prettier": "^10.1.1",
83
+ "eslint-plugin-prettier": "^5.2.3",
84
+ "eslint-plugin-react": "^7.37.4",
85
+ "eslint-plugin-react-refresh": "^0.4.19",
86
+ "eslint-plugin-unused-imports": "^4.1.4",
87
+ "glob": "^10.3.10",
88
+ "i18next": "^25.5.2",
89
+ "lodash-es": "^4.17.21",
90
+ "postcss-import": "^16.1.0",
91
+ "postcss-preset-mantine": "^1.17.0",
92
+ "prettier": "^3.4.2",
93
+ "prettier-plugin-organize-attributes": "^1.0.0",
94
+ "proper-lockfile": "^4.1.2",
95
+ "react-i18next": "^15.7.3",
96
+ "rollup-plugin-typescript-paths": "^1.5.0",
97
+ "rollup-plugin-visualizer": "^5.12.0",
98
+ "sass": "^1.71.1",
99
+ "terser": "^5.39.0",
100
+ "typescript": "^5.5.4",
101
+ "typescript-eslint": "^8.2.0",
102
+ "vite": "^6.2.2",
103
+ "vite-plugin-commonjs": "^0.10.1",
104
+ "vite-plugin-css-injected-by-js": "^3.5.0",
105
+ "vite-plugin-dts": "^4.0.0-beta.1",
106
+ "vite-plugin-static-copy": "^2.3.2",
107
+ "vite-plugin-svgr": "^4.2.0",
108
+ "vitest": "^4.0.18"
109
+ },
110
+ "overrides": {
111
+ "nanoid": "^5.0.9",
112
+ "prismjs": "^1.30.0",
113
+ "dompurify": "^3.2.4",
114
+ "mermaid": "^10.9.4",
115
+ "i18next": "^25.5.2",
116
+ "@mantine/core": "8.3.5",
117
+ "@mantine/hooks": "8.3.5",
118
+ "@mantine/form": "8.3.5",
119
+ "@mantine/dropzone": "8.3.5",
120
+ "@mantine/modals": "8.3.5",
121
+ "@mantine/notifications": "8.3.5",
122
+ "@excalidraw/mermaid-to-excalidraw": {
123
+ "nanoid": "^5.0.9"
124
+ },
125
+ "@excalidraw/excalidraw": {
126
+ "nanoid": "^5.0.9"
127
+ },
128
+ "postcss": {
129
+ "nanoid": "^5.0.9"
130
+ },
131
+ "ajv": "^8.18.0",
132
+ "minimatch": "^10.2.1"
133
+ },
134
+ "peerDependencies": {
135
+ "@dnd-kit/modifiers": ">=6",
136
+ "@emotion/react": ">=11",
137
+ "@emotion/styled": ">=11",
138
+ "@hugeicons/core-free-icons": ">=1",
139
+ "@hugeicons/react": ">=1",
140
+ "@mantine/carousel": ">=8.0.0",
141
+ "@mantine/colors-generator": ">=8.0.0",
142
+ "@mantine/core": ">=8.0.0",
143
+ "@mantine/dropzone": ">=8.0.0",
144
+ "@mantine/form": ">=8.0.0",
145
+ "@mantine/hooks": ">=8.0.0",
146
+ "@mantine/modals": ">=8.0.0",
147
+ "@mantine/notifications": ">=8.0.0",
148
+ "@mantine/tiptap": ">=8.0.0",
149
+ "@tabler/icons-react": ">=3.7.0",
150
+ "@tanstack/react-query": "^5.52.2",
151
+ "@tanstack/react-virtual": ">=3",
152
+ "date-fns-tz": ">=3",
153
+ "i18next": "^25.5.2",
154
+ "js-confetti": ">=0.12",
155
+ "lodash-es": ">=4.17.21",
156
+ "react": "^18.3.1",
157
+ "react-dom": "^18.3.1",
158
+ "react-i18next": "^15.7.3",
159
+ "swagger-ui-react": "^5.27.1"
160
+ },
161
+ "peerDependenciesMeta": {
162
+ "swagger-ui-react": {
163
+ "optional": true
164
+ }
165
+ }
166
+ }
@@ -1,6 +0,0 @@
1
- import { e as o, j as s, o as f } from "./layers.DRRS2jlo.js";
2
- export {
3
- o as default,
4
- s as en,
5
- f as kaa
6
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("./layers.CihLa4Cq.js"),s=(e,r)=>n.Utils.lang.round(n.Color.parse(e)[r]);exports.channel=s;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./layers.DDwbrkJ7.js");require("./layers.BwGwij_7.js");exports.Commands=e.CB;exports.subsetToBase64=e.QB;exports.subsetToBinary=e.NQ;exports.toBase64=e.AI;
@@ -1,276 +0,0 @@
1
- import { jsxs as E, Fragment as T, jsx as o } from "react/jsx-runtime";
2
- import { useRef as N, useEffect as d, useState as C, useCallback as f } from "react";
3
- import { createPortal as U } from "react-dom";
4
- import { k as P, d as S, c as $, l as V, H as X, n as Y, O as J } from "./layers.D7Q4uE4E.js";
5
- import { useLexicalComposerContext as W } from "@lexical/react/LexicalComposerContext";
6
- import { LexicalErrorBoundary as _ } from "@lexical/react/LexicalErrorBoundary";
7
- import { useLexicalEditable as Z } from "@lexical/react/useLexicalEditable";
8
- import { Textarea as K, Group as ee, Button as H } from "@mantine/core";
9
- import { $getNodeByKey as v, COMMAND_PRIORITY_EDITOR as te } from "lexical";
10
- import ne from "./layers.b9B2NY7n.js";
11
- function w({
12
- equation: r,
13
- inline: a,
14
- onDoubleClick: s
15
- }) {
16
- const n = N(null);
17
- return d(() => {
18
- const l = n.current;
19
- l !== null && ne.render(r, l, {
20
- displayMode: !a,
21
- errorColor: "#cc0000",
22
- output: "html",
23
- strict: "warn",
24
- throwOnError: !1,
25
- trust: !1
26
- });
27
- }, [r, a]), /* @__PURE__ */ E(T, { children: [
28
- /* @__PURE__ */ o(
29
- "img",
30
- {
31
- src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
32
- width: 0,
33
- height: 0,
34
- alt: ""
35
- }
36
- ),
37
- /* @__PURE__ */ o(
38
- "span",
39
- {
40
- role: "button",
41
- tabIndex: -1,
42
- onDoubleClick: s,
43
- ref: n
44
- }
45
- ),
46
- /* @__PURE__ */ o(
47
- "img",
48
- {
49
- src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
50
- width: 0,
51
- height: 0,
52
- alt: ""
53
- }
54
- )
55
- ] });
56
- }
57
- let M = !1;
58
- const I = /* @__PURE__ */ new Map();
59
- function oe(r) {
60
- M || (M = !0, r.registerCommand(
61
- J,
62
- (a) => {
63
- const s = I.get(a);
64
- return s ? (s(), !0) : !1;
65
- },
66
- te
67
- ));
68
- }
69
- function pe({
70
- equation: r,
71
- inline: a,
72
- nodeKey: s
73
- }) {
74
- const [n] = W(), l = Z(), p = N(null), B = N(null), [m, x] = C(r), [c, u] = C(!1), [O, F] = C({ top: 0, left: 0 }), [j, D] = C(!1), b = f(() => {
75
- const e = p.current;
76
- if (!e) return;
77
- const i = (e.closest(
78
- ".editor-equation"
79
- ) || e).getBoundingClientRect();
80
- F({
81
- top: i.bottom + 18,
82
- left: i.left
83
- }), D(!0);
84
- }, []);
85
- d(() => {
86
- oe(n);
87
- }, [n]), d(() => {
88
- const e = () => {
89
- l && u(!0);
90
- };
91
- return I.set(s, e), () => {
92
- I.delete(s);
93
- };
94
- }, [l, s]);
95
- const A = f(() => {
96
- if (l) {
97
- if (c) {
98
- u(!1);
99
- return;
100
- }
101
- b(), u(!0);
102
- }
103
- }, [l, c, b]), k = f(() => {
104
- const e = m.trim();
105
- n.update(() => {
106
- const t = v(s);
107
- if (P(t)) {
108
- if (t.isInline && t.isInline() && e === "") {
109
- t.remove();
110
- return;
111
- }
112
- t.setEquation(e);
113
- }
114
- }), u(!1);
115
- }, [n, s, m]), q = f(() => {
116
- if (!r && a) {
117
- n.update(() => {
118
- const e = v(s);
119
- P(e) && e.remove();
120
- }), u(!1);
121
- return;
122
- }
123
- x(r), r && u(!1);
124
- }, [n, r, a, s]);
125
- d(() => {
126
- c || x(r);
127
- }, [r, c]), d(() => {
128
- if (!c) {
129
- S(n.getRootElement()), D(!1);
130
- return;
131
- }
132
- $(n.getRootElement()), b();
133
- const e = window.requestAnimationFrame(() => {
134
- const t = B.current;
135
- if (!t) return;
136
- const i = t.value.length;
137
- t.focus(), t.setSelectionRange(i, i);
138
- });
139
- return () => {
140
- window.cancelAnimationFrame(e), S(n.getRootElement());
141
- };
142
- }, [c, b]), d(() => {
143
- if (!c) return;
144
- const e = (t) => {
145
- const i = t.target, g = p.current, y = document.querySelector(".equation-block__popup");
146
- i && (g != null && g.contains(i) || y instanceof HTMLElement && y.contains(i)) || (a && !m.trim() && n.update(() => {
147
- const L = v(s);
148
- P(L) && L.remove();
149
- }), u(!1));
150
- };
151
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
152
- }, [n, a, c, s, m]);
153
- const h = (c ? m : r).trim(), R = h.length > 0;
154
- d(() => {
155
- const e = p.current;
156
- if (!e) return;
157
- const t = e.closest(".editor-equation"), i = h;
158
- if (t) {
159
- if (!i) {
160
- t.removeAttribute("data-lexical-equation");
161
- return;
162
- }
163
- try {
164
- const g = btoa(unescape(encodeURIComponent(i)));
165
- t.setAttribute("data-lexical-equation", g);
166
- } catch {
167
- t.setAttribute("data-lexical-equation", i);
168
- }
169
- }
170
- }, [h]);
171
- const z = a && !l ? /* @__PURE__ */ o("span", { className: "equation-inline-trigger", children: /* @__PURE__ */ o(_, { onError: (e) => {
172
- var t;
173
- return (t = n._onError) == null ? void 0 : t.call(n, e);
174
- }, children: /* @__PURE__ */ o(
175
- w,
176
- {
177
- equation: r,
178
- inline: a,
179
- onDoubleClick: A
180
- }
181
- ) }) }) : a ? /* @__PURE__ */ o(
182
- "span",
183
- {
184
- className: `equation-inline-trigger${R ? "" : " equation-inline-trigger--empty"}`,
185
- onClick: A,
186
- ref: p,
187
- children: R ? /* @__PURE__ */ o(_, { onError: (e) => {
188
- var t;
189
- return (t = n._onError) == null ? void 0 : t.call(n, e);
190
- }, children: /* @__PURE__ */ o(
191
- w,
192
- {
193
- equation: h,
194
- inline: a,
195
- onDoubleClick: A
196
- }
197
- ) }) : /* @__PURE__ */ E("span", { className: "equation-inline-placeholder", children: [
198
- /* @__PURE__ */ o(X, { icon: Y, size: 24 }),
199
- /* @__PURE__ */ o("span", { children: "New equation" })
200
- ] })
201
- }
202
- ) : /* @__PURE__ */ o("div", { className: "equation-block", ref: p, children: /* @__PURE__ */ o(
203
- "div",
204
- {
205
- className: "equation-block__container",
206
- onClick: A,
207
- style: { cursor: l ? "pointer" : "default" },
208
- children: R ? /* @__PURE__ */ o(_, { onError: (e) => {
209
- var t;
210
- return (t = n._onError) == null ? void 0 : t.call(n, e);
211
- }, children: /* @__PURE__ */ o(
212
- w,
213
- {
214
- equation: h,
215
- inline: a,
216
- onDoubleClick: A
217
- }
218
- ) }) : /* @__PURE__ */ o("div", { className: "equation-block__placeholder", children: "Add a TeX equation" })
219
- }
220
- ) }), G = f(
221
- (e) => {
222
- e.stopPropagation(), x(e.currentTarget.value);
223
- },
224
- []
225
- ), Q = f(
226
- V({
227
- onConfirm: k,
228
- onCancel: q
229
- }),
230
- [k, q]
231
- );
232
- return /* @__PURE__ */ E(T, { children: [
233
- z,
234
- c && j && U(
235
- /* @__PURE__ */ o(
236
- "div",
237
- {
238
- className: "equation-block__popup",
239
- style: {
240
- position: "fixed",
241
- top: O.top,
242
- left: O.left,
243
- zIndex: 103
244
- },
245
- children: /* @__PURE__ */ E("div", { className: "equation-block__editor", children: [
246
- /* @__PURE__ */ o(
247
- K,
248
- {
249
- autosize: !0,
250
- minRows: 2,
251
- variant: "unstyled",
252
- value: m,
253
- onChange: G,
254
- onKeyDown: Q,
255
- placeholder: "x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",
256
- classNames: {
257
- wrapper: "equation-block__textarea-wrapper"
258
- },
259
- autoFocus: !0,
260
- ref: B
261
- }
262
- ),
263
- /* @__PURE__ */ E(ee, { justify: "flex-end", gap: "sm", children: [
264
- /* @__PURE__ */ o(H, { variant: "subtle", color: "gray", onClick: q, children: "Cancel" }),
265
- /* @__PURE__ */ o(H, { onClick: k, children: "Save" })
266
- ] })
267
- ] })
268
- }
269
- ),
270
- document.body
271
- )
272
- ] });
273
- }
274
- export {
275
- pe as default
276
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),T=require("react-dom"),u=require("./layers.CrglsE47.js"),$=require("@lexical/react/LexicalComposerContext"),R=require("@lexical/react/LexicalErrorBoundary"),H=require("@lexical/react/useLexicalEditable"),h=require("@mantine/core"),b=require("lexical"),F=require("./layers.R8mPlCA0.js");function P({equation:s,inline:a,onDoubleClick:c}){const r=o.useRef(null);return o.useEffect(()=>{const d=r.current;d!==null&&F.default.render(s,d,{displayMode:!a,errorColor:"#cc0000",output:"html",strict:"warn",throwOnError:!1,trust:!1})},[s,a]),n.jsxs(n.Fragment,{children:[n.jsx("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",width:0,height:0,alt:""}),n.jsx("span",{role:"button",tabIndex:-1,onDoubleClick:c,ref:r}),n.jsx("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",width:0,height:0,alt:""})]})}let I=!1;const N=new Map;function z(s){I||(I=!0,s.registerCommand(u.OPEN_EQUATION_POPUP_COMMAND,a=>{const c=N.get(a);return c?(c(),!0):!1},b.COMMAND_PRIORITY_EDITOR))}function G({equation:s,inline:a,nodeKey:c}){const[r]=$.useLexicalComposerContext(),d=H.useLexicalEditable(),p=o.useRef(null),_=o.useRef(null),[A,C]=o.useState(s),[l,f]=o.useState(!1),[v,L]=o.useState({top:0,left:0}),[S,y]=o.useState(!1),E=o.useCallback(()=>{const e=p.current;if(!e)return;const i=(e.closest(".editor-equation")||e).getBoundingClientRect();L({top:i.bottom+18,left:i.left}),y(!0)},[]);o.useEffect(()=>{z(r)},[r]),o.useEffect(()=>{const e=()=>{d&&f(!0)};return N.set(c,e),()=>{N.delete(c)}},[d,c]);const m=o.useCallback(()=>{if(d){if(l){f(!1);return}E(),f(!0)}},[d,l,E]),q=o.useCallback(()=>{const e=A.trim();r.update(()=>{const t=b.$getNodeByKey(c);if(u.$isEquationNode(t)){if(t.isInline&&t.isInline()&&e===""){t.remove();return}t.setEquation(e)}}),f(!1)},[r,c,A]),j=o.useCallback(()=>{if(!s&&a){r.update(()=>{const e=b.$getNodeByKey(c);u.$isEquationNode(e)&&e.remove()}),f(!1);return}C(s),s&&f(!1)},[r,s,a,c]);o.useEffect(()=>{l||C(s)},[s,l]),o.useEffect(()=>{if(!l){u.unblockScroll(r.getRootElement()),y(!1);return}u.blockScroll(r.getRootElement()),E();const e=window.requestAnimationFrame(()=>{const t=_.current;if(!t)return;const i=t.value.length;t.focus(),t.setSelectionRange(i,i)});return()=>{window.cancelAnimationFrame(e),u.unblockScroll(r.getRootElement())}},[l,E]),o.useEffect(()=>{if(!l)return;const e=t=>{const i=t.target,g=p.current,w=document.querySelector(".equation-block__popup");i&&(g!=null&&g.contains(i)||w instanceof HTMLElement&&w.contains(i))||(a&&!A.trim()&&r.update(()=>{const B=b.$getNodeByKey(c);u.$isEquationNode(B)&&B.remove()}),f(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r,a,l,c,A]);const x=(l?A:s).trim(),k=x.length>0;o.useEffect(()=>{const e=p.current;if(!e)return;const t=e.closest(".editor-equation"),i=x;if(t){if(!i){t.removeAttribute("data-lexical-equation");return}try{const g=btoa(unescape(encodeURIComponent(i)));t.setAttribute("data-lexical-equation",g)}catch{t.setAttribute("data-lexical-equation",i)}}},[x]);const O=a&&!d?n.jsx("span",{className:"equation-inline-trigger",children:n.jsx(R.LexicalErrorBoundary,{onError:e=>{var t;return(t=r._onError)==null?void 0:t.call(r,e)},children:n.jsx(P,{equation:s,inline:a,onDoubleClick:m})})}):a?n.jsx("span",{className:`equation-inline-trigger${k?"":" equation-inline-trigger--empty"}`,onClick:m,ref:p,children:k?n.jsx(R.LexicalErrorBoundary,{onError:e=>{var t;return(t=r._onError)==null?void 0:t.call(r,e)},children:n.jsx(P,{equation:x,inline:a,onDoubleClick:m})}):n.jsxs("span",{className:"equation-inline-placeholder",children:[n.jsx(u.HugeiconsIcon,{icon:u.c4,size:24}),n.jsx("span",{children:"New equation"})]})}):n.jsx("div",{className:"equation-block",ref:p,children:n.jsx("div",{className:"equation-block__container",onClick:m,style:{cursor:d?"pointer":"default"},children:k?n.jsx(R.LexicalErrorBoundary,{onError:e=>{var t;return(t=r._onError)==null?void 0:t.call(r,e)},children:n.jsx(P,{equation:x,inline:a,onDoubleClick:m})}):n.jsx("div",{className:"equation-block__placeholder",children:"Add a TeX equation"})})}),D=o.useCallback(e=>{e.stopPropagation(),C(e.currentTarget.value)},[]),M=o.useCallback(u.createPopupKeyDownHandler({onConfirm:q,onCancel:j}),[q,j]);return n.jsxs(n.Fragment,{children:[O,l&&S&&T.createPortal(n.jsx("div",{className:"equation-block__popup",style:{position:"fixed",top:v.top,left:v.left,zIndex:103},children:n.jsxs("div",{className:"equation-block__editor",children:[n.jsx(h.Textarea,{autosize:!0,minRows:2,variant:"unstyled",value:A,onChange:D,onKeyDown:M,placeholder:"x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",classNames:{wrapper:"equation-block__textarea-wrapper"},autoFocus:!0,ref:_}),n.jsxs(h.Group,{justify:"flex-end",gap:"sm",children:[n.jsx(h.Button,{variant:"subtle",color:"gray",onClick:j,children:"Cancel"}),n.jsx(h.Button,{onClick:q,children:"Save"})]})]})}),document.body)]})}exports.default=G;