@diagrammo/dgmo 0.8.14 → 0.8.16
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 +101 -101
- package/dist/index.cjs +623 -119
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -9
- package/dist/index.d.ts +41 -9
- package/dist/index.js +620 -119
- package/dist/index.js.map +1 -1
- package/docs/guide/colors.md +26 -22
- package/docs/language-reference.md +3 -1
- package/package.json +1 -1
- package/src/chart.ts +22 -4
- package/src/class/parser.ts +9 -2
- package/src/colors.ts +64 -8
- package/src/d3.ts +71 -34
- package/src/dgmo-mermaid.ts +8 -2
- package/src/echarts.ts +19 -4
- package/src/er/parser.ts +12 -4
- package/src/graph/flowchart-parser.ts +36 -6
- package/src/graph/state-parser.ts +34 -6
- package/src/index.ts +9 -1
- package/src/infra/parser.ts +7 -1
- package/src/kanban/parser.ts +17 -5
- package/src/kanban/renderer.ts +524 -8
- package/src/palettes/bold.ts +4 -0
- package/src/palettes/catppuccin.ts +4 -0
- package/src/palettes/dracula.ts +4 -0
- package/src/palettes/gruvbox.ts +4 -0
- package/src/palettes/monokai.ts +4 -0
- package/src/palettes/nord.ts +4 -0
- package/src/palettes/one-dark.ts +4 -0
- package/src/palettes/rose-pine.ts +4 -0
- package/src/palettes/solarized.ts +4 -0
- package/src/palettes/tokyo-night.ts +4 -0
- package/src/palettes/types.ts +2 -0
- package/src/sequence/parser.ts +6 -1
- package/src/sequence/renderer.ts +2 -6
- package/src/sharing.ts +11 -3
- package/src/sitemap/parser.ts +43 -10
- package/src/utils/duration.ts +10 -1
- package/src/utils/parsing.ts +22 -6
package/dist/index.d.cts
CHANGED
|
@@ -114,6 +114,8 @@ interface PaletteColors {
|
|
|
114
114
|
teal: string;
|
|
115
115
|
cyan: string;
|
|
116
116
|
gray: string;
|
|
117
|
+
black: string;
|
|
118
|
+
white: string;
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
/**
|
|
@@ -1469,10 +1471,17 @@ declare function computeCardArchive(content: string, parsed: ParsedKanban, cardI
|
|
|
1469
1471
|
/** Check if a column name is the archive column (case-insensitive). */
|
|
1470
1472
|
declare function isArchiveColumn(name: string): boolean;
|
|
1471
1473
|
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1474
|
+
interface KanbanInteractiveOptions {
|
|
1475
|
+
onNavigateToLine?: (line: number) => void;
|
|
1476
|
+
exportDims?: {
|
|
1477
|
+
width: number;
|
|
1478
|
+
height: number;
|
|
1479
|
+
};
|
|
1480
|
+
activeTagGroup?: string | null;
|
|
1481
|
+
currentSwimlaneGroup?: string | null;
|
|
1482
|
+
onSwimlaneChange?: (group: string | null) => void;
|
|
1483
|
+
}
|
|
1484
|
+
declare function renderKanban(container: HTMLElement, parsed: ParsedKanban, palette: PaletteColors, isDark: boolean, options?: KanbanInteractiveOptions): void;
|
|
1476
1485
|
declare function renderKanbanForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
|
|
1477
1486
|
|
|
1478
1487
|
/** @deprecated Use `TagEntry` from `utils/tag-groups` */
|
|
@@ -2521,14 +2530,35 @@ declare const nord: {
|
|
|
2521
2530
|
/** Color name → Nord hex for inline `(color)` annotations. */
|
|
2522
2531
|
declare const colorNames: Record<string, string>;
|
|
2523
2532
|
/**
|
|
2524
|
-
*
|
|
2525
|
-
*
|
|
2526
|
-
*
|
|
2527
|
-
|
|
2533
|
+
* The canonical, closed set of color names accepted by the DGMO language.
|
|
2534
|
+
* See `docs/dgmo-language-spec.md` §1.5. Users cannot extend this list —
|
|
2535
|
+
* palettes only provide the per-theme hex values for these names.
|
|
2536
|
+
*/
|
|
2537
|
+
declare const RECOGNIZED_COLOR_NAMES: readonly ["red", "orange", "yellow", "green", "blue", "purple", "teal", "cyan", "gray", "black", "white"];
|
|
2538
|
+
/**
|
|
2539
|
+
* Returns true iff `name` is one of the 11 recognized DGMO color names.
|
|
2540
|
+
*/
|
|
2541
|
+
declare function isRecognizedColorName(name: string): boolean;
|
|
2542
|
+
/**
|
|
2543
|
+
* Resolves a recognized color name to its hex value for the active palette
|
|
2544
|
+
* (falling back to the built-in Nord defaults). Returns `null` for any
|
|
2545
|
+
* unrecognized input — including hex codes, CSS keywords like `black`,
|
|
2546
|
+
* and typos. Callers MUST treat `null` as a parse error and emit a
|
|
2547
|
+
* diagnostic; do not silently fall back to the raw input.
|
|
2528
2548
|
*/
|
|
2529
2549
|
declare function resolveColor(color: string, palette?: {
|
|
2530
2550
|
colors: Record<string, string>;
|
|
2531
2551
|
}): string | null;
|
|
2552
|
+
|
|
2553
|
+
/**
|
|
2554
|
+
* Resolves a color name and pushes a warning diagnostic on failure.
|
|
2555
|
+
* Returns the hex string for valid names, or `undefined` for unknown
|
|
2556
|
+
* input (after pushing a diagnostic). Use this from parsers that have
|
|
2557
|
+
* a diagnostics array and a line number in scope.
|
|
2558
|
+
*/
|
|
2559
|
+
declare function resolveColorWithDiagnostic(color: string, line: number, diagnostics: DgmoError[], palette?: {
|
|
2560
|
+
colors: Record<string, string>;
|
|
2561
|
+
}): string | undefined;
|
|
2532
2562
|
/** @deprecated Use getSeriesColors(palette) from '@/lib/palettes' instead. */
|
|
2533
2563
|
declare const seriesColors: string[];
|
|
2534
2564
|
|
|
@@ -2543,10 +2573,12 @@ interface DiagramViewState {
|
|
|
2543
2573
|
interface DecodedDiagramUrl {
|
|
2544
2574
|
dsl: string;
|
|
2545
2575
|
viewState: DiagramViewState;
|
|
2576
|
+
filename?: string;
|
|
2546
2577
|
}
|
|
2547
2578
|
interface EncodeDiagramUrlOptions {
|
|
2548
2579
|
baseUrl?: string;
|
|
2549
2580
|
viewState?: DiagramViewState;
|
|
2581
|
+
filename?: string;
|
|
2550
2582
|
}
|
|
2551
2583
|
type EncodeDiagramUrlResult = {
|
|
2552
2584
|
url: string;
|
|
@@ -2600,4 +2632,4 @@ declare function parseFirstLine(line: string): {
|
|
|
2600
2632
|
*/
|
|
2601
2633
|
declare function injectBranding(svgHtml: string, mutedColor: string): string;
|
|
2602
2634
|
|
|
2603
|
-
export { ALL_CHART_TYPES, type Activation, type ArcLink, type ArcNodeGroup, type BLCollapseResult, type BLEdge, type BLGroup, type BLLayoutEdge, type BLLayoutGroup, type BLLayoutNode, type BLLayoutResult, type BLNode, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type CollapsedSitemapResult, type ComputedInfraEdge, type ComputedInfraModel, type ComputedInfraNode, type ContextRelationship, type D3ExportDimensions, type DecodedDiagramUrl, type DgmoError, type DgmoSeverity, type DiagramSymbols, type DiagramViewState, type DirectiveSpec, type DirectiveValueSpec, type Duration, type DurationUnit, ENTITY_TYPES, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type ExtendedChartType, type ExtractFn, type GanttDependency, type GanttEra, type GanttGroup, type GroupRow as GanttGroupRow, type GanttHolidays, type GanttInteractiveOptions, type LaneHeaderRow as GanttLaneHeaderRow, type GanttMarker, type GanttNode, type GanttOptions, type GanttParallelBlock, type Row as GanttRow, type GanttTask, type TaskRow as GanttTaskRow, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, INFRA_BEHAVIOR_KEYS, type ImportSource, type InfraAvailabilityPercentiles, type InfraBehaviorKey, type InfraCbState, type InfraComputeParams, type InfraDiagnostic, type InfraEdge, type InfraGroup, type InfraLatencyPercentiles, type InfraLayoutEdge, type InfraLayoutGroup, type InfraLayoutNode, type InfraLayoutResult, type InfraLegendGroup, type InfraNode, type InfraPlaybackState, type InfraProperty, type InfraRole, type InfraTagGroup, type InlineSpan, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, LEGEND_HEIGHT, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type LegendCallbacks, type LegendConfig, type LegendControl, type LegendGroupData, type LegendHandle, type LegendLayout, type LegendMode, type LegendPalette, type LegendPosition, type LegendState, METADATA_KEY_SET, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, PIPE_METADATA, type PaletteColors, type PaletteConfig, type ParsedBoxesAndLines, type ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedKanban, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParsedSitemap, type ParsedVisualization, type ParticipantType, type PipeKeySpec, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderCategory, type RenderStep, type ResolveImportsResult, type ResolvedGroup, type ResolvedSchedule, type ResolvedTask, type ScatterLabelPoint, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, type SitemapContainerBounds, type SitemapDirection, type SitemapEdge, type SitemapLayoutEdge, type SitemapLayoutNode, type SitemapLayoutResult, type SitemapLegendEntry, type SitemapLegendGroup, type SitemapNode, type TagEntry, type TagGroup, type VisualizationType, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildExtendedChartOption, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildSimpleChartOption, buildTagLaneRowList, buildThemeCSS, calculateSchedule, catppuccinPalette, collapseBoxesAndLines, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeLegendLayout, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, draculaPalette, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getLegendReservedHeight, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isSequenceBlock, isSequenceNote, isValidHex, layoutBoxesAndLines, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, monokaiPalette, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseBoxesAndLines, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderBoxesAndLines, renderBoxesAndLinesForExport, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderKanban, renderKanbanForExport, renderLegendD3, renderLegendSvg, renderLegendSvgFromConfig, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSitemap, renderSitemapForExport, renderSlopeChart, renderState, renderStateForExport, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveOrgImports, resolveTaskName, rollUpContextRelationships, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette, truncateBareUrl, validateComputed, validateInfra };
|
|
2635
|
+
export { ALL_CHART_TYPES, type Activation, type ArcLink, type ArcNodeGroup, type BLCollapseResult, type BLEdge, type BLGroup, type BLLayoutEdge, type BLLayoutGroup, type BLLayoutNode, type BLLayoutResult, type BLNode, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type CollapsedSitemapResult, type ComputedInfraEdge, type ComputedInfraModel, type ComputedInfraNode, type ContextRelationship, type D3ExportDimensions, type DecodedDiagramUrl, type DgmoError, type DgmoSeverity, type DiagramSymbols, type DiagramViewState, type DirectiveSpec, type DirectiveValueSpec, type Duration, type DurationUnit, ENTITY_TYPES, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type ExtendedChartType, type ExtractFn, type GanttDependency, type GanttEra, type GanttGroup, type GroupRow as GanttGroupRow, type GanttHolidays, type GanttInteractiveOptions, type LaneHeaderRow as GanttLaneHeaderRow, type GanttMarker, type GanttNode, type GanttOptions, type GanttParallelBlock, type Row as GanttRow, type GanttTask, type TaskRow as GanttTaskRow, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, INFRA_BEHAVIOR_KEYS, type ImportSource, type InfraAvailabilityPercentiles, type InfraBehaviorKey, type InfraCbState, type InfraComputeParams, type InfraDiagnostic, type InfraEdge, type InfraGroup, type InfraLatencyPercentiles, type InfraLayoutEdge, type InfraLayoutGroup, type InfraLayoutNode, type InfraLayoutResult, type InfraLegendGroup, type InfraNode, type InfraPlaybackState, type InfraProperty, type InfraRole, type InfraTagGroup, type InlineSpan, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, LEGEND_HEIGHT, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type LegendCallbacks, type LegendConfig, type LegendControl, type LegendGroupData, type LegendHandle, type LegendLayout, type LegendMode, type LegendPalette, type LegendPosition, type LegendState, METADATA_KEY_SET, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, PIPE_METADATA, type PaletteColors, type PaletteConfig, type ParsedBoxesAndLines, type ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedKanban, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParsedSitemap, type ParsedVisualization, type ParticipantType, type PipeKeySpec, RECOGNIZED_COLOR_NAMES, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderCategory, type RenderStep, type ResolveImportsResult, type ResolvedGroup, type ResolvedSchedule, type ResolvedTask, type ScatterLabelPoint, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, type SitemapContainerBounds, type SitemapDirection, type SitemapEdge, type SitemapLayoutEdge, type SitemapLayoutNode, type SitemapLayoutResult, type SitemapLegendEntry, type SitemapLegendGroup, type SitemapNode, type TagEntry, type TagGroup, type VisualizationType, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildExtendedChartOption, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildSimpleChartOption, buildTagLaneRowList, buildThemeCSS, calculateSchedule, catppuccinPalette, collapseBoxesAndLines, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeLegendLayout, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, draculaPalette, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getLegendReservedHeight, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isRecognizedColorName, isSequenceBlock, isSequenceNote, isValidHex, layoutBoxesAndLines, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, monokaiPalette, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseBoxesAndLines, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderBoxesAndLines, renderBoxesAndLinesForExport, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderKanban, renderKanbanForExport, renderLegendD3, renderLegendSvg, renderLegendSvgFromConfig, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSitemap, renderSitemapForExport, renderSlopeChart, renderState, renderStateForExport, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveColorWithDiagnostic, resolveOrgImports, resolveTaskName, rollUpContextRelationships, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette, truncateBareUrl, validateComputed, validateInfra };
|
package/dist/index.d.ts
CHANGED
|
@@ -114,6 +114,8 @@ interface PaletteColors {
|
|
|
114
114
|
teal: string;
|
|
115
115
|
cyan: string;
|
|
116
116
|
gray: string;
|
|
117
|
+
black: string;
|
|
118
|
+
white: string;
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
/**
|
|
@@ -1469,10 +1471,17 @@ declare function computeCardArchive(content: string, parsed: ParsedKanban, cardI
|
|
|
1469
1471
|
/** Check if a column name is the archive column (case-insensitive). */
|
|
1470
1472
|
declare function isArchiveColumn(name: string): boolean;
|
|
1471
1473
|
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1474
|
+
interface KanbanInteractiveOptions {
|
|
1475
|
+
onNavigateToLine?: (line: number) => void;
|
|
1476
|
+
exportDims?: {
|
|
1477
|
+
width: number;
|
|
1478
|
+
height: number;
|
|
1479
|
+
};
|
|
1480
|
+
activeTagGroup?: string | null;
|
|
1481
|
+
currentSwimlaneGroup?: string | null;
|
|
1482
|
+
onSwimlaneChange?: (group: string | null) => void;
|
|
1483
|
+
}
|
|
1484
|
+
declare function renderKanban(container: HTMLElement, parsed: ParsedKanban, palette: PaletteColors, isDark: boolean, options?: KanbanInteractiveOptions): void;
|
|
1476
1485
|
declare function renderKanbanForExport(content: string, theme: 'light' | 'dark' | 'transparent', palette: PaletteColors): string;
|
|
1477
1486
|
|
|
1478
1487
|
/** @deprecated Use `TagEntry` from `utils/tag-groups` */
|
|
@@ -2521,14 +2530,35 @@ declare const nord: {
|
|
|
2521
2530
|
/** Color name → Nord hex for inline `(color)` annotations. */
|
|
2522
2531
|
declare const colorNames: Record<string, string>;
|
|
2523
2532
|
/**
|
|
2524
|
-
*
|
|
2525
|
-
*
|
|
2526
|
-
*
|
|
2527
|
-
|
|
2533
|
+
* The canonical, closed set of color names accepted by the DGMO language.
|
|
2534
|
+
* See `docs/dgmo-language-spec.md` §1.5. Users cannot extend this list —
|
|
2535
|
+
* palettes only provide the per-theme hex values for these names.
|
|
2536
|
+
*/
|
|
2537
|
+
declare const RECOGNIZED_COLOR_NAMES: readonly ["red", "orange", "yellow", "green", "blue", "purple", "teal", "cyan", "gray", "black", "white"];
|
|
2538
|
+
/**
|
|
2539
|
+
* Returns true iff `name` is one of the 11 recognized DGMO color names.
|
|
2540
|
+
*/
|
|
2541
|
+
declare function isRecognizedColorName(name: string): boolean;
|
|
2542
|
+
/**
|
|
2543
|
+
* Resolves a recognized color name to its hex value for the active palette
|
|
2544
|
+
* (falling back to the built-in Nord defaults). Returns `null` for any
|
|
2545
|
+
* unrecognized input — including hex codes, CSS keywords like `black`,
|
|
2546
|
+
* and typos. Callers MUST treat `null` as a parse error and emit a
|
|
2547
|
+
* diagnostic; do not silently fall back to the raw input.
|
|
2528
2548
|
*/
|
|
2529
2549
|
declare function resolveColor(color: string, palette?: {
|
|
2530
2550
|
colors: Record<string, string>;
|
|
2531
2551
|
}): string | null;
|
|
2552
|
+
|
|
2553
|
+
/**
|
|
2554
|
+
* Resolves a color name and pushes a warning diagnostic on failure.
|
|
2555
|
+
* Returns the hex string for valid names, or `undefined` for unknown
|
|
2556
|
+
* input (after pushing a diagnostic). Use this from parsers that have
|
|
2557
|
+
* a diagnostics array and a line number in scope.
|
|
2558
|
+
*/
|
|
2559
|
+
declare function resolveColorWithDiagnostic(color: string, line: number, diagnostics: DgmoError[], palette?: {
|
|
2560
|
+
colors: Record<string, string>;
|
|
2561
|
+
}): string | undefined;
|
|
2532
2562
|
/** @deprecated Use getSeriesColors(palette) from '@/lib/palettes' instead. */
|
|
2533
2563
|
declare const seriesColors: string[];
|
|
2534
2564
|
|
|
@@ -2543,10 +2573,12 @@ interface DiagramViewState {
|
|
|
2543
2573
|
interface DecodedDiagramUrl {
|
|
2544
2574
|
dsl: string;
|
|
2545
2575
|
viewState: DiagramViewState;
|
|
2576
|
+
filename?: string;
|
|
2546
2577
|
}
|
|
2547
2578
|
interface EncodeDiagramUrlOptions {
|
|
2548
2579
|
baseUrl?: string;
|
|
2549
2580
|
viewState?: DiagramViewState;
|
|
2581
|
+
filename?: string;
|
|
2550
2582
|
}
|
|
2551
2583
|
type EncodeDiagramUrlResult = {
|
|
2552
2584
|
url: string;
|
|
@@ -2600,4 +2632,4 @@ declare function parseFirstLine(line: string): {
|
|
|
2600
2632
|
*/
|
|
2601
2633
|
declare function injectBranding(svgHtml: string, mutedColor: string): string;
|
|
2602
2634
|
|
|
2603
|
-
export { ALL_CHART_TYPES, type Activation, type ArcLink, type ArcNodeGroup, type BLCollapseResult, type BLEdge, type BLGroup, type BLLayoutEdge, type BLLayoutGroup, type BLLayoutNode, type BLLayoutResult, type BLNode, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type CollapsedSitemapResult, type ComputedInfraEdge, type ComputedInfraModel, type ComputedInfraNode, type ContextRelationship, type D3ExportDimensions, type DecodedDiagramUrl, type DgmoError, type DgmoSeverity, type DiagramSymbols, type DiagramViewState, type DirectiveSpec, type DirectiveValueSpec, type Duration, type DurationUnit, ENTITY_TYPES, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type ExtendedChartType, type ExtractFn, type GanttDependency, type GanttEra, type GanttGroup, type GroupRow as GanttGroupRow, type GanttHolidays, type GanttInteractiveOptions, type LaneHeaderRow as GanttLaneHeaderRow, type GanttMarker, type GanttNode, type GanttOptions, type GanttParallelBlock, type Row as GanttRow, type GanttTask, type TaskRow as GanttTaskRow, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, INFRA_BEHAVIOR_KEYS, type ImportSource, type InfraAvailabilityPercentiles, type InfraBehaviorKey, type InfraCbState, type InfraComputeParams, type InfraDiagnostic, type InfraEdge, type InfraGroup, type InfraLatencyPercentiles, type InfraLayoutEdge, type InfraLayoutGroup, type InfraLayoutNode, type InfraLayoutResult, type InfraLegendGroup, type InfraNode, type InfraPlaybackState, type InfraProperty, type InfraRole, type InfraTagGroup, type InlineSpan, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, LEGEND_HEIGHT, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type LegendCallbacks, type LegendConfig, type LegendControl, type LegendGroupData, type LegendHandle, type LegendLayout, type LegendMode, type LegendPalette, type LegendPosition, type LegendState, METADATA_KEY_SET, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, PIPE_METADATA, type PaletteColors, type PaletteConfig, type ParsedBoxesAndLines, type ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedKanban, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParsedSitemap, type ParsedVisualization, type ParticipantType, type PipeKeySpec, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderCategory, type RenderStep, type ResolveImportsResult, type ResolvedGroup, type ResolvedSchedule, type ResolvedTask, type ScatterLabelPoint, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, type SitemapContainerBounds, type SitemapDirection, type SitemapEdge, type SitemapLayoutEdge, type SitemapLayoutNode, type SitemapLayoutResult, type SitemapLegendEntry, type SitemapLegendGroup, type SitemapNode, type TagEntry, type TagGroup, type VisualizationType, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildExtendedChartOption, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildSimpleChartOption, buildTagLaneRowList, buildThemeCSS, calculateSchedule, catppuccinPalette, collapseBoxesAndLines, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeLegendLayout, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, draculaPalette, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getLegendReservedHeight, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isSequenceBlock, isSequenceNote, isValidHex, layoutBoxesAndLines, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, monokaiPalette, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseBoxesAndLines, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderBoxesAndLines, renderBoxesAndLinesForExport, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderKanban, renderKanbanForExport, renderLegendD3, renderLegendSvg, renderLegendSvgFromConfig, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSitemap, renderSitemapForExport, renderSlopeChart, renderState, renderStateForExport, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveOrgImports, resolveTaskName, rollUpContextRelationships, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette, truncateBareUrl, validateComputed, validateInfra };
|
|
2635
|
+
export { ALL_CHART_TYPES, type Activation, type ArcLink, type ArcNodeGroup, type BLCollapseResult, type BLEdge, type BLGroup, type BLLayoutEdge, type BLLayoutGroup, type BLLayoutNode, type BLLayoutResult, type BLNode, type C4ArrowType, type C4DeploymentNode, type C4Element, type C4ElementType, type C4Group, type C4LayoutBoundary, type C4LayoutEdge, type C4LayoutNode, type C4LayoutResult, type C4LegendEntry, type C4LegendGroup, type C4Relationship, type C4Shape, type C4TagEntry, type C4TagGroup, CHART_TYPES, COMPLETION_REGISTRY, type ChartDataPoint, type ChartEra, type ChartType$1 as ChartType, type ClassLayoutEdge, type ClassLayoutNode, type ClassLayoutResult, type ClassMember, type ClassModifier, type ClassNode, type ClassRelationship, type CollapsedOrgResult, type CollapsedSitemapResult, type ComputedInfraEdge, type ComputedInfraModel, type ComputedInfraNode, type ContextRelationship, type D3ExportDimensions, type DecodedDiagramUrl, type DgmoError, type DgmoSeverity, type DiagramSymbols, type DiagramViewState, type DirectiveSpec, type DirectiveValueSpec, type Duration, type DurationUnit, ENTITY_TYPES, type ERCardinality, type ERColumn, type ERConstraint, type ERLayoutEdge, type ERLayoutNode, type ERLayoutResult, type ERRelationship, type ERTable, type ElseIfBranch, type EncodeDiagramUrlOptions, type EncodeDiagramUrlResult, type ExtendedChartType, type ExtractFn, type GanttDependency, type GanttEra, type GanttGroup, type GroupRow as GanttGroupRow, type GanttHolidays, type GanttInteractiveOptions, type LaneHeaderRow as GanttLaneHeaderRow, type GanttMarker, type GanttNode, type GanttOptions, type GanttParallelBlock, type Row as GanttRow, type GanttTask, type TaskRow as GanttTaskRow, type GraphDirection, type GraphEdge, type GraphGroup, type GraphNode, type GraphShape, INFRA_BEHAVIOR_KEYS, type ImportSource, type InfraAvailabilityPercentiles, type InfraBehaviorKey, type InfraCbState, type InfraComputeParams, type InfraDiagnostic, type InfraEdge, type InfraGroup, type InfraLatencyPercentiles, type InfraLayoutEdge, type InfraLayoutGroup, type InfraLayoutNode, type InfraLayoutResult, type InfraLegendGroup, type InfraNode, type InfraPlaybackState, type InfraProperty, type InfraRole, type InfraTagGroup, type InlineSpan, type KanbanCard, type KanbanColumn, type KanbanTagEntry, type KanbanTagGroup, LEGEND_HEIGHT, type LayoutEdge, type LayoutGroup, type LayoutNode, type LayoutResult, type LegendCallbacks, type LegendConfig, type LegendControl, type LegendGroupData, type LegendHandle, type LegendLayout, type LegendMode, type LegendPalette, type LegendPosition, type LegendState, METADATA_KEY_SET, type MemberVisibility, type OrgContainerBounds, type OrgLayoutEdge, type OrgLayoutNode, type OrgLayoutResult, type OrgNode, PIPE_METADATA, type PaletteColors, type PaletteConfig, type ParsedBoxesAndLines, type ParsedC4, type ParsedChart, type ParsedClassDiagram, type ParsedERDiagram, type ParsedExtendedChart, type ParsedGantt, type ParsedGraph, type ParsedInfra, type ParsedKanban, type ParsedOrg, type ParsedQuadrant, type ParsedSequenceDgmo, type ParsedSitemap, type ParsedVisualization, type ParticipantType, type PipeKeySpec, RECOGNIZED_COLOR_NAMES, RULE_COUNT, type ReadFileFn, type RelationshipType, type RenderCategory, type RenderStep, type ResolveImportsResult, type ResolvedGroup, type ResolvedSchedule, type ResolvedTask, type ScatterLabelPoint, type SectionMessageGroup, type SequenceBlock, type SequenceElement, type SequenceGroup, type SequenceMessage, type SequenceNote, type SequenceParticipant, type SequenceRenderOptions, type SequenceSection, type SitemapContainerBounds, type SitemapDirection, type SitemapEdge, type SitemapLayoutEdge, type SitemapLayoutNode, type SitemapLayoutResult, type SitemapLegendEntry, type SitemapLegendGroup, type SitemapNode, type TagEntry, type TagGroup, type VisualizationType, addDurationToDate, applyGroupOrdering, applyPositionOverrides, boldPalette, buildExtendedChartOption, buildMermaidQuadrant, buildMermaidThemeVars, buildNoteMessageMap, buildRenderSequence, buildSimpleChartOption, buildTagLaneRowList, buildThemeCSS, calculateSchedule, catppuccinPalette, collapseBoxesAndLines, collapseOrgTree, collapseSitemapTree, collectDiagramRoles, collectTasks, colorNames, computeActivations, computeCardArchive, computeCardMove, computeInfra, computeInfraLegendGroups, computeLegendLayout, computeScatterLabelGraphics, computeTimeTicks, contrastText, decodeDiagramUrl, draculaPalette, encodeDiagramUrl, extractDiagramSymbols, extractTagDeclarations, formatDateLabel, formatDgmoError, getAvailablePalettes, getExtendedChartLegendGroups, getLegendReservedHeight, getPalette, getRenderCategory, getSeriesColors, getSimpleChartLegendGroups, groupMessagesBySection, gruvboxPalette, hexToHSL, hexToHSLString, hslToHex, inferParticipantType, inferRoles, injectBranding, isArchiveColumn, isExtendedChartType, isRecognizedColorName, isSequenceBlock, isSequenceNote, isValidHex, layoutBoxesAndLines, layoutC4Components, layoutC4Containers, layoutC4Context, layoutC4Deployment, layoutClassDiagram, layoutERDiagram, layoutGraph, layoutInfra, layoutOrg, layoutSitemap, looksLikeClassDiagram, looksLikeERDiagram, looksLikeFlowchart, looksLikeSequence, looksLikeSitemap, looksLikeState, makeDgmoError, monokaiPalette, mute, nord, nordPalette, oneDarkPalette, orderArcNodes, parseAndLayoutInfra, parseBoxesAndLines, parseC4, parseChart, parseClassDiagram, parseDataRowValues, parseDgmo, parseDgmoChartType, parseERDiagram, parseExtendedChart, parseFirstLine, parseFlowchart, parseGantt, parseInfra, parseInlineMarkdown, parseKanban, parseOrg, parseQuadrant, parseSequenceDgmo, parseSitemap, parseState, parseTimelineDate, parseVisualization, registerExtractor, registerPalette, render, renderArcDiagram, renderBoxesAndLines, renderBoxesAndLinesForExport, renderC4ComponentsForExport, renderC4Containers, renderC4ContainersForExport, renderC4Context, renderC4ContextForExport, renderC4Deployment, renderC4DeploymentForExport, renderClassDiagram, renderClassDiagramForExport, renderERDiagram, renderERDiagramForExport, renderExtendedChartForExport, renderFlowchart, renderFlowchartForExport, renderForExport, renderGantt, renderInfra, renderKanban, renderKanbanForExport, renderLegendD3, renderLegendSvg, renderLegendSvgFromConfig, renderOrg, renderOrgForExport, renderQuadrant, renderSequenceDiagram, renderSitemap, renderSitemapForExport, renderSlopeChart, renderState, renderStateForExport, renderTimeline, renderVenn, renderWordCloud, resolveColor, resolveColorWithDiagnostic, resolveOrgImports, resolveTaskName, rollUpContextRelationships, rosePinePalette, seriesColors, shade, solarizedPalette, tint, tokyoNightPalette, truncateBareUrl, validateComputed, validateInfra };
|