@dwelle/excalidraw 0.6.0-rc.1 → 0.6.0-rc.3
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/README.md +3 -4
- package/dist/dev/{chunk-EFVS2MI5.js → chunk-FCTATTEX.js} +2 -2
- package/dist/dev/{chunk-EFVS2MI5.js.map → chunk-FCTATTEX.js.map} +1 -1
- package/dist/dev/chunk-GPAPUEH7.js +25914 -0
- package/dist/dev/chunk-GPAPUEH7.js.map +7 -0
- package/dist/dev/data/image-KIZE4OBD.js +13 -0
- package/dist/dev/index.css.map +1 -1
- package/dist/dev/index.js +33243 -37
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/{chunk-P7457GAF.js → chunk-DZ7HA6XS.js} +1 -1
- package/dist/prod/chunk-TQDSDB2B.js +46 -0
- package/dist/prod/data/image-SCXWNX5A.js +1 -0
- package/dist/prod/index.js +108 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionAlign.d.ts +18 -18
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +31 -31
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +17 -17
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +5 -5
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionExport.d.ts +30 -30
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +9 -9
- package/dist/types/excalidraw/actions/actionGroup.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionLink.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionMenu.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionProperties.d.ts +31 -31
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionStyles.d.ts +5 -5
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionZindex.d.ts +14 -14
- package/dist/types/excalidraw/actions/manager.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +2 -2
- package/dist/types/excalidraw/appState.d.ts +9 -9
- package/dist/types/excalidraw/clipboard.d.ts +4 -4
- package/dist/types/excalidraw/components/Actions.d.ts +6 -7
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/App.d.ts +13 -3
- package/dist/types/excalidraw/components/Avatar.d.ts +1 -1
- package/dist/types/excalidraw/components/BraveMeasureTextError.d.ts +1 -2
- package/dist/types/excalidraw/components/Button.d.ts +1 -1
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -1
- package/dist/types/excalidraw/components/ButtonIconCycle.d.ts +2 -2
- package/dist/types/excalidraw/components/ButtonIconSelect.d.ts +2 -2
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +1 -2
- package/dist/types/excalidraw/components/ButtonSeparator.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -2
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -2
- package/dist/types/excalidraw/components/ConfirmDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/ContextMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -2
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/Dialog.d.ts +1 -1
- package/dist/types/excalidraw/components/DialogActionButton.d.ts +1 -1
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/FixedSideContainer.d.ts +1 -1
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +1 -2
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -2
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/HandButton.d.ts +1 -2
- package/dist/types/excalidraw/components/HelpButton.d.ts +1 -2
- package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/HintViewer.d.ts +1 -2
- package/dist/types/excalidraw/components/IconPicker.d.ts +2 -2
- package/dist/types/excalidraw/components/ImageExportDialog.d.ts +2 -3
- package/dist/types/excalidraw/components/InitializeApp.d.ts +1 -1
- package/dist/types/excalidraw/components/InlineIcon.d.ts +1 -2
- package/dist/types/excalidraw/components/JSONExportDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +1 -2
- package/dist/types/excalidraw/components/LayerUI.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +2 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +1 -2
- package/dist/types/excalidraw/components/MagicButton.d.ts +2 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +2 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +4 -4
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +6 -6
- package/dist/types/excalidraw/components/Paragraph.d.ts +1 -2
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/PenModeButton.d.ts +1 -2
- package/dist/types/excalidraw/components/Popover.d.ts +1 -1
- package/dist/types/excalidraw/components/ProjectName.d.ts +1 -2
- package/dist/types/excalidraw/components/PublishLibrary.d.ts +1 -2
- package/dist/types/excalidraw/components/RadioGroup.d.ts +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +1 -2
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -2
- package/dist/types/excalidraw/components/ScrollableList.d.ts +1 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -2
- package/dist/types/excalidraw/components/ShareableLinkDialog.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +6 -6
- package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/common.d.ts +1 -0
- package/dist/types/excalidraw/components/Spinner.d.ts +1 -2
- package/dist/types/excalidraw/components/Stack.d.ts +2 -3
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -2
- package/dist/types/excalidraw/components/Stats/index.d.ts +4 -4
- package/dist/types/excalidraw/components/Switch.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +2 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +2 -1
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +1 -1
- package/dist/types/excalidraw/components/Toast.d.ts +1 -1
- package/dist/types/excalidraw/components/Tooltip.d.ts +1 -1
- package/dist/types/excalidraw/components/UserList.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -2
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -2
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +11 -11
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +4 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +2 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +1 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -2
- package/dist/types/excalidraw/components/footer/Footer.d.ts +1 -2
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +1 -2
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +1 -2
- package/dist/types/excalidraw/components/icons.d.ts +178 -178
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +1 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +12 -13
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +9 -9
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +10 -10
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +3 -4
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +15 -15
- package/dist/types/excalidraw/constants.d.ts +1 -0
- package/dist/types/excalidraw/data/blob.d.ts +1 -1
- package/dist/types/excalidraw/element/ElementCanvasButtons.d.ts +1 -2
- package/dist/types/excalidraw/element/binding.d.ts +1 -2
- package/dist/types/excalidraw/element/collision.d.ts +10 -1
- package/dist/types/excalidraw/element/distance.d.ts +3 -0
- package/dist/types/excalidraw/element/embeddable.d.ts +1 -1
- package/dist/types/excalidraw/element/newElement.d.ts +1 -1
- package/dist/types/excalidraw/element/transformHandles.d.ts +2 -2
- package/dist/types/excalidraw/element/types.d.ts +1 -1
- package/dist/types/excalidraw/element/utils.d.ts +21 -0
- package/dist/types/excalidraw/fonts/FontMetadata.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +2 -4
- package/dist/types/excalidraw/shapes.d.ts +11 -12
- package/dist/types/excalidraw/store.d.ts +6 -6
- package/dist/types/excalidraw/types.d.ts +3 -2
- package/dist/types/excalidraw/utils.d.ts +3 -3
- package/dist/types/excalidraw/visualdebug.d.ts +7 -8
- package/dist/types/excalidraw/zindex.d.ts +2 -2
- package/dist/types/math/curve.d.ts +22 -14
- package/dist/types/math/ellipse.d.ts +44 -0
- package/dist/types/math/index.d.ts +1 -1
- package/dist/types/math/line.d.ts +2 -30
- package/dist/types/math/point.d.ts +1 -29
- package/dist/types/math/rectangle.d.ts +3 -0
- package/dist/types/math/segment.d.ts +8 -1
- package/dist/types/math/types.d.ts +15 -6
- package/dist/types/math/vector.d.ts +0 -4
- package/dist/types/utils/export.d.ts +1 -1
- package/package.json +6 -14
- package/dist/dev/chunk-637CAVTS.js +0 -57639
- package/dist/dev/chunk-637CAVTS.js.map +0 -7
- package/dist/dev/data/image-N6Y7BWW6.css +0 -6753
- package/dist/dev/data/image-N6Y7BWW6.css.map +0 -7
- package/dist/dev/data/image-QMQX6YR5.js +0 -15
- package/dist/prod/chunk-PEDHHNBJ.js +0 -153
- package/dist/prod/data/image-IP6M4LZC.js +0 -1
- package/dist/prod/data/image-KGQIL6Y4.css +0 -1
- package/dist/types/math/arc.d.ts +0 -6
- package/dist/types/math/ga/ga.d.ts +0 -63
- package/dist/types/math/ga/gadirections.d.ts +0 -8
- package/dist/types/math/ga/galines.d.ts +0 -22
- package/dist/types/math/ga/gapoints.d.ts +0 -7
- package/dist/types/math/ga/gatransforms.d.ts +0 -10
- /package/dist/dev/data/{image-QMQX6YR5.js.map → image-KIZE4OBD.js.map} +0 -0
|
@@ -3,61 +3,61 @@ import "./WelcomeScreen.scss";
|
|
|
3
3
|
declare const WelcomeScreen: {
|
|
4
4
|
(props: {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
|
-
}): JSX.Element;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
Center: {
|
|
9
9
|
({ children }: {
|
|
10
10
|
children?: import("react").ReactNode;
|
|
11
|
-
}): JSX.Element;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
displayName: string;
|
|
13
13
|
Logo: {
|
|
14
14
|
({ children }: {
|
|
15
15
|
children?: import("react").ReactNode;
|
|
16
|
-
}): JSX.Element;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
19
|
Heading: {
|
|
20
20
|
({ children }: {
|
|
21
21
|
children: import("react").ReactNode;
|
|
22
|
-
}): JSX.Element;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
Menu: {
|
|
26
26
|
({ children }: {
|
|
27
27
|
children?: import("react").ReactNode;
|
|
28
|
-
}): JSX.Element;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
displayName: string;
|
|
30
30
|
};
|
|
31
31
|
MenuItem: {
|
|
32
32
|
({ onSelect, children, icon, shortcut, className, ...props }: {
|
|
33
33
|
onSelect: () => void;
|
|
34
34
|
children: import("react").ReactNode;
|
|
35
|
-
icon?: JSX.Element | undefined;
|
|
35
|
+
icon?: import("react").JSX.Element | undefined;
|
|
36
36
|
shortcut?: string | null | undefined;
|
|
37
|
-
} & import("react").ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
37
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
displayName: string;
|
|
39
39
|
};
|
|
40
40
|
MenuItemLink: {
|
|
41
41
|
({ children, href, icon, shortcut, className, ...props }: {
|
|
42
42
|
children: import("react").ReactNode;
|
|
43
43
|
href: string;
|
|
44
|
-
icon?: JSX.Element | undefined;
|
|
44
|
+
icon?: import("react").JSX.Element | undefined;
|
|
45
45
|
shortcut?: string | null | undefined;
|
|
46
|
-
} & import("react").AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
46
|
+
} & import("react").AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
|
|
47
47
|
displayName: string;
|
|
48
48
|
};
|
|
49
49
|
MenuItemHelp: {
|
|
50
|
-
(): JSX.Element;
|
|
50
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
51
51
|
displayName: string;
|
|
52
52
|
};
|
|
53
53
|
MenuItemLoadScene: {
|
|
54
|
-
(): JSX.Element | null;
|
|
54
|
+
(): import("react/jsx-runtime").JSX.Element | null;
|
|
55
55
|
displayName: string;
|
|
56
56
|
};
|
|
57
57
|
MenuItemLiveCollaborationTrigger: {
|
|
58
58
|
({ onSelect, }: {
|
|
59
59
|
onSelect: () => any;
|
|
60
|
-
}): JSX.Element;
|
|
60
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
61
61
|
displayName: string;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
@@ -65,19 +65,19 @@ declare const WelcomeScreen: {
|
|
|
65
65
|
MenuHint: {
|
|
66
66
|
({ children }: {
|
|
67
67
|
children?: import("react").ReactNode;
|
|
68
|
-
}): JSX.Element;
|
|
68
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
69
69
|
displayName: string;
|
|
70
70
|
};
|
|
71
71
|
ToolbarHint: {
|
|
72
72
|
({ children }: {
|
|
73
73
|
children?: import("react").ReactNode;
|
|
74
|
-
}): JSX.Element;
|
|
74
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
75
75
|
displayName: string;
|
|
76
76
|
};
|
|
77
77
|
HelpHint: {
|
|
78
78
|
({ children }: {
|
|
79
79
|
children?: import("react").ReactNode;
|
|
80
|
-
}): JSX.Element;
|
|
80
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
81
81
|
displayName: string;
|
|
82
82
|
};
|
|
83
83
|
};
|
|
@@ -146,6 +146,7 @@ export declare const COLOR_WHITE = "#ffffff";
|
|
|
146
146
|
export declare const COLOR_CHARCOAL_BLACK = "#1e1e1e";
|
|
147
147
|
export declare const COLOR_TRANSPARENT = "transparent";
|
|
148
148
|
export declare const SIDE_RESIZING_THRESHOLD: number;
|
|
149
|
+
export declare const EPSILON = 0.00001;
|
|
149
150
|
export declare const DEFAULT_COLLISION_THRESHOLD: number;
|
|
150
151
|
export declare const COLOR_VOICE_CALL = "#a2f1a6";
|
|
151
152
|
export declare const CANVAS_ONLY_ACTIONS: string[];
|
|
@@ -6,7 +6,7 @@ import type { FileSystemHandle } from "./filesystem";
|
|
|
6
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
|
-
export declare const isImageFileHandleType: (type: string | null) => type is "
|
|
9
|
+
export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
|
|
10
10
|
export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
|
|
11
11
|
export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
|
|
12
12
|
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { ElementsMap, NonDeletedExcalidrawElement } from "./types";
|
|
3
2
|
import "./ElementCanvasButtons.scss";
|
|
4
3
|
export declare const ElementCanvasButtons: ({ children, element, elementsMap, }: {
|
|
5
4
|
children: React.ReactNode;
|
|
6
5
|
element: NonDeletedExcalidrawElement;
|
|
7
6
|
elementsMap: ElementsMap;
|
|
8
|
-
}) => JSX.Element | null;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -39,7 +39,7 @@ export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawE
|
|
|
39
39
|
changedElements?: Map<string, OrderedExcalidrawElement>;
|
|
40
40
|
}) => void;
|
|
41
41
|
export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, elementsMap: ElementsMap, origPoint: GlobalPoint, zoom?: AppState["zoom"]) => Heading;
|
|
42
|
-
export declare const bindPointToSnapToElementOutline: (
|
|
42
|
+
export declare const bindPointToSnapToElementOutline: (arrow: ExcalidrawElbowArrowElement, bindableElement: ExcalidrawBindableElement | undefined, startOrEnd: "start" | "end") => GlobalPoint;
|
|
43
43
|
export declare const avoidRectangularCorner: (element: ExcalidrawBindableElement, p: GlobalPoint) => GlobalPoint;
|
|
44
44
|
export declare const snapToMid: (element: ExcalidrawBindableElement, p: GlobalPoint, tolerance?: number) => GlobalPoint;
|
|
45
45
|
export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => {
|
|
@@ -52,7 +52,6 @@ export declare const bindingBorderTest: (element: NonDeleted<ExcalidrawBindableE
|
|
|
52
52
|
y: number;
|
|
53
53
|
}, elementsMap: NonDeletedSceneElementsMap, zoom?: AppState["zoom"], fullShape?: boolean) => boolean;
|
|
54
54
|
export declare const maxBindingGap: (element: ExcalidrawElement, elementWidth: number, elementHeight: number, zoom?: AppState["zoom"]) => number;
|
|
55
|
-
export declare const distanceToBindableElement: (element: ExcalidrawBindableElement, point: GlobalPoint, elementsMap: ElementsMap) => number;
|
|
56
55
|
export declare const bindingProperties: Set<BindableProp | BindingProp>;
|
|
57
56
|
export type BindableProp = "boundElements";
|
|
58
57
|
export type BindingProp = "frameId" | "containerId" | "startBinding" | "endBinding";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
2
2
|
import type { FrameNameBounds } from "../types";
|
|
3
3
|
import type { GeometricShape } from "@excalidraw/utils/geometry/shape";
|
|
4
|
-
import type { GlobalPoint, LocalPoint } from "@excalidraw/math";
|
|
4
|
+
import type { GlobalPoint, LineSegment, LocalPoint } from "@excalidraw/math";
|
|
5
5
|
export declare const shouldTestInside: (element: ExcalidrawElement) => boolean;
|
|
6
6
|
export type HitTestArgs<Point extends GlobalPoint | LocalPoint> = {
|
|
7
7
|
x: number;
|
|
@@ -15,3 +15,12 @@ export declare const hitElementItself: <Point extends GlobalPoint | LocalPoint>(
|
|
|
15
15
|
export declare const hitElementBoundingBox: (x: number, y: number, element: ExcalidrawElement, elementsMap: ElementsMap, tolerance?: number) => boolean;
|
|
16
16
|
export declare const hitElementBoundingBoxOnly: <Point extends GlobalPoint | LocalPoint>(hitArgs: HitTestArgs<Point>, elementsMap: ElementsMap) => boolean;
|
|
17
17
|
export declare const hitElementBoundText: <Point extends GlobalPoint | LocalPoint>(x: number, y: number, textShape: GeometricShape<Point> | null) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Intersect a line with an element for binding test
|
|
20
|
+
*
|
|
21
|
+
* @param element
|
|
22
|
+
* @param line
|
|
23
|
+
* @param offset
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export declare const intersectElementWithLineSegment: (element: ExcalidrawElement, line: LineSegment<GlobalPoint>, offset?: number) => GlobalPoint[];
|
|
@@ -52,7 +52,7 @@ export declare const newArrowElement: <T extends boolean>(opts: {
|
|
|
52
52
|
points?: readonly import("@excalidraw/math").LocalPoint[] | undefined;
|
|
53
53
|
elbowed?: T | undefined;
|
|
54
54
|
fixedSegments?: FixedSegment[] | null | undefined;
|
|
55
|
-
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "
|
|
55
|
+
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "angle" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "link" | "locked" | "customData"> & Partial<Pick<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "angle" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "link" | "locked" | "customData">>) => T extends true ? NonDeleted<ExcalidrawElbowArrowElement> : NonDeleted<ExcalidrawArrowElement>;
|
|
56
56
|
export declare const newImageElement: (opts: {
|
|
57
57
|
type: ExcalidrawImageElement["type"];
|
|
58
58
|
status?: ExcalidrawImageElement["status"];
|
|
@@ -31,8 +31,8 @@ export declare const OMIT_SIDES_FOR_FRAME: {
|
|
|
31
31
|
export declare const canResizeFromSides: (device: Device) => boolean;
|
|
32
32
|
export declare const getOmitSidesForDevice: (device: Device) => {};
|
|
33
33
|
export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [number, number, number, number, number, number], angle: Radians, zoom: Zoom, pointerType: PointerType, omitSides?: {
|
|
34
|
-
e?: boolean | undefined;
|
|
35
34
|
s?: boolean | undefined;
|
|
35
|
+
e?: boolean | undefined;
|
|
36
36
|
w?: boolean | undefined;
|
|
37
37
|
n?: boolean | undefined;
|
|
38
38
|
nw?: boolean | undefined;
|
|
@@ -42,8 +42,8 @@ export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [
|
|
|
42
42
|
rotation?: boolean | undefined;
|
|
43
43
|
}, margin?: number, spacing?: number) => TransformHandles;
|
|
44
44
|
export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoom, elementsMap: ElementsMap, pointerType?: PointerType, omitSides?: {
|
|
45
|
-
e?: boolean | undefined;
|
|
46
45
|
s?: boolean | undefined;
|
|
46
|
+
e?: boolean | undefined;
|
|
47
47
|
w?: boolean | undefined;
|
|
48
48
|
n?: boolean | undefined;
|
|
49
49
|
nw?: boolean | undefined;
|
|
@@ -228,7 +228,7 @@ export type ExcalidrawElbowArrowElement = Merge<ExcalidrawArrowElement, {
|
|
|
228
228
|
elbowed: true;
|
|
229
229
|
startBinding: FixedPointBinding | null;
|
|
230
230
|
endBinding: FixedPointBinding | null;
|
|
231
|
-
fixedSegments: FixedSegment[] | null;
|
|
231
|
+
fixedSegments: readonly FixedSegment[] | null;
|
|
232
232
|
/**
|
|
233
233
|
* Marks that the 3rd point should be used as the 2nd point of the arrow in
|
|
234
234
|
* order to temporarily hide the first segment of the arrow without losing
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Curve, LineSegment } from "@excalidraw/math";
|
|
2
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
3
|
+
import type { ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Get the building components of a rectanguloid element in the form of
|
|
6
|
+
* line segments and curves.
|
|
7
|
+
*
|
|
8
|
+
* @param element Target rectanguloid element
|
|
9
|
+
* @param offset Optional offset to expand the rectanguloid shape
|
|
10
|
+
* @returns Tuple of line segments (0) and curves (1)
|
|
11
|
+
*/
|
|
12
|
+
export declare function deconstructRectanguloidElement(element: ExcalidrawRectanguloidElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
|
|
13
|
+
/**
|
|
14
|
+
* Get the building components of a diamond element in the form of
|
|
15
|
+
* line segments and curves as a tuple, in this order.
|
|
16
|
+
*
|
|
17
|
+
* @param element The element to deconstruct
|
|
18
|
+
* @param offset An optional offset
|
|
19
|
+
* @returns Tuple of line segments (0) and curves (1)
|
|
20
|
+
*/
|
|
21
|
+
export declare function deconstructDiamondElement(element: ExcalidrawDiamondElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare function useOutsideClick<T extends HTMLElement>(ref: React.RefObject<T>,
|
|
2
|
+
export declare function useOutsideClick<T extends HTMLElement>(ref: React.RefObject<T | null>,
|
|
3
3
|
/** if performance is of concern, memoize the callback */
|
|
4
4
|
callback: (event: Event) => void,
|
|
5
5
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const useScrollPosition: <T extends HTMLElement>(elementRef: import("react").RefObject<T>) => number;
|
|
2
|
+
export declare const useScrollPosition: <T extends HTMLElement>(elementRef: import("react").RefObject<T | null>) => number;
|
|
@@ -3,12 +3,11 @@ import "./css/app.scss";
|
|
|
3
3
|
import "./css/styles.scss";
|
|
4
4
|
import "./fonts/fonts.css";
|
|
5
5
|
import type { ExcalidrawProps } from "./types";
|
|
6
|
-
import { editorJotaiStore } from "./editor-jotai";
|
|
7
6
|
import Footer from "./components/footer/FooterCenter";
|
|
8
7
|
import MainMenu from "./components/main-menu/MainMenu";
|
|
9
8
|
import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
|
|
10
9
|
import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
|
|
11
|
-
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => JSX.Element>;
|
|
10
|
+
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
11
|
export { getSceneVersion, hashElementsVersion, hashString, isInvisiblySmallElement, getNonDeletedElements, getTextFromElements, } from "./element";
|
|
13
12
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
14
13
|
export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
@@ -21,7 +20,7 @@ export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
|
21
20
|
export { isLinearElement } from "./element/typeChecks";
|
|
22
21
|
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, } from "./constants";
|
|
23
22
|
export { mutateElement, newElementWith, bumpVersion, } from "./element/mutateElement";
|
|
24
|
-
export {
|
|
23
|
+
export { CaptureUpdateAction } from "./store";
|
|
25
24
|
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
26
25
|
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "./utils";
|
|
27
26
|
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
@@ -46,7 +45,6 @@ export { getDataURL } from "./data/blob";
|
|
|
46
45
|
export { isElementLink } from "./element/elementLink";
|
|
47
46
|
export { setCustomTextMetricsProvider } from "./element/textMeasurements";
|
|
48
47
|
export { getDefaultAppState, cleanAppStateForExport, clearAppStateForLocalStorage, } from "./appState";
|
|
49
|
-
export { editorJotaiStore };
|
|
50
48
|
export { libraryItemsAtom } from "./data/library";
|
|
51
49
|
export * as icons from "./components/icons";
|
|
52
50
|
export * as actions from "./actions/index";
|
|
@@ -1,71 +1,70 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
3
2
|
import { type GeometricShape } from "@excalidraw/utils/geometry/shape";
|
|
4
3
|
import type { Bounds } from "./element/bounds";
|
|
5
4
|
import type { ElementsMap, ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./element/types";
|
|
6
5
|
import type { Zoom } from "./types";
|
|
7
6
|
export declare const SHAPES: readonly [{
|
|
8
|
-
readonly icon: JSX.Element;
|
|
7
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
readonly value: "selection";
|
|
10
9
|
readonly key: "v";
|
|
11
10
|
readonly numericKey: "1";
|
|
12
11
|
readonly fillable: true;
|
|
13
12
|
}, {
|
|
14
|
-
readonly icon: JSX.Element;
|
|
13
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
readonly value: "rectangle";
|
|
16
15
|
readonly key: "r";
|
|
17
16
|
readonly numericKey: "2";
|
|
18
17
|
readonly fillable: true;
|
|
19
18
|
}, {
|
|
20
|
-
readonly icon: JSX.Element;
|
|
19
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
21
20
|
readonly value: "diamond";
|
|
22
21
|
readonly key: "d";
|
|
23
22
|
readonly numericKey: "3";
|
|
24
23
|
readonly fillable: true;
|
|
25
24
|
}, {
|
|
26
|
-
readonly icon: JSX.Element;
|
|
25
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
27
26
|
readonly value: "ellipse";
|
|
28
27
|
readonly key: "o";
|
|
29
28
|
readonly numericKey: "4";
|
|
30
29
|
readonly fillable: true;
|
|
31
30
|
}, {
|
|
32
|
-
readonly icon: JSX.Element;
|
|
31
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
33
32
|
readonly value: "arrow";
|
|
34
33
|
readonly key: "a";
|
|
35
34
|
readonly numericKey: "5";
|
|
36
35
|
readonly fillable: true;
|
|
37
36
|
}, {
|
|
38
|
-
readonly icon: JSX.Element;
|
|
37
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
39
38
|
readonly value: "line";
|
|
40
39
|
readonly key: "l";
|
|
41
40
|
readonly numericKey: "6";
|
|
42
41
|
readonly fillable: true;
|
|
43
42
|
}, {
|
|
44
|
-
readonly icon: JSX.Element;
|
|
43
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
45
44
|
readonly value: "freedraw";
|
|
46
45
|
readonly key: readonly ["p", "x"];
|
|
47
46
|
readonly numericKey: "7";
|
|
48
47
|
readonly fillable: false;
|
|
49
48
|
}, {
|
|
50
|
-
readonly icon: JSX.Element;
|
|
49
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
51
50
|
readonly value: "text";
|
|
52
51
|
readonly key: "t";
|
|
53
52
|
readonly numericKey: "8";
|
|
54
53
|
readonly fillable: false;
|
|
55
54
|
}, {
|
|
56
|
-
readonly icon: JSX.Element;
|
|
55
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
57
56
|
readonly value: "image";
|
|
58
57
|
readonly key: null;
|
|
59
58
|
readonly numericKey: "9";
|
|
60
59
|
readonly fillable: false;
|
|
61
60
|
}, {
|
|
62
|
-
readonly icon: JSX.Element;
|
|
61
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
63
62
|
readonly value: "eraser";
|
|
64
63
|
readonly key: "e";
|
|
65
64
|
readonly numericKey: "0";
|
|
66
65
|
readonly fillable: false;
|
|
67
66
|
}];
|
|
68
|
-
export declare const findShapeByKey: (key: string) => "
|
|
67
|
+
export declare const findShapeByKey: (key: string) => "text" | "line" | "arrow" | "image" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "eraser" | null;
|
|
69
68
|
/**
|
|
70
69
|
* get the pure geometric shape of an excalidraw element
|
|
71
70
|
* which is then used for hit detection
|
|
@@ -4,7 +4,7 @@ import { Emitter } from "./emitter";
|
|
|
4
4
|
import type { AppState, ObservedAppState } from "./types";
|
|
5
5
|
import type { ValueOf } from "./utility-types";
|
|
6
6
|
export declare const getObservedAppState: (appState: AppState) => ObservedAppState;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const CaptureUpdateAction: {
|
|
8
8
|
/**
|
|
9
9
|
* Immediately undoable.
|
|
10
10
|
*
|
|
@@ -13,7 +13,7 @@ export declare const StoreAction: {
|
|
|
13
13
|
*
|
|
14
14
|
* These updates will _immediately_ make it to the local undo / redo stacks.
|
|
15
15
|
*/
|
|
16
|
-
readonly
|
|
16
|
+
readonly IMMEDIATELY: "IMMEDIATELY";
|
|
17
17
|
/**
|
|
18
18
|
* Never undoable.
|
|
19
19
|
*
|
|
@@ -22,21 +22,21 @@ export declare const StoreAction: {
|
|
|
22
22
|
*
|
|
23
23
|
* These updates will _never_ make it to the local undo / redo stacks.
|
|
24
24
|
*/
|
|
25
|
-
readonly
|
|
25
|
+
readonly NEVER: "NEVER";
|
|
26
26
|
/**
|
|
27
27
|
* Eventually undoable.
|
|
28
28
|
*
|
|
29
29
|
* Use for updates which should not be captured immediately - likely
|
|
30
30
|
* exceptions which are part of some async multi-step process. Otherwise, all
|
|
31
31
|
* such updates would end up being captured with the next
|
|
32
|
-
* `
|
|
32
|
+
* `CaptureUpdateAction.IMMEDIATELY` - triggered either by the next `updateScene`
|
|
33
33
|
* or internally by the editor.
|
|
34
34
|
*
|
|
35
35
|
* These updates will _eventually_ make it to the local undo / redo stacks.
|
|
36
36
|
*/
|
|
37
|
-
readonly
|
|
37
|
+
readonly EVENTUALLY: "EVENTUALLY";
|
|
38
38
|
};
|
|
39
|
-
export type
|
|
39
|
+
export type CaptureUpdateActionType = ValueOf<typeof CaptureUpdateAction>;
|
|
40
40
|
/**
|
|
41
41
|
* Represent an increment to the Store.
|
|
42
42
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
1
2
|
import type React from "react";
|
|
2
3
|
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement } from "./element/types";
|
|
3
4
|
import type { Action } from "./actions/types";
|
|
@@ -17,7 +18,7 @@ import type { IMAGE_MIME_TYPES, MIME_TYPES } from "./constants";
|
|
|
17
18
|
import type { ContextMenuItems } from "./components/ContextMenu";
|
|
18
19
|
import type { SnapLine } from "./snapping";
|
|
19
20
|
import type { Merge, MaybePromise, ValueOf, MakeBrand } from "./utility-types";
|
|
20
|
-
import type {
|
|
21
|
+
import type { CaptureUpdateActionType } from "./store";
|
|
21
22
|
import type { UserIdleState } from "./constants";
|
|
22
23
|
export type SocketId = string & {
|
|
23
24
|
_brand: "SocketId";
|
|
@@ -478,7 +479,7 @@ export type SceneData = {
|
|
|
478
479
|
elements?: ImportedDataState["elements"];
|
|
479
480
|
appState?: ImportedDataState["appState"];
|
|
480
481
|
collaborators?: Map<SocketId, Collaborator>;
|
|
481
|
-
|
|
482
|
+
captureUpdate?: CaptureUpdateActionType;
|
|
482
483
|
};
|
|
483
484
|
export type ExportOpts = {
|
|
484
485
|
saveFileToDisk?: boolean;
|
|
@@ -6,9 +6,9 @@ export declare const setDateTimeForTests: (dateTime: string) => void;
|
|
|
6
6
|
export declare const getDateTime: () => string;
|
|
7
7
|
export declare const capitalizeString: (str: string) => string;
|
|
8
8
|
export declare const isToolIcon: (target: Element | EventTarget | null) => target is HTMLElement;
|
|
9
|
-
export declare const isInputLike: (target: Element | EventTarget | null) => target is
|
|
9
|
+
export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLBRElement | HTMLDivElement;
|
|
10
10
|
export declare const isInteractive: (target: Element | EventTarget | null) => boolean;
|
|
11
|
-
export declare const isWritableElement: (target: Element | EventTarget | null) => target is
|
|
11
|
+
export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLTextAreaElement | HTMLBRElement | HTMLDivElement;
|
|
12
12
|
export declare const getFontFamilyString: ({ fontFamily, }: {
|
|
13
13
|
fontFamily: FontFamilyValues;
|
|
14
14
|
}) => string;
|
|
@@ -184,7 +184,7 @@ export declare const wrapEvent: <T extends Event>(name: EVENT, nativeEvent: T) =
|
|
|
184
184
|
}>;
|
|
185
185
|
export declare const updateObject: <T extends Record<string, any>>(obj: T, updates: Partial<T>) => T;
|
|
186
186
|
export declare const isPrimitive: (val: any) => boolean;
|
|
187
|
-
export declare const getFrame: () => "
|
|
187
|
+
export declare const getFrame: () => "top" | "iframe";
|
|
188
188
|
export declare const isRunningInIframe: () => boolean;
|
|
189
189
|
export declare const isPromiseLike: (value: any) => value is Promise<any>;
|
|
190
190
|
export declare const queryFocusableElements: (container: HTMLElement | null) => HTMLElement[];
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
+
import type { Curve } from "@excalidraw/math";
|
|
1
2
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
3
|
import type { LineSegment } from "@excalidraw/utils";
|
|
3
|
-
import type {
|
|
4
|
+
import type { Bounds } from "./element/bounds";
|
|
4
5
|
declare global {
|
|
5
6
|
interface Window {
|
|
6
7
|
visualDebug?: {
|
|
7
8
|
data: DebugElement[][];
|
|
8
9
|
currentFrame?: number;
|
|
9
10
|
};
|
|
10
|
-
debugDrawPoint: typeof debugDrawPoint;
|
|
11
|
-
debugDrawLine: typeof debugDrawLine;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
13
|
export type DebugElement = {
|
|
15
14
|
color: string;
|
|
16
|
-
data: LineSegment<GlobalPoint>;
|
|
15
|
+
data: LineSegment<GlobalPoint> | Curve<GlobalPoint>;
|
|
17
16
|
permanent: boolean;
|
|
18
17
|
};
|
|
19
|
-
export declare const
|
|
18
|
+
export declare const debugDrawCubicBezier: (c: Curve<GlobalPoint>, opts?: {
|
|
20
19
|
color?: string;
|
|
21
20
|
permanent?: boolean;
|
|
22
21
|
}) => void;
|
|
23
|
-
export declare const
|
|
22
|
+
export declare const debugDrawLine: (segment: LineSegment<GlobalPoint> | LineSegment<GlobalPoint>[], opts?: {
|
|
24
23
|
color?: string;
|
|
25
24
|
permanent?: boolean;
|
|
26
|
-
fuzzy?: boolean;
|
|
27
25
|
}) => void;
|
|
28
|
-
export declare const
|
|
26
|
+
export declare const debugDrawPoint: (p: GlobalPoint, opts?: {
|
|
29
27
|
color?: string;
|
|
30
28
|
permanent?: boolean;
|
|
29
|
+
fuzzy?: boolean;
|
|
31
30
|
}) => void;
|
|
32
31
|
export declare const debugDrawBounds: (box: Bounds | Bounds[], opts?: {
|
|
33
32
|
color?: string;
|
|
@@ -2,5 +2,5 @@ import type { ExcalidrawElement } from "./element/types";
|
|
|
2
2
|
import type { AppState } from "./types";
|
|
3
3
|
export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[];
|
|
4
4
|
export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[];
|
|
5
|
-
export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => ExcalidrawElement[] |
|
|
6
|
-
export declare const moveAllRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => ExcalidrawElement[] |
|
|
5
|
+
export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
|
|
6
|
+
export declare const moveAllRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Curve, GlobalPoint,
|
|
1
|
+
import type { Curve, GlobalPoint, LineSegment, LocalPoint } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param a
|
|
@@ -8,25 +8,33 @@ import type { Curve, GlobalPoint, LocalPoint, Radians } from "./types";
|
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
10
|
export declare function curve<Point extends GlobalPoint | LocalPoint>(a: Point, b: Point, c: Point, d: Point): Curve<Point>;
|
|
11
|
-
export declare const curveRotate: <Point extends GlobalPoint | LocalPoint>(curve: Curve<Point>, angle: Radians, origin: Point) => Point[];
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
14
|
-
* @param pointsIn
|
|
15
|
-
* @param curveTightness
|
|
16
|
-
* @returns
|
|
12
|
+
* Computes the intersection between a cubic spline and a line segment.
|
|
17
13
|
*/
|
|
18
|
-
export declare function
|
|
14
|
+
export declare function curveIntersectLineSegment<Point extends GlobalPoint | LocalPoint>(c: Curve<Point>, l: LineSegment<Point>): Point[];
|
|
19
15
|
/**
|
|
16
|
+
* Finds the closest point on the Bezier curve from another point
|
|
20
17
|
*
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
18
|
+
* @param x
|
|
19
|
+
* @param y
|
|
20
|
+
* @param P0
|
|
21
|
+
* @param P1
|
|
22
|
+
* @param P2
|
|
23
|
+
* @param P3
|
|
24
|
+
* @param tolerance
|
|
25
|
+
* @param maxLevel
|
|
23
26
|
* @returns
|
|
24
27
|
*/
|
|
25
|
-
export declare
|
|
28
|
+
export declare function curveClosestPoint<Point extends GlobalPoint | LocalPoint>(c: Curve<Point>, p: Point, tolerance?: number): Point | null;
|
|
26
29
|
/**
|
|
30
|
+
* Determines the distance between a point and the closest point on the
|
|
31
|
+
* Bezier curve.
|
|
27
32
|
*
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
|
|
33
|
+
* @param c The curve to test
|
|
34
|
+
* @param p The point to measure from
|
|
35
|
+
*/
|
|
36
|
+
export declare function curvePointDistance<Point extends GlobalPoint | LocalPoint>(c: Curve<Point>, p: Point): number;
|
|
37
|
+
/**
|
|
38
|
+
* Determines if the parameter is a Curve
|
|
31
39
|
*/
|
|
32
|
-
export declare
|
|
40
|
+
export declare function isCurve<P extends GlobalPoint | LocalPoint>(v: unknown): v is Curve<P>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Ellipse, GlobalPoint, Line, LineSegment, LocalPoint } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Construct an Ellipse object from the parameters
|
|
4
|
+
*
|
|
5
|
+
* @param center The center of the ellipse
|
|
6
|
+
* @param angle The slanting of the ellipse in radians
|
|
7
|
+
* @param halfWidth Half of the width of a non-slanted version of the ellipse
|
|
8
|
+
* @param halfHeight Half of the height of a non-slanted version of the ellipse
|
|
9
|
+
* @returns The constructed Ellipse object
|
|
10
|
+
*/
|
|
11
|
+
export declare function ellipse<Point extends GlobalPoint | LocalPoint>(center: Point, halfWidth: number, halfHeight: number): Ellipse<Point>;
|
|
12
|
+
/**
|
|
13
|
+
* Determines if a point is inside or on the ellipse outline
|
|
14
|
+
*
|
|
15
|
+
* @param p The point to test
|
|
16
|
+
* @param ellipse The ellipse to compare against
|
|
17
|
+
* @returns TRUE if the point is inside or on the outline of the ellipse
|
|
18
|
+
*/
|
|
19
|
+
export declare const ellipseIncludesPoint: <Point extends GlobalPoint | LocalPoint>(p: Point, ellipse: Ellipse<Point>) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Tests whether a point lies on the outline of the ellipse within a given
|
|
22
|
+
* tolerance
|
|
23
|
+
*
|
|
24
|
+
* @param point The point to test
|
|
25
|
+
* @param ellipse The ellipse to compare against
|
|
26
|
+
* @param threshold The distance to consider a point close enough to be "on" the outline
|
|
27
|
+
* @returns TRUE if the point is on the ellise outline
|
|
28
|
+
*/
|
|
29
|
+
export declare const ellipseTouchesPoint: <Point extends GlobalPoint | LocalPoint>(point: Point, ellipse: Ellipse<Point>, threshold?: number) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Determine the shortest euclidean distance from a point to the
|
|
32
|
+
* outline of the ellipse
|
|
33
|
+
*
|
|
34
|
+
* @param p The point to consider
|
|
35
|
+
* @param ellipse The ellipse to calculate the distance to
|
|
36
|
+
* @returns The eucledian distance
|
|
37
|
+
*/
|
|
38
|
+
export declare const ellipseDistanceFromPoint: <Point extends GlobalPoint | LocalPoint>(p: Point, ellipse: Ellipse<Point>) => number;
|
|
39
|
+
/**
|
|
40
|
+
* Calculate a maximum of two intercept points for a line going throug an
|
|
41
|
+
* ellipse.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ellipseSegmentInterceptPoints<Point extends GlobalPoint | LocalPoint>(e: Readonly<Ellipse<Point>>, s: Readonly<LineSegment<Point>>): Point[];
|
|
44
|
+
export declare function ellipseLineIntersectionPoints<Point extends GlobalPoint | LocalPoint>({ center, halfWidth, halfHeight }: Ellipse<Point>, [g, h]: Line<Point>): Point[];
|