Merge branch 'dev'

This commit is contained in:
codetypes committed 2025-05-08 14:21:27 +08:00
commit 6f670786e4
3 files changed
+9 -5

No files matched your search

+3 -1
View File
@@ -976,7 +976,7 @@ export class Graph {
}
const ret = await dialog.showSaveDialog({
defaultPath: workspace.workdir,
defaultPath: workspace.workdir.replaceAll("/", Path.sep),
properties: ["showOverwriteConfirmation"],
filters: [{ name: "Json", extensions: ["json"] }],
});
@@ -1001,6 +1001,8 @@ export class Graph {
} as TreeData;
fs.writeFileSync(subpath, JSON.stringify(subtreeModel, null, 2));
data.path = workspace.relative(subpath);
this._graph.updateNodeData([node]);
this.editor.data.root = this._nodeToData("1");
await this.refresh();
this._storeHistory();
}
+2
View File
@@ -14,6 +14,7 @@ import { useWorkspace } from "../contexts/workspace-context";
import * as b3util from "../misc/b3util";
import i18n from "../misc/i18n";
import { Hotkey, isMacos } from "../misc/keys";
import Path from "../misc/path";
const MenuItemLabel: FC<FlexProps> = (itemProps) => {
return (
@@ -107,6 +108,7 @@ export const Menu: FC<LayoutProps> = () => {
click: () => {
console.log("newFile");
const path = dialog.showSaveDialogSync({
defaultPath: workspace.workdir.replaceAll("/", Path.sep),
properties: ["showOverwriteConfirmation"],
filters: [{ name: "Json", extensions: ["json"] }],
});
+4 -4
View File
@@ -189,8 +189,8 @@ b3util.setSizeCalculator((data: NodeData) => {
height += 20;
}
updateHeight(data.args);
updateHeight(data.input);
updateHeight(data.output);
data.input?.find((v) => !!v) && updateHeight(data.input);
data.output?.find((v) => !!v) && updateHeight(data.output);
return [width, height];
});
@@ -513,7 +513,7 @@ class TreeNode extends Rect {
}
private drawInputText(attributes: Required<RectStyleProps>, container: Group) {
const input = this._data.input ?? [];
const input = this._data.input?.find((v) => !!v) ? this._data.input : [];
const { str, line } =
input.length > 0
? toBreakWord(`${i18n.t("regnode.input")}${JSON.stringify(input)}`, 200)
@@ -552,7 +552,7 @@ class TreeNode extends Rect {
}
private drawOutputText(attributes: Required<RectStyleProps>, container: Group) {
const output = this._data.output ?? [];
const output = this._data.output?.find((v) => !!v) ? this._data.output : [];
const { str, line } =
output.length > 0
? toBreakWord(`${i18n.t("regnode.output")}${JSON.stringify(output)}`, 200)