@diagrammo/dgmo 0.15.1 → 0.17.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/README.md +9 -9
- package/dist/advanced.cjs +612 -734
- package/dist/advanced.d.cts +42 -36
- package/dist/advanced.d.ts +42 -36
- package/dist/advanced.js +612 -733
- package/dist/auto.cjs +508 -620
- package/dist/auto.js +105 -105
- package/dist/auto.mjs +508 -620
- package/dist/cli.cjs +144 -144
- package/dist/editor.cjs +8 -9
- package/dist/editor.js +8 -9
- package/dist/highlight.cjs +8 -9
- package/dist/highlight.js +8 -9
- package/dist/index.cjs +497 -608
- package/dist/index.js +497 -608
- package/dist/internal.cjs +612 -734
- package/dist/internal.d.cts +42 -36
- package/dist/internal.d.ts +42 -36
- package/dist/internal.js +612 -733
- package/dist/pert.d.cts +2 -2
- package/dist/pert.d.ts +2 -2
- package/docs/language-reference.md +97 -84
- package/docs/migration-sequence-color-to-tags.md +1 -1
- package/gallery/fixtures/area.dgmo +3 -3
- package/gallery/fixtures/bar-stacked.dgmo +5 -5
- package/gallery/fixtures/boxes-and-lines.dgmo +2 -2
- package/gallery/fixtures/c4-full.dgmo +8 -8
- package/gallery/fixtures/class-full.dgmo +2 -2
- package/gallery/fixtures/doughnut.dgmo +6 -6
- package/gallery/fixtures/flowchart-colors.dgmo +3 -3
- package/gallery/fixtures/function.dgmo +3 -3
- package/gallery/fixtures/gantt-full.dgmo +9 -9
- package/gallery/fixtures/gantt.dgmo +7 -7
- package/gallery/fixtures/infra-full.dgmo +6 -6
- package/gallery/fixtures/infra.dgmo +2 -2
- package/gallery/fixtures/kanban.dgmo +9 -9
- package/gallery/fixtures/line.dgmo +2 -2
- package/gallery/fixtures/multi-line.dgmo +3 -3
- package/gallery/fixtures/org-full.dgmo +6 -6
- package/gallery/fixtures/quadrant.dgmo +2 -2
- package/gallery/fixtures/sankey.dgmo +9 -9
- package/gallery/fixtures/scatter.dgmo +3 -3
- package/gallery/fixtures/sequence-tags-protocols.dgmo +11 -11
- package/gallery/fixtures/sequence-tags.dgmo +10 -10
- package/gallery/fixtures/sequence.dgmo +4 -4
- package/gallery/fixtures/sitemap-full.dgmo +7 -7
- package/gallery/fixtures/slope.dgmo +5 -5
- package/gallery/fixtures/spr-eras.dgmo +9 -9
- package/gallery/fixtures/timeline.dgmo +3 -3
- package/gallery/fixtures/venn.dgmo +3 -3
- package/package.json +7 -3
- package/src/advanced.ts +0 -1
- package/src/auto/index.ts +2 -2
- package/src/boxes-and-lines/layout.ts +1 -2
- package/src/boxes-and-lines/renderer.ts +5 -1
- package/src/c4/parser.ts +2 -2
- package/src/c4/renderer.ts +15 -8
- package/src/chart.ts +18 -9
- package/src/class/parser.ts +8 -7
- package/src/class/renderer.ts +17 -6
- package/src/cli.ts +8 -8
- package/src/completion.ts +14 -17
- package/src/cycle/parser.ts +15 -1
- package/src/cycle/renderer.ts +6 -3
- package/src/d3.ts +88 -49
- package/src/diagnostics.ts +20 -0
- package/src/echarts.ts +28 -11
- package/src/editor/dgmo.grammar +1 -3
- package/src/editor/dgmo.grammar.d.ts +1 -1
- package/src/editor/dgmo.grammar.js +8 -8
- package/src/editor/dgmo.grammar.terms.js +11 -12
- package/src/editor/highlight-api.ts +0 -1
- package/src/editor/highlight.ts +0 -1
- package/src/er/parser.ts +19 -12
- package/src/er/renderer.ts +19 -7
- package/src/gantt/parser.ts +1 -1
- package/src/gantt/renderer.ts +7 -4
- package/src/graph/flowchart-parser.ts +18 -84
- package/src/graph/flowchart-renderer.ts +6 -8
- package/src/graph/layout.ts +0 -2
- package/src/graph/state-parser.ts +17 -62
- package/src/graph/state-renderer.ts +3 -8
- package/src/infra/parser.ts +21 -11
- package/src/infra/renderer.ts +8 -6
- package/src/journey-map/parser.ts +11 -4
- package/src/journey-map/renderer.ts +3 -1
- package/src/kanban/parser.ts +11 -7
- package/src/kanban/renderer.ts +3 -1
- package/src/mindmap/parser.ts +4 -5
- package/src/mindmap/renderer.ts +2 -1
- package/src/org/parser.ts +3 -3
- package/src/org/renderer.ts +4 -3
- package/src/pert/analyzer.ts +10 -10
- package/src/pert/layout.ts +1 -1
- package/src/pert/parser.ts +8 -8
- package/src/pert/renderer.ts +7 -2
- package/src/pert/types.ts +1 -1
- package/src/pyramid/parser.ts +13 -1
- package/src/raci/parser.ts +42 -12
- package/src/raci/renderer.ts +2 -1
- package/src/raci/types.ts +4 -3
- package/src/ring/parser.ts +13 -1
- package/src/sequence/parser.ts +81 -23
- package/src/sequence/participant-inference.ts +18 -181
- package/src/sequence/renderer.ts +48 -137
- package/src/sitemap/layout.ts +0 -2
- package/src/sitemap/parser.ts +12 -38
- package/src/sitemap/renderer.ts +13 -13
- package/src/sitemap/types.ts +0 -1
- package/src/tech-radar/parser.ts +2 -2
- package/src/tech-radar/renderer.ts +5 -3
- package/src/tech-radar/types.ts +2 -0
- package/src/utils/arrows.ts +3 -28
- package/src/utils/extract-alias.ts +1 -1
- package/src/utils/inline-markdown.ts +1 -1
- package/src/utils/legend-d3.ts +12 -6
- package/src/utils/legend-layout.ts +1 -1
- package/src/utils/legend-types.ts +1 -1
- package/src/utils/parsing.ts +64 -35
- package/src/utils/tag-groups.ts +98 -18
- package/src/utils/time-ticks.ts +1 -1
- package/src/wireframe/parser.ts +3 -3
|
@@ -5,20 +5,20 @@ critical-path
|
|
|
5
5
|
dependencies
|
|
6
6
|
|
|
7
7
|
tag Team as t
|
|
8
|
-
Engineering
|
|
9
|
-
Design
|
|
10
|
-
QA
|
|
11
|
-
Marketing
|
|
8
|
+
Engineering blue
|
|
9
|
+
Design purple
|
|
10
|
+
QA orange
|
|
11
|
+
Marketing green
|
|
12
12
|
|
|
13
13
|
tag Phase as p
|
|
14
|
-
Foundation
|
|
15
|
-
Growth
|
|
16
|
-
Launch
|
|
14
|
+
Foundation green
|
|
15
|
+
Growth orange
|
|
16
|
+
Launch red
|
|
17
17
|
|
|
18
18
|
era 2024-01-15 -> 2024-02-15 Investor Review
|
|
19
|
-
era 2024-03-10 -> 2024-03-14 GDC 2024
|
|
19
|
+
era 2024-03-10 -> 2024-03-14 GDC 2024 purple
|
|
20
20
|
marker 2024-02-26 Board Meeting
|
|
21
|
-
marker 2024-04-08 Trade Show Demo
|
|
21
|
+
marker 2024-04-08 Trade Show Demo orange
|
|
22
22
|
|
|
23
23
|
// Independent task with offset — starts 8bd after project start
|
|
24
24
|
10bd Brand Guidelines | t: Design, p: Foundation, offset: 8bd
|
|
@@ -5,18 +5,18 @@ critical-path
|
|
|
5
5
|
dependencies
|
|
6
6
|
|
|
7
7
|
tag Team as t
|
|
8
|
-
Engineering
|
|
9
|
-
Design
|
|
10
|
-
QA
|
|
8
|
+
Engineering blue
|
|
9
|
+
Design purple
|
|
10
|
+
QA orange
|
|
11
11
|
|
|
12
12
|
tag Phase as p
|
|
13
|
-
Foundation
|
|
14
|
-
Growth
|
|
13
|
+
Foundation green
|
|
14
|
+
Growth orange
|
|
15
15
|
|
|
16
16
|
era 2024-01-15 -> 2024-02-15 Investor Review
|
|
17
|
-
era 2024-03-10 -> 2024-03-14 GDC 2024
|
|
17
|
+
era 2024-03-10 -> 2024-03-14 GDC 2024 purple
|
|
18
18
|
marker 2024-02-26 Board Meeting
|
|
19
|
-
marker 2024-04-08 Trade Show Demo
|
|
19
|
+
marker 2024-04-08 Trade Show Demo orange
|
|
20
20
|
|
|
21
21
|
// Independent task with offset — starts 8bd after project start
|
|
22
22
|
10bd Brand Guidelines | t: Design, p: Foundation, offset: 8bd
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
infra E-Commerce Platform — Full Infrastructure
|
|
2
2
|
|
|
3
3
|
tag Team as t
|
|
4
|
-
Backend
|
|
5
|
-
Platform
|
|
6
|
-
Data
|
|
4
|
+
Backend blue
|
|
5
|
+
Platform teal
|
|
6
|
+
Data purple
|
|
7
7
|
|
|
8
8
|
tag Tier as r
|
|
9
|
-
Edge
|
|
10
|
-
Core
|
|
11
|
-
Storage
|
|
9
|
+
Edge green
|
|
10
|
+
Core blue
|
|
11
|
+
Storage orange
|
|
12
12
|
|
|
13
13
|
edge
|
|
14
14
|
rps: 15000
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
kanban Plunder Sprint 7
|
|
2
2
|
|
|
3
3
|
tag Priority
|
|
4
|
-
Low
|
|
5
|
-
Urgent
|
|
6
|
-
High
|
|
4
|
+
Low green
|
|
5
|
+
Urgent red
|
|
6
|
+
High orange
|
|
7
7
|
|
|
8
8
|
tag Crew as c
|
|
9
|
-
Blackbeard
|
|
10
|
-
Anne Bonny
|
|
11
|
-
Calico Jack
|
|
9
|
+
Blackbeard red
|
|
10
|
+
Anne Bonny purple
|
|
11
|
+
Calico Jack teal
|
|
12
12
|
|
|
13
|
-
[Awaiting Orders]
|
|
13
|
+
[Awaiting Orders] red
|
|
14
14
|
Recruit gunners at Tortuga | priority: High, c: Calico Jack
|
|
15
15
|
Chart new trade route | priority: Urgent, c: Anne Bonny
|
|
16
16
|
Scout the Windward Passage
|
|
17
17
|
Avoid Royal Navy patrols
|
|
18
18
|
Resupply rum and powder | priority: Low, c: Calico Jack
|
|
19
19
|
|
|
20
|
-
[Underway]
|
|
20
|
+
[Underway] orange | wip: 2
|
|
21
21
|
Forge letters of marque | priority: High, c: Anne Bonny
|
|
22
22
|
Raid merchant convoy | priority: Urgent, c: Blackbeard
|
|
23
23
|
Three ships spotted off Nassau
|
|
24
24
|
|
|
25
|
-
[Done]
|
|
25
|
+
[Done] green
|
|
26
26
|
Bribe the harbour master | priority: High, c: Anne Bonny
|
|
27
27
|
Repair hull damage | priority: Low, c: Blackbeard
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
org Acme Corp
|
|
2
2
|
|
|
3
3
|
tag Location
|
|
4
|
-
NY
|
|
5
|
-
LA
|
|
6
|
-
CO
|
|
7
|
-
Remote
|
|
4
|
+
NY blue
|
|
5
|
+
LA yellow
|
|
6
|
+
CO green
|
|
7
|
+
Remote purple
|
|
8
8
|
|
|
9
9
|
tag Status
|
|
10
|
-
FTE
|
|
11
|
-
Contractor
|
|
10
|
+
FTE green
|
|
11
|
+
Contractor orange
|
|
12
12
|
|
|
13
13
|
Jane Smith
|
|
14
14
|
role: CEO
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
sankey Website Traffic Flow
|
|
2
2
|
|
|
3
3
|
// Source channels — colored by type
|
|
4
|
-
Organic Search
|
|
4
|
+
Organic Search green
|
|
5
5
|
Landing Page 450
|
|
6
|
-
Paid Ads
|
|
6
|
+
Paid Ads orange
|
|
7
7
|
Landing Page 280
|
|
8
|
-
Social Media
|
|
8
|
+
Social Media blue
|
|
9
9
|
Landing Page 180
|
|
10
|
-
Email
|
|
10
|
+
Email purple
|
|
11
11
|
Landing Page 120
|
|
12
|
-
Direct
|
|
12
|
+
Direct teal
|
|
13
13
|
Landing Page 90
|
|
14
14
|
|
|
15
15
|
// Engagement & Conversion
|
|
16
16
|
Landing Page
|
|
17
17
|
Sign Up 340
|
|
18
18
|
Browse Products 520
|
|
19
|
-
Bounce 260
|
|
19
|
+
Bounce 260 red
|
|
20
20
|
|
|
21
21
|
Sign Up
|
|
22
22
|
Free Trial 240
|
|
@@ -24,8 +24,8 @@ Sign Up
|
|
|
24
24
|
|
|
25
25
|
Browse Products
|
|
26
26
|
Add to Cart 310
|
|
27
|
-
Exit 210
|
|
27
|
+
Exit 210 red
|
|
28
28
|
|
|
29
29
|
Add to Cart
|
|
30
|
-
Purchase
|
|
31
|
-
Abandon 90
|
|
30
|
+
Purchase green 220
|
|
31
|
+
Abandon 90 red
|
|
@@ -2,20 +2,20 @@ scatter Startup Funding vs Revenue
|
|
|
2
2
|
x-label Funding ($M)
|
|
3
3
|
y-label Annual Revenue ($M)
|
|
4
4
|
|
|
5
|
-
[SaaS]
|
|
5
|
+
[SaaS] blue
|
|
6
6
|
Acme Cloud 12 8.5
|
|
7
7
|
DataSync 5.2 3.1
|
|
8
8
|
CloudOps 25 18.4
|
|
9
9
|
PlatformX 8 5.7
|
|
10
10
|
NexGen 3.5 1.2
|
|
11
11
|
|
|
12
|
-
[Fintech]
|
|
12
|
+
[Fintech] green
|
|
13
13
|
PayFlow 45 32
|
|
14
14
|
LendTech 18 12.5
|
|
15
15
|
CoinBase+ 60 41
|
|
16
16
|
QuickPay 9 6.8
|
|
17
17
|
|
|
18
|
-
[HealthTech]
|
|
18
|
+
[HealthTech] red
|
|
19
19
|
MediScan 15 7.2
|
|
20
20
|
HealthAI 22 14.1
|
|
21
21
|
CareLink 7 3.8
|
|
@@ -2,21 +2,21 @@ sequence Order Fulfillment — Protocols & Ownership
|
|
|
2
2
|
active-tag Protocol
|
|
3
3
|
|
|
4
4
|
tag Protocol as p
|
|
5
|
-
REST
|
|
6
|
-
gRPC
|
|
7
|
-
Async
|
|
8
|
-
SQL
|
|
5
|
+
REST blue
|
|
6
|
+
gRPC green
|
|
7
|
+
Async orange
|
|
8
|
+
SQL purple
|
|
9
9
|
|
|
10
10
|
tag Owner as o
|
|
11
|
-
Checkout
|
|
12
|
-
Fulfillment
|
|
13
|
-
Payments
|
|
14
|
-
Data
|
|
11
|
+
Checkout teal
|
|
12
|
+
Fulfillment orange
|
|
13
|
+
Payments red
|
|
14
|
+
Data blue
|
|
15
15
|
|
|
16
16
|
Buyer is an actor
|
|
17
|
-
CheckoutSvc
|
|
18
|
-
InventorySvc
|
|
19
|
-
PaymentSvc
|
|
17
|
+
CheckoutSvc | o: Checkout
|
|
18
|
+
InventorySvc | o: Fulfillment
|
|
19
|
+
PaymentSvc | o: Payments
|
|
20
20
|
OrderDB is a database | o: Data
|
|
21
21
|
EventBus is a queue
|
|
22
22
|
|
|
@@ -2,23 +2,23 @@ sequence API Gateway — Infrastructure Concerns
|
|
|
2
2
|
active-tag Concern
|
|
3
3
|
|
|
4
4
|
tag Concern as c
|
|
5
|
-
Caching
|
|
6
|
-
Auth
|
|
7
|
-
RateLimiting
|
|
8
|
-
BusinessLogic
|
|
5
|
+
Caching blue
|
|
6
|
+
Auth green
|
|
7
|
+
RateLimiting orange
|
|
8
|
+
BusinessLogic purple default
|
|
9
9
|
|
|
10
10
|
tag Team as t
|
|
11
|
-
Platform
|
|
12
|
-
Product
|
|
13
|
-
Security
|
|
11
|
+
Platform teal
|
|
12
|
+
Product orange
|
|
13
|
+
Security red
|
|
14
14
|
|
|
15
15
|
Mobile is an actor
|
|
16
|
-
Gateway
|
|
16
|
+
Gateway | t: Platform
|
|
17
17
|
Redis is a cache | c: Caching, t: Platform
|
|
18
18
|
|
|
19
19
|
[Backend] | t: Product
|
|
20
|
-
UserAPI
|
|
21
|
-
OrderAPI
|
|
20
|
+
UserAPI
|
|
21
|
+
OrderAPI
|
|
22
22
|
DB is a database
|
|
23
23
|
|
|
24
24
|
== Authentication ==
|
|
@@ -2,15 +2,15 @@ sitemap Grand Slam Tickets
|
|
|
2
2
|
direction-tb
|
|
3
3
|
|
|
4
4
|
tag Auth
|
|
5
|
-
Public
|
|
6
|
-
Required
|
|
7
|
-
Admin
|
|
5
|
+
Public green
|
|
6
|
+
Required blue
|
|
7
|
+
Admin red
|
|
8
8
|
|
|
9
9
|
tag Type
|
|
10
|
-
Landing
|
|
11
|
-
Form
|
|
12
|
-
Content
|
|
13
|
-
Transactional
|
|
10
|
+
Landing purple
|
|
11
|
+
Form orange
|
|
12
|
+
Content cyan
|
|
13
|
+
Transactional yellow
|
|
14
14
|
|
|
15
15
|
Home
|
|
16
16
|
Auth: Public
|
|
@@ -2,8 +2,8 @@ slope Programming Language Popularity
|
|
|
2
2
|
|
|
3
3
|
period 2020 2022 2025
|
|
4
4
|
|
|
5
|
-
Python
|
|
6
|
-
JavaScript
|
|
7
|
-
TypeScript
|
|
8
|
-
Rust
|
|
9
|
-
Go
|
|
5
|
+
Python blue 3 1 1
|
|
6
|
+
JavaScript yellow 1 2 2
|
|
7
|
+
TypeScript cyan 7 4 3
|
|
8
|
+
Rust orange 18 12 5
|
|
9
|
+
Go green 10 8 7
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
line U.S. Strategic Petroleum Reserve
|
|
2
2
|
y-label Million Barrels
|
|
3
3
|
|
|
4
|
-
era '77 -> '81 Carter
|
|
5
|
-
era '81 -> '89 Reagan
|
|
6
|
-
era '89 -> '93 Bush
|
|
7
|
-
era '93 -> '01 Clinton
|
|
8
|
-
era '01 -> '09 Bush
|
|
9
|
-
era '09 -> '17 Obama
|
|
10
|
-
era '17 -> '21 Trump
|
|
11
|
-
era '21 -> '25 Biden
|
|
12
|
-
era '25 -> '25 Trump
|
|
4
|
+
era '77 -> '81 Carter blue
|
|
5
|
+
era '81 -> '89 Reagan red
|
|
6
|
+
era '89 -> '93 Bush red
|
|
7
|
+
era '93 -> '01 Clinton blue
|
|
8
|
+
era '01 -> '09 Bush red
|
|
9
|
+
era '09 -> '17 Obama blue
|
|
10
|
+
era '17 -> '21 Trump red
|
|
11
|
+
era '21 -> '25 Biden blue
|
|
12
|
+
era '25 -> '25 Trump red
|
|
13
13
|
|
|
14
14
|
'77 7
|
|
15
15
|
'78 67
|
|
@@ -2,9 +2,9 @@ timeline Product Roadmap 2024-2025
|
|
|
2
2
|
sort tag:Team
|
|
3
3
|
|
|
4
4
|
tag Team as t
|
|
5
|
-
Engineering
|
|
6
|
-
Design
|
|
7
|
-
Product
|
|
5
|
+
Engineering blue
|
|
6
|
+
Design purple
|
|
7
|
+
Product green
|
|
8
8
|
|
|
9
9
|
era 2024-01 -> 2024-06 Phase 1 - Foundation
|
|
10
10
|
era 2024-07 -> 2024-12 Phase 2 - Growth
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diagrammo/dgmo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "DGMO diagram markup language — parser, renderer, and color system",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
"prebuild": "rm -rf dist && pnpm codegen",
|
|
118
118
|
"build": "tsup",
|
|
119
119
|
"typecheck": "tsc --noEmit",
|
|
120
|
+
"typecheck:strict": "tsc --noEmit -p tsconfig.strict.json",
|
|
120
121
|
"dev": "tsup --watch",
|
|
121
122
|
"pretest": "pnpm codegen",
|
|
122
123
|
"test": "vitest run --coverage",
|
|
@@ -130,12 +131,14 @@
|
|
|
130
131
|
"lint:fix": "eslint . --fix",
|
|
131
132
|
"format": "prettier --write src/",
|
|
132
133
|
"format:check": "prettier --check src/",
|
|
134
|
+
"check:api": "pnpm build && bash scripts/check-api.sh check",
|
|
135
|
+
"check:api:update": "pnpm build && bash scripts/check-api.sh update",
|
|
133
136
|
"check:duplication": "jscpd ./src",
|
|
134
137
|
"check:deadcode": "knip",
|
|
135
138
|
"check:spelling": "cspell \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
136
|
-
"check:all": "pnpm check:deadcode && pnpm check:spelling && pnpm check:duplication && pnpm check:circular && pnpm check:deps && pnpm check:security && pnpm build && pnpm check:publish && pnpm check:types",
|
|
139
|
+
"check:all": "pnpm check:deadcode && pnpm check:spelling && pnpm check:duplication && pnpm check:circular && pnpm check:deps && pnpm check:security && pnpm build && bash scripts/check-api.sh check && pnpm check:publish && pnpm check:types",
|
|
137
140
|
"check:circular": "madge --circular --extensions ts src/ --json | node -e \"const c=JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')); const n=c.length; if(n>4){console.error('New circular deps found ('+n+' > 4 known type-only cycles)');process.exit(1)}else if(n>0){console.log(n+' known type-only/dynamic cycles (safe)')}else{console.log('No circular dependencies')}\"",
|
|
138
|
-
"check:deps": "depcheck --ignores='@codemirror/language,@lezer/*,husky,lint-staged,tsup,axe-core'",
|
|
141
|
+
"check:deps": "depcheck --ignores='@codemirror/language,@lezer/*,husky,lint-staged,tsup,axe-core,type-coverage'",
|
|
139
142
|
"check:security": "pnpm audit --prod",
|
|
140
143
|
"check:publish": "publint",
|
|
141
144
|
"check:size": "pnpm build && du -sh dist/ && echo '---' && ls -lh dist/*.js dist/*.cjs",
|
|
@@ -185,6 +188,7 @@
|
|
|
185
188
|
"prettier": "^3.8.2",
|
|
186
189
|
"publint": "^0.3.18",
|
|
187
190
|
"tsup": "^8.5.1",
|
|
191
|
+
"type-coverage": "^2.29.7",
|
|
188
192
|
"typescript": "^6.0.2",
|
|
189
193
|
"typescript-eslint": "^8.58.1",
|
|
190
194
|
"vitest": "^4.1.4"
|
package/src/advanced.ts
CHANGED
|
@@ -28,7 +28,6 @@ export type { DgmoError, DgmoSeverity } from './diagnostics';
|
|
|
28
28
|
export {
|
|
29
29
|
parseInArrowLabel,
|
|
30
30
|
validateLabelCharacters,
|
|
31
|
-
matchColorParens,
|
|
32
31
|
ARROW_DIAGNOSTIC_CODES,
|
|
33
32
|
} from './utils/arrows';
|
|
34
33
|
export type { ParseInArrowLabelResult } from './utils/arrows';
|
package/src/auto/index.ts
CHANGED
|
@@ -279,7 +279,7 @@ export function resolveTheme(
|
|
|
279
279
|
function ensureStyles(): void {
|
|
280
280
|
if (typeof document === 'undefined') return;
|
|
281
281
|
const html = document.documentElement;
|
|
282
|
-
if (html
|
|
282
|
+
if (html?.dataset?.[STYLE_FLAG] === '1') return;
|
|
283
283
|
|
|
284
284
|
// If a <link rel="stylesheet"> for our css is already linked, skip inline.
|
|
285
285
|
const linked = document.querySelector(
|
|
@@ -509,7 +509,7 @@ function determineReplaceTarget(matched: Element): Element {
|
|
|
509
509
|
// If matched is a <code> whose only child of <pre> is itself, replace <pre>.
|
|
510
510
|
if (matched.tagName === 'CODE') {
|
|
511
511
|
const parent = matched.parentElement;
|
|
512
|
-
if (parent
|
|
512
|
+
if (parent?.tagName === 'PRE') {
|
|
513
513
|
const meaningfulChildren = Array.from(parent.childNodes).filter(
|
|
514
514
|
(n) =>
|
|
515
515
|
n.nodeType === 1 ||
|
|
@@ -636,8 +636,7 @@ export async function layoutBoxesAndLines(
|
|
|
636
636
|
const edge = parsed.edges[i];
|
|
637
637
|
if (edgeParallelCounts[i] === 0) continue;
|
|
638
638
|
const elkEdge = edgeById.get(`e${i}`);
|
|
639
|
-
if (!elkEdge
|
|
640
|
-
continue;
|
|
639
|
+
if (!elkEdge?.sections || elkEdge.sections.length === 0) continue;
|
|
641
640
|
const container = elkEdge.container ?? 'root';
|
|
642
641
|
const off = containerAbs.get(container) ?? { x: 0, y: 0 };
|
|
643
642
|
const s = elkEdge.sections[0];
|
|
@@ -309,6 +309,7 @@ interface BLRenderOptions {
|
|
|
309
309
|
controlsExpanded?: boolean;
|
|
310
310
|
onToggleDescriptions?: (active: boolean) => void;
|
|
311
311
|
onToggleControlsExpand?: () => void;
|
|
312
|
+
exportMode?: boolean;
|
|
312
313
|
}
|
|
313
314
|
|
|
314
315
|
export function renderBoxesAndLines(
|
|
@@ -328,6 +329,7 @@ export function renderBoxesAndLines(
|
|
|
328
329
|
controlsExpanded,
|
|
329
330
|
onToggleDescriptions,
|
|
330
331
|
onToggleControlsExpand,
|
|
332
|
+
exportMode = false,
|
|
331
333
|
} = options ?? {};
|
|
332
334
|
d3Selection.select(container).selectAll(':not([data-d3-tooltip])').remove();
|
|
333
335
|
|
|
@@ -974,7 +976,7 @@ export function renderBoxesAndLines(
|
|
|
974
976
|
const legendConfig: LegendConfig = {
|
|
975
977
|
groups: parsed.tagGroups,
|
|
976
978
|
position: { placement: 'top-center', titleRelation: 'below-title' },
|
|
977
|
-
mode: '
|
|
979
|
+
mode: exportMode ? 'export' : 'preview',
|
|
978
980
|
controlsGroup,
|
|
979
981
|
};
|
|
980
982
|
const legendState: LegendState = {
|
|
@@ -1017,11 +1019,13 @@ export function renderBoxesAndLinesForExport(
|
|
|
1017
1019
|
exportDims?: { width: number; height: number };
|
|
1018
1020
|
activeTagGroup?: string | null;
|
|
1019
1021
|
hiddenTagValues?: Map<string, Set<string>>;
|
|
1022
|
+
exportMode?: boolean;
|
|
1020
1023
|
}
|
|
1021
1024
|
): void {
|
|
1022
1025
|
renderBoxesAndLines(container, parsed, layout, palette, isDark, {
|
|
1023
1026
|
exportDims: options?.exportDims,
|
|
1024
1027
|
activeTagGroup: options?.activeTagGroup,
|
|
1025
1028
|
hiddenTagValues: options?.hiddenTagValues,
|
|
1029
|
+
exportMode: options?.exportMode,
|
|
1026
1030
|
});
|
|
1027
1031
|
}
|
package/src/c4/parser.ts
CHANGED
|
@@ -232,7 +232,7 @@ export function parseC4(content: string, palette?: PaletteColors): ParsedC4 {
|
|
|
232
232
|
return result;
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
-
if (!content
|
|
235
|
+
if (!content?.trim()) {
|
|
236
236
|
return fail(0, 'No content provided');
|
|
237
237
|
}
|
|
238
238
|
|
|
@@ -350,7 +350,7 @@ export function parseC4(content: string, palette?: PaletteColors): ParsedC4 {
|
|
|
350
350
|
if (!color) {
|
|
351
351
|
pushError(
|
|
352
352
|
lineNumber,
|
|
353
|
-
`Expected 'Value
|
|
353
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
354
354
|
);
|
|
355
355
|
continue;
|
|
356
356
|
}
|
package/src/c4/renderer.ts
CHANGED
|
@@ -232,7 +232,8 @@ export function renderC4Context(
|
|
|
232
232
|
isDark: boolean,
|
|
233
233
|
onClickItem?: (lineNumber: number) => void,
|
|
234
234
|
exportDims?: { width?: number; height?: number },
|
|
235
|
-
activeTagGroup?: string | null
|
|
235
|
+
activeTagGroup?: string | null,
|
|
236
|
+
exportMode?: boolean
|
|
236
237
|
): void {
|
|
237
238
|
d3Selection.select(container).selectAll(':not([data-d3-tooltip])').remove();
|
|
238
239
|
|
|
@@ -636,7 +637,8 @@ export function renderC4Context(
|
|
|
636
637
|
palette,
|
|
637
638
|
isDark,
|
|
638
639
|
activeTagGroup,
|
|
639
|
-
fixedLegend ? width : null
|
|
640
|
+
fixedLegend ? width : null,
|
|
641
|
+
exportMode
|
|
640
642
|
);
|
|
641
643
|
}
|
|
642
644
|
}
|
|
@@ -1259,7 +1261,8 @@ function renderLegend(
|
|
|
1259
1261
|
palette: PaletteColors,
|
|
1260
1262
|
isDark: boolean,
|
|
1261
1263
|
activeTagGroup?: string | null,
|
|
1262
|
-
fixedWidth?: number | null
|
|
1264
|
+
fixedWidth?: number | null,
|
|
1265
|
+
exportMode?: boolean
|
|
1263
1266
|
): void {
|
|
1264
1267
|
const groups = layout.legend.map((g) => ({
|
|
1265
1268
|
name: g.name,
|
|
@@ -1268,7 +1271,7 @@ function renderLegend(
|
|
|
1268
1271
|
const legendConfig: LegendConfig = {
|
|
1269
1272
|
groups,
|
|
1270
1273
|
position: { placement: 'top-center', titleRelation: 'below-title' },
|
|
1271
|
-
mode: '
|
|
1274
|
+
mode: exportMode ? 'export' : 'preview',
|
|
1272
1275
|
};
|
|
1273
1276
|
const legendState: LegendState = { activeGroup: activeTagGroup ?? null };
|
|
1274
1277
|
const containerWidth = fixedWidth ?? layout.width;
|
|
@@ -1300,7 +1303,8 @@ export function renderC4Containers(
|
|
|
1300
1303
|
isDark: boolean,
|
|
1301
1304
|
onClickItem?: (lineNumber: number) => void,
|
|
1302
1305
|
exportDims?: { width?: number; height?: number },
|
|
1303
|
-
activeTagGroup?: string | null
|
|
1306
|
+
activeTagGroup?: string | null,
|
|
1307
|
+
exportMode?: boolean
|
|
1304
1308
|
): void {
|
|
1305
1309
|
d3Selection.select(container).selectAll(':not([data-d3-tooltip])').remove();
|
|
1306
1310
|
|
|
@@ -1805,7 +1809,8 @@ export function renderC4Containers(
|
|
|
1805
1809
|
palette,
|
|
1806
1810
|
isDark,
|
|
1807
1811
|
activeTagGroup,
|
|
1808
|
-
fixedLegend ? width : null
|
|
1812
|
+
fixedLegend ? width : null,
|
|
1813
|
+
exportMode
|
|
1809
1814
|
);
|
|
1810
1815
|
}
|
|
1811
1816
|
}
|
|
@@ -1933,7 +1938,8 @@ export function renderC4Deployment(
|
|
|
1933
1938
|
isDark: boolean,
|
|
1934
1939
|
onClickItem?: (lineNumber: number) => void,
|
|
1935
1940
|
exportDims?: { width?: number; height?: number },
|
|
1936
|
-
activeTagGroup?: string | null
|
|
1941
|
+
activeTagGroup?: string | null,
|
|
1942
|
+
exportMode?: boolean
|
|
1937
1943
|
): void {
|
|
1938
1944
|
renderC4Containers(
|
|
1939
1945
|
container,
|
|
@@ -1943,7 +1949,8 @@ export function renderC4Deployment(
|
|
|
1943
1949
|
isDark,
|
|
1944
1950
|
onClickItem,
|
|
1945
1951
|
exportDims,
|
|
1946
|
-
activeTagGroup
|
|
1952
|
+
activeTagGroup,
|
|
1953
|
+
exportMode
|
|
1947
1954
|
);
|
|
1948
1955
|
}
|
|
1949
1956
|
|