mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-03 05:10:13 -05:00
7b3192936e
* wip * wip * wipo * more structure * wip * id library wip * wip * main instance working * improvements * fix node order * refactor * remove not used method * refactor * fix component set translation * refactor * add changelog * penpot lib update --------- Co-authored-by: Jordi Sala Morales <jordism91@gmail.com>
24 lines
638 B
TypeScript
24 lines
638 B
TypeScript
import { componentsLibrary } from '@plugin/ComponentLibrary';
|
|
|
|
import { createFile } from '@ui/lib/penpot';
|
|
import { createComponentLibrary, createPage } from '@ui/parser/creators';
|
|
import { uiComponents } from '@ui/parser/libraries/UiComponents';
|
|
import { PenpotDocument } from '@ui/types';
|
|
|
|
import { idLibrary } from '.';
|
|
|
|
export const parse = ({ name, children = [], components }: PenpotDocument) => {
|
|
componentsLibrary.init(components);
|
|
uiComponents.init();
|
|
idLibrary.init();
|
|
|
|
const file = createFile(name);
|
|
|
|
for (const page of children) {
|
|
createPage(file, page);
|
|
}
|
|
|
|
createComponentLibrary(file);
|
|
|
|
return file;
|
|
};
|