@flourish/layout
Advanced tools
+3
-3
| { | ||
| "name": "@flourish/layout", | ||
| "type": "module", | ||
| "version": "8.7.2", | ||
| "version": "8.7.3", | ||
| "private": false, | ||
@@ -48,6 +48,6 @@ "description": "Flourish module to control layouts", | ||
| "file-saver-es": "^2.0.5", | ||
| "@flourish/interpreter": "^9.2.0", | ||
| "@flourish/formatters": "^2.3.0", | ||
| "@flourish/interpreter": "^9.2.0", | ||
| "@flourish/pocket-knife": "^2.3.0", | ||
| "@flourish/number-formatter": "^2.0.0", | ||
| "@flourish/pocket-knife": "^2.3.0", | ||
| "@flourish/utils-color": "^2.0.0" | ||
@@ -54,0 +54,0 @@ }, |
+3
-0
@@ -0,1 +1,4 @@ | ||
| # 8.7.3 | ||
| * Font loading should now work with relative as well as absolute URLs | ||
| # 8.7.2 | ||
@@ -2,0 +5,0 @@ * Bump to v8.7.1 of layout module |
@@ -14,2 +14,10 @@ import { state } from "../core/init.js"; | ||
| function toAbsoluteURL(url) { | ||
| try { | ||
| return new URL(url, document.baseURI).href; | ||
| } catch { | ||
| // if malformed, fall back without throwing | ||
| return url; | ||
| } | ||
| } | ||
| function appendFontSample(font) { | ||
@@ -67,2 +75,3 @@ if (!document.body.querySelector(".font-samples")) { | ||
| var font_already_loaded = false; | ||
| var font_url_absolute = toAbsoluteURL(font.url); | ||
@@ -72,3 +81,3 @@ var layout_fonts = document.head.querySelectorAll("link.layout-font"); | ||
| var font_el = layout_fonts[i]; | ||
| if (font_el.href == font.url) font_already_loaded = true; | ||
| if (font_el.href === font_url_absolute) font_already_loaded = true; | ||
| } | ||
@@ -92,3 +101,3 @@ | ||
| fonts.forEach(function (font) { | ||
| if (font && font.url == font_el.href) font_needed = true; | ||
| if (font && toAbsoluteURL(font.url) === font_el.href) font_needed = true; | ||
| }); | ||
@@ -95,0 +104,0 @@ if (!font_needed) font_el.parentElement.removeChild(font_el); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
429832
0.15%8178
0.22%