@legionworks/facet 1.9.0
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/LICENSE-APACHE +202 -0
- package/LICENSE-MIT +23 -0
- package/README.md +158 -0
- package/dist/gallery/chunk-4g8rem85.css +656 -0
- package/dist/gallery/chunk-c6s9k9ty.js +5970 -0
- package/dist/gallery/frame/artifact.css +8424 -0
- package/dist/gallery/frame/chunks/abnfDiagram-N423BO3Z-jj74szbm.js +155 -0
- package/dist/gallery/frame/chunks/architecture-TIHT7OUA-cvdjn7dt.js +10 -0
- package/dist/gallery/frame/chunks/architectureDiagram-T3A2C74G-n4z77eg6.js +8675 -0
- package/dist/gallery/frame/chunks/blockDiagram-VBNYF7ZC-7xsqzrd1.js +3529 -0
- package/dist/gallery/frame/chunks/c4Diagram-5PPSVZJV-z2zjs7wx.js +2413 -0
- package/dist/gallery/frame/chunks/classDiagram-JCYQIIEL-ve8rngqp.js +47 -0
- package/dist/gallery/frame/chunks/classDiagram-v2-OCEON4UE-8cfaxb8z.js +47 -0
- package/dist/gallery/frame/chunks/cose-bilkent-JH36ORCC-sn92qexx.js +4822 -0
- package/dist/gallery/frame/chunks/cynefin-VYW2F7L2-tqjv913d.js +10 -0
- package/dist/gallery/frame/chunks/cynefinDiagram-MW4NZA55-c1c0dj12.js +500 -0
- package/dist/gallery/frame/chunks/dagre-VZM6K2ZE-7tyg4yt2.js +476 -0
- package/dist/gallery/frame/chunks/diagram-7IWD3JNH-y4eng9sc.js +526 -0
- package/dist/gallery/frame/chunks/diagram-B4RE2ZJO-rn3p7j5h.js +673 -0
- package/dist/gallery/frame/chunks/diagram-LBJQPF4R-w4a2cm9q.js +255 -0
- package/dist/gallery/frame/chunks/diagram-Q27KOJAE-aqc2v7wy.js +575 -0
- package/dist/gallery/frame/chunks/diagram-UB23O5K3-xncy8nyd.js +355 -0
- package/dist/gallery/frame/chunks/ebnfDiagram-BXEA7PRR-acwgxz16.js +175 -0
- package/dist/gallery/frame/chunks/erDiagram-JOGREHBK-mzp5nswt.js +1332 -0
- package/dist/gallery/frame/chunks/eventmodeling-45OFAUF4-sg07qr0c.js +10 -0
- package/dist/gallery/frame/chunks/flowDiagram-UKHOOZJN-2e5ygs44.js +29 -0
- package/dist/gallery/frame/chunks/ganttDiagram-PKOTCBZU-p2hhh7hr.js +2620 -0
- package/dist/gallery/frame/chunks/gitGraph-TEB2WS4Q-j6kw0naa.js +10 -0
- package/dist/gallery/frame/chunks/gitGraphDiagram-DS77QQ5N-4z9z8wjm.js +1347 -0
- package/dist/gallery/frame/chunks/info-DKCQHKI2-mpt80jd3.js +10 -0
- package/dist/gallery/frame/chunks/infoDiagram-6WML65LV-5rqm3mgg.js +65 -0
- package/dist/gallery/frame/chunks/ishikawaDiagram-WSZJBQD7-b51z96jy.js +975 -0
- package/dist/gallery/frame/chunks/journeyDiagram-NVQOT4AX-9jbfp0pk.js +1272 -0
- package/dist/gallery/frame/chunks/kanban-definition-27J2QSJJ-4x0vx4se.js +1116 -0
- package/dist/gallery/frame/chunks/katex-xfgk95tv.js +14034 -0
- package/dist/gallery/frame/chunks/markdown-1s5vwkf2.js +9 -0
- package/dist/gallery/frame/chunks/markdown-2h6bwsms.js +3239 -0
- package/dist/gallery/frame/chunks/markdown-2x113yh8.js +107 -0
- package/dist/gallery/frame/chunks/markdown-30b7rwmp.js +1943 -0
- package/dist/gallery/frame/chunks/markdown-356bfj4g.js +2031 -0
- package/dist/gallery/frame/chunks/markdown-44n9ea69.js +2406 -0
- package/dist/gallery/frame/chunks/markdown-56enrf2r.js +39 -0
- package/dist/gallery/frame/chunks/markdown-5avymm8t.js +725 -0
- package/dist/gallery/frame/chunks/markdown-6r4svars.js +33 -0
- package/dist/gallery/frame/chunks/markdown-6zz8efx2.js +24 -0
- package/dist/gallery/frame/chunks/markdown-7jp6prnb.js +19 -0
- package/dist/gallery/frame/chunks/markdown-809k7q41.js +55 -0
- package/dist/gallery/frame/chunks/markdown-82xmzhzd.js +1076 -0
- package/dist/gallery/frame/chunks/markdown-92n37gd4.js +7627 -0
- package/dist/gallery/frame/chunks/markdown-ag2sssf8.js +36 -0
- package/dist/gallery/frame/chunks/markdown-b4s7ntq2.js +19 -0
- package/dist/gallery/frame/chunks/markdown-c9k0fvp1.js +100 -0
- package/dist/gallery/frame/chunks/markdown-ceefymn8.js +125 -0
- package/dist/gallery/frame/chunks/markdown-d1wfbs70.js +243 -0
- package/dist/gallery/frame/chunks/markdown-dy5sgjhc.js +11022 -0
- package/dist/gallery/frame/chunks/markdown-dz3z5w30.js +30868 -0
- package/dist/gallery/frame/chunks/markdown-eg6ngz7y.js +30340 -0
- package/dist/gallery/frame/chunks/markdown-ff5wvb43.js +1149 -0
- package/dist/gallery/frame/chunks/markdown-ffg06nfz.js +86 -0
- package/dist/gallery/frame/chunks/markdown-fvfncadf.js +472 -0
- package/dist/gallery/frame/chunks/markdown-gvyszqpv.js +19 -0
- package/dist/gallery/frame/chunks/markdown-gx1p0ew0.js +88 -0
- package/dist/gallery/frame/chunks/markdown-gxye5frz.js +65 -0
- package/dist/gallery/frame/chunks/markdown-h7pzv34e.js +105 -0
- package/dist/gallery/frame/chunks/markdown-hab789t9.js +47 -0
- package/dist/gallery/frame/chunks/markdown-hjp6sj8t.js +125 -0
- package/dist/gallery/frame/chunks/markdown-jka64qgp.js +1993 -0
- package/dist/gallery/frame/chunks/markdown-k8xkn8mw.js +56 -0
- package/dist/gallery/frame/chunks/markdown-m7frq8x8.js +112 -0
- package/dist/gallery/frame/chunks/markdown-p740v4qm.js +36 -0
- package/dist/gallery/frame/chunks/markdown-pxfeh231.js +57 -0
- package/dist/gallery/frame/chunks/markdown-pzgd8z3s.js +87 -0
- package/dist/gallery/frame/chunks/markdown-qx3cngz2.js +1673 -0
- package/dist/gallery/frame/chunks/markdown-rawhfvvc.js +85 -0
- package/dist/gallery/frame/chunks/markdown-rd8w0ng9.js +49 -0
- package/dist/gallery/frame/chunks/markdown-rm2yxfjj.js +2773 -0
- package/dist/gallery/frame/chunks/markdown-s1jatrnk.js +993 -0
- package/dist/gallery/frame/chunks/markdown-sgfg5vvq.js +59 -0
- package/dist/gallery/frame/chunks/markdown-t4ethv9d.js +409 -0
- package/dist/gallery/frame/chunks/markdown-tnmabqvz.js +36 -0
- package/dist/gallery/frame/chunks/markdown-tvdpppw8.js +5292 -0
- package/dist/gallery/frame/chunks/markdown-v0x27twr.js +22 -0
- package/dist/gallery/frame/chunks/markdown-v14td68x.js +36 -0
- package/dist/gallery/frame/chunks/markdown-w6sgd54z.js +36 -0
- package/dist/gallery/frame/chunks/markdown-xw8dsk8b.js +2125 -0
- package/dist/gallery/frame/chunks/markdown-y18mve73.js +85 -0
- package/dist/gallery/frame/chunks/markdown-yengsms5.js +427 -0
- package/dist/gallery/frame/chunks/markdown-z1wc0v0d.js +1826 -0
- package/dist/gallery/frame/chunks/markdown-zazx9h4n.js +329 -0
- package/dist/gallery/frame/chunks/mermaid-de7p4v0x.js +30 -0
- package/dist/gallery/frame/chunks/mindmap-definition-FAOFIHXS-ra44cbem.js +1216 -0
- package/dist/gallery/frame/chunks/packet-7NZHBO7P-xppm5913.js +10 -0
- package/dist/gallery/frame/chunks/pegDiagram-VL7TDLO6-a2a4wg03.js +163 -0
- package/dist/gallery/frame/chunks/pie-RZYD4A2V-hnbxk152.js +10 -0
- package/dist/gallery/frame/chunks/pieDiagram-7S7Q4E2Y-f1vxjtmx.js +311 -0
- package/dist/gallery/frame/chunks/quadrantDiagram-CIZ2JOQS-ywafa6kh.js +1390 -0
- package/dist/gallery/frame/chunks/radar-I7S5WNFK-ewqd27se.js +10 -0
- package/dist/gallery/frame/chunks/railroad-3IZDKUUU-5hy4bdx3.js +10 -0
- package/dist/gallery/frame/chunks/railroad-abnf-AHOZXSZD-bh5sxz0d.js +10 -0
- package/dist/gallery/frame/chunks/railroad-ebnf-EBAXGLYW-6b9c3zeh.js +10 -0
- package/dist/gallery/frame/chunks/railroad-peg-LSFZ7HO6-avc8v39s.js +10 -0
- package/dist/gallery/frame/chunks/railroadDiagram-AXF67PYL-qc61wax4.js +131 -0
- package/dist/gallery/frame/chunks/requirementDiagram-LRYGKXZP-9bs4786c.js +1295 -0
- package/dist/gallery/frame/chunks/sankeyDiagram-W5VNT64P-awt1em8b.js +1339 -0
- package/dist/gallery/frame/chunks/sequenceDiagram-SI44F4Z6-qaf9mz3t.js +4324 -0
- package/dist/gallery/frame/chunks/sizeCapture-X5ZJPWSS-9fq685xd.js +64 -0
- package/dist/gallery/frame/chunks/stateDiagram-OKZ733FA-vx7a7hh0.js +456 -0
- package/dist/gallery/frame/chunks/stateDiagram-v2-UEYNNEHI-x4m6ws5t.js +46 -0
- package/dist/gallery/frame/chunks/swimlanes-SLNWSIFB-e4mxm1gh.js +8287 -0
- package/dist/gallery/frame/chunks/swimlanesDiagram-ULZ7WXOC-0h93e2qq.js +42 -0
- package/dist/gallery/frame/chunks/timeline-definition-Z64GVDOM-wp0bhbzg.js +1549 -0
- package/dist/gallery/frame/chunks/treeView-QDETBFTQ-hcx7n0vt.js +10 -0
- package/dist/gallery/frame/chunks/treemap-6X3UGDF4-av02skdw.js +10 -0
- package/dist/gallery/frame/chunks/vennDiagram-T6HMQDX7-pmvk1p7n.js +2566 -0
- package/dist/gallery/frame/chunks/wardley-OPB4EBWU-njsp6e40.js +10 -0
- package/dist/gallery/frame/chunks/wardleyDiagram-T6FBY63Y-eggmnv4z.js +979 -0
- package/dist/gallery/frame/chunks/xychartDiagram-ELKLHX3M-q40tnpe5.js +1954 -0
- package/dist/gallery/frame/frame.css +183 -0
- package/dist/gallery/frame/runtime/chart.js +42744 -0
- package/dist/gallery/frame/runtime/html.js +14 -0
- package/dist/gallery/frame/runtime/markdown.js +1403 -0
- package/dist/gallery/frame/runtime/mermaid.js +32 -0
- package/dist/gallery/frame/runtime/svg.js +14 -0
- package/dist/gallery/frame/runtime/tsx.js +52 -0
- package/dist/gallery/index.html +104 -0
- package/docs/reference/cli.md +163 -0
- package/docs/reference/export.md +106 -0
- package/docs/reference/html.md +215 -0
- package/docs/reference/http.md +85 -0
- package/docs/reference/mcp.md +78 -0
- package/docs/reference/security.md +119 -0
- package/docs/reference/storage.md +93 -0
- package/docs/reference/tsx.md +101 -0
- package/docs/reference/validation.md +212 -0
- package/package.json +89 -0
- package/scripts/build-gallery.ts +127 -0
- package/scripts/launch-netns.sh +67 -0
- package/skills/facet/SKILL.md +100 -0
- package/src/cli/client.ts +311 -0
- package/src/cli/commands/create.ts +49 -0
- package/src/cli/commands/doctor.ts +249 -0
- package/src/cli/commands/export.ts +179 -0
- package/src/cli/commands/instantiate.ts +35 -0
- package/src/cli/commands/list.ts +49 -0
- package/src/cli/commands/open.ts +75 -0
- package/src/cli/commands/pin.ts +39 -0
- package/src/cli/commands/promote.ts +49 -0
- package/src/cli/commands/publish.ts +122 -0
- package/src/cli/commands/read-back.ts +56 -0
- package/src/cli/commands/status.ts +114 -0
- package/src/cli/commands/watch.ts +146 -0
- package/src/cli/main.ts +522 -0
- package/src/cli/output.ts +106 -0
- package/src/cli/parser.ts +376 -0
- package/src/cli/presenter.ts +212 -0
- package/src/cli/service-metadata.ts +134 -0
- package/src/cli/spawn-service.ts +326 -0
- package/src/css.d.ts +4 -0
- package/src/gallery-web/app.ts +1581 -0
- package/src/gallery-web/export-menu.ts +121 -0
- package/src/gallery-web/export.ts +112 -0
- package/src/gallery-web/favicon.ts +54 -0
- package/src/gallery-web/frame/entries/chart.ts +6 -0
- package/src/gallery-web/frame/entries/html.ts +6 -0
- package/src/gallery-web/frame/entries/markdown.ts +6 -0
- package/src/gallery-web/frame/entries/mermaid.ts +6 -0
- package/src/gallery-web/frame/entries/svg.ts +6 -0
- package/src/gallery-web/frame/entries/tsx.ts +6 -0
- package/src/gallery-web/frame/frame-payload.ts +91 -0
- package/src/gallery-web/frame/renderer-validation.ts +13 -0
- package/src/gallery-web/frame/renderers/chart.ts +182 -0
- package/src/gallery-web/frame/renderers/dompurify-shim.ts +112 -0
- package/src/gallery-web/frame/renderers/html.ts +48 -0
- package/src/gallery-web/frame/renderers/markdown.ts +81 -0
- package/src/gallery-web/frame/renderers/mermaid.ts +120 -0
- package/src/gallery-web/frame/renderers/registry.ts +260 -0
- package/src/gallery-web/frame/renderers/svg.ts +393 -0
- package/src/gallery-web/frame/renderers/tsx.ts +61 -0
- package/src/gallery-web/frame/runtime.ts +501 -0
- package/src/gallery-web/frame/styles/artifact.css +8424 -0
- package/src/gallery-web/frame/styles/frame.css +183 -0
- package/src/gallery-web/frame/styles/html-source.css +23 -0
- package/src/gallery-web/frame/view-box.ts +33 -0
- package/src/gallery-web/frame-html.ts +72 -0
- package/src/gallery-web/index.html +104 -0
- package/src/gallery-web/session.ts +107 -0
- package/src/gallery-web/sse-client.ts +212 -0
- package/src/gallery-web/styles/app.css +420 -0
- package/src/gallery-web/styles/tokens.css +112 -0
- package/src/gallery-web/styles/verdict.css +186 -0
- package/src/gallery-web/swap.ts +64 -0
- package/src/gallery-web/theme.ts +40 -0
- package/src/gallery-web/view-state.ts +93 -0
- package/src/harness-adapters/claude-code/README.md +10 -0
- package/src/harness-adapters/claude-code/facet.sh +4 -0
- package/src/harness-adapters/codex/README.md +10 -0
- package/src/harness-adapters/codex/facet.sh +4 -0
- package/src/harness-adapters/mcp/README.md +13 -0
- package/src/harness-adapters/mcp/cli-bridge.ts +216 -0
- package/src/harness-adapters/mcp/main.ts +15 -0
- package/src/harness-adapters/mcp/server.ts +164 -0
- package/src/harness-adapters/mcp/tool-schemas.ts +53 -0
- package/src/harness-adapters/opencode/README.md +10 -0
- package/src/harness-adapters/opencode/facet.sh +4 -0
- package/src/runtime/compiled-entrypoints.ts +69 -0
- package/src/service/dispatcher.ts +717 -0
- package/src/service/export.ts +218 -0
- package/src/service/http-utils.ts +55 -0
- package/src/service/lexical/expectations.ts +210 -0
- package/src/service/lifecycle/idle-controller.ts +125 -0
- package/src/service/lifecycle/orphan-cleanup.ts +128 -0
- package/src/service/lifecycle/process-lock.ts +235 -0
- package/src/service/main.ts +136 -0
- package/src/service/process.ts +240 -0
- package/src/service/router-guards.ts +239 -0
- package/src/service/router.ts +627 -0
- package/src/service/security/auth.ts +168 -0
- package/src/service/security/host-origin.ts +138 -0
- package/src/service/security/http-guards.ts +13 -0
- package/src/service/security/leases.ts +182 -0
- package/src/service/security/token-store.ts +138 -0
- package/src/service/server.ts +356 -0
- package/src/service/store/database.ts +61 -0
- package/src/service/store/evidence-retention.ts +234 -0
- package/src/service/store/migrations.ts +167 -0
- package/src/service/store/repository-lifecycle.ts +121 -0
- package/src/service/store/repository.ts +732 -0
- package/src/service/store/schema.ts +218 -0
- package/src/service/stored-verdict.ts +97 -0
- package/src/service/stream.ts +301 -0
- package/src/service/verdict-enrichment.ts +45 -0
- package/src/shared/build/frame-bundle-plugins.ts +61 -0
- package/src/shared/build-mode.ts +28 -0
- package/src/shared/config/evidence-read.ts +98 -0
- package/src/shared/config/limits.ts +56 -0
- package/src/shared/config/paths.ts +96 -0
- package/src/shared/contracts/artifact-types.ts +2 -0
- package/src/shared/contracts/artifact.ts +98 -0
- package/src/shared/contracts/commands/_shared.ts +59 -0
- package/src/shared/contracts/commands/guards.ts +86 -0
- package/src/shared/contracts/commands/index.ts +204 -0
- package/src/shared/contracts/commands/names.ts +35 -0
- package/src/shared/contracts/commands/requests.ts +149 -0
- package/src/shared/contracts/commands/results.ts +200 -0
- package/src/shared/contracts/envelope.ts +140 -0
- package/src/shared/contracts/events.ts +41 -0
- package/src/shared/contracts/observed-counts.ts +19 -0
- package/src/shared/contracts/renderers.ts +6 -0
- package/src/shared/contracts/validation.ts +296 -0
- package/src/shared/errors/facet-error.ts +127 -0
- package/src/shared/errors/store-error.ts +68 -0
- package/src/shared/evidence-image.ts +37 -0
- package/src/shared/export.ts +31 -0
- package/src/shared/html/policy.ts +108 -0
- package/src/shared/html/style-vocabulary.ts +352 -0
- package/src/shared/logging/logger.ts +108 -0
- package/src/shared/logging/redact.ts +49 -0
- package/src/shared/security/frozen-csp.ts +13 -0
- package/src/shared/storage-version.ts +2 -0
- package/src/shared/tsx/execution.ts +29 -0
- package/src/shared/tsx/import-policy.ts +94 -0
- package/src/shared/util/dir-permissions.ts +94 -0
- package/src/shared/util/mermaid-nodes.ts +230 -0
- package/src/shared/util/process.ts +67 -0
- package/src/shared/util/time.ts +21 -0
- package/src/shared/version.ts +3 -0
- package/src/validation/sandbox/limits.ts +41 -0
- package/src/validation/sandbox/netns.ts +177 -0
- package/src/validation/tier0/chart.ts +177 -0
- package/src/validation/tier0/dom-shim.ts +54 -0
- package/src/validation/tier0/html.ts +408 -0
- package/src/validation/tier0/markdown.ts +285 -0
- package/src/validation/tier0/mermaid.ts +98 -0
- package/src/validation/tier0/runner.ts +504 -0
- package/src/validation/tier0/svg.ts +321 -0
- package/src/validation/tier0/tsx/allowlist-resolver.ts +77 -0
- package/src/validation/tier0/tsx/ast-policy-capabilities.ts +238 -0
- package/src/validation/tier0/tsx/ast-policy-shared.ts +71 -0
- package/src/validation/tier0/tsx/ast-policy.ts +181 -0
- package/src/validation/tier0/tsx/compiler.ts +156 -0
- package/src/validation/tier0/worker-dispatch.ts +211 -0
- package/src/validation/tier0/worker-entry.ts +96 -0
- package/src/validation/tier0/worker-input.ts +75 -0
- package/src/validation/tier1/browser-process.ts +147 -0
- package/src/validation/tier1/cdp-pipe.ts +281 -0
- package/src/validation/tier1/entries/chart.ts +5 -0
- package/src/validation/tier1/entries/html.ts +6 -0
- package/src/validation/tier1/entries/markdown.ts +5 -0
- package/src/validation/tier1/entries/mermaid.ts +5 -0
- package/src/validation/tier1/entries/svg.ts +5 -0
- package/src/validation/tier1/entries/tsx.ts +5 -0
- package/src/validation/tier1/frame-target.ts +162 -0
- package/src/validation/tier1/harness-entry.ts +261 -0
- package/src/validation/tier1/harness.ts +215 -0
- package/src/validation/tier1/isolated-probe.ts +94 -0
- package/src/validation/tier1/launcher.ts +177 -0
- package/src/validation/tier1/limits.ts +80 -0
- package/src/validation/tier1/nonce.ts +17 -0
- package/src/validation/tier1/protocol-probe.ts +519 -0
- package/src/validation/tier1/runner.ts +1122 -0
- package/src/validation/tier1/verdict.ts +246 -0
- package/src/validation/tier1/webp.ts +69 -0
- package/templates/README.md +88 -0
- package/templates/bar-compare.vl.json +63 -0
- package/templates/capacity-report.tsx +102 -0
- package/templates/decision-record.md +24 -0
- package/templates/deployment-state.mmd +40 -0
- package/templates/exemplar.md +91 -0
- package/templates/facet-story.tsx +799 -0
- package/templates/fleet-dashboard.html +141 -0
- package/templates/html-release-ledger.html +91 -0
- package/templates/html-status-report.html +114 -0
- package/templates/incident-console.tsx +147 -0
- package/templates/legion-boundaries.mmd +23 -0
- package/templates/legion-flow.mmd +15 -0
- package/templates/legion-sequence.mmd +14 -0
- package/templates/legion-state.mmd +7 -0
- package/templates/metric-card.svg +29 -0
- package/templates/observability-map.svg +101 -0
- package/templates/pipeline-audit.md +108 -0
- package/templates/release-metrics.vl.json +98 -0
- package/templates/service-topology.mmd +47 -0
- package/templates/status-report.md +32 -0
- package/templates/system-map.svg +53 -0
- package/templates/timeseries.vl.json +71 -0
- package/templates/tsx-interactive-counter.tsx +19 -0
- package/templates/tsx-status-report.tsx +31 -0
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
import {
|
|
2
|
+
populateCommonDb
|
|
3
|
+
} from "./markdown-b4s7ntq2.js";
|
|
4
|
+
import {
|
|
5
|
+
parse
|
|
6
|
+
} from "./markdown-ceefymn8.js";
|
|
7
|
+
import {
|
|
8
|
+
ImperativeState
|
|
9
|
+
} from "./markdown-7jp6prnb.js";
|
|
10
|
+
import"./markdown-gx1p0ew0.js";
|
|
11
|
+
import"./markdown-pxfeh231.js";
|
|
12
|
+
import"./markdown-y18mve73.js";
|
|
13
|
+
import"./markdown-2x113yh8.js";
|
|
14
|
+
import"./markdown-56enrf2r.js";
|
|
15
|
+
import"./markdown-ag2sssf8.js";
|
|
16
|
+
import"./markdown-tnmabqvz.js";
|
|
17
|
+
import"./markdown-hab789t9.js";
|
|
18
|
+
import"./markdown-gxye5frz.js";
|
|
19
|
+
import"./markdown-k8xkn8mw.js";
|
|
20
|
+
import"./markdown-p740v4qm.js";
|
|
21
|
+
import"./markdown-ffg06nfz.js";
|
|
22
|
+
import"./markdown-w6sgd54z.js";
|
|
23
|
+
import"./markdown-rawhfvvc.js";
|
|
24
|
+
import"./markdown-v14td68x.js";
|
|
25
|
+
import"./markdown-dz3z5w30.js";
|
|
26
|
+
import {
|
|
27
|
+
selectSvgElement
|
|
28
|
+
} from "./markdown-6zz8efx2.js";
|
|
29
|
+
import {
|
|
30
|
+
getIconSVG,
|
|
31
|
+
registerIconPacks
|
|
32
|
+
} from "./markdown-yengsms5.js";
|
|
33
|
+
import {
|
|
34
|
+
cleanAndMerge
|
|
35
|
+
} from "./markdown-ff5wvb43.js";
|
|
36
|
+
import"./markdown-pzgd8z3s.js";
|
|
37
|
+
import {
|
|
38
|
+
clear,
|
|
39
|
+
configureSvgSize,
|
|
40
|
+
defaultConfig_default,
|
|
41
|
+
getAccDescription,
|
|
42
|
+
getAccTitle,
|
|
43
|
+
getConfig,
|
|
44
|
+
getDiagramTitle,
|
|
45
|
+
sanitizeText,
|
|
46
|
+
setAccDescription,
|
|
47
|
+
setAccTitle,
|
|
48
|
+
setDiagramTitle
|
|
49
|
+
} from "./markdown-92n37gd4.js";
|
|
50
|
+
import {
|
|
51
|
+
log
|
|
52
|
+
} from "./markdown-xw8dsk8b.js";
|
|
53
|
+
import {
|
|
54
|
+
__name
|
|
55
|
+
} from "./markdown-1s5vwkf2.js";
|
|
56
|
+
import"./markdown-dy5sgjhc.js";
|
|
57
|
+
import"./markdown-809k7q41.js";
|
|
58
|
+
|
|
59
|
+
// node_modules/mermaid/dist/chunks/mermaid.core/diagram-7IWD3JNH.mjs
|
|
60
|
+
var ALL_BOX_CHARS = /[─━│┃└┗├┣]/;
|
|
61
|
+
var BRANCH_CHAR = /[└┗├┣]/;
|
|
62
|
+
var DASH_CHAR = /[─━]/;
|
|
63
|
+
var DECORATION_ONLY = /^[\s│┃]+$/;
|
|
64
|
+
var METADATA_LINE = /^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/;
|
|
65
|
+
var COMMENT_LINE = /^\s*%%/;
|
|
66
|
+
var INDENT_UNIT = " ";
|
|
67
|
+
function isBoxDrawingFormat(lines) {
|
|
68
|
+
return lines.some((line) => ALL_BOX_CHARS.test(line));
|
|
69
|
+
}
|
|
70
|
+
__name(isBoxDrawingFormat, "isBoxDrawingFormat");
|
|
71
|
+
function inferSegmentWidth(contentLines) {
|
|
72
|
+
for (const line of contentLines) {
|
|
73
|
+
const match = BRANCH_CHAR.exec(line);
|
|
74
|
+
if (match?.index && match.index > 0) {
|
|
75
|
+
return match.index;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return 4;
|
|
79
|
+
}
|
|
80
|
+
__name(inferSegmentWidth, "inferSegmentWidth");
|
|
81
|
+
function remapErrorLines(message, lineMap) {
|
|
82
|
+
return message.replace(/\bline\s+(\d+)\b/gi, (match, lineStr) => {
|
|
83
|
+
const line = parseInt(lineStr, 10);
|
|
84
|
+
const original = lineMap.get(line);
|
|
85
|
+
return original ? `line ${original}` : match;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
__name(remapErrorLines, "remapErrorLines");
|
|
89
|
+
function preprocessBoxDrawing(input) {
|
|
90
|
+
const lines = input.split(`
|
|
91
|
+
`);
|
|
92
|
+
const lineMap = /* @__PURE__ */ new Map;
|
|
93
|
+
let keywordIdx = -1;
|
|
94
|
+
for (const [i, line] of lines.entries()) {
|
|
95
|
+
if (line.trim() === "treeView-beta") {
|
|
96
|
+
keywordIdx = i;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (keywordIdx === -1) {
|
|
101
|
+
return { text: input, lineMap };
|
|
102
|
+
}
|
|
103
|
+
const contentLineTexts = [];
|
|
104
|
+
for (let i = keywordIdx + 1;i < lines.length; i++) {
|
|
105
|
+
const line = lines[i];
|
|
106
|
+
const trimmed = line.trim();
|
|
107
|
+
if (trimmed === "" || COMMENT_LINE.test(line) || METADATA_LINE.test(line)) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (DECORATION_ONLY.test(line)) {
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
contentLineTexts.push(line.replace(/\t/g, " "));
|
|
114
|
+
}
|
|
115
|
+
if (!isBoxDrawingFormat(contentLineTexts)) {
|
|
116
|
+
return { text: input, lineMap };
|
|
117
|
+
}
|
|
118
|
+
const segmentWidth = inferSegmentWidth(contentLineTexts);
|
|
119
|
+
const outputLines = [];
|
|
120
|
+
let outLineNo = 0;
|
|
121
|
+
for (let i = 0;i <= keywordIdx; i++) {
|
|
122
|
+
outputLines.push(lines[i]);
|
|
123
|
+
outLineNo++;
|
|
124
|
+
lineMap.set(outLineNo, i + 1);
|
|
125
|
+
}
|
|
126
|
+
for (let i = keywordIdx + 1;i < lines.length; i++) {
|
|
127
|
+
const line = lines[i];
|
|
128
|
+
const trimmed = line.trim();
|
|
129
|
+
const origLineNo = i + 1;
|
|
130
|
+
if (trimmed === "") {
|
|
131
|
+
outputLines.push(line);
|
|
132
|
+
outLineNo++;
|
|
133
|
+
lineMap.set(outLineNo, origLineNo);
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (COMMENT_LINE.test(line)) {
|
|
137
|
+
outputLines.push(line);
|
|
138
|
+
outLineNo++;
|
|
139
|
+
lineMap.set(outLineNo, origLineNo);
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (METADATA_LINE.test(line)) {
|
|
143
|
+
outputLines.push(line);
|
|
144
|
+
outLineNo++;
|
|
145
|
+
lineMap.set(outLineNo, origLineNo);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (DECORATION_ONLY.test(line)) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
const normalized = line.replace(/\t/g, " ");
|
|
152
|
+
const branchMatch = BRANCH_CHAR.exec(normalized);
|
|
153
|
+
if (branchMatch?.index !== undefined) {
|
|
154
|
+
const branchCol = branchMatch.index;
|
|
155
|
+
const depth = Math.round(branchCol / segmentWidth) + 1;
|
|
156
|
+
let pos = branchCol + 1;
|
|
157
|
+
while (pos < normalized.length && DASH_CHAR.test(normalized[pos])) {
|
|
158
|
+
pos++;
|
|
159
|
+
}
|
|
160
|
+
while (pos < normalized.length && normalized[pos] === " ") {
|
|
161
|
+
pos++;
|
|
162
|
+
}
|
|
163
|
+
const content = normalized.slice(pos).trimEnd();
|
|
164
|
+
if (!content) {
|
|
165
|
+
throw new Error(`Line ${origLineNo}: Empty node — expected a filename or directory name after the box-drawing prefix`);
|
|
166
|
+
}
|
|
167
|
+
const indent = INDENT_UNIT.repeat(depth);
|
|
168
|
+
outputLines.push(indent + content);
|
|
169
|
+
outLineNo++;
|
|
170
|
+
lineMap.set(outLineNo, origLineNo);
|
|
171
|
+
} else if (/^[\s─━│┃└┗├┣]+$/.test(normalized)) {
|
|
172
|
+
continue;
|
|
173
|
+
} else if (ALL_BOX_CHARS.test(normalized)) {
|
|
174
|
+
outputLines.push(line);
|
|
175
|
+
outLineNo++;
|
|
176
|
+
lineMap.set(outLineNo, origLineNo);
|
|
177
|
+
} else if (/^\s+/.test(normalized)) {
|
|
178
|
+
throw new Error(`Line ${origLineNo}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);
|
|
179
|
+
} else {
|
|
180
|
+
outputLines.push(line);
|
|
181
|
+
outLineNo++;
|
|
182
|
+
lineMap.set(outLineNo, origLineNo);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return { text: outputLines.join(`
|
|
186
|
+
`), lineMap };
|
|
187
|
+
}
|
|
188
|
+
__name(preprocessBoxDrawing, "preprocessBoxDrawing");
|
|
189
|
+
var state = new ImperativeState(() => ({
|
|
190
|
+
cnt: 1,
|
|
191
|
+
stack: [
|
|
192
|
+
{
|
|
193
|
+
id: 0,
|
|
194
|
+
level: -1,
|
|
195
|
+
name: "/",
|
|
196
|
+
nodeType: "directory",
|
|
197
|
+
children: []
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}));
|
|
201
|
+
var clear2 = /* @__PURE__ */ __name(() => {
|
|
202
|
+
state.reset();
|
|
203
|
+
clear();
|
|
204
|
+
}, "clear");
|
|
205
|
+
var getRoot = /* @__PURE__ */ __name(() => {
|
|
206
|
+
return state.records.stack[0];
|
|
207
|
+
}, "getRoot");
|
|
208
|
+
var getCount = /* @__PURE__ */ __name(() => state.records.cnt, "getCount");
|
|
209
|
+
var defaultConfig = defaultConfig_default.treeView;
|
|
210
|
+
var getConfig2 = /* @__PURE__ */ __name(() => {
|
|
211
|
+
return cleanAndMerge(defaultConfig, getConfig().treeView);
|
|
212
|
+
}, "getConfig");
|
|
213
|
+
var addNode = /* @__PURE__ */ __name((level, name, nodeType, cssClass, icon, description) => {
|
|
214
|
+
while (level <= state.records.stack[state.records.stack.length - 1].level) {
|
|
215
|
+
state.records.stack.pop();
|
|
216
|
+
}
|
|
217
|
+
const node = {
|
|
218
|
+
id: state.records.cnt++,
|
|
219
|
+
level,
|
|
220
|
+
name,
|
|
221
|
+
nodeType,
|
|
222
|
+
icon,
|
|
223
|
+
cssClass,
|
|
224
|
+
description,
|
|
225
|
+
children: []
|
|
226
|
+
};
|
|
227
|
+
state.records.stack[state.records.stack.length - 1].children.push(node);
|
|
228
|
+
state.records.stack.push(node);
|
|
229
|
+
}, "addNode");
|
|
230
|
+
var db = {
|
|
231
|
+
clear: clear2,
|
|
232
|
+
addNode,
|
|
233
|
+
getRoot,
|
|
234
|
+
getCount,
|
|
235
|
+
getConfig: getConfig2,
|
|
236
|
+
getAccTitle,
|
|
237
|
+
getAccDescription,
|
|
238
|
+
getDiagramTitle,
|
|
239
|
+
setAccDescription,
|
|
240
|
+
setAccTitle,
|
|
241
|
+
setDiagramTitle
|
|
242
|
+
};
|
|
243
|
+
var db_default = db;
|
|
244
|
+
var populate = /* @__PURE__ */ __name((ast) => {
|
|
245
|
+
populateCommonDb(ast, db_default);
|
|
246
|
+
for (const node of ast.nodes) {
|
|
247
|
+
const level = typeof node.indent === "number" ? node.indent : 0;
|
|
248
|
+
let name = node.name;
|
|
249
|
+
const isDirectory = name.endsWith("/");
|
|
250
|
+
if (isDirectory) {
|
|
251
|
+
name = name.slice(0, -1);
|
|
252
|
+
}
|
|
253
|
+
const nodeType = isDirectory ? "directory" : "file";
|
|
254
|
+
const cssClass = node.classAnnotation || undefined;
|
|
255
|
+
const rawIcon = node.iconAnnotation;
|
|
256
|
+
const icon = rawIcon !== undefined ? rawIcon || "none" : undefined;
|
|
257
|
+
const rawDesc = node.descAnnotation || undefined;
|
|
258
|
+
const description = rawDesc ? sanitizeText(rawDesc, getConfig()) : undefined;
|
|
259
|
+
db_default.addNode(level, name, nodeType, cssClass, icon, description);
|
|
260
|
+
}
|
|
261
|
+
}, "populate");
|
|
262
|
+
var parser = {
|
|
263
|
+
parse: /* @__PURE__ */ __name(async (input) => {
|
|
264
|
+
const { text, lineMap } = preprocessBoxDrawing(input);
|
|
265
|
+
try {
|
|
266
|
+
const ast = await parse("treeView", text);
|
|
267
|
+
log.debug(ast);
|
|
268
|
+
populate(ast);
|
|
269
|
+
} catch (error) {
|
|
270
|
+
if (lineMap.size > 0 && error instanceof Error) {
|
|
271
|
+
error.message = remapErrorLines(error.message, lineMap);
|
|
272
|
+
}
|
|
273
|
+
throw error;
|
|
274
|
+
}
|
|
275
|
+
}, "parse")
|
|
276
|
+
};
|
|
277
|
+
var treeViewIcons = {
|
|
278
|
+
prefix: "mermaid-treeview",
|
|
279
|
+
height: 24,
|
|
280
|
+
width: 24,
|
|
281
|
+
icons: {
|
|
282
|
+
folder: {
|
|
283
|
+
body: '<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'
|
|
284
|
+
},
|
|
285
|
+
file: {
|
|
286
|
+
body: '<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
function detectIcon(name, config) {
|
|
291
|
+
const filenameIcon = config?.filenameIcons?.[name];
|
|
292
|
+
if (filenameIcon) {
|
|
293
|
+
return filenameIcon;
|
|
294
|
+
}
|
|
295
|
+
const dotIdx = name.lastIndexOf(".");
|
|
296
|
+
if (dotIdx > 0) {
|
|
297
|
+
const ext = name.substring(dotIdx).toLowerCase();
|
|
298
|
+
const extensionIcons = config?.extensionIcons;
|
|
299
|
+
return extensionIcons?.[ext] ?? extensionIcons?.[ext.slice(1)];
|
|
300
|
+
}
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
__name(detectIcon, "detectIcon");
|
|
304
|
+
function qualifyIcon(icon, defaultIconPack) {
|
|
305
|
+
if (icon.includes(":")) {
|
|
306
|
+
return icon;
|
|
307
|
+
}
|
|
308
|
+
if (icon in treeViewIcons.icons || !defaultIconPack) {
|
|
309
|
+
return `${treeViewIcons.prefix}:${icon}`;
|
|
310
|
+
}
|
|
311
|
+
return `${defaultIconPack}:${icon}`;
|
|
312
|
+
}
|
|
313
|
+
__name(qualifyIcon, "qualifyIcon");
|
|
314
|
+
function getNodeIcon(node, config) {
|
|
315
|
+
if (node.icon === "none") {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
if (node.icon) {
|
|
319
|
+
return qualifyIcon(node.icon, config.defaultIconPack);
|
|
320
|
+
}
|
|
321
|
+
if (!config.showIcons) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (node.nodeType === "file") {
|
|
325
|
+
const detected = detectIcon(node.name, config);
|
|
326
|
+
if (detected === "none") {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (detected) {
|
|
330
|
+
return qualifyIcon(detected, config.defaultIconPack);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return `${treeViewIcons.prefix}:${node.nodeType === "directory" ? "folder" : "file"}`;
|
|
334
|
+
}
|
|
335
|
+
__name(getNodeIcon, "getNodeIcon");
|
|
336
|
+
registerIconPacks([
|
|
337
|
+
{
|
|
338
|
+
name: treeViewIcons.prefix,
|
|
339
|
+
icons: treeViewIcons
|
|
340
|
+
}
|
|
341
|
+
]);
|
|
342
|
+
var ICON_SIZE = 14;
|
|
343
|
+
var ICON_GAP = 4;
|
|
344
|
+
var DESC_GAP = 16;
|
|
345
|
+
var iconSymbolId = /* @__PURE__ */ __name((diagramId, icon) => `tv-icon-${diagramId}-${icon.replace(/[^\w-]/g, "-")}`, "iconSymbolId");
|
|
346
|
+
var injectIconDefs = /* @__PURE__ */ __name(async (svg, root, config, diagramId) => {
|
|
347
|
+
const usedIcons = /* @__PURE__ */ new Set;
|
|
348
|
+
const collect = /* @__PURE__ */ __name((node) => {
|
|
349
|
+
const icon = getNodeIcon(node, config);
|
|
350
|
+
if (icon) {
|
|
351
|
+
usedIcons.add(icon);
|
|
352
|
+
}
|
|
353
|
+
node.children.forEach(collect);
|
|
354
|
+
}, "collect");
|
|
355
|
+
collect(root);
|
|
356
|
+
if (usedIcons.size === 0) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
const iconSVGs = await Promise.all([...usedIcons].map(async (icon) => ({
|
|
360
|
+
icon,
|
|
361
|
+
svg: await getIconSVG(icon, {
|
|
362
|
+
height: ICON_SIZE,
|
|
363
|
+
width: ICON_SIZE
|
|
364
|
+
})
|
|
365
|
+
})));
|
|
366
|
+
const defs = svg.append("defs");
|
|
367
|
+
for (const { icon, svg: iconSVG } of iconSVGs) {
|
|
368
|
+
defs.append("g").attr("id", iconSymbolId(diagramId, icon)).html(iconSVG);
|
|
369
|
+
}
|
|
370
|
+
}, "injectIconDefs");
|
|
371
|
+
var positionLabel = /* @__PURE__ */ __name((x, y, node, domElem, config, diagramId) => {
|
|
372
|
+
const nodeGroup = domElem.append("g");
|
|
373
|
+
let cssClasses = "treeView-node-label";
|
|
374
|
+
if (node.nodeType === "directory") {
|
|
375
|
+
cssClasses += " treeView-node-dir";
|
|
376
|
+
}
|
|
377
|
+
if (node.cssClass) {
|
|
378
|
+
cssClasses += ` ${node.cssClass}`;
|
|
379
|
+
}
|
|
380
|
+
const iconOffset = ICON_SIZE + ICON_GAP;
|
|
381
|
+
const icon = getNodeIcon(node, config);
|
|
382
|
+
const showIcon = icon !== undefined;
|
|
383
|
+
if (icon) {
|
|
384
|
+
nodeGroup.append("use").attr("xlink:href", `#${iconSymbolId(diagramId, icon)}`).attr("x", x + config.paddingX).attr("y", y + config.paddingY).attr("class", "treeView-node-icon");
|
|
385
|
+
}
|
|
386
|
+
const label = nodeGroup.append("text").text(node.name).attr("dominant-baseline", "middle").attr("class", cssClasses);
|
|
387
|
+
const { height: labelHeight, width: labelWidth } = label.node().getBBox();
|
|
388
|
+
const height = labelHeight + config.paddingY * 2;
|
|
389
|
+
const labelX = x + config.paddingX + (showIcon ? iconOffset : 0);
|
|
390
|
+
label.attr("x", labelX);
|
|
391
|
+
label.attr("y", y + height / 2);
|
|
392
|
+
const labelRightEdge = labelX + labelWidth;
|
|
393
|
+
const width = labelWidth + config.paddingX * 2 + (showIcon ? iconOffset : 0);
|
|
394
|
+
node.BBox = { x, y, width, height };
|
|
395
|
+
if (node.cssClass?.split(/\s+/).includes("highlight")) {
|
|
396
|
+
nodeGroup.insert("rect", ":first-child").attr("x", x).attr("y", y + 1).attr("width", 0).attr("height", height - 2).attr("rx", 3).attr("class", "treeView-highlight-bg");
|
|
397
|
+
}
|
|
398
|
+
return { node, nodeGroup, labelRightEdge, centerY: y + height / 2 };
|
|
399
|
+
}, "positionLabel");
|
|
400
|
+
var positionLine = /* @__PURE__ */ __name((domElem, x1, y1, x2, y2, lineThickness) => {
|
|
401
|
+
return domElem.append("line").attr("x1", x1).attr("y1", y1).attr("x2", x2).attr("y2", y2).attr("stroke-width", lineThickness).attr("class", "treeView-node-line");
|
|
402
|
+
}, "positionLine");
|
|
403
|
+
var drawTree = /* @__PURE__ */ __name((elem, root, config, diagramId) => {
|
|
404
|
+
let totalHeight = 0;
|
|
405
|
+
let totalWidth = 0;
|
|
406
|
+
const renderInfos = [];
|
|
407
|
+
const drawNode = /* @__PURE__ */ __name((elem2, node, config2, depth) => {
|
|
408
|
+
const indent = depth * (config2.rowIndent + config2.paddingX);
|
|
409
|
+
const info = positionLabel(indent, totalHeight, node, elem2, config2, diagramId);
|
|
410
|
+
renderInfos.push(info);
|
|
411
|
+
const { height, width } = node.BBox;
|
|
412
|
+
positionLine(elem2, indent - config2.rowIndent, totalHeight + height / 2, indent, totalHeight + height / 2, config2.lineThickness);
|
|
413
|
+
totalWidth = Math.max(totalWidth, indent + width);
|
|
414
|
+
totalHeight += height;
|
|
415
|
+
}, "drawNode");
|
|
416
|
+
const processNode = /* @__PURE__ */ __name((node, depth = 0) => {
|
|
417
|
+
drawNode(elem, node, config, depth);
|
|
418
|
+
node.children.forEach((child) => {
|
|
419
|
+
processNode(child, depth + 1);
|
|
420
|
+
});
|
|
421
|
+
const { x, y, height } = node.BBox;
|
|
422
|
+
if (node.children.length) {
|
|
423
|
+
const { y: endY, height: endHeight } = node.children[node.children.length - 1].BBox;
|
|
424
|
+
positionLine(elem, x + config.paddingX, y + height, x + config.paddingX, endY + endHeight / 2 + config.lineThickness / 2, config.lineThickness);
|
|
425
|
+
}
|
|
426
|
+
}, "processNode");
|
|
427
|
+
processNode(root);
|
|
428
|
+
const nodesWithDesc = renderInfos.filter((ri) => ri.node.description);
|
|
429
|
+
if (nodesWithDesc.length > 0) {
|
|
430
|
+
const maxLabelRight = Math.max(...renderInfos.map((ri) => ri.labelRightEdge));
|
|
431
|
+
const descX = maxLabelRight + DESC_GAP;
|
|
432
|
+
for (const ri of nodesWithDesc) {
|
|
433
|
+
const desc = ri.nodeGroup.append("text").text(ri.node.description).attr("dominant-baseline", "middle").attr("class", "treeView-node-description").attr("x", descX).attr("y", ri.centerY);
|
|
434
|
+
const descBBox = desc.node().getBBox();
|
|
435
|
+
totalWidth = Math.max(totalWidth, descX + descBBox.width + config.paddingX);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
for (const ri of renderInfos) {
|
|
439
|
+
if (ri.node.cssClass?.split(/\s+/).includes("highlight")) {
|
|
440
|
+
const rect = ri.nodeGroup.select(".treeView-highlight-bg");
|
|
441
|
+
if (!rect.empty()) {
|
|
442
|
+
const rectWidth = totalWidth - ri.node.BBox.x + 8;
|
|
443
|
+
rect.attr("width", rectWidth);
|
|
444
|
+
totalWidth = Math.max(totalWidth, ri.node.BBox.x + rectWidth + 2);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return { totalHeight, totalWidth };
|
|
449
|
+
}, "drawTree");
|
|
450
|
+
var draw = /* @__PURE__ */ __name(async (text, id, _ver, diagObj) => {
|
|
451
|
+
log.debug(`Rendering treeView diagram
|
|
452
|
+
` + text);
|
|
453
|
+
const db2 = diagObj.db;
|
|
454
|
+
const root = db2.getRoot();
|
|
455
|
+
const config = db2.getConfig();
|
|
456
|
+
const svg = selectSvgElement(id);
|
|
457
|
+
await injectIconDefs(svg, root, config, id);
|
|
458
|
+
const treeElem = svg.append("g");
|
|
459
|
+
treeElem.attr("class", "tree-view");
|
|
460
|
+
const { totalHeight, totalWidth } = drawTree(treeElem, root, config, id);
|
|
461
|
+
svg.attr("viewBox", `-${config.lineThickness / 2} 0 ${totalWidth} ${totalHeight}`);
|
|
462
|
+
configureSvgSize(svg, totalHeight, totalWidth, config.useMaxWidth);
|
|
463
|
+
}, "draw");
|
|
464
|
+
var renderer = {
|
|
465
|
+
draw
|
|
466
|
+
};
|
|
467
|
+
var renderer_default = renderer;
|
|
468
|
+
var defaultTreeViewDiagramStyles = {
|
|
469
|
+
labelFontSize: "16px",
|
|
470
|
+
labelColor: "black",
|
|
471
|
+
lineColor: "black",
|
|
472
|
+
iconColor: "#546e7a",
|
|
473
|
+
descriptionColor: "#6a9955",
|
|
474
|
+
highlightBg: "rgba(255, 193, 7, 0.15)",
|
|
475
|
+
highlightStroke: "#ffc107"
|
|
476
|
+
};
|
|
477
|
+
var styles = /* @__PURE__ */ __name(({
|
|
478
|
+
treeView
|
|
479
|
+
}) => {
|
|
480
|
+
const {
|
|
481
|
+
labelFontSize,
|
|
482
|
+
labelColor,
|
|
483
|
+
lineColor,
|
|
484
|
+
iconColor,
|
|
485
|
+
descriptionColor,
|
|
486
|
+
highlightBg,
|
|
487
|
+
highlightStroke
|
|
488
|
+
} = cleanAndMerge(defaultTreeViewDiagramStyles, treeView);
|
|
489
|
+
return `
|
|
490
|
+
.treeView-node-label {
|
|
491
|
+
font-size: ${labelFontSize};
|
|
492
|
+
fill: ${labelColor};
|
|
493
|
+
white-space: pre;
|
|
494
|
+
}
|
|
495
|
+
.treeView-node-dir {
|
|
496
|
+
font-weight: bold;
|
|
497
|
+
}
|
|
498
|
+
.treeView-node-line {
|
|
499
|
+
stroke: ${lineColor};
|
|
500
|
+
}
|
|
501
|
+
.treeView-node-icon {
|
|
502
|
+
color: ${iconColor};
|
|
503
|
+
}
|
|
504
|
+
.treeView-node-description {
|
|
505
|
+
font-size: ${labelFontSize};
|
|
506
|
+
fill: ${descriptionColor};
|
|
507
|
+
font-style: italic;
|
|
508
|
+
white-space: pre;
|
|
509
|
+
}
|
|
510
|
+
.treeView-highlight-bg {
|
|
511
|
+
fill: ${highlightBg};
|
|
512
|
+
stroke: ${highlightStroke};
|
|
513
|
+
stroke-width: 1;
|
|
514
|
+
}
|
|
515
|
+
`;
|
|
516
|
+
}, "styles");
|
|
517
|
+
var styles_default = styles;
|
|
518
|
+
var diagram = {
|
|
519
|
+
db: db_default,
|
|
520
|
+
renderer: renderer_default,
|
|
521
|
+
parser,
|
|
522
|
+
styles: styles_default
|
|
523
|
+
};
|
|
524
|
+
export {
|
|
525
|
+
diagram
|
|
526
|
+
};
|