fix(sdk): prefer option payload for goView iframe/video detection
This commit is contained in:
parent
b667b02b79
commit
1d2a712f70
@ -459,23 +459,29 @@ export function convertGoViewProjectToScreen(input: GoViewProjectLike | GoViewSt
|
|||||||
// Prefer evidence from the option payload over the widget key.
|
// Prefer evidence from the option payload over the widget key.
|
||||||
// Some goView/fork widgets mislabel embedded platforms (YouTube/Vimeo/etc) as "Video" even
|
// Some goView/fork widgets mislabel embedded platforms (YouTube/Vimeo/etc) as "Video" even
|
||||||
// though they are best represented as an iframe.
|
// though they are best represented as an iframe.
|
||||||
|
const optionSaysImage = looksLikeImageOption(option);
|
||||||
const optionSaysVideo = looksLikeVideoOption(option);
|
const optionSaysVideo = looksLikeVideoOption(option);
|
||||||
const optionSaysIframe = looksLikeIframeOption(option);
|
const optionSaysIframe = looksLikeIframeOption(option);
|
||||||
|
|
||||||
|
// Prefer evidence from the option payload over the widget key.
|
||||||
|
// Many forks mislabel widget keys (e.g. "Text*" / "Image*"), but the option payload
|
||||||
|
// clearly indicates iframe/video/image.
|
||||||
const inferredType: 'text' | 'image' | 'iframe' | 'video' | undefined =
|
const inferredType: 'text' | 'image' | 'iframe' | 'video' | undefined =
|
||||||
isImage(c) || looksLikeImageOption(option)
|
optionSaysIframe
|
||||||
? 'image'
|
? 'iframe'
|
||||||
: optionSaysIframe
|
: optionSaysVideo
|
||||||
? 'iframe'
|
? 'video'
|
||||||
: optionSaysVideo
|
: optionSaysImage
|
||||||
? 'video'
|
? 'image'
|
||||||
: isIframe(c)
|
: isIframe(c)
|
||||||
? 'iframe'
|
? 'iframe'
|
||||||
: isVideo(c)
|
: isVideo(c)
|
||||||
? 'video'
|
? 'video'
|
||||||
: isTextCommon(c)
|
: isImage(c)
|
||||||
? 'text'
|
? 'image'
|
||||||
: undefined;
|
: isTextCommon(c)
|
||||||
|
? 'text'
|
||||||
|
: undefined;
|
||||||
|
|
||||||
const defaults =
|
const defaults =
|
||||||
inferredType === 'text'
|
inferredType === 'text'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user