0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-06 23:00:55 -05:00
penpot-exporter-figma-plugin/ui-src/parser/creators/createComponentLibrary.ts

16 lines
453 B
TypeScript
Raw Normal View History

import { PenpotFile } from '@ui/lib/types/penpotFile';
import { ComponentShape } from '@ui/lib/types/shapes/componentShape';
import { components } from '@ui/parser/libraries';
import { createItems } from '.';
export const createComponentLibrary = (file: PenpotFile) => {
components.get().forEach(({ children = [], ...rest }: ComponentShape) => {
file.startComponent(rest);
createItems(file, children);
file.finishComponent();
});
};