@dwelle/excalidraw 0.3.75 → 0.3.77-debug

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 (74) hide show
  1. package/dist/excalidraw-assets/vendor-b9b3a25c026c138e55b2.js +2 -0
  2. package/dist/excalidraw-assets/vendor-b9b3a25c026c138e55b2.js.LICENSE.txt +6 -0
  3. package/dist/excalidraw-assets-dev/{vendor-4534d6e506404cef7a9e.js → vendor-33bd21df77fc9cda16d2.js} +66 -0
  4. package/dist/excalidraw.development.js +151 -157
  5. package/dist/excalidraw.production.min.js +1 -1
  6. package/dist/excalidraw.production.min.js.LICENSE.txt +1 -17
  7. package/package.json +20 -22
  8. package/types/actions/actionAlign.d.ts +6 -6
  9. package/types/actions/actionCanvas.d.ts +7 -7
  10. package/types/actions/actionDeleteSelected.d.ts +1 -1
  11. package/types/actions/actionDistribute.d.ts +2 -2
  12. package/types/actions/actionDuplicateSelection.d.ts +1 -1
  13. package/types/actions/actionExport.d.ts +8 -8
  14. package/types/actions/actionFinalize.d.ts +1 -1
  15. package/types/actions/actionGroup.d.ts +2 -2
  16. package/types/actions/actionMenu.d.ts +3 -3
  17. package/types/actions/actionNavigate.d.ts +1 -2
  18. package/types/actions/actionProperties.d.ts +13 -13
  19. package/types/actions/actionSelectAll.d.ts +2 -1
  20. package/types/actions/actionZindex.d.ts +4 -4
  21. package/types/analytics.d.ts +1 -1
  22. package/types/clients.d.ts +1 -1
  23. package/types/components/ActiveFile.d.ts +0 -1
  24. package/types/components/App.d.ts +78 -1
  25. package/types/components/ButtonIconSelect.d.ts +0 -1
  26. package/types/components/Card.d.ts +1 -0
  27. package/types/components/CheckboxItem.d.ts +1 -0
  28. package/types/components/ClearCanvas.d.ts +0 -1
  29. package/types/components/CollabButton.d.ts +0 -1
  30. package/types/components/ColorPicker.d.ts +0 -1
  31. package/types/components/ConfirmDialog.d.ts +0 -1
  32. package/types/components/DarkModeToggle.d.ts +0 -1
  33. package/types/components/ErrorDialog.d.ts +0 -1
  34. package/types/components/HelpDialog.d.ts +0 -1
  35. package/types/components/HelpIcon.d.ts +0 -1
  36. package/types/components/HintViewer.d.ts +0 -1
  37. package/types/components/IconPicker.d.ts +0 -1
  38. package/types/components/ImageExportDialog.d.ts +0 -1
  39. package/types/components/JSONExportDialog.d.ts +0 -1
  40. package/types/components/LibraryMenu.d.ts +0 -1
  41. package/types/components/LibraryUnit.d.ts +0 -1
  42. package/types/components/LockButton.d.ts +0 -1
  43. package/types/components/Modal.d.ts +2 -2
  44. package/types/components/PenModeButton.d.ts +0 -1
  45. package/types/components/ProjectName.d.ts +0 -1
  46. package/types/components/PublishLibrary.d.ts +0 -1
  47. package/types/components/Section.d.ts +4 -5
  48. package/types/components/SidebarLockButton.d.ts +0 -1
  49. package/types/components/SingleLibraryItem.d.ts +0 -1
  50. package/types/components/Spinner.d.ts +0 -1
  51. package/types/components/Toast.d.ts +0 -1
  52. package/types/data/blob.d.ts +4 -4
  53. package/types/data/json.d.ts +1 -1
  54. package/types/element/Hyperlink.d.ts +1 -1
  55. package/types/element/binding.d.ts +3 -3
  56. package/types/element/dragElements.d.ts +1 -1
  57. package/types/element/index.d.ts +1 -1
  58. package/types/element/mutateElement.d.ts +1 -1
  59. package/types/element/sizeHelpers.d.ts +4 -0
  60. package/types/element/textElement.d.ts +1 -1
  61. package/types/element/typeChecks.d.ts +3 -3
  62. package/types/keys.d.ts +1 -1
  63. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-6644c8f79d52085cf653.d.ts +0 -0
  64. package/types/packages/excalidraw/dist/excalidraw-assets/vendor-b9b3a25c026c138e55b2.d.ts +0 -0
  65. package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-33bd21df77fc9cda16d2.d.ts +0 -0
  66. package/types/packages/excalidraw/dist/excalidraw.production.min.d.ts +5 -1
  67. package/types/packages/excalidraw/example/App.d.ts +0 -1
  68. package/types/packages/excalidraw/webpack.prod.config.d.ts +2 -1
  69. package/types/renderer/renderElement.d.ts +1 -1
  70. package/types/shapes.d.ts +0 -1
  71. package/types/types.d.ts +1 -0
  72. package/types/utils.d.ts +6 -6
  73. package/dist/excalidraw-assets/vendor-aed19b6e017f9f736254.js +0 -2
  74. package/dist/excalidraw-assets/vendor-aed19b6e017f9f736254.js.LICENSE.txt +0 -12
