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