@markdy/renderer-dom 1.4.22 → 1.4.23

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -6616,13 +6616,21 @@ function createDiagram(opts) {
6616
6616
  if (!ast.meta.explicitWidth) ast.meta.width = dims.width;
6617
6617
  if (!ast.meta.explicitHeight) ast.meta.height = dims.height;
6618
6618
  }
6619
- const hasExplicitTheme = Boolean(ast.meta.explicitTheme === true && ast.meta.theme !== "auto");
6620
6619
  const optionsDefaultLight = defaultThemes?.light ?? defaultLightTheme;
6621
6620
  const optionsDefaultDark = defaultThemes?.dark ?? defaultDarkTheme;
6622
6621
  const explicitDefaults = {
6623
6622
  light: ast.meta.defaultThemes?.light ?? optionsDefaultLight,
6624
6623
  dark: ast.meta.defaultThemes?.dark ?? optionsDefaultDark
6625
6624
  };
6625
+ const hasScriptDualThemes = Boolean(ast.meta.defaultThemes?.light || ast.meta.defaultThemes?.dark);
6626
+ const hasOptionsDualThemes = Boolean(explicitDefaults.light || explicitDefaults.dark);
6627
+ const win = typeof window !== "undefined" ? window : null;
6628
+ const hasGlobalDualThemes = Boolean(
6629
+ win && Boolean(win.__MARKDY_DEFAULT_THEMES__?.light || win.__MARKDY_DEFAULT_THEMES__?.dark)
6630
+ );
6631
+ const hasExplicitTheme = Boolean(
6632
+ ast.meta.explicitTheme === true && ast.meta.theme !== "auto" && !hasScriptDualThemes && !hasOptionsDualThemes && !hasGlobalDualThemes
6633
+ );
6626
6634
  const initialTheme = hasExplicitTheme ? ast.meta.theme : detectHostTheme(container, explicitDefaults);
6627
6635
  const plan = compilePlan(ast, resolveTheme2(initialTheme));
6628
6636
  let hostThemeObserver = null;
@@ -7516,6 +7524,10 @@ function createDiagram(opts) {
7516
7524
  applyThemeVariables(container, newTheme);
7517
7525
  container.style.background = newTheme.canvas;
7518
7526
  container.style.color = newTheme.text;
7527
+ if (container.parentElement && container.parentElement.classList.contains("markdy-root")) {
7528
+ container.parentElement.style.background = newTheme.canvas;
7529
+ applyThemeVariables(container.parentElement, newTheme);
7530
+ }
7519
7531
  applyThemeVariables(viewport, newTheme);
7520
7532
  viewport.style.background = newTheme.canvas;
7521
7533
  viewport.style.color = newTheme.text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/renderer-dom",
3
- "version": "1.4.22",
3
+ "version": "1.4.23",
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",
@@ -44,7 +44,7 @@
44
44
  "access": "public"
45
45
  },
46
46
  "dependencies": {
47
- "@markdy/core": "1.4.22",
47
+ "@markdy/core": "^1.4.23",
48
48
  "html2canvas": "^1.4.1"
49
49
  },
50
50
  "devDependencies": {