mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
e8270cfd54
* refactor * fixes * rename libraries * refactor libraries * fixes
30 lines
724 B
TypeScript
30 lines
724 B
TypeScript
import { components } from '@plugin/libraries';
|
|
import {
|
|
processImages,
|
|
processPages,
|
|
processPaintStyles,
|
|
processTextStyles,
|
|
registerPaintStyles,
|
|
registerTextStyles
|
|
} from '@plugin/processors';
|
|
|
|
import { PenpotDocument } from '@ui/types';
|
|
|
|
export const transformDocumentNode = async (node: DocumentNode): Promise<PenpotDocument> => {
|
|
await registerPaintStyles();
|
|
await registerTextStyles();
|
|
|
|
const children = await processPages(node);
|
|
const paintStyles = await processPaintStyles();
|
|
const images = await processImages();
|
|
const textStyles = await processTextStyles();
|
|
|
|
return {
|
|
name: node.name,
|
|
children,
|
|
components: components.all(),
|
|
images,
|
|
paintStyles,
|
|
textStyles
|
|
};
|
|
};
|