fix: make history local to a given excalidraw instance (#3481)
* fix: make history local to a given excalidraw instance * changelog * Update src/packages/excalidraw/CHANGELOG.md
This commit is contained in:
parent
891ac82447
commit
d3106495b2
@ -3,7 +3,7 @@ import React from "react";
|
|||||||
import { undo, redo } from "../components/icons";
|
import { undo, redo } from "../components/icons";
|
||||||
import { ToolButton } from "../components/ToolButton";
|
import { ToolButton } from "../components/ToolButton";
|
||||||
import { t } from "../i18n";
|
import { t } from "../i18n";
|
||||||
import { SceneHistory, HistoryEntry } from "../history";
|
import History, { HistoryEntry } from "../history";
|
||||||
import { ExcalidrawElement } from "../element/types";
|
import { ExcalidrawElement } from "../element/types";
|
||||||
import { AppState } from "../types";
|
import { AppState } from "../types";
|
||||||
import { isWindows, KEYS } from "../keys";
|
import { isWindows, KEYS } from "../keys";
|
||||||
@ -59,7 +59,7 @@ const writeData = (
|
|||||||
return { commitToHistory };
|
return { commitToHistory };
|
||||||
};
|
};
|
||||||
|
|
||||||
type ActionCreator = (history: SceneHistory) => Action;
|
type ActionCreator = (history: History) => Action;
|
||||||
|
|
||||||
export const createUndoAction: ActionCreator = (history) => ({
|
export const createUndoAction: ActionCreator = (history) => ({
|
||||||
name: "undo",
|
name: "undo",
|
||||||
|
@ -137,7 +137,7 @@ import {
|
|||||||
isSelectedViaGroup,
|
isSelectedViaGroup,
|
||||||
selectGroupsForSelectedElements,
|
selectGroupsForSelectedElements,
|
||||||
} from "../groups";
|
} from "../groups";
|
||||||
import { createHistory, SceneHistory } from "../history";
|
import History from "../history";
|
||||||
import { defaultLang, getLanguage, languages, setLanguage, t } from "../i18n";
|
import { defaultLang, getLanguage, languages, setLanguage, t } from "../i18n";
|
||||||
import {
|
import {
|
||||||
CODES,
|
CODES,
|
||||||
@ -203,8 +203,6 @@ const ExcalidrawContainerContext = React.createContext<HTMLDivElement | null>(
|
|||||||
export const useExcalidrawContainer = () =>
|
export const useExcalidrawContainer = () =>
|
||||||
useContext(ExcalidrawContainerContext);
|
useContext(ExcalidrawContainerContext);
|
||||||
|
|
||||||
const { history } = createHistory();
|
|
||||||
|
|
||||||
let didTapTwice: boolean = false;
|
let didTapTwice: boolean = false;
|
||||||
let tappedTwiceTimer = 0;
|
let tappedTwiceTimer = 0;
|
||||||
let cursorX = 0;
|
let cursorX = 0;
|
||||||
@ -321,6 +319,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
public library: Library;
|
public library: Library;
|
||||||
public libraryItemsFromStorage: LibraryItems | undefined;
|
public libraryItemsFromStorage: LibraryItems | undefined;
|
||||||
private id: string;
|
private id: string;
|
||||||
|
private history: History;
|
||||||
|
|
||||||
constructor(props: AppProps) {
|
constructor(props: AppProps) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -379,7 +378,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
this.scene = new Scene();
|
this.scene = new Scene();
|
||||||
this.library = new Library(this);
|
this.library = new Library(this);
|
||||||
|
this.history = new History();
|
||||||
this.actionManager = new ActionManager(
|
this.actionManager = new ActionManager(
|
||||||
this.syncActionResult,
|
this.syncActionResult,
|
||||||
() => this.state,
|
() => this.state,
|
||||||
@ -388,8 +387,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
);
|
);
|
||||||
this.actionManager.registerAll(actions);
|
this.actionManager.registerAll(actions);
|
||||||
|
|
||||||
this.actionManager.registerAction(createUndoAction(history));
|
this.actionManager.registerAction(createUndoAction(this.history));
|
||||||
this.actionManager.registerAction(createRedoAction(history));
|
this.actionManager.registerAction(createRedoAction(this.history));
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderCanvas() {
|
private renderCanvas() {
|
||||||
@ -564,13 +563,13 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
});
|
});
|
||||||
this.scene.replaceAllElements(actionResult.elements);
|
this.scene.replaceAllElements(actionResult.elements);
|
||||||
if (actionResult.commitToHistory) {
|
if (actionResult.commitToHistory) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actionResult.appState || editingElement) {
|
if (actionResult.appState || editingElement) {
|
||||||
if (actionResult.commitToHistory) {
|
if (actionResult.commitToHistory) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
let viewModeEnabled = actionResult?.appState?.viewModeEnabled || false;
|
let viewModeEnabled = actionResult?.appState?.viewModeEnabled || false;
|
||||||
@ -614,7 +613,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
if (actionResult.syncHistory) {
|
if (actionResult.syncHistory) {
|
||||||
history.setCurrentState(
|
this.history.setCurrentState(
|
||||||
this.state,
|
this.state,
|
||||||
this.scene.getElementsIncludingDeleted(),
|
this.scene.getElementsIncludingDeleted(),
|
||||||
);
|
);
|
||||||
@ -689,7 +688,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private resetHistory = () => {
|
private resetHistory = () => {
|
||||||
history.clear();
|
this.history.clear();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -822,6 +821,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
configurable: true,
|
configurable: true,
|
||||||
value: this,
|
value: this,
|
||||||
},
|
},
|
||||||
|
history: {
|
||||||
|
configurable: true,
|
||||||
|
value: this.history,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1123,7 +1126,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
this.setState({ scrolledOutside });
|
this.setState({ scrolledOutside });
|
||||||
}
|
}
|
||||||
|
|
||||||
history.record(this.state, this.scene.getElementsIncludingDeleted());
|
this.history.record(this.state, this.scene.getElementsIncludingDeleted());
|
||||||
|
|
||||||
// Do not notify consumers if we're still loading the scene. Among other
|
// Do not notify consumers if we're still loading the scene. Among other
|
||||||
// potential issues, this fixes a case where the tab isn't focused during
|
// potential issues, this fixes a case where the tab isn't focused during
|
||||||
@ -1332,7 +1335,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.scene.replaceAllElements(nextElements);
|
this.scene.replaceAllElements(nextElements);
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
this.setState(
|
this.setState(
|
||||||
selectGroupsForSelectedElements(
|
selectGroupsForSelectedElements(
|
||||||
{
|
{
|
||||||
@ -1378,7 +1381,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
element,
|
element,
|
||||||
]);
|
]);
|
||||||
this.setState({ selectedElementIds: { [element.id]: true } });
|
this.setState({ selectedElementIds: { [element.id]: true } });
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collaboration
|
// Collaboration
|
||||||
@ -1452,7 +1455,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
|
|
||||||
public updateScene = withBatchedUpdates((sceneData: SceneData) => {
|
public updateScene = withBatchedUpdates((sceneData: SceneData) => {
|
||||||
if (sceneData.commitToHistory) {
|
if (sceneData.commitToHistory) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
// currently we only support syncing background color
|
// currently we only support syncing background color
|
||||||
@ -1595,7 +1598,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
!this.state.editingLinearElement ||
|
!this.state.editingLinearElement ||
|
||||||
this.state.editingLinearElement.elementId !== selectedElements[0].id
|
this.state.editingLinearElement.elementId !== selectedElements[0].id
|
||||||
) {
|
) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
this.setState({
|
this.setState({
|
||||||
editingLinearElement: new LinearElementEditor(
|
editingLinearElement: new LinearElementEditor(
|
||||||
selectedElements[0],
|
selectedElements[0],
|
||||||
@ -1789,7 +1792,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
fixBindingsAfterDeletion(this.scene.getElements(), [element]);
|
fixBindingsAfterDeletion(this.scene.getElements(), [element]);
|
||||||
}
|
}
|
||||||
if (!isDeleted || isExistingElement) {
|
if (!isDeleted || isExistingElement) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
@ -1970,7 +1973,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
!this.state.editingLinearElement ||
|
!this.state.editingLinearElement ||
|
||||||
this.state.editingLinearElement.elementId !== selectedElements[0].id
|
this.state.editingLinearElement.elementId !== selectedElements[0].id
|
||||||
) {
|
) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
this.setState({
|
this.setState({
|
||||||
editingLinearElement: new LinearElementEditor(
|
editingLinearElement: new LinearElementEditor(
|
||||||
selectedElements[0],
|
selectedElements[0],
|
||||||
@ -2687,7 +2690,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
event,
|
event,
|
||||||
this.state,
|
this.state,
|
||||||
(appState) => this.setState(appState),
|
(appState) => this.setState(appState),
|
||||||
history,
|
this.history,
|
||||||
pointerDownState.origin,
|
pointerDownState.origin,
|
||||||
);
|
);
|
||||||
if (ret.hitElement) {
|
if (ret.hitElement) {
|
||||||
@ -3379,7 +3382,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
|
|
||||||
if (isLinearElement(draggingElement)) {
|
if (isLinearElement(draggingElement)) {
|
||||||
if (draggingElement!.points.length > 1) {
|
if (draggingElement!.points.length > 1) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
}
|
}
|
||||||
const pointerCoords = viewportCoordsToSceneCoords(
|
const pointerCoords = viewportCoordsToSceneCoords(
|
||||||
childEvent,
|
childEvent,
|
||||||
@ -3463,7 +3466,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resizingElement) {
|
if (resizingElement) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resizingElement && isInvisiblySmallElement(resizingElement)) {
|
if (resizingElement && isInvisiblySmallElement(resizingElement)) {
|
||||||
@ -3577,7 +3580,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
elementType !== "selection" ||
|
elementType !== "selection" ||
|
||||||
isSomeElementSelected(this.scene.getElements(), this.state)
|
isSomeElementSelected(this.scene.getElements(), this.state)
|
||||||
) {
|
) {
|
||||||
history.resumeRecording();
|
this.history.resumeRecording();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pointerDownState.drag.hasOccurred || isResizing || isRotating) {
|
if (pointerDownState.drag.hasOccurred || isResizing || isRotating) {
|
||||||
@ -4269,8 +4272,8 @@ declare global {
|
|||||||
elements: readonly ExcalidrawElement[];
|
elements: readonly ExcalidrawElement[];
|
||||||
state: AppState;
|
state: AppState;
|
||||||
setState: React.Component<any, AppState>["setState"];
|
setState: React.Component<any, AppState>["setState"];
|
||||||
history: SceneHistory;
|
|
||||||
app: InstanceType<typeof App>;
|
app: InstanceType<typeof App>;
|
||||||
|
history: History;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4291,10 +4294,6 @@ if (
|
|||||||
return this.app.scene.replaceAllElements(elements);
|
return this.app.scene.replaceAllElements(elements);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
history: {
|
|
||||||
configurable: true,
|
|
||||||
get: () => history,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
export default App;
|
export default App;
|
||||||
|
@ -10,7 +10,7 @@ import { getElementAbsoluteCoords } from ".";
|
|||||||
import { getElementPointsCoords } from "./bounds";
|
import { getElementPointsCoords } from "./bounds";
|
||||||
import { Point, AppState } from "../types";
|
import { Point, AppState } from "../types";
|
||||||
import { mutateElement } from "./mutateElement";
|
import { mutateElement } from "./mutateElement";
|
||||||
import { SceneHistory } from "../history";
|
import History from "../history";
|
||||||
|
|
||||||
import Scene from "../scene/Scene";
|
import Scene from "../scene/Scene";
|
||||||
import {
|
import {
|
||||||
@ -167,7 +167,7 @@ export class LinearElementEditor {
|
|||||||
event: React.PointerEvent<HTMLCanvasElement>,
|
event: React.PointerEvent<HTMLCanvasElement>,
|
||||||
appState: AppState,
|
appState: AppState,
|
||||||
setState: React.Component<any, AppState>["setState"],
|
setState: React.Component<any, AppState>["setState"],
|
||||||
history: SceneHistory,
|
history: History,
|
||||||
scenePointer: { x: number; y: number },
|
scenePointer: { x: number; y: number },
|
||||||
): {
|
): {
|
||||||
didAddPoint: boolean;
|
didAddPoint: boolean;
|
||||||
|
@ -28,7 +28,7 @@ const clearAppStatePropertiesForHistory = (appState: AppState) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export class SceneHistory {
|
class History {
|
||||||
private elementCache = new Map<string, Map<number, ExcalidrawElement>>();
|
private elementCache = new Map<string, Map<number, ExcalidrawElement>>();
|
||||||
private recording: boolean = true;
|
private recording: boolean = true;
|
||||||
private stateHistory: DehydratedHistoryEntry[] = [];
|
private stateHistory: DehydratedHistoryEntry[] = [];
|
||||||
@ -260,7 +260,4 @@ export class SceneHistory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const createHistory: () => { history: SceneHistory } = () => {
|
export default History;
|
||||||
const history = new SceneHistory();
|
|
||||||
return { history };
|
|
||||||
};
|
|
||||||
|
@ -38,6 +38,8 @@ Please add the latest change on the top under the correct section.
|
|||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
|
- Make history local to a given Excalidraw instance. This fixes a case where history was getting shared when you have multiple Excalidraw components on the same page [#3481](https://github.com/excalidraw/excalidraw/pull/3481).
|
||||||
|
|
||||||
- Use active Excalidraw component when editing text. This fixes a case where text editing was not working when you have multiple Excalidraw components on the same page [#3478](https://github.com/excalidraw/excalidraw/pull/3478).
|
- Use active Excalidraw component when editing text. This fixes a case where text editing was not working when you have multiple Excalidraw components on the same page [#3478](https://github.com/excalidraw/excalidraw/pull/3478).
|
||||||
- When switching theme, apply it only to the active Excalidraw component. This fixes a case where the theme was getting applied to the first Excalidraw component if you had multiple Excalidraw components on the same page [#3446](https://github.com/excalidraw/excalidraw/pull/3446)
|
- When switching theme, apply it only to the active Excalidraw component. This fixes a case where the theme was getting applied to the first Excalidraw component if you had multiple Excalidraw components on the same page [#3446](https://github.com/excalidraw/excalidraw/pull/3446)
|
||||||
|
|
||||||
|
@ -900,40 +900,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 449462985,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -1096,40 +1062,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 1278240551,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -1354,40 +1286,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 1278240551,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -1647,40 +1545,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 1278240551,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -1995,40 +1859,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 1278240551,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -3058,40 +2888,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 1278240551,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -3404,40 +3200,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 449462985,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -3819,40 +3581,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 1278240551,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -4114,40 +3842,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 449462985,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": -10,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
|
@ -2958,40 +2958,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 1278240551,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": 100,
|
|
||||||
"y": 100,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
@ -5022,40 +4988,6 @@ Object {
|
|||||||
},
|
},
|
||||||
"elements": Array [],
|
"elements": Array [],
|
||||||
},
|
},
|
||||||
Object {
|
|
||||||
"appState": Object {
|
|
||||||
"editingGroupId": null,
|
|
||||||
"editingLinearElement": null,
|
|
||||||
"name": "Untitled-201933152653",
|
|
||||||
"selectedElementIds": Object {},
|
|
||||||
"viewBackgroundColor": "#ffffff",
|
|
||||||
},
|
|
||||||
"elements": Array [
|
|
||||||
Object {
|
|
||||||
"angle": 0,
|
|
||||||
"backgroundColor": "transparent",
|
|
||||||
"boundElementIds": null,
|
|
||||||
"fillStyle": "hachure",
|
|
||||||
"groupIds": Array [],
|
|
||||||
"height": 0,
|
|
||||||
"id": "id0",
|
|
||||||
"isDeleted": false,
|
|
||||||
"opacity": 100,
|
|
||||||
"roughness": 1,
|
|
||||||
"seed": 337897,
|
|
||||||
"strokeColor": "#000000",
|
|
||||||
"strokeSharpness": "sharp",
|
|
||||||
"strokeStyle": "solid",
|
|
||||||
"strokeWidth": 1,
|
|
||||||
"type": "rectangle",
|
|
||||||
"version": 1,
|
|
||||||
"versionNonce": 0,
|
|
||||||
"width": 0,
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
Object {
|
Object {
|
||||||
"appState": Object {
|
"appState": Object {
|
||||||
"editingGroupId": null,
|
"editingGroupId": null,
|
||||||
|
@ -62,7 +62,6 @@ describe("contextMenu element", () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
renderScene.mockClear();
|
renderScene.mockClear();
|
||||||
h.history.clear();
|
|
||||||
reseed(7);
|
reseed(7);
|
||||||
setDateTimeForTests("201933152653");
|
setDateTimeForTests("201933152653");
|
||||||
|
|
||||||
|
@ -57,7 +57,6 @@ beforeEach(async () => {
|
|||||||
|
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
renderScene.mockClear();
|
renderScene.mockClear();
|
||||||
h.history.clear();
|
|
||||||
reseed(7);
|
reseed(7);
|
||||||
setDateTimeForTests("201933152653");
|
setDateTimeForTests("201933152653");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user