web: bump mermaid from 9.4.0 to 10.0.0 in /web (#4752)

* web: bump mermaid from 9.4.0 to 10.0.0 in /web

Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 9.4.0 to 10.0.0.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/mermaid-js/mermaid/compare/v9.4.0...v10.0.0)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* update diagram element for mermaid v10

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
dependabot[bot] 2023-02-22 11:33:08 +01:00 committed by GitHub
parent 1f7178c3a8
commit 47e663f48c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 15 deletions

48
web/package-lock.json generated
View File

@ -62,7 +62,7 @@
"eslint-plugin-lit": "^1.8.2", "eslint-plugin-lit": "^1.8.2",
"fuse.js": "^6.6.2", "fuse.js": "^6.6.2",
"lit": "^2.6.1", "lit": "^2.6.1",
"mermaid": "^9.4.0", "mermaid": "^10.0.0",
"moment": "^2.29.4", "moment": "^2.29.4",
"prettier": "^2.8.4", "prettier": "^2.8.4",
"pyright": "^1.1.294", "pyright": "^1.1.294",
@ -7525,25 +7525,26 @@
} }
}, },
"node_modules/mermaid": { "node_modules/mermaid": {
"version": "9.4.0", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-9.4.0.tgz", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.0.0.tgz",
"integrity": "sha512-4PWbOND7CNRbjHrdG3WUUGBreKAFVnMhdlPjttuUkeHbCQmAHkwzSh5dGwbrKmXGRaR4uTvfFVYzUcg++h0DkA==", "integrity": "sha512-syS1qyYCd3EPXCVSpYtefY4D9z9WZAK8hFgjeHR9PAtanybLO162Tu7o5i/nZkqRrJq0Rk8RqskQlhBPgT8eBw==",
"dependencies": { "dependencies": {
"@braintree/sanitize-url": "^6.0.0", "@braintree/sanitize-url": "^6.0.0",
"cytoscape": "^3.23.0", "cytoscape": "^3.23.0",
"cytoscape-cose-bilkent": "^4.1.0", "cytoscape-cose-bilkent": "^4.1.0",
"cytoscape-fcose": "^2.1.0", "cytoscape-fcose": "^2.1.0",
"d3": "^7.0.0", "d3": "^7.4.0",
"dagre-d3-es": "7.0.8", "dagre-d3-es": "7.0.8",
"dompurify": "2.4.3", "dompurify": "2.4.3",
"elkjs": "^0.8.2", "elkjs": "^0.8.2",
"khroma": "^2.0.0", "khroma": "^2.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"moment": "^2.29.4", "moment-mini": "^2.29.4",
"non-layered-tidy-tree-layout": "^2.0.2", "non-layered-tidy-tree-layout": "^2.0.2",
"stylis": "^4.1.2", "stylis": "^4.1.2",
"ts-dedent": "^2.2.0", "ts-dedent": "^2.2.0",
"uuid": "^9.0.0" "uuid": "^9.0.0",
"web-worker": "^1.2.0"
} }
}, },
"node_modules/micromatch": { "node_modules/micromatch": {
@ -7620,6 +7621,11 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/moment-mini": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment-mini/-/moment-mini-2.29.4.tgz",
"integrity": "sha512-uhXpYwHFeiTbY9KSgPPRoo1nt8OxNVdMVoTBYHfSEKeRkIkwGpO+gERmhuhBtzfaeOyTkykSrm2+noJBgqt3Hg=="
},
"node_modules/moo": { "node_modules/moo": {
"version": "0.5.2", "version": "0.5.2",
"resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz",
@ -10028,6 +10034,11 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/web-worker": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz",
"integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA=="
},
"node_modules/webcomponent-qr-code": { "node_modules/webcomponent-qr-code": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/webcomponent-qr-code/-/webcomponent-qr-code-1.1.1.tgz", "resolved": "https://registry.npmjs.org/webcomponent-qr-code/-/webcomponent-qr-code-1.1.1.tgz",
@ -15742,25 +15753,26 @@
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="
}, },
"mermaid": { "mermaid": {
"version": "9.4.0", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/mermaid/-/mermaid-9.4.0.tgz", "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.0.0.tgz",
"integrity": "sha512-4PWbOND7CNRbjHrdG3WUUGBreKAFVnMhdlPjttuUkeHbCQmAHkwzSh5dGwbrKmXGRaR4uTvfFVYzUcg++h0DkA==", "integrity": "sha512-syS1qyYCd3EPXCVSpYtefY4D9z9WZAK8hFgjeHR9PAtanybLO162Tu7o5i/nZkqRrJq0Rk8RqskQlhBPgT8eBw==",
"requires": { "requires": {
"@braintree/sanitize-url": "^6.0.0", "@braintree/sanitize-url": "^6.0.0",
"cytoscape": "^3.23.0", "cytoscape": "^3.23.0",
"cytoscape-cose-bilkent": "^4.1.0", "cytoscape-cose-bilkent": "^4.1.0",
"cytoscape-fcose": "^2.1.0", "cytoscape-fcose": "^2.1.0",
"d3": "^7.0.0", "d3": "^7.4.0",
"dagre-d3-es": "7.0.8", "dagre-d3-es": "7.0.8",
"dompurify": "2.4.3", "dompurify": "2.4.3",
"elkjs": "^0.8.2", "elkjs": "^0.8.2",
"khroma": "^2.0.0", "khroma": "^2.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"moment": "^2.29.4", "moment-mini": "^2.29.4",
"non-layered-tidy-tree-layout": "^2.0.2", "non-layered-tidy-tree-layout": "^2.0.2",
"stylis": "^4.1.2", "stylis": "^4.1.2",
"ts-dedent": "^2.2.0", "ts-dedent": "^2.2.0",
"uuid": "^9.0.0" "uuid": "^9.0.0",
"web-worker": "^1.2.0"
} }
}, },
"micromatch": { "micromatch": {
@ -15816,6 +15828,11 @@
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==" "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
}, },
"moment-mini": {
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment-mini/-/moment-mini-2.29.4.tgz",
"integrity": "sha512-uhXpYwHFeiTbY9KSgPPRoo1nt8OxNVdMVoTBYHfSEKeRkIkwGpO+gERmhuhBtzfaeOyTkykSrm2+noJBgqt3Hg=="
},
"moo": { "moo": {
"version": "0.5.2", "version": "0.5.2",
"resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz",
@ -17609,6 +17626,11 @@
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz",
"integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==" "integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q=="
}, },
"web-worker": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz",
"integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA=="
},
"webcomponent-qr-code": { "webcomponent-qr-code": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/webcomponent-qr-code/-/webcomponent-qr-code-1.1.1.tgz", "resolved": "https://registry.npmjs.org/webcomponent-qr-code/-/webcomponent-qr-code-1.1.1.tgz",

View File

@ -106,7 +106,7 @@
"eslint-plugin-lit": "^1.8.2", "eslint-plugin-lit": "^1.8.2",
"fuse.js": "^6.6.2", "fuse.js": "^6.6.2",
"lit": "^2.6.1", "lit": "^2.6.1",
"mermaid": "^9.4.0", "mermaid": "^10.0.0",
"moment": "^2.29.4", "moment": "^2.29.4",
"prettier": "^2.8.4", "prettier": "^2.8.4",
"pyright": "^1.1.294", "pyright": "^1.1.294",

View File

@ -6,6 +6,7 @@ import mermaid from "mermaid";
import { CSSResult, TemplateResult, css, html } from "lit"; import { CSSResult, TemplateResult, css, html } from "lit";
import { customElement, property } from "lit/decorators.js"; import { customElement, property } from "lit/decorators.js";
import { unsafeHTML } from "lit/directives/unsafe-html.js"; import { unsafeHTML } from "lit/directives/unsafe-html.js";
import { until } from "lit/directives/until.js";
@customElement("ak-diagram") @customElement("ak-diagram")
export class Diagram extends AKElement { export class Diagram extends AKElement {
@ -74,6 +75,11 @@ export class Diagram extends AKElement {
if (!this.diagram) { if (!this.diagram) {
return html`<ak-empty-state ?loading=${true}></ak-empty-state>`; return html`<ak-empty-state ?loading=${true}></ak-empty-state>`;
} }
return html`${unsafeHTML(mermaid.render("graph", this.diagram))}`; return html`${until(
mermaid.render("graph", this.diagram).then((r) => {
r.bindFunctions?.(this.shadowRoot as unknown as Element);
return unsafeHTML(r.svg);
}),
)}`;
} }
} }