@zsviczian/excalidraw 0.13.0-obsidian → 0.13.0-obsidian-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +1 -1
  2. package/dist/excalidraw.development.js +1149 -166
  3. package/dist/excalidraw.production.min.js +1 -1
  4. package/dist/excalidraw.production.min.js.LICENSE.txt +104 -0
  5. package/package.json +1 -1
  6. package/types/actions/actionAddToLibrary.d.ts +9 -9
  7. package/types/actions/actionAlign.d.ts +18 -6
  8. package/types/actions/actionBoundText.d.ts +3 -3
  9. package/types/actions/actionCanvas.d.ts +62 -43
  10. package/types/actions/actionClipboard.d.ts +24 -15
  11. package/types/actions/actionDeleteSelected.d.ts +21 -10
  12. package/types/actions/actionDistribute.d.ts +6 -2
  13. package/types/actions/actionDuplicateSelection.d.ts +3 -1
  14. package/types/actions/actionExport.d.ts +61 -44
  15. package/types/actions/actionFinalize.d.ts +9 -7
  16. package/types/actions/actionGroup.d.ts +6 -2
  17. package/types/actions/actionLinearEditor.d.ts +3 -3
  18. package/types/actions/actionMenu.d.ts +20 -12
  19. package/types/actions/actionNavigate.d.ts +4 -1
  20. package/types/actions/actionProperties.d.ts +80 -54
  21. package/types/actions/actionStyles.d.ts +3 -3
  22. package/types/actions/actionToggleGridMode.d.ts +4 -3
  23. package/types/actions/actionToggleLock.d.ts +3 -3
  24. package/types/actions/actionToggleStats.d.ts +4 -3
  25. package/types/actions/actionToggleViewMode.d.ts +4 -3
  26. package/types/actions/actionToggleZenMode.d.ts +4 -3
  27. package/types/actions/actionZindex.d.ts +12 -4
  28. package/types/actions/manager.d.ts +1 -1
  29. package/types/actions/shortcuts.d.ts +1 -1
  30. package/types/actions/types.d.ts +7 -2
  31. package/types/appState.d.ts +11 -11
  32. package/types/bug-issue-template.d.ts +2 -0
  33. package/types/clients.d.ts +1 -1
  34. package/types/clipboard.d.ts +6 -1
  35. package/types/components/Actions.d.ts +1 -0
  36. package/types/components/App.d.ts +47 -1
  37. package/types/components/Avatar.d.ts +1 -1
  38. package/types/components/CollabButton.d.ts +2 -1
  39. package/types/components/ContextMenu.d.ts +9 -10
  40. package/types/components/DialogActionButton.d.ts +10 -0
  41. package/types/components/EncryptedIcon.d.ts +2 -0
  42. package/types/components/Footer.d.ts +2 -1
  43. package/types/components/HelpButton.d.ts +8 -0
  44. package/types/components/ImageExportDialog.d.ts +3 -1
  45. package/types/components/LayerUI.d.ts +2 -1
  46. package/types/components/LibraryButton.d.ts +1 -0
  47. package/types/components/LibraryMenuBrowseButton.d.ts +7 -0
  48. package/types/components/LibraryMenuItems.d.ts +5 -2
  49. package/types/components/MenuItem.d.ts +11 -0
  50. package/types/components/MenuUtils.d.ts +2 -0
  51. package/types/components/MobileMenu.d.ts +2 -1
  52. package/types/components/Sidebar/Sidebar.d.ts +1 -1
  53. package/types/components/Sidebar/common.d.ts +1 -0
  54. package/types/components/TopErrorBoundary.d.ts +15 -0
  55. package/types/components/WelcomeScreen.d.ts +8 -0
  56. package/types/components/WelcomeScreenDecor.d.ts +6 -0
  57. package/types/components/icons.d.ts +83 -124
  58. package/types/constants.d.ts +8 -5
  59. package/types/element/Hyperlink.d.ts +6 -4
  60. package/types/element/bounds.d.ts +3 -2
  61. package/types/element/linearElementEditor.d.ts +34 -6
  62. package/types/element/newElement.d.ts +2 -2
  63. package/types/element/resizeElements.d.ts +0 -1
  64. package/types/element/textElement.d.ts +17 -2
  65. package/types/element/transformHandles.d.ts +3 -4
  66. package/types/element/typeChecks.d.ts +10 -1
  67. package/types/element/types.d.ts +11 -4
  68. package/types/excalidraw-app/CustomStats.d.ts +9 -0
  69. package/types/excalidraw-app/app_constants.d.ts +32 -0
  70. package/types/excalidraw-app/collab/Collab.d.ts +163 -0
  71. package/types/excalidraw-app/collab/Portal.d.ts +28 -0
  72. package/types/excalidraw-app/collab/RoomDialog.d.ts +13 -0
  73. package/types/excalidraw-app/collab/reconciliation.d.ts +10 -0
  74. package/types/excalidraw-app/components/ExportToExcalidrawPlus.d.ts +9 -0
  75. package/types/excalidraw-app/components/LanguageList.d.ts +4 -0
  76. package/types/excalidraw-app/components/icons.d.ts +1 -0
  77. package/types/excalidraw-app/data/FileManager.d.ts +66 -0
  78. package/types/excalidraw-app/data/LocalData.d.ts +32 -0
  79. package/types/excalidraw-app/data/Locker.d.ts +8 -0
  80. package/types/excalidraw-app/data/firebase.d.ts +25 -0
  81. package/types/excalidraw-app/data/index.d.ts +185 -0
  82. package/types/excalidraw-app/data/localStorage.d.ts +111 -0
  83. package/types/excalidraw-app/data/tabSync.d.ts +9 -0
  84. package/types/excalidraw-app/index.d.ts +26 -0
  85. package/types/hooks/useOutsideClick.d.ts +2 -0
  86. package/types/keys.d.ts +10 -0
  87. package/types/math.d.ts +2 -1
  88. package/types/packages/excalidraw/index.d.ts +3 -0
  89. package/types/packages/utils.d.ts +3 -1
  90. package/types/renderer/renderElement.d.ts +4 -3
  91. package/types/renderer/renderScene.d.ts +1 -1
  92. package/types/scene/Fonts.d.ts +21 -0
  93. package/types/scene/Scene.d.ts +15 -0
  94. package/types/scene/comparisons.d.ts +2 -3
  95. package/types/scene/index.d.ts +1 -1
  96. package/types/scene/types.d.ts +1 -0
  97. package/types/shapes.d.ts +27 -3
  98. package/types/types.d.ts +15 -4
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface TopErrorBoundaryState {
3
+ hasError: boolean;
4
+ sentryEventId: string;
5
+ localStorage: string;
6
+ }
7
+ export declare class TopErrorBoundary extends React.Component<any, TopErrorBoundaryState> {
8
+ state: TopErrorBoundaryState;
9
+ render(): any;
10
+ componentDidCatch(error: Error, errorInfo: any): void;
11
+ private selectTextArea;
12
+ private createGithubIssue;
13
+ private errorSplash;
14
+ }
15
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ActionManager } from "../actions/manager";
2
+ import { AppState } from "../types";
3
+ import "./WelcomeScreen.scss";
4
+ declare const WelcomeScreen: ({ appState, actionManager, }: {
5
+ appState: AppState;
6
+ actionManager: ActionManager;
7
+ }) => JSX.Element;
8
+ export default WelcomeScreen;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ declare const WelcomeScreenDecor: ({ children, shouldRender, }: {
3
+ children: ReactNode;
4
+ shouldRender: boolean;
5
+ }) => JSX.Element | null;
6
+ export default WelcomeScreenDecor;
@@ -6,68 +6,77 @@ declare type Opts = {
6
6
  mirror?: true;
7
7
  } & React.SVGProps<SVGSVGElement>;
