From dffa8b1d4fefb8629662cbbe5e48e413390be65e Mon Sep 17 00:00:00 2001 From: sealday Date: Mon, 17 Jun 2024 17:48:32 +0800 Subject: [PATCH] chore: refactor code-mirror (#1196) Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1196 --- .../plugin-core/src/client/components/code-mirror/index.tsx | 2 +- .../client/features/field-appends/show-code/Code.interface.ts | 2 +- packages/plugins/@hera/plugin-core/src/client/index.tsx | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/plugins/@hera/plugin-core/src/client/components/code-mirror/index.tsx b/packages/plugins/@hera/plugin-core/src/client/components/code-mirror/index.tsx index 9feb8c8d6..73e1f582d 100644 --- a/packages/plugins/@hera/plugin-core/src/client/components/code-mirror/index.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/components/code-mirror/index.tsx @@ -89,7 +89,7 @@ export const CodeMirror = connect(({ value, onChange, ...otherProps }) => { override: [completionSource], }), ]} - height="200" + height="300px" > ); }); diff --git a/packages/plugins/@hera/plugin-core/src/client/features/field-appends/show-code/Code.interface.ts b/packages/plugins/@hera/plugin-core/src/client/features/field-appends/show-code/Code.interface.ts index 53784a41e..455507339 100644 --- a/packages/plugins/@hera/plugin-core/src/client/features/field-appends/show-code/Code.interface.ts +++ b/packages/plugins/@hera/plugin-core/src/client/features/field-appends/show-code/Code.interface.ts @@ -67,7 +67,7 @@ export class ShowFieldCodeInterface extends CollectionFieldInterface { type: 'string', title: 'JSCode', 'x-decorator': 'FormItem', - 'x-component': 'Input.TextArea', + 'x-component': 'CodeMirror', default: '', required: true, }, diff --git a/packages/plugins/@hera/plugin-core/src/client/index.tsx b/packages/plugins/@hera/plugin-core/src/client/index.tsx index c0fae740e..fbd149f3f 100644 --- a/packages/plugins/@hera/plugin-core/src/client/index.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/index.tsx @@ -13,6 +13,7 @@ import { Expression, SignatureInput, } from './components'; +import { CodeMirror } from './components/code-mirror'; import { PluginAssistant } from './features/assistant'; import { PluginGroupBlock } from './features/block-group'; import { PluginContextMenu } from './features/context-menu'; @@ -143,6 +144,7 @@ export class PluginCoreClient extends Plugin { AssociatedField, AutoComplete, CalcResult, + CodeMirror, CreateSubmitActionInitializer, CustomAssociatedField, CustomComponentDispatcher,