Skip to content

Commit

Permalink
Updated Excalidraw to v0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
nienow committed Apr 25, 2024
1 parent 5afc4c3 commit 063c35a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"preview": "live-server --cors dist/"
},
"dependencies": {
"@excalidraw/excalidraw": "^0.15.3",
"@excalidraw/excalidraw": "^0.17.6",
"react": "^18.3.0",
"react-dom": "^18.3.0",
"sn-extension-api": "0.3.2"
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

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

13 changes: 6 additions & 7 deletions src/components/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, {useRef} from 'react';
import React from 'react';
import {Excalidraw, getSceneVersion} from "@excalidraw/excalidraw";
import {useEditor} from "../providers/EditorProvider";

const Editor = () => {
const {data, saveNote, isLocked} = useEditor();
const el = useRef();
let lastVersion = getSceneVersion(data.elements);
let libraryCnt = data.libraryItems?.length || 0;

Expand All @@ -22,12 +21,12 @@ const Editor = () => {
if (Object.keys(files).length !== 0) {
//non empty files
data.files = files;
}
}

// if (Object.keys(appState).length !== 0) {
// //non empty appState
// data.appState = appState;
// }
// }
saveNote();
}
};
Expand All @@ -43,10 +42,10 @@ const Editor = () => {

return (
<div className="main">
<Excalidraw ref={el} key={Math.random()} initialData={data} theme={'dark'} onChange={onChange} onLibraryChange={onLibraryChange}
<Excalidraw key={Math.random()} initialData={data} theme={'dark'} onChange={onChange} onLibraryChange={onLibraryChange}
viewModeEnabled={isLocked} UIOptions={UIOptions}/>
</div>
);
}
};

export default Editor
export default Editor;
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require("copy-webpack-plugin");
const ZipPlugin = require('zip-webpack-plugin');
const webpack = require('webpack');

const PACKAGE = require('./package.json');
const version = PACKAGE.version;
Expand Down Expand Up @@ -64,6 +65,9 @@ module.exports = (env, argv) => ({
}
},
plugins: [
new webpack.DefinePlugin({
"process.env.IS_PREACT": JSON.stringify("false")
}),
new HtmlWebpackPlugin({
filename: "index.html",
template: "./src/index.html",
Expand Down

0 comments on commit 063c35a

Please sign in to comment.