0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 05:33:02 -05:00
penpot-exporter-figma-plugin/plugin-src/transformers/transformDocumentNode.ts
Alex Sánchez 303cc833a0
Fix component overrides (#200)
* wip

* wip

* wip

* wip

* wip

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes

* fixes
2024-06-28 12:17:56 +02:00

33 lines
846 B
TypeScript

import { toObject } from '@common/map';
import { componentProperties, 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: toObject(components),
images,
paintStyles,
textStyles,
componentProperties: toObject(componentProperties)
};
};