diff --git a/README.md b/README.md index bf95742c4..d86a00a2d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ <p align="center"> - <img src="src/electron/renderer/assets/img/logo-guide-draft-transparent-tight.png" width="250" alt="NeuroConv logo"/> + <img src="src/electron/frontend/assets/img/logo-guide-draft-transparent-tight.png" width="250" alt="NeuroConv logo"/> <h3 align="center">NWB Graphical User Interface for Data Entry</h3> <p align="center"> <a href="https://github.com/NeurodataWithoutBorders/nwb-guide/actions/workflows/testing.yml"><img src="https://github.com/NeurodataWithoutBorders/nwb-guide/actions/workflows/testing.yml/badge.svg" alt="Full Tests"></a> diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index 208b730ce..2888018bf 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -88,13 +88,17 @@ Repo Structure - `main` - `src` - Contains all the source code for the backend - `assets` - Contains all the backend-facing assets (e.g. images, css, etc.) - - `renderer` - - `src` - Contains all the source code for the frontend + - `preload` + - `preload.js` - Exposes electron-specific variables to the frontend + - `frontend` + - `core` - Contains all the source code for the frontend - `index.js` - The entry point for the application - `pages.js` - The main code that controls which pages are rendered and how they are linked together - - `stories` - Contains all the Web Components and related Storybook stories - - `electron` - Contains all the Electron-related code to enable conditional inclusion for development mode + - `components` - Contains all the UI Components used throughout the app - `assets` - Contains all the frontend-facing assets (e.g. images, css, etc.) + - `utils` + - `electron.js` - Contains electron-exposed variables + - `url.js` - Saving the history state for hot reloading and refresh page functionality - `pyflask` - Contains all the source code for the backend - `schemas` - Contains all the JSON schemas used for validation diff --git a/docs/index.rst b/docs/index.rst index 2fb04c252..2805f6417 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -2,7 +2,7 @@ NWB GUIDE documentation ======================= | -.. image:: ../src/electron/renderer/assets/img/logo-guide-draft-transparent-tight.png +.. image:: ../src/electron/frontend/assets/img/logo-guide-draft-transparent-tight.png :scale: 50 % :align: center :alt: NWB GUIDE logo diff --git a/electron.vite.config.js b/electron.vite.config.js index 21a8b4b8f..bf952ab7c 100644 --- a/electron.vite.config.js +++ b/electron.vite.config.js @@ -4,7 +4,7 @@ import ViteYaml from "@modyfi/vite-plugin-yaml"; import { resolve } from "path"; -const htmlRoot = "src/electron/renderer"; +const htmlRoot = "src/electron/frontend"; export default defineConfig({ main: { diff --git a/package.json b/package.json index 0d9b55dd9..81aea6245 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,7 @@ "scripts": { "start": "electron-vite dev --outDir build", "postinstall": "electron-builder install-app-deps", - "dev": "concurrently -n BE,FE --kill-others \"npm run dev:server\" \"npm run dev:app\"", - "dev:app": "vite src/electron/renderer", - "dev:server": "cd src/pyflask && python -m flask run --port 4242", + "server": "cd src/pyflask && python -m flask run --port 4242", "build": "npm run build:app", "echo": "python -c \"print('hello')\"", "build:app": "electron-vite build --outDir build", @@ -77,7 +75,7 @@ "win": { "asar": false, "target": "nsis", - "icon": "src/electron/renderer/assets/app-icon/logo-guide-draft.ico", + "icon": "src/electron/frontend/assets/app-icon/logo-guide-draft.ico", "requestedExecutionLevel": "requireAdministrator" }, "mac": { @@ -98,7 +96,7 @@ ] } ], - "icon": "src/electron/renderer/assets/img/logo-guide-draft.png", + "icon": "src/electron/frontend/assets/img/logo-guide-draft.png", "darkModeSupport": false, "hardenedRuntime": true, "gatekeeperAssess": false, @@ -114,7 +112,7 @@ "linux": { "asar": true, "target": "AppImage", - "icon": "src/electron/renderer/assets/img/logo-guide-draft.png", + "icon": "src/electron/frontend/assets/img/logo-guide-draft.png", "extraResources": [ { "from": "./build/flask/nwb-guide", @@ -127,7 +125,7 @@ "oneClick": false, "perMachine": false, "allowToChangeInstallationDirectory": true, - "installerIcon": "src/electron/renderer/assets/app-icon/logo-guide-draft.ico" + "installerIcon": "src/electron/frontend/assets/app-icon/logo-guide-draft.ico" }, "publish": { "provider": "github" diff --git a/src/electron/renderer/assets/app-icon/logo-guide-draft.ico b/src/electron/frontend/assets/app-icon/logo-guide-draft.ico similarity index 100% rename from src/electron/renderer/assets/app-icon/logo-guide-draft.ico rename to src/electron/frontend/assets/app-icon/logo-guide-draft.ico diff --git a/src/electron/renderer/assets/css/demo.css b/src/electron/frontend/assets/css/demo.css similarity index 100% rename from src/electron/renderer/assets/css/demo.css rename to src/electron/frontend/assets/css/demo.css diff --git a/src/electron/renderer/assets/css/fontawesome.css b/src/electron/frontend/assets/css/fontawesome.css similarity index 100% rename from src/electron/renderer/assets/css/fontawesome.css rename to src/electron/frontend/assets/css/fontawesome.css diff --git a/src/electron/renderer/assets/css/global.css b/src/electron/frontend/assets/css/global.css similarity index 100% rename from src/electron/renderer/assets/css/global.css rename to src/electron/frontend/assets/css/global.css diff --git a/src/electron/renderer/assets/css/guided.css b/src/electron/frontend/assets/css/guided.css similarity index 100% rename from src/electron/renderer/assets/css/guided.css rename to src/electron/frontend/assets/css/guided.css diff --git a/src/electron/renderer/assets/css/individualtab.css b/src/electron/frontend/assets/css/individualtab.css similarity index 100% rename from src/electron/renderer/assets/css/individualtab.css rename to src/electron/frontend/assets/css/individualtab.css diff --git a/src/electron/renderer/assets/css/main.css b/src/electron/frontend/assets/css/main.css similarity index 100% rename from src/electron/renderer/assets/css/main.css rename to src/electron/frontend/assets/css/main.css diff --git a/src/electron/renderer/assets/css/main_tabs.css b/src/electron/frontend/assets/css/main_tabs.css similarity index 100% rename from src/electron/renderer/assets/css/main_tabs.css rename to src/electron/frontend/assets/css/main_tabs.css diff --git a/src/electron/renderer/assets/css/nativize.css b/src/electron/frontend/assets/css/nativize.css similarity index 100% rename from src/electron/renderer/assets/css/nativize.css rename to src/electron/frontend/assets/css/nativize.css diff --git a/src/electron/renderer/assets/css/nav.css b/src/electron/frontend/assets/css/nav.css similarity index 100% rename from src/electron/renderer/assets/css/nav.css rename to src/electron/frontend/assets/css/nav.css diff --git a/src/electron/renderer/assets/css/print.css b/src/electron/frontend/assets/css/print.css similarity index 100% rename from src/electron/renderer/assets/css/print.css rename to src/electron/frontend/assets/css/print.css diff --git a/src/electron/renderer/assets/css/section.css b/src/electron/frontend/assets/css/section.css similarity index 100% rename from src/electron/renderer/assets/css/section.css rename to src/electron/frontend/assets/css/section.css diff --git a/src/electron/renderer/assets/css/spur.css b/src/electron/frontend/assets/css/spur.css similarity index 100% rename from src/electron/renderer/assets/css/spur.css rename to src/electron/frontend/assets/css/spur.css diff --git a/src/electron/renderer/assets/css/tablepath.css b/src/electron/frontend/assets/css/tablepath.css similarity index 100% rename from src/electron/renderer/assets/css/tablepath.css rename to src/electron/frontend/assets/css/tablepath.css diff --git a/src/electron/renderer/assets/css/variables.css b/src/electron/frontend/assets/css/variables.css similarity index 100% rename from src/electron/renderer/assets/css/variables.css rename to src/electron/frontend/assets/css/variables.css diff --git a/src/electron/renderer/assets/icons/dandi.svg b/src/electron/frontend/assets/icons/dandi.svg similarity index 100% rename from src/electron/renderer/assets/icons/dandi.svg rename to src/electron/frontend/assets/icons/dandi.svg diff --git a/src/electron/renderer/assets/icons/delete.svg b/src/electron/frontend/assets/icons/delete.svg similarity index 100% rename from src/electron/renderer/assets/icons/delete.svg rename to src/electron/frontend/assets/icons/delete.svg diff --git a/src/electron/renderer/assets/icons/exploration.svg b/src/electron/frontend/assets/icons/exploration.svg similarity index 100% rename from src/electron/renderer/assets/icons/exploration.svg rename to src/electron/frontend/assets/icons/exploration.svg diff --git a/src/electron/renderer/assets/icons/folder_open.svg b/src/electron/frontend/assets/icons/folder_open.svg similarity index 100% rename from src/electron/renderer/assets/icons/folder_open.svg rename to src/electron/frontend/assets/icons/folder_open.svg diff --git a/src/electron/renderer/assets/icons/fullscreen.svg b/src/electron/frontend/assets/icons/fullscreen.svg similarity index 100% rename from src/electron/renderer/assets/icons/fullscreen.svg rename to src/electron/frontend/assets/icons/fullscreen.svg diff --git a/src/electron/renderer/assets/icons/fullscreen_exit.svg b/src/electron/frontend/assets/icons/fullscreen_exit.svg similarity index 100% rename from src/electron/renderer/assets/icons/fullscreen_exit.svg rename to src/electron/frontend/assets/icons/fullscreen_exit.svg diff --git a/src/electron/renderer/assets/icons/global.svg b/src/electron/frontend/assets/icons/global.svg similarity index 100% rename from src/electron/renderer/assets/icons/global.svg rename to src/electron/frontend/assets/icons/global.svg diff --git a/src/electron/renderer/assets/icons/inspect.svg b/src/electron/frontend/assets/icons/inspect.svg similarity index 100% rename from src/electron/renderer/assets/icons/inspect.svg rename to src/electron/frontend/assets/icons/inspect.svg diff --git a/src/electron/renderer/assets/icons/key.svg b/src/electron/frontend/assets/icons/key.svg similarity index 100% rename from src/electron/renderer/assets/icons/key.svg rename to src/electron/frontend/assets/icons/key.svg diff --git a/src/electron/renderer/assets/icons/neurosift-logo.svg b/src/electron/frontend/assets/icons/neurosift-logo.svg similarity index 100% rename from src/electron/renderer/assets/icons/neurosift-logo.svg rename to src/electron/frontend/assets/icons/neurosift-logo.svg diff --git a/src/electron/renderer/assets/icons/preview.svg b/src/electron/frontend/assets/icons/preview.svg similarity index 100% rename from src/electron/renderer/assets/icons/preview.svg rename to src/electron/frontend/assets/icons/preview.svg diff --git a/src/electron/renderer/assets/icons/python.svg b/src/electron/frontend/assets/icons/python.svg similarity index 100% rename from src/electron/renderer/assets/icons/python.svg rename to src/electron/frontend/assets/icons/python.svg diff --git a/src/electron/renderer/assets/icons/restart.svg b/src/electron/frontend/assets/icons/restart.svg similarity index 100% rename from src/electron/renderer/assets/icons/restart.svg rename to src/electron/frontend/assets/icons/restart.svg diff --git a/src/electron/renderer/assets/icons/save.svg b/src/electron/frontend/assets/icons/save.svg similarity index 100% rename from src/electron/renderer/assets/icons/save.svg rename to src/electron/frontend/assets/icons/save.svg diff --git a/src/electron/renderer/assets/icons/search.svg b/src/electron/frontend/assets/icons/search.svg similarity index 100% rename from src/electron/renderer/assets/icons/search.svg rename to src/electron/frontend/assets/icons/search.svg diff --git a/src/electron/renderer/assets/icons/server.svg b/src/electron/frontend/assets/icons/server.svg similarity index 100% rename from src/electron/renderer/assets/icons/server.svg rename to src/electron/frontend/assets/icons/server.svg diff --git a/src/electron/renderer/assets/icons/settings.svg b/src/electron/frontend/assets/icons/settings.svg similarity index 100% rename from src/electron/renderer/assets/icons/settings.svg rename to src/electron/frontend/assets/icons/settings.svg diff --git a/src/electron/renderer/assets/icons/web_asset.svg b/src/electron/frontend/assets/icons/web_asset.svg similarity index 100% rename from src/electron/renderer/assets/icons/web_asset.svg rename to src/electron/frontend/assets/icons/web_asset.svg diff --git a/src/electron/renderer/assets/icons/wifi.svg b/src/electron/frontend/assets/icons/wifi.svg similarity index 100% rename from src/electron/renderer/assets/icons/wifi.svg rename to src/electron/frontend/assets/icons/wifi.svg diff --git a/src/electron/renderer/assets/img/logo-catalystneuro.png b/src/electron/frontend/assets/img/logo-catalystneuro.png similarity index 100% rename from src/electron/renderer/assets/img/logo-catalystneuro.png rename to src/electron/frontend/assets/img/logo-catalystneuro.png diff --git a/src/electron/renderer/assets/img/logo-guide-draft-transparent-tight.png b/src/electron/frontend/assets/img/logo-guide-draft-transparent-tight.png similarity index 100% rename from src/electron/renderer/assets/img/logo-guide-draft-transparent-tight.png rename to src/electron/frontend/assets/img/logo-guide-draft-transparent-tight.png diff --git a/src/electron/renderer/assets/img/logo-guide-draft-transparent.png b/src/electron/frontend/assets/img/logo-guide-draft-transparent.png similarity index 100% rename from src/electron/renderer/assets/img/logo-guide-draft-transparent.png rename to src/electron/frontend/assets/img/logo-guide-draft-transparent.png diff --git a/src/electron/renderer/assets/img/logo-guide-draft.png b/src/electron/frontend/assets/img/logo-guide-draft.png similarity index 100% rename from src/electron/renderer/assets/img/logo-guide-draft.png rename to src/electron/frontend/assets/img/logo-guide-draft.png diff --git a/src/electron/renderer/assets/img/logo-neuroconv.png b/src/electron/frontend/assets/img/logo-neuroconv.png similarity index 100% rename from src/electron/renderer/assets/img/logo-neuroconv.png rename to src/electron/frontend/assets/img/logo-neuroconv.png diff --git a/src/electron/renderer/assets/lotties/contact-us-lotties.js b/src/electron/frontend/assets/lotties/contact-us-lotties.js similarity index 100% rename from src/electron/renderer/assets/lotties/contact-us-lotties.js rename to src/electron/frontend/assets/lotties/contact-us-lotties.js diff --git a/src/electron/renderer/assets/lotties/documentation-lotties.js b/src/electron/frontend/assets/lotties/documentation-lotties.js similarity index 100% rename from src/electron/renderer/assets/lotties/documentation-lotties.js rename to src/electron/frontend/assets/lotties/documentation-lotties.js diff --git a/src/electron/renderer/assets/lotties/index.js b/src/electron/frontend/assets/lotties/index.js similarity index 100% rename from src/electron/renderer/assets/lotties/index.js rename to src/electron/frontend/assets/lotties/index.js diff --git a/src/electron/renderer/assets/lotties/overview-lotties.js b/src/electron/frontend/assets/lotties/overview-lotties.js similarity index 100% rename from src/electron/renderer/assets/lotties/overview-lotties.js rename to src/electron/frontend/assets/lotties/overview-lotties.js diff --git a/src/electron/renderer/src/stories/Accordion.js b/src/electron/frontend/core/components/Accordion.js similarity index 100% rename from src/electron/renderer/src/stories/Accordion.js rename to src/electron/frontend/core/components/Accordion.js diff --git a/src/electron/renderer/src/stories/BasicTable.js b/src/electron/frontend/core/components/BasicTable.js similarity index 100% rename from src/electron/renderer/src/stories/BasicTable.js rename to src/electron/frontend/core/components/BasicTable.js diff --git a/src/electron/renderer/src/stories/Button.js b/src/electron/frontend/core/components/Button.js similarity index 100% rename from src/electron/renderer/src/stories/Button.js rename to src/electron/frontend/core/components/Button.js diff --git a/src/electron/renderer/src/stories/Chevron.js b/src/electron/frontend/core/components/Chevron.js similarity index 100% rename from src/electron/renderer/src/stories/Chevron.js rename to src/electron/frontend/core/components/Chevron.js diff --git a/src/electron/renderer/src/stories/CodeBlock.js b/src/electron/frontend/core/components/CodeBlock.js similarity index 100% rename from src/electron/renderer/src/stories/CodeBlock.js rename to src/electron/frontend/core/components/CodeBlock.js diff --git a/src/electron/renderer/src/stories/DandiResults.js b/src/electron/frontend/core/components/DandiResults.js similarity index 100% rename from src/electron/renderer/src/stories/DandiResults.js rename to src/electron/frontend/core/components/DandiResults.js diff --git a/src/electron/renderer/src/stories/Dashboard.js b/src/electron/frontend/core/components/Dashboard.js similarity index 96% rename from src/electron/renderer/src/stories/Dashboard.js rename to src/electron/frontend/core/components/Dashboard.js index 74a228430..0b3b96ca5 100644 --- a/src/electron/renderer/src/stories/Dashboard.js +++ b/src/electron/frontend/core/components/Dashboard.js @@ -29,8 +29,9 @@ import "../../../../../node_modules/fomantic-ui/dist/components/accordion.min.cs import "../../../../../node_modules/@sweetalert2/theme-bulma/bulma.css"; // import "../../node_modules/intro.js/minified/introjs.min.css" import "../../assets/css/guided.css"; -import isElectron from "../electron/check.js"; -import { isStorybook, reloadPageToHome } from "../dependencies/globals"; +import { isElectron } from "../../utils/electron.js"; +import { isStorybook, reloadPageToHome } from "../globals.js"; + import { getCurrentProjectName, updateAppProgress } from "../progress/index.js"; // import "https://jsuites.net/v4/jsuites.js" diff --git a/src/electron/renderer/src/stories/DateTimeSelector.js b/src/electron/frontend/core/components/DateTimeSelector.js similarity index 100% rename from src/electron/renderer/src/stories/DateTimeSelector.js rename to src/electron/frontend/core/components/DateTimeSelector.js diff --git a/src/electron/renderer/src/stories/FileSystemSelector.js b/src/electron/frontend/core/components/FileSystemSelector.js similarity index 96% rename from src/electron/renderer/src/stories/FileSystemSelector.js rename to src/electron/frontend/core/components/FileSystemSelector.js index 3bef33378..da0c10140 100644 --- a/src/electron/renderer/src/stories/FileSystemSelector.js +++ b/src/electron/frontend/core/components/FileSystemSelector.js @@ -1,6 +1,6 @@ import { LitElement, css, html } from "lit"; -import { fs, remote } from "../electron/index"; +import { fs, remote } from "../../utils/electron"; import { List } from "./List"; const { dialog } = remote; diff --git a/src/electron/renderer/src/stories/Footer.js b/src/electron/frontend/core/components/Footer.js similarity index 100% rename from src/electron/renderer/src/stories/Footer.js rename to src/electron/frontend/core/components/Footer.js diff --git a/src/electron/renderer/src/stories/FullScreenToggle.ts b/src/electron/frontend/core/components/FullScreenToggle.ts similarity index 100% rename from src/electron/renderer/src/stories/FullScreenToggle.ts rename to src/electron/frontend/core/components/FullScreenToggle.ts diff --git a/src/electron/renderer/src/stories/InfoBox.js b/src/electron/frontend/core/components/InfoBox.js similarity index 100% rename from src/electron/renderer/src/stories/InfoBox.js rename to src/electron/frontend/core/components/InfoBox.js diff --git a/src/electron/renderer/src/stories/InstanceManager.js b/src/electron/frontend/core/components/InstanceManager.js similarity index 96% rename from src/electron/renderer/src/stories/InstanceManager.js rename to src/electron/frontend/core/components/InstanceManager.js index 41ecd6e37..cc5071713 100644 --- a/src/electron/renderer/src/stories/InstanceManager.js +++ b/src/electron/frontend/core/components/InstanceManager.js @@ -1,6 +1,6 @@ import { LitElement, css, html } from "lit"; import "./Button"; -import { notify } from "../dependencies/globals"; +import { notify } from "../dependencies"; import { Accordion } from "./Accordion"; import { InstanceListItem } from "./instances/item"; import { checkStatus } from "../validation"; diff --git a/src/electron/renderer/src/stories/JSONSchemaForm.js b/src/electron/frontend/core/components/JSONSchemaForm.js similarity index 100% rename from src/electron/renderer/src/stories/JSONSchemaForm.js rename to src/electron/frontend/core/components/JSONSchemaForm.js diff --git a/src/electron/renderer/src/stories/JSONSchemaInput.js b/src/electron/frontend/core/components/JSONSchemaInput.js similarity index 100% rename from src/electron/renderer/src/stories/JSONSchemaInput.js rename to src/electron/frontend/core/components/JSONSchemaInput.js diff --git a/src/electron/renderer/src/stories/List.ts b/src/electron/frontend/core/components/List.ts similarity index 100% rename from src/electron/renderer/src/stories/List.ts rename to src/electron/frontend/core/components/List.ts diff --git a/src/electron/renderer/src/stories/Loader.ts b/src/electron/frontend/core/components/Loader.ts similarity index 100% rename from src/electron/renderer/src/stories/Loader.ts rename to src/electron/frontend/core/components/Loader.ts diff --git a/src/electron/renderer/src/stories/Main.js b/src/electron/frontend/core/components/Main.js similarity index 100% rename from src/electron/renderer/src/stories/Main.js rename to src/electron/frontend/core/components/Main.js diff --git a/src/electron/renderer/src/stories/Modal.ts b/src/electron/frontend/core/components/Modal.ts similarity index 100% rename from src/electron/renderer/src/stories/Modal.ts rename to src/electron/frontend/core/components/Modal.ts diff --git a/src/electron/renderer/src/stories/NavigationSidebar.js b/src/electron/frontend/core/components/NavigationSidebar.js similarity index 100% rename from src/electron/renderer/src/stories/NavigationSidebar.js rename to src/electron/frontend/core/components/NavigationSidebar.js diff --git a/src/electron/renderer/src/stories/OptionalSection.js b/src/electron/frontend/core/components/OptionalSection.js similarity index 100% rename from src/electron/renderer/src/stories/OptionalSection.js rename to src/electron/frontend/core/components/OptionalSection.js diff --git a/src/electron/renderer/src/stories/Overlay.ts b/src/electron/frontend/core/components/Overlay.ts similarity index 100% rename from src/electron/renderer/src/stories/Overlay.ts rename to src/electron/frontend/core/components/Overlay.ts diff --git a/src/electron/renderer/src/stories/ProgressBar.ts b/src/electron/frontend/core/components/ProgressBar.ts similarity index 100% rename from src/electron/renderer/src/stories/ProgressBar.ts rename to src/electron/frontend/core/components/ProgressBar.ts diff --git a/src/electron/renderer/src/stories/Search.js b/src/electron/frontend/core/components/Search.js similarity index 100% rename from src/electron/renderer/src/stories/Search.js rename to src/electron/frontend/core/components/Search.js diff --git a/src/electron/renderer/src/stories/SimpleTable.js b/src/electron/frontend/core/components/SimpleTable.js similarity index 100% rename from src/electron/renderer/src/stories/SimpleTable.js rename to src/electron/frontend/core/components/SimpleTable.js diff --git a/src/electron/renderer/src/stories/Table.js b/src/electron/frontend/core/components/Table.js similarity index 100% rename from src/electron/renderer/src/stories/Table.js rename to src/electron/frontend/core/components/Table.js diff --git a/src/electron/renderer/src/stories/forms/GlobalFormModal.ts b/src/electron/frontend/core/components/forms/GlobalFormModal.ts similarity index 100% rename from src/electron/renderer/src/stories/forms/GlobalFormModal.ts rename to src/electron/frontend/core/components/forms/GlobalFormModal.ts diff --git a/src/electron/renderer/src/stories/forms/utils.ts b/src/electron/frontend/core/components/forms/utils.ts similarity index 100% rename from src/electron/renderer/src/stories/forms/utils.ts rename to src/electron/frontend/core/components/forms/utils.ts diff --git a/src/electron/renderer/src/stories/globals.js b/src/electron/frontend/core/components/globals.js similarity index 100% rename from src/electron/renderer/src/stories/globals.js rename to src/electron/frontend/core/components/globals.js diff --git a/src/electron/renderer/src/stories/hot.js b/src/electron/frontend/core/components/hot.js similarity index 100% rename from src/electron/renderer/src/stories/hot.js rename to src/electron/frontend/core/components/hot.js diff --git a/src/electron/renderer/src/stories/instances/item.ts b/src/electron/frontend/core/components/instances/item.ts similarity index 100% rename from src/electron/renderer/src/stories/instances/item.ts rename to src/electron/frontend/core/components/instances/item.ts diff --git a/src/electron/renderer/src/stories/multiselect/MultiSelectForm.js b/src/electron/frontend/core/components/multiselect/MultiSelectForm.js similarity index 100% rename from src/electron/renderer/src/stories/multiselect/MultiSelectForm.js rename to src/electron/frontend/core/components/multiselect/MultiSelectForm.js diff --git a/src/electron/renderer/src/stories/pages/FormPage.js b/src/electron/frontend/core/components/pages/FormPage.js similarity index 100% rename from src/electron/renderer/src/stories/pages/FormPage.js rename to src/electron/frontend/core/components/pages/FormPage.js diff --git a/src/electron/renderer/src/stories/pages/Page.js b/src/electron/frontend/core/components/pages/Page.js similarity index 96% rename from src/electron/renderer/src/stories/pages/Page.js rename to src/electron/frontend/core/components/pages/Page.js index 18ffd028f..e40b2602f 100644 --- a/src/electron/renderer/src/stories/pages/Page.js +++ b/src/electron/frontend/core/components/pages/Page.js @@ -1,7 +1,10 @@ import { LitElement, html } from "lit"; import { runConversion } from "./guided-mode/options/utils.js"; import { get, save } from "../../progress/index.js"; -import { dismissNotification, isStorybook, notify } from "../../dependencies/globals"; + +import { dismissNotification, notify } from "../../dependencies.js"; +import { isStorybook } from "../../globals.js"; + import { randomizeElements, mapSessions, merge } from "./utils"; import { resolveMetadata } from "./guided-mode/data/utils.js"; diff --git a/src/electron/renderer/src/stories/pages/Unsafe.js b/src/electron/frontend/core/components/pages/Unsafe.js similarity index 100% rename from src/electron/renderer/src/stories/pages/Unsafe.js rename to src/electron/frontend/core/components/pages/Unsafe.js diff --git a/src/electron/renderer/src/stories/pages/contact-us/Contact.js b/src/electron/frontend/core/components/pages/contact-us/Contact.js similarity index 94% rename from src/electron/renderer/src/stories/pages/contact-us/Contact.js rename to src/electron/frontend/core/components/pages/contact-us/Contact.js index 90e7ade16..2b8995dae 100644 --- a/src/electron/renderer/src/stories/pages/contact-us/Contact.js +++ b/src/electron/frontend/core/components/pages/contact-us/Contact.js @@ -2,7 +2,7 @@ import { html } from "lit"; import { contact_lottie } from "../../../../assets/lotties/contact-us-lotties.js"; import { Page } from "../Page.js"; -import { startLottie } from "../../../dependencies/globals"; +import { startLottie } from "../../../dependencies.js"; export class ContactPage extends Page { header = { diff --git a/src/electron/renderer/src/stories/pages/documentation/Documentation.js b/src/electron/frontend/core/components/pages/documentation/Documentation.js similarity index 96% rename from src/electron/renderer/src/stories/pages/documentation/Documentation.js rename to src/electron/frontend/core/components/pages/documentation/Documentation.js index 023e05c51..77ca419d4 100644 --- a/src/electron/renderer/src/stories/pages/documentation/Documentation.js +++ b/src/electron/frontend/core/components/pages/documentation/Documentation.js @@ -2,7 +2,7 @@ import { html } from "lit"; import { docu_lottie } from "../../../../assets/lotties/documentation-lotties.js"; import { Page } from "../Page.js"; -import { startLottie } from "../../../dependencies/globals"; +import { startLottie } from "../../../dependencies.js"; import { Button } from "../../Button.js"; diff --git a/src/electron/renderer/src/stories/pages/getting-started/GettingStarted.js b/src/electron/frontend/core/components/pages/getting-started/GettingStarted.js similarity index 100% rename from src/electron/renderer/src/stories/pages/getting-started/GettingStarted.js rename to src/electron/frontend/core/components/pages/getting-started/GettingStarted.js diff --git a/src/electron/renderer/src/stories/pages/globals.js b/src/electron/frontend/core/components/pages/globals.js similarity index 100% rename from src/electron/renderer/src/stories/pages/globals.js rename to src/electron/frontend/core/components/pages/globals.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/GuidedFooter.js b/src/electron/frontend/core/components/pages/guided-mode/GuidedFooter.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/GuidedFooter.js rename to src/electron/frontend/core/components/pages/guided-mode/GuidedFooter.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/GuidedHeader.js b/src/electron/frontend/core/components/pages/guided-mode/GuidedHeader.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/GuidedHeader.js rename to src/electron/frontend/core/components/pages/guided-mode/GuidedHeader.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/GuidedHome.js b/src/electron/frontend/core/components/pages/guided-mode/GuidedHome.js similarity index 97% rename from src/electron/renderer/src/stories/pages/guided-mode/GuidedHome.js rename to src/electron/frontend/core/components/pages/guided-mode/GuidedHome.js index 07d4fa1c8..a71dc03d6 100644 --- a/src/electron/renderer/src/stories/pages/guided-mode/GuidedHome.js +++ b/src/electron/frontend/core/components/pages/guided-mode/GuidedHome.js @@ -2,7 +2,7 @@ import { html } from "lit"; import { Page } from "../Page.js"; import { ProgressCard } from "./ProgressCard.js"; -import { startLottie } from "../../../dependencies/globals"; +import { startLottie } from "../../../dependencies.js"; import * as progress from "../../../progress/index.js"; import { newDataset } from "../../../../assets/lotties/index.js"; diff --git a/src/electron/renderer/src/stories/pages/guided-mode/GuidedStart.js b/src/electron/frontend/core/components/pages/guided-mode/GuidedStart.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/GuidedStart.js rename to src/electron/frontend/core/components/pages/guided-mode/GuidedStart.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/ProgressCard.js b/src/electron/frontend/core/components/pages/guided-mode/ProgressCard.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/ProgressCard.js rename to src/electron/frontend/core/components/pages/guided-mode/ProgressCard.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedMetadata.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/data/GuidedMetadata.js rename to src/electron/frontend/core/components/pages/guided-mode/data/GuidedMetadata.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedPathExpansion.js similarity index 97% rename from src/electron/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js rename to src/electron/frontend/core/components/pages/guided-mode/data/GuidedPathExpansion.js index 4fa48857a..43b535812 100644 --- a/src/electron/renderer/src/stories/pages/guided-mode/data/GuidedPathExpansion.js +++ b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedPathExpansion.js @@ -9,7 +9,7 @@ import { onThrow } from "../../../../errors"; import pathExpansionSchema from "../../../../../../../schemas/json/path-expansion.schema.json" assert { type: "json" }; import { merge } from "../../utils"; import { List } from "../../../List"; -import { fs } from "../../../../electron/index.js"; +import { fs } from "../../../../../utils/electron.js"; import { Button } from "../../../Button.js"; import { Modal } from "../../../Modal"; import { header } from "../../../forms/utils"; diff --git a/src/electron/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedSourceData.js similarity index 97% rename from src/electron/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js rename to src/electron/frontend/core/components/pages/guided-mode/data/GuidedSourceData.js index f3876100a..9c99d8704 100644 --- a/src/electron/renderer/src/stories/pages/guided-mode/data/GuidedSourceData.js +++ b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedSourceData.js @@ -1,5 +1,7 @@ import Swal from "sweetalert2"; -import { isStorybook } from "../../../../dependencies/globals"; + +import { isStorybook } from "../../../../globals.js"; + import { JSONSchemaForm } from "../../../JSONSchemaForm.js"; import { InstanceManager } from "../../../InstanceManager.js"; import { ManagedPage } from "./ManagedPage.js"; diff --git a/src/electron/renderer/src/stories/pages/guided-mode/data/GuidedStructure.js b/src/electron/frontend/core/components/pages/guided-mode/data/GuidedStructure.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/data/GuidedStructure.js rename to src/electron/frontend/core/components/pages/guided-mode/data/GuidedStructure.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/data/ManagedPage.js b/src/electron/frontend/core/components/pages/guided-mode/data/ManagedPage.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/data/ManagedPage.js rename to src/electron/frontend/core/components/pages/guided-mode/data/ManagedPage.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/data/utils.js b/src/electron/frontend/core/components/pages/guided-mode/data/utils.js similarity index 96% rename from src/electron/renderer/src/stories/pages/guided-mode/data/utils.js rename to src/electron/frontend/core/components/pages/guided-mode/data/utils.js index f2c4fcf70..b5259e3bb 100644 --- a/src/electron/renderer/src/stories/pages/guided-mode/data/utils.js +++ b/src/electron/frontend/core/components/pages/guided-mode/data/utils.js @@ -1,5 +1,5 @@ import { getEditableItems } from "../../../JSONSchemaInput.js"; -import { merge } from "../../utils"; +import { merge } from "../../utils.js"; // Merge project-wide data into metadata export function populateWithProjectMetadata(info, globalState) { diff --git a/src/electron/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedInspectorPage.js similarity index 96% rename from src/electron/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js rename to src/electron/frontend/core/components/pages/guided-mode/options/GuidedInspectorPage.js index ae262f389..413092150 100644 --- a/src/electron/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js +++ b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedInspectorPage.js @@ -4,7 +4,7 @@ import { Page } from "../../Page.js"; import { unsafeSVG } from "lit/directives/unsafe-svg.js"; import folderOpenSVG from "../../../../../assets/icons/folder_open.svg?raw"; -import { electron } from "../../../../electron/index.js"; +import { electron } from "../../../../../utils/electron.js"; import { getSharedPath, removeFilePaths, truncateFilePaths } from "../../../preview/NWBFilePreview.js"; const { ipcRenderer } = electron; import { until } from "lit/directives/until.js"; diff --git a/src/electron/renderer/src/stories/pages/guided-mode/options/GuidedStubPreview.js b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedStubPreview.js similarity index 94% rename from src/electron/renderer/src/stories/pages/guided-mode/options/GuidedStubPreview.js rename to src/electron/frontend/core/components/pages/guided-mode/options/GuidedStubPreview.js index d1b022155..55979eaa5 100644 --- a/src/electron/renderer/src/stories/pages/guided-mode/options/GuidedStubPreview.js +++ b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedStubPreview.js @@ -4,7 +4,7 @@ import { Page } from "../../Page.js"; import { unsafeSVG } from "lit/directives/unsafe-svg.js"; import folderOpenSVG from "../../../../../assets/icons/folder_open.svg?raw"; -import { electron } from "../../../../electron/index.js"; +import { electron } from "../../../../../utils/electron.js"; import { NWBFilePreview, getSharedPath } from "../../../preview/NWBFilePreview.js"; const { ipcRenderer } = electron; diff --git a/src/electron/renderer/src/stories/pages/guided-mode/options/GuidedUpload.js b/src/electron/frontend/core/components/pages/guided-mode/options/GuidedUpload.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/options/GuidedUpload.js rename to src/electron/frontend/core/components/pages/guided-mode/options/GuidedUpload.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/options/utils.js b/src/electron/frontend/core/components/pages/guided-mode/options/utils.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/options/utils.js rename to src/electron/frontend/core/components/pages/guided-mode/options/utils.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/results/GuidedDandiResults.js b/src/electron/frontend/core/components/pages/guided-mode/results/GuidedDandiResults.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/results/GuidedDandiResults.js rename to src/electron/frontend/core/components/pages/guided-mode/results/GuidedDandiResults.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/results/GuidedResults.js b/src/electron/frontend/core/components/pages/guided-mode/results/GuidedResults.js similarity index 93% rename from src/electron/renderer/src/stories/pages/guided-mode/results/GuidedResults.js rename to src/electron/frontend/core/components/pages/guided-mode/results/GuidedResults.js index 1cc68fa86..dc1e5a333 100644 --- a/src/electron/renderer/src/stories/pages/guided-mode/results/GuidedResults.js +++ b/src/electron/frontend/core/components/pages/guided-mode/results/GuidedResults.js @@ -6,7 +6,7 @@ import { Page } from "../../Page.js"; import { getStubArray } from "../options/GuidedStubPreview.js"; import { getSharedPath } from "../../../preview/NWBFilePreview.js"; -import { electron, path } from "../../../../electron/index.js"; +import { electron, path } from "../../../../../utils/electron.js"; const { ipcRenderer } = electron; export class GuidedResultsPage extends Page { diff --git a/src/electron/renderer/src/stories/pages/guided-mode/setup/GuidedNewDatasetInfo.js b/src/electron/frontend/core/components/pages/guided-mode/setup/GuidedNewDatasetInfo.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/setup/GuidedNewDatasetInfo.js rename to src/electron/frontend/core/components/pages/guided-mode/setup/GuidedNewDatasetInfo.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js b/src/electron/frontend/core/components/pages/guided-mode/setup/GuidedSubjects.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js rename to src/electron/frontend/core/components/pages/guided-mode/setup/GuidedSubjects.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/setup/Preform.js b/src/electron/frontend/core/components/pages/guided-mode/setup/Preform.js similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/setup/Preform.js rename to src/electron/frontend/core/components/pages/guided-mode/setup/Preform.js diff --git a/src/electron/renderer/src/stories/pages/guided-mode/setup/utils.ts b/src/electron/frontend/core/components/pages/guided-mode/setup/utils.ts similarity index 100% rename from src/electron/renderer/src/stories/pages/guided-mode/setup/utils.ts rename to src/electron/frontend/core/components/pages/guided-mode/setup/utils.ts diff --git a/src/electron/renderer/src/stories/pages/inspect/InspectPage.js b/src/electron/frontend/core/components/pages/inspect/InspectPage.js similarity index 100% rename from src/electron/renderer/src/stories/pages/inspect/InspectPage.js rename to src/electron/frontend/core/components/pages/inspect/InspectPage.js diff --git a/src/electron/renderer/src/stories/pages/inspect/utils.js b/src/electron/frontend/core/components/pages/inspect/utils.js similarity index 100% rename from src/electron/renderer/src/stories/pages/inspect/utils.js rename to src/electron/frontend/core/components/pages/inspect/utils.js diff --git a/src/electron/renderer/src/stories/pages/preview/PreviewPage.js b/src/electron/frontend/core/components/pages/preview/PreviewPage.js similarity index 100% rename from src/electron/renderer/src/stories/pages/preview/PreviewPage.js rename to src/electron/frontend/core/components/pages/preview/PreviewPage.js diff --git a/src/electron/renderer/src/stories/pages/settings/SettingsPage.js b/src/electron/frontend/core/components/pages/settings/SettingsPage.js similarity index 96% rename from src/electron/renderer/src/stories/pages/settings/SettingsPage.js rename to src/electron/frontend/core/components/pages/settings/SettingsPage.js index e314a9a41..94bf07a33 100644 --- a/src/electron/renderer/src/stories/pages/settings/SettingsPage.js +++ b/src/electron/frontend/core/components/pages/settings/SettingsPage.js @@ -12,8 +12,10 @@ import { Button } from "../../Button.js"; import { global, remove, save } from "../../../progress/index.js"; import { merge, setUndefinedIfNotDeclared } from "../utils"; -import { homeDirectory, notyf, testDataFolderPath } from "../../../dependencies/globals"; -import { SERVER_FILE_PATH, electron, path, port, fs } from "../../../electron/index.js"; +import { notyf } from "../../../dependencies.js"; +import { homeDirectory, testDataFolderPath } from "../../../globals.js"; + +import { SERVER_FILE_PATH, electron, path, port, fs } from "../../../../utils/electron.js"; import saveSVG from "../../../../assets/icons/save.svg?raw"; import folderSVG from "../../../../assets/icons/folder_open.svg?raw"; diff --git a/src/electron/renderer/src/stories/pages/uploads/UploadsPage.js b/src/electron/frontend/core/components/pages/uploads/UploadsPage.js similarity index 100% rename from src/electron/renderer/src/stories/pages/uploads/UploadsPage.js rename to src/electron/frontend/core/components/pages/uploads/UploadsPage.js diff --git a/src/electron/renderer/src/stories/pages/uploads/utils.ts b/src/electron/frontend/core/components/pages/uploads/utils.ts similarity index 100% rename from src/electron/renderer/src/stories/pages/uploads/utils.ts rename to src/electron/frontend/core/components/pages/uploads/utils.ts diff --git a/src/electron/renderer/src/stories/pages/utils.js b/src/electron/frontend/core/components/pages/utils.js similarity index 100% rename from src/electron/renderer/src/stories/pages/utils.js rename to src/electron/frontend/core/components/pages/utils.js diff --git a/src/electron/renderer/src/stories/preview/NWBFilePreview.js b/src/electron/frontend/core/components/preview/NWBFilePreview.js similarity index 96% rename from src/electron/renderer/src/stories/preview/NWBFilePreview.js rename to src/electron/frontend/core/components/preview/NWBFilePreview.js index cd268a90e..c65f3323b 100644 --- a/src/electron/renderer/src/stories/preview/NWBFilePreview.js +++ b/src/electron/frontend/core/components/preview/NWBFilePreview.js @@ -5,7 +5,7 @@ import { unsafeHTML } from "lit/directives/unsafe-html.js"; import { run } from "../pages/guided-mode/options/utils"; import { until } from "lit/directives/until.js"; import { InstanceManager } from "../InstanceManager"; -import { path } from "../../electron"; +import { path } from "../../../utils/electron.js"; import { FullScreenToggle } from "../FullScreenToggle"; export function getSharedPath(array) { diff --git a/src/electron/renderer/src/stories/preview/Neurosift.js b/src/electron/frontend/core/components/preview/Neurosift.js similarity index 100% rename from src/electron/renderer/src/stories/preview/Neurosift.js rename to src/electron/frontend/core/components/preview/Neurosift.js diff --git a/src/electron/renderer/src/stories/preview/inspector/InspectorList.js b/src/electron/frontend/core/components/preview/inspector/InspectorList.js similarity index 100% rename from src/electron/renderer/src/stories/preview/inspector/InspectorList.js rename to src/electron/frontend/core/components/preview/inspector/InspectorList.js diff --git a/src/electron/renderer/src/stories/sidebar.js b/src/electron/frontend/core/components/sidebar.js similarity index 100% rename from src/electron/renderer/src/stories/sidebar.js rename to src/electron/frontend/core/components/sidebar.js diff --git a/src/electron/renderer/src/stories/status/StatusBar.ts b/src/electron/frontend/core/components/status/StatusBar.ts similarity index 100% rename from src/electron/renderer/src/stories/status/StatusBar.ts rename to src/electron/frontend/core/components/status/StatusBar.ts diff --git a/src/electron/renderer/src/stories/status/StatusIndicator.ts b/src/electron/frontend/core/components/status/StatusIndicator.ts similarity index 100% rename from src/electron/renderer/src/stories/status/StatusIndicator.ts rename to src/electron/frontend/core/components/status/StatusIndicator.ts diff --git a/src/electron/renderer/src/stories/table/Cell.ts b/src/electron/frontend/core/components/table/Cell.ts similarity index 100% rename from src/electron/renderer/src/stories/table/Cell.ts rename to src/electron/frontend/core/components/table/Cell.ts diff --git a/src/electron/renderer/src/stories/table/ContextMenu.ts b/src/electron/frontend/core/components/table/ContextMenu.ts similarity index 100% rename from src/electron/renderer/src/stories/table/ContextMenu.ts rename to src/electron/frontend/core/components/table/ContextMenu.ts diff --git a/src/electron/renderer/src/stories/table/cells/array.ts b/src/electron/frontend/core/components/table/cells/array.ts similarity index 100% rename from src/electron/renderer/src/stories/table/cells/array.ts rename to src/electron/frontend/core/components/table/cells/array.ts diff --git a/src/electron/renderer/src/stories/table/cells/base.ts b/src/electron/frontend/core/components/table/cells/base.ts similarity index 100% rename from src/electron/renderer/src/stories/table/cells/base.ts rename to src/electron/frontend/core/components/table/cells/base.ts diff --git a/src/electron/renderer/src/stories/table/cells/date-time.ts b/src/electron/frontend/core/components/table/cells/date-time.ts similarity index 100% rename from src/electron/renderer/src/stories/table/cells/date-time.ts rename to src/electron/frontend/core/components/table/cells/date-time.ts diff --git a/src/electron/renderer/src/stories/table/cells/dropdown.ts b/src/electron/frontend/core/components/table/cells/dropdown.ts similarity index 100% rename from src/electron/renderer/src/stories/table/cells/dropdown.ts rename to src/electron/frontend/core/components/table/cells/dropdown.ts diff --git a/src/electron/renderer/src/stories/table/cells/editors/base.ts b/src/electron/frontend/core/components/table/cells/editors/base.ts similarity index 100% rename from src/electron/renderer/src/stories/table/cells/editors/base.ts rename to src/electron/frontend/core/components/table/cells/editors/base.ts diff --git a/src/electron/renderer/src/stories/table/cells/input.ts b/src/electron/frontend/core/components/table/cells/input.ts similarity index 97% rename from src/electron/renderer/src/stories/table/cells/input.ts rename to src/electron/frontend/core/components/table/cells/input.ts index 5c090813a..17572ead1 100644 --- a/src/electron/renderer/src/stories/table/cells/input.ts +++ b/src/electron/frontend/core/components/table/cells/input.ts @@ -1,12 +1,12 @@ import { LitElement, css, html } from "lit"; import { TableCellBase } from "./base.js"; import { BaseRenderer } from "./renderers/base.js"; -import { Modal } from "../../Modal"; +import { Modal } from "../../Modal.js"; import { SimpleTable } from "../../SimpleTable.js"; import { JSONSchemaInput } from "../../JSONSchemaInput.js"; -import { header } from "../../forms/utils"; +import { header } from "../../forms/utils.js"; export class NestedEditor extends LitElement { diff --git a/src/electron/renderer/src/stories/table/cells/renderers/base.ts b/src/electron/frontend/core/components/table/cells/renderers/base.ts similarity index 100% rename from src/electron/renderer/src/stories/table/cells/renderers/base.ts rename to src/electron/frontend/core/components/table/cells/renderers/base.ts diff --git a/src/electron/renderer/src/stories/table/convert.ts b/src/electron/frontend/core/components/table/convert.ts similarity index 100% rename from src/electron/renderer/src/stories/table/convert.ts rename to src/electron/frontend/core/components/table/convert.ts diff --git a/src/electron/renderer/src/stories/table/utils.ts b/src/electron/frontend/core/components/table/utils.ts similarity index 100% rename from src/electron/renderer/src/stories/table/utils.ts rename to src/electron/frontend/core/components/table/utils.ts diff --git a/src/electron/renderer/src/stories/utils/progress.js b/src/electron/frontend/core/components/utils/progress.js similarity index 100% rename from src/electron/renderer/src/stories/utils/progress.js rename to src/electron/frontend/core/components/utils/progress.js diff --git a/src/electron/renderer/src/stories/utils/useGlobalStyles.js b/src/electron/frontend/core/components/utils/useGlobalStyles.js similarity index 100% rename from src/electron/renderer/src/stories/utils/useGlobalStyles.js rename to src/electron/frontend/core/components/utils/useGlobalStyles.js diff --git a/src/electron/renderer/src/dependencies/globals.js b/src/electron/frontend/core/dependencies.js similarity index 95% rename from src/electron/renderer/src/dependencies/globals.js rename to src/electron/frontend/core/dependencies.js index f7ec74427..810456d11 100644 --- a/src/electron/renderer/src/dependencies/globals.js +++ b/src/electron/frontend/core/dependencies.js @@ -2,8 +2,6 @@ import { Notyf } from "notyf"; import checkChromatic from "chromatic/isChromatic"; import lottie from "lottie-web"; -export * from "./simple.js"; - // ---------- Lottie Helper ---------- const isChromatic = checkChromatic(); diff --git a/src/electron/renderer/src/errors.ts b/src/electron/frontend/core/errors.ts similarity index 74% rename from src/electron/renderer/src/errors.ts rename to src/electron/frontend/core/errors.ts index 89f7ae17f..ba1794a91 100644 --- a/src/electron/renderer/src/errors.ts +++ b/src/electron/frontend/core/errors.ts @@ -1,4 +1,4 @@ -import { notify } from './dependencies/globals' +import { notify } from './dependencies' export const onThrow = (message: string, id?: string) => { return notify(id ? `<b>[${id}]</b>: ${message}` : message, "error", 7000); diff --git a/src/electron/renderer/src/dependencies/simple.js b/src/electron/frontend/core/globals.js similarity index 69% rename from src/electron/renderer/src/dependencies/simple.js rename to src/electron/frontend/core/globals.js index b9c86f59c..fa3fc0e26 100644 --- a/src/electron/renderer/src/dependencies/simple.js +++ b/src/electron/frontend/core/globals.js @@ -1,6 +1,15 @@ -import { app, crypto, isElectron } from "../electron/index.js"; -import paths from "../../../../paths.config.json" assert { type: "json" }; -import { joinPath } from "../globals"; +import { app, path, crypto, isElectron } from "../utils/electron.js"; + +import paths from "../../../paths.config.json" assert { type: "json" }; + +import supportedInterfaces from "../../../supported_interfaces.json" assert { type: "json" }; + +export const joinPath = (...args) => (path ? path.join(...args) : args.filter((str) => str).join("/")); + +export let runOnLoad = (fn) => { + if (document.readyState === "complete") fn(); + else window.addEventListener("load", fn); +}; export const reloadPageToHome = () => { if (isStorybook) return; @@ -29,3 +38,5 @@ export const ENCRYPTION_IV = crypto ? crypto.randomBytes(IV_LENGTH) : null; // Storybook export const isStorybook = window.location.href.includes("iframe.html"); + +export { supportedInterfaces }; diff --git a/src/electron/renderer/src/index.ts b/src/electron/frontend/core/index.ts similarity index 95% rename from src/electron/renderer/src/index.ts rename to src/electron/frontend/core/index.ts index b3493aa94..08415c3e1 100644 --- a/src/electron/renderer/src/index.ts +++ b/src/electron/frontend/core/index.ts @@ -1,18 +1,18 @@ import "./pages.js" -import { isElectron, electron } from './electron/index.js' +import { isElectron, electron } from '../utils/electron.js' const { ipcRenderer } = electron; -import { Dashboard } from './stories/Dashboard.js' +import { Dashboard } from './components/Dashboard.js' import { notyf, notify -} from './dependencies/globals' +} from './dependencies.js' import Swal from 'sweetalert2' import { loadServerEvents, pythonServerOpened } from "./server/index.js"; -import { statusBar } from "./server/globals"; +import { statusBar } from "./server/globals.js"; // Set the sidebar subtitle to the current app version const dashboard = document.querySelector('nwb-dashboard') as Dashboard diff --git a/src/electron/renderer/src/pages.js b/src/electron/frontend/core/pages.js similarity index 73% rename from src/electron/renderer/src/pages.js rename to src/electron/frontend/core/pages.js index 7dbd400e7..09e1b4c16 100644 --- a/src/electron/renderer/src/pages.js +++ b/src/electron/frontend/core/pages.js @@ -1,33 +1,32 @@ -import { GettingStartedPage } from "./stories/pages/getting-started/GettingStarted"; -import { DocumentationPage } from "./stories/pages/documentation/Documentation"; -import { ContactPage } from "./stories/pages/contact-us/Contact"; -import { GuidedHomePage } from "./stories/pages/guided-mode/GuidedHome"; -import { GuidedNewDatasetPage } from "./stories/pages/guided-mode/setup/GuidedNewDatasetInfo"; -import { GuidedStructurePage } from "./stories/pages/guided-mode/data/GuidedStructure"; -import { sections } from "./stories/pages/globals"; -import { GuidedSubjectsPage } from "./stories/pages/guided-mode/setup/GuidedSubjects"; -import { GuidedSourceDataPage } from "./stories/pages/guided-mode/data/GuidedSourceData"; -import { GuidedMetadataPage } from "./stories/pages/guided-mode/data/GuidedMetadata"; -import { GuidedUploadPage } from "./stories/pages/guided-mode/options/GuidedUpload"; -import { GuidedResultsPage } from "./stories/pages/guided-mode/results/GuidedResults"; -import { Dashboard } from "./stories/Dashboard"; -import { GuidedStubPreviewPage } from "./stories/pages/guided-mode/options/GuidedStubPreview"; -import { GuidedInspectorPage } from "./stories/pages/guided-mode/options/GuidedInspectorPage"; +import { DocumentationPage } from "./components/pages/documentation/Documentation"; +import { ContactPage } from "./components/pages/contact-us/Contact"; +import { GuidedHomePage } from "./components/pages/guided-mode/GuidedHome"; +import { GuidedNewDatasetPage } from "./components/pages/guided-mode/setup/GuidedNewDatasetInfo"; +import { GuidedStructurePage } from "./components/pages/guided-mode/data/GuidedStructure"; +import { sections } from "./components/pages/globals"; +import { GuidedSubjectsPage } from "./components/pages/guided-mode/setup/GuidedSubjects"; +import { GuidedSourceDataPage } from "./components/pages/guided-mode/data/GuidedSourceData"; +import { GuidedMetadataPage } from "./components/pages/guided-mode/data/GuidedMetadata"; +import { GuidedUploadPage } from "./components/pages/guided-mode/options/GuidedUpload"; +import { GuidedResultsPage } from "./components/pages/guided-mode/results/GuidedResults"; +import { Dashboard } from "./components/Dashboard"; +import { GuidedStubPreviewPage } from "./components/pages/guided-mode/options/GuidedStubPreview"; +import { GuidedInspectorPage } from "./components/pages/guided-mode/options/GuidedInspectorPage"; import logo from "../assets/img/logo-guide-draft-transparent-tight.png"; -import { GuidedPathExpansionPage } from "./stories/pages/guided-mode/data/GuidedPathExpansion"; +import { GuidedPathExpansionPage } from "./components/pages/guided-mode/data/GuidedPathExpansion"; import uploadIcon from "../assets/icons/dandi.svg?raw"; import inspectIcon from "../assets/icons/inspect.svg?raw"; import neurosiftIcon from "../assets/icons/neurosift-logo.svg?raw"; import settingsIcon from "../assets/icons/settings.svg?raw"; -import { UploadsPage } from "./stories/pages/uploads/UploadsPage"; -import { SettingsPage } from "./stories/pages/settings/SettingsPage"; -import { InspectPage } from "./stories/pages/inspect/InspectPage"; -import { PreviewPage } from "./stories/pages/preview/PreviewPage"; -import { GuidedPreform } from "./stories/pages/guided-mode/setup/Preform"; -import { GuidedDandiResultsPage } from "./stories/pages/guided-mode/results/GuidedDandiResults"; +import { UploadsPage } from "./components/pages/uploads/UploadsPage"; +import { SettingsPage } from "./components/pages/settings/SettingsPage"; +import { InspectPage } from "./components/pages/inspect/InspectPage"; +import { PreviewPage } from "./components/pages/preview/PreviewPage"; +import { GuidedPreform } from "./components/pages/guided-mode/setup/Preform"; +import { GuidedDandiResultsPage } from "./components/pages/guided-mode/results/GuidedDandiResults"; let dashboard = document.querySelector("nwb-dashboard"); if (!dashboard) dashboard = new Dashboard(); diff --git a/src/electron/renderer/src/progress/index.js b/src/electron/frontend/core/progress/index.js similarity index 95% rename from src/electron/renderer/src/progress/index.js rename to src/electron/frontend/core/progress/index.js index 3527f9da2..761ab8534 100644 --- a/src/electron/renderer/src/progress/index.js +++ b/src/electron/frontend/core/progress/index.js @@ -7,11 +7,11 @@ import { appDirectory, ENCRYPTION_KEY, ENCRYPTION_IV, -} from "../dependencies/simple.js"; -import { fs, crypto } from "../electron/index.js"; +} from "../globals.js"; +import { fs, crypto } from "../../utils/electron.js"; import { joinPath, runOnLoad } from "../globals"; -import { merge } from "../stories/pages/utils.js"; +import { merge } from "../components/pages/utils.js"; import { updateAppProgress, updateFile } from "./update.js"; import { updateURLParams } from "../../utils/url.js"; diff --git a/src/electron/renderer/src/progress/operations.js b/src/electron/frontend/core/progress/operations.js similarity index 88% rename from src/electron/renderer/src/progress/operations.js rename to src/electron/frontend/core/progress/operations.js index b4c4658b1..8d60e238e 100644 --- a/src/electron/renderer/src/progress/operations.js +++ b/src/electron/frontend/core/progress/operations.js @@ -1,6 +1,6 @@ import { joinPath } from "../globals"; -import { conversionSaveFolderPath, guidedProgressFilePath, previewSaveFolderPath } from "../dependencies/simple"; -import { fs } from "../electron"; +import { conversionSaveFolderPath, guidedProgressFilePath, previewSaveFolderPath } from "../globals"; +import { fs } from "../../utils/electron"; export const remove = (name) => { //Get the path of the progress file to delete diff --git a/src/electron/renderer/src/progress/update.js b/src/electron/frontend/core/progress/update.js similarity index 93% rename from src/electron/renderer/src/progress/update.js rename to src/electron/frontend/core/progress/update.js index 5a2258f9b..c621427b6 100644 --- a/src/electron/renderer/src/progress/update.js +++ b/src/electron/frontend/core/progress/update.js @@ -1,6 +1,6 @@ import { updateURLParams } from "../../utils/url.js"; -import { guidedProgressFilePath } from "../dependencies/simple.js"; -import { fs } from "../electron/index.js"; +import { guidedProgressFilePath } from "../globals.js"; +import { fs } from "../../utils/electron.js"; import { joinPath } from "../globals"; import { get, hasEntry } from "./index.js"; diff --git a/src/electron/renderer/src/promises.ts b/src/electron/frontend/core/promises.ts similarity index 100% rename from src/electron/renderer/src/promises.ts rename to src/electron/frontend/core/promises.ts diff --git a/src/electron/renderer/src/server/globals.ts b/src/electron/frontend/core/server/globals.ts similarity index 94% rename from src/electron/renderer/src/server/globals.ts rename to src/electron/frontend/core/server/globals.ts index 5ad456472..6f23ea2c7 100644 --- a/src/electron/renderer/src/server/globals.ts +++ b/src/electron/frontend/core/server/globals.ts @@ -1,4 +1,4 @@ -import { isElectron, app, port } from '../electron/index.js' +import { isElectron, app, port } from '../../utils/electron.js' import serverSVG from "../../assets/icons/server.svg?raw"; import webAssetSVG from "../../assets/icons/web_asset.svg?raw"; @@ -19,7 +19,7 @@ export const resolve = (object, callback) => { // ------------------------------------------------- -import { StatusBar } from "../stories/status/StatusBar.js"; +import { StatusBar } from "../components/status/StatusBar.js"; import { unsafeSVG } from "lit/directives/unsafe-svg.js"; const appVersion = app?.getVersion(); diff --git a/src/electron/renderer/src/server/index.ts b/src/electron/frontend/core/server/index.ts similarity index 94% rename from src/electron/renderer/src/server/index.ts rename to src/electron/frontend/core/server/index.ts index 62dba82f2..e8b69b229 100644 --- a/src/electron/renderer/src/server/index.ts +++ b/src/electron/frontend/core/server/index.ts @@ -1,13 +1,13 @@ -import { isElectron, electron, app, port } from '../electron/index.js' +import { isElectron, electron, app, port } from '../../utils/electron.js' const { ipcRenderer } = electron; import { notyf, -} from '../dependencies/globals' +} from '../dependencies.js' import Swal from 'sweetalert2' -import { activateServer, baseUrl, statusBar } from './globals'; +import { activateServer, baseUrl, statusBar } from './globals.js'; // Check if the Flask server is live const serverIsLiveStartup = async () => { diff --git a/src/electron/renderer/src/validation/dandi.ts b/src/electron/frontend/core/validation/dandi.ts similarity index 100% rename from src/electron/renderer/src/validation/dandi.ts rename to src/electron/frontend/core/validation/dandi.ts diff --git a/src/electron/renderer/src/validation/index.js b/src/electron/frontend/core/validation/index.js similarity index 100% rename from src/electron/renderer/src/validation/index.js rename to src/electron/frontend/core/validation/index.js diff --git a/src/electron/renderer/src/validation/validation.json b/src/electron/frontend/core/validation/validation.json similarity index 100% rename from src/electron/renderer/src/validation/validation.json rename to src/electron/frontend/core/validation/validation.json diff --git a/src/electron/renderer/src/validation/validation.ts b/src/electron/frontend/core/validation/validation.ts similarity index 99% rename from src/electron/renderer/src/validation/validation.ts rename to src/electron/frontend/core/validation/validation.ts index 9a6b8eb1a..961f9b5fc 100644 --- a/src/electron/renderer/src/validation/validation.ts +++ b/src/electron/frontend/core/validation/validation.ts @@ -1,5 +1,5 @@ import schema from './validation.json' -import { JSONSchemaForm, getSchema } from '../stories/JSONSchemaForm' +import { JSONSchemaForm, getSchema } from '../components/JSONSchemaForm' import Swal from 'sweetalert2' diff --git a/src/electron/renderer/index.html b/src/electron/frontend/index.html similarity index 97% rename from src/electron/renderer/index.html rename to src/electron/frontend/index.html index 1429dac62..a1d25a4ff 100755 --- a/src/electron/renderer/index.html +++ b/src/electron/frontend/index.html @@ -31,7 +31,7 @@ <body> <nwb-dashboard></nwb-dashboard> - <script type="module" src="./src/index"></script> + <script type="module" src="./core/index"></script> <script async src="https://w.appzi.io/w.js?token=hUmCm"></script> <script defer> diff --git a/src/electron/renderer/src/electron/index.js b/src/electron/frontend/utils/electron.js similarity index 88% rename from src/electron/renderer/src/electron/index.js rename to src/electron/frontend/utils/electron.js index 76d7e9062..7d85eb45f 100644 --- a/src/electron/renderer/src/electron/index.js +++ b/src/electron/frontend/utils/electron.js @@ -1,7 +1,7 @@ -import { updateURLParams } from "../../utils/url.js"; -import isElectron from "./check.js"; +import { updateURLParams } from "./url.js"; -export { isElectron }; +var userAgent = navigator.userAgent.toLowerCase(); +export const isElectron = userAgent.indexOf(" electron/") > -1; export let port = 4242; export let SERVER_FILE_PATH = ""; diff --git a/src/electron/renderer/utils/url.js b/src/electron/frontend/utils/url.js similarity index 100% rename from src/electron/renderer/utils/url.js rename to src/electron/frontend/utils/url.js diff --git a/src/electron/main/main.ts b/src/electron/main/main.ts index 615b41aab..511eb15ef 100755 --- a/src/electron/main/main.ts +++ b/src/electron/main/main.ts @@ -17,7 +17,7 @@ import fs from 'fs'; import './application-menu.js'; -import icon from '../renderer/assets/img/logo-guide-draft.png?asset' +import icon from '../frontend/assets/img/logo-guide-draft.png?asset' import splashHTML from './splash-screen.html?asset' import preloadUrl from '../preload/preload.js?asset' diff --git a/src/electron/main/splash-screen.html b/src/electron/main/splash-screen.html index b047be8b4..e2f16cbea 100644 --- a/src/electron/main/splash-screen.html +++ b/src/electron/main/splash-screen.html @@ -12,7 +12,7 @@ <div style="display: flex; flex-direction: column; justify-content: center; align-items: center;"> <p align="center"> <img - src="../../../src/electron/renderer/assets/img/logo-guide-draft.png" + src="../../../src/electron/frontend/assets/img/logo-guide-draft.png" width="250px" height="250px" /> diff --git a/src/electron/renderer/src/electron/check.js b/src/electron/renderer/src/electron/check.js deleted file mode 100644 index 92380a280..000000000 --- a/src/electron/renderer/src/electron/check.js +++ /dev/null @@ -1,3 +0,0 @@ -var userAgent = navigator.userAgent.toLowerCase(); -export const isElectron = userAgent.indexOf(" electron/") > -1; -export default isElectron; diff --git a/src/electron/renderer/src/globals.js b/src/electron/renderer/src/globals.js deleted file mode 100644 index 371ea6968..000000000 --- a/src/electron/renderer/src/globals.js +++ /dev/null @@ -1,12 +0,0 @@ -import { path } from "./electron/index.js"; - -import supportedInterfaces from "../../../supported_interfaces.json" assert { type: "json" }; - -export const joinPath = (...args) => (path ? path.join(...args) : args.filter((str) => str).join("/")); - -export let runOnLoad = (fn) => { - if (document.readyState === "complete") fn(); - else window.addEventListener("load", fn); -}; - -export { supportedInterfaces }; diff --git a/src/schemas/base-metadata.schema.ts b/src/schemas/base-metadata.schema.ts index 8e3ca7035..1a05c58c8 100644 --- a/src/schemas/base-metadata.schema.ts +++ b/src/schemas/base-metadata.schema.ts @@ -1,11 +1,11 @@ -import { serverGlobals, resolve } from '../electron/renderer/src/server/globals' +import { serverGlobals, resolve } from '../electron/frontend/core/server/globals' -import { header, replaceRefsWithValue } from '../electron/renderer/src/stories/forms/utils' +import { header, replaceRefsWithValue } from '../electron/frontend/core/components/forms/utils' import baseMetadataSchema from './json/base_metadata_schema.json' assert { type: "json" } -import { merge } from '../electron/renderer/src/stories/pages/utils' -import { drillSchemaProperties } from '../electron/renderer/src/stories/pages/guided-mode/data/utils' +import { merge } from '../electron/frontend/core/components/pages/utils' +import { drillSchemaProperties } from '../electron/frontend/core/components/pages/guided-mode/data/utils' const UV_MATH_FORMAT = `µV`; //`<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>µ</mo><mi>V</mi></math>` const UV_PROPERTIES = ["gain_to_uV", "offset_to_uV"] diff --git a/src/schemas/dandi-upload.schema.ts b/src/schemas/dandi-upload.schema.ts index fc251b467..d39a05234 100644 --- a/src/schemas/dandi-upload.schema.ts +++ b/src/schemas/dandi-upload.schema.ts @@ -1,10 +1,10 @@ import { Dandiset, getMine } from 'dandi' -import { global } from '../electron/renderer/src/progress' +import { global } from '../electron/frontend/core/progress' import upload from './json/dandi/upload.json' assert { type: "json" } -import { isStaging } from '../electron/renderer/src/stories/pages/uploads/utils' -import { baseUrl, onServerOpen } from '../electron/renderer/src/server/globals' -import { isStorybook } from '../electron/renderer/src/dependencies/simple' +import { isStaging } from '../electron/frontend/core/components/pages/uploads/utils' +import { baseUrl, onServerOpen } from '../electron/frontend/core/server/globals' +import { isStorybook } from '../electron/frontend/core/globals' const schema = structuredClone(upload) diff --git a/src/schemas/interfaces.info.ts b/src/schemas/interfaces.info.ts index 7ecc13cc7..0736cfbe6 100644 --- a/src/schemas/interfaces.info.ts +++ b/src/schemas/interfaces.info.ts @@ -1,5 +1,5 @@ -import { baseUrl, onServerOpen } from '../electron/renderer/src/server/globals' -import { isStorybook } from '../electron/renderer/src/dependencies/simple' +import { baseUrl, onServerOpen } from '../electron/frontend/core/server/globals' +import { isStorybook } from '../electron/frontend/core/globals' const values = { interfaces: {} } const setReady: any = {} diff --git a/stories/Pages.stories.js b/stories/Pages.stories.js index a697bbd9c..fd44b261b 100644 --- a/stories/Pages.stories.js +++ b/stories/Pages.stories.js @@ -1,4 +1,4 @@ -import { dashboard } from "../src/electron/renderer/src/pages.js"; +import { dashboard } from "../src/electron/frontend/core/pages.js"; // const options = Object.keys(dashboard.pagesById) diff --git a/stories/components/Accordion.stories.js b/stories/components/Accordion.stories.js index f6b1d2599..1a12b3553 100644 --- a/stories/components/Accordion.stories.js +++ b/stories/components/Accordion.stories.js @@ -1,4 +1,4 @@ -import { Accordion } from "../../src/electron/renderer/src/stories/Accordion"; +import { Accordion } from "../../src/electron/frontend/core/components/Accordion"; export default { title: "Components/Accordion", diff --git a/stories/components/Button.stories.js b/stories/components/Button.stories.js index 9e91838d2..d12285fd2 100644 --- a/stories/components/Button.stories.js +++ b/stories/components/Button.stories.js @@ -1,4 +1,4 @@ -import { Button } from "../../src/electron/renderer/src/stories/Button"; +import { Button } from "../../src/electron/frontend/core/components/Button"; // More on how to set up stories at: https://storybook.js.org/docs/7.0/web-components/writing-stories/introduction export default { diff --git a/stories/components/FileSystemSelector.stories.js b/stories/components/FileSystemSelector.stories.js index eac8a8998..7ab7c0b38 100644 --- a/stories/components/FileSystemSelector.stories.js +++ b/stories/components/FileSystemSelector.stories.js @@ -1,4 +1,4 @@ -import { FilesystemSelector } from "../../src/electron/renderer/src/stories/FileSystemSelector"; +import { FilesystemSelector } from "../../src/electron/frontend/core/components/FileSystemSelector"; export default { title: "Components/Filesystem Selector", diff --git a/stories/components/InspectorList.stories.js b/stories/components/InspectorList.stories.js index 8f34aa767..a26ab0286 100644 --- a/stories/components/InspectorList.stories.js +++ b/stories/components/InspectorList.stories.js @@ -1,4 +1,4 @@ -import { InspectorList } from "../../src/electron/renderer/src/stories/preview/inspector/InspectorList"; +import { InspectorList } from "../../src/electron/frontend/core/components/preview/inspector/InspectorList"; import testInspectorList from "../inputs/inspector_output.json"; export default { diff --git a/stories/components/InstanceManager.stories.js b/stories/components/InstanceManager.stories.js index 867fd1e1c..b3f34bbd9 100644 --- a/stories/components/InstanceManager.stories.js +++ b/stories/components/InstanceManager.stories.js @@ -1,5 +1,5 @@ -import { InstanceManager } from "../../src/electron/renderer/src/stories/InstanceManager"; -import { Modal } from "../../src/electron/renderer/src/stories/Modal"; +import { InstanceManager } from "../../src/electron/frontend/core/components/InstanceManager"; +import { Modal } from "../../src/electron/frontend/core/components/Modal"; // More on how to set up stories at: https://storybook.js.org/docs/7.0/web-components/writing-stories/introduction export default { diff --git a/stories/components/JSONSchemaForm.stories.js b/stories/components/JSONSchemaForm.stories.js index aa2932444..ce2922535 100644 --- a/stories/components/JSONSchemaForm.stories.js +++ b/stories/components/JSONSchemaForm.stories.js @@ -1,4 +1,4 @@ -import { JSONSchemaForm } from "../../src/electron/renderer/src/stories/JSONSchemaForm"; +import { JSONSchemaForm } from "../../src/electron/frontend/core/components/JSONSchemaForm"; export default { title: "Components/JSON Schema Form", diff --git a/stories/components/List.stories.js b/stories/components/List.stories.js index 29338cb4d..3b4139320 100644 --- a/stories/components/List.stories.js +++ b/stories/components/List.stories.js @@ -1,4 +1,4 @@ -import { List } from "../../src/electron/renderer/src/stories/List"; +import { List } from "../../src/electron/frontend/core/components/List"; export default { title: "Components/List", diff --git a/stories/components/Multiselect.stories.js b/stories/components/Multiselect.stories.js index c40ab2d2f..211e2d8a6 100644 --- a/stories/components/Multiselect.stories.js +++ b/stories/components/Multiselect.stories.js @@ -1,4 +1,4 @@ -import { MultiSelectForm } from "../../src/electron/renderer/src/stories/multiselect/MultiSelectForm.js"; +import { MultiSelectForm } from "../../src/electron/frontend/core/components/multiselect/MultiSelectForm.js"; export default { title: "Components/Multiselect Form", diff --git a/stories/components/OptionalSection.stories.js b/stories/components/OptionalSection.stories.js index b4c3c24eb..281198fa8 100644 --- a/stories/components/OptionalSection.stories.js +++ b/stories/components/OptionalSection.stories.js @@ -1,4 +1,4 @@ -import { OptionalSection } from "../../src/electron/renderer/src/stories/OptionalSection"; +import { OptionalSection } from "../../src/electron/frontend/core/components/OptionalSection"; export default { title: "Components/Optional Section", diff --git a/stories/components/ProgressBar.stories.js b/stories/components/ProgressBar.stories.js index c8acf7ea3..cdb18b64c 100644 --- a/stories/components/ProgressBar.stories.js +++ b/stories/components/ProgressBar.stories.js @@ -1,4 +1,4 @@ -import { ProgressBar } from "../../src/electron/renderer/src/stories/ProgressBar"; +import { ProgressBar } from "../../src/electron/frontend/core/components/ProgressBar"; export default { title: "Components/Progress Bar", diff --git a/stories/components/Search.stories.js b/stories/components/Search.stories.js index ff6ad16a4..24a315bb4 100644 --- a/stories/components/Search.stories.js +++ b/stories/components/Search.stories.js @@ -1,4 +1,4 @@ -import { Search } from "../../src/electron/renderer/src/stories/Search"; +import { Search } from "../../src/electron/frontend/core/components/Search"; // More on how to set up stories at: https://storybook.js.org/docs/7.0/web-components/writing-stories/introduction export default { diff --git a/stories/components/StatusBar.stories.js b/stories/components/StatusBar.stories.js index 6666cca4a..a3c9bd555 100644 --- a/stories/components/StatusBar.stories.js +++ b/stories/components/StatusBar.stories.js @@ -1,8 +1,8 @@ -import { StatusBar } from "../../src/electron/renderer/src/stories/status/StatusBar"; +import { StatusBar } from "../../src/electron/frontend/core/components/status/StatusBar"; import { unsafeSVG } from "lit/directives/unsafe-svg.js"; -import pythonSVG from "../../src/electron/renderer/assets/icons/python.svg?raw"; -import webAssetSVG from "../../src/electron/renderer/assets/icons/web_asset.svg?raw"; -import wifiSVG from "../../src/electron/renderer/assets/icons/wifi.svg?raw"; +import pythonSVG from "../../src/electron/frontend/assets/icons/python.svg?raw"; +import webAssetSVG from "../../src/electron/frontend/assets/icons/web_asset.svg?raw"; +import wifiSVG from "../../src/electron/frontend/assets/icons/wifi.svg?raw"; export default { title: "Components/Status Bar", diff --git a/stories/components/Table.stories.js b/stories/components/Table.stories.js index 4d9cb88c0..29d7706f4 100644 --- a/stories/components/Table.stories.js +++ b/stories/components/Table.stories.js @@ -1,8 +1,8 @@ -import { Table } from "../../src/electron/renderer/src/stories/Table.js"; +import { Table } from "../../src/electron/frontend/core/components/Table.js"; import getSubjectSchema from "../../src/schemas/subject.schema"; -import { SimpleTable } from "../../src/electron/renderer/src/stories/SimpleTable.js"; -import { BasicTable } from "../../src/electron/renderer/src/stories/BasicTable.js"; +import { SimpleTable } from "../../src/electron/frontend/core/components/SimpleTable.js"; +import { BasicTable } from "../../src/electron/frontend/core/components/BasicTable.js"; export default { title: "Components/Table", diff --git a/stories/pages/storyStates.ts b/stories/pages/storyStates.ts index 8e518cfdf..d25ef602f 100644 --- a/stories/pages/storyStates.ts +++ b/stories/pages/storyStates.ts @@ -1,8 +1,8 @@ import nwbBaseSchema from "../../src/schemas/base-metadata.schema.js"; // import exephysExampleSchema from "../../../../../../schemas/json/ecephys_metadata_schema_example.json"; -import { dashboard } from "../../src/electron/renderer/src/pages.js"; -import { activateServer } from "../../src/electron/renderer/src/server/globals.js"; +import { dashboard } from "../../src/electron/frontend/core/pages.js"; +import { activateServer } from "../../src/electron/frontend/core/server/globals.js"; activateServer(); diff --git a/tests/e2e/pipelines.test.ts b/tests/e2e/pipelines.test.ts index 04f0e875a..d49437d83 100644 --- a/tests/e2e/pipelines.test.ts +++ b/tests/e2e/pipelines.test.ts @@ -15,7 +15,7 @@ import examplePipelines from "../../src/example_pipelines.yml"; import paths from "../../src/paths.config.json" assert { type: "json" }; import { evaluate, initTests } from './utils' -import { header } from '../../src/electron/renderer/src/stories/forms/utils' +import { header } from '../../src/electron/frontend/core/components/forms/utils' // NOTE: We assume the user has put the GIN data in ~/NWB_GUIDE/test-data const guideRootPath = join(homedir(), paths.root) diff --git a/tests/metadata.test.ts b/tests/metadata.test.ts index f35a46efa..0bb326f31 100644 --- a/tests/metadata.test.ts +++ b/tests/metadata.test.ts @@ -1,19 +1,19 @@ import { describe, expect, test } from 'vitest' -import { createResults } from '../src/electron/renderer/src/stories/pages/guided-mode/data/utils' -import { mapSessions } from '../src/electron/renderer/src/stories/pages/utils' +import { createResults } from '../src/electron/frontend/core/components/pages/guided-mode/data/utils' +import { mapSessions } from '../src/electron/frontend/core/components/pages/utils' import baseMetadataSchema from '../src/schemas/base-metadata.schema' import { createMockGlobalState } from './utils' import { Validator } from 'jsonschema' -import { tempPropertyKey, textToArray } from '../src/electron/renderer/src/stories/forms/utils' -import { updateResultsFromSubjects } from '../src/electron/renderer/src/stories/pages/guided-mode/setup/utils' -import { JSONSchemaForm } from '../src/electron/renderer/src/stories/JSONSchemaForm' +import { tempPropertyKey, textToArray } from '../src/electron/frontend/core/components/forms/utils' +import { updateResultsFromSubjects } from '../src/electron/frontend/core/components/pages/guided-mode/setup/utils' +import { JSONSchemaForm } from '../src/electron/frontend/core/components/JSONSchemaForm' -import { validateOnChange } from "../src/electron/renderer/src/validation/index.js"; -import { SimpleTable } from '../src/electron/renderer/src/stories/SimpleTable' -import { JSONSchemaInput } from '../src/electron/renderer/src/stories/JSONSchemaInput.js' +import { validateOnChange } from "../src/electron/frontend/core/validation/index.js"; +import { SimpleTable } from '../src/electron/frontend/core/components/SimpleTable' +import { JSONSchemaInput } from '../src/electron/frontend/core/components/JSONSchemaInput.js' function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); diff --git a/tests/progress.test.ts b/tests/progress.test.ts index 009794280..b6ccffc29 100644 --- a/tests/progress.test.ts +++ b/tests/progress.test.ts @@ -1,7 +1,7 @@ import { expect, test } from 'vitest' -import { updateAppProgress, updateFile, rename } from '../src/electron/renderer/src/progress/update' -import { get } from '../src/electron/renderer/src/progress' -import { remove } from '../src/electron/renderer/src/progress/operations' +import { updateAppProgress, updateFile, rename } from '../src/electron/frontend/core/progress/update' +import { get } from '../src/electron/frontend/core/progress' +import { remove } from '../src/electron/frontend/core/progress/operations' test('updates to app progress do not fail', () => updateAppProgress('/', {}))