Comments (7)
Ok great. Hopefully they expose the ability to set this in the API. I will take a look this weekend. If it's possible to fix, it should be done in a few days.
from sketch-data-faker.
Thanks for reporting this. I haven't tested with layers from external libraries, so you may be right that it's a bug in Sketch Data Faker
. I'll take a look.
Can you tell me one thing though - have you used regular "Sketch Data" on a layer imported from a Library? And does that work? So, if you do exactly the same thing you tried with Sketch Data Faker
, but instead you choose "Data -> Sketch Data -> Names" - will that work on the same layer that Sketch Data Faker
is not?
Thanks!
from sketch-data-faker.
Yes, I tested this.
- Other ‘Sketch Data’ does work as expected when overriding library symbol instances.
- Manual (not name based) ‘Faker Data’ overrides work neither.
from sketch-data-faker.
Hi @timohofmeijer - a quick update.
I did some debugging this weekend and recreated your issue. Two things I learned:
-
Sketch Data Faker
is not finding the layer correctly, when the layer is a from alibrary
. I do a check here https://github.com/paintedbicycle/sketch-data-faker/blob/master/src/faker.js#L25 that currently retrieves the layer by looking up the id of either a normal layer, or, in the case of a symbol, it uses the symbol override instead. It looks like I need to add yet another check here forlibrary instances
, passing the correct id. I thought it would already be taken care of, but apparently not. I'll have to research a little more to get this working. -
One potential issue I see going forward is with
Automatic Mode
which requires changing the layer name. I'm not certain you can rename layers insidelibraries
that you've imported. Do you know if that's true (in general with Sketch) or are layer names locked and you need to detach from the library before you can rename them?
So I can likely get Manual Mode
(the one with quick overrides) working, but it might be harder to get the full automatic mode working unless the Sketch user has the ability to edit the names of the original library layer. I'll definitely want to get this working with libraries, so it might mean a much larger plugin rewrite. Anyway, more research needs to be done...perhaps I can indeed change the layer name programatically. Just not sure yet.
I'll keep going on this next weekend.
from sketch-data-faker.
Hi Paul, grateful for your efforts! One could of course rename layers in a self managed library. With an external library (e.g. iOS) this would require a fork and is likely not desirable. I personally would prefer applying data manually even though I manage the library myself. I could fork and have a look at the code this weekend, if you could let me know if you are not already on this, so we don't spend duplicate time : )
from sketch-data-faker.
@timohofmeijer Just pushed a version live for testing. You should now be able to override the text in a library layer using Manual mode.
Automatic mode works too, but it sets the layer name on the parent. This is the only editable layer name and actually happens automatically. However, since the layer that gets the new content is only the layer that is selected, it updates the correct layer with the text.
I'll have to investigate more, but let me know what you think
from sketch-data-faker.
Hi @timohofmeijer I broke Library symbol overrides in a previous release, sorry about that. It is now fixed with 0.7.0. If you're still using it, I'd love to hear if it worked for you.
Thanks!
from sketch-data-faker.
Related Issues (15)
- Auto feature (renaming layer) doesn't work with Symbols HOT 2
- Add image support HOT 1
- Provide "Matching Data". i.e. add objects/grouped data
- List all Faker options HOT 6
- Localization support HOT 4
- Add localised data formatting HOT 3
- Add support for default locale HOT 2
- Auto feature (renaming layer) doesn't work with Symbols HOT 7
- Doesn't seem to work on Sketch 57.1 HOT 3
- Replace text using content instead of layer name HOT 3
- parameter option for count of words/sentences/paragraphs
- Customize manual options in the sketch data menu HOT 1
- Concatenate Multiple Data HOT 3
- Where is the data coming from?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sketch-data-faker.