@myoc/excalidraw 0.19.521 → 0.19.522
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/CHANGELOG.md +227 -8
- package/dist/dev/{chunk-P7I4FGOG.js → chunk-6T5HZJCI.js} +2 -2
- package/dist/dev/chunk-72CYJXY3.js +69 -0
- package/dist/dev/chunk-72CYJXY3.js.map +7 -0
- package/dist/dev/{chunk-MN6E45MP.js → chunk-BCNQXIBK.js} +348 -85
- package/dist/dev/chunk-BCNQXIBK.js.map +7 -0
- package/dist/dev/{chunk-IU2VFRFU.js → chunk-SKCAT7JG.js} +19 -6
- package/dist/dev/chunk-SKCAT7JG.js.map +7 -0
- package/dist/dev/data/{image-ZYGVHYLC.js → image-NFLICJEW.js} +3 -3
- package/dist/dev/index.css +2198 -2250
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +14897 -11932
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{ar-SA-NFU76NHO.js → ar-SA-JEFXMY43.js} +69 -29
- package/dist/dev/locales/ar-SA-JEFXMY43.js.map +7 -0
- package/dist/dev/locales/{az-AZ-F7U432OF.js → az-AZ-K5GG7N2H.js} +47 -7
- package/dist/dev/locales/az-AZ-K5GG7N2H.js.map +7 -0
- package/dist/dev/locales/{bg-BG-VMJGHZ3R.js → bg-BG-YUNBCAUF.js} +47 -7
- package/dist/dev/locales/bg-BG-YUNBCAUF.js.map +7 -0
- package/dist/dev/locales/{bn-BD-ABWH5RGF.js → bn-BD-TASJ52R7.js} +47 -7
- package/dist/dev/locales/bn-BD-TASJ52R7.js.map +7 -0
- package/dist/dev/locales/{bn-IN-6FBCHDUY.js → bn-IN-CQJ5XUTI.js} +47 -7
- package/dist/dev/locales/bn-IN-CQJ5XUTI.js.map +7 -0
- package/dist/dev/locales/{ca-ES-UX7K2ENH.js → ca-ES-F62AQUFY.js} +47 -69
- package/dist/dev/locales/ca-ES-F62AQUFY.js.map +7 -0
- package/dist/dev/locales/{cs-CZ-TBYIRH36.js → cs-CZ-YHUNUU6P.js} +47 -69
- package/dist/dev/locales/cs-CZ-YHUNUU6P.js.map +7 -0
- package/dist/dev/locales/{da-DK-KW4TGU6O.js → da-DK-QU24E74Q.js} +47 -69
- package/dist/dev/locales/da-DK-QU24E74Q.js.map +7 -0
- package/dist/dev/locales/{de-CH-QSJHIHEN.js → de-CH-KLWBYLGC.js} +110 -132
- package/dist/dev/locales/de-CH-KLWBYLGC.js.map +7 -0
- package/dist/dev/locales/{de-DE-2WQ5IRPT.js → de-DE-UB755M7G.js} +110 -132
- package/dist/dev/locales/de-DE-UB755M7G.js.map +7 -0
- package/dist/dev/locales/{el-GR-N7JWYMV5.js → el-GR-J2BFDAEA.js} +47 -69
- package/dist/dev/locales/el-GR-J2BFDAEA.js.map +7 -0
- package/dist/dev/locales/{en-25BPHB4T.js → en-RETPDZ4S.js} +4 -2
- package/dist/dev/locales/{es-ES-37LJTLHM.js → es-ES-GL35U3D6.js} +97 -119
- package/dist/dev/locales/es-ES-GL35U3D6.js.map +7 -0
- package/dist/dev/locales/{eu-ES-2IFCUP7K.js → eu-ES-5LL7P4G7.js} +150 -172
- package/dist/dev/locales/eu-ES-5LL7P4G7.js.map +7 -0
- package/dist/dev/locales/{fa-IR-VDT7BNM4.js → fa-IR-2D6AXPSB.js} +52 -74
- package/dist/dev/locales/fa-IR-2D6AXPSB.js.map +7 -0
- package/dist/dev/locales/{fi-FI-HLYF5ISJ.js → fi-FI-WLH5PKEI.js} +47 -69
- package/dist/dev/locales/fi-FI-WLH5PKEI.js.map +7 -0
- package/dist/dev/locales/{fr-FR-5YNPDFPF.js → fr-FR-2OK3WPK2.js} +50 -72
- package/dist/dev/locales/fr-FR-2OK3WPK2.js.map +7 -0
- package/dist/dev/locales/{gl-ES-S56CRRSA.js → gl-ES-EZQPQSMM.js} +47 -69
- package/dist/dev/locales/gl-ES-EZQPQSMM.js.map +7 -0
- package/dist/dev/locales/{he-IL-7GR3BHPZ.js → he-IL-AZ66QXVH.js} +101 -123
- package/dist/dev/locales/he-IL-AZ66QXVH.js.map +7 -0
- package/dist/dev/locales/{hi-IN-AQ7X42V5.js → hi-IN-FLBMKLKL.js} +47 -69
- package/dist/dev/locales/hi-IN-FLBMKLKL.js.map +7 -0
- package/dist/dev/locales/{hu-HU-4HM3N3P3.js → hu-HU-VDOE4ASN.js} +47 -69
- package/dist/dev/locales/hu-HU-VDOE4ASN.js.map +7 -0
- package/dist/dev/locales/{id-ID-P7V2I35Q.js → id-ID-ONDPKYZS.js} +94 -116
- package/dist/dev/locales/id-ID-ONDPKYZS.js.map +7 -0
- package/dist/dev/locales/{it-IT-HUGIPGTB.js → it-IT-VBFSF2PC.js} +50 -72
- package/dist/dev/locales/it-IT-VBFSF2PC.js.map +7 -0
- package/dist/dev/locales/{ja-JP-XFX5V5ZL.js → ja-JP-HYYYQCGH.js} +141 -163
- package/dist/dev/locales/ja-JP-HYYYQCGH.js.map +7 -0
- package/dist/dev/locales/{kaa-X53Z7Q4I.js → kaa-TY3DGTWH.js} +47 -69
- package/dist/dev/locales/kaa-TY3DGTWH.js.map +7 -0
- package/dist/dev/locales/{kab-KAB-GGKAECT5.js → kab-KAB-IY5ZIQCV.js} +47 -69
- package/dist/dev/locales/kab-KAB-IY5ZIQCV.js.map +7 -0
- package/dist/dev/locales/{kk-KZ-Z6R3NY65.js → kk-KZ-XL46CODC.js} +47 -69
- package/dist/dev/locales/kk-KZ-XL46CODC.js.map +7 -0
- package/dist/dev/locales/{km-KH-DGK3UTBI.js → km-KH-SBKIWI6O.js} +47 -69
- package/dist/dev/locales/km-KH-SBKIWI6O.js.map +7 -0
- package/dist/dev/locales/{ko-KR-W7QZK3EC.js → ko-KR-G6PO3BPA.js} +109 -131
- package/dist/dev/locales/ko-KR-G6PO3BPA.js.map +7 -0
- package/dist/dev/locales/{ku-TR-3UJE7FNE.js → ku-TR-DCRJVW6B.js} +47 -69
- package/dist/dev/locales/ku-TR-DCRJVW6B.js.map +7 -0
- package/dist/dev/locales/{lt-LT-OTNQMXF6.js → lt-LT-HMDRWN2A.js} +47 -69
- package/dist/dev/locales/lt-LT-HMDRWN2A.js.map +7 -0
- package/dist/dev/locales/{lv-LV-Y44YX4AK.js → lv-LV-E7XBXM5Z.js} +47 -69
- package/dist/dev/locales/lv-LV-E7XBXM5Z.js.map +7 -0
- package/dist/dev/locales/{mr-IN-MT2HYNUI.js → mr-IN-7HMFEVFE.js} +48 -70
- package/dist/dev/locales/mr-IN-7HMFEVFE.js.map +7 -0
- package/dist/dev/locales/{my-MM-ZBRKQSW3.js → my-MM-L4VSI7TR.js} +47 -69
- package/dist/dev/locales/my-MM-L4VSI7TR.js.map +7 -0
- package/dist/dev/locales/{nb-NO-ZY7DB7O2.js → nb-NO-GBRDJCO7.js} +47 -69
- package/dist/dev/locales/nb-NO-GBRDJCO7.js.map +7 -0
- package/dist/dev/locales/{nl-NL-YLVMYG2H.js → nl-NL-Z3EVTIXJ.js} +52 -74
- package/dist/dev/locales/nl-NL-Z3EVTIXJ.js.map +7 -0
- package/dist/dev/locales/{nn-NO-4SXLBTTQ.js → nn-NO-WCTTYN3P.js} +47 -69
- package/dist/dev/locales/nn-NO-WCTTYN3P.js.map +7 -0
- package/dist/dev/locales/{oc-FR-NMOJCLB4.js → oc-FR-6IH2LZOZ.js} +47 -69
- package/dist/dev/locales/oc-FR-6IH2LZOZ.js.map +7 -0
- package/dist/dev/locales/{pa-IN-G5T3AUSW.js → pa-IN-3KCEDMBE.js} +47 -69
- package/dist/dev/locales/pa-IN-3KCEDMBE.js.map +7 -0
- package/dist/dev/locales/{percentages-ZRLRVMSI.js → percentages-DKKGPYTW.js} +2 -2
- package/dist/dev/locales/{pl-PL-TXUESISZ.js → pl-PL-OFE4QPOR.js} +47 -69
- package/dist/dev/locales/pl-PL-OFE4QPOR.js.map +7 -0
- package/dist/dev/locales/{pt-BR-KEMR6KPT.js → pt-BR-KFYVREQI.js} +94 -116
- package/dist/dev/locales/pt-BR-KFYVREQI.js.map +7 -0
- package/dist/dev/locales/{pt-PT-ZCG2G3PR.js → pt-PT-GZLT46KI.js} +92 -114
- package/dist/dev/locales/pt-PT-GZLT46KI.js.map +7 -0
- package/dist/dev/locales/{ro-RO-MDAUF4EM.js → ro-RO-DKVFNBHO.js} +50 -72
- package/dist/dev/locales/ro-RO-DKVFNBHO.js.map +7 -0
- package/dist/dev/locales/{ru-RU-ZIRVCAVQ.js → ru-RU-6JEBKTLT.js} +50 -72
- package/dist/dev/locales/ru-RU-6JEBKTLT.js.map +7 -0
- package/dist/dev/locales/{si-LK-FPEI3WT5.js → si-LK-6AKNCJA5.js} +47 -69
- package/dist/dev/locales/si-LK-6AKNCJA5.js.map +7 -0
- package/dist/dev/locales/{sk-SK-TZJ3W5LE.js → sk-SK-2ATL6K2E.js} +50 -72
- package/dist/dev/locales/sk-SK-2ATL6K2E.js.map +7 -0
- package/dist/dev/locales/{sl-SI-KIJ3UR57.js → sl-SI-YMMKUPW6.js} +47 -69
- package/dist/dev/locales/sl-SI-YMMKUPW6.js.map +7 -0
- package/dist/dev/locales/{sv-SE-WX2A2Y2N.js → sv-SE-WBMU72M2.js} +88 -110
- package/dist/dev/locales/sv-SE-WBMU72M2.js.map +7 -0
- package/dist/dev/locales/{ta-IN-ECFHL2WQ.js → ta-IN-OVDW7DBM.js} +47 -69
- package/dist/dev/locales/ta-IN-OVDW7DBM.js.map +7 -0
- package/dist/dev/locales/{th-TH-XIGNEM6A.js → th-TH-7L42SH4O.js} +73 -95
- package/dist/dev/locales/th-TH-7L42SH4O.js.map +7 -0
- package/dist/dev/locales/{tr-TR-RCLDMBSM.js → tr-TR-MPDZYTZ2.js} +83 -105
- package/dist/dev/locales/tr-TR-MPDZYTZ2.js.map +7 -0
- package/dist/dev/locales/{uk-UA-2ADII6GR.js → uk-UA-5SVBS74S.js} +66 -88
- package/dist/dev/locales/uk-UA-5SVBS74S.js.map +7 -0
- package/dist/dev/locales/{uz-UZ-COGLAKY3.js → uz-UZ-QYTGSZB2.js} +47 -69
- package/dist/dev/locales/uz-UZ-QYTGSZB2.js.map +7 -0
- package/dist/dev/locales/{vi-VN-QBW5T274.js → vi-VN-KMVP2XW5.js} +47 -69
- package/dist/dev/locales/vi-VN-KMVP2XW5.js.map +7 -0
- package/dist/dev/locales/{zh-CN-WONZCIPT.js → zh-CN-KR2L555J.js} +51 -73
- package/dist/dev/locales/zh-CN-KR2L555J.js.map +7 -0
- package/dist/dev/locales/{zh-HK-AJ2UN7VN.js → zh-HK-VFOCIZQM.js} +47 -69
- package/dist/dev/locales/zh-HK-VFOCIZQM.js.map +7 -0
- package/dist/dev/locales/{zh-TW-O73UCU5T.js → zh-TW-OIQ4BXFH.js} +91 -113
- package/dist/dev/locales/zh-TW-OIQ4BXFH.js.map +7 -0
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-5XKZK2GL.js +1 -0
- package/dist/prod/chunk-66O5T5YX.js +4 -0
- package/dist/prod/chunk-DARW3V66.js +12 -0
- package/dist/prod/{chunk-ZYOK2JIN.js → chunk-SZWH77NQ.js} +1 -1
- package/dist/prod/data/image-AAJBLI3M.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +20 -111
- package/dist/prod/locales/ar-SA-E6E2KRZ5.js +10 -0
- package/dist/prod/locales/az-AZ-RDMGQYMZ.js +1 -0
- package/dist/prod/locales/bg-BG-CHUVCTEA.js +5 -0
- package/dist/prod/locales/bn-BD-ZMOEPIQW.js +3 -0
- package/dist/prod/locales/bn-IN-OHZAWF5C.js +3 -0
- package/dist/prod/locales/ca-ES-K4A7PUP4.js +8 -0
- package/dist/prod/locales/cs-CZ-RVP6YORC.js +7 -0
- package/dist/prod/locales/da-DK-ENJX4GIQ.js +2 -0
- package/dist/prod/locales/de-CH-VYBKDWRU.js +11 -0
- package/dist/prod/locales/de-DE-6MCXRRVA.js +11 -0
- package/dist/prod/locales/el-GR-WEDZAIPA.js +7 -0
- package/dist/prod/locales/en-RNZ7CUK6.js +1 -0
- package/dist/prod/locales/es-ES-LLEALNRO.js +11 -0
- package/dist/prod/locales/eu-ES-M4Y34NOW.js +8 -0
- package/dist/prod/locales/fa-IR-XSMVGGRV.js +9 -0
- package/dist/prod/locales/fi-FI-K2D3DDUS.js +6 -0
- package/dist/prod/locales/fr-FR-EQKMVJSO.js +12 -0
- package/dist/prod/locales/gl-ES-RCPQTYJV.js +6 -0
- package/dist/prod/locales/he-IL-RHAGKYKH.js +9 -0
- package/dist/prod/locales/hi-IN-3UDCLKHN.js +3 -0
- package/dist/prod/locales/hu-HU-T3REA7IL.js +3 -0
- package/dist/prod/locales/id-ID-KW4N25IN.js +8 -0
- package/dist/prod/locales/it-IT-LJVXK4LO.js +12 -0
- package/dist/prod/locales/ja-JP-GGGK3KPX.js +12 -0
- package/dist/prod/locales/kaa-TSEHAWJR.js +1 -0
- package/dist/prod/locales/kab-KAB-IWXTEINV.js +4 -0
- package/dist/prod/locales/kk-KZ-6GNYSAU7.js +1 -0
- package/dist/prod/locales/km-KH-ILUXSOEW.js +7 -0
- package/dist/prod/locales/ko-KR-FJWHM3OT.js +5 -0
- package/dist/prod/locales/ku-TR-DRDDAECA.js +6 -0
- package/dist/prod/locales/lt-LT-IYFIPPJI.js +3 -0
- package/dist/prod/locales/lv-LV-7F754RSS.js +4 -0
- package/dist/prod/locales/mr-IN-BYRIZ3PC.js +9 -0
- package/dist/prod/locales/my-MM-RBYJSIJ6.js +1 -0
- package/dist/prod/locales/nb-NO-EKTZIYSK.js +8 -0
- package/dist/prod/locales/nl-NL-UECYYIUK.js +13 -0
- package/dist/prod/locales/nn-NO-JPXGIDBA.js +4 -0
- package/dist/prod/locales/oc-FR-4RSIVDPZ.js +4 -0
- package/dist/prod/locales/pa-IN-GPHFXISR.js +4 -0
- package/dist/prod/locales/percentages-Q7USCRWZ.js +1 -0
- package/dist/prod/locales/pl-PL-HKHPAEVK.js +12 -0
- package/dist/prod/locales/pt-BR-UBWN6CKP.js +10 -0
- package/dist/prod/locales/pt-PT-XDY4S4SD.js +12 -0
- package/dist/prod/locales/ro-RO-2B3UXAQO.js +12 -0
- package/dist/prod/locales/ru-RU-EW52HAV3.js +10 -0
- package/dist/prod/locales/si-LK-PIEHI4JX.js +1 -0
- package/dist/prod/locales/sk-SK-TZXYYIFD.js +7 -0
- package/dist/prod/locales/sl-SI-VUDQNDF3.js +6 -0
- package/dist/prod/locales/sv-SE-IJTJRA7S.js +12 -0
- package/dist/prod/locales/ta-IN-Q5PXZT3U.js +6 -0
- package/dist/prod/locales/th-TH-HK66ZQXE.js +1 -0
- package/dist/prod/locales/tr-TR-CLYYPVPL.js +4 -0
- package/dist/prod/locales/uk-UA-YR4OMRYF.js +6 -0
- package/dist/prod/locales/uz-UZ-CY4LSY5Y.js +1 -0
- package/dist/prod/locales/vi-VN-UDAEMEBG.js +7 -0
- package/dist/prod/locales/zh-CN-EGBL23FT.js +11 -0
- package/dist/prod/locales/zh-HK-ZOJEG32A.js +1 -0
- package/dist/prod/locales/zh-TW-TM5HZP7M.js +13 -0
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/colors.d.ts +14 -0
- package/dist/types/common/src/constants.d.ts +3 -0
- package/dist/types/common/src/keys.d.ts +2 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/utils.d.ts +1 -1
- package/dist/types/element/src/Scene.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrows/focus.d.ts +5 -2
- package/dist/types/element/src/binding.d.ts +17 -8
- package/dist/types/element/src/bounds.d.ts +5 -9
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/element/src/comparisons.d.ts +4 -4
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/distribute.d.ts +2 -2
- package/dist/types/element/src/dragElements.d.ts +27 -0
- package/dist/types/element/src/duplicate.d.ts +3 -3
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +7 -7
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +4 -4
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/index.d.ts +4 -1
- package/dist/types/element/src/linearElementEditor.d.ts +17 -10
- package/dist/types/element/src/newElement.d.ts +13 -0
- package/dist/types/element/src/renderElement.d.ts +0 -3
- package/dist/types/element/src/resizeElements.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +5 -5
- package/dist/types/element/src/shape.d.ts +12 -0
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/textElement.d.ts +12 -9
- package/dist/types/element/src/transform.d.ts +2 -2
- package/dist/types/element/src/typeChecks.d.ts +25 -25
- package/dist/types/element/src/types.d.ts +2 -1
- package/dist/types/element/src/zindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +24 -8
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +128 -961
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -8
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +38 -13
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +9 -4
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +25 -9
- package/dist/types/excalidraw/actions/actionExport.d.ts +26 -10
- package/dist/types/excalidraw/actions/actionFrame.d.ts +47 -205
- package/dist/types/excalidraw/actions/actionGroup.d.ts +39 -23
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -6
- package/dist/types/excalidraw/actions/actionLink.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionMenu.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionProperties.d.ts +43 -24
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +17 -9
- package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -9
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -9
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -5
- package/dist/types/excalidraw/actions/index.d.ts +1 -2
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +8 -4
- package/dist/types/excalidraw/appState.d.ts +10 -5
- package/dist/types/excalidraw/components/Actions.d.ts +17 -12
- package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +30 -0
- package/dist/types/excalidraw/components/App.d.ts +384 -60
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
- package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +1 -3
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +146 -0
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +4 -1
- package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/context/tunnels.d.ts +0 -1
- package/dist/types/excalidraw/data/blob.d.ts +14 -6
- package/dist/types/excalidraw/data/index.d.ts +4 -4
- package/dist/types/excalidraw/data/json.d.ts +20 -12
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/index.d.ts +3 -3
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +10 -3
- package/dist/types/excalidraw/scene/Renderer.d.ts +11 -11
- package/dist/types/excalidraw/scene/export.d.ts +3 -3
- package/dist/types/excalidraw/scene/index.d.ts +1 -1
- package/dist/types/excalidraw/scene/types.d.ts +4 -3
- package/dist/types/excalidraw/snapping.d.ts +7 -7
- package/dist/types/excalidraw/types.d.ts +423 -27
- package/dist/types/excalidraw/viewport.d.ts +283 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
- package/dist/types/laser-pointer/src/state.d.ts +1 -0
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/polygon.d.ts +25 -1
- package/dist/types/utils/src/export.d.ts +3 -3
- package/package.json +4 -4
- package/dist/dev/chunk-IU2VFRFU.js.map +0 -7
- package/dist/dev/chunk-MN6E45MP.js.map +0 -7
- package/dist/dev/chunk-URPEKBQ3.js +0 -69
- package/dist/dev/chunk-URPEKBQ3.js.map +0 -7
- package/dist/dev/locales/ar-SA-NFU76NHO.js.map +0 -7
- package/dist/dev/locales/az-AZ-F7U432OF.js.map +0 -7
- package/dist/dev/locales/bg-BG-VMJGHZ3R.js.map +0 -7
- package/dist/dev/locales/bn-BD-ABWH5RGF.js.map +0 -7
- package/dist/dev/locales/bn-IN-6FBCHDUY.js.map +0 -7
- package/dist/dev/locales/ca-ES-UX7K2ENH.js.map +0 -7
- package/dist/dev/locales/cs-CZ-TBYIRH36.js.map +0 -7
- package/dist/dev/locales/da-DK-KW4TGU6O.js.map +0 -7
- package/dist/dev/locales/de-CH-QSJHIHEN.js.map +0 -7
- package/dist/dev/locales/de-DE-2WQ5IRPT.js.map +0 -7
- package/dist/dev/locales/el-GR-N7JWYMV5.js.map +0 -7
- package/dist/dev/locales/es-ES-37LJTLHM.js.map +0 -7
- package/dist/dev/locales/eu-ES-2IFCUP7K.js.map +0 -7
- package/dist/dev/locales/fa-IR-VDT7BNM4.js.map +0 -7
- package/dist/dev/locales/fi-FI-HLYF5ISJ.js.map +0 -7
- package/dist/dev/locales/fr-FR-5YNPDFPF.js.map +0 -7
- package/dist/dev/locales/gl-ES-S56CRRSA.js.map +0 -7
- package/dist/dev/locales/he-IL-7GR3BHPZ.js.map +0 -7
- package/dist/dev/locales/hi-IN-AQ7X42V5.js.map +0 -7
- package/dist/dev/locales/hu-HU-4HM3N3P3.js.map +0 -7
- package/dist/dev/locales/id-ID-P7V2I35Q.js.map +0 -7
- package/dist/dev/locales/it-IT-HUGIPGTB.js.map +0 -7
- package/dist/dev/locales/ja-JP-XFX5V5ZL.js.map +0 -7
- package/dist/dev/locales/kaa-X53Z7Q4I.js.map +0 -7
- package/dist/dev/locales/kab-KAB-GGKAECT5.js.map +0 -7
- package/dist/dev/locales/kk-KZ-Z6R3NY65.js.map +0 -7
- package/dist/dev/locales/km-KH-DGK3UTBI.js.map +0 -7
- package/dist/dev/locales/ko-KR-W7QZK3EC.js.map +0 -7
- package/dist/dev/locales/ku-TR-3UJE7FNE.js.map +0 -7
- package/dist/dev/locales/lt-LT-OTNQMXF6.js.map +0 -7
- package/dist/dev/locales/lv-LV-Y44YX4AK.js.map +0 -7
- package/dist/dev/locales/mr-IN-MT2HYNUI.js.map +0 -7
- package/dist/dev/locales/my-MM-ZBRKQSW3.js.map +0 -7
- package/dist/dev/locales/nb-NO-ZY7DB7O2.js.map +0 -7
- package/dist/dev/locales/nl-NL-YLVMYG2H.js.map +0 -7
- package/dist/dev/locales/nn-NO-4SXLBTTQ.js.map +0 -7
- package/dist/dev/locales/oc-FR-NMOJCLB4.js.map +0 -7
- package/dist/dev/locales/pa-IN-G5T3AUSW.js.map +0 -7
- package/dist/dev/locales/pl-PL-TXUESISZ.js.map +0 -7
- package/dist/dev/locales/pt-BR-KEMR6KPT.js.map +0 -7
- package/dist/dev/locales/pt-PT-ZCG2G3PR.js.map +0 -7
- package/dist/dev/locales/ro-RO-MDAUF4EM.js.map +0 -7
- package/dist/dev/locales/ru-RU-ZIRVCAVQ.js.map +0 -7
- package/dist/dev/locales/si-LK-FPEI3WT5.js.map +0 -7
- package/dist/dev/locales/sk-SK-TZJ3W5LE.js.map +0 -7
- package/dist/dev/locales/sl-SI-KIJ3UR57.js.map +0 -7
- package/dist/dev/locales/sv-SE-WX2A2Y2N.js.map +0 -7
- package/dist/dev/locales/ta-IN-ECFHL2WQ.js.map +0 -7
- package/dist/dev/locales/th-TH-XIGNEM6A.js.map +0 -7
- package/dist/dev/locales/tr-TR-RCLDMBSM.js.map +0 -7
- package/dist/dev/locales/uk-UA-2ADII6GR.js.map +0 -7
- package/dist/dev/locales/uz-UZ-COGLAKY3.js.map +0 -7
- package/dist/dev/locales/vi-VN-QBW5T274.js.map +0 -7
- package/dist/dev/locales/zh-CN-WONZCIPT.js.map +0 -7
- package/dist/dev/locales/zh-HK-AJ2UN7VN.js.map +0 -7
- package/dist/dev/locales/zh-TW-O73UCU5T.js.map +0 -7
- package/dist/prod/chunk-3PELD44J.js +0 -1
- package/dist/prod/chunk-3UXKIWVY.js +0 -12
- package/dist/prod/chunk-BNYGVLQX.js +0 -4
- package/dist/prod/data/image-OFIWDJ6Z.js +0 -1
- package/dist/prod/locales/ar-SA-3G7FTBZJ.js +0 -8
- package/dist/prod/locales/az-AZ-HMFZUPFL.js +0 -1
- package/dist/prod/locales/bg-BG-Y7OZ2DXF.js +0 -5
- package/dist/prod/locales/bn-BD-36TGMEAF.js +0 -3
- package/dist/prod/locales/bn-IN-FALW4RB5.js +0 -3
- package/dist/prod/locales/ca-ES-MJRJ6GTN.js +0 -8
- package/dist/prod/locales/cs-CZ-52YM52ZO.js +0 -7
- package/dist/prod/locales/da-DK-QEP42HP6.js +0 -2
- package/dist/prod/locales/de-CH-LGHSGO4X.js +0 -7
- package/dist/prod/locales/de-DE-GHNPPGTN.js +0 -7
- package/dist/prod/locales/el-GR-2UZLGABX.js +0 -7
- package/dist/prod/locales/en-AH5BYWXT.js +0 -1
- package/dist/prod/locales/es-ES-2NUH2FTW.js +0 -7
- package/dist/prod/locales/eu-ES-LW4CGHUU.js +0 -7
- package/dist/prod/locales/fa-IR-U32PFECK.js +0 -9
- package/dist/prod/locales/fi-FI-G7756HAK.js +0 -6
- package/dist/prod/locales/fr-FR-VIEH4DTC.js +0 -12
- package/dist/prod/locales/gl-ES-JWQDRMPC.js +0 -6
- package/dist/prod/locales/he-IL-YYBNMYP4.js +0 -8
- package/dist/prod/locales/hi-IN-4J4RW5AN.js +0 -3
- package/dist/prod/locales/hu-HU-MBXXMHSF.js +0 -3
- package/dist/prod/locales/id-ID-5U764SVL.js +0 -8
- package/dist/prod/locales/it-IT-7BNDK63V.js +0 -12
- package/dist/prod/locales/ja-JP-4SLEHWLA.js +0 -7
- package/dist/prod/locales/kaa-YHCGFUY5.js +0 -1
- package/dist/prod/locales/kab-KAB-LSGAIMUB.js +0 -4
- package/dist/prod/locales/kk-KZ-3YNSB7GZ.js +0 -1
- package/dist/prod/locales/km-KH-7GXC5R4I.js +0 -7
- package/dist/prod/locales/ko-KR-B6Q6YTFE.js +0 -5
- package/dist/prod/locales/ku-TR-FBC7A657.js +0 -6
- package/dist/prod/locales/lt-LT-NTZ3RRBU.js +0 -3
- package/dist/prod/locales/lv-LV-G24LH3KG.js +0 -4
- package/dist/prod/locales/mr-IN-FMZEIYNW.js +0 -9
- package/dist/prod/locales/my-MM-B6EJQIQF.js +0 -1
- package/dist/prod/locales/nb-NO-GEP6ZOEM.js +0 -8
- package/dist/prod/locales/nl-NL-4QUIWSVP.js +0 -13
- package/dist/prod/locales/nn-NO-P32L2VHA.js +0 -4
- package/dist/prod/locales/oc-FR-QRACY6JR.js +0 -4
- package/dist/prod/locales/pa-IN-GBDTCDVG.js +0 -4
- package/dist/prod/locales/percentages-5DKR754L.js +0 -1
- package/dist/prod/locales/pl-PL-2Y6CXCHK.js +0 -12
- package/dist/prod/locales/pt-BR-FKWT7UFL.js +0 -6
- package/dist/prod/locales/pt-PT-6EMD7SCZ.js +0 -8
- package/dist/prod/locales/ro-RO-XERO3Y25.js +0 -12
- package/dist/prod/locales/ru-RU-XKTTT4QL.js +0 -10
- package/dist/prod/locales/si-LK-MGLC5APF.js +0 -1
- package/dist/prod/locales/sk-SK-BMCDJLZC.js +0 -7
- package/dist/prod/locales/sl-SI-LAWKY4LU.js +0 -6
- package/dist/prod/locales/sv-SE-X2ORO3SG.js +0 -8
- package/dist/prod/locales/ta-IN-RZDP4ZDC.js +0 -6
- package/dist/prod/locales/th-TH-GY4Y5ENV.js +0 -1
- package/dist/prod/locales/tr-TR-CT4QTEX3.js +0 -4
- package/dist/prod/locales/uk-UA-XEPSQF3S.js +0 -6
- package/dist/prod/locales/uz-UZ-WM3HHDOU.js +0 -1
- package/dist/prod/locales/vi-VN-RFG3SAMP.js +0 -7
- package/dist/prod/locales/zh-CN-2WGTQQH5.js +0 -11
- package/dist/prod/locales/zh-HK-J64WV2A2.js +0 -1
- package/dist/prod/locales/zh-TW-4JITCNYX.js +0 -9
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -180
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -12
- package/dist/types/excalidraw/components/shapes.d.ts +0 -270
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
- package/dist/types/excalidraw/scroll.d.ts +0 -46
- /package/dist/dev/{chunk-P7I4FGOG.js.map → chunk-6T5HZJCI.js.map} +0 -0
- /package/dist/dev/data/{image-ZYGVHYLC.js.map → image-NFLICJEW.js.map} +0 -0
- /package/dist/dev/locales/{en-25BPHB4T.js.map → en-RETPDZ4S.js.map} +0 -0
- /package/dist/dev/locales/{percentages-ZRLRVMSI.js.map → percentages-DKKGPYTW.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
define_import_meta_env_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6T5HZJCI.js";
|
|
4
4
|
import {
|
|
5
5
|
__publicField
|
|
6
6
|
} from "./chunk-XDFCUUT6.js";
|
|
@@ -116,6 +116,7 @@ var getDefaultAppState = () => {
|
|
|
116
116
|
scrolledOutside: false,
|
|
117
117
|
scrollX: 0,
|
|
118
118
|
scrollY: 0,
|
|
119
|
+
scrollConstraints: null,
|
|
119
120
|
selectedElementIds: {},
|
|
120
121
|
hoveredElementIds: {},
|
|
121
122
|
selectedGroupIds: {},
|
|
@@ -127,6 +128,7 @@ var getDefaultAppState = () => {
|
|
|
127
128
|
panels: STATS_PANELS.generalStats | STATS_PANELS.elementProperties
|
|
128
129
|
},
|
|
129
130
|
suggestedBinding: null,
|
|
131
|
+
hoveredArrowTextAnchor: null,
|
|
130
132
|
frameRendering: { enabled: true, clip: true, name: true, outline: true },
|
|
131
133
|
frameToHighlight: null,
|
|
132
134
|
editingFrame: null,
|
|
@@ -147,15 +149,18 @@ var getDefaultAppState = () => {
|
|
|
147
149
|
y: 0
|
|
148
150
|
},
|
|
149
151
|
objectsSnapModeEnabled: false,
|
|
150
|
-
userToFollow: null,
|
|
151
|
-
followedBy: /* @__PURE__ */ new Set(),
|
|
152
152
|
isCropping: false,
|
|
153
153
|
croppingElementId: null,
|
|
154
154
|
searchMatches: null,
|
|
155
155
|
lockedMultiSelections: {},
|
|
156
156
|
activeLockedId: null,
|
|
157
157
|
bindMode: "orbit",
|
|
158
|
-
boxSelectionMode: "contain"
|
|
158
|
+
boxSelectionMode: "contain",
|
|
159
|
+
colorTopPicks: {
|
|
160
|
+
elementStroke: null,
|
|
161
|
+
elementBackground: null,
|
|
162
|
+
bucketFill: null
|
|
163
|
+
}
|
|
159
164
|
};
|
|
160
165
|
};
|
|
161
166
|
var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
@@ -242,6 +247,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
242
247
|
scrolledOutside: { browser: true, export: false, server: false },
|
|
243
248
|
scrollX: { browser: true, export: false, server: false },
|
|
244
249
|
scrollY: { browser: true, export: false, server: false },
|
|
250
|
+
scrollConstraints: { browser: false, export: false, server: false },
|
|
245
251
|
selectedElementIds: { browser: true, export: false, server: false },
|
|
246
252
|
hoveredElementIds: { browser: false, export: false, server: false },
|
|
247
253
|
selectedGroupIds: { browser: true, export: false, server: false },
|
|
@@ -254,6 +260,7 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
254
260
|
shouldCacheIgnoreZoom: { browser: true, export: false, server: false },
|
|
255
261
|
stats: { browser: true, export: false, server: false },
|
|
256
262
|
suggestedBinding: { browser: false, export: false, server: false },
|
|
263
|
+
hoveredArrowTextAnchor: { browser: false, export: false, server: false },
|
|
257
264
|
frameRendering: { browser: false, export: false, server: false },
|
|
258
265
|
frameToHighlight: { browser: false, export: false, server: false },
|
|
259
266
|
editingFrame: { browser: false, export: false, server: false },
|
|
@@ -270,14 +277,13 @@ var APP_STATE_STORAGE_CONF = /* @__PURE__ */ ((config) => config)({
|
|
|
270
277
|
snapLines: { browser: false, export: false, server: false },
|
|
271
278
|
originSnapOffset: { browser: false, export: false, server: false },
|
|
272
279
|
objectsSnapModeEnabled: { browser: true, export: false, server: false },
|
|
273
|
-
userToFollow: { browser: false, export: false, server: false },
|
|
274
|
-
followedBy: { browser: false, export: false, server: false },
|
|
275
280
|
isCropping: { browser: false, export: false, server: false },
|
|
276
281
|
croppingElementId: { browser: false, export: false, server: false },
|
|
277
282
|
searchMatches: { browser: false, export: false, server: false },
|
|
278
283
|
lockedMultiSelections: { browser: true, export: true, server: true },
|
|
279
284
|
activeLockedId: { browser: false, export: false, server: false },
|
|
280
|
-
bindMode: { browser: true, export: false, server: false }
|
|
285
|
+
bindMode: { browser: true, export: false, server: false },
|
|
286
|
+
colorTopPicks: { browser: true, export: false, server: false }
|
|
281
287
|
});
|
|
282
288
|
var _clearAppStateForStorage = (appState, exportType) => {
|
|
283
289
|
const stateForExport = {};
|
|
@@ -357,25 +363,202 @@ import {
|
|
|
357
363
|
getTargetElements
|
|
358
364
|
} from "@excalidraw/element";
|
|
359
365
|
|
|
360
|
-
//
|
|
361
|
-
import { getVisibleElements } from "@excalidraw/element";
|
|
366
|
+
// viewport.ts
|
|
362
367
|
import {
|
|
363
|
-
|
|
364
|
-
|
|
368
|
+
arrayToMap,
|
|
369
|
+
MAX_ZOOM,
|
|
370
|
+
MIN_ZOOM,
|
|
371
|
+
viewportCoordsToSceneCoords,
|
|
372
|
+
ZOOM_STEP
|
|
365
373
|
} from "@excalidraw/common";
|
|
366
|
-
import {
|
|
367
|
-
import {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
374
|
+
import { clamp, pointDistance, pointFrom, roundToStep } from "@excalidraw/math";
|
|
375
|
+
import {
|
|
376
|
+
CaptureUpdateAction,
|
|
377
|
+
getCommonBounds,
|
|
378
|
+
getElementBounds,
|
|
379
|
+
getVisibleElements
|
|
380
|
+
} from "@excalidraw/element";
|
|
381
|
+
var DEFAULT_OVERSCROLL = 150;
|
|
382
|
+
var constrainScrollAxis = (scroll, boxStart, boxSize, visibleSize, offsetStart, offsetEnd, overscroll) => {
|
|
383
|
+
const max = -boxStart + offsetStart;
|
|
384
|
+
const min = visibleSize - (boxStart + boxSize) - offsetEnd;
|
|
385
|
+
if (min > max) {
|
|
386
|
+
const center = (min + max) / 2;
|
|
387
|
+
return clamp(scroll, center - overscroll, center + overscroll);
|
|
388
|
+
}
|
|
389
|
+
return clamp(scroll, min - overscroll, max + overscroll);
|
|
390
|
+
};
|
|
391
|
+
var constrainScrollState = (state, overscroll = 0) => {
|
|
392
|
+
const { scrollConstraints, width, height } = state;
|
|
393
|
+
if (!scrollConstraints) {
|
|
394
|
+
return { scrollX: state.scrollX, scrollY: state.scrollY, zoom: state.zoom };
|
|
395
|
+
}
|
|
396
|
+
const minZoom = scrollConstraints.lockZoom ? scrollConstraints.zoom : MIN_ZOOM;
|
|
397
|
+
const zoomValue = getNormalizedZoom(
|
|
398
|
+
clamp(state.zoom.value, minZoom, MAX_ZOOM)
|
|
373
399
|
);
|
|
374
|
-
|
|
375
|
-
{
|
|
376
|
-
|
|
400
|
+
if (!scrollConstraints.lockScroll) {
|
|
401
|
+
return {
|
|
402
|
+
scrollX: state.scrollX,
|
|
403
|
+
scrollY: state.scrollY,
|
|
404
|
+
zoom: { value: zoomValue }
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
const give = Math.max(overscroll, 0) / zoomValue;
|
|
408
|
+
const offsets = scrollConstraints.offsets;
|
|
409
|
+
const offsetTop = (offsets?.top ?? 0) / zoomValue;
|
|
410
|
+
const offsetRight = (offsets?.right ?? 0) / zoomValue;
|
|
411
|
+
const offsetBottom = (offsets?.bottom ?? 0) / zoomValue;
|
|
412
|
+
const offsetLeft = (offsets?.left ?? 0) / zoomValue;
|
|
413
|
+
return {
|
|
414
|
+
scrollX: constrainScrollAxis(
|
|
415
|
+
state.scrollX,
|
|
416
|
+
scrollConstraints.x,
|
|
417
|
+
scrollConstraints.width,
|
|
418
|
+
width / zoomValue,
|
|
419
|
+
offsetLeft,
|
|
420
|
+
offsetRight,
|
|
421
|
+
give
|
|
422
|
+
),
|
|
423
|
+
scrollY: constrainScrollAxis(
|
|
424
|
+
state.scrollY,
|
|
425
|
+
scrollConstraints.y,
|
|
426
|
+
scrollConstraints.height,
|
|
427
|
+
height / zoomValue,
|
|
428
|
+
offsetTop,
|
|
429
|
+
offsetBottom,
|
|
430
|
+
give
|
|
431
|
+
),
|
|
432
|
+
zoom: { value: zoomValue }
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
var getViewportForZoom = ({ viewportX, viewportY, nextZoom }, appState) => {
|
|
436
|
+
const appLayerX = viewportX - appState.offsetLeft;
|
|
437
|
+
const appLayerY = viewportY - appState.offsetTop;
|
|
438
|
+
const currentZoom = appState.zoom.value;
|
|
439
|
+
const baseScrollX = appState.scrollX + (appLayerX - appLayerX / currentZoom);
|
|
440
|
+
const baseScrollY = appState.scrollY + (appLayerY - appLayerY / currentZoom);
|
|
441
|
+
const zoomOffsetScrollX = -(appLayerX - appLayerX / nextZoom);
|
|
442
|
+
const zoomOffsetScrollY = -(appLayerY - appLayerY / nextZoom);
|
|
443
|
+
return {
|
|
444
|
+
scrollX: baseScrollX + zoomOffsetScrollX,
|
|
445
|
+
scrollY: baseScrollY + zoomOffsetScrollY,
|
|
446
|
+
zoom: {
|
|
447
|
+
value: nextZoom
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
var getViewportForZoomWithScrollConstraints = (opts, state) => {
|
|
452
|
+
const restingViewport = constrainScrollState(state);
|
|
453
|
+
const overscrollX = (state.scrollX - restingViewport.scrollX) * state.zoom.value;
|
|
454
|
+
const overscrollY = (state.scrollY - restingViewport.scrollY) * state.zoom.value;
|
|
455
|
+
const zoomedViewport = constrainScrollState({
|
|
456
|
+
...state,
|
|
457
|
+
...getViewportForZoom(opts, state)
|
|
458
|
+
});
|
|
459
|
+
if (!state.scrollConstraints?.lockScroll || !overscrollX && !overscrollY) {
|
|
460
|
+
return zoomedViewport;
|
|
461
|
+
}
|
|
462
|
+
const zoom = zoomedViewport.zoom.value;
|
|
463
|
+
return constrainScrollState(
|
|
464
|
+
{
|
|
465
|
+
...state,
|
|
466
|
+
...zoomedViewport,
|
|
467
|
+
scrollX: zoomedViewport.scrollX + overscrollX / zoom,
|
|
468
|
+
scrollY: zoomedViewport.scrollY + overscrollY / zoom
|
|
469
|
+
},
|
|
470
|
+
state.scrollConstraints.overscroll
|
|
377
471
|
);
|
|
378
|
-
|
|
472
|
+
};
|
|
473
|
+
var zoomValueToFitBoundsOnViewport = (bounds, viewportDimensions) => {
|
|
474
|
+
const [x1, y1, x2, y2] = bounds;
|
|
475
|
+
const commonBoundsWidth = x2 - x1;
|
|
476
|
+
const zoomValueForWidth = viewportDimensions.width / commonBoundsWidth;
|
|
477
|
+
const commonBoundsHeight = y2 - y1;
|
|
478
|
+
const zoomValueForHeight = viewportDimensions.height / commonBoundsHeight;
|
|
479
|
+
const smallestZoomValue = Math.min(zoomValueForWidth, zoomValueForHeight);
|
|
480
|
+
return Math.min(smallestZoomValue, 1);
|
|
481
|
+
};
|
|
482
|
+
var zoomToFitBounds = ({
|
|
483
|
+
bounds,
|
|
484
|
+
appState,
|
|
485
|
+
canvasOffsets,
|
|
486
|
+
fit = "scale-down",
|
|
487
|
+
minZoom = -Infinity,
|
|
488
|
+
maxZoom = Infinity,
|
|
489
|
+
steppedZoom = false
|
|
490
|
+
}) => {
|
|
491
|
+
const [x1, y1, x2, y2] = bounds;
|
|
492
|
+
const centerX = (x1 + x2) / 2;
|
|
493
|
+
const centerY = (y1 + y2) / 2;
|
|
494
|
+
const canvasOffsetLeft = canvasOffsets?.left ?? 0;
|
|
495
|
+
const canvasOffsetTop = canvasOffsets?.top ?? 0;
|
|
496
|
+
const canvasOffsetRight = canvasOffsets?.right ?? 0;
|
|
497
|
+
const canvasOffsetBottom = canvasOffsets?.bottom ?? 0;
|
|
498
|
+
const effectiveCanvasWidth = appState.width - canvasOffsetLeft - canvasOffsetRight;
|
|
499
|
+
const effectiveCanvasHeight = appState.height - canvasOffsetTop - canvasOffsetBottom;
|
|
500
|
+
let adjustedZoomValue;
|
|
501
|
+
if (fit === "none") {
|
|
502
|
+
adjustedZoomValue = appState.zoom.value;
|
|
503
|
+
} else if (fit === "contain") {
|
|
504
|
+
const commonBoundsWidth = x2 - x1;
|
|
505
|
+
const commonBoundsHeight = y2 - y1;
|
|
506
|
+
adjustedZoomValue = Math.min(
|
|
507
|
+
effectiveCanvasWidth / commonBoundsWidth,
|
|
508
|
+
effectiveCanvasHeight / commonBoundsHeight
|
|
509
|
+
);
|
|
510
|
+
} else {
|
|
511
|
+
adjustedZoomValue = zoomValueToFitBoundsOnViewport(bounds, {
|
|
512
|
+
width: effectiveCanvasWidth,
|
|
513
|
+
height: effectiveCanvasHeight
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
const targetZoomValue = steppedZoom && fit !== "none" ? roundToStep(adjustedZoomValue, ZOOM_STEP, "floor") : adjustedZoomValue;
|
|
517
|
+
const newZoomValue = getNormalizedZoom(
|
|
518
|
+
clamp(targetZoomValue, minZoom, maxZoom)
|
|
519
|
+
);
|
|
520
|
+
const centerScroll = centerScrollOn({
|
|
521
|
+
scenePoint: { x: centerX, y: centerY },
|
|
522
|
+
viewportDimensions: {
|
|
523
|
+
width: appState.width,
|
|
524
|
+
height: appState.height
|
|
525
|
+
},
|
|
526
|
+
offsets: canvasOffsets,
|
|
527
|
+
zoom: { value: newZoomValue }
|
|
528
|
+
});
|
|
529
|
+
return {
|
|
530
|
+
appState: {
|
|
531
|
+
...appState,
|
|
532
|
+
scrollX: centerScroll.scrollX,
|
|
533
|
+
scrollY: centerScroll.scrollY,
|
|
534
|
+
zoom: { value: newZoomValue }
|
|
535
|
+
},
|
|
536
|
+
captureUpdate: CaptureUpdateAction.EVENTUALLY
|
|
537
|
+
};
|
|
538
|
+
};
|
|
539
|
+
var doBoundsExceedViewport = (appState, bounds) => {
|
|
540
|
+
const [x1, y1, x2, y2] = bounds;
|
|
541
|
+
return (x2 - x1) * appState.zoom.value > appState.width || (y2 - y1) * appState.zoom.value > appState.height;
|
|
542
|
+
};
|
|
543
|
+
var getClosestElementBounds = (elements, from) => {
|
|
544
|
+
if (!elements.length) {
|
|
545
|
+
return [0, 0, 0, 0];
|
|
546
|
+
}
|
|
547
|
+
let minDistance = Infinity;
|
|
548
|
+
let closestElement = elements[0];
|
|
549
|
+
const elementsMap = arrayToMap(elements);
|
|
550
|
+
elements.forEach((element) => {
|
|
551
|
+
const [x1, y1, x2, y2] = getElementBounds(element, elementsMap);
|
|
552
|
+
const distance2 = pointDistance(
|
|
553
|
+
pointFrom((x1 + x2) / 2, (y1 + y2) / 2),
|
|
554
|
+
pointFrom(from.x, from.y)
|
|
555
|
+
);
|
|
556
|
+
if (distance2 < minDistance) {
|
|
557
|
+
minDistance = distance2;
|
|
558
|
+
closestElement = element;
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
return getElementBounds(closestElement, elementsMap);
|
|
379
562
|
};
|
|
380
563
|
var centerScrollOn = ({
|
|
381
564
|
scenePoint,
|
|
@@ -392,7 +575,7 @@ var centerScrollOn = ({
|
|
|
392
575
|
scrollY
|
|
393
576
|
};
|
|
394
577
|
};
|
|
395
|
-
var
|
|
578
|
+
var getScrollToContentState = (elements, appState) => {
|
|
396
579
|
elements = getVisibleElements(elements);
|
|
397
580
|
if (!elements.length) {
|
|
398
581
|
return {
|
|
@@ -401,11 +584,14 @@ var calculateScrollCenter = (elements, appState) => {
|
|
|
401
584
|
};
|
|
402
585
|
}
|
|
403
586
|
let [x1, y1, x2, y2] = getCommonBounds(elements);
|
|
404
|
-
if (
|
|
587
|
+
if (doBoundsExceedViewport(appState, [x1, y1, x2, y2])) {
|
|
405
588
|
[x1, y1, x2, y2] = getClosestElementBounds(
|
|
406
589
|
elements,
|
|
407
590
|
viewportCoordsToSceneCoords(
|
|
408
|
-
{
|
|
591
|
+
{
|
|
592
|
+
clientX: appState.offsetLeft + appState.width / 2,
|
|
593
|
+
clientY: appState.offsetTop + appState.height / 2
|
|
594
|
+
},
|
|
409
595
|
appState
|
|
410
596
|
)
|
|
411
597
|
);
|
|
@@ -430,16 +616,16 @@ import {
|
|
|
430
616
|
} from "@excalidraw/element";
|
|
431
617
|
|
|
432
618
|
// scene/normalize.ts
|
|
433
|
-
import { MAX_ZOOM, MIN_ZOOM } from "@excalidraw/common";
|
|
434
|
-
import { clamp, round } from "@excalidraw/math";
|
|
619
|
+
import { MAX_ZOOM as MAX_ZOOM2, MIN_ZOOM as MIN_ZOOM2 } from "@excalidraw/common";
|
|
620
|
+
import { clamp as clamp2, round } from "@excalidraw/math";
|
|
435
621
|
var getNormalizedZoom = (zoom) => {
|
|
436
|
-
return
|
|
622
|
+
return clamp2(round(zoom, 6), MIN_ZOOM2, MAX_ZOOM2);
|
|
437
623
|
};
|
|
438
624
|
var getNormalizedGridSize = (gridStep) => {
|
|
439
|
-
return
|
|
625
|
+
return clamp2(Math.round(gridStep), 1, 100);
|
|
440
626
|
};
|
|
441
627
|
var getNormalizedGridStep = (gridStep) => {
|
|
442
|
-
return
|
|
628
|
+
return clamp2(Math.round(gridStep), 1, 100);
|
|
443
629
|
};
|
|
444
630
|
|
|
445
631
|
// scene/export.ts
|
|
@@ -452,7 +638,7 @@ import {
|
|
|
452
638
|
THEME as THEME5,
|
|
453
639
|
MIME_TYPES as MIME_TYPES5,
|
|
454
640
|
EXPORT_DATA_TYPES as EXPORT_DATA_TYPES2,
|
|
455
|
-
arrayToMap,
|
|
641
|
+
arrayToMap as arrayToMap2,
|
|
456
642
|
distance,
|
|
457
643
|
getFontString as getFontString2,
|
|
458
644
|
toBrandedType,
|
|
@@ -3046,6 +3232,7 @@ var Fonts = _Fonts;
|
|
|
3046
3232
|
// renderer/staticScene.ts
|
|
3047
3233
|
import {
|
|
3048
3234
|
applyDarkModeFilter as applyDarkModeFilter2,
|
|
3235
|
+
COLOR_WHITE as COLOR_WHITE2,
|
|
3049
3236
|
FRAME_STYLE,
|
|
3050
3237
|
THEME as THEME3,
|
|
3051
3238
|
throttleRAF
|
|
@@ -3067,7 +3254,7 @@ import { renderElement } from "@excalidraw/element";
|
|
|
3067
3254
|
import { getElementAbsoluteCoords as getElementAbsoluteCoords2 } from "@excalidraw/element";
|
|
3068
3255
|
|
|
3069
3256
|
// components/hyperlink/helpers.ts
|
|
3070
|
-
import { pointFrom, pointRotateRads } from "@excalidraw/math";
|
|
3257
|
+
import { pointFrom as pointFrom2, pointRotateRads } from "@excalidraw/math";
|
|
3071
3258
|
import { MIME_TYPES as MIME_TYPES3 } from "@excalidraw/common";
|
|
3072
3259
|
import { getElementAbsoluteCoords } from "@excalidraw/element";
|
|
3073
3260
|
import { hitElementBoundingBox } from "@excalidraw/element";
|
|
@@ -3093,8 +3280,8 @@ var getLinkHandleFromCoords = ([x1, y1, x2, y2], angle, appState) => {
|
|
|
3093
3280
|
const x = x2 + dashedLineMargin - centeringOffset;
|
|
3094
3281
|
const y = y1 - dashedLineMargin - linkMarginY + centeringOffset;
|
|
3095
3282
|
const [rotatedX, rotatedY] = pointRotateRads(
|
|
3096
|
-
|
|
3097
|
-
|
|
3283
|
+
pointFrom2(x + linkWidth / 2, y + linkHeight / 2),
|
|
3284
|
+
pointFrom2(centerX, centerY),
|
|
3098
3285
|
angle
|
|
3099
3286
|
);
|
|
3100
3287
|
return [
|
|
@@ -3119,19 +3306,19 @@ var isPointHittingLink = (element, elementsMap, appState, [x, y], isMobile) => {
|
|
|
3119
3306
|
if (!element.link || appState.selectedElementIds[element.id]) {
|
|
3120
3307
|
return false;
|
|
3121
3308
|
}
|
|
3122
|
-
if (!isMobile && appState.viewModeEnabled && hitElementBoundingBox(
|
|
3309
|
+
if (!isMobile && appState.viewModeEnabled && hitElementBoundingBox(pointFrom2(x, y), element, elementsMap)) {
|
|
3123
3310
|
return true;
|
|
3124
3311
|
}
|
|
3125
3312
|
return isPointHittingLinkIcon(
|
|
3126
3313
|
element,
|
|
3127
3314
|
elementsMap,
|
|
3128
3315
|
appState,
|
|
3129
|
-
|
|
3316
|
+
pointFrom2(x, y)
|
|
3130
3317
|
);
|
|
3131
3318
|
};
|
|
3132
3319
|
|
|
3133
3320
|
// renderer/helpers.ts
|
|
3134
|
-
import { THEME as THEME2, applyDarkModeFilter } from "@excalidraw/common";
|
|
3321
|
+
import { COLOR_WHITE, THEME as THEME2, applyDarkModeFilter } from "@excalidraw/common";
|
|
3135
3322
|
var fillCircle = (context, cx, cy, radius, stroke, fill = true) => {
|
|
3136
3323
|
context.beginPath();
|
|
3137
3324
|
context.arc(cx, cy, radius, 0, Math.PI * 2);
|
|
@@ -3158,19 +3345,20 @@ var bootstrapCanvas = ({
|
|
|
3158
3345
|
context.setTransform(1, 0, 0, 1, 0, 0);
|
|
3159
3346
|
context.scale(scale, scale);
|
|
3160
3347
|
if (typeof viewBackgroundColor === "string") {
|
|
3161
|
-
const
|
|
3162
|
-
|
|
3163
|
-
/(hsla|rgba)\(/.test(viewBackgroundColor);
|
|
3164
|
-
if (hasTransparence) {
|
|
3348
|
+
const isOpaque = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(viewBackgroundColor);
|
|
3349
|
+
if (!isOpaque) {
|
|
3165
3350
|
context.clearRect(0, 0, normalizedWidth, normalizedHeight);
|
|
3166
3351
|
}
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3352
|
+
if (viewBackgroundColor !== "transparent") {
|
|
3353
|
+
context.save();
|
|
3354
|
+
context.fillStyle = COLOR_WHITE;
|
|
3355
|
+
context.fillStyle = applyDarkModeFilter(
|
|
3356
|
+
viewBackgroundColor,
|
|
3357
|
+
theme === THEME2.DARK
|
|
3358
|
+
);
|
|
3359
|
+
context.fillRect(0, 0, normalizedWidth, normalizedHeight);
|
|
3360
|
+
context.restore();
|
|
3361
|
+
}
|
|
3174
3362
|
} else {
|
|
3175
3363
|
context.clearRect(0, 0, normalizedWidth, normalizedHeight);
|
|
3176
3364
|
}
|
|
@@ -3297,7 +3485,8 @@ var renderLinkIcon = (element, context, appState, elementsMap) => {
|
|
|
3297
3485
|
window.devicePixelRatio * appState.zoom.value,
|
|
3298
3486
|
window.devicePixelRatio * appState.zoom.value
|
|
3299
3487
|
);
|
|
3300
|
-
linkCanvasCacheContext.fillStyle =
|
|
3488
|
+
linkCanvasCacheContext.fillStyle = COLOR_WHITE2;
|
|
3489
|
+
linkCanvasCacheContext.fillStyle = appState.viewBackgroundColor || COLOR_WHITE2;
|
|
3301
3490
|
linkCanvasCacheContext.fillRect(0, 0, width, height);
|
|
3302
3491
|
if (canvasKey === "elementLink") {
|
|
3303
3492
|
linkCanvasCacheContext.drawImage(ELEMENT_LINK_IMG, 0, 0, width, height);
|
|
@@ -3423,7 +3612,7 @@ var _renderStaticScene = ({
|
|
|
3423
3612
|
);
|
|
3424
3613
|
}
|
|
3425
3614
|
context.restore();
|
|
3426
|
-
if (!isExporting) {
|
|
3615
|
+
if (!isExporting && renderConfig.renderLinks !== false) {
|
|
3427
3616
|
renderLinkIcon(element, context, appState, elementsMap);
|
|
3428
3617
|
}
|
|
3429
3618
|
} catch (error) {
|
|
@@ -3461,7 +3650,7 @@ var _renderStaticScene = ({
|
|
|
3461
3650
|
appState
|
|
3462
3651
|
);
|
|
3463
3652
|
}
|
|
3464
|
-
if (!isExporting) {
|
|
3653
|
+
if (!isExporting && renderConfig.renderLinks !== false) {
|
|
3465
3654
|
renderLinkIcon(element, context, appState, elementsMap);
|
|
3466
3655
|
}
|
|
3467
3656
|
};
|
|
@@ -4084,7 +4273,7 @@ var renderSceneToSvg = (elements, elementsMap, rsvg, svgRoot, files, renderConfi
|
|
|
4084
4273
|
renderConfig
|
|
4085
4274
|
);
|
|
4086
4275
|
const boundTextElement = getBoundTextElement2(element, elementsMap);
|
|
4087
|
-
if (boundTextElement) {
|
|
4276
|
+
if (boundTextElement?.isDeleted === false) {
|
|
4088
4277
|
renderElementToSvg(
|
|
4089
4278
|
boundTextElement,
|
|
4090
4279
|
elementsMap,
|
|
@@ -4095,6 +4284,10 @@ var renderSceneToSvg = (elements, elementsMap, rsvg, svgRoot, files, renderConfi
|
|
|
4095
4284
|
boundTextElement.y + renderConfig.offsetY,
|
|
4096
4285
|
renderConfig
|
|
4097
4286
|
);
|
|
4287
|
+
} else if (boundTextElement) {
|
|
4288
|
+
console.error(
|
|
4289
|
+
"[NONDELETED][INVARIANT] Skipped rendering deleted bound text element"
|
|
4290
|
+
);
|
|
4098
4291
|
}
|
|
4099
4292
|
} catch (error) {
|
|
4100
4293
|
console.error(error);
|
|
@@ -4186,7 +4379,7 @@ var prepareElementsForRender = ({
|
|
|
4186
4379
|
nextElements = getElementsOverlappingFrame(
|
|
4187
4380
|
elements,
|
|
4188
4381
|
exportingFrame,
|
|
4189
|
-
|
|
4382
|
+
arrayToMap2(elements)
|
|
4190
4383
|
);
|
|
4191
4384
|
} else if (frameRendering.enabled && frameRendering.name) {
|
|
4192
4385
|
nextElements = addFrameLabelsAsTextElements(elements, {
|
|
@@ -4244,10 +4437,10 @@ var exportToCanvas = async (elements, appState, files, {
|
|
|
4244
4437
|
canvas,
|
|
4245
4438
|
rc: rough.canvas(canvas),
|
|
4246
4439
|
elementsMap: toBrandedType(
|
|
4247
|
-
|
|
4440
|
+
arrayToMap2(elementsForRender)
|
|
4248
4441
|
),
|
|
4249
4442
|
allElementsMap: toBrandedType(
|
|
4250
|
-
|
|
4443
|
+
arrayToMap2(syncInvalidIndices(elements))
|
|
4251
4444
|
),
|
|
4252
4445
|
visibleElements: elementsForRender,
|
|
4253
4446
|
scale,
|
|
@@ -4336,7 +4529,7 @@ var exportToSvg = async (elements, appState, files, opts) => {
|
|
|
4336
4529
|
}
|
|
4337
4530
|
const frameElements = getFrameLikeElements(elements);
|
|
4338
4531
|
if (frameElements.length) {
|
|
4339
|
-
const elementsMap =
|
|
4532
|
+
const elementsMap = arrayToMap2(elements);
|
|
4340
4533
|
for (const frame of frameElements) {
|
|
4341
4534
|
const clipPath = svgRoot.ownerDocument.createElementNS(
|
|
4342
4535
|
SVG_NS2,
|
|
@@ -4385,7 +4578,7 @@ var exportToSvg = async (elements, appState, files, opts) => {
|
|
|
4385
4578
|
const renderEmbeddables = opts?.renderEmbeddables ?? false;
|
|
4386
4579
|
renderSceneToSvg(
|
|
4387
4580
|
elementsForRender,
|
|
4388
|
-
toBrandedType(
|
|
4581
|
+
toBrandedType(arrayToMap2(elementsForRender)),
|
|
4389
4582
|
rsvg,
|
|
4390
4583
|
svgRoot,
|
|
4391
4584
|
files || {},
|
|
@@ -4456,15 +4649,9 @@ var getCanvasSize = (elements, exportPadding) => {
|
|
|
4456
4649
|
const height = distance(minY, maxY) + exportPadding * 2;
|
|
4457
4650
|
return [minX, minY, width, height];
|
|
4458
4651
|
};
|
|
4459
|
-
var getExportSize = (elements, exportPadding, scale) => {
|
|
4460
|
-
const [, , width, height] = getCanvasSize(elements, exportPadding).map(
|
|
4461
|
-
(dimension) => Math.trunc(dimension * scale)
|
|
4462
|
-
);
|
|
4463
|
-
return [width, height];
|
|
4464
|
-
};
|
|
4465
4652
|
|
|
4466
4653
|
// data/restore.ts
|
|
4467
|
-
import { isFiniteNumber, isValidPoint, pointFrom as
|
|
4654
|
+
import { isFiniteNumber, isValidPoint, pointFrom as pointFrom3 } from "@excalidraw/math";
|
|
4468
4655
|
import {
|
|
4469
4656
|
DEFAULT_FONT_FAMILY as DEFAULT_FONT_FAMILY2,
|
|
4470
4657
|
DEFAULT_STROKE_STREAMLINE,
|
|
@@ -4479,7 +4666,7 @@ import {
|
|
|
4479
4666
|
randomId,
|
|
4480
4667
|
getUpdatedTimestamp,
|
|
4481
4668
|
updateActiveTool,
|
|
4482
|
-
arrayToMap as
|
|
4669
|
+
arrayToMap as arrayToMap3,
|
|
4483
4670
|
getSizeFromPoints,
|
|
4484
4671
|
normalizeLink as normalizeLink2,
|
|
4485
4672
|
getLineHeight,
|
|
@@ -4530,20 +4717,20 @@ var handleOversizedLinearElements = (element) => {
|
|
|
4530
4717
|
y: 0,
|
|
4531
4718
|
width: 100,
|
|
4532
4719
|
height: 100,
|
|
4533
|
-
points: [
|
|
4720
|
+
points: [pointFrom3(0, 0), pointFrom3(100, 100)],
|
|
4534
4721
|
isDeleted: true
|
|
4535
4722
|
};
|
|
4536
4723
|
};
|
|
4537
4724
|
var restoreLinearElementPoints = (points, width, height) => {
|
|
4538
4725
|
const restoredPoints = Array.isArray(points) ? points.reduce((acc, point) => {
|
|
4539
4726
|
if (isValidPoint(point)) {
|
|
4540
|
-
acc.push(
|
|
4727
|
+
acc.push(pointFrom3(point[0], point[1]));
|
|
4541
4728
|
}
|
|
4542
4729
|
return acc;
|
|
4543
4730
|
}, []) : [];
|
|
4544
4731
|
return restoredPoints.length < 2 ? [
|
|
4545
|
-
|
|
4546
|
-
|
|
4732
|
+
pointFrom3(0, 0),
|
|
4733
|
+
pointFrom3(
|
|
4547
4734
|
isFiniteNumber(width) ? width : 0,
|
|
4548
4735
|
isFiniteNumber(height) ? height : 0
|
|
4549
4736
|
)
|
|
@@ -4561,7 +4748,7 @@ var restoreFreedrawPoints = (points, pressures) => {
|
|
|
4561
4748
|
const restoredPressures = [];
|
|
4562
4749
|
points.forEach((point, index) => {
|
|
4563
4750
|
if (isValidPoint(point)) {
|
|
4564
|
-
restoredPoints.push(
|
|
4751
|
+
restoredPoints.push(pointFrom3(point[0], point[1]));
|
|
4565
4752
|
if (index in pressureValues) {
|
|
4566
4753
|
const pressure = pressureValues[index];
|
|
4567
4754
|
restoredPressures.push(isFiniteNumber(pressure) ? pressure : 0.5);
|
|
@@ -4590,7 +4777,9 @@ var AllowedExcalidrawActiveTools = {
|
|
|
4590
4777
|
embeddable: true,
|
|
4591
4778
|
hand: true,
|
|
4592
4779
|
laser: false,
|
|
4593
|
-
magicframe: false
|
|
4780
|
+
magicframe: false,
|
|
4781
|
+
autoshape: false,
|
|
4782
|
+
bucketfill: false
|
|
4594
4783
|
};
|
|
4595
4784
|
var ALLOWED_STROKE_VARIABILITIES = /* @__PURE__ */ new Set([
|
|
4596
4785
|
"constant",
|
|
@@ -4953,8 +5142,8 @@ var repairFrameMembership = (element, elementsMap) => {
|
|
|
4953
5142
|
};
|
|
4954
5143
|
var restoreElements = (targetElements, existingElements, opts) => {
|
|
4955
5144
|
const existingIds = /* @__PURE__ */ new Set();
|
|
4956
|
-
const targetElementsMap =
|
|
4957
|
-
const existingElementsMap = existingElements ?
|
|
5145
|
+
const targetElementsMap = arrayToMap3(targetElements || []);
|
|
5146
|
+
const existingElementsMap = existingElements ? arrayToMap3(existingElements) : null;
|
|
4958
5147
|
const restoredElements = syncInvalidIndices2(
|
|
4959
5148
|
(targetElements || []).reduce((elements, element) => {
|
|
4960
5149
|
if (element.type === "selection") {
|
|
@@ -4995,7 +5184,7 @@ var restoreElements = (targetElements, existingElements, opts) => {
|
|
|
4995
5184
|
if (!opts?.repairBindings) {
|
|
4996
5185
|
return restoredElements;
|
|
4997
5186
|
}
|
|
4998
|
-
const restoredElementsMap =
|
|
5187
|
+
const restoredElementsMap = arrayToMap3(restoredElements);
|
|
4999
5188
|
for (const element of restoredElements) {
|
|
5000
5189
|
if (element.frameId) {
|
|
5001
5190
|
repairFrameMembership(element, restoredElementsMap);
|
|
@@ -5033,7 +5222,7 @@ var restoreElements = (targetElements, existingElements, opts) => {
|
|
|
5033
5222
|
restoredElementsMap,
|
|
5034
5223
|
{
|
|
5035
5224
|
points: [
|
|
5036
|
-
|
|
5225
|
+
pointFrom3(0, 0),
|
|
5037
5226
|
element.points[element.points.length - 1]
|
|
5038
5227
|
]
|
|
5039
5228
|
}
|
|
@@ -5062,10 +5251,10 @@ var restoreElements = (targetElements, existingElements, opts) => {
|
|
|
5062
5251
|
width: boundElement.width,
|
|
5063
5252
|
height: boundElement.height,
|
|
5064
5253
|
points: [
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5254
|
+
pointFrom3(0, 0),
|
|
5255
|
+
pointFrom3(0, -10),
|
|
5256
|
+
pointFrom3(boundElement.width / 2 + 5, -10),
|
|
5257
|
+
pointFrom3(
|
|
5069
5258
|
boundElement.width / 2 + 5,
|
|
5070
5259
|
boundElement.height / 2 + 5
|
|
5071
5260
|
)
|
|
@@ -5156,7 +5345,7 @@ var parseFileContents = async (blob) => {
|
|
|
5156
5345
|
let contents;
|
|
5157
5346
|
if (blob.type === MIME_TYPES6.png) {
|
|
5158
5347
|
try {
|
|
5159
|
-
return await (await import("./data/image-
|
|
5348
|
+
return await (await import("./data/image-NFLICJEW.js")).decodePngMetadata(blob);
|
|
5160
5349
|
} catch (error) {
|
|
5161
5350
|
if (error.message === "INVALID") {
|
|
5162
5351
|
throw new ImageSceneDataError(
|
|
@@ -5246,7 +5435,7 @@ var loadFromBlob = async (blob, localAppState, localElements, fileHandle) => {
|
|
|
5246
5435
|
theme: localAppState?.theme,
|
|
5247
5436
|
fileHandle: fileHandle || blob.handle || null,
|
|
5248
5437
|
...cleanAppStateForExport(data.appState || {}),
|
|
5249
|
-
...localAppState ?
|
|
5438
|
+
...localAppState ? getScrollToContentState(data.elements || [], localAppState) : {}
|
|
5250
5439
|
},
|
|
5251
5440
|
localAppState
|
|
5252
5441
|
),
|
|
@@ -5312,6 +5501,77 @@ var getDataURL_sync = (data, mimeType) => {
|
|
|
5312
5501
|
var dataURLToString = (dataURL) => {
|
|
5313
5502
|
return base64ToString(dataURL.slice(dataURL.indexOf(",") + 1));
|
|
5314
5503
|
};
|
|
5504
|
+
var getImageFileDimensions = async (file) => {
|
|
5505
|
+
const browserURL = typeof window !== "undefined" ? window.URL : void 0;
|
|
5506
|
+
let objectURL = null;
|
|
5507
|
+
let imageSource;
|
|
5508
|
+
try {
|
|
5509
|
+
imageSource = browserURL?.createObjectURL ? objectURL = browserURL.createObjectURL(file) : await getDataURL(file);
|
|
5510
|
+
} catch {
|
|
5511
|
+
objectURL = null;
|
|
5512
|
+
imageSource = await getDataURL(file);
|
|
5513
|
+
}
|
|
5514
|
+
return new Promise((resolve, reject) => {
|
|
5515
|
+
const image = new Image();
|
|
5516
|
+
const cleanup = () => {
|
|
5517
|
+
image.onload = null;
|
|
5518
|
+
image.onerror = null;
|
|
5519
|
+
if (objectURL && browserURL?.revokeObjectURL) {
|
|
5520
|
+
browserURL.revokeObjectURL(objectURL);
|
|
5521
|
+
}
|
|
5522
|
+
};
|
|
5523
|
+
image.onload = () => {
|
|
5524
|
+
cleanup();
|
|
5525
|
+
resolve({
|
|
5526
|
+
width: image.naturalWidth || image.width,
|
|
5527
|
+
height: image.naturalHeight || image.height
|
|
5528
|
+
});
|
|
5529
|
+
};
|
|
5530
|
+
image.onerror = (error) => {
|
|
5531
|
+
cleanup();
|
|
5532
|
+
reject(error);
|
|
5533
|
+
};
|
|
5534
|
+
image.src = imageSource;
|
|
5535
|
+
});
|
|
5536
|
+
};
|
|
5537
|
+
var resizeImageFile = async (file, opts) => {
|
|
5538
|
+
if (file.type === MIME_TYPES6.svg) {
|
|
5539
|
+
return file;
|
|
5540
|
+
}
|
|
5541
|
+
if (!isSupportedImageFile(file)) {
|
|
5542
|
+
throw new Error("Error: unsupported file type", { cause: "UNSUPPORTED" });
|
|
5543
|
+
}
|
|
5544
|
+
if (!opts.outputType || opts.outputType === file.type) {
|
|
5545
|
+
const dimensions = await getImageFileDimensions(file);
|
|
5546
|
+
if (Math.max(dimensions.width, dimensions.height) <= opts.maxWidthOrHeight) {
|
|
5547
|
+
return file;
|
|
5548
|
+
}
|
|
5549
|
+
}
|
|
5550
|
+
const [pica, imageBlobReduce] = await Promise.all([
|
|
5551
|
+
import("pica").then((res) => res.default),
|
|
5552
|
+
// a wrapper for pica for better API
|
|
5553
|
+
import("image-blob-reduce").then((res) => res.default)
|
|
5554
|
+
]);
|
|
5555
|
+
const reduce = imageBlobReduce({
|
|
5556
|
+
pica: pica({ features: ["js", "wasm"] })
|
|
5557
|
+
});
|
|
5558
|
+
if (opts.outputType) {
|
|
5559
|
+
const { outputType } = opts;
|
|
5560
|
+
reduce._create_blob = function(env) {
|
|
5561
|
+
return this.pica.toBlob(env.out_canvas, outputType, 0.8).then((blob) => {
|
|
5562
|
+
env.out_blob = blob;
|
|
5563
|
+
return env;
|
|
5564
|
+
});
|
|
5565
|
+
};
|
|
5566
|
+
}
|
|
5567
|
+
return new File(
|
|
5568
|
+
[await reduce.toBlob(file, { max: opts.maxWidthOrHeight, alpha: true })],
|
|
5569
|
+
file.name,
|
|
5570
|
+
{
|
|
5571
|
+
type: opts.outputType || file.type
|
|
5572
|
+
}
|
|
5573
|
+
);
|
|
5574
|
+
};
|
|
5315
5575
|
var SVGStringToFile = (SVGString, filename = "") => {
|
|
5316
5576
|
return new File([new TextEncoder().encode(SVGString)], filename, {
|
|
5317
5577
|
type: MIME_TYPES6.svg
|
|
@@ -5456,8 +5716,11 @@ var decodePngMetadata = async (blob) => {
|
|
|
5456
5716
|
};
|
|
5457
5717
|
|
|
5458
5718
|
export {
|
|
5459
|
-
|
|
5460
|
-
|
|
5719
|
+
DEFAULT_OVERSCROLL,
|
|
5720
|
+
constrainScrollState,
|
|
5721
|
+
getViewportForZoomWithScrollConstraints,
|
|
5722
|
+
zoomToFitBounds,
|
|
5723
|
+
getScrollToContentState,
|
|
5461
5724
|
getNormalizedZoom,
|
|
5462
5725
|
getNormalizedGridStep,
|
|
5463
5726
|
isSomeElementSelected,
|
|
@@ -5494,7 +5757,6 @@ export {
|
|
|
5494
5757
|
renderStaticScene,
|
|
5495
5758
|
exportToCanvas,
|
|
5496
5759
|
exportToSvg,
|
|
5497
|
-
getExportSize,
|
|
5498
5760
|
restoreElement,
|
|
5499
5761
|
restoreElements,
|
|
5500
5762
|
restoreAppState,
|
|
@@ -5512,10 +5774,11 @@ export {
|
|
|
5512
5774
|
getDataURL,
|
|
5513
5775
|
getDataURL_sync,
|
|
5514
5776
|
dataURLToString,
|
|
5777
|
+
resizeImageFile,
|
|
5515
5778
|
SVGStringToFile,
|
|
5516
5779
|
ImageURLToFile,
|
|
5517
5780
|
getFileHandle,
|
|
5518
5781
|
createFile,
|
|
5519
5782
|
normalizeFile
|
|
5520
5783
|
};
|
|
5521
|
-
//# sourceMappingURL=chunk-
|
|
5784
|
+
//# sourceMappingURL=chunk-BCNQXIBK.js.map
|