|
1 | | -import { Classes, Intent, OverlayToaster, type ToastProps, type Toaster } from "@blueprintjs/core"; |
| 1 | +import { Classes, Intent, OverlayToaster, type ToastProps } from "@blueprintjs/core"; |
2 | 2 | import classNames from "classnames"; |
| 3 | +import { SourceDocumentation, getNames, runInContext, type Context } from "js-slang"; |
3 | 4 | import { Chapter, Variant } from "js-slang/dist/types"; |
4 | 5 | import { stringify } from "js-slang/dist/utils/stringify"; |
5 | 6 | import React, { useCallback } from "react"; |
6 | 7 | import { HotKeys } from "react-hotkeys"; |
7 | | - |
| 8 | +import mockModuleContext from "../mockModuleContext"; |
| 9 | +import type { InterpreterOutput } from "../types"; |
8 | 10 | import Workspace, { type WorkspaceProps } from "./Workspace"; |
| 11 | +import { ControlBarClearButton } from "./controlBar/ControlBarClearButton"; |
| 12 | +import { ControlBarRefreshButton } from "./controlBar/ControlBarRefreshButton"; |
9 | 13 | import { ControlBarRunButton } from "./controlBar/ControlBarRunButton"; |
10 | | -import { type Context, runInContext, getNames, SourceDocumentation } from "js-slang"; |
| 14 | +import testTabContent from "./sideContent/TestTab"; |
| 15 | +import type { SideContentTab } from "./sideContent/types"; |
| 16 | +import { getDynamicTabs } from "./sideContent/utils"; |
11 | 17 |
|
12 | 18 | // Importing this straight from js-slang doesn't work for whatever reason |
13 | 19 | import createContext from "js-slang/dist/createContext"; |
14 | 20 |
|
15 | | -import { getDynamicTabs } from "./sideContent/utils"; |
16 | | -import type { SideContentTab } from "./sideContent/types"; |
17 | | -import testTabContent from "./sideContent/TestTab"; |
18 | | -import { ControlBarClearButton } from "./controlBar/ControlBarClearButton"; |
19 | | -import { ControlBarRefreshButton } from "./controlBar/ControlBarRefreshButton"; |
20 | | -import type { InterpreterOutput } from "../types"; |
21 | | -import mockModuleContext from "../mockModuleContext"; |
22 | | - |
23 | 21 | const refreshSuccessToast: ToastProps = { |
24 | 22 | intent: Intent.SUCCESS, |
25 | 23 | message: "Refresh Successful!" |
@@ -48,7 +46,7 @@ const Playground: React.FC<{}> = () => { |
48 | 46 | const [replOutput, setReplOutput] = React.useState<InterpreterOutput | null>(null); |
49 | 47 | const [alerts, setAlerts] = React.useState<string[]>([]); |
50 | 48 |
|
51 | | - const toaster = React.useRef<Toaster | null>(null); |
| 49 | + const toaster = React.useRef<OverlayToaster>(null); |
52 | 50 |
|
53 | 51 | const showToast = (props: ToastProps) => { |
54 | 52 | if (toaster.current) { |
|
0 commit comments