@diagrammo/dgmo 0.16.0 → 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.
Files changed (53) hide show
  1. package/dist/advanced.cjs +133 -280
  2. package/dist/advanced.d.cts +9 -2
  3. package/dist/advanced.d.ts +9 -2
  4. package/dist/advanced.js +133 -280
  5. package/dist/auto.cjs +135 -269
  6. package/dist/auto.js +96 -96
  7. package/dist/auto.mjs +135 -269
  8. package/dist/cli.cjs +125 -125
  9. package/dist/index.cjs +132 -266
  10. package/dist/index.js +132 -266
  11. package/dist/internal.cjs +133 -280
  12. package/dist/internal.d.cts +9 -2
  13. package/dist/internal.d.ts +9 -2
  14. package/dist/internal.js +133 -280
  15. package/docs/language-reference.md +14 -18
  16. package/docs/migration-sequence-color-to-tags.md +1 -1
  17. package/gallery/fixtures/sequence-tags-protocols.dgmo +3 -3
  18. package/gallery/fixtures/sequence-tags.dgmo +3 -3
  19. package/gallery/fixtures/sequence.dgmo +4 -4
  20. package/package.json +7 -3
  21. package/src/auto/index.ts +2 -2
  22. package/src/boxes-and-lines/layout.ts +1 -2
  23. package/src/c4/parser.ts +1 -1
  24. package/src/class/parser.ts +1 -1
  25. package/src/cli.ts +2 -2
  26. package/src/completion.ts +1 -14
  27. package/src/cycle/parser.ts +1 -1
  28. package/src/d3.ts +2 -3
  29. package/src/diagnostics.ts +20 -0
  30. package/src/echarts.ts +2 -2
  31. package/src/editor/dgmo.grammar.d.ts +1 -1
  32. package/src/er/parser.ts +1 -1
  33. package/src/graph/flowchart-renderer.ts +3 -0
  34. package/src/infra/renderer.ts +1 -2
  35. package/src/journey-map/parser.ts +1 -1
  36. package/src/kanban/parser.ts +1 -1
  37. package/src/mindmap/parser.ts +2 -3
  38. package/src/org/parser.ts +1 -1
  39. package/src/pert/analyzer.ts +10 -10
  40. package/src/pert/layout.ts +1 -1
  41. package/src/pert/parser.ts +1 -1
  42. package/src/pyramid/parser.ts +1 -1
  43. package/src/raci/parser.ts +2 -2
  44. package/src/ring/parser.ts +1 -1
  45. package/src/sequence/parser.ts +66 -14
  46. package/src/sequence/participant-inference.ts +18 -181
  47. package/src/sequence/renderer.ts +47 -136
  48. package/src/sitemap/parser.ts +1 -1
  49. package/src/tech-radar/parser.ts +2 -2
  50. package/src/utils/extract-alias.ts +1 -1
  51. package/src/utils/inline-markdown.ts +1 -1
  52. package/src/utils/time-ticks.ts +1 -1
  53. package/src/wireframe/parser.ts +1 -1
@@ -62,7 +62,7 @@ export function parseTechRadar(content: string): ParsedTechRadar {
62
62
  result.diagnostics.push(makeDgmoError(line, message, 'warning'));
63
63
  };
64
64
 
65
- if (!content || !content.trim()) {
65
+ if (!content?.trim()) {
66
66
  return fail(0, 'No content provided');
67
67
  }
68
68
 
@@ -115,7 +115,7 @@ export function parseTechRadar(content: string): ParsedTechRadar {
115
115
  // --- First line: chart type + title ---
116
116
  if (!headerParsed) {
117
117
  const firstLine = parseFirstLine(trimmed);
118
- if (firstLine && firstLine.chartType === 'tech-radar') {
118
+ if (firstLine?.chartType === 'tech-radar') {
119
119
  result.title = firstLine.title ?? '';
120
120
  result.titleLineNumber = lineNumber;
121
121
  headerParsed = true;
@@ -32,7 +32,7 @@ export const ALIAS_TOKEN_RE = /^[A-Za-z][A-Za-z0-9_]{0,11}$/;
32
32
  * DGMO grammar keywords with all chart-type tokens (per F5).
33
33
  *
34
34
  * Articles (`a`, `an`, `the`) are intentionally NOT reserved — the
35
- * spec's worked examples use `Alice is a service as a`, where `a`
35
+ * spec's worked examples use `Alice is an actor as a`, where `a`
36
36
  * is a perfectly fine single-letter alias. Reserving English
37
37
  * articles would break the canonical example pattern.
38
38
  */
@@ -2,7 +2,7 @@
2
2
  // Inline Markdown — shared parsing + SVG rendering for text fields
3
3
  // ============================================================
4
4
 
5
- import * as d3Selection from 'd3-selection';
5
+ import type * as d3Selection from 'd3-selection';
6
6
  import type { PaletteColors } from '../palettes';
7
7
  import { safeHref } from './safe-href';
8
8
 
@@ -2,7 +2,7 @@
2
2
  // Time axis tick computation — shared by d3.ts and gantt/renderer.ts
3
3
  // ============================================================
4
4
 
5
- import * as d3Scale from 'd3-scale';
5
+ import type * as d3Scale from 'd3-scale';
6
6
 
7
7
  export const MONTH_ABBR = [
8
8
  'Jan',
@@ -668,7 +668,7 @@ export function parseWireframe(content: string): ParsedWireframe {
668
668
  if (phase === 'header') {
669
669
  // First line: chart type declaration
670
670
  const firstLineResult = parseFirstLine(trimmed);
671
- if (firstLineResult && firstLineResult.chartType === 'wireframe') {
671
+ if (firstLineResult?.chartType === 'wireframe') {
672
672
  title = firstLineResult.title || null;
673
673
  titleLineNumber = lineNumber;
674
674
  continue;