@dwelle/excalidraw 0.3.51 → 0.3.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dwelle/excalidraw",
3
- "version": "0.3.51",
3
+ "version": "0.3.54",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -49,12 +49,12 @@
49
49
  "babel-loader": "8.2.3",
50
50
  "babel-plugin-transform-class-properties": "6.24.1",
51
51
  "cross-env": "7.0.3",
52
- "css-loader": "6.6.0",
52
+ "css-loader": "6.7.1",
53
53
  "mini-css-extract-plugin": "2.4.6",
54
54
  "postcss-loader": "6.2.1",
55
55
  "sass-loader": "12.4.0",
56
56
  "terser-webpack-plugin": "5.3.1",
57
- "ts-loader": "9.2.6",
57
+ "ts-loader": "9.2.8",
58
58
  "typescript": "4.5.4",
59
59
  "webpack": "5.65.0",
60
60
  "webpack-bundle-analyzer": "4.5.0",
@@ -749,7 +749,8 @@ export declare const actionErase: {
749
749
  };
750
750
  commitToHistory: true;
751
751
  };
752
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
752
753
  PanelComponent: ({ elements, appState, updateData, data }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
753
754
  } & {
754
- keyTest?: undefined;
755
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
755
756
  };
@@ -178,7 +178,7 @@ export declare const actionFinalize: {
178
178
  commitToHistory: boolean;
179
179
  };
180
180
  keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: import("../types").AppState) => boolean;
181
- PanelComponent: ({ appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
181
+ PanelComponent: ({ appState, updateData, data }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
182
182
  } & {
183
183
  keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: import("../types").AppState) => boolean) | undefined;
184
184
  };
@@ -8,13 +8,14 @@ export declare const SelectedShapeActions: ({ appState, elements, renderAction,
8
8
  renderAction: ActionManager["renderAction"];
9
9
  elementType: AppState["elementType"];
10
10
  }) => JSX.Element;
11
- export declare const ShapesSwitcher: ({ canvas, elementType, setAppState, onImageAction, }: {
11
+ export declare const ShapesSwitcher: ({ canvas, elementType, setAppState, onImageAction, appState, }: {
12
12
  canvas: HTMLCanvasElement | null;
13
13
  elementType: AppState["elementType"];
14
14
  setAppState: React.Component<any, AppState>["setState"];
15
15
  onImageAction: (data: {
16
16
  pointerType: PointerType | null;
17
17
  }) => void;
18
+ appState: AppState;
18
19
  }) => JSX.Element;
19
20
  export declare const ZoomActions: ({ renderAction, zoom, }: {
20
21
  renderAction: ActionManager["renderAction"];
@@ -3,8 +3,8 @@ import { RoughCanvas } from "roughjs/bin/canvas";
3
3
  import { ActionManager } from "../actions/manager";
4
4
  import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
5
5
  import History from "../history";
6
- import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData } from "../types";
7
- export declare const useIsMobile: () => boolean;
6
+ import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, DeviceType } from "../types";
7
+ export declare const useDeviceType: () => DeviceType;
8
8
  export declare const useExcalidrawContainer: () => {
9
9
  container: HTMLDivElement | null;
10
10
  id?: string | null | undefined;
@@ -14,7 +14,7 @@ declare class App extends React.Component<AppProps, AppState> {
14
14
  rc: RoughCanvas | null;
15
15
  unmounted: boolean;
16
16
  actionManager: ActionManager;
17
- isMobile: boolean;
17
+ deviceType: DeviceType;
18
18
  detachIsMobileMqHandler?: () => void;
19
19
  private excalidrawContainerRef;
20
20
  static defaultProps: Partial<AppProps>;
package/types/shapes.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare const SHAPES: readonly [{
14
14
  }, {
15
15
  readonly icon: JSX.Element;
16
16
  readonly value: "ellipse";
17
- readonly key: "e";
17
+ readonly key: "o";
18
18
  }, {
19
19
  readonly icon: JSX.Element;
20
20
  readonly value: "arrow";
package/types/types.d.ts CHANGED
@@ -341,4 +341,8 @@ export declare type ExcalidrawImperativeAPI = {
341
341
  id: string;
342
342
  app: InstanceType<typeof App>;
343
343
  };
344
+ export declare type DeviceType = {
345
+ isMobile: boolean;
346
+ isTouchScreen: boolean;
347
+ };
344
348
  export {};
package/types/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EVENT } from "./constants";
2
2
  import { FontFamilyValues, FontString } from "./element/types";
3
- import { Zoom } from "./types";
3
+ import { AppState, Zoom } from "./types";
4
4
  export declare const setDateTimeForTests: (dateTime: string) => void;
5
5
  export declare const getDateTime: () => string;
6
6
  export declare const capitalizeString: (str: string) => string;
@@ -31,7 +31,8 @@ export declare const removeSelection: () => void;
31
31
  export declare const distance: (x: number, y: number) => number;
32
32
  export declare const resetCursor: (canvas: HTMLCanvasElement | null) => void;
33
33
  export declare const setCursor: (canvas: HTMLCanvasElement | null, cursor: string) => void;
34
- export declare const setCursorForShape: (canvas: HTMLCanvasElement | null, shape: string) => void;
34
+ export declare const setEraserCursor: (canvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;
35
+ export declare const setCursorForShape: (canvas: HTMLCanvasElement | null, appState: AppState) => void;
35
36
  export declare const isFullScreen: () => boolean;
36
37
  export declare const allowFullScreen: () => Promise<void>;
37
38
  export declare const exitFullScreen: () => Promise<void>;
@@ -116,3 +117,4 @@ export declare const isTestEnv: () => boolean;
116
117
  export declare const wrapEvent: <T extends Event>(name: EVENT, nativeEvent: T) => CustomEvent<{
117
118
  nativeEvent: T;
118
119
  }>;
120
+ export declare const updateObject: <T extends Record<string, any>>(obj: T, updates: Partial<T>) => T;