diff --git a/.vite/build.ts b/.vite/build.ts index 360f878ba..cf52cd50a 100644 --- a/.vite/build.ts +++ b/.vite/build.ts @@ -23,23 +23,13 @@ const packageOptions = { 'mermaid-mindmap': { name: 'mermaid-mindmap', packageName: 'mermaid-mindmap', - file: 'diagram-definition.ts', - }, - 'mermaid-mindmap-detector': { - name: 'mermaid-mindmap-detector', - packageName: 'mermaid-mindmap', - file: 'detector.ts', - }, - 'mermaid-example-diagram': { - name: 'mermaid-example-diagram', - packageName: 'mermaid-example-diagram', - file: 'diagram-definition.ts', - }, - 'mermaid-example-diagram-detector': { - name: 'mermaid-example-diagram-detector', - packageName: 'mermaid-example-diagram', file: 'detector.ts', }, + // 'mermaid-example-diagram-detector': { + // name: 'mermaid-example-diagram-detector', + // packageName: 'mermaid-example-diagram', + // file: 'detector.ts', + // }, }; interface BuildOptions { diff --git a/docs/index.html b/docs/index.html index abbd23e28..e757a8e78 100644 --- a/docs/index.html +++ b/docs/index.html @@ -49,10 +49,9 @@
diff --git a/tests/webpack/src/index.js b/tests/webpack/src/index.js index e1d5cad6a..899f66596 100644 --- a/tests/webpack/src/index.js +++ b/tests/webpack/src/index.js @@ -1,6 +1,38 @@ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable no-console */ const mermaid = require('mermaid'); -// import mermaid from 'mermaid'; +import mindmap from '@mermaid-js/mermaid-mindmap'; -console.log(mermaid); +const render = async (graph) => { + const svg = await mermaid.renderAsync('dummy', graph); + console.log(svg); + document.getElementById('graphDiv').innerHTML = svg; +}; + +const load = async () => { + await mermaid.registerExternalDiagrams([mindmap]); + await render('info'); + + setTimeout(async () => { + await render(`mindmap + root((mindmap)) + Origins + Long history + ::icon(fa fa-book) + Popularisation + British popular psychology author Tony Buzan + Research + On effectivness
and features + On Automatic creation + Uses + Creative techniques + Strategic planning + Argument mapping + Tools + Pen and paper + Mermaid + `); + }, 2500); +}; + +window.addEventListener('load', load, false);