feat: 更新 CodeEditor 组件,重构为懒加载并添加 CodeEditorImpl,优化导入路径
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { ScrollArea } from '@/components/ui/scroll-area'
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import { CodeEditor } from '@/components'
|
||||
import { CodeEditor } from '@/components/CodeEditor'
|
||||
import { DynamicConfigForm } from '@/components/dynamic-form'
|
||||
import { RestartOverlay } from '@/components/restart-overlay'
|
||||
import { useToast } from '@/hooks/use-toast'
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'
|
||||
import { ListFieldEditor } from '@/components/ListFieldEditor'
|
||||
import { Alert, AlertDescription } from '@/components/ui/alert'
|
||||
import { CodeEditor } from '@/components'
|
||||
import { CodeEditor } from '@/components/CodeEditor'
|
||||
import { parse as parseToml } from 'smol-toml'
|
||||
import {
|
||||
Select,
|
||||
|
||||
@@ -37,8 +37,8 @@ import {
|
||||
type GitStatus,
|
||||
type MaimaiVersion,
|
||||
} from '@/lib/plugin-api'
|
||||
import { MarkdownRenderer } from '@/components/markdown-renderer'
|
||||
import { PluginStats } from '@/components/plugin-stats'
|
||||
import { MarkdownRenderer } from '@/components'
|
||||
import { recordPluginDownload } from '@/lib/plugin-stats'
|
||||
|
||||
// 分类名称映射
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
Upload,
|
||||
} from 'lucide-react'
|
||||
|
||||
import { CodeEditor } from '@/components'
|
||||
import { CodeEditor } from '@/components/CodeEditor'
|
||||
import { MemoryDeleteDialog } from '@/components/memory/MemoryDeleteDialog'
|
||||
import { MemoryConfigEditor } from '@/components/memory/MemoryConfigEditor'
|
||||
import { Alert, AlertDescription } from '@/components/ui/alert'
|
||||
|
||||
@@ -171,10 +171,14 @@ export function NodeDetailDialog({
|
||||
</Button>
|
||||
{onDeleteEntity ? (
|
||||
<div className="flex flex-col items-end gap-2 rounded-lg border bg-background p-3">
|
||||
<label className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<Checkbox checked={includeParagraphs} onCheckedChange={(checked) => setIncludeParagraphs(Boolean(checked))} />
|
||||
删除该实体相关证据段落
|
||||
</label>
|
||||
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<Checkbox
|
||||
checked={includeParagraphs}
|
||||
onCheckedChange={(checked) => setIncludeParagraphs(Boolean(checked))}
|
||||
aria-label="删除该实体相关证据段落"
|
||||
/>
|
||||
<span>删除该实体相关证据段落</span>
|
||||
</div>
|
||||
<Button variant="outline" onClick={() => onDeleteEntity({ includeParagraphs })}>
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
删除实体
|
||||
@@ -280,10 +284,14 @@ export function EdgeDetailDialog({
|
||||
</Button>
|
||||
{onDeleteEdgeGroup ? (
|
||||
<div className="flex flex-col items-end gap-2 rounded-lg border bg-background p-3">
|
||||
<label className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<Checkbox checked={includeParagraphs} onCheckedChange={(checked) => setIncludeParagraphs(Boolean(checked))} />
|
||||
同时删除支撑段落
|
||||
</label>
|
||||
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<Checkbox
|
||||
checked={includeParagraphs}
|
||||
onCheckedChange={(checked) => setIncludeParagraphs(Boolean(checked))}
|
||||
aria-label="同时删除支撑段落"
|
||||
/>
|
||||
<span>同时删除支撑段落</span>
|
||||
</div>
|
||||
<Button variant="outline" onClick={() => onDeleteEdgeGroup({ includeParagraphs })}>
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
删除此关系组
|
||||
@@ -371,10 +379,14 @@ export function RelationDetailDialog({
|
||||
|
||||
{onDeleteRelation ? (
|
||||
<div className="rounded-lg border bg-background p-3">
|
||||
<label className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<Checkbox checked={includeParagraphs} onCheckedChange={(checked) => setIncludeParagraphs(Boolean(checked))} />
|
||||
同时删除支撑该关系的段落
|
||||
</label>
|
||||
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||
<Checkbox
|
||||
checked={includeParagraphs}
|
||||
onCheckedChange={(checked) => setIncludeParagraphs(Boolean(checked))}
|
||||
aria-label="同时删除支撑该关系的段落"
|
||||
/>
|
||||
<span>同时删除支撑该关系的段落</span>
|
||||
</div>
|
||||
<Button className="mt-3" variant="outline" onClick={() => onDeleteRelation(relation, includeParagraphs)}>
|
||||
<Trash2 className="mr-2 h-4 w-4" />
|
||||
删除这条关系
|
||||
|
||||
Reference in New Issue
Block a user