From 5c410f26b305e98dbf732451a996fa54bd26376c Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Sun, 29 Oct 2023 16:44:24 +0000 Subject: [PATCH] cleanup --- jacdac-ts | 2 +- .../devicescript/DeviceScriptTextEditor.tsx | 75 ------------------ src/components/layout.tsx | 15 +--- src/components/shell/DataEditorAppBar.tsx | 77 ------------------- src/pages/editors.mdx | 12 --- src/pages/editors/devicescript.tsx | 13 ---- src/pages/tools/more.mdx | 1 - 7 files changed, 4 insertions(+), 191 deletions(-) delete mode 100644 src/components/devicescript/DeviceScriptTextEditor.tsx delete mode 100644 src/components/shell/DataEditorAppBar.tsx delete mode 100644 src/pages/editors.mdx delete mode 100644 src/pages/editors/devicescript.tsx diff --git a/jacdac-ts b/jacdac-ts index 16e1e8dbc252..1ebfb1de5cde 160000 --- a/jacdac-ts +++ b/jacdac-ts @@ -1 +1 @@ -Subproject commit 16e1e8dbc2522a84e16fffa4ad4dd8d0a2cba5d1 +Subproject commit 1ebfb1de5cde43f47f0fc571c76ce9787db0a72f diff --git a/src/components/devicescript/DeviceScriptTextEditor.tsx b/src/components/devicescript/DeviceScriptTextEditor.tsx deleted file mode 100644 index 4c3da63f3a20..000000000000 --- a/src/components/devicescript/DeviceScriptTextEditor.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import React, { useContext, lazy } from "react" -import { Grid, NoSsr } from "@mui/material" -import Suspense from "../ui/Suspense" -import useDeviceScriptVm from "./useDeviceScriptVm" -import DeviceScriptToolbar from "./DeviceScriptToolbar" -import GridHeader from "../ui/GridHeader" -import { useLocationSearchParamBoolean } from "../hooks/useLocationSearchParam" -import DeviceScriptStats from "./DeviceScriptStats" -import ConnectButtons from "../buttons/ConnectButtons" -import useRoleManagerClient from "../services/useRoleManagerClient" -import useChange from "../../jacdac/useChange" - -const DeviceScriptTextField = lazy(() => import("./DeviceScriptTextField")) -const ConsoleLog = lazy(() => import("../console/ConsoleLog")) -const Dashboard = lazy(() => import("../dashboard/Dashboard")) - -function DeviceScriptTextEditorWithContext() { - const showTextField = useLocationSearchParamBoolean("text", true) - - useDeviceScriptVm() - const roleManager = useRoleManagerClient() - useChange(roleManager, _ => _?.startSimulators()) - - return ( - - - } - /> - - - - - {showTextField && ( - - - - - - )} - - - - - - - - - - - - - - - - - - ) -} - -export default function DeviceScriptTextEditor() { - return ( - - - - ) -} diff --git a/src/components/layout.tsx b/src/components/layout.tsx index d5b8794082e4..8fd67335be76 100644 --- a/src/components/layout.tsx +++ b/src/components/layout.tsx @@ -30,7 +30,6 @@ const TraceAlert = lazy(() => import("./shell/TraceAlert")) const WebDiagnostics = lazy(() => import("./shell/WebDiagnostics")) const WebCam = lazy(() => import("./ui/WebCam")) const PassiveAlert = lazy(() => import("./shell/PassiveAlert")) -const DataEditorAppBar = lazy(() => import("./shell/DataEditorAppBar")) const YouTubePlayer = lazy(() => import("./youtube/YouTubePlayer")) const PREFIX = "Layout" @@ -223,25 +222,17 @@ function LayoutWithContext(props: LayoutProps) { const deviceScriptTool = /tools\/devicescript-/.test(path) const devicesPage = /^\/devices\/$/.test(path) const fullWidthTools = - /^\/editors\/\w/.test(path) || /^\/tools\/console\/$/.test(path) || /^\/(tools\/(makecode-|player|devicescript-)|dashboard)/.test(path) || !!frontmatter?.fullWidth - const isDataEditor = /^\/editors\/data/.test(path) const { hideMainMenu = false, hideBreadcrumbs = false } = frontmatter || { hideMainMenu: isHosted || makeCodeTool || deviceScriptTool, hideUnderConstruction: - isDataEditor || makeCodeTool || deviceScriptTool || fullWidthTools, - hideBreadcrumbs: isDataEditor || tools || fullWidthTools || devicesPage, + makeCodeTool || deviceScriptTool || fullWidthTools, + hideBreadcrumbs: tools || fullWidthTools || devicesPage, } - const appBar = hideMainMenu ? undefined : isDataEditor ? ( - - - - ) : ( - - ) + const appBar = hideMainMenu ? undefined : const { darkMode } = useContext(DarkModeContext) const { drawerType, toolsMenu, showWebCam } = useContext(AppContext) diff --git a/src/components/shell/DataEditorAppBar.tsx b/src/components/shell/DataEditorAppBar.tsx deleted file mode 100644 index ad0c15164786..000000000000 --- a/src/components/shell/DataEditorAppBar.tsx +++ /dev/null @@ -1,77 +0,0 @@ -import React, { useContext } from "react" -import { styled } from "@mui/material/styles" -import { Hidden, Box } from "@mui/material" -import AppBar from "@mui/material/AppBar" -import Toolbar from "@mui/material/Toolbar" -import Typography from "@mui/material/Typography" -// tslint:disable-next-line: no-submodule-imports -import DarkModeContext from "../ui/DarkModeContext" -import { HideOnScroll } from "../ui/HideOnScroll" -import { Link } from "gatsby-theme-material-ui" - -const PREFIX = "DataEditorApp" - -const classes = { - grow: `${PREFIX}grow`, - appBar: `${PREFIX}appBar`, - menuButton: `${PREFIX}menuButton`, -} - -const StyledBox = styled(Box)(({ theme }) => ({ - [`& .${classes.grow}`]: { - flexGrow: 1, - }, - - [`& .${classes.appBar}`]: { - transition: theme.transitions.create(["margin", "width"], { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.leavingScreen, - }), - }, - - [`& .${classes.menuButton}`]: { - marginRight: theme.spacing(1), - }, -})) - -export default function DataEditorAppBar() { - const { darkMode } = useContext(DarkModeContext) - const appBarColor = darkMode === "dark" ? "inherit" : undefined - - return ( - - - - - - - - Data Science Editor (Experimental) - - - -
- - About - - - - - - ) -} diff --git a/src/pages/editors.mdx b/src/pages/editors.mdx deleted file mode 100644 index fad6c18a14ad..000000000000 --- a/src/pages/editors.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -hideToc: true -title: Editors ---- - -# Editors - -The Jacdac web site hosts a few experimental editors. - -- [DeviceScript Editor](/editors/devicescript/) -- [Data Science Editor](/editors/data/) -- [Machine Learning Editor](/editors/ml/) diff --git a/src/pages/editors/devicescript.tsx b/src/pages/editors/devicescript.tsx deleted file mode 100644 index 8197527e560e..000000000000 --- a/src/pages/editors/devicescript.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from "react" -import DeviceScriptTextEditor from "../../components/devicescript/DeviceScriptTextEditor" - -export const frontmatter = { - title: "DeviceScript Editor", - description: "Edit DeviceScript programs.", -} -import CoreHead from "../../components/shell/Head" -export const Head = props => - -export default function Page() { - return -} diff --git a/src/pages/tools/more.mdx b/src/pages/tools/more.mdx index 577df73479b3..355142c19bdf 100644 --- a/src/pages/tools/more.mdx +++ b/src/pages/tools/more.mdx @@ -25,5 +25,4 @@ order: 100 - [Enclosure generator](/tools/enclosure), generate STL files of enclosures for models - [EC30 shape generator](/tools/ec30), generates EC30 shape profiles as SVG or DXF -- [data science](/editors/data/), block coding for data science - [model uploader](/tools/model-uploader/), deploy Machine Learning models (like TensorFlow Lite)