2020-01-06 20:24:54 +04:00
|
|
|
import { ExcalidrawTextElement } from "../element/types";
|
2020-02-19 08:25:01 -08:00
|
|
|
import { FlooredNumber } from "../types";
|
2020-01-06 20:24:54 +04:00
|
|
|
|
2020-01-06 19:34:22 +04:00
|
|
|
export type SceneState = {
|
2020-02-19 08:25:01 -08:00
|
|
|
scrollX: FlooredNumber;
|
|
|
|
scrollY: FlooredNumber;
|
2020-01-06 19:34:22 +04:00
|
|
|
// null indicates transparent bg
|
|
|
|
viewBackgroundColor: string | null;
|
2020-02-15 21:03:32 +01:00
|
|
|
zoom: number;
|
2020-03-28 16:59:36 -07:00
|
|
|
shouldCacheIgnoreZoom: boolean;
|
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 };
|
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 = {
|
2020-02-19 08:25:01 -08:00
|
|
|
scrollX: FlooredNumber;
|
|
|
|
scrollY: FlooredNumber;
|
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;
|
|
|
|
};
|