@markdy/renderer-dom 1.4.17 → 1.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -7
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6301,12 +6301,20 @@ function buildBeatCaptionAnimations(beats, layer) {
|
|
|
6301
6301
|
function isDarkBgColor(colorStr) {
|
|
6302
6302
|
if (!colorStr || colorStr === "transparent" || colorStr === "rgba(0, 0, 0, 0)") return null;
|
|
6303
6303
|
const match = colorStr.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/i);
|
|
6304
|
-
if (
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6304
|
+
if (match) {
|
|
6305
|
+
const r = parseInt(match[1], 10);
|
|
6306
|
+
const g = parseInt(match[2], 10);
|
|
6307
|
+
const b = parseInt(match[3], 10);
|
|
6308
|
+
const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
6309
|
+
return luma < 128;
|
|
6310
|
+
}
|
|
6311
|
+
const oklMatch = colorStr.match(/ok(?:lch|lab)\(\s*([\d.]+)(%?)/i);
|
|
6312
|
+
if (oklMatch) {
|
|
6313
|
+
let l = parseFloat(oklMatch[1]);
|
|
6314
|
+
if (oklMatch[2] === "%") l /= 100;
|
|
6315
|
+
return l < 0.5;
|
|
6316
|
+
}
|
|
6317
|
+
return null;
|
|
6310
6318
|
}
|
|
6311
6319
|
function checkElementTheme(el, lightTheme = "paper", darkTheme = "nebula") {
|
|
6312
6320
|
const themeAttr = el.getAttribute("data-theme") || el.dataset.theme || el.getAttribute("data-mode") || el.getAttribute("data-bs-theme") || el.getAttribute("data-color-mode") || el.getAttribute("data-color-scheme");
|
|
@@ -6377,7 +6385,7 @@ function detectHostTheme(container, defaults) {
|
|
|
6377
6385
|
if (bodyCheck) return bodyCheck;
|
|
6378
6386
|
}
|
|
6379
6387
|
if (typeof window !== "undefined" && typeof window.getComputedStyle === "function") {
|
|
6380
|
-
let bgEl = container ?? document.body ?? null;
|
|
6388
|
+
let bgEl = (container ? container.parentElement : null) ?? document.body ?? null;
|
|
6381
6389
|
while (bgEl) {
|
|
6382
6390
|
try {
|
|
6383
6391
|
const bg = window.getComputedStyle(bgEl).backgroundColor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/renderer-dom",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.18",
|
|
4
4
|
"description": "Browser renderer for diagram-native animated MarkdyScript architecture diagrams, built on the Web Animations API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"html2canvas": "^1.4.1",
|
|
49
|
-
"@markdy/core": "1.4.
|
|
49
|
+
"@markdy/core": "1.4.18"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"jsdom": "^29.1.1",
|
|
53
53
|
"tsup": "^8.5.1",
|
|
54
54
|
"typescript": "^5.9.3",
|
|
55
55
|
"vitest": "^4.1.7",
|
|
56
|
-
"@markdy/stdlib-systems": "1.4.
|
|
56
|
+
"@markdy/stdlib-systems": "1.4.18"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsup",
|