8
8
  export declare const createIcon: (d: string | React.ReactNode, opts?: number | Opts) => JSX.Element;
9
+ export declare const PlusPromoIcon: JSX.Element;
10
+ export declare const LibraryIcon: JSX.Element;
11
+ export declare const PlusIcon: JSX.Element;
12
+ export declare const DotsIcon: JSX.Element;
13
+ export declare const PinIcon: JSX.Element;
14
+ export declare const UnlockedIcon: JSX.Element;
15
+ export declare const LockedIcon: JSX.Element;
16
+ export declare const WelcomeScreenMenuArrow: JSX.Element;
17
+ export declare const WelcomeScreenHelpArrow: JSX.Element;
18
+ export declare const WelcomeScreenTopToolbarArrow: JSX.Element;
19
+ export declare const ExcalLogo: JSX.Element;
20
+ export declare const SelectionIcon: JSX.Element;
21
+ export declare const RectangleIcon: JSX.Element;
22
+ export declare const DiamondIcon: JSX.Element;
23
+ export declare const EllipseIcon: JSX.Element;
24
+ export declare const ArrowIcon: JSX.Element;
25
+ export declare const LineIcon: JSX.Element;
26
+ export declare const PenModeIcon: JSX.Element;
27
+ export declare const FreedrawIcon: JSX.Element;
28
+ export declare const TextIcon: JSX.Element;
29
+ export declare const ImageIcon: JSX.Element;
30
+ export declare const EraserIcon: JSX.Element;
31
+ export declare const ZoomInIcon: JSX.Element;
32
+ export declare const ZoomOutIcon: JSX.Element;
33
+ export declare const TrashIcon: JSX.Element;
34
+ export declare const DuplicateIcon: JSX.Element;
35
+ export declare const MoonIcon: JSX.Element;
36
+ export declare const SunIcon: JSX.Element;
37
+ export declare const HamburgerMenuIcon: JSX.Element;
38
+ export declare const ExportIcon: JSX.Element;
39
+ export declare const HelpIcon: JSX.Element;
40
+ export declare const ExternalLinkIcon: JSX.Element;
41
+ export declare const GithubIcon: JSX.Element;
42
+ export declare const DiscordIcon: JSX.Element;
43
+ export declare const TwitterIcon: JSX.Element;
9
44
  export declare const checkIcon: JSX.Element;
10
- export declare const link: JSX.Element;
45
+ export declare const LinkIcon: JSX.Element;
11
46
  export declare const save: JSX.Element;
12
47
  export declare const saveAs: JSX.Element;
13
- export declare const load: JSX.Element;
48
+ export declare const LoadIcon: JSX.Element;
14
49
  export declare const clipboard: JSX.Element;
