0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-01-05 06:10:52 -05:00
penpot-exporter-figma-plugin/ui-src/converters/createPenpotText.ts

13 lines
430 B
TypeScript
Raw Normal View History

import { PenpotFile } from '@ui/lib/penpot';
import { TEXT_TYPE } from '@ui/lib/types/text/textAttributes';
import { TextShape } from '@ui/lib/types/text/textShape';
2024-04-16 04:24:53 -05:00
import { translateUiBlendMode } from '@ui/translators';
2024-04-08 10:50:01 -05:00
2024-04-16 04:24:53 -05:00
export const createPenpotText = (file: PenpotFile, { type, blendMode, ...rest }: TextShape) => {
file.createText({
type: TEXT_TYPE,
2024-04-16 04:24:53 -05:00
blendMode: translateUiBlendMode(blendMode),
...rest
2024-04-08 10:50:01 -05:00
});
};