import { type ReactNode, useDeferredValue, useEffect, useMemo, useRef, useState, } from 'react'; import { getCustomWorldSceneRelativePositionLabel } from '../data/customWorldSceneGraph'; import { normalizeCustomWorldCreatorIntent } from '../services/customWorldCreatorIntent'; import { buildCustomWorldFoundationEntries, parseFoundationTagText, } from '../services/customWorldFoundationEntries'; import { buildCustomWorldScenePresentations } from '../services/customWorldScenePresentation'; import { AnimationState, type Character, type CustomWorldProfile, type SceneActBlueprint, type SceneChapterBlueprint, } from '../types'; import { CharacterAnimator } from './CharacterAnimator'; import { CustomWorldNpcPortrait } from './CustomWorldNpcVisualEditor'; import { ResolvedAssetImage } from './ResolvedAssetImage'; import type { RpgCreationEditorTarget } from './rpg-creation-editor/RpgCreationEntityEditorModal'; export type ResultTab = 'world' | 'playable' | 'story' | 'landmarks'; type PendingGeneratedEntity = { id: string; kind: 'playable' | 'story' | 'landmark'; title: string; progress: number; phaseLabel: string; }; type RecentGeneratedIds = Record<'playable' | 'story' | 'landmark', string[]>; interface CustomWorldEntityCatalogProps { profile: CustomWorldProfile; previewCharacters: Character[]; activeTab: ResultTab; onActiveTabChange: (tab: ResultTab) => void; onEditTarget: (target: RpgCreationEditorTarget) => void; onProfileChange: (profile: CustomWorldProfile) => void; onDeleteStoryNpcs?: (ids: string[]) => void; onDeleteLandmarks?: (ids: string[]) => void; createActionLabel?: string; onCreateAction?: () => void; createActionDisabled?: boolean; pendingGeneratedEntity?: PendingGeneratedEntity | null; recentGeneratedIds?: RecentGeneratedIds; readOnly?: boolean; } const RESULT_TABS: Array<{ id: ResultTab; label: string }> = [ { id: 'world', label: '世界' }, { id: 'landmarks', label: '场景' }, { id: 'playable', label: '可扮演角色' }, { id: 'story', label: '场景角色' }, ]; function Section({ title, subtitle, badge, actions, children, }: { title: string; subtitle?: string; badge?: ReactNode; actions?: ReactNode; children: ReactNode; }) { return (
{profile.summary}