@@ -123,6 +123,84 @@ declare class App extends React.Component<AppProps, AppState> {
123
123
  };
124
124
  };
125
125
  }>, event: React.PointerEvent<HTMLCanvasElement>]>;
126
+ onPointerUpEmitter: Emitter<[activeTool: {
127
+ type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
128
+ lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
129
+ locked: boolean;
130
+ customType: null;
131
+ } | {
132
+ type: "custom";
133
+ customType: string;
134
+ lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
135
+ locked: boolean;
136
+ }, pointerDownState: Readonly<{
137
+ origin: Readonly<{
138
+ x: number;
139
+ y: number;
140
+ }>;
141
+ originInGrid: Readonly<{
142
+ x: number;
143
+ y: number;
144
+ }>;
145
+ scrollbars: {
146
+ isOverEither: boolean;
147
+ isOverHorizontal: boolean;
148
+ isOverVertical: boolean;
149
+ };
150
+ lastCoords: {
151
+ x: number;
152
+ y: number;
153
+ };
154
+ originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
155
+ resize: {
156
+ handleType: import("../element/transformHandles").MaybeTransformHandleType;
157
+ isResizing: boolean;
158
+ offset: {
159
+ x: number;
160
+ y: number;
161
+ };
162
+ arrowDirection: "end" | "origin";
163
+ center: {
164
+ x: number;
165
+ y: number;
166
+ };
167
+ };
168
+ hit: {
169
+ element: NonDeleted<ExcalidrawElement> | null;
170
+ allHitElements: NonDeleted<ExcalidrawElement>[];
171
+ wasAddedToSelection: boolean;
172
+ hasBeenDuplicated: boolean;
173
+ hasHitCommonBoundingBoxOfSelectedElements: boolean;
174
+ hasHitElementInside: boolean;
175
+ };
176
+ withCmdOrCtrl: boolean;
177
+ drag: {
178
+ hasOccurred: boolean;
179
+ offset: {
180
+ x: number;
181
+ y: number;
182
+ } | null;
183
+ };
184
+ eventListeners: {
185
+ onMove: {
186
+ (...args: any[]): void;
187
+ flush(): void;
188
+ cancel(): void;
189
+ } | null;
190
+ onUp: ((event: PointerEvent) => void) | null;
191
+ onKeyDown: ((event: KeyboardEvent) => void) | null;
192
+ onKeyUp: ((event: KeyboardEvent) => void) | null;
193
+ };
194
+ boxSelection: {
195
+ hasOccurred: boolean;
196
+ };
197
+ elementIdsToErase: {
198
+ [key: string]: {
199
+ opacity: number;
200
+ erase: boolean;
201
+ };
202
+ };
203
+ }>, event: PointerEvent]>;
126
204
  constructor(props: AppProps);
