0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 13:43:03 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformGroupNode.ts
2024-06-19 07:05:10 +00:00

35 lines
915 B
TypeScript

import {
transformBlend,
transformDimension,
transformEffects,
transformFigmaIds,
transformOverrides,
transformRotationAndPosition,
transformSceneNode
} from '@plugin/transformers/partials';
import { transformChildren } from '@plugin/transformers/partials';
import { GroupShape } from '@ui/lib/types/shapes/groupShape';
export const transformGroupNode = (node: GroupNode): GroupShape => {
return {
...transformFigmaIds(node),
...transformGroupNodeLike(node),
...transformEffects(node),
...transformBlend(node),
...transformChildren(node),
...transformOverrides(node)
};
};
export const transformGroupNodeLike = (
node: BaseNodeMixin & LayoutMixin & SceneNodeMixin
): Omit<GroupShape, 'children'> => {
return {
type: 'group',
name: node.name,
...transformDimension(node),
...transformRotationAndPosition(node),
...transformSceneNode(node)
};
};