Skip to content

Commit

Permalink
Merge pull request #1096 from pattern-lab/fix/plugin-and-clean-fixes
Browse files Browse the repository at this point in the history
Fix/plugin and clean fixes
  • Loading branch information
sghoweri committed Nov 13, 2019
2 parents f41d8bf + 2d6136c commit f1f1b8e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/lib/buildPatterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {
//
const graph = (patternlab.graph = loadPatternGraph(
patternlab,
deletePatternDir
patternlab.config.cleanPublic
));
const graphNeedsUpgrade = !PatternGraph.checkVersion(graph);
if (graphNeedsUpgrade) {
Expand All @@ -55,7 +55,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {

// Flags
patternlab.incrementalBuildsEnabled = !(
deletePatternDir || graphNeedsUpgrade
patternlab.config.cleanPublic || graphNeedsUpgrade
);

//
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-tab/dist/js/@pattern-lab-plugin-tab.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const PluginTab = {
// workaround to `PluginTab undefined` error in Safari
window.PluginTab = {
/**
* The function defined as the onready callback within the plugin configuration.
*/
Expand Down
33 changes: 20 additions & 13 deletions packages/plugin-tab/src/snippet.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
/* global Panels */
function addPanels() {
window.patternlab.panels.add({
id: 'sg-panel-scss',
name: 'SCSS',
default: false,
templateID: 'pl-panel-template-code',
httpRequest: true,
httpRequestReplace: '.scss',
httpRequestCompleted: false,
prismHighlight: true,
language: 'scss',
keyCombo: 'ctrl+shift+z',
});
}

window.patternlab.panels.add({
id: 'sg-panel-<<type>>',
name: '<<typeUC>>',
default: false,
templateID: 'pl-panel-template-code',
httpRequest: true,
httpRequestReplace: '.<<type>>',
httpRequestCompleted: false,
prismHighlight: true,
language: '<<type>>',
keyCombo: 'ctrl+shift+z',
});
// workaround to try recovering from load order race conditions
if (window.patternlab && window.patternlab.panels) {
addPanels();
} else {
document.addEventListener('patternLab.pageLoad', addPanels);
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
font-family: $pl-font;
border-color: #ddd;
border-width: 1px; // fix for different browser defaults
border-style: solid; // fix for different browser defaults (ex. Safari)
display: flex;
align-items: center;

Expand Down

0 comments on commit f1f1b8e

Please sign in to comment.