mirror of
https://github.com/symfony/web-profiler-bundle.git
synced 2026-03-24 00:02:13 +01:00
[WebProfilerBundle] Inline flowchart-only Mermaid version
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -2,3 +2,4 @@
|
||||
/phpunit.xml.dist export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/Resources/views/Script/Mermaid/Makefile export-ignore
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
vendor/
|
||||
composer.lock
|
||||
phpunit.xml
|
||||
/Resources/views/Script/Mermaid/repo-*
|
||||
|
||||
@@ -132,8 +132,8 @@
|
||||
<p>There are no workflows configured.</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<script type="module">
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
|
||||
<script>
|
||||
{{ source('@WebProfiler/Script/Mermaid/mermaid-flowchart-v2.min.js') }}
|
||||
const isDarkMode = document.querySelector('body').classList.contains('theme-dark');
|
||||
mermaid.initialize({
|
||||
flowchart: { useMaxWidth: false },
|
||||
|
||||
32
Resources/views/Script/Mermaid/Makefile
Normal file
32
Resources/views/Script/Mermaid/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
define diagram-orchestration
|
||||
import { diagram as flowchartV2 } from '../diagrams/flowchart/flowDiagram-v2.js';
|
||||
import { registerDiagram } from './diagramAPI.js';
|
||||
|
||||
let hasLoadedDiagrams = false;
|
||||
export const addDiagrams = () => {
|
||||
if (hasLoadedDiagrams) {
|
||||
return;
|
||||
}
|
||||
hasLoadedDiagrams = true;
|
||||
registerDiagram('flowchart-v2', flowchartV2, () => true);
|
||||
};
|
||||
endef
|
||||
|
||||
override tag := v10.9.0
|
||||
|
||||
.PHONY: mermaid-flowchart-v2.min.js
|
||||
mermaid-flowchart-v2.min.js: | repo-$(tag)/node_modules
|
||||
$(file >repo-$(tag)/packages/mermaid/src/diagram-api/diagram-orchestration.ts,$(diagram-orchestration))
|
||||
pnpm -C repo-$(tag) run build
|
||||
cp repo-$(tag)/packages/mermaid/dist/mermaid.min.js $@
|
||||
|
||||
repo-$(tag)/node_modules: | repo-$(tag)
|
||||
pnpm -C $(@D) install --ignore-scripts
|
||||
|
||||
.SECONDARY: repo-$(tag)
|
||||
repo-$(tag):
|
||||
curl -fL https://github.com/mermaid-js/mermaid/archive/refs/tags/$(tag).tar.gz | tar -xz --strip-components=1 --one-top-level=$@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf ./repo-*
|
||||
483
Resources/views/Script/Mermaid/mermaid-flowchart-v2.min.js
vendored
Normal file
483
Resources/views/Script/Mermaid/mermaid-flowchart-v2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user