GithubHelp home page GithubHelp logo

dwilliames / paddy-sketch-plugin Goto Github PK

View Code? Open in Web Editor NEW
2.2K 61.0 67.0 46.4 MB

Automated padding, spacing and alignment for your Sketch layers

License: MIT License

JavaScript 100.00%
sketch sketch-plugin cocoascript sketchapp design-tools

paddy-sketch-plugin's People

Contributors

d4rekanguok avatar dwilliames avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

paddy-sketch-plugin's Issues

[BUG] Can't select Paddy layer group

Bug report

Actual behavior:

When i try to select the Paddy layer group from the artboard (not from layer list) it selects it for a one second and then deselects it.

Problem occurs when Paddy group is nested inside another group.

screenflow

Paddy version: 1.0.4
Sketch version: 48.2

Resizes abruptly with Anima's Stack in Symbols

Hey David, as mentioned on Facebook, I'm capturing the issue that I ran into when I was trying to create a modal/dialogue box.

This happens when I combine a paddy button with anima stack and it basically behaves very abruptly upon interacting with it.

I've attached a screen capture of the issue here and attaching the sketch file I have setup without paddy. sketch file and screen recording.zip

I don't know if this is related but sounds like the width may be linked. #12

[enhancement] Auto-fill padding from selection

As the title says, it would be pretty nice to not have to measure and enter paddings manually, and instead they should be taken from the current selection. Then you wouldn't necessarily have to show the popup either

padding symbol support

actually it doesn't support at all. it takes so much time when inputing padding while symbol is implemented anywhere.

Symbols in Symbols do not work (

It would be great if i could put resizable button in another symbol and then change text in overrides.

symbol «molecule»    //atom do not resize 
   symbol «atom»        //resizable button, resizing work
     text
     symbol «bg» [10 10]

Updated to 1.0.3 and now getting odd alert from Sketch

I updated to latest version of this plugin this morning, and I keep getting a loop alert from Sketch, "Choose at least one layer to duplicate", even though I am not trying to duplicate anything. Sketch version 48.2, Mac OS Sierra. Nothing else has changed in my Sketch set up since last night.

[Bug] Stopped working after the update

Не работает на символы. Пропала автоматика. Работает только «Enter padding fo selection» на обычных элементах.

=====

Does not work for characters. Automation was lost. Only "Enter padding fo selection" works on ordinary elements.

Video

Wonder if it's possible to 'force' same widths?

Firstly, I love this plugin! Im just having a ply and trying to set up a master wireframe document. However I've run into a problem… In the image below, when I resize it or change the text, sometimes the image background on the top will be smaller or bigger than the text box below?

Any ideas how I can get around this?

screen shot 2018-02-06 at 10 44 23

And here is how I have it all set up…

screen shot 2018-02-06 at 10 46 47

spacing shortcut + auto update on nested groups (not symbols)

Hi, So I can't get the spacing shortcut to ever work (control+alt+command+p), other shortcut works fine as does manually adding spacing parameters to groups. Tried removing other plugins, tried in the sketch beta, just never works. I'm in sketch 48.2 on a MacBook Pro with touch bar + High Sierra 10.13.3.

The main problem, and I'm not sure if its an issue or not, but nested groups don't update unless you select something lower down in the the group hierarchy first. Is this the intended behaviour? as it seems to work by bubbling up from what was last selected? Or should it actually update everything when you click outside (which is what I thought it was supposed to do).

video here: https://www.dropbox.com/s/ngla2oojb1eee8a/paddy%20test.mov?dl=0

sketch file here: https://www.dropbox.com/s/a1y9wtn3a7khs5i/paddy%20new%20test.sketch?dl=0

Just wondering if this is a bug or not :)

Thanks!

[Bug] Symbol Text Doesn't Respect Stacking When Overidden

If you override a symbol's text that has vertical spacing set, I would expect it to push up or down once the text length changes. Below, I have an example of a symbol that has a stacked set of copy. If you change the middle block, it does not push down the third text element when it moves from being one line to many.

screen shot 2018-02-26 at 11 02 09 am

Nested Symbols support

Hi,
I have a button as a symbol with with padding on it. I have another symbol with multiple buttons on it. If I try to override the text, it doesn't get updated.

Button Symbol
screen shot 2018-02-05 at 6 03 33 pm

Card Symbol
screen shot 2018-02-05 at 6 03 54 pm

Symbol in use
screen shot 2018-02-05 at 6 06 51 pm

Thanks

[Enhancement] Values as variables

Have a central spot to host values as variables. This way, if you want to change the value of spacing, you could do it in one spot; rather than tediously changing all occurrences through your document.

For example:

  • small = 8
  • medium = 16
  • large = 32

Then using them with the variables, instead of [8 16], it would [small medium]

That way, changing the value of medium to be '20'; simply change it in the centralised place.

[BUG] Text Box WIDTH in Symbols Is Not Respected - Autoresizes Arbitrarily

