@diagrammo/dgmo 0.15.1 → 0.16.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 +479 -454
- package/dist/advanced.d.cts +34 -35
- package/dist/advanced.d.ts +34 -35
- package/dist/advanced.js +479 -453
- package/dist/auto.cjs +374 -352
- package/dist/auto.js +103 -103
- package/dist/auto.mjs +374 -352
- package/dist/cli.cjs +140 -140
- 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 +365 -342
- package/dist/index.js +365 -342
- package/dist/internal.cjs +479 -454
- package/dist/internal.d.cts +34 -35
- package/dist/internal.d.ts +34 -35
- package/dist/internal.js +479 -453
- package/dist/pert.d.cts +2 -2
- package/dist/pert.d.ts +2 -2
- package/docs/language-reference.md +83 -66
- 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 +8 -8
- package/gallery/fixtures/sequence-tags.dgmo +7 -7
- 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 +1 -1
- package/src/advanced.ts +0 -1
- package/src/boxes-and-lines/renderer.ts +5 -1
- package/src/c4/parser.ts +1 -1
- package/src/c4/renderer.ts +15 -8
- package/src/chart.ts +18 -9
- package/src/class/parser.ts +7 -6
- package/src/class/renderer.ts +17 -6
- package/src/cli.ts +6 -6
- package/src/completion.ts +13 -3
- package/src/cycle/parser.ts +14 -0
- package/src/cycle/renderer.ts +6 -3
- package/src/d3.ts +86 -46
- package/src/echarts.ts +26 -9
- package/src/editor/dgmo.grammar +1 -3
- 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 +18 -11
- 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 +3 -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 +7 -4
- package/src/journey-map/parser.ts +10 -3
- package/src/journey-map/renderer.ts +3 -1
- package/src/kanban/parser.ts +10 -6
- package/src/kanban/renderer.ts +3 -1
- package/src/mindmap/parser.ts +2 -2
- package/src/mindmap/renderer.ts +2 -1
- package/src/org/parser.ts +2 -2
- package/src/org/renderer.ts +4 -3
- package/src/pert/parser.ts +7 -7
- package/src/pert/renderer.ts +7 -2
- package/src/pert/types.ts +1 -1
- package/src/pyramid/parser.ts +12 -0
- package/src/raci/parser.ts +40 -10
- package/src/raci/renderer.ts +2 -1
- package/src/raci/types.ts +4 -3
- package/src/ring/parser.ts +12 -0
- package/src/sequence/parser.ts +15 -9
- package/src/sequence/renderer.ts +1 -1
- package/src/sitemap/layout.ts +0 -2
- package/src/sitemap/parser.ts +11 -37
- package/src/sitemap/renderer.ts +13 -13
- package/src/sitemap/types.ts +0 -1
- 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/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/wireframe/parser.ts +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1822,17 +1822,21 @@ function measureIndent(line12) {
|
|
|
1822
1822
|
return indent;
|
|
1823
1823
|
}
|
|
1824
1824
|
function extractColor(label, palette, diagnostics, line12) {
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1827
|
-
|
|
1825
|
+
const lastSpaceIdx = Math.max(
|
|
1826
|
+
label.lastIndexOf(" "),
|
|
1827
|
+
label.lastIndexOf(" ")
|
|
1828
|
+
);
|
|
1829
|
+
if (lastSpaceIdx < 0) return { label };
|
|
1830
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
1831
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { label };
|
|
1828
1832
|
let color;
|
|
1829
1833
|
if (diagnostics && line12 !== void 0) {
|
|
1830
|
-
color = resolveColorWithDiagnostic(
|
|
1834
|
+
color = resolveColorWithDiagnostic(trailing, line12, diagnostics, palette);
|
|
1831
1835
|
} else {
|
|
1832
|
-
color = resolveColor(
|
|
1836
|
+
color = resolveColor(trailing, palette) ?? void 0;
|
|
1833
1837
|
}
|
|
1834
1838
|
return {
|
|
1835
|
-
label: label.substring(0,
|
|
1839
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
1836
1840
|
color
|
|
1837
1841
|
};
|
|
1838
1842
|
}
|
|
@@ -1965,14 +1969,18 @@ function parseSeriesNames(value, lines, lineIndex, palette, diagnostics) {
|
|
|
1965
1969
|
}
|
|
1966
1970
|
return { series, names, nameColors, nameLineNumbers, newIndex };
|
|
1967
1971
|
}
|
|
1968
|
-
function
|
|
1969
|
-
const
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
return
|
|
1972
|
+
function peelTrailingColorName(label) {
|
|
1973
|
+
const lastSpaceIdx = Math.max(
|
|
1974
|
+
label.lastIndexOf(" "),
|
|
1975
|
+
label.lastIndexOf(" ")
|
|
1976
|
+
);
|
|
1977
|
+
if (lastSpaceIdx < 0) return { label };
|
|
1978
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
1979
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { label };
|
|
1980
|
+
return {
|
|
1981
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
1982
|
+
colorName: trailing
|
|
1983
|
+
};
|
|
1976
1984
|
}
|
|
1977
1985
|
function parsePipeMetadata(segments, aliasMap = /* @__PURE__ */ new Map(), errorMultiplePipes) {
|
|
1978
1986
|
if (segments.length > 2) {
|
|
@@ -1994,11 +2002,14 @@ function parsePipeMetadata(segments, aliasMap = /* @__PURE__ */ new Map(), error
|
|
|
1994
2002
|
}
|
|
1995
2003
|
return metadata;
|
|
1996
2004
|
}
|
|
1997
|
-
var ALL_CHART_TYPES, PIPE_KEY_VALUE_PREFIX_RE, PIPE_LIKELY_STRUCTURED_TAIL_RE,
|
|
2005
|
+
var RECOGNIZED_COLOR_SET, ALL_CHART_TYPES, PIPE_KEY_VALUE_PREFIX_RE, PIPE_LIKELY_STRUCTURED_TAIL_RE, OPTION_NOCOLON_RE, GLOBAL_BOOLEANS, MULTIPLE_PIPE_ERROR;
|
|
1998
2006
|
var init_parsing = __esm({
|
|
1999
2007
|
"src/utils/parsing.ts"() {
|
|
2000
2008
|
"use strict";
|
|
2001
2009
|
init_colors();
|
|
2010
|
+
RECOGNIZED_COLOR_SET = new Set(
|
|
2011
|
+
RECOGNIZED_COLOR_NAMES
|
|
2012
|
+
);
|
|
2002
2013
|
ALL_CHART_TYPES = /* @__PURE__ */ new Set([
|
|
2003
2014
|
// data charts
|
|
2004
2015
|
"bar",
|
|
@@ -2050,7 +2061,6 @@ var init_parsing = __esm({
|
|
|
2050
2061
|
]);
|
|
2051
2062
|
PIPE_KEY_VALUE_PREFIX_RE = /^\s*[A-Za-z][A-Za-z0-9_-]*\s*:/;
|
|
2052
2063
|
PIPE_LIKELY_STRUCTURED_TAIL_RE = /,\s*[A-Za-z][A-Za-z0-9_-]*\s*:/;
|
|
2053
|
-
COLOR_SUFFIX_RE = /\(([^)]+)\)\s*$/;
|
|
2054
2064
|
OPTION_NOCOLON_RE = /^([a-z][a-z0-9-]*)\s+(.+)$/i;
|
|
2055
2065
|
GLOBAL_BOOLEANS = /* @__PURE__ */ new Set([
|
|
2056
2066
|
"solid-fill",
|
|
@@ -2087,7 +2097,7 @@ function parseTagDeclaration(line12) {
|
|
|
2087
2097
|
let restStartIdx = 1;
|
|
2088
2098
|
let valueStart = tokens.length;
|
|
2089
2099
|
for (let i = 1; i < tokens.length; i++) {
|
|
2090
|
-
if (tokens[i].includes("
|
|
2100
|
+
if (tokens[i].includes(",")) {
|
|
2091
2101
|
valueStart = i;
|
|
2092
2102
|
break;
|
|
2093
2103
|
}
|
|
@@ -2119,13 +2129,29 @@ function parseTagDeclaration(line12) {
|
|
|
2119
2129
|
restStartIdx = valueStart;
|
|
2120
2130
|
}
|
|
2121
2131
|
} else {
|
|
2122
|
-
|
|
2123
|
-
|
|
2132
|
+
const isColorWord = (s) => RECOGNIZED_COLOR_NAMES.includes(s);
|
|
2133
|
+
if (valueStart < tokens.length) {
|
|
2134
|
+
const commaTokenIdx = valueStart;
|
|
2135
|
+
const lastBeforeComma = tokens[commaTokenIdx].replace(/,$/, "");
|
|
2136
|
+
const firstValueStart = isColorWord(lastBeforeComma) ? commaTokenIdx - 1 : commaTokenIdx;
|
|
2137
|
+
const prefixEnd = firstValueStart;
|
|
2138
|
+
const aliasCandidate = prefixEnd > 1 ? tokens[prefixEnd - 1] : void 0;
|
|
2139
|
+
if (aliasCandidate && isAliasToken(aliasCandidate) && !isColorWord(aliasCandidate)) {
|
|
2140
|
+
alias = aliasCandidate;
|
|
2141
|
+
legacyForm = "bare-shorthand";
|
|
2142
|
+
name = tokens.slice(0, prefixEnd - 1).map((t) => stripQuotes(t)).join(" ");
|
|
2143
|
+
restStartIdx = prefixEnd;
|
|
2144
|
+
} else {
|
|
2145
|
+
name = tokens.slice(0, prefixEnd).map((t) => stripQuotes(t)).join(" ");
|
|
2146
|
+
restStartIdx = prefixEnd;
|
|
2147
|
+
}
|
|
2148
|
+
} else if (tokens[0][0] === '"' || tokens[0][0] === "'") {
|
|
2149
|
+
if (tokens.length > 1 && isAliasToken(tokens[1]) && !isColorWord(tokens[1])) {
|
|
2124
2150
|
alias = tokens[1];
|
|
2125
2151
|
legacyForm = "bare-shorthand";
|
|
2126
2152
|
restStartIdx = 2;
|
|
2127
2153
|
}
|
|
2128
|
-
} else if (valueStart > 1 && isAliasToken(tokens[valueStart - 1])) {
|
|
2154
|
+
} else if (valueStart > 1 && isAliasToken(tokens[valueStart - 1]) && !isColorWord(tokens[valueStart - 1])) {
|
|
2129
2155
|
alias = tokens[valueStart - 1];
|
|
2130
2156
|
legacyForm = "bare-shorthand";
|
|
2131
2157
|
name = tokens.slice(0, valueStart - 1).map((t) => stripQuotes(t)).join(" ");
|
|
@@ -2140,10 +2166,13 @@ function parseTagDeclaration(line12) {
|
|
|
2140
2166
|
inlineValues = valueStr.split(",").map((v) => v.trim()).filter(Boolean);
|
|
2141
2167
|
}
|
|
2142
2168
|
if (!inlineValues || inlineValues.length === 0) {
|
|
2143
|
-
const
|
|
2144
|
-
if (
|
|
2145
|
-
|
|
2146
|
-
|
|
2169
|
+
const lastSpaceIdx = name.lastIndexOf(" ");
|
|
2170
|
+
if (lastSpaceIdx > 0) {
|
|
2171
|
+
const trailing = name.substring(lastSpaceIdx + 1);
|
|
2172
|
+
if (RECOGNIZED_COLOR_NAMES.includes(trailing)) {
|
|
2173
|
+
colorHint = trailing;
|
|
2174
|
+
name = name.substring(0, lastSpaceIdx).trimEnd();
|
|
2175
|
+
}
|
|
2147
2176
|
}
|
|
2148
2177
|
}
|
|
2149
2178
|
return {
|
|
@@ -2271,6 +2300,7 @@ var init_tag_groups = __esm({
|
|
|
2271
2300
|
"use strict";
|
|
2272
2301
|
init_parsing();
|
|
2273
2302
|
init_diagnostics();
|
|
2303
|
+
init_colors();
|
|
2274
2304
|
TAG_BLOCK_NOCOLON_RE = /^tag\s+/i;
|
|
2275
2305
|
VALID_TAG_IDENT_RE = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
2276
2306
|
}
|
|
@@ -2544,7 +2574,7 @@ function buildControlsGroupLayout(config, state) {
|
|
|
2544
2574
|
}
|
|
2545
2575
|
function computeLegendLayout(config, state, containerWidth) {
|
|
2546
2576
|
const { groups, controls: configControls, mode } = config;
|
|
2547
|
-
const isExport = mode === "
|
|
2577
|
+
const isExport = mode === "export";
|
|
2548
2578
|
const activeGroupName = state.activeGroup?.toLowerCase() ?? null;
|
|
2549
2579
|
if (isExport && !activeGroupName) {
|
|
2550
2580
|
return {
|
|
@@ -2830,7 +2860,10 @@ function renderLegendD3(container, config, state, palette, isDark, callbacks, co
|
|
|
2830
2860
|
const width = containerWidth ?? parseFloat(container.attr("width") || "800");
|
|
2831
2861
|
let currentState = { ...state };
|
|
2832
2862
|
let currentLayout;
|
|
2833
|
-
const legendG = container.append("g").attr("class", "dgmo-legend")
|
|
2863
|
+
const legendG = container.append("g").attr("class", "dgmo-legend").attr("data-legend-title-relation", config.position.titleRelation).attr(
|
|
2864
|
+
"data-legend-capsule-addon-width",
|
|
2865
|
+
String(config.capsulePillAddonWidth ?? 0)
|
|
2866
|
+
);
|
|
2834
2867
|
function render3() {
|
|
2835
2868
|
currentLayout = computeLegendLayout(config, currentState, width);
|
|
2836
2869
|
legendG.selectAll("*").remove();
|
|
@@ -3392,15 +3425,6 @@ function parseInArrowLabel(rawLabel, lineNumber) {
|
|
|
3392
3425
|
const diagnostics = validateLabelCharacters(trimmed, lineNumber);
|
|
3393
3426
|
return { label: trimmed, diagnostics };
|
|
3394
3427
|
}
|
|
3395
|
-
function matchColorParens(content) {
|
|
3396
|
-
const m = content.match(/^\(([A-Za-z]+)\)$/);
|
|
3397
|
-
if (!m) return null;
|
|
3398
|
-
const candidate = m[1].toLowerCase();
|
|
3399
|
-
if (RECOGNIZED_COLOR_NAMES.includes(candidate)) {
|
|
3400
|
-
return candidate;
|
|
3401
|
-
}
|
|
3402
|
-
return null;
|
|
3403
|
-
}
|
|
3404
3428
|
function parseArrow(line12) {
|
|
3405
3429
|
if (BIDI_SYNC_RE.test(line12) || BIDI_ASYNC_RE.test(line12)) {
|
|
3406
3430
|
return {
|
|
@@ -3439,7 +3463,6 @@ var init_arrows = __esm({
|
|
|
3439
3463
|
"src/utils/arrows.ts"() {
|
|
3440
3464
|
"use strict";
|
|
3441
3465
|
init_diagnostics();
|
|
3442
|
-
init_colors();
|
|
3443
3466
|
ARROW_DIAGNOSTIC_CODES = {
|
|
3444
3467
|
/** Active: label contains `->` or `~>` substring (TD-13). */
|
|
3445
3468
|
ARROW_SUBSTRING_IN_LABEL: "E_ARROW_SUBSTRING_IN_LABEL",
|
|
@@ -3764,7 +3787,7 @@ function parseSequenceDgmo(content) {
|
|
|
3764
3787
|
if (groupColor) {
|
|
3765
3788
|
pushWarning(
|
|
3766
3789
|
lineNumber,
|
|
3767
|
-
`(${groupColor}) color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3790
|
+
`'(${groupColor})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3768
3791
|
);
|
|
3769
3792
|
}
|
|
3770
3793
|
contentStarted = true;
|
|
@@ -3844,7 +3867,7 @@ function parseSequenceDgmo(content) {
|
|
|
3844
3867
|
if (!color) {
|
|
3845
3868
|
pushError(
|
|
3846
3869
|
lineNumber,
|
|
3847
|
-
`Expected 'Value
|
|
3870
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
3848
3871
|
);
|
|
3849
3872
|
continue;
|
|
3850
3873
|
}
|
|
@@ -3868,11 +3891,13 @@ function parseSequenceDgmo(content) {
|
|
|
3868
3891
|
blockStack.pop();
|
|
3869
3892
|
}
|
|
3870
3893
|
const labelRaw = sectionMatch[1].trim();
|
|
3871
|
-
const colorMatch = labelRaw.match(
|
|
3894
|
+
const colorMatch = labelRaw.match(
|
|
3895
|
+
/^(.+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)$/
|
|
3896
|
+
);
|
|
3872
3897
|
if (colorMatch) {
|
|
3873
3898
|
pushWarning(
|
|
3874
3899
|
lineNumber,
|
|
3875
|
-
`(${colorMatch[2]
|
|
3900
|
+
`'(${colorMatch[2]})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3876
3901
|
);
|
|
3877
3902
|
}
|
|
3878
3903
|
contentStarted = true;
|
|
@@ -4027,7 +4052,7 @@ function parseSequenceDgmo(content) {
|
|
|
4027
4052
|
const color = coloredMatch[2].trim();
|
|
4028
4053
|
pushError(
|
|
4029
4054
|
lineNumber,
|
|
4030
|
-
`'${id}(${color})' syntax is no longer supported \u2014 use 'tag:' groups for coloring`
|
|
4055
|
+
`'${id}(${color})' parens-color syntax is no longer supported \u2014 use 'tag:' groups for coloring`
|
|
4031
4056
|
);
|
|
4032
4057
|
contentStarted = true;
|
|
4033
4058
|
const key = addParticipant(id, lineNumber, { metadata: colorMeta });
|
|
@@ -4406,7 +4431,7 @@ var init_parser = __esm({
|
|
|
4406
4431
|
]);
|
|
4407
4432
|
IS_A_PATTERN = /^([^:]+?)\s+is\s+an?\s+(\w+)(?:\s+(.+))?$/i;
|
|
4408
4433
|
POSITION_ONLY_PATTERN = /^([^:]+?)\s+position\s+(-?\d+)$/i;
|
|
4409
|
-
COLORED_PARTICIPANT_PATTERN = /^(\S+?)\((
|
|
4434
|
+
COLORED_PARTICIPANT_PATTERN = /^(\S+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)\s*$/;
|
|
4410
4435
|
GROUP_HEADING_PATTERN = /^\[([^\]|]+?)(?:\(([^)]+)\))?\]\s*(.*)$/;
|
|
4411
4436
|
GROUP_HEADING_FALLBACK = /^\[([^\]]+)\]\s*(.*)$/;
|
|
4412
4437
|
LEGACY_GROUP_PATTERN = /^##\s+(.+?)(?:\(([^)]+)\))?\s*$/;
|
|
@@ -4475,7 +4500,6 @@ function splitArrows(line12) {
|
|
|
4475
4500
|
const arrowEnd = idx + 2;
|
|
4476
4501
|
let arrowStart;
|
|
4477
4502
|
let label;
|
|
4478
|
-
let color;
|
|
4479
4503
|
let openingStart = -1;
|
|
4480
4504
|
for (let i = scanFloor; i < runStart; i++) {
|
|
4481
4505
|
if (line12[i] !== "-") continue;
|
|
@@ -4488,21 +4512,13 @@ function splitArrows(line12) {
|
|
|
4488
4512
|
if (openingStart !== -1) {
|
|
4489
4513
|
let openingEnd = openingStart;
|
|
4490
4514
|
while (openingEnd < runStart && line12[openingEnd] === "-") openingEnd++;
|
|
4491
|
-
const
|
|
4492
|
-
|
|
4493
|
-
if (colorMatch) {
|
|
4494
|
-
color = colorMatch[1].trim();
|
|
4495
|
-
const labelPart = arrowContent.substring(0, colorMatch.index).trim();
|
|
4496
|
-
if (labelPart) label = labelPart;
|
|
4497
|
-
} else {
|
|
4498
|
-
const labelPart = arrowContent.trim();
|
|
4499
|
-
if (labelPart) label = labelPart;
|
|
4500
|
-
}
|
|
4515
|
+
const labelPart = line12.substring(openingEnd, runStart).trim();
|
|
4516
|
+
if (labelPart) label = labelPart;
|
|
4501
4517
|
arrowStart = openingStart;
|
|
4502
4518
|
} else {
|
|
4503
4519
|
arrowStart = runStart;
|
|
4504
4520
|
}
|
|
4505
|
-
arrowPositions.push({ start: arrowStart, end: arrowEnd, label
|
|
4521
|
+
arrowPositions.push({ start: arrowStart, end: arrowEnd, label });
|
|
4506
4522
|
searchFrom = arrowEnd;
|
|
4507
4523
|
scanFloor = arrowEnd;
|
|
4508
4524
|
}
|
|
@@ -4516,11 +4532,7 @@ function splitArrows(line12) {
|
|
|
4516
4532
|
if (beforeText || i === 0) {
|
|
4517
4533
|
segments.push(beforeText);
|
|
4518
4534
|
}
|
|
4519
|
-
|
|
4520
|
-
if (arrow.label && arrow.color)
|
|
4521
|
-
arrowToken = `-${arrow.label}(${arrow.color})->`;
|
|
4522
|
-
else if (arrow.label) arrowToken = `-${arrow.label}->`;
|
|
4523
|
-
else if (arrow.color) arrowToken = `-(${arrow.color})->`;
|
|
4535
|
+
const arrowToken = arrow.label ? `-${arrow.label}->` : "->";
|
|
4524
4536
|
segments.push(arrowToken);
|
|
4525
4537
|
lastIndex = arrow.end;
|
|
4526
4538
|
}
|
|
@@ -4530,45 +4542,14 @@ function splitArrows(line12) {
|
|
|
4530
4542
|
}
|
|
4531
4543
|
return segments;
|
|
4532
4544
|
}
|
|
4533
|
-
function parseArrowToken(token,
|
|
4545
|
+
function parseArrowToken(token, _palette, lineNumber, diagnostics) {
|
|
4534
4546
|
if (token === "->") return {};
|
|
4535
|
-
const
|
|
4536
|
-
if (bareParen) {
|
|
4537
|
-
const colorName = matchColorParens(bareParen[1]);
|
|
4538
|
-
if (colorName) {
|
|
4539
|
-
return {
|
|
4540
|
-
color: resolveColorWithDiagnostic(
|
|
4541
|
-
colorName,
|
|
4542
|
-
lineNumber,
|
|
4543
|
-
diagnostics,
|
|
4544
|
-
palette
|
|
4545
|
-
)
|
|
4546
|
-
};
|
|
4547
|
-
}
|
|
4548
|
-
}
|
|
4549
|
-
const m = token.match(/^-(.+?)(?:\(([^)]+)\))?->$/);
|
|
4547
|
+
const m = token.match(/^-(.+?)->$/);
|
|
4550
4548
|
if (m) {
|
|
4551
4549
|
const rawLabel = m[1] ?? "";
|
|
4552
4550
|
const labelResult = parseInArrowLabel(rawLabel, lineNumber);
|
|
4553
4551
|
diagnostics.push(...labelResult.diagnostics);
|
|
4554
|
-
|
|
4555
|
-
let color = m[2] ? resolveColorWithDiagnostic(
|
|
4556
|
-
m[2].trim(),
|
|
4557
|
-
lineNumber,
|
|
4558
|
-
diagnostics,
|
|
4559
|
-
palette
|
|
4560
|
-
) : void 0;
|
|
4561
|
-
if (label && !color) {
|
|
4562
|
-
const inferred = inferArrowColor(label);
|
|
4563
|
-
if (inferred)
|
|
4564
|
-
color = resolveColorWithDiagnostic(
|
|
4565
|
-
inferred,
|
|
4566
|
-
lineNumber,
|
|
4567
|
-
diagnostics,
|
|
4568
|
-
palette
|
|
4569
|
-
);
|
|
4570
|
-
}
|
|
4571
|
-
return { label, color };
|
|
4552
|
+
return { label: labelResult.label };
|
|
4572
4553
|
}
|
|
4573
4554
|
return {};
|
|
4574
4555
|
}
|
|
@@ -4634,13 +4615,12 @@ function parseFlowchart(content, palette) {
|
|
|
4634
4615
|
result.nodes.push(node);
|
|
4635
4616
|
return node;
|
|
4636
4617
|
}
|
|
4637
|
-
function addEdge(sourceId, targetId, lineNumber, label
|
|
4618
|
+
function addEdge(sourceId, targetId, lineNumber, label) {
|
|
4638
4619
|
const edge = {
|
|
4639
4620
|
source: sourceId,
|
|
4640
4621
|
target: targetId,
|
|
4641
4622
|
lineNumber,
|
|
4642
|
-
...label && { label }
|
|
4643
|
-
...color && { color }
|
|
4623
|
+
...label && { label }
|
|
4644
4624
|
};
|
|
4645
4625
|
result.edges.push(edge);
|
|
4646
4626
|
}
|
|
@@ -4706,13 +4686,7 @@ function parseFlowchart(content, palette) {
|
|
|
4706
4686
|
if (pendingArrow !== null) {
|
|
4707
4687
|
const sourceId = lastNodeId ?? implicitSourceId;
|
|
4708
4688
|
if (sourceId) {
|
|
4709
|
-
addEdge(
|
|
4710
|
-
sourceId,
|
|
4711
|
-
node.id,
|
|
4712
|
-
lineNumber,
|
|
4713
|
-
pendingArrow.label,
|
|
4714
|
-
pendingArrow.color
|
|
4715
|
-
);
|
|
4689
|
+
addEdge(sourceId, node.id, lineNumber, pendingArrow.label);
|
|
4716
4690
|
}
|
|
4717
4691
|
pendingArrow = null;
|
|
4718
4692
|
} else if (lastNodeId === null && implicitSourceId === null) {
|
|
@@ -4837,7 +4811,6 @@ var NODE_ID_RE;
|
|
|
4837
4811
|
var init_flowchart_parser = __esm({
|
|
4838
4812
|
"src/graph/flowchart-parser.ts"() {
|
|
4839
4813
|
"use strict";
|
|
4840
|
-
init_colors();
|
|
4841
4814
|
init_diagnostics();
|
|
4842
4815
|
init_arrows();
|
|
4843
4816
|
init_parsing();
|
|
@@ -4865,7 +4838,6 @@ function splitArrows2(line12) {
|
|
|
4865
4838
|
const arrowEnd = idx + 2;
|
|
4866
4839
|
let arrowStart;
|
|
4867
4840
|
let label;
|
|
4868
|
-
let color;
|
|
4869
4841
|
let openingStart = -1;
|
|
4870
4842
|
for (let i = scanFloor; i < runStart; i++) {
|
|
4871
4843
|
if (line12[i] !== "-") continue;
|
|
@@ -4878,21 +4850,13 @@ function splitArrows2(line12) {
|
|
|
4878
4850
|
if (openingStart !== -1) {
|
|
4879
4851
|
let openingEnd = openingStart;
|
|
4880
4852
|
while (openingEnd < runStart && line12[openingEnd] === "-") openingEnd++;
|
|
4881
|
-
const
|
|
4882
|
-
|
|
4883
|
-
if (colorMatch) {
|
|
4884
|
-
color = colorMatch[1].trim();
|
|
4885
|
-
const labelPart = arrowContent.substring(0, colorMatch.index).trim();
|
|
4886
|
-
if (labelPart) label = labelPart;
|
|
4887
|
-
} else {
|
|
4888
|
-
const labelPart = arrowContent.trim();
|
|
4889
|
-
if (labelPart) label = labelPart;
|
|
4890
|
-
}
|
|
4853
|
+
const labelPart = line12.substring(openingEnd, runStart).trim();
|
|
4854
|
+
if (labelPart) label = labelPart;
|
|
4891
4855
|
arrowStart = openingStart;
|
|
4892
4856
|
} else {
|
|
4893
4857
|
arrowStart = runStart;
|
|
4894
4858
|
}
|
|
4895
|
-
arrowPositions.push({ start: arrowStart, end: arrowEnd, label
|
|
4859
|
+
arrowPositions.push({ start: arrowStart, end: arrowEnd, label });
|
|
4896
4860
|
searchFrom = arrowEnd;
|
|
4897
4861
|
scanFloor = arrowEnd;
|
|
4898
4862
|
}
|
|
@@ -4902,11 +4866,7 @@ function splitArrows2(line12) {
|
|
|
4902
4866
|
const arrow = arrowPositions[i];
|
|
4903
4867
|
const beforeText = line12.substring(lastIndex, arrow.start).trim();
|
|
4904
4868
|
if (beforeText || i === 0) segments.push(beforeText);
|
|
4905
|
-
|
|
4906
|
-
if (arrow.label && arrow.color)
|
|
4907
|
-
arrowToken = `-${arrow.label}(${arrow.color})->`;
|
|
4908
|
-
else if (arrow.label) arrowToken = `-${arrow.label}->`;
|
|
4909
|
-
else if (arrow.color) arrowToken = `-(${arrow.color})->`;
|
|
4869
|
+
const arrowToken = arrow.label ? `-${arrow.label}->` : "->";
|
|
4910
4870
|
segments.push(arrowToken);
|
|
4911
4871
|
lastIndex = arrow.end;
|
|
4912
4872
|
}
|
|
@@ -4914,35 +4874,14 @@ function splitArrows2(line12) {
|
|
|
4914
4874
|
if (remaining) segments.push(remaining);
|
|
4915
4875
|
return segments;
|
|
4916
4876
|
}
|
|
4917
|
-
function parseArrowToken2(token,
|
|
4877
|
+
function parseArrowToken2(token, _palette, lineNumber, diagnostics) {
|
|
4918
4878
|
if (token === "->") return {};
|
|
4919
|
-
const
|
|
4920
|
-
if (bareParen) {
|
|
4921
|
-
const colorName = matchColorParens(bareParen[1]);
|
|
4922
|
-
if (colorName) {
|
|
4923
|
-
return {
|
|
4924
|
-
color: resolveColorWithDiagnostic(
|
|
4925
|
-
colorName,
|
|
4926
|
-
lineNumber,
|
|
4927
|
-
diagnostics,
|
|
4928
|
-
palette
|
|
4929
|
-
)
|
|
4930
|
-
};
|
|
4931
|
-
}
|
|
4932
|
-
}
|
|
4933
|
-
const m = token.match(/^-(.+?)(?:\(([^)]+)\))?->$/);
|
|
4879
|
+
const m = token.match(/^-(.+?)->$/);
|
|
4934
4880
|
if (m) {
|
|
4935
4881
|
const rawLabel = m[1] ?? "";
|
|
4936
4882
|
const labelResult = parseInArrowLabel(rawLabel, lineNumber);
|
|
4937
4883
|
diagnostics.push(...labelResult.diagnostics);
|
|
4938
|
-
|
|
4939
|
-
const color = m[2] ? resolveColorWithDiagnostic(
|
|
4940
|
-
m[2].trim(),
|
|
4941
|
-
lineNumber,
|
|
4942
|
-
diagnostics,
|
|
4943
|
-
palette
|
|
4944
|
-
) : void 0;
|
|
4945
|
-
return { label, color };
|
|
4884
|
+
return { label: labelResult.label };
|
|
4946
4885
|
}
|
|
4947
4886
|
return {};
|
|
4948
4887
|
}
|
|
@@ -5033,13 +4972,12 @@ function parseState(content, palette) {
|
|
|
5033
4972
|
}
|
|
5034
4973
|
return node;
|
|
5035
4974
|
}
|
|
5036
|
-
function addEdge(sourceId, targetId, lineNumber, label
|
|
4975
|
+
function addEdge(sourceId, targetId, lineNumber, label) {
|
|
5037
4976
|
result.edges.push({
|
|
5038
4977
|
source: sourceId,
|
|
5039
4978
|
target: targetId,
|
|
5040
4979
|
lineNumber,
|
|
5041
|
-
...label && { label }
|
|
5042
|
-
...color && { color }
|
|
4980
|
+
...label && { label }
|
|
5043
4981
|
});
|
|
5044
4982
|
}
|
|
5045
4983
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -5182,13 +5120,7 @@ function parseState(content, palette) {
|
|
|
5182
5120
|
if (pendingArrow !== null) {
|
|
5183
5121
|
const sourceId = lastNodeId ?? implicitSourceId;
|
|
5184
5122
|
if (sourceId) {
|
|
5185
|
-
addEdge(
|
|
5186
|
-
sourceId,
|
|
5187
|
-
node.id,
|
|
5188
|
-
lineNumber,
|
|
5189
|
-
pendingArrow.label,
|
|
5190
|
-
pendingArrow.color
|
|
5191
|
-
);
|
|
5123
|
+
addEdge(sourceId, node.id, lineNumber, pendingArrow.label);
|
|
5192
5124
|
}
|
|
5193
5125
|
pendingArrow = null;
|
|
5194
5126
|
}
|
|
@@ -5241,7 +5173,7 @@ var init_state_parser = __esm({
|
|
|
5241
5173
|
init_name_normalize();
|
|
5242
5174
|
PSEUDOSTATE_ID = "pseudostate:[*]";
|
|
5243
5175
|
PSEUDOSTATE_LABEL = "[*]";
|
|
5244
|
-
GROUP_BRACKET_RE = /^\[([^\]]+)\](?:\(
|
|
5176
|
+
GROUP_BRACKET_RE = /^\[([^\]]+)\](?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/;
|
|
5245
5177
|
}
|
|
5246
5178
|
});
|
|
5247
5179
|
|
|
@@ -5620,7 +5552,7 @@ var init_parser2 = __esm({
|
|
|
5620
5552
|
init_arrows();
|
|
5621
5553
|
init_parsing();
|
|
5622
5554
|
init_name_normalize();
|
|
5623
|
-
CLASS_DECL_RE = /^(?:(abstract|interface|enum)\s+)?(?:"([^"]+)"|([A-Z][^":]*?))(?:\s+extends\s+(?:"([^"]+)"|([A-Z][^":]*?)))?(?:\s+implements\s+(?:"([^"]+)"|([A-Z][^":]*?)))?(?:\s+\[(abstract|interface|enum)\])?(?:\s
|
|
5555
|
+
CLASS_DECL_RE = /^(?:(abstract|interface|enum)\s+)?(?:"([^"]+)"|([A-Z][^":]*?))(?:\s+extends\s+(?:"([^"]+)"|([A-Z][^":]*?)))?(?:\s+implements\s+(?:"([^"]+)"|([A-Z][^":]*?)))?(?:\s+\[(abstract|interface|enum)\])?(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?(?:\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11}))?\s*$/;
|
|
5624
5556
|
INDENT_REL_ARROW_RE = /^(--\|>|\.\.\|>|\*--|o--|\.\.>|->)\s*(?:"([^"]+)"|([A-Za-z][^":]*?))(?:\s+:?\s*(.+))?$/;
|
|
5625
5557
|
REL_ARROW_RE = /^(?:"([^"]+)"|([A-Z][^":]*?))\s*(--\|>|\.\.\|>|\*--|o--|\.\.>|->)\s*(?:"([^"]+)"|([A-Z][^":]*?))(?:\s+:?\s*(.+))?$/;
|
|
5626
5558
|
VISIBILITY_RE = /^([+\-#])\s*/;
|
|
@@ -5827,7 +5759,7 @@ function parseERDiagram(content, palette) {
|
|
|
5827
5759
|
result.diagnostics.push(
|
|
5828
5760
|
makeDgmoError(
|
|
5829
5761
|
lineNumber,
|
|
5830
|
-
`Expected 'Value
|
|
5762
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`,
|
|
5831
5763
|
"warning"
|
|
5832
5764
|
)
|
|
5833
5765
|
);
|
|
@@ -5939,7 +5871,7 @@ function parseERDiagram(content, palette) {
|
|
|
5939
5871
|
if (result.tables.length === 0 && !result.error) {
|
|
5940
5872
|
const diag = makeDgmoError(
|
|
5941
5873
|
1,
|
|
5942
|
-
'No tables found. Add table declarations like "users" or "orders
|
|
5874
|
+
'No tables found. Add table declarations like "users" or "orders blue".'
|
|
5943
5875
|
);
|
|
5944
5876
|
result.diagnostics.push(diag);
|
|
5945
5877
|
result.error = formatDgmoError(diag);
|
|
@@ -6025,15 +5957,19 @@ function extractSymbols3(docText) {
|
|
|
6025
5957
|
for (const rawLine of docText.split("\n")) {
|
|
6026
5958
|
const line12 = rawLine.trim();
|
|
6027
5959
|
if (inMetadata && /^er(\s|$)/i.test(line12)) continue;
|
|
6028
|
-
if (inMetadata && OPTION_NOCOLON_RE.test(line12)) continue;
|
|
6029
|
-
inMetadata = false;
|
|
6030
|
-
if (line12.length === 0) continue;
|
|
6031
5960
|
if (/^\s/.test(rawLine)) continue;
|
|
5961
|
+
if (line12.length === 0) continue;
|
|
6032
5962
|
const m = TABLE_DECL_RE.exec(line12);
|
|
6033
5963
|
if (m) {
|
|
6034
5964
|
const name = (m[1] ?? m[2] ?? "").trim();
|
|
6035
|
-
if (name)
|
|
5965
|
+
if (name) {
|
|
5966
|
+
inMetadata = false;
|
|
5967
|
+
entities.push(name);
|
|
5968
|
+
continue;
|
|
5969
|
+
}
|
|
6036
5970
|
}
|
|
5971
|
+
if (inMetadata && OPTION_NOCOLON_RE.test(line12)) continue;
|
|
5972
|
+
inMetadata = false;
|
|
6037
5973
|
}
|
|
6038
5974
|
return {
|
|
6039
5975
|
kind: "er",
|
|
@@ -6051,7 +5987,7 @@ var init_parser3 = __esm({
|
|
|
6051
5987
|
init_name_normalize();
|
|
6052
5988
|
init_parsing();
|
|
6053
5989
|
init_tag_groups();
|
|
6054
|
-
TABLE_DECL_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":(]*?))(?:\s
|
|
5990
|
+
TABLE_DECL_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":(]*?))(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?(?:\s*\|(.+))?$/;
|
|
6055
5991
|
INDENT_REL_RE = /^([1*?])-{1,2}(?:(.+?)-{1,2})?([1*?])\s+(?:"([^"]+)"|([a-zA-Z_][^":]*?))\s*$/;
|
|
6056
5992
|
CONSTRAINT_MAP = {
|
|
6057
5993
|
pk: "pk",
|
|
@@ -6131,18 +6067,22 @@ function parseChart(content, palette) {
|
|
|
6131
6067
|
return fail(lineNumber, msg2);
|
|
6132
6068
|
}
|
|
6133
6069
|
}
|
|
6134
|
-
const eraMatch = trimmed.match(
|
|
6135
|
-
/^era\s+(.+?)\s*->\s*(.+?)(?:\s*\(([^)]+)\))?\s*$/
|
|
6136
|
-
);
|
|
6070
|
+
const eraMatch = trimmed.match(/^era\s+(.+?)\s*->\s*(.+?)\s*$/);
|
|
6137
6071
|
if (eraMatch) {
|
|
6138
6072
|
const afterArrow = eraMatch[2].trim();
|
|
6139
6073
|
const spaceIdx2 = afterArrow.indexOf(" ");
|
|
6140
6074
|
if (spaceIdx2 >= 0) {
|
|
6075
|
+
const lastSpaceIdx = afterArrow.lastIndexOf(" ");
|
|
6076
|
+
const trailing = afterArrow.substring(lastSpaceIdx + 1);
|
|
6077
|
+
const hasColor = RECOGNIZED_COLOR_NAMES.includes(
|
|
6078
|
+
trailing
|
|
6079
|
+
);
|
|
6080
|
+
const labelPart = hasColor ? afterArrow.substring(0, lastSpaceIdx).trimEnd() : afterArrow;
|
|
6141
6081
|
rawEras.push({
|
|
6142
6082
|
start: eraMatch[1].trim(),
|
|
6143
|
-
afterArrow,
|
|
6144
|
-
color:
|
|
6145
|
-
|
|
6083
|
+
afterArrow: labelPart,
|
|
6084
|
+
color: hasColor ? resolveColorWithDiagnostic(
|
|
6085
|
+
trailing,
|
|
6146
6086
|
lineNumber,
|
|
6147
6087
|
result.diagnostics,
|
|
6148
6088
|
palette
|
|
@@ -6642,11 +6582,12 @@ function parseExtendedChart(content, palette) {
|
|
|
6642
6582
|
return result;
|
|
6643
6583
|
}
|
|
6644
6584
|
}
|
|
6645
|
-
const categoryMatch = trimmed.match(/^\[(.+?)\](?:\s
|
|
6585
|
+
const categoryMatch = trimmed.match(/^\[(.+?)\](?:\s+(\S+))?\s*$/);
|
|
6646
6586
|
if (categoryMatch) {
|
|
6647
6587
|
const catName = categoryMatch[1].trim();
|
|
6648
|
-
const
|
|
6649
|
-
|
|
6588
|
+
const rawCatColor = categoryMatch[2]?.trim();
|
|
6589
|
+
const catColor = rawCatColor ? resolveColorWithDiagnostic(
|
|
6590
|
+
rawCatColor,
|
|
6650
6591
|
lineNumber,
|
|
6651
6592
|
result.diagnostics,
|
|
6652
6593
|
palette
|
|
@@ -6661,7 +6602,7 @@ function parseExtendedChart(content, palette) {
|
|
|
6661
6602
|
continue;
|
|
6662
6603
|
}
|
|
6663
6604
|
const arrowMatch = trimmed.match(
|
|
6664
|
-
/^(.+?)\s*(->|--)\s*(.+?)\s+(-?[\d,_]+(?:\.[\d]+)?)
|
|
6605
|
+
/^(.+?)\s*(->|--)\s*(.+?)\s+(-?[\d,_]+(?:\.[\d]+)?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
6665
6606
|
);
|
|
6666
6607
|
if (arrowMatch) {
|
|
6667
6608
|
const [, rawSource, arrow, rawTarget, rawVal, rawLinkColor] = arrowMatch;
|
|
@@ -6706,9 +6647,12 @@ function parseExtendedChart(content, palette) {
|
|
|
6706
6647
|
}
|
|
6707
6648
|
if (sankeyStack.length > 0) {
|
|
6708
6649
|
const valColorMatch = trimmed.match(
|
|
6709
|
-
/(-?[\d,_]+(?:\.[\d]+)?)\s
|
|
6650
|
+
/(-?[\d,_]+(?:\.[\d]+)?)\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\s*$/
|
|
6710
6651
|
);
|
|
6711
|
-
const strippedLine = valColorMatch ? trimmed.replace(
|
|
6652
|
+
const strippedLine = valColorMatch ? trimmed.replace(
|
|
6653
|
+
/\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\s*$/,
|
|
6654
|
+
""
|
|
6655
|
+
) : trimmed;
|
|
6712
6656
|
const dataRow2 = parseDataRowValues(strippedLine);
|
|
6713
6657
|
if (dataRow2 && dataRow2.values.length === 1) {
|
|
6714
6658
|
const source = sankeyStack.at(-1).name;
|
|
@@ -9088,7 +9032,7 @@ function parseOrg(content, palette) {
|
|
|
9088
9032
|
if (!color) {
|
|
9089
9033
|
pushError(
|
|
9090
9034
|
lineNumber,
|
|
9091
|
-
`Expected 'Value
|
|
9035
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9092
9036
|
);
|
|
9093
9037
|
continue;
|
|
9094
9038
|
}
|
|
@@ -9379,7 +9323,7 @@ function parseKanban(content, palette) {
|
|
|
9379
9323
|
if (!color) {
|
|
9380
9324
|
warn(
|
|
9381
9325
|
lineNumber,
|
|
9382
|
-
`Expected 'Value
|
|
9326
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9383
9327
|
);
|
|
9384
9328
|
continue;
|
|
9385
9329
|
}
|
|
@@ -9422,8 +9366,9 @@ function parseKanban(content, palette) {
|
|
|
9422
9366
|
currentCard = null;
|
|
9423
9367
|
columnCounter++;
|
|
9424
9368
|
const colName = columnMatch[1].trim();
|
|
9425
|
-
const
|
|
9426
|
-
|
|
9369
|
+
const rawTrailing = columnMatch[2]?.trim();
|
|
9370
|
+
const colColor = rawTrailing ? resolveColorWithDiagnostic(
|
|
9371
|
+
rawTrailing,
|
|
9427
9372
|
lineNumber,
|
|
9428
9373
|
result.diagnostics,
|
|
9429
9374
|
palette
|
|
@@ -9578,7 +9523,7 @@ var init_parser5 = __esm({
|
|
|
9578
9523
|
init_tag_groups();
|
|
9579
9524
|
init_parsing();
|
|
9580
9525
|
init_name_normalize();
|
|
9581
|
-
COLUMN_RE = /^\[(.+?)\](?:\s
|
|
9526
|
+
COLUMN_RE = /^\[(.+?)\](?:\s+(\S+))?(?:\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11}))?\s*(?:\|\s*(.+))?$/;
|
|
9582
9527
|
LEGACY_COLUMN_RE = /^==\s+(.+?)\s*(?:\[wip:\s*(\d+)\])?\s*==$/;
|
|
9583
9528
|
KNOWN_OPTIONS4 = /* @__PURE__ */ new Set(["hide", "active-tag"]);
|
|
9584
9529
|
KNOWN_BOOLEANS3 = /* @__PURE__ */ new Set([
|
|
@@ -9761,7 +9706,7 @@ function parseC4(content, palette) {
|
|
|
9761
9706
|
if (!color) {
|
|
9762
9707
|
pushError(
|
|
9763
9708
|
lineNumber,
|
|
9764
|
-
`Expected 'Value
|
|
9709
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9765
9710
|
);
|
|
9766
9711
|
continue;
|
|
9767
9712
|
}
|
|
@@ -10357,7 +10302,7 @@ __export(parser_exports7, {
|
|
|
10357
10302
|
looksLikeSitemap: () => looksLikeSitemap,
|
|
10358
10303
|
parseSitemap: () => parseSitemap
|
|
10359
10304
|
});
|
|
10360
|
-
function parseArrowLine(trimmed,
|
|
10305
|
+
function parseArrowLine(trimmed, _palette, _lineNumber, _diagnostics) {
|
|
10361
10306
|
const bareMatch = trimmed.match(BARE_ARROW_RE);
|
|
10362
10307
|
if (bareMatch) {
|
|
10363
10308
|
const rawTarget = bareMatch[1].trim();
|
|
@@ -10370,27 +10315,10 @@ function parseArrowLine(trimmed, palette, lineNumber, diagnostics) {
|
|
|
10370
10315
|
const arrowMatch = trimmed.match(ARROW_RE);
|
|
10371
10316
|
if (arrowMatch) {
|
|
10372
10317
|
const label = arrowMatch[1]?.trim() || void 0;
|
|
10373
|
-
|
|
10374
|
-
arrowMatch[2].trim(),
|
|
10375
|
-
lineNumber,
|
|
10376
|
-
diagnostics,
|
|
10377
|
-
palette
|
|
10378
|
-
) : void 0;
|
|
10379
|
-
if (label && !color) {
|
|
10380
|
-
const inferred = inferArrowColor(label);
|
|
10381
|
-
if (inferred)
|
|
10382
|
-
color = resolveColorWithDiagnostic(
|
|
10383
|
-
inferred,
|
|
10384
|
-
lineNumber,
|
|
10385
|
-
diagnostics,
|
|
10386
|
-
palette
|
|
10387
|
-
);
|
|
10388
|
-
}
|
|
10389
|
-
const rawTarget = arrowMatch[3].trim();
|
|
10318
|
+
const rawTarget = arrowMatch[2].trim();
|
|
10390
10319
|
const groupMatch = rawTarget.match(/^\[(.+)\]$/);
|
|
10391
10320
|
return {
|
|
10392
10321
|
label,
|
|
10393
|
-
color,
|
|
10394
10322
|
target: groupMatch ? groupMatch[1].trim() : rawTarget,
|
|
10395
10323
|
targetIsGroup: !!groupMatch
|
|
10396
10324
|
};
|
|
@@ -10532,7 +10460,7 @@ function parseSitemap(content, palette) {
|
|
|
10532
10460
|
if (!color) {
|
|
10533
10461
|
pushError(
|
|
10534
10462
|
lineNumber,
|
|
10535
|
-
`Expected 'Value
|
|
10463
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
10536
10464
|
);
|
|
10537
10465
|
continue;
|
|
10538
10466
|
}
|
|
@@ -10569,7 +10497,6 @@ function parseSitemap(content, palette) {
|
|
|
10569
10497
|
targetLabel: arrowInfo.target,
|
|
10570
10498
|
targetIsGroup: arrowInfo.targetIsGroup,
|
|
10571
10499
|
label: arrowInfo.label,
|
|
10572
|
-
color: arrowInfo.color,
|
|
10573
10500
|
lineNumber
|
|
10574
10501
|
});
|
|
10575
10502
|
}
|
|
@@ -10667,7 +10594,6 @@ function parseSitemap(content, palette) {
|
|
|
10667
10594
|
sourceId: arrow.sourceNode.id,
|
|
10668
10595
|
targetId: aliasHit,
|
|
10669
10596
|
label: arrow.label,
|
|
10670
|
-
color: arrow.color,
|
|
10671
10597
|
lineNumber: arrow.lineNumber
|
|
10672
10598
|
});
|
|
10673
10599
|
continue;
|
|
@@ -10687,7 +10613,6 @@ function parseSitemap(content, palette) {
|
|
|
10687
10613
|
sourceId: arrow.sourceNode.id,
|
|
10688
10614
|
targetId: targetContainer.id,
|
|
10689
10615
|
label: arrow.label,
|
|
10690
|
-
color: arrow.color,
|
|
10691
10616
|
lineNumber: arrow.lineNumber
|
|
10692
10617
|
});
|
|
10693
10618
|
} else {
|
|
@@ -10704,7 +10629,6 @@ function parseSitemap(content, palette) {
|
|
|
10704
10629
|
sourceId: arrow.sourceNode.id,
|
|
10705
10630
|
targetId: targetNode.id,
|
|
10706
10631
|
label: arrow.label,
|
|
10707
|
-
color: arrow.color,
|
|
10708
10632
|
lineNumber: arrow.lineNumber
|
|
10709
10633
|
});
|
|
10710
10634
|
}
|
|
@@ -10794,7 +10718,6 @@ var CONTAINER_RE3, METADATA_RE3, ARROW_RE, BARE_ARROW_RE;
|
|
|
10794
10718
|
var init_parser7 = __esm({
|
|
10795
10719
|
"src/sitemap/parser.ts"() {
|
|
10796
10720
|
"use strict";
|
|
10797
|
-
init_colors();
|
|
10798
10721
|
init_diagnostics();
|
|
10799
10722
|
init_name_normalize();
|
|
10800
10723
|
init_tag_groups();
|
|
@@ -10802,7 +10725,7 @@ var init_parser7 = __esm({
|
|
|
10802
10725
|
init_description_helpers();
|
|
10803
10726
|
CONTAINER_RE3 = /^\[([^\]]+)\]\s*(?:\|\s*(.+))?$/;
|
|
10804
10727
|
METADATA_RE3 = /^([^:]+):\s*(.+)$/;
|
|
10805
|
-
ARROW_RE = /^-([
|
|
10728
|
+
ARROW_RE = /^-([^>][^>]*?)?\s*->\s*(.+)$/;
|
|
10806
10729
|
BARE_ARROW_RE = /^->\s*(.+)$/;
|
|
10807
10730
|
}
|
|
10808
10731
|
});
|
|
@@ -11093,13 +11016,18 @@ function parseInfra(content) {
|
|
|
11093
11016
|
}
|
|
11094
11017
|
if (currentTagGroup && indent > 0) {
|
|
11095
11018
|
const { text: cleanEntry, isDefault } = stripDefaultModifier(trimmed);
|
|
11096
|
-
const
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11019
|
+
const lastSpaceIdx = cleanEntry.lastIndexOf(" ");
|
|
11020
|
+
let valueName = cleanEntry;
|
|
11021
|
+
let rawColor;
|
|
11022
|
+
if (lastSpaceIdx > 0) {
|
|
11023
|
+
const trailing = cleanEntry.substring(lastSpaceIdx + 1);
|
|
11024
|
+
if (isRecognizedColorName(trailing)) {
|
|
11025
|
+
rawColor = trailing;
|
|
11026
|
+
valueName = cleanEntry.substring(0, lastSpaceIdx).trimEnd();
|
|
11027
|
+
}
|
|
11028
|
+
}
|
|
11029
|
+
const tvMatch = valueName.match(TAG_VALUE_RE);
|
|
11030
|
+
if (tvMatch || /^\w+$/.test(valueName)) {
|
|
11103
11031
|
currentTagGroup.values.push({
|
|
11104
11032
|
name: valueName,
|
|
11105
11033
|
color: rawColor
|
|
@@ -11511,9 +11439,9 @@ var init_parser8 = __esm({
|
|
|
11511
11439
|
"use strict";
|
|
11512
11440
|
init_diagnostics();
|
|
11513
11441
|
init_description_helpers();
|
|
11514
|
-
init_colors();
|
|
11515
11442
|
init_arrows();
|
|
11516
11443
|
init_parsing();
|
|
11444
|
+
init_colors();
|
|
11517
11445
|
init_name_normalize();
|
|
11518
11446
|
init_tag_groups();
|
|
11519
11447
|
init_types();
|
|
@@ -11523,7 +11451,7 @@ var init_parser8 = __esm({
|
|
|
11523
11451
|
ASYNC_SIMPLE_CONNECTION_RE = /^~>\s*(.+?)\s*$/;
|
|
11524
11452
|
DEPRECATED_FANOUT_RE = /\bx(\d+)\s*$/;
|
|
11525
11453
|
GROUP_RE = /^\[([^\]]+)\]\s*(?:as\s+([A-Za-z][A-Za-z0-9_]{0,11})\s*)?(?:\|\s*(.+))?$/;
|
|
11526
|
-
TAG_VALUE_RE = /^(\w[\w\s]
|
|
11454
|
+
TAG_VALUE_RE = /^(\w[\w\s]+?)\s*$/;
|
|
11527
11455
|
COMPONENT_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":]*?))\s*(\|.*)?$/;
|
|
11528
11456
|
PIPE_META_RE = /[|,]\s*(\w+)\s*:\s*([^|,]+)/g;
|
|
11529
11457
|
PROPERTY_RE = /^([\w-]+)\s+(.+)$/;
|
|
@@ -12960,7 +12888,7 @@ function parsePert(content, parseOpts = {}) {
|
|
|
12960
12888
|
if (!color) {
|
|
12961
12889
|
warn(
|
|
12962
12890
|
lineNumber,
|
|
12963
|
-
`Expected 'Value
|
|
12891
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
12964
12892
|
);
|
|
12965
12893
|
continue;
|
|
12966
12894
|
}
|
|
@@ -12983,7 +12911,7 @@ function parsePert(content, parseOpts = {}) {
|
|
|
12983
12911
|
if (!color) {
|
|
12984
12912
|
warn(
|
|
12985
12913
|
lineNumber,
|
|
12986
|
-
`Expected 'Value
|
|
12914
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
12987
12915
|
);
|
|
12988
12916
|
continue;
|
|
12989
12917
|
}
|
|
@@ -14532,7 +14460,7 @@ function parseMindmap(content, palette) {
|
|
|
14532
14460
|
if (!color) {
|
|
14533
14461
|
pushError(
|
|
14534
14462
|
lineNumber,
|
|
14535
|
-
`Expected 'Value
|
|
14463
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
14536
14464
|
);
|
|
14537
14465
|
continue;
|
|
14538
14466
|
}
|
|
@@ -15118,7 +15046,7 @@ function parseWireframe(content) {
|
|
|
15118
15046
|
} else {
|
|
15119
15047
|
pushWarning(
|
|
15120
15048
|
lineNumber,
|
|
15121
|
-
`Expected 'Value
|
|
15049
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
15122
15050
|
);
|
|
15123
15051
|
}
|
|
15124
15052
|
continue;
|
|
@@ -15735,6 +15663,13 @@ function parseCycle(content) {
|
|
|
15735
15663
|
warn(lineNum, "Empty node label.");
|
|
15736
15664
|
continue;
|
|
15737
15665
|
}
|
|
15666
|
+
if (!metadata["color"]) {
|
|
15667
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
15668
|
+
if (shortcutColor) {
|
|
15669
|
+
metadata["color"] = shortcutColor;
|
|
15670
|
+
label = stripped;
|
|
15671
|
+
}
|
|
15672
|
+
}
|
|
15738
15673
|
const color = metadata["color"];
|
|
15739
15674
|
const spanStr = metadata["span"];
|
|
15740
15675
|
let span = 1;
|
|
@@ -15964,8 +15899,12 @@ function parseJourneyMap(content, palette) {
|
|
|
15964
15899
|
const key = part.substring(0, colonIdx).trim().toLowerCase();
|
|
15965
15900
|
const value = part.substring(colonIdx + 1).trim();
|
|
15966
15901
|
if (key === "color") {
|
|
15967
|
-
|
|
15968
|
-
|
|
15902
|
+
personaColor = resolveColorWithDiagnostic(
|
|
15903
|
+
value,
|
|
15904
|
+
lineNumber,
|
|
15905
|
+
result.diagnostics,
|
|
15906
|
+
palette
|
|
15907
|
+
) ?? void 0;
|
|
15969
15908
|
}
|
|
15970
15909
|
}
|
|
15971
15910
|
}
|
|
@@ -16023,7 +15962,7 @@ function parseJourneyMap(content, palette) {
|
|
|
16023
15962
|
if (!color) {
|
|
16024
15963
|
warn(
|
|
16025
15964
|
lineNumber,
|
|
16026
|
-
`Expected 'Value
|
|
15965
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
16027
15966
|
);
|
|
16028
15967
|
continue;
|
|
16029
15968
|
}
|
|
@@ -16266,6 +16205,7 @@ var PHASE_RE, SCORE_RE, ANNOTATION_RE, KNOWN_OPTIONS9, KNOWN_BOOLEANS6;
|
|
|
16266
16205
|
var init_parser16 = __esm({
|
|
16267
16206
|
"src/journey-map/parser.ts"() {
|
|
16268
16207
|
"use strict";
|
|
16208
|
+
init_colors();
|
|
16269
16209
|
init_diagnostics();
|
|
16270
16210
|
init_tag_groups();
|
|
16271
16211
|
init_parsing();
|
|
@@ -16364,6 +16304,13 @@ function parsePyramid(content) {
|
|
|
16364
16304
|
warn(lineNum, "Empty layer label.");
|
|
16365
16305
|
continue;
|
|
16366
16306
|
}
|
|
16307
|
+
if (!color) {
|
|
16308
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
16309
|
+
if (shortcutColor) {
|
|
16310
|
+
color = shortcutColor;
|
|
16311
|
+
label = stripped;
|
|
16312
|
+
}
|
|
16313
|
+
}
|
|
16367
16314
|
currentLayer = {
|
|
16368
16315
|
label,
|
|
16369
16316
|
lineNumber: lineNum,
|
|
@@ -16527,6 +16474,13 @@ function parseRing(content) {
|
|
|
16527
16474
|
warn(lineNum, "Empty layer label.");
|
|
16528
16475
|
continue;
|
|
16529
16476
|
}
|
|
16477
|
+
if (!color) {
|
|
16478
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
16479
|
+
if (shortcutColor) {
|
|
16480
|
+
color = shortcutColor;
|
|
16481
|
+
label = stripped;
|
|
16482
|
+
}
|
|
16483
|
+
}
|
|
16530
16484
|
currentLayer = {
|
|
16531
16485
|
label,
|
|
16532
16486
|
lineNumber: lineNum,
|
|
@@ -17021,7 +16975,7 @@ function parseRaci(content, palette) {
|
|
|
17021
16975
|
if (next.length > 0 && next[0] !== " " && next[0] !== " ") break;
|
|
17022
16976
|
const stripped = nextTrim.replace(/,\s*$/, "");
|
|
17023
16977
|
const segments = stripped.split("|").map((s) => s.trim());
|
|
17024
|
-
|
|
16978
|
+
let roleLabel = segments[0] ?? "";
|
|
17025
16979
|
let roleColor;
|
|
17026
16980
|
if (segments.length > 1) {
|
|
17027
16981
|
const meta = parsePipeMetadata(segments);
|
|
@@ -17034,6 +16988,18 @@ function parseRaci(content, palette) {
|
|
|
17034
16988
|
);
|
|
17035
16989
|
}
|
|
17036
16990
|
}
|
|
16991
|
+
if (!roleColor) {
|
|
16992
|
+
const { label: stripLabel, colorName: shortcutColor } = peelTrailingColorName(roleLabel);
|
|
16993
|
+
if (shortcutColor) {
|
|
16994
|
+
roleColor = resolveColorWithDiagnostic(
|
|
16995
|
+
shortcutColor,
|
|
16996
|
+
j + 1,
|
|
16997
|
+
result.diagnostics,
|
|
16998
|
+
palette
|
|
16999
|
+
);
|
|
17000
|
+
roleLabel = stripLabel;
|
|
17001
|
+
}
|
|
17002
|
+
}
|
|
17037
17003
|
if (roleLabel) getOrAddRole(roleLabel, j + 1, roleColor);
|
|
17038
17004
|
}
|
|
17039
17005
|
i = j - 1;
|
|
@@ -17092,8 +17058,10 @@ function parseRaci(content, palette) {
|
|
|
17092
17058
|
continue;
|
|
17093
17059
|
}
|
|
17094
17060
|
let phaseColor;
|
|
17095
|
-
|
|
17096
|
-
|
|
17061
|
+
const trailingToken = phaseMatch[2];
|
|
17062
|
+
const pipeMeta = phaseMatch[3];
|
|
17063
|
+
if (pipeMeta) {
|
|
17064
|
+
const meta = parsePipeMetadata(["", pipeMeta]);
|
|
17097
17065
|
if (meta["color"]) {
|
|
17098
17066
|
phaseColor = resolveColorWithDiagnostic(
|
|
17099
17067
|
meta["color"],
|
|
@@ -17103,6 +17071,17 @@ function parseRaci(content, palette) {
|
|
|
17103
17071
|
);
|
|
17104
17072
|
}
|
|
17105
17073
|
}
|
|
17074
|
+
if (!phaseColor && trailingToken) {
|
|
17075
|
+
const { colorName } = peelTrailingColorName(`x ${trailingToken}`);
|
|
17076
|
+
if (colorName) {
|
|
17077
|
+
phaseColor = resolveColorWithDiagnostic(
|
|
17078
|
+
colorName,
|
|
17079
|
+
lineNumber,
|
|
17080
|
+
result.diagnostics,
|
|
17081
|
+
palette
|
|
17082
|
+
);
|
|
17083
|
+
}
|
|
17084
|
+
}
|
|
17106
17085
|
currentPhase = {
|
|
17107
17086
|
id: normalizeName(display),
|
|
17108
17087
|
displayName: display,
|
|
@@ -17333,7 +17312,7 @@ var init_parser19 = __esm({
|
|
|
17333
17312
|
"no-title",
|
|
17334
17313
|
...Object.keys(VARIANT_LOCK_DIRECTIVES)
|
|
17335
17314
|
]);
|
|
17336
|
-
PHASE_RE2 = /^\[(.+?)\]
|
|
17315
|
+
PHASE_RE2 = /^\[(.+?)\](?:\s+(\S+))?(?:\s*\|\s*(.+))?\s*$/;
|
|
17337
17316
|
ROLE_ASSIGNMENT_RE = /^([^:]+):\s*(.*)$/;
|
|
17338
17317
|
}
|
|
17339
17318
|
});
|
|
@@ -19049,7 +19028,7 @@ function containerFill(palette, isDark, nodeColor2) {
|
|
|
19049
19028
|
function containerStroke(palette, nodeColor2) {
|
|
19050
19029
|
return nodeColor2 ?? palette.textMuted;
|
|
19051
19030
|
}
|
|
19052
|
-
function renderOrg(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, ancestorPath) {
|
|
19031
|
+
function renderOrg(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, ancestorPath, exportMode) {
|
|
19053
19032
|
d3Selection.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
19054
19033
|
const width = exportDims?.width ?? container.clientWidth;
|
|
19055
19034
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -19309,7 +19288,7 @@ function renderOrg(container, parsed, layout, palette, isDark, onClickItem, expo
|
|
|
19309
19288
|
}
|
|
19310
19289
|
],
|
|
19311
19290
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
19312
|
-
mode: "
|
|
19291
|
+
mode: exportMode ? "export" : "preview"
|
|
19313
19292
|
};
|
|
19314
19293
|
const singleState = { activeGroup: lg.name };
|
|
19315
19294
|
const groupG = legendParentBase.append("g").attr("transform", `translate(${lg.x}, ${lg.y})`);
|
|
@@ -19329,7 +19308,7 @@ function renderOrg(container, parsed, layout, palette, isDark, onClickItem, expo
|
|
|
19329
19308
|
const legendConfig = {
|
|
19330
19309
|
groups,
|
|
19331
19310
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
19332
|
-
mode: "
|
|
19311
|
+
mode: exportMode ? "export" : "preview",
|
|
19333
19312
|
capsulePillAddonWidth: eyeAddonWidth
|
|
19334
19313
|
};
|
|
19335
19314
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
@@ -19796,7 +19775,6 @@ function layoutSitemap(parsed, hiddenCounts, activeTagGroup, hiddenAttributes, e
|
|
|
19796
19775
|
targetId: edge.targetId,
|
|
19797
19776
|
points,
|
|
19798
19777
|
label: edge.label,
|
|
19799
|
-
color: edge.color,
|
|
19800
19778
|
lineNumber: edge.lineNumber,
|
|
19801
19779
|
deferred: deferredSet.has(i) || void 0
|
|
19802
19780
|
});
|
|
@@ -20252,7 +20230,7 @@ function containerFill2(palette, isDark, nodeColor2) {
|
|
|
20252
20230
|
function containerStroke2(palette, nodeColor2) {
|
|
20253
20231
|
return nodeColor2 ?? palette.textMuted;
|
|
20254
20232
|
}
|
|
20255
|
-
function renderSitemap(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes) {
|
|
20233
|
+
function renderSitemap(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, exportMode) {
|
|
20256
20234
|
d3Selection2.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
20257
20235
|
const width = exportDims?.width ?? container.clientWidth;
|
|
20258
20236
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -20283,9 +20261,6 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20283
20261
|
const defs = svg.append("defs");
|
|
20284
20262
|
defs.append("marker").attr("id", "sm-arrow").attr("viewBox", `0 0 ${ARROWHEAD_W} ${ARROWHEAD_H}`).attr("refX", ARROWHEAD_W).attr("refY", ARROWHEAD_H / 2).attr("markerWidth", ARROWHEAD_W).attr("markerHeight", ARROWHEAD_H).attr("orient", "auto").append("polygon").attr("points", `0,0 ${ARROWHEAD_W},${ARROWHEAD_H / 2} 0,${ARROWHEAD_H}`).attr("fill", palette.textMuted);
|
|
20285
20263
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
20286
|
-
for (const edge of layout.edges) {
|
|
20287
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
20288
|
-
}
|
|
20289
20264
|
for (const color of edgeColors) {
|
|
20290
20265
|
const id = `sm-arrow-${color.replace("#", "")}`;
|
|
20291
20266
|
defs.append("marker").attr("id", id).attr("viewBox", `0 0 ${ARROWHEAD_W} ${ARROWHEAD_H}`).attr("refX", ARROWHEAD_W).attr("refY", ARROWHEAD_H / 2).attr("markerWidth", ARROWHEAD_W).attr("markerHeight", ARROWHEAD_H).attr("orient", "auto").append("polygon").attr("points", `0,0 ${ARROWHEAD_W},${ARROWHEAD_H / 2} 0,${ARROWHEAD_H}`).attr("fill", color);
|
|
@@ -20364,8 +20339,8 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20364
20339
|
for (const edge of layout.edges) {
|
|
20365
20340
|
if (edge.points.length < 2) continue;
|
|
20366
20341
|
const edgeG = contentG.append("g").attr("class", "sitemap-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
20367
|
-
const edgeColor3 =
|
|
20368
|
-
const markerId =
|
|
20342
|
+
const edgeColor3 = palette.textMuted;
|
|
20343
|
+
const markerId = "sm-arrow";
|
|
20369
20344
|
const gen = edge.deferred ? lineGeneratorLinear : lineGenerator;
|
|
20370
20345
|
const pathD = gen(edge.points);
|
|
20371
20346
|
if (pathD) {
|
|
@@ -20446,7 +20421,8 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20446
20421
|
isDark,
|
|
20447
20422
|
activeTagGroup,
|
|
20448
20423
|
void 0,
|
|
20449
|
-
hiddenAttributes
|
|
20424
|
+
hiddenAttributes,
|
|
20425
|
+
exportMode
|
|
20450
20426
|
);
|
|
20451
20427
|
}
|
|
20452
20428
|
if (fixedTitle) {
|
|
@@ -20471,11 +20447,12 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20471
20447
|
isDark,
|
|
20472
20448
|
activeTagGroup,
|
|
20473
20449
|
width,
|
|
20474
|
-
hiddenAttributes
|
|
20450
|
+
hiddenAttributes,
|
|
20451
|
+
exportMode
|
|
20475
20452
|
);
|
|
20476
20453
|
}
|
|
20477
20454
|
}
|
|
20478
|
-
function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fixedWidth, hiddenAttributes) {
|
|
20455
|
+
function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fixedWidth, hiddenAttributes, exportMode) {
|
|
20479
20456
|
if (legendGroups.length === 0) return;
|
|
20480
20457
|
const groups = legendGroups.map((g) => ({
|
|
20481
20458
|
name: g.name,
|
|
@@ -20486,7 +20463,7 @@ function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fix
|
|
|
20486
20463
|
const legendConfig = {
|
|
20487
20464
|
groups,
|
|
20488
20465
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
20489
|
-
mode: "
|
|
20466
|
+
mode: exportMode ? "export" : "preview",
|
|
20490
20467
|
capsulePillAddonWidth: eyeAddonWidth
|
|
20491
20468
|
};
|
|
20492
20469
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
@@ -20772,7 +20749,7 @@ function renderKanban(container, parsed, palette, isDark, options) {
|
|
|
20772
20749
|
const legendConfig = {
|
|
20773
20750
|
groups: parsed.tagGroups,
|
|
20774
20751
|
position: { placement: "top-center", titleRelation: "inline-with-title" },
|
|
20775
|
-
mode:
|
|
20752
|
+
mode: options?.exportMode ? "export" : "preview"
|
|
20776
20753
|
};
|
|
20777
20754
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
20778
20755
|
const legendG = svg.append("g").attr("class", "kanban-legend").attr("transform", `translate(${legendX},${legendY})`);
|
|
@@ -20930,7 +20907,8 @@ function renderKanbanForExport(content, theme, palette) {
|
|
|
20930
20907
|
const layout = computeLayout(parsed, palette);
|
|
20931
20908
|
const container = document.createElement("div");
|
|
20932
20909
|
renderKanban(container, parsed, palette, isDark, {
|
|
20933
|
-
exportDims: { width: layout.totalWidth, height: layout.totalHeight }
|
|
20910
|
+
exportDims: { width: layout.totalWidth, height: layout.totalHeight },
|
|
20911
|
+
exportMode: true
|
|
20934
20912
|
});
|
|
20935
20913
|
const svgEl = container.querySelector("svg");
|
|
20936
20914
|
return svgEl?.outerHTML ?? "";
|
|
@@ -21468,7 +21446,7 @@ function markerIdForType(type) {
|
|
|
21468
21446
|
function isSourceMarker(type) {
|
|
21469
21447
|
return type === "composes" || type === "aggregates";
|
|
21470
21448
|
}
|
|
21471
|
-
function renderClassDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, legendActive) {
|
|
21449
|
+
function renderClassDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, legendActive, exportMode) {
|
|
21472
21450
|
d3Selection4.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
21473
21451
|
const width = exportDims?.width ?? container.clientWidth;
|
|
21474
21452
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -21530,7 +21508,7 @@ function renderClassDiagram(container, parsed, layout, palette, isDark, onClickI
|
|
|
21530
21508
|
const legendConfig = {
|
|
21531
21509
|
groups: legendGroups,
|
|
21532
21510
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
21533
|
-
mode: "
|
|
21511
|
+
mode: exportMode ? "export" : "preview"
|
|
21534
21512
|
};
|
|
21535
21513
|
const legendState = {
|
|
21536
21514
|
activeGroup: isLegendExpanded ? LEGEND_GROUP_NAME : null
|
|
@@ -21670,10 +21648,22 @@ function renderClassDiagramForExport(content, theme, palette) {
|
|
|
21670
21648
|
const exportWidth = layout.width + DIAGRAM_PADDING4 * 2;
|
|
21671
21649
|
const exportHeight = layout.height + DIAGRAM_PADDING4 * 2 + (parsed.title ? 40 : 0) + legendReserve;
|
|
21672
21650
|
return runInExportContainer(exportWidth, exportHeight, (container) => {
|
|
21673
|
-
renderClassDiagram(
|
|
21674
|
-
|
|
21675
|
-
|
|
21676
|
-
|
|
21651
|
+
renderClassDiagram(
|
|
21652
|
+
container,
|
|
21653
|
+
parsed,
|
|
21654
|
+
layout,
|
|
21655
|
+
palette,
|
|
21656
|
+
isDark,
|
|
21657
|
+
void 0,
|
|
21658
|
+
{
|
|
21659
|
+
width: exportWidth,
|
|
21660
|
+
height: exportHeight
|
|
21661
|
+
},
|
|
21662
|
+
true,
|
|
21663
|
+
// legendActive for export
|
|
21664
|
+
true
|
|
21665
|
+
// exportMode
|
|
21666
|
+
);
|
|
21677
21667
|
return extractExportSvg(container, theme);
|
|
21678
21668
|
});
|
|
21679
21669
|
}
|
|
@@ -22149,7 +22139,7 @@ function drawCardinality(g, point, prevPoint, cardinality, color, useLabels) {
|
|
|
22149
22139
|
g.append("line").attr("x1", bx + px * spread).attr("y1", by + py * spread).attr("x2", bx - px * spread).attr("y2", by - py * spread).attr("stroke", color).attr("stroke-width", sw);
|
|
22150
22140
|
}
|
|
22151
22141
|
}
|
|
22152
|
-
function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, semanticColorsActive) {
|
|
22142
|
+
function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, semanticColorsActive, exportMode) {
|
|
22153
22143
|
d3Selection5.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
22154
22144
|
const useSemanticColors = parsed.tagGroups.length === 0 && layout.nodes.every((n) => !n.color);
|
|
22155
22145
|
const LEGEND_FIXED_GAP4 = 8;
|
|
@@ -22305,7 +22295,7 @@ function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem
|
|
|
22305
22295
|
const legendConfig = {
|
|
22306
22296
|
groups: parsed.tagGroups,
|
|
22307
22297
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22308
|
-
mode: "
|
|
22298
|
+
mode: exportMode ? "export" : "preview"
|
|
22309
22299
|
};
|
|
22310
22300
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
22311
22301
|
const legendG = svg.append("g").attr("class", "er-tag-legend").attr("transform", `translate(0,${legendY})`);
|
|
@@ -22341,7 +22331,7 @@ function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem
|
|
|
22341
22331
|
const legendConfig = {
|
|
22342
22332
|
groups: semanticGroups,
|
|
22343
22333
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22344
|
-
mode: "
|
|
22334
|
+
mode: exportMode ? "export" : "preview"
|
|
22345
22335
|
};
|
|
22346
22336
|
const legendState = {
|
|
22347
22337
|
activeGroup: semanticActive ? "Role" : null
|
|
@@ -22374,10 +22364,21 @@ function renderERDiagramForExport(content, theme, palette) {
|
|
|
22374
22364
|
container.style.left = "-9999px";
|
|
22375
22365
|
document.body.appendChild(container);
|
|
22376
22366
|
try {
|
|
22377
|
-
renderERDiagram(
|
|
22378
|
-
|
|
22379
|
-
|
|
22380
|
-
|
|
22367
|
+
renderERDiagram(
|
|
22368
|
+
container,
|
|
22369
|
+
parsed,
|
|
22370
|
+
layout,
|
|
22371
|
+
palette,
|
|
22372
|
+
isDark,
|
|
22373
|
+
void 0,
|
|
22374
|
+
{
|
|
22375
|
+
width: exportWidth,
|
|
22376
|
+
height: exportHeight
|
|
22377
|
+
},
|
|
22378
|
+
void 0,
|
|
22379
|
+
void 0,
|
|
22380
|
+
true
|
|
22381
|
+
);
|
|
22381
22382
|
const svgEl = container.querySelector("svg");
|
|
22382
22383
|
if (!svgEl) return "";
|
|
22383
22384
|
if (theme === "transparent") {
|
|
@@ -22612,7 +22613,8 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
|
|
|
22612
22613
|
hideDescriptions,
|
|
22613
22614
|
controlsExpanded,
|
|
22614
22615
|
onToggleDescriptions,
|
|
22615
|
-
onToggleControlsExpand
|
|
22616
|
+
onToggleControlsExpand,
|
|
22617
|
+
exportMode = false
|
|
22616
22618
|
} = options ?? {};
|
|
22617
22619
|
d3Selection6.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
22618
22620
|
const width = exportDims?.width ?? container.clientWidth;
|
|
@@ -22948,7 +22950,7 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
|
|
|
22948
22950
|
const legendConfig = {
|
|
22949
22951
|
groups: parsed.tagGroups,
|
|
22950
22952
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22951
|
-
mode: "
|
|
22953
|
+
mode: exportMode ? "export" : "preview",
|
|
22952
22954
|
controlsGroup
|
|
22953
22955
|
};
|
|
22954
22956
|
const legendState = {
|
|
@@ -22980,7 +22982,8 @@ function renderBoxesAndLinesForExport(container, parsed, layout, palette, isDark
|
|
|
22980
22982
|
renderBoxesAndLines(container, parsed, layout, palette, isDark, {
|
|
22981
22983
|
exportDims: options?.exportDims,
|
|
22982
22984
|
activeTagGroup: options?.activeTagGroup,
|
|
22983
|
-
hiddenTagValues: options?.hiddenTagValues
|
|
22985
|
+
hiddenTagValues: options?.hiddenTagValues,
|
|
22986
|
+
exportMode: options?.exportMode
|
|
22984
22987
|
});
|
|
22985
22988
|
}
|
|
22986
22989
|
var d3Selection6, d3Shape4, DIAGRAM_PADDING6, NODE_FONT_SIZE, MIN_NODE_FONT_SIZE, EDGE_LABEL_FONT_SIZE4, EDGE_STROKE_WIDTH5, NODE_STROKE_WIDTH5, NODE_RX, COLLAPSE_BAR_HEIGHT3, ARROWHEAD_W2, ARROWHEAD_H2, DESC_FONT_SIZE, DESC_LINE_HEIGHT, MAX_DESC_LINES, CHAR_WIDTH_RATIO2, NODE_TEXT_PADDING, GROUP_RX, GROUP_LABEL_FONT_SIZE, GROUP_LABEL_ZONE, lineGeneratorLR, lineGeneratorTB;
|
|
@@ -24218,7 +24221,7 @@ function renderMindmap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
24218
24221
|
};
|
|
24219
24222
|
}),
|
|
24220
24223
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
24221
|
-
mode: "
|
|
24224
|
+
mode: options?.exportMode ? "export" : "preview",
|
|
24222
24225
|
controlsGroup: controlsToggles
|
|
24223
24226
|
};
|
|
24224
24227
|
const legendState = {
|
|
@@ -27020,7 +27023,7 @@ function drawPersonIcon(g, cx, cy, color) {
|
|
|
27020
27023
|
g.append("line").attr("x1", cx).attr("y1", bodyBottomY).attr("x2", cx - PERSON_LEG_SPAN).attr("y2", legY).attr("stroke", color).attr("stroke-width", PERSON_SW);
|
|
27021
27024
|
g.append("line").attr("x1", cx).attr("y1", bodyBottomY).attr("x2", cx + PERSON_LEG_SPAN).attr("y2", legY).attr("stroke", color).attr("stroke-width", PERSON_SW);
|
|
27022
27025
|
}
|
|
27023
|
-
function renderC4Context(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
27026
|
+
function renderC4Context(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27024
27027
|
d3Selection9.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
27025
27028
|
const width = exportDims?.width ?? container.clientWidth;
|
|
27026
27029
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -27196,7 +27199,8 @@ function renderC4Context(container, parsed, layout, palette, isDark, onClickItem
|
|
|
27196
27199
|
palette,
|
|
27197
27200
|
isDark,
|
|
27198
27201
|
activeTagGroup,
|
|
27199
|
-
fixedLegend ? width : null
|
|
27202
|
+
fixedLegend ? width : null,
|
|
27203
|
+
exportMode
|
|
27200
27204
|
);
|
|
27201
27205
|
}
|
|
27202
27206
|
}
|
|
@@ -27551,7 +27555,7 @@ function placeEdgeLabels(labels, edges, obstacleRects) {
|
|
|
27551
27555
|
placedRects.push({ x: lbl.x, y: lbl.y, w: lbl.bgW, h: lbl.bgH });
|
|
27552
27556
|
}
|
|
27553
27557
|
}
|
|
27554
|
-
function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWidth) {
|
|
27558
|
+
function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWidth, exportMode) {
|
|
27555
27559
|
const groups = layout.legend.map((g) => ({
|
|
27556
27560
|
name: g.name,
|
|
27557
27561
|
entries: g.entries.map((e) => ({ value: e.value, color: e.color }))
|
|
@@ -27559,7 +27563,7 @@ function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWid
|
|
|
27559
27563
|
const legendConfig = {
|
|
27560
27564
|
groups,
|
|
27561
27565
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
27562
|
-
mode: "
|
|
27566
|
+
mode: exportMode ? "export" : "preview"
|
|
27563
27567
|
};
|
|
27564
27568
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
27565
27569
|
const containerWidth = fixedWidth ?? layout.width;
|
|
@@ -27574,7 +27578,7 @@ function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWid
|
|
|
27574
27578
|
);
|
|
27575
27579
|
parent.selectAll("[data-legend-group]").classed("c4-legend-group", true);
|
|
27576
27580
|
}
|
|
27577
|
-
function renderC4Containers(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
27581
|
+
function renderC4Containers(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27578
27582
|
d3Selection9.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
27579
27583
|
const width = exportDims?.width ?? container.clientWidth;
|
|
27580
27584
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -27805,7 +27809,8 @@ function renderC4Containers(container, parsed, layout, palette, isDark, onClickI
|
|
|
27805
27809
|
palette,
|
|
27806
27810
|
isDark,
|
|
27807
27811
|
activeTagGroup,
|
|
27808
|
-
fixedLegend ? width : null
|
|
27812
|
+
fixedLegend ? width : null,
|
|
27813
|
+
exportMode
|
|
27809
27814
|
);
|
|
27810
27815
|
}
|
|
27811
27816
|
}
|
|
@@ -27873,7 +27878,7 @@ function renderC4ComponentsForExport(content, systemName, containerName, theme,
|
|
|
27873
27878
|
document.body.removeChild(el);
|
|
27874
27879
|
}
|
|
27875
27880
|
}
|
|
27876
|
-
function renderC4Deployment(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
27881
|
+
function renderC4Deployment(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27877
27882
|
renderC4Containers(
|
|
27878
27883
|
container,
|
|
27879
27884
|
parsed,
|
|
@@ -27882,7 +27887,8 @@ function renderC4Deployment(container, parsed, layout, palette, isDark, onClickI
|
|
|
27882
27887
|
isDark,
|
|
27883
27888
|
onClickItem,
|
|
27884
27889
|
exportDims,
|
|
27885
|
-
activeTagGroup
|
|
27890
|
+
activeTagGroup,
|
|
27891
|
+
exportMode
|
|
27886
27892
|
);
|
|
27887
27893
|
}
|
|
27888
27894
|
function renderC4DeploymentForExport(content, theme, palette) {
|
|
@@ -28064,7 +28070,6 @@ function layoutGraph(graph, options) {
|
|
|
28064
28070
|
target: edge.target,
|
|
28065
28071
|
points: edgeData?.points ?? [],
|
|
28066
28072
|
label: edge.label,
|
|
28067
|
-
color: edge.color,
|
|
28068
28073
|
lineNumber: edge.lineNumber
|
|
28069
28074
|
};
|
|
28070
28075
|
});
|
|
@@ -28387,9 +28392,6 @@ function renderFlowchart(container, graph, layout, palette, isDark, onClickItem,
|
|
|
28387
28392
|
const defs = svg.append("defs");
|
|
28388
28393
|
defs.append("marker").attr("id", "fc-arrow").attr("viewBox", `0 0 ${ARROWHEAD_W3} ${ARROWHEAD_H3}`).attr("refX", ARROWHEAD_W3).attr("refY", ARROWHEAD_H3 / 2).attr("markerWidth", ARROWHEAD_W3).attr("markerHeight", ARROWHEAD_H3).attr("orient", "auto").append("polygon").attr("points", `0,0 ${ARROWHEAD_W3},${ARROWHEAD_H3 / 2} 0,${ARROWHEAD_H3}`).attr("fill", palette.textMuted);
|
|
28389
28394
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
28390
|
-
for (const edge of layout.edges) {
|
|
28391
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
28392
|
-
}
|
|
28393
28395
|
for (const color of edgeColors) {
|
|
28394
28396
|
const id = `fc-arrow-${color.replace("#", "")}`;
|
|
28395
28397
|
defs.append("marker").attr("id", id).attr("viewBox", `0 0 ${ARROWHEAD_W3} ${ARROWHEAD_H3}`).attr("refX", ARROWHEAD_W3).attr("refY", ARROWHEAD_H3 / 2).attr("markerWidth", ARROWHEAD_W3).attr("markerHeight", ARROWHEAD_H3).attr("orient", "auto").append("polygon").attr("points", `0,0 ${ARROWHEAD_W3},${ARROWHEAD_H3 / 2} 0,${ARROWHEAD_H3}`).attr("fill", color);
|
|
@@ -28453,8 +28455,8 @@ function renderFlowchart(container, graph, layout, palette, isDark, onClickItem,
|
|
|
28453
28455
|
const edge = layout.edges[ei];
|
|
28454
28456
|
if (edge.points.length < 2) continue;
|
|
28455
28457
|
const edgeG = contentG.append("g").attr("class", "fc-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
28456
|
-
const edgeColor3 =
|
|
28457
|
-
const markerId =
|
|
28458
|
+
const edgeColor3 = palette.textMuted;
|
|
28459
|
+
const markerId = "fc-arrow";
|
|
28458
28460
|
const pathD = lineGenerator5(edge.points);
|
|
28459
28461
|
if (pathD) {
|
|
28460
28462
|
edgeG.append("path").attr("d", pathD).attr("fill", "none").attr("stroke", edgeColor3).attr("stroke-width", EDGE_STROKE_WIDTH8).attr("marker-end", `url(#${markerId})`).attr("class", "fc-edge");
|
|
@@ -31078,7 +31080,7 @@ function computeInfraLegendGroups(nodes, tagGroups, palette, edges) {
|
|
|
31078
31080
|
}
|
|
31079
31081
|
return groups;
|
|
31080
31082
|
}
|
|
31081
|
-
function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDark, activeGroup, playback) {
|
|
31083
|
+
function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDark, activeGroup, playback, exportMode = false) {
|
|
31082
31084
|
if (legendGroups.length === 0 && !playback) return;
|
|
31083
31085
|
const legendG = rootSvg.append("g").attr("transform", `translate(0, ${legendY})`);
|
|
31084
31086
|
if (activeGroup) {
|
|
@@ -31094,7 +31096,7 @@ function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDa
|
|
|
31094
31096
|
const legendConfig = {
|
|
31095
31097
|
groups: allGroups,
|
|
31096
31098
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
31097
|
-
mode: "
|
|
31099
|
+
mode: exportMode ? "export" : "preview",
|
|
31098
31100
|
showEmptyGroups: true
|
|
31099
31101
|
};
|
|
31100
31102
|
const legendState = { activeGroup };
|
|
@@ -31282,7 +31284,8 @@ function renderInfra(container, layout, palette, isDark, title, titleLineNumber,
|
|
|
31282
31284
|
palette,
|
|
31283
31285
|
isDark,
|
|
31284
31286
|
activeGroup ?? null,
|
|
31285
|
-
playback ?? void 0
|
|
31287
|
+
playback ?? void 0,
|
|
31288
|
+
exportMode
|
|
31286
31289
|
);
|
|
31287
31290
|
legendSvg.selectAll(".infra-legend-group").style("pointer-events", "auto");
|
|
31288
31291
|
} else {
|
|
@@ -31294,7 +31297,8 @@ function renderInfra(container, layout, palette, isDark, title, titleLineNumber,
|
|
|
31294
31297
|
palette,
|
|
31295
31298
|
isDark,
|
|
31296
31299
|
activeGroup ?? null,
|
|
31297
|
-
playback ?? void 0
|
|
31300
|
+
playback ?? void 0,
|
|
31301
|
+
exportMode
|
|
31298
31302
|
);
|
|
31299
31303
|
}
|
|
31300
31304
|
}
|
|
@@ -33193,7 +33197,8 @@ function renderPert(container, resolved, layout, palette, isDark, options = {})
|
|
|
33193
33197
|
x: 0,
|
|
33194
33198
|
y: tagLegendY,
|
|
33195
33199
|
width: exportWidth,
|
|
33196
|
-
activeGroup: tagLegendActive
|
|
33200
|
+
activeGroup: tagLegendActive,
|
|
33201
|
+
exportMode: options.exportMode
|
|
33197
33202
|
});
|
|
33198
33203
|
}
|
|
33199
33204
|
const root = svg.append("g").attr("transform", `translate(${offsetX}, ${offsetY})`);
|
|
@@ -33254,7 +33259,8 @@ function renderPertForExport(content, theme, palette, now) {
|
|
|
33254
33259
|
renderPert(container, resolved, layout, palette, isDark, {
|
|
33255
33260
|
title: hasTitle ? parsed.title : null,
|
|
33256
33261
|
subtitle: resolved.projectSubtitle,
|
|
33257
|
-
exportDims: { width: exportWidth, height: exportHeight }
|
|
33262
|
+
exportDims: { width: exportWidth, height: exportHeight },
|
|
33263
|
+
exportMode: true
|
|
33258
33264
|
});
|
|
33259
33265
|
const svgEl = container.querySelector("svg");
|
|
33260
33266
|
if (!svgEl) return "";
|
|
@@ -34341,7 +34347,7 @@ function renderLegendBlock(svg, entries, args) {
|
|
|
34341
34347
|
}
|
|
34342
34348
|
function renderTagLegendRow(svg, resolved, palette, isDark, args) {
|
|
34343
34349
|
if (resolved.tagGroups.length === 0) return;
|
|
34344
|
-
const { x, y, width, activeGroup } = args;
|
|
34350
|
+
const { x, y, width, activeGroup, exportMode } = args;
|
|
34345
34351
|
const groups = resolved.tagGroups.map((g) => ({
|
|
34346
34352
|
name: g.name,
|
|
34347
34353
|
entries: g.entries.map((e) => ({ value: e.value, color: e.color }))
|
|
@@ -34352,7 +34358,7 @@ function renderTagLegendRow(svg, resolved, palette, isDark, args) {
|
|
|
34352
34358
|
{
|
|
34353
34359
|
groups,
|
|
34354
34360
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
34355
|
-
mode: "
|
|
34361
|
+
mode: exportMode ? "export" : "preview"
|
|
34356
34362
|
},
|
|
34357
34363
|
{ activeGroup },
|
|
34358
34364
|
palette,
|
|
@@ -35792,7 +35798,8 @@ function renderGantt(container, resolved, palette, isDark, options, exportDims)
|
|
|
35792
35798
|
).attr("display", active ? null : "none");
|
|
35793
35799
|
}
|
|
35794
35800
|
drawLegend();
|
|
35795
|
-
}
|
|
35801
|
+
},
|
|
35802
|
+
options?.exportMode ?? false
|
|
35796
35803
|
);
|
|
35797
35804
|
}
|
|
35798
35805
|
}
|
|
@@ -36581,7 +36588,7 @@ function buildControlsToggles(hasCriticalPath, criticalPathActive, hasDependenci
|
|
|
36581
36588
|
}
|
|
36582
36589
|
return toggles;
|
|
36583
36590
|
}
|
|
36584
|
-
function renderTagLegend(svg, chartG, tagGroups, activeGroupName, chartLeftMargin, chartInnerWidth, legendY, palette, isDark, hasCriticalPath, criticalPathActive, _optionLineNumbers, onToggle, onToggleControlsExpand, currentSwimlaneGroup, onSwimlaneChange, legendViewMode, resolvedTasks, controlsExpanded = false, hasDependencies = false, dependenciesActive = false, onControlsToggle) {
|
|
36591
|
+
function renderTagLegend(svg, chartG, tagGroups, activeGroupName, chartLeftMargin, chartInnerWidth, legendY, palette, isDark, hasCriticalPath, criticalPathActive, _optionLineNumbers, onToggle, onToggleControlsExpand, currentSwimlaneGroup, onSwimlaneChange, legendViewMode, resolvedTasks, controlsExpanded = false, hasDependencies = false, dependenciesActive = false, onControlsToggle, exportMode = false) {
|
|
36585
36592
|
let visibleGroups;
|
|
36586
36593
|
if (activeGroupName) {
|
|
36587
36594
|
const activeGroup = tagGroups.filter(
|
|
@@ -36676,7 +36683,7 @@ function renderTagLegend(svg, chartG, tagGroups, activeGroupName, chartLeftMargi
|
|
|
36676
36683
|
placement: "top-center",
|
|
36677
36684
|
titleRelation: "below-title"
|
|
36678
36685
|
},
|
|
36679
|
-
mode: "
|
|
36686
|
+
mode: exportMode ? "export" : "preview",
|
|
36680
36687
|
capsulePillAddonWidth: iconReserve,
|
|
36681
36688
|
controlsGroup: controlsToggles.length > 0 ? { toggles: controlsToggles } : void 0
|
|
36682
36689
|
};
|
|
@@ -36783,7 +36790,7 @@ function renderTagLegend(svg, chartG, tagGroups, activeGroupName, chartLeftMargi
|
|
|
36783
36790
|
placement: "top-center",
|
|
36784
36791
|
titleRelation: "below-title"
|
|
36785
36792
|
},
|
|
36786
|
-
mode: "
|
|
36793
|
+
mode: exportMode ? "export" : "preview",
|
|
36787
36794
|
controlsGroup: { toggles: controlsToggles }
|
|
36788
36795
|
};
|
|
36789
36796
|
const tagGroupG = legendRow.append("g");
|
|
@@ -37666,9 +37673,6 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
|
|
|
37666
37673
|
const defs = svg.append("defs");
|
|
37667
37674
|
defs.append("marker").attr("id", "st-arrow").attr("viewBox", `0 0 ${ARROWHEAD_W5} ${ARROWHEAD_H5}`).attr("refX", ARROWHEAD_W5).attr("refY", ARROWHEAD_H5 / 2).attr("markerWidth", ARROWHEAD_W5).attr("markerHeight", ARROWHEAD_H5).attr("orient", "auto").append("polygon").attr("points", `0,0 ${ARROWHEAD_W5},${ARROWHEAD_H5 / 2} 0,${ARROWHEAD_H5}`).attr("fill", palette.textMuted);
|
|
37668
37675
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
37669
|
-
for (const edge of layout.edges) {
|
|
37670
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
37671
|
-
}
|
|
37672
37676
|
for (const color of edgeColors) {
|
|
37673
37677
|
const id = `st-arrow-${color.replace("#", "")}`;
|
|
37674
37678
|
defs.append("marker").attr("id", id).attr("viewBox", `0 0 ${ARROWHEAD_W5} ${ARROWHEAD_H5}`).attr("refX", ARROWHEAD_W5).attr("refY", ARROWHEAD_H5 / 2).attr("markerWidth", ARROWHEAD_W5).attr("markerHeight", ARROWHEAD_H5).attr("orient", "auto").append("polygon").attr("points", `0,0 ${ARROWHEAD_W5},${ARROWHEAD_H5 / 2} 0,${ARROWHEAD_H5}`).attr("fill", color);
|
|
@@ -37763,8 +37767,8 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
|
|
|
37763
37767
|
for (let ei = 0; ei < layout.edges.length; ei++) {
|
|
37764
37768
|
const edge = layout.edges[ei];
|
|
37765
37769
|
const edgeG = contentG.append("g").attr("class", "st-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
37766
|
-
const edgeColor3 =
|
|
37767
|
-
const markerId =
|
|
37770
|
+
const edgeColor3 = palette.textMuted;
|
|
37771
|
+
const markerId = "st-arrow";
|
|
37768
37772
|
if (edge.source === edge.target) {
|
|
37769
37773
|
const node = nodePositionMap.get(edge.source);
|
|
37770
37774
|
if (node) {
|
|
@@ -38634,7 +38638,7 @@ function renderTechRadar(container, parsed, palette, isDark, onClickItem, export
|
|
|
38634
38638
|
}
|
|
38635
38639
|
],
|
|
38636
38640
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
38637
|
-
mode: "
|
|
38641
|
+
mode: options?.exportMode ? "export" : "preview",
|
|
38638
38642
|
controlsGroup: {
|
|
38639
38643
|
toggles: [
|
|
38640
38644
|
{
|
|
@@ -39237,7 +39241,7 @@ function getQuadrantLabelPosition(position, cx, cy, maxRadius) {
|
|
|
39237
39241
|
};
|
|
39238
39242
|
}
|
|
39239
39243
|
}
|
|
39240
|
-
function renderTechRadarForExport(container, parsed, palette, isDark, exportDims, viewState) {
|
|
39244
|
+
function renderTechRadarForExport(container, parsed, palette, isDark, exportDims, viewState, exportMode) {
|
|
39241
39245
|
renderTechRadar(
|
|
39242
39246
|
container,
|
|
39243
39247
|
parsed,
|
|
@@ -39245,7 +39249,8 @@ function renderTechRadarForExport(container, parsed, palette, isDark, exportDims
|
|
|
39245
39249
|
isDark,
|
|
39246
39250
|
void 0,
|
|
39247
39251
|
exportDims,
|
|
39248
|
-
viewState
|
|
39252
|
+
viewState,
|
|
39253
|
+
{ exportMode }
|
|
39249
39254
|
);
|
|
39250
39255
|
}
|
|
39251
39256
|
var d3Selection16, BLIP_RADIUS2, BLIP_FONT_SIZE2, RING_LABEL_FONT_SIZE, QUADRANT_LABEL_FONT_SIZE, TITLE_FONT_SIZE3, LISTING_FONT_SIZE, LISTING_HEADER_FONT_SIZE, LISTING_TOP_MARGIN, LISTING_COL_GAP, LISTING_LINE_HEIGHT, LISTING_BLIP_R;
|
|
@@ -39624,7 +39629,7 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
|
|
|
39624
39629
|
titleRelation: "inline-with-title"
|
|
39625
39630
|
},
|
|
39626
39631
|
titleWidth: 0,
|
|
39627
|
-
mode:
|
|
39632
|
+
mode: options?.exportMode ? "export" : "preview"
|
|
39628
39633
|
};
|
|
39629
39634
|
const legendState = { activeGroup: effectiveActiveGroup };
|
|
39630
39635
|
const legendCallbacks = {
|
|
@@ -40337,7 +40342,8 @@ function renderJourneyMapForExport(content, theme, palette) {
|
|
|
40337
40342
|
const layout = layoutJourneyMap(parsed, palette, { isDark });
|
|
40338
40343
|
const container = document.createElement("div");
|
|
40339
40344
|
renderJourneyMap(container, parsed, palette, isDark, {
|
|
40340
|
-
exportDims: { width: layout.totalWidth, height: layout.totalHeight }
|
|
40345
|
+
exportDims: { width: layout.totalWidth, height: layout.totalHeight },
|
|
40346
|
+
exportMode: true
|
|
40341
40347
|
});
|
|
40342
40348
|
const svgEl = container.querySelector("svg");
|
|
40343
40349
|
if (!svgEl) return "";
|
|
@@ -41103,7 +41109,7 @@ function renderCycle(container, parsed, palette, isDark, onClickItem, exportDims
|
|
|
41103
41109
|
const legendConfig = {
|
|
41104
41110
|
groups: [],
|
|
41105
41111
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
41106
|
-
mode: "
|
|
41112
|
+
mode: renderOptions?.exportMode ? "export" : "preview",
|
|
41107
41113
|
controlsGroup
|
|
41108
41114
|
};
|
|
41109
41115
|
const legendState = {
|
|
@@ -41287,7 +41293,7 @@ function renderCycle(container, parsed, palette, isDark, onClickItem, exportDims
|
|
|
41287
41293
|
}
|
|
41288
41294
|
}
|
|
41289
41295
|
}
|
|
41290
|
-
function renderCycleForExport(container, parsed, palette, isDark, exportDims, viewState) {
|
|
41296
|
+
function renderCycleForExport(container, parsed, palette, isDark, exportDims, viewState, exportMode) {
|
|
41291
41297
|
renderCycle(
|
|
41292
41298
|
container,
|
|
41293
41299
|
parsed,
|
|
@@ -41295,7 +41301,8 @@ function renderCycleForExport(container, parsed, palette, isDark, exportDims, vi
|
|
|
41295
41301
|
isDark,
|
|
41296
41302
|
void 0,
|
|
41297
41303
|
exportDims,
|
|
41298
|
-
viewState
|
|
41304
|
+
viewState,
|
|
41305
|
+
{ exportMode }
|
|
41299
41306
|
);
|
|
41300
41307
|
}
|
|
41301
41308
|
function resolveNodeColor5(color, palette, defaultColor) {
|
|
@@ -44219,7 +44226,7 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
44219
44226
|
const legendConfig = {
|
|
44220
44227
|
groups: resolvedGroups,
|
|
44221
44228
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
44222
|
-
mode: "
|
|
44229
|
+
mode: "preview"
|
|
44223
44230
|
};
|
|
44224
44231
|
const legendState = {
|
|
44225
44232
|
activeGroup: activeTagGroup ?? null,
|
|
@@ -44620,7 +44627,9 @@ function parseVisualization(content, palette) {
|
|
|
44620
44627
|
if (currentTimelineTagGroup && indent === 0) {
|
|
44621
44628
|
currentTimelineTagGroup = null;
|
|
44622
44629
|
}
|
|
44623
|
-
const groupMatch = line12.match(
|
|
44630
|
+
const groupMatch = line12.match(
|
|
44631
|
+
/^\[(.+?)\](?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
44632
|
+
);
|
|
44624
44633
|
if (groupMatch) {
|
|
44625
44634
|
if (result.type === "arc") {
|
|
44626
44635
|
const name = groupMatch[1].trim();
|
|
@@ -44662,7 +44671,7 @@ function parseVisualization(content, palette) {
|
|
|
44662
44671
|
}
|
|
44663
44672
|
if (result.type === "arc") {
|
|
44664
44673
|
const linkMatch = line12.match(
|
|
44665
|
-
/^(.+?)\s*->\s*(.+?)(?:\(
|
|
44674
|
+
/^(.+?)\s*->\s*(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?(?:\s+(-?[\d,_]+(?:\.[\d]+)?))?$/
|
|
44666
44675
|
);
|
|
44667
44676
|
if (linkMatch) {
|
|
44668
44677
|
const source = linkMatch[1].trim();
|
|
@@ -44701,7 +44710,7 @@ function parseVisualization(content, palette) {
|
|
|
44701
44710
|
} else {
|
|
44702
44711
|
if (line12.startsWith("//")) continue;
|
|
44703
44712
|
const eraEntryMatch = line12.match(
|
|
44704
|
-
/^(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s*(?:->|\u2013>)\s*(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s
|
|
44713
|
+
/^(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s*(?:->|\u2013>)\s*(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
44705
44714
|
);
|
|
44706
44715
|
if (eraEntryMatch) {
|
|
44707
44716
|
const colorAnnotation = eraEntryMatch[4]?.trim() || null;
|
|
@@ -44729,7 +44738,7 @@ function parseVisualization(content, palette) {
|
|
|
44729
44738
|
} else {
|
|
44730
44739
|
if (line12.startsWith("//")) continue;
|
|
44731
44740
|
const markerEntryMatch = line12.match(
|
|
44732
|
-
/^(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s
|
|
44741
|
+
/^(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
44733
44742
|
);
|
|
44734
44743
|
if (markerEntryMatch) {
|
|
44735
44744
|
const colorAnnotation = markerEntryMatch[3]?.trim() || null;
|
|
@@ -44762,7 +44771,7 @@ function parseVisualization(content, palette) {
|
|
|
44762
44771
|
continue;
|
|
44763
44772
|
}
|
|
44764
44773
|
const eraMatch = line12.match(
|
|
44765
|
-
/^era\s+(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s*(?:->|\u2013>)\s*(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s
|
|
44774
|
+
/^era\s+(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s*(?:->|\u2013>)\s*(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
44766
44775
|
);
|
|
44767
44776
|
if (eraMatch) {
|
|
44768
44777
|
const colorAnnotation = eraMatch[4]?.trim() || null;
|
|
@@ -44781,7 +44790,7 @@ function parseVisualization(content, palette) {
|
|
|
44781
44790
|
continue;
|
|
44782
44791
|
}
|
|
44783
44792
|
const markerMatch = line12.match(
|
|
44784
|
-
/^marker\s+(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s
|
|
44793
|
+
/^marker\s+(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
44785
44794
|
);
|
|
44786
44795
|
if (markerMatch) {
|
|
44787
44796
|
const colorAnnotation = markerMatch[3]?.trim() || null;
|
|
@@ -44902,13 +44911,11 @@ function parseVisualization(content, palette) {
|
|
|
44902
44911
|
}
|
|
44903
44912
|
}
|
|
44904
44913
|
if (!/^(solid-fill|no-name|no-value|no-percent|no-title)$/i.test(line12)) {
|
|
44905
|
-
const legacyAliasMatch = line12.match(
|
|
44906
|
-
/^([^(:]+?)(?:\(([^)]+)\))?\s+alias\s+(\S+)\s*$/i
|
|
44907
|
-
);
|
|
44914
|
+
const legacyAliasMatch = line12.match(/^(.+?)\s+alias\s+(\S+)\s*$/i);
|
|
44908
44915
|
if (legacyAliasMatch) {
|
|
44909
|
-
const
|
|
44910
|
-
const
|
|
44911
|
-
const
|
|
44916
|
+
const nameWithMaybeColor = legacyAliasMatch[1].trim();
|
|
44917
|
+
const aliasToken = legacyAliasMatch[2].trim();
|
|
44918
|
+
const { label: name, colorName } = peelTrailingColorName(nameWithMaybeColor);
|
|
44912
44919
|
let color = null;
|
|
44913
44920
|
if (colorName) {
|
|
44914
44921
|
color = resolveColorWithDiagnostic(
|
|
@@ -44930,11 +44937,12 @@ function parseVisualization(content, palette) {
|
|
|
44930
44937
|
continue;
|
|
44931
44938
|
}
|
|
44932
44939
|
const setDeclMatch = line12.match(
|
|
44933
|
-
/^(
|
|
44940
|
+
/^(.+?)(?:\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11}))?\s*$/i
|
|
44934
44941
|
);
|
|
44935
44942
|
if (setDeclMatch) {
|
|
44936
|
-
const
|
|
44937
|
-
const
|
|
44943
|
+
const nameWithMaybeColor = setDeclMatch[1].trim();
|
|
44944
|
+
const alias = setDeclMatch[2]?.trim() ?? null;
|
|
44945
|
+
const { label: name, colorName } = peelTrailingColorName(nameWithMaybeColor);
|
|
44938
44946
|
let color = null;
|
|
44939
44947
|
if (colorName) {
|
|
44940
44948
|
color = resolveColorWithDiagnostic(
|
|
@@ -44944,7 +44952,6 @@ function parseVisualization(content, palette) {
|
|
|
44944
44952
|
palette
|
|
44945
44953
|
) ?? null;
|
|
44946
44954
|
}
|
|
44947
|
-
const alias = setDeclMatch[3]?.trim() ?? null;
|
|
44948
44955
|
result.vennSets.push({ name, alias, color, lineNumber });
|
|
44949
44956
|
continue;
|
|
44950
44957
|
}
|
|
@@ -44990,10 +44997,9 @@ function parseVisualization(content, palette) {
|
|
|
44990
44997
|
if (quadrantMatch) {
|
|
44991
44998
|
const position = quadrantMatch[1].toLowerCase();
|
|
44992
44999
|
const labelPart = quadrantMatch[2].trim();
|
|
44993
|
-
const
|
|
44994
|
-
const
|
|
44995
|
-
|
|
44996
|
-
labelColorMatch[2].trim(),
|
|
45000
|
+
const { label: text, colorName } = peelTrailingColorName(labelPart);
|
|
45001
|
+
const color = colorName ? resolveColorWithDiagnostic(
|
|
45002
|
+
colorName,
|
|
44997
45003
|
lineNumber,
|
|
44998
45004
|
result.diagnostics,
|
|
44999
45005
|
palette
|
|
@@ -45183,10 +45189,9 @@ function parseVisualization(content, palette) {
|
|
|
45183
45189
|
);
|
|
45184
45190
|
continue;
|
|
45185
45191
|
}
|
|
45186
|
-
const
|
|
45187
|
-
const
|
|
45188
|
-
|
|
45189
|
-
colorMatch[2].trim(),
|
|
45192
|
+
const { label: labelPart, colorName: colorWord } = peelTrailingColorName(joinedLabel);
|
|
45193
|
+
const colorPart = colorWord ? resolveColorWithDiagnostic(
|
|
45194
|
+
colorWord,
|
|
45190
45195
|
lineNumber,
|
|
45191
45196
|
result.diagnostics,
|
|
45192
45197
|
palette
|
|
@@ -46475,7 +46480,7 @@ function makeTimelineHoverHelpers() {
|
|
|
46475
46480
|
setTagAttrs
|
|
46476
46481
|
};
|
|
46477
46482
|
}
|
|
46478
|
-
function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setup, hovers, onClickItem, exportDims, swimlaneTagGroup, activeTagGroup, onTagStateChange, viewMode) {
|
|
46483
|
+
function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setup, hovers, onClickItem, exportDims, swimlaneTagGroup, activeTagGroup, onTagStateChange, viewMode, exportMode) {
|
|
46479
46484
|
if (parsed.timelineTagGroups.length === 0) return;
|
|
46480
46485
|
const { width, textColor, groupColorMap, solid } = setup;
|
|
46481
46486
|
const { FADE_OPACITY: FADE_OPACITY3, fadeReset, fadeToTagValue } = hovers;
|
|
@@ -46546,7 +46551,7 @@ function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setu
|
|
|
46546
46551
|
const centralConfig = {
|
|
46547
46552
|
groups: centralGroups,
|
|
46548
46553
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
46549
|
-
mode: "
|
|
46554
|
+
mode: exportMode ? "export" : "preview",
|
|
46550
46555
|
capsulePillAddonWidth: iconAddon
|
|
46551
46556
|
};
|
|
46552
46557
|
const centralState = { activeGroup: centralActive };
|
|
@@ -47390,7 +47395,7 @@ function renderTimelineVertical(container, parsed, palette, isDark, setup, hover
|
|
|
47390
47395
|
}
|
|
47391
47396
|
}
|
|
47392
47397
|
}
|
|
47393
|
-
function renderTimeline(container, parsed, palette, isDark, onClickItem, exportDims, activeTagGroup, swimlaneTagGroup, onTagStateChange, viewMode) {
|
|
47398
|
+
function renderTimeline(container, parsed, palette, isDark, onClickItem, exportDims, activeTagGroup, swimlaneTagGroup, onTagStateChange, viewMode, exportMode) {
|
|
47394
47399
|
const setup = setupTimeline(
|
|
47395
47400
|
container,
|
|
47396
47401
|
parsed,
|
|
@@ -47465,7 +47470,8 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
|
|
|
47465
47470
|
swimlaneTagGroup,
|
|
47466
47471
|
activeTagGroup,
|
|
47467
47472
|
onTagStateChange,
|
|
47468
|
-
viewMode
|
|
47473
|
+
viewMode,
|
|
47474
|
+
exportMode
|
|
47469
47475
|
);
|
|
47470
47476
|
}
|
|
47471
47477
|
function getRotateFn(mode) {
|
|
@@ -48562,6 +48568,7 @@ function finalizeSvgExport(container, theme, palette) {
|
|
|
48562
48568
|
return svgHtml;
|
|
48563
48569
|
}
|
|
48564
48570
|
async function renderForExport(content, theme, palette, viewState, options) {
|
|
48571
|
+
const exportMode = options?.exportMode ?? false;
|
|
48565
48572
|
const { parseDgmoChartType: parseDgmoChartType2 } = await Promise.resolve().then(() => (init_dgmo_router(), dgmo_router_exports));
|
|
48566
48573
|
const detectedType = parseDgmoChartType2(content);
|
|
48567
48574
|
if (detectedType === "org") {
|
|
@@ -48603,7 +48610,9 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48603
48610
|
void 0,
|
|
48604
48611
|
{ width: exportWidth, height: exportHeight },
|
|
48605
48612
|
activeTagGroup,
|
|
48606
|
-
hiddenAttributes
|
|
48613
|
+
hiddenAttributes,
|
|
48614
|
+
void 0,
|
|
48615
|
+
exportMode
|
|
48607
48616
|
);
|
|
48608
48617
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48609
48618
|
}
|
|
@@ -48645,7 +48654,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48645
48654
|
void 0,
|
|
48646
48655
|
{ width: exportWidth, height: exportHeight },
|
|
48647
48656
|
activeTagGroup,
|
|
48648
|
-
hiddenAttributes
|
|
48657
|
+
hiddenAttributes,
|
|
48658
|
+
exportMode
|
|
48649
48659
|
);
|
|
48650
48660
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48651
48661
|
}
|
|
@@ -48668,7 +48678,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48668
48678
|
currentSwimlaneGroup: viewState?.swim ?? null,
|
|
48669
48679
|
collapsedLanes: viewState?.cl ? new Set(viewState.cl) : void 0,
|
|
48670
48680
|
collapsedColumns: viewState?.cc ? new Set(viewState.cc) : void 0,
|
|
48671
|
-
compactMeta: viewState?.cm
|
|
48681
|
+
compactMeta: viewState?.cm,
|
|
48682
|
+
exportMode
|
|
48672
48683
|
});
|
|
48673
48684
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48674
48685
|
}
|
|
@@ -48692,7 +48703,9 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48692
48703
|
effectivePalette2,
|
|
48693
48704
|
theme === "dark",
|
|
48694
48705
|
void 0,
|
|
48695
|
-
{ width: exportWidth, height: exportHeight }
|
|
48706
|
+
{ width: exportWidth, height: exportHeight },
|
|
48707
|
+
void 0,
|
|
48708
|
+
exportMode
|
|
48696
48709
|
);
|
|
48697
48710
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48698
48711
|
}
|
|
@@ -48722,7 +48735,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48722
48735
|
erParsed.options["active-tag"],
|
|
48723
48736
|
viewState?.tag ?? options?.tagGroup
|
|
48724
48737
|
),
|
|
48725
|
-
viewState?.sem
|
|
48738
|
+
viewState?.sem,
|
|
48739
|
+
exportMode
|
|
48726
48740
|
);
|
|
48727
48741
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48728
48742
|
}
|
|
@@ -48755,7 +48769,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48755
48769
|
{
|
|
48756
48770
|
exportDims: { width: exportWidth, height: exportHeight },
|
|
48757
48771
|
activeTagGroup: viewState?.tag ?? options?.tagGroup,
|
|
48758
|
-
hiddenTagValues: blHiddenTagValues
|
|
48772
|
+
hiddenTagValues: blHiddenTagValues,
|
|
48773
|
+
exportMode
|
|
48759
48774
|
}
|
|
48760
48775
|
);
|
|
48761
48776
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
@@ -48801,7 +48816,7 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48801
48816
|
void 0,
|
|
48802
48817
|
hideDescriptions,
|
|
48803
48818
|
colorByDepth ? null : activeTagGroup,
|
|
48804
|
-
colorByDepth ? { colorByDepth: true } :
|
|
48819
|
+
colorByDepth ? { colorByDepth: true, exportMode } : { exportMode }
|
|
48805
48820
|
);
|
|
48806
48821
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48807
48822
|
}
|
|
@@ -48864,7 +48879,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48864
48879
|
c4Parsed.tagGroups,
|
|
48865
48880
|
c4Parsed.options["active-tag"],
|
|
48866
48881
|
viewState?.tag ?? options?.tagGroup
|
|
48867
|
-
)
|
|
48882
|
+
),
|
|
48883
|
+
exportMode
|
|
48868
48884
|
);
|
|
48869
48885
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48870
48886
|
}
|
|
@@ -49000,7 +49016,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49000
49016
|
resolved.tagGroups,
|
|
49001
49017
|
resolved.options.activeTag ?? void 0,
|
|
49002
49018
|
viewState?.tag ?? options?.tagGroup
|
|
49003
|
-
)
|
|
49019
|
+
),
|
|
49020
|
+
exportMode
|
|
49004
49021
|
},
|
|
49005
49022
|
{ width: EXPORT_W, height: EXPORT_H }
|
|
49006
49023
|
);
|
|
@@ -49041,7 +49058,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49041
49058
|
effectivePalette2,
|
|
49042
49059
|
theme === "dark",
|
|
49043
49060
|
{ width: RADAR_EXPORT_W, height: RADAR_EXPORT_H },
|
|
49044
|
-
viewState
|
|
49061
|
+
viewState,
|
|
49062
|
+
exportMode
|
|
49045
49063
|
);
|
|
49046
49064
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49047
49065
|
}
|
|
@@ -49061,7 +49079,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49061
49079
|
jmLayout.totalHeight
|
|
49062
49080
|
);
|
|
49063
49081
|
renderJourneyMap2(container2, jmParsed, effectivePalette2, theme === "dark", {
|
|
49064
|
-
exportDims: { width: jmLayout.totalWidth, height: jmLayout.totalHeight }
|
|
49082
|
+
exportDims: { width: jmLayout.totalWidth, height: jmLayout.totalHeight },
|
|
49083
|
+
exportMode
|
|
49065
49084
|
});
|
|
49066
49085
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49067
49086
|
}
|
|
@@ -49078,7 +49097,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49078
49097
|
effectivePalette2,
|
|
49079
49098
|
theme === "dark",
|
|
49080
49099
|
{ width: EXPORT_WIDTH, height: EXPORT_HEIGHT },
|
|
49081
|
-
viewState
|
|
49100
|
+
viewState,
|
|
49101
|
+
exportMode
|
|
49082
49102
|
);
|
|
49083
49103
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49084
49104
|
}
|
|
@@ -49197,7 +49217,10 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49197
49217
|
void 0,
|
|
49198
49218
|
viewState?.tag ?? options?.tagGroup
|
|
49199
49219
|
),
|
|
49200
|
-
viewState?.swim
|
|
49220
|
+
viewState?.swim,
|
|
49221
|
+
void 0,
|
|
49222
|
+
void 0,
|
|
49223
|
+
exportMode
|
|
49201
49224
|
);
|
|
49202
49225
|
} else if (parsed.type === "venn") {
|
|
49203
49226
|
renderVenn(container, parsed, effectivePalette, isDark, void 0, dims);
|