@excalidraw/excalidraw 0.17.1-7441-cc6868c → 0.17.1-7441-0269e5a
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/CHANGELOG.md +2 -0
- package/dist/browser/excalidraw-assets/{ar-SA-O4ZYAXHV.js → ar-SA-ZG4GMNKR.js} +1 -1
- package/dist/browser/excalidraw-assets/{az-AZ-RBGCVZSU.js → az-AZ-5QPIG4ZE.js} +1 -1
- package/dist/browser/excalidraw-assets/{bg-BG-27JU7ZTW.js → bg-BG-GWMMOXVZ.js} +1 -1
- package/dist/browser/excalidraw-assets/{bn-BD-YI5COLVX.js → bn-BD-FFLR3TNM.js} +1 -1
- package/dist/browser/excalidraw-assets/{c4Diagram-9cddb37f-M7FQCEGJ.js → c4Diagram-9cddb37f-DT3MBRIQ.js} +4 -4
- package/dist/browser/excalidraw-assets/{ca-ES-OT3NLCX2.js → ca-ES-7TTPSWTV.js} +1 -1
- package/dist/browser/excalidraw-assets/{chunk-Y73ZIZF2.js → chunk-2H6Q3UHB.js} +21 -21
- package/dist/browser/excalidraw-assets/{chunk-I7D3YGSV.js → chunk-5XVKPBR4.js} +1 -1
- package/dist/browser/excalidraw-assets/{chunk-EC7D42UC.js → chunk-67KWAPOR.js} +4 -4
- package/dist/browser/excalidraw-assets/{chunk-VFCK2VL6.js → chunk-AZELGDJ7.js} +3 -3
- package/dist/browser/excalidraw-assets/{chunk-KBSJWTUC.js → chunk-E67NG25X.js} +3 -3
- package/dist/browser/excalidraw-assets/{chunk-VJ4TJS2Y.js → chunk-ED7FCLMV.js} +3 -3
- package/dist/browser/excalidraw-assets/{chunk-YS3YHKSV.js → chunk-HG4GCABW.js} +7 -0
- package/dist/browser/excalidraw-assets/{chunk-PZKJ4HUG.js → chunk-K5VM6ZHC.js} +6 -6
- package/dist/browser/excalidraw-assets/{chunk-4RBOPRHV.js → chunk-L5BPE74O.js} +2 -2
- package/dist/browser/excalidraw-assets/{chunk-AB4DRNTX.js → chunk-OJAFOQ6I.js} +5 -5
- package/dist/browser/excalidraw-assets/{chunk-NUFRJSGA.js → chunk-RFZOXM2P.js} +3 -3
- package/dist/browser/excalidraw-assets/{chunk-Q5V3XSEB.js → chunk-T7PKCJTJ.js} +13 -1
- package/dist/browser/excalidraw-assets/{chunk-RRTDSCW5.js → chunk-UZYJGJH5.js} +2 -2
- package/dist/browser/excalidraw-assets/{chunk-C3WE7537.js → chunk-V52YQ6TH.js} +600 -172
- package/dist/browser/excalidraw-assets/{chunk-OBSLEQVG.js → chunk-YCSAT77X.js} +2 -2
- package/dist/browser/excalidraw-assets/{chunk-MDHEUGIE.js → chunk-YVMHRGYC.js} +2 -2
- package/dist/browser/excalidraw-assets/{classDiagram-bc733c3b-ILLIUUCV.js → classDiagram-bc733c3b-ADGQD5FE.js} +7 -7
- package/dist/browser/excalidraw-assets/{classDiagram-v2-8931bdaf-U7JETC6T.js → classDiagram-v2-8931bdaf-LQUNAO5F.js} +10 -10
- package/dist/browser/excalidraw-assets/{cs-CZ-VWNS2EBL.js → cs-CZ-ZBCV22AJ.js} +1 -1
- package/dist/browser/excalidraw-assets/{da-DK-ZSZISCYL.js → da-DK-Q4T27BFS.js} +1 -1
- package/dist/browser/excalidraw-assets/{de-DE-NGG5BQQU.js → de-DE-MBK4JIXX.js} +1 -1
- package/dist/browser/excalidraw-assets/{directory-open-01563666-OUEPAD2B.js → directory-open-01563666-XGWD52SG.js} +2 -2
- package/dist/browser/excalidraw-assets/{directory-open-4ed118d0-3YEXHCYQ.js → directory-open-4ed118d0-CW2C2TU4.js} +2 -2
- package/dist/browser/excalidraw-assets/{dist-YSQXM7F6.js → dist-GMU63VF7.js} +3 -3
- package/dist/browser/excalidraw-assets/{el-GR-WZRPRHPI.js → el-GR-4IO54FJG.js} +1 -1
- package/dist/browser/excalidraw-assets/{en-Y3Y5PHTH.js → en-6HNFHSKB.js} +4 -2
- package/dist/browser/excalidraw-assets/{erDiagram-f6946109-MARB7LUI.js → erDiagram-f6946109-LOZPUYNA.js} +5 -5
- package/dist/browser/excalidraw-assets/{es-ES-J4OESQ2T.js → es-ES-RTNHOKI6.js} +1 -1
- package/dist/browser/excalidraw-assets/{eu-ES-JIOSKIEU.js → eu-ES-IPUNFIRV.js} +1 -1
- package/dist/browser/excalidraw-assets/{fa-IR-KEVEW3J2.js → fa-IR-AFOLD64G.js} +1 -1
- package/dist/browser/excalidraw-assets/{fi-FI-VHWIPZNU.js → fi-FI-YDIGP7ED.js} +1 -1
- package/dist/browser/excalidraw-assets/{file-open-002ab408-YC7KQ7M7.js → file-open-002ab408-XIZJR36E.js} +2 -2
- package/dist/browser/excalidraw-assets/{file-open-7c801643-GRK3M4FM.js → file-open-7c801643-YIZPMU4W.js} +2 -2
- package/dist/browser/excalidraw-assets/{file-save-3189631c-XOSH6LGE.js → file-save-3189631c-BQMBD5TV.js} +2 -2
- package/dist/browser/excalidraw-assets/{file-save-745eba88-HT2N2RA6.js → file-save-745eba88-MWPDJIMB.js} +2 -2
- package/dist/browser/excalidraw-assets/{flowDiagram-93327f21-QAR7MBV2.js → flowDiagram-93327f21-IG42SU5S.js} +11 -11
- package/dist/browser/excalidraw-assets/{flowDiagram-v2-476db779-NRWK544J.js → flowDiagram-v2-476db779-Y67G2FM7.js} +11 -11
- package/dist/browser/excalidraw-assets/{flowchart-elk-definition-5082a990-YKT6KRH3.js → flowchart-elk-definition-5082a990-N6NGIBWD.js} +8 -8
- package/dist/browser/excalidraw-assets/{fr-FR-6IOJIJYL.js → fr-FR-DKTDAJMV.js} +1 -1
- package/dist/browser/excalidraw-assets/{ganttDiagram-7ce12d6b-TETXDXSS.js → ganttDiagram-7ce12d6b-QM7W7H3I.js} +3 -3
- package/dist/browser/excalidraw-assets/{gitGraphDiagram-1e960c50-KJ53NSM2.js → gitGraphDiagram-1e960c50-EKEGNJUG.js} +3 -3
- package/dist/browser/excalidraw-assets/{gl-ES-GLS3MPGJ.js → gl-ES-KAW5CTCB.js} +1 -1
- package/dist/browser/excalidraw-assets/{he-IL-PES5HNTH.js → he-IL-XFQ6PZWN.js} +1 -1
- package/dist/browser/excalidraw-assets/{hi-IN-KJ5CDJGW.js → hi-IN-CJGZ2R72.js} +1 -1
- package/dist/browser/excalidraw-assets/{hu-HU-Y4JXQDS4.js → hu-HU-LH67LOY3.js} +1 -1
- package/dist/browser/excalidraw-assets/{id-ID-DA5FA6OL.js → id-ID-L6Y7PWWN.js} +1 -1
- package/dist/browser/excalidraw-assets/{image-TP5JGDPK.css → image-2MHILQWB.css} +193 -2
- package/dist/browser/excalidraw-assets/{image-DBNYVO3T.js → image-MZHH7VY4.js} +4 -4
- package/dist/browser/excalidraw-assets/{image-blob-reduce.esm-EBROP3TW.js → image-blob-reduce.esm-5RGBO4BD.js} +2 -2
- package/dist/browser/excalidraw-assets/{infoDiagram-264bed3e-EX4AYPQQ.js → infoDiagram-264bed3e-DGYH27DL.js} +3 -3
- package/dist/browser/excalidraw-assets/{it-IT-BNXL4CYY.js → it-IT-NYW7ZXIC.js} +1 -1
- package/dist/browser/excalidraw-assets/{ja-JP-MNWVRFQD.js → ja-JP-PTAJBPX4.js} +1 -1
- package/dist/browser/excalidraw-assets/{journeyDiagram-31be0096-Y6RLBNJ4.js → journeyDiagram-31be0096-MOV4SXUQ.js} +4 -4
- package/dist/browser/excalidraw-assets/{kaa-MGHZRJX2.js → kaa-WXJRXWPF.js} +1 -1
- package/dist/browser/excalidraw-assets/{kab-KAB-JIMEPM6B.js → kab-KAB-ODUQXY6X.js} +1 -1
- package/dist/browser/excalidraw-assets/{kk-KZ-34LQGHKY.js → kk-KZ-UXGGFOE5.js} +1 -1
- package/dist/browser/excalidraw-assets/{km-KH-ASWPZXSX.js → km-KH-KH42MBCX.js} +1 -1
- package/dist/browser/excalidraw-assets/{ko-KR-TSJPRBBT.js → ko-KR-OK4WMN6E.js} +1 -1
- package/dist/browser/excalidraw-assets/{ku-TR-PNP7OOUH.js → ku-TR-I6JF7FTE.js} +1 -1
- package/dist/browser/excalidraw-assets/{lt-LT-OYI4CUPY.js → lt-LT-MRDJ3W6M.js} +1 -1
- package/dist/browser/excalidraw-assets/{lv-LV-UIBLRKLP.js → lv-LV-GUHKIRYT.js} +1 -1
- package/dist/browser/excalidraw-assets/{mindmap-definition-4fc2557c-BODO5LN7.js → mindmap-definition-4fc2557c-QD6CUNYL.js} +4 -4
- package/dist/browser/excalidraw-assets/{mr-IN-L2APYGBG.js → mr-IN-2VY5ATS4.js} +1 -1
- package/dist/browser/excalidraw-assets/{my-MM-75U3VCOE.js → my-MM-Q3UE7NDU.js} +1 -1
- package/dist/browser/excalidraw-assets/{nb-NO-NM6ZQSU6.js → nb-NO-YGVSWPTU.js} +1 -1
- package/dist/browser/excalidraw-assets/{nl-NL-D6PK3GH3.js → nl-NL-JYQZFVD6.js} +1 -1
- package/dist/browser/excalidraw-assets/{nn-NO-BNIHWH3L.js → nn-NO-SVCTK45S.js} +1 -1
- package/dist/browser/excalidraw-assets/{oc-FR-LCRUD5LT.js → oc-FR-7S4GZ53C.js} +1 -1
- package/dist/browser/excalidraw-assets/{pa-IN-STXLKWNM.js → pa-IN-OAXG5ILZ.js} +1 -1
- package/dist/browser/excalidraw-assets/{percentages-7OAWRSFY.js → percentages-G7XJNZNY.js} +1 -1
- package/dist/browser/excalidraw-assets/{pica-UY2E6YV3.js → pica-3M7LI2AU.js} +2 -2
- package/dist/browser/excalidraw-assets/{pieDiagram-157505fe-TR3EKKEP.js → pieDiagram-157505fe-THFWR2W3.js} +3 -3
- package/dist/browser/excalidraw-assets/{pl-PL-3XM5C6BE.js → pl-PL-4LOCCO6A.js} +1 -1
- package/dist/browser/excalidraw-assets/{pt-BR-PCB5M6Q5.js → pt-BR-UE7QKZT7.js} +1 -1
- package/dist/browser/excalidraw-assets/{pt-PT-JKKOIWOA.js → pt-PT-QRYXWDEQ.js} +1 -1
- package/dist/browser/excalidraw-assets/{quadrantDiagram-fd70f2d0-II72YD6R.js → quadrantDiagram-fd70f2d0-PM7WE6V7.js} +3 -3
- package/dist/browser/excalidraw-assets/{requirementDiagram-19c99588-KQYIFNAJ.js → requirementDiagram-19c99588-VQ7AQGMD.js} +5 -5
- package/dist/browser/excalidraw-assets/{ro-RO-CRH2KIPB.js → ro-RO-S6UM3GTE.js} +1 -1
- package/dist/browser/excalidraw-assets/{ru-RU-QBGPUX6G.js → ru-RU-X3LZJ2PM.js} +1 -1
- package/dist/browser/excalidraw-assets/{sequenceDiagram-5dfd0049-25L3RXZD.js → sequenceDiagram-5dfd0049-7VLXNLQB.js} +4 -4
- package/dist/browser/excalidraw-assets/{si-LK-3SZOS2BL.js → si-LK-47EZ7CDR.js} +1 -1
- package/dist/browser/excalidraw-assets/{sk-SK-J3IRFPPI.js → sk-SK-BZTESEQ3.js} +1 -1
- package/dist/browser/excalidraw-assets/{sl-SI-XMEM4DG7.js → sl-SI-UKPT7XYH.js} +1 -1
- package/dist/browser/excalidraw-assets/{stateDiagram-133e3642-BOXZPPAP.js → stateDiagram-133e3642-TFVBMKD2.js} +6 -6
- package/dist/browser/excalidraw-assets/{stateDiagram-v2-6371a76b-UE67H35B.js → stateDiagram-v2-6371a76b-HLD2VAQC.js} +10 -10
- package/dist/browser/excalidraw-assets/{sv-SE-ANRZHTXG.js → sv-SE-QCQFH645.js} +1 -1
- package/dist/browser/excalidraw-assets/{ta-IN-YQ3TKMCX.js → ta-IN-VVBM4WJT.js} +1 -1
- package/dist/browser/excalidraw-assets/{th-TH-SQW3PVEH.js → th-TH-7BH7SJAO.js} +1 -1
- package/dist/browser/excalidraw-assets/{timeline-definition-5ed366f4-VSVFFB5S.js → timeline-definition-5ed366f4-36TJ7JFQ.js} +3 -3
- package/dist/browser/excalidraw-assets/{tr-TR-KUEQIRHA.js → tr-TR-PSQK5I6C.js} +1 -1
- package/dist/browser/excalidraw-assets/{uk-UA-LHOOITZN.js → uk-UA-SPVEJS7T.js} +1 -1
- package/dist/browser/excalidraw-assets/{vi-VN-A6OAOG4Q.js → vi-VN-KIIQDQET.js} +1 -1
- package/dist/browser/excalidraw-assets/{zh-CN-TKODMXQV.js → zh-CN-6PVTYMG5.js} +1 -1
- package/dist/browser/excalidraw-assets/{zh-HK-3KKLKRDR.js → zh-HK-V2KK262G.js} +1 -1
- package/dist/browser/excalidraw-assets/{zh-TW-SN3SAI3Y.js → zh-TW-VYIR3NM2.js} +1 -1
- package/dist/browser/index.css +193 -2
- package/dist/browser/index.js +10 -6
- package/dist/index.css +193 -2
- package/dist/index.js +29488 -861
- package/package.json +2 -2
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +57 -3
- package/types/excalidraw/actions/actionBoundText.d.ts +38 -2
- package/types/excalidraw/actions/actionCanvas.d.ts +367 -11
- package/types/excalidraw/actions/actionClipboard.d.ts +133 -7
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +57 -3
- package/types/excalidraw/actions/actionElementLock.d.ts +38 -2
- package/types/excalidraw/actions/actionExport.d.ts +171 -9
- package/types/excalidraw/actions/actionFinalize.d.ts +38 -2
- package/types/excalidraw/actions/actionFrame.d.ts +57 -3
- package/types/excalidraw/actions/actionGroup.d.ts +38 -2
- package/types/excalidraw/actions/actionLinearEditor.d.ts +19 -1
- package/types/excalidraw/actions/actionMenu.d.ts +57 -3
- package/types/excalidraw/actions/actionNavigate.d.ts +302 -3
- package/types/excalidraw/actions/actionProperties.d.ts +247 -13
- package/types/excalidraw/actions/actionSelectAll.d.ts +19 -1
- package/types/excalidraw/actions/actionStyles.d.ts +19 -1
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +19 -1
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +19 -1
- package/types/excalidraw/actions/actionToggleStats.d.ts +19 -1
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +19 -1
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +19 -1
- package/types/excalidraw/actions/types.d.ts +1 -1
- package/types/excalidraw/components/App.d.ts +7 -2
- package/types/excalidraw/components/Avatar.d.ts +3 -1
- package/types/excalidraw/components/FollowMode/FollowMode.d.ts +11 -0
- package/types/excalidraw/components/Tooltip.d.ts +2 -1
- package/types/excalidraw/components/UserList.d.ts +18 -4
- package/types/excalidraw/components/icons.d.ts +1 -0
- package/types/excalidraw/element/Hyperlink.d.ts +19 -1
- package/types/excalidraw/element/bounds.d.ts +14 -1
- package/types/excalidraw/element/embeddable.d.ts +19 -1
- package/types/excalidraw/element/linearElementEditor.d.ts +20 -2
- package/types/excalidraw/index.d.ts +2 -1
- package/types/excalidraw/types.d.ts +25 -5
- package/types/excalidraw/utils.d.ts +10 -1
|
@@ -19,7 +19,7 @@ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" |
|
|
|
19
19
|
export type PanelComponentProps = {
|
|
20
20
|
elements: readonly ExcalidrawElement[];
|
|
21
21
|
appState: AppState;
|
|
22
|
-
updateData: (formData?:
|
|
22
|
+
updateData: <T = any>(formData?: T) => void;
|
|
23
23
|
appProps: ExcalidrawProps;
|
|
24
24
|
data?: Record<string, any>;
|
|
25
25
|
app: AppClassProperties;
|
|
@@ -7,7 +7,7 @@ import { LinearElementEditor } from "../element/linearElementEditor";
|
|
|
7
7
|
import { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement } from "../element/types";
|
|
8
8
|
import History from "../history";
|
|
9
9
|
import Scene from "../scene/Scene";
|
|
10
|
-
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType } from "../types";
|
|
10
|
+
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload } from "../types";
|
|
11
11
|
import { FileSystemHandle } from "../data/filesystem";
|
|
12
12
|
import { Renderer } from "../scene/Renderer";
|
|
13
13
|
import { LaserPathManager } from "./LaserTool/LaserPathManager";
|
|
@@ -207,6 +207,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
209
|
}>, event: PointerEvent]>;
|
|
210
|
+
onUserFollowEmitter: Emitter<[payload: OnUserFollowedPayload]>;
|
|
211
|
+
onScrollChangeEmitter: Emitter<[scrollX: number, scrollY: number, zoom: Readonly<{
|
|
212
|
+
value: import("../types").NormalizedZoomValue;
|
|
213
|
+
}>]>;
|
|
210
214
|
constructor(props: AppProps);
|
|
211
215
|
private onWindowMessage;
|
|
212
216
|
private cacheEmbeddableRef;
|
|
@@ -294,7 +298,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
294
298
|
* Zooms on canvas viewport center
|
|
295
299
|
*/
|
|
296
300
|
zoomCanvas: (value: number) => void;
|
|
297
|
-
private
|
|
301
|
+
private cancelInProgressAnimation;
|
|
298
302
|
scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[], opts?: {
|
|
299
303
|
fitToContent?: boolean;
|
|
300
304
|
fitToViewport?: never;
|
|
@@ -311,6 +315,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
311
315
|
animate?: boolean;
|
|
312
316
|
duration?: number;
|
|
313
317
|
}) => void;
|
|
318
|
+
private maybeUnfollowRemoteUser;
|
|
314
319
|
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
315
320
|
private translateCanvas;
|
|
316
321
|
setToast: (toast: {
|
|
@@ -5,6 +5,8 @@ type AvatarProps = {
|
|
|
5
5
|
color: string;
|
|
6
6
|
name: string;
|
|
7
7
|
src?: string;
|
|
8
|
+
isBeingFollowed?: boolean;
|
|
9
|
+
isCurrentUser: boolean;
|
|
8
10
|
};
|
|
9
|
-
export declare const Avatar: ({ color, onClick, name, src }: AvatarProps) => JSX.Element;
|
|
11
|
+
export declare const Avatar: ({ color, onClick, name, src, isBeingFollowed, isCurrentUser, }: AvatarProps) => JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { UserToFollow } from "../../types";
|
|
3
|
+
import "./FollowMode.scss";
|
|
4
|
+
interface FollowModeProps {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
userToFollow: UserToFollow;
|
|
8
|
+
onDisconnect: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const FollowMode: ({ height, width, userToFollow, onDisconnect, }: FollowModeProps) => JSX.Element;
|
|
11
|
+
export default FollowMode;
|
|
@@ -12,6 +12,7 @@ type TooltipProps = {
|
|
|
12
12
|
label: string;
|
|
13
13
|
long?: boolean;
|
|
14
14
|
style?: React.CSSProperties;
|
|
15
|
+
disabled?: boolean;
|
|
15
16
|
};
|
|
16
|
-
export declare const Tooltip: ({ children, label, long, style, }: TooltipProps) => JSX.Element;
|
|
17
|
+
export declare const Tooltip: ({ children, label, long, style, disabled, }: TooltipProps) => JSX.Element | null;
|
|
17
18
|
export {};
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import "./UserList.scss";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
3
|
+
import { Collaborator, SocketId } from "../types";
|
|
4
|
+
export type GoToCollaboratorComponentProps = {
|
|
5
|
+
clientId: ClientId;
|
|
6
|
+
collaborator: Collaborator;
|
|
7
|
+
withName: boolean;
|
|
8
|
+
isBeingFollowed: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** collaborator user id or socket id (fallback) */
|
|
11
|
+
type ClientId = string & {
|
|
12
|
+
_brand: "UserId";
|
|
13
|
+
};
|
|
14
|
+
type UserListUserObject = Pick<Collaborator, "avatarUrl" | "id" | "socketId" | "username">;
|
|
15
|
+
type UserListProps = {
|
|
5
16
|
className?: string;
|
|
6
17
|
mobile?: boolean;
|
|
7
|
-
collaborators:
|
|
8
|
-
|
|
18
|
+
collaborators: Map<SocketId, UserListUserObject>;
|
|
19
|
+
userToFollow: SocketId | null;
|
|
20
|
+
};
|
|
21
|
+
export declare const UserList: React.MemoExoticComponent<({ className, mobile, collaborators, userToFollow }: UserListProps) => JSX.Element | null>;
|
|
22
|
+
export {};
|
|
@@ -171,4 +171,5 @@ export declare const fullscreenIcon: JSX.Element;
|
|
|
171
171
|
export declare const eyeIcon: JSX.Element;
|
|
172
172
|
export declare const eyeClosedIcon: JSX.Element;
|
|
173
173
|
export declare const brainIcon: JSX.Element;
|
|
174
|
+
export declare const searchIcon: JSX.Element;
|
|
174
175
|
export {};
|
|
@@ -128,7 +128,23 @@ export declare const actionLink: {
|
|
|
128
128
|
offsetTop: number;
|
|
129
129
|
offsetLeft: number;
|
|
130
130
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
131
|
-
collaborators: Map<
|
|
131
|
+
collaborators: Map<import("../types").SocketId, Readonly<{
|
|
132
|
+
pointer?: import("../types").CollaboratorPointer | undefined;
|
|
133
|
+
button?: "up" | "down" | undefined;
|
|
134
|
+
selectedElementIds?: Readonly<{
|
|
135
|
+
[id: string]: true;
|
|
136
|
+
}> | undefined;
|
|
137
|
+
username?: string | null | undefined;
|
|
138
|
+
userState?: import("../types").UserIdleState | undefined;
|
|
139
|
+
color?: {
|
|
140
|
+
background: string;
|
|
141
|
+
stroke: string;
|
|
142
|
+
} | undefined;
|
|
143
|
+
avatarUrl?: string | undefined;
|
|
144
|
+
id?: string | undefined;
|
|
145
|
+
socketId?: import("../types").SocketId | undefined;
|
|
146
|
+
isCurrentUser?: boolean | undefined;
|
|
147
|
+
}>>;
|
|
132
148
|
showStats: boolean;
|
|
133
149
|
currentChartType: import("./types").ChartType;
|
|
134
150
|
pasteDialog: {
|
|
@@ -146,6 +162,8 @@ export declare const actionLink: {
|
|
|
146
162
|
y: number;
|
|
147
163
|
} | null;
|
|
148
164
|
objectsSnapModeEnabled: boolean;
|
|
165
|
+
userToFollow: import("../types").UserToFollow | null;
|
|
166
|
+
followedBy: Set<import("../types").SocketId>;
|
|
149
167
|
};
|
|
150
168
|
commitToHistory: true;
|
|
151
169
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, ExcalidrawFreeDrawElement, NonDeleted } from "./types";
|
|
2
2
|
import { Drawable, Op } from "roughjs/bin/core";
|
|
3
|
-
import { Point } from "../types";
|
|
3
|
+
import { AppState, Point } from "../types";
|
|
4
4
|
export type RectangleBox = {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
@@ -8,12 +8,21 @@ export type RectangleBox = {
|
|
|
8
8
|
height: number;
|
|
9
9
|
angle: number;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* x and y position of top left corner, x and y position of bottom right corner
|
|
13
|
+
*/
|
|
11
14
|
export type Bounds = readonly [
|
|
12
15
|
minX: number,
|
|
13
16
|
minY: number,
|
|
14
17
|
maxX: number,
|
|
15
18
|
maxY: number
|
|
16
19
|
];
|
|
20
|
+
export type SceneBounds = readonly [
|
|
21
|
+
sceneX: number,
|
|
22
|
+
sceneY: number,
|
|
23
|
+
sceneX2: number,
|
|
24
|
+
sceneY2: number
|
|
25
|
+
];
|
|
17
26
|
export declare class ElementBounds {
|
|
18
27
|
private static boundsCache;
|
|
19
28
|
static getBounds(element: ExcalidrawElement): Bounds;
|
|
@@ -60,3 +69,7 @@ export interface BoundingBox {
|
|
|
60
69
|
height: number;
|
|
61
70
|
}
|
|
62
71
|
export declare const getCommonBoundingBox: (elements: ExcalidrawElement[] | readonly NonDeleted<ExcalidrawElement>[]) => BoundingBox;
|
|
72
|
+
/**
|
|
73
|
+
* returns scene coords of user's editor viewport (visible canvas area) bounds
|
|
74
|
+
*/
|
|
75
|
+
export declare const getVisibleSceneBounds: ({ scrollX, scrollY, width, height, zoom, }: AppState) => SceneBounds;
|
|
@@ -121,7 +121,23 @@ export declare const actionSetEmbeddableAsActiveTool: {
|
|
|
121
121
|
offsetTop: number;
|
|
122
122
|
offsetLeft: number;
|
|
123
123
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
124
|
-
collaborators: Map<
|
|
124
|
+
collaborators: Map<import("../types").SocketId, Readonly<{
|
|
125
|
+
pointer?: import("../types").CollaboratorPointer | undefined;
|
|
126
|
+
button?: "up" | "down" | undefined;
|
|
127
|
+
selectedElementIds?: Readonly<{
|
|
128
|
+
[id: string]: true;
|
|
129
|
+
}> | undefined;
|
|
130
|
+
username?: string | null | undefined;
|
|
131
|
+
userState?: import("../types").UserIdleState | undefined;
|
|
132
|
+
color?: {
|
|
133
|
+
background: string;
|
|
134
|
+
stroke: string;
|
|
135
|
+
} | undefined;
|
|
136
|
+
avatarUrl?: string | undefined;
|
|
137
|
+
id?: string | undefined;
|
|
138
|
+
socketId?: import("../types").SocketId | undefined;
|
|
139
|
+
isCurrentUser?: boolean | undefined;
|
|
140
|
+
}>>;
|
|
125
141
|
showStats: boolean;
|
|
126
142
|
currentChartType: import("./types").ChartType;
|
|
127
143
|
pasteDialog: {
|
|
@@ -140,6 +156,8 @@ export declare const actionSetEmbeddableAsActiveTool: {
|
|
|
140
156
|
y: number;
|
|
141
157
|
} | null;
|
|
142
158
|
objectsSnapModeEnabled: boolean;
|
|
159
|
+
userToFollow: import("../types").UserToFollow | null;
|
|
160
|
+
followedBy: Set<import("../types").SocketId>;
|
|
143
161
|
};
|
|
144
162
|
commitToHistory: false;
|
|
145
163
|
};
|
|
@@ -127,7 +127,7 @@ export declare class LinearElementEditor {
|
|
|
127
127
|
contextMenu: {
|
|
128
128
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
129
129
|
top: number;
|
|
130
|
-
left: number;
|
|
130
|
+
left: number;
|
|
131
131
|
} | null;
|
|
132
132
|
showWelcomeScreen: boolean;
|
|
133
133
|
isLoading: boolean;
|
|
@@ -231,7 +231,23 @@ export declare class LinearElementEditor {
|
|
|
231
231
|
offsetTop: number;
|
|
232
232
|
offsetLeft: number;
|
|
233
233
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
234
|
-
collaborators: Map<
|
|
234
|
+
collaborators: Map<import("../types").SocketId, Readonly<{
|
|
235
|
+
pointer?: import("../types").CollaboratorPointer | undefined;
|
|
236
|
+
button?: "up" | "down" | undefined;
|
|
237
|
+
selectedElementIds?: Readonly<{
|
|
238
|
+
[id: string]: true;
|
|
239
|
+
}> | undefined;
|
|
240
|
+
username?: string | null | undefined;
|
|
241
|
+
userState?: import("../types").UserIdleState | undefined;
|
|
242
|
+
color?: {
|
|
243
|
+
background: string;
|
|
244
|
+
stroke: string;
|
|
245
|
+
} | undefined;
|
|
246
|
+
avatarUrl?: string | undefined;
|
|
247
|
+
id?: string | undefined;
|
|
248
|
+
socketId?: import("../types").SocketId | undefined;
|
|
249
|
+
isCurrentUser?: boolean | undefined;
|
|
250
|
+
}>>;
|
|
235
251
|
showStats: boolean;
|
|
236
252
|
currentChartType: import("./types").ChartType;
|
|
237
253
|
pasteDialog: {
|
|
@@ -250,6 +266,8 @@ export declare class LinearElementEditor {
|
|
|
250
266
|
y: number;
|
|
251
267
|
} | null;
|
|
252
268
|
objectsSnapModeEnabled: boolean;
|
|
269
|
+
userToFollow: import("../types").UserToFollow | null;
|
|
270
|
+
followedBy: Set<import("../types").SocketId>;
|
|
253
271
|
};
|
|
254
272
|
};
|
|
255
273
|
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, pointIndices: readonly number[]): void;
|
|
@@ -28,6 +28,7 @@ export { DefaultSidebar } from "./components/DefaultSidebar";
|
|
|
28
28
|
export { TTDDialog } from "./components/TTDDialog/TTDDialog";
|
|
29
29
|
export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
|
|
30
30
|
export { normalizeLink } from "./data/url";
|
|
31
|
+
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
31
32
|
export { convertToExcalidrawElements } from "./data/transform";
|
|
32
|
-
export { getCommonBounds } from "./element/bounds";
|
|
33
|
+
export { getCommonBounds, getVisibleSceneBounds } from "./element/bounds";
|
|
33
34
|
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "../utils/export";
|
|
@@ -19,7 +19,10 @@ import { ContextMenuItems } from "./components/ContextMenu";
|
|
|
19
19
|
import { SnapLine } from "./snapping";
|
|
20
20
|
import { Merge, ValueOf } from "./utility-types";
|
|
21
21
|
export type Point = Readonly<RoughPoint>;
|
|
22
|
-
export type
|
|
22
|
+
export type SocketId = string & {
|
|
23
|
+
_brand: "SocketId";
|
|
24
|
+
};
|
|
25
|
+
export type Collaborator = Readonly<{
|
|
23
26
|
pointer?: CollaboratorPointer;
|
|
24
27
|
button?: "up" | "down";
|
|
25
28
|
selectedElementIds?: AppState["selectedElementIds"];
|
|
@@ -31,7 +34,9 @@ export type Collaborator = {
|
|
|
31
34
|
};
|
|
32
35
|
avatarUrl?: string;
|
|
33
36
|
id?: string;
|
|
34
|
-
|
|
37
|
+
socketId?: SocketId;
|
|
38
|
+
isCurrentUser?: boolean;
|
|
39
|
+
}>;
|
|
35
40
|
export type CollaboratorPointer = {
|
|
36
41
|
x: number;
|
|
37
42
|
y: number;
|
|
@@ -70,6 +75,10 @@ export type ActiveTool = {
|
|
|
70
75
|
};
|
|
71
76
|
export type SidebarName = string;
|
|
72
77
|
export type SidebarTabName = string;
|
|
78
|
+
export type UserToFollow = {
|
|
79
|
+
socketId: SocketId;
|
|
80
|
+
username: string;
|
|
81
|
+
};
|
|
73
82
|
type _CommonCanvasAppState = {
|
|
74
83
|
zoom: AppState["zoom"];
|
|
75
84
|
scrollX: AppState["scrollX"];
|
|
@@ -230,7 +239,7 @@ export interface AppState {
|
|
|
230
239
|
offsetTop: number;
|
|
231
240
|
offsetLeft: number;
|
|
232
241
|
fileHandle: FileSystemHandle | null;
|
|
233
|
-
collaborators: Map<
|
|
242
|
+
collaborators: Map<SocketId, Collaborator>;
|
|
234
243
|
showStats: boolean;
|
|
235
244
|
currentChartType: ChartType;
|
|
236
245
|
pasteDialog: {
|
|
@@ -250,6 +259,10 @@ export interface AppState {
|
|
|
250
259
|
y: number;
|
|
251
260
|
} | null;
|
|
252
261
|
objectsSnapModeEnabled: boolean;
|
|
262
|
+
/** the user's clientId & username who is being followed on the canvas */
|
|
263
|
+
userToFollow: UserToFollow | null;
|
|
264
|
+
/** the clientIds of the users following the current user */
|
|
265
|
+
followedBy: Set<SocketId>;
|
|
253
266
|
}
|
|
254
267
|
export type UIAppState = Omit<AppState, "suggestedBindings" | "startBoundElement" | "cursorButton" | "scrollX" | "scrollY">;
|
|
255
268
|
export type NormalizedZoomValue = number & {
|
|
@@ -295,6 +308,10 @@ export type LibraryItemsSource = ((currentLibraryItems: LibraryItems) => Blob |
|
|
|
295
308
|
export type ExcalidrawInitialDataState = Merge<ImportedDataState, {
|
|
296
309
|
libraryItems?: Required<ImportedDataState>["libraryItems"] | Promise<Required<ImportedDataState>["libraryItems"]>;
|
|
297
310
|
}>;
|
|
311
|
+
export type OnUserFollowedPayload = {
|
|
312
|
+
userToFollow: UserToFollow;
|
|
313
|
+
action: "FOLLOW" | "UNFOLLOW";
|
|
314
|
+
};
|
|
298
315
|
export interface ExcalidrawProps {
|
|
299
316
|
onChange?: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
|
|
300
317
|
initialData?: ExcalidrawInitialDataState | null | Promise<ExcalidrawInitialDataState | null>;
|
|
@@ -330,7 +347,8 @@ export interface ExcalidrawProps {
|
|
|
330
347
|
nativeEvent: MouseEvent | React.PointerEvent<HTMLCanvasElement>;
|
|
331
348
|
}>) => void;
|
|
332
349
|
onPointerDown?: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState) => void;
|
|
333
|
-
onScrollChange?: (scrollX: number, scrollY: number) => void;
|
|
350
|
+
onScrollChange?: (scrollX: number, scrollY: number, zoom: Zoom) => void;
|
|
351
|
+
onUserFollow?: (payload: OnUserFollowedPayload) => void;
|
|
334
352
|
children?: React.ReactNode;
|
|
335
353
|
validateEmbeddable?: boolean | string[] | RegExp | RegExp[] | ((link: string) => boolean | undefined);
|
|
336
354
|
renderEmbeddable?: (element: NonDeleted<ExcalidrawEmbeddableElement>, appState: AppState) => JSX.Element | null;
|
|
@@ -339,7 +357,7 @@ export interface ExcalidrawProps {
|
|
|
339
357
|
export type SceneData = {
|
|
340
358
|
elements?: ImportedDataState["elements"];
|
|
341
359
|
appState?: ImportedDataState["appState"];
|
|
342
|
-
collaborators?: Map<
|
|
360
|
+
collaborators?: Map<SocketId, Collaborator>;
|
|
343
361
|
commitToHistory?: boolean;
|
|
344
362
|
};
|
|
345
363
|
export declare enum UserIdleState {
|
|
@@ -502,6 +520,8 @@ export type ExcalidrawImperativeAPI = {
|
|
|
502
520
|
onChange: (callback: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => void) => UnsubscribeCallback;
|
|
503
521
|
onPointerDown: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: React.PointerEvent<HTMLElement>) => void) => UnsubscribeCallback;
|
|
504
522
|
onPointerUp: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: PointerEvent) => void) => UnsubscribeCallback;
|
|
523
|
+
onScrollChange: (callback: (scrollX: number, scrollY: number, zoom: Zoom) => void) => UnsubscribeCallback;
|
|
524
|
+
onUserFollow: (callback: (payload: OnUserFollowedPayload) => void) => UnsubscribeCallback;
|
|
505
525
|
};
|
|
506
526
|
export type Device = Readonly<{
|
|
507
527
|
viewport: {
|
|
@@ -182,7 +182,15 @@ export declare const getFrame: () => "top" | "iframe";
|
|
|
182
182
|
export declare const isRunningInIframe: () => boolean;
|
|
183
183
|
export declare const isPromiseLike: (value: any) => value is Promise<any>;
|
|
184
184
|
export declare const queryFocusableElements: (container: HTMLElement | null) => HTMLElement[];
|
|
185
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Returns whether object/array is shallow equal.
|
|
187
|
+
* Considers empty object/arrays as equal (whether top-level or second-level).
|
|
188
|
+
*/
|
|
189
|
+
export declare const isShallowEqual: <T extends Record<string, any>, K extends readonly unknown[]>(objA: T, objB: T, comparators?: { [key in keyof T]?: ((a: T[key], b: T[key]) => boolean) | undefined; } | (keyof T extends K[number] ? K extends readonly (keyof T)[] ? K : {
|
|
190
|
+
_error: "keys are either missing or include keys not in compared obj";
|
|
191
|
+
} : {
|
|
192
|
+
_error: "keys are either missing or include keys not in compared obj";
|
|
193
|
+
}) | undefined, debug?: boolean) => boolean;
|
|
186
194
|
export declare const composeEventHandlers: <E>(originalEventHandler?: ((event: E) => void) | undefined, ourEventHandler?: ((event: E) => void) | undefined, { checkForDefaultPrevented }?: {
|
|
187
195
|
checkForDefaultPrevented?: boolean | undefined;
|
|
188
196
|
}) => (event: E) => void;
|
|
@@ -202,3 +210,4 @@ export declare const isRenderThrottlingEnabled: () => boolean;
|
|
|
202
210
|
export declare const isMemberOf: <T extends string>(collection: Set<T> | Record<T, any> | Map<T, any> | readonly T[], value: string) => value is T;
|
|
203
211
|
export declare const cloneJSON: <T>(obj: T) => T;
|
|
204
212
|
export declare const isFiniteNumber: (value: any) => value is number;
|
|
213
|
+
export declare const updateStable: <T extends any[] | Record<string, any>>(prevValue: T, nextValue: T) => T;
|