Skip to content

Commit

Permalink
fix excalidraw 0.17 integration
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Mar 6, 2024
1 parent 6fad5f2 commit 2bb4ccc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 92 deletions.
125 changes: 39 additions & 86 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"@braintree/sanitize-url": "6.0.4",
"@electron/remote": "2.1.2",
"@excalidraw/excalidraw": "0.16.1",
"@excalidraw/excalidraw": "0.17.3",
"archiver": "7.0.0",
"async-mutex": "0.4.1",
"axios": "1.6.7",
Expand Down
10 changes: 5 additions & 5 deletions src/public/app/widgets/type_widgets/canvas.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import libraryLoader from "../../services/library_loader.js";
import TypeWidget from "./type_widget.js";
import libraryLoader from '../../services/library_loader.js';
import TypeWidget from './type_widget.js';
import utils from '../../services/utils.js';
import linkService from '../../services/link.js';
import debounce from "../../services/debounce.js";
import debounce from '../../services/debounce.js';

const TPL = `
<div class="canvas-widget note-detail-canvas note-detail-printable note-detail">
Expand Down Expand Up @@ -246,7 +246,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {

this.excalidrawApi.updateScene(sceneData);
this.excalidrawApi.addFiles(fileArray);
this.excalidrawRef.current.history.clear();
this.excalidrawApi.history.clear();
}

Promise.all(
Expand Down Expand Up @@ -283,7 +283,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
const files = this.excalidrawApi.getFiles();

// parallel svg export to combat bitrot and enable rendering image for note inclusion, preview, and share
const svg = await this.excalidrawApi.exportToSvg({
const svg = await ExcalidrawLib.exportToSvg({
elements,
appState,
exportPadding: 5, // 5 px padding
Expand Down

0 comments on commit 2bb4ccc

Please sign in to comment.