@diagrammo/dgmo 0.8.19 → 0.8.21
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/dist/cli.cjs +92 -131
- package/dist/editor.cjs +13 -1
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.js +13 -1
- package/dist/editor.js.map +1 -1
- package/dist/highlight.cjs +13 -1
- package/dist/highlight.cjs.map +1 -1
- package/dist/highlight.js +13 -1
- package/dist/highlight.js.map +1 -1
- package/dist/index.cjs +4524 -1511
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +427 -186
- package/dist/index.d.ts +427 -186
- package/dist/index.js +4526 -1503
- package/dist/index.js.map +1 -1
- package/docs/guide/chart-mindmap.md +198 -0
- package/docs/guide/chart-sequence.md +23 -1
- package/docs/guide/chart-wireframe.md +100 -0
- package/docs/guide/index.md +8 -0
- package/docs/language-reference.md +210 -2
- package/package.json +22 -9
- package/src/boxes-and-lines/collapse.ts +21 -3
- package/src/boxes-and-lines/layout.ts +51 -9
- package/src/boxes-and-lines/parser.ts +16 -4
- package/src/boxes-and-lines/renderer.ts +121 -23
- package/src/boxes-and-lines/types.ts +1 -0
- package/src/c4/parser.ts +8 -7
- package/src/class/parser.ts +6 -0
- package/src/cli.ts +1 -9
- package/src/completion.ts +26 -0
- package/src/d3.ts +169 -266
- package/src/dgmo-router.ts +103 -5
- package/src/diagnostics.ts +16 -6
- package/src/echarts.ts +43 -10
- package/src/editor/keywords.ts +12 -0
- package/src/er/parser.ts +22 -2
- package/src/gantt/renderer.ts +2 -2
- package/src/graph/flowchart-parser.ts +89 -52
- package/src/graph/layout.ts +73 -9
- package/src/graph/state-collapse.ts +78 -0
- package/src/graph/state-parser.ts +60 -35
- package/src/graph/state-renderer.ts +139 -34
- package/src/index.ts +41 -16
- package/src/infra/parser.ts +9 -2
- package/src/kanban/renderer.ts +305 -59
- package/src/mindmap/collapse.ts +88 -0
- package/src/mindmap/layout.ts +605 -0
- package/src/mindmap/parser.ts +379 -0
- package/src/mindmap/renderer.ts +543 -0
- package/src/mindmap/text-wrap.ts +207 -0
- package/src/mindmap/types.ts +55 -0
- package/src/palettes/color-utils.ts +4 -12
- package/src/palettes/index.ts +0 -4
- package/src/render.ts +31 -20
- package/src/sequence/parser.ts +7 -2
- package/src/sequence/renderer.ts +141 -21
- package/src/sharing.ts +2 -0
- package/src/sitemap/layout.ts +35 -12
- package/src/sitemap/renderer.ts +1 -6
- package/src/utils/arrows.ts +180 -11
- package/src/utils/d3-types.ts +4 -0
- package/src/utils/export-container.ts +3 -2
- package/src/utils/legend-constants.ts +0 -4
- package/src/utils/legend-d3.ts +1 -0
- package/src/utils/legend-layout.ts +2 -2
- package/src/utils/parsing.ts +2 -0
- package/src/utils/time-ticks.ts +213 -0
- package/src/wireframe/layout.ts +460 -0
- package/src/wireframe/parser.ts +956 -0
- package/src/wireframe/renderer.ts +1293 -0
- package/src/wireframe/types.ts +110 -0
- package/src/branding.ts +0 -67
- package/src/dgmo-mermaid.ts +0 -262
- package/src/palettes/mermaid-bridge.ts +0 -220
package/src/index.ts
CHANGED
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
export { makeDgmoError, formatDgmoError } from './diagnostics';
|
|
6
6
|
export type { DgmoError, DgmoSeverity } from './diagnostics';
|
|
7
7
|
|
|
8
|
+
// ============================================================
|
|
9
|
+
// Arrow helpers (in-arrow label validation)
|
|
10
|
+
// ============================================================
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
parseInArrowLabel,
|
|
14
|
+
validateLabelCharacters,
|
|
15
|
+
matchColorParens,
|
|
16
|
+
ARROW_DIAGNOSTIC_CODES,
|
|
17
|
+
} from './utils/arrows';
|
|
18
|
+
export type { ParseInArrowLabelResult } from './utils/arrows';
|
|
19
|
+
|
|
8
20
|
// ============================================================
|
|
9
21
|
// Unified API
|
|
10
22
|
// ============================================================
|
|
@@ -38,9 +50,9 @@ export {
|
|
|
38
50
|
orderArcNodes,
|
|
39
51
|
parseTimelineDate,
|
|
40
52
|
addDurationToDate,
|
|
41
|
-
computeTimeTicks,
|
|
42
53
|
formatDateLabel,
|
|
43
54
|
} from './d3';
|
|
55
|
+
export { computeTimeTicks } from './utils/time-ticks';
|
|
44
56
|
export type {
|
|
45
57
|
ParsedVisualization,
|
|
46
58
|
VisualizationType,
|
|
@@ -73,13 +85,12 @@ export {
|
|
|
73
85
|
RULE_COUNT,
|
|
74
86
|
} from './sequence/participant-inference';
|
|
75
87
|
|
|
76
|
-
export { parseQuadrant } from './dgmo-mermaid';
|
|
77
|
-
export type { ParsedQuadrant } from './dgmo-mermaid';
|
|
78
|
-
|
|
79
88
|
export { parseFlowchart, looksLikeFlowchart } from './graph/flowchart-parser';
|
|
80
89
|
|
|
81
90
|
export { parseState, looksLikeState } from './graph/state-parser';
|
|
82
91
|
export { renderState, renderStateForExport } from './graph/state-renderer';
|
|
92
|
+
export { collapseStateGroups } from './graph/state-collapse';
|
|
93
|
+
export type { StateCollapseResult } from './graph/state-collapse';
|
|
83
94
|
|
|
84
95
|
export { parseClassDiagram, looksLikeClassDiagram } from './class/parser';
|
|
85
96
|
|
|
@@ -323,6 +334,30 @@ export type {
|
|
|
323
334
|
export { collapseOrgTree } from './org/collapse';
|
|
324
335
|
export type { CollapsedOrgResult } from './org/collapse';
|
|
325
336
|
|
|
337
|
+
export { parseMindmap } from './mindmap/parser';
|
|
338
|
+
export type {
|
|
339
|
+
MindmapNode,
|
|
340
|
+
ParsedMindmap,
|
|
341
|
+
MindmapLayoutNode,
|
|
342
|
+
MindmapLayoutEdge,
|
|
343
|
+
MindmapLayoutResult,
|
|
344
|
+
} from './mindmap/types';
|
|
345
|
+
export { layoutMindmap } from './mindmap/layout';
|
|
346
|
+
export { renderMindmap, renderMindmapForExport } from './mindmap/renderer';
|
|
347
|
+
export { collapseMindmapTree } from './mindmap/collapse';
|
|
348
|
+
export type { CollapsedMindmapResult } from './mindmap/collapse';
|
|
349
|
+
|
|
350
|
+
export { parseWireframe } from './wireframe/parser';
|
|
351
|
+
export type {
|
|
352
|
+
ParsedWireframe,
|
|
353
|
+
WireframeElement,
|
|
354
|
+
WireframeElementType,
|
|
355
|
+
WireframeFormFactor,
|
|
356
|
+
} from './wireframe/types';
|
|
357
|
+
export { layoutWireframe } from './wireframe/layout';
|
|
358
|
+
export type { WireframeLayout, WireframeLayoutNode } from './wireframe/layout';
|
|
359
|
+
export { renderWireframe } from './wireframe/renderer';
|
|
360
|
+
|
|
326
361
|
export { resolveOrgImports } from './org/resolver';
|
|
327
362
|
export type {
|
|
328
363
|
ReadFileFn,
|
|
@@ -336,6 +371,7 @@ export type {
|
|
|
336
371
|
LayoutNode,
|
|
337
372
|
LayoutEdge,
|
|
338
373
|
LayoutGroup,
|
|
374
|
+
LayoutOptions,
|
|
339
375
|
} from './graph/layout';
|
|
340
376
|
|
|
341
377
|
export {
|
|
@@ -378,8 +414,6 @@ export type {
|
|
|
378
414
|
LegendHandle,
|
|
379
415
|
LegendPalette,
|
|
380
416
|
} from './utils/legend-types';
|
|
381
|
-
export { buildMermaidQuadrant } from './dgmo-mermaid';
|
|
382
|
-
|
|
383
417
|
// ============================================================
|
|
384
418
|
// Renderers (produce SVG output)
|
|
385
419
|
// ============================================================
|
|
@@ -437,7 +471,6 @@ export {
|
|
|
437
471
|
hexToHSL,
|
|
438
472
|
hslToHex,
|
|
439
473
|
hexToHSLString,
|
|
440
|
-
mute,
|
|
441
474
|
tint,
|
|
442
475
|
shade,
|
|
443
476
|
getSeriesColors,
|
|
@@ -453,12 +486,10 @@ export {
|
|
|
453
486
|
boldPalette,
|
|
454
487
|
draculaPalette,
|
|
455
488
|
monokaiPalette,
|
|
456
|
-
// Mermaid bridge
|
|
457
|
-
buildMermaidThemeVars,
|
|
458
|
-
buildThemeCSS,
|
|
459
489
|
} from './palettes';
|
|
460
490
|
|
|
461
491
|
export type { PaletteConfig, PaletteColors } from './palettes';
|
|
492
|
+
export { mix } from './palettes/color-utils';
|
|
462
493
|
|
|
463
494
|
// ============================================================
|
|
464
495
|
// Sharing (URL encoding/decoding)
|
|
@@ -500,9 +531,3 @@ export type {
|
|
|
500
531
|
} from './completion';
|
|
501
532
|
|
|
502
533
|
export { parseFirstLine, ALL_CHART_TYPES } from './utils/parsing';
|
|
503
|
-
|
|
504
|
-
// ============================================================
|
|
505
|
-
// Branding
|
|
506
|
-
// ============================================================
|
|
507
|
-
|
|
508
|
-
export { injectBranding } from './branding';
|
package/src/infra/parser.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { makeDgmoError, formatDgmoError, suggest } from '../diagnostics';
|
|
10
10
|
import { resolveColorWithDiagnostic } from '../colors';
|
|
11
|
+
import { parseInArrowLabel } from '../utils/arrows';
|
|
11
12
|
import {
|
|
12
13
|
measureIndent,
|
|
13
14
|
parseFirstLine,
|
|
@@ -477,7 +478,10 @@ export function parseInfra(content: string): ParsedInfra {
|
|
|
477
478
|
// Async labeled connection: ~label~> Target
|
|
478
479
|
const asyncConnMatch = trimmed.match(ASYNC_CONNECTION_RE);
|
|
479
480
|
if (asyncConnMatch) {
|
|
480
|
-
const
|
|
481
|
+
const rawLabel = asyncConnMatch[1] ?? '';
|
|
482
|
+
const labelResult = parseInArrowLabel(rawLabel, lineNumber);
|
|
483
|
+
result.diagnostics.push(...labelResult.diagnostics);
|
|
484
|
+
const label = labelResult.label ?? '';
|
|
481
485
|
const targetRaw = asyncConnMatch[2].trim();
|
|
482
486
|
const pipeMeta = extractPipeMetadata(targetRaw);
|
|
483
487
|
const targetName = pipeMeta.clean || targetRaw;
|
|
@@ -551,7 +555,10 @@ export function parseInfra(content: string): ParsedInfra {
|
|
|
551
555
|
// Labeled connection: -label-> Target | split: N%, fanout: 3
|
|
552
556
|
const connMatch = trimmed.match(CONNECTION_RE);
|
|
553
557
|
if (connMatch) {
|
|
554
|
-
const
|
|
558
|
+
const rawLabel = connMatch[1] ?? '';
|
|
559
|
+
const labelResult = parseInArrowLabel(rawLabel, lineNumber);
|
|
560
|
+
result.diagnostics.push(...labelResult.diagnostics);
|
|
561
|
+
const label = labelResult.label ?? '';
|
|
555
562
|
const targetRaw = connMatch[2].trim();
|
|
556
563
|
const pipeMeta = extractPipeMetadata(targetRaw);
|
|
557
564
|
const targetName = pipeMeta.clean || targetRaw;
|