@presenta/figma2pjson
v1.0.35
Published
Figma to Presenta converter
Downloads
54
Readme
Figma Document to PRESENTA JSON converter
Features:
- Texts will be converted as Editable Text Block in PRESENTA, styles will be preserved
- Images will be converted as Editable Image Block in PRESENTA with a placeholder source
- All the graphics/paths will be rendered as Svg Block in PRESENTA
- Frame background color is added as Svg Block
- Masks are supported
- Locked Elements in FIGMA will hide the API Param Preview in FrameAPI Panel
Limitations:
- Only the first PAGE is considered for the conversion
- Only FRAMEs will be parsed
- The first FRAME size will define the document size in PRESENTA, other Figma frames will inherit the first frame size in PRESENTA
- GROUPs will be rendered as SVG, no matter what they contain (this can be exploited, i.e. text as path or image embeded)
- Editable TEXTs need to be in the FRAME root in order to remain editable in PRESENTA
- Editable IMAGEs need to be in the FRAME root in order to remain editable in PRESENTA
- Images from FIGMA will be used from their CDN. They might expire though after a while.
- Custom or local fonts are not converted. You can add it in PRESENTA though.
This function accepts a data config and a template config and return a merged version useful to create a PRESENTA Lib document.
Usage
import { interpolate } from '@presenta/config-interpolator
const data = {
myText: 'Hello'
}
const templateConfig = {
scenes:[{
blocks:[{
type: 'text',
ukey: 'myText',
content: ''
}]
}]
}
const config = await interpolate(data, templateConfig)
/*
const data = {
myText: 'Hello'
}
const templateConfig = {
scenes:[{
blocks:[{
type: 'text',
ukey: 'myText',
content: 'Hello'
}]
}]
}
*/