In Sketch, when adding text to our artboard we can create either free text layers (by clicking with the text tool), or text boxes (by dragging instead of clicking). The difference between the two types of layers is:

  • free text layers will extend horizontally automatically when text is added, and will auto-shrink when text is removed. If you want new lines in your text you must add them manually. Free text layers have their "Alignment" in the Type Inspector set to "Auto":

screen shot 2018-02-10 at 8 44 37 pm

  • text boxes have a set width: as you add text, the text will auto-wrap to the width of the box, and new lines are added automatically. Text boxes have their "Alignment" in the Type Inspector set to "Fixed":

screen shot 2018-02-10 at 8 44 13 pm

It seems, however, that when we have a text box (with fixed alignment) inside a SYMBOL, Paddy does not respect the set width of the box, and automatically resizes all text boxes HORIZONTALLY to fit the text, as if they were free text layers (with auto alignment). This is not the native behaviour, and gives somewhat confusing results.

To make matters worse, when we add extensive text to a symbol, Paddy seems to resize the symbol arbitrarily. I setup a simple group with 1 background rectangle (with 30px padding), and 1 text box (200px wide). So the entire symbol is supposed to be 260px. I can set it up, and define the symbol without any issues. But when I place the symbol back on the page, it autoresizes it down (because it is autoresizing the text box just wide enough to fit the default text, which is small. If I add a paragraph of text with 2 or 3 lines, it resizes the box to about 410px, and I get 2 lines of text. If I add very extensive text - line, 20 lines - it resizes the box to over 2000px.

Although we can use Paddy's width settings to manually set min/max/default widths, and try to limit this autoresizing, this seems cumbersome, and not what is expected by default.

[Bug] Automatic padding/alignment doesn't work.

Basically what the title says. Automatic padding with a shape doesn't work, automatic alignment and spacing either. Only thing that works is with a shape and text layer (a button, for instance). I've attached a sketch file and a video.

Thanks!

paddy-bugs.zip

Issue with Undo (Cmd + Z)

Bug report

Expected behavior:

  1. Draw a rectangle

  2. Click anywhere outside to unselect the layer.

  3. Press Cmd + Z for undo.

  4. The rectangle should have been removed as that was the last step.

Actual behavior:

The rectangle first gets selected, then on a subsequent press of Cmd + Z again, the rectangle is removed.

Can someone else also verify? I noticed this bug today - it was there before the Sketch v49 update also.

I can say that this happens only if I have Paddy plugin enabled. I have checked by removing all others.

Thanks,
Sankalp

[Bug] Centered "Fixed" text within Symbol resizing to custom width

Previously I've been using an Alignment Fixed text layer within buttons and the Resize settings set to scale with the button so that on resize in layout it's easy to set button width by detecting at which point the text wraps. i.e. the Fixed alignment combined with Resize rules helps maintain padding when a user doesn't have the plugin.

After the update the button symbol can no longer change width to account for a longer label, only height. Setting the text to Alignment Auto seems to fix this, but then other users without the plugin lose the ability to size accordingly. The previous version seemed to handle this case correctly.

screen shot 2018-02-13 at 11 32 34 am

screen shot 2018-02-13 at 11 35 45 am

[Bug] Using [x] parameter impacting symbol size

Bug report

Expected behavior:

The x parameter should not impact the padding for edges it is not applied to.

Actual behavior:

Using the x to ignore padding on certain edges is causing other padding to not work. For example, I have a button with padding [10 x 11] for a button with a 40px height on the symbol page. When using the symbol in layout the height changes to 37px. Using an integer instead of x maintains the button height at 40px. I have also tried [10 x 11 x] and the same height change happens. You can see in the screenshots that the button appears to be getting cropped on the lower portion.

screen shot 2018-02-28 at 12 19 56 pm

screen shot 2018-02-28 at 12 20 25 pm

Steps to reproduce:

See above. (Tried to attach Sketch file, but got a "We don't support that file type." error message.

[Bug] Misalignment on centered text (for symbols)

I created a simple button made of a rounded rectangle and a longish text. Then made that a symbol.

When I override the text, below a certain length the text is not properly centered. If I don't make it a symbol it works fine

image

[Bug] 'Undo' not working correctly

Bug report: History or cmd-z affected

Expected behavior: When using cmd-z it should go back 1 step in history when moving and deselecting objects.

Actual behavior: Once a box is moved and deselected few times to go back (cmd-z) takes many times, way more than the steps I've previously taken. This also affects cmd-shift-z to move forward in history.

(Please include a screenshot or screen recording if possible)
Unzip, it's a video
paddy bug.zip

Steps to reproduce: Move a box > deselect > wait few seconds > tap cmd-z > nothing happens

(Please attach a Sketch file if possible)
It will happen on a fresh file of sketch 48.2

Paddy interferes with ENTER shortcut to open groups

Bug report

Expected behavior:

Selecting a layer group and then hitting Enter opens the layer group in the layer panel.

Actual behavior:

Selecting a layer group that includes a layer with padding added and hitting Enter doesn't open the group.

Steps to reproduce:

  1. Add information for Paddy to a layer name
  2. Group it
  3. Select the group
  4. Hit Enter

[Bug] Padding Breaks When Detaching Overriden Symbol, & When Using Craft Sync Plugin for Invision

It seems that there is an issue with padding that I've noticed due to my use of Craft.

I noticed that whenever I sync and check the inspect tool in Invision, my overriden button symbols looks something like this:
screen shot 2018-02-16 at 10 27 46 am
This is what the structure looks like for the original symbol:

screen shot 2018-02-16 at 10 40 53 am screen shot 2018-02-16 at 10 50 50 am

I've noticed that when I sync to Invision the button seems to move and you can briefly see the issue occuring. The symbol has not been detached, just overriden, and is still a symbol after the sync has completed:

giphy

In my effort to try and track the issue down, I've noticed that this happens even without trying to use the craft plugin, if I ever detach an overriden button symbol which has paddy applied:

screen shot 2018-02-16 at 10 34 07 am

Not sure if the issue is with how I'm setting up the original symbol with "Auto" Alignment, or if any of the other parameters that are set on the text/button background are incorrect, but I wanted to report what was happening in case that this isn't an issue with my workflow.

Otherwise, love this plugin so far! It's been a crazy time saver for keeping consistency across projects.

Thanks!
-Danny

[Enhancement] User interface in inspector panel

It would be great to give users the option of displaying padding/spacing details within Sketch's right inspector panel. Similar to how 'resizing is displayed'.

Then, optionally, user's could 'turn off' the values in the layer names.
Sometimes it's helpful to view the values within the layers names in the layer list, to quickly glance at. Sometimes, it is unnecessary, and makes it cluttered.

Middle align keeps jumping

When I have a group with middle applied and lose focus after moving it, it then jumps up. Really annoying and weird. Insanely awesome plugin btw.

feb-07-2018 11-10-50

Please select at least one layer to duplicate. Error Box

When I used Paddy after I clicked off the artboard or selected another element I get an error box that says "Please select at least one layer to duplicate." with an OK button. If I disable the Paddy plugin everything works fine.
screen shot 2018-02-17 at 1 28 10 pm

Sketch 48.2

Plugins
Runner
Abstract
Brand.ai
Midnight
Rename It
Sketch Guides
Sketch Measure
Craft
Zeplin

Issue on group positioning

Various sized layer group's Y position was nudged -6px on every 'automatic spacing update' when using the 'middle' expression.

btw, it would be very handy if there is a way to fix the group's position, that way we don't have to manually put it back where it was when rearranging its sub-layers 😄

You are doing an incredibly good job at making a lean and to the point plugin, I have my Anima auto layout uninstalled the first minute I put my hands on this one, Anima is getting way puffier than it should and losing its primary focus. Big thumb up for paddy👍🏻 keep up the good work mate!

macOS 10.13.2 (17C88)
Sketch 48.2 (47327)

[Enhancement] Layers/groups that contain [] as part of their name don’t get Paddy'd

"layername[0] [8 4]" or "groupname[1] [8v]" won’t get matched.

Maybe your RegExp should be changed from

/\[(.*)\]/g (match anything between the first [ and last ], which grabs 0] [8 4 and 1] [8v in my examples, respectively)

to something like

/\[([^]]+)\]$/g (match only characters between the [ and ] at the end of the string, which would get 8 4 and 8v in my examples).

Middle issue still

@DWilliames So now when I click on and off the group it still jumps about 1px up or down. I think the reason is that the elements are not using whole numbers for x and y. Each time I click on and off the elements are getting new numbers with decimals. I triple checked to see if it was just the elements starting off on decimals but it's not. Something in the logic is off. Thanks for being so prompt.

[Bug] Paddy not working for symbols in sketch 49

For version 1.0.4 it is arbitrarily changing the width of the symbol instances.
For version 1.0.2 (on which I currently am) it does not seem to even apply. Symbol instances are not changing their size according to the set padding.

[Bug] Option to turn off update warning

First, I'm not even using paddy on this symbol or even in this document which is weird.

But I'd like to turn off this warning that occurs when you edit a symbol with 10 or more instances.
image

Annoying if you're working on existing symbol and you have to click this every time even if you don't make changes. And there is no slow down for me even with 30 symbols

[Enhancement] Multiple alignment options

Hey @DWilliames — thanks for this plugin, it's a life-saver!

Do I have any syntax for applying middle + center? I tried Group [cm], Group [c m] and Group [c, m] but it doesn't kick in :(

If there's no support for this at moment, it would be nice as an enhancement. We could combine vertical + horizontal alignment strategies. Freaking cool.

Once again, thanks a lot buddy! 🍻

[Enhancement] Center align layers with "min width" padding

Hi! I have a huge library with buttons, and all of them have "min width" specifications. In this case, the paddings are 15; 24; 17; 24 and width >=100. When I use a short title for my button, such as "Add", the plugin automatically fits the width to 100 px (it's super cool!), but the text field doesn't seem to be aligned to the centre.
alignment

[Enhancement] Resizing symbol with right aligned text

At the moment, symbol instances are always resized from the top-left.

However, if the widest text layer is right aligned, it would be better if the symbol instance resized from the right, instead of the left.

Example of current behaviour:
2018-02-11 20 19 44

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.