styleguidekit-assets-default icon indicating copy to clipboard operation
styleguidekit-assets-default copied to clipboard

Support for adding and removing panels

Open kara-todd opened this issue 8 years ago • 8 comments

It would be nice to have the ability to define or modify what panels appear for the code view. In my case, I'd like to have JS/CSS/HTML (but not mustache.) This is because we will be using pattern-lab to share the front-end code base with an external vendor. The vendor needs to be able understand what is required for units to render & function, but will be generating HTML server-side rather than using mustache.

My initial thought was to somehow try and hook into the panels registration through the gulp build process.

kara-todd avatar Aug 18 '16 21:08 kara-todd

Hey @kara-todd, Yep the architecture for Pattern Lab 2 allows to extend these panels. @dmolsen would have to explain the logistics of extending these panels. I just want to let you know that your request is something that's being addressed. Thanks!

bradfrost avatar Aug 30 '16 15:08 bradfrost

Note - you may add panels in PL Node with https://github.com/pattern-lab/plugin-node-tab

bmuenzenmeyer avatar Dec 22 '16 13:12 bmuenzenmeyer

but how to remove them? Change? For example i want to add new tab: 'scss' (done over plugin) and remove it if the content is empty (no file, or empty file). Or i want to remove 'mustache' panel.

yadimon avatar May 08 '17 10:05 yadimon

Removing panels is not supported by the plugin yet, but it's been noted as an improvement opportunity.

bmuenzenmeyer avatar May 08 '17 13:05 bmuenzenmeyer

pr for remove ability: https://github.com/pattern-lab/styleguidekit-assets-default/pull/59

yadimon avatar May 09 '17 16:05 yadimon

@bmuenzenmeyer should this PR go as part of this repository or the plugin? It doesn't seem like it would be bad to include it as part of styleguidekit-assets-default

bradfrost avatar Oct 09 '17 21:10 bradfrost

@bradfrost this PR should be merged to enable future plugin enhancements (such as the one I linked above), and / or allow core Pattern Lab implementations to hide panels by default.

It's important to note that ADDING panels is something more difficult to make happen by default, because it requires pre-processing of source (hence the plugin), whereas removal is an after-the-fact hiding.

tldr; we should merge #59 !

bmuenzenmeyer avatar Oct 10 '17 04:10 bmuenzenmeyer

@bmuenzenmeyer Awesome sounds good! I saw you self-assigned that PR, so I'll leave you to it.

bradfrost avatar Oct 10 '17 22:10 bradfrost