First steps towards onIncrement API

This commit is contained in:
Marcel Mraz 2025-04-25 22:14:39 +02:00
parent 192c4e7658
commit 0c21f1ae07
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
51 changed files with 1358 additions and 870 deletions

View file

@ -807,6 +807,9 @@ const ExcalidrawWrapper = () => {
<Excalidraw
excalidrawAPI={excalidrawRefCallback}
onChange={onChange}
onIncrement={(increment) => {
console.log(increment);
}}
initialData={initialStatePromiseRef.current.promise}
isCollaborating={isCollaborating}
onPointerUpdate={collabAPI?.onPointerUpdate}

View file

@ -122,7 +122,7 @@ describe("collaboration", () => {
expect(h.elements).toEqual([expect.objectContaining(rect1Props)]);
});
const undoAction = createUndoAction(h.history, h.store);
const undoAction = createUndoAction(h.history);
act(() => h.app.actionManager.executeAction(undoAction));
// with explicit undo (as addition) we expect our item to be restored from the snapshot!
@ -154,7 +154,7 @@ describe("collaboration", () => {
expect(h.elements).toEqual([expect.objectContaining(rect1Props)]);
});
const redoAction = createRedoAction(h.history, h.store);
const redoAction = createRedoAction(h.history);
act(() => h.app.actionManager.executeAction(redoAction));
// with explicit redo (as removal) we again restore the element from the snapshot!