Skip to content

Commit d968b9e

Browse files
circuit-sketcher-core new features integration: canvas menus updates, library and nodes import/export, changed localstorage to indexedDb for library storage, bug fixes
1 parent 8daa04b commit d968b9e

File tree

3 files changed

+71
-19
lines changed

3 files changed

+71
-19
lines changed

package-lock.json

Lines changed: 64 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "circuit-sketcher-app",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"author": "Code Forge Temple",
55
"description": "An application to draw circuits on a canvas, based on circuit-sketcher-core.",
66
"license": "GPL",
@@ -34,6 +34,6 @@
3434
"sass": "^1.83.0",
3535
"typescript": "~5.6.2",
3636
"typescript-eslint": "^8.15.0",
37-
"vite": "^6.2.2"
37+
"vite": "^6.3.5"
3838
}
39-
}
39+
}

src/components/DrawBoard/DrawBoard.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ export const DrawBoard: React.FC = () => {
3131

3232
const handleSaveCanvas = async () => {
3333
const jsonStr = await CanvasManager.getInstance().stringify();
34-
3534
const blob = new Blob([JSON.stringify(JSON.parse(jsonStr), null, 4)], {type: "application/json"});
3635

3736
saveAs(blob, "Circuit Sketcher Canvas.circuit-sketcher");
3837
};
3938

40-
const handleSaveLibrary = () => {
39+
const handleSaveLibrary = async () => {
4140
const timestamp = new Date().getTime();
4241
const filename = `Circuit Sketcher Library-${timestamp}.circuit-sketcher.lib`;
43-
const blob = new Blob([LocalStorageManager.getLibrary(true)], {type: "application/json"});
42+
const blob = new Blob([await LocalStorageManager.getLibrary(true)], {type: "application/json"});
43+
4444
saveAs(blob, filename);
4545
};
4646

@@ -63,7 +63,7 @@ export const DrawBoard: React.FC = () => {
6363
};
6464

6565
const handleLibraryFileChange = async (event: React.ChangeEvent<HTMLInputElement>) => {
66-
LocalStorageManager.setLibrary(await loadJsonFile(event));
66+
await LocalStorageManager.setLibrary(await loadJsonFile(event));
6767
};
6868

6969
const handleResize = () => {

0 commit comments

Comments
 (0)