@poppinss/cliui
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -122,3 +122,2 @@ "use strict"; | ||
} | ||
const width = string_width_1.default(this.state.heading); | ||
/** | ||
@@ -128,4 +127,4 @@ * Creating the header text | ||
const leftWhitespace = this.repeat(' ', this.leftPadding); | ||
const rightWhitespace = this.repeat(' ', this.widestLineLength - width + this.rightPadding); | ||
const headingContent = this.wrapInVerticalLines(this.state.heading, leftWhitespace, rightWhitespace); | ||
const rightWhitespace = this.repeat(' ', this.widestLineLength - this.state.heading.width + this.rightPadding); | ||
const headingContent = this.wrapInVerticalLines(this.state.heading.text, leftWhitespace, rightWhitespace); | ||
/** | ||
@@ -165,3 +164,7 @@ * Creating the heading border bottom | ||
heading(text) { | ||
this.state.heading = text; | ||
const width = string_width_1.default(text); | ||
if (width > this.widestLineLength) { | ||
this.widestLineLength = width; | ||
} | ||
this.state.heading = { text, width }; | ||
return this; | ||
@@ -191,3 +194,3 @@ } | ||
if (this.testing) { | ||
this.state.heading && renderer.log(this.state.heading); | ||
this.state.heading && renderer.log(this.state.heading.text); | ||
this.state.content.forEach(({ text }) => renderer.log(text)); | ||
@@ -194,0 +197,0 @@ return; |
{ | ||
"name": "@poppinss/cliui", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Highly opinionated command line UI KIT", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78794
2304