@kumu/hydra
Advanced tools
Comparing version 0.0.0-kumu.36 to 0.0.0-kumu.37
{ | ||
"name": "@kumu/hydra", | ||
"version": "0.0.0-kumu.36", | ||
"version": "0.0.0-kumu.37", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
@@ -177,2 +177,20 @@ import { expect, test } from "vitest"; | ||
test("breaks with double space", () => { | ||
expect( | ||
wrapLabel( | ||
"Now what you hear is not a test, I'm wrappin' to the beat. And me, the groove, and my friends are gonna try to move your feet", | ||
40, | ||
"wrap", | ||
"auto", | ||
), | ||
).toEqual([ | ||
"Now what you hear", | ||
"is not a test,", | ||
"I'm wrappin'", | ||
"to the beat.", | ||
"And me, the groove, and my friends", | ||
"are gonna try to move your feet", | ||
]); | ||
}); | ||
test("measure label", () => { | ||
@@ -179,0 +197,0 @@ expect( |
@@ -84,3 +84,2 @@ export const whitespace = /(\s)/; | ||
* @param maxWidth The max number of characters per line. | ||
* @param fontSize The font size to use. | ||
* @param overflow The overflow strategy to use. See {@link TextOverflow}. | ||
@@ -96,2 +95,6 @@ * @param breaking The line breaking strategy to use. See {@link TextBreaking}. | ||
): string[] { | ||
// Temporary workaround for supporting double space line breaks in Kumu. | ||
// TODO: Remove this when we add support for function style properties. | ||
text = text.replace(/ /g, "\n"); | ||
// Checking the first letter is a cheap way to take a good guess at whether | ||
@@ -98,0 +101,0 @@ // we're working with a CJK string. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1177850
20803