Compare commits

...

8 Commits

Author SHA1 Message Date
Aakansha Doshi
1ac4200cc0 tweak 2024-02-05 19:54:39 +05:30
Aakansha Doshi
2ca2c0f9fa fix 2024-02-05 19:34:48 +05:30
Aakansha Doshi
f3b6e9b09f fix 2024-02-05 19:28:24 +05:30
Aakansha Doshi
1db2869906 persist file name to LS 2024-02-05 19:26:52 +05:30
Aakansha Doshi
1bb88cb5e9 fix 2024-02-05 15:43:44 +05:30
Aakansha Doshi
701e076cc1 fix snaps 2024-02-05 15:13:49 +05:30
Aakansha Doshi
ad39506585 fix 2024-02-05 15:07:11 +05:30
Aakansha Doshi
b2331ffd98 feat: remove name from appState and use in component directly 2024-02-05 15:05:01 +05:30
17 changed files with 61 additions and 354 deletions

View File

@ -104,6 +104,7 @@ import { openConfirmModal } from "../packages/excalidraw/components/OverwriteCon
import { OverwriteConfirmDialog } from "../packages/excalidraw/components/OverwriteConfirm/OverwriteConfirm"; import { OverwriteConfirmDialog } from "../packages/excalidraw/components/OverwriteConfirm/OverwriteConfirm";
import Trans from "../packages/excalidraw/components/Trans"; import Trans from "../packages/excalidraw/components/Trans";
import { ShareDialog, shareDialogStateAtom } from "./share/ShareDialog"; import { ShareDialog, shareDialogStateAtom } from "./share/ShareDialog";
import { getFileName } from "../packages/excalidraw/data/filename";
polyfill(); polyfill();
@ -690,7 +691,6 @@ const ExcalidrawWrapper = () => {
</div> </div>
); );
} }
return ( return (
<div <div
style={{ height: "100%" }} style={{ height: "100%" }}
@ -775,6 +775,7 @@ const ExcalidrawWrapper = () => {
excalidrawAPI.getSceneElements(), excalidrawAPI.getSceneElements(),
excalidrawAPI.getAppState(), excalidrawAPI.getAppState(),
excalidrawAPI.getFiles(), excalidrawAPI.getFiles(),
getFileName(),
); );
}} }}
> >

View File

