diff --git a/GNUmakefile b/GNUmakefile index a11a82c39..6e4e04a5e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -46,7 +46,7 @@ bin/probod: pkg/server/api/console/v1/schema/schema.go pkg/server/api/console/v1 .PHONY: @probo/console @probo/console: NODE_ENV=production @probo/console: - $(NPM) --workspace $@ run typecheck + $(NPM) --workspace $@ run check $(NPM) --workspace $@ run build pkg/server/api/console/v1/schema/schema.go \ @@ -60,7 +60,7 @@ help: ## Show this help .PHONY:dev dev: ## Start the development server - parallel -j 2 --line-buffer ::: "gow -r=false run cmd/probod/main.go" "cd apps/console2 && npm run dev" + parallel -j 2 --line-buffer ::: "gow -r=false run cmd/probod/main.go" "cd apps/console && npm run dev" .PHONY: fmt fmt: fmt-go ## Format Go code @@ -90,4 +90,3 @@ stack-ps: ## List the docker stack containers .PHONY: psql psql: ## Open a psql shell to the postgres container $(DOCKER_COMPOSE) exec postgres psql -U probod -d probod - diff --git a/apps/console2/.env b/apps/console/.env similarity index 100% rename from apps/console2/.env rename to apps/console/.env diff --git a/apps/console/.env.development b/apps/console/.env.development deleted file mode 100644 index f5617f6a3..000000000 --- a/apps/console/.env.development +++ /dev/null @@ -1,8 +0,0 @@ -LIVE_RELOAD=true - -POSTHOG_HOST= -POSTHOG_KEY= -FARO_PUSH_URL= - -API_SERVER_HOST="http://localhost:8080" - diff --git a/apps/console/.env.example b/apps/console/.env.example deleted file mode 100644 index 3a3c144b0..000000000 --- a/apps/console/.env.example +++ /dev/null @@ -1,7 +0,0 @@ -LIVE_RELOAD= - -POSTHOG_HOST= -POSTHOG_KEY= -FARO_PUSH_URL= - -HTTP_ENDPOINT="http://example.com" diff --git a/apps/console/.env.production b/apps/console/.env.production deleted file mode 100644 index 215594768..000000000 --- a/apps/console/.env.production +++ /dev/null @@ -1,6 +0,0 @@ -POSTHOG_HOST= -POSTHOG_KEY= -FARO_PUSH_URL= - -API_SERVER_HOST= - diff --git a/apps/console/.gitignore b/apps/console/.gitignore index 109052e40..0e4727357 100644 --- a/apps/console/.gitignore +++ b/apps/console/.gitignore @@ -1,2 +1,25 @@ -!dist/.keep -dist/ \ No newline at end of file +# Logs +old +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/apps/console2/README.md b/apps/console/README.md similarity index 100% rename from apps/console2/README.md rename to apps/console/README.md diff --git a/apps/console/components.json b/apps/console/components.json deleted file mode 100644 index 0222518a0..000000000 --- a/apps/console/components.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "tailwind.config.ts", - "css": "src/App.css", - "baseColor": "zinc", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils", - "ui": "@/components/ui", - "lib": "@/lib", - "hooks": "@/hooks" - }, - "iconLibrary": "lucide" -} diff --git a/apps/console/eslint.config.js b/apps/console/eslint.config.js index 131ea07a1..092408a9f 100644 --- a/apps/console/eslint.config.js +++ b/apps/console/eslint.config.js @@ -1,32 +1,28 @@ -import globals from "globals"; -import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; -import pluginReact from "eslint-plugin-react"; +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import tseslint from 'typescript-eslint' -/** @type {import('eslint').Linter.Config[]} */ -export default [ - { files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] }, +export default tseslint.config( + { ignores: ['dist'] }, { + extends: [js.configs.recommended, ...tseslint.configs.recommended], + files: ['**/*.{ts,tsx}'], languageOptions: { + ecmaVersion: 2020, globals: globals.browser, - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - }, }, - }, - pluginJs.configs.recommended, - ...tseslint.configs.recommended, - pluginReact.configs.flat.recommended, - { - settings: { - react: { - version: "detect", - }, + plugins: { + 'react-hooks': reactHooks, + 'react-refresh': reactRefresh, }, rules: { - "react/react-in-jsx-scope": "off", + ...reactHooks.configs.recommended.rules, + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], }, }, -]; +) diff --git a/apps/console/index.html b/apps/console/index.html index e591b5868..9d2709dad 100644 --- a/apps/console/index.html +++ b/apps/console/index.html @@ -1,47 +1,37 @@ - + - - - - Probo - Console - - - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + Probo Console + + + +
+ + - - - - - -
- - diff --git a/apps/console/package.json b/apps/console/package.json index e50147923..51d8268f7 100644 --- a/apps/console/package.json +++ b/apps/console/package.json @@ -1,93 +1,61 @@ { "name": "@probo/console", - "version": "0.0.1", + "private": true, + "version": "0.0.0", "type": "module", "scripts": { - "dev": "npx node --env-file .env.development scripts/esbuild.mjs watch", - "build": "npx node --env-file .env.production scripts/esbuild.mjs", - "relay": "npx relay-compiler --output quiet-with-errors", - "relay:watch": "npx relay-compiler --output quiet-with-errors --watch", - "lint": "eslint src --ext .ts,.tsx", - "typecheck": "npx tsc --noEmit" + "dev": "vite", + "relay": "find src -type d -name \"__generated__\" -exec rm -rf {} + && npx relay-compiler ./relay.config.json", + "build": "tsc -b && vite build", + "lint": "eslint .", + "check": "tsc --noEmit -p tsconfig.app.json", + "preview": "vite preview" }, "dependencies": { + "@hookform/resolvers": "^5.0.1", + "@probo/helpers": "1.0.0", + "@probo/hooks": "1.0.0", + "@probo/i18n": "1.0.0", "@probo/react-lazy": "1.0.0", - "@probo/vendors": "^0.0.1", - "@radix-ui/colors": "^3.0.0", - "@radix-ui/react-avatar": "^1.1.3", - "@radix-ui/react-checkbox": "^1.0.4", - "@radix-ui/react-collapsible": "^1.1.3", - "@radix-ui/react-dialog": "^1.1.6", - "@radix-ui/react-dropdown-menu": "^2.1.6", - "@radix-ui/react-label": "^2.0.2", - "@radix-ui/react-popover": "^1.1.6", - "@radix-ui/react-progress": "^1.1.2", - "@radix-ui/react-radio-group": "^1.1.3", - "@radix-ui/react-select": "^2.0.0", - "@radix-ui/react-separator": "^1.1.2", - "@radix-ui/react-slot": "^1.1.2", - "@radix-ui/react-switch": "^1.1.4", - "@radix-ui/react-tabs": "^1.1.3", - "@radix-ui/react-toast": "^1.2.6", - "@radix-ui/react-tooltip": "^1.1.8", - "@tailwindcss/typography": "^0.5.16", - "class-variance-authority": "^0.7.1", + "@probo/ui": "1.0.0", + "@probo/vendors": "0.0.1", + "@radix-ui/react-dialog": "^1.1.14", + "@radix-ui/react-label": "^2.1.7", + "@radix-ui/react-select": "^2.2.5", + "@tanstack/react-query": "^5.76.1", "clsx": "^2.1.1", - "cmdk": "^1.0.4", - "date-fns": "^4.1.0", - "fuse.js": "^7.1.0", - "lucide-react": "^0.475.0", - "posthog-js": "^1.215.1", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-helmet-async": "^2.0.5", - "react-markdown": "^10.1.0", - "react-relay": "^18.2.0", - "react-router": "^7.1.5", - "rehype-raw": "^7.0.0", - "relay-runtime": "^18.2.0", - "remark-gfm": "^4.0.1", - "tailwind-merge": "^3.0.2", - "tailwindcss-animate": "^1.0.7" + "minisearch": "^7.1.2", + "react": "^19.1.0", + "react-dom": "^19.1.0", + "react-error-boundary": "^6.0.0", + "react-hook-form": "^7.56.4", + "react-relay": "^19.0.0", + "react-router": "^7.6.0", + "relay-runtime": "^19.0.0", + "use-debounce": "^10.0.5", + "usehooks-ts": "^3.1.1", + "zod": "^3.25.17" }, "devDependencies": { - "@babel/core": "^7.26.7", - "@babel/preset-env": "^7.26.7", - "@babel/preset-typescript": "^7.26.0", - "@eslint/js": "^9.21.0", - "@probo/esbuild-plugin-postcss": "^0.0.1", - "@probo/tsconfig": "^0.0.1", - "@tailwindcss/postcss": "^4.0.9", - "@types/babel-core": "^6.25.10", - "@types/node": "^22.13.0", - "@types/react": "^18.3.18", - "@types/react-dom": "^18.3.5", - "@types/react-relay": "^18.2.0", - "@types/relay-runtime": "^18.2.5", - "autoprefixer": "^10.4.20", - "babel-plugin-relay": "^18.2.0", - "esbuild": "^0.25.0", - "eslint": "^9.21.0", - "eslint-plugin-react": "^7.37.4", + "@eslint/js": "^9.25.0", + "@tailwindcss/vite": "^4.1.7", + "@types/node": "^22.15.21", + "@types/react": "^19.1.2", + "@types/react-dom": "^19.1.2", + "@types/react-relay": "^18.2.1", + "@types/relay-runtime": "^19.0.1", + "@vitejs/plugin-react": "^4.4.1", + "babel-plugin-relay": "^19.0.0", + "eslint": "^9.25.0", + "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-react-refresh": "^0.4.19", "globals": "^16.0.0", - "relay-compiler": "^18.2.0", - "tailwindcss": "^4.0.9", - "typescript": "^5.8.3", - "typescript-eslint": "^8.25.0" - }, - "relay": { - "src": "src", - "language": "typescript", - "schema": "../../pkg/server/api/console/v1/schema.graphql", - "noFutureProofEnums": true, - "customScalarTypes": { - "Datetime": "string", - "CursorKey": "string" - }, - "excludes": [ - "**/node_modules/**", - "**/__mocks__/**", - "**/__generated__/**" - ] + "graphql": "^16.11.0", + "prettier": "^3.5.3", + "relay-compiler": "^19.0.0", + "tailwindcss": "^4.1.7", + "typescript": "~5.8.3", + "typescript-eslint": "^8.30.1", + "vite": "^6.3.5" } } diff --git a/apps/console/public/assets/android-chrome-192x192.png b/apps/console/public/assets/android-chrome-192x192.png deleted file mode 100644 index 6f1ced291..000000000 Binary files a/apps/console/public/assets/android-chrome-192x192.png and /dev/null differ diff --git a/apps/console/public/assets/android-chrome-512x512.png b/apps/console/public/assets/android-chrome-512x512.png deleted file mode 100644 index 420456241..000000000 Binary files a/apps/console/public/assets/android-chrome-512x512.png and /dev/null differ diff --git a/apps/console/public/assets/apple-touch-icon.png b/apps/console/public/assets/apple-touch-icon.png deleted file mode 100644 index 710ed96f0..000000000 Binary files a/apps/console/public/assets/apple-touch-icon.png and /dev/null differ diff --git a/apps/console/public/assets/cross-icon.svg b/apps/console/public/assets/cross-icon.svg deleted file mode 100644 index 6b6a8bb6e..000000000 --- a/apps/console/public/assets/cross-icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/apps/console/public/assets/favicon-16x16.png b/apps/console/public/assets/favicon-16x16.png deleted file mode 100644 index 3ae0a9835..000000000 Binary files a/apps/console/public/assets/favicon-16x16.png and /dev/null differ diff --git a/apps/console/public/assets/favicon-32x32.png b/apps/console/public/assets/favicon-32x32.png deleted file mode 100644 index 7a80f7481..000000000 Binary files a/apps/console/public/assets/favicon-32x32.png and /dev/null differ diff --git a/apps/console/public/assets/favicon-dark.svg b/apps/console/public/assets/favicon-dark.svg deleted file mode 100644 index c81aad138..000000000 --- a/apps/console/public/assets/favicon-dark.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/apps/console/public/assets/favicon.ico b/apps/console/public/assets/favicon.ico deleted file mode 100644 index aba5652f3..000000000 Binary files a/apps/console/public/assets/favicon.ico and /dev/null differ diff --git a/apps/console/public/assets/favicon.svg b/apps/console/public/assets/favicon.svg deleted file mode 100644 index c81aad138..000000000 --- a/apps/console/public/assets/favicon.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/apps/console2/public/document.png b/apps/console/public/document.png similarity index 100% rename from apps/console2/public/document.png rename to apps/console/public/document.png diff --git a/apps/console2/public/favicons/apple-touch-icon-114x114.png b/apps/console/public/favicons/apple-touch-icon-114x114.png similarity index 100% rename from apps/console2/public/favicons/apple-touch-icon-114x114.png rename to apps/console/public/favicons/apple-touch-icon-114x114.png diff --git a/apps/console2/public/favicons/apple-touch-icon-120x120.png b/apps/console/public/favicons/apple-touch-icon-120x120.png similarity index 100% rename from apps/console2/public/favicons/apple-touch-icon-120x120.png rename to apps/console/public/favicons/apple-touch-icon-120x120.png diff --git a/apps/console2/public/favicons/apple-touch-icon-144x144.png b/apps/console/public/favicons/apple-touch-icon-144x144.png similarity index 100% rename from apps/console2/public/favicons/apple-touch-icon-144x144.png rename to apps/console/public/favicons/apple-touch-icon-144x144.png diff --git a/apps/console2/public/favicons/apple-touch-icon-152x152.png b/apps/console/public/favicons/apple-touch-icon-152x152.png similarity index 100% rename from apps/console2/public/favicons/apple-touch-icon-152x152.png rename to apps/console/public/favicons/apple-touch-icon-152x152.png diff --git a/apps/console2/public/favicons/apple-touch-icon-57x57.png b/apps/console/public/favicons/apple-touch-icon-57x57.png similarity index 100% rename from apps/console2/public/favicons/apple-touch-icon-57x57.png rename to apps/console/public/favicons/apple-touch-icon-57x57.png diff --git a/apps/console2/public/favicons/apple-touch-icon-60x60.png b/apps/console/public/favicons/apple-touch-icon-60x60.png similarity index 100% rename from apps/console2/public/favicons/apple-touch-icon-60x60.png rename to apps/console/public/favicons/apple-touch-icon-60x60.png diff --git a/apps/console2/public/favicons/apple-touch-icon-72x72.png b/apps/console/public/favicons/apple-touch-icon-72x72.png similarity index 100% rename from apps/console2/public/favicons/apple-touch-icon-72x72.png rename to apps/console/public/favicons/apple-touch-icon-72x72.png diff --git a/apps/console2/public/favicons/apple-touch-icon-76x76.png b/apps/console/public/favicons/apple-touch-icon-76x76.png similarity index 100% rename from apps/console2/public/favicons/apple-touch-icon-76x76.png rename to apps/console/public/favicons/apple-touch-icon-76x76.png diff --git a/apps/console2/public/favicons/favicon-128.png b/apps/console/public/favicons/favicon-128.png similarity index 100% rename from apps/console2/public/favicons/favicon-128.png rename to apps/console/public/favicons/favicon-128.png diff --git a/apps/console2/public/favicons/favicon-16x16.png b/apps/console/public/favicons/favicon-16x16.png similarity index 100% rename from apps/console2/public/favicons/favicon-16x16.png rename to apps/console/public/favicons/favicon-16x16.png diff --git a/apps/console2/public/favicons/favicon-196x196.png b/apps/console/public/favicons/favicon-196x196.png similarity index 100% rename from apps/console2/public/favicons/favicon-196x196.png rename to apps/console/public/favicons/favicon-196x196.png diff --git a/apps/console2/public/favicons/favicon-32x32.png b/apps/console/public/favicons/favicon-32x32.png similarity index 100% rename from apps/console2/public/favicons/favicon-32x32.png rename to apps/console/public/favicons/favicon-32x32.png diff --git a/apps/console2/public/favicons/favicon-96x96.png b/apps/console/public/favicons/favicon-96x96.png similarity index 100% rename from apps/console2/public/favicons/favicon-96x96.png rename to apps/console/public/favicons/favicon-96x96.png diff --git a/apps/console2/public/favicons/favicon.ico b/apps/console/public/favicons/favicon.ico similarity index 100% rename from apps/console2/public/favicons/favicon.ico rename to apps/console/public/favicons/favicon.ico diff --git a/apps/console2/public/favicons/mstile-144x144.png b/apps/console/public/favicons/mstile-144x144.png similarity index 100% rename from apps/console2/public/favicons/mstile-144x144.png rename to apps/console/public/favicons/mstile-144x144.png diff --git a/apps/console2/public/favicons/mstile-150x150.png b/apps/console/public/favicons/mstile-150x150.png similarity index 100% rename from apps/console2/public/favicons/mstile-150x150.png rename to apps/console/public/favicons/mstile-150x150.png diff --git a/apps/console2/public/favicons/mstile-310x150.png b/apps/console/public/favicons/mstile-310x150.png similarity index 100% rename from apps/console2/public/favicons/mstile-310x150.png rename to apps/console/public/favicons/mstile-310x150.png diff --git a/apps/console2/public/favicons/mstile-310x310.png b/apps/console/public/favicons/mstile-310x310.png similarity index 100% rename from apps/console2/public/favicons/mstile-310x310.png rename to apps/console/public/favicons/mstile-310x310.png diff --git a/apps/console2/public/favicons/mstile-70x70.png b/apps/console/public/favicons/mstile-70x70.png similarity index 100% rename from apps/console2/public/favicons/mstile-70x70.png rename to apps/console/public/favicons/mstile-70x70.png diff --git a/apps/console2/public/github.png b/apps/console/public/github.png similarity index 100% rename from apps/console2/public/github.png rename to apps/console/public/github.png diff --git a/apps/console/public/icons/arrow-inbox.svg b/apps/console/public/icons/arrow-inbox.svg deleted file mode 100644 index d65d6d200..000000000 --- a/apps/console/public/icons/arrow-inbox.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/apps/console/public/icons/clock.svg b/apps/console/public/icons/clock.svg deleted file mode 100644 index 4d4200ddd..000000000 --- a/apps/console/public/icons/clock.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/apps/console/public/icons/dot-grid-1x3-horizontal.svg b/apps/console/public/icons/dot-grid-1x3-horizontal.svg deleted file mode 100644 index 8e9422bec..000000000 --- a/apps/console/public/icons/dot-grid-1x3-horizontal.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/console/public/images/dot-grid-1x3-horizontal.svg b/apps/console/public/images/dot-grid-1x3-horizontal.svg deleted file mode 100644 index 8e9422bec..000000000 --- a/apps/console/public/images/dot-grid-1x3-horizontal.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/console/public/index.html b/apps/console/public/index.html deleted file mode 100644 index 3b206be67..000000000 --- a/apps/console/public/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Probo - Console - - - - - - - - - - - - - - - - - -
- - - diff --git a/apps/console2/public/logos/gdpr.png b/apps/console/public/logos/gdpr.png similarity index 100% rename from apps/console2/public/logos/gdpr.png rename to apps/console/public/logos/gdpr.png diff --git a/apps/console2/public/logos/iso27001.png b/apps/console/public/logos/iso27001.png similarity index 100% rename from apps/console2/public/logos/iso27001.png rename to apps/console/public/logos/iso27001.png diff --git a/apps/console2/public/logos/soc2.png b/apps/console/public/logos/soc2.png similarity index 100% rename from apps/console2/public/logos/soc2.png rename to apps/console/public/logos/soc2.png diff --git a/apps/console2/public/logos/sox.png b/apps/console/public/logos/sox.png similarity index 100% rename from apps/console2/public/logos/sox.png rename to apps/console/public/logos/sox.png diff --git a/apps/console2/public/slack.png b/apps/console/public/slack.png similarity index 100% rename from apps/console2/public/slack.png rename to apps/console/public/slack.png diff --git a/apps/console2/public/vite.svg b/apps/console/public/vite.svg similarity index 100% rename from apps/console2/public/vite.svg rename to apps/console/public/vite.svg diff --git a/apps/console/relay.config.json b/apps/console/relay.config.json index 89f9e7e73..6c55a8183 100644 --- a/apps/console/relay.config.json +++ b/apps/console/relay.config.json @@ -1,6 +1,7 @@ { "src": "./src", - "schema": "./schema.graphql", + "schema": "../../pkg/server/api/console/v1/schema.graphql", "language": "typescript", - "eagerEsModules": true + "eagerEsModules": true, + "noFutureProofEnums": true } diff --git a/apps/console/scripts/esbuild.mjs b/apps/console/scripts/esbuild.mjs deleted file mode 100644 index ae065649a..000000000 --- a/apps/console/scripts/esbuild.mjs +++ /dev/null @@ -1,278 +0,0 @@ -import babel from "@babel/core"; -import postCssPlugin from "@probo/esbuild-plugin-postcss"; -import autoprefixer from "autoprefixer"; -import { execSync, spawn } from "child_process"; -import * as esbuild from "esbuild"; -import fs from "node:fs/promises"; -import http from "node:http"; -import path from "node:path"; -import process from "node:process"; -import tailwindcssPlugin from "@tailwindcss/postcss"; - -async function copyRecursive(src, dest) { - await fs.mkdir(dest, { recursive: true }); - const files = await fs.readdir(src); - - for (const file of files) { - const srcPath = path.join(src, file); - const destPath = path.join(dest, file); - - const fileInfo = await fs.lstat(srcPath); - - if (fileInfo.isDirectory()) { - await copyRecursive(srcPath, destPath); - } else { - await fs.copyFile(srcPath, destPath); - } - } -} - -function runRelayCompilerInWatchMode() { - const relayProcess = spawn("npm", ["run", "relay:watch"]); - - relayProcess.stdout.on("data", (data) => { - console.log(`[relay] ${data}`); - }); - - relayProcess.stderr.on("data", (data) => { - console.error(`[relay] ${data}`); - }); - - relayProcess.on("error", (error) => { - console.error("Failed to start Relay compiler:", error); - }); - - console.log("Relay compiler started in watch mode."); -} - -const envVars = Object.fromEntries( - Object.entries(process.env).map(([key, value]) => [ - `process.env.${key}`, - JSON.stringify(value), - ]) -); - -const hotReloading = { - name: "hot-reloading", - async setup(build) { - if (!process.env.LIVE_RELOAD) { - return; - } - - build.initialOptions.banner = build.initialOptions.banner || {}; - build.initialOptions.banner.js = ` - ${build.initialOptions.banner.js || ""}; - - if (!window.__esbuild_event_source__) { - window.__esbuild_event_source__ = true; - new EventSource('/esbuild').addEventListener('change', (e) => { - const { added, removed, updated } = JSON.parse(e.data); - - if (!added.length && !removed.length && updated.length === 1) { - for (const link of document.getElementsByTagName("link")) { - const url = new URL(link.href); - - if (url.host === location.host && url.pathname === updated[0]) { - const next = link.cloneNode(); - next.href = updated[0] + '?' + Math.random().toString(36).slice(2); - next.onload = () => link.remove(); - link.parentNode.insertBefore(next, link.nextSibling); - return; - } - } - } - - location.reload(); - }); - } - `; - return; - }, -}; - -const relayPlugin = { - name: "relay-compiler", - setup(build) { - build.initialOptions.loader = { - ...build.initialOptions.loader, - ".graphql": "text", - }; - - build.onLoad({ filter: /\.(ts|tsx)$/ }, async (args) => { - const source = await fs.readFile(args.path, "utf8"); - - const result = await babel.transformAsync(source, { - filename: args.path, - presets: [ - [ - "@babel/preset-env", - { - modules: false, - }, - ], - "@babel/preset-typescript", - ], - plugins: ["relay"], - sourceMaps: true, - }); - - return { - contents: result.code, - loader: "default", - }; - }); - }, -}; - -const htmlPlugin = { - name: 'html-plugin', - setup(build) { - build.onEnd(async (result) => { - // do not run this in watch mode - if (process.argv[2] === "watch") { - return; - } - - if (result.errors.length > 0) { - return; - } - - if (!result.metafile) { - console.error('Metafile not available'); - return; - } - - const outputs = Object.keys(result.metafile.outputs); - - const jsOutputs = outputs.filter(file => file.endsWith('.js') && file.includes('/App-')); - const cssOutputs = outputs.filter(file => file.endsWith('.css') && file.includes('/App-')); - - if (jsOutputs.length === 0 || cssOutputs.length === 0) { - console.error('Could not find entry point outputs'); - return; - } - - const jsFile = path.basename(jsOutputs[0]); - const cssFile = path.basename(cssOutputs[0]); - - console.log('Found JS file:', jsFile); - console.log('Found CSS file:', cssFile); - - const htmlPath = path.join(process.cwd(), 'dist', 'index.html'); - let html = await fs.readFile(htmlPath, "utf8"); - - html = html.replace('"/App.css"', `"/${cssFile}"`); - html = html.replace('"/App.js"', `"/${jsFile}"`); - - await fs.writeFile(htmlPath, html); - console.log("Successfully updated index.html with hashed filenames"); - }); - } -}; - -const defaultOptions = { - logLevel: "info", - entryPoints: ["src/App.tsx"], - bundle: true, - minify: true, - publicPath: "/", - outdir: "dist", - assetNames: "assets/[name]-[hash]", - chunkNames: "chunks/[name]-[hash]", - entryNames: "[dir]/[name]-[hash]", - splitting: true, - format: "esm", - sourcemap: "external", - metafile: true, - loader: { - ".png": "file", - ".jpg": "file", - ".jpeg": "file", - ".svg": "file", - ".gif": "file", - }, - plugins: [ - relayPlugin, - hotReloading, - htmlPlugin, - postCssPlugin({ - plugins: [tailwindcssPlugin(), autoprefixer()], - }), - ], - define: { - ...envVars, - }, -}; - -await copyRecursive("public", "dist"); - -const [, , command] = process.argv; - -if (command === "watch") { - runRelayCompilerInWatchMode(); - - const ctx = await esbuild.context({ - ...defaultOptions, - minify: false, - entryNames: "[dir]/[name]" - }); - await ctx.watch(); - let { host, port } = await ctx.serve({ servedir: "dist" }); - http - .createServer((req, res) => { - const options = { - hostname: host, - port: port, - path: req.url, - method: req.method, - headers: req.headers, - }; - - const urlObj = new URL(req.url, `http://${req.headers.host}`); - const extensionPattern = /\.[^/]+$/; - - const proxyReq = http.request(options, (proxyRes) => { - if ( - proxyRes.statusCode === 404 && - extensionPattern.test(urlObj.pathname) - ) { - res.writeHead(404, { "Content-Type": "text/plain" }); - res.end("404 - Not Found"); - return; - } - - if (proxyRes.statusCode === 404) { - const indexPath = path.join( - import.meta.dirname, - "../dist", - "index.html" - ); - - fs.readFile(indexPath, "utf8") - .then((data) => { - res.writeHead(200, { "Content-Type": "text/html" }); - res.end(data); - }) - .catch((err) => { - console.error("Error reading index.html:", err); - res.writeHead(500, { "Content-Type": "text/plain" }); - res.end("500 - Internal Server Error"); - }); - - proxyRes.resume(); - return; - } - - res.writeHead(proxyRes.statusCode, proxyRes.headers); - proxyRes.pipe(res, { end: true }); - }); - - req.pipe(proxyReq, { end: true }); - }) - .listen(3000, () => { - console.log(`listening on http://localhost:3000`); - }); -} else { - execSync("npm run relay", { stdio: "inherit" }); - await esbuild.build(defaultOptions); -} diff --git a/apps/console/src/App.css b/apps/console/src/App.css deleted file mode 100644 index a9c1514f5..000000000 --- a/apps/console/src/App.css +++ /dev/null @@ -1,323 +0,0 @@ -@import "tailwindcss"; -@import "@radix-ui/colors/blue.css"; -@import "@radix-ui/colors/blue-dark.css"; -@import "@radix-ui/colors/olive.css"; -@import "@radix-ui/colors/olive-alpha.css"; -@import "@radix-ui/colors/olive-dark.css"; -@import "@radix-ui/colors/olive-dark-alpha.css"; -@import "@radix-ui/colors/lime.css"; -@import "@radix-ui/colors/lime-dark.css"; -@import "@radix-ui/colors/red.css"; -@import "@radix-ui/colors/red-dark.css"; -@import "@radix-ui/colors/red-dark-alpha.css"; -@import "@radix-ui/colors/orange.css"; -@import "@radix-ui/colors/orange-dark.css"; - -@import "./styles/document-content.css"; - -@plugin 'tailwindcss-animate'; -@plugin "@tailwindcss/typography"; - -@custom-variant dark (&:is(.dark *)); - -@theme { - /* Legacy */ - /* --color-border: hsl(var(--border)); -> solid-b - --color-input: hsl(var(--input)); -> solid-b - --color-ring: hsl(var(--ring)); -> active-b - --color-background: hsl(var(--background)); -> level-0 - --color-foreground: hsl(var(--foreground)); -> primary - - --color-primary: hsl(var(--primary)); -> primary - --color-primary-foreground: hsl(var(--primary-foreground)); -> invert - - --color-secondary: hsl(var(--secondary)); -> invert - --color-secondary-foreground: hsl(var(--secondary-foreground)); -> secondary - - --color-destructive: hsl(var(--destructive)); -> danger-bg - --color-destructive-foreground: hsl(var(--destructive-foreground)); -> danger - - --color-muted: hsl(var(--muted)); -> invert-bg - --color-muted-foreground: hsl(var(--muted-foreground)); -> tertiary - - --color-accent: hsl(var(--accent)); -> accent-bg - --color-accent-foreground: hsl(var(--accent-foreground)); -> accent - - --color-popover: hsl(var(--popover)); -> level-0 - --color-popover-foreground: hsl(var(--popover-foreground)); -> primary - - --color-card: hsl(var(--card)); -> level-0 - --color-card-foreground: hsl(var(--card-foreground)); -> primary - - --color-sidebar: hsl(var(--sidebar-background)); -> level-0 - --color-sidebar-foreground: hsl(var(--sidebar-foreground)); -> secondary - --color-sidebar-primary: hsl(var(--sidebar-primary)); -> not used - --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground)); - --color-sidebar-accent: hsl(var(--sidebar-accent)); - --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground)); - --color-sidebar-border: hsl(var(--sidebar-border)); -> solid-b - --color-sidebar-ring: hsl(var(--sidebar-ring)); -> active-b */ - - /* New */ - /* Surfaces */ - --color-level-0: var(--level-0); - --color-level-1: var(--level-1); - --color-level-2: var(--level-2); - --color-level-3: var(--level-3); - - /* Text colors */ - --color-primary: var(--primary); - --color-invert: var(--invert); - --color-secondary: var(--secondary); - --color-tertiary: var(--tertiary); - --color-quaternary: var(--quaternary); - --color-disabled: var(--disabled); - --color-accent: var(--accent); - --color-danger: var(--danger); - --color-success: var(--success); - --color-info: var(--info); - --color-warning: var(--warning); - - /* Background colors */ - --color-primary-bg: var(--primary-bg); - --color-invert-bg: var(--invert-bg); - --color-secondary-bg: var(--secondary-bg); - --color-tertiary-bg: var(--tertiary-bg); - --color-subtle-bg: var(--subtle-bg); - --color-highlight-bg: var(--highlight-bg); - --color-accent-bg: var(--accent-bg); - --color-active-bg: var(--active-bg); - --color-danger-bg: var(--danger-bg); - --color-danger-plain-bg: var(--danger-plain-bg); - --color-success-bg: var(--success-bg); - --color-info-bg: var(--info-bg); - --color-warning-bg: var(--warning-bg); - /* Hover */ - --color-h-primary-bg: var(--h-primary-bg); - --color-h-invert-bg: var(--h-invert-bg); - --color-h-secondary-bg: var(--h-secondary-bg); - --color-h-tertiary-bg: var(--h-tertiary-bg); - --color-h-subtle-bg: var(--h-subtle-bg); - --color-h-highlight-bg: var(--h-highlight-bg); - --color-h-accent-bg: var(--h-accent-bg); - --color-h-active-bg: var(--h-active-bg); - /* Pressed */ - --color-p-primary-bg: var(--p-primary-bg); - --color-p-invert-bg: var(--p-invert-bg); - --color-p-secondary-bg: var(--p-secondary-bg); - --color-p-tertiary-bg: var(--p-tertiary-bg); - --color-p-subtle-bg: var(--p-subtle-bg); - --color-p-highlight-bg: var(--p-highlight-bg); - --color-p-accent-bg: var(--p-accent-bg); - --color-p-active-bg: var(--p-active-bg); - - /* Borders */ - --color-solid-b: var(--solid-b); - --color-low-b: var(--low-b); - --color-mid-b: var(--mid-b); - --color-strong-b: var(--strong-b); - --color-active-b: var(--active-b); - --color-accent-b: var(--accent-b); - --color-danger-b: var(--danger-b); - --color-success-b: var(--success-b); - --color-warning-b: var(--warning-b); - --color-info-b: var(--info-b); -} - -/* - The default border color has changed to `currentColor` in Tailwind CSS v4, - so we've added these compatibility styles to make sure everything still - looks the same as it did with Tailwind CSS v3. - - If we ever want to remove these styles, we need to add an explicit border - color utility to any element that depends on these defaults. -*/ -@layer base { - *, - ::after, - ::before, - ::backdrop, - ::file-selector-button { - border-color: var(--color-mid-b, currentColor); - } -} - -@layer base { - /* Legacy */ - /* :root { - --background: 0 0% 100%; - --foreground: 222.2 47.4% 11.2%; - --muted: 210 40% 96.1%; - --muted-foreground: 215.4 16.3% 46.9%; - --popover: 0 0% 100%; - --popover-foreground: 222.2 47.4% 11.2%; - --border: 214.3 31.8% 91.4%; - --input: 214.3 31.8% 91.4%; - --card: 0 0% 100%; - --card-foreground: 222.2 47.4% 11.2%; - --primary: 222.2 47.4% 11.2%; - --primary-foreground: 210 40% 98%; - --secondary: 210 40% 96.1%; - --secondary-foreground: 222.2 47.4% 11.2%; - --accent: 210 40% 96.1%; - --accent-foreground: 222.2 47.4% 11.2%; - --destructive: 0 100% 50%; - --destructive-foreground: 210 40% 98%; - --ring: 215 20.2% 65.1%; - --sidebar-background: 0 0% 98%; - --sidebar-foreground: 240 5.3% 26.1%; - --sidebar-primary: 240 5.9% 10%; - --sidebar-primary-foreground: 0 0% 98%; - --sidebar-accent: 240 4.8% 95.9%; - --sidebar-accent-foreground: 240 5.9% 10%; - --sidebar-border: 220 13% 91%; - --sidebar-ring: 217.2 91.2% 59.8%; - } - - .dark { - --background: 224 71% 4%; - --foreground: 213 31% 91%; - --muted: 223 47% 11%; - --muted-foreground: 215.4 16.3% 56.9%; - --accent: 216 34% 17%; - --accent-foreground: 210 40% 98%; - --popover: 224 71% 4%; - --popover-foreground: 215 20.2% 65.1%; - --border: 216 34% 17%; - --input: 216 34% 17%; - --card: 224 71% 4%; - --card-foreground: 213 31% 91%; - --primary: 210 40% 98%; - --primary-foreground: 222.2 47.4% 1.2%; - --secondary: 222.2 47.4% 11.2%; - --secondary-foreground: 210 40% 98%; - --destructive: 0 63% 31%; - --destructive-foreground: 210 40% 98%; - --ring: 216 34% 17%; - --sidebar-background: 240 5.9% 10%; - --sidebar-foreground: 240 4.8% 95.9%; - --sidebar-primary: 224.3 76.3% 48%; - --sidebar-primary-foreground: 0 0% 100%; - --sidebar-accent: 240 3.7% 15.9%; - --sidebar-accent-foreground: 240 4.8% 95.9%; - --sidebar-border: 240 3.7% 15.9%; - --sidebar-ring: 217.2 91.2% 59.8%; - } */ - - /* New */ - :root { - /* Surfaces */ - --level-0: #FAFAF5; - --level-1: #FFFFFF; - --level-2: #FFFFFF; - --level-3: var(--olive-12); - - /* Text colors */ - --primary: var(--olive-12); - --invert: var(--olive-1); - --secondary: var(--olive-11); - --tertiary: var(--olive-10); - --quaternary: var(--olive-8); - --disabled: var(--olive-7); - --accent: var(--lime-10); - --danger: var(--red-11); - --success: var(--lime-11); - --info: var(--blue-11); - --warning: var(--orange-11); - - /* Background colors */ - --primary-bg: var(--olive-12); - --invert-bg: #ffffff; - --secondary-bg: var(--olive-1); - --tertiary-bg: transparent; - --subtle-bg: var(--olive-a2); - --highlight-bg: var(--olive-a3); - --accent-bg: var(--olive-12); - --active-bg: var(--lime-4); - --danger-bg: var(--red-3); - --danger-plain-bg: var(--red-10); - --success-bg: var(--lime-3); - --info-bg: var(--blue-3); - --warning-bg: var(--orange-3); - /* Hover */ - --h-primary-bg: #273025; - --h-invert-bg: var(--olive-2); - --h-secondary-bg: var(--olive-2); - --h-tertiary-bg: var(--olive-a2); - --h-subtle-bg: var(--olive-a3); - --h-highlight-bg: var(--olive-a4); - --h-accent-bg: #1E2C1C; - --h-active-bg: var(--lime-5); - /* Pressed */ - --p-primary-bg: #30392E; - --p-invert-bg: var(--olive-3); - --p-secondary-bg: var(--olive-3); - --p-tertiary-bg: var(--olive-a3); - --p-subtle-bg: var(--olive-a4); - --p-highlight-bg: var(--olive-a5); - --p-accent-bg: #293A25; - --p-active-bg: var(--lime-6); - - /* Borders */ - --solid-b: var(--olive-4); - --low-b: var(--olive-a4); - --mid-b: var(--olive-a7); - --strong-b: var(--olive-a8); - --active-b: var(--olive-12); - --accent-b: var(--lime-11); - --danger-b: var(--red-10); - --success-b: var(--lime-10); - --warning-b: var(--orange-10); - --info-b: var(--blue-10); - } - - .dark { - /* Surfaces */ - --level-0: var(--olive-1); - --level-1: var(--olive-2); - --level-2: var(--olive-3); - --level-3: var(--olive-7); - - /* Text colors */ - --success: var(--lime-a11); - - /* Background colors */ - --primary-bg: var(--lime-10); - --invert-bg: var(--olive-1); - --secondary-bg: var(--olive-a3); - --active-bg: var(--olive-a4); - --accent-bg: var(--lime-10); - --danger-bg: var(--red-a3); - --danger-plain-bg: var(--red-a10); - --success-bg: var(--lime-a3); - --info-bg: var(--blue-a3); - --warning-bg: var(--orange-a3); - /* Hover */ - --h-primary-bg: #C4F042E1; - --h-secondary-bg: var(--olive-a3); - --h-highlight-bg: var(--olive-a5); - --h-accent-bg: var(--lime-a9); - --h-active-bg: var(--olive-a5); - /* Pressed */ - --p-primary-bg: #C4F042D7; - --p-secondary-bg: var(--olive-a4); - --p-highlight-bg: var(--olive-a6); - --p-accent-bg: var(--lime-a10); - --p-active-bg: var(--olive-a6); - - /* Borders */ - --solid-b: var(--olive-5); - --mid-b: var(--olive-a5); - --active-b: var(--olive-a12); - --warning-b: var(--orange-a10); - } -} - -@layer base { - * { - @apply border-solid-b; - } - body { - @apply font-sans antialiased bg-level-0 text-primary; - } -} diff --git a/apps/console/src/App.tsx b/apps/console/src/App.tsx index 78a5e630a..6efc4ed96 100644 --- a/apps/console/src/App.tsx +++ b/apps/console/src/App.tsx @@ -1,91 +1,12 @@ -import posthog from "posthog-js"; -import { PostHogProvider } from "posthog-js/react"; -import { lazy } from "@probo/react-lazy"; -import { StrictMode, Suspense } from "react"; -import { createRoot } from "react-dom/client"; -import { HelmetProvider } from "react-helmet-async"; -import { RelayEnvironmentProvider } from "react-relay"; -import { BrowserRouter, Route, Routes, useLocation } from "react-router"; -import "./App.css"; -import "./styles/document-content.css"; -import ErrorBoundary from "./components/ErrorBoundary"; -import AuthLayout from "./layouts/AuthLayout"; -import { RelayEnvironment } from "./RelayEnvironment"; -import { AuthenticationRoutes } from "./pages/authentication/Routes"; -import { OrganizationsRoutes } from "./pages/organizations/Routes"; -import SigningRequestsPage from "./pages/SigningRequestsPage"; +import { RouterProvider } from "react-router"; +import { router } from "./routes"; +import { Toasts } from "@probo/ui"; -posthog.init(process.env.POSTHOG_KEY!, { - api_host: process.env.POSTHOG_HOST, - session_recording: { - maskAllInputs: true, - }, - loaded: (posthog) => { - if (!process.env.POSTHOG_KEY) posthog.debug(); - }, -}); - -const OrganizationSelectionPage = lazy( - () => import("./pages/OrganizationSelectionPage"), -); - -function App() { +export function App() { return ( - - - - - - - - - - - - - } - /> - - } - /> - - } - /> - - - - - } - /> - - - - - - - + <> + + + ); } - -function ErrorBoundaryWithLocation({ - children, -}: { - children: React.ReactNode; -}) { - const location = useLocation(); - return {children}; -} - -const container = document.getElementById("root"); -const root = createRoot(container!); -root.render(); diff --git a/apps/console/src/RelayEnvironment.ts b/apps/console/src/RelayEnvironment.ts deleted file mode 100644 index aa9063173..000000000 --- a/apps/console/src/RelayEnvironment.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { - Environment, - FetchFunction, - Network, - RecordSource, - Store, -} from "relay-runtime"; -import { buildEndpoint } from "./utils"; -import { GraphQLError } from "graphql"; - -export class UnAuthenticatedError extends Error { - constructor() { - super("UNAUTHENTICATED"); - this.name = "UnAuthenticatedError"; - } -} - -export class InternalServerError extends Error { - constructor() { - super("INTERNAL_SERVER_ERROR"); - this.name = "InternalServerError"; - } -} - -const hasUnauthenticatedError = (error: GraphQLError) => - error.extensions?.code == "UNAUTHENTICATED"; - -const fetchRelay: FetchFunction = async ( - request, - variables, - _, - uploadables -) => { - const requestInit: RequestInit = { - method: "POST", - credentials: "include", - headers: {}, - }; - - if (uploadables) { - const formData = new FormData(); - formData.append( - "operations", - JSON.stringify({ - operationName: request.name, - query: request.text, - variables: variables, - }) - ); - - const uploadableMap: { - [key: string]: string[]; - } = {}; - - Object.keys(uploadables).forEach((key, index) => { - uploadableMap[index] = [`variables.${key}`]; - }); - - formData.append("map", JSON.stringify(uploadableMap)); - - Object.keys(uploadables).forEach((key, index) => { - formData.append(index.toString(), uploadables[key]); - }); - - requestInit.body = formData; - } else { - requestInit.headers = { - Accept: - "application/graphql-response+json; charset=utf-8, application/json; charset=utf-8", - "Content-Type": "application/json", - }; - - requestInit.body = JSON.stringify({ - operationName: request.name, - query: request.text, - variables, - }); - } - - const response = await fetch( - buildEndpoint("/api/console/v1/query"), - requestInit - ); - - if (response.status === 500) { - throw new InternalServerError(); - } - - const json = await response.json(); - - if (json.errors) { - const errors = json.errors as GraphQLError[]; - - if (errors.find(hasUnauthenticatedError)) { - throw new UnAuthenticatedError(); - } - - throw new Error( - `Error fetching GraphQL query '${ - request.name - }' with variables '${JSON.stringify(variables)}': ${JSON.stringify( - json.errors - )}` - ); - } - - return json; -}; - -function createRelayEnvironment() { - const source = new RecordSource(); - const store = new Store(source, { - queryCacheExpirationTime: 1 * 60 * 1000, - gcReleaseBufferSize: 20, - }); - - return new Environment({ - network: Network.create(fetchRelay), - store, - }); -} - -export const RelayEnvironment: Environment = createRelayEnvironment(); diff --git a/apps/console/src/components/AppSidebar.tsx b/apps/console/src/components/AppSidebar.tsx deleted file mode 100644 index 0cddb0dd6..000000000 --- a/apps/console/src/components/AppSidebar.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import * as React from "react"; -import { Suspense, useEffect } from "react"; -import { - graphql, - PreloadedQuery, - usePreloadedQuery, - useQueryLoader, -} from "react-relay"; - -import { NavUser } from "@/components/NavUser"; -import { Sidebar } from "@/components/ui/sidebar"; -import type { AppSidebarQuery as AppSidebarQueryType } from "./__generated__/AppSidebarQuery.graphql"; -import { OrganizationSwitcher } from "@/components/OrganizationSwitcher"; -import { AppSidebarShell } from "./AppSidebarShell"; -import { AppSidebarSkeleton } from "./AppSidebarSkeleton"; -import { NavMain } from "./NavMain"; - -const AppSidebarQuery = graphql` - query AppSidebarQuery { - viewer { - id - ...OrganizationSwitcher_organizations - ...NavUser_viewer - } - } -`; - -function AppSidebarContent({ - queryRef, - ...props -}: React.ComponentProps & { - queryRef: PreloadedQuery; -}) { - const data = usePreloadedQuery(AppSidebarQuery, queryRef); - - return ( - - } - navMain={} - navUser={} - {...props} - /> - ); -} - -export function AppSidebar(props: React.ComponentProps) { - const [queryRef, loadQuery] = - useQueryLoader(AppSidebarQuery); - - useEffect(() => { - loadQuery({}); - }, [loadQuery]); - - if (!queryRef) { - return ; - } - - return ( - }> - - - ); -} diff --git a/apps/console/src/components/AppSidebarShell.tsx b/apps/console/src/components/AppSidebarShell.tsx deleted file mode 100644 index a2297b549..000000000 --- a/apps/console/src/components/AppSidebarShell.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { NavSecondary } from "./NavSecondary"; -import { - Sidebar, - SidebarContent, - SidebarFooter, - SidebarHeader, -} from "./ui/sidebar"; -import { ReactNode } from "react"; - -interface AppSidebarShellProps extends React.ComponentProps { - navUser: ReactNode; - navMain: ReactNode; - organizationSwitcher: ReactNode; -} - -export function AppSidebarShell({ - navUser, - navMain, - organizationSwitcher, - ...props -}: AppSidebarShellProps) { - return ( - - {organizationSwitcher} - - {navMain} - - - {navUser} - - ); -} diff --git a/apps/console/src/components/AppSidebarSkeleton.tsx b/apps/console/src/components/AppSidebarSkeleton.tsx deleted file mode 100644 index 9515cf532..000000000 --- a/apps/console/src/components/AppSidebarSkeleton.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { AppSidebarShell } from "./AppSidebarShell"; -import { NavMainSkeleton } from "./NavMainSkeleton"; -import { NavUserSkeleton } from "./NavUserSkeleton"; -import { OrganizationSwitcherSkeleton } from "./OrganizationSwitcherSkeleton"; -import { Sidebar } from "./ui/sidebar"; - -export function AppSidebarSkeleton( - props: React.ComponentProps, -) { - return ( - } - navMain={} - navUser={} - {...props} - /> - ); -} diff --git a/apps/console/src/components/DocumentEditor.css b/apps/console/src/components/DocumentEditor.css deleted file mode 100644 index 57e7b9069..000000000 --- a/apps/console/src/components/DocumentEditor.css +++ /dev/null @@ -1,284 +0,0 @@ -.document-editor-container { - border-radius: 0.5rem; - position: relative; - line-height: 1.5; - font-weight: 400; - margin-top: 0.5rem; - border: 1px solid var(--solid-b); - display: block; - width: 100%; -} - -.document-editor { - background: var(--bg-invert-bg); - position: relative; - border-radius: 0.5rem; - display: flex; - flex-direction: column; - width: 100%; -} - -.document-editor-inner { - background: #fff; - position: relative; - border-radius: 0 0 0.5rem 0.5rem; - flex: 1; - min-height: 250px; -} - -.document-editor-input { - min-height: 250px; - max-height: 500px; - resize: none; - font-size: 15px; - position: relative; - tab-size: 1; - outline: 0; - padding: 15px 10px; - overflow-y: auto; - width: 100%; - display: block; - color: #000; -} - -.document-editor-placeholder { - color: #999; - overflow: hidden; - position: absolute; - text-overflow: ellipsis; - top: 15px; - left: 10px; - font-size: 15px; - user-select: none; - display: inline-block; - pointer-events: none; -} - -.document-editor-paragraph { - margin: 0 0 15px 0; - position: relative; -} - -.document-editor .toolbar { - display: flex; - flex-wrap: wrap; - padding: 8px; - border-bottom: 1px solid hsl(var(--solid-b)); - background-color: hsl(var(--invert-bg)); - border-radius: 0.5rem 0.5rem 0 0; -} - -.document-editor .toolbar button { - border: 0; - display: flex; - background: none; - border-radius: 4px; - padding: 8px; - cursor: pointer; - vertical-align: middle; - align-items: center; - justify-content: center; -} - -.document-editor .toolbar button:hover { - background-color: rgba(0, 0, 0, 0.05); -} - -.document-editor .toolbar button.active { - background-color: rgba(0, 0, 0, 0.1); -} - -.document-editor .toolbar .divider { - width: 1px; - background-color: hsl(var(--solid-b)); - margin: 0 8px; - height: 24px; -} - -/* Typography */ -.editor-heading-h1 { - font-size: 24px; - font-weight: 700; - margin: 0 0 12px 0; -} - -.editor-heading-h2 { - font-size: 20px; - font-weight: 700; - margin: 10px 0; -} - -.editor-heading-h3 { - font-size: 18px; - font-weight: 600; - margin: 8px 0; -} - -.editor-heading-h4 { - font-size: 16px; - font-weight: 600; - margin: 8px 0; -} - -.editor-heading-h5 { - font-size: 14px; - font-weight: 600; - margin: 8px 0; -} - -.editor-quote { - margin: 0; - margin-left: 20px; - padding-left: 16px; - border-left: 4px solid hsl(var(--solid-b)); - color: hsl(var(--tertiary)); -} - -.editor-list-ol { - padding: 0; - margin: 0 0 0 16px; - list-style-type: decimal; - display: block; - counter-reset: li; -} - -.editor-list-ul { - padding: 0; - margin: 0 0 0 16px; - list-style-type: disc; - display: block; -} - -.editor-listitem { - margin: 8px 0 0 0; - display: list-item; - position: relative; - padding-left: 8px; -} - -/* Ensure list items display consistently across browsers */ -li.editor-listitem::marker { - font-weight: normal; - color: inherit; -} - -/* Specifically for ordered lists */ -ol.editor-list-ol > .editor-listitem { - list-style-type: decimal; - list-style-position: outside; -} - -/* For nested ordered lists */ -ol.editor-list-ol ol.editor-list-ol > .editor-listitem { - list-style-type: lower-alpha; -} - -.editor-listitem--checked, -.editor-listitem--unchecked { - position: relative; - margin-left: 0; - padding-left: 24px; - list-style-type: none; -} - -.editor-listitem--checked:before, -.editor-listitem--unchecked:before { - content: ''; - width: 16px; - height: 16px; - position: absolute; - left: 0; - top: 2px; - background-size: 16px; - background-position: center; - background-repeat: no-repeat; -} - -.editor-listitem--checked:before { - background-image: url('data:image/svg+xml;utf8,'); -} - -.editor-listitem--unchecked:before { - background-image: url('data:image/svg+xml;utf8,'); -} - -.editor-nested-listitem { - list-style-type: none; -} - -/* Text formatting */ -.editor-text-bold { - font-weight: bold; -} - -.editor-text-italic { - font-style: italic; -} - -.editor-text-underline { - text-decoration: underline; -} - -.editor-text-strikethrough { - text-decoration: line-through; -} - -.editor-text-underlineStrikethrough { - text-decoration: underline line-through; -} - -.editor-text-code { - background-color: hsl(var(--invert-bg)); - padding: 1px 4px; - border-radius: 4px; - font-family: monospace; -} - -.editor-link { - color: hsl(var(--primary)); - text-decoration: underline; -} - -.editor-code { - background-color: hsl(var(--invert-bg)); - font-family: monospace; - display: block; - padding: 8px 16px; - line-height: 1.6; - font-size: 13px; - border-radius: 0.5rem; - margin: 8px 0; -} - -/* Code highlight */ -.editor-tokenComment { - color: slategray; -} - -.editor-tokenPunctuation { - color: #999; -} - -.editor-tokenProperty { - color: #905; -} - -.editor-tokenSelector { - color: #690; -} - -.editor-tokenOperator { - color: #9a6e3a; -} - -.editor-tokenAttr { - color: #07a; -} - -.editor-tokenVariable { - color: #e90; -} - -.editor-tokenFunction { - color: #dd4a68; -} diff --git a/apps/console/src/components/EditableField.tsx b/apps/console/src/components/EditableField.tsx deleted file mode 100644 index f0045828f..000000000 --- a/apps/console/src/components/EditableField.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { HelpCircle } from "lucide-react"; -import { Label } from "./ui/label"; -import { Textarea } from "./ui/textarea"; -import { Input } from "./ui/input"; -import { cn } from "@/lib/utils"; - -export function EditableField({ - label, - value, - onChange, - type = "text", - helpText, - required, - multiline = false, -}: { - label: string; - value: string; - onChange: (value: string) => void; - type?: string; - helpText?: string; - required?: boolean; - multiline?: boolean; -}) { - return ( -
-
- - {helpText && ( -
- - {helpText} -
- )} -
- {multiline ? ( -