2024-04-15 07:09:48 -05:00
|
|
|
import { transformSceneNode } from '@plugin/transformers';
|
2024-04-15 07:06:38 -05:00
|
|
|
|
2024-04-19 02:48:19 -05:00
|
|
|
import { PenpotNode } from '@ui/lib/types/penpotNode';
|
2024-04-15 07:09:48 -05:00
|
|
|
import { Children } from '@ui/lib/types/utils/children';
|
2024-04-15 07:06:38 -05:00
|
|
|
|
|
|
|
export const transformChildren = async (
|
|
|
|
node: ChildrenMixin,
|
|
|
|
baseX: number = 0,
|
|
|
|
baseY: number = 0
|
|
|
|
): Promise<Children> => {
|
|
|
|
return {
|
2024-04-19 02:48:19 -05:00
|
|
|
children: (
|
|
|
|
await Promise.all(node.children.map(child => transformSceneNode(child, baseX, baseY)))
|
|
|
|
).filter((child): child is PenpotNode => !!child)
|
2024-04-15 07:06:38 -05:00
|
|
|
};
|
|
|
|
};
|