@dwelle/excalidraw 0.5.0-bb58eff → 0.5.0-bcfbd91

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 (235) hide show
  1. package/dist/browser/dev/excalidraw-assets-dev/{c4Diagram-9cddb37f-5K5MMBTZ.js → c4Diagram-9cddb37f-Z2BVR4KG.js} +4 -4
  2. package/dist/browser/dev/excalidraw-assets-dev/{chunk-YLFK45LY.js → chunk-2R746FJ3.js} +21 -21
  3. package/dist/browser/dev/excalidraw-assets-dev/{chunk-HPE2QM6Z.js → chunk-4YGSGIMJ.js} +3 -3
  4. package/dist/browser/dev/excalidraw-assets-dev/{chunk-FG5PX37Z.js → chunk-7ZK24NYG.js} +398 -930
  5. package/dist/browser/dev/excalidraw-assets-dev/chunk-7ZK24NYG.js.map +7 -0
  6. package/dist/browser/dev/excalidraw-assets-dev/{chunk-VJWYXZRD.js → chunk-A4L3DQO2.js} +3 -3
  7. package/dist/browser/dev/excalidraw-assets-dev/{chunk-LARCHXKL.js → chunk-CWUUGB6C.js} +3 -3
  8. package/dist/browser/dev/excalidraw-assets-dev/{chunk-PTRCE3YZ.js → chunk-DLCKQH3C.js} +4 -4
  9. package/dist/browser/dev/excalidraw-assets-dev/{chunk-ABU3Y4P6.js → chunk-IVZGHBP3.js} +5 -5
  10. package/dist/browser/dev/excalidraw-assets-dev/{chunk-VVJS3CBB.js → chunk-J3RT3AEL.js} +3 -3
  11. package/dist/browser/dev/excalidraw-assets-dev/{chunk-AQ5OI7FF.js → chunk-KN673SBB.js} +3 -3
  12. package/dist/browser/dev/excalidraw-assets-dev/{chunk-OBKV4VWD.js → chunk-OGN4DE2Q.js} +2 -2
  13. package/dist/browser/dev/excalidraw-assets-dev/{chunk-JRHEG4KR.js → chunk-P3NJMBHG.js} +3 -3
  14. package/dist/browser/dev/excalidraw-assets-dev/{chunk-UN4RKPVH.js → chunk-QP4L67PY.js} +3 -3
  15. package/dist/browser/dev/excalidraw-assets-dev/{chunk-AU5UG6FO.js → chunk-U7QYLFAH.js} +6 -6
  16. package/dist/browser/dev/excalidraw-assets-dev/{chunk-FSI24XHB.js → chunk-ULL4JVA4.js} +7 -7
  17. package/dist/browser/dev/excalidraw-assets-dev/{chunk-2WPXONHI.js → chunk-WFIY45QO.js} +2 -5
  18. package/dist/browser/dev/excalidraw-assets-dev/{chunk-2WPXONHI.js.map → chunk-WFIY45QO.js.map} +2 -2
  19. package/dist/browser/dev/excalidraw-assets-dev/{chunk-RMILGNZX.js → chunk-WWRYLVJC.js} +4 -4
  20. package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-bc733c3b-NWRL2CDH.js → classDiagram-bc733c3b-K5SPPM5G.js} +7 -7
  21. package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-v2-8931bdaf-Y5FPX4CT.js → classDiagram-v2-8931bdaf-LMQ4MBCJ.js} +10 -10
  22. package/dist/browser/dev/excalidraw-assets-dev/{directory-open-01563666-VWSBJ543.js → directory-open-01563666-HET5VGVW.js} +2 -2
  23. package/dist/browser/dev/excalidraw-assets-dev/{directory-open-4ed118d0-FYNYOZXP.js → directory-open-4ed118d0-EEZTUAOR.js} +2 -2
  24. package/dist/browser/dev/excalidraw-assets-dev/dist-MMLCHBGE.js +10 -0
  25. package/dist/browser/dev/excalidraw-assets-dev/{en-OFPNSLTO.js → en-CJBKYSM5.js} +2 -2
  26. package/dist/browser/dev/excalidraw-assets-dev/{erDiagram-f6946109-URHWBVQF.js → erDiagram-f6946109-T5ZYWW62.js} +5 -5
  27. package/dist/browser/dev/excalidraw-assets-dev/{file-open-002ab408-K7UWK3UX.js → file-open-002ab408-2OQEKDVS.js} +2 -2
  28. package/dist/browser/dev/excalidraw-assets-dev/{file-open-7c801643-PUS6AQBV.js → file-open-7c801643-7IDWBVQC.js} +2 -2
  29. package/dist/browser/dev/excalidraw-assets-dev/{file-save-3189631c-AVBJT4K7.js → file-save-3189631c-D66DZOSK.js} +2 -2
  30. package/dist/browser/dev/excalidraw-assets-dev/{file-save-745eba88-FCWOWXVA.js → file-save-745eba88-3NARDH2Z.js} +2 -2
  31. package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-93327f21-ARY24FIN.js → flowDiagram-93327f21-OFTBRZYD.js} +11 -11
  32. package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-v2-476db779-Y3LYCDLM.js → flowDiagram-v2-476db779-VVUICW5U.js} +11 -11
  33. package/dist/browser/dev/excalidraw-assets-dev/{flowchart-elk-definition-5082a990-DTGYPOS7.js → flowchart-elk-definition-5082a990-KDDK5LFE.js} +8 -8
  34. package/dist/browser/dev/excalidraw-assets-dev/{ganttDiagram-7ce12d6b-GWKDCJYX.js → ganttDiagram-7ce12d6b-XW6BLNYB.js} +3 -3
  35. package/dist/browser/dev/excalidraw-assets-dev/{gitGraphDiagram-1e960c50-A4SIEE63.js → gitGraphDiagram-1e960c50-WAVVX7YE.js} +3 -3
  36. package/dist/browser/dev/excalidraw-assets-dev/{image-ZQHNSB7P.css → image-BMBZMPAN.css} +20 -99
  37. package/dist/browser/dev/excalidraw-assets-dev/image-BMBZMPAN.css.map +7 -0
  38. package/dist/browser/dev/excalidraw-assets-dev/{image-J27XZPQC.js → image-DG6G3CCZ.js} +6 -6
  39. package/dist/browser/dev/excalidraw-assets-dev/{image-blob-reduce.esm-BDWVJKFQ.js → image-blob-reduce.esm-OJYOZNL4.js} +2 -2
  40. package/dist/browser/dev/excalidraw-assets-dev/{infoDiagram-264bed3e-AUF35UHX.js → infoDiagram-264bed3e-SMYVWNAJ.js} +3 -3
  41. package/dist/browser/dev/excalidraw-assets-dev/{journeyDiagram-31be0096-ADAT3O42.js → journeyDiagram-31be0096-IXIWAKJV.js} +4 -4
  42. package/dist/browser/dev/excalidraw-assets-dev/{mindmap-definition-4fc2557c-YC2LM75P.js → mindmap-definition-4fc2557c-H5WTPEBY.js} +4 -4
  43. package/dist/browser/dev/excalidraw-assets-dev/{pica-GXUQBC7B.js → pica-RRHXYZO2.js} +2 -2
  44. package/dist/browser/dev/excalidraw-assets-dev/{pieDiagram-157505fe-4XR6DLIZ.js → pieDiagram-157505fe-3LXENDEP.js} +3 -3
  45. package/dist/browser/dev/excalidraw-assets-dev/{quadrantDiagram-fd70f2d0-LIR55Z6M.js → quadrantDiagram-fd70f2d0-CBA7LD4X.js} +3 -3
  46. package/dist/browser/dev/excalidraw-assets-dev/{requirementDiagram-19c99588-NKRCRRBM.js → requirementDiagram-19c99588-53JLZTYM.js} +5 -5
  47. package/dist/browser/dev/excalidraw-assets-dev/{roundRect-ZNZYUVWJ.js → roundRect-5HI6M3OA.js} +2 -2
  48. package/dist/browser/dev/excalidraw-assets-dev/{sequenceDiagram-5dfd0049-VUKNRO5G.js → sequenceDiagram-5dfd0049-XJRLBGS7.js} +4 -4
  49. package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-133e3642-3NYPG4IW.js → stateDiagram-133e3642-ZVPN2MPZ.js} +6 -6
  50. package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-v2-6371a76b-YINZI7AG.js → stateDiagram-v2-6371a76b-QIW3VCSC.js} +10 -10
  51. package/dist/browser/dev/excalidraw-assets-dev/{timeline-definition-5ed366f4-KWC42LPI.js → timeline-definition-5ed366f4-LGCWVNZT.js} +3 -3
  52. package/dist/browser/dev/index.css +19 -98
  53. package/dist/browser/dev/index.css.map +2 -2
  54. package/dist/browser/dev/index.js +5 -5
  55. package/dist/browser/prod/excalidraw-assets/{c4Diagram-9cddb37f-UIUBGLLC.js → c4Diagram-9cddb37f-CSAXQUMT.js} +1 -1
  56. package/dist/browser/prod/excalidraw-assets/{chunk-I32TF3FD.js → chunk-56HIV6N6.js} +1 -1
  57. package/dist/browser/prod/excalidraw-assets/{chunk-X3V4W6Y3.js → chunk-5PG4MN6E.js} +1 -1
  58. package/dist/browser/prod/excalidraw-assets/{chunk-XXT5RS66.js → chunk-5PXNTGLF.js} +1 -1
  59. package/dist/browser/prod/excalidraw-assets/{chunk-EQDCUI7P.js → chunk-6LDES2GZ.js} +1 -1
  60. package/dist/browser/prod/excalidraw-assets/{chunk-4C6GEPVI.js → chunk-BWJEY7EX.js} +1 -1
  61. package/dist/browser/prod/excalidraw-assets/{chunk-LOWTGNCV.js → chunk-CP5W5ACF.js} +1 -1
  62. package/dist/browser/prod/excalidraw-assets/chunk-DBUEOZT5.js +269 -0
  63. package/dist/browser/prod/excalidraw-assets/{chunk-MJ2YKZ3B.js → chunk-DF24HG3F.js} +1 -1
  64. package/dist/browser/prod/excalidraw-assets/{chunk-FVDUD6XA.js → chunk-DVVGVVYL.js} +1 -1
  65. package/dist/browser/prod/excalidraw-assets/{chunk-7CLKPETF.js → chunk-GTO2REC5.js} +1 -1
  66. package/dist/browser/prod/excalidraw-assets/{chunk-YGSQT3TE.js → chunk-KQZZ435A.js} +2 -2
  67. package/dist/browser/prod/excalidraw-assets/{chunk-RVQN2TTU.js → chunk-ONH2E3HD.js} +3 -3
  68. package/dist/browser/prod/excalidraw-assets/{chunk-FGOIQKRL.js → chunk-QK2I4STK.js} +1 -1
  69. package/dist/browser/prod/excalidraw-assets/{chunk-VZ5ZGWAN.js → chunk-TGFMJVS6.js} +1 -1
  70. package/dist/browser/prod/excalidraw-assets/{chunk-5EY4KGYU.js → chunk-V6GEKVIM.js} +1 -1
  71. package/dist/browser/prod/excalidraw-assets/{chunk-VI6ARPX6.js → chunk-W7OUYNQP.js} +1 -1
  72. package/dist/browser/prod/excalidraw-assets/{classDiagram-bc733c3b-6BX33ZTH.js → classDiagram-bc733c3b-FZUH7HPQ.js} +1 -1
  73. package/dist/browser/prod/excalidraw-assets/{classDiagram-v2-8931bdaf-ACBVEHQO.js → classDiagram-v2-8931bdaf-LRVGH5BD.js} +1 -1
  74. package/dist/browser/prod/excalidraw-assets/{directory-open-01563666-C2PFQBKL.js → directory-open-01563666-WBDEPWFN.js} +1 -1
  75. package/dist/browser/prod/excalidraw-assets/{directory-open-4ed118d0-E55HNHTS.js → directory-open-4ed118d0-SHTOCZXQ.js} +1 -1
  76. package/dist/browser/prod/excalidraw-assets/dist-JMLVFQ4W.js +1 -0
  77. package/dist/browser/prod/excalidraw-assets/{en-46OXMRU6.js → en-6EOGX47W.js} +1 -1
  78. package/dist/browser/prod/excalidraw-assets/{erDiagram-f6946109-TYWREFGK.js → erDiagram-f6946109-IIBR3HHT.js} +1 -1
  79. package/dist/browser/prod/excalidraw-assets/{file-open-002ab408-FQU3HANB.js → file-open-002ab408-7YMAGCE3.js} +1 -1
  80. package/dist/browser/prod/excalidraw-assets/{file-open-7c801643-BCD55L36.js → file-open-7c801643-2UIR6WEW.js} +1 -1
  81. package/dist/browser/prod/excalidraw-assets/{file-save-3189631c-TAXV2OAM.js → file-save-3189631c-UAJTEO5I.js} +1 -1
  82. package/dist/browser/prod/excalidraw-assets/{file-save-745eba88-DPWZ3VE6.js → file-save-745eba88-TOUSYUTX.js} +1 -1
  83. package/dist/browser/prod/excalidraw-assets/{flowDiagram-93327f21-4VGGLTSV.js → flowDiagram-93327f21-XIY3FFTU.js} +1 -1
  84. package/dist/browser/prod/excalidraw-assets/flowDiagram-v2-476db779-EQMWJJEV.js +1 -0
  85. package/dist/browser/prod/excalidraw-assets/{flowchart-elk-definition-5082a990-DWI3JPDY.js → flowchart-elk-definition-5082a990-LJBHN7JH.js} +1 -1
  86. package/dist/browser/prod/excalidraw-assets/{ganttDiagram-7ce12d6b-FGLMWLXT.js → ganttDiagram-7ce12d6b-CBM3PKRU.js} +1 -1
  87. package/dist/browser/prod/excalidraw-assets/{gitGraphDiagram-1e960c50-6PYRBTDK.js → gitGraphDiagram-1e960c50-TZDQTV4Y.js} +1 -1
  88. package/dist/browser/prod/excalidraw-assets/image-NFLQBKBU.js +1 -0
  89. package/dist/browser/prod/excalidraw-assets/image-TGGHFJHC.css +1 -0
  90. package/dist/browser/prod/excalidraw-assets/{image-blob-reduce.esm-7C326NDW.js → image-blob-reduce.esm-NOK55Z4R.js} +1 -1
  91. package/dist/browser/prod/excalidraw-assets/{infoDiagram-264bed3e-B3RQYU4J.js → infoDiagram-264bed3e-VTVTW2PT.js} +1 -1
  92. package/dist/browser/prod/excalidraw-assets/{journeyDiagram-31be0096-SPHJ2Z6S.js → journeyDiagram-31be0096-3RXCXFNL.js} +1 -1
  93. package/dist/browser/prod/excalidraw-assets/{mindmap-definition-4fc2557c-EKE5IPT5.js → mindmap-definition-4fc2557c-U2MTITUZ.js} +1 -1
  94. package/dist/browser/prod/excalidraw-assets/{pica-WBNTBMON.js → pica-FN4U5BBA.js} +1 -1
  95. package/dist/browser/prod/excalidraw-assets/{pieDiagram-157505fe-R3GPKUOS.js → pieDiagram-157505fe-UPOKDCDE.js} +1 -1
  96. package/dist/browser/prod/excalidraw-assets/{quadrantDiagram-fd70f2d0-E6DDN2FC.js → quadrantDiagram-fd70f2d0-G6SC76BN.js} +1 -1
  97. package/dist/browser/prod/excalidraw-assets/{requirementDiagram-19c99588-EDK37RW4.js → requirementDiagram-19c99588-OPA5Q2CG.js} +1 -1
  98. package/dist/browser/prod/excalidraw-assets/{roundRect-P4IDSYXR.js → roundRect-YDYZGRTK.js} +1 -1
  99. package/dist/browser/prod/excalidraw-assets/{sequenceDiagram-5dfd0049-SDPAZI6N.js → sequenceDiagram-5dfd0049-RLLGIVI3.js} +1 -1
  100. package/dist/browser/prod/excalidraw-assets/{stateDiagram-133e3642-2GOIU2WH.js → stateDiagram-133e3642-POU4VV6D.js} +1 -1
  101. package/dist/browser/prod/excalidraw-assets/{stateDiagram-v2-6371a76b-HIFSCSY4.js → stateDiagram-v2-6371a76b-TI5DGF27.js} +1 -1
  102. package/dist/browser/prod/excalidraw-assets/{timeline-definition-5ed366f4-KTXR6TKT.js → timeline-definition-5ed366f4-RRRA7YP4.js} +1 -1
  103. package/dist/browser/prod/index.css +1 -1
  104. package/dist/browser/prod/index.js +1 -1
  105. package/dist/{prod/en-54AU74IP.json → dev/en-JBWHKG2R.json} +1 -4
  106. package/dist/dev/index.css +19 -98
  107. package/dist/dev/index.css.map +2 -2
  108. package/dist/dev/index.js +524 -863
  109. package/dist/dev/index.js.map +4 -4
  110. package/dist/excalidraw/actions/actionAddToLibrary.d.ts +0 -9
  111. package/dist/excalidraw/actions/actionBoundText.d.ts +0 -6
  112. package/dist/excalidraw/actions/actionBoundText.js +1 -4
  113. package/dist/excalidraw/actions/actionCanvas.d.ts +0 -36
  114. package/dist/excalidraw/actions/actionClipboard.d.ts +0 -21
  115. package/dist/excalidraw/actions/actionDeleteSelected.d.ts +0 -9
  116. package/dist/excalidraw/actions/actionDuplicateSelection.js +0 -4
  117. package/dist/excalidraw/actions/actionElementLock.d.ts +0 -6
  118. package/dist/excalidraw/actions/actionExport.d.ts +1 -28
  119. package/dist/excalidraw/actions/actionFinalize.d.ts +0 -6
  120. package/dist/excalidraw/actions/actionFrame.d.ts +0 -9
  121. package/dist/excalidraw/actions/actionGroup.d.ts +0 -6
  122. package/dist/excalidraw/actions/actionGroup.js +2 -4
  123. package/dist/excalidraw/actions/actionHistory.js +0 -3
  124. package/dist/excalidraw/actions/actionLinearEditor.d.ts +0 -3
  125. package/dist/excalidraw/actions/actionLink.d.ts +0 -3
  126. package/dist/excalidraw/actions/actionMenu.d.ts +0 -9
  127. package/dist/excalidraw/actions/actionNavigate.d.ts +0 -6
  128. package/dist/excalidraw/actions/actionNavigate.js +6 -15
  129. package/dist/excalidraw/actions/actionProperties.d.ts +0 -39
  130. package/dist/excalidraw/actions/actionSelectAll.d.ts +0 -3
  131. package/dist/excalidraw/actions/actionStyles.d.ts +0 -3
  132. package/dist/excalidraw/actions/actionToggleGridMode.d.ts +0 -3
  133. package/dist/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -3
  134. package/dist/excalidraw/actions/actionToggleStats.d.ts +0 -3
  135. package/dist/excalidraw/actions/actionToggleViewMode.d.ts +0 -3
  136. package/dist/excalidraw/actions/actionToggleZenMode.d.ts +0 -3
  137. package/dist/excalidraw/actions/actionZindex.d.ts +11 -11
  138. package/dist/excalidraw/clients.d.ts +1 -10
  139. package/dist/excalidraw/clients.js +6 -153
  140. package/dist/excalidraw/components/App.d.ts +3 -3
  141. package/dist/excalidraw/components/App.js +38 -20
  142. package/dist/excalidraw/components/Avatar.d.ts +3 -2
  143. package/dist/excalidraw/components/Avatar.js +5 -2
  144. package/dist/excalidraw/components/UserList.d.ts +7 -3
  145. package/dist/excalidraw/components/UserList.js +34 -63
  146. package/dist/excalidraw/components/canvases/InteractiveCanvas.js +22 -19
  147. package/dist/excalidraw/components/icons.d.ts +0 -2
  148. package/dist/excalidraw/components/icons.js +1 -3
  149. package/dist/excalidraw/constants.d.ts +3 -2
  150. package/dist/excalidraw/constants.js +3 -3
  151. package/dist/excalidraw/data/restore.d.ts +3 -3
  152. package/dist/excalidraw/data/restore.js +6 -5
  153. package/dist/excalidraw/data/transform.d.ts +1 -1
  154. package/dist/excalidraw/data/transform.js +3 -4
  155. package/dist/excalidraw/element/embeddable.d.ts +0 -3
  156. package/dist/excalidraw/element/linearElementEditor.d.ts +1 -5
  157. package/dist/excalidraw/element/newElement.d.ts +1 -1
  158. package/dist/excalidraw/element/newElement.js +1 -2
  159. package/dist/excalidraw/element/types.d.ts +2 -14
  160. package/dist/excalidraw/errors.d.ts +0 -3
  161. package/dist/excalidraw/errors.js +0 -3
  162. package/dist/excalidraw/frame.d.ts +1 -1
  163. package/dist/excalidraw/laser-trails.js +1 -1
  164. package/dist/excalidraw/locales/en.json +1 -4
  165. package/dist/excalidraw/renderer/interactiveScene.js +119 -13
  166. package/dist/excalidraw/renderer/staticScene.js +4 -5
  167. package/dist/excalidraw/scene/Scene.d.ts +6 -7
  168. package/dist/excalidraw/scene/Scene.js +13 -28
  169. package/dist/excalidraw/scene/export.js +1 -2
  170. package/dist/excalidraw/scene/types.d.ts +21 -10
  171. package/dist/excalidraw/types.d.ts +4 -7
  172. package/dist/excalidraw/utils.js +0 -3
  173. package/dist/excalidraw/zindex.d.ts +2 -2
  174. package/dist/excalidraw/zindex.js +13 -9
  175. package/dist/{dev/en-54AU74IP.json → prod/en-JBWHKG2R.json} +1 -4
  176. package/dist/prod/index.css +1 -1
  177. package/dist/prod/index.js +39 -39
  178. package/package.json +3 -4
  179. package/dist/browser/dev/excalidraw-assets-dev/chunk-FG5PX37Z.js.map +0 -7
  180. package/dist/browser/dev/excalidraw-assets-dev/dist-HOOQ44NM.js +0 -10
  181. package/dist/browser/dev/excalidraw-assets-dev/image-ZQHNSB7P.css.map +0 -7
  182. package/dist/browser/prod/excalidraw-assets/chunk-D2I3QE7U.js +0 -269
  183. package/dist/browser/prod/excalidraw-assets/dist-XTBKPFET.js +0 -1
  184. package/dist/browser/prod/excalidraw-assets/flowDiagram-v2-476db779-KLWICWG3.js +0 -1
  185. package/dist/browser/prod/excalidraw-assets/image-M662KTMJ.css +0 -1
  186. package/dist/browser/prod/excalidraw-assets/image-XP52XYUU.js +0 -1
  187. package/dist/excalidraw/data/reconcile.d.ts +0 -6
  188. package/dist/excalidraw/data/reconcile.js +0 -49
  189. package/dist/excalidraw/fractionalIndex.d.ts +0 -40
  190. package/dist/excalidraw/fractionalIndex.js +0 -241
  191. /package/dist/browser/dev/excalidraw-assets-dev/{c4Diagram-9cddb37f-5K5MMBTZ.js.map → c4Diagram-9cddb37f-Z2BVR4KG.js.map} +0 -0
  192. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-YLFK45LY.js.map → chunk-2R746FJ3.js.map} +0 -0
  193. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-HPE2QM6Z.js.map → chunk-4YGSGIMJ.js.map} +0 -0
  194. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-VJWYXZRD.js.map → chunk-A4L3DQO2.js.map} +0 -0
  195. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-LARCHXKL.js.map → chunk-CWUUGB6C.js.map} +0 -0
  196. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-PTRCE3YZ.js.map → chunk-DLCKQH3C.js.map} +0 -0
  197. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-ABU3Y4P6.js.map → chunk-IVZGHBP3.js.map} +0 -0
  198. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-VVJS3CBB.js.map → chunk-J3RT3AEL.js.map} +0 -0
  199. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-AQ5OI7FF.js.map → chunk-KN673SBB.js.map} +0 -0
  200. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-OBKV4VWD.js.map → chunk-OGN4DE2Q.js.map} +0 -0
  201. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-JRHEG4KR.js.map → chunk-P3NJMBHG.js.map} +0 -0
  202. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-UN4RKPVH.js.map → chunk-QP4L67PY.js.map} +0 -0
  203. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-AU5UG6FO.js.map → chunk-U7QYLFAH.js.map} +0 -0
  204. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-FSI24XHB.js.map → chunk-ULL4JVA4.js.map} +0 -0
  205. /package/dist/browser/dev/excalidraw-assets-dev/{chunk-RMILGNZX.js.map → chunk-WWRYLVJC.js.map} +0 -0
  206. /package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-bc733c3b-NWRL2CDH.js.map → classDiagram-bc733c3b-K5SPPM5G.js.map} +0 -0
  207. /package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-v2-8931bdaf-Y5FPX4CT.js.map → classDiagram-v2-8931bdaf-LMQ4MBCJ.js.map} +0 -0
  208. /package/dist/browser/dev/excalidraw-assets-dev/{directory-open-01563666-VWSBJ543.js.map → directory-open-01563666-HET5VGVW.js.map} +0 -0
  209. /package/dist/browser/dev/excalidraw-assets-dev/{directory-open-4ed118d0-FYNYOZXP.js.map → directory-open-4ed118d0-EEZTUAOR.js.map} +0 -0
  210. /package/dist/browser/dev/excalidraw-assets-dev/{dist-HOOQ44NM.js.map → dist-MMLCHBGE.js.map} +0 -0
  211. /package/dist/browser/dev/excalidraw-assets-dev/{en-OFPNSLTO.js.map → en-CJBKYSM5.js.map} +0 -0
  212. /package/dist/browser/dev/excalidraw-assets-dev/{erDiagram-f6946109-URHWBVQF.js.map → erDiagram-f6946109-T5ZYWW62.js.map} +0 -0
  213. /package/dist/browser/dev/excalidraw-assets-dev/{file-open-002ab408-K7UWK3UX.js.map → file-open-002ab408-2OQEKDVS.js.map} +0 -0
  214. /package/dist/browser/dev/excalidraw-assets-dev/{file-open-7c801643-PUS6AQBV.js.map → file-open-7c801643-7IDWBVQC.js.map} +0 -0
  215. /package/dist/browser/dev/excalidraw-assets-dev/{file-save-3189631c-AVBJT4K7.js.map → file-save-3189631c-D66DZOSK.js.map} +0 -0
  216. /package/dist/browser/dev/excalidraw-assets-dev/{file-save-745eba88-FCWOWXVA.js.map → file-save-745eba88-3NARDH2Z.js.map} +0 -0
  217. /package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-93327f21-ARY24FIN.js.map → flowDiagram-93327f21-OFTBRZYD.js.map} +0 -0
  218. /package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-v2-476db779-Y3LYCDLM.js.map → flowDiagram-v2-476db779-VVUICW5U.js.map} +0 -0
  219. /package/dist/browser/dev/excalidraw-assets-dev/{flowchart-elk-definition-5082a990-DTGYPOS7.js.map → flowchart-elk-definition-5082a990-KDDK5LFE.js.map} +0 -0
  220. /package/dist/browser/dev/excalidraw-assets-dev/{ganttDiagram-7ce12d6b-GWKDCJYX.js.map → ganttDiagram-7ce12d6b-XW6BLNYB.js.map} +0 -0
  221. /package/dist/browser/dev/excalidraw-assets-dev/{gitGraphDiagram-1e960c50-A4SIEE63.js.map → gitGraphDiagram-1e960c50-WAVVX7YE.js.map} +0 -0
  222. /package/dist/browser/dev/excalidraw-assets-dev/{image-J27XZPQC.js.map → image-DG6G3CCZ.js.map} +0 -0
  223. /package/dist/browser/dev/excalidraw-assets-dev/{image-blob-reduce.esm-BDWVJKFQ.js.map → image-blob-reduce.esm-OJYOZNL4.js.map} +0 -0
  224. /package/dist/browser/dev/excalidraw-assets-dev/{infoDiagram-264bed3e-AUF35UHX.js.map → infoDiagram-264bed3e-SMYVWNAJ.js.map} +0 -0
  225. /package/dist/browser/dev/excalidraw-assets-dev/{journeyDiagram-31be0096-ADAT3O42.js.map → journeyDiagram-31be0096-IXIWAKJV.js.map} +0 -0
  226. /package/dist/browser/dev/excalidraw-assets-dev/{mindmap-definition-4fc2557c-YC2LM75P.js.map → mindmap-definition-4fc2557c-H5WTPEBY.js.map} +0 -0
  227. /package/dist/browser/dev/excalidraw-assets-dev/{pica-GXUQBC7B.js.map → pica-RRHXYZO2.js.map} +0 -0
  228. /package/dist/browser/dev/excalidraw-assets-dev/{pieDiagram-157505fe-4XR6DLIZ.js.map → pieDiagram-157505fe-3LXENDEP.js.map} +0 -0
  229. /package/dist/browser/dev/excalidraw-assets-dev/{quadrantDiagram-fd70f2d0-LIR55Z6M.js.map → quadrantDiagram-fd70f2d0-CBA7LD4X.js.map} +0 -0
  230. /package/dist/browser/dev/excalidraw-assets-dev/{requirementDiagram-19c99588-NKRCRRBM.js.map → requirementDiagram-19c99588-53JLZTYM.js.map} +0 -0
  231. /package/dist/browser/dev/excalidraw-assets-dev/{roundRect-ZNZYUVWJ.js.map → roundRect-5HI6M3OA.js.map} +0 -0
  232. /package/dist/browser/dev/excalidraw-assets-dev/{sequenceDiagram-5dfd0049-VUKNRO5G.js.map → sequenceDiagram-5dfd0049-XJRLBGS7.js.map} +0 -0
  233. /package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-133e3642-3NYPG4IW.js.map → stateDiagram-133e3642-ZVPN2MPZ.js.map} +0 -0
  234. /package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-v2-6371a76b-YINZI7AG.js.map → stateDiagram-v2-6371a76b-QIW3VCSC.js.map} +0 -0
  235. /package/dist/browser/dev/excalidraw-assets-dev/{timeline-definition-5ed366f4-KWC42LPI.js.map → timeline-definition-5ed366f4-LGCWVNZT.js.map} +0 -0
