diff --git a/package-lock.json b/package-lock.json
index 5480d41f..534a94eb 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -21443,6 +21443,21 @@
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
+ },
+ "node_modules/@next/swc-win32-ia32-msvc": {
+ "version": "14.2.20",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.20.tgz",
+ "integrity": "sha512-igQW/JWciTGJwj3G1ipalD2V20Xfx3ywQy17IV0ciOUBbFhNfyU1DILWsTi32c8KmqgIDviUEulW/yPb2FF90w==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
}
}
}
diff --git a/src/app/(theme)/playground/client/page-client.tsx b/src/app/(theme)/playground/client/page-client.tsx
index d93e3da6..03cb977a 100644
--- a/src/app/(theme)/playground/client/page-client.tsx
+++ b/src/app/(theme)/playground/client/page-client.tsx
@@ -17,6 +17,7 @@ import {
DropdownMenuSeparator,
} from "@/components/ui/dropdown-menu";
import { Button } from "@/components/ui/button";
+import { CommonDialogProvider } from "@/components/common-dialog";
function OverlayAround({
x,
@@ -324,10 +325,12 @@ export default function PlaygroundEditorBody({
return (
<>
-
-
-
- {dom}
+
+
+
+
+ {dom}
+
>
);
}
diff --git a/src/components/gui/tabs/relational-diagram-tab/erd-table-column.tsx b/src/components/gui/tabs/relational-diagram-tab/erd-table-column.tsx
index 06440ba7..b22793a7 100644
--- a/src/components/gui/tabs/relational-diagram-tab/erd-table-column.tsx
+++ b/src/components/gui/tabs/relational-diagram-tab/erd-table-column.tsx
@@ -11,7 +11,7 @@ export default function ERDTableColumn({
}) {
return (
-
+
}
{column.fk && }
- {column.title}
+ {column.title}
-
+
{column.type}
x.position.x)) ?? 0) +
- NODE_MARGIN +
- MAX_NODE_WIDTH;
+ layoutRelationship.nodes.length === 0
+ ? 0
+ : (Math.max(...layoutRelationship.nodes.map((x) => x.position.x)) ?? 0) +
+ NODE_MARGIN +
+ MAX_NODE_WIDTH;
const relationshipTopPosition =
- Math.min(...layoutRelationship.nodes.map((x) => x.position.y)) ?? 0;
+ layoutRelationship.nodes.length === 0
+ ? 0
+ : Math.min(...layoutRelationship.nodes.map((x) => x.position.y)) ?? 0;
// Calculate estimate area of the nodes without relationship
const area =
diff --git a/src/components/screen-dropzone.tsx b/src/components/screen-dropzone.tsx
index 5488d8f7..f5e26ed8 100644
--- a/src/components/screen-dropzone.tsx
+++ b/src/components/screen-dropzone.tsx
@@ -1,12 +1,15 @@
"use client";
import { useEffect } from "react";
+import { useCommonDialog } from "./common-dialog";
interface Props {
onFileDrop: (handler: FileSystemFileHandle) => void;
}
export default function ScreenDropZone({ onFileDrop }: Props) {
+ const { showDialog } = useCommonDialog();
+
useEffect(() => {
const dropEventHandler = (e: DragEvent) => {
e.preventDefault();
@@ -17,7 +20,15 @@ export default function ScreenDropZone({ onFileDrop }: Props) {
if (!fileList) return;
if (fileList.length === 0) return;
- (fileList[0] as any).getAsFileSystemHandle().then(onFileDrop);
+ try {
+ (fileList[0] as any).getAsFileSystemHandle().then(onFileDrop);
+ } catch (error) {
+ showDialog({
+ destructive: true,
+ title: "Warning",
+ content: "Your browser are not support. please use another browser.",
+ });
+ }
};
const dragEventHandler = (e: DragEvent) => {
@@ -33,7 +44,7 @@ export default function ScreenDropZone({ onFileDrop }: Props) {
window.document.removeEventListener("dragover", dragEventHandler);
window.document.removeEventListener("drop", dropEventHandler);
};
- }, [onFileDrop]);
+ }, [onFileDrop, showDialog]);
return <>>;
}