diff --git a/packages/libro-prompt-cell/src/code-block.tsx b/packages/libro-prompt-cell/src/code-block.tsx index 46d66e60..508bc627 100644 --- a/packages/libro-prompt-cell/src/code-block.tsx +++ b/packages/libro-prompt-cell/src/code-block.tsx @@ -2,6 +2,7 @@ import { CopyOutlined, EditOutlined } from '@ant-design/icons'; import type { DisplayDataOutputModel } from '@difizen/libro-jupyter'; import { copy2clipboard } from '@difizen/libro-jupyter'; import { useInject, ViewInstance } from '@difizen/mana-app'; +import { Collapse } from 'antd'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { LibroPromptCellView } from './prompt-cell-view.js'; @@ -61,29 +62,44 @@ export const InterpreterCodeBlock = (props: any) => { const [, lang] = /language-(\w+)/.exec(className || '') || []; return ( -
- {cell.model.interpreterEnabled && ( -+{ - cell.interpreterEditMode = true; - if (cell.model.interpreterCode) { - replace(cell.model.interpreterCode); - } - }} - > -- )} -代码编辑-- - {typeof children === 'string' ? children.trim() : children} - -
+ { ++{ + cell.interpreterEditMode = true; + if (cell.model.interpreterCode) { + replace(cell.model.interpreterCode); + } + }} + > ++ } +代码编辑++ + {typeof children === 'string' ? children.trim() : children} + +