@lightningjs/blits
Advanced tools
Comparing version 0.4.2 to 0.5.0
@@ -34,4 +34,4 @@ { | ||
"dependencies": { | ||
"@lightningjs/blits": "^0.4.2" | ||
"@lightningjs/blits": "^0.5.0" | ||
} | ||
} |
# Changelog | ||
# v0.5.0 | ||
_23 nov 2023_ | ||
- Introduced `wordwrap` and `maxlines` attributes on the Text-component, replacing the previous `w` and `h` attributes (breaking change!) | ||
# v0.4.2 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@lightningjs/blits", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"description": "Blits: The Lightning 3 App Development Framework", | ||
@@ -5,0 +5,0 @@ "bin": "bin/index.cjs", |
@@ -34,4 +34,4 @@ /* | ||
contain="$_contain" | ||
:w="$w" | ||
:h="$h" | ||
:wordWrap="$wordwrap" | ||
:maxLines="$maxlines" | ||
:textAlign="$align" | ||
@@ -58,4 +58,4 @@ @loaded="$@loaded" | ||
'align', | ||
'w', | ||
'h', | ||
'wordwrap', | ||
'maxlines', | ||
'contain', | ||
@@ -67,5 +67,8 @@ '@loaded', | ||
_contain() { | ||
return this.contain || (this.w && this.h ? 'both' : this.w ? 'width' : 'none') | ||
return ( | ||
this.contain || | ||
(this.wordwrap && this.maxlines ? 'both' : this.wordwrap ? 'width' : 'none') | ||
) | ||
}, | ||
}, | ||
}) |
@@ -57,2 +57,4 @@ /* | ||
delete props.z | ||
'wordWrap' in props && (props.width = props.wordWrap) | ||
delete props.wordWrap | ||
}, | ||
@@ -165,2 +167,8 @@ parent(props) { | ||
}, | ||
maxLines(props, setProperties, element) { | ||
if (props.maxLines) { | ||
props.height = props.maxLines * element.node.fontSize | ||
} | ||
delete props.maxLines | ||
}, | ||
} | ||
@@ -222,3 +230,3 @@ | ||
if (transformations[prop]) { | ||
transformations[prop](props, this.setProperties) | ||
transformations[prop](props, this.setProperties, this) | ||
} | ||
@@ -225,0 +233,0 @@ |
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
904744
22147