Merge branch 'dev'

This commit is contained in:
codetypes committed 2024-08-09 13:12:39 +08:00
commit bd8f4b4ead
6 files changed
+834 -760

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ import { Hotkey, isHotkeyPressed, isMacos, useHotkeys } from "@/misc/keys";
import Path from "@/misc/path";
import { DownOutlined } from "@ant-design/icons";
import { Button, Dropdown, Flex, FlexProps, Input, MenuProps, Space, Tree } from "antd";
import { ItemType } from "antd/es/menu/hooks/useItems";
import { ItemType } from "antd/es/menu/interface";
import { ipcRenderer, shell } from "electron";
import * as fs from "fs";
import React, { FC, useEffect, useMemo, useState } from "react";
+1 -1
View File
@@ -6,7 +6,7 @@ import { Hotkey, isMacos, sendInputEvent } from "@/misc/keys";
import { CheckOutlined } from "@ant-design/icons";
import { Menu as AppMenu, BrowserWindow, app, dialog } from "@electron/remote";
import { Button, DropDownProps, Dropdown, Flex, FlexProps, LayoutProps, Space } from "antd";
import { ItemType } from "antd/es/menu/hooks/useItems";
import { ItemType } from "antd/es/menu/interface";
import { ipcRenderer } from "electron";
import { MenuItemConstructorOptions } from "electron/renderer";
import * as fs from "fs";
+8 -7
View File
@@ -2,8 +2,6 @@ import { useWorkspace } from "@/contexts/workspace-context";
import { TreeGraphData, getNodeType } from "@/misc/b3type";
import { checkTreeData, cutWordTo, toBreakWord } from "@/misc/b3util";
import i18n from "@/misc/i18n";
import { isMacos } from "@/misc/keys";
import Path from "@/misc/path";
import G6 from "@antv/g6";
const NODE_COLORS: any = {
@@ -250,7 +248,7 @@ G6.registerNode(
let desc = (cfg.desc || nodeDef.desc) as string;
if (desc) {
desc = i18n.t("regnode.mark") + desc;
desc = cutWordTo(desc, 33);
desc = cutWordTo(desc, w - 15);
addShape("text", {
attrs: {
textBaseline: "top",
@@ -267,7 +265,7 @@ G6.registerNode(
const args: any = cfg.args;
if (nodeDef.args && args && Object.keys(args).length > 0) {
const { str, line } = toBreakWord(`${i18n.t("regnode.args")}${JSON.stringify(args)}`, 36);
const { str, line } = toBreakWord(`${i18n.t("regnode.args")}${JSON.stringify(args)}`, 200);
addShape("text", {
attrs: {
textBaseline: "top",
@@ -285,7 +283,10 @@ G6.registerNode(
const input: [] = cfg.input ? (cfg.input as []) : [];
if (nodeDef.input && input.length > 0) {
const { str, line } = toBreakWord(`${i18n.t("regnode.input")}${JSON.stringify(input)}`, 35);
const { str, line } = toBreakWord(
`${i18n.t("regnode.input")}${JSON.stringify(input)}`,
200
);
if (cfg.highlightInput) {
addShape("rect", {
attrs: {
@@ -322,7 +323,7 @@ G6.registerNode(
if (nodeDef.output && output.length > 0) {
const { str, line } = toBreakWord(
`${i18n.t("regnode.output")}${JSON.stringify(output)}`,
35
200
);
if (cfg.highlightOutput) {
addShape("rect", {
@@ -358,7 +359,7 @@ G6.registerNode(
if (cfg.path) {
let path = (i18n.t("regnode.subtree") + cfg.path) as string;
path = cutWordTo(path, 35);
path = cutWordTo(path, w - 15);
addShape("text", {
attrs: {
textBaseline: "top",