Skip to content

Commit 2bb4ccc

Browse files
committed
fix excalidraw 0.17 integration
1 parent 6fad5f2 commit 2bb4ccc

File tree

3 files changed

+45
-92
lines changed

3 files changed

+45
-92
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"dependencies": {
3838
"@braintree/sanitize-url": "6.0.4",
3939
"@electron/remote": "2.1.2",
40-
"@excalidraw/excalidraw": "0.16.1",
40+
"@excalidraw/excalidraw": "0.17.3",
4141
"archiver": "7.0.0",
4242
"async-mutex": "0.4.1",
4343
"axios": "1.6.7",

src/public/app/widgets/type_widgets/canvas.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import libraryLoader from "../../services/library_loader.js";
2-
import TypeWidget from "./type_widget.js";
1+
import libraryLoader from '../../services/library_loader.js';
2+
import TypeWidget from './type_widget.js';
33
import utils from '../../services/utils.js';
44
import linkService from '../../services/link.js';
5-
import debounce from "../../services/debounce.js";
5+
import debounce from '../../services/debounce.js';
66

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

247247
this.excalidrawApi.updateScene(sceneData);
248248
this.excalidrawApi.addFiles(fileArray);
249-
this.excalidrawRef.current.history.clear();
249+
this.excalidrawApi.history.clear();
250250
}
251251

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

285285
// parallel svg export to combat bitrot and enable rendering image for note inclusion, preview, and share
286-
const svg = await this.excalidrawApi.exportToSvg({
286+
const svg = await ExcalidrawLib.exportToSvg({
287287
elements,
288288
appState,
289289
exportPadding: 5, // 5 px padding

0 commit comments

Comments
 (0)