From 06f9665d6d0013df55126fc5883436c5f4ffb3b6 Mon Sep 17 00:00:00 2001 From: codetypes Date: Fri, 3 May 2024 23:07:35 +0800 Subject: [PATCH 1/5] nowarp for explore item title --- src/components/editor.tsx | 8 ++++---- src/components/explorer.tsx | 27 ++++++++++++++++++++++++++- src/index.scss | 11 ++++++++--- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/components/editor.tsx b/src/components/editor.tsx index 1cf1e60..37381cd 100644 --- a/src/components/editor.tsx +++ b/src/components/editor.tsx @@ -1185,8 +1185,8 @@ export const Editor: FC = ({ onUpdate: updateState, data: editor, . type="text" size="small" className={mergeClassNames( - "b3-editor-button-filter", - filterOption.filterCase && "b3-editor-button-filter-selected" + "b3-editor-filter", + filterOption.filterCase && "b3-editor-filter-selected" )} icon={} onClick={() => @@ -1201,8 +1201,8 @@ export const Editor: FC = ({ onUpdate: updateState, data: editor, . type="text" size="small" className={mergeClassNames( - "b3-editor-button-filter", - filterOption.filterFocus && "b3-editor-button-filter-selected" + "b3-editor-filter", + filterOption.filterFocus && "b3-editor-filter-selected" )} icon={} onClick={() => diff --git a/src/components/explorer.tsx b/src/components/explorer.tsx index fa2c748..652b4e9 100644 --- a/src/components/explorer.tsx +++ b/src/components/explorer.tsx @@ -804,7 +804,19 @@ export const Explorer: FC = () => { ); } else { - return {node.title}; + return ( +
+
+ {node.title} +
+
+ ); } }} allowDrop={(options) => { @@ -826,6 +838,19 @@ export const Explorer: FC = () => { fieldNames={{ key: "title" }} treeData={nodeTree ? [nodeTree] : []} draggable={{ icon: false, nodeDraggable: (node) => !!node.isLeaf }} + titleRender={(node) => ( +
+
+ {node.title} +
+
+ )} onSelect={(_, info) => { const node = info.node; if (node && node.isLeaf) { diff --git a/src/index.scss b/src/index.scss index b26a781..f126461 100644 --- a/src/index.scss +++ b/src/index.scss @@ -86,8 +86,13 @@ body { cursor: pointer !important; } -.ant-tree .ant-tree-node-content-wrapper { +.ant-tree-node-content-wrapper { padding-left: 0 !important; + display: inline-flex; +} + +.ant-tree-title { + display: contents; } .ant-tree-switcher.ant-tree-switcher-noop, @@ -179,11 +184,11 @@ body { } // editor -.b3-editor-button-filter { +.b3-editor-filter { width: 20px !important; height: 20px !important; } -.b3-editor-button-filter-selected { +.b3-editor-filter-selected { background-color: var(--b3-color-selected) !important; } From fa5d48d80c3f8d84c0f8b4971942fc22425d5b0e Mon Sep 17 00:00:00 2001 From: codetypes Date: Sun, 5 May 2024 11:37:49 +0800 Subject: [PATCH 2/5] use text area for description --- public/icons/Decorator.svg | 2 +- src/components/explorer.tsx | 2 -- src/components/inspector.tsx | 7 ++++--- src/components/register-node.ts | 12 ++++++------ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/public/icons/Decorator.svg b/public/icons/Decorator.svg index d670472..4b10007 100644 --- a/public/icons/Decorator.svg +++ b/public/icons/Decorator.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/components/explorer.tsx b/src/components/explorer.tsx index 652b4e9..d3b1dac 100644 --- a/src/components/explorer.tsx +++ b/src/components/explorer.tsx @@ -709,8 +709,6 @@ export const Explorer: FC = () => { return arr; }, [t, copyFile]); - const nodeConfs = useMemo(() => {}, [workspace.nodeDefs]); - const onClick = (info: MenuInfo) => { const node = findFile(selectedKeys[0], workspace.fileTree!) ?? workspace.fileTree; if (node) { diff --git a/src/components/inspector.tsx b/src/components/inspector.tsx index d250939..52766d9 100644 --- a/src/components/inspector.tsx +++ b/src/components/inspector.tsx @@ -3,6 +3,7 @@ import { NodeArgType, NodeModel, TreeGraphData, TreeModel } from "@/misc/b3type" import { Hotkey, isMacos } from "@/misc/keys"; import Path from "@/misc/path"; import { AutoComplete, Divider, Flex, Form, Input, InputNumber, Select, Switch } from "antd"; +import TextArea from "antd/es/input/TextArea"; import { DefaultOptionType } from "antd/es/select"; import { FC, useEffect, useMemo } from "react"; import { useTranslation } from "react-i18next"; @@ -52,7 +53,7 @@ const TreeInspector: FC = () => { - +