2020-01-06 20:24:54 +04:00
|
|
|
import { ExcalidrawTextElement } from "../element/types";
|
2021-11-25 14:05:22 +01:00
|
|
|
import { AppClassProperties, AppState } from "../types";
|
2020-01-06 20:24:54 +04:00
|
|
|
|
2021-11-25 14:05:22 +01:00
|
|
|
export type RenderConfig = {
|
|
|
|
// AppState values
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
scrollX: AppState["scrollX"];
|
|
|
|
scrollY: AppState["scrollY"];
|
|
|
|
/** null indicates transparent bg */
|
|
|
|
viewBackgroundColor: AppState["viewBackgroundColor"] | null;
|
|
|
|
zoom: AppState["zoom"];
|
|
|
|
shouldCacheIgnoreZoom: AppState["shouldCacheIgnoreZoom"];
|
|
|
|
theme: AppState["theme"];
|
|
|
|
// collab-related state
|
|
|
|
// ---------------------------------------------------------------------------
|
basic Socket.io implementation of collaborative editing (#879)
* Enable collaborative syncing for elements
* Don't fall back to local storage if using a room, as that is confusing
* Use remote socket server
* Send updates to new users when they join
* ~
* add mouse tracking
* enable collaboration, rooms, and mouse tracking
* fix syncing bugs and add a button to start syncing mid session
* enable collaboration, rooms, and mouse tracking
* fix syncing bugs and add a button to start syncing mid session
* Add Live button and app state to support tracking collaborator counts
* Enable collaborative syncing for elements
* add mouse tracking
* enable collaboration, rooms, and mouse tracking
* fix syncing bugs and add a button to start syncing mid session
* fix syncing bugs and add a button to start syncing mid session
* Add Live button and app state to support tracking collaborator counts
* prettier
* Fix bug with remote pointers not changing on scroll
* Enable collaborative syncing for elements
* add mouse tracking
* enable collaboration, rooms, and mouse tracking
* fix syncing bugs and add a button to start syncing mid session
* enable collaboration, rooms, and mouse tracking
* fix syncing bugs and add a button to start syncing mid session
* Add Live button and app state to support tracking collaborator counts
* enable collaboration, rooms, and mouse tracking
* fix syncing bugs and add a button to start syncing mid session
* fix syncing bugs and add a button to start syncing mid session
* Fix bug with remote pointers not changing on scroll
* remove UI for collaboration
* remove link
* clean up lingering unused UI
* set random IV passed per encrypted message, reduce room id length, refactored socket broadcasting API, rename room_id to room, removed throttling of pointer movement
* fix package.json conflict
2020-03-09 08:48:25 -07:00
|
|
|
remotePointerViewportCoords: { [id: string]: { x: number; y: number } };
|
2020-04-04 16:12:19 +01:00
|
|
|
remotePointerButton?: { [id: string]: string | undefined };
|
2020-04-04 16:02:16 +02:00
|
|
|
remoteSelectedElementIds: { [elementId: string]: string[] };
|
2020-04-07 14:02:42 +01:00
|
|
|
remotePointerUsernames: { [id: string]: string };
|
2021-02-04 11:55:43 +01:00
|
|
|
remotePointerUserStates: { [id: string]: string };
|
2021-11-25 14:05:22 +01:00
|
|
|
// extra options passed to the renderer
|
|
|
|
// ---------------------------------------------------------------------------
|
2021-10-21 22:05:48 +02:00
|
|
|
imageCache: AppClassProperties["imageCache"];
|
2021-11-25 14:05:22 +01:00
|
|
|
renderScrollbars?: boolean;
|
|
|
|
renderSelection?: boolean;
|
|
|
|
renderGrid?: boolean;
|
|
|
|
/** when exporting the behavior is slightly different (e.g. we can't use
|
|
|
|
CSS filters), and we disable render optimizations for best output */
|
|
|
|
isExporting: boolean;
|
2020-01-06 19:34:22 +04:00
|
|
|
};
|
2020-01-06 20:24:54 +04:00
|
|
|
|
2020-01-08 23:56:35 -03:00
|
|
|
export type SceneScroll = {
|
2021-01-31 10:47:43 +01:00
|
|
|
scrollX: number;
|
|
|
|
scrollY: number;
|
2020-01-08 23:56:35 -03:00
|
|
|
};
|
|
|
|
|
2020-01-06 20:24:54 +04:00
|
|
|
export interface Scene {
|
|
|
|
elements: ExcalidrawTextElement[];
|
|
|
|
}
|
2020-01-09 17:37:08 +01:00
|
|
|
|
2020-04-05 16:13:17 -07:00
|
|
|
export type ExportType =
|
|
|
|
| "png"
|
|
|
|
| "clipboard"
|
|
|
|
| "clipboard-svg"
|
|
|
|
| "backend"
|
|
|
|
| "svg";
|
2020-03-01 21:43:35 +01:00
|
|
|
|
|
|
|
export type ScrollBars = {
|
|
|
|
horizontal: {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
} | null;
|
|
|
|
vertical: {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
} | null;
|
|
|
|
};
|