Skip to content

Commit f1f1b8e

Browse files
authored
Merge pull request #1096 from pattern-lab/fix/plugin-and-clean-fixes
Fix/plugin and clean fixes
2 parents f41d8bf + 2d6136c commit f1f1b8e

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

packages/core/src/lib/buildPatterns.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {
4040
//
4141
const graph = (patternlab.graph = loadPatternGraph(
4242
patternlab,
43-
deletePatternDir
43+
patternlab.config.cleanPublic
4444
));
4545
const graphNeedsUpgrade = !PatternGraph.checkVersion(graph);
4646
if (graphNeedsUpgrade) {
@@ -55,7 +55,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {
5555

5656
// Flags
5757
patternlab.incrementalBuildsEnabled = !(
58-
deletePatternDir || graphNeedsUpgrade
58+
patternlab.config.cleanPublic || graphNeedsUpgrade
5959
);
6060

6161
//

packages/plugin-tab/dist/js/@pattern-lab-plugin-tab.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const PluginTab = {
1+
// workaround to `PluginTab undefined` error in Safari
2+
window.PluginTab = {
23
/**
34
* The function defined as the onready callback within the plugin configuration.
45
*/

packages/plugin-tab/src/snippet.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
/* global Panels */
1+
function addPanels() {
2+
window.patternlab.panels.add({
3+
id: 'sg-panel-scss',
4+
name: 'SCSS',
5+
default: false,
6+
templateID: 'pl-panel-template-code',
7+
httpRequest: true,
8+
httpRequestReplace: '.scss',
9+
httpRequestCompleted: false,
10+
prismHighlight: true,
11+
language: 'scss',
12+
keyCombo: 'ctrl+shift+z',
13+
});
14+
}
215

3-
window.patternlab.panels.add({
4-
id: 'sg-panel-<<type>>',
5-
name: '<<typeUC>>',
6-
default: false,
7-
templateID: 'pl-panel-template-code',
8-
httpRequest: true,
9-
httpRequestReplace: '.<<type>>',
10-
httpRequestCompleted: false,
11-
prismHighlight: true,
12-
language: '<<type>>',
13-
keyCombo: 'ctrl+shift+z',
14-
});
16+
// workaround to try recovering from load order race conditions
17+
if (window.patternlab && window.patternlab.panels) {
18+
addPanels();
19+
} else {
20+
document.addEventListener('patternLab.pageLoad', addPanels);
21+
}

packages/uikit-workshop/src/sass/scss/04-components/_pattern.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
font-family: $pl-font;
8282
border-color: #ddd;
8383
border-width: 1px; // fix for different browser defaults
84+
border-style: solid; // fix for different browser defaults (ex. Safari)
8485
display: flex;
8586
align-items: center;
8687

0 commit comments

Comments
 (0)