dbdiff-app 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/bin/cli.js +83 -0
- package/bin/install-local.js +57 -0
- package/electron/generate-icon.mjs +54 -0
- package/electron/icon.icns +0 -0
- package/electron/icon.png +0 -0
- package/electron/icon.svg +21 -0
- package/electron/main.js +169 -0
- package/electron/patch-dev-plist.js +31 -0
- package/electron/preload.cjs +18 -0
- package/electron/wait-for-vite.js +43 -0
- package/index.html +13 -0
- package/package.json +91 -0
- package/public/favicon.svg +15 -0
- package/public/vite.svg +1 -0
- package/server/export.ts +57 -0
- package/server/index.ts +392 -0
- package/src/App.css +1 -0
- package/src/App.tsx +543 -0
- package/src/assets/react.svg +1 -0
- package/src/components/CommandPalette.tsx +243 -0
- package/src/components/ConnectedView.tsx +78 -0
- package/src/components/ConnectionPicker.tsx +381 -0
- package/src/components/ConsoleView.tsx +360 -0
- package/src/components/CsvExportModal.tsx +144 -0
- package/src/components/DataGrid/DataGrid.tsx +262 -0
- package/src/components/DataGrid/DataGridCell.tsx +73 -0
- package/src/components/DataGrid/DataGridHeader.tsx +89 -0
- package/src/components/DataGrid/index.ts +20 -0
- package/src/components/DataGrid/types.ts +63 -0
- package/src/components/DataGrid/useColumnResize.ts +153 -0
- package/src/components/DataGrid/useDataGridSelection.ts +340 -0
- package/src/components/DataGrid/utils.ts +184 -0
- package/src/components/DatabaseMenu.tsx +93 -0
- package/src/components/DatabaseSwitcher.tsx +208 -0
- package/src/components/DiffView.tsx +215 -0
- package/src/components/EditConnectionModal.tsx +417 -0
- package/src/components/ErrorBoundary.tsx +69 -0
- package/src/components/GlobalShortcuts.tsx +201 -0
- package/src/components/InnerTabBar.tsx +129 -0
- package/src/components/JsonTreeViewer.tsx +387 -0
- package/src/components/MemberAccessEditor.tsx +443 -0
- package/src/components/MembersModal.tsx +446 -0
- package/src/components/NewConnectionModal.tsx +274 -0
- package/src/components/Resizer.tsx +66 -0
- package/src/components/ScanSuccessModal.tsx +113 -0
- package/src/components/ShortcutSettingsModal.tsx +318 -0
- package/src/components/Sidebar.tsx +532 -0
- package/src/components/TabBar.tsx +188 -0
- package/src/components/TableView.tsx +2147 -0
- package/src/components/ThemeToggle.tsx +44 -0
- package/src/components/index.ts +17 -0
- package/src/constants.ts +12 -0
- package/src/electron.d.ts +12 -0
- package/src/index.css +44 -0
- package/src/main.tsx +13 -0
- package/src/stores/hooks.ts +1146 -0
- package/src/stores/index.ts +12 -0
- package/src/stores/store.ts +1514 -0
- package/src/stores/useCloudSync.ts +274 -0
- package/src/stores/useSyncDatabase.ts +422 -0
- package/src/types.ts +277 -0
- package/src/utils/csv.ts +27 -0
- package/src/vite-env.d.ts +2 -0
- package/tsconfig.app.json +28 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +26 -0
- package/tsconfig.server.json +14 -0
- package/vite.config.ts +14 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
interface ThemeToggleProps {
|
|
2
|
+
darkMode: boolean;
|
|
3
|
+
onToggle: () => void;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function ThemeToggle({ darkMode, onToggle }: ThemeToggleProps) {
|
|
7
|
+
return (
|
|
8
|
+
<button
|
|
9
|
+
className="w-8 h-8 flex items-center justify-center rounded-md text-interactive hover:bg-stone-200/50 dark:hover:bg-white/[0.04] transition-all duration-150"
|
|
10
|
+
onClick={onToggle}
|
|
11
|
+
title={darkMode ? "Switch to light mode" : "Switch to dark mode"}
|
|
12
|
+
>
|
|
13
|
+
{darkMode ? (
|
|
14
|
+
<svg
|
|
15
|
+
className="w-4 h-4"
|
|
16
|
+
fill="none"
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
stroke="currentColor"
|
|
19
|
+
>
|
|
20
|
+
<path
|
|
21
|
+
strokeLinecap="round"
|
|
22
|
+
strokeLinejoin="round"
|
|
23
|
+
strokeWidth={2}
|
|
24
|
+
d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
) : (
|
|
28
|
+
<svg
|
|
29
|
+
className="w-4 h-4"
|
|
30
|
+
fill="none"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
stroke="currentColor"
|
|
33
|
+
>
|
|
34
|
+
<path
|
|
35
|
+
strokeLinecap="round"
|
|
36
|
+
strokeLinejoin="round"
|
|
37
|
+
strokeWidth={2}
|
|
38
|
+
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
)}
|
|
42
|
+
</button>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { TabBar } from "./TabBar";
|
|
2
|
+
export { InnerTabBar } from "./InnerTabBar";
|
|
3
|
+
export { Sidebar } from "./Sidebar";
|
|
4
|
+
export { ConnectionPicker } from "./ConnectionPicker";
|
|
5
|
+
export { ConnectedView } from "./ConnectedView";
|
|
6
|
+
export { ConsoleView } from "./ConsoleView";
|
|
7
|
+
export { ThemeToggle } from "./ThemeToggle";
|
|
8
|
+
export { NewConnectionModal } from "./NewConnectionModal";
|
|
9
|
+
export { EditConnectionModal } from "./EditConnectionModal";
|
|
10
|
+
export { MembersModal } from "./MembersModal";
|
|
11
|
+
export { ShortcutSettingsModal } from "./ShortcutSettingsModal";
|
|
12
|
+
export { Resizer } from "./Resizer";
|
|
13
|
+
export { GlobalShortcuts } from "./GlobalShortcuts";
|
|
14
|
+
export { CommandPalette } from "./CommandPalette";
|
|
15
|
+
export { DatabaseSwitcher } from "./DatabaseSwitcher";
|
|
16
|
+
export { ScanSuccessModal } from "./ScanSuccessModal";
|
|
17
|
+
export { ErrorBoundary } from "./ErrorBoundary";
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const CLOUD_URL =
|
|
2
|
+
process.env.NODE_ENV === "development"
|
|
3
|
+
? "http://localhost:3090"
|
|
4
|
+
: "https://cloud.dbdiff.app";
|
|
5
|
+
|
|
6
|
+
// Set to true to show cloud linking/sync UI
|
|
7
|
+
export const CLOUD_ENABLED = false;
|
|
8
|
+
|
|
9
|
+
// Disable for cloud-hosted deployments where localhost isn't accessible
|
|
10
|
+
export const LOCALHOST_SCANNING_ENABLED = true;
|
|
11
|
+
|
|
12
|
+
export const PAGE_SIZE = 500;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface ElectronAPI {
|
|
2
|
+
onMenuAction: (callback: (action: string) => void) => () => void;
|
|
3
|
+
setDatabaseMenuEnabled: (enabled: boolean) => void;
|
|
4
|
+
onCloudAuthCallback: (
|
|
5
|
+
callback: (data: { key: string; state: string }) => void,
|
|
6
|
+
) => () => void;
|
|
7
|
+
platform: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Window {
|
|
11
|
+
electronAPI?: ElectronAPI;
|
|
12
|
+
}
|
package/src/index.css
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
4
|
+
|
|
5
|
+
html, body {
|
|
6
|
+
margin: 0;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
overscroll-behavior-x: none;
|
|
9
|
+
overscroll-behavior-y: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/* Text color system */
|
|
14
|
+
.text-primary {
|
|
15
|
+
@apply text-stone-900 dark:text-white;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.text-secondary {
|
|
19
|
+
@apply text-stone-500 dark:text-white/80;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.text-tertiary {
|
|
23
|
+
@apply text-stone-400 dark:text-white/60;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Interactive text color system with hover states */
|
|
27
|
+
.text-interactive {
|
|
28
|
+
@apply text-stone-500 dark:text-white/50;
|
|
29
|
+
}
|
|
30
|
+
.text-interactive:hover {
|
|
31
|
+
@apply text-stone-600 dark:text-white/70;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.text-interactive-subtle {
|
|
35
|
+
@apply text-stone-400 dark:text-white/40;
|
|
36
|
+
}
|
|
37
|
+
.text-interactive-subtle:hover {
|
|
38
|
+
@apply text-stone-500 dark:text-white/60;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Buttons should always show pointer cursor */
|
|
42
|
+
button {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
package/src/main.tsx
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StrictMode } from "react";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import "./index.css";
|
|
4
|
+
import App from "./App.tsx";
|
|
5
|
+
import { ErrorBoundary } from "./components/ErrorBoundary";
|
|
6
|
+
|
|
7
|
+
createRoot(document.getElementById("root")!).render(
|
|
8
|
+
<StrictMode>
|
|
9
|
+
<ErrorBoundary>
|
|
10
|
+
<App />
|
|
11
|
+
</ErrorBoundary>
|
|
12
|
+
</StrictMode>,
|
|
13
|
+
);
|