package/dist/dev/index.js CHANGED
@@ -18,7 +18,7 @@ var __export = (target, all) => {
18
18
  var define_import_meta_env_default;
19
19
  var init_define_import_meta_env = __esm({
20
20
  "<define:import.meta.env>"() {
21
- define_import_meta_env_default = { VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "https://app.excalidraw.com", VITE_APP_AI_BACKEND: "http://localhost:3015", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_ENABLE_SW: "", VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_DISABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3000", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_PKG_NAME: "@excalidraw/excalidraw", VITE_PKG_VERSION: "0.5.0-bb58eff", VITE_IS_EXCALIDRAW_NPM_PACKAGE: true, DEV: true };
21
+ define_import_meta_env_default = { VITE_APP_BACKEND_V2_GET_URL: "https://json-dev.excalidraw.com/api/v2/", VITE_APP_BACKEND_V2_POST_URL: "https://json-dev.excalidraw.com/api/v2/post/", VITE_APP_LIBRARY_URL: "https://libraries.excalidraw.com", VITE_APP_LIBRARY_BACKEND: "https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries", VITE_APP_WS_SERVER_URL: "http://localhost:3002", VITE_APP_PLUS_LP: "https://plus.excalidraw.com", VITE_APP_PLUS_APP: "https://app.excalidraw.com", VITE_APP_AI_BACKEND: "http://localhost:3015", VITE_APP_FIREBASE_CONFIG: '{"apiKey":"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8","authDomain":"excalidraw-oss-dev.firebaseapp.com","projectId":"excalidraw-oss-dev","storageBucket":"excalidraw-oss-dev.appspot.com","messagingSenderId":"664559512677","appId":"1:664559512677:web:a385181f2928d328a7aa8c"}', VITE_APP_DEV_ENABLE_SW: "", VITE_APP_DEV_DISABLE_LIVE_RELOAD: "", VITE_APP_DISABLE_TRACKING: "true", FAST_REFRESH: "false", VITE_APP_PORT: "3000", VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX: "", VITE_APP_COLLAPSE_OVERLAY: "true", VITE_APP_ENABLE_ESLINT: "true", VITE_PKG_NAME: "@excalidraw/excalidraw", VITE_PKG_VERSION: "0.5.0-bcfbd91", VITE_IS_EXCALIDRAW_NPM_PACKAGE: true, DEV: true };
22
22
  }
23
23
  });
24
24
 
@@ -49,7 +49,7 @@ var init_ = __esm({
49
49
  "./locales/da-DK.json": () => import("./da-DK-WBEQB3CJ.json"),
50
50
  "./locales/de-DE.json": () => import("./de-DE-VEIMCP7R.json"),
51
51
  "./locales/el-GR.json": () => import("./el-GR-TKRKG5GQ.json"),
52
- "./locales/en.json": () => import("./en-54AU74IP.json"),
52
+ "./locales/en.json": () => import("./en-JBWHKG2R.json"),
53
53
  "./locales/es-ES.json": () => import("./es-ES-TOLWEZNW.json"),
54
54
  "./locales/eu-ES.json": () => import("./eu-ES-7CDRJQWJ.json"),
55
55
  "./locales/fa-IR.json": () => import("./fa-IR-527E2XGU.json"),
@@ -100,7 +100,7 @@ var init_ = __esm({
100
100
  });
101
101
 
102
102
  // i18n.ts
103
- import fallbackLangData from "./en-54AU74IP.json";
103
+ import fallbackLangData from "./en-JBWHKG2R.json";
104
104
  import percentages from "./percentages-UCQDHIQF.json";
105
105
  import { atom, useAtomValue } from "jotai";
106
106
  var COMPLETION_THRESHOLD, defaultLang, languages, TEST_LANG_CODE, currentLang, currentLangData, setLanguage, getLanguage, findPartsForData, t, editorLangCodeAtom, useI18n;
@@ -287,7 +287,7 @@ var init_Spinner2 = __esm({
287
287
  });
288
288
 
289
289
  // constants.ts
290
- var isDarwin, isWindows, isAndroid, isFirefox, isChrome, isSafari, isIOS, isBrave, supportsResizeObserver, APP_NAME, DRAGGING_THRESHOLD, LINE_CONFIRM_THRESHOLD, ELEMENT_SHIFT_TRANSLATE_AMOUNT, ELEMENT_TRANSLATE_AMOUNT, TEXT_TO_CENTER_SNAP_THRESHOLD, SHIFT_LOCKING_ANGLE, DEFAULT_LASER_COLOR, CURSOR_TYPE, POINTER_BUTTON, POINTER_EVENTS, YOUTUBE_STATES, ENV, CLASSES, FONT_FAMILY, THEME, FRAME_STYLE, WINDOWS_EMOJI_FALLBACK_FONT, MIN_FONT_SIZE, DEFAULT_FONT_SIZE, DEFAULT_FONT_FAMILY, DEFAULT_TEXT_ALIGN, DEFAULT_VERTICAL_ALIGN, DEFAULT_TRANSFORM_HANDLE_SPACING, DEFAULT_ZOOM_VALUE, COLOR_WHITE, COLOR_CHARCOAL_BLACK, COLOR_TRANSPARENT, COLOR_VOICE_CALL, GRID_SIZE, IMAGE_MIME_TYPES, ALLOWED_PASTE_MIME_TYPES, MIME_TYPES, EXPORT_IMAGE_TYPES, EXPORT_DATA_TYPES, EXPORT_SOURCE, IMAGE_RENDER_TIMEOUT, TAP_TWICE_TIMEOUT, TOUCH_CTX_MENU_TIMEOUT, SCROLL_TIMEOUT, ZOOM_STEP, MIN_ZOOM, HYPERLINK_TOOLTIP_DELAY, THEME_FILTER, URL_QUERY_KEYS, URL_HASH_KEYS, DEFAULT_UI_OPTIONS, MQ_MAX_WIDTH_PORTRAIT, MQ_MAX_WIDTH_LANDSCAPE, MQ_MAX_HEIGHT_LANDSCAPE, MQ_RIGHT_SIDEBAR_MIN_WIDTH, LIBRARY_SIDEBAR_WIDTH, MAX_DECIMALS_FOR_SVG_EXPORT, EXPORT_SCALES, DEFAULT_EXPORT_PADDING, DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT, MAX_ALLOWED_FILE_BYTES, SVG_NS, VERSIONS, BOUND_TEXT_PADDING, ARROW_LABEL_WIDTH_FRACTION, ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO, VERTICAL_ALIGN, TEXT_ALIGN, ELEMENT_READY_TO_ERASE_OPACITY, DEFAULT_PROPORTIONAL_RADIUS, DEFAULT_ADAPTIVE_RADIUS, ROUNDNESS, ROUGHNESS, STROKE_WIDTH, DEFAULT_ELEMENT_PROPS, LIBRARY_SIDEBAR_TAB, DEFAULT_SIDEBAR, LIBRARY_DISABLED_TYPES, TOOL_TYPE, EDITOR_LS_KEYS, DEFAULT_FILENAME;
290
+ var isDarwin, isWindows, isAndroid, isFirefox, isChrome, isSafari, isIOS, isBrave, APP_NAME, DRAGGING_THRESHOLD, LINE_CONFIRM_THRESHOLD, ELEMENT_SHIFT_TRANSLATE_AMOUNT, ELEMENT_TRANSLATE_AMOUNT, TEXT_TO_CENTER_SNAP_THRESHOLD, SHIFT_LOCKING_ANGLE, DEFAULT_LASER_COLOR, CURSOR_TYPE, POINTER_BUTTON, POINTER_EVENTS, YOUTUBE_STATES, ENV, CLASSES, FONT_FAMILY, THEME, FRAME_STYLE, WINDOWS_EMOJI_FALLBACK_FONT, MIN_FONT_SIZE, DEFAULT_FONT_SIZE, DEFAULT_FONT_FAMILY, DEFAULT_TEXT_ALIGN, DEFAULT_VERTICAL_ALIGN, DEFAULT_TRANSFORM_HANDLE_SPACING, DEFAULT_ZOOM_VALUE, COLOR_WHITE, COLOR_CHARCOAL_BLACK, COLOR_TRANSPARENT, GRID_SIZE, IMAGE_MIME_TYPES, ALLOWED_PASTE_MIME_TYPES, MIME_TYPES, EXPORT_IMAGE_TYPES, EXPORT_DATA_TYPES, EXPORT_SOURCE, IMAGE_RENDER_TIMEOUT, TAP_TWICE_TIMEOUT, TOUCH_CTX_MENU_TIMEOUT, SCROLL_TIMEOUT, ZOOM_STEP, MIN_ZOOM, HYPERLINK_TOOLTIP_DELAY, THEME_FILTER, URL_QUERY_KEYS, URL_HASH_KEYS, DEFAULT_UI_OPTIONS, MQ_MAX_WIDTH_PORTRAIT, MQ_MAX_WIDTH_LANDSCAPE, MQ_MAX_HEIGHT_LANDSCAPE, MQ_RIGHT_SIDEBAR_MIN_WIDTH, LIBRARY_SIDEBAR_WIDTH, MAX_DECIMALS_FOR_SVG_EXPORT, EXPORT_SCALES, DEFAULT_EXPORT_PADDING, DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT, MAX_ALLOWED_FILE_BYTES, SVG_NS, VERSIONS, BOUND_TEXT_PADDING, ARROW_LABEL_WIDTH_FRACTION, ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO, VERTICAL_ALIGN, TEXT_ALIGN, ELEMENT_READY_TO_ERASE_OPACITY, DEFAULT_PROPORTIONAL_RADIUS, DEFAULT_ADAPTIVE_RADIUS, ROUNDNESS, PRECEDING_ELEMENT_KEY, ROUGHNESS, STROKE_WIDTH, DEFAULT_ELEMENT_PROPS, LIBRARY_SIDEBAR_TAB, DEFAULT_SIDEBAR, LIBRARY_DISABLED_TYPES, TOOL_TYPE, EDITOR_LS_KEYS, DEFAULT_FILENAME;
291
291
  var init_constants = __esm({
292
292
  "constants.ts"() {
293
293
  "use strict";
@@ -301,7 +301,6 @@ var init_constants = __esm({
301
301
  isIOS = /iPad|iPhone/.test(navigator.platform) || // iPadOS 13+
302
302
  navigator.userAgent.includes("Mac") && "ontouchend" in document;
303
303
  isBrave = () => navigator.brave?.isBrave?.name === "isBrave";
304
- supportsResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
305
304
  APP_NAME = "Excalidraw";
306
305
  DRAGGING_THRESHOLD = 10;
307
306
  LINE_CONFIRM_THRESHOLD = 8;
@@ -383,7 +382,6 @@ var init_constants = __esm({
383
382
  COLOR_WHITE = "#ffffff";
384
383
  COLOR_CHARCOAL_BLACK = "#1e1e1e";
385
384
  COLOR_TRANSPARENT = "transparent";
386
- COLOR_VOICE_CALL = "#a2f1a6";
387
385
  GRID_SIZE = 20;
388
386
  IMAGE_MIME_TYPES = {
389
387
  svg: "image/svg+xml",
@@ -497,6 +495,7 @@ var init_constants = __esm({
497
495
  // (see DEFAULT_ADAPTIVE_RADIUS constant)
498
496
  ADAPTIVE_RADIUS: 3
499
497
  };
498
+ PRECEDING_ELEMENT_KEY = "__precedingElement__";
500
499
  ROUGHNESS = {
501
500
  architect: 0,
502
501
  artist: 1,
@@ -1061,14 +1060,6 @@ var init_utils = __esm({
1061
1060
  const aKeys = Object.keys(objA);
1062
1061
  const bKeys = Object.keys(objB);
1063
1062
  if (aKeys.length !== bKeys.length) {
1064
- if (debug) {
1065
- console.warn(
1066
- `%cisShallowEqual: objects don't have same properties ->`,
1067
- "color: #8B4000",
1068
- objA,
1069
- objB
1070
- );
1071
- }
1072
1063
  return false;
1073
1064
  }
1074
1065
  if (comparators && Array.isArray(comparators)) {
@@ -1324,202 +1315,6 @@ var init_random = __esm({
1324
1315
  }
1325
1316
  });
1326
1317
 
1327
- // errors.ts
1328
- var CanvasError, AbortError, ImageSceneDataError, InvalidFractionalIndexError;
1329
- var init_errors = __esm({
1330
- "errors.ts"() {
1331
- "use strict";
1332
- init_define_import_meta_env();
1333
- CanvasError = class extends Error {
1334
- constructor(message = "Couldn't export canvas.", name = "CANVAS_ERROR") {
1335
- super();
1336
- this.name = name;
1337
- this.message = message;
1338
- }
1339
- };
1340
- AbortError = class extends DOMException {
1341
- constructor(message = "Request Aborted") {
1342
- super(message, "AbortError");
1343
- }
1344
- };
1345
- ImageSceneDataError = class extends Error {
1346
- code;
1347
- constructor(message = "Image Scene Data Error", code = "IMAGE_SCENE_DATA_ERROR") {
1348
- super(message);
1349
- this.name = "EncodingError";
1350
- this.code = code;
1351
- }
1352
- };
1353
- InvalidFractionalIndexError = class extends Error {
1354
- code = "ELEMENT_HAS_INVALID_INDEX";
1355
- };
1356
- }
1357
- });
1358
-
1359
- // fractionalIndex.ts
1360
- import { generateNKeysBetween } from "fractional-indexing";
1361
- var validateFractionalIndices, syncMovedIndices, syncInvalidIndices, getMovedIndicesGroups, getInvalidIndicesGroups, isValidFractionalIndex, generateIndices;
1362
- var init_fractionalIndex = __esm({
1363
- "fractionalIndex.ts"() {
1364
- "use strict";
1365
- init_define_import_meta_env();
1366
- init_mutateElement();
1367
- init_errors();
1368
- validateFractionalIndices = (indices) => {
1369
- for (const [i, index] of indices.entries()) {
1370
- const predecessorIndex = indices[i - 1];
1371
- const successorIndex = indices[i + 1];
1372
- if (!isValidFractionalIndex(index, predecessorIndex, successorIndex)) {
1373
- throw new InvalidFractionalIndexError(
1374
- `Fractional indices invariant for element has been compromised - ["${predecessorIndex}", "${index}", "${successorIndex}"] [predecessor, current, successor]`
1375
- );
1376
- }
1377
- }
1378
- };
1379
- syncMovedIndices = (elements, movedElements) => {
1380
- try {
1381
- const indicesGroups = getMovedIndicesGroups(elements, movedElements);
1382
- const elementsUpdates = generateIndices(elements, indicesGroups);
1383
- validateFractionalIndices(
1384
- elements.map((x) => elementsUpdates.get(x)?.index || x.index)
1385
- );
1386
- for (const [element, update] of elementsUpdates) {
1387
- mutateElement(element, update, false);
1388
- }
1389
- } catch (e) {
1390
- syncInvalidIndices(elements);
1391
- }
1392
- return elements;
1393
- };
1394
- syncInvalidIndices = (elements) => {
1395
- const indicesGroups = getInvalidIndicesGroups(elements);
1396
- const elementsUpdates = generateIndices(elements, indicesGroups);
1397
- for (const [element, update] of elementsUpdates) {
1398
- mutateElement(element, update, false);
1399
- }
1400
- return elements;
1401
- };
1402
- getMovedIndicesGroups = (elements, movedElements) => {
1403
- const indicesGroups = [];
1404
- let i = 0;
1405
- while (i < elements.length) {
1406
- if (movedElements.has(elements[i].id) && !isValidFractionalIndex(
1407
- elements[i]?.index,
1408
- elements[i - 1]?.index,
1409
- elements[i + 1]?.index
1410
- )) {
1411
- const indicesGroup = [i - 1, i];
1412
- while (++i < elements.length) {
1413
- if (!(movedElements.has(elements[i].id) && !isValidFractionalIndex(
1414
- elements[i]?.index,
1415
- elements[i - 1]?.index,
1416
- elements[i + 1]?.index
1417
- ))) {
1418
- break;
1419
- }
1420
- indicesGroup.push(i);
1421
- }
1422
- indicesGroup.push(i);
1423
- indicesGroups.push(indicesGroup);
1424
- } else {
1425
- i++;
1426
- }
1427
- }
1428
- return indicesGroups;
1429
- };
1430
- getInvalidIndicesGroups = (elements) => {
1431
- const indicesGroups = [];
1432
- let lowerBound = void 0;
1433
- let upperBound = void 0;
1434
- let lowerBoundIndex = -1;
1435
- let upperBoundIndex = 0;
1436
- const getLowerBound = (index) => {
1437
- const lowerBound2 = elements[lowerBoundIndex] ? elements[lowerBoundIndex].index : void 0;
1438
- const candidate = elements[index - 1]?.index;
1439
- if (!lowerBound2 && candidate || // first lowerBound
1440
- lowerBound2 && candidate && candidate > lowerBound2) {
1441
- return [candidate, index - 1];
1442
- }
1443
- return [lowerBound2, lowerBoundIndex];
1444
- };
1445
- const getUpperBound = (index) => {
1446
- const upperBound2 = elements[upperBoundIndex] ? elements[upperBoundIndex].index : void 0;
1447
- if (upperBound2 && index < upperBoundIndex) {
1448
- return [upperBound2, upperBoundIndex];
1449
- }
1450
- let i2 = upperBoundIndex;
1451
- while (++i2 < elements.length) {
1452
- const candidate = elements[i2]?.index;
1453
- if (!upperBound2 && candidate || // first upperBound
1454
- upperBound2 && candidate && candidate > upperBound2) {
1455
- return [candidate, i2];
1456
- }
1457
- }
1458
- return [void 0, i2];
1459
- };
1460
- let i = 0;
1461
- while (i < elements.length) {
1462
- const current = elements[i].index;
1463
- [lowerBound, lowerBoundIndex] = getLowerBound(i);
1464
- [upperBound, upperBoundIndex] = getUpperBound(i);
1465
- if (!isValidFractionalIndex(current, lowerBound, upperBound)) {
1466
- const indicesGroup = [lowerBoundIndex, i];
1467
- while (++i < elements.length) {
1468
- const current2 = elements[i].index;
1469
- const [nextLowerBound, nextLowerBoundIndex] = getLowerBound(i);
1470
- const [nextUpperBound, nextUpperBoundIndex] = getUpperBound(i);
1471
- if (isValidFractionalIndex(current2, nextLowerBound, nextUpperBound)) {
1472
- break;
1473
- }
1474
- [lowerBound, lowerBoundIndex] = [nextLowerBound, nextLowerBoundIndex];
1475
- [upperBound, upperBoundIndex] = [nextUpperBound, nextUpperBoundIndex];
1476
- indicesGroup.push(i);
1477
- }
1478
- indicesGroup.push(upperBoundIndex);
1479
- indicesGroups.push(indicesGroup);
1480
- } else {
1481
- i++;
1482
- }
1483
- }
1484
- return indicesGroups;
1485
- };
1486
- isValidFractionalIndex = (index, predecessor, successor) => {
1487
- if (!index) {
1488
- return false;
1489
- }
1490
- if (predecessor && successor) {
1491
- return predecessor < index && index < successor;
1492
- }
1493
- if (!predecessor && successor) {
1494
- return index < successor;
1495
- }
1496
- if (predecessor && !successor) {
1497
- return predecessor < index;
1498
- }
1499
- return !!index;
1500
- };
1501
- generateIndices = (elements, indicesGroups) => {
1502
- const elementsUpdates = /* @__PURE__ */ new Map();
1503
- for (const indices of indicesGroups) {
1504
- const lowerBoundIndex = indices.shift();
1505
- const upperBoundIndex = indices.pop();
1506
- const fractionalIndices = generateNKeysBetween(
1507
- elements[lowerBoundIndex]?.index,
1508
- elements[upperBoundIndex]?.index,
1509
- indices.length
1510
- );
1511
- for (let i = 0; i < indices.length; i++) {
1512
- const element = elements[indices[i]];
1513
- elementsUpdates.set(element, {
1514
- index: fractionalIndices[i]
1515
- });
1516
- }
1517
- }
1518
- return elementsUpdates;
1519
- };
1520
- }
1521
- });
1522
-
1523
1318
  // scene/Scene.ts
1524
1319
  var getNonDeletedElements, hashSelectionOpts, isIdKey, Scene, Scene_default;
1525
1320
  var init_Scene = __esm({
@@ -1530,20 +1325,14 @@ var init_Scene = __esm({
1530
1325
  init_typeChecks();
1531
1326
  init_selection();
1532
1327
  init_random();
1533
- init_fractionalIndex();
1534
- init_utils();
1535
1328
  init_utils();
1536
- init_constants();
1537
1329
  getNonDeletedElements = (allElements) => {
1538
1330
  const elementsMap = /* @__PURE__ */ new Map();
1539
1331
  const elements = [];
1540
1332
  for (const element of allElements) {
1541
1333
  if (!element.isDeleted) {
1542
1334
  elements.push(element);
1543
- elementsMap.set(
1544
- element.id,
1545
- element
1546
- );
1335
+ elementsMap.set(element.id, element);
1547
1336
  }
1548
1337
  }
1549
1338
  return { elementsMap, elements };
@@ -1590,7 +1379,6 @@ var init_Scene = __esm({
1590
1379
  nonDeletedElementsMap = toBrandedType(
1591
1380
  /* @__PURE__ */ new Map()
1592
1381
  );
1593
- // ideally all elements within the scene should be wrapped around with `Ordered` type, but right now there is no real benefit doing so
1594
1382
  elements = [];
1595
1383
  nonDeletedFramesLikes = [];
1596
1384
  frames = [];
@@ -1682,15 +1470,9 @@ var init_Scene = __esm({
1682
1470
  return didChange;
1683
1471
  }
1684
1472
  replaceAllElements(nextElements) {
1685
- const _nextElements = (
1686
- // ts doesn't like `Array.isArray` of `instanceof Map`
1687
- nextElements instanceof Array ? nextElements : Array.from(nextElements.values())
1688
- );
1473
+ this.elements = // ts doesn't like `Array.isArray` of `instanceof Map`
1474
+ nextElements instanceof Array ? nextElements : Array.from(nextElements.values());
1689
1475
  const nextFrameLikes = [];
1690
- if (define_import_meta_env_default.DEV || define_import_meta_env_default.MODE === ENV.TEST) {
1691
- validateFractionalIndices(_nextElements.map((x) => x.index));
1692
- }
1693
- this.elements = syncInvalidIndices(_nextElements);
1694
1476
  this.elementsMap.clear();
1695
1477
  this.elements.forEach((element) => {
1696
1478
  if (isFrameLikeElement(element)) {
@@ -1725,8 +1507,8 @@ var init_Scene = __esm({
1725
1507
  };
1726
1508
  }
1727
1509
  destroy() {
1728
- this.elements = [];
1729
1510
  this.nonDeletedElements = [];
1511
+ this.elements = [];
1730
1512
  this.nonDeletedFramesLikes = [];
1731
1513
  this.frames = [];
1732
1514
  this.elementsMap.clear();
@@ -1751,7 +1533,6 @@ var init_Scene = __esm({
1751
1533
  element,
1752
1534
  ...this.elements.slice(index)
1753
1535
  ];
1754
- syncMovedIndices(nextElements, arrayToMap([element]));
1755
1536
  this.replaceAllElements(nextElements);
1756
1537
  }
1757
1538
  insertElementsAtIndex(elements, index) {
@@ -1765,16 +1546,14 @@ var init_Scene = __esm({
1765
1546
  ...elements,
1766
1547
  ...this.elements.slice(index)
1767
1548
  ];
1768
- syncMovedIndices(nextElements, arrayToMap(elements));
1769
1549
  this.replaceAllElements(nextElements);
1770
1550
  }
1771
- insertElement = (element) => {
1772
- const index = element.frameId ? this.getElementIndex(element.frameId) : this.elements.length;
1773
- this.insertElementAtIndex(element, index);
1774
- };
1775
- insertElements = (elements) => {
1776
- const index = elements[0].frameId ? this.getElementIndex(elements[0].frameId) : this.elements.length;
1777
- this.insertElementsAtIndex(elements, index);
1551
+ addNewElement = (element) => {
1552
+ if (element.frameId) {
1553
+ this.insertElementAtIndex(element, this.getElementIndex(element.frameId));
1554
+ } else {
1555
+ this.replaceAllElements([...this.elements, element]);
1556
+ }
1778
1557
  };
1779
1558
  getElementIndex(elementId) {
1780
1559
  return this.elements.findIndex((element) => element.id === elementId);
@@ -7304,7 +7083,6 @@ var init_newElement = __esm({
7304
7083
  angle = 0,
7305
7084
  groupIds = [],
7306
7085
  frameId = null,
7307
- index = null,
7308
7086
  roundness = null,
7309
7087
  boundElements = null,
7310
7088
  link = null,
@@ -7328,7 +7106,6 @@ var init_newElement = __esm({
7328
7106
  opacity,
7329
7107
  groupIds,
7330
7108
  frameId,
7331
- index,
7332
7109
  roundness,
7333
7110
  seed: rest.seed ?? randomInteger(),
7334
7111
  version: rest.version || 1,
@@ -8452,6 +8229,35 @@ var init_staticSvgScene = __esm({
8452
8229
  }
8453
8230
  });
8454
8231
 
8232
+ // errors.ts
8233
+ var CanvasError, AbortError, ImageSceneDataError;
8234
+ var init_errors = __esm({
8235
+ "errors.ts"() {
8236
+ "use strict";
8237
+ init_define_import_meta_env();
8238
+ CanvasError = class extends Error {
8239
+ constructor(message = "Couldn't export canvas.", name = "CANVAS_ERROR") {
8240
+ super();
8241
+ this.name = name;
8242
+ this.message = message;
8243
+ }
8244
+ };
8245
+ AbortError = class extends DOMException {
8246
+ constructor(message = "Request Aborted") {
8247
+ super(message, "AbortError");
8248
+ }
8249
+ };
8250
+ ImageSceneDataError = class extends Error {
8251
+ code;
8252
+ constructor(message = "Image Scene Data Error", code = "IMAGE_SCENE_DATA_ERROR") {
8253
+ super(message);
8254
+ this.name = "EncodingError";
8255
+ this.code = code;
8256
+ }
8257
+ };
8258
+ }
8259
+ });
8260
+
8455
8261
  // data/filesystem.ts
8456
8262
  import {
8457
8263
  fileOpen as _fileOpen,
@@ -8548,7 +8354,6 @@ var init_restore = __esm({
8548
8354
  init_utils();
8549
8355
  init_textElement();
8550
8356
  init_url();
8551
- init_fractionalIndex();
8552
8357
  AllowedExcalidrawActiveTools = {
8553
8358
  selection: true,
8554
8359
  text: true,
@@ -8586,7 +8391,6 @@ var init_restore = __esm({
8586
8391
  // newly added elements
8587
8392
  version: element.version || 1,
8588
8393
  versionNonce: element.versionNonce ?? 0,
8589
- index: element.index ?? null,
8590
8394
  isDeleted: element.isDeleted ?? false,
8591
8395
  id: element.id || randomId(),
8592
8396
  fillStyle: element.fillStyle || DEFAULT_ELEMENT_PROPS.fillStyle,
@@ -8617,6 +8421,9 @@ var init_restore = __esm({
8617
8421
  if ("customData" in element || "customData" in extra) {
8618
8422
  base.customData = "customData" in extra ? extra.customData : element.customData;
8619
8423
  }
8424
+ if (PRECEDING_ELEMENT_KEY in element) {
8425
+ base[PRECEDING_ELEMENT_KEY] = element[PRECEDING_ELEMENT_KEY];
8426
+ }
8620
8427
  return {
8621
8428
  ...base,
8622
8429
  ...getNormalizedDimensions(base),
@@ -8767,28 +8574,23 @@ var init_restore = __esm({
8767
8574
  restoreElements = (elements, localElements, opts) => {
8768
8575
  const existingIds = /* @__PURE__ */ new Set();
8769
8576
  const localElementsMap = localElements ? arrayToMap(localElements) : null;
8770
- const restoredElements = syncInvalidIndices(
8771
- (elements || []).reduce((elements2, element) => {
8772
- if (element.type !== "selection" && !isInvisiblySmallElement(element)) {
8773
- let migratedElement = restoreElement(element);
8774
- if (migratedElement) {
8775
- const localElement = localElementsMap?.get(element.id);
8776
- if (localElement && localElement.version > migratedElement.version) {
8777
- migratedElement = bumpVersion(
8778
- migratedElement,
8779
- localElement.version
8780
- );
8781
- }
8782
- if (existingIds.has(migratedElement.id)) {
8783
- migratedElement = { ...migratedElement, id: randomId() };
8784
- }
8785
- existingIds.add(migratedElement.id);
8786
- elements2.push(migratedElement);
8577
+ const restoredElements = (elements || []).reduce((elements2, element) => {
8578
+ if (element.type !== "selection" && !isInvisiblySmallElement(element)) {
8579
+ let migratedElement = restoreElement(element);
8580
+ if (migratedElement) {
8581
+ const localElement = localElementsMap?.get(element.id);
8582
+ if (localElement && localElement.version > migratedElement.version) {
8583
+ migratedElement = bumpVersion(migratedElement, localElement.version);
8584
+ }
8585
+ if (existingIds.has(migratedElement.id)) {
8586
+ migratedElement = { ...migratedElement, id: randomId() };
8787
8587
  }
8588
+ existingIds.add(migratedElement.id);
8589
+ elements2.push(migratedElement);
8788
8590
  }
8789
- return elements2;
8790
- }, [])
8791
- );
8591
+ }
8592
+ return elements2;
8593
+ }, []);
8792
8594
  if (!opts?.repairBindings) {
8793
8595
  return restoredElements;
8794
8596
  }
@@ -9794,11 +9596,10 @@ var init_staticScene = __esm({
9794
9596
  init_utils();
9795
9597
  strokeGrid = (context, gridSize, scrollX, scrollY, zoom, width, height) => {
9796
9598
  const BOLD_LINE_FREQUENCY = 5;
9797
- let GridLineColor;
9798
- ((GridLineColor2) => {
9799
- GridLineColor2["Bold"] = "#cccccc";
9800
- GridLineColor2["Regular"] = "#e5e5e5";
9801
- })(GridLineColor || (GridLineColor = {}));
9599
+ const GridLineColor = {
9600
+ Bold: "#cccccc",
9601
+ Regular: "#e5e5e5"
9602
+ };
9802
9603
  const offsetX = -Math.round(zoom.value / gridSize) * gridSize + scrollX % gridSize;
9803
9604
  const offsetY = -Math.round(zoom.value / gridSize) * gridSize + scrollY % gridSize;
9804
9605
  const lineWidth = Math.min(1 / zoom.value, 1);
@@ -9810,7 +9611,7 @@ var init_staticScene = __esm({
9810
9611
  const isBold = Math.round(x - scrollX) % (BOLD_LINE_FREQUENCY * gridSize) === 0;
9811
9612
  context.beginPath();
9812
9613
  context.setLineDash(isBold ? [] : lineDash);
9813
- context.strokeStyle = isBold ? "#cccccc" /* Bold */ : "#e5e5e5" /* Regular */;
9614
+ context.strokeStyle = isBold ? GridLineColor.Bold : GridLineColor.Regular;
9814
9615
  context.moveTo(x, offsetY - gridSize);
9815
9616
  context.lineTo(x, offsetY + height + gridSize * 2);
9816
9617
  context.stroke();
@@ -9819,7 +9620,7 @@ var init_staticScene = __esm({
9819
9620
  const isBold = Math.round(y - scrollY) % (BOLD_LINE_FREQUENCY * gridSize) === 0;
9820
9621
  context.beginPath();
9821
9622
  context.setLineDash(isBold ? [] : lineDash);
9822
- context.strokeStyle = isBold ? "#cccccc" /* Bold */ : "#e5e5e5" /* Regular */;
9623
+ context.strokeStyle = isBold ? GridLineColor.Bold : GridLineColor.Regular;
9823
9624
  context.moveTo(offsetX - gridSize, y);
9824
9625
  context.lineTo(offsetX + width + gridSize * 2, y);
9825
9626
  context.stroke();
@@ -10060,7 +9861,6 @@ var init_export = __esm({
10060
9861
  init_element();
10061
9862
  init_mutateElement();
10062
9863
  init_typeChecks();
10063
- init_fractionalIndex();
10064
9864
  init_staticScene();
10065
9865
  SVG_EXPORT_TAG = `<!-- svg-source:excalidraw -->`;
10066
9866
  truncateText = (element, maxWidth) => {
@@ -10297,7 +10097,7 @@ var init_export = __esm({
10297
10097
  arrayToMap(elementsForRender)
10298
10098
  ),
10299
10099
  allElementsMap: toBrandedType(
10300
- arrayToMap(syncInvalidIndices(elements))
10100
+ arrayToMap(elements)
10301
10101
  ),
10302
10102
  visibleElements: elementsForRender,
10303
10103
  appState: {
@@ -14316,8 +14116,6 @@ __export(icons_exports, {
14316
14116
  laserPointerToolIcon: () => laserPointerToolIcon,
14317
14117
  menu: () => menu,
14318
14118
  mermaidLogoIcon: () => mermaidLogoIcon,
14319
- microphoneIcon: () => microphoneIcon,
14320
- microphoneMutedIcon: () => microphoneMutedIcon,
14321
14119
  palette: () => palette,
14322
14120
  playerPlayIcon: () => playerPlayIcon,
14323
14121
  playerStopFilledIcon: () => playerStopFilledIcon,
@@ -14343,7 +14141,7 @@ import React4 from "react";
14343
14141
  import oc2 from "open-color";
14344
14142
  import clsx3 from "clsx";
14345
14143
  import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
14346
- var iconFillColor, handlerColor, createIcon, tablerIconProps, modifiedTablerIconProps, HomeIcon, LibraryIcon, PlusIcon, DotsIcon, PinIcon, UnlockedIcon, LockedIcon, WelcomeScreenMenuArrow, WelcomeScreenHelpArrow, WelcomeScreenTopToolbarArrow, ExcalLogo, SelectionIcon, RectangleIcon, DiamondIcon, EllipseIcon, ArrowIcon, LineIcon, PenModeIcon, FreedrawIcon, TextIcon, ImageIcon, EraserIcon, ZoomInIcon, ZoomOutIcon, TrashIcon, EmbedIcon, DuplicateIcon, MoonIcon, SunIcon, HamburgerMenuIcon, ExportIcon, HelpIcon, ExternalLinkIcon, GithubIcon, DiscordIcon, XBrandIcon, checkIcon, LinkIcon, save, saveAs, LoadIcon, clipboard, palette, ExportImageIcon, exportToFileIcon, zoomIn, zoomOut, done, menu, UndoIcon, RedoIcon, questionCircle, share, warning, shareIOS, shareWindows, resetZoom, BringForwardIcon, SendBackwardIcon, BringToFrontIcon, SendToBackIcon, AlignTopIcon, AlignBottomIcon, AlignLeftIcon, AlignRightIcon, DistributeHorizontallyIcon, DistributeVerticallyIcon, CenterVerticallyIcon, CenterHorizontallyIcon, usersIcon, start, stop, CloseIcon, back, clone, shield, file, GroupIcon, UngroupIcon, FillZigZagIcon, FillHachureIcon, FillCrossHatchIcon, FillSolidIcon, StrokeWidthBaseIcon, StrokeWidthBoldIcon, StrokeWidthExtraBoldIcon, StrokeStyleSolidIcon, StrokeStyleDashedIcon, StrokeStyleDottedIcon, SloppinessArchitectIcon, SloppinessArtistIcon, SloppinessCartoonistIcon, EdgeSharpIcon, EdgeRoundIcon, ArrowheadNoneIcon, ArrowheadArrowIcon, ArrowheadCircleIcon, ArrowheadCircleOutlineIcon, ArrowheadBarIcon, ArrowheadTriangleIcon, ArrowheadTriangleOutlineIcon, ArrowheadDiamondIcon, ArrowheadDiamondOutlineIcon, FontSizeSmallIcon, FontSizeMediumIcon, FontSizeLargeIcon, FontSizeExtraLargeIcon, FontFamilyNormalIcon, FontFamilyCodeIcon, TextAlignLeftIcon, TextAlignCenterIcon, TextAlignRightIcon, TextAlignTopIcon, TextAlignBottomIcon, TextAlignMiddleIcon, publishIcon, eraser, handIcon, downloadIcon, copyIcon, helpIcon, playerPlayIcon, playerStopFilledIcon, tablerCheckIcon, alertTriangleIcon, eyeDropperIcon, extraToolsIcon, frameToolIcon, mermaidLogoIcon, ArrowRightIcon, laserPointerToolIcon, MagicIcon, OpenAIIcon, fullscreenIcon, eyeIcon, eyeClosedIcon, brainIcon, searchIcon, microphoneIcon, microphoneMutedIcon;
14144
+ var iconFillColor, handlerColor, createIcon, tablerIconProps, modifiedTablerIconProps, HomeIcon, LibraryIcon, PlusIcon, DotsIcon, PinIcon, UnlockedIcon, LockedIcon, WelcomeScreenMenuArrow, WelcomeScreenHelpArrow, WelcomeScreenTopToolbarArrow, ExcalLogo, SelectionIcon, RectangleIcon, DiamondIcon, EllipseIcon, ArrowIcon, LineIcon, PenModeIcon, FreedrawIcon, TextIcon, ImageIcon, EraserIcon, ZoomInIcon, ZoomOutIcon, TrashIcon, EmbedIcon, DuplicateIcon, MoonIcon, SunIcon, HamburgerMenuIcon, ExportIcon, HelpIcon, ExternalLinkIcon, GithubIcon, DiscordIcon, XBrandIcon, checkIcon, LinkIcon, save, saveAs, LoadIcon, clipboard, palette, ExportImageIcon, exportToFileIcon, zoomIn, zoomOut, done, menu, UndoIcon, RedoIcon, questionCircle, share, warning, shareIOS, shareWindows, resetZoom, BringForwardIcon, SendBackwardIcon, BringToFrontIcon, SendToBackIcon, AlignTopIcon, AlignBottomIcon, AlignLeftIcon, AlignRightIcon, DistributeHorizontallyIcon, DistributeVerticallyIcon, CenterVerticallyIcon, CenterHorizontallyIcon, usersIcon, start, stop, CloseIcon, back, clone, shield, file, GroupIcon, UngroupIcon, FillZigZagIcon, FillHachureIcon, FillCrossHatchIcon, FillSolidIcon, StrokeWidthBaseIcon, StrokeWidthBoldIcon, StrokeWidthExtraBoldIcon, StrokeStyleSolidIcon, StrokeStyleDashedIcon, StrokeStyleDottedIcon, SloppinessArchitectIcon, SloppinessArtistIcon, SloppinessCartoonistIcon, EdgeSharpIcon, EdgeRoundIcon, ArrowheadNoneIcon, ArrowheadArrowIcon, ArrowheadCircleIcon, ArrowheadCircleOutlineIcon, ArrowheadBarIcon, ArrowheadTriangleIcon, ArrowheadTriangleOutlineIcon, ArrowheadDiamondIcon, ArrowheadDiamondOutlineIcon, FontSizeSmallIcon, FontSizeMediumIcon, FontSizeLargeIcon, FontSizeExtraLargeIcon, FontFamilyNormalIcon, FontFamilyCodeIcon, TextAlignLeftIcon, TextAlignCenterIcon, TextAlignRightIcon, TextAlignTopIcon, TextAlignBottomIcon, TextAlignMiddleIcon, publishIcon, eraser, handIcon, downloadIcon, copyIcon, helpIcon, playerPlayIcon, playerStopFilledIcon, tablerCheckIcon, alertTriangleIcon, eyeDropperIcon, extraToolsIcon, frameToolIcon, mermaidLogoIcon, ArrowRightIcon, laserPointerToolIcon, MagicIcon, OpenAIIcon, fullscreenIcon, eyeIcon, eyeClosedIcon, brainIcon, searchIcon;
14347
14145
  var init_icons = __esm({
14348
14146
  "components/icons.tsx"() {
14349
14147
  "use strict";
@@ -16134,7 +15932,7 @@ var init_icons = __esm({
16134
15932
  tablerIconProps
16135
15933
  );
16136
15934
  eyeIcon = createIcon(
16137
- /* @__PURE__ */ jsxs3("g", { stroke: "currentColor", fill: "none", strokeWidth: 1.5, children: [
15935
+ /* @__PURE__ */ jsxs3("g", { stroke: "currentColor", fill: "none", children: [
16138
15936
  /* @__PURE__ */ jsx5("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
16139
15937
  /* @__PURE__ */ jsx5("path", { d: "M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" }),
16140
15938
  /* @__PURE__ */ jsx5("path", { d: "M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6" })
@@ -16170,27 +15968,6 @@ var init_icons = __esm({
16170
15968
  ] }),
16171
15969
  tablerIconProps
16172
15970
  );
16173
- microphoneIcon = createIcon(
16174
- /* @__PURE__ */ jsxs3("g", { strokeWidth: 1.5, children: [
16175
- /* @__PURE__ */ jsx5("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
16176
- /* @__PURE__ */ jsx5("path", { d: "M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z" }),
16177
- /* @__PURE__ */ jsx5("path", { d: "M5 10a7 7 0 0 0 14 0" }),
16178
- /* @__PURE__ */ jsx5("path", { d: "M8 21l8 0" }),
16179
- /* @__PURE__ */ jsx5("path", { d: "M12 17l0 4" })
16180
- ] }),
16181
- tablerIconProps
16182
- );
16183
- microphoneMutedIcon = createIcon(
16184
- /* @__PURE__ */ jsxs3("g", { strokeWidth: 1.5, children: [
16185
- /* @__PURE__ */ jsx5("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
16186
- /* @__PURE__ */ jsx5("path", { d: "M3 3l18 18" }),
16187
- /* @__PURE__ */ jsx5("path", { d: "M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1" }),
16188
- /* @__PURE__ */ jsx5("path", { d: "M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85" }),
16189
- /* @__PURE__ */ jsx5("path", { d: "M8 21l8 0" }),
16190
- /* @__PURE__ */ jsx5("path", { d: "M12 17l0 4" })
16191
- ] }),
16192
- tablerIconProps
16193
- );
16194
15971
  }
16195
15972
  });
16196
15973
 
@@ -16408,8 +16185,8 @@ var init_zindex = __esm({
16408
16185
  "zindex.ts"() {
16409
16186
  "use strict";
16410
16187
  init_define_import_meta_env();
16188
+ init_mutateElement();
16411
16189
  init_typeChecks();
16412
- init_fractionalIndex();
16413
16190
  init_groups();
16414
16191
  init_scene();
16415
16192
  init_Scene();
@@ -16554,9 +16331,9 @@ var init_zindex = __esm({
16554
16331
  getTargetElementsMap = (elements, indices) => {
16555
16332
  return indices.reduce((acc, index) => {
16556
16333
  const element = elements[index];
16557
- acc.set(element.id, element);
16334
+ acc[element.id] = element;
16558
16335
  return acc;
16559
- }, /* @__PURE__ */ new Map());
16336
+ }, {});
16560
16337
  };
16561
16338
  shiftElementsByOne = (elements, appState, direction) => {
16562
16339
  const indicesToMove = getIndicesToMove(elements, appState);
@@ -16602,8 +16379,12 @@ var init_zindex = __esm({
16602
16379
  ...trailingElements
16603
16380
  ];
16604
16381
  });
16605
- syncMovedIndices(elements, targetElementsMap);
16606
- return elements;
16382
+ return elements.map((element) => {
16383
+ if (targetElementsMap[element.id]) {
16384
+ return bumpVersion(element);
16385
+ }
16386
+ return element;
16387
+ });
16607
16388
  };
16608
16389
  shiftElementsToEnd = (elements, appState, direction, containingFrame, elementsToBeMoved) => {
16609
16390
  const indicesToMove = getIndicesToMove(elements, appState, elementsToBeMoved);
@@ -16658,10 +16439,12 @@ var init_zindex = __esm({
16658
16439
  displacedElements.push(elements[index]);
16659
16440
  }
16660
16441
  }
16661
- const targetElements = Array.from(targetElementsMap.values());
16442
+ const targetElements = Object.values(targetElementsMap).map((element) => {
16443
+ return bumpVersion(element);
16444
+ });
16662
16445
  const leadingElements = elements.slice(0, leadingIndex);
16663
16446
  const trailingElements = elements.slice(trailingIndex + 1);
16664
- const nextElements = direction === "left" ? [
16447
+ return direction === "left" ? [
16665
16448
  ...leadingElements,
16666
16449
  ...targetElements,
16667
16450
  ...displacedElements,
@@ -16672,8 +16455,6 @@ var init_zindex = __esm({
16672
16455
  ...targetElements,
16673
16456
  ...trailingElements
16674
16457
  ];
16675
- syncMovedIndices(nextElements, targetElementsMap);
16676
- return nextElements;
16677
16458
  };
16678
16459
  moveOneLeft = (allElements, appState) => {
16679
16460
  return shiftElementsByOne(allElements, appState, "left");
@@ -16983,7 +16764,6 @@ var init_actionDuplicateSelection = __esm({
16983
16764
  init_icons();
16984
16765
  init_frame();
16985
16766
  init_selection();
16986
- init_fractionalIndex();
16987
16767
  actionDuplicateSelection = register({
16988
16768
  name: "duplicateSelection",
16989
16769
  trackEvent: { category: "element" },
@@ -17030,7 +16810,6 @@ var init_actionDuplicateSelection = __esm({
17030
16810
  const newElements = [];
17031
16811
  const oldElements = [];
17032
16812
  const oldIdToDuplicatedId = /* @__PURE__ */ new Map();
17033
- const duplicatedElementsMap = /* @__PURE__ */ new Map();
17034
16813
  const duplicateAndOffsetElement = (element) => {
17035
16814
  const newElement2 = duplicateElement(
17036
16815
  appState.editingGroupId,
@@ -17041,7 +16820,6 @@ var init_actionDuplicateSelection = __esm({
17041
16820
  y: element.y + GRID_SIZE / 2
17042
16821
  }
17043
16822
  );
17044
- duplicatedElementsMap.set(newElement2.id, newElement2);
17045
16823
  oldIdToDuplicatedId.set(element.id, newElement2.id);
17046
16824
  oldElements.push(element);
17047
16825
  newElements.push(newElement2);
@@ -17133,7 +16911,6 @@ var init_actionDuplicateSelection = __esm({
17133
16911
  }
17134
16912
  }
17135
16913
  const finalElements = finalElementsReversed.reverse();
17136
- syncMovedIndices(finalElements, arrayToMap([...oldElements, ...newElements]));
17137
16914
  bindTextToShapeAfterDuplication(
17138
16915
  elementsWithClones,
17139
16916
  oldElements,
@@ -21526,7 +21303,6 @@ var init_actionGroup = __esm({
21526
21303
  init_ToolButton();
21527
21304
  init_typeChecks();
21528
21305
  init_frame();
21529
- init_fractionalIndex();
21530
21306
  allElementsInSameGroup = (elements) => {
21531
21307
  if (elements.length >= 2) {
21532
21308
  const groupIds = elements[0].groupIds;
@@ -21610,12 +21386,11 @@ var init_actionGroup = __esm({
21610
21386
  const elementsBeforeGroup = nextElements.slice(0, lastGroupElementIndex).filter(
21611
21387
  (updatedElement) => !isElementInGroup(updatedElement, newGroupId)
21612
21388
  );
21613
- const reorderedElements = [
21389
+ nextElements = [
21614
21390
  ...elementsBeforeGroup,
21615
21391
  ...elementsInGroup,
21616
21392
  ...elementsAfterGroup
21617
21393
  ];
21618
- syncMovedIndices(reorderedElements, arrayToMap(elementsInGroup));
21619
21394
  return {
21620
21395
  appState: {
21621
21396
  ...appState,
@@ -21625,7 +21400,7 @@ var init_actionGroup = __esm({
21625
21400
  getNonDeletedElements3(nextElements)
21626
21401
  )
21627
21402
  },
21628
- elements: reorderedElements,
21403
+ elements: nextElements,
21629
21404
  commitToHistory: true
21630
21405
  };
21631
21406
  },
@@ -21735,46 +21510,6 @@ var init_actionGroup = __esm({
21735
21510
  }
21736
21511
  });
21737
21512
 
21738
- // renderer/roundRect.ts
21739
- var roundRect;
21740
- var init_roundRect = __esm({
21741
- "renderer/roundRect.ts"() {
21742
- "use strict";
21743
- init_define_import_meta_env();
21744
- roundRect = (context, x, y, width, height, radius, strokeColor) => {
21745
- context.beginPath();
21746
- context.moveTo(x + radius, y);
21747
- context.lineTo(x + width - radius, y);
21748
- context.quadraticCurveTo(x + width, y, x + width, y + radius);
21749
- context.lineTo(x + width, y + height - radius);
21750
- context.quadraticCurveTo(
21751
- x + width,
21752
- y + height,
21753
- x + width - radius,
21754
- y + height
21755
- );
21756
- context.lineTo(x + radius, y + height);
21757
- context.quadraticCurveTo(x, y + height, x, y + height - radius);
21758
- context.lineTo(x, y + radius);
21759
- context.quadraticCurveTo(x, y, x + radius, y);
21760
- context.closePath();
21761
- context.fill();
21762
- if (strokeColor) {
21763
- context.strokeStyle = strokeColor;
21764
- }
21765
- context.stroke();
21766
- };
21767
- }
21768
- });
21769
-
21770
- // types.ts
21771
- var init_types = __esm({
21772
- "types.ts"() {
21773
- "use strict";
21774
- init_define_import_meta_env();
21775
- }
21776
- });
21777
-
21778
21513
  // clients.ts
21779
21514
  function hashToInteger(id) {
21780
21515
  let hash = 0;
@@ -21787,16 +21522,13 @@ function hashToInteger(id) {
21787
21522
  }
21788
21523
  return hash;
21789
21524
  }
21790
- var getClientColor, getNameInitial, renderRemoteCursors;
21525
+ var getClientColor, getNameInitial;
21791
21526
  var init_clients = __esm({
21792
21527
  "clients.ts"() {
21793
21528
  "use strict";
21794
21529
  init_define_import_meta_env();
21795
- init_constants();
21796
- init_roundRect();
21797
- init_types();
21798
- getClientColor = (socketId, collaborator) => {
21799
- const hash = Math.abs(hashToInteger(collaborator?.id || socketId));
21530
+ getClientColor = (id) => {
21531
+ const hash = Math.abs(hashToInteger(id));
21800
21532
  const hue = hash % 37 * 10;
21801
21533
  const saturation = 100;
21802
21534
  const lightness = 83;
@@ -21806,162 +21538,6 @@ var init_clients = __esm({
21806
21538
  const firstCodePoint = name?.trim()?.codePointAt(0);
21807
21539
  return (firstCodePoint ? String.fromCodePoint(firstCodePoint) : "?").toUpperCase();
21808
21540
  };
21809
- renderRemoteCursors = ({
21810
- context,
21811
- renderConfig,
21812
- appState,
21813
- normalizedWidth,
21814
- normalizedHeight
21815
- }) => {
21816
- for (const [socketId, pointer] of renderConfig.remotePointerViewportCoords) {
21817
- let { x, y } = pointer;
21818
- const collaborator = appState.collaborators.get(socketId);
21819
- x -= appState.offsetLeft;
21820
- y -= appState.offsetTop;
21821
- const width = 11;
21822
- const height = 14;
21823
- const isOutOfBounds = x < 0 || x > normalizedWidth - width || y < 0 || y > normalizedHeight - height;
21824
- x = Math.max(x, 0);
21825
- x = Math.min(x, normalizedWidth - width);
21826
- y = Math.max(y, 0);
21827
- y = Math.min(y, normalizedHeight - height);
21828
- const background = getClientColor(socketId, collaborator);
21829
- context.save();
21830
- context.strokeStyle = background;
21831
- context.fillStyle = background;
21832
- const userState = renderConfig.remotePointerUserStates.get(socketId);
21833
- const isInactive = isOutOfBounds || userState === "idle" /* IDLE */ || userState === "away" /* AWAY */;
21834
- if (isInactive) {
21835
- context.globalAlpha = 0.3;
21836
- }
21837
- if (renderConfig.remotePointerButton.get(socketId) === "down") {
21838
- context.beginPath();
21839
- context.arc(x, y, 15, 0, 2 * Math.PI, false);
21840
- context.lineWidth = 3;
21841
- context.strokeStyle = "#ffffff88";
21842
- context.stroke();
21843
- context.closePath();
21844
- context.beginPath();
21845
- context.arc(x, y, 15, 0, 2 * Math.PI, false);
21846
- context.lineWidth = 1;
21847
- context.strokeStyle = background;
21848
- context.stroke();
21849
- context.closePath();
21850
- }
21851
- const IS_SPEAKING_COLOR = appState.theme === THEME.DARK ? "#2f6330" : COLOR_VOICE_CALL;
21852
- const isSpeaking = collaborator?.isSpeaking;
21853
- if (isSpeaking) {
21854
- context.fillStyle = IS_SPEAKING_COLOR;
21855
- context.strokeStyle = IS_SPEAKING_COLOR;
21856
- context.lineWidth = 10;
21857
- context.lineJoin = "round";
21858
- context.beginPath();
21859
- context.moveTo(x, y);
21860
- context.lineTo(x + 0, y + 14);
21861
- context.lineTo(x + 4, y + 9);
21862
- context.lineTo(x + 11, y + 8);
21863
- context.closePath();
21864
- context.stroke();
21865
- context.fill();
21866
- }
21867
- context.fillStyle = COLOR_WHITE;
21868
- context.strokeStyle = COLOR_WHITE;
21869
- context.lineWidth = 6;
21870
- context.lineJoin = "round";
21871
- context.beginPath();
21872
- context.moveTo(x, y);
21873
- context.lineTo(x + 0, y + 14);
21874
- context.lineTo(x + 4, y + 9);
21875
- context.lineTo(x + 11, y + 8);
21876
- context.closePath();
21877
- context.stroke();
21878
- context.fill();
21879
- context.fillStyle = background;
21880
- context.strokeStyle = background;
21881
- context.lineWidth = 2;
21882
- context.lineJoin = "round";
21883
- context.beginPath();
21884
- if (isInactive) {
21885
- context.moveTo(x - 1, y - 1);
21886
- context.lineTo(x - 1, y + 15);
21887
- context.lineTo(x + 5, y + 10);
21888
- context.lineTo(x + 12, y + 9);
21889
- context.closePath();
21890
- context.fill();
21891
- } else {
21892
- context.moveTo(x, y);
21893
- context.lineTo(x + 0, y + 14);
21894
- context.lineTo(x + 4, y + 9);
21895
- context.lineTo(x + 11, y + 8);
21896
- context.closePath();
21897
- context.fill();
21898
- context.stroke();
21899
- }
21900
- const username = renderConfig.remotePointerUsernames.get(socketId) || "";
21901
- if (!isOutOfBounds && username) {
21902
- context.font = "600 12px sans-serif";
21903
- const offsetX = (isSpeaking ? x + 0 : x) + width / 2;
21904
- const offsetY = (isSpeaking ? y + 0 : y) + height + 2;
21905
- const paddingHorizontal = 5;
21906
- const paddingVertical = 3;
21907
- const measure = context.measureText(username);
21908
- const measureHeight = measure.actualBoundingBoxDescent + measure.actualBoundingBoxAscent;
21909
- const finalHeight = Math.max(measureHeight, 12);
21910
- const boxX = offsetX - 1;
21911
- const boxY = offsetY - 1;
21912
- const boxWidth = measure.width + 2 + paddingHorizontal * 2 + 2;
21913
- const boxHeight = finalHeight + 2 + paddingVertical * 2 + 2;
21914
- if (context.roundRect) {
21915
- context.beginPath();
21916
- context.roundRect(boxX, boxY, boxWidth, boxHeight, 8);
21917
- context.fillStyle = background;
21918
- context.fill();
21919
- context.strokeStyle = COLOR_WHITE;
21920
- context.stroke();
21921
- if (isSpeaking) {
21922
- context.beginPath();
21923
- context.roundRect(boxX - 2, boxY - 2, boxWidth + 4, boxHeight + 4, 8);
21924
- context.strokeStyle = IS_SPEAKING_COLOR;
21925
- context.stroke();
21926
- }
21927
- } else {
21928
- roundRect(context, boxX, boxY, boxWidth, boxHeight, 8, COLOR_WHITE);
21929
- }
21930
- context.fillStyle = COLOR_CHARCOAL_BLACK;
21931
- context.fillText(
21932
- username,
21933
- offsetX + paddingHorizontal + 1,
21934
- offsetY + paddingVertical + measure.actualBoundingBoxAscent + Math.floor((finalHeight - measureHeight) / 2) + 2
21935
- );
21936
- if (isSpeaking) {
21937
- context.fillStyle = IS_SPEAKING_COLOR;
21938
- const barheight = 8;
21939
- const margin = 8;
21940
- const gap = 5;
21941
- context.fillRect(
21942
- boxX + boxWidth + margin,
21943
- boxY + (boxHeight / 2 - barheight / 2),
21944
- 2,
21945
- barheight
21946
- );
21947
- context.fillRect(
21948
- boxX + boxWidth + margin + gap,
21949
- boxY + (boxHeight / 2 - barheight * 2 / 2),
21950
- 2,
21951
- barheight * 2
21952
- );
21953
- context.fillRect(
21954
- boxX + boxWidth + margin + gap * 2,
21955
- boxY + (boxHeight / 2 - barheight / 2),
21956
- 2,
21957
- barheight
21958
- );
21959
- }
21960
- }
21961
- context.restore();
21962
- context.closePath();
21963
- }
21964
- };
21965
21541
  }
21966
21542
  });
21967
21543
 
@@ -21987,28 +21563,39 @@ var init_Avatar2 = __esm({
21987
21563
  onClick,
21988
21564
  name,
21989
21565
  src,
21990
- className
21566
+ isBeingFollowed,
21567
+ isCurrentUser
21991
21568
  }) => {
21992
21569
  const shortName = getNameInitial(name);
21993
21570
  const [error, setError] = useState8(false);
21994
21571
  const loadImg = !error && src;
21995
21572
  const style = loadImg ? void 0 : { background: color };
21996
- return /* @__PURE__ */ jsx31("div", { className: clsx13("Avatar", className), style, onClick, children: loadImg ? /* @__PURE__ */ jsx31(
21997
- "img",
21573
+ return /* @__PURE__ */ jsx31(
21574
+ "div",
21998
21575
  {
21999
- className: "Avatar-img",
22000
- src,
22001
- alt: shortName,
22002
- referrerPolicy: "no-referrer",
22003
- onError: () => setError(true)
21576
+ className: clsx13("Avatar", {
21577
+ "Avatar--is-followed": isBeingFollowed,
21578
+ "Avatar--is-current-user": isCurrentUser
21579
+ }),
21580
+ style,
21581
+ onClick,
21582
+ children: loadImg ? /* @__PURE__ */ jsx31(
21583
+ "img",
21584
+ {
21585
+ className: "Avatar-img",
21586
+ src,
21587
+ alt: shortName,
21588
+ referrerPolicy: "no-referrer",
21589
+ onError: () => setError(true)
21590
+ }
21591
+ ) : shortName
22004
21592
  }
22005
- ) : shortName });
21593
+ );
22006
21594
  };
22007
21595
  }
22008
21596
  });
22009
21597
 
22010
21598
  // actions/actionNavigate.tsx
22011
- import clsx14 from "clsx";
22012
21599
  import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
22013
21600
  var actionGoToCollaborator;
22014
21601
  var init_actionNavigate = __esm({
@@ -22048,39 +21635,12 @@ var init_actionNavigate = __esm({
22048
21635
  };
22049
21636
  },
22050
21637
  PanelComponent: ({ updateData, data, appState }) => {
22051
- const { socketId, collaborator, withName, isBeingFollowed } = data;
22052
- const background = getClientColor(socketId, collaborator);
22053
- const statusClassNames = clsx14({
22054
- "is-followed": isBeingFollowed,
22055
- "is-current-user": collaborator.isCurrentUser === true,
22056
- "is-speaking": collaborator.isSpeaking,
22057
- "is-in-call": collaborator.isInCall,
22058
- "is-muted": collaborator.isMuted
22059
- });
22060
- const statusIconJSX = collaborator.isInCall ? collaborator.isSpeaking ? /* @__PURE__ */ jsxs18(
22061
- "div",
22062
- {
22063
- className: "UserList__collaborator-status-icon-speaking-indicator",
22064
- title: t("userList.hint.isSpeaking"),
22065
- children: [
22066
- /* @__PURE__ */ jsx32("div", {}),
22067
- /* @__PURE__ */ jsx32("div", {}),
22068
- /* @__PURE__ */ jsx32("div", {})
22069
- ]
22070
- }
22071
- ) : collaborator.isMuted ? /* @__PURE__ */ jsx32(
22072
- "div",
22073
- {
22074
- className: "UserList__collaborator-status-icon-microphone-muted",
22075
- title: t("userList.hint.micMuted"),
22076
- children: microphoneMutedIcon
22077
- }
22078
- ) : /* @__PURE__ */ jsx32("div", { title: t("userList.hint.inCall"), children: microphoneIcon }) : null;
21638
+ const { clientId, collaborator, withName, isBeingFollowed } = data;
21639
+ const background = getClientColor(clientId);
22079
21640
  return withName ? /* @__PURE__ */ jsxs18(
22080
21641
  "div",
22081
21642
  {
22082
- className: `dropdown-menu-item dropdown-menu-item-base UserList__collaborator ${statusClassNames}`,
22083
- style: { [`--avatar-size`]: "1.5rem" },
21643
+ className: "dropdown-menu-item dropdown-menu-item-base UserList__collaborator",
22084
21644
  onClick: () => updateData(collaborator),
22085
21645
  children: [
22086
21646
  /* @__PURE__ */ jsx32(
@@ -22091,43 +21651,35 @@ var init_actionNavigate = __esm({
22091
21651
  },
22092
21652
  name: collaborator.username || "",
22093
21653
  src: collaborator.avatarUrl,
22094
- className: statusClassNames
21654
+ isBeingFollowed,
21655
+ isCurrentUser: collaborator.isCurrentUser === true
22095
21656
  }
22096
21657
  ),
22097
21658
  /* @__PURE__ */ jsx32("div", { className: "UserList__collaborator-name", children: collaborator.username }),
22098
- /* @__PURE__ */ jsxs18("div", { className: "UserList__collaborator-status-icons", "aria-hidden": true, children: [
22099
- isBeingFollowed && /* @__PURE__ */ jsx32(
22100
- "div",
22101
- {
22102
- className: "UserList__collaborator-status-icon-is-followed",
22103
- title: t("userList.hint.followStatus"),
22104
- children: eyeIcon
22105
- }
22106
- ),
22107
- statusIconJSX
22108
- ] })
22109
- ]
22110
- }
22111
- ) : /* @__PURE__ */ jsxs18(
22112
- "div",
22113
- {
22114
- className: `UserList__collaborator UserList__collaborator--avatar-only ${statusClassNames}`,
22115
- children: [
22116
21659
  /* @__PURE__ */ jsx32(
22117
- Avatar,
21660
+ "div",
22118
21661
  {
22119
- color: background,
22120
- onClick: () => {
22121
- updateData(collaborator);
22122
- },
22123
- name: collaborator.username || "",
22124
- src: collaborator.avatarUrl,
22125
- className: statusClassNames
21662
+ className: "UserList__collaborator-follow-status-icon",
21663
+ style: { visibility: isBeingFollowed ? "visible" : "hidden" },
21664
+ title: isBeingFollowed ? t("userList.hint.followStatus") : void 0,
21665
+ "aria-hidden": true,
21666
+ children: eyeIcon
22126
21667
  }
22127
- ),
22128
- statusIconJSX && /* @__PURE__ */ jsx32("div", { className: "UserList__collaborator-status-icon", children: statusIconJSX })
21668
+ )
22129
21669
  ]
22130
21670
  }
21671
+ ) : /* @__PURE__ */ jsx32(
21672
+ Avatar,
21673
+ {
21674
+ color: background,
21675
+ onClick: () => {
21676
+ updateData(collaborator);
21677
+ },
21678
+ name: collaborator.username || "",
21679
+ src: collaborator.avatarUrl,
21680
+ isBeingFollowed,
21681
+ isCurrentUser: collaborator.isCurrentUser === true
21682
+ }
22131
21683
  );
22132
21684
  }
22133
21685
  });
@@ -23102,7 +22654,6 @@ var init_actionBoundText = __esm({
23102
22654
  init_typeChecks();
23103
22655
  init_utils();
23104
22656
  init_register();
23105
- init_fractionalIndex();
23106
22657
  actionUnbindText = register({
23107
22658
  name: "unbindText",
23108
22659
  contextItemLabel: "labels.unbindText",
@@ -23223,7 +22774,6 @@ var init_actionBoundText = __esm({
23223
22774
  (ele) => ele.id === container.id
23224
22775
  );
23225
22776
  updatedElements.splice(containerIndex + 1, 0, textElement);
23226
- syncMovedIndices(updatedElements, arrayToMap([container, textElement]));
23227
22777
  return updatedElements;
23228
22778
  };
23229
22779
  pushContainerBelowText = (elements, container, textElement) => {
@@ -23236,7 +22786,6 @@ var init_actionBoundText = __esm({
23236
22786
  (ele) => ele.id === textElement.id
23237
22787
  );
23238
22788
  updatedElements.splice(textElementIndex, 0, container);
23239
- syncMovedIndices(updatedElements, arrayToMap([container, textElement]));
23240
22789
  return updatedElements;
23241
22790
  };
23242
22791
  actionWrapTextInContainer = register({
@@ -23357,7 +22906,7 @@ import {
23357
22906
  useRef as useRef10,
23358
22907
  useState as useState9
23359
22908
  } from "react";
23360
- import clsx15 from "clsx";
22909
+ import clsx14 from "clsx";
23361
22910
  import { jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
23362
22911
  var CONTAINER_WIDTH, SPACE_BOTTOM, CONTAINER_PADDING, CONTAINER_HEIGHT, AUTO_HIDE_TIMEOUT, IS_HYPERLINK_TOOLTIP_VISIBLE, embeddableLinkCache, Hyperlink, getCoordsForPopover, getContextMenuLabel, HYPERLINK_TOOLTIP_TIMEOUT_ID, showHyperlinkTooltip, renderTooltip, hideHyperlinkToolip, shouldHideLinkPopup;
23363
22912
  var init_Hyperlink2 = __esm({
@@ -23532,7 +23081,7 @@ var init_Hyperlink2 = __esm({
23532
23081
  isEditing ? /* @__PURE__ */ jsx35(
23533
23082
  "input",
23534
23083
  {
23535
- className: clsx15("excalidraw-hyperlinkContainer-input"),
23084
+ className: clsx14("excalidraw-hyperlinkContainer-input"),
23536
23085
  placeholder: "Type or paste your link here",
23537
23086
  ref: inputRef,
23538
23087
  value: inputVal,
@@ -24014,7 +23563,6 @@ var init_actionHistory = __esm({
24014
23563
  init_binding();
24015
23564
  init_utils();
24016
23565
  init_constants();
24017
- init_fractionalIndex();
24018
23566
  writeData = (prevElements, appState, updater) => {
24019
23567
  const commitToHistory = false;
24020
23568
  if (!appState.multiElement && !appState.resizingElement && !appState.editingElement && !appState.draggingElement) {
@@ -24039,7 +23587,6 @@ var init_actionHistory = __esm({
24039
23587
  )
24040
23588
  );
24041
23589
  fixBindingsAfterDeletion(elements, deletedElements);
24042
- syncInvalidIndices(elements);
24043
23590
  return {
24044
23591
  elements,
24045
23592
  appState: { ...appState, ...data.appState },
@@ -25288,7 +24835,7 @@ var init_shortcuts = __esm({
25288
24835
  });
25289
24836
 
25290
24837
  // components/ContextMenu.tsx
25291
- import clsx16 from "clsx";
24838
+ import clsx15 from "clsx";
25292
24839
  import React12 from "react";
25293
24840
  import { jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
25294
24841
  var CONTEXT_MENU_SEPARATOR, ContextMenu;
@@ -25369,7 +24916,7 @@ var init_ContextMenu2 = __esm({
25369
24916
  children: /* @__PURE__ */ jsxs20(
25370
24917
  "button",
25371
24918
  {
25372
- className: clsx16("context-menu-item", {
24919
+ className: clsx15("context-menu-item", {
25373
24920
  dangerous: actionName === "deleteSelectedElements",
25374
24921
  checkmark: item.checked?.(appState)
25375
24922
  }),
@@ -25400,7 +24947,7 @@ var init_Stack = __esm({
25400
24947
 
25401
24948
  // components/Stack.tsx
25402
24949
  import { forwardRef } from "react";
25403
- import clsx17 from "clsx";
24950
+ import clsx16 from "clsx";
25404
24951
  import { jsx as jsx40 } from "react/jsx-runtime";
25405
24952
  var RowStack, ColStack, Stack_default;
25406
24953
  var init_Stack2 = __esm({
@@ -25413,7 +24960,7 @@ var init_Stack2 = __esm({
25413
24960
  return /* @__PURE__ */ jsx40(
25414
24961
  "div",
25415
24962
  {
25416
- className: clsx17("Stack Stack_horizontal", className),
24963
+ className: clsx16("Stack Stack_horizontal", className),
25417
24964
  style: {
25418
24965
  "--gap": gap,
25419
24966
  alignItems: align,
@@ -25431,7 +24978,7 @@ var init_Stack2 = __esm({
25431
24978
  return /* @__PURE__ */ jsx40(
25432
24979
  "div",
25433
24980
  {
25434
- className: clsx17("Stack Stack_vertical", className),
24981
+ className: clsx16("Stack Stack_vertical", className),
25435
24982
  style: {
25436
24983
  "--gap": gap,
25437
24984
  justifyItems: align,
@@ -25458,7 +25005,7 @@ var init_Actions = __esm({
25458
25005
  });
25459
25006
 
25460
25007
  // components/dropdownMenu/DropdownMenuTrigger.tsx
25461
- import clsx18 from "clsx";
25008
+ import clsx17 from "clsx";
25462
25009
  import { jsx as jsx41 } from "react/jsx-runtime";
25463
25010
  var MenuTrigger, DropdownMenuTrigger_default;
25464
25011
  var init_DropdownMenuTrigger = __esm({
@@ -25474,7 +25021,7 @@ var init_DropdownMenuTrigger = __esm({
25474
25021
  ...rest
25475
25022
  }) => {
25476
25023
  const device = useDevice();
25477
- const classNames = clsx18(
25024
+ const classNames = clsx17(
25478
25025
  `dropdown-menu-button ${className}`,
25479
25026
  "zen-mode-transition",
25480
25027
  {
@@ -25664,7 +25211,7 @@ var init_Island = __esm({
25664
25211
 
25665
25212
  // components/Island.tsx
25666
25213
  import React15 from "react";
25667
- import clsx19 from "clsx";
25214
+ import clsx18 from "clsx";
25668
25215
  import { jsx as jsx46 } from "react/jsx-runtime";
25669
25216
  var Island;
25670
25217
  var init_Island2 = __esm({
@@ -25676,7 +25223,7 @@ var init_Island2 = __esm({
25676
25223
  ({ children, padding, className, style }, ref) => /* @__PURE__ */ jsx46(
25677
25224
  "div",
25678
25225
  {
25679
- className: clsx19("Island", className),
25226
+ className: clsx18("Island", className),
25680
25227
  style: { "--padding": padding, ...style },
25681
25228
  ref,
25682
25229
  children
@@ -25687,7 +25234,7 @@ var init_Island2 = __esm({
25687
25234
  });
25688
25235
 
25689
25236
  // components/dropdownMenu/DropdownMenuContent.tsx
25690
- import clsx20 from "clsx";
25237
+ import clsx19 from "clsx";
25691
25238
  import { useEffect as useEffect16, useRef as useRef12 } from "react";
25692
25239
  import { jsx as jsx47 } from "react/jsx-runtime";
25693
25240
  var MenuContent, DropdownMenuContent_default;
@@ -25732,7 +25279,7 @@ var init_DropdownMenuContent = __esm({
25732
25279
  document.removeEventListener("keydown" /* KEYDOWN */, onKeyDown);
25733
25280
  };
25734
25281
  }, [callbacksRef]);
25735
- const classNames = clsx20(`dropdown-menu ${className}`, {
25282
+ const classNames = clsx19(`dropdown-menu ${className}`, {
25736
25283
  "dropdown-menu--mobile": device.editor.isMobile
25737
25284
  }).trim();
25738
25285
  return /* @__PURE__ */ jsx47(DropdownMenuContentPropsContext.Provider, { value: { onSelect }, children: /* @__PURE__ */ jsx47(
@@ -25933,7 +25480,7 @@ var init_tunnels = __esm({
25933
25480
 
25934
25481
  // components/Actions.tsx
25935
25482
  import { useState as useState11 } from "react";
25936
- import clsx21 from "clsx";
25483
+ import clsx20 from "clsx";
25937
25484
  import { Fragment as Fragment8, jsx as jsx50, jsxs as jsxs24 } from "react/jsx-runtime";
25938
25485
  var SelectedShapeActions, ShapesSwitcher, ZoomActions, UndoRedoActions, ExitZenModeAction, FinalizeAction;
25939
25486
  var init_Actions2 = __esm({
@@ -26078,7 +25625,7 @@ var init_Actions2 = __esm({
26078
25625
  return /* @__PURE__ */ jsx50(
26079
25626
  ToolButton,
26080
25627
  {
26081
- className: clsx21("Shape", { fillable }),
25628
+ className: clsx20("Shape", { fillable }),
26082
25629
  type: "radio",
26083
25630
  icon,
26084
25631
  checked: activeTool.type === value,
@@ -26115,7 +25662,7 @@ var init_Actions2 = __esm({
26115
25662
  /* @__PURE__ */ jsxs24(
26116
25663
  DropdownMenu_default.Trigger,
26117
25664
  {
26118
- className: clsx21("App-toolbar__extra-tools-trigger", {
25665
+ className: clsx20("App-toolbar__extra-tools-trigger", {
26119
25666
  "App-toolbar__extra-tools-trigger--selected": frameToolSelected || embeddableToolSelected || // in collab we're already highlighting the laser button
26120
25667
  // outside toolbar, so let's not highlight extra-tools button
26121
25668
  // on top of it
@@ -26257,7 +25804,7 @@ var init_Actions2 = __esm({
26257
25804
  }) => /* @__PURE__ */ jsx50(
26258
25805
  "button",
26259
25806
  {
26260
- className: clsx21("disable-zen-mode", {
25807
+ className: clsx20("disable-zen-mode", {
26261
25808
  "disable-zen-mode--visible": showExitZenModeBtn
26262
25809
  }),
26263
25810
  onClick: () => actionManager.executeAction(actionToggleZenMode),
@@ -26300,7 +25847,7 @@ var init_Modal = __esm({
26300
25847
 
26301
25848
  // components/Modal.tsx
26302
25849
  import { createPortal as createPortal2 } from "react-dom";
26303
- import clsx22 from "clsx";
25850
+ import clsx21 from "clsx";
26304
25851
  import { jsx as jsx51, jsxs as jsxs25 } from "react/jsx-runtime";
26305
25852
  var Modal;
26306
25853
  var init_Modal2 = __esm({
@@ -26329,7 +25876,7 @@ var init_Modal2 = __esm({
26329
25876
  /* @__PURE__ */ jsxs25(
26330
25877
  "div",
26331
25878
  {
26332
- className: clsx22("Modal", props.className),
25879
+ className: clsx21("Modal", props.className),
26333
25880
  role: "dialog",
26334
25881
  "aria-modal": "true",
26335
25882
  onKeyDown: handleKeydown,
@@ -26391,7 +25938,7 @@ var init_LibraryMenuBrowseButton = __esm({
26391
25938
  });
26392
25939
 
26393
25940
  // components/LibraryMenuControlButtons.tsx
26394
- import clsx23 from "clsx";
25941
+ import clsx22 from "clsx";
26395
25942
  import { jsx as jsx53, jsxs as jsxs26 } from "react/jsx-runtime";
26396
25943
  var LibraryMenuControlButtons;
26397
25944
  var init_LibraryMenuControlButtons = __esm({
@@ -26410,7 +25957,7 @@ var init_LibraryMenuControlButtons = __esm({
26410
25957
  return /* @__PURE__ */ jsxs26(
26411
25958
  "div",
26412
25959
  {
26413
- className: clsx23("library-menu-control-buttons", className),
25960
+ className: clsx22("library-menu-control-buttons", className),
26414
25961
  style,
26415
25962
  children: [
26416
25963
  /* @__PURE__ */ jsx53(
@@ -26529,7 +26076,7 @@ var init_DialogActionButton = __esm({
26529
26076
  });
26530
26077
 
26531
26078
  // components/DialogActionButton.tsx
26532
- import clsx24 from "clsx";
26079
+ import clsx23 from "clsx";
26533
26080
  import { jsx as jsx54, jsxs as jsxs27 } from "react/jsx-runtime";
26534
26081
  var DialogActionButton, DialogActionButton_default;
26535
26082
  var init_DialogActionButton2 = __esm({
@@ -26552,7 +26099,7 @@ var init_DialogActionButton2 = __esm({
26552
26099
  return /* @__PURE__ */ jsxs27(
26553
26100
  "button",
26554
26101
  {
26555
- className: clsx24("Dialog__action-button", cs, className),
26102
+ className: clsx23("Dialog__action-button", cs, className),
26556
26103
  type,
26557
26104
  "aria-label": label,
26558
26105
  onClick,
@@ -27172,7 +26719,7 @@ var init_PublishLibrary2 = __esm({
27172
26719
  // components/LibraryMenuHeaderContent.tsx
27173
26720
  import { useCallback as useCallback5, useState as useState14 } from "react";
27174
26721
  import { useAtom as useAtom9 } from "jotai";
27175
- import clsx25 from "clsx";
26722
+ import clsx24 from "clsx";
27176
26723
  import { jsx as jsx57, jsxs as jsxs30 } from "react/jsx-runtime";
27177
26724
  var getSelectedItems, LibraryDropdownMenuButton, LibraryDropdownMenu;
27178
26725
  var init_LibraryMenuHeaderContent = __esm({
@@ -27378,7 +26925,7 @@ var init_LibraryMenuHeaderContent = __esm({
27378
26925
  )
27379
26926
  ] });
27380
26927
  };
27381
- return /* @__PURE__ */ jsxs30("div", { className: clsx25("library-menu-dropdown-container", className), children: [
26928
+ return /* @__PURE__ */ jsxs30("div", { className: clsx24("library-menu-dropdown-container", className), children: [
27382
26929
  renderLibraryMenu(),
27383
26930
  selectedItems.length > 0 && /* @__PURE__ */ jsx57("div", { className: "library-actions-counter", children: selectedItems.length }),
27384
26931
  showRemoveLibAlert && renderRemoveLibAlert(),
@@ -27448,7 +26995,7 @@ var init_LibraryUnit = __esm({
27448
26995
  });
27449
26996
 
27450
26997
  // components/LibraryUnit.tsx
27451
- import clsx26 from "clsx";
26998
+ import clsx25 from "clsx";
27452
26999
  import { memo, useEffect as useEffect18, useRef as useRef14, useState as useState15 } from "react";
27453
27000
  import { jsx as jsx58, jsxs as jsxs31 } from "react/jsx-runtime";
27454
27001
  var LibraryUnit, EmptyLibraryUnit;
@@ -27492,7 +27039,7 @@ var init_LibraryUnit2 = __esm({
27492
27039
  return /* @__PURE__ */ jsxs31(
27493
27040
  "div",
27494
27041
  {
27495
- className: clsx26("library-unit", {
27042
+ className: clsx25("library-unit", {
27496
27043
  "library-unit__active": elements,
27497
27044
  "library-unit--hover": elements && isHovered,
27498
27045
  "library-unit--selected": selected,
@@ -27504,7 +27051,7 @@ var init_LibraryUnit2 = __esm({
27504
27051
  /* @__PURE__ */ jsx58(
27505
27052
  "div",
27506
27053
  {
27507
- className: clsx26("library-unit__dragger", {
27054
+ className: clsx25("library-unit__dragger", {
27508
27055
  "library-unit__pulse": !!isPending
27509
27056
  }),
27510
27057
  ref,
@@ -28104,7 +27651,7 @@ var init_LibraryMenu2 = __esm({
28104
27651
  });
28105
27652
 
28106
27653
  // components/Dialog.tsx
28107
- import clsx27 from "clsx";
27654
+ import clsx26 from "clsx";
28108
27655
  import { useEffect as useEffect22, useState as useState19 } from "react";
28109
27656
  import { useSetAtom as useSetAtom2 } from "jotai";
28110
27657
  import { jsx as jsx62, jsxs as jsxs34 } from "react/jsx-runtime";
@@ -28181,7 +27728,7 @@ var init_Dialog2 = __esm({
28181
27728
  return /* @__PURE__ */ jsx62(
28182
27729
  Modal,
28183
27730
  {
28184
- className: clsx27("Dialog", props.className, {
27731
+ className: clsx26("Dialog", props.className, {
28185
27732
  "Dialog--fullscreen": isFullscreen
28186
27733
  }),
28187
27734
  labelledBy: "dialog-title",
@@ -28252,7 +27799,7 @@ var init_RadioGroup = __esm({
28252
27799
  });
28253
27800
 
28254
27801
  // components/RadioGroup.tsx
28255
- import clsx28 from "clsx";
27802
+ import clsx27 from "clsx";
28256
27803
  import { jsx as jsx64, jsxs as jsxs35 } from "react/jsx-runtime";
28257
27804
  var RadioGroup;
28258
27805
  var init_RadioGroup2 = __esm({
@@ -28269,7 +27816,7 @@ var init_RadioGroup2 = __esm({
28269
27816
  return /* @__PURE__ */ jsx64("div", { className: "RadioGroup", children: choices.map((choice) => /* @__PURE__ */ jsxs35(
28270
27817
  "div",
28271
27818
  {
28272
- className: clsx28("RadioGroup__choice", {
27819
+ className: clsx27("RadioGroup__choice", {
28273
27820
  active: choice.value === value
28274
27821
  }),
28275
27822
  children: [
@@ -28298,7 +27845,7 @@ var init_Switch = __esm({
28298
27845
  });
28299
27846
 
28300
27847
  // components/Switch.tsx
28301
- import clsx29 from "clsx";
27848
+ import clsx28 from "clsx";
28302
27849
  import { jsx as jsx65 } from "react/jsx-runtime";
28303
27850
  var Switch;
28304
27851
  var init_Switch2 = __esm({
@@ -28313,7 +27860,7 @@ var init_Switch2 = __esm({
28313
27860
  onChange,
28314
27861
  disabled = false
28315
27862
  }) => {
28316
- return /* @__PURE__ */ jsx65("div", { className: clsx29("Switch", { toggled: checked, disabled }), children: /* @__PURE__ */ jsx65(
27863
+ return /* @__PURE__ */ jsx65("div", { className: clsx28("Switch", { toggled: checked, disabled }), children: /* @__PURE__ */ jsx65(
28317
27864
  "input",
28318
27865
  {
28319
27866
  name,
@@ -28348,7 +27895,7 @@ var init_FilledButton = __esm({
28348
27895
 
28349
27896
  // components/FilledButton.tsx
28350
27897
  import { forwardRef as forwardRef2, useState as useState21 } from "react";
28351
- import clsx30 from "clsx";
27898
+ import clsx29 from "clsx";
28352
27899
  import { jsx as jsx66, jsxs as jsxs36 } from "react/jsx-runtime";
28353
27900
  var FilledButton;
28354
27901
  var init_FilledButton2 = __esm({
@@ -28392,7 +27939,7 @@ var init_FilledButton2 = __esm({
28392
27939
  return /* @__PURE__ */ jsx66(
28393
27940
  "button",
28394
27941
  {
28395
- className: clsx30(
27942
+ className: clsx29(
28396
27943
  "ExcButton",
28397
27944
  `ExcButton--color-${color}`,
28398
27945
  `ExcButton--variant-${variant}`,
@@ -28767,7 +28314,7 @@ var init_FixedSideContainer = __esm({
28767
28314
  });
28768
28315
 
28769
28316
  // components/FixedSideContainer.tsx
28770
- import clsx31 from "clsx";
28317
+ import clsx30 from "clsx";
28771
28318
  import { jsx as jsx68 } from "react/jsx-runtime";
28772
28319
  var FixedSideContainer;
28773
28320
  var init_FixedSideContainer2 = __esm({
@@ -28782,7 +28329,7 @@ var init_FixedSideContainer2 = __esm({
28782
28329
  }) => /* @__PURE__ */ jsx68(
28783
28330
  "div",
28784
28331
  {
28785
- className: clsx31(
28332
+ className: clsx30(
28786
28333
  "FixedSideContainer",
28787
28334
  `FixedSideContainer_side_${side}`,
28788
28335
  className
@@ -28901,7 +28448,7 @@ var init_HintViewer2 = __esm({
28901
28448
  });
28902
28449
 
28903
28450
  // components/LockButton.tsx
28904
- import clsx32 from "clsx";
28451
+ import clsx31 from "clsx";
28905
28452
  import { jsx as jsx70, jsxs as jsxs38 } from "react/jsx-runtime";
28906
28453
  var DEFAULT_SIZE, ICONS2, LockButton;
28907
28454
  var init_LockButton = __esm({
@@ -28919,7 +28466,7 @@ var init_LockButton = __esm({
28919
28466
  return /* @__PURE__ */ jsxs38(
28920
28467
  "label",
28921
28468
  {
28922
- className: clsx32(
28469
+ className: clsx31(
28923
28470
  "ToolIcon ToolIcon__lock",
28924
28471
  `ToolIcon_size_${DEFAULT_SIZE}`,
28925
28472
  {
@@ -29036,7 +28583,7 @@ var init_scrollbars = __esm({
29036
28583
  });
29037
28584
 
29038
28585
  // components/PenModeButton.tsx
29039
- import clsx33 from "clsx";
28586
+ import clsx32 from "clsx";
29040
28587
  import { jsx as jsx72, jsxs as jsxs40 } from "react/jsx-runtime";
29041
28588
  var DEFAULT_SIZE2, PenModeButton;
29042
28589
  var init_PenModeButton = __esm({
@@ -29053,7 +28600,7 @@ var init_PenModeButton = __esm({
29053
28600
  return /* @__PURE__ */ jsxs40(
29054
28601
  "label",
29055
28602
  {
29056
- className: clsx33(
28603
+ className: clsx32(
29057
28604
  "ToolIcon ToolIcon__penMode",
29058
28605
  `ToolIcon_size_${DEFAULT_SIZE2}`,
29059
28606
  {
@@ -29165,7 +28712,7 @@ var init_Stats2 = __esm({
29165
28712
  });
29166
28713
 
29167
28714
  // components/HandButton.tsx
29168
- import clsx34 from "clsx";
28715
+ import clsx33 from "clsx";
29169
28716
  import { jsx as jsx74 } from "react/jsx-runtime";
29170
28717
  var HandButton;
29171
28718
  var init_HandButton = __esm({
@@ -29180,7 +28727,7 @@ var init_HandButton = __esm({
29180
28727
  return /* @__PURE__ */ jsx74(
29181
28728
  ToolButton,
29182
28729
  {
29183
- className: clsx34("Shape", { fillable: false }),
28730
+ className: clsx33("Shape", { fillable: false }),
29184
28731
  type: "radio",
29185
28732
  icon: handIcon,
29186
28733
  name: "editor-current-shape",
@@ -30180,11 +29727,11 @@ var init_UserList = __esm({
30180
29727
  });
30181
29728
 
30182
29729
  // components/UserList.tsx
30183
- import React30, { useLayoutEffect as useLayoutEffect6 } from "react";
30184
- import clsx35 from "clsx";
29730
+ import React30 from "react";
29731
+ import clsx34 from "clsx";
30185
29732
  import * as Popover3 from "@radix-ui/react-popover";
30186
29733
  import { jsx as jsx79, jsxs as jsxs45 } from "react/jsx-runtime";
30187
- var DEFAULT_MAX_AVATARS, SHOW_COLLABORATORS_FILTER_AT, ConditionalTooltipWrapper, renderCollaborator, collaboratorComparatorKeys, UserList;
29734
+ var FIRST_N_AVATARS, SHOW_COLLABORATORS_FILTER_AT, ConditionalTooltipWrapper, renderCollaborator, collaboratorComparatorKeys, UserList;
30188
29735
  var init_UserList2 = __esm({
30189
29736
  "components/UserList.tsx"() {
30190
29737
  "use strict";
@@ -30196,24 +29743,24 @@ var init_UserList2 = __esm({
30196
29743
  init_icons();
30197
29744
  init_i18n();
30198
29745
  init_utils();
30199
- init_constants();
30200
- DEFAULT_MAX_AVATARS = 4;
29746
+ FIRST_N_AVATARS = 3;
30201
29747
  SHOW_COLLABORATORS_FILTER_AT = 8;
30202
29748
  ConditionalTooltipWrapper = ({
30203
29749
  shouldWrap,
30204
29750
  children,
29751
+ clientId,
30205
29752
  username
30206
- }) => shouldWrap ? /* @__PURE__ */ jsx79(Tooltip, { label: username || "Unknown user", children }) : /* @__PURE__ */ jsx79(React30.Fragment, { children });
29753
+ }) => shouldWrap ? /* @__PURE__ */ jsx79(Tooltip, { label: username || "Unknown user", children }, clientId) : /* @__PURE__ */ jsx79(React30.Fragment, { children }, clientId);
30207
29754
  renderCollaborator = ({
30208
29755
  actionManager,
30209
29756
  collaborator,
30210
- socketId,
29757
+ clientId,
30211
29758
  withName = false,
30212
29759
  shouldWrapWithTooltip = false,
30213
29760
  isBeingFollowed
30214
29761
  }) => {
30215
29762
  const data = {
30216
- socketId,
29763
+ clientId,
30217
29764
  collaborator,
30218
29765
  withName,
30219
29766
  isBeingFollowed
@@ -30222,21 +29769,19 @@ var init_UserList2 = __esm({
30222
29769
  return /* @__PURE__ */ jsx79(
30223
29770
  ConditionalTooltipWrapper,
30224
29771
  {
29772
+ clientId,
30225
29773
  username: collaborator.username,
30226
29774
  shouldWrap: shouldWrapWithTooltip,
30227
29775
  children: avatarJSX
30228
29776
  },
30229
- socketId
29777
+ clientId
30230
29778
  );
30231
29779
  };
30232
29780
  collaboratorComparatorKeys = [
30233
29781
  "avatarUrl",
30234
29782
  "id",
30235
29783
  "socketId",
30236
- "username",
30237
- "isInCall",
30238
- "isSpeaking",
30239
- "isMuted"
29784
+ "username"
30240
29785
  ];
30241
29786
  UserList = React30.memo(
30242
29787
  ({ className, mobile, collaborators, userToFollow }) => {
@@ -30250,138 +29795,107 @@ var init_UserList2 = __esm({
30250
29795
  { ...collaborator, socketId }
30251
29796
  );
30252
29797
  });
30253
- const uniqueCollaboratorsArray = Array.from(
30254
- uniqueCollaboratorsMap.values()
30255
- ).filter((collaborator) => collaborator.username?.trim());
29798
+ const uniqueCollaboratorsArray = Array.from(uniqueCollaboratorsMap).filter(
29799
+ ([_, collaborator]) => collaborator.username?.trim()
29800
+ );
30256
29801
  const [searchTerm, setSearchTerm] = React30.useState("");
30257
- const userListWrapper = React30.useRef(null);
30258
- useLayoutEffect6(() => {
30259
- if (userListWrapper.current) {
30260
- const updateMaxAvatars = (width) => {
30261
- const maxAvatars2 = Math.max(1, Math.min(8, Math.floor(width / 38)));
30262
- setMaxAvatars(maxAvatars2);
30263
- };
30264
- updateMaxAvatars(userListWrapper.current.clientWidth);
30265
- if (!supportsResizeObserver) {
30266
- return;
30267
- }
30268
- const resizeObserver = new ResizeObserver((entries) => {
30269
- for (const entry of entries) {
30270
- const { width } = entry.contentRect;
30271
- updateMaxAvatars(width);
30272
- }
30273
- });
30274
- resizeObserver.observe(userListWrapper.current);
30275
- return () => {
30276
- resizeObserver.disconnect();
30277
- };
30278
- }
30279
- }, []);
30280
- const [maxAvatars, setMaxAvatars] = React30.useState(DEFAULT_MAX_AVATARS);
29802
+ if (uniqueCollaboratorsArray.length === 0) {
29803
+ return null;
29804
+ }
30281
29805
  const searchTermNormalized = searchTerm.trim().toLowerCase();
30282
29806
  const filteredCollaborators = searchTermNormalized ? uniqueCollaboratorsArray.filter(
30283
- (collaborator) => collaborator.username?.toLowerCase().includes(searchTerm)
29807
+ ([, collaborator]) => collaborator.username?.toLowerCase().includes(searchTerm)
30284
29808
  ) : uniqueCollaboratorsArray;
30285
29809
  const firstNCollaborators = uniqueCollaboratorsArray.slice(
30286
29810
  0,
30287
- maxAvatars - 1
29811
+ FIRST_N_AVATARS
30288
29812
  );
30289
29813
  const firstNAvatarsJSX = firstNCollaborators.map(
30290
- (collaborator) => renderCollaborator({
29814
+ ([clientId, collaborator]) => renderCollaborator({
30291
29815
  actionManager,
30292
29816
  collaborator,
30293
- socketId: collaborator.socketId,
29817
+ clientId,
30294
29818
  shouldWrapWithTooltip: true,
30295
29819
  isBeingFollowed: collaborator.socketId === userToFollow
30296
29820
  })
30297
29821
  );
30298
- return mobile ? /* @__PURE__ */ jsx79("div", { className: clsx35("UserList UserList_mobile", className), children: uniqueCollaboratorsArray.map(
30299
- (collaborator) => renderCollaborator({
29822
+ return mobile ? /* @__PURE__ */ jsx79("div", { className: clsx34("UserList UserList_mobile", className), children: uniqueCollaboratorsArray.map(
29823
+ ([clientId, collaborator]) => renderCollaborator({
30300
29824
  actionManager,
30301
29825
  collaborator,
30302
- socketId: collaborator.socketId,
29826
+ clientId,
30303
29827
  shouldWrapWithTooltip: true,
30304
29828
  isBeingFollowed: collaborator.socketId === userToFollow
30305
29829
  })
30306
- ) }) : /* @__PURE__ */ jsx79("div", { className: "UserList-wrapper", ref: userListWrapper, children: /* @__PURE__ */ jsxs45(
30307
- "div",
30308
- {
30309
- className: clsx35("UserList", className),
30310
- style: { [`--max-avatars`]: maxAvatars },
30311
- children: [
30312
- firstNAvatarsJSX,
30313
- uniqueCollaboratorsArray.length > maxAvatars - 1 && /* @__PURE__ */ jsxs45(
30314
- Popover3.Root,
30315
- {
30316
- onOpenChange: (isOpen) => {
30317
- if (!isOpen) {
30318
- setSearchTerm("");
30319
- }
30320
- },
30321
- children: [
30322
- /* @__PURE__ */ jsxs45(Popover3.Trigger, { className: "UserList__more", children: [
30323
- "+",
30324
- uniqueCollaboratorsArray.length - maxAvatars + 1
30325
- ] }),
30326
- /* @__PURE__ */ jsx79(
30327
- Popover3.Content,
30328
- {
30329
- style: {
30330
- zIndex: 2,
30331
- width: "15rem",
30332
- textAlign: "left"
30333
- },
30334
- align: "end",
30335
- sideOffset: 10,
30336
- children: /* @__PURE__ */ jsxs45(Island, { style: { overflow: "hidden" }, children: [
30337
- uniqueCollaboratorsArray.length >= SHOW_COLLABORATORS_FILTER_AT && /* @__PURE__ */ jsxs45("div", { className: "UserList__search-wrapper", children: [
30338
- searchIcon,
30339
- /* @__PURE__ */ jsx79(
30340
- "input",
30341
- {
30342
- className: "UserList__search",
30343
- type: "text",
30344
- placeholder: t("userList.search.placeholder"),
30345
- value: searchTerm,
30346
- onChange: (e) => {
30347
- setSearchTerm(e.target.value);
30348
- }
30349
- }
30350
- )
30351
- ] }),
30352
- /* @__PURE__ */ jsxs45("div", { className: "dropdown-menu UserList__collaborators", children: [
30353
- filteredCollaborators.length === 0 && /* @__PURE__ */ jsx79("div", { className: "UserList__collaborators__empty", children: t("userList.search.empty") }),
30354
- /* @__PURE__ */ jsx79("div", { className: "UserList__hint", children: t("userList.hint.text") }),
30355
- filteredCollaborators.map(
30356
- (collaborator) => renderCollaborator({
30357
- actionManager,
30358
- collaborator,
30359
- socketId: collaborator.socketId,
30360
- withName: true,
30361
- isBeingFollowed: collaborator.socketId === userToFollow
30362
- })
30363
- )
30364
- ] })
30365
- ] })
30366
- }
30367
- )
30368
- ]
29830
+ ) }) : /* @__PURE__ */ jsxs45("div", { className: clsx34("UserList", className), children: [
29831
+ firstNAvatarsJSX,
29832
+ uniqueCollaboratorsArray.length > FIRST_N_AVATARS && /* @__PURE__ */ jsxs45(
29833
+ Popover3.Root,
29834
+ {
29835
+ onOpenChange: (isOpen) => {
29836
+ if (!isOpen) {
29837
+ setSearchTerm("");
30369
29838
  }
30370
- )
30371
- ]
30372
- }
30373
- ) });
29839
+ },
29840
+ children: [
29841
+ /* @__PURE__ */ jsxs45(Popover3.Trigger, { className: "UserList__more", children: [
29842
+ "+",
29843
+ uniqueCollaboratorsArray.length - FIRST_N_AVATARS
29844
+ ] }),
29845
+ /* @__PURE__ */ jsx79(
29846
+ Popover3.Content,
29847
+ {
29848
+ style: {
29849
+ zIndex: 2,
29850
+ width: "13rem",
29851
+ textAlign: "left"
29852
+ },
29853
+ align: "end",
29854
+ sideOffset: 10,
29855
+ children: /* @__PURE__ */ jsxs45(Island, { style: { overflow: "hidden" }, children: [
29856
+ uniqueCollaboratorsArray.length >= SHOW_COLLABORATORS_FILTER_AT && /* @__PURE__ */ jsxs45("div", { className: "UserList__search-wrapper", children: [
29857
+ searchIcon,
29858
+ /* @__PURE__ */ jsx79(
29859
+ "input",
29860
+ {
29861
+ className: "UserList__search",
29862
+ type: "text",
29863
+ placeholder: t("userList.search.placeholder"),
29864
+ value: searchTerm,
29865
+ onChange: (e) => {
29866
+ setSearchTerm(e.target.value);
29867
+ }
29868
+ }
29869
+ )
29870
+ ] }),
29871
+ /* @__PURE__ */ jsxs45("div", { className: "dropdown-menu UserList__collaborators", children: [
29872
+ filteredCollaborators.length === 0 && /* @__PURE__ */ jsx79("div", { className: "UserList__collaborators__empty", children: t("userList.search.empty") }),
29873
+ /* @__PURE__ */ jsx79("div", { className: "UserList__hint", children: t("userList.hint.text") }),
29874
+ filteredCollaborators.map(
29875
+ ([clientId, collaborator]) => renderCollaborator({
29876
+ actionManager,
29877
+ collaborator,
29878
+ clientId,
29879
+ withName: true,
29880
+ isBeingFollowed: collaborator.socketId === userToFollow
29881
+ })
29882
+ )
29883
+ ] })
29884
+ ] })
29885
+ }
29886
+ )
29887
+ ]
29888
+ }
29889
+ )
29890
+ ] });
30374
29891
  },
30375
29892
  (prev, next) => {
30376
29893
  if (prev.collaborators.size !== next.collaborators.size || prev.mobile !== next.mobile || prev.className !== next.className || prev.userToFollow !== next.userToFollow) {
30377
29894
  return false;
30378
29895
  }
30379
- const nextCollaboratorSocketIds = next.collaborators.keys();
30380
29896
  for (const [socketId, collaborator] of prev.collaborators) {
30381
29897
  const nextCollaborator = next.collaborators.get(socketId);
30382
- if (!nextCollaborator || // this checks order of collaborators in the map is the same
30383
- // as previous render
30384
- socketId !== nextCollaboratorSocketIds.next().value || !isShallowEqual(
29898
+ if (!nextCollaborator || !isShallowEqual(
30385
29899
  collaborator,
30386
29900
  nextCollaborator,
30387
29901
  collaboratorComparatorKeys
@@ -30564,7 +30078,7 @@ var init_HelpButton = __esm({
30564
30078
  });
30565
30079
 
30566
30080
  // components/footer/Footer.tsx
30567
- import clsx36 from "clsx";
30081
+ import clsx35 from "clsx";
30568
30082
  import { jsx as jsx83, jsxs as jsxs47 } from "react/jsx-runtime";
30569
30083
  var Footer, Footer_default;
30570
30084
  var init_Footer = __esm({
@@ -30596,7 +30110,7 @@ var init_Footer = __esm({
30596
30110
  /* @__PURE__ */ jsx83(
30597
30111
  "div",
30598
30112
  {
30599
- className: clsx36("layer-ui__wrapper__footer-left zen-mode-transition", {
30113
+ className: clsx35("layer-ui__wrapper__footer-left zen-mode-transition", {
30600
30114
  "layer-ui__wrapper__footer-left--transition-left": appState.zenModeEnabled
30601
30115
  }),
30602
30116
  children: /* @__PURE__ */ jsx83(Stack_default.Col, { gap: 2, children: /* @__PURE__ */ jsxs47(Section, { heading: "canvasActions", children: [
@@ -30611,7 +30125,7 @@ var init_Footer = __esm({
30611
30125
  UndoRedoActions,
30612
30126
  {
30613
30127
  renderAction: actionManager.renderAction,
30614
- className: clsx36("zen-mode-transition", {
30128
+ className: clsx35("zen-mode-transition", {
30615
30129
  "layer-ui__wrapper__footer-left--transition-bottom": appState.zenModeEnabled
30616
30130
  })
30617
30131
  }
@@ -30620,7 +30134,7 @@ var init_Footer = __esm({
30620
30134
  FinalizeAction,
30621
30135
  {
30622
30136
  renderAction: actionManager.renderAction,
30623
- className: clsx36("zen-mode-transition", {
30137
+ className: clsx35("zen-mode-transition", {
30624
30138
  "layer-ui__wrapper__footer-left--transition-left": appState.zenModeEnabled
30625
30139
  })
30626
30140
  }
@@ -30632,7 +30146,7 @@ var init_Footer = __esm({
30632
30146
  /* @__PURE__ */ jsx83(
30633
30147
  "div",
30634
30148
  {
30635
- className: clsx36("layer-ui__wrapper__footer-right zen-mode-transition", {
30149
+ className: clsx35("layer-ui__wrapper__footer-right zen-mode-transition", {
30636
30150
  "transition-right": appState.zenModeEnabled
30637
30151
  }),
30638
30152
  children: /* @__PURE__ */ jsxs47("div", { style: { position: "relative" }, children: [
@@ -30680,7 +30194,7 @@ var init_Button = __esm({
30680
30194
  });
30681
30195
 
30682
30196
  // components/Button.tsx
30683
- import clsx37 from "clsx";
30197
+ import clsx36 from "clsx";
30684
30198
  import { jsx as jsx84 } from "react/jsx-runtime";
30685
30199
  var Button;
30686
30200
  var init_Button2 = __esm({
@@ -30704,7 +30218,7 @@ var init_Button2 = __esm({
30704
30218
  onSelect();
30705
30219
  }),
30706
30220
  type,
30707
- className: clsx37("excalidraw-button", className, { selected }),
30221
+ className: clsx36("excalidraw-button", className, { selected }),
30708
30222
  ...rest,
30709
30223
  children
30710
30224
  }
@@ -30714,7 +30228,7 @@ var init_Button2 = __esm({
30714
30228
  });
30715
30229
 
30716
30230
  // components/Sidebar/SidebarHeader.tsx
30717
- import clsx38 from "clsx";
30231
+ import clsx37 from "clsx";
30718
30232
  import { useContext as useContext2 } from "react";
30719
30233
  import { jsx as jsx85, jsxs as jsxs48 } from "react/jsx-runtime";
30720
30234
  var SidebarHeader;
@@ -30738,7 +30252,7 @@ var init_SidebarHeader = __esm({
30738
30252
  return /* @__PURE__ */ jsxs48(
30739
30253
  "div",
30740
30254
  {
30741
- className: clsx38("sidebar__header", className),
30255
+ className: clsx37("sidebar__header", className),
30742
30256
  "data-testid": "sidebar-header",
30743
30257
  children: [
30744
30258
  children,
@@ -30780,7 +30294,7 @@ var init_SidebarTrigger = __esm({
30780
30294
  });
30781
30295
 
30782
30296
  // components/Sidebar/SidebarTrigger.tsx
30783
- import clsx39 from "clsx";
30297
+ import clsx38 from "clsx";
30784
30298
  import { jsx as jsx86, jsxs as jsxs49 } from "react/jsx-runtime";
30785
30299
  var SidebarTrigger;
30786
30300
  var init_SidebarTrigger2 = __esm({
@@ -30819,7 +30333,7 @@ var init_SidebarTrigger2 = __esm({
30819
30333
  "aria-keyshortcuts": "0"
30820
30334
  }
30821
30335
  ),
30822
- /* @__PURE__ */ jsxs49("div", { className: clsx39("sidebar-trigger", className), style, children: [
30336
+ /* @__PURE__ */ jsxs49("div", { className: clsx38("sidebar-trigger", className), style, children: [
30823
30337
  icon && /* @__PURE__ */ jsx86("div", { children: icon }),
30824
30338
  children && /* @__PURE__ */ jsx86("div", { className: "sidebar-trigger__label", children })
30825
30339
  ] })
@@ -30941,7 +30455,7 @@ var init_Sidebar = __esm({
30941
30455
  // components/Sidebar/Sidebar.tsx
30942
30456
  import {
30943
30457
  useEffect as useEffect24,
30944
- useLayoutEffect as useLayoutEffect7,
30458
+ useLayoutEffect as useLayoutEffect6,
30945
30459
  useRef as useRef19,
30946
30460
  useState as useState24,
30947
30461
  forwardRef as forwardRef3,
@@ -30949,7 +30463,7 @@ import {
30949
30463
  useCallback as useCallback9
30950
30464
  } from "react";
30951
30465
  import { atom as atom8, useSetAtom as useSetAtom3 } from "jotai";
30952
- import clsx40 from "clsx";
30466
+ import clsx39 from "clsx";
30953
30467
  import { jsx as jsx91 } from "react/jsx-runtime";
30954
30468
  import { createElement } from "react";
30955
30469
  var isSidebarDockedAtom, SidebarInner, Sidebar;
@@ -30990,7 +30504,7 @@ var init_Sidebar2 = __esm({
30990
30504
  }
30991
30505
  const setAppState = useExcalidrawSetAppState();
30992
30506
  const setIsSidebarDockedAtom = useSetAtom3(isSidebarDockedAtom, jotaiScope);
30993
- useLayoutEffect7(() => {
30507
+ useLayoutEffect6(() => {
30994
30508
  setIsSidebarDockedAtom(!!docked);
30995
30509
  return () => {
30996
30510
  setIsSidebarDockedAtom(false);
@@ -31049,7 +30563,7 @@ var init_Sidebar2 = __esm({
31049
30563
  Island,
31050
30564
  {
31051
30565
  ...rest,
31052
- className: clsx40("sidebar", { "sidebar--docked": docked }, className),
30566
+ className: clsx39("sidebar", { "sidebar--docked": docked }, className),
31053
30567
  ref: islandRef,
31054
30568
  children: /* @__PURE__ */ jsx91(SidebarPropsContext.Provider, { value: headerPropsRef.current, children })
31055
30569
  }
@@ -31076,7 +30590,7 @@ var init_Sidebar2 = __esm({
31076
30590
  refPrevOpenSidebar.current = appState.openSidebar;
31077
30591
  }, [appState.openSidebar, onStateChange, props.name]);
31078
30592
  const [mounted, setMounted] = useState24(false);
31079
- useLayoutEffect7(() => {
30593
+ useLayoutEffect6(() => {
31080
30594
  setMounted(true);
31081
30595
  return () => setMounted(false);
31082
30596
  }, []);
@@ -31197,7 +30711,7 @@ __export(DefaultItems_exports, {
31197
30711
  Socials: () => Socials,
31198
30712
  ToggleTheme: () => ToggleTheme
31199
30713
  });
31200
- import clsx41 from "clsx";
30714
+ import clsx40 from "clsx";
31201
30715
  import { useSetAtom as useSetAtom4 } from "jotai";
31202
30716
  import { Fragment as Fragment17, jsx as jsx93, jsxs as jsxs51 } from "react/jsx-runtime";
31203
30717
  var LoadScene, SaveToActiveFile, SaveAsImage, Help, ClearCanvas, ToggleTheme, ChangeCanvasBackground, Export, Socials, LiveCollaborationTrigger;
@@ -31435,7 +30949,7 @@ var init_DefaultItems2 = __esm({
31435
30949
  {
31436
30950
  "data-testid": "collab-button",
31437
30951
  icon: usersIcon,
31438
- className: clsx41({
30952
+ className: clsx40({
31439
30953
  "active-collab": isCollaborating
31440
30954
  }),
31441
30955
  onSelect,
@@ -31449,7 +30963,7 @@ var init_DefaultItems2 = __esm({
31449
30963
 
31450
30964
  // components/hoc/withInternalFallback.tsx
31451
30965
  import { atom as atom11, useAtom as useAtom13 } from "jotai";
31452
- import { useLayoutEffect as useLayoutEffect8, useRef as useRef20 } from "react";
30966
+ import { useLayoutEffect as useLayoutEffect7, useRef as useRef20 } from "react";
31453
30967
  import { jsx as jsx94 } from "react/jsx-runtime";
31454
30968
  var withInternalFallback;
31455
30969
  var init_withInternalFallback = __esm({
@@ -31470,7 +30984,7 @@ var init_withInternalFallback = __esm({
31470
30984
  preferHost: false,
31471
30985
  counter: 0
31472
30986
  });
31473
- useLayoutEffect8(() => {
30987
+ useLayoutEffect7(() => {
31474
30988
  const meta = metaRef.current;
31475
30989
  setCounter((c) => {
31476
30990
  const next = c + 1;
@@ -31746,7 +31260,7 @@ var init_OverwriteConfirm2 = __esm({
31746
31260
  });
31747
31261
 
31748
31262
  // components/DefaultSidebar.tsx
31749
- import clsx42 from "clsx";
31263
+ import clsx41 from "clsx";
31750
31264
  import { jsx as jsx98, jsxs as jsxs55 } from "react/jsx-runtime";
31751
31265
  import { createElement as createElement2 } from "react";
31752
31266
  var DefaultSidebarTrigger, DefaultTabTriggers, DefaultSidebar;
@@ -31805,7 +31319,7 @@ var init_DefaultSidebar = __esm({
31805
31319
  ...rest,
31806
31320
  name: "default",
31807
31321
  key: "default",
31808
- className: clsx42("default-sidebar", className),
31322
+ className: clsx41("default-sidebar", className),
31809
31323
  docked: docked ?? appState.defaultSidebarDockedPreference,
31810
31324
  onDock: (
31811
31325
  // `onDock=false` disables docking.
@@ -31864,7 +31378,7 @@ var init_Toolbar = __esm({
31864
31378
  });
31865
31379
 
31866
31380
  // components/LaserPointerButton.tsx
31867
- import clsx43 from "clsx";
31381
+ import clsx42 from "clsx";
31868
31382
  import { jsx as jsx99, jsxs as jsxs56 } from "react/jsx-runtime";
31869
31383
  var DEFAULT_SIZE3, LaserPointerButton;
31870
31384
  var init_LaserPointerButton = __esm({
@@ -31878,7 +31392,7 @@ var init_LaserPointerButton = __esm({
31878
31392
  return /* @__PURE__ */ jsxs56(
31879
31393
  "label",
31880
31394
  {
31881
- className: clsx43(
31395
+ className: clsx42(
31882
31396
  "ToolIcon ToolIcon__LaserPointer",
31883
31397
  `ToolIcon_size_${DEFAULT_SIZE3}`,
31884
31398
  {
@@ -31918,10 +31432,10 @@ import {
31918
31432
  forwardRef as forwardRef4,
31919
31433
  useRef as useRef21,
31920
31434
  useImperativeHandle as useImperativeHandle2,
31921
- useLayoutEffect as useLayoutEffect9,
31435
+ useLayoutEffect as useLayoutEffect8,
31922
31436
  useState as useState25
31923
31437
  } from "react";
31924
- import clsx44 from "clsx";
31438
+ import clsx43 from "clsx";
31925
31439
  import { jsx as jsx100, jsxs as jsxs57 } from "react/jsx-runtime";
31926
31440
  var TextField;
31927
31441
  var init_TextField2 = __esm({
@@ -31945,7 +31459,7 @@ var init_TextField2 = __esm({
31945
31459
  }, ref) => {
31946
31460
  const innerRef = useRef21(null);
31947
31461
  useImperativeHandle2(ref, () => innerRef.current);
31948
- useLayoutEffect9(() => {
31462
+ useLayoutEffect8(() => {
31949
31463
  if (selectOnRender) {
31950
31464
  innerRef.current?.select();
31951
31465
  }
@@ -31954,7 +31468,7 @@ var init_TextField2 = __esm({
31954
31468
  return /* @__PURE__ */ jsxs57(
31955
31469
  "div",
31956
31470
  {
31957
- className: clsx44("ExcTextField", {
31471
+ className: clsx43("ExcTextField", {
31958
31472
  "ExcTextField--fullWidth": fullWidth
31959
31473
  }),
31960
31474
  onClick: () => {
@@ -31965,14 +31479,14 @@ var init_TextField2 = __esm({
31965
31479
  /* @__PURE__ */ jsxs57(
31966
31480
  "div",
31967
31481
  {
31968
- className: clsx44("ExcTextField__input", {
31482
+ className: clsx43("ExcTextField__input", {
31969
31483
  "ExcTextField__input--readonly": readonly
31970
31484
  }),
31971
31485
  children: [
31972
31486
  /* @__PURE__ */ jsx100(
31973
31487
  "input",
31974
31488
  {
31975
- className: clsx44({
31489
+ className: clsx43({
31976
31490
  "is-redacted": "value" in rest && rest.value && isRedacted && !isTemporarilyUnredacted
31977
31491
  }),
31978
31492
  readOnly: readonly,
@@ -32407,7 +31921,7 @@ var init_TTDDialogPanels = __esm({
32407
31921
  });
32408
31922
 
32409
31923
  // components/TTDDialog/TTDDialogPanel.tsx
32410
- import clsx45 from "clsx";
31924
+ import clsx44 from "clsx";
32411
31925
  import { jsx as jsx107, jsxs as jsxs59 } from "react/jsx-runtime";
32412
31926
  var TTDDialogPanel;
32413
31927
  var init_TTDDialogPanel = __esm({
@@ -32435,7 +31949,7 @@ var init_TTDDialogPanel = __esm({
32435
31949
  /* @__PURE__ */ jsxs59(
32436
31950
  "div",
32437
31951
  {
32438
- className: clsx45("ttd-dialog-panel-button-container", {
31952
+ className: clsx44("ttd-dialog-panel-button-container", {
32439
31953
  invisible: !panelAction
32440
31954
  }),
32441
31955
  style: { display: "flex", alignItems: "center" },
@@ -32448,7 +31962,7 @@ var init_TTDDialogPanel = __esm({
32448
31962
  },
32449
31963
  disabled: panelActionDisabled || onTextSubmitInProgess,
32450
31964
  children: [
32451
- /* @__PURE__ */ jsxs59("div", { className: clsx45({ invisible: onTextSubmitInProgess }), children: [
31965
+ /* @__PURE__ */ jsxs59("div", { className: clsx44({ invisible: onTextSubmitInProgess }), children: [
32452
31966
  panelAction?.label,
32453
31967
  panelAction?.icon && /* @__PURE__ */ jsx107("span", { children: panelAction.icon })
32454
31968
  ] }),
@@ -33052,7 +32566,7 @@ TTD mermaid definition render errror: ${error3.message}`,
33052
32566
  });
33053
32567
 
33054
32568
  // components/LayerUI.tsx
33055
- import clsx46 from "clsx";
32569
+ import clsx45 from "clsx";
33056
32570
  import React35 from "react";
33057
32571
  import { Provider, useAtom as useAtom16, useAtomValue as useAtomValue2 } from "jotai";
33058
32572
  import { Fragment as Fragment19, jsx as jsx115, jsxs as jsxs64 } from "react/jsx-runtime";
@@ -33202,7 +32716,7 @@ var init_LayerUI2 = __esm({
33202
32716
  Section,
33203
32717
  {
33204
32718
  heading: "selectedShapeActions",
33205
- className: clsx46("selected-shape-actions zen-mode-transition", {
32719
+ className: clsx45("selected-shape-actions zen-mode-transition", {
33206
32720
  "transition-left": appState.zenModeEnabled
33207
32721
  }),
33208
32722
  children: /* @__PURE__ */ jsx115(
@@ -33233,7 +32747,7 @@ var init_LayerUI2 = __esm({
33233
32747
  elements
33234
32748
  );
33235
32749
  return /* @__PURE__ */ jsx115(FixedSideContainer, { side: "top", children: /* @__PURE__ */ jsxs64("div", { className: "App-menu App-menu_top", children: [
33236
- /* @__PURE__ */ jsxs64(Stack_default.Col, { gap: 6, className: clsx46("App-menu_top__left"), children: [
32750
+ /* @__PURE__ */ jsxs64(Stack_default.Col, { gap: 6, className: clsx45("App-menu_top__left"), children: [
33237
32751
  renderCanvasActions(),
33238
32752
  shouldRenderSelectedShapeActions && renderSelectedShapeActions()
33239
32753
  ] }),
@@ -33243,7 +32757,7 @@ var init_LayerUI2 = __esm({
33243
32757
  Stack_default.Row,
33244
32758
  {
33245
32759
  gap: 1,
33246
- className: clsx46("App-toolbar-container", {
32760
+ className: clsx45("App-toolbar-container", {
33247
32761
  "zen-mode": appState.zenModeEnabled
33248
32762
  }),
33249
32763
  children: [
@@ -33251,7 +32765,7 @@ var init_LayerUI2 = __esm({
33251
32765
  Island,
33252
32766
  {
33253
32767
  padding: 1,
33254
- className: clsx46("App-toolbar", {
32768
+ className: clsx45("App-toolbar", {
33255
32769
  "zen-mode": appState.zenModeEnabled
33256
32770
  }),
33257
32771
  children: [
@@ -33333,7 +32847,7 @@ var init_LayerUI2 = __esm({
33333
32847
  /* @__PURE__ */ jsxs64(
33334
32848
  "div",
33335
32849
  {
33336
- className: clsx46(
32850
+ className: clsx45(
33337
32851
  "layer-ui__wrapper__top-right zen-mode-transition",
33338
32852
  {
33339
32853
  "transition-right": appState.zenModeEnabled
@@ -34918,7 +34432,6 @@ var init_transform = __esm({
34918
34432
  init_utils();
34919
34433
  init_points();
34920
34434
  init_random();
34921
- init_fractionalIndex();
34922
34435
  DEFAULT_LINEAR_ELEMENT_PROPS = {
34923
34436
  width: 100,
34924
34437
  height: 0
@@ -35126,12 +34639,10 @@ var init_transform = __esm({
35126
34639
  this.excalidrawElements.set(ele.id, ele);
35127
34640
  };
35128
34641
  getElements = () => {
35129
- return syncInvalidIndices(Array.from(this.excalidrawElements.values()));
34642
+ return Array.from(this.excalidrawElements.values());
35130
34643
  };
35131
34644
  getElementsMap = () => {
35132
- return toBrandedType(
35133
- arrayToMap(this.getElements())
35134
- );
34645
+ return toBrandedType(this.excalidrawElements);
35135
34646
  };
35136
34647
  getElement = (id) => {
35137
34648
  return this.excalidrawElements.get(id);
@@ -35431,6 +34942,46 @@ var init_reactUtils = __esm({
35431
34942
  }
35432
34943
  });
35433
34944
 
34945
+ // renderer/roundRect.ts
34946
+ var roundRect;
34947
+ var init_roundRect = __esm({
34948
+ "renderer/roundRect.ts"() {
34949
+ "use strict";
34950
+ init_define_import_meta_env();
34951
+ roundRect = (context, x, y, width, height, radius, strokeColor) => {
34952
+ context.beginPath();
34953
+ context.moveTo(x + radius, y);
34954
+ context.lineTo(x + width - radius, y);
34955
+ context.quadraticCurveTo(x + width, y, x + width, y + radius);
34956
+ context.lineTo(x + width, y + height - radius);
34957
+ context.quadraticCurveTo(
34958
+ x + width,
34959
+ y + height,
34960
+ x + width - radius,
34961
+ y + height
34962
+ );
34963
+ context.lineTo(x + radius, y + height);
34964
+ context.quadraticCurveTo(x, y + height, x, y + height - radius);
34965
+ context.lineTo(x, y + radius);
34966
+ context.quadraticCurveTo(x, y, x + radius, y);
34967
+ context.closePath();
34968
+ context.fill();
34969
+ if (strokeColor) {
34970
+ context.strokeStyle = strokeColor;
34971
+ }
34972
+ context.stroke();
34973
+ };
34974
+ }
34975
+ });
34976
+
34977
+ // types.ts
34978
+ var init_types = __esm({
34979
+ "types.ts"() {
34980
+ "use strict";
34981
+ init_define_import_meta_env();
34982
+ }
34983
+ });
34984
+
35434
34985
  // renderer/renderSnaps.ts
35435
34986
  var SNAP_COLOR_LIGHT, SNAP_COLOR_DARK, SNAP_WIDTH, SNAP_CROSS_SIZE, renderSnaps, drawPointsSnapLine, drawPointerSnapLine, drawCross, drawLine, drawGapLine;
35436
34987
  var init_renderSnaps = __esm({
@@ -35567,6 +35118,7 @@ var init_interactiveScene = __esm({
35567
35118
  init_groups();
35568
35119
  init_transformHandles();
35569
35120
  init_utils();
35121
+ init_types();
35570
35122
  init_constants();
35571
35123
  init_renderSnaps();
35572
35124
  init_collision();
@@ -36029,18 +35581,15 @@ var init_interactiveScene = __esm({
36029
35581
  if (locallySelectedIds.has(element.id) && !isSelectedViaGroup(appState, element)) {
36030
35582
  selectionColors.push(selectionColor);
36031
35583
  }
36032
- const remoteClients = renderConfig.remoteSelectedElementIds.get(
36033
- element.id
36034
- );
36035
- if (remoteClients) {
35584
+ if (renderConfig.remoteSelectedElementIds[element.id]) {
36036
35585
  selectionColors.push(
36037
- ...remoteClients.map((socketId) => {
36038
- const background = getClientColor(
36039
- socketId,
36040
- appState.collaborators.get(socketId)
36041
- );
36042
- return background;
36043
- })
35586
+ ...renderConfig.remoteSelectedElementIds[element.id].map(
35587
+ (socketId) => {
35588
+ const { id } = renderConfig.remotePointerViewportCoords[socketId];
35589
+ const background = getClientColor(id);
35590
+ return background;
35591
+ }
35592
+ )
36044
35593
  );
36045
35594
  }
36046
35595
  if (selectionColors.length) {
@@ -36052,7 +35601,7 @@ var init_interactiveScene = __esm({
36052
35601
  elementX2,
36053
35602
  elementY2,
36054
35603
  selectionColors,
36055
- dashed: !!remoteClients,
35604
+ dashed: !!renderConfig.remoteSelectedElementIds[element.id],
36056
35605
  cx,
36057
35606
  cy,
36058
35607
  activeEmbeddable: appState.activeEmbeddable?.element === element && appState.activeEmbeddable.state === "active"
@@ -36147,13 +35696,107 @@ var init_interactiveScene = __esm({
36147
35696
  }
36148
35697
  renderSnaps(context, appState);
36149
35698
  context.restore();
36150
- renderRemoteCursors({
36151
- context,
36152
- renderConfig,
36153
- appState,
36154
- normalizedWidth,
36155
- normalizedHeight
36156
- });
35699
+ for (const clientId in renderConfig.remotePointerViewportCoords) {
35700
+ let { x, y, id } = renderConfig.remotePointerViewportCoords[clientId];
35701
+ x -= appState.offsetLeft;
35702
+ y -= appState.offsetTop;
35703
+ const width = 11;
35704
+ const height = 14;
35705
+ const isOutOfBounds = x < 0 || x > normalizedWidth - width || y < 0 || y > normalizedHeight - height;
35706
+ x = Math.max(x, 0);
35707
+ x = Math.min(x, normalizedWidth - width);
35708
+ y = Math.max(y, 0);
35709
+ y = Math.min(y, normalizedHeight - height);
35710
+ const background = getClientColor(id);
35711
+ context.save();
35712
+ context.strokeStyle = background;
35713
+ context.fillStyle = background;
35714
+ const userState = renderConfig.remotePointerUserStates[clientId];
35715
+ const isInactive = isOutOfBounds || userState === "idle" /* IDLE */ || userState === "away" /* AWAY */;
35716
+ if (isInactive) {
35717
+ context.globalAlpha = 0.3;
35718
+ }
35719
+ if (renderConfig.remotePointerButton && renderConfig.remotePointerButton[clientId] === "down") {
35720
+ context.beginPath();
35721
+ context.arc(x, y, 15, 0, 2 * Math.PI, false);
35722
+ context.lineWidth = 3;
35723
+ context.strokeStyle = "#ffffff88";
35724
+ context.stroke();
35725
+ context.closePath();
35726
+ context.beginPath();
35727
+ context.arc(x, y, 15, 0, 2 * Math.PI, false);
35728
+ context.lineWidth = 1;
35729
+ context.strokeStyle = background;
35730
+ context.stroke();
35731
+ context.closePath();
35732
+ }
35733
+ context.fillStyle = oc3.white;
35734
+ context.strokeStyle = oc3.white;
35735
+ context.lineWidth = 6;
35736
+ context.lineJoin = "round";
35737
+ context.beginPath();
35738
+ context.moveTo(x, y);
35739
+ context.lineTo(x + 0, y + 14);
35740
+ context.lineTo(x + 4, y + 9);
35741
+ context.lineTo(x + 11, y + 8);
35742
+ context.closePath();
35743
+ context.stroke();
35744
+ context.fill();
35745
+ context.fillStyle = background;
35746
+ context.strokeStyle = background;
35747
+ context.lineWidth = 2;
35748
+ context.lineJoin = "round";
35749
+ context.beginPath();
35750
+ if (isInactive) {
35751
+ context.moveTo(x - 1, y - 1);
35752
+ context.lineTo(x - 1, y + 15);
35753
+ context.lineTo(x + 5, y + 10);
35754
+ context.lineTo(x + 12, y + 9);
35755
+ context.closePath();
35756
+ context.fill();
35757
+ } else {
35758
+ context.moveTo(x, y);
35759
+ context.lineTo(x + 0, y + 14);
35760
+ context.lineTo(x + 4, y + 9);
35761
+ context.lineTo(x + 11, y + 8);
35762
+ context.closePath();
35763
+ context.fill();
35764
+ context.stroke();
35765
+ }
35766
+ const username = renderConfig.remotePointerUsernames[clientId] || "";
35767
+ if (!isOutOfBounds && username) {
35768
+ context.font = "600 12px sans-serif";
35769
+ const offsetX = x + width / 2;
35770
+ const offsetY = y + height + 2;
35771
+ const paddingHorizontal = 5;
35772
+ const paddingVertical = 3;
35773
+ const measure = context.measureText(username);
35774
+ const measureHeight = measure.actualBoundingBoxDescent + measure.actualBoundingBoxAscent;
35775
+ const finalHeight = Math.max(measureHeight, 12);
35776
+ const boxX = offsetX - 1;
35777
+ const boxY = offsetY - 1;
35778
+ const boxWidth = measure.width + 2 + paddingHorizontal * 2 + 2;
35779
+ const boxHeight = finalHeight + 2 + paddingVertical * 2 + 2;
35780
+ if (context.roundRect) {
35781
+ context.beginPath();
35782
+ context.roundRect(boxX, boxY, boxWidth, boxHeight, 8);
35783
+ context.fillStyle = background;
35784
+ context.fill();
35785
+ context.strokeStyle = oc3.white;
35786
+ context.stroke();
35787
+ } else {
35788
+ roundRect(context, boxX, boxY, boxWidth, boxHeight, 8, oc3.white);
35789
+ }
35790
+ context.fillStyle = oc3.black;
35791
+ context.fillText(
35792
+ username,
35793
+ offsetX + paddingHorizontal + 1,
35794
+ offsetY + paddingVertical + measure.actualBoundingBoxAscent + Math.floor((finalHeight - measureHeight) / 2) + 2
35795
+ );
35796
+ }
35797
+ context.restore();
35798
+ context.closePath();
35799
+ }
36157
35800
  let scrollBars;
36158
35801
  if (renderConfig.renderScrollbars) {
36159
35802
  scrollBars = getScrollBars(
@@ -36224,40 +35867,40 @@ var init_InteractiveCanvas = __esm({
36224
35867
  isComponentMounted.current = true;
36225
35868
  return;
36226
35869
  }
36227
- const remotePointerButton = /* @__PURE__ */ new Map();
36228
- const remotePointerViewportCoords = /* @__PURE__ */ new Map();
36229
- const remoteSelectedElementIds = /* @__PURE__ */ new Map();
36230
- const remotePointerUsernames = /* @__PURE__ */ new Map();
36231
- const remotePointerUserStates = /* @__PURE__ */ new Map();
35870
+ const cursorButton = {};
35871
+ const pointerViewportCoords = {};
35872
+ const remoteSelectedElementIds = {};
35873
+ const pointerUsernames = {};
35874
+ const pointerUserStates = {};
36232
35875
  props.appState.collaborators.forEach((user, socketId) => {
36233
35876
  if (user.selectedElementIds) {
36234
35877
  for (const id of Object.keys(user.selectedElementIds)) {
36235
- if (!remoteSelectedElementIds.has(id)) {
36236
- remoteSelectedElementIds.set(id, []);
35878
+ if (!(id in remoteSelectedElementIds)) {
35879
+ remoteSelectedElementIds[id] = [];
36237
35880
  }
36238
- remoteSelectedElementIds.get(id).push(socketId);
35881
+ remoteSelectedElementIds[id].push(socketId);
36239
35882
  }
36240
35883
  }
36241
35884
  if (!user.pointer || user.pointer.renderCursor === false) {
36242
35885
  return;
36243
35886
  }
36244
35887
  if (user.username) {
36245
- remotePointerUsernames.set(socketId, user.username);
35888
+ pointerUsernames[socketId] = user.username;
36246
35889
  }
36247
35890
  if (user.userState) {
36248
- remotePointerUserStates.set(socketId, user.userState);
35891
+ pointerUserStates[socketId] = user.userState;
36249
35892
  }
36250
- remotePointerViewportCoords.set(
36251
- socketId,
36252
- sceneCoordsToViewportCoords(
35893
+ pointerViewportCoords[socketId] = {
35894
+ ...sceneCoordsToViewportCoords(
36253
35895
  {
36254
35896
  sceneX: user.pointer.x,
36255
35897
  sceneY: user.pointer.y
36256
35898
  },
36257
35899
  props.appState
36258
- )
36259
- );
36260
- remotePointerButton.set(socketId, user.button);
35900
+ ),
35901
+ id: user.id || socketId
35902
+ };
35903
+ cursorButton[socketId] = user.button;
36261
35904
  });
36262
35905
  const selectionColor = props.containerRef?.current && getComputedStyle(props.containerRef.current).getPropertyValue(
36263
35906
  "--color-selection"
@@ -36271,11 +35914,11 @@ var init_InteractiveCanvas = __esm({
36271
35914
  scale: window.devicePixelRatio,
36272
35915
  appState: props.appState,
36273
35916
  renderConfig: {
36274
- remotePointerViewportCoords,
36275
- remotePointerButton,
35917
+ remotePointerViewportCoords: pointerViewportCoords,
35918
+ remotePointerButton: cursorButton,
36276
35919
  remoteSelectedElementIds,
36277
- remotePointerUsernames,
36278
- remotePointerUserStates,
35920
+ remotePointerUsernames: pointerUsernames,
35921
+ remotePointerUserStates: pointerUserStates,
36279
35922
  selectionColor,
36280
35923
  renderScrollbars: false
36281
35924
  },
@@ -36749,7 +36392,7 @@ Please output JUST THE HTML file containing your best attempt at implementing th
36749
36392
  });
36750
36393
 
36751
36394
  // components/MagicButton.tsx
36752
- import clsx47 from "clsx";
36395
+ import clsx46 from "clsx";
36753
36396
  import { jsx as jsx122, jsxs as jsxs67 } from "react/jsx-runtime";
36754
36397
  var DEFAULT_SIZE4, ElementCanvasButton;
36755
36398
  var init_MagicButton = __esm({
@@ -36762,7 +36405,7 @@ var init_MagicButton = __esm({
36762
36405
  return /* @__PURE__ */ jsxs67(
36763
36406
  "label",
36764
36407
  {
36765
- className: clsx47(
36408
+ className: clsx46(
36766
36409
  "ToolIcon ToolIcon__MagicButton",
36767
36410
  `ToolIcon_size_${DEFAULT_SIZE4}`,
36768
36411
  {
@@ -37068,7 +36711,7 @@ var init_laser_trails = __esm({
37068
36711
  if (!this.collabTrails.has(key)) {
37069
36712
  trail = new AnimatedTrail(this.animationFrameHandler, this.app, {
37070
36713
  ...this.getTrailOptions(),
37071
- fill: () => collaborator.pointer?.laserColor || getClientColor(key, collaborator)
36714
+ fill: () => collaborator.pointer?.laserColor || getClientColor(collaborator.id || key)
37072
36715
  });
37073
36716
  trail.start(this.container);
37074
36717
  this.collabTrails.set(key, trail);
@@ -37592,11 +37235,11 @@ var init_textWysiwyg = __esm({
37592
37235
  import React38, { useContext as useContext3 } from "react";
37593
37236
  import { flushSync } from "react-dom";
37594
37237
  import rough4 from "roughjs/bin/rough";
37595
- import clsx48 from "clsx";
37238
+ import clsx47 from "clsx";
37596
37239
  import { nanoid as nanoid3 } from "nanoid";
37597
37240
  import throttle2 from "lodash.throttle";
37598
37241
  import { Fragment as Fragment20, jsx as jsx124, jsxs as jsxs69 } from "react/jsx-runtime";
37599
- var AppContext, AppPropsContext, deviceContextInitialValue, DeviceContext, ExcalidrawContainerContext, ExcalidrawElementsContext, ExcalidrawAppStateContext, ExcalidrawSetAppStateContext, ExcalidrawActionManagerContext, useApp, useAppProps, useDevice, useExcalidrawContainer, useExcalidrawElements, useExcalidrawAppState, useExcalidrawSetAppState, useExcalidrawActionManager, didTapTwice, tappedTwiceTimer, isHoldingSpace, isPanning, isDraggingScrollBar, currentScrollBars, touchTimeout, invalidateContextMenu, YOUTUBE_VIDEO_STATES, IS_PLAIN_PASTE, IS_PLAIN_PASTE_TIMER, PLAIN_PASTE_TOAST_SHOWN, lastPointerUp, gesture, App, createTestHook, App_default;
37242
+ var AppContext, AppPropsContext, deviceContextInitialValue, DeviceContext, ExcalidrawContainerContext, ExcalidrawElementsContext, ExcalidrawAppStateContext, ExcalidrawSetAppStateContext, ExcalidrawActionManagerContext, useApp, useAppProps, useDevice, useExcalidrawContainer, useExcalidrawElements, useExcalidrawAppState, useExcalidrawSetAppState, useExcalidrawActionManager, supportsResizeObserver, didTapTwice, tappedTwiceTimer, isHoldingSpace, isPanning, isDraggingScrollBar, currentScrollBars, touchTimeout, invalidateContextMenu, YOUTUBE_VIDEO_STATES, IS_PLAIN_PASTE, IS_PLAIN_PASTE_TIMER, PLAIN_PASTE_TOAST_SHOWN, lastPointerUp, gesture, App, createTestHook, App_default;
37600
37243
  var init_App = __esm({
37601
37244
  "components/App.tsx"() {
37602
37245
  "use strict";
@@ -37681,7 +37324,6 @@ var init_App = __esm({
37681
37324
  init_renderElement();
37682
37325
  init_textWysiwyg();
37683
37326
  init_scrollbars();
37684
- init_fractionalIndex();
37685
37327
  init_helpers();
37686
37328
  AppContext = React38.createContext(null);
37687
37329
  AppPropsContext = React38.createContext(null);
@@ -37726,6 +37368,7 @@ var init_App = __esm({
37726
37368
  useExcalidrawAppState = () => useContext3(ExcalidrawAppStateContext);
37727
37369
  useExcalidrawSetAppState = () => useContext3(ExcalidrawSetAppStateContext);
37728
37370
  useExcalidrawActionManager = () => useContext3(ExcalidrawActionManagerContext);
37371
+ supportsResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
37729
37372
  didTapTwice = false;
37730
37373
  tappedTwiceTimer = 0;
37731
37374
  isHoldingSpace = false;
@@ -38216,7 +37859,7 @@ var init_App = __esm({
38216
37859
  return /* @__PURE__ */ jsx124(
38217
37860
  "div",
38218
37861
  {
38219
- className: clsx48("excalidraw__embeddable-container", {
37862
+ className: clsx47("excalidraw__embeddable-container", {
38220
37863
  "is-hovered": isHovered
38221
37864
  }),
38222
37865
  style: {
@@ -38469,7 +38112,7 @@ var init_App = __esm({
38469
38112
  return /* @__PURE__ */ jsx124(
38470
38113
  "div",
38471
38114
  {
38472
- className: clsx48("excalidraw excalidraw-container", {
38115
+ className: clsx47("excalidraw excalidraw-container", {
38473
38116
  "excalidraw--view-mode": this.state.viewModeEnabled,
38474
38117
  "excalidraw--mobile": this.device.editor.isMobile,
38475
38118
  "excalidraw--zen-mode": this.state.zenModeEnabled
@@ -38964,7 +38607,7 @@ var init_App = __esm({
38964
38607
  opacity: 100,
38965
38608
  locked: false
38966
38609
  });
38967
- this.scene.insertElement(frame);
38610
+ this.scene.addNewElement(frame);
38968
38611
  for (const child of selectedElements) {
38969
38612
  mutateElement(child, { frameId: frame.id });
38970
38613
  }
@@ -39809,18 +39452,19 @@ var init_App = __esm({
39809
39452
  randomizeSeed: !opts.retainSeed
39810
39453
  }
39811
39454
  );
39812
- const prevElements = this.scene.getElementsIncludingDeleted();
39813
- const nextElements = [...prevElements, ...newElements];
39814
- syncMovedIndices(nextElements, arrayToMap(newElements));
39455
+ const allElements = [
39456
+ ...this.scene.getElementsIncludingDeleted(),
39457
+ ...newElements
39458
+ ];
39815
39459
  const topLayerFrame = this.getTopLayerFrameAtSceneCoords({ x, y });
39816
39460
  if (topLayerFrame) {
39817
39461
  const eligibleElements = filterElementsEligibleAsFrameChildren(
39818
39462
  newElements,
39819
39463
  topLayerFrame
39820
39464
  );
39821
- addElementsToFrame(nextElements, eligibleElements, topLayerFrame);
39465
+ addElementsToFrame(allElements, eligibleElements, topLayerFrame);
39822
39466
  }
39823
- this.scene.replaceAllElements(nextElements);
39467
+ this.scene.replaceAllElements(allElements);
39824
39468
  newElements.forEach((newElement2) => {
39825
39469
  if (isTextElement(newElement2) && isBoundToContainer(newElement2)) {
39826
39470
  const container = getContainerElement(
@@ -40008,7 +39652,18 @@ var init_App = __esm({
40008
39652
  if (textElements.length === 0) {
40009
39653
  return;
40010
39654
  }
40011
- this.scene.insertElements(textElements);
39655
+ const frameId = textElements[0].frameId;
39656
+ if (frameId) {
39657
+ this.scene.insertElementsAtIndex(
39658
+ textElements,
39659
+ this.scene.getElementIndex(frameId)
39660
+ );
39661
+ } else {
39662
+ this.scene.replaceAllElements([
39663
+ ...this.scene.getElementsIncludingDeleted(),
39664
+ ...textElements
39665
+ ]);
39666
+ }
40012
39667
  this.setState({
40013
39668
  selectedElementIds: makeNextSelectedElementIds(
40014
39669
  Object.fromEntries(textElements.map((el) => [el.id, true])),
@@ -40871,7 +40526,7 @@ var init_App = __esm({
40871
40526
  const containerIndex = this.scene.getElementIndex(container.id);
40872
40527
  this.scene.insertElementAtIndex(element, containerIndex + 1);
40873
40528
  } else {
40874
- this.scene.insertElement(element);
40529
+ this.scene.addNewElement(element);
40875
40530
  }
40876
40531
  }
40877
40532
  this.setState({
@@ -42263,7 +41918,7 @@ var init_App = __esm({
42263
41918
  this.scene.getNonDeletedElements(),
42264
41919
  this.scene.getNonDeletedElementsMap()
42265
41920
  );
42266
- this.scene.insertElement(element);
41921
+ this.scene.addNewElement(element);
42267
41922
  this.setState({
42268
41923
  draggingElement: element,
42269
41924
  editingElement: element,
@@ -42298,7 +41953,10 @@ var init_App = __esm({
42298
41953
  width,
42299
41954
  height
42300
41955
  });
42301
- this.scene.insertElement(element);
41956
+ this.scene.replaceAllElements([
41957
+ ...this.scene.getElementsIncludingDeleted(),
41958
+ element
41959
+ ]);
42302
41960
  return element;
42303
41961
  };
42304
41962
  //create rectangle element with youtube top left on nearest grid point width / hight 640/360
@@ -42339,7 +41997,10 @@ var init_App = __esm({
42339
41997
  height: embedLink.intrinsicSize.h,
42340
41998
  link
42341
41999
  });
42342
- this.scene.insertElement(element);
42000
+ this.scene.replaceAllElements([
42001
+ ...this.scene.getElementsIncludingDeleted(),
42002
+ element
42003
+ ]);
42343
42004
  return element;
42344
42005
  };
42345
42006
  createImageElement = ({
@@ -42455,7 +42116,7 @@ var init_App = __esm({
42455
42116
  this.scene.getNonDeletedElements(),
42456
42117
  this.scene.getNonDeletedElementsMap()
42457
42118
  );
42458
- this.scene.insertElement(element);
42119
+ this.scene.addNewElement(element);
42459
42120
  this.setState({
42460
42121
  draggingElement: element,
42461
42122
  editingElement: element,
@@ -42511,7 +42172,7 @@ var init_App = __esm({
42511
42172
  draggingElement: element
42512
42173
  });
42513
42174
  } else {
42514
- this.scene.insertElement(element);
42175
+ this.scene.addNewElement(element);
42515
42176
  this.setState({
42516
42177
  multiElement: null,
42517
42178
  draggingElement: element,
@@ -42533,7 +42194,10 @@ var init_App = __esm({
42533
42194
  ...FRAME_STYLE
42534
42195
  };
42535
42196
  const frame = type === TOOL_TYPE.magicframe ? newMagicFrameElement(constructorOpts) : newFrameElement(constructorOpts);
42536
- this.scene.insertElement(frame);
42197
+ this.scene.replaceAllElements([
42198
+ ...this.scene.getElementsIncludingDeleted(),
42199
+ frame
42200
+ ]);
42537
42201
  this.setState({
42538
42202
  multiElement: null,
42539
42203
  draggingElement: frame,
@@ -42821,7 +42485,6 @@ var init_App = __esm({
42821
42485
  }
42822
42486
  }
42823
42487
  const nextSceneElements = [...nextElements, ...elementsToAppend];
42824
- syncMovedIndices(nextSceneElements, arrayToMap(elementsToAppend));
42825
42488
  bindTextToShapeAfterDuplication(
42826
42489
  nextElements,
42827
42490
  elementsToAppend,
@@ -43715,7 +43378,7 @@ var init_App = __esm({
43715
43378
  this.setState({ errorMessage: t("errors.imageToolNotSupported") });
43716
43379
  return;
43717
43380
  }
43718
- this.scene.insertElement(imageElement);
43381
+ this.scene.addNewElement(imageElement);
43719
43382
  try {
43720
43383
  return await this.initializeImage({
43721
43384
  imageFile,
@@ -44589,9 +44252,7 @@ var init_App = __esm({
44589
44252
  return this.app?.scene.getElementsIncludingDeleted();
44590
44253
  },
44591
44254
  set(elements) {
44592
- return this.app?.scene.replaceAllElements(
44593
- syncInvalidIndices(elements)
44594
- );
44255
+ return this.app?.scene.replaceAllElements(elements);
44595
44256
  }
44596
44257
  }
44597
44258
  });
@@ -44662,7 +44323,7 @@ var init_FooterCenter = __esm({
44662
44323
  });
44663
44324
 
44664
44325
  // components/footer/FooterCenter.tsx
44665
- import clsx49 from "clsx";
44326
+ import clsx48 from "clsx";
44666
44327
  import { jsx as jsx125 } from "react/jsx-runtime";
44667
44328
  var FooterCenter, FooterCenter_default;
44668
44329
  var init_FooterCenter2 = __esm({
@@ -44678,7 +44339,7 @@ var init_FooterCenter2 = __esm({
44678
44339
  return /* @__PURE__ */ jsx125(FooterCenterTunnel.In, { children: /* @__PURE__ */ jsx125(
44679
44340
  "div",
44680
44341
  {
44681
- className: clsx49("footer-center zen-mode-transition", {
44342
+ className: clsx48("footer-center zen-mode-transition", {
44682
44343
  "layer-ui__wrapper__footer-left--transition-bottom": appState.zenModeEnabled
44683
44344
  }),
44684
44345
  children
@@ -44989,7 +44650,7 @@ var init_LiveCollaborationTrigger = __esm({
44989
44650
  });
44990
44651
 
44991
44652
  // components/live-collaboration/LiveCollaborationTrigger.tsx
44992
- import clsx50 from "clsx";
44653
+ import clsx49 from "clsx";
44993
44654
  import { jsx as jsx130, jsxs as jsxs74 } from "react/jsx-runtime";
44994
44655
  var LiveCollaborationTrigger2, LiveCollaborationTrigger_default;
44995
44656
  var init_LiveCollaborationTrigger2 = __esm({
@@ -45012,7 +44673,7 @@ var init_LiveCollaborationTrigger2 = __esm({
45012
44673
  Button,
45013
44674
  {
45014
44675
  ...rest,
45015
- className: clsx50("collab-button", { active: isCollaborating }),
44676
+ className: clsx49("collab-button", { active: isCollaborating }),
45016
44677
  type: "button",
45017
44678
  onSelect,
45018
44679
  style: { position: "relative", width: showIconOnly ? void 0 : "auto" },