nrdocs 0.1.7 → 0.1.8

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/bin.mjs CHANGED
@@ -6204,10 +6204,16 @@ function wrapInTemplate(options) {
6204
6204
  <script>
6205
6205
  (function(){
6206
6206
  function theme(){var t=document.documentElement.dataset.theme;return t==='dark'||t==='light'?t:(window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light');}
6207
+ function api(){
6208
+ var g=typeof globalThis!=='undefined'?globalThis:(typeof window!=='undefined'?window:null);
6209
+ if(!g||!g.mermaid)return null;
6210
+ var m=g.mermaid;
6211
+ return (m.default&&typeof m.default.initialize==='function')?m.default:m;
6212
+ }
6207
6213
  function initMermaid(){
6208
- if(typeof mermaid==='undefined')return;
6209
- mermaid.initialize({startOnLoad:true,theme:theme()==='dark'?'dark':'default'});
6210
- mermaid.run();
6214
+ var m=api();if(!m)return;
6215
+ m.initialize({startOnLoad:true,theme:theme()==='dark'?'dark':'default'});
6216
+ m.run();
6211
6217
  }
6212
6218
  document.addEventListener('DOMContentLoaded',initMermaid);
6213
6219
  document.addEventListener('nrdocs-theme-change',initMermaid);