15
- export declare const trash: JSX.Element;
16
50
  export declare const palette: JSX.Element;
17
- export declare const exportFile: JSX.Element;
18
- export declare const exportImage: JSX.Element;
51
+ export declare const ExportImageIcon: JSX.Element;
19
52
  export declare const exportToFileIcon: JSX.Element;
20
53
  export declare const zoomIn: JSX.Element;
21
54
  export declare const zoomOut: JSX.Element;
22
55
  export declare const done: JSX.Element;
23
56
  export declare const menu: JSX.Element;
24
- export declare const undo: JSX.Element;
25
- export declare const redo: JSX.Element;
57
+ export declare const UndoIcon: JSX.Element;
58
+ export declare const RedoIcon: JSX.Element;
26
59
  export declare const questionCircle: JSX.Element;
27
60
  export declare const share: JSX.Element;
28
61
  export declare const shareIOS: JSX.Element;
29
62
  export declare const shareWindows: JSX.Element;
30
63
  export declare const resetZoom: JSX.Element;
31
- export declare const BringForwardIcon: React.MemoExoticComponent<({ theme }: {
32
- theme: Theme;
33
- }) => JSX.Element>;
34
- export declare const SendBackwardIcon: React.MemoExoticComponent<({ theme }: {
35
- theme: Theme;
36
- }) => JSX.Element>;
37
- export declare const BringToFrontIcon: React.MemoExoticComponent<({ theme }: {
38
- theme: Theme;
39
- }) => JSX.Element>;
40
- export declare const SendToBackIcon: React.MemoExoticComponent<({ theme }: {
41
- theme: Theme;
42
- }) => JSX.Element>;
43
- export declare const AlignTopIcon: React.MemoExoticComponent<({ theme }: {
44
- theme: Theme;
45
- }) => JSX.Element>;
46
- export declare const AlignBottomIcon: React.MemoExoticComponent<({ theme }: {
47
- theme: Theme;
48
- }) => JSX.Element>;
49
- export declare const AlignLeftIcon: React.MemoExoticComponent<({ theme }: {
50
- theme: Theme;
51
- }) => JSX.Element>;
52
- export declare const AlignRightIcon: React.MemoExoticComponent<({ theme }: {
53
- theme: Theme;
54
- }) => JSX.Element>;
55
- export declare const DistributeHorizontallyIcon: React.MemoExoticComponent<({ theme }: {
56
- theme: Theme;
57
- }) => JSX.Element>;
58
- export declare const DistributeVerticallyIcon: React.MemoExoticComponent<({ theme }: {
59
- theme: Theme;
60
- }) => JSX.Element>;
61
- export declare const CenterVerticallyIcon: React.MemoExoticComponent<({ theme }: {
62
- theme: Theme;
63
- }) => JSX.Element>;
64
- export declare const CenterHorizontallyIcon: React.MemoExoticComponent<({ theme }: {
65
- theme: Theme;
66
- }) => JSX.Element>;
67
- export declare const users: JSX.Element;
64
+ export declare const BringForwardIcon: JSX.Element;
65
+ export declare const SendBackwardIcon: JSX.Element;
66
+ export declare const BringToFrontIcon: JSX.Element;
67
+ export declare const SendToBackIcon: JSX.Element;
68
+ export declare const AlignTopIcon: JSX.Element;
69
+ export declare const AlignBottomIcon: JSX.Element;
70
+ export declare const AlignLeftIcon: JSX.Element;
71
+ export declare const AlignRightIcon: JSX.Element;
72
+ export declare const DistributeHorizontallyIcon: JSX.Element;
73
+ export declare const DistributeVerticallyIcon: JSX.Element;
74
+ export declare const CenterVerticallyIcon: JSX.Element;
75
+ export declare const CenterHorizontallyIcon: JSX.Element;
76
+ export declare const UsersIcon: JSX.Element;
68
77
  export declare const start: JSX.Element;
69
78
  export declare const stop: JSX.Element;
70
- export declare const close: JSX.Element;
79
+ export declare const CloseIcon: JSX.Element;
71
80
  export declare const back: JSX.Element;
72
81
  export declare const clone: JSX.Element;
73
82
  export declare const shield: JSX.Element;
