@zsviczian/excalidraw 0.10.0-obsidian-41 → 0.10.0-obsidian-45

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": "@zsviczian/excalidraw",
3
- "version": "0.10.0-obsidian-41",
3
+ "version": "0.10.0-obsidian-45",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -113,8 +113,6 @@ declare class App extends React.Component<AppProps, AppState> {
113
113
  private handleCanvasDoubleClick;
114
114
  private getElementLinkAtPosition;
115
115
  private redirectToLink;
116
- private attachLinkListener;
117
- private detachLinkListener;
118
116
  private handleCanvasPointerMove;
119
117
  private handleTouchMove;
120
118
  private handleCanvasPointerDown;
@@ -47,7 +47,8 @@ export declare enum EVENT {
47
47
  TOUCH_END = "touchend",
48
48
  HASHCHANGE = "hashchange",
49
49
  VISIBILITY_CHANGE = "visibilitychange",
50
- SCROLL = "scroll"
50
+ SCROLL = "scroll",
51
+ EXCALIDRAW_LINK = "excalidraw-link"
51
52
  }
52
53
  export declare const ENV: {
53
54
  TEST: string;
@@ -13,11 +13,12 @@ export declare const newTextElement: (opts: {
13
13
  verticalAlign: VerticalAlign;
14
14
  containerId?: ExcalidrawRectangleElement["id"];
15
15
  } & ElementConstructorOpts) => NonDeleted<ExcalidrawTextElement>;
16
- export declare const updateTextElement: (element: ExcalidrawTextElement, { text, isDeleted, originalText, rawText, }: {
16
+ export declare const updateTextElement: (element: ExcalidrawTextElement, { text, isDeleted, originalText, rawText, link, }: {
17
17
  text: string;
18
18
  isDeleted?: boolean | undefined;
19
19
  originalText: string;
20
20
  rawText?: string | undefined;
21
+ link?: string | undefined;
21
22
  }) => ExcalidrawTextElement;
22
23
  export declare const newFreeDrawElement: (opts: {
23
24
  type: "freedraw";
package/types/types.d.ts CHANGED
@@ -201,10 +201,13 @@ export interface ExcalidrawProps {
201
201
  onLibraryChange?: (libraryItems: LibraryItems) => void | Promise<any>;
202
202
  autoFocus?: boolean;
203
203
  onBeforeTextEdit?: (textElement: ExcalidrawTextElement) => string;
204
- onBeforeTextSubmit?: (textElement: ExcalidrawTextElement, textToSubmit: string, originalText: string, isDeleted: boolean) => [string, string];
204
+ onBeforeTextSubmit?: (textElement: ExcalidrawTextElement, textToSubmit: string, originalText: string, isDeleted: boolean) => [string, string, string];
205
205
  generateIdForFile?: (file: File) => string | Promise<string>;
206
206
  onThemeChange?: (newTheme: string) => void;
207
- onLinkOpen?: (link: string, event: MouseEvent) => void;
207
+ onLinkOpen?: (element: NonDeletedExcalidrawElement, event: CustomEvent<{
208
+ nativeEvent: MouseEvent;
209
+ }>) => void;
210
+ onLinkHover?: (element: NonDeletedExcalidrawElement, event: React.PointerEvent<HTMLCanvasElement>) => void;
208
211
  }
209
212
  export declare type SceneData = {
210
213
  elements?: ImportedDataState["elements"];
package/types/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { EVENT } from "./constants";
1
2
  import { FontFamilyValues, FontString } from "./element/types";
2
3
  import { Zoom } from "./types";
3
4
  export declare const setDateTimeForTests: (dateTime: string) => void;
@@ -98,3 +99,6 @@ export declare const arrayToMap: <T extends string | {
98
99
  id: string;
99
100
  }>(items: readonly T[]) => Map<string, T>;
100
101
  export declare const isTestEnv: () => boolean;
102
+ export declare const wrapEvent: <T extends Event>(name: EVENT, nativeEvent: T) => CustomEvent<{
103
+ nativeEvent: T;
104
+ }>;