Fix INT: ContentSlider Slides editor wrote wrong prop key (image vs imageSrc)
MediaStylePanel's Slides array editor guarded on item.image !== undefined and wrote `image` via AssetPicker's onChange, but ContentSlider (render + toHtml) reads slide.imageSrc. Default slides (imageSrc:'', no `image` key) never showed an image picker at all, and any `image` value written was a silent no-op on render/export. Editor now guards/reads/writes `imageSrc` throughout, and the "add slide" emptyItem matches defaultSlides' exact shape (type/imageSrc/heading/text/bgColor). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -145,14 +145,14 @@ export const MediaStylePanel: React.FC<StylePanelProps> = ({ selectedId, nodePro
|
||||
});
|
||||
}} placeholder="Text" rows={2} style={{ ...smallInputStyle, resize: 'vertical' }} />
|
||||
)}
|
||||
{item.image !== undefined && (
|
||||
{item.imageSrc !== undefined && (
|
||||
<AssetPicker
|
||||
variant="compact"
|
||||
value={item.image || ''}
|
||||
value={item.imageSrc || ''}
|
||||
onChange={(url) => {
|
||||
actions.setProp(selectedId, (props: any) => {
|
||||
const updated = [...(props.slides || [])];
|
||||
updated[index] = { ...updated[index], image: url };
|
||||
updated[index] = { ...updated[index], imageSrc: url };
|
||||
props.slides = updated;
|
||||
});
|
||||
}}
|
||||
@@ -160,7 +160,7 @@ export const MediaStylePanel: React.FC<StylePanelProps> = ({ selectedId, nodePro
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
emptyItem={{ heading: 'New Slide', text: '', image: '' }}
|
||||
emptyItem={{ type: 'image', imageSrc: '', heading: 'New Slide', text: '', bgColor: '' }}
|
||||
/>
|
||||
</CollapsibleSection>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user