Releases: dataliterate/data-populator
v1.7.1: Support for new symbols
Works with the new symbols introduced with Sketch 3.7 as well as "regular" Layer Groups (as usual).
Now the plugin bundle has the correct file name, too.
v1.7.0: Support for new symbols (as introduced with Sketch 3.7)
Works with the new symbols introduced with Sketch 3.7 as well as "regular" Layer Groups (as usual).
v1.6-beta.3: Bug fix
This is a beta release – please check it out and let us know if it works by posting issues. Please don't use this version of Sketch Data Populator for production yet.
Please note: This pre release only works with Sketch 3.7+
Fixes
- Text Substitutes now work in symbols, no crashing anymore (see #58)
- this beta version of the plugin can be used in parallel to the master version (keyboard shortcut overlaps need to be resolved)
Known Issues
- The text layer formating behavior when populating is a bit random, we need to investigate further here (related to issue #54)
v1.6-beta.2: Fixes for new symbols support (Sketch 3.7+)
This is a beta release – please check it out and let us know if it works by posting issues. Please don't use this version of Sketch Data Populator for production yet.
Please note: This pre release only works with Sketch 3.7+
Fixes
- populates shapes in symbols with image (no matter what the Fill type was)
- works with nested symbols
- text truncation works within symbols (if text layer width is set to "Fixed")
- fixed bug when image URL is invalid
Known Issues
- Text Substitutes don't work as expected in symbols (see #58)
v1.6-beta.1: Support for new symbols introduced in Sketch 3.7
This is a beta release – please check it out and let us know if it works by posting issues.
Please note: This release only works with Sketch 3.7
v1.5.1: Sketch 3.5.1 Compatibility
The Sketch Data Populator plugin is now fully compatible with Sketch 3.5.1 (e9fcb00).
Please note: the plugin is not compatible with older versions of Sketch!
Thanks to @RenGate, it is now possible to rename Artboards via Placeholders (#43). @lukasondrej made sure they can also be restored back to the original string containing placeholders (b4e0335).
v1.3.2-beta: Conditional Actions
tl;dr
A data-driven "if this than that" for Sketch Data Populator: triggers in the data lead to actions in Sketch.
About Conditional Actions
a 'conditional action' performs a certain action on a layergroup based on data and a conditional expression. the conditional action is controlled by the name of the layergroup.
a common use case is to delete a layer group if a certain value in the json is true.
- if the name of a layergroup is
delete #if({isVIP})
, data-populator will delete the layer group if the value of the boolean data fieldisVIP
is true
Syntax
ACTION #if(EXPRESSION_TEMPLATE)
the EXPRESSION_TEMPLATE is any javascript statement. Sketch Data Populator will populate the EXPRESSION_TEMPLATE with data, execute the code snippet and then evaluate the result. you can use curly bracket syntax {datafield}
to include data values in the statement. think of mini templates to create javascript expressions that evaluate to true or false.
make sure to wrap strings.
Examples
[{
"isVIP": true,
"name": "John",
"age": 30
}]
#if({isVIP})
#if({age} < 30)
#if("{name}".length < 100)
#if({isVIP} == false && {age} < 30)
Supported Actions
delete, hide, show, lock
#if({isVIP})
(default action) shows the layergroupdelete #if("{name}" == "John")
deletes the entire layergrouphide #if("{name}".length < 5)
hides the layergroupshow #if({age} < 32)
shows the layergrouplock #if({age} < 32)
locks the layergroup
v1.3.1: allow JSON with a single object
Before, JSON objects always needed to be in an array on root level:
[{
"one": "string1",
"two": "string2",
"three": "string3"
}]
Now, if you have only one object in your JSON file, you can get rid of the root level array (we think this is more intuitive if you happen to work with only one object on the root level):
{
"one": "string1",
"two": "string2",
"three": "string3"
}
v1.3.0: dotpath arrays
Sketch Data Populator can now handle JSON arrays properly. The dotpath getter is from now on based on lodash.get.
Example
{
"name": "Frida Precious",
"images": [
"images/01.jpg",
"images/02.jpg"
],
"phone": [
{
"type": "mobile",
"number": "0123456789"
}
]
}
Dotpath Syntax
{{images[0]}}
{{images[1]}}
{phones[0].type}
{phones[0].number}
See #35 (thanks @rockitbaby!)
v1.2.2: ready for Sketch 3.4
- now fully compatible with Sketch 3.4 (#23)
- Added ability to use URLs for referencing images (#33, thanks @m0nkmaster!)
- add triple curly brackets {{{color}}} to support color fill (#27, thanks @JakeLin!)