@ -25,11 +25,13 @@ import { MIME_TYPES } from "../../packages/excalidraw/constants";
import { trackEvent } from "../../packages/excalidraw/analytics"; import { trackEvent } from "../../packages/excalidraw/analytics";
import { getFrame } from "../../packages/excalidraw/utils"; import { getFrame } from "../../packages/excalidraw/utils";
import { ExcalidrawLogo } from "../../packages/excalidraw/components/ExcalidrawLogo"; import { ExcalidrawLogo } from "../../packages/excalidraw/components/ExcalidrawLogo";
import { getFileName } from "../../packages/excalidraw/data/filename";
export const exportToExcalidrawPlus = async ( export const exportToExcalidrawPlus = async (
elements: readonly NonDeletedExcalidrawElement[], elements: readonly NonDeletedExcalidrawElement[],
appState: Partial<AppState>, appState: Partial<AppState>,
files: BinaryFiles, files: BinaryFiles,
name: string,
) => { ) => {
const firebase = await loadFirebaseStorage(); const firebase = await loadFirebaseStorage();
@ -53,7 +55,7 @@ export const exportToExcalidrawPlus = async (
.ref(`/migrations/scenes/${id}`) .ref(`/migrations/scenes/${id}`)
.put(blob, { .put(blob, {
customMetadata: { customMetadata: {
data: JSON.stringify({ version: 2, name: appState.name }), data: JSON.stringify({ version: 2, name }),
created: Date.now().toString(), created: Date.now().toString(),
}, },
}); });
@ -117,7 +119,12 @@ export const ExportToExcalidrawPlus: React.FC<{
onClick={async () => { onClick={async () => {
try { try {
trackEvent("export", "eplus", `ui (${getFrame()})`); trackEvent("export", "eplus", `ui (${getFrame()})`);
await exportToExcalidrawPlus(elements, appState, files); await exportToExcalidrawPlus(
elements,
appState,
files,
getFileName(),
);
onSuccess(); onSuccess();
} catch (error: any) { } catch (error: any) {
console.error(error); console.error(error);

View File

@ -13,6 +13,7 @@ import { exportCanvas, prepareElementsForExport } from "../data/index";
import { isTextElement } from "../element"; import { isTextElement } from "../element";
import { t } from "../i18n"; import { t } from "../i18n";
import { isFirefox } from "../constants"; import { isFirefox } from "../constants";
import { getFileName } from "../data/filename";
export const actionCopy = register({ export const actionCopy = register({
name: "copy", name: "copy",
@ -138,6 +139,7 @@ export const actionCopyAsSvg = register({
{ {
...appState, ...appState,
exportingFrame, exportingFrame,
name: app.props.name || getFileName(),
}, },
); );
return { return {
@ -184,6 +186,7 @@ export const actionCopyAsPng = register({
await exportCanvas("clipboard", exportedElements, appState, app.files, { await exportCanvas("clipboard", exportedElements, appState, app.files, {
...appState, ...appState,
exportingFrame, exportingFrame,
name: app.props.name || getFileName(),
}); });
return { return {
appState: { appState: {

View File

@ -17,6 +17,7 @@ import { getNonDeletedElements } from "../element";
import { isImageFileHandle } from "../data/blob"; import { isImageFileHandle } from "../data/blob";
import { nativeFileSystemSupported } from "../data/filesystem"; import { nativeFileSystemSupported } from "../data/filesystem";
import { Theme } from "../element/types"; import { Theme } from "../element/types";
import { getFileName } from "../data/filename";
import "../components/ToolIcon.scss"; import "../components/ToolIcon.scss";
@ -29,7 +30,7 @@ export const actionChangeProjectName = register({
PanelComponent: ({ appState, updateData, appProps, data }) => ( PanelComponent: ({ appState, updateData, appProps, data }) => (
<ProjectName <ProjectName
label={t("labels.fileTitle")} label={t("labels.fileTitle")}
value={appState.name || "Unnamed"} value={appProps.name}
onChange={(name: string) => updateData(name)} onChange={(name: string) => updateData(name)}
isNameEditable={ isNameEditable={
typeof appProps.name === "undefined" && !appState.viewModeEnabled typeof appProps.name === "undefined" && !appState.viewModeEnabled
@ -144,8 +145,18 @@ export const actionSaveToActiveFile = register({
try { try {
const { fileHandle } = isImageFileHandle(appState.fileHandle) const { fileHandle } = isImageFileHandle(appState.fileHandle)
? await resaveAsImageWithScene(elements, appState, app.files) ? await resaveAsImageWithScene(
: await saveAsJSON(elements, appState, app.files); elements,
appState,
app.files,
app.props.name || getFileName(),
)
: await saveAsJSON(
elements,
appState,
app.files,
app.props.name || getFileName(),
);
return { return {
commitToHistory: false, commitToHistory: false,
@ -190,6 +201,7 @@ export const actionSaveFileToDisk = register({
fileHandle: null, fileHandle: null,
}, },
app.files, app.files,
app.props.name || getFileName(),
); );
return { return {
commitToHistory: false, commitToHistory: false,

View File

@ -7,9 +7,7 @@ import {
EXPORT_SCALES, EXPORT_SCALES,
THEME, THEME,
} from "./constants"; } from "./constants";
import { t } from "./i18n";
import { AppState, NormalizedZoomValue } from "./types"; import { AppState, NormalizedZoomValue } from "./types";
import { getDateTime } from "./utils";
const defaultExportScale = EXPORT_SCALES.includes(devicePixelRatio) const defaultExportScale = EXPORT_SCALES.includes(devicePixelRatio)
? devicePixelRatio ? devicePixelRatio
@ -65,7 +63,6 @@ export const getDefaultAppState = (): Omit<
isRotating: false, isRotating: false,
lastPointerDownWith: "mouse", lastPointerDownWith: "mouse",
multiElement: null, multiElement: null,
name: `${t("labels.untitled")}-${getDateTime()}`,
contextMenu: null, contextMenu: null,
openMenu: null, openMenu: null,
openPopup: null, openPopup: null,
@ -175,7 +172,6 @@ const APP_STATE_STORAGE_CONF = (<
isRotating: { browser: false, export: false, server: false }, isRotating: { browser: false, export: false, server: false },
lastPointerDownWith: { browser: true, export: false, server: false }, lastPointerDownWith: { browser: true, export: false, server: false },
multiElement: { browser: false, export: false, server: false }, multiElement: { browser: false, export: false, server: false },
name: { browser: true, export: false, server: false },
offsetLeft: { browser: false, export: false, server: false }, offsetLeft: { browser: false, export: false, server: false },
offsetTop: { browser: false, export: false, server: false }, offsetTop: { browser: false, export: false, server: false },
contextMenu: { browser: false, export: false, server: false }, contextMenu: { browser: false, export: false, server: false },

View File

@ -409,6 +409,7 @@ import { withBatchedUpdates, withBatchedUpdatesThrottled } from "../reactUtils";
import { getRenderOpacity } from "../renderer/renderElement"; import { getRenderOpacity } from "../renderer/renderElement";
import { textWysiwyg } from "../element/textWysiwyg"; import { textWysiwyg } from "../element/textWysiwyg";
import { isOverScrollBars } from "../scene/scrollbars"; import { isOverScrollBars } from "../scene/scrollbars";
import { getFileName } from "../data/filename";
const AppContext = React.createContext<AppClassProperties>(null!); const AppContext = React.createContext<AppClassProperties>(null!);
const AppPropsContext = React.createContext<AppProps>(null!); const AppPropsContext = React.createContext<AppProps>(null!);
@ -619,7 +620,6 @@ class App extends React.Component<AppProps, AppState> {
gridModeEnabled = false, gridModeEnabled = false,
objectsSnapModeEnabled = false, objectsSnapModeEnabled = false,
theme = defaultAppState.theme, theme = defaultAppState.theme,
name = defaultAppState.name,
} = props; } = props;
this.state = { this.state = {
...defaultAppState, ...defaultAppState,
@ -630,7 +630,6 @@ class App extends React.Component<AppProps, AppState> {
zenModeEnabled, zenModeEnabled,
objectsSnapModeEnabled, objectsSnapModeEnabled,
gridSize: gridModeEnabled ? GRID_SIZE : null, gridSize: gridModeEnabled ? GRID_SIZE : null,
name,
width: window.innerWidth, width: window.innerWidth,
height: window.innerHeight, height: window.innerHeight,
}; };
@ -1725,7 +1724,7 @@ class App extends React.Component<AppProps, AppState> {
this.files, this.files,
{ {
exportBackground: this.state.exportBackground, exportBackground: this.state.exportBackground,
name: this.state.name, name: this.props.name || getFileName(),
viewBackgroundColor: this.state.viewBackgroundColor, viewBackgroundColor: this.state.viewBackgroundColor,
exportingFrame: opts.exportingFrame, exportingFrame: opts.exportingFrame,
}, },
@ -2124,7 +2123,7 @@ class App extends React.Component<AppProps, AppState> {
let gridSize = actionResult?.appState?.gridSize || null; let gridSize = actionResult?.appState?.gridSize || null;
const theme = const theme =
actionResult?.appState?.theme || this.props.theme || THEME.LIGHT; actionResult?.appState?.theme || this.props.theme || THEME.LIGHT;
let name = actionResult?.appState?.name ?? this.state.name;
const errorMessage = const errorMessage =
actionResult?.appState?.errorMessage ?? this.state.errorMessage; actionResult?.appState?.errorMessage ?? this.state.errorMessage;
if (typeof this.props.viewModeEnabled !== "undefined") { if (typeof this.props.viewModeEnabled !== "undefined") {
@ -2139,10 +2138,6 @@ class App extends React.Component<AppProps, AppState> {
gridSize = this.props.gridModeEnabled ? GRID_SIZE : null; gridSize = this.props.gridModeEnabled ? GRID_SIZE : null;
} }
if (typeof this.props.name !== "undefined") {
name = this.props.name;
}
editingElement = editingElement =
editingElement || actionResult.appState?.editingElement || null; editingElement || actionResult.appState?.editingElement || null;
@ -2165,7 +2160,6 @@ class App extends React.Component<AppProps, AppState> {
zenModeEnabled, zenModeEnabled,
gridSize, gridSize,
theme, theme,
name,
errorMessage, errorMessage,
}); });
}, },
@ -2699,12 +2693,6 @@ class App extends React.Component<AppProps, AppState> {
}); });
} }
if (this.props.name && prevProps.name !== this.props.name) {
this.setState({
name: this.props.name,
});
}
this.excalidrawContainerRef.current?.classList.toggle( this.excalidrawContainerRef.current?.classList.toggle(
"theme--dark", "theme--dark",
this.state.theme === "dark", this.state.theme === "dark",

View File

@ -36,6 +36,7 @@ import { useAppProps } from "./App";
import { FilledButton } from "./FilledButton"; import { FilledButton } from "./FilledButton";
import { cloneJSON } from "../utils"; import { cloneJSON } from "../utils";
import { prepareElementsForExport } from "../data"; import { prepareElementsForExport } from "../data";
import { getFileName } from "../data/filename";
const supportsContextFilters = const supportsContextFilters =
"filter" in document.createElement("canvas").getContext("2d")!; "filter" in document.createElement("canvas").getContext("2d")!;
@ -73,7 +74,9 @@ const ImageExportModal = ({
); );
const appProps = useAppProps(); const appProps = useAppProps();
const [projectName, setProjectName] = useState(appStateSnapshot.name); const [projectName, setProjectName] = useState(
appProps.name || getFileName(),
);
const [exportSelectionOnly, setExportSelectionOnly] = useState(hasSelection); const [exportSelectionOnly, setExportSelectionOnly] = useState(hasSelection);
const [exportWithBackground, setExportWithBackground] = useState( const [exportWithBackground, setExportWithBackground] = useState(
appStateSnapshot.exportBackground, appStateSnapshot.exportBackground,
@ -109,7 +112,6 @@ const ImageExportModal = ({
elements: exportedElements, elements: exportedElements,
appState: { appState: {
...appStateSnapshot, ...appStateSnapshot,
name: projectName,
exportBackground: exportWithBackground, exportBackground: exportWithBackground,
exportWithDarkMode: exportDarkMode, exportWithDarkMode: exportDarkMode,
exportScale, exportScale,

View File

@ -6,9 +6,12 @@ import { focusNearestParent } from "../utils";
import "./ProjectName.scss"; import "./ProjectName.scss";
import { useExcalidrawContainer } from "./App"; import { useExcalidrawContainer } from "./App";
import { KEYS } from "../keys"; import { KEYS } from "../keys";
import { EditorLocalStorage } from "../data/EditorLocalStorage";
import { EDITOR_LS_KEYS } from "../constants";
import { getFileName } from "../data/filename";
type Props = { type Props = {
value: string; value?: string;
onChange: (value: string) => void; onChange: (value: string) => void;
label: string; label: string;
isNameEditable: boolean; isNameEditable: boolean;
@ -17,9 +20,13 @@ type Props = {
export const ProjectName = (props: Props) => { export const ProjectName = (props: Props) => {
const { id } = useExcalidrawContainer(); const { id } = useExcalidrawContainer();
const [fileName, setFileName] = useState<string>(props.value); const [fileName, setFileName] = useState<string>(
props.value || getFileName(),
);
const handleBlur = (event: any) => { const handleBlur = (event: any) => {
EditorLocalStorage.set(EDITOR_LS_KEYS.EXCALIDRAW_FILE_NAME, fileName);
if (!props.ignoreFocus) { if (!props.ignoreFocus) {
focusNearestParent(event.target); focusNearestParent(event.target);
} }

View File

@ -380,4 +380,5 @@ export const EDITOR_LS_KEYS = {
// legacy naming (non)scheme // legacy naming (non)scheme
MERMAID_TO_EXCALIDRAW: "mermaid-to-excalidraw", MERMAID_TO_EXCALIDRAW: "mermaid-to-excalidraw",
PUBLISH_LIBRARY: "publish-library-data", PUBLISH_LIBRARY: "publish-library-data",
EXCALIDRAW_FILE_NAME: "excalidraw-file-name",
} as const; } as const;

View File

@ -0,0 +1,11 @@
import { EDITOR_LS_KEYS } from "../constants";
import { t } from "../i18n";
import { getDateTime } from "../utils";
import { EditorLocalStorage } from "./EditorLocalStorage";
export const getFileName = () => {
return (
EditorLocalStorage.get<string>(EDITOR_LS_KEYS.EXCALIDRAW_FILE_NAME) ||
`${t("labels.untitled")}-${getDateTime()}`
);
};

View File

@ -71,6 +71,7 @@ export const saveAsJSON = async (
elements: readonly ExcalidrawElement[], elements: readonly ExcalidrawElement[],
appState: AppState, appState: AppState,
files: BinaryFiles, files: BinaryFiles,
name: string,
) => { ) => {
const serialized = serializeAsJSON(elements, appState, files, "local"); const serialized = serializeAsJSON(elements, appState, files, "local");
const blob = new Blob([serialized], { const blob = new Blob([serialized], {
@ -78,7 +79,7 @@ export const saveAsJSON = async (
}); });
const fileHandle = await fileSave(blob, { const fileHandle = await fileSave(blob, {
name: appState.name, name,
extension: "excalidraw", extension: "excalidraw",
description: "Excalidraw file", description: "Excalidraw file",
fileHandle: isImageFileHandle(appState.fileHandle) fileHandle: isImageFileHandle(appState.fileHandle)

View File

@ -7,8 +7,9 @@ export const resaveAsImageWithScene = async (
elements: readonly ExcalidrawElement[], elements: readonly ExcalidrawElement[],
appState: AppState, appState: AppState,
files: BinaryFiles, files: BinaryFiles,
name: string,
) => { ) => {
const { exportBackground, viewBackgroundColor, name, fileHandle } = appState; const { exportBackground, viewBackgroundColor, fileHandle } = appState;
const fileHandleType = getFileHandleType(fileHandle); const fileHandleType = getFileHandleType(fileHandle);

View File

@ -26,7 +26,6 @@ const clearAppStatePropertiesForHistory = (appState: AppState) => {
viewBackgroundColor: appState.viewBackgroundColor, viewBackgroundColor: appState.viewBackgroundColor,
editingLinearElement: appState.editingLinearElement, editingLinearElement: appState.editingLinearElement,
editingGroupId: appState.editingGroupId, editingGroupId: appState.editingGroupId,
name: appState.name,
}; };
}; };

View File

@ -328,7 +328,6 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -459,7 +458,6 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -529,7 +527,6 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -620,7 +617,6 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -631,7 +627,6 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -733,7 +728,6 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -854,7 +848,6 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -865,7 +858,6 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -908,7 +900,6 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -980,7 +971,6 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -1111,7 +1101,6 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -1232,7 +1221,6 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -1243,7 +1231,6 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -1286,7 +1273,6 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -1358,7 +1344,6 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -1489,7 +1474,6 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -1580,7 +1564,6 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -1591,7 +1574,6 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -1693,7 +1675,6 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -1780,7 +1761,6 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -1791,7 +1771,6 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -1834,7 +1813,6 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -1934,7 +1912,6 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -2055,7 +2032,6 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -2066,7 +2042,6 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -2109,7 +2084,6 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0_copy": true, "id0_copy": true,
}, },
@ -2240,7 +2214,6 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -2370,7 +2343,6 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -2381,7 +2353,6 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -2424,7 +2395,6 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -2496,7 +2466,6 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
"id1": true, "id1": true,
@ -2634,7 +2603,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -2757,7 +2725,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -2768,7 +2735,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -2811,7 +2777,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -2883,7 +2848,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -2955,7 +2919,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -3027,7 +2990,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -3099,7 +3061,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -3171,7 +3132,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -3243,7 +3203,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -3315,7 +3274,6 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -3446,7 +3404,6 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -3567,7 +3524,6 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -3578,7 +3534,6 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -3621,7 +3576,6 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -3693,7 +3647,6 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -3824,7 +3777,6 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -3945,7 +3897,6 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -3956,7 +3907,6 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -3999,7 +3949,6 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -4071,7 +4020,6 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -4202,7 +4150,6 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -4326,7 +4273,6 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -4337,7 +4283,6 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -4380,7 +4325,6 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -4452,7 +4396,6 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
"id1": true, "id1": true,
@ -4531,7 +4474,6 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
"id1": true, "id1": true,
@ -4936,7 +4878,6 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -5060,7 +5001,6 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -5071,7 +5011,6 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -5114,7 +5053,6 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -5518,7 +5456,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -5648,7 +5585,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -5659,7 +5595,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -5702,7 +5637,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id1": true, "id1": true,
}, },
@ -5774,7 +5708,6 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
"id1": true, "id1": true,
@ -6039,7 +5972,6 @@ exports[`contextMenu element > shows context menu for canvas > [end of test] app
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -6097,7 +6029,6 @@ exports[`contextMenu element > shows context menu for canvas > [end of test] his
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -6440,7 +6371,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -6816,7 +6746,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"isRotating": false, "isRotating": false,
"lastPointerDownWith": "mouse", "lastPointerDownWith": "mouse",
"multiElement": null, "multiElement": null,
"name": "Untitled-201933152653",
"objectsSnapModeEnabled": false, "objectsSnapModeEnabled": false,
"offsetLeft": 20, "offsetLeft": 20,
"offsetTop": 10, "offsetTop": 10,
@ -6972,7 +6901,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] hi
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",
@ -6983,7 +6911,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] hi
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": { "selectedElementIds": {
"id0": true, "id0": true,
}, },
@ -7035,7 +6962,6 @@ exports[`contextMenu element > shows context menu for element > [end of test] hi
"appState": { "appState": {
"editingGroupId": null, "editingGroupId": null,
"editingLinearElement": null, "editingLinearElement": null,
"name": "Untitled-201933152653",
"selectedElementIds": {}, "selectedElementIds": {},
"selectedGroupIds": {}, "selectedGroupIds": {},
"viewBackgroundColor": "#ffffff", "viewBackgroundColor": "#ffffff",

View File

@ -306,12 +306,10 @@ describe("restoreAppState", () => {
const stubImportedAppState = getDefaultAppState(); const stubImportedAppState = getDefaultAppState();
stubImportedAppState.activeTool.type = "selection"; stubImportedAppState.activeTool.type = "selection";
stubImportedAppState.cursorButton = "down"; stubImportedAppState.cursorButton = "down";
stubImportedAppState.name = "imported app state";
const stubLocalAppState = getDefaultAppState(); const stubLocalAppState = getDefaultAppState();
stubLocalAppState.activeTool.type = "rectangle"; stubLocalAppState.activeTool.type = "rectangle";
stubLocalAppState.cursorButton = "up"; stubLocalAppState.cursorButton = "up";
stubLocalAppState.name = "local app state";
const restoredAppState = restore.restoreAppState( const restoredAppState = restore.restoreAppState(
stubImportedAppState, stubImportedAppState,
@ -321,7 +319,6 @@ describe("restoreAppState", () => {
stubImportedAppState.activeTool, stubImportedAppState.activeTool,
); );
expect(restoredAppState.cursorButton).toBe("up"); expect(restoredAppState.cursorButton).toBe("up");
expect(restoredAppState.name).toBe(stubImportedAppState.name);
}); });
it("should restore with current app state when imported data state is undefined", () => { it("should restore with current app state when imported data state is undefined", () => {
@ -333,37 +330,31 @@ describe("restoreAppState", () => {
const stubLocalAppState = getDefaultAppState(); const stubLocalAppState = getDefaultAppState();
stubLocalAppState.cursorButton = "down"; stubLocalAppState.cursorButton = "down";
stubLocalAppState.name = "local app state";
const restoredAppState = restore.restoreAppState( const restoredAppState = restore.restoreAppState(
stubImportedAppState, stubImportedAppState,
stubLocalAppState, stubLocalAppState,
); );
expect(restoredAppState.cursorButton).toBe(stubLocalAppState.cursorButton); expect(restoredAppState.cursorButton).toBe(stubLocalAppState.cursorButton);
expect(restoredAppState.name).toBe(stubLocalAppState.name);
}); });
it("should return imported data when local app state is null", () => { it("should return imported data when local app state is null", () => {
const stubImportedAppState = getDefaultAppState(); const stubImportedAppState = getDefaultAppState();
stubImportedAppState.cursorButton = "down"; stubImportedAppState.cursorButton = "down";
stubImportedAppState.name = "imported app state";
const restoredAppState = restore.restoreAppState( const restoredAppState = restore.restoreAppState(
stubImportedAppState, stubImportedAppState,
null, null,
); );
expect(restoredAppState.cursorButton).toBe("up"); expect(restoredAppState.cursorButton).toBe("up");
expect(restoredAppState.name).toBe(stubImportedAppState.name);
}); });
it("should return local app state when imported data state is null", () => { it("should return local app state when imported data state is null", () => {
const stubLocalAppState = getDefaultAppState(); const stubLocalAppState = getDefaultAppState();
stubLocalAppState.cursorButton = "down"; stubLocalAppState.cursorButton = "down";
stubLocalAppState.name = "local app state";
const restoredAppState = restore.restoreAppState(null, stubLocalAppState); const restoredAppState = restore.restoreAppState(null, stubLocalAppState);
expect(restoredAppState.cursorButton).toBe(stubLocalAppState.cursorButton); expect(restoredAppState.cursorButton).toBe(stubLocalAppState.cursorButton);
expect(restoredAppState.name).toBe(stubLocalAppState.name);
}); });
it("should return default app state when imported data state and local app state are undefined", () => { it("should return default app state when imported data state and local app state are undefined", () => {
@ -492,13 +483,11 @@ describe("restore", () => {
it("when imported data state is null it should return the local app state property", () => { it("when imported data state is null it should return the local app state property", () => {
const stubLocalAppState = getDefaultAppState(); const stubLocalAppState = getDefaultAppState();
stubLocalAppState.cursorButton = "down"; stubLocalAppState.cursorButton = "down";
stubLocalAppState.name = "local app state";
const restoredData = restore.restore(null, stubLocalAppState, null); const restoredData = restore.restore(null, stubLocalAppState, null);
expect(restoredData.appState.cursorButton).toBe( expect(restoredData.appState.cursorButton).toBe(
stubLocalAppState.cursorButton, stubLocalAppState.cursorButton,
); );
expect(restoredData.appState.name).toBe(stubLocalAppState.name);
}); });
it("when imported data state has elements", () => { it("when imported data state has elements", () => {
@ -522,14 +511,12 @@ describe("restore", () => {
it("when local app state is null but imported app state is supplied", () => { it("when local app state is null but imported app state is supplied", () => {
const stubImportedAppState = getDefaultAppState(); const stubImportedAppState = getDefaultAppState();
stubImportedAppState.cursorButton = "down"; stubImportedAppState.cursorButton = "down";
stubImportedAppState.name = "imported app state";
const importedDataState = {} as ImportedDataState; const importedDataState = {} as ImportedDataState;
importedDataState.appState = stubImportedAppState; importedDataState.appState = stubImportedAppState;
const restoredData = restore.restore(importedDataState, null, null); const restoredData = restore.restore(importedDataState, null, null);
expect(restoredData.appState.cursorButton).toBe("up"); expect(restoredData.appState.cursorButton).toBe("up");
expect(restoredData.appState.name).toBe(stubImportedAppState.name);
}); });
it("bump versions of local duplicate elements when supplied", () => { it("bump versions of local duplicate elements when supplied", () => {

View File

@ -247,7 +247,6 @@ export interface AppState {
scrollY: number; scrollY: number;
cursorButton: "up" | "down"; cursorButton: "up" | "down";
scrolledOutside: boolean; scrolledOutside: boolean;
name: string;
isResizing: boolean; isResizing: boolean;
isRotating: boolean; isRotating: boolean;
zoom: Zoom; zoom: Zoom;