@@ -78,95 +87,46 @@ export declare const GroupIcon: React.MemoExoticComponent<({ theme }: {
78
87
  export declare const UngroupIcon: React.MemoExoticComponent<({ theme }: {
79
88
  theme: Theme;
80
89
  }) => JSX.Element>;
81
- export declare const FillHachureIcon: React.MemoExoticComponent<({ theme }: {
82
- theme: Theme;
83
- }) => JSX.Element>;
84
- export declare const FillCrossHatchIcon: React.MemoExoticComponent<({ theme }: {
85
- theme: Theme;
86
- }) => JSX.Element>;
87
- export declare const FillSolidIcon: React.MemoExoticComponent<({ theme }: {
88
- theme: Theme;
89
- }) => JSX.Element>;
90
- export declare const StrokeWidthIcon: React.MemoExoticComponent<({ theme, strokeWidth }: {
91
- theme: Theme;
92
- strokeWidth: number;
93
- }) => JSX.Element>;
90
+ export declare const FillHachureIcon: JSX.Element;
91
+ export declare const FillCrossHatchIcon: JSX.Element;
92
+ export declare const FillSolidIcon: JSX.Element;
93
+ export declare const StrokeWidthThinIcon: JSX.Element;
94
+ export declare const StrokeWidthBaseIcon: JSX.Element;
95
+ export declare const StrokeWidthBoldIcon: JSX.Element;
96
+ export declare const StrokeWidthExtraBoldIcon: JSX.Element;
94
97
  export declare const StrokeStyleSolidIcon: React.MemoExoticComponent<({ theme }: {
95
98
  theme: Theme;
96
99
  }) => JSX.Element>;
97
- export declare const StrokeStyleDashedIcon: React.MemoExoticComponent<({ theme }: {
98
- theme: Theme;
99
- }) => JSX.Element>;
100
- export declare const StrokeStyleDottedIcon: React.MemoExoticComponent<({ theme }: {
101
- theme: Theme;
102
- }) => JSX.Element>;
103
- export declare const SloppinessArchitectIcon: React.MemoExoticComponent<({ theme }: {
104
- theme: Theme;
105
- }) => JSX.Element>;
106
- export declare const SloppinessArtistIcon: React.MemoExoticComponent<({ theme }: {
107
- theme: Theme;
108
- }) => JSX.Element>;
109
- export declare const SloppinessCartoonistIcon: React.MemoExoticComponent<({ theme }: {
110
- theme: Theme;
111
- }) => JSX.Element>;
112
- export declare const EdgeSharpIcon: React.MemoExoticComponent<({ theme }: {
113
- theme: Theme;
114
- }) => JSX.Element>;
115
- export declare const EdgeRoundIcon: React.MemoExoticComponent<({ theme }: {
116
- theme: Theme;
117
- }) => JSX.Element>;
118
- export declare const ArrowheadNoneIcon: React.MemoExoticComponent<({ theme }: {
119
- theme: Theme;
120
- }) => JSX.Element>;
121
- export declare const ArrowheadArrowIcon: React.MemoExoticComponent<({ theme, flip }: {
122
- theme: Theme;
100
+ export declare const StrokeStyleDashedIcon: JSX.Element;
101
+ export declare const StrokeStyleDottedIcon: JSX.Element;
102
+ export declare const SloppinessArchitectIcon: JSX.Element;
103
+ export declare const SloppinessArtistIcon: JSX.Element;
104
+ export declare const SloppinessCartoonistIcon: JSX.Element;
105
+ export declare const EdgeSharpIcon: JSX.Element;
106
+ export declare const EdgeRoundIcon: JSX.Element;
107
+ export declare const ArrowheadNoneIcon: JSX.Element;
108
+ export declare const ArrowheadArrowIcon: React.MemoExoticComponent<({ flip }: {
123
109
  flip?: boolean | undefined;
124
110
  }) => JSX.Element>;
125
- export declare const ArrowheadDotIcon: React.MemoExoticComponent<({ theme, flip }: {
126
- theme: Theme;
111
+ export declare const ArrowheadDotIcon: React.MemoExoticComponent<({ flip }: {
127
112
  flip?: boolean | undefined;
128
113
  }) => JSX.Element>;
129
- export declare const ArrowheadBarIcon: React.MemoExoticComponent<({ theme, flip }: {
130
- theme: Theme;
114
+ export declare const ArrowheadBarIcon: React.MemoExoticComponent<({ flip }: {
131
115
  flip?: boolean | undefined;
132
116
  }) => JSX.Element>;
133
- export declare const ArrowheadTriangleIcon: React.MemoExoticComponent<({ theme, flip }: {
134
- theme: Theme;
117
+ export declare const ArrowheadTriangleIcon: React.MemoExoticComponent<({ flip }: {
135
118
  flip?: boolean | undefined;
136
119
  }) => JSX.Element>;
137
- export declare const FontSizeSmallIcon: React.MemoExoticComponent<({ theme }: {
138
- theme: Theme;
139
- }) => JSX.Element>;
140
- export declare const FontSizeMediumIcon: React.MemoExoticComponent<({ theme }: {
141
- theme: Theme;
142
- }) => JSX.Element>;
143
- export declare const FontSizeLargeIcon: React.MemoExoticComponent<({ theme }: {
144
- theme: Theme;
145
- }) => JSX.Element>;
146
- export declare const FontSizeExtraLargeIcon: React.MemoExoticComponent<({ theme }: {
147
- theme: Theme;
148
- }) => JSX.Element>;
149
- export declare const FontFamilyHandDrawnIcon: React.MemoExoticComponent<({ theme }: {
150
- theme: Theme;
151
- }) => JSX.Element>;
152
- export declare const FontFamilyLocalFontIcon: React.MemoExoticComponent<({ theme }: {
153
- theme: Theme;
154
- }) => JSX.Element>;
155
- export declare const FontFamilyNormalIcon: React.MemoExoticComponent<({ theme }: {
156
- theme: Theme;
157
- }) => JSX.Element>;
158
- export declare const FontFamilyCodeIcon: React.MemoExoticComponent<({ theme }: {
159
- theme: Theme;
160
- }) => JSX.Element>;
161
- export declare const TextAlignLeftIcon: React.MemoExoticComponent<({ theme }: {
162
- theme: Theme;
163
- }) => JSX.Element>;
164
- export declare const TextAlignCenterIcon: React.MemoExoticComponent<({ theme }: {
165
- theme: Theme;
166
- }) => JSX.Element>;
167
- export declare const TextAlignRightIcon: React.MemoExoticComponent<({ theme }: {
168
- theme: Theme;
169
- }) => JSX.Element>;
120
+ export declare const FontSizeSmallIcon: JSX.Element;
121
+ export declare const FontSizeMediumIcon: JSX.Element;
122
+ export declare const FontSizeLargeIcon: JSX.Element;
123
+ export declare const FontSizeExtraLargeIcon: JSX.Element;
124
+ export declare const FontFamilyNormalIcon: JSX.Element;
125
+ export declare const FontFamilyCodeIcon: JSX.Element;
126
+ export declare const FontFamilyLocalFontIcon: JSX.Element;
127
+ export declare const TextAlignLeftIcon: JSX.Element;
128
+ export declare const TextAlignCenterIcon: JSX.Element;
129
+ export declare const TextAlignRightIcon: JSX.Element;
170
130
  export declare const TextAlignTopIcon: React.MemoExoticComponent<({ theme }: {
171
131
  theme: Theme;
172
132
  }) => JSX.Element>;
@@ -177,6 +137,5 @@ export declare const TextAlignMiddleIcon: React.MemoExoticComponent<({ theme }:
177
137
  theme: Theme;
178
138
  }) => JSX.Element>;
179
139
  export declare const publishIcon: JSX.Element;
180
- export declare const editIcon: JSX.Element;
181
140
  export declare const eraser: JSX.Element;
182
141
  export {};
@@ -105,14 +105,10 @@ export declare const TITLE_TIMEOUT = 10000;
105
105
  export declare const VERSION_TIMEOUT = 30000;
106
106
  export declare const SCROLL_TIMEOUT = 100;
107
107
  export declare const ZOOM_STEP = 0.05;
108
+ export declare const MIN_ZOOM = 0.1;
108
109
  export declare const HYPERLINK_TOOLTIP_DELAY = 300;
109
110
  export declare const IDLE_THRESHOLD = 60000;
110
111
  export declare const ACTIVE_THRESHOLD = 3000;
111
- export declare const MODES: {
112
- VIEW: string;
113
- ZEN: string;
114
- GRID: string;
115
- };
116
112
  export declare const THEME_FILTER: any;
117
113
  export declare const URL_QUERY_KEYS: {
118
114
  readonly addLibrary: "addLibrary";
@@ -151,6 +147,13 @@ export declare const TEXT_ALIGN: {
151
147
  RIGHT: string;
152
148
  };
153
149
  export declare const ELEMENT_READY_TO_ERASE_OPACITY = 20;
150
+ export declare const DEFAULT_PROPORTIONAL_RADIUS = 0.25;
151
+ export declare const DEFAULT_ADAPTIVE_RADIUS = 32;
152
+ export declare const ROUNDNESS: {
153
+ readonly LEGACY: 1;
154
+ readonly PROPORTIONAL_RADIUS: 2;
155
+ readonly ADAPTIVE_RADIUS: 3;
156
+ };
154
157
  export declare const COOKIES: {
155
158
  readonly AUTH_STATE_COOKIE: "excplus-auth";
156
159
  };
@@ -18,6 +18,7 @@ export declare const actionLink: {
18
18
  appState: {
19
19
  showHyperlinkPopup: "editor";
20
20
  openMenu: null;
21
+ showWelcomeScreen: boolean;
21
22
  isLoading: boolean;
22
23
  errorMessage: string | null;
23
24
  draggingElement: NonDeletedExcalidrawElement | null;
@@ -56,10 +57,9 @@ export declare const actionLink: {
56
57
  currentItemFontFamily: number;
57
58
  currentItemFontSize: number;
58
59
  currentItemTextAlign: string;
59
- currentItemStrokeSharpness: import("./types").StrokeSharpness;
60
60
  currentItemStartArrowhead: import("./types").Arrowhead | null;
61
61
  currentItemEndArrowhead: import("./types").Arrowhead | null;
62
- currentItemLinearStrokeSharpness: import("./types").StrokeSharpness;
62
+ currentItemRoundness: import("./types").StrokeRoundness;
63
63
  viewBackgroundColor: string;
64
64
  scrollX: number;
65
65
  scrollY: number;
@@ -73,6 +73,7 @@ export declare const actionLink: {
73
73
  }>;
74
74
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
75
75
  openSidebar: "library" | "customSidebar" | null;
76
+ openDialog: "imageExport" | "help" | null;
76
77
  isSidebarDocked: boolean;
77
78
  lastPointerDownWith: import("./types").PointerType;
78
79
  selectedElementIds: {
@@ -82,7 +83,6 @@ export declare const actionLink: {
82
83
  [id: string]: boolean;
83
84
  };
84
85
  shouldCacheIgnoreZoom: boolean;
85
- showHelpDialog: boolean;
86
86
  toast: {
87
87
  message: string;
88
88
  closable?: boolean | undefined;
@@ -130,7 +130,9 @@ export declare const actionLink: {
130
130
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
131
131
  contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
132
132
  contextItemPredicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
133
- PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => JSX.Element;
133
+ PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps & {
134
+ isInHamburgerMenu: boolean;
135
+ }) => JSX.Element;
134
136
  } & {
135
137
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
136
138
  };
@@ -1,15 +1,16 @@
1
1
  import { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, NonDeleted } from "./types";
2
2
  import { Drawable, Op } from "roughjs/bin/core";
3
3
  export declare type Bounds = readonly [number, number, number, number];
4
- export declare const getElementAbsoluteCoords: (element: ExcalidrawElement) => Bounds;
4
+ export declare const getElementAbsoluteCoords: (element: ExcalidrawElement, includeBoundText?: boolean) => [number, number, number, number, number, number];
5
5
  export declare const pointRelativeTo: (element: ExcalidrawElement, absoluteCoords: readonly [number, number]) => readonly [number, number];
6
6
  export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
7
7
  export declare const getCurvePathOps: (shape: Drawable) => Op[];
8
+ export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: ((x: number, y: number) => [number, number]) | undefined) => [number, number, number, number];
8
9
  export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead) => number[] | null;
9
10
  export declare const getElementBounds: (element: ExcalidrawElement) => [number, number, number, number];
10
11
  export declare const getCommonBounds: (elements: readonly ExcalidrawElement[]) => [number, number, number, number];
11
12
  export declare const getResizedElementAbsoluteCoords: (element: ExcalidrawElement, nextWidth: number, nextHeight: number, normalizePoints: boolean) => [number, number, number, number];
12
- export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[], sharpness: ExcalidrawElement["strokeSharpness"]) => [number, number, number, number];
13
+ export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[]) => [number, number, number, number];
13
14
  export declare const getClosestElementBounds: (elements: readonly ExcalidrawElement[], from: {
14
15
  x: number;
15
16
  y: number;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement } from "./types";
3
- import { Point, AppState } from "../types";
2
+ import { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer } from "./types";
3
+ import { Point, AppState, PointerCoords } from "../types";
4
4
  import History from "../history";
5
5
  import Scene from "../scene/Scene";
6
6
  declare const editorMidPointsCache: {
@@ -18,6 +18,15 @@ export declare class LinearElementEditor {
18
18
  prevSelectedPointsIndices: readonly number[] | null;
19
19
  /** index */
20
20
  lastClickedPoint: number;
21
+ origin: Readonly<{
22
+ x: number;
23
+ y: number;
24
+ }> | null;
25
+ segmentMidpoint: {
26
+ value: Point | null;
27
+ index: number | null;
28
+ added: boolean;
29
+ };
21
30
  }>;
22
31
  /** whether you're dragging a point */
23
32
  readonly isDragging: boolean;
@@ -60,7 +69,6 @@ export declare class LinearElementEditor {
60
69
  didAddPoint: boolean;
61
70
  hitElement: NonDeleted<ExcalidrawElement> | null;
62
71
  linearElementEditor: LinearElementEditor | null;
63
- isMidPoint: boolean;
64
72
  };
65
73
  static arePointsEqual(point1: Point | null, point2: Point | null): boolean;
66
74
  static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, appState: AppState): LinearElementEditor | null;
@@ -94,6 +102,15 @@ export declare class LinearElementEditor {
94
102
  prevSelectedPointsIndices: readonly number[] | null;
95
103
  /** index */
96
104
  lastClickedPoint: number;
105
+ origin: Readonly<{
106
+ x: number;
107
+ y: number;
108
+ }> | null;
109
+ segmentMidpoint: {
110
+ value: readonly [number, number] | null;
111
+ index: number | null;
112
+ added: boolean;
113
+ };
97
114
  }>;
98
115
  isDragging: boolean;
99
116
  lastUncommittedPoint: readonly [number, number] | null;
@@ -106,6 +123,7 @@ export declare class LinearElementEditor {
106
123
  hoverPointIndex: number;
107
124
  segmentMidPointHoveredCoords: readonly [number, number] | null;
108
125
  };
126
+ showWelcomeScreen: boolean;
109
127
  isLoading: boolean;
110
128
  errorMessage: string | null;
111
129
  draggingElement: import("./types").NonDeletedExcalidrawElement | null;
@@ -143,10 +161,9 @@ export declare class LinearElementEditor {
143
161
  currentItemFontFamily: number;
144
162
  currentItemFontSize: number;
145
163
  currentItemTextAlign: string;
146
- currentItemStrokeSharpness: import("./types").StrokeSharpness;
147
164
  currentItemStartArrowhead: import("./types").Arrowhead | null;
148
165
  currentItemEndArrowhead: import("./types").Arrowhead | null;
149
- currentItemLinearStrokeSharpness: import("./types").StrokeSharpness;
166
+ currentItemRoundness: import("./types").StrokeRoundness;
150
167
  viewBackgroundColor: string;
151
168
  scrollX: number;
152
169
  scrollY: number;
@@ -161,6 +178,7 @@ export declare class LinearElementEditor {
161
178
  openMenu: "canvas" | "shape" | null;
162
179
  openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
163
180
  openSidebar: "library" | "customSidebar" | null;
181
+ openDialog: "imageExport" | "help" | null;
164
182
  isSidebarDocked: boolean;
165
183
  lastPointerDownWith: import("./types").PointerType;
166
184
  selectedElementIds: {
@@ -170,7 +188,6 @@ export declare class LinearElementEditor {
170
188
  [id: string]: boolean;
171
189
  };
172
190
  shouldCacheIgnoreZoom: boolean;
173
- showHelpDialog: boolean;
174
191
  toast: {
175
192
  message: string;
176
193
  closable?: boolean | undefined;
@@ -223,7 +240,18 @@ export declare class LinearElementEditor {
223
240
  startBinding?: PointBinding;
224
241
  endBinding?: PointBinding;
225
242
  }): void;
243
+ static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState): boolean;
244
+ static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState): {
245
+ pointerDownState: LinearElementEditor["pointerDownState"];
246
+ selectedPointsIndices: LinearElementEditor["selectedPointsIndices"];
247
+ } | undefined;
226
248
  private static _updatePoints;
227
249
  private static _getShiftLockedDelta;
250
+ static getBoundTextElementPosition: (element: ExcalidrawLinearElement, boundTextElement: ExcalidrawTextElementWithContainer) => {
251
+ x: number;
252
+ y: number;
253
+ };
254
+ static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementBounds: [number, number, number, number], boundTextElement: ExcalidrawTextElementWithContainer) => [number, number, number, number, number, number];
255
+ static getElementAbsoluteCoords: (element: ExcalidrawLinearElement, includeBoundText?: boolean) => [number, number, number, number, number, number];
228
256
  }
229
257
  export {};
@@ -1,4 +1,4 @@
1
- import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawRectangleElement } from "../element/types";
1
+ import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer } from "../element/types";
2
2
  import { AppState } from "../types";
3
3
  declare type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "boundElements" | "seed" | "version" | "versionNonce" | "link">;
4
4
  export declare const newElement: (opts: {
@@ -11,7 +11,7 @@ export declare const newTextElement: (opts: {
11
11
  fontFamily: FontFamilyValues;
12
12
  textAlign: TextAlign;
13
13
  verticalAlign: VerticalAlign;
14
- containerId?: ExcalidrawRectangleElement["id"];
14
+ containerId?: ExcalidrawTextContainer["id"];
15
15
  } & ElementConstructorOpts) => NonDeleted<ExcalidrawTextElement>;
16
16
  export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement, text?: string) => {
17
17
  x: number;
@@ -3,7 +3,6 @@ import { MaybeTransformHandleType, TransformHandleDirection } from "./transformH
3
3
  import { PointerDownState } from "../types";
4
4
  export declare const normalizeAngle: (angle: number) => number;
5
5
  export declare const transformElements: (pointerDownState: PointerDownState, transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], resizeArrowDirection: "origin" | "end", shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
6
- export declare const reshapeSingleTwoPointElement: (element: NonDeleted<ExcalidrawLinearElement>, resizeArrowDirection: "origin" | "end", shouldRotateWithDiscreteAngle: boolean, pointerX: number, pointerY: number) => void;
7
6
  export declare const resizeSingleElement: (originalElements: PointerDownState["originalElements"], shouldMaintainAspectRatio: boolean, element: NonDeletedExcalidrawElement, transformHandleDirection: TransformHandleDirection, shouldResizeFromCenter: boolean, pointerX: number, pointerY: number) => void;
8
7
  export declare const getResizeOffsetXY: (transformHandleType: MaybeTransformHandleType, selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
9
8
  export declare const getResizeArrowDirection: (transformHandleType: MaybeTransformHandleType, element: NonDeleted<ExcalidrawLinearElement>) => "origin" | "end";
@@ -1,8 +1,10 @@
1
- import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, FontString, NonDeletedExcalidrawElement } from "./types";
1
+ import { ExcalidrawElement, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, FontString, NonDeletedExcalidrawElement } from "./types";
2
2
  import { MaybeTransformHandleType } from "./transformHandles";
3
+ import { AppState } from "../types";
4
+ export declare const normalizeText: (text: string) => string;
3
5
  export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null) => void;
4
6
  export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
5
- export declare const handleBindTextResize: (element: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
7
+ export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
6
8
  export declare const measureText: (text: string, font: FontString, maxWidth?: number | null) => {
7
9
  width: number;
8
10
  height: number;
@@ -28,3 +30,16 @@ export declare const getContainerDims: (element: ExcalidrawElement) => {
28
30
  width: number;
29
31
  height: number;
30
32
  };
33
+ export declare const getContainerCenter: (container: ExcalidrawElement, appState: AppState) => {
34
+ x: number;
35
+ y: number;
36
+ };
37
+ export declare const getTextElementAngle: (textElement: ExcalidrawTextElement) => number;
38
+ export declare const getBoundTextElementOffset: (boundTextElement: ExcalidrawTextElement | null) => number;
39
+ export declare const getBoundTextElementPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => {
40
+ x: number;
41
+ y: number;
42
+ } | undefined;
43
+ export declare const shouldAllowVerticalAlign: (selectedElements: NonDeletedExcalidrawElement[]) => boolean;
44
+ export declare const getTextBindableContainerAtPosition: (elements: readonly ExcalidrawElement[], appState: AppState, x: number, y: number) => ExcalidrawTextContainer | null;
45
+ export declare const isValidTextContainer: (element: ExcalidrawElement) => boolean;
@@ -1,5 +1,4 @@
1
1
  import { ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
2
- import { Bounds } from "./bounds";
3
2
  import { AppState, Zoom } from "../types";
4
3
  export declare type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
5
4
  export declare type TransformHandleType = TransformHandleDirection | "rotation";
@@ -14,11 +13,11 @@ export declare const OMIT_SIDES_FOR_MULTIPLE_ELEMENTS: {
14
13
  n: boolean;
15
14
  w: boolean;
16
15
  };
17
- export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, zoom: Zoom, pointerType: PointerType, omitSides?: {
18
- e?: boolean | undefined;
16
+ export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [number, number, number, number, number, number], angle: number, zoom: Zoom, pointerType: PointerType, omitSides?: {
19
17
  s?: boolean | undefined;
20
- w?: boolean | undefined;
18
+ e?: boolean | undefined;
21
19
  n?: boolean | undefined;
20
+ w?: boolean | undefined;
22
21
  nw?: boolean | undefined;
23
22
  ne?: boolean | undefined;
24
23
  sw?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  import { AppState } from "../types";
2
- import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawGenericElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer } from "./types";
2
+ import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawGenericElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, RoundnessType } from "./types";
3
3
  export declare const isGenericElement: (element: ExcalidrawElement | null) => element is ExcalidrawGenericElement;
4
4
  export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
5
5
  export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
@@ -7,6 +7,7 @@ export declare const isTextElement: (element: ExcalidrawElement | null) => eleme
7
7
  export declare const isFreeDrawElement: (element?: ExcalidrawElement | null) => element is ExcalidrawFreeDrawElement;
8
8
  export declare const isFreeDrawElementType: (elementType: ExcalidrawElement["type"]) => boolean;
9
9
  export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
10
+ export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
10
11
  export declare const isLinearElementType: (elementType: AppState["activeTool"]["type"]) => boolean;
11
12
  export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
12
13
  export declare const isBindingElementType: (elementType: AppState["activeTool"]["type"]) => boolean;
@@ -15,3 +16,11 @@ export declare const isTextBindableContainer: (element: ExcalidrawElement | null
15
16
  export declare const isExcalidrawElement: (element: any) => boolean;
16
17
  export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is ExcalidrawBindableElement;
17
18
  export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
19
+ export declare const isUsingAdaptiveRadius: (type: string) => boolean;
20
+ export declare const isUsingProportionalRadius: (type: string) => boolean;
21
+ export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
22
+ export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElement) => {
23
+ type: 2;
24
+ } | {
25
+ type: 3;
26
+ } | null;
@@ -1,5 +1,5 @@
1
1
  import { Point } from "../types";
2
- import { FONT_FAMILY, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
2
+ import { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
3
3
  export declare type ChartType = "bar" | "line";
4
4
  export declare type FillStyle = "hachure" | "cross-hatch" | "solid";
5
5
  export declare type FontFamilyKeys = keyof typeof FONT_FAMILY;
@@ -10,7 +10,8 @@ export declare type FontString = string & {
10
10
  };
11
11
  export declare type GroupId = string;
12
12
  export declare type PointerType = "mouse" | "pen" | "touch";
13
- export declare type StrokeSharpness = "round" | "sharp";
13
+ export declare type StrokeRoundness = "round" | "sharp";
14
+ export declare type RoundnessType = ValueOf<typeof ROUNDNESS>;
14
15
  export declare type StrokeStyle = "solid" | "dashed" | "dotted";
15
16
  export declare type TextAlign = typeof TEXT_ALIGN[keyof typeof TEXT_ALIGN];
16
17
  declare type VerticalAlignKeys = keyof typeof VERTICAL_ALIGN;
@@ -24,7 +25,10 @@ declare type _ExcalidrawElementBase = Readonly<{
24
25
  fillStyle: FillStyle;
25
26
  strokeWidth: number;
26
27
  strokeStyle: StrokeStyle;
27
- strokeSharpness: StrokeSharpness;
28
+ roundness: null | {
29
+ type: RoundnessType;
30
+ value?: number;
31
+ };
28
32
  roughness: number;
29
33
  opacity: number;
30
34
  width: number;
@@ -103,7 +107,7 @@ export declare type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
103
107
  originalText: string;
104
108
  }>;
105
109
  export declare type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement;
106
- export declare type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawImageElement;
110
+ export declare type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawImageElement | ExcalidrawArrowElement;
107
111
  export declare type ExcalidrawTextElementWithContainer = {
108
112
  containerId: ExcalidrawTextContainer["id"];
109
113
  } & ExcalidrawTextElement;
@@ -122,6 +126,9 @@ export declare type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<
122
126
  startArrowhead: Arrowhead | null;
123
127
  endArrowhead: Arrowhead | null;
124
128
  }>;
129
+ export declare type ExcalidrawArrowElement = ExcalidrawLinearElement & Readonly<{
130
+ type: "arrow";
131
+ }>;
125
132
  export declare type ExcalidrawFreeDrawElement = _ExcalidrawElementBase & Readonly<{
126
133
  type: "freedraw";
127
134
  points: readonly Point[];