@excalidraw/excalidraw 0.17.1-1d71f84 → 0.17.1-22b3927
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 +14 -2
- package/dist/browser/dev/excalidraw-assets-dev/{blockDiagram-91b80b7a-ACFH36JV.js → blockDiagram-91b80b7a-H47FTXHA.js} +5 -5
- package/dist/browser/dev/excalidraw-assets-dev/{c4Diagram-b2a90758-QZ27YR47.js → c4Diagram-b2a90758-NNJK6GKC.js} +3 -3
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-HO2HMSK7.js → chunk-4KQVEBHW.js} +3 -3
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-USGV265L.js → chunk-53YI56GV.js} +4 -4
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-EDFX3S7X.js → chunk-A2WCJI4I.js} +3 -3
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-IX4V72YG.js → chunk-EFLPX7NE.js} +6 -6
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-MXVETLVM.js → chunk-JYIQCNWV.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-YZIOORVX.js → chunk-LVIQQW6F.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-6U7GQNJT.js → chunk-PXLO3FOU.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-AK7SWNLN.js → chunk-Q6A4M3MN.js} +9 -5
- package/dist/browser/dev/excalidraw-assets-dev/chunk-Q6A4M3MN.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-7DACDEY3.js → chunk-TO2AW5PW.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-RWZVJAQU.js → chunk-VC7RRIDZ.js} +4657 -2673
- package/dist/browser/dev/excalidraw-assets-dev/chunk-VC7RRIDZ.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-NJ77ZFNJ.js → chunk-VURILHLY.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-2T2GU7NF.js → chunk-ZAYGSUHF.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{chunk-Z3PH3V2B.js → chunk-ZQR5ML6Y.js} +26 -26
- package/dist/browser/dev/excalidraw-assets-dev/chunk-ZQR5ML6Y.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-30eddba6-QSLMH4JW.js → classDiagram-30eddba6-CUYIJICN.js} +5 -5
- package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-v2-f2df5561-DY4DYQ5P.js → classDiagram-v2-f2df5561-K6WW6K73.js} +8 -8
- package/dist/browser/dev/excalidraw-assets-dev/{dist-Z46EOVOL.js → dist-6QVAH5JA.js} +37 -15
- package/dist/browser/dev/excalidraw-assets-dev/dist-6QVAH5JA.js.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{en-5TCZHGGJ.js → en-Y27YPU72.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{erDiagram-47591fe2-SOOJRTCB.js → erDiagram-47591fe2-XGAD7EEP.js} +4 -4
- package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-5540d9b9-AHGL4KPK.js → flowDiagram-5540d9b9-B6EOVNNO.js} +9 -9
- package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-v2-3b53844e-56LDZZWY.js → flowDiagram-v2-3b53844e-NUG24FJH.js} +9 -9
- package/dist/browser/dev/excalidraw-assets-dev/{flowchart-elk-definition-5fe447d6-27LUKRI6.js → flowchart-elk-definition-5fe447d6-25Y7PCBL.js} +5 -5
- package/dist/browser/dev/excalidraw-assets-dev/{ganttDiagram-9a3bba1f-EHGYGNG6.js → ganttDiagram-9a3bba1f-GNL6ZDTC.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{gitGraphDiagram-96e6b4ee-AJQNBDW5.js → gitGraphDiagram-96e6b4ee-HNW52NVO.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{image-EDKQZH7Z.js → image-J7S3ALXP.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{image-OFRRV5MB.css → image-O66MQ7WQ.css} +1 -1
- package/dist/browser/dev/excalidraw-assets-dev/image-O66MQ7WQ.css.map +7 -0
- package/dist/browser/dev/excalidraw-assets-dev/{infoDiagram-bcd20f53-SWLLQVES.js → infoDiagram-bcd20f53-FWEUVFLT.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{journeyDiagram-4fe6b3dc-7UAVCWOZ.js → journeyDiagram-4fe6b3dc-RZIUI7UG.js} +3 -3
- package/dist/browser/dev/excalidraw-assets-dev/{mindmap-definition-f354de21-SROW5KGM.js → mindmap-definition-f354de21-GBVN45GU.js} +3 -3
- package/dist/browser/dev/excalidraw-assets-dev/{pieDiagram-79897490-QKCI6NCB.js → pieDiagram-79897490-ECENNII6.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{quadrantDiagram-62f64e94-LNYJZFC5.js → quadrantDiagram-62f64e94-ZMEOFVNL.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{requirementDiagram-05bf5f74-ZZD7ZHFA.js → requirementDiagram-05bf5f74-FHZSFHCR.js} +4 -4
- package/dist/browser/dev/excalidraw-assets-dev/{sankeyDiagram-97764748-L75ZZ4UM.js → sankeyDiagram-97764748-VDKIKTA6.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{sequenceDiagram-acc0e65c-6PCU7TDK.js → sequenceDiagram-acc0e65c-6JUSPVKX.js} +3 -3
- package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-0ff1cf1a-WM76WOPR.js → stateDiagram-0ff1cf1a-L3AKWENF.js} +5 -5
- package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-v2-9a9d610d-N4HZW3O2.js → stateDiagram-v2-9a9d610d-NU3GGMCH.js} +8 -8
- package/dist/browser/dev/excalidraw-assets-dev/{timeline-definition-fea2a41d-ZHGCAXGP.js → timeline-definition-fea2a41d-JGP7XCHW.js} +2 -2
- package/dist/browser/dev/excalidraw-assets-dev/{xychartDiagram-ab372869-2DLOVRAZ.js → xychartDiagram-ab372869-HLFHHF2I.js} +3 -3
- package/dist/browser/dev/index.css +72 -28
- package/dist/browser/dev/index.css.map +3 -3
- package/dist/browser/dev/index.js +2387 -1934
- package/dist/browser/dev/index.js.map +4 -4
- package/dist/browser/prod/excalidraw-assets/{blockDiagram-91b80b7a-ONPS22AM.js → blockDiagram-91b80b7a-FVCRVGN5.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{c4Diagram-b2a90758-XMIQY7ZT.js → c4Diagram-b2a90758-56CXO7GA.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-GCHQBOKV.js → chunk-635MQ3CK.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-P5M3G2RP.js → chunk-AIKXYJX3.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-E2YLWFZX.js → chunk-CR7VMNWC.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/chunk-CWO763YJ.js +55 -0
- package/dist/browser/prod/excalidraw-assets/{chunk-WEYK4A2L.js → chunk-FFF2CSVG.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-R3HAIP6R.js → chunk-G4WDCSPE.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-HFOXJM22.js → chunk-HKZSHFLX.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-XIMFFJTE.js → chunk-IKCDYWMW.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-CTYINSWT.js → chunk-IZMZ6RPD.js} +2 -2
- package/dist/browser/prod/excalidraw-assets/{chunk-AHLLBBVJ.js → chunk-L5DS24G6.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-CQJF3C6G.js → chunk-MUNOKHUD.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-NI6SYCUG.js → chunk-QOQYOOQ4.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{chunk-I2PZFXTK.js → chunk-ZTIWFPBM.js} +21 -21
- package/dist/browser/prod/excalidraw-assets/{classDiagram-30eddba6-IEJXXCVX.js → classDiagram-30eddba6-BCUTAUMD.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{classDiagram-v2-f2df5561-7LZDSWOS.js → classDiagram-v2-f2df5561-6SOXSGQ2.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/dist-567JAXHK.js +7 -0
- package/dist/browser/prod/excalidraw-assets/{en-LROPV2RN.js → en-GSUSWMSH.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{erDiagram-47591fe2-E5V666CF.js → erDiagram-47591fe2-RE6HB7RM.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{flowDiagram-5540d9b9-GMBRCYVF.js → flowDiagram-5540d9b9-ZNJZBERW.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{flowDiagram-v2-3b53844e-Z4HUWP6B.js → flowDiagram-v2-3b53844e-LY44JLQJ.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{flowchart-elk-definition-5fe447d6-5ZCYTX5N.js → flowchart-elk-definition-5fe447d6-TMTJ6Z7O.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{ganttDiagram-9a3bba1f-WM32OMT5.js → ganttDiagram-9a3bba1f-5O6EA6LX.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{gitGraphDiagram-96e6b4ee-CAKZ2U6E.js → gitGraphDiagram-96e6b4ee-UHYNM5DI.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/image-SZBFRCU2.js +1 -0
- package/dist/browser/prod/excalidraw-assets/{infoDiagram-bcd20f53-MUIKXGC4.js → infoDiagram-bcd20f53-BP77NQEH.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{journeyDiagram-4fe6b3dc-NYRV4HK2.js → journeyDiagram-4fe6b3dc-XMGKCMES.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{mindmap-definition-f354de21-MY55DRSM.js → mindmap-definition-f354de21-ZQRRBRWF.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{pieDiagram-79897490-47L6J6L2.js → pieDiagram-79897490-IGXEC2KX.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{quadrantDiagram-62f64e94-DF5C2GDT.js → quadrantDiagram-62f64e94-WTHHDYJL.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{requirementDiagram-05bf5f74-C4IMUBDN.js → requirementDiagram-05bf5f74-MV4OFRVW.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{sankeyDiagram-97764748-YHW7EUST.js → sankeyDiagram-97764748-ZGYUHEJT.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{sequenceDiagram-acc0e65c-H3XEHT32.js → sequenceDiagram-acc0e65c-IBSENK6W.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{stateDiagram-0ff1cf1a-Z5WB6Q3P.js → stateDiagram-0ff1cf1a-DB73XNZH.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{stateDiagram-v2-9a9d610d-T7OZETQC.js → stateDiagram-v2-9a9d610d-2OOBUPNR.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{timeline-definition-fea2a41d-VVC22BWF.js → timeline-definition-fea2a41d-P3NQQVDU.js} +1 -1
- package/dist/browser/prod/excalidraw-assets/{xychartDiagram-ab372869-JAXODQF7.js → xychartDiagram-ab372869-HI3XLK3Y.js} +1 -1
- package/dist/browser/prod/index.css +1 -1
- package/dist/browser/prod/index.js +24 -24
- package/dist/dev/{en-II4GK66F.json → en-OIPCBIOA.json} +8 -4
- package/dist/dev/index.css +72 -28
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +5866 -3499
- package/dist/dev/index.js.map +4 -4
- package/dist/excalidraw/actions/actionAddToLibrary.d.ts +4 -4
- package/dist/excalidraw/actions/actionAddToLibrary.js +4 -3
- package/dist/excalidraw/actions/actionAlign.d.ts +22 -22
- package/dist/excalidraw/actions/actionAlign.js +7 -6
- package/dist/excalidraw/actions/actionBoundText.d.ts +10 -10
- package/dist/excalidraw/actions/actionBoundText.js +11 -5
- package/dist/excalidraw/actions/actionCanvas.d.ts +52 -52
- package/dist/excalidraw/actions/actionCanvas.js +19 -14
- package/dist/excalidraw/actions/actionClipboard.d.ts +24 -24
- package/dist/excalidraw/actions/actionClipboard.js +14 -13
- package/dist/excalidraw/actions/actionDeleteSelected.d.ts +10 -10
- package/dist/excalidraw/actions/actionDeleteSelected.js +6 -3
- package/dist/excalidraw/actions/actionDistribute.d.ts +10 -10
- package/dist/excalidraw/actions/actionDistribute.js +3 -2
- package/dist/excalidraw/actions/actionDuplicateSelection.d.ts +7 -8
- package/dist/excalidraw/actions/actionDuplicateSelection.js +7 -3
- package/dist/excalidraw/actions/actionElementLock.d.ts +9 -9
- package/dist/excalidraw/actions/actionElementLock.js +3 -2
- package/dist/excalidraw/actions/actionExport.d.ts +33 -33
- package/dist/excalidraw/actions/actionExport.js +15 -11
- package/dist/excalidraw/actions/actionFinalize.d.ts +9 -9
- package/dist/excalidraw/actions/actionFinalize.js +9 -5
- package/dist/excalidraw/actions/actionFlip.d.ts +10 -10
- package/dist/excalidraw/actions/actionFlip.js +12 -12
- package/dist/excalidraw/actions/actionFrame.d.ts +171 -18
- package/dist/excalidraw/actions/actionFrame.js +7 -6
- package/dist/excalidraw/actions/actionGroup.d.ts +16 -16
- package/dist/excalidraw/actions/actionGroup.js +9 -11
- package/dist/excalidraw/actions/actionHistory.d.ts +4 -3
- package/dist/excalidraw/actions/actionHistory.js +27 -28
- package/dist/excalidraw/actions/actionLinearEditor.d.ts +6 -4
- package/dist/excalidraw/actions/actionLinearEditor.js +21 -5
- package/dist/excalidraw/actions/actionLink.d.ts +5 -5
- package/dist/excalidraw/actions/actionLink.js +2 -1
- package/dist/excalidraw/actions/actionMenu.d.ts +8 -8
- package/dist/excalidraw/actions/actionMenu.js +4 -3
- package/dist/excalidraw/actions/actionNavigate.d.ts +4 -4
- package/dist/excalidraw/actions/actionNavigate.js +3 -2
- package/dist/excalidraw/actions/actionProperties.d.ts +34 -34
- package/dist/excalidraw/actions/actionProperties.js +19 -14
- package/dist/excalidraw/actions/actionSelectAll.d.ts +5 -5
- package/dist/excalidraw/actions/actionSelectAll.js +2 -1
- package/dist/excalidraw/actions/actionStyles.d.ts +11 -11
- package/dist/excalidraw/actions/actionStyles.js +4 -3
- package/dist/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
- package/dist/excalidraw/actions/actionTextAutoResize.js +38 -0
- package/dist/excalidraw/actions/actionToggleGridMode.d.ts +7 -5
- package/dist/excalidraw/actions/actionToggleGridMode.js +6 -2
- package/dist/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -4
- package/dist/excalidraw/actions/actionToggleObjectsSnapMode.js +2 -1
- package/dist/excalidraw/actions/actionToggleStats.d.ts +4 -4
- package/dist/excalidraw/actions/actionToggleStats.js +2 -1
- package/dist/excalidraw/actions/actionToggleViewMode.d.ts +4 -4
- package/dist/excalidraw/actions/actionToggleViewMode.js +2 -1
- package/dist/excalidraw/actions/actionToggleZenMode.d.ts +4 -4
- package/dist/excalidraw/actions/actionToggleZenMode.js +2 -1
- package/dist/excalidraw/actions/actionZindex.d.ts +23 -19
- package/dist/excalidraw/actions/actionZindex.js +9 -4
- package/dist/excalidraw/actions/manager.d.ts +5 -5
- package/dist/excalidraw/actions/register.d.ts +1 -1
- package/dist/excalidraw/actions/shortcuts.d.ts +2 -2
- package/dist/excalidraw/actions/shortcuts.js +1 -1
- package/dist/excalidraw/actions/types.d.ts +8 -8
- package/dist/excalidraw/align.d.ts +1 -1
- package/dist/excalidraw/analytics.js +1 -1
- package/dist/excalidraw/animated-trail.d.ts +2 -2
- package/dist/excalidraw/appState.d.ts +5 -5
- package/dist/excalidraw/change.d.ts +191 -0
- package/dist/excalidraw/change.js +901 -0
- package/dist/excalidraw/charts.d.ts +1 -1
- package/dist/excalidraw/clients.d.ts +2 -2
- package/dist/excalidraw/clients.js +1 -1
- package/dist/excalidraw/clipboard.d.ts +3 -3
- package/dist/excalidraw/colors.d.ts +1 -1
- package/dist/excalidraw/components/Actions.d.ts +3 -3
- package/dist/excalidraw/components/Actions.js +9 -6
- package/dist/excalidraw/components/App.d.ts +28 -14
- package/dist/excalidraw/components/App.js +491 -204
- package/dist/excalidraw/components/ButtonIconSelect.js +1 -1
- package/dist/excalidraw/components/CheckboxItem.js +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorInput.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorInput.js +1 -1
- package/dist/excalidraw/components/ColorPicker/ColorPicker.d.ts +4 -4
- package/dist/excalidraw/components/ColorPicker/ColorPicker.js +1 -1
- package/dist/excalidraw/components/ColorPicker/Picker.d.ts +3 -3
- package/dist/excalidraw/components/ColorPicker/PickerColorList.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/PickerHeading.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/ShadeList.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +2 -2
- package/dist/excalidraw/components/ColorPicker/colorPickerUtils.js +1 -1
- package/dist/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
- package/dist/excalidraw/components/ColorPicker/keyboardNavHandlers.js +1 -1
- package/dist/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/excalidraw/components/CommandPalette/CommandPalette.js +30 -15
- package/dist/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -1
- package/dist/excalidraw/components/CommandPalette/types.d.ts +3 -3
- package/dist/excalidraw/components/ConfirmDialog.d.ts +1 -1
- package/dist/excalidraw/components/ContextMenu.d.ts +2 -2
- package/dist/excalidraw/components/ContextMenu.js +2 -2
- package/dist/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/excalidraw/components/DarkModeToggle.js +3 -1
- package/dist/excalidraw/components/DefaultSidebar.d.ts +2 -2
- package/dist/excalidraw/components/Dialog.js +1 -1
- package/dist/excalidraw/components/DialogActionButton.d.ts +1 -1
- package/dist/excalidraw/components/EyeDropper.d.ts +2 -2
- package/dist/excalidraw/components/FollowMode/FollowMode.d.ts +1 -1
- package/dist/excalidraw/components/FollowMode/FollowMode.js +1 -1
- package/dist/excalidraw/components/HelpDialog.js +8 -6
- package/dist/excalidraw/components/HintViewer.d.ts +1 -1
- package/dist/excalidraw/components/IconPicker.js +2 -2
- package/dist/excalidraw/components/ImageExportDialog.d.ts +1 -1
- package/dist/excalidraw/components/InitializeApp.d.ts +2 -2
- package/dist/excalidraw/components/JSONExportDialog.d.ts +3 -3
- package/dist/excalidraw/components/LayerUI.d.ts +4 -4
- package/dist/excalidraw/components/LayerUI.js +2 -2
- package/dist/excalidraw/components/LibraryMenu.d.ts +2 -2
- package/dist/excalidraw/components/LibraryMenuBrowseButton.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuHeaderContent.d.ts +2 -2
- package/dist/excalidraw/components/LibraryMenuItems.d.ts +1 -1
- package/dist/excalidraw/components/LibraryMenuSection.d.ts +5 -4
- package/dist/excalidraw/components/LibraryUnit.d.ts +2 -2
- package/dist/excalidraw/components/LoadingMessage.d.ts +1 -1
- package/dist/excalidraw/components/MagicSettings.js +2 -2
- package/dist/excalidraw/components/MobileMenu.d.ts +3 -3
- package/dist/excalidraw/components/MobileMenu.js +1 -1
- package/dist/excalidraw/components/Modal.d.ts +1 -1
- package/dist/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/excalidraw/components/PasteChartDialog.d.ts +1 -1
- package/dist/excalidraw/components/PasteChartDialog.js +1 -1
- package/dist/excalidraw/components/PublishLibrary.d.ts +1 -1
- package/dist/excalidraw/components/RadioGroup.d.ts +2 -1
- package/dist/excalidraw/components/RadioGroup.js +1 -1
- package/dist/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/Sidebar.d.ts +2 -2
- package/dist/excalidraw/components/Sidebar/Sidebar.js +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -1
- package/dist/excalidraw/components/Sidebar/common.d.ts +1 -1
- package/dist/excalidraw/components/Stack.d.ts +2 -2
- package/dist/excalidraw/components/Stats.d.ts +2 -2
- package/dist/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/MermaidToExcalidraw.js +6 -2
- package/dist/excalidraw/components/TTDDialog/TTDDialog.js +2 -2
- package/dist/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -1
- package/dist/excalidraw/components/TTDDialog/common.d.ts +4 -4
- package/dist/excalidraw/components/TextField.d.ts +1 -1
- package/dist/excalidraw/components/Toast.d.ts +1 -1
- package/dist/excalidraw/components/ToolButton.d.ts +4 -2
- package/dist/excalidraw/components/ToolButton.js +1 -1
- package/dist/excalidraw/components/Trans.d.ts +1 -1
- package/dist/excalidraw/components/UserList.d.ts +1 -1
- package/dist/excalidraw/components/canvases/InteractiveCanvas.d.ts +5 -3
- package/dist/excalidraw/components/canvases/InteractiveCanvas.js +5 -2
- package/dist/excalidraw/components/canvases/StaticCanvas.d.ts +2 -2
- package/dist/excalidraw/components/canvases/StaticCanvas.js +2 -2
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItem.js +2 -2
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +18 -0
- package/dist/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.js +9 -0
- package/dist/excalidraw/components/footer/Footer.d.ts +2 -2
- package/dist/excalidraw/components/hyperlink/Hyperlink.d.ts +2 -2
- package/dist/excalidraw/components/hyperlink/Hyperlink.js +3 -3
- package/dist/excalidraw/components/hyperlink/helpers.d.ts +3 -3
- package/dist/excalidraw/components/hyperlink/helpers.js +2 -3
- package/dist/excalidraw/components/icons.d.ts +6 -1
- package/dist/excalidraw/components/icons.js +23 -5
- package/dist/excalidraw/components/main-menu/DefaultItems.d.ts +12 -2
- package/dist/excalidraw/components/main-menu/DefaultItems.js +38 -7
- package/dist/excalidraw/constants.d.ts +6 -5
- package/dist/excalidraw/constants.js +11 -3
- package/dist/excalidraw/context/ui-appState.d.ts +1 -1
- package/dist/excalidraw/cursor.d.ts +1 -1
- package/dist/excalidraw/data/EditorLocalStorage.d.ts +2 -2
- package/dist/excalidraw/data/blob.d.ts +5 -5
- package/dist/excalidraw/data/filesystem.d.ts +2 -1
- package/dist/excalidraw/data/index.d.ts +4 -4
- package/dist/excalidraw/data/json.d.ts +3 -3
- package/dist/excalidraw/data/library.d.ts +3 -3
- package/dist/excalidraw/data/magic.d.ts +3 -3
- package/dist/excalidraw/data/magic.js +2 -1
- package/dist/excalidraw/data/reconcile.d.ts +6 -0
- package/dist/excalidraw/data/reconcile.js +49 -0
- package/dist/excalidraw/data/resave.d.ts +2 -2
- package/dist/excalidraw/data/restore.d.ts +5 -5
- package/dist/excalidraw/data/restore.js +9 -7
- package/dist/excalidraw/data/transform.d.ts +4 -4
- package/dist/excalidraw/data/transform.js +12 -3
- package/dist/excalidraw/data/types.d.ts +3 -3
- package/dist/excalidraw/data/url.d.ts +1 -0
- package/dist/excalidraw/data/url.js +4 -1
- package/dist/excalidraw/element/ElementCanvasButtons.d.ts +1 -1
- package/dist/excalidraw/element/binding.d.ts +50 -9
- package/dist/excalidraw/element/binding.js +712 -155
- package/dist/excalidraw/element/bounds.d.ts +3 -4
- package/dist/excalidraw/element/bounds.js +0 -3
- package/dist/excalidraw/element/collision.d.ts +14 -19
- package/dist/excalidraw/element/collision.js +36 -713
- package/dist/excalidraw/element/containerCache.d.ts +1 -1
- package/dist/excalidraw/element/dragElements.d.ts +4 -4
- package/dist/excalidraw/element/dragElements.js +27 -3
- package/dist/excalidraw/element/embeddable.d.ts +9 -6
- package/dist/excalidraw/element/embeddable.js +98 -62
- package/dist/excalidraw/element/image.d.ts +2 -2
- package/dist/excalidraw/element/index.d.ts +2 -3
- package/dist/excalidraw/element/index.js +1 -2
- package/dist/excalidraw/element/linearElementEditor.d.ts +12 -12
- package/dist/excalidraw/element/linearElementEditor.js +7 -5
- package/dist/excalidraw/element/mutateElement.d.ts +4 -5
- package/dist/excalidraw/element/mutateElement.js +5 -3
- package/dist/excalidraw/element/newElement.d.ts +6 -9
- package/dist/excalidraw/element/newElement.js +18 -15
- package/dist/excalidraw/element/resizeElements.d.ts +4 -4
- package/dist/excalidraw/element/resizeElements.js +172 -96
- package/dist/excalidraw/element/resizeTest.d.ts +7 -7
- package/dist/excalidraw/element/resizeTest.js +53 -8
- package/dist/excalidraw/element/showSelectedShapeActions.d.ts +2 -2
- package/dist/excalidraw/element/sizeHelpers.d.ts +2 -2
- package/dist/excalidraw/element/sizeHelpers.js +3 -0
- package/dist/excalidraw/element/sortElements.d.ts +1 -1
- package/dist/excalidraw/element/textElement.d.ts +6 -6
- package/dist/excalidraw/element/textElement.js +16 -37
- package/dist/excalidraw/element/textWysiwyg.d.ts +12 -6
- package/dist/excalidraw/element/textWysiwyg.js +38 -17
- package/dist/excalidraw/element/transformHandles.d.ts +24 -6
- package/dist/excalidraw/element/transformHandles.js +22 -11
- package/dist/excalidraw/element/typeChecks.d.ts +4 -4
- package/dist/excalidraw/element/types.d.ts +33 -10
- package/dist/excalidraw/emitter.d.ts +1 -1
- package/dist/excalidraw/errors.d.ts +3 -0
- package/dist/excalidraw/errors.js +3 -0
- package/dist/excalidraw/fractionalIndex.d.ts +40 -0
- package/dist/excalidraw/fractionalIndex.js +239 -0
- package/dist/excalidraw/frame.d.ts +4 -4
- package/dist/excalidraw/gatransforms.d.ts +1 -1
- package/dist/excalidraw/gesture.d.ts +1 -1
- package/dist/excalidraw/groups.d.ts +5 -3
- package/dist/excalidraw/groups.js +17 -0
- package/dist/excalidraw/history.d.ts +35 -47
- package/dist/excalidraw/history.js +100 -167
- package/dist/excalidraw/hooks/useCreatePortalContainer.js +2 -1
- package/dist/excalidraw/hooks/useEmitter.d.ts +2 -0
- package/dist/excalidraw/hooks/useEmitter.js +13 -0
- package/dist/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/excalidraw/i18n.d.ts +1 -1
- package/dist/excalidraw/index.d.ts +3 -1
- package/dist/excalidraw/index.js +2 -0
- package/dist/excalidraw/jotai.d.ts +1 -1
- package/dist/excalidraw/laser-trails.d.ts +3 -2
- package/dist/excalidraw/locales/en.json +8 -4
- package/dist/excalidraw/math.d.ts +2 -2
- package/dist/excalidraw/mermaid.d.ts +2 -0
- package/dist/excalidraw/mermaid.js +28 -0
- package/dist/excalidraw/points.d.ts +1 -1
- package/dist/excalidraw/queue.d.ts +1 -1
- package/dist/excalidraw/renderer/helpers.d.ts +2 -2
- package/dist/excalidraw/renderer/helpers.js +2 -2
- package/dist/excalidraw/renderer/interactiveScene.d.ts +2 -2
- package/dist/excalidraw/renderer/interactiveScene.js +38 -11
- package/dist/excalidraw/renderer/renderElement.d.ts +4 -4
- package/dist/excalidraw/renderer/renderElement.js +7 -7
- package/dist/excalidraw/renderer/renderSnaps.d.ts +1 -1
- package/dist/excalidraw/renderer/renderSnaps.js +2 -1
- package/dist/excalidraw/renderer/staticScene.d.ts +1 -1
- package/dist/excalidraw/renderer/staticScene.js +14 -3
- package/dist/excalidraw/renderer/staticSvgScene.d.ts +4 -4
- package/dist/excalidraw/renderer/staticSvgScene.js +10 -0
- package/dist/excalidraw/scene/Fonts.d.ts +2 -4
- package/dist/excalidraw/scene/Fonts.js +6 -12
- package/dist/excalidraw/scene/Renderer.d.ts +4 -4
- package/dist/excalidraw/scene/Renderer.js +2 -3
- package/dist/excalidraw/scene/Scene.d.ts +19 -12
- package/dist/excalidraw/scene/Scene.js +44 -23
- package/dist/excalidraw/scene/Shape.d.ts +1 -1
- package/dist/excalidraw/scene/ShapeCache.d.ts +4 -4
- package/dist/excalidraw/scene/comparisons.d.ts +2 -2
- package/dist/excalidraw/scene/export.d.ts +2 -2
- package/dist/excalidraw/scene/export.js +6 -5
- package/dist/excalidraw/scene/scroll.d.ts +2 -2
- package/dist/excalidraw/scene/scrollbars.d.ts +3 -3
- package/dist/excalidraw/scene/selection.d.ts +2 -2
- package/dist/excalidraw/scene/types.d.ts +7 -5
- package/dist/excalidraw/scene/zoom.d.ts +1 -1
- package/dist/excalidraw/snapping.d.ts +4 -4
- package/dist/excalidraw/snapping.js +2 -1
- package/dist/excalidraw/store.d.ts +129 -0
- package/dist/excalidraw/store.js +296 -0
- package/dist/excalidraw/types.d.ts +34 -19
- package/dist/excalidraw/utils.d.ts +11 -4
- package/dist/excalidraw/utils.js +8 -0
- package/dist/excalidraw/zindex.d.ts +4 -4
- package/dist/excalidraw/zindex.js +9 -13
- package/dist/prod/{en-II4GK66F.json → en-OIPCBIOA.json} +8 -4
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +44 -44
- package/dist/utils/bbox.d.ts +2 -2
- package/dist/utils/collision.d.ts +4 -0
- package/dist/utils/collision.js +48 -0
- package/dist/utils/export.d.ts +2 -2
- package/dist/utils/geometry/geometry.d.ts +71 -0
- package/dist/utils/geometry/geometry.js +674 -0
- package/dist/utils/geometry/shape.d.ts +56 -0
- package/dist/utils/geometry/shape.js +168 -0
- package/dist/utils/withinBounds.d.ts +1 -1
- package/history.ts +163 -218
- package/package.json +3 -2
- package/dist/browser/dev/excalidraw-assets-dev/chunk-AK7SWNLN.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/chunk-RWZVJAQU.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/chunk-Z3PH3V2B.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/dist-Z46EOVOL.js.map +0 -7
- package/dist/browser/dev/excalidraw-assets-dev/image-OFRRV5MB.css.map +0 -7
- package/dist/browser/prod/excalidraw-assets/chunk-LL4GORAM.js +0 -55
- package/dist/browser/prod/excalidraw-assets/dist-PIPZXALV.js +0 -6
- package/dist/browser/prod/excalidraw-assets/image-EFCJDJH3.js +0 -1
- /package/dist/browser/dev/excalidraw-assets-dev/{blockDiagram-91b80b7a-ACFH36JV.js.map → blockDiagram-91b80b7a-H47FTXHA.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{c4Diagram-b2a90758-QZ27YR47.js.map → c4Diagram-b2a90758-NNJK6GKC.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-HO2HMSK7.js.map → chunk-4KQVEBHW.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-USGV265L.js.map → chunk-53YI56GV.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-EDFX3S7X.js.map → chunk-A2WCJI4I.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-IX4V72YG.js.map → chunk-EFLPX7NE.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-MXVETLVM.js.map → chunk-JYIQCNWV.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-YZIOORVX.js.map → chunk-LVIQQW6F.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-6U7GQNJT.js.map → chunk-PXLO3FOU.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-7DACDEY3.js.map → chunk-TO2AW5PW.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-NJ77ZFNJ.js.map → chunk-VURILHLY.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{chunk-2T2GU7NF.js.map → chunk-ZAYGSUHF.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-30eddba6-QSLMH4JW.js.map → classDiagram-30eddba6-CUYIJICN.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{classDiagram-v2-f2df5561-DY4DYQ5P.js.map → classDiagram-v2-f2df5561-K6WW6K73.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{en-5TCZHGGJ.js.map → en-Y27YPU72.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{erDiagram-47591fe2-SOOJRTCB.js.map → erDiagram-47591fe2-XGAD7EEP.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-5540d9b9-AHGL4KPK.js.map → flowDiagram-5540d9b9-B6EOVNNO.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{flowDiagram-v2-3b53844e-56LDZZWY.js.map → flowDiagram-v2-3b53844e-NUG24FJH.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{flowchart-elk-definition-5fe447d6-27LUKRI6.js.map → flowchart-elk-definition-5fe447d6-25Y7PCBL.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{ganttDiagram-9a3bba1f-EHGYGNG6.js.map → ganttDiagram-9a3bba1f-GNL6ZDTC.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{gitGraphDiagram-96e6b4ee-AJQNBDW5.js.map → gitGraphDiagram-96e6b4ee-HNW52NVO.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{image-EDKQZH7Z.js.map → image-J7S3ALXP.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{infoDiagram-bcd20f53-SWLLQVES.js.map → infoDiagram-bcd20f53-FWEUVFLT.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{journeyDiagram-4fe6b3dc-7UAVCWOZ.js.map → journeyDiagram-4fe6b3dc-RZIUI7UG.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{mindmap-definition-f354de21-SROW5KGM.js.map → mindmap-definition-f354de21-GBVN45GU.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{pieDiagram-79897490-QKCI6NCB.js.map → pieDiagram-79897490-ECENNII6.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{quadrantDiagram-62f64e94-LNYJZFC5.js.map → quadrantDiagram-62f64e94-ZMEOFVNL.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{requirementDiagram-05bf5f74-ZZD7ZHFA.js.map → requirementDiagram-05bf5f74-FHZSFHCR.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{sankeyDiagram-97764748-L75ZZ4UM.js.map → sankeyDiagram-97764748-VDKIKTA6.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{sequenceDiagram-acc0e65c-6PCU7TDK.js.map → sequenceDiagram-acc0e65c-6JUSPVKX.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-0ff1cf1a-WM76WOPR.js.map → stateDiagram-0ff1cf1a-L3AKWENF.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{stateDiagram-v2-9a9d610d-N4HZW3O2.js.map → stateDiagram-v2-9a9d610d-NU3GGMCH.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{timeline-definition-fea2a41d-ZHGCAXGP.js.map → timeline-definition-fea2a41d-JGP7XCHW.js.map} +0 -0
- /package/dist/browser/dev/excalidraw-assets-dev/{xychartDiagram-ab372869-2DLOVRAZ.js.map → xychartDiagram-ab372869-HLFHHF2I.js.map} +0 -0
|
@@ -83,7 +83,7 @@ export const TrashIcon = createIcon(_jsx("path", { strokeWidth: "1.25", d: "M3.3
|
|
|
83
83
|
export const EmbedIcon = createIcon(_jsxs("g", { strokeWidth: "1.25", children: [_jsx("polyline", { points: "12 16 18 10 12 4" }), _jsx("polyline", { points: "8 4 2 10 8 16" })] }), modifiedTablerIconProps);
|
|
84
84
|
export const DuplicateIcon = createIcon(_jsxs("g", { strokeWidth: "1.25", children: [_jsx("path", { d: "M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z" }), _jsx("path", { clipRule: "evenodd", d: "M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z" })] }), modifiedTablerIconProps);
|
|
85
85
|
export const MoonIcon = createIcon(_jsx("path", { clipRule: "evenodd", d: "M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z", stroke: "currentColor" }), modifiedTablerIconProps);
|
|
86
|
-
export const SunIcon = createIcon(_jsx("g", { stroke: "currentColor",
|
|
86
|
+
export const SunIcon = createIcon(_jsx("g", { stroke: "currentColor", strokeLinejoin: "round", children: _jsx("path", { d: "M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667" }) }), { ...modifiedTablerIconProps, strokeWidth: 1.5 });
|
|
87
87
|
export const HamburgerMenuIcon = createIcon(_jsxs("g", { strokeWidth: "1.5", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("line", { x1: "4", y1: "6", x2: "20", y2: "6" }), _jsx("line", { x1: "4", y1: "12", x2: "20", y2: "12" }), _jsx("line", { x1: "4", y1: "18", x2: "20", y2: "18" })] }), tablerIconProps);
|
|
88
88
|
export const ExportIcon = createIcon(_jsx("path", { strokeWidth: "1.25", d: "M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10" }), modifiedTablerIconProps);
|
|
89
89
|
export const HelpIcon = createIcon(_jsxs("g", { strokeWidth: "1.5", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("circle", { cx: "12", cy: "12", r: "9" }), _jsx("line", { x1: "12", y1: "17", x2: "12", y2: "17.01" }), _jsx("path", { d: "M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4" })] }), tablerIconProps);
|
|
@@ -121,10 +121,22 @@ export const shareWindows = createIcon(_jsxs(_Fragment, { children: [_jsx("path"
|
|
|
121
121
|
// Icon imported form Storybook
|
|
122
122
|
// Storybook is licensed under MIT https://github.com/storybookjs/storybook/blob/next/LICENSE
|
|
123
123
|
export const resetZoom = createIcon(_jsx("path", { stroke: "currentColor", strokeWidth: "40", fill: "currentColor", d: "M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z" }), { width: 1024 });
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
export const
|
|
127
|
-
export const
|
|
124
|
+
const arrowBarToTopJSX = (_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M12 10l0 10" }), _jsx("path", { d: "M12 10l4 4" }), _jsx("path", { d: "M12 10l-4 4" }), _jsx("path", { d: "M4 4l16 0" })] }));
|
|
125
|
+
const arrownNarrowUpJSX = (_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M12 5l0 14" }), _jsx("path", { d: "M16 9l-4 -4" }), _jsx("path", { d: "M8 9l4 -4" })] }));
|
|
126
|
+
export const BringForwardIcon = createIcon(arrownNarrowUpJSX, tablerIconProps);
|
|
127
|
+
export const SendBackwardIcon = createIcon(arrownNarrowUpJSX, {
|
|
128
|
+
...tablerIconProps,
|
|
129
|
+
style: {
|
|
130
|
+
transform: "rotate(180deg)",
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
export const BringToFrontIcon = createIcon(arrowBarToTopJSX, tablerIconProps);
|
|
134
|
+
export const SendToBackIcon = createIcon(arrowBarToTopJSX, {
|
|
135
|
+
...tablerIconProps,
|
|
136
|
+
style: {
|
|
137
|
+
transform: "rotate(180deg)",
|
|
138
|
+
},
|
|
139
|
+
});
|
|
128
140
|
//
|
|
129
141
|
// Align action icons created from scratch to match those of z-index actions
|
|
130
142
|
// Note: vertical align icons are flipped so the larger item is always the
|
|
@@ -240,3 +252,9 @@ export const svgIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_js
|
|
|
240
252
|
export const pngIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M14 3v4a1 1 0 0 0 1 1h4" }), _jsx("path", { d: "M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4" }), _jsx("path", { d: "M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3" }), _jsx("path", { d: "M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6" }), _jsx("path", { d: "M11 21v-6l3 6v-6" })] }), tablerIconProps);
|
|
241
253
|
export const magnetIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0" }), _jsx("path", { d: "M4 8l5 0" }), _jsx("path", { d: "M15 8l4 0" })] }), tablerIconProps);
|
|
242
254
|
export const coffeeIcon = createIcon(_jsxs("g", { strokeWidth: 1.25, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1" }), _jsx("path", { d: "M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2" }), _jsx("path", { d: "M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2" }), _jsx("path", { d: "M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z" }), _jsx("path", { d: "M16.746 16.726a3 3 0 1 0 .252 -5.555" })] }), tablerIconProps);
|
|
255
|
+
export const DeviceDesktopIcon = createIcon(_jsxs("g", { stroke: "currentColor", children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4" })] }), { ...tablerIconProps, strokeWidth: 1.5 });
|
|
256
|
+
// login
|
|
257
|
+
export const loginIcon = createIcon(_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2" }), _jsx("path", { d: "M21 12h-13l3 -3" }), _jsx("path", { d: "M11 15l-3 -3" })] }), tablerIconProps);
|
|
258
|
+
export const youtubeIcon = createIcon(_jsxs("g", { children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z" }), _jsx("path", { d: "M10 9l5 3l-5 3z" })] }), tablerIconProps);
|
|
259
|
+
export const gridIcon = createIcon(_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M3 6h18" }), _jsx("path", { d: "M3 12h18" }), _jsx("path", { d: "M3 18h18" }), _jsx("path", { d: "M6 3v18" }), _jsx("path", { d: "M12 3v18" }), _jsx("path", { d: "M18 3v18" })] }), tablerIconProps);
|
|
260
|
+
export const lineEditorIcon = createIcon(_jsxs("g", { strokeWidth: 1.5, children: [_jsx("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), _jsx("path", { d: "M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z" }), _jsx("path", { d: "M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z" }), _jsx("path", { d: "M17 5c-6.627 0 -12 5.373 -12 12" })] }), tablerIconProps);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { Theme } from "../../element/types";
|
|
2
3
|
import "./DefaultItems.scss";
|
|
3
4
|
export declare const LoadScene: {
|
|
4
5
|
(): JSX.Element | null;
|
|
@@ -13,7 +14,9 @@ export declare const SaveAsImage: {
|
|
|
13
14
|
displayName: string;
|
|
14
15
|
};
|
|
15
16
|
export declare const CommandPalette: {
|
|
16
|
-
(
|
|
17
|
+
(opts?: {
|
|
18
|
+
className?: string;
|
|
19
|
+
}): JSX.Element;
|
|
17
20
|
displayName: string;
|
|
18
21
|
};
|
|
19
22
|
export declare const Help: {
|
|
@@ -25,7 +28,14 @@ export declare const ClearCanvas: {
|
|
|
25
28
|
displayName: string;
|
|
26
29
|
};
|
|
27
30
|
export declare const ToggleTheme: {
|
|
28
|
-
(
|
|
31
|
+
(props: {
|
|
32
|
+
allowSystemTheme: true;
|
|
33
|
+
theme: Theme | "system";
|
|
34
|
+
onSelect: (theme: Theme | "system") => void;
|
|
35
|
+
} | {
|
|
36
|
+
allowSystemTheme?: false | undefined;
|
|
37
|
+
onSelect?: ((theme: Theme) => void) | undefined;
|
|
38
|
+
}): JSX.Element | null;
|
|
29
39
|
displayName: string;
|
|
30
40
|
};
|
|
31
41
|
export declare const ChangeCanvasBackground: {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { getShortcutFromShortcutName } from "../../actions/shortcuts";
|
|
3
3
|
import { useI18n } from "../../i18n";
|
|
4
4
|
import { useExcalidrawSetAppState, useExcalidrawActionManager, useExcalidrawElements, useAppProps, } from "../App";
|
|
5
|
-
import { boltIcon, ExportIcon, ExportImageIcon, HelpIcon, LoadIcon, MoonIcon, save, SunIcon, TrashIcon, usersIcon, } from "../icons";
|
|
5
|
+
import { boltIcon, DeviceDesktopIcon, ExportIcon, ExportImageIcon, HelpIcon, LoadIcon, MoonIcon, save, SunIcon, TrashIcon, usersIcon, } from "../icons";
|
|
6
6
|
import { GithubIcon, DiscordIcon, XBrandIcon } from "../icons";
|
|
7
7
|
import DropdownMenuItem from "../dropdownMenu/DropdownMenuItem";
|
|
8
8
|
import DropdownMenuItemLink from "../dropdownMenu/DropdownMenuItemLink";
|
|
@@ -14,6 +14,9 @@ import { jotaiScope } from "../../jotai";
|
|
|
14
14
|
import { useUIAppState } from "../../context/ui-appState";
|
|
15
15
|
import { openConfirmModal } from "../OverwriteConfirm/OverwriteConfirmState";
|
|
16
16
|
import Trans from "../Trans";
|
|
17
|
+
import DropdownMenuItemContentRadio from "../dropdownMenu/DropdownMenuItemContentRadio";
|
|
18
|
+
import { THEME } from "../../constants";
|
|
19
|
+
import { trackEvent } from "../../analytics";
|
|
17
20
|
import "./DefaultItems.scss";
|
|
18
21
|
export const LoadScene = () => {
|
|
19
22
|
const { t } = useI18n();
|
|
@@ -51,10 +54,13 @@ export const SaveAsImage = () => {
|
|
|
51
54
|
return (_jsx(DropdownMenuItem, { icon: ExportImageIcon, "data-testid": "image-export-button", onSelect: () => setAppState({ openDialog: { name: "imageExport" } }), shortcut: getShortcutFromShortcutName("imageExport"), "aria-label": t("buttons.exportImage"), children: t("buttons.exportImage") }));
|
|
52
55
|
};
|
|
53
56
|
SaveAsImage.displayName = "SaveAsImage";
|
|
54
|
-
export const CommandPalette = () => {
|
|
57
|
+
export const CommandPalette = (opts) => {
|
|
55
58
|
const setAppState = useExcalidrawSetAppState();
|
|
56
59
|
const { t } = useI18n();
|
|
57
|
-
return (_jsx(DropdownMenuItem, { icon: boltIcon, "data-testid": "command-palette-button", onSelect: () =>
|
|
60
|
+
return (_jsx(DropdownMenuItem, { icon: boltIcon, "data-testid": "command-palette-button", onSelect: () => {
|
|
61
|
+
trackEvent("command_palette", "open", "menu");
|
|
62
|
+
setAppState({ openDialog: { name: "commandPalette" } });
|
|
63
|
+
}, shortcut: getShortcutFromShortcutName("commandPalette"), "aria-label": t("commandPalette.title"), className: opts?.className, children: t("commandPalette.title") }));
|
|
58
64
|
};
|
|
59
65
|
CommandPalette.displayName = "CommandPalette";
|
|
60
66
|
export const Help = () => {
|
|
@@ -73,20 +79,45 @@ export const ClearCanvas = () => {
|
|
|
73
79
|
return (_jsx(DropdownMenuItem, { icon: TrashIcon, onSelect: () => setActiveConfirmDialog("clearCanvas"), "data-testid": "clear-canvas-button", "aria-label": t("buttons.clearReset"), children: t("buttons.clearReset") }));
|
|
74
80
|
};
|
|
75
81
|
ClearCanvas.displayName = "ClearCanvas";
|
|
76
|
-
export const ToggleTheme = () => {
|
|
82
|
+
export const ToggleTheme = (props) => {
|
|
77
83
|
const { t } = useI18n();
|
|
78
84
|
const appState = useUIAppState();
|
|
79
85
|
const actionManager = useExcalidrawActionManager();
|
|
86
|
+
const shortcut = getShortcutFromShortcutName("toggleTheme");
|
|
80
87
|
if (!actionManager.isActionEnabled(actionToggleTheme)) {
|
|
81
88
|
return null;
|
|
82
89
|
}
|
|
90
|
+
if (props?.allowSystemTheme) {
|
|
91
|
+
return (_jsx(DropdownMenuItemContentRadio, { name: "theme", value: props.theme, onChange: (value) => props.onSelect(value), choices: [
|
|
92
|
+
{
|
|
93
|
+
value: THEME.LIGHT,
|
|
94
|
+
label: SunIcon,
|
|
95
|
+
ariaLabel: `${t("buttons.lightMode")} - ${shortcut}`,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
value: THEME.DARK,
|
|
99
|
+
label: MoonIcon,
|
|
100
|
+
ariaLabel: `${t("buttons.darkMode")} - ${shortcut}`,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
value: "system",
|
|
104
|
+
label: DeviceDesktopIcon,
|
|
105
|
+
ariaLabel: t("buttons.systemMode"),
|
|
106
|
+
},
|
|
107
|
+
], children: t("labels.theme") }));
|
|
108
|
+
}
|
|
83
109
|
return (_jsx(DropdownMenuItem, { onSelect: (event) => {
|
|
84
110
|
// do not close the menu when changing theme
|
|
85
111
|
event.preventDefault();
|
|
86
|
-
|
|
87
|
-
|
|
112
|
+
if (props?.onSelect) {
|
|
113
|
+
props.onSelect(appState.theme === THEME.DARK ? THEME.LIGHT : THEME.DARK);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
return actionManager.executeAction(actionToggleTheme);
|
|
117
|
+
}
|
|
118
|
+
}, icon: appState.theme === THEME.DARK ? SunIcon : MoonIcon, "data-testid": "toggle-dark-mode", shortcut: shortcut, "aria-label": appState.theme === THEME.DARK
|
|
88
119
|
? t("buttons.lightMode")
|
|
89
|
-
: t("buttons.darkMode"), children: appState.theme ===
|
|
120
|
+
: t("buttons.darkMode"), children: appState.theme === THEME.DARK
|
|
90
121
|
? t("buttons.lightMode")
|
|
91
122
|
: t("buttons.darkMode") }));
|
|
92
123
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppProps } from "./types";
|
|
2
|
-
import { ExcalidrawElement, FontFamilyValues } from "./element/types";
|
|
1
|
+
import type { AppProps } from "./types";
|
|
2
|
+
import type { ExcalidrawElement, FontFamilyValues } from "./element/types";
|
|
3
3
|
export declare const isDarwin: boolean;
|
|
4
4
|
export declare const isWindows: boolean;
|
|
5
5
|
export declare const isAndroid: boolean;
|
|
@@ -10,6 +10,7 @@ export declare const isIOS: boolean;
|
|
|
10
10
|
export declare const isBrave: () => boolean;
|
|
11
11
|
export declare const supportsResizeObserver: boolean;
|
|
12
12
|
export declare const APP_NAME = "Excalidraw";
|
|
13
|
+
export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
|
|
13
14
|
export declare const DRAGGING_THRESHOLD = 10;
|
|
14
15
|
export declare const LINE_CONFIRM_THRESHOLD = 8;
|
|
15
16
|
export declare const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
|
|
@@ -121,6 +122,8 @@ export declare const DEFAULT_TEXT_ALIGN = "left";
|
|
|
121
122
|
export declare const DEFAULT_VERTICAL_ALIGN = "top";
|
|
122
123
|
export declare const DEFAULT_VERSION = "{version}";
|
|
123
124
|
export declare const DEFAULT_TRANSFORM_HANDLE_SPACING = 2;
|
|
125
|
+
export declare const SIDE_RESIZING_THRESHOLD: number;
|
|
126
|
+
export declare const DEFAULT_COLLISION_THRESHOLD: number;
|
|
124
127
|
export declare const COLOR_WHITE = "#ffffff";
|
|
125
128
|
export declare const COLOR_CHARCOAL_BLACK = "#1e1e1e";
|
|
126
129
|
export declare const COLOR_VOICE_CALL = "#a2f1a6";
|
|
@@ -175,6 +178,7 @@ export declare const VERSION_TIMEOUT = 30000;
|
|
|
175
178
|
export declare const SCROLL_TIMEOUT = 100;
|
|
176
179
|
export declare const ZOOM_STEP = 0.1;
|
|
177
180
|
export declare const MIN_ZOOM = 0.1;
|
|
181
|
+
export declare const MAX_ZOOM = 30;
|
|
178
182
|
export declare const HYPERLINK_TOOLTIP_DELAY = 300;
|
|
179
183
|
export declare const IDLE_THRESHOLD = 60000;
|
|
180
184
|
export declare const ACTIVE_THRESHOLD = 3000;
|
|
@@ -223,9 +227,6 @@ export declare const ROUNDNESS: {
|
|
|
223
227
|
readonly PROPORTIONAL_RADIUS: 2;
|
|
224
228
|
readonly ADAPTIVE_RADIUS: 3;
|
|
225
229
|
};
|
|
226
|
-
/** key containt id of precedeing elemnt id we use in reconciliation during
|
|
227
|
-
* collaboration */
|
|
228
|
-
export declare const PRECEDING_ELEMENT_KEY = "__precedingElement__";
|
|
229
230
|
export declare const ROUGHNESS: {
|
|
230
231
|
readonly architect: 0;
|
|
231
232
|
readonly artist: 1;
|
|
@@ -15,6 +15,11 @@ export const isIOS = /iPad|iPhone/.test(navigator.platform) ||
|
|
|
15
15
|
export const isBrave = () => navigator.brave?.isBrave?.name === "isBrave";
|
|
16
16
|
export const supportsResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
|
|
17
17
|
export const APP_NAME = "Excalidraw";
|
|
18
|
+
// distance when creating text before it's considered `autoResize: false`
|
|
19
|
+
// we're using higher threshold so that clicks that end up being drags
|
|
20
|
+
// don't unintentionally create text elements that are wrapped to a few chars
|
|
21
|
+
// (happens a lot with fast clicks with the text tool)
|
|
22
|
+
export const TEXT_AUTOWRAP_THRESHOLD = 36; // px
|
|
18
23
|
export const DRAGGING_THRESHOLD = 10; // px
|
|
19
24
|
export const LINE_CONFIRM_THRESHOLD = 8; // px
|
|
20
25
|
export const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
|
|
@@ -128,6 +133,11 @@ export const DEFAULT_TEXT_ALIGN = "left";
|
|
|
128
133
|
export const DEFAULT_VERTICAL_ALIGN = "top";
|
|
129
134
|
export const DEFAULT_VERSION = "{version}";
|
|
130
135
|
export const DEFAULT_TRANSFORM_HANDLE_SPACING = 2;
|
|
136
|
+
export const SIDE_RESIZING_THRESHOLD = 2 * DEFAULT_TRANSFORM_HANDLE_SPACING;
|
|
137
|
+
// a small epsilon to make side resizing always take precedence
|
|
138
|
+
// (avoids an increase in renders and changes to tests)
|
|
139
|
+
const EPSILON = 0.00001;
|
|
140
|
+
export const DEFAULT_COLLISION_THRESHOLD = 2 * SIDE_RESIZING_THRESHOLD - EPSILON;
|
|
131
141
|
export const COLOR_WHITE = "#ffffff";
|
|
132
142
|
export const COLOR_CHARCOAL_BLACK = "#1e1e1e";
|
|
133
143
|
// keep this in sync with CSS
|
|
@@ -180,6 +190,7 @@ export const VERSION_TIMEOUT = 30000;
|
|
|
180
190
|
export const SCROLL_TIMEOUT = 100;
|
|
181
191
|
export const ZOOM_STEP = 0.1;
|
|
182
192
|
export const MIN_ZOOM = 0.1;
|
|
193
|
+
export const MAX_ZOOM = 30.0;
|
|
183
194
|
export const HYPERLINK_TOOLTIP_DELAY = 300;
|
|
184
195
|
// Report a user inactive after IDLE_THRESHOLD milliseconds
|
|
185
196
|
export const IDLE_THRESHOLD = 60_000;
|
|
@@ -264,9 +275,6 @@ export const ROUNDNESS = {
|
|
|
264
275
|
// (see DEFAULT_ADAPTIVE_RADIUS constant)
|
|
265
276
|
ADAPTIVE_RADIUS: 3,
|
|
266
277
|
};
|
|
267
|
-
/** key containt id of precedeing elemnt id we use in reconciliation during
|
|
268
|
-
* collaboration */
|
|
269
|
-
export const PRECEDING_ELEMENT_KEY = "__precedingElement__";
|
|
270
278
|
export const ROUGHNESS = {
|
|
271
279
|
architect: 0,
|
|
272
280
|
artist: 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppState } from "./types";
|
|
1
|
+
import type { AppState } from "./types";
|
|
2
2
|
export declare const resetCursor: (interactiveCanvas: HTMLCanvasElement | null) => void;
|
|
3
3
|
export declare const setCursor: (interactiveCanvas: HTMLCanvasElement | null, cursor: string) => void;
|
|
4
4
|
export declare const setEraserCursor: (interactiveCanvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EDITOR_LS_KEYS } from "../constants";
|
|
2
|
-
import { JSONValue } from "../types";
|
|
1
|
+
import type { EDITOR_LS_KEYS } from "../constants";
|
|
2
|
+
import type { JSONValue } from "../types";
|
|
3
3
|
export declare class EditorLocalStorage {
|
|
4
4
|
static has(key: typeof EDITOR_LS_KEYS[keyof typeof EDITOR_LS_KEYS]): boolean;
|
|
5
5
|
static get<T extends JSONValue>(key: typeof EDITOR_LS_KEYS[keyof typeof EDITOR_LS_KEYS]): T | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IMAGE_MIME_TYPES, MIME_TYPES } from "../constants";
|
|
2
|
-
import { ExcalidrawElement, FileId } from "../element/types";
|
|
3
|
-
import { AppState, DataURL, LibraryItem } from "../types";
|
|
4
|
-
import { ValueOf } from "../utility-types";
|
|
5
|
-
import { FileSystemHandle } from "./filesystem";
|
|
6
|
-
import { ImportedLibraryData } from "./types";
|
|
2
|
+
import type { ExcalidrawElement, FileId } from "../element/types";
|
|
3
|
+
import type { AppState, DataURL, LibraryItem } from "../types";
|
|
4
|
+
import type { ValueOf } from "../utility-types";
|
|
5
|
+
import type { FileSystemHandle } from "./filesystem";
|
|
6
|
+
import type { ImportedLibraryData } from "./types";
|
|
7
7
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
8
8
|
export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
|
|
9
9
|
export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FileSystemHandle
|
|
1
|
+
import type { FileSystemHandle } from "browser-fs-access";
|
|
2
|
+
import { supported as nativeFileSystemSupported } from "browser-fs-access";
|
|
2
3
|
import { MIME_TYPES } from "../constants";
|
|
3
4
|
type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
|
|
4
5
|
export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
2
|
-
import { ExportType } from "../scene/types";
|
|
3
|
-
import { AppState, BinaryFiles } from "../types";
|
|
4
|
-
import { FileSystemHandle } from "./filesystem";
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { ExportType } from "../scene/types";
|
|
3
|
+
import type { AppState, BinaryFiles } from "../types";
|
|
4
|
+
import type { FileSystemHandle } from "./filesystem";
|
|
5
5
|
export { loadFromBlob } from "./blob";
|
|
6
6
|
export { loadFromJSON, saveAsJSON } from "./json";
|
|
7
7
|
export type ExportedElements = readonly NonDeletedExcalidrawElement[] & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ExcalidrawElement } from "../element/types";
|
|
2
|
-
import { AppState, BinaryFiles, LibraryItems } from "../types";
|
|
3
|
-
import { ImportedDataState, ImportedLibraryData } from "./types";
|
|
1
|
+
import type { ExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppState, BinaryFiles, LibraryItems } from "../types";
|
|
3
|
+
import type { ImportedDataState, ImportedLibraryData } from "./types";
|
|
4
4
|
export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial<AppState>, files: BinaryFiles, type: "local" | "database") => string;
|
|
5
5
|
export declare const saveAsJSON: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles, name?: string) => Promise<{
|
|
6
6
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource, LibraryItems_anyVersion } from "../types";
|
|
1
|
+
import type { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource, LibraryItems_anyVersion } from "../types";
|
|
2
2
|
import type App from "../components/App";
|
|
3
|
-
import { ExcalidrawElement } from "../element/types";
|
|
4
|
-
import { MaybePromise } from "../utility-types";
|
|
3
|
+
import type { ExcalidrawElement } from "../element/types";
|
|
4
|
+
import type { MaybePromise } from "../utility-types";
|
|
5
5
|
export type LibraryPersistedData = {
|
|
6
6
|
libraryItems: LibraryItems;
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Theme } from "../element/types";
|
|
2
|
-
import { DataURL } from "../types";
|
|
3
|
-
import { OpenAIOutput } from "./ai/types";
|
|
1
|
+
import type { Theme } from "../element/types";
|
|
2
|
+
import type { DataURL } from "../types";
|
|
3
|
+
import type { OpenAIOutput } from "./ai/types";
|
|
4
4
|
export type MagicCacheData = {
|
|
5
5
|
status: "pending";
|
|
6
6
|
} | {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { THEME } from "../constants";
|
|
1
2
|
const SYSTEM_PROMPT = `You are a skilled front-end developer who builds interactive prototypes from wireframes, and is an expert at CSS Grid and Flex design.
|
|
2
3
|
Your role is to transform low-fidelity wireframes into working front-end HTML code.
|
|
3
4
|
|
|
@@ -19,7 +20,7 @@ If the wireframes, diagrams, or text is unclear or unreadable, refer to provided
|
|
|
19
20
|
Your goal is a production-ready prototype that brings the wireframes to life.
|
|
20
21
|
|
|
21
22
|
Please output JUST THE HTML file containing your best attempt at implementing the provided wireframes.`;
|
|
22
|
-
export async function diagramToHTML({ image, apiKey, text, theme =
|
|
23
|
+
export async function diagramToHTML({ image, apiKey, text, theme = THEME.LIGHT, }) {
|
|
23
24
|
const body = {
|
|
24
25
|
model: "gpt-4-vision-preview",
|
|
25
26
|
// 4096 are max output tokens allowed for `gpt-4-vision-preview` currently
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OrderedExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppState } from "../types";
|
|
3
|
+
import type { MakeBrand } from "../utility-types";
|
|
4
|
+
export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
|
|
5
|
+
export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
|
|
6
|
+
export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { orderByFractionalIndex, syncInvalidIndices } from "../fractionalIndex";
|
|
2
|
+
import { arrayToMap } from "../utils";
|
|
3
|
+
const shouldDiscardRemoteElement = (localAppState, local, remote) => {
|
|
4
|
+
if (local &&
|
|
5
|
+
// local element is being edited
|
|
6
|
+
(local.id === localAppState.editingElement?.id ||
|
|
7
|
+
local.id === localAppState.resizingElement?.id ||
|
|
8
|
+
local.id === localAppState.draggingElement?.id || // TODO: Is this still valid? As draggingElement is selection element, which is never part of the elements array
|
|
9
|
+
// local element is newer
|
|
10
|
+
local.version > remote.version ||
|
|
11
|
+
// resolve conflicting edits deterministically by taking the one with
|
|
12
|
+
// the lowest versionNonce
|
|
13
|
+
(local.version === remote.version &&
|
|
14
|
+
local.versionNonce < remote.versionNonce))) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
};
|
|
19
|
+
export const reconcileElements = (localElements, remoteElements, localAppState) => {
|
|
20
|
+
const localElementsMap = arrayToMap(localElements);
|
|
21
|
+
const reconciledElements = [];
|
|
22
|
+
const added = new Set();
|
|
23
|
+
// process remote elements
|
|
24
|
+
for (const remoteElement of remoteElements) {
|
|
25
|
+
if (!added.has(remoteElement.id)) {
|
|
26
|
+
const localElement = localElementsMap.get(remoteElement.id);
|
|
27
|
+
const discardRemoteElement = shouldDiscardRemoteElement(localAppState, localElement, remoteElement);
|
|
28
|
+
if (localElement && discardRemoteElement) {
|
|
29
|
+
reconciledElements.push(localElement);
|
|
30
|
+
added.add(localElement.id);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
reconciledElements.push(remoteElement);
|
|
34
|
+
added.add(remoteElement.id);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// process remaining local elements
|
|
39
|
+
for (const localElement of localElements) {
|
|
40
|
+
if (!added.has(localElement.id)) {
|
|
41
|
+
reconciledElements.push(localElement);
|
|
42
|
+
added.add(localElement.id);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const orderedElements = orderByFractionalIndex(reconciledElements);
|
|
46
|
+
// de-duplicate indices
|
|
47
|
+
syncInvalidIndices(orderedElements);
|
|
48
|
+
return orderedElements;
|
|
49
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExcalidrawElement } from "../element/types";
|
|
2
|
-
import { AppState, BinaryFiles } from "../types";
|
|
1
|
+
import type { ExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppState, BinaryFiles } from "../types";
|
|
3
3
|
export declare const resaveAsImageWithScene: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles, name: string) => Promise<{
|
|
4
4
|
fileHandle: import("browser-fs-access").FileSystemHandle;
|
|
5
5
|
}>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ExcalidrawElement } from "../element/types";
|
|
2
|
-
import { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
|
-
import { ImportedDataState } from "./types";
|
|
1
|
+
import type { ExcalidrawElement, OrderedExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
|
+
import type { ImportedDataState } from "./types";
|
|
4
4
|
type RestoredAppState = Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
5
5
|
export declare const AllowedExcalidrawActiveTools: Record<AppState["activeTool"]["type"], boolean>;
|
|
6
6
|
export type RestoredDataState = {
|
|
7
|
-
elements:
|
|
7
|
+
elements: OrderedExcalidrawElement[];
|
|
8
8
|
appState: RestoredAppState;
|
|
9
9
|
files: BinaryFiles;
|
|
10
10
|
};
|
|
11
11
|
export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined, opts?: {
|
|
12
12
|
refreshDimensions?: boolean;
|
|
13
13
|
repairBindings?: boolean;
|
|
14
|
-
} | undefined) =>
|
|
14
|
+
} | undefined) => OrderedExcalidrawElement[];
|
|
15
15
|
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
16
16
|
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined, elementsConfig?: {
|
|
17
17
|
refreshDimensions?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getNonDeletedElements, getNormalizedDimensions, isInvisiblySmallElement, refreshTextDimensions, } from "../element";
|
|
2
2
|
import { isTextElement, isUsingAdaptiveRadius } from "../element/typeChecks";
|
|
3
3
|
import { randomId } from "../random";
|
|
4
|
-
import { DEFAULT_FONT_FAMILY, DEFAULT_TEXT_ALIGN, DEFAULT_VERTICAL_ALIGN,
|
|
4
|
+
import { DEFAULT_FONT_FAMILY, DEFAULT_TEXT_ALIGN, DEFAULT_VERTICAL_ALIGN, FONT_FAMILY, ROUNDNESS, DEFAULT_SIDEBAR, DEFAULT_ELEMENT_PROPS, } from "../constants";
|
|
5
5
|
import { getDefaultAppState } from "../appState";
|
|
6
6
|
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
7
7
|
import { bumpVersion } from "../element/mutateElement";
|
|
@@ -9,6 +9,8 @@ import { getUpdatedTimestamp, updateActiveTool } from "../utils";
|
|
|
9
9
|
import { arrayToMap } from "../utils";
|
|
10
10
|
import { detectLineHeight, getContainerElement, getDefaultLineHeight, } from "../element/textElement";
|
|
11
11
|
import { normalizeLink } from "./url";
|
|
12
|
+
import { syncInvalidIndices } from "../fractionalIndex";
|
|
13
|
+
import { getSizeFromPoints } from "../points";
|
|
12
14
|
export const AllowedExcalidrawActiveTools = {
|
|
13
15
|
selection: true,
|
|
14
16
|
text: true,
|
|
@@ -46,6 +48,7 @@ const restoreElementWithProperties = (element, extra) => {
|
|
|
46
48
|
// newly added elements
|
|
47
49
|
version: element.version || 1,
|
|
48
50
|
versionNonce: element.versionNonce ?? 0,
|
|
51
|
+
index: element.index ?? null,
|
|
49
52
|
isDeleted: element.isDeleted ?? false,
|
|
50
53
|
id: element.id || randomId(),
|
|
51
54
|
fillStyle: element.fillStyle || DEFAULT_ELEMENT_PROPS.fillStyle,
|
|
@@ -85,9 +88,6 @@ const restoreElementWithProperties = (element, extra) => {
|
|
|
85
88
|
base.customData =
|
|
86
89
|
"customData" in extra ? extra.customData : element.customData;
|
|
87
90
|
}
|
|
88
|
-
if (PRECEDING_ELEMENT_KEY in element) {
|
|
89
|
-
base[PRECEDING_ELEMENT_KEY] = element[PRECEDING_ELEMENT_KEY];
|
|
90
|
-
}
|
|
91
91
|
return {
|
|
92
92
|
...base,
|
|
93
93
|
...getNormalizedDimensions(base),
|
|
@@ -125,6 +125,7 @@ const restoreElement = (element) => {
|
|
|
125
125
|
verticalAlign: element.verticalAlign || DEFAULT_VERTICAL_ALIGN,
|
|
126
126
|
containerId: element.containerId ?? null,
|
|
127
127
|
originalText: element.originalText || text,
|
|
128
|
+
autoResize: element.autoResize ?? true,
|
|
128
129
|
lineHeight,
|
|
129
130
|
});
|
|
130
131
|
// if empty text, mark as deleted. We keep in array
|
|
@@ -178,6 +179,7 @@ const restoreElement = (element) => {
|
|
|
178
179
|
points,
|
|
179
180
|
x,
|
|
180
181
|
y,
|
|
182
|
+
...getSizeFromPoints(points),
|
|
181
183
|
});
|
|
182
184
|
}
|
|
183
185
|
// generic elements
|
|
@@ -199,7 +201,7 @@ const restoreElement = (element) => {
|
|
|
199
201
|
return null;
|
|
200
202
|
};
|
|
201
203
|
/**
|
|
202
|
-
* Repairs
|
|
204
|
+
* Repairs container element's boundElements array by removing duplicates and
|
|
203
205
|
* fixing containerId of bound elements if not present. Also removes any
|
|
204
206
|
* bound elements that do not exist in the elements array.
|
|
205
207
|
*
|
|
@@ -275,7 +277,7 @@ localElements, opts) => {
|
|
|
275
277
|
// used to detect duplicate top-level element ids
|
|
276
278
|
const existingIds = new Set();
|
|
277
279
|
const localElementsMap = localElements ? arrayToMap(localElements) : null;
|
|
278
|
-
const restoredElements = (elements || []).reduce((elements, element) => {
|
|
280
|
+
const restoredElements = syncInvalidIndices((elements || []).reduce((elements, element) => {
|
|
279
281
|
// filtering out selection, which is legacy, no longer kept in elements,
|
|
280
282
|
// and causing issues if retained
|
|
281
283
|
if (element.type !== "selection" && !isInvisiblySmallElement(element)) {
|
|
@@ -293,7 +295,7 @@ localElements, opts) => {
|
|
|
293
295
|
}
|
|
294
296
|
}
|
|
295
297
|
return elements;
|
|
296
|
-
}, []);
|
|
298
|
+
}, []));
|
|
297
299
|
if (!opts?.repairBindings) {
|
|
298
300
|
return restoredElements;
|
|
299
301
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ElementConstructorOpts } from "../element/newElement";
|
|
2
|
-
import { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "../element/types";
|
|
3
|
-
import { MarkOptional } from "../utility-types";
|
|
1
|
+
import type { ElementConstructorOpts } from "../element/newElement";
|
|
2
|
+
import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "../element/types";
|
|
3
|
+
import type { MarkOptional } from "../utility-types";
|
|
4
4
|
export type ValidLinearElement = {
|
|
5
5
|
type: "arrow" | "line";
|
|
6
6
|
x: number;
|
|
@@ -78,4 +78,4 @@ export type ExcalidrawElementSkeleton = Extract<Exclude<ExcalidrawElement, Excal
|
|
|
78
78
|
} & Partial<ExcalidrawMagicFrameElement>);
|
|
79
79
|
export declare const convertToExcalidrawElements: (elementsSkeleton: ExcalidrawElementSkeleton[] | null, opts?: {
|
|
80
80
|
regenerateIds: boolean;
|
|
81
|
-
}) =>
|
|
81
|
+
}) => import("../element/types").OrderedExcalidrawElement[];
|
|
@@ -3,9 +3,10 @@ import { getCommonBounds, newElement, newLinearElement, redrawTextBoundingBox, }
|
|
|
3
3
|
import { bindLinearElement } from "../element/binding";
|
|
4
4
|
import { newFrameElement, newImageElement, newMagicFrameElement, newTextElement, } from "../element/newElement";
|
|
5
5
|
import { getDefaultLineHeight, measureText, normalizeText, } from "../element/textElement";
|
|
6
|
-
import { assertNever, cloneJSON, getFontString, toBrandedType } from "../utils";
|
|
6
|
+
import { arrayToMap, assertNever, cloneJSON, getFontString, toBrandedType, } from "../utils";
|
|
7
7
|
import { getSizeFromPoints } from "../points";
|
|
8
8
|
import { randomId } from "../random";
|
|
9
|
+
import { syncInvalidIndices } from "../fractionalIndex";
|
|
9
10
|
const DEFAULT_LINEAR_ELEMENT_PROPS = {
|
|
10
11
|
width: 100,
|
|
11
12
|
height: 0,
|
|
@@ -162,6 +163,14 @@ const bindLinearElementToElement = (linearElement, start, end, elementStore, ele
|
|
|
162
163
|
bindLinearElement(linearElement, endBoundElement, "end", elementsMap);
|
|
163
164
|
}
|
|
164
165
|
}
|
|
166
|
+
// Safe check to early return for single point
|
|
167
|
+
if (linearElement.points.length < 2) {
|
|
168
|
+
return {
|
|
169
|
+
linearElement,
|
|
170
|
+
startBoundElement,
|
|
171
|
+
endBoundElement,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
165
174
|
// Update start/end points by 0.5 so bindings don't overlap with start/end bound element coordinates.
|
|
166
175
|
const endPointIndex = linearElement.points.length - 1;
|
|
167
176
|
const delta = 0.5;
|
|
@@ -206,10 +215,10 @@ class ElementStore {
|
|
|
206
215
|
this.excalidrawElements.set(ele.id, ele);
|
|
207
216
|
};
|
|
208
217
|
getElements = () => {
|
|
209
|
-
return Array.from(this.excalidrawElements.values());
|
|
218
|
+
return syncInvalidIndices(Array.from(this.excalidrawElements.values()));
|
|
210
219
|
};
|
|
211
220
|
getElementsMap = () => {
|
|
212
|
-
return toBrandedType(this.
|
|
221
|
+
return toBrandedType(arrayToMap(this.getElements()));
|
|
213
222
|
};
|
|
214
223
|
getElement = (id) => {
|
|
215
224
|
return this.excalidrawElements.get(id);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ExcalidrawElement } from "../element/types";
|
|
2
|
-
import { AppState, BinaryFiles, LibraryItems, LibraryItems_anyVersion } from "../types";
|
|
1
|
+
import type { ExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppState, BinaryFiles, LibraryItems, LibraryItems_anyVersion } from "../types";
|
|
3
3
|
import type { cleanAppStateForExport } from "../appState";
|
|
4
|
-
import { VERSIONS } from "../constants";
|
|
4
|
+
import type { VERSIONS } from "../constants";
|
|
5
5
|
export interface ExportedDataState {
|
|
6
6
|
type: string;
|
|
7
7
|
version: number;
|