diff --git a/packages/core/src/lib/expandPartials.js b/packages/core/src/lib/expandPartials.js index f153ff467..d9f7fad8e 100644 --- a/packages/core/src/lib/expandPartials.js +++ b/packages/core/src/lib/expandPartials.js @@ -2,12 +2,10 @@ const logger = require('./log'); const ph = require('./parameter_hunter'); -const smh = require('./style_modifier_hunter'); const jsonCopy = require('./json_copy'); const getPartial = require('./get'); const parameter_hunter = new ph(); -const style_modifier_hunter = new smh(); module.exports = function (currentPattern, patternlab) { const processRecursive = require('./processRecursive'); @@ -47,18 +45,6 @@ module.exports = function (currentPattern, patternlab) { `partial pattern ${partial}` ); - //if partial has style modifier data, replace the styleModifier value - if ( - currentPattern.stylePartials && - currentPattern.stylePartials.length > 0 - ) { - style_modifier_hunter.consume_style_modifier( - cleanPartialPattern, - foundPartial, - patternlab - ); - } - //this is what we came here for logger.debug( `within ${currentPattern.patternPartial}, replacing extendedTemplate partial ${foundPartial} with ${cleanPartialPattern.patternPartial}'s extendedTemplate` diff --git a/packages/core/src/lib/loadPattern.js b/packages/core/src/lib/loadPattern.js index 9d6b22519..b5990fecf 100644 --- a/packages/core/src/lib/loadPattern.js +++ b/packages/core/src/lib/loadPattern.js @@ -132,10 +132,6 @@ module.exports = function (relPath, patternlab) { currentPattern.template = fs.readFileSync(templatePath, 'utf8'); - //find any stylemodifiers that may be in the current pattern - currentPattern.stylePartials = - currentPattern.findPartialsWithStyleModifiers(); - //find any pattern parameters that may be in the current pattern currentPattern.parameteredPartials = currentPattern.findPartialsWithPatternParameters(); diff --git a/packages/core/src/lib/object_factory.js b/packages/core/src/lib/object_factory.js index 704474881..318b4cd25 100644 --- a/packages/core/src/lib/object_factory.js +++ b/packages/core/src/lib/object_factory.js @@ -265,10 +265,6 @@ Pattern.prototype = { return this.engine.findPartials(this); }, - findPartialsWithStyleModifiers: function () { - return this.engine.findPartialsWithStyleModifiers(this); - }, - findPartialsWithPatternParameters: function () { return this.engine.findPartialsWithPatternParameters(this); }, diff --git a/packages/core/src/lib/parameter_hunter.js b/packages/core/src/lib/parameter_hunter.js index 3a6d018e5..01a260ffc 100644 --- a/packages/core/src/lib/parameter_hunter.js +++ b/packages/core/src/lib/parameter_hunter.js @@ -1,8 +1,5 @@ 'use strict'; -const smh = require('./style_modifier_hunter'); -const style_modifier_hunter = new smh(); - const getPartial = require('./get'); const logger = require('./log'); const parseLink = require('./parseLink'); @@ -313,15 +310,6 @@ const parameter_hunter = function () { } } - //if partial has style modifier data, replace the styleModifier value - if (pattern.stylePartials && pattern.stylePartials.length > 0) { - style_modifier_hunter.consume_style_modifier( - partialPattern, - pMatch, - patternlab - ); - } - // set pattern.extendedTemplate pMatch with replacedPartial pattern.extendedTemplate = pattern.extendedTemplate.replace( pMatch, diff --git a/packages/core/src/lib/processIterative.js b/packages/core/src/lib/processIterative.js index e2433b1c8..8f57f7dff 100644 --- a/packages/core/src/lib/processIterative.js +++ b/packages/core/src/lib/processIterative.js @@ -11,9 +11,6 @@ module.exports = function (pattern, patternlab) { return pph .find_pseudopatterns(pattern, patternlab) .then(() => { - //find any stylemodifiers that may be in the current pattern - pattern.stylePartials = pattern.findPartialsWithStyleModifiers(); - //find any pattern parameters that may be in the current pattern pattern.parameteredPartials = pattern.findPartialsWithPatternParameters(); return Promise.resolve(pattern); diff --git a/packages/core/src/lib/pseudopattern_hunter.js b/packages/core/src/lib/pseudopattern_hunter.js index 73e703564..28d4f3e1a 100644 --- a/packages/core/src/lib/pseudopattern_hunter.js +++ b/packages/core/src/lib/pseudopattern_hunter.js @@ -86,7 +86,6 @@ pseudopattern_hunter.prototype.find_pseudopatterns = function ( extendedTemplate: currentPattern.extendedTemplate, isPseudoPattern: true, basePattern: currentPattern, - stylePartials: currentPattern.stylePartials, parameteredPartials: currentPattern.parameteredPartials, // Only regular patterns are discovered during iterative walks diff --git a/packages/core/src/lib/style_modifier_hunter.js b/packages/core/src/lib/style_modifier_hunter.js deleted file mode 100644 index bd62c773a..000000000 --- a/packages/core/src/lib/style_modifier_hunter.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -const logger = require('./log'); - -const style_modifier_hunter = function () { - /** - * Modifies a patterns partial with any styleModifiers found on the supplied partial - * - * @param pattern {object} the pattern to extend - * @param partial {string} partial containing styleModifiers - * @param patternlab {object} the patternlab instance - */ - function consumestylemodifier(pattern, partial, patternlab) { - //extract the classname from the stylemodifier which comes in the format of :className - let styleModifier = partial.match(/:([\w\-_|])+/g) - ? partial.match(/:([\w\-_|])+/g)[0].slice(1) - : null; - - if (styleModifier) { - //replace the special character pipe | used to separate multiple classes with a space - styleModifier = styleModifier.replace(/\|/g, ' '); - - logger.debug( - `Found partial styleModifier within pattern ${pattern.patternPartial}` - ); - - //replace the stylemodifier placeholder with the class name - pattern.extendedTemplate = pattern.extendedTemplate.replace( - /{{[ ]?styleModifier[ ]?}}/i, - styleModifier - ); - - //update the extendedTemplate in the partials object in case this pattern is consumed later - patternlab.partials[pattern.patternPartial] = pattern.extendedTemplate; - } - } - - return { - consume_style_modifier: function (pattern, partial, patternlab) { - consumestylemodifier(pattern, partial, patternlab); - }, - }; -}; - -module.exports = style_modifier_hunter; diff --git a/packages/core/test/engine_handlebars_tests.js b/packages/core/test/engine_handlebars_tests.js index f842c4357..8e5d3c34e 100644 --- a/packages/core/test/engine_handlebars_tests.js +++ b/packages/core/test/engine_handlebars_tests.js @@ -248,13 +248,6 @@ tap.test( } ); -tap.test( - 'find_pattern_partials finds simple partials with style modifiers', - function (test) { - testFindPartials(test, ['{{> molecules-single-comment:foo }}']); - } -); - tap.test( 'find_pattern_partials finds partials with handlebars parameters', function (test) { diff --git a/packages/core/test/engine_mustache_tests.js b/packages/core/test/engine_mustache_tests.js index 1bfcf8cee..dd5e3fb19 100644 --- a/packages/core/test/engine_mustache_tests.js +++ b/packages/core/test/engine_mustache_tests.js @@ -71,32 +71,6 @@ function testFindPartials(test, partialTests) { test.end(); } -function testFindPartialsWithStyleModifiers(test, partialTests) { - test.plan(partialTests.length + 1); - - // setup current pattern from what we would have during execution - // docs on partial syntax are here: - // https://patternlab.io/docs/including-patterns/ - var currentPattern = Pattern.create( - 'molecules/testing/test-mol.mustache', // relative path now - null, // data - { - template: partialTests.join(eol), - } - ); - - // act - var results = currentPattern.findPartialsWithStyleModifiers(); - - // assert - test.equal(results.length, partialTests.length); - partialTests.forEach(function (testString, index) { - test.equal(results[index], testString); - }); - - test.end(); -} - function testFindPartialsWithPatternParameters(test, partialTests) { test.plan(partialTests.length + 1); @@ -160,16 +134,6 @@ tap.test( } ); -tap.test( - 'find_pattern_partials finds simple partials with style modifiers', - function (test) { - testFindPartials(test, [ - '{{> molecules-single-comment:foo }}', - '{{> molecules-single-comment:foo|bar }}', - ]); - } -); - tap.test('find_pattern_partials finds mixed partials', function (test) { testFindPartials(test, [ '{{> molecules-single-comment:foo(description: "test", anotherThing: true) }}', @@ -177,46 +141,6 @@ tap.test('find_pattern_partials finds mixed partials', function (test) { ]); }); -tap.test( - 'find_pattern_partials finds one simple partial with styleModifier', - function (test) { - testFindPartialsWithStyleModifiers(test, [ - '{{> molecules-comment-header:test}}', - ]); - } -); - -tap.test( - 'find_pattern_partials finds partial with many styleModifiers', - function (test) { - testFindPartialsWithStyleModifiers(test, [ - '{{> molecules-comment-header:test|test2|test3}}', - ]); - } -); - -tap.test( - 'find_pattern_partials finds partials with differing styleModifiers', - function (test) { - testFindPartialsWithStyleModifiers(test, [ - '{{> molecules-comment-header:test|test2|test3}}', - '{{> molecules-comment-header:foo-1}}', - '{{> molecules-comment-header:bar_1}}', - ]); - } -); - -tap.test( - 'find_pattern_partials finds partials with styleModifiers when parameters present', - function (test) { - testFindPartialsWithStyleModifiers(test, [ - '{{> molecules-comment-header:test|test2|test3(description: true)}}', - "{{> molecules-comment-header:foo-1(description: 'foo')}}", - "{{> molecules-comment-header:bar_1(descrition: 'bar', anotherThing: 10102010) }}", - ]); - } -); - tap.test( 'find_pattern_partials_with_parameters finds one simple partial with parameters', function (test) { @@ -240,14 +164,3 @@ tap.test( ]); } ); - -tap.test( - 'find_pattern_partials finds partials with parameters when styleModifiers present', - function (test) { - testFindPartialsWithPatternParameters(test, [ - '{{> molecules-comment-header:test|test2|test3(description: true)}}', - "{{> molecules-comment-header:foo-1(description: 'foo')}}", - "{{> molecules-comment-header:bar_1(descrition: 'bar', anotherThing: 10102010) }}", - ]); - } -); diff --git a/packages/core/test/files/_patterns/test/paramMiddle.mustache b/packages/core/test/files/_patterns/test/paramMiddle.mustache index 31169fb7e..b69912370 100644 --- a/packages/core/test/files/_patterns/test/paramMiddle.mustache +++ b/packages/core/test/files/_patterns/test/paramMiddle.mustache @@ -1,3 +1,3 @@ -
+
{{> test-link }}
diff --git a/packages/core/test/files/_patterns/test/paramParent.mustache b/packages/core/test/files/_patterns/test/paramParent.mustache index bf4e84562..5ae3cb466 100644 --- a/packages/core/test/files/_patterns/test/paramParent.mustache +++ b/packages/core/test/files/_patterns/test/paramParent.mustache @@ -1 +1 @@ -{{> test-paramMiddle(styleModifier: "foo") }} +{{> test-paramMiddle(additionalClasses: "foo") }} diff --git a/packages/core/test/files/_patterns/test/styled-atom.mustache b/packages/core/test/files/_patterns/test/styled-atom.mustache index b736c06aa..e85d0fc26 100644 --- a/packages/core/test/files/_patterns/test/styled-atom.mustache +++ b/packages/core/test/files/_patterns/test/styled-atom.mustache @@ -1,3 +1,3 @@ - + {{message}} diff --git a/packages/core/test/index_tests.js b/packages/core/test/index_tests.js index f8b49ff61..5cf82654e 100644 --- a/packages/core/test/index_tests.js +++ b/packages/core/test/index_tests.js @@ -253,34 +253,6 @@ tap.test('buildPatterns suite', (test) => { } ); - tap.test( - 'correctly ignores bookended partials without a style modifier when the same partial has a style modifier between', - (test) => { - var pattern = get('test-bookend-listitem', patternlab); - test.equal( - util.sanitized(pattern.extendedTemplate), - util.sanitized(`
- {{#listItems-two}} - - {{message}} - - - - {{message}} - - - - {{message}} - - - {{/listItems-two}} -
- `) - ); - test.end(); - } - ); - tap.test( 'listItems keys (`one` through `twelve`) can be used more than once per pattern', (test) => { diff --git a/packages/core/test/lineage_hunter_tests.js b/packages/core/test/lineage_hunter_tests.js index 24a4a62f0..31a40b764 100644 --- a/packages/core/test/lineage_hunter_tests.js +++ b/packages/core/test/lineage_hunter_tests.js @@ -428,199 +428,6 @@ tap.test( } ); -tap.test( - 'find_lineage - finds lineage with spaced styleModifier', - function (test) { - //setup current pattern from what we would have during execution - var currentPattern = Pattern.createEmpty({ - name: 'molecules-toast-error', - subdir: 'molecules\\toast', - filename: 'error.mustache', - data: null, - template: '{{> atoms-error:foo }}', - extendedTemplate: '{{> atoms-error:foo }}', - patternBaseName: 'error', - patternLink: 'molecules-toast-error/molecules-toast-error.html', - patternGroup: 'molecules', - patternSubgroup: 'molecules\\toast', - flatPatternPath: 'molecules\\toast', - patternPartial: 'molecules-error', - patternState: '', - lineage: [], - lineageIndex: [], - lineageR: [], - lineageRIndex: [], - }); - var patternlab = { - graph: new PatternGraph(null, 0), - patterns: [ - Pattern.createEmpty({ - name: 'atoms-alerts-error', - subdir: 'atoms\\alerts', - filename: 'error.mustache', - data: null, - template: '

{{message}}

', - extendedTemplate: '

{{message}}

', - patternBaseName: 'error', - patternLink: 'atoms-alerts-error/atoms-alerts-error.html', - patternGroup: 'atoms', - patternSubgroup: 'atoms\\alerts', - flatPatternPath: 'atoms\\alerts', - patternPartial: 'atoms-error', - patternState: '', - lineage: [], - lineageIndex: [], - lineageR: [], - lineageRIndex: [], - }), - ], - config: { - outputFileSuffixes: { - rendered: '.rendered', - rawTemplate: '', - markupOnly: '.markup-only', - }, - }, - }; - - lineage_hunter.find_lineage(currentPattern, patternlab); - - test.equal(currentPattern.lineageIndex.length, 1); - test.equal(currentPattern.lineageIndex[0], 'atoms-error'); - - test.end(); - } -); - -tap.test( - 'find_lineage - finds lineage with unspaced styleModifier', - function (test) { - //setup current pattern from what we would have during execution - var currentPattern = Pattern.createEmpty({ - name: 'molecules-toast-error', - subdir: 'molecules\\toast', - filename: 'error.mustache', - data: null, - template: '{{> atoms-error:foo }}', - extendedTemplate: '{{>atoms-error:foo}}', - patternBaseName: 'error', - patternLink: 'molecules-toast-error/molecules-toast-error.html', - patternGroup: 'molecules', - patternSubgroup: 'molecules\\toast', - flatPatternPath: 'molecules\\toast', - patternPartial: 'molecules-error', - patternState: '', - lineage: [], - lineageIndex: [], - lineageR: [], - lineageRIndex: [], - }); - var patternlab = { - graph: PatternGraph.empty(), - patterns: [ - Pattern.createEmpty({ - name: 'atoms-alerts-error', - subdir: 'atoms\\alerts', - filename: 'error.mustache', - data: null, - template: '

{{message}}

', - extendedTemlpate: '

{{message}}

', - patternBaseName: 'error', - patternLink: 'atoms-alerts-error/atoms-alerts-error.html', - patternGroup: 'atoms', - patternSubgroup: 'atoms\\alerts', - flatPatternPath: 'atoms\\alerts', - patternPartial: 'atoms-error', - patternState: '', - lineage: [], - lineageIndex: [], - lineageR: [], - lineageRIndex: [], - }), - ], - config: { - outputFileSuffixes: { - rendered: '.rendered', - rawTemplate: '', - markupOnly: '.markup-only', - }, - }, - }; - - lineage_hunter.find_lineage(currentPattern, patternlab); - - test.equal(currentPattern.lineageIndex.length, 1); - test.equal(currentPattern.lineageIndex[0], 'atoms-error'); - - test.end(); - } -); - -tap.test( - 'find_lineage - finds lineage with fuzzy partial with styleModifier', - function (test) { - //setup current pattern from what we would have during execution - var currentPattern = Pattern.createEmpty({ - name: 'molecules-toast-error', - subdir: 'molecules\\toast', - filename: 'error.mustache', - data: null, - template: '{{> atoms-e:foo }}', - extendedTemplate: '{{>atoms-e:foo}}', - patternBaseName: 'error', - patternLink: 'molecules-toast-error/molecules-toast-error.html', - patternGroup: 'molecules', - patternSubgroup: 'molecules\\toast', - flatPatternPath: 'molecules\\toast', - patternPartial: 'molecules-error', - patternState: '', - lineage: [], - lineageIndex: [], - lineageR: [], - lineageRIndex: [], - }); - var patternlab = { - graph: PatternGraph.empty(), - patterns: [ - Pattern.createEmpty({ - name: 'atoms-alerts-error', - subdir: 'atoms\\alerts', - filename: 'error.mustache', - data: null, - template: '

{{message}}

', - extendedTemplate: '

{{message}}

', - patternBaseName: 'error', - patternLink: 'atoms-alerts-error/atoms-alerts-error.html', - patternGroup: 'atoms', - patternSubgroup: 'atoms\\alerts', - flatPatternPath: 'atoms\\alerts', - patternPartial: 'atoms-error', - patternState: '', - lineage: [], - lineageIndex: [], - lineageR: [], - lineageRIndex: [], - }), - ], - config: { - outputFileSuffixes: { - rendered: '.rendered', - rawTemplate: '', - markupOnly: '.markup-only', - }, - }, - }; - - var lineage_hunter = new lh(); - lineage_hunter.find_lineage(currentPattern, patternlab); - - test.equal(currentPattern.lineageIndex.length, 1); - test.equal(currentPattern.lineageIndex[0], 'atoms-error'); - - test.end(); - } -); - tap.test('find_lineage - does not apply lineage twice', function (test) { //setup current pattern from what we would have during execution var currentPattern = createFakeEmptyErrorPattern(); diff --git a/packages/core/test/processRecursive_tests.js b/packages/core/test/processRecursive_tests.js index 96de00066..e9ae0c4d8 100644 --- a/packages/core/test/processRecursive_tests.js +++ b/packages/core/test/processRecursive_tests.js @@ -47,269 +47,6 @@ tap.test('processRecursive recursively includes partials', function (test) { .catch(test.threw); }); -tap.test( - 'processRecursive - correctly replaces all stylemodifiers when multiple duplicate patterns with different stylemodifiers found', - function (test) { - //arrange - const patternlab = util.fakePatternLab(patterns_dir); - - var atomPath = path.join('test', 'styled-atom.mustache'); - var atomPattern = loadPattern(atomPath, patternlab); - - var groupPath = path.join('test', 'group.mustache'); - var groupPattern = loadPattern(groupPath, patternlab); - - var p1 = processIterative(atomPattern, patternlab); - var p2 = processIterative(groupPattern, patternlab); - - Promise.all([p1, p2]) - .then(() => { - //act - processRecursive(groupPath, patternlab) - .then(() => { - //assert - const expectedValue = - '
{{message}} {{message}} {{message}} {{message}}
'; - test.equal( - util.sanitized(groupPattern.extendedTemplate), - util.sanitized(expectedValue) - ); - test.end(); - }) - .catch(test.threw); - }) - .catch(test.threw); - } -); - -tap.only( - 'processRecursive - correctly replaces multiple stylemodifier classes on same partial', - function (test) { - //arrange - const patternlab = util.fakePatternLab(patterns_dir); - - var atomPath = path.join('test', 'styled-atom.mustache'); - var atomPattern = loadPattern(atomPath, patternlab); - - var groupPath = path.join('test', 'multiple-classes-numeric.mustache'); - var groupPattern = loadPattern(groupPath, patternlab); - - var p1 = processIterative(atomPattern, patternlab); - var p2 = processIterative(groupPattern, patternlab); - - Promise.all([p1, p2]) - .then(() => { - //act - processRecursive(groupPath, patternlab) - .then(() => { - //assert - const expectedValue = - '
{{message}} {{message}} bar
'; - test.equal( - util.sanitized(groupPattern.extendedTemplate), - util.sanitized(expectedValue) - ); - test.end(); - }) - .catch(test.threw); - }) - .catch(test.threw); - } -); - -tap.test( - 'processRecursive - correctly ignores a partial without a style modifier when the same partial later has a style modifier', - function (test) { - //arrange - const patternlab = util.fakePatternLab(patterns_dir); - - var atomPath = path.join('test', 'styled-atom.mustache'); - var atomPattern = loadPattern(atomPath, patternlab); - - var mixedPath = path.join('test', 'mixed.mustache'); - var mixedPattern = loadPattern(mixedPath, patternlab); - - var p1 = processIterative(atomPattern, patternlab); - var p2 = processIterative(mixedPattern, patternlab); - - Promise.all([p1, p2]) - .then(() => { - //act - processRecursive(mixedPath, patternlab) - .then(() => { - //assert. here we expect {{styleModifier}} to be in the first group, since it was not replaced by anything. rendering with data will then remove this (correctly) - const expectedValue = - '
{{message}} {{message}} {{message}} {{message}}
'; - test.equal( - util.sanitized(mixedPattern.extendedTemplate), - util.sanitized(expectedValue) - ); - test.end(); - }) - .catch(test.threw); - }) - .catch(test.threw); - } -); - -tap.test( - 'processRecursive - correctly ignores bookended partials without a style modifier when the same partial has a style modifier between', - function (test) { - //arrange - const patternlab = util.fakePatternLab(patterns_dir); - - var atomPath = path.join('test', 'styled-atom.mustache'); - var atomPattern = loadPattern(atomPath, patternlab); - - var bookendPath = path.join('test', 'bookend.mustache'); - var bookendPattern = loadPattern(bookendPath, patternlab); - - var p1 = processIterative(atomPattern, patternlab); - var p2 = processIterative(bookendPattern, patternlab); - - Promise.all([p1, p2]) - .then(() => { - //act - processRecursive(bookendPath, patternlab) - .then(() => { - //assert. here we expect {{styleModifier}} to be in the first and last group, since it was not replaced by anything. rendering with data will then remove this (correctly) - const expectedValue = - '
{{message}} {{message}} {{message}} {{message}}
'; - test.equal( - util.sanitized(bookendPattern.extendedTemplate), - util.sanitized(expectedValue) - ); - test.end(); - }) - .catch(test.threw); - }) - .catch(test.threw); - } -); - -tap.test( - 'processRecursive - correctly ignores a partial without a style modifier when the same partial later has a style modifier and pattern parameters', - function (test) { - //arrange - const patternlab = util.fakePatternLab(patterns_dir); - - var atomPath = path.join('test', 'styled-atom.mustache'); - var atomPattern = loadPattern(atomPath, patternlab); - - var mixedPath = path.join('test', 'mixed-params.mustache'); - var mixedPattern = loadPattern(mixedPath, patternlab); - - var p1 = processIterative(atomPattern, patternlab); - var p2 = processIterative(mixedPattern, patternlab); - - Promise.all([p1, p2]) - .then(() => { - //act - processRecursive(mixedPath, patternlab) - .then(() => { - //assert. here we expect {{styleModifier}} to be in the first span, since it was not replaced by anything. rendering with data will then remove this (correctly) - const expectedValue = - '
{{message}} 2 3 4
'; - test.equal( - util.sanitized(mixedPattern.extendedTemplate), - util.sanitized(expectedValue) - ); - test.end(); - }) - .catch(test.threw); - }) - .catch(test.threw); - } -); - -tap.test( - 'processRecursive - correctly ignores bookended partials without a style modifier when the same partial has a style modifier and pattern parameters between', - function (test) { - //arrange - const patternlab = util.fakePatternLab(patterns_dir); - - var atomPath = path.join('test', 'styled-atom.mustache'); - var atomPattern = loadPattern(atomPath, patternlab); - - var bookendPath = path.join('test', 'bookend-params.mustache'); - var bookendPattern = loadPattern(bookendPath, patternlab); - - var p1 = processIterative(atomPattern, patternlab); - var p2 = processIterative(bookendPattern, patternlab); - - Promise.all([p1, p2]) - .then(() => { - //act - processRecursive(bookendPath, patternlab) - .then(() => { - //assert. here we expect {{styleModifier}} to be in the first and last span, since it was not replaced by anything. rendering with data will then remove this (correctly) - const expectedValue = - '
{{message}} 2 3 {{message}}
'; - test.equal( - util.sanitized(bookendPattern.extendedTemplate), - util.sanitized(expectedValue) - ); - test.end(); - }) - .catch(test.threw); - }) - .catch(test.threw); - } -); - -tap.test( - 'processRecursive - does not pollute previous patterns when a later one is found with a styleModifier', - function (test) { - //arrange - const patternlab = util.fakePatternLab(patterns_dir); - - var atomPath = path.join('test', 'styled-atom.mustache'); - var atomPattern = loadPattern(atomPath, patternlab); - - var anotherPath = path.join('test', 'another-styled-atom.mustache'); - var anotherPattern = loadPattern(anotherPath, patternlab); - - var p1 = processIterative(atomPattern, patternlab); - var p2 = processIterative(anotherPattern, patternlab); - - Promise.all([p1, p2]) - .then(() => { - //act - processRecursive(anotherPath, patternlab) - .then(() => { - //assert - const expectedCleanValue = - ' {{message}} '; - const expectedSetValue = - ' {{message}} '; - - //this is the "atom" - it should remain unchanged - test.equal( - util.sanitized(atomPattern.template), - util.sanitized(expectedCleanValue) - ); - test.equal( - util.sanitized(atomPattern.extendedTemplate), - util.sanitized(expectedCleanValue) - ); - - // this is the style modifier pattern, which should resolve correctly - test.equal( - util.sanitized(anotherPattern.template), - '{{> test-styled-atom:test_1 }}' - ); - test.equal( - util.sanitized(anotherPattern.extendedTemplate), - util.sanitized(expectedSetValue) - ); - test.end(); - }) - .catch(test.threw); - }) - .catch(test.threw); - } -); - tap .test('processRecursive - ensure deep-nesting works', function (test) { //arrange diff --git a/packages/core/test/pseudopattern_hunter_tests.js b/packages/core/test/pseudopattern_hunter_tests.js index 9c5bf40c1..1f9c5e541 100644 --- a/packages/core/test/pseudopattern_hunter_tests.js +++ b/packages/core/test/pseudopattern_hunter_tests.js @@ -84,49 +84,41 @@ tap.test('pseudpattern does not pollute base pattern data', function (test) { }); }); -tap.test( - 'pseudpattern variant includes stylePartials and parameteredPartials', - function (test) { - //arrange - var pl = stubPatternlab(); +tap.test('pseudpattern variant includes parameteredPartials', function (test) { + //arrange + var pl = stubPatternlab(); - var atomPattern = new Pattern('test/styled-atom.mustache'); - atomPattern.template = fs.readFileSync( - patterns_dir + 'test/styled-atom.mustache', - 'utf8' - ); - atomPattern.extendedTemplate = atomPattern.template; - atomPattern.stylePartials = - atomPattern.findPartialsWithStyleModifiers(atomPattern); - atomPattern.parameteredPartials = - atomPattern.findPartialsWithPatternParameters(atomPattern); - - var pseudoPattern = new Pattern('test/pseudomodifier.mustache'); - pseudoPattern.template = fs.readFileSync( - patterns_dir + 'test/pseudomodifier.mustache', - 'utf8' + var atomPattern = new Pattern('test/styled-atom.mustache'); + atomPattern.template = fs.readFileSync( + patterns_dir + 'test/styled-atom.mustache', + 'utf8' + ); + atomPattern.extendedTemplate = atomPattern.template; + atomPattern.parameteredPartials = + atomPattern.findPartialsWithPatternParameters(atomPattern); + + var pseudoPattern = new Pattern('test/pseudomodifier.mustache'); + pseudoPattern.template = fs.readFileSync( + patterns_dir + 'test/pseudomodifier.mustache', + 'utf8' + ); + pseudoPattern.extendedTemplate = atomPattern.template; + pseudoPattern.parameteredPartials = + pseudoPattern.findPartialsWithPatternParameters(pseudoPattern); + + addPattern(atomPattern, pl); + addPattern(pseudoPattern, pl); + + //act + return pph.find_pseudopatterns(pseudoPattern, pl).then(() => { + //assert + test.equal(pl.patterns[2].patternPartial, 'test-pseudomodifier-test'); + test.equal( + pl.patterns[2].parameteredPartials, + pseudoPattern.parameteredPartials ); - pseudoPattern.extendedTemplate = atomPattern.template; - pseudoPattern.stylePartials = - pseudoPattern.findPartialsWithStyleModifiers(pseudoPattern); - pseudoPattern.parameteredPartials = - pseudoPattern.findPartialsWithPatternParameters(pseudoPattern); - - addPattern(atomPattern, pl); - addPattern(pseudoPattern, pl); - - //act - return pph.find_pseudopatterns(pseudoPattern, pl).then(() => { - //assert - test.equal(pl.patterns[2].patternPartial, 'test-pseudomodifier-test'); - test.equal(pl.patterns[2].stylePartials, pseudoPattern.stylePartials); - test.equal( - pl.patterns[2].parameteredPartials, - pseudoPattern.parameteredPartials - ); - }); - } -); + }); +}); tap.test('pseudo pattern variant data should merge arrays', function (test) { const pl = stubPatternlab(); diff --git a/packages/core/test/style_modifier_hunter_tests.js b/packages/core/test/style_modifier_hunter_tests.js deleted file mode 100644 index 93c76f92e..000000000 --- a/packages/core/test/style_modifier_hunter_tests.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; - -var tap = require('tap'); - -var smh = require('../src/lib/style_modifier_hunter'); - -tap.test( - 'uses the partial stylemodifer to modify the patterns extendedTemplate', - function (test) { - //arrange - var pl = {}; - pl.partials = {}; - pl.config = {}; - pl.config.logLevel = 'quiet'; - - var pattern = { - extendedTemplate: '
', - }; - - var style_modifier_hunter = new smh(); - - //act - style_modifier_hunter.consume_style_modifier( - pattern, - '{{> partial:bar}}', - pl - ); - - //assert - test.equal(pattern.extendedTemplate, '
'); - test.end(); - } -); - -tap.test('replaces style modifiers with spaces in the syntax', function (test) { - //arrange - var pl = {}; - pl.partials = {}; - pl.config = {}; - pl.config.logLevel = 'quiet'; - - var pattern = { - extendedTemplate: '
', - }; - - var style_modifier_hunter = new smh(); - - //act - style_modifier_hunter.consume_style_modifier( - pattern, - '{{> partial:bar}}', - pl - ); - - //assert - test.equal(pattern.extendedTemplate, '
'); - test.end(); -}); - -tap.test('replaces multiple style modifiers', function (test) { - //arrange - var pl = {}; - pl.partials = {}; - pl.config = {}; - pl.config.logLevel = 'quiet'; - - var pattern = { - extendedTemplate: '
', - }; - - var style_modifier_hunter = new smh(); - - //act - style_modifier_hunter.consume_style_modifier( - pattern, - '{{> partial:bar|baz|dum}}', - pl - ); - - //assert - test.equal(pattern.extendedTemplate, '
'); - test.end(); -}); - -tap.test( - 'does not alter pattern extendedTemplate if styleModifier not found in partial', - function (test) { - //arrange - var pl = {}; - pl.partials = {}; - pl.config = {}; - pl.config.logLevel = 'quiet'; - - var pattern = { - extendedTemplate: '
', - }; - - var style_modifier_hunter = new smh(); - - //act - style_modifier_hunter.consume_style_modifier(pattern, '{{> partial}}', pl); - - //assert - test.equal( - pattern.extendedTemplate, - '
' - ); - test.end(); - } -); diff --git a/packages/docs/src/_includes/components/stacked-block.njk b/packages/docs/src/_includes/components/stacked-block.njk index 24c79fb1f..fb351e919 100644 --- a/packages/docs/src/_includes/components/stacked-block.njk +++ b/packages/docs/src/_includes/components/stacked-block.njk @@ -1,6 +1,6 @@ -
+

{{ title }}

{{ description }}

-
\ No newline at end of file +
diff --git a/packages/docs/src/_includes/components/tile.njk b/packages/docs/src/_includes/components/tile.njk index a2aeb04cf..c6274f2e6 100644 --- a/packages/docs/src/_includes/components/tile.njk +++ b/packages/docs/src/_includes/components/tile.njk @@ -1,4 +1,4 @@ -
+

{{ title }} @@ -6,4 +6,4 @@
{{ description | safe }}

-
\ No newline at end of file +
diff --git a/packages/docs/src/_includes/layouts/home.njk b/packages/docs/src/_includes/layouts/home.njk index 9cd6807bd..4ed9ea020 100644 --- a/packages/docs/src/_includes/layouts/home.njk +++ b/packages/docs/src/_includes/layouts/home.njk @@ -8,21 +8,21 @@
  • - {% set styleModifier = 'c-tile--green' %} + {% set additionalClasses = 'c-tile--green' %} {% set title = 'Read the docs' %} {% set link = '/docs/installing-pattern-lab/' %} {% set description = "Learn how to get up and running with Pattern Lab, work with patterns, design with dynamic data, and use Pattern Lab's advanced features." %} {% include "components/tile.njk" %}
  • - {% set styleModifier = 'c-tile--orange' %} + {% set additionalClasses = 'c-tile--orange' %} {% set title = 'Demos' %} {% set link = '/demos/' %} {% set description = "Demos of pattern starterkits for your project as well as a gallery of Pattern Lab projects in the wild" %} {% include "components/tile.njk" %}
  • - {% set styleModifier = 'c-tile--purple' %} + {% set additionalClasses = 'c-tile--purple' %} {% set title = 'Resources' %} {% set link = '/resources/' %} {% set description = "Links to articles and resources around Pattern Lab and design systems" %} @@ -81,8 +81,8 @@ {% include "components/stacked-block.njk" %}
- - {% set styleModifier = 'c-tile--orange' %} + + {% set additionalClasses = 'c-tile--orange' %} {% set title = 'Open source and community driven' %} {% set link = '/support/' %} {% set description = "Pattern Lab is (and will always be) an open source project. Check out the project on GitHub and join the Pattern Lab Gitter community for conversation and support." %} diff --git a/packages/engine-handlebars/README.md b/packages/engine-handlebars/README.md index 890ac3fd1..8e34ce81c 100644 --- a/packages/engine-handlebars/README.md +++ b/packages/engine-handlebars/README.md @@ -9,8 +9,8 @@ To install the Handlebars PatternEngine in your edition, `npm install --save @pa * [x] [Hidden Patterns](https://patternlab.io/docs/hiding-patterns-in-the-navigation/) * [x] [Pseudo-Patterns](https://patternlab.io/docs/using-pseudo-patterns/) * [x] [Pattern States](https://patternlab.io/docs/using-pattern-states/) -* [ ] [Pattern Parameters](https://patternlab.io/docs/using-pattern-parameters/) (Accomplished instead using [native Handlebars partial arguments](https://handlebarsjs.com/guide/partials.html)) -* [ ] [Style Modifiers](https://github.com/pattern-lab/patternlab-node/issues/1177) (Accomplished instead using [native Handlebars partial arguments](https://handlebarsjs.com/guide/partials.html)) +* [ ] ~~[Pattern Parameters](https://patternlab.io/docs/using-pattern-parameters/)~~ (Accomplished instead using [native Handlebars partial arguments](https://handlebarsjs.com/guide/partials.html)) +* [ ] ~~[Style Modifiers](https://github.com/pattern-lab/patternlab-node/issues/1177)~~ (Accomplished instead using [native Handlebars partial arguments](https://handlebarsjs.com/guide/partials.html)) ## Helpers diff --git a/packages/engine-handlebars/lib/engine_handlebars.js b/packages/engine-handlebars/lib/engine_handlebars.js index fdd6dbd14..d182971c1 100644 --- a/packages/engine-handlebars/lib/engine_handlebars.js +++ b/packages/engine-handlebars/lib/engine_handlebars.js @@ -81,11 +81,6 @@ const engine_handlebars = { const matches = pattern.template.match(findPartialsRE); return matches; }, - findPartialsWithStyleModifiers: function () { - // TODO: make the call to this from oPattern objects conditional on their - // being implemented here. - return []; - }, // returns any patterns that match {{> value(foo:"bar") }} or {{> // value:mod(foo:"bar") }} within the pattern diff --git a/packages/engine-nunjucks/README.md b/packages/engine-nunjucks/README.md index 383567428..283a3695c 100644 --- a/packages/engine-nunjucks/README.md +++ b/packages/engine-nunjucks/README.md @@ -10,8 +10,8 @@ To install the Nunjucks PatternEngine in your edition, run `npm install @pattern - [x] [Hidden Patterns](https://patternlab.io/docs/hiding-patterns-in-the-navigation/) - [x] [Pseudo-Patterns](https://patternlab.io/docs/using-pseudo-patterns/) - [x] [Pattern States](https://patternlab.io/docs/using-pattern-states/) -- [ ] [Pattern Parameters](https://patternlab.io/docs/using-pattern-parameters/) (Accomplished instead using native Nunjucks variables) -- [ ] [Style Modifiers](https://github.com/pattern-lab/patternlab-node/issues/1177) (Accomplished instead using native Nunjucks variables) +- [ ] ~~[Pattern Parameters](https://patternlab.io/docs/using-pattern-parameters/)~~ (Accomplished instead using native Nunjucks variables) +- [ ] ~~[Style Modifiers](https://github.com/pattern-lab/patternlab-node/issues/1177)~~ (Accomplished instead using native Nunjucks variables) Level of Support is more or less full. Partial calls and lineage hunting are supported. Nunjucks does not support the mustache-specific syntax extensions, style modifiers and pattern parameters, because their use cases are addressed by the core Nunjucks feature set. Pattern Lab's listitems feature is still written in the mustache syntax. diff --git a/packages/engine-nunjucks/lib/engine_nunjucks.js b/packages/engine-nunjucks/lib/engine_nunjucks.js index 5e3a909fb..939e21adc 100644 --- a/packages/engine-nunjucks/lib/engine_nunjucks.js +++ b/packages/engine-nunjucks/lib/engine_nunjucks.js @@ -90,11 +90,6 @@ const engine_nunjucks = { return matches; }, - // handled by nunjucks. This is here to keep PL from erroring - findPartialsWithStyleModifiers: function () { - return null; - }, - // handled by nunjucks. This is here to keep PL from erroring findPartialsWithPatternParameters: function () { return null; diff --git a/packages/engine-react/lib/engine_react.js b/packages/engine-react/lib/engine_react.js index 3c33f1eca..d57051633 100644 --- a/packages/engine-react/lib/engine_react.js +++ b/packages/engine-react/lib/engine_react.js @@ -174,10 +174,6 @@ var engine_react = { return matches; }, - findPartialsWithStyleModifiers(pattern) { - return []; - }, - // returns any patterns that match {{> value(foo:'bar') }} or {{> // value:mod(foo:'bar') }} within the pattern findPartialsWithPatternParameters(pattern) { diff --git a/packages/engine-twig-php/lib/engine_twig_php.js b/packages/engine-twig-php/lib/engine_twig_php.js index c4ab2af72..2dda1ae18 100644 --- a/packages/engine-twig-php/lib/engine_twig_php.js +++ b/packages/engine-twig-php/lib/engine_twig_php.js @@ -164,10 +164,6 @@ const engine_twig_php = { return filteredMatches; }, - findPartialsWithStyleModifiers(pattern) { - return null; - }, - findPartialsWithPatternParameters(pattern) { return null; }, diff --git a/packages/engine-twig/lib/engine_twig.js b/packages/engine-twig/lib/engine_twig.js index 6a2aedeca..0d4306afc 100644 --- a/packages/engine-twig/lib/engine_twig.js +++ b/packages/engine-twig/lib/engine_twig.js @@ -153,11 +153,6 @@ var engine_twig = { var matches = pattern.template.match(this.findPartialsRE); return matches; }, - findPartialsWithStyleModifiers: function () { - // TODO: make the call to this from oPattern objects conditional on their - // being implemented here. - return []; - }, // returns any patterns that match {{> value(foo:"bar") }} or {{> // value:mod(foo:"bar") }} within the pattern diff --git a/packages/engine-underscore/README.md b/packages/engine-underscore/README.md index 6828852f3..c9580ecac 100644 --- a/packages/engine-underscore/README.md +++ b/packages/engine-underscore/README.md @@ -11,8 +11,8 @@ To install the Underscore PatternEngine in your edition, `npm install @pattern-l * [x] [Hidden Patterns](https://patternlab.io/docs/hiding-patterns-in-the-navigation/) * [x] [Pseudo-Patterns](https://patternlab.io/docs/using-pseudo-patterns/) * [x] [Pattern States](https://patternlab.io/docs/using-pattern-states/) -* [ ] [Pattern Parameters](https://patternlab.io/docs/using-pattern-parameters/) (Accomplished instead using parameter object passed to the included [`_.renderNamedPartial()`](https://github.com/pattern-lab/patternlab-node/blob/master/packages/engine-underscore/lib/engine_underscore.js#L54-L60) mixin function) -* [ ] [Style Modifiers](https://github.com/pattern-lab/patternlab-node/issues/1177) (Accomplished instead using parameter object passed to the included [`_.renderNamedPartial()`](https://github.com/pattern-lab/patternlab-node/blob/master/packages/engine-underscore/lib/engine_underscore.js#L54-L60) mixin function) +* [ ] ~~[Pattern Parameters](https://patternlab.io/docs/using-pattern-parameters/)~~ (Accomplished instead using parameter object passed to the included [`_.renderNamedPartial()`](https://github.com/pattern-lab/patternlab-node/blob/master/packages/engine-underscore/lib/engine_underscore.js#L54-L60) mixin function) +* [ ] ~~[Style Modifiers](https://github.com/pattern-lab/patternlab-node/issues/1177)~~ (Accomplished instead using parameter object passed to the included [`_.renderNamedPartial()`](https://github.com/pattern-lab/patternlab-node/blob/master/packages/engine-underscore/lib/engine_underscore.js#L54-L60) mixin function) ## Extensions to basic Underscore functionality diff --git a/packages/engine-underscore/lib/engine_underscore.js b/packages/engine-underscore/lib/engine_underscore.js index d08b3a63f..86b34c307 100644 --- a/packages/engine-underscore/lib/engine_underscore.js +++ b/packages/engine-underscore/lib/engine_underscore.js @@ -168,9 +168,6 @@ const engine_underscore = { const matches = pattern.template.match(this.findPartialsRE); return matches; }, - findPartialsWithStyleModifiers: function () { - return []; - }, // returns any patterns that match {{> value(foo:"bar") }} or {{> // value:mod(foo:"bar") }} within the pattern diff --git a/packages/starterkit-handlebars-demo/dist/_data/buttons.json b/packages/starterkit-handlebars-demo/dist/_data/buttons.json index 81560eb82..3da8beecc 100644 --- a/packages/starterkit-handlebars-demo/dist/_data/buttons.json +++ b/packages/starterkit-handlebars-demo/dist/_data/buttons.json @@ -7,7 +7,7 @@ "buttonText": "Button" }, { - "styleModifier": "c-btn--bare", + "additionalClasses": "c-btn--bare", "buttonTag": true, "buttonText": "Button" } diff --git a/packages/starterkit-handlebars-demo/dist/_data/forms.json b/packages/starterkit-handlebars-demo/dist/_data/forms.json index eb5780265..4ae32b3dc 100644 --- a/packages/starterkit-handlebars-demo/dist/_data/forms.json +++ b/packages/starterkit-handlebars-demo/dist/_data/forms.json @@ -44,7 +44,7 @@ "searchForm": true, "searchFormButton": { "buttonTag": true, - "styleModifier": "u-is-vishidden", + "additionalClasses": "u-is-vishidden", "buttonText": "Search" }, "fields": [ @@ -121,7 +121,7 @@ "formButtons": [ {}, { - "styleModifier": "c-btn--bare" + "additionalClasses": "c-btn--bare" } ] } diff --git a/packages/starterkit-handlebars-demo/dist/_data/global.json b/packages/starterkit-handlebars-demo/dist/_data/global.json index 0a432082e..a6cedd01e 100644 --- a/packages/starterkit-handlebars-demo/dist/_data/global.json +++ b/packages/starterkit-handlebars-demo/dist/_data/global.json @@ -1,5 +1,5 @@ { "footerLogo": { - "styleModifier": "c-logo--light" + "additionalClasses": "c-logo--light" } } diff --git a/packages/starterkit-handlebars-demo/dist/_data/lists.json b/packages/starterkit-handlebars-demo/dist/_data/lists.json index 210171248..62c5ed567 100644 --- a/packages/starterkit-handlebars-demo/dist/_data/lists.json +++ b/packages/starterkit-handlebars-demo/dist/_data/lists.json @@ -1,7 +1,7 @@ { "stackedBlockList": [ { - "styleModifier": "", + "additionalClasses": "", "url": "#", "stackedBlockMedia": { "src": "https://via.placeholder.com/600x400", @@ -14,7 +14,7 @@ "label": "Label" }, { - "styleModifier": "", + "additionalClasses": "", "url": "#", "stackedBlockMedia": { "src": "https://via.placeholder.com/600x400", @@ -27,7 +27,7 @@ "label": "Label" }, { - "styleModifier": "", + "additionalClasses": "", "url": "#", "stackedBlockMedia": { "src": "https://via.placeholder.com/600x400", @@ -40,7 +40,7 @@ "label": "Label" }, { - "styleModifier": "", + "additionalClasses": "", "url": "#", "stackedBlockMedia": { "src": "https://via.placeholder.com/600x400", @@ -53,7 +53,7 @@ "label": "Label" }, { - "styleModifier": "", + "additionalClasses": "", "url": "#", "stackedBlockMedia": { "src": "https://via.placeholder.com/600x400", @@ -66,7 +66,7 @@ "label": "Label" }, { - "styleModifier": "", + "additionalClasses": "", "url": "#", "stackedBlockMedia": { "src": "https://via.placeholder.com/600x400", diff --git a/packages/starterkit-handlebars-demo/dist/_data/navigation.json b/packages/starterkit-handlebars-demo/dist/_data/navigation.json index ecc2fbbfe..0ab45d698 100644 --- a/packages/starterkit-handlebars-demo/dist/_data/navigation.json +++ b/packages/starterkit-handlebars-demo/dist/_data/navigation.json @@ -1,6 +1,6 @@ { "navToggle" : { - "styleModifier" : "c-btn--small c-header__nav-btn js-nav-trigger", + "additionalClasses": "c-btn--small c-header__nav-btn js-nav-trigger", "buttonText" : "Menu" }, "paginationList" : [ @@ -64,7 +64,7 @@ "progressTracker" : { "items": [ { - "styleModifier": "is-current", + "additionalClasses": "is-current", "number": "1", "label": "Shipping Information" }, diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/atoms/forms/select.hbs b/packages/starterkit-handlebars-demo/dist/_patterns/atoms/forms/select.hbs index abe66fa04..722a05f8c 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/atoms/forms/select.hbs +++ b/packages/starterkit-handlebars-demo/dist/_patterns/atoms/forms/select.hbs @@ -1,4 +1,4 @@ - {{# selectOptions }} {{/ selectOptions }} diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/atoms/images/icon.hbs b/packages/starterkit-handlebars-demo/dist/_patterns/atoms/images/icon.hbs index 3d96285b7..e524c5ac2 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/atoms/images/icon.hbs +++ b/packages/starterkit-handlebars-demo/dist/_patterns/atoms/images/icon.hbs @@ -1,3 +1,3 @@ - + diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/atoms/images/landscape-4x3.hbs b/packages/starterkit-handlebars-demo/dist/_patterns/atoms/images/landscape-4x3.hbs index 24954fe25..aba0e0684 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/atoms/images/landscape-4x3.hbs +++ b/packages/starterkit-handlebars-demo/dist/_patterns/atoms/images/landscape-4x3.hbs @@ -1 +1 @@ -{{ alt }} +{{ alt }} diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/blocks/promo-block.hbs b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/blocks/promo-block.hbs index 328eaacdb..1328643b0 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/blocks/promo-block.hbs +++ b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/blocks/promo-block.hbs @@ -1,4 +1,4 @@ -
+
{{#with promoBlockLink }} diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/blocks/stacked-block.hbs b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/blocks/stacked-block.hbs index 30303ab71..9d0ae50a9 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/blocks/stacked-block.hbs +++ b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/blocks/stacked-block.hbs @@ -1,4 +1,4 @@ - +
{{#with stackedBlockMedia }} diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/buttons/button.hbs b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/buttons/button.hbs index fc8f42ada..de9560b2f 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/buttons/button.hbs +++ b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/buttons/button.hbs @@ -1,4 +1,4 @@ -<{{#if buttonTag }}button{{/ if }}{{#if linkTag }}a href="{{ url }}"{{/ if }} class="c-btn {{ styleModifier }}" {{# buttonTitle}}title="{{ buttonTitle }}"{{/ buttonTitle}}{{# buttonIsToggle }} data-btn-icon-swap="{{ iconPath }}{{ buttonIconSwap }}"{{/ buttonIsToggle }}> +<{{#if buttonTag }}button{{/ if }}{{#if linkTag }}a href="{{ url }}"{{/ if }} class="c-btn {{ additionalClasses }}" {{# buttonTitle}}title="{{ buttonTitle }}"{{/ buttonTitle}}{{# buttonIsToggle }} data-btn-icon-swap="{{ iconPath }}{{ buttonIconSwap }}"{{/ buttonIsToggle }}>
diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/buttons/button~bare.json b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/buttons/button~bare.json index f65351498..9aa3d63cc 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/buttons/button~bare.json +++ b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/buttons/button~bare.json @@ -1,3 +1,3 @@ { - "styleModifier": "c-btn--bare" + "additionalClasses": "c-btn--bare" } diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/forms/checkbox-field.hbs b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/forms/checkbox-field.hbs index b4c6f9157..0ba1da3a8 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/forms/checkbox-field.hbs +++ b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/forms/checkbox-field.hbs @@ -1,4 +1,4 @@ -
+

{{ label }}

diff --git a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/forms/inline-checkbox.hbs b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/forms/inline-checkbox.hbs index 0b02c92f7..ef8131a48 100644 --- a/packages/starterkit-handlebars-demo/dist/_patterns/molecules/forms/inline-checkbox.hbs +++ b/packages/starterkit-handlebars-demo/dist/_patterns/molecules/forms/inline-checkbox.hbs @@ -1,4 +1,4 @@ -
+

{{ label }}

-