Skip to content

Commit bf1bf62

Browse files
committed
Backport imports
1 parent 217f822 commit bf1bf62

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ import "./index.scss";
88

99
import Navigation from "./components/Navigation";
1010
import SplitEditor from "./components/SplitEditor";
11-
import { getLastState, mergeStates, saveLastEngine } from "./config";
12-
import { FileSaver } from "./FileSaver";
13-
import { exportAs, type SupportedEngine, saveSource } from "./rendering";
14-
import { tutorial } from "./samples";
15-
import { copyToClipboard, getShareUrl, getSourceFromUrl } from "./utils";
11+
import { getLastState, mergeStates, saveLastEngine } from "./config.js";
12+
import { FileSaver } from "./FileSaver.js";
13+
import { exportAs, type SupportedEngine, saveSource } from "./rendering.js";
14+
import { tutorial } from "./samples/index.js";
15+
import { copyToClipboard, getShareUrl, getSourceFromUrl } from "./utils.js";
1616
import {
1717
type ExportableFormat,
1818
sourceFormatExtension,
1919
supportedEngines,
20-
} from "./viz";
20+
} from "./viz.js";
2121

2222
const defaultEngine = supportedEngines[1];
2323

@@ -31,9 +31,10 @@ interface Props {
3131

3232
const defaultSource = tutorial;
3333

34+
const saver = new FileSaver();
35+
3436
class App extends Component<Props, State> {
3537
#currentSource: string | undefined = undefined;
36-
#saver: FileSaver = new FileSaver();
3738
#editorRef: RefObject<import("./components/SplitEditor").default | null> =
3839
createRef();
3940

@@ -68,9 +69,9 @@ class App extends Component<Props, State> {
6869
const dotSrc = this.#currentSource;
6970
if (dotSrc) {
7071
if (format === sourceFormatExtension) {
71-
saveSource(dotSrc, this.#saver);
72+
saveSource(dotSrc, saver);
7273
} else {
73-
exportAs(dotSrc, format, this.state, this.#saver);
74+
exportAs(dotSrc, format, this.state, saver);
7475
}
7576
}
7677
};

0 commit comments

Comments
 (0)