@myoc/element 0.19.541 → 0.19.543

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.
@@ -1,16 +1,82 @@
1
- export declare const actionSmartZoom: {
2
- name: "smartZoom";
3
- label: string;
4
- trackEvent: {
5
- category: "toolbar";
1
+ import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
+ type SmartZoomTarget = readonly ExcalidrawElement[];
3
+ export declare const SMART_ZOOM_KEY_HINT = "Press <kbd>F</kbd> quickly to smart zoom the canvas, or hold and click on an item to smart zoom to it";
4
+ export declare const smartZoomKeyHeldAtom: import("jotai").PrimitiveAtom<boolean> & {
5
+ init: boolean;
6
+ };
7
+ export declare const getNextSmartZoomImage: (elements: readonly NonDeletedExcalidrawElement[], elementsMap: NonDeletedSceneElementsMap, currentImageId: ExcalidrawElement["id"] | null, direction: "previous" | "next") => (Readonly<{
8
+ id: string;
9
+ x: number;
10
+ y: number;
11
+ strokeColor: string;
12
+ backgroundColor: string;
13
+ fillStyle: import("@excalidraw/element/types").FillStyle;
14
+ strokeWidth: number;
15
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
16
+ roundness: null | {
17
+ type: import("@excalidraw/element/types").RoundnessType;
18
+ value?: number;
6
19
  };
7
- icon: import("react/jsx-runtime").JSX.Element;
8
- viewMode: true;
9
- perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties) => {
10
- captureUpdate: "NEVER";
20
+ roughness: number;
21
+ opacity: number;
22
+ width: number;
23
+ height: number;
24
+ angle: import("@excalidraw/math").Radians;
25
+ seed: number;
26
+ version: number;
27
+ versionNonce: number;
28
+ index: import("@excalidraw/element/types").FractionalIndex | null;
29
+ isDeleted: boolean;
30
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
31
+ frameId: string | null;
32
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
33
+ updated: number;
34
+ link: string | null;
35
+ locked: boolean;
36
+ customData?: Record<string, any>;
37
+ }> & Readonly<{
38
+ type: "image";
39
+ fileId: import("@excalidraw/element/types").FileId | null;
40
+ fileName: string | null;
41
+ thumbHash: string | null;
42
+ status: "pending" | "saved" | "error";
43
+ scale: [number, number];
44
+ crop: import("@excalidraw/element/types").ImageCrop | null;
45
+ gifPlayback: import("@excalidraw/element/types").ExcalidrawGifPlayback | null;
46
+ }> & {
47
+ isDeleted: false;
48
+ } & Readonly<{
49
+ id: string;
50
+ x: number;
51
+ y: number;
52
+ strokeColor: string;
53
+ backgroundColor: string;
54
+ fillStyle: import("@excalidraw/element/types").FillStyle;
55
+ strokeWidth: number;
56
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
57
+ roundness: null | {
58
+ type: import("@excalidraw/element/types").RoundnessType;
59
+ value?: number;
11
60
  };
12
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
13
- PanelComponent: ({ data, updateData }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
14
- } & {
15
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
61
+ roughness: number;
62
+ opacity: number;
63
+ width: number;
64
+ height: number;
65
+ angle: import("@excalidraw/math").Radians;
66
+ seed: number;
67
+ version: number;
68
+ versionNonce: number;
69
+ index: import("@excalidraw/element/types").FractionalIndex | null;
70
+ isDeleted: boolean;
71
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
72
+ frameId: string | null;
73
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
74
+ updated: number;
75
+ link: string | null;
76
+ locked: boolean;
77
+ customData?: Record<string, any>;
78
+ }>) | null;
79
+ export declare const actionSmartZoom: import("./types").Action<SmartZoomTarget | null> & {
80
+ keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: import("../types").AppState, elements: readonly ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
16
81
  };
82
+ export {};
@@ -145,6 +145,9 @@ declare class App extends React.Component<AppProps, AppState> {
145
145
  y: number;
146
146
  } | null;
147
147
  private lastCompletedCanvasClicks;
148
+ private lastKeyboardSmartZoomImageId;
149
+ private smartZoomKeyDownAt;
150
+ private smartZoomKeyHitElement;
148
151
  /** previous frame pointer coords */
149
152
  previousPointerMoveCoords: {
150
153
  x: number;
@@ -560,6 +563,12 @@ declare class App extends React.Component<AppProps, AppState> {
560
563
  force?: boolean;
561
564
  }) => boolean;
562
565
  private updateCurrentCursorPosition;
566
+ private isPlainSmartZoomKey;
567
+ private updateSmartZoomCursor;
568
+ private resetSmartZoomKey;
569
+ private handleSmartZoomKeyDown;
570
+ private handleSmartZoomKeyUp;
571
+ private handleSmartZoomPointerDown;
563
572
  private onKeyDown;
564
573
  private onKeyUp;
565
574
  setActiveTool: (tool: ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myoc/element",
3
- "version": "0.19.541",
3
+ "version": "0.19.543",
4
4
  "type": "module",
5
5
  "types": "./dist/types/element/src/index.d.ts",
6
6
  "main": "./dist/prod/index.js",
@@ -64,9 +64,9 @@
64
64
  "build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
65
65
  },
66
66
  "dependencies": {
67
- "@excalidraw/common": "npm:@myoc/common@0.19.541",
68
- "@excalidraw/fractional-indexing": "npm:@myoc/fractional-indexing@0.19.541",
69
- "@excalidraw/math": "npm:@myoc/math@0.19.541",
67
+ "@excalidraw/common": "npm:@myoc/common@0.19.543",
68
+ "@excalidraw/fractional-indexing": "npm:@myoc/fractional-indexing@0.19.543",
69
+ "@excalidraw/math": "npm:@myoc/math@0.19.543",
70
70
  "modern-gif": "2.1.0",
71
71
  "thumbhash": "0.1.1"
72
72
  }