2024-05-31 04:25:32 -05:00
|
|
|
import { translateChildren } from '@plugin/translators';
|
2024-05-13 10:04:13 -05:00
|
|
|
import { translatePageFill } from '@plugin/translators/fills';
|
2024-04-12 09:52:36 -05:00
|
|
|
|
2024-04-15 07:06:38 -05:00
|
|
|
import { PenpotPage } from '@ui/lib/types/penpotPage';
|
2024-04-12 06:55:42 -05:00
|
|
|
|
|
|
|
export const transformPageNode = async (node: PageNode): Promise<PenpotPage> => {
|
|
|
|
return {
|
|
|
|
name: node.name,
|
2024-04-22 03:52:25 -05:00
|
|
|
options: {
|
|
|
|
background: node.backgrounds.length ? translatePageFill(node.backgrounds[0]) : undefined
|
|
|
|
},
|
2024-05-31 04:25:32 -05:00
|
|
|
children: await translateChildren(node.children)
|
2024-04-12 06:55:42 -05:00
|
|
|
};
|
|
|
|
};
|