mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-22 00:41:09 +02:00
feat: multiplayer undo / redo (#7348)
This commit is contained in:
@@ -199,6 +199,24 @@ export type InteractiveCanvasAppState = Readonly<
|
||||
}
|
||||
>;
|
||||
|
||||
export type ObservedAppState = ObservedStandaloneAppState &
|
||||
ObservedElementsAppState;
|
||||
|
||||
export type ObservedStandaloneAppState = {
|
||||
name: AppState["name"];
|
||||
viewBackgroundColor: AppState["viewBackgroundColor"];
|
||||
};
|
||||
|
||||
export type ObservedElementsAppState = {
|
||||
editingGroupId: AppState["editingGroupId"];
|
||||
selectedElementIds: AppState["selectedElementIds"];
|
||||
selectedGroupIds: AppState["selectedGroupIds"];
|
||||
// Avoiding storing whole instance, as it could lead into state incosistencies, empty undos/redos and etc.
|
||||
editingLinearElementId: LinearElementEditor["elementId"] | null;
|
||||
// Right now it's coupled to `editingLinearElement`, ideally it should not be really needed as we already have selectedElementIds & editingLinearElementId
|
||||
selectedLinearElementId: LinearElementEditor["elementId"] | null;
|
||||
};
|
||||
|
||||
export interface AppState {
|
||||
contextMenu: {
|
||||
items: ContextMenuItems;
|
||||
@@ -489,7 +507,7 @@ export type SceneData = {
|
||||
elements?: ImportedDataState["elements"];
|
||||
appState?: ImportedDataState["appState"];
|
||||
collaborators?: Map<SocketId, Collaborator>;
|
||||
commitToHistory?: boolean;
|
||||
commitToStore?: boolean;
|
||||
};
|
||||
|
||||
export enum UserIdleState {
|
||||
|
Reference in New Issue
Block a user