接通图片预览地址到组件检查器

将 UI 编辑会话的 previewUrls 沿节点检查器传递到图片组件面板。
This commit is contained in:
2026-09-03 13:46:57 +08:00
parent df8b22f71f
commit bc55e524ba
3 changed files with 7 additions and 0 deletions
@@ -293,6 +293,7 @@ function renderComponentEditor(
<ImagePanel
component={component.Image}
sprites={props.sprites}
previewUrls={props.previewUrls}
readOnly={readOnly}
onChange={(next) => updateComponent(index, { Image: next })}
/>
@@ -9,6 +9,7 @@ import type { UiEditorOperationResult } from '../../../../../features/ui-editor/
export type ComponentPanelProps = {
components: Component[];
sprites: Record<string, SpriteAsset>;
previewUrls: Record<string, string>;
fonts: Record<string, FontAsset>;
fontFaces: Record<string, UiEditorFontFaceState>;
projectPath: string;
@@ -35,6 +36,7 @@ export type ComponentEditorProps<T> = {
export type ImageEditorProps = ComponentEditorProps<ImageComponent> & {
sprites: Record<string, SpriteAsset>;
previewUrls: Record<string, string>;
};
export type TextEditorProps = ComponentEditorProps<TextComponent> & {
@@ -111,6 +111,7 @@ export function InspectorSidebar({
onTransformChange={inspector.setNodeTransform}
onLayoutChange={inspector.setNodeLayout}
sprites={inspector.sprites}
previewUrls={inspector.previewUrls}
fonts={inspector.fonts}
fontFaces={inspector.fontFaces}
projectPath={inspector.projectPath}
@@ -288,6 +289,7 @@ function NodeInspector({
onTransformChange,
onLayoutChange,
sprites,
previewUrls,
fonts,
fontFaces,
projectPath,
@@ -317,6 +319,7 @@ function NodeInspector({
onTransformChange: UiEditorInspectorProjection['setNodeTransform'];
onLayoutChange: UiEditorInspectorProjection['setNodeLayout'];
sprites: UiEditorInspectorProjection['sprites'];
previewUrls: UiEditorInspectorProjection['previewUrls'];
fonts: UiEditorInspectorProjection['fonts'];
fontFaces: UiEditorInspectorProjection['fontFaces'];
projectPath: string;
@@ -497,6 +500,7 @@ function NodeInspector({
<ComponentPanel
components={node.components}
sprites={sprites}
previewUrls={previewUrls}
fonts={fonts}
fontFaces={fontFaces}
projectPath={projectPath}