@excalidraw/excalidraw 0.18.0-f87f6d086 → 0.18.0-ffcb67b
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.
- package/dist/dev/{chunk-CRKRRBMD.js → chunk-3BOYZTLR.js} +309 -457
- package/dist/dev/chunk-3BOYZTLR.js.map +7 -0
- package/dist/dev/{chunk-FB2NA5UG.js → chunk-6JJSWC4C.js} +1 -1
- package/dist/dev/{chunk-FB2NA5UG.js.map → chunk-6JJSWC4C.js.map} +2 -2
- package/dist/dev/{chunk-QF5FRM6O.js → chunk-IFMURN5W.js} +108 -29
- package/dist/dev/chunk-IFMURN5W.js.map +7 -0
- package/dist/dev/chunk-URPEKBQ3.js +69 -0
- package/dist/dev/chunk-URPEKBQ3.js.map +7 -0
- package/dist/dev/{chunk-CP5DND7P.js → chunk-Y3BTNZQY.js} +2 -2
- package/dist/dev/data/{image-IWGLHPIX.js → image-VHVPDZAZ.js} +3 -3
- package/dist/dev/index.css +2030 -886
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +18060 -13227
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{ar-SA-XORAP2EK.js → ar-SA-AGVJN2FU.js} +354 -142
- package/dist/dev/locales/ar-SA-AGVJN2FU.js.map +7 -0
- package/dist/dev/locales/{az-AZ-NAUU3Z4Y.js → az-AZ-62IXPX5D.js} +296 -84
- package/dist/dev/locales/az-AZ-62IXPX5D.js.map +7 -0
- package/dist/dev/locales/{bg-BG-AAABLFCY.js → bg-BG-UBDZF4KA.js} +284 -72
- package/dist/dev/locales/bg-BG-UBDZF4KA.js.map +7 -0
- package/dist/dev/locales/{bn-BD-PM4AC5WG.js → bn-BD-4TAUVZOD.js} +264 -52
- package/dist/dev/locales/bn-BD-4TAUVZOD.js.map +7 -0
- package/dist/dev/locales/bn-IN-PUGL2LDE.js +798 -0
- package/dist/dev/locales/bn-IN-PUGL2LDE.js.map +7 -0
- package/dist/dev/locales/{ca-ES-YNNMFRQX.js → ca-ES-GEEW5L7T.js} +331 -119
- package/dist/dev/locales/ca-ES-GEEW5L7T.js.map +7 -0
- package/dist/dev/locales/{cs-CZ-DGZA5IKG.js → cs-CZ-LNVE3QM5.js} +284 -72
- package/dist/dev/locales/cs-CZ-LNVE3QM5.js.map +7 -0
- package/dist/dev/locales/{da-DK-N76F4QAJ.js → da-DK-CAYJG7FJ.js} +353 -141
- package/dist/dev/locales/da-DK-CAYJG7FJ.js.map +7 -0
- package/dist/dev/locales/de-CH-GCXOD4LK.js +798 -0
- package/dist/dev/locales/de-CH-GCXOD4LK.js.map +7 -0
- package/dist/dev/locales/{de-DE-DMRXZ2SZ.js → de-DE-CGDBECYD.js} +255 -43
- package/dist/dev/locales/de-DE-CGDBECYD.js.map +7 -0
- package/dist/dev/locales/{el-GR-HIKPLEXI.js → el-GR-G5QZC24A.js} +329 -117
- package/dist/dev/locales/el-GR-G5QZC24A.js.map +7 -0
- package/dist/dev/locales/{en-SMAPCEOQ.js → en-ZZQASRYX.js} +8 -2
- package/dist/dev/locales/{es-ES-AQYVXC32.js → es-ES-UMEOH76W.js} +268 -56
- package/dist/dev/locales/es-ES-UMEOH76W.js.map +7 -0
- package/dist/dev/locales/{eu-ES-3TOEU5DE.js → eu-ES-IWRZXJC5.js} +266 -54
- package/dist/dev/locales/eu-ES-IWRZXJC5.js.map +7 -0
- package/dist/dev/locales/{fa-IR-527GAKUP.js → fa-IR-QOYVIIJA.js} +341 -129
- package/dist/dev/locales/fa-IR-QOYVIIJA.js.map +7 -0
- package/dist/dev/locales/{fi-FI-M3WLVDFP.js → fi-FI-BXRW65OA.js} +295 -83
- package/dist/dev/locales/fi-FI-BXRW65OA.js.map +7 -0
- package/dist/dev/locales/{fr-FR-YE4VDJFI.js → fr-FR-R2QH5VCW.js} +259 -47
- package/dist/dev/locales/fr-FR-R2QH5VCW.js.map +7 -0
- package/dist/dev/locales/{gl-ES-KMXUYGUN.js → gl-ES-4ES3ZADP.js} +267 -55
- package/dist/dev/locales/gl-ES-4ES3ZADP.js.map +7 -0
- package/dist/dev/locales/he-IL-TRQRRYPH.js +798 -0
- package/dist/dev/locales/he-IL-TRQRRYPH.js.map +7 -0
- package/dist/dev/locales/hi-IN-U46BOJEC.js +798 -0
- package/dist/dev/locales/hi-IN-U46BOJEC.js.map +7 -0
- package/dist/dev/locales/{hu-HU-VIYZI3X4.js → hu-HU-JDULJ6XL.js} +291 -79
- package/dist/dev/locales/hu-HU-JDULJ6XL.js.map +7 -0
- package/dist/dev/locales/{id-ID-22TWZNLA.js → id-ID-BLIXNCUT.js} +300 -88
- package/dist/dev/locales/id-ID-BLIXNCUT.js.map +7 -0
- package/dist/dev/locales/{it-IT-MDEQ2SG3.js → it-IT-6TBW7RUK.js} +258 -46
- package/dist/dev/locales/it-IT-6TBW7RUK.js.map +7 -0
- package/dist/dev/locales/{ja-JP-K2DI4W6B.js → ja-JP-6HYAQFYX.js} +302 -90
- package/dist/dev/locales/ja-JP-6HYAQFYX.js.map +7 -0
- package/dist/dev/locales/{kaa-6BPSNM3R.js → kaa-Z5UP62XJ.js} +257 -45
- package/dist/dev/locales/kaa-Z5UP62XJ.js.map +7 -0
- package/dist/dev/locales/{kab-KAB-2S7ZURK7.js → kab-KAB-Z7STWQKS.js} +266 -54
- package/dist/dev/locales/kab-KAB-Z7STWQKS.js.map +7 -0
- package/dist/dev/locales/{kk-KZ-UJPYGRQQ.js → kk-KZ-BWHY45DX.js} +230 -18
- package/dist/dev/locales/kk-KZ-BWHY45DX.js.map +7 -0
- package/dist/dev/locales/{km-KH-M5T5JKUE.js → km-KH-HGLNWNRU.js} +254 -42
- package/dist/dev/locales/km-KH-HGLNWNRU.js.map +7 -0
- package/dist/dev/locales/{ko-KR-RQX37SNF.js → ko-KR-CO36WKPC.js} +273 -61
- package/dist/dev/locales/ko-KR-CO36WKPC.js.map +7 -0
- package/dist/dev/locales/{ku-TR-5XJDIERL.js → ku-TR-AACVIARC.js} +254 -42
- package/dist/dev/locales/ku-TR-AACVIARC.js.map +7 -0
- package/dist/dev/locales/{lt-LT-MGUBX6CA.js → lt-LT-CFYYFLDV.js} +234 -22
- package/dist/dev/locales/lt-LT-CFYYFLDV.js.map +7 -0
- package/dist/dev/locales/{lv-LV-MD7N5VHD.js → lv-LV-QCBBOFFU.js} +252 -40
- package/dist/dev/locales/lv-LV-QCBBOFFU.js.map +7 -0
- package/dist/dev/locales/{mr-IN-4XWMNGQC.js → mr-IN-B2CM5GK5.js} +260 -48
- package/dist/dev/locales/mr-IN-B2CM5GK5.js.map +7 -0
- package/dist/dev/locales/{my-MM-O4Z74GN5.js → my-MM-756BNN36.js} +236 -24
- package/dist/dev/locales/my-MM-756BNN36.js.map +7 -0
- package/dist/dev/locales/{nb-NO-BMB73KRH.js → nb-NO-5BLHQI4J.js} +275 -63
- package/dist/dev/locales/nb-NO-5BLHQI4J.js.map +7 -0
- package/dist/dev/locales/nl-NL-225BLGAH.js +798 -0
- package/dist/dev/locales/nl-NL-225BLGAH.js.map +7 -0
- package/dist/dev/locales/{nn-NO-NCORG7TS.js → nn-NO-4J7MR6GH.js} +256 -44
- package/dist/dev/locales/nn-NO-4J7MR6GH.js.map +7 -0
- package/dist/dev/locales/{oc-FR-ATFBDMF6.js → oc-FR-XCETH7KF.js} +276 -64
- package/dist/dev/locales/oc-FR-XCETH7KF.js.map +7 -0
- package/dist/dev/locales/{pa-IN-D2I375G4.js → pa-IN-32NBAN5L.js} +246 -34
- package/dist/dev/locales/pa-IN-32NBAN5L.js.map +7 -0
- package/dist/dev/locales/{percentages-YKFLWNK2.js → percentages-ZRLRVMSI.js} +2 -2
- package/dist/dev/locales/{pl-PL-YJHOWAAW.js → pl-PL-R6OJ54BT.js} +270 -58
- package/dist/dev/locales/pl-PL-R6OJ54BT.js.map +7 -0
- package/dist/dev/locales/{pt-BR-APOPYZJ7.js → pt-BR-7AFGAKGR.js} +292 -80
- package/dist/dev/locales/pt-BR-7AFGAKGR.js.map +7 -0
- package/dist/dev/locales/pt-PT-S6BMW6MY.js +798 -0
- package/dist/dev/locales/pt-PT-S6BMW6MY.js.map +7 -0
- package/dist/dev/locales/{ro-RO-L575VRQA.js → ro-RO-4JVGQHS2.js} +259 -47
- package/dist/dev/locales/ro-RO-4JVGQHS2.js.map +7 -0
- package/dist/dev/locales/{ru-RU-BLG6HZG5.js → ru-RU-IESI752T.js} +310 -98
- package/dist/dev/locales/ru-RU-IESI752T.js.map +7 -0
- package/dist/dev/locales/si-LK-H75E7PKD.js +798 -0
- package/dist/dev/locales/si-LK-H75E7PKD.js.map +7 -0
- package/dist/dev/locales/{sk-SK-DY6IPO5U.js → sk-SK-EUK2NR2F.js} +256 -44
- package/dist/dev/locales/sk-SK-EUK2NR2F.js.map +7 -0
- package/dist/dev/locales/{sl-SI-5DZSRA47.js → sl-SI-AKW7R5PW.js} +253 -41
- package/dist/dev/locales/sl-SI-AKW7R5PW.js.map +7 -0
- package/dist/dev/locales/{sv-SE-V32YHALQ.js → sv-SE-QIBOOXLJ.js} +258 -46
- package/dist/dev/locales/sv-SE-QIBOOXLJ.js.map +7 -0
- package/dist/dev/locales/{ta-IN-5JRAGQAO.js → ta-IN-LBK2NQ5K.js} +311 -99
- package/dist/dev/locales/ta-IN-LBK2NQ5K.js.map +7 -0
- package/dist/dev/locales/{th-TH-55ACRHDJ.js → th-TH-YJ2E6GVT.js} +343 -131
- package/dist/dev/locales/th-TH-YJ2E6GVT.js.map +7 -0
- package/dist/dev/locales/{tr-TR-7QYBXDBO.js → tr-TR-Y5GO2XJW.js} +310 -98
- package/dist/dev/locales/tr-TR-Y5GO2XJW.js.map +7 -0
- package/dist/dev/locales/{uk-UA-TJS2TMRH.js → uk-UA-XYAFHHJW.js} +284 -72
- package/dist/dev/locales/uk-UA-XYAFHHJW.js.map +7 -0
- package/dist/dev/locales/{si-LK-KT7GGO6D.js → uz-UZ-LF3CBRYE.js} +267 -55
- package/dist/dev/locales/uz-UZ-LF3CBRYE.js.map +7 -0
- package/dist/dev/locales/vi-VN-WDPZEUOJ.js +798 -0
- package/dist/dev/locales/vi-VN-WDPZEUOJ.js.map +7 -0
- package/dist/dev/locales/{zh-CN-4MXUOFTH.js → zh-CN-SZ37453H.js} +255 -43
- package/dist/dev/locales/zh-CN-SZ37453H.js.map +7 -0
- package/dist/dev/locales/{zh-HK-RBTGIU3U.js → zh-HK-QDQ5QNBC.js} +230 -18
- package/dist/dev/locales/zh-HK-QDQ5QNBC.js.map +7 -0
- package/dist/dev/locales/{zh-TW-U5VF4CCU.js → zh-TW-CYU6GFBV.js} +260 -48
- package/dist/dev/locales/zh-TW-CYU6GFBV.js.map +7 -0
- package/dist/dev/subset-shared.chunk.js +2 -2
- package/dist/dev/subset-worker.chunk.js +2 -2
- package/dist/prod/chunk-3PELD44J.js +1 -0
- package/dist/prod/chunk-CWPS6EPR.js +4 -0
- package/dist/prod/chunk-MSBJ7C4T.js +12 -0
- package/dist/prod/{chunk-LS7FJGPW.js → chunk-Z5NKEFVG.js} +8 -8
- package/dist/prod/data/{image-4SM4COIL.js → image-WETLJ4WS.js} +1 -1
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +33 -25
- package/dist/prod/locales/ar-SA-NXDWD63E.js +8 -0
- package/dist/prod/locales/az-AZ-MXSORGZV.js +1 -0
- package/dist/prod/locales/bg-BG-O6MV2KSF.js +5 -0
- package/dist/prod/locales/bn-BD-T2VJNT7N.js +3 -0
- package/dist/prod/locales/bn-IN-MMW2ORAC.js +3 -0
- package/dist/prod/locales/ca-ES-MKBCGNOG.js +8 -0
- package/dist/prod/locales/cs-CZ-V77HGUP7.js +7 -0
- package/dist/prod/locales/da-DK-I5RFNTM4.js +2 -0
- package/dist/prod/locales/de-CH-WLRDEVBV.js +7 -0
- package/dist/prod/locales/de-DE-DTI4WUSC.js +7 -0
- package/dist/prod/locales/el-GR-ZXDJ2OS4.js +7 -0
- package/dist/prod/locales/en-RQF5X6GM.js +1 -0
- package/dist/prod/locales/es-ES-DYQHAD43.js +7 -0
- package/dist/prod/locales/eu-ES-QDSYU5Y3.js +7 -0
- package/dist/prod/locales/fa-IR-26LZG4PM.js +9 -0
- package/dist/prod/locales/fi-FI-6YS4KDE4.js +6 -0
- package/dist/prod/locales/fr-FR-BRLLPTZC.js +12 -0
- package/dist/prod/locales/gl-ES-OKUZTLYG.js +6 -0
- package/dist/prod/locales/he-IL-26MGYIU7.js +8 -0
- package/dist/prod/locales/hi-IN-Q4ZOGTP2.js +3 -0
- package/dist/prod/locales/hu-HU-P2OXPSN5.js +3 -0
- package/dist/prod/locales/id-ID-2EIKXYN6.js +8 -0
- package/dist/prod/locales/it-IT-4CFKVXI2.js +12 -0
- package/dist/prod/locales/ja-JP-MAND2Z4V.js +7 -0
- package/dist/prod/locales/kaa-HQRTCXTJ.js +1 -0
- package/dist/prod/locales/kab-KAB-JKIKKTGH.js +4 -0
- package/dist/prod/locales/kk-KZ-HXQ63ZFC.js +1 -0
- package/dist/prod/locales/km-KH-PKL3LSGX.js +7 -0
- package/dist/prod/locales/ko-KR-KXLREZX3.js +5 -0
- package/dist/prod/locales/ku-TR-MJ4IER3X.js +6 -0
- package/dist/prod/locales/lt-LT-H6WFQ6FJ.js +3 -0
- package/dist/prod/locales/lv-LV-GOCK6SJW.js +4 -0
- package/dist/prod/locales/mr-IN-IXVLDMEQ.js +9 -0
- package/dist/prod/locales/my-MM-YG6MYTTD.js +1 -0
- package/dist/prod/locales/nb-NO-XGWJISD2.js +8 -0
- package/dist/prod/locales/nl-NL-XVDVCPNC.js +13 -0
- package/dist/prod/locales/nn-NO-EMX5MJX5.js +4 -0
- package/dist/prod/locales/oc-FR-ROEINTVO.js +4 -0
- package/dist/prod/locales/pa-IN-ZYN6SUDY.js +4 -0
- package/dist/prod/locales/percentages-5DKR754L.js +1 -0
- package/dist/prod/locales/pl-PL-6VTG7PHC.js +12 -0
- package/dist/prod/locales/pt-BR-5YFKRR5G.js +6 -0
- package/dist/prod/locales/pt-PT-GEIXXZ67.js +8 -0
- package/dist/prod/locales/ro-RO-E2P6TFZI.js +12 -0
- package/dist/prod/locales/ru-RU-YBIIY43T.js +10 -0
- package/dist/prod/locales/si-LK-673C2CI2.js +1 -0
- package/dist/prod/locales/sk-SK-CKZHQ4AP.js +7 -0
- package/dist/prod/locales/sl-SI-557H2GWM.js +6 -0
- package/dist/prod/locales/sv-SE-XOPKKDWS.js +8 -0
- package/dist/prod/locales/ta-IN-XBH7DQI3.js +6 -0
- package/dist/prod/locales/th-TH-TOCWH3R4.js +1 -0
- package/dist/prod/locales/tr-TR-GXW6CYY5.js +4 -0
- package/dist/prod/locales/uk-UA-IJKTNUDG.js +6 -0
- package/dist/prod/locales/uz-UZ-TBZZEA4V.js +1 -0
- package/dist/prod/locales/vi-VN-MULSGNVB.js +7 -0
- package/dist/prod/locales/zh-CN-MVX3E32U.js +11 -0
- package/dist/prod/locales/zh-HK-JNU5RLIE.js +1 -0
- package/dist/prod/locales/zh-TW-LENVCA6T.js +9 -0
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/bounds.d.ts +10 -0
- package/dist/types/common/src/colors.d.ts +59 -39
- package/dist/types/common/src/constants.d.ts +37 -26
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/font-metadata.d.ts +1 -3
- package/dist/types/common/src/index.d.ts +2 -0
- package/dist/types/common/src/keys.d.ts +1 -1
- package/dist/types/common/src/utility-types.d.ts +0 -1
- package/dist/types/common/src/utils.d.ts +49 -34
- package/dist/types/element/src/Scene.d.ts +3 -3
- package/dist/types/element/src/arrows/focus.d.ts +27 -0
- package/dist/types/element/src/arrows/helpers.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +66 -45
- package/dist/types/element/src/bounds.d.ts +3 -11
- package/dist/types/element/src/collision.d.ts +7 -2
- package/dist/types/element/src/comparisons.d.ts +7 -7
- package/dist/types/element/src/delta.d.ts +2 -2
- package/dist/types/element/src/distribute.d.ts +2 -1
- package/dist/types/element/src/dragElements.d.ts +3 -3
- package/dist/types/element/src/duplicate.d.ts +3 -3
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +5 -1
- package/dist/types/element/src/heading.d.ts +2 -1
- package/dist/types/element/src/image.d.ts +1 -11
- package/dist/types/element/src/index.d.ts +4 -3
- package/dist/types/element/src/linearElementEditor.d.ts +18 -20
- package/dist/types/element/src/mutateElement.d.ts +3 -1
- package/dist/types/element/src/newElement.d.ts +6 -6
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +4 -7
- package/dist/types/element/src/resizeElements.d.ts +10 -10
- package/dist/types/element/src/resizeTest.d.ts +6 -5
- package/dist/types/element/src/selection.d.ts +3 -7
- package/dist/types/element/src/shape.d.ts +8 -7
- package/dist/types/element/src/store.d.ts +3 -2
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/textMeasurements.d.ts +1 -3
- package/dist/types/{excalidraw/data → element/src}/transform.d.ts +3 -3
- package/dist/types/element/src/transformHandles.d.ts +8 -27
- package/dist/types/element/src/typeChecks.d.ts +4 -7
- package/dist/types/element/src/types.d.ts +7 -11
- package/dist/types/element/src/utils.d.ts +8 -3
- package/dist/types/element/src/zindex.d.ts +7 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +102 -136
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -7
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +73 -96
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +438 -758
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +92 -856
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +35 -47
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +118 -156
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +31 -45
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +72 -95
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +36 -48
- package/dist/types/excalidraw/actions/actionExport.d.ts +156 -1104
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -394
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +225 -308
- package/dist/types/excalidraw/actions/actionGroup.d.ts +76 -107
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +128 -178
- package/dist/types/excalidraw/actions/actionLink.d.ts +33 -45
- package/dist/types/excalidraw/actions/actionMenu.d.ts +30 -410
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -359
- package/dist/types/excalidraw/actions/actionProperties.d.ts +135 -2488
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +38 -54
- package/dist/types/excalidraw/actions/actionStyles.d.ts +35 -47
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +35 -47
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +35 -47
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +28 -42
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +35 -47
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +35 -47
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +36 -48
- package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -3
- package/dist/types/excalidraw/actions/index.d.ts +2 -2
- package/dist/types/excalidraw/actions/register.d.ts +2 -2
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +4 -4
- package/dist/types/excalidraw/appState.d.ts +12 -7
- package/dist/types/excalidraw/clipboard.d.ts +58 -17
- package/dist/types/excalidraw/components/Actions.d.ts +22 -5
- package/dist/types/excalidraw/components/App.d.ts +73 -66
- package/dist/types/excalidraw/components/ButtonIconCycle.d.ts +1 -1
- package/dist/types/excalidraw/components/Card.d.ts +1 -3
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -3
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -2
- package/dist/types/excalidraw/components/EyeDropper.d.ts +0 -1
- package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
- package/dist/types/excalidraw/components/LinkButton.d.ts +4 -0
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +10 -0
- package/dist/types/excalidraw/components/Modal.d.ts +0 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
- package/dist/types/excalidraw/components/Popover.d.ts +2 -1
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +2 -1
- package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
- package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
- package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +15 -21
- package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
- package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
- package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +2 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +2 -3
- package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
- package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
- package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
- package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
- package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
- package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +24 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
- package/dist/types/excalidraw/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/Toast.d.ts +3 -3
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/Trans.d.ts +2 -2
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +6 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +47 -35
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -5
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +0 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
- package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +1 -1
- package/dist/types/excalidraw/components/icons.d.ts +29 -12
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +4 -3
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +17 -2
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -35
- package/dist/types/excalidraw/components/shapes.d.ts +129 -1
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +6 -6
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +15 -16
- package/dist/types/excalidraw/data/blob.d.ts +330 -10
- package/dist/types/excalidraw/data/encode.d.ts +4 -4
- package/dist/types/excalidraw/data/encryption.d.ts +5 -5
- package/dist/types/excalidraw/data/filesystem.d.ts +2 -2
- package/dist/types/excalidraw/data/index.d.ts +3 -3
- package/dist/types/excalidraw/data/json.d.ts +162 -2
- package/dist/types/excalidraw/data/library.d.ts +24 -9
- package/dist/types/excalidraw/data/restore.d.ts +25 -10
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
- package/dist/types/excalidraw/errors.d.ts +14 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/i18n.d.ts +2 -2
- package/dist/types/excalidraw/index.d.ts +7 -7
- package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +6 -8
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +8 -14
- package/dist/types/excalidraw/scene/Renderer.d.ts +5 -2
- package/dist/types/excalidraw/scene/export.d.ts +2 -2
- package/dist/types/excalidraw/scene/scroll.d.ts +1 -6
- package/dist/types/excalidraw/scene/types.d.ts +22 -5
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/snapping.d.ts +5 -5
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
- package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
- package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
- package/dist/types/excalidraw/types.d.ts +37 -21
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -2
- package/dist/types/math/src/polygon.d.ts +2 -2
- package/dist/types/math/src/range.d.ts +1 -3
- package/dist/types/math/src/segment.d.ts +4 -3
- package/dist/types/utils/src/bbox.d.ts +1 -1
- package/dist/types/utils/src/export.d.ts +5 -5
- package/dist/types/utils/src/shape.d.ts +6 -6
- package/dist/types/utils/src/withinBounds.d.ts +2 -2
- package/package.json +8 -10
- package/dist/dev/chunk-CRKRRBMD.js.map +0 -7
- package/dist/dev/chunk-MFAYKRVR.js +0 -66
- package/dist/dev/chunk-MFAYKRVR.js.map +0 -7
- package/dist/dev/chunk-QF5FRM6O.js.map +0 -7
- package/dist/dev/locales/ar-SA-XORAP2EK.js.map +0 -7
- package/dist/dev/locales/az-AZ-NAUU3Z4Y.js.map +0 -7
- package/dist/dev/locales/bg-BG-AAABLFCY.js.map +0 -7
- package/dist/dev/locales/bn-BD-PM4AC5WG.js.map +0 -7
- package/dist/dev/locales/ca-ES-YNNMFRQX.js.map +0 -7
- package/dist/dev/locales/cs-CZ-DGZA5IKG.js.map +0 -7
- package/dist/dev/locales/da-DK-N76F4QAJ.js.map +0 -7
- package/dist/dev/locales/de-DE-DMRXZ2SZ.js.map +0 -7
- package/dist/dev/locales/el-GR-HIKPLEXI.js.map +0 -7
- package/dist/dev/locales/es-ES-AQYVXC32.js.map +0 -7
- package/dist/dev/locales/eu-ES-3TOEU5DE.js.map +0 -7
- package/dist/dev/locales/fa-IR-527GAKUP.js.map +0 -7
- package/dist/dev/locales/fi-FI-M3WLVDFP.js.map +0 -7
- package/dist/dev/locales/fr-FR-YE4VDJFI.js.map +0 -7
- package/dist/dev/locales/gl-ES-KMXUYGUN.js.map +0 -7
- package/dist/dev/locales/he-IL-4MU5N22B.js +0 -586
- package/dist/dev/locales/he-IL-4MU5N22B.js.map +0 -7
- package/dist/dev/locales/hi-IN-ZHZNZWFC.js +0 -586
- package/dist/dev/locales/hi-IN-ZHZNZWFC.js.map +0 -7
- package/dist/dev/locales/hu-HU-VIYZI3X4.js.map +0 -7
- package/dist/dev/locales/id-ID-22TWZNLA.js.map +0 -7
- package/dist/dev/locales/it-IT-MDEQ2SG3.js.map +0 -7
- package/dist/dev/locales/ja-JP-K2DI4W6B.js.map +0 -7
- package/dist/dev/locales/kaa-6BPSNM3R.js.map +0 -7
- package/dist/dev/locales/kab-KAB-2S7ZURK7.js.map +0 -7
- package/dist/dev/locales/kk-KZ-UJPYGRQQ.js.map +0 -7
- package/dist/dev/locales/km-KH-M5T5JKUE.js.map +0 -7
- package/dist/dev/locales/ko-KR-RQX37SNF.js.map +0 -7
- package/dist/dev/locales/ku-TR-5XJDIERL.js.map +0 -7
- package/dist/dev/locales/lt-LT-MGUBX6CA.js.map +0 -7
- package/dist/dev/locales/lv-LV-MD7N5VHD.js.map +0 -7
- package/dist/dev/locales/mr-IN-4XWMNGQC.js.map +0 -7
- package/dist/dev/locales/my-MM-O4Z74GN5.js.map +0 -7
- package/dist/dev/locales/nb-NO-BMB73KRH.js.map +0 -7
- package/dist/dev/locales/nl-NL-F2257BLQ.js +0 -586
- package/dist/dev/locales/nl-NL-F2257BLQ.js.map +0 -7
- package/dist/dev/locales/nn-NO-NCORG7TS.js.map +0 -7
- package/dist/dev/locales/oc-FR-ATFBDMF6.js.map +0 -7
- package/dist/dev/locales/pa-IN-D2I375G4.js.map +0 -7
- package/dist/dev/locales/pl-PL-YJHOWAAW.js.map +0 -7
- package/dist/dev/locales/pt-BR-APOPYZJ7.js.map +0 -7
- package/dist/dev/locales/pt-PT-W56WCN7P.js +0 -586
- package/dist/dev/locales/pt-PT-W56WCN7P.js.map +0 -7
- package/dist/dev/locales/ro-RO-L575VRQA.js.map +0 -7
- package/dist/dev/locales/ru-RU-BLG6HZG5.js.map +0 -7
- package/dist/dev/locales/si-LK-KT7GGO6D.js.map +0 -7
- package/dist/dev/locales/sk-SK-DY6IPO5U.js.map +0 -7
- package/dist/dev/locales/sl-SI-5DZSRA47.js.map +0 -7
- package/dist/dev/locales/sv-SE-V32YHALQ.js.map +0 -7
- package/dist/dev/locales/ta-IN-5JRAGQAO.js.map +0 -7
- package/dist/dev/locales/th-TH-55ACRHDJ.js.map +0 -7
- package/dist/dev/locales/tr-TR-7QYBXDBO.js.map +0 -7
- package/dist/dev/locales/uk-UA-TJS2TMRH.js.map +0 -7
- package/dist/dev/locales/vi-VN-Y5CQ2EKQ.js +0 -586
- package/dist/dev/locales/vi-VN-Y5CQ2EKQ.js.map +0 -7
- package/dist/dev/locales/zh-CN-4MXUOFTH.js.map +0 -7
- package/dist/dev/locales/zh-HK-RBTGIU3U.js.map +0 -7
- package/dist/dev/locales/zh-TW-U5VF4CCU.js.map +0 -7
- package/dist/prod/chunk-HHV2PJKY.js +0 -4
- package/dist/prod/chunk-I4UNSFV6.js +0 -12
- package/dist/prod/chunk-Z3N5DIM6.js +0 -1
- package/dist/prod/locales/ar-SA-G6X2FPQ2.js +0 -10
- package/dist/prod/locales/az-AZ-76LH7QW2.js +0 -1
- package/dist/prod/locales/bg-BG-XCXSNQG7.js +0 -5
- package/dist/prod/locales/bn-BD-2XOGV67Q.js +0 -5
- package/dist/prod/locales/ca-ES-6MX7JW3Y.js +0 -8
- package/dist/prod/locales/cs-CZ-2BRQDIVT.js +0 -11
- package/dist/prod/locales/da-DK-5WZEPLOC.js +0 -5
- package/dist/prod/locales/de-DE-XR44H4JA.js +0 -8
- package/dist/prod/locales/el-GR-BZB4AONW.js +0 -10
- package/dist/prod/locales/en-TYY6KWIJ.js +0 -1
- package/dist/prod/locales/es-ES-U4NZUMDT.js +0 -9
- package/dist/prod/locales/eu-ES-A7QVB2H4.js +0 -11
- package/dist/prod/locales/fa-IR-HGAKTJCU.js +0 -8
- package/dist/prod/locales/fi-FI-Z5N7JZ37.js +0 -6
- package/dist/prod/locales/fr-FR-RHASNOE6.js +0 -9
- package/dist/prod/locales/gl-ES-HMX3MZ6V.js +0 -10
- package/dist/prod/locales/he-IL-6SHJWFNN.js +0 -10
- package/dist/prod/locales/hi-IN-IWLTKZ5I.js +0 -4
- package/dist/prod/locales/hu-HU-A5ZG7DT2.js +0 -7
- package/dist/prod/locales/id-ID-SAP4L64H.js +0 -10
- package/dist/prod/locales/it-IT-JPQ66NNP.js +0 -11
- package/dist/prod/locales/ja-JP-DBVTYXUO.js +0 -8
- package/dist/prod/locales/kaa-6HZHGXH3.js +0 -1
- package/dist/prod/locales/kab-KAB-ZGHBKWFO.js +0 -8
- package/dist/prod/locales/kk-KZ-P5N5QNE5.js +0 -1
- package/dist/prod/locales/km-KH-HSX4SM5Z.js +0 -11
- package/dist/prod/locales/ko-KR-MTYHY66A.js +0 -9
- package/dist/prod/locales/ku-TR-6OUDTVRD.js +0 -9
- package/dist/prod/locales/lt-LT-XHIRWOB4.js +0 -3
- package/dist/prod/locales/lv-LV-5QDEKY6T.js +0 -7
- package/dist/prod/locales/mr-IN-CRQNXWMA.js +0 -13
- package/dist/prod/locales/my-MM-5M5IBNSE.js +0 -1
- package/dist/prod/locales/nb-NO-T6EIAALU.js +0 -10
- package/dist/prod/locales/nl-NL-IS3SIHDZ.js +0 -8
- package/dist/prod/locales/nn-NO-6E72VCQL.js +0 -8
- package/dist/prod/locales/oc-FR-POXYY2M6.js +0 -8
- package/dist/prod/locales/pa-IN-N4M65BXN.js +0 -4
- package/dist/prod/locales/percentages-BXMCSKIN.js +0 -1
- package/dist/prod/locales/pl-PL-T2D74RX3.js +0 -9
- package/dist/prod/locales/pt-BR-5N22H2LF.js +0 -9
- package/dist/prod/locales/pt-PT-UZXXM6DQ.js +0 -9
- package/dist/prod/locales/ro-RO-JPDTUUEW.js +0 -11
- package/dist/prod/locales/ru-RU-B4JR7IUQ.js +0 -9
- package/dist/prod/locales/si-LK-N5RQ5JYF.js +0 -1
- package/dist/prod/locales/sk-SK-C5VTKIMK.js +0 -6
- package/dist/prod/locales/sl-SI-NN7IZMDC.js +0 -6
- package/dist/prod/locales/sv-SE-XGPEYMSR.js +0 -10
- package/dist/prod/locales/ta-IN-2NMHFXQM.js +0 -9
- package/dist/prod/locales/th-TH-HPSO5L25.js +0 -2
- package/dist/prod/locales/tr-TR-DEFEU3FU.js +0 -7
- package/dist/prod/locales/uk-UA-QMV73CPH.js +0 -6
- package/dist/prod/locales/vi-VN-M7AON7JQ.js +0 -5
- package/dist/prod/locales/zh-CN-LNUGB5OW.js +0 -10
- package/dist/prod/locales/zh-HK-E62DVLB3.js +0 -1
- package/dist/prod/locales/zh-TW-RAJ6MFWO.js +0 -9
- /package/dist/dev/{chunk-CP5DND7P.js.map → chunk-Y3BTNZQY.js.map} +0 -0
- /package/dist/dev/data/{image-IWGLHPIX.js.map → image-VHVPDZAZ.js.map} +0 -0
- /package/dist/dev/locales/{en-SMAPCEOQ.js.map → en-ZZQASRYX.js.map} +0 -0
- /package/dist/dev/locales/{percentages-YKFLWNK2.js.map → percentages-ZRLRVMSI.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y3BTNZQY.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
bytesToHexString,
|
|
20
20
|
isPromiseLike
|
|
21
21
|
} from "@excalidraw/common";
|
|
22
|
-
import { clearElementsForExport as clearElementsForExport2 } from "@excalidraw/element";
|
|
23
22
|
|
|
24
23
|
// appState.ts
|
|
25
24
|
import {
|
|
@@ -70,6 +69,10 @@ var getDefaultAppState = () => {
|
|
|
70
69
|
fromSelection: false,
|
|
71
70
|
lastActiveTool: null
|
|
72
71
|
},
|
|
72
|
+
preferredSelectionTool: {
|
|
73
|
+
type: "selection",
|
|
74
|
+
initialized: false
|
|
75
|
+
},
|
|
73
76
|
penMode: false,
|
|
74
77
|
penDetected: false,
|
|
75
78
|
errorMessage: null,
|
|
@@ -111,7 +114,7 @@ var getDefaultAppState = () => {
|
|
|
111
114
|
panels: STATS_PANELS.generalStats | STATS_PANELS.elementProperties
|
|
112
115
|
},
|
|
113
116
|
startBoundElement: null,
|
|
114
|
-
|
|
117
|
+
suggestedBinding: null,
|
|
115
118
|
frameRendering: { enabled: true, clip: true, name: true, outline: true },
|
|
116
119
|
frameToHighlight: null,
|
|
117
120
|
editingFrame: null,
|
|
@@ -137,7 +140,8 @@ var getDefaultAppState = () => {
|
|
|
137
140
|
croppingElementId: null,
|
|
138
141
|
searchMatches: null,
|
|
139
142
|
lockedMultiSelections: {},
|
|
140
|
-
activeLockedId: null
|
|
143
|
+
activeLockedId: null,
|
|
144
|
+
bindMode: "orbit"
|
|
141
145
|
};
|
|
142
146
|
};
|
|
143
147
|
var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
@@ -174,6 +178,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
174
178
|
editingTextElement: { browser: false, export: false, server: false },
|
|
175
179
|
editingGroupId: { browser: true, export: false, server: false },
|
|
176
180
|
activeTool: { browser: true, export: false, server: false },
|
|
181
|
+
preferredSelectionTool: { browser: true, export: false, server: false },
|
|
177
182
|
penMode: { browser: true, export: false, server: false },
|
|
178
183
|
penDetected: { browser: true, export: false, server: false },
|
|
179
184
|
errorMessage: { browser: false, export: false, server: false },
|
|
@@ -223,7 +228,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
223
228
|
shouldCacheIgnoreZoom: { browser: true, export: false, server: false },
|
|
224
229
|
stats: { browser: true, export: false, server: false },
|
|
225
230
|
startBoundElement: { browser: false, export: false, server: false },
|
|
226
|
-
|
|
231
|
+
suggestedBinding: { browser: false, export: false, server: false },
|
|
227
232
|
frameRendering: { browser: false, export: false, server: false },
|
|
228
233
|
frameToHighlight: { browser: false, export: false, server: false },
|
|
229
234
|
editingFrame: { browser: false, export: false, server: false },
|
|
@@ -245,7 +250,8 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
245
250
|
croppingElementId: { browser: false, export: false, server: false },
|
|
246
251
|
searchMatches: { browser: false, export: false, server: false },
|
|
247
252
|
lockedMultiSelections: { browser: true, export: true, server: true },
|
|
248
|
-
activeLockedId: { browser: false, export: false, server: false }
|
|
253
|
+
activeLockedId: { browser: false, export: false, server: false },
|
|
254
|
+
bindMode: { browser: true, export: false, server: false }
|
|
249
255
|
});
|
|
250
256
|
var _clearAppStateForStorage = (appState, exportType) => {
|
|
251
257
|
const stateForExport = {};
|
|
@@ -316,6 +322,24 @@ var ExcalidrawError = class extends Error {
|
|
|
316
322
|
this.name = "ExcalidrawError";
|
|
317
323
|
}
|
|
318
324
|
};
|
|
325
|
+
var RequestError = class extends Error {
|
|
326
|
+
constructor({
|
|
327
|
+
message = "Something went wrong",
|
|
328
|
+
status = 500,
|
|
329
|
+
data
|
|
330
|
+
} = {}) {
|
|
331
|
+
super();
|
|
332
|
+
__publicField(this, "status");
|
|
333
|
+
__publicField(this, "data");
|
|
334
|
+
this.name = "RequestError";
|
|
335
|
+
this.message = message;
|
|
336
|
+
this.status = status;
|
|
337
|
+
this.data = data;
|
|
338
|
+
}
|
|
339
|
+
toObject() {
|
|
340
|
+
return { name: this.name, status: this.status, message: this.message };
|
|
341
|
+
}
|
|
342
|
+
};
|
|
319
343
|
|
|
320
344
|
// scene/index.ts
|
|
321
345
|
import {
|
|
@@ -416,14 +440,14 @@ import {
|
|
|
416
440
|
FRAME_STYLE as FRAME_STYLE3,
|
|
417
441
|
FONT_FAMILY as FONT_FAMILY2,
|
|
418
442
|
SVG_NS as SVG_NS2,
|
|
419
|
-
THEME as
|
|
420
|
-
THEME_FILTER as THEME_FILTER2,
|
|
443
|
+
THEME as THEME5,
|
|
421
444
|
MIME_TYPES as MIME_TYPES5,
|
|
422
445
|
EXPORT_DATA_TYPES as EXPORT_DATA_TYPES2,
|
|
423
446
|
arrayToMap,
|
|
424
447
|
distance,
|
|
425
448
|
getFontString as getFontString2,
|
|
426
|
-
toBrandedType
|
|
449
|
+
toBrandedType,
|
|
450
|
+
applyDarkModeFilter as applyDarkModeFilter4
|
|
427
451
|
} from "@excalidraw/common";
|
|
428
452
|
import { getCommonBounds as getCommonBounds2, getElementAbsoluteCoords as getElementAbsoluteCoords4 } from "@excalidraw/element";
|
|
429
453
|
import {
|
|
@@ -517,10 +541,6 @@ import {
|
|
|
517
541
|
MIME_TYPES as MIME_TYPES2,
|
|
518
542
|
VERSIONS
|
|
519
543
|
} from "@excalidraw/common";
|
|
520
|
-
import {
|
|
521
|
-
clearElementsForDatabase,
|
|
522
|
-
clearElementsForExport
|
|
523
|
-
} from "@excalidraw/element";
|
|
524
544
|
|
|
525
545
|
// data/filesystem.ts
|
|
526
546
|
import {
|
|
@@ -529,8 +549,8 @@ import {
|
|
|
529
549
|
supported as nativeFileSystemSupported
|
|
530
550
|
} from "browser-fs-access";
|
|
531
551
|
import { EVENT, MIME_TYPES, debounce } from "@excalidraw/common";
|
|
532
|
-
var INPUT_CHANGE_INTERVAL_MS =
|
|
533
|
-
var fileOpen = (opts) => {
|
|
552
|
+
var INPUT_CHANGE_INTERVAL_MS = 5e3;
|
|
553
|
+
var fileOpen = async (opts) => {
|
|
534
554
|
const mimeTypes = opts.extensions?.reduce((mimeTypes2, type) => {
|
|
535
555
|
mimeTypes2.push(MIME_TYPES[type]);
|
|
536
556
|
return mimeTypes2;
|
|
@@ -541,7 +561,7 @@ var fileOpen = (opts) => {
|
|
|
541
561
|
}
|
|
542
562
|
return acc.concat(`.${ext}`);
|
|
543
563
|
}, []);
|
|
544
|
-
|
|
564
|
+
const files = await _fileOpen({
|
|
545
565
|
description: opts.description,
|
|
546
566
|
extensions,
|
|
547
567
|
mimeTypes,
|
|
@@ -579,6 +599,12 @@ var fileOpen = (opts) => {
|
|
|
579
599
|
};
|
|
580
600
|
}
|
|
581
601
|
});
|
|
602
|
+
if (Array.isArray(files)) {
|
|
603
|
+
return await Promise.all(
|
|
604
|
+
files.map((file) => normalizeFile(file))
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
return await normalizeFile(files);
|
|
582
608
|
};
|
|
583
609
|
var fileSave = (blob, opts) => {
|
|
584
610
|
return _fileSave(
|
|
@@ -608,7 +634,7 @@ var serializeAsJSON = (elements, appState, files, type) => {
|
|
|
608
634
|
type: EXPORT_DATA_TYPES.excalidraw,
|
|
609
635
|
version: VERSIONS.excalidraw,
|
|
610
636
|
source: getExportSource(),
|
|
611
|
-
elements
|
|
637
|
+
elements,
|
|
612
638
|
appState: type === "local" ? cleanAppStateForExport(appState) : clearAppStateForDatabase(appState),
|
|
613
639
|
files: type === "local" ? filterOutDeletedFiles(elements, files) : (
|
|
614
640
|
// will be stripped from JSON
|
|
@@ -637,12 +663,7 @@ var loadFromJSON = async (localAppState, localElements) => {
|
|
|
637
663
|
// gets resolved. Else, iOS users cannot open `.excalidraw` files.
|
|
638
664
|
// extensions: ["json", "excalidraw", "png", "svg"],
|
|
639
665
|
});
|
|
640
|
-
return loadFromBlob(
|
|
641
|
-
await normalizeFile(file),
|
|
642
|
-
localAppState,
|
|
643
|
-
localElements,
|
|
644
|
-
file.handle
|
|
645
|
-
);
|
|
666
|
+
return loadFromBlob(file, localAppState, localElements, file.handle);
|
|
646
667
|
};
|
|
647
668
|
var isValidExcalidrawData = (data) => {
|
|
648
669
|
return data?.type === EXPORT_DATA_TYPES.excalidraw && (!data.elements || Array.isArray(data.elements) && (!data.appState || typeof data.appState === "object"));
|
|
@@ -679,7 +700,8 @@ import {
|
|
|
679
700
|
FONT_FAMILY_FALLBACKS,
|
|
680
701
|
CJK_HAND_DRAWN_FALLBACK_FONT,
|
|
681
702
|
WINDOWS_EMOJI_FALLBACK_FONT,
|
|
682
|
-
getFontFamilyFallbacks
|
|
703
|
+
getFontFamilyFallbacks,
|
|
704
|
+
FONT_SIZES
|
|
683
705
|
} from "@excalidraw/common";
|
|
684
706
|
import { getContainerElement } from "@excalidraw/element";
|
|
685
707
|
import { charWidth } from "@excalidraw/element";
|
|
@@ -2908,7 +2930,7 @@ var _Fonts = class _Fonts {
|
|
|
2908
2930
|
for (const [index, fontFamily] of fontFamilies.entries()) {
|
|
2909
2931
|
const font = getFontString({
|
|
2910
2932
|
fontFamily,
|
|
2911
|
-
fontSize:
|
|
2933
|
+
fontSize: FONT_SIZES.sm
|
|
2912
2934
|
});
|
|
2913
2935
|
const text = _Fonts.getCharacters(charsPerFamily, fontFamily);
|
|
2914
2936
|
if (!window.document.fonts.check(font, text)) {
|
|
@@ -3065,7 +3087,12 @@ __publicField(_Fonts, "loadElementsFonts", async (elements) => {
|
|
|
3065
3087
|
var Fonts = _Fonts;
|
|
3066
3088
|
|
|
3067
3089
|
// renderer/staticScene.ts
|
|
3068
|
-
import {
|
|
3090
|
+
import {
|
|
3091
|
+
applyDarkModeFilter as applyDarkModeFilter2,
|
|
3092
|
+
FRAME_STYLE,
|
|
3093
|
+
THEME as THEME3,
|
|
3094
|
+
throttleRAF
|
|
3095
|
+
} from "@excalidraw/common";
|
|
3069
3096
|
import { isElementLink } from "@excalidraw/element";
|
|
3070
3097
|
import { createPlaceholderEmbeddableLabel } from "@excalidraw/element";
|
|
3071
3098
|
import { getBoundTextElement } from "@excalidraw/element";
|
|
@@ -3147,19 +3174,7 @@ var isPointHittingLink = (element, elementsMap, appState, [x, y], isMobile) => {
|
|
|
3147
3174
|
};
|
|
3148
3175
|
|
|
3149
3176
|
// renderer/helpers.ts
|
|
3150
|
-
import { THEME as THEME2,
|
|
3151
|
-
import { FIXED_BINDING_DISTANCE } from "@excalidraw/element";
|
|
3152
|
-
import { getDiamondPoints } from "@excalidraw/element";
|
|
3153
|
-
import { elementCenterPoint, getCornerRadius } from "@excalidraw/element";
|
|
3154
|
-
import {
|
|
3155
|
-
curve,
|
|
3156
|
-
curveCatmullRomCubicApproxPoints,
|
|
3157
|
-
curveCatmullRomQuadraticApproxPoints,
|
|
3158
|
-
curveOffsetPoints,
|
|
3159
|
-
offsetPointsForQuadraticBezier,
|
|
3160
|
-
pointFrom as pointFrom2,
|
|
3161
|
-
pointRotateRads as pointRotateRads2
|
|
3162
|
-
} from "@excalidraw/math";
|
|
3177
|
+
import { THEME as THEME2, applyDarkModeFilter } from "@excalidraw/common";
|
|
3163
3178
|
var fillCircle = (context, cx, cy, radius, stroke, fill = true) => {
|
|
3164
3179
|
context.beginPath();
|
|
3165
3180
|
context.arc(cx, cy, radius, 0, Math.PI * 2);
|
|
@@ -3185,9 +3200,6 @@ var bootstrapCanvas = ({
|
|
|
3185
3200
|
const context = canvas.getContext("2d");
|
|
3186
3201
|
context.setTransform(1, 0, 0, 1, 0, 0);
|
|
3187
3202
|
context.scale(scale, scale);
|
|
3188
|
-
if (isExporting && theme === THEME2.DARK) {
|
|
3189
|
-
context.filter = THEME_FILTER;
|
|
3190
|
-
}
|
|
3191
3203
|
if (typeof viewBackgroundColor === "string") {
|
|
3192
3204
|
const hasTransparence = viewBackgroundColor === "transparent" || viewBackgroundColor.length === 5 || // #RGBA
|
|
3193
3205
|
viewBackgroundColor.length === 9 || // #RRGGBBA
|
|
@@ -3196,7 +3208,7 @@ var bootstrapCanvas = ({
|
|
|
3196
3208
|
context.clearRect(0, 0, normalizedWidth, normalizedHeight);
|
|
3197
3209
|
}
|
|
3198
3210
|
context.save();
|
|
3199
|
-
context.fillStyle = viewBackgroundColor;
|
|
3211
|
+
context.fillStyle = theme === THEME2.DARK ? applyDarkModeFilter(viewBackgroundColor) : viewBackgroundColor;
|
|
3200
3212
|
context.fillRect(0, 0, normalizedWidth, normalizedHeight);
|
|
3201
3213
|
context.restore();
|
|
3202
3214
|
} else {
|
|
@@ -3204,127 +3216,7 @@ var bootstrapCanvas = ({
|
|
|
3204
3216
|
}
|
|
3205
3217
|
return context;
|
|
3206
3218
|
};
|
|
3207
|
-
|
|
3208
|
-
const pointSets = curveCatmullRomQuadraticApproxPoints(points, tension);
|
|
3209
|
-
if (pointSets) {
|
|
3210
|
-
for (let i = 0; i < pointSets.length - 1; i++) {
|
|
3211
|
-
const [[cpX, cpY], [p2X, p2Y]] = pointSets[i];
|
|
3212
|
-
ctx.quadraticCurveTo(cpX, cpY, p2X, p2Y);
|
|
3213
|
-
}
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
function drawCatmullRomCubicApprox(ctx, points, tension = 0.5) {
|
|
3217
|
-
const pointSets = curveCatmullRomCubicApproxPoints(points, tension);
|
|
3218
|
-
if (pointSets) {
|
|
3219
|
-
for (let i = 0; i < pointSets.length; i++) {
|
|
3220
|
-
const [[cp1x, cp1y], [cp2x, cp2y], [x, y]] = pointSets[i];
|
|
3221
|
-
ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
|
|
3222
|
-
}
|
|
3223
|
-
}
|
|
3224
|
-
}
|
|
3225
|
-
var drawHighlightForRectWithRotation = (context, element, elementsMap, padding) => {
|
|
3226
|
-
const [x, y] = pointRotateRads2(
|
|
3227
|
-
pointFrom2(element.x, element.y),
|
|
3228
|
-
elementCenterPoint(element, elementsMap),
|
|
3229
|
-
element.angle
|
|
3230
|
-
);
|
|
3231
|
-
context.save();
|
|
3232
|
-
context.translate(x, y);
|
|
3233
|
-
context.rotate(element.angle);
|
|
3234
|
-
let radius = getCornerRadius(
|
|
3235
|
-
Math.min(element.width, element.height),
|
|
3236
|
-
element
|
|
3237
|
-
);
|
|
3238
|
-
if (radius === 0) {
|
|
3239
|
-
radius = 0.01;
|
|
3240
|
-
}
|
|
3241
|
-
context.beginPath();
|
|
3242
|
-
{
|
|
3243
|
-
const topLeftApprox = offsetPointsForQuadraticBezier(
|
|
3244
|
-
pointFrom2(0, 0 + radius),
|
|
3245
|
-
pointFrom2(0, 0),
|
|
3246
|
-
pointFrom2(0 + radius, 0),
|
|
3247
|
-
padding
|
|
3248
|
-
);
|
|
3249
|
-
const topRightApprox = offsetPointsForQuadraticBezier(
|
|
3250
|
-
pointFrom2(element.width - radius, 0),
|
|
3251
|
-
pointFrom2(element.width, 0),
|
|
3252
|
-
pointFrom2(element.width, radius),
|
|
3253
|
-
padding
|
|
3254
|
-
);
|
|
3255
|
-
const bottomRightApprox = offsetPointsForQuadraticBezier(
|
|
3256
|
-
pointFrom2(element.width, element.height - radius),
|
|
3257
|
-
pointFrom2(element.width, element.height),
|
|
3258
|
-
pointFrom2(element.width - radius, element.height),
|
|
3259
|
-
padding
|
|
3260
|
-
);
|
|
3261
|
-
const bottomLeftApprox = offsetPointsForQuadraticBezier(
|
|
3262
|
-
pointFrom2(radius, element.height),
|
|
3263
|
-
pointFrom2(0, element.height),
|
|
3264
|
-
pointFrom2(0, element.height - radius),
|
|
3265
|
-
padding
|
|
3266
|
-
);
|
|
3267
|
-
context.moveTo(
|
|
3268
|
-
topLeftApprox[topLeftApprox.length - 1][0],
|
|
3269
|
-
topLeftApprox[topLeftApprox.length - 1][1]
|
|
3270
|
-
);
|
|
3271
|
-
context.lineTo(topRightApprox[0][0], topRightApprox[0][1]);
|
|
3272
|
-
drawCatmullRomQuadraticApprox(context, topRightApprox);
|
|
3273
|
-
context.lineTo(bottomRightApprox[0][0], bottomRightApprox[0][1]);
|
|
3274
|
-
drawCatmullRomQuadraticApprox(context, bottomRightApprox);
|
|
3275
|
-
context.lineTo(bottomLeftApprox[0][0], bottomLeftApprox[0][1]);
|
|
3276
|
-
drawCatmullRomQuadraticApprox(context, bottomLeftApprox);
|
|
3277
|
-
context.lineTo(topLeftApprox[0][0], topLeftApprox[0][1]);
|
|
3278
|
-
drawCatmullRomQuadraticApprox(context, topLeftApprox);
|
|
3279
|
-
}
|
|
3280
|
-
{
|
|
3281
|
-
const topLeftApprox = offsetPointsForQuadraticBezier(
|
|
3282
|
-
pointFrom2(0 + radius, 0),
|
|
3283
|
-
pointFrom2(0, 0),
|
|
3284
|
-
pointFrom2(0, 0 + radius),
|
|
3285
|
-
-FIXED_BINDING_DISTANCE
|
|
3286
|
-
);
|
|
3287
|
-
const topRightApprox = offsetPointsForQuadraticBezier(
|
|
3288
|
-
pointFrom2(element.width, radius),
|
|
3289
|
-
pointFrom2(element.width, 0),
|
|
3290
|
-
pointFrom2(element.width - radius, 0),
|
|
3291
|
-
-FIXED_BINDING_DISTANCE
|
|
3292
|
-
);
|
|
3293
|
-
const bottomRightApprox = offsetPointsForQuadraticBezier(
|
|
3294
|
-
pointFrom2(element.width - radius, element.height),
|
|
3295
|
-
pointFrom2(element.width, element.height),
|
|
3296
|
-
pointFrom2(element.width, element.height - radius),
|
|
3297
|
-
-FIXED_BINDING_DISTANCE
|
|
3298
|
-
);
|
|
3299
|
-
const bottomLeftApprox = offsetPointsForQuadraticBezier(
|
|
3300
|
-
pointFrom2(0, element.height - radius),
|
|
3301
|
-
pointFrom2(0, element.height),
|
|
3302
|
-
pointFrom2(radius, element.height),
|
|
3303
|
-
-FIXED_BINDING_DISTANCE
|
|
3304
|
-
);
|
|
3305
|
-
context.moveTo(
|
|
3306
|
-
topLeftApprox[topLeftApprox.length - 1][0],
|
|
3307
|
-
topLeftApprox[topLeftApprox.length - 1][1]
|
|
3308
|
-
);
|
|
3309
|
-
context.lineTo(bottomLeftApprox[0][0], bottomLeftApprox[0][1]);
|
|
3310
|
-
drawCatmullRomQuadraticApprox(context, bottomLeftApprox);
|
|
3311
|
-
context.lineTo(bottomRightApprox[0][0], bottomRightApprox[0][1]);
|
|
3312
|
-
drawCatmullRomQuadraticApprox(context, bottomRightApprox);
|
|
3313
|
-
context.lineTo(topRightApprox[0][0], topRightApprox[0][1]);
|
|
3314
|
-
drawCatmullRomQuadraticApprox(context, topRightApprox);
|
|
3315
|
-
context.lineTo(topLeftApprox[0][0], topLeftApprox[0][1]);
|
|
3316
|
-
drawCatmullRomQuadraticApprox(context, topLeftApprox);
|
|
3317
|
-
}
|
|
3318
|
-
context.closePath();
|
|
3319
|
-
context.fill();
|
|
3320
|
-
context.restore();
|
|
3321
|
-
};
|
|
3322
|
-
var strokeEllipseWithRotation = (context, width, height, cx, cy, angle) => {
|
|
3323
|
-
context.beginPath();
|
|
3324
|
-
context.ellipse(cx, cy, width / 2, height / 2, angle, 0, Math.PI * 2);
|
|
3325
|
-
context.stroke();
|
|
3326
|
-
};
|
|
3327
|
-
var strokeRectWithRotation = (context, x, y, width, height, cx, cy, angle, fill = false, radius = 0) => {
|
|
3219
|
+
var strokeRectWithRotation_simple = (context, x, y, width, height, cx, cy, angle, fill = false, radius = 0) => {
|
|
3328
3220
|
context.save();
|
|
3329
3221
|
context.translate(cx, cy);
|
|
3330
3222
|
context.rotate(angle);
|
|
@@ -3341,133 +3233,19 @@ var strokeRectWithRotation = (context, x, y, width, height, cx, cy, angle, fill
|
|
|
3341
3233
|
}
|
|
3342
3234
|
context.restore();
|
|
3343
3235
|
};
|
|
3344
|
-
var drawHighlightForDiamondWithRotation = (context, padding, element, elementsMap) => {
|
|
3345
|
-
const [x, y] = pointRotateRads2(
|
|
3346
|
-
pointFrom2(element.x, element.y),
|
|
3347
|
-
elementCenterPoint(element, elementsMap),
|
|
3348
|
-
element.angle
|
|
3349
|
-
);
|
|
3350
|
-
context.save();
|
|
3351
|
-
context.translate(x, y);
|
|
3352
|
-
context.rotate(element.angle);
|
|
3353
|
-
{
|
|
3354
|
-
context.beginPath();
|
|
3355
|
-
const [topX, topY, rightX, rightY, bottomX, bottomY, leftX, leftY] = getDiamondPoints(element);
|
|
3356
|
-
const verticalRadius = element.roundness ? getCornerRadius(Math.abs(topX - leftX), element) : (topX - leftX) * 0.01;
|
|
3357
|
-
const horizontalRadius = element.roundness ? getCornerRadius(Math.abs(rightY - topY), element) : (rightY - topY) * 0.01;
|
|
3358
|
-
const topApprox = curveOffsetPoints(
|
|
3359
|
-
curve(
|
|
3360
|
-
pointFrom2(topX - verticalRadius, topY + horizontalRadius),
|
|
3361
|
-
pointFrom2(topX, topY),
|
|
3362
|
-
pointFrom2(topX, topY),
|
|
3363
|
-
pointFrom2(topX + verticalRadius, topY + horizontalRadius)
|
|
3364
|
-
),
|
|
3365
|
-
padding
|
|
3366
|
-
);
|
|
3367
|
-
const rightApprox = curveOffsetPoints(
|
|
3368
|
-
curve(
|
|
3369
|
-
pointFrom2(rightX - verticalRadius, rightY - horizontalRadius),
|
|
3370
|
-
pointFrom2(rightX, rightY),
|
|
3371
|
-
pointFrom2(rightX, rightY),
|
|
3372
|
-
pointFrom2(rightX - verticalRadius, rightY + horizontalRadius)
|
|
3373
|
-
),
|
|
3374
|
-
padding
|
|
3375
|
-
);
|
|
3376
|
-
const bottomApprox = curveOffsetPoints(
|
|
3377
|
-
curve(
|
|
3378
|
-
pointFrom2(bottomX + verticalRadius, bottomY - horizontalRadius),
|
|
3379
|
-
pointFrom2(bottomX, bottomY),
|
|
3380
|
-
pointFrom2(bottomX, bottomY),
|
|
3381
|
-
pointFrom2(bottomX - verticalRadius, bottomY - horizontalRadius)
|
|
3382
|
-
),
|
|
3383
|
-
padding
|
|
3384
|
-
);
|
|
3385
|
-
const leftApprox = curveOffsetPoints(
|
|
3386
|
-
curve(
|
|
3387
|
-
pointFrom2(leftX + verticalRadius, leftY + horizontalRadius),
|
|
3388
|
-
pointFrom2(leftX, leftY),
|
|
3389
|
-
pointFrom2(leftX, leftY),
|
|
3390
|
-
pointFrom2(leftX + verticalRadius, leftY - horizontalRadius)
|
|
3391
|
-
),
|
|
3392
|
-
padding
|
|
3393
|
-
);
|
|
3394
|
-
context.moveTo(
|
|
3395
|
-
topApprox[topApprox.length - 1][0],
|
|
3396
|
-
topApprox[topApprox.length - 1][1]
|
|
3397
|
-
);
|
|
3398
|
-
context.lineTo(rightApprox[1][0], rightApprox[1][1]);
|
|
3399
|
-
drawCatmullRomCubicApprox(context, rightApprox);
|
|
3400
|
-
context.lineTo(bottomApprox[1][0], bottomApprox[1][1]);
|
|
3401
|
-
drawCatmullRomCubicApprox(context, bottomApprox);
|
|
3402
|
-
context.lineTo(leftApprox[1][0], leftApprox[1][1]);
|
|
3403
|
-
drawCatmullRomCubicApprox(context, leftApprox);
|
|
3404
|
-
context.lineTo(topApprox[1][0], topApprox[1][1]);
|
|
3405
|
-
drawCatmullRomCubicApprox(context, topApprox);
|
|
3406
|
-
}
|
|
3407
|
-
{
|
|
3408
|
-
const [topX, topY, rightX, rightY, bottomX, bottomY, leftX, leftY] = getDiamondPoints(element);
|
|
3409
|
-
const verticalRadius = element.roundness ? getCornerRadius(Math.abs(topX - leftX), element) : (topX - leftX) * 0.01;
|
|
3410
|
-
const horizontalRadius = element.roundness ? getCornerRadius(Math.abs(rightY - topY), element) : (rightY - topY) * 0.01;
|
|
3411
|
-
const topApprox = curveOffsetPoints(
|
|
3412
|
-
curve(
|
|
3413
|
-
pointFrom2(topX + verticalRadius, topY + horizontalRadius),
|
|
3414
|
-
pointFrom2(topX, topY),
|
|
3415
|
-
pointFrom2(topX, topY),
|
|
3416
|
-
pointFrom2(topX - verticalRadius, topY + horizontalRadius)
|
|
3417
|
-
),
|
|
3418
|
-
-FIXED_BINDING_DISTANCE
|
|
3419
|
-
);
|
|
3420
|
-
const rightApprox = curveOffsetPoints(
|
|
3421
|
-
curve(
|
|
3422
|
-
pointFrom2(rightX - verticalRadius, rightY + horizontalRadius),
|
|
3423
|
-
pointFrom2(rightX, rightY),
|
|
3424
|
-
pointFrom2(rightX, rightY),
|
|
3425
|
-
pointFrom2(rightX - verticalRadius, rightY - horizontalRadius)
|
|
3426
|
-
),
|
|
3427
|
-
-FIXED_BINDING_DISTANCE
|
|
3428
|
-
);
|
|
3429
|
-
const bottomApprox = curveOffsetPoints(
|
|
3430
|
-
curve(
|
|
3431
|
-
pointFrom2(bottomX - verticalRadius, bottomY - horizontalRadius),
|
|
3432
|
-
pointFrom2(bottomX, bottomY),
|
|
3433
|
-
pointFrom2(bottomX, bottomY),
|
|
3434
|
-
pointFrom2(bottomX + verticalRadius, bottomY - horizontalRadius)
|
|
3435
|
-
),
|
|
3436
|
-
-FIXED_BINDING_DISTANCE
|
|
3437
|
-
);
|
|
3438
|
-
const leftApprox = curveOffsetPoints(
|
|
3439
|
-
curve(
|
|
3440
|
-
pointFrom2(leftX + verticalRadius, leftY - horizontalRadius),
|
|
3441
|
-
pointFrom2(leftX, leftY),
|
|
3442
|
-
pointFrom2(leftX, leftY),
|
|
3443
|
-
pointFrom2(leftX + verticalRadius, leftY + horizontalRadius)
|
|
3444
|
-
),
|
|
3445
|
-
-FIXED_BINDING_DISTANCE
|
|
3446
|
-
);
|
|
3447
|
-
context.moveTo(
|
|
3448
|
-
topApprox[topApprox.length - 1][0],
|
|
3449
|
-
topApprox[topApprox.length - 1][1]
|
|
3450
|
-
);
|
|
3451
|
-
context.lineTo(leftApprox[1][0], leftApprox[1][1]);
|
|
3452
|
-
drawCatmullRomCubicApprox(context, leftApprox);
|
|
3453
|
-
context.lineTo(bottomApprox[1][0], bottomApprox[1][1]);
|
|
3454
|
-
drawCatmullRomCubicApprox(context, bottomApprox);
|
|
3455
|
-
context.lineTo(rightApprox[1][0], rightApprox[1][1]);
|
|
3456
|
-
drawCatmullRomCubicApprox(context, rightApprox);
|
|
3457
|
-
context.lineTo(topApprox[1][0], topApprox[1][1]);
|
|
3458
|
-
drawCatmullRomCubicApprox(context, topApprox);
|
|
3459
|
-
}
|
|
3460
|
-
context.closePath();
|
|
3461
|
-
context.fill();
|
|
3462
|
-
context.restore();
|
|
3463
|
-
};
|
|
3464
3236
|
|
|
3465
3237
|
// renderer/staticScene.ts
|
|
3466
3238
|
var GridLineColor = {
|
|
3467
|
-
|
|
3468
|
-
|
|
3239
|
+
[THEME3.LIGHT]: {
|
|
3240
|
+
bold: "#dddddd",
|
|
3241
|
+
regular: "#e5e5e5"
|
|
3242
|
+
},
|
|
3243
|
+
[THEME3.DARK]: {
|
|
3244
|
+
bold: applyDarkModeFilter2("#dddddd"),
|
|
3245
|
+
regular: applyDarkModeFilter2("#e5e5e5")
|
|
3246
|
+
}
|
|
3469
3247
|
};
|
|
3470
|
-
var strokeGrid = (context, gridSize, gridStep, scrollX, scrollY, zoom, width, height) => {
|
|
3248
|
+
var strokeGrid = (context, gridSize, gridStep, scrollX, scrollY, zoom, theme, width, height) => {
|
|
3471
3249
|
const offsetX = scrollX % gridSize - gridSize;
|
|
3472
3250
|
const offsetY = scrollY % gridSize - gridSize;
|
|
3473
3251
|
const actualGridSize = gridSize * zoom.value;
|
|
@@ -3486,7 +3264,7 @@ var strokeGrid = (context, gridSize, gridStep, scrollX, scrollY, zoom, width, he
|
|
|
3486
3264
|
const lineDash = [lineWidth * 3, spaceWidth + (lineWidth + spaceWidth)];
|
|
3487
3265
|
context.beginPath();
|
|
3488
3266
|
context.setLineDash(isBold ? [] : lineDash);
|
|
3489
|
-
context.strokeStyle = isBold ? GridLineColor.
|
|
3267
|
+
context.strokeStyle = isBold ? GridLineColor[theme].bold : GridLineColor[theme].regular;
|
|
3490
3268
|
context.moveTo(x, offsetY - gridSize);
|
|
3491
3269
|
context.lineTo(x, Math.ceil(offsetY + height + gridSize * 2));
|
|
3492
3270
|
context.stroke();
|
|
@@ -3501,7 +3279,7 @@ var strokeGrid = (context, gridSize, gridStep, scrollX, scrollY, zoom, width, he
|
|
|
3501
3279
|
const lineDash = [lineWidth * 3, spaceWidth + (lineWidth + spaceWidth)];
|
|
3502
3280
|
context.beginPath();
|
|
3503
3281
|
context.setLineDash(isBold ? [] : lineDash);
|
|
3504
|
-
context.strokeStyle = isBold ? GridLineColor.
|
|
3282
|
+
context.strokeStyle = isBold ? GridLineColor[theme].bold : GridLineColor[theme].regular;
|
|
3505
3283
|
context.moveTo(offsetX - gridSize, y);
|
|
3506
3284
|
context.lineTo(Math.ceil(offsetX + width + gridSize * 2), y);
|
|
3507
3285
|
context.stroke();
|
|
@@ -3574,6 +3352,7 @@ var renderLinkIcon = (element, context, appState, elementsMap) => {
|
|
|
3574
3352
|
}
|
|
3575
3353
|
linkCanvasCacheContext.restore();
|
|
3576
3354
|
}
|
|
3355
|
+
context.globalAlpha = element.opacity / 100;
|
|
3577
3356
|
context.drawImage(linkCanvas, x - centerX, y - centerY, width, height);
|
|
3578
3357
|
context.restore();
|
|
3579
3358
|
}
|
|
@@ -3614,6 +3393,7 @@ var _renderStaticScene = ({
|
|
|
3614
3393
|
appState.scrollX,
|
|
3615
3394
|
appState.scrollY,
|
|
3616
3395
|
appState.zoom,
|
|
3396
|
+
renderConfig.theme,
|
|
3617
3397
|
normalizedWidth / appState.zoom.value,
|
|
3618
3398
|
normalizedHeight / appState.zoom.value
|
|
3619
3399
|
);
|
|
@@ -3780,12 +3560,15 @@ var renderStaticScene = (renderConfig, throttle) => {
|
|
|
3780
3560
|
import {
|
|
3781
3561
|
FRAME_STYLE as FRAME_STYLE2,
|
|
3782
3562
|
MAX_DECIMALS_FOR_SVG_EXPORT,
|
|
3783
|
-
MIME_TYPES as MIME_TYPES4,
|
|
3784
3563
|
SVG_NS,
|
|
3564
|
+
THEME as THEME4,
|
|
3565
|
+
DARK_THEME_FILTER,
|
|
3785
3566
|
getFontFamilyString,
|
|
3786
3567
|
isRTL,
|
|
3787
3568
|
isTestEnv as isTestEnv2,
|
|
3788
|
-
getVerticalOffset
|
|
3569
|
+
getVerticalOffset,
|
|
3570
|
+
applyDarkModeFilter as applyDarkModeFilter3,
|
|
3571
|
+
MIME_TYPES as MIME_TYPES4
|
|
3789
3572
|
} from "@excalidraw/common";
|
|
3790
3573
|
import { normalizeLink, toValidURL } from "@excalidraw/common";
|
|
3791
3574
|
import { hashString } from "@excalidraw/element";
|
|
@@ -3804,9 +3587,8 @@ import {
|
|
|
3804
3587
|
isTextElement as isTextElement3
|
|
3805
3588
|
} from "@excalidraw/element";
|
|
3806
3589
|
import { getContainingFrame } from "@excalidraw/element";
|
|
3807
|
-
import { getCornerRadius
|
|
3590
|
+
import { getCornerRadius, isPathALoop } from "@excalidraw/element";
|
|
3808
3591
|
import { ShapeCache as ShapeCache2 } from "@excalidraw/element";
|
|
3809
|
-
import { getFreeDrawSvgPath, IMAGE_INVERT_FILTER } from "@excalidraw/element";
|
|
3810
3592
|
import { getElementAbsoluteCoords as getElementAbsoluteCoords3 } from "@excalidraw/element";
|
|
3811
3593
|
var roughSVGDrawWithPrecision = (rsvg, drawable, precision) => {
|
|
3812
3594
|
if (typeof precision === "undefined") {
|
|
@@ -3874,7 +3656,7 @@ var renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, o
|
|
|
3874
3656
|
case "rectangle":
|
|
3875
3657
|
case "diamond":
|
|
3876
3658
|
case "ellipse": {
|
|
3877
|
-
const shape = ShapeCache2.generateElementShape(element,
|
|
3659
|
+
const shape = ShapeCache2.generateElementShape(element, renderConfig);
|
|
3878
3660
|
const node = roughSVGDrawWithPrecision(
|
|
3879
3661
|
rsvg,
|
|
3880
3662
|
shape,
|
|
@@ -3942,7 +3724,7 @@ var renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, o
|
|
|
3942
3724
|
while (embeddableNode.firstChild) {
|
|
3943
3725
|
embeddableNode.removeChild(embeddableNode.firstChild);
|
|
3944
3726
|
}
|
|
3945
|
-
const radius =
|
|
3727
|
+
const radius = getCornerRadius(
|
|
3946
3728
|
Math.min(element.width, element.height),
|
|
3947
3729
|
element
|
|
3948
3730
|
);
|
|
@@ -4067,36 +3849,49 @@ var renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, o
|
|
|
4067
3849
|
break;
|
|
4068
3850
|
}
|
|
4069
3851
|
case "freedraw": {
|
|
4070
|
-
const
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
3852
|
+
const wrapper = svgRoot.ownerDocument.createElementNS(SVG_NS, "g");
|
|
3853
|
+
const shapes = ShapeCache2.generateElementShape(element, renderConfig);
|
|
3854
|
+
for (const shape of shapes) {
|
|
3855
|
+
if (typeof shape === "string") {
|
|
3856
|
+
const path = svgRoot.ownerDocument.createElementNS(SVG_NS, "path");
|
|
3857
|
+
path.setAttribute(
|
|
3858
|
+
"fill",
|
|
3859
|
+
renderConfig.theme === THEME4.DARK ? applyDarkModeFilter3(element.strokeColor) : element.strokeColor
|
|
3860
|
+
);
|
|
3861
|
+
path.setAttribute("d", shape);
|
|
3862
|
+
wrapper.appendChild(path);
|
|
3863
|
+
} else {
|
|
3864
|
+
const bgNode = roughSVGDrawWithPrecision(
|
|
3865
|
+
rsvg,
|
|
3866
|
+
shape,
|
|
3867
|
+
MAX_DECIMALS_FOR_SVG_EXPORT
|
|
3868
|
+
);
|
|
3869
|
+
if (bgNode.nodeName === "g") {
|
|
3870
|
+
while (bgNode.firstChild) {
|
|
3871
|
+
wrapper.appendChild(bgNode.firstChild);
|
|
3872
|
+
}
|
|
3873
|
+
} else {
|
|
3874
|
+
wrapper.appendChild(bgNode);
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
4079
3878
|
if (opacity !== 1) {
|
|
4080
|
-
|
|
4081
|
-
|
|
3879
|
+
wrapper.setAttribute("stroke-opacity", `${opacity}`);
|
|
3880
|
+
wrapper.setAttribute("fill-opacity", `${opacity}`);
|
|
4082
3881
|
}
|
|
4083
|
-
|
|
3882
|
+
wrapper.setAttribute(
|
|
4084
3883
|
"transform",
|
|
4085
3884
|
`translate(${offsetX || 0} ${offsetY || 0}) rotate(${degree} ${cx} ${cy})`
|
|
4086
3885
|
);
|
|
4087
|
-
|
|
4088
|
-
const path = svgRoot.ownerDocument.createElementNS(SVG_NS, "path");
|
|
4089
|
-
path.setAttribute("fill", element.strokeColor);
|
|
4090
|
-
path.setAttribute("d", getFreeDrawSvgPath(element));
|
|
4091
|
-
node.appendChild(path);
|
|
3886
|
+
wrapper.setAttribute("stroke", "none");
|
|
4092
3887
|
const g = maybeWrapNodesInFrameClipPath(
|
|
4093
3888
|
element,
|
|
4094
3889
|
root,
|
|
4095
|
-
[
|
|
3890
|
+
[wrapper],
|
|
4096
3891
|
renderConfig.frameRendering,
|
|
4097
3892
|
elementsMap
|
|
4098
3893
|
);
|
|
4099
|
-
addToRoot(g ||
|
|
3894
|
+
addToRoot(g || wrapper, element);
|
|
4100
3895
|
break;
|
|
4101
3896
|
}
|
|
4102
3897
|
case "image": {
|
|
@@ -4136,9 +3931,6 @@ var renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, o
|
|
|
4136
3931
|
}
|
|
4137
3932
|
const use = svgRoot.ownerDocument.createElementNS(SVG_NS, "use");
|
|
4138
3933
|
use.setAttribute("href", `#${symbolId}`);
|
|
4139
|
-
if (renderConfig.exportWithDarkMode && fileData.mimeType !== MIME_TYPES4.svg) {
|
|
4140
|
-
use.setAttribute("filter", IMAGE_INVERT_FILTER);
|
|
4141
|
-
}
|
|
4142
3934
|
let normalizedCropX = 0;
|
|
4143
3935
|
let normalizedCropY = 0;
|
|
4144
3936
|
if (element.crop) {
|
|
@@ -4158,6 +3950,9 @@ var renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, o
|
|
|
4158
3950
|
);
|
|
4159
3951
|
}
|
|
4160
3952
|
const g = svgRoot.ownerDocument.createElementNS(SVG_NS, "g");
|
|
3953
|
+
if (renderConfig.theme === THEME4.DARK && fileData.mimeType === MIME_TYPES4.svg) {
|
|
3954
|
+
g.setAttribute("filter", DARK_THEME_FILTER);
|
|
3955
|
+
}
|
|
4161
3956
|
if (element.crop) {
|
|
4162
3957
|
const mask = svgRoot.ownerDocument.createElementNS(SVG_NS, "mask");
|
|
4163
3958
|
mask.setAttribute("id", `mask-image-crop-${element.id}`);
|
|
@@ -4185,14 +3980,19 @@ var renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, o
|
|
|
4185
3980
|
"clipPath"
|
|
4186
3981
|
);
|
|
4187
3982
|
clipPath.id = `image-clipPath-${element.id}`;
|
|
3983
|
+
clipPath.setAttribute("clipPathUnits", "userSpaceOnUse");
|
|
4188
3984
|
const clipRect = svgRoot.ownerDocument.createElementNS(
|
|
4189
3985
|
SVG_NS,
|
|
4190
3986
|
"rect"
|
|
4191
3987
|
);
|
|
4192
|
-
const radius =
|
|
3988
|
+
const radius = getCornerRadius(
|
|
4193
3989
|
Math.min(element.width, element.height),
|
|
4194
3990
|
element
|
|
4195
3991
|
);
|
|
3992
|
+
const clipOffsetX = element.crop ? normalizedCropX : 0;
|
|
3993
|
+
const clipOffsetY = element.crop ? normalizedCropY : 0;
|
|
3994
|
+
clipRect.setAttribute("x", `${clipOffsetX}`);
|
|
3995
|
+
clipRect.setAttribute("y", `${clipOffsetY}`);
|
|
4196
3996
|
clipRect.setAttribute("width", `${element.width}`);
|
|
4197
3997
|
clipRect.setAttribute("height", `${element.height}`);
|
|
4198
3998
|
clipRect.setAttribute("rx", `${radius}`);
|
|
@@ -4225,7 +4025,10 @@ var renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, o
|
|
|
4225
4025
|
rect.setAttribute("rx", FRAME_STYLE2.radius.toString());
|
|
4226
4026
|
rect.setAttribute("ry", FRAME_STYLE2.radius.toString());
|
|
4227
4027
|
rect.setAttribute("fill", "none");
|
|
4228
|
-
rect.setAttribute(
|
|
4028
|
+
rect.setAttribute(
|
|
4029
|
+
"stroke",
|
|
4030
|
+
renderConfig.theme === THEME4.DARK ? applyDarkModeFilter3(FRAME_STYLE2.strokeColor) : FRAME_STYLE2.strokeColor
|
|
4031
|
+
);
|
|
4229
4032
|
rect.setAttribute("stroke-width", FRAME_STYLE2.strokeWidth.toString());
|
|
4230
4033
|
addToRoot(rect, element);
|
|
4231
4034
|
}
|
|
@@ -4262,7 +4065,10 @@ var renderElementToSvg = (element, elementsMap, rsvg, svgRoot, files, offsetX, o
|
|
|
4262
4065
|
text.setAttribute("y", `${i * lineHeightPx + verticalOffset}`);
|
|
4263
4066
|
text.setAttribute("font-family", getFontFamilyString(element));
|
|
4264
4067
|
text.setAttribute("font-size", `${element.fontSize}px`);
|
|
4265
|
-
text.setAttribute(
|
|
4068
|
+
text.setAttribute(
|
|
4069
|
+
"fill",
|
|
4070
|
+
renderConfig.theme === THEME4.DARK ? applyDarkModeFilter3(element.strokeColor) : element.strokeColor
|
|
4071
|
+
);
|
|
4266
4072
|
text.setAttribute("text-anchor", textAnchor);
|
|
4267
4073
|
text.setAttribute("style", "white-space: pre;");
|
|
4268
4074
|
text.setAttribute("direction", direction);
|
|
@@ -4475,7 +4281,7 @@ var exportToCanvas = async (elements, appState, files, {
|
|
|
4475
4281
|
scrollY: -minY + exportPadding,
|
|
4476
4282
|
zoom: defaultAppState.zoom,
|
|
4477
4283
|
shouldCacheIgnoreZoom: false,
|
|
4478
|
-
theme: appState.exportWithDarkMode ?
|
|
4284
|
+
theme: appState.exportWithDarkMode ? THEME5.DARK : THEME5.LIGHT
|
|
4479
4285
|
},
|
|
4480
4286
|
renderConfig: {
|
|
4481
4287
|
canvasBackgroundColor: viewBackgroundColor,
|
|
@@ -4485,7 +4291,8 @@ var exportToCanvas = async (elements, appState, files, {
|
|
|
4485
4291
|
// empty disables embeddable rendering
|
|
4486
4292
|
embedsValidationStatus: /* @__PURE__ */ new Map(),
|
|
4487
4293
|
elementsPendingErasure: /* @__PURE__ */ new Set(),
|
|
4488
|
-
pendingFlowchartNodes: null
|
|
4294
|
+
pendingFlowchartNodes: null,
|
|
4295
|
+
theme: appState.exportWithDarkMode ? THEME5.DARK : THEME5.LIGHT
|
|
4489
4296
|
}
|
|
4490
4297
|
});
|
|
4491
4298
|
return canvas;
|
|
@@ -4527,9 +4334,6 @@ var exportToSvg = async (elements, appState, files, opts) => {
|
|
|
4527
4334
|
svgRoot.setAttribute("viewBox", `0 0 ${width} ${height}`);
|
|
4528
4335
|
svgRoot.setAttribute("width", `${width * exportScale}`);
|
|
4529
4336
|
svgRoot.setAttribute("height", `${height * exportScale}`);
|
|
4530
|
-
if (exportWithDarkMode) {
|
|
4531
|
-
svgRoot.setAttribute("filter", THEME_FILTER2);
|
|
4532
|
-
}
|
|
4533
4337
|
const defsElement = svgRoot.ownerDocument.createElementNS(SVG_NS2, "defs");
|
|
4534
4338
|
const metadataElement = svgRoot.ownerDocument.createElementNS(
|
|
4535
4339
|
SVG_NS2,
|
|
@@ -4593,7 +4397,10 @@ var exportToSvg = async (elements, appState, files, opts) => {
|
|
|
4593
4397
|
rect.setAttribute("y", "0");
|
|
4594
4398
|
rect.setAttribute("width", `${width}`);
|
|
4595
4399
|
rect.setAttribute("height", `${height}`);
|
|
4596
|
-
rect.setAttribute(
|
|
4400
|
+
rect.setAttribute(
|
|
4401
|
+
"fill",
|
|
4402
|
+
exportWithDarkMode ? applyDarkModeFilter4(viewBackgroundColor) : viewBackgroundColor
|
|
4403
|
+
);
|
|
4597
4404
|
svgRoot.appendChild(rect);
|
|
4598
4405
|
}
|
|
4599
4406
|
const rsvg = rough.svg(svgRoot);
|
|
@@ -4615,7 +4422,8 @@ var exportToSvg = async (elements, appState, files, opts) => {
|
|
|
4615
4422
|
embedsValidationStatus: renderEmbeddables ? new Map(
|
|
4616
4423
|
elementsForRender.filter((element) => isFrameLikeElement(element)).map((element) => [element.id, true])
|
|
4617
4424
|
) : /* @__PURE__ */ new Map(),
|
|
4618
|
-
reuseImages: opts?.reuseImages ?? true
|
|
4425
|
+
reuseImages: opts?.reuseImages ?? true,
|
|
4426
|
+
theme: exportWithDarkMode ? THEME5.DARK : THEME5.LIGHT
|
|
4619
4427
|
}
|
|
4620
4428
|
);
|
|
4621
4429
|
return svgRoot;
|
|
@@ -4678,7 +4486,7 @@ var getExportSize = (elements, exportPadding, scale) => {
|
|
|
4678
4486
|
};
|
|
4679
4487
|
|
|
4680
4488
|
// data/restore.ts
|
|
4681
|
-
import { isFiniteNumber, pointFrom as
|
|
4489
|
+
import { isFiniteNumber, pointFrom as pointFrom2 } from "@excalidraw/math";
|
|
4682
4490
|
import {
|
|
4683
4491
|
DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY2,
|
|
4684
4492
|
DEFAULT_TEXT_ALIGN as DEFAULT_TEXT_ALIGN2,
|
|
@@ -4697,7 +4505,13 @@ import {
|
|
|
4697
4505
|
normalizeLink as normalizeLink2,
|
|
4698
4506
|
getLineHeight
|
|
4699
4507
|
} from "@excalidraw/common";
|
|
4700
|
-
import {
|
|
4508
|
+
import {
|
|
4509
|
+
calculateFixedPointForNonElbowArrowBinding,
|
|
4510
|
+
getNonDeletedElements,
|
|
4511
|
+
isPointInElement,
|
|
4512
|
+
isValidPolygon,
|
|
4513
|
+
projectFixedPointOntoDiagonal
|
|
4514
|
+
} from "@excalidraw/element";
|
|
4701
4515
|
import { normalizeFixedPoint } from "@excalidraw/element";
|
|
4702
4516
|
import {
|
|
4703
4517
|
updateElbowArrowPoints,
|
|
@@ -4711,7 +4525,6 @@ import {
|
|
|
4711
4525
|
isArrowBoundToElement,
|
|
4712
4526
|
isArrowElement as isArrowElement2,
|
|
4713
4527
|
isElbowArrow,
|
|
4714
|
-
isFixedPointBinding,
|
|
4715
4528
|
isLinearElement,
|
|
4716
4529
|
isLineElement,
|
|
4717
4530
|
isTextElement as isTextElement4,
|
|
@@ -4746,23 +4559,67 @@ var getFontFamilyByName = (fontFamilyName) => {
|
|
|
4746
4559
|
}
|
|
4747
4560
|
return DEFAULT_FONT_FAMILY2;
|
|
4748
4561
|
};
|
|
4749
|
-
var repairBinding = (element, binding) => {
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4562
|
+
var repairBinding = (element, binding, targetElementsMap, existingElementsMap, startOrEnd) => {
|
|
4563
|
+
try {
|
|
4564
|
+
if (!binding) {
|
|
4565
|
+
return null;
|
|
4566
|
+
}
|
|
4567
|
+
if (isElbowArrow(element)) {
|
|
4568
|
+
const fixedPointBinding = {
|
|
4569
|
+
...binding,
|
|
4570
|
+
fixedPoint: normalizeFixedPoint(binding.fixedPoint ?? [0, 0]),
|
|
4571
|
+
mode: binding.mode || "orbit"
|
|
4572
|
+
};
|
|
4573
|
+
return fixedPointBinding;
|
|
4574
|
+
}
|
|
4575
|
+
if (binding.mode) {
|
|
4576
|
+
if (binding.elementId) {
|
|
4577
|
+
return {
|
|
4578
|
+
elementId: binding.elementId,
|
|
4579
|
+
mode: binding.mode,
|
|
4580
|
+
fixedPoint: normalizeFixedPoint(binding.fixedPoint || [0.5, 0.5])
|
|
4581
|
+
};
|
|
4582
|
+
}
|
|
4583
|
+
return null;
|
|
4584
|
+
}
|
|
4585
|
+
const targetBoundElement = targetElementsMap.get(binding.elementId) || void 0;
|
|
4586
|
+
const boundElement = targetBoundElement || existingElementsMap?.get(
|
|
4587
|
+
binding.elementId
|
|
4588
|
+
) || void 0;
|
|
4589
|
+
const elementsMap = targetBoundElement ? targetElementsMap : existingElementsMap;
|
|
4590
|
+
if (boundElement && elementsMap) {
|
|
4591
|
+
const p = LinearElementEditor2.getPointAtIndexGlobalCoordinates(
|
|
4592
|
+
element,
|
|
4593
|
+
startOrEnd === "start" ? 0 : element.points.length - 1,
|
|
4594
|
+
elementsMap
|
|
4595
|
+
);
|
|
4596
|
+
const mode = isPointInElement(p, boundElement, elementsMap) ? "inside" : "orbit";
|
|
4597
|
+
const focusPoint = mode === "inside" ? p : projectFixedPointOntoDiagonal(
|
|
4598
|
+
element,
|
|
4599
|
+
p,
|
|
4600
|
+
boundElement,
|
|
4601
|
+
startOrEnd,
|
|
4602
|
+
elementsMap,
|
|
4603
|
+
{ value: 1 }
|
|
4604
|
+
) || p;
|
|
4605
|
+
const { fixedPoint } = calculateFixedPointForNonElbowArrowBinding(
|
|
4606
|
+
element,
|
|
4607
|
+
boundElement,
|
|
4608
|
+
startOrEnd,
|
|
4609
|
+
elementsMap,
|
|
4610
|
+
focusPoint
|
|
4611
|
+
);
|
|
4612
|
+
return {
|
|
4613
|
+
mode,
|
|
4614
|
+
elementId: binding.elementId,
|
|
4615
|
+
fixedPoint
|
|
4616
|
+
};
|
|
4617
|
+
}
|
|
4618
|
+
console.error(`could not repair binding for element`);
|
|
4619
|
+
} catch (error) {
|
|
4620
|
+
console.error("Error repairing binding:", error);
|
|
4761
4621
|
}
|
|
4762
|
-
return
|
|
4763
|
-
...binding,
|
|
4764
|
-
focus
|
|
4765
|
-
};
|
|
4622
|
+
return null;
|
|
4766
4623
|
};
|
|
4767
4624
|
var restoreElementWithProperties = (element, extra) => {
|
|
4768
4625
|
const base = {
|
|
@@ -4815,7 +4672,7 @@ var restoreElementWithProperties = (element, extra) => {
|
|
|
4815
4672
|
delete ret.boundElementIds;
|
|
4816
4673
|
return ret;
|
|
4817
4674
|
};
|
|
4818
|
-
var restoreElement = (element, opts) => {
|
|
4675
|
+
var restoreElement = (element, targetElementsMap, existingElementsMap, opts) => {
|
|
4819
4676
|
element = { ...element };
|
|
4820
4677
|
switch (element.type) {
|
|
4821
4678
|
case "text":
|
|
@@ -4855,7 +4712,6 @@ var restoreElement = (element, opts) => {
|
|
|
4855
4712
|
case "freedraw": {
|
|
4856
4713
|
return restoreElementWithProperties(element, {
|
|
4857
4714
|
points: element.points,
|
|
4858
|
-
lastCommittedPoint: null,
|
|
4859
4715
|
simulatePressure: element.simulatePressure,
|
|
4860
4716
|
pressures: element.pressures
|
|
4861
4717
|
});
|
|
@@ -4874,16 +4730,15 @@ var restoreElement = (element, opts) => {
|
|
|
4874
4730
|
let y = element.y;
|
|
4875
4731
|
let points = (
|
|
4876
4732
|
// migrate old arrow model to new one
|
|
4877
|
-
!Array.isArray(element.points) || element.points.length < 2 ? [
|
|
4733
|
+
!Array.isArray(element.points) || element.points.length < 2 ? [pointFrom2(0, 0), pointFrom2(element.width, element.height)] : element.points
|
|
4878
4734
|
);
|
|
4879
4735
|
if (points[0][0] !== 0 || points[0][1] !== 0) {
|
|
4880
4736
|
({ points, x, y } = LinearElementEditor2.getNormalizeElementPointsAndCoords(element));
|
|
4881
4737
|
}
|
|
4882
4738
|
return restoreElementWithProperties(element, {
|
|
4883
|
-
type:
|
|
4884
|
-
startBinding:
|
|
4885
|
-
endBinding:
|
|
4886
|
-
lastCommittedPoint: null,
|
|
4739
|
+
type: "line",
|
|
4740
|
+
startBinding: null,
|
|
4741
|
+
endBinding: null,
|
|
4887
4742
|
startArrowhead,
|
|
4888
4743
|
endArrowhead,
|
|
4889
4744
|
points,
|
|
@@ -4896,20 +4751,28 @@ var restoreElement = (element, opts) => {
|
|
|
4896
4751
|
});
|
|
4897
4752
|
case "arrow": {
|
|
4898
4753
|
const { startArrowhead: startArrowhead2 = null, endArrowhead: endArrowhead2 = "arrow" } = element;
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4754
|
+
const x2 = element.x;
|
|
4755
|
+
const y2 = element.y;
|
|
4756
|
+
const points2 = (
|
|
4902
4757
|
// migrate old arrow model to new one
|
|
4903
|
-
!Array.isArray(element.points) || element.points.length < 2 ? [
|
|
4758
|
+
!Array.isArray(element.points) || element.points.length < 2 ? [pointFrom2(0, 0), pointFrom2(element.width, element.height)] : element.points
|
|
4904
4759
|
);
|
|
4905
|
-
if (points2[0][0] !== 0 || points2[0][1] !== 0) {
|
|
4906
|
-
({ points: points2, x: x2, y: y2 } = LinearElementEditor2.getNormalizeElementPointsAndCoords(element));
|
|
4907
|
-
}
|
|
4908
4760
|
const base = {
|
|
4909
4761
|
type: element.type,
|
|
4910
|
-
startBinding: repairBinding(
|
|
4911
|
-
|
|
4912
|
-
|
|
4762
|
+
startBinding: repairBinding(
|
|
4763
|
+
element,
|
|
4764
|
+
element.startBinding,
|
|
4765
|
+
targetElementsMap,
|
|
4766
|
+
existingElementsMap,
|
|
4767
|
+
"start"
|
|
4768
|
+
),
|
|
4769
|
+
endBinding: repairBinding(
|
|
4770
|
+
element,
|
|
4771
|
+
element.endBinding,
|
|
4772
|
+
targetElementsMap,
|
|
4773
|
+
existingElementsMap,
|
|
4774
|
+
"end"
|
|
4775
|
+
),
|
|
4913
4776
|
startArrowhead: startArrowhead2,
|
|
4914
4777
|
endArrowhead: endArrowhead2,
|
|
4915
4778
|
points: points2,
|
|
@@ -4918,15 +4781,19 @@ var restoreElement = (element, opts) => {
|
|
|
4918
4781
|
elbowed: element.elbowed,
|
|
4919
4782
|
...getSizeFromPoints(points2)
|
|
4920
4783
|
};
|
|
4921
|
-
|
|
4784
|
+
const restoredElement = isElbowArrow(element) ? restoreElementWithProperties(element, {
|
|
4922
4785
|
...base,
|
|
4923
4786
|
elbowed: true,
|
|
4924
|
-
|
|
4925
|
-
endBinding: repairBinding(element, element.endBinding),
|
|
4926
|
-
fixedSegments: element.fixedSegments,
|
|
4787
|
+
fixedSegments: element.fixedSegments?.length && base.points.length >= 4 ? element.fixedSegments : null,
|
|
4927
4788
|
startIsSpecial: element.startIsSpecial,
|
|
4928
4789
|
endIsSpecial: element.endIsSpecial
|
|
4929
4790
|
}) : restoreElementWithProperties(element, base);
|
|
4791
|
+
return {
|
|
4792
|
+
...restoredElement,
|
|
4793
|
+
...LinearElementEditor2.getNormalizeElementPointsAndCoords(
|
|
4794
|
+
restoredElement
|
|
4795
|
+
)
|
|
4796
|
+
};
|
|
4930
4797
|
}
|
|
4931
4798
|
case "ellipse":
|
|
4932
4799
|
case "rectangle":
|
|
@@ -4991,21 +4858,33 @@ var repairFrameMembership = (element, elementsMap) => {
|
|
|
4991
4858
|
}
|
|
4992
4859
|
}
|
|
4993
4860
|
};
|
|
4994
|
-
var restoreElements = (
|
|
4861
|
+
var restoreElements = (targetElements, existingElements, opts) => {
|
|
4995
4862
|
const existingIds = /* @__PURE__ */ new Set();
|
|
4996
|
-
const
|
|
4863
|
+
const targetElementsMap = arrayToMap2(targetElements || []);
|
|
4864
|
+
const existingElementsMap = existingElements ? arrayToMap2(existingElements) : null;
|
|
4997
4865
|
const restoredElements = syncInvalidIndices2(
|
|
4998
|
-
(
|
|
4866
|
+
(targetElements || []).reduce((elements, element) => {
|
|
4999
4867
|
if (element.type === "selection") {
|
|
5000
|
-
return
|
|
4868
|
+
return elements;
|
|
4869
|
+
}
|
|
4870
|
+
let migratedElement;
|
|
4871
|
+
try {
|
|
4872
|
+
migratedElement = restoreElement(
|
|
4873
|
+
element,
|
|
4874
|
+
targetElementsMap,
|
|
4875
|
+
existingElementsMap,
|
|
4876
|
+
{
|
|
4877
|
+
deleteInvisibleElements: opts?.deleteInvisibleElements
|
|
4878
|
+
}
|
|
4879
|
+
);
|
|
4880
|
+
} catch (error) {
|
|
4881
|
+
console.error("Error restoring element:", error);
|
|
4882
|
+
migratedElement = null;
|
|
5001
4883
|
}
|
|
5002
|
-
let migratedElement = restoreElement(element, {
|
|
5003
|
-
deleteInvisibleElements: opts?.deleteInvisibleElements
|
|
5004
|
-
});
|
|
5005
4884
|
if (migratedElement) {
|
|
5006
|
-
const localElement =
|
|
4885
|
+
const localElement = existingElementsMap?.get(element.id);
|
|
5007
4886
|
const shouldMarkAsDeleted = opts?.deleteInvisibleElements && isInvisiblySmallElement(element);
|
|
5008
|
-
if (shouldMarkAsDeleted
|
|
4887
|
+
if (shouldMarkAsDeleted) {
|
|
5009
4888
|
migratedElement = bumpVersion(migratedElement, localElement?.version);
|
|
5010
4889
|
}
|
|
5011
4890
|
if (shouldMarkAsDeleted) {
|
|
@@ -5015,9 +4894,9 @@ var restoreElements = (elements, localElements, opts) => {
|
|
|
5015
4894
|
migratedElement = { ...migratedElement, id: randomId() };
|
|
5016
4895
|
}
|
|
5017
4896
|
existingIds.add(migratedElement.id);
|
|
5018
|
-
|
|
4897
|
+
elements.push(migratedElement);
|
|
5019
4898
|
}
|
|
5020
|
-
return
|
|
4899
|
+
return elements;
|
|
5021
4900
|
}, [])
|
|
5022
4901
|
);
|
|
5023
4902
|
if (!opts?.repairBindings) {
|
|
@@ -5061,7 +4940,7 @@ var restoreElements = (elements, localElements, opts) => {
|
|
|
5061
4940
|
restoredElementsMap,
|
|
5062
4941
|
{
|
|
5063
4942
|
points: [
|
|
5064
|
-
|
|
4943
|
+
pointFrom2(0, 0),
|
|
5065
4944
|
element.points[element.points.length - 1]
|
|
5066
4945
|
]
|
|
5067
4946
|
}
|
|
@@ -5090,10 +4969,10 @@ var restoreElements = (elements, localElements, opts) => {
|
|
|
5090
4969
|
width: boundElement.width,
|
|
5091
4970
|
height: boundElement.height,
|
|
5092
4971
|
points: [
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
4972
|
+
pointFrom2(0, 0),
|
|
4973
|
+
pointFrom2(0, -10),
|
|
4974
|
+
pointFrom2(boundElement.width / 2 + 5, -10),
|
|
4975
|
+
pointFrom2(
|
|
5097
4976
|
boundElement.width / 2 + 5,
|
|
5098
4977
|
boundElement.height / 2 + 5
|
|
5099
4978
|
)
|
|
@@ -5171,13 +5050,6 @@ var restoreAppState = (appState, localAppState) => {
|
|
|
5171
5050
|
editingFrame: null
|
|
5172
5051
|
};
|
|
5173
5052
|
};
|
|
5174
|
-
var restore = (data, localAppState, localElements, elementsConfig) => {
|
|
5175
|
-
return {
|
|
5176
|
-
elements: restoreElements(data?.elements, localElements, elementsConfig),
|
|
5177
|
-
appState: restoreAppState(data?.appState, localAppState || null),
|
|
5178
|
-
files: data?.files || {}
|
|
5179
|
-
};
|
|
5180
|
-
};
|
|
5181
5053
|
var restoreLibraryItem = (libraryItem) => {
|
|
5182
5054
|
const elements = restoreElements(
|
|
5183
5055
|
getNonDeletedElements(libraryItem.elements),
|
|
@@ -5219,7 +5091,7 @@ var parseFileContents = async (blob) => {
|
|
|
5219
5091
|
let contents;
|
|
5220
5092
|
if (blob.type === MIME_TYPES6.png) {
|
|
5221
5093
|
try {
|
|
5222
|
-
return await (await import("./data/image-
|
|
5094
|
+
return await (await import("./data/image-VHVPDZAZ.js")).decodePngMetadata(blob);
|
|
5223
5095
|
} catch (error) {
|
|
5224
5096
|
if (error.message === "INVALID") {
|
|
5225
5097
|
throw new ImageSceneDataError(
|
|
@@ -5301,25 +5173,22 @@ var loadSceneOrLibraryFromBlob = async (blob, localAppState, localElements, file
|
|
|
5301
5173
|
if (isValidExcalidrawData(data)) {
|
|
5302
5174
|
return {
|
|
5303
5175
|
type: MIME_TYPES6.excalidraw,
|
|
5304
|
-
data:
|
|
5305
|
-
{
|
|
5306
|
-
|
|
5307
|
-
|
|
5176
|
+
data: {
|
|
5177
|
+
elements: restoreElements(data.elements, localElements, {
|
|
5178
|
+
repairBindings: true,
|
|
5179
|
+
deleteInvisibleElements: true
|
|
5180
|
+
}),
|
|
5181
|
+
appState: restoreAppState(
|
|
5182
|
+
{
|
|
5308
5183
|
theme: localAppState?.theme,
|
|
5309
5184
|
fileHandle: fileHandle || blob.handle || null,
|
|
5310
5185
|
...cleanAppStateForExport(data.appState || {}),
|
|
5311
5186
|
...localAppState ? calculateScrollCenter(data.elements || [], localAppState) : {}
|
|
5312
5187
|
},
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
{
|
|
5318
|
-
repairBindings: true,
|
|
5319
|
-
refreshDimensions: false,
|
|
5320
|
-
deleteInvisibleElements: true
|
|
5321
|
-
}
|
|
5322
|
-
)
|
|
5188
|
+
localAppState
|
|
5189
|
+
),
|
|
5190
|
+
files: data.files || {}
|
|
5191
|
+
}
|
|
5323
5192
|
};
|
|
5324
5193
|
} else if (isValidLibrary(data)) {
|
|
5325
5194
|
return {
|
|
@@ -5463,16 +5332,11 @@ var ImageURLToFile = async (imageUrl, filename = "") => {
|
|
|
5463
5332
|
}
|
|
5464
5333
|
throw new Error("Error: unsupported file type", { cause: "UNSUPPORTED" });
|
|
5465
5334
|
};
|
|
5466
|
-
var getFileFromEvent = async (event) => {
|
|
5467
|
-
const file = event.dataTransfer.files.item(0);
|
|
5468
|
-
const fileHandle = await getFileHandle(event);
|
|
5469
|
-
return { file: file ? await normalizeFile(file) : null, fileHandle };
|
|
5470
|
-
};
|
|
5471
5335
|
var getFileHandle = async (event) => {
|
|
5472
5336
|
if (nativeFileSystemSupported) {
|
|
5473
5337
|
try {
|
|
5474
|
-
const
|
|
5475
|
-
const handle = await
|
|
5338
|
+
const dataTransferItem = event instanceof DataTransferItem ? event : event.dataTransfer?.items?.[0];
|
|
5339
|
+
const handle = await dataTransferItem.getAsFileSystemHandle() || null;
|
|
5476
5340
|
return handle;
|
|
5477
5341
|
} catch (error) {
|
|
5478
5342
|
console.warn(error.name, error.message);
|
|
@@ -5481,61 +5345,52 @@ var getFileHandle = async (event) => {
|
|
|
5481
5345
|
}
|
|
5482
5346
|
return null;
|
|
5483
5347
|
};
|
|
5484
|
-
var getActualMimeTypeFromImage = (
|
|
5348
|
+
var getActualMimeTypeFromImage = async (file) => {
|
|
5485
5349
|
let mimeType = null;
|
|
5486
|
-
const
|
|
5487
|
-
|
|
5350
|
+
const leadingBytes = [
|
|
5351
|
+
...new Uint8Array(await blobToArrayBuffer(file.slice(0, 15)))
|
|
5352
|
+
].join(" ");
|
|
5353
|
+
const bytes = {
|
|
5488
5354
|
// https://en.wikipedia.org/wiki/Portable_Network_Graphics#File_header
|
|
5489
|
-
png:
|
|
5355
|
+
png: /^137 80 78 71 13 10 26 10\b/,
|
|
5490
5356
|
// https://en.wikipedia.org/wiki/JPEG#Syntax_and_structure
|
|
5491
5357
|
// jpg is a bit wonky. Checking the first three bytes should be enough,
|
|
5492
5358
|
// but may yield false positives. (https://stackoverflow.com/a/23360709/927631)
|
|
5493
|
-
jpg:
|
|
5359
|
+
jpg: /^255 216 255\b/,
|
|
5494
5360
|
// https://en.wikipedia.org/wiki/GIF#Example_GIF_file
|
|
5495
|
-
gif:
|
|
5361
|
+
gif: /^71 73 70 56 57 97\b/,
|
|
5362
|
+
// 4 bytes for RIFF + 4 bytes for chunk size + WEBP identifier
|
|
5363
|
+
webp: /^82 73 70 70 \d+ \d+ \d+ \d+ 87 69 66 80 86 80 56\b/
|
|
5496
5364
|
};
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
return mimeType;
|
|
5365
|
+
for (const type of Object.keys(bytes)) {
|
|
5366
|
+
if (leadingBytes.match(bytes[type])) {
|
|
5367
|
+
mimeType = MIME_TYPES6[type];
|
|
5368
|
+
break;
|
|
5369
|
+
}
|
|
5370
|
+
}
|
|
5371
|
+
return mimeType || file.type || null;
|
|
5505
5372
|
};
|
|
5506
5373
|
var createFile = (blob, mimeType, name) => {
|
|
5507
5374
|
return new File([blob], name || "", {
|
|
5508
5375
|
type: mimeType
|
|
5509
5376
|
});
|
|
5510
5377
|
};
|
|
5378
|
+
var normalizedFileSymbol = Symbol("fileNormalized");
|
|
5511
5379
|
var normalizeFile = async (file) => {
|
|
5512
|
-
if (
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
await blobToArrayBuffer(file),
|
|
5522
|
-
MIME_TYPES6.excalidraw,
|
|
5523
|
-
file.name
|
|
5524
|
-
);
|
|
5525
|
-
} else {
|
|
5526
|
-
const buffer = await blobToArrayBuffer(file);
|
|
5527
|
-
const mimeType = getActualMimeTypeFromImage(buffer);
|
|
5528
|
-
if (mimeType) {
|
|
5529
|
-
file = createFile(buffer, mimeType, file.name);
|
|
5530
|
-
}
|
|
5531
|
-
}
|
|
5532
|
-
} else if (isSupportedImageFile(file)) {
|
|
5533
|
-
const buffer = await blobToArrayBuffer(file);
|
|
5534
|
-
const mimeType = getActualMimeTypeFromImage(buffer);
|
|
5380
|
+
if (file[normalizedFileSymbol]) {
|
|
5381
|
+
return file;
|
|
5382
|
+
}
|
|
5383
|
+
if (file?.name?.endsWith(".excalidrawlib")) {
|
|
5384
|
+
file = createFile(file, MIME_TYPES6.excalidrawlib, file.name);
|
|
5385
|
+
} else if (file?.name?.endsWith(".excalidraw")) {
|
|
5386
|
+
file = createFile(file, MIME_TYPES6.excalidraw, file.name);
|
|
5387
|
+
} else if (!file.type || file.type?.startsWith("image/")) {
|
|
5388
|
+
const mimeType = await getActualMimeTypeFromImage(file);
|
|
5535
5389
|
if (mimeType && mimeType !== file.type) {
|
|
5536
|
-
file = createFile(
|
|
5390
|
+
file = createFile(file, mimeType, file.name);
|
|
5537
5391
|
}
|
|
5538
5392
|
}
|
|
5393
|
+
file[normalizedFileSymbol] = true;
|
|
5539
5394
|
return file;
|
|
5540
5395
|
};
|
|
5541
5396
|
var blobToArrayBuffer = (blob) => {
|
|
@@ -5617,6 +5472,7 @@ export {
|
|
|
5617
5472
|
AbortError,
|
|
5618
5473
|
ImageSceneDataError,
|
|
5619
5474
|
ExcalidrawError,
|
|
5475
|
+
RequestError,
|
|
5620
5476
|
Fonts,
|
|
5621
5477
|
getDefaultAppState,
|
|
5622
5478
|
isEraserActive,
|
|
@@ -5635,10 +5491,7 @@ export {
|
|
|
5635
5491
|
fillCircle,
|
|
5636
5492
|
getNormalizedCanvasDimensions,
|
|
5637
5493
|
bootstrapCanvas,
|
|
5638
|
-
|
|
5639
|
-
strokeEllipseWithRotation,
|
|
5640
|
-
strokeRectWithRotation,
|
|
5641
|
-
drawHighlightForDiamondWithRotation,
|
|
5494
|
+
strokeRectWithRotation_simple,
|
|
5642
5495
|
frameClip,
|
|
5643
5496
|
renderStaticSceneThrottled,
|
|
5644
5497
|
renderStaticScene,
|
|
@@ -5648,7 +5501,6 @@ export {
|
|
|
5648
5501
|
restoreElement,
|
|
5649
5502
|
restoreElements,
|
|
5650
5503
|
restoreAppState,
|
|
5651
|
-
restore,
|
|
5652
5504
|
restoreLibraryItems,
|
|
5653
5505
|
getTEXtChunk,
|
|
5654
5506
|
encodePngMetadata,
|
|
@@ -5670,8 +5522,8 @@ export {
|
|
|
5670
5522
|
resizeImageFile,
|
|
5671
5523
|
SVGStringToFile,
|
|
5672
5524
|
ImageURLToFile,
|
|
5673
|
-
|
|
5525
|
+
getFileHandle,
|
|
5674
5526
|
createFile,
|
|
5675
5527
|
normalizeFile
|
|
5676
5528
|
};
|
|
5677
|
-
//# sourceMappingURL=chunk-
|
|
5529
|
+
//# sourceMappingURL=chunk-3BOYZTLR.js.map
|