mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-06 23:00:55 -05:00
16 lines
453 B
TypeScript
16 lines
453 B
TypeScript
|
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();
|
||
|
});
|
||
|
};
|