127
205
  private renderCanvas;
128
206
  render(): JSX.Element;
@@ -144,7 +222,6 @@ declare class App extends React.Component<AppProps, AppState> {
144
222
  private refreshDeviceState;
145
223
  componentDidMount(): Promise<void>;
146
224
  componentWillUnmount(): void;
147
- private checkIfBrowserZoomed;
148
225
  private onResize;
149
226
  private removeEventListeners;
150
227
  private addEventListeners;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ButtonIconSelect: <T extends Object>({ options, value, onChange, group, }: {
3
2
  options: {
4
3
  value: T;
@@ -3,4 +3,5 @@ import OpenColor from "open-color";
3
3
  import "./Card.scss";
4
4
  export declare const Card: React.FC<{
5
5
  color: keyof OpenColor | "primary";
6
+ children?: React.ReactNode;
6
7
  }>;
@@ -4,4 +4,5 @@ export declare const CheckboxItem: React.FC<{
4
4
  checked: boolean;
5
5
  onChange: (checked: boolean, event: React.MouseEvent) => void;
6
6
  className?: string;
7
+ children?: React.ReactNode;
7
8
  }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const ClearCanvas: ({ onConfirm }: {
3
2
  onConfirm: () => void;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./CollabButton.scss";
3
2
  declare const CollabButton: ({ isCollaborating, collaboratorCount, onClick, }: {
4
3
  isCollaborating: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ColorPicker.scss";
3
2
  import { ExcalidrawElement } from "../element/types";
4
3
  import { AppState } from "../types";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DialogProps } from "./Dialog";
3
2
  import "./ConfirmDialog.scss";
4
3
  interface Props extends Omit<DialogProps, "onCloseRequest"> {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToolIcon.scss";
3
2
  import { Theme } from "../element/types";
4
3
  export declare const DarkModeToggle: (props: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const ErrorDialog: ({ message, onClose, }: {
3
2
  message: string;
4
3
  onClose?: (() => void) | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./HelpDialog.scss";
3
2
  export declare const HelpDialog: ({ onClose }: {
4
3
  onClose?: (() => void) | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type HelpIconProps = {
3
2
  title?: string;
4
3
  name?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NonDeletedExcalidrawElement } from "../element/types";
3
2
  import "./HintViewer.scss";
4
3
  import { AppState } from "../types";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./IconPicker.scss";
3
2
  export declare function IconPicker<T>({ value, label, options, onChange, group, }: {
4
3
  label: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NonDeletedExcalidrawElement } from "../element/types";
3
2
  import { AppState, BinaryFiles } from "../types";
4
3
  import "./ExportDialog.scss";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { NonDeletedExcalidrawElement } from "../element/types";
3
2
  import { AppState, CanvasActions, BinaryFiles } from "../types";
4
3
  import "./ExportDialog.scss";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import Library from "../data/library";
3
2
  import { LibraryItems, LibraryItem, AppState, BinaryFiles, ExcalidrawProps } from "../types";
4
3
  import "./LibraryMenu.scss";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BinaryFiles, LibraryItem } from "../types";
3
2
  import "./LibraryUnit.scss";
4
3
  export declare const LibraryUnit: ({ id, elements, files, isPending, onClick, selected, onToggle, onDrag, }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToolIcon.scss";
3
2
  declare type LockIconProps = {
4
3
  title?: string;
@@ -1,7 +1,7 @@
1
1
  import "./Modal.scss";
2
2
  import React from "react";
3
3
  import { AppState } from "../types";
4
- export declare const Modal: (props: {
4
+ export declare const Modal: React.FC<{
5
5
  className?: string;
6
6
  children: React.ReactNode;
7
7
  maxWidth?: number;
@@ -9,4 +9,4 @@ export declare const Modal: (props: {
9
9
  labelledBy: string;
10
10
  theme?: AppState["theme"];
11
11
  closeOnClickOutside?: boolean;
12
- }) => React.ReactPortal | null;
12
+ }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToolIcon.scss";
3
2
  declare type PenModeIconProps = {
4
3
  title?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./TextInput.scss";
3
2
  import "./ProjectName.scss";
4
3
  declare type Props = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AppState, LibraryItems } from "../types";
3
2
  import "./PublishLibrary.scss";
4
3
  declare const PublishLibrary: ({ onClose, libraryItems, appState, onSuccess, onError, updateItemsInStorage, onRemove, }: {
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
- interface SectionProps extends React.HTMLProps<HTMLElement> {
2
+ export declare const Section: React.FC<{
3
3
  heading: string;
4
- children: React.ReactNode | ((header: React.ReactNode) => React.ReactNode);
5
- }
6
- export declare const Section: ({ heading, children, ...props }: SectionProps) => JSX.Element;
7
- export {};
4
+ children?: React.ReactNode | ((heading: React.ReactNode) => React.ReactNode);
5
+ className?: string;
6
+ }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./ToolIcon.scss";
3
2
  import "./SidebarLockButton.scss";
4
3
  declare type SidebarLockIconProps = {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AppState, LibraryItem } from "../types";
3
2
  import "./SingleLibraryItem.scss";
4
3
  declare const SingleLibraryItem: ({ libItem, appState, index, onChange, onRemove, }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./Spinner.scss";
3
2
  declare const Spinner: ({ size, circleWidth, }: {
4
3
  size?: string | number | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./Toast.scss";
3
2
  export declare const Toast: ({ message, onClose, closable, duration, }: {
4
3
  message: string;
@@ -8,16 +8,16 @@ export declare const getFileHandleType: (handle: FileSystemHandle | null) => str
8
8
  export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
9
9
  export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
10
10
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
11
- type: typeof ALLOWED_IMAGE_MIME_TYPES[number];
11
+ type: (typeof ALLOWED_IMAGE_MIME_TYPES)[number];
12
12
  };
13
- export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null | undefined) => Promise<{
13
+ export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<{
14
14
  type: "application/vnd.excalidraw+json";
15
15
  data: import("./restore").RestoredDataState;
16
16
  } | {
17
17
  type: "application/vnd.excalidrawlib+json";
18
18
  data: ImportedLibraryData;
19
19
  }>;
20
- export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null | undefined) => Promise<import("./restore").RestoredDataState>;
20
+ export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<import("./restore").RestoredDataState>;
21
21
  export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
22
22
  export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
23
23
  export declare const canvasToBlob: (canvas: HTMLCanvasElement) => Promise<Blob>;
@@ -28,7 +28,7 @@ export declare const getDataURL: (file: Blob | File) => Promise<DataURL>;
28
28
  export declare const dataURLToFile: (dataURL: DataURL, filename?: string) => File;
29
29
  export declare const resizeImageFile: (file: File, opts: {
30
30
  /** undefined indicates auto */
31
- outputType?: typeof MIME_TYPES["jpg"];
31
+ outputType?: (typeof MIME_TYPES)["jpg"];
32
32
  maxWidthOrHeight: number;
33
33
  }) => Promise<File>;
34
34
  export declare const SVGStringToFile: (SVGString: string, filename?: string) => File & {
@@ -10,7 +10,7 @@ export declare const isValidExcalidrawData: (data?: {
10
10
  type?: any;
11
11
  elements?: any;
12
12
  appState?: any;
13
- } | undefined) => data is ImportedDataState;
13
+ }) => data is ImportedDataState;
14
14
  export declare const isValidLibrary: (json: any) => json is ImportedLibraryData;
15
15
  export declare const serializeLibraryAsJSON: (libraryItems: LibraryItems) => string;
16
16
  export declare const saveLibraryAsJSON: (libraryItems: LibraryItems) => Promise<void>;
@@ -123,7 +123,7 @@ export declare const actionLink: {
123
123
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
124
124
  contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
125
125
  contextItemPredicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
126
- PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("../actions/types").PanelComponentProps>) => JSX.Element;
126
+ PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => JSX.Element;
127
127
  } & {
128
128
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
129
129
  };
@@ -22,12 +22,12 @@ export declare const getHoveredElementForBinding: (pointerCoords: {
22
22
  y: number;
23
23
  }, scene: Scene) => NonDeleted<ExcalidrawBindableElement> | null;
24
24
  export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, options?: {
25
- simultaneouslyUpdated?: readonly ExcalidrawElement[] | undefined;
25
+ simultaneouslyUpdated?: readonly ExcalidrawElement[];
26
26
  newSize?: {
27
27
  width: number;
28
28
  height: number;
29
- } | undefined;
30
- } | undefined) => void;
29
+ };
30
+ }) => void;
31
31
  export declare const getEligibleElementsForBinding: (elements: NonDeleted<ExcalidrawElement>[]) => SuggestedBinding[];
32
32
  export declare const fixBindingsAfterDuplication: (sceneElements: readonly ExcalidrawElement[], oldElements: readonly ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>, duplicatesServeAsOld?: "duplicatesServeAsOld" | undefined) => void;
33
33
  export declare const fixBindingsAfterDeletion: (sceneElements: readonly ExcalidrawElement[], deletedElements: readonly ExcalidrawElement[]) => void;
@@ -2,4 +2,4 @@ import { NonDeletedExcalidrawElement } from "./types";
2
2
  import { AppState, PointerDownState } from "../types";
3
3
  export declare const dragSelectedElements: (pointerDownState: PointerDownState, selectedElements: NonDeletedExcalidrawElement[], pointerX: number, pointerY: number, lockDirection: boolean | undefined, distanceX: number | undefined, distanceY: number | undefined, appState: AppState) => void;
4
4
  export declare const getDragOffsetXY: (selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
5
- export declare const dragNewElement: (draggingElement: NonDeletedExcalidrawElement, elementType: AppState["activeTool"]["type"], originX: number, originY: number, x: number, y: number, width: number, height: number, shouldMaintainAspectRatio: boolean, shouldResizeFromCenter: boolean, widthAspectRatio?: number | null | undefined) => void;
5
+ export declare const dragNewElement: (draggingElement: NonDeletedExcalidrawElement, elementType: AppState["activeTool"]["type"], originX: number, originY: number, x: number, y: number, width: number, height: number, shouldMaintainAspectRatio: boolean, shouldResizeFromCenter: boolean, widthAspectRatio?: number | null) => void;
@@ -9,7 +9,7 @@ export { dragSelectedElements, getDragOffsetXY, dragNewElement, } from "./dragEl
9
9
  export { isTextElement, isExcalidrawElement } from "./typeChecks";
10
10
  export { textWysiwyg } from "./textWysiwyg";
11
11
  export { redrawTextBoundingBox } from "./textElement";
12
- export { getPerfectElementSize, isInvisiblySmallElement, resizePerfectLineForNWHandler, getNormalizedDimensions, } from "./sizeHelpers";
12
+ export { getPerfectElementSize, getLockedLinearCursorAlignSize, isInvisiblySmallElement, resizePerfectLineForNWHandler, getNormalizedDimensions, } from "./sizeHelpers";
13
13
  export { showSelectedShapeActions } from "./showSelectedShapeActions";
14
14
  export declare const getSceneVersion: (elements: readonly ExcalidrawElement[]) => number;
15
15
  export declare const getVisibleElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
@@ -7,5 +7,5 @@ export declare const newElementWith: <TElement extends ExcalidrawElement>(elemen
7
7
  *
8
8
  * NOTE: does not trigger re-render.
9
9
  */
10
- export declare const bumpVersion: (element: Mutable<ExcalidrawElement>, version?: number | undefined) => Mutable<ExcalidrawElement>;
10
+ export declare const bumpVersion: (element: Mutable<ExcalidrawElement>, version?: ExcalidrawElement["version"]) => Mutable<ExcalidrawElement>;
11
11
  export {};
@@ -8,6 +8,10 @@ export declare const getPerfectElementSize: (elementType: AppState["activeTool"]
8
8
  width: number;
9
9
  height: number;
10
10
  };
11
+ export declare const getLockedLinearCursorAlignSize: (originX: number, originY: number, x: number, y: number) => {
12
+ width: number;
13
+ height: number;
14
+ };
11
15
  export declare const resizePerfectLineForNWHandler: (element: ExcalidrawElement, x: number, y: number) => void;
12
16
  export declare const getNormalizedDimensions: (element: Pick<ExcalidrawElement, "width" | "height" | "x" | "y">) => {
13
17
  width: ExcalidrawElement["width"];
@@ -3,7 +3,7 @@ import { MaybeTransformHandleType } from "./transformHandles";
3
3
  export declare const redrawTextBoundingBox: (element: ExcalidrawTextElement, container: ExcalidrawElement | null) => void;
4
4
  export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
5
5
  export declare const handleBindTextResize: (element: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
6
- export declare const measureText: (text: string, font: FontString, maxWidth?: number | null | undefined) => {
6
+ export declare const measureText: (text: string, font: FontString, maxWidth?: number | null) => {
7
7
  width: number;
8
8
  height: number;
9
9
  baseline: number;
@@ -4,11 +4,11 @@ export declare const isGenericElement: (element: ExcalidrawElement | null) => el
4
4
  export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
5
5
  export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
6
6
  export declare const isTextElement: (element: ExcalidrawElement | null) => element is ExcalidrawTextElement;
7
- export declare const isFreeDrawElement: (element?: ExcalidrawElement | null | undefined) => element is ExcalidrawFreeDrawElement;
7
+ export declare const isFreeDrawElement: (element?: ExcalidrawElement | null) => element is ExcalidrawFreeDrawElement;
8
8
  export declare const isFreeDrawElementType: (elementType: ExcalidrawElement["type"]) => boolean;
9
- export declare const isLinearElement: (element?: ExcalidrawElement | null | undefined) => element is ExcalidrawLinearElement;
9
+ export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
10
10
  export declare const isLinearElementType: (elementType: AppState["activeTool"]["type"]) => boolean;
11
- export declare const isBindingElement: (element?: ExcalidrawElement | null | undefined, includeLocked?: boolean) => element is ExcalidrawLinearElement;
11
+ export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
12
12
  export declare const isBindingElementType: (elementType: AppState["activeTool"]["type"]) => boolean;
13
13
  export declare const isBindableElement: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawBindableElement;
14
14
  export declare const isTextBindableContainer: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawTextContainer;
package/types/keys.d.ts CHANGED
@@ -65,4 +65,4 @@ export declare type Key = keyof typeof KEYS;
65
65
  export declare const isArrowKey: (key: string) => boolean;
66
66
  export declare const shouldResizeFromCenter: (event: MouseEvent | KeyboardEvent) => boolean;
67
67
  export declare const shouldMaintainAspectRatio: (event: MouseEvent | KeyboardEvent) => boolean;
68
- export declare const shouldRotateWithDiscreteAngle: (event: MouseEvent | KeyboardEvent) => boolean;
68
+ export declare const shouldRotateWithDiscreteAngle: (event: MouseEvent | KeyboardEvent | React.PointerEvent<HTMLCanvasElement>) => boolean;
@@ -1 +1,5 @@
1
- export const ExcalidrawLib: {};
1
+ export function assign(e: any, ...args: any[]): any;
2
+ export function shrinkBuf(e: any, t: any): any;
3
+ export function setTyped(e: any): void;
4
+ declare const ExcalidrawLib: {};
5
+ export { Array as Buf8, Array as Buf16, Array as Buf32 };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./App.scss";
3
2
  declare global {
4
3
  interface Window {
@@ -1,4 +1,5 @@
1
1
  import autoprefixer = require("autoprefixer");
2
+ import TerserPlugin = require("terser-webpack-plugin");
2
3
  export const mode: string;
3
4
  export const entry: {
4
5
  "excalidraw.production.min": string;
@@ -63,7 +64,7 @@ export namespace module {
63
64
  }
64
65
  export namespace optimization {
65
66
  const minimize: boolean;
66
- const minimizer: import("terser-webpack-plugin/types").default<import("terser").MinifyOptions>[];
67
+ const minimizer: TerserPlugin<import("terser").MinifyOptions>[];
67
68
  namespace splitChunks {
68
69
  const chunks: string;
69
70
  namespace cacheGroups {
@@ -27,7 +27,7 @@ export declare const invalidateShapeForElement: (element: ExcalidrawElement) =>
27
27
  export declare const clearRenderCache: () => void;
28
28
  export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
29
29
  export declare const renderElement: (element: NonDeletedExcalidrawElement, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: RenderConfig) => void;
30
- export declare const renderElementToSvg: (element: NonDeletedExcalidrawElement, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, offsetX?: number | undefined, offsetY?: number | undefined, exportWithDarkMode?: boolean | undefined) => void;
30
+ export declare const renderElementToSvg: (element: NonDeletedExcalidrawElement, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, offsetX?: number, offsetY?: number, exportWithDarkMode?: boolean) => void;
31
31
  export declare let pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
32
32
  export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
33
33
  export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
package/types/shapes.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const SHAPES: readonly [{
3
2
  readonly icon: JSX.Element;
4
3
  readonly value: "selection";
package/types/types.d.ts CHANGED
@@ -381,6 +381,7 @@ export declare type ExcalidrawImperativeAPI = {
381
381
  app: InstanceType<typeof App>;
382
382
  onChange: (callback: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => void) => UnsubscribeCallback;
383
383
  onPointerDown: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: React.PointerEvent<HTMLCanvasElement>) => void) => UnsubscribeCallback;
384
+ onPointerUp: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: PointerEvent) => void) => UnsubscribeCallback;
384
385
  };
385
386
  export declare type Device = Readonly<{
386
387
  isSmScreen: boolean;
package/types/utils.d.ts CHANGED
@@ -6,8 +6,8 @@ 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 HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLBRElement | HTMLDivElement;
10
- export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLTextAreaElement | HTMLBRElement | HTMLDivElement;
9
+ export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLBRElement | HTMLDivElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
10
+ export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLBRElement | HTMLDivElement | HTMLInputElement | HTMLTextAreaElement;
11
11
  export declare const getFontFamilyString: ({ fontFamily, }: {
12
12
  fontFamily: FontFamilyValues;
13
13
  }) => string;
@@ -22,8 +22,8 @@ export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeo
22
22
  cancel(): void;
23
23
  };
24
24
  export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void, opts?: {
25
- trailing?: boolean | undefined;
26
- } | undefined) => {
25
+ trailing?: boolean;
26
+ }) => {
27
27
  (...args: T): void;
28
28
  flush(): void;
29
29
  cancel(): void;
@@ -33,7 +33,7 @@ export declare const selectNode: (node: Element) => void;
33
33
  export declare const removeSelection: () => void;
34
34
  export declare const distance: (x: number, y: number) => number;
35
35
  export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: ({
36
- type: typeof SHAPES[number]["value"] | "eraser";
36
+ type: (typeof SHAPES)[number]["value"] | "eraser";
37
37
  } | {
38
38
  type: "custom";
39
39
  customType: string;
@@ -87,7 +87,7 @@ export declare const tupleToCoors: (xyTuple: readonly [number, number]) => {
87
87
  y: number;
88
88
  };
89
89
  /** use as a rejectionHandler to mute filesystem Abort errors */
90
- export declare const muteFSAbortError: (error?: Error | undefined) => void;
90
+ export declare const muteFSAbortError: (error?: Error) => void;
91
91
  export declare const findIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
92
92
  export declare const findLastIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
93
93
  export declare const isTransparent: (color: string) => boolean;