refactor(sdk): use WidgetNode union in goView converter
This commit is contained in:
parent
01b55b260d
commit
5f67a5bca1
@ -1,11 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
ASTRALVIEW_SCHEMA_VERSION,
|
ASTRALVIEW_SCHEMA_VERSION,
|
||||||
createEmptyScreen,
|
createEmptyScreen,
|
||||||
type ImageWidgetNode,
|
|
||||||
type IframeWidgetNode,
|
|
||||||
type Screen,
|
type Screen,
|
||||||
type TextWidgetNode,
|
type WidgetNode,
|
||||||
type VideoWidgetNode,
|
|
||||||
} from '../schema';
|
} from '../schema';
|
||||||
import { convertGoViewImageOptionToNodeProps, type GoViewImageOption } from '../widgets/image';
|
import { convertGoViewImageOptionToNodeProps, type GoViewImageOption } from '../widgets/image';
|
||||||
import { convertGoViewIframeOptionToNodeProps, type GoViewIframeOption } from '../widgets/iframe';
|
import { convertGoViewIframeOptionToNodeProps, type GoViewIframeOption } from '../widgets/iframe';
|
||||||
@ -654,7 +651,7 @@ export function convertGoViewProjectToScreen(input: GoViewProjectLike | GoViewSt
|
|||||||
[];
|
[];
|
||||||
const componentList = Array.isArray(componentListRaw) ? componentListRaw : [];
|
const componentList = Array.isArray(componentListRaw) ? componentListRaw : [];
|
||||||
|
|
||||||
const nodes: Array<TextWidgetNode | ImageWidgetNode | IframeWidgetNode | VideoWidgetNode> = [];
|
const nodes: WidgetNode[] = [];
|
||||||
|
|
||||||
for (const raw of componentList) {
|
for (const raw of componentList) {
|
||||||
if (!raw || typeof raw !== 'object') continue;
|
if (!raw || typeof raw !== 'object') continue;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user