@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.js
CHANGED
|
@@ -1820,17 +1820,21 @@ function measureIndent(line12) {
|
|
|
1820
1820
|
return indent;
|
|
1821
1821
|
}
|
|
1822
1822
|
function extractColor(label, palette, diagnostics, line12) {
|
|
1823
|
-
const
|
|
1824
|
-
|
|
1825
|
-
|
|
1823
|
+
const lastSpaceIdx = Math.max(
|
|
1824
|
+
label.lastIndexOf(" "),
|
|
1825
|
+
label.lastIndexOf(" ")
|
|
1826
|
+
);
|
|
1827
|
+
if (lastSpaceIdx < 0) return { label };
|
|
1828
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
1829
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { label };
|
|
1826
1830
|
let color;
|
|
1827
1831
|
if (diagnostics && line12 !== void 0) {
|
|
1828
|
-
color = resolveColorWithDiagnostic(
|
|
1832
|
+
color = resolveColorWithDiagnostic(trailing, line12, diagnostics, palette);
|
|
1829
1833
|
} else {
|
|
1830
|
-
color = resolveColor(
|
|
1834
|
+
color = resolveColor(trailing, palette) ?? void 0;
|
|
1831
1835
|
}
|
|
1832
1836
|
return {
|
|
1833
|
-
label: label.substring(0,
|
|
1837
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
1834
1838
|
color
|
|
1835
1839
|
};
|
|
1836
1840
|
}
|
|
@@ -1963,14 +1967,18 @@ function parseSeriesNames(value, lines, lineIndex, palette, diagnostics) {
|
|
|
1963
1967
|
}
|
|
1964
1968
|
return { series, names, nameColors, nameLineNumbers, newIndex };
|
|
1965
1969
|
}
|
|
1966
|
-
function
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
return
|
|
1970
|
+
function peelTrailingColorName(label) {
|
|
1971
|
+
const lastSpaceIdx = Math.max(
|
|
1972
|
+
label.lastIndexOf(" "),
|
|
1973
|
+
label.lastIndexOf(" ")
|
|
1974
|
+
);
|
|
1975
|
+
if (lastSpaceIdx < 0) return { label };
|
|
1976
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
1977
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { label };
|
|
1978
|
+
return {
|
|
1979
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
1980
|
+
colorName: trailing
|
|
1981
|
+
};
|
|
1974
1982
|
}
|
|
1975
1983
|
function parsePipeMetadata(segments, aliasMap = /* @__PURE__ */ new Map(), errorMultiplePipes) {
|
|
1976
1984
|
if (segments.length > 2) {
|
|
@@ -1992,11 +2000,14 @@ function parsePipeMetadata(segments, aliasMap = /* @__PURE__ */ new Map(), error
|
|
|
1992
2000
|
}
|
|
1993
2001
|
return metadata;
|
|
1994
2002
|
}
|
|
1995
|
-
var ALL_CHART_TYPES, PIPE_KEY_VALUE_PREFIX_RE, PIPE_LIKELY_STRUCTURED_TAIL_RE,
|
|
2003
|
+
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;
|
|
1996
2004
|
var init_parsing = __esm({
|
|
1997
2005
|
"src/utils/parsing.ts"() {
|
|
1998
2006
|
"use strict";
|
|
1999
2007
|
init_colors();
|
|
2008
|
+
RECOGNIZED_COLOR_SET = new Set(
|
|
2009
|
+
RECOGNIZED_COLOR_NAMES
|
|
2010
|
+
);
|
|
2000
2011
|
ALL_CHART_TYPES = /* @__PURE__ */ new Set([
|
|
2001
2012
|
// data charts
|
|
2002
2013
|
"bar",
|
|
@@ -2048,7 +2059,6 @@ var init_parsing = __esm({
|
|
|
2048
2059
|
]);
|
|
2049
2060
|
PIPE_KEY_VALUE_PREFIX_RE = /^\s*[A-Za-z][A-Za-z0-9_-]*\s*:/;
|
|
2050
2061
|
PIPE_LIKELY_STRUCTURED_TAIL_RE = /,\s*[A-Za-z][A-Za-z0-9_-]*\s*:/;
|
|
2051
|
-
COLOR_SUFFIX_RE = /\(([^)]+)\)\s*$/;
|
|
2052
2062
|
OPTION_NOCOLON_RE = /^([a-z][a-z0-9-]*)\s+(.+)$/i;
|
|
2053
2063
|
GLOBAL_BOOLEANS = /* @__PURE__ */ new Set([
|
|
2054
2064
|
"solid-fill",
|
|
@@ -2085,7 +2095,7 @@ function parseTagDeclaration(line12) {
|
|
|
2085
2095
|
let restStartIdx = 1;
|
|
2086
2096
|
let valueStart = tokens.length;
|
|
2087
2097
|
for (let i = 1; i < tokens.length; i++) {
|
|
2088
|
-
if (tokens[i].includes("
|
|
2098
|
+
if (tokens[i].includes(",")) {
|
|
2089
2099
|
valueStart = i;
|
|
2090
2100
|
break;
|
|
2091
2101
|
}
|
|
@@ -2117,13 +2127,29 @@ function parseTagDeclaration(line12) {
|
|
|
2117
2127
|
restStartIdx = valueStart;
|
|
2118
2128
|
}
|
|
2119
2129
|
} else {
|
|
2120
|
-
|
|
2121
|
-
|
|
2130
|
+
const isColorWord = (s) => RECOGNIZED_COLOR_NAMES.includes(s);
|
|
2131
|
+
if (valueStart < tokens.length) {
|
|
2132
|
+
const commaTokenIdx = valueStart;
|
|
2133
|
+
const lastBeforeComma = tokens[commaTokenIdx].replace(/,$/, "");
|
|
2134
|
+
const firstValueStart = isColorWord(lastBeforeComma) ? commaTokenIdx - 1 : commaTokenIdx;
|
|
2135
|
+
const prefixEnd = firstValueStart;
|
|
2136
|
+
const aliasCandidate = prefixEnd > 1 ? tokens[prefixEnd - 1] : void 0;
|
|
2137
|
+
if (aliasCandidate && isAliasToken(aliasCandidate) && !isColorWord(aliasCandidate)) {
|
|
2138
|
+
alias = aliasCandidate;
|
|
2139
|
+
legacyForm = "bare-shorthand";
|
|
2140
|
+
name = tokens.slice(0, prefixEnd - 1).map((t) => stripQuotes(t)).join(" ");
|
|
2141
|
+
restStartIdx = prefixEnd;
|
|
2142
|
+
} else {
|
|
2143
|
+
name = tokens.slice(0, prefixEnd).map((t) => stripQuotes(t)).join(" ");
|
|
2144
|
+
restStartIdx = prefixEnd;
|
|
2145
|
+
}
|
|
2146
|
+
} else if (tokens[0][0] === '"' || tokens[0][0] === "'") {
|
|
2147
|
+
if (tokens.length > 1 && isAliasToken(tokens[1]) && !isColorWord(tokens[1])) {
|
|
2122
2148
|
alias = tokens[1];
|
|
2123
2149
|
legacyForm = "bare-shorthand";
|
|
2124
2150
|
restStartIdx = 2;
|
|
2125
2151
|
}
|
|
2126
|
-
} else if (valueStart > 1 && isAliasToken(tokens[valueStart - 1])) {
|
|
2152
|
+
} else if (valueStart > 1 && isAliasToken(tokens[valueStart - 1]) && !isColorWord(tokens[valueStart - 1])) {
|
|
2127
2153
|
alias = tokens[valueStart - 1];
|
|
2128
2154
|
legacyForm = "bare-shorthand";
|
|
2129
2155
|
name = tokens.slice(0, valueStart - 1).map((t) => stripQuotes(t)).join(" ");
|
|
@@ -2138,10 +2164,13 @@ function parseTagDeclaration(line12) {
|
|
|
2138
2164
|
inlineValues = valueStr.split(",").map((v) => v.trim()).filter(Boolean);
|
|
2139
2165
|
}
|
|
2140
2166
|
if (!inlineValues || inlineValues.length === 0) {
|
|
2141
|
-
const
|
|
2142
|
-
if (
|
|
2143
|
-
|
|
2144
|
-
|
|
2167
|
+
const lastSpaceIdx = name.lastIndexOf(" ");
|
|
2168
|
+
if (lastSpaceIdx > 0) {
|
|
2169
|
+
const trailing = name.substring(lastSpaceIdx + 1);
|
|
2170
|
+
if (RECOGNIZED_COLOR_NAMES.includes(trailing)) {
|
|
2171
|
+
colorHint = trailing;
|
|
2172
|
+
name = name.substring(0, lastSpaceIdx).trimEnd();
|
|
2173
|
+
}
|
|
2145
2174
|
}
|
|
2146
2175
|
}
|
|
2147
2176
|
return {
|
|
@@ -2269,6 +2298,7 @@ var init_tag_groups = __esm({
|
|
|
2269
2298
|
"use strict";
|
|
2270
2299
|
init_parsing();
|
|
2271
2300
|
init_diagnostics();
|
|
2301
|
+
init_colors();
|
|
2272
2302
|
TAG_BLOCK_NOCOLON_RE = /^tag\s+/i;
|
|
2273
2303
|
VALID_TAG_IDENT_RE = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
2274
2304
|
}
|
|
@@ -2542,7 +2572,7 @@ function buildControlsGroupLayout(config, state) {
|
|
|
2542
2572
|
}
|
|
2543
2573
|
function computeLegendLayout(config, state, containerWidth) {
|
|
2544
2574
|
const { groups, controls: configControls, mode } = config;
|
|
2545
|
-
const isExport = mode === "
|
|
2575
|
+
const isExport = mode === "export";
|
|
2546
2576
|
const activeGroupName = state.activeGroup?.toLowerCase() ?? null;
|
|
2547
2577
|
if (isExport && !activeGroupName) {
|
|
2548
2578
|
return {
|
|
@@ -2828,7 +2858,10 @@ function renderLegendD3(container, config, state, palette, isDark, callbacks, co
|
|
|
2828
2858
|
const width = containerWidth ?? parseFloat(container.attr("width") || "800");
|
|
2829
2859
|
let currentState = { ...state };
|
|
2830
2860
|
let currentLayout;
|
|
2831
|
-
const legendG = container.append("g").attr("class", "dgmo-legend")
|
|
2861
|
+
const legendG = container.append("g").attr("class", "dgmo-legend").attr("data-legend-title-relation", config.position.titleRelation).attr(
|
|
2862
|
+
"data-legend-capsule-addon-width",
|
|
2863
|
+
String(config.capsulePillAddonWidth ?? 0)
|
|
2864
|
+
);
|
|
2832
2865
|
function render3() {
|
|
2833
2866
|
currentLayout = computeLegendLayout(config, currentState, width);
|
|
2834
2867
|
legendG.selectAll("*").remove();
|
|
@@ -3390,15 +3423,6 @@ function parseInArrowLabel(rawLabel, lineNumber) {
|
|
|
3390
3423
|
const diagnostics = validateLabelCharacters(trimmed, lineNumber);
|
|
3391
3424
|
return { label: trimmed, diagnostics };
|
|
3392
3425
|
}
|
|
3393
|
-
function matchColorParens(content) {
|
|
3394
|
-
const m = content.match(/^\(([A-Za-z]+)\)$/);
|
|
3395
|
-
if (!m) return null;
|
|
3396
|
-
const candidate = m[1].toLowerCase();
|
|
3397
|
-
if (RECOGNIZED_COLOR_NAMES.includes(candidate)) {
|
|
3398
|
-
return candidate;
|
|
3399
|
-
}
|
|
3400
|
-
return null;
|
|
3401
|
-
}
|
|
3402
3426
|
function parseArrow(line12) {
|
|
3403
3427
|
if (BIDI_SYNC_RE.test(line12) || BIDI_ASYNC_RE.test(line12)) {
|
|
3404
3428
|
return {
|
|
@@ -3437,7 +3461,6 @@ var init_arrows = __esm({
|
|
|
3437
3461
|
"src/utils/arrows.ts"() {
|
|
3438
3462
|
"use strict";
|
|
3439
3463
|
init_diagnostics();
|
|
3440
|
-
init_colors();
|
|
3441
3464
|
ARROW_DIAGNOSTIC_CODES = {
|
|
3442
3465
|
/** Active: label contains `->` or `~>` substring (TD-13). */
|
|
3443
3466
|
ARROW_SUBSTRING_IN_LABEL: "E_ARROW_SUBSTRING_IN_LABEL",
|
|
@@ -3762,7 +3785,7 @@ function parseSequenceDgmo(content) {
|
|
|
3762
3785
|
if (groupColor) {
|
|
3763
3786
|
pushWarning(
|
|
3764
3787
|
lineNumber,
|
|
3765
|
-
`(${groupColor}) color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3788
|
+
`'(${groupColor})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3766
3789
|
);
|
|
3767
3790
|
}
|
|
3768
3791
|
contentStarted = true;
|
|
@@ -3842,7 +3865,7 @@ function parseSequenceDgmo(content) {
|
|
|
3842
3865
|
if (!color) {
|
|
3843
3866
|
pushError(
|
|
3844
3867
|
lineNumber,
|
|
3845
|
-
`Expected 'Value
|
|
3868
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
3846
3869
|
);
|
|
3847
3870
|
continue;
|
|
3848
3871
|
}
|
|
@@ -3866,11 +3889,13 @@ function parseSequenceDgmo(content) {
|
|
|
3866
3889
|
blockStack.pop();
|
|
3867
3890
|
}
|
|
3868
3891
|
const labelRaw = sectionMatch[1].trim();
|
|
3869
|
-
const colorMatch = labelRaw.match(
|
|
3892
|
+
const colorMatch = labelRaw.match(
|
|
3893
|
+
/^(.+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)$/
|
|
3894
|
+
);
|
|
3870
3895
|
if (colorMatch) {
|
|
3871
3896
|
pushWarning(
|
|
3872
3897
|
lineNumber,
|
|
3873
|
-
`(${colorMatch[2]
|
|
3898
|
+
`'(${colorMatch[2]})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3874
3899
|
);
|
|
3875
3900
|
}
|
|
3876
3901
|
contentStarted = true;
|
|
@@ -4025,7 +4050,7 @@ function parseSequenceDgmo(content) {
|
|
|
4025
4050
|
const color = coloredMatch[2].trim();
|
|
4026
4051
|
pushError(
|
|
4027
4052
|
lineNumber,
|
|
4028
|
-
`'${id}(${color})' syntax is no longer supported \u2014 use 'tag:' groups for coloring`
|
|
4053
|
+
`'${id}(${color})' parens-color syntax is no longer supported \u2014 use 'tag:' groups for coloring`
|
|
4029
4054
|
);
|
|
4030
4055
|
contentStarted = true;
|
|
4031
4056
|
const key = addParticipant(id, lineNumber, { metadata: colorMeta });
|
|
@@ -4404,7 +4429,7 @@ var init_parser = __esm({
|
|
|
4404
4429
|
]);
|
|
4405
4430
|
IS_A_PATTERN = /^([^:]+?)\s+is\s+an?\s+(\w+)(?:\s+(.+))?$/i;
|
|
4406
4431
|
POSITION_ONLY_PATTERN = /^([^:]+?)\s+position\s+(-?\d+)$/i;
|
|
4407
|
-
COLORED_PARTICIPANT_PATTERN = /^(\S+?)\((
|
|
4432
|
+
COLORED_PARTICIPANT_PATTERN = /^(\S+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)\s*$/;
|
|
4408
4433
|
GROUP_HEADING_PATTERN = /^\[([^\]|]+?)(?:\(([^)]+)\))?\]\s*(.*)$/;
|
|
4409
4434
|
GROUP_HEADING_FALLBACK = /^\[([^\]]+)\]\s*(.*)$/;
|
|
4410
4435
|
LEGACY_GROUP_PATTERN = /^##\s+(.+?)(?:\(([^)]+)\))?\s*$/;
|
|
@@ -4473,7 +4498,6 @@ function splitArrows(line12) {
|
|
|
4473
4498
|
const arrowEnd = idx + 2;
|
|
4474
4499
|
let arrowStart;
|
|
4475
4500
|
let label;
|
|
4476
|
-
let color;
|
|
4477
4501
|
let openingStart = -1;
|
|
4478
4502
|
for (let i = scanFloor; i < runStart; i++) {
|
|
4479
4503
|
if (line12[i] !== "-") continue;
|
|
@@ -4486,21 +4510,13 @@ function splitArrows(line12) {
|
|
|
4486
4510
|
if (openingStart !== -1) {
|
|
4487
4511
|
let openingEnd = openingStart;
|
|
4488
4512
|
while (openingEnd < runStart && line12[openingEnd] === "-") openingEnd++;
|
|
4489
|
-
const
|
|
4490
|
-
|
|
4491
|
-
if (colorMatch) {
|
|
4492
|
-
color = colorMatch[1].trim();
|
|
4493
|
-
const labelPart = arrowContent.substring(0, colorMatch.index).trim();
|
|
4494
|
-
if (labelPart) label = labelPart;
|
|
4495
|
-
} else {
|
|
4496
|
-
const labelPart = arrowContent.trim();
|
|
4497
|
-
if (labelPart) label = labelPart;
|
|
4498
|
-
}
|
|
4513
|
+
const labelPart = line12.substring(openingEnd, runStart).trim();
|
|
4514
|
+
if (labelPart) label = labelPart;
|
|
4499
4515
|
arrowStart = openingStart;
|
|
4500
4516
|
} else {
|
|
4501
4517
|
arrowStart = runStart;
|
|
4502
4518
|
}
|
|
4503
|
-
arrowPositions.push({ start: arrowStart, end: arrowEnd, label
|
|
4519
|
+
arrowPositions.push({ start: arrowStart, end: arrowEnd, label });
|
|
4504
4520
|
searchFrom = arrowEnd;
|
|
4505
4521
|
scanFloor = arrowEnd;
|
|
4506
4522
|
}
|
|
@@ -4514,11 +4530,7 @@ function splitArrows(line12) {
|
|
|
4514
4530
|
if (beforeText || i === 0) {
|
|
4515
4531
|
segments.push(beforeText);
|
|
4516
4532
|
}
|
|
4517
|
-
|
|
4518
|
-
if (arrow.label && arrow.color)
|
|
4519
|
-
arrowToken = `-${arrow.label}(${arrow.color})->`;
|
|
4520
|
-
else if (arrow.label) arrowToken = `-${arrow.label}->`;
|
|
4521
|
-
else if (arrow.color) arrowToken = `-(${arrow.color})->`;
|
|
4533
|
+
const arrowToken = arrow.label ? `-${arrow.label}->` : "->";
|
|
4522
4534
|
segments.push(arrowToken);
|
|
4523
4535
|
lastIndex = arrow.end;
|
|
4524
4536
|
}
|
|
@@ -4528,45 +4540,14 @@ function splitArrows(line12) {
|
|
|
4528
4540
|
}
|
|
4529
4541
|
return segments;
|
|
4530
4542
|
}
|
|
4531
|
-
function parseArrowToken(token,
|
|
4543
|
+
function parseArrowToken(token, _palette, lineNumber, diagnostics) {
|
|
4532
4544
|
if (token === "->") return {};
|
|
4533
|
-
const
|
|
4534
|
-
if (bareParen) {
|
|
4535
|
-
const colorName = matchColorParens(bareParen[1]);
|
|
4536
|
-
if (colorName) {
|
|
4537
|
-
return {
|
|
4538
|
-
color: resolveColorWithDiagnostic(
|
|
4539
|
-
colorName,
|
|
4540
|
-
lineNumber,
|
|
4541
|
-
diagnostics,
|
|
4542
|
-
palette
|
|
4543
|
-
)
|
|
4544
|
-
};
|
|
4545
|
-
}
|
|
4546
|
-
}
|
|
4547
|
-
const m = token.match(/^-(.+?)(?:\(([^)]+)\))?->$/);
|
|
4545
|
+
const m = token.match(/^-(.+?)->$/);
|
|
4548
4546
|
if (m) {
|
|
4549
4547
|
const rawLabel = m[1] ?? "";
|
|
4550
4548
|
const labelResult = parseInArrowLabel(rawLabel, lineNumber);
|
|
4551
4549
|
diagnostics.push(...labelResult.diagnostics);
|
|
4552
|
-
|
|
4553
|
-
let color = m[2] ? resolveColorWithDiagnostic(
|
|
4554
|
-
m[2].trim(),
|
|
4555
|
-
lineNumber,
|
|
4556
|
-
diagnostics,
|
|
4557
|
-
palette
|
|
4558
|
-
) : void 0;
|
|
4559
|
-
if (label && !color) {
|
|
4560
|
-
const inferred = inferArrowColor(label);
|
|
4561
|
-
if (inferred)
|
|
4562
|
-
color = resolveColorWithDiagnostic(
|
|
4563
|
-
inferred,
|
|
4564
|
-
lineNumber,
|
|
4565
|
-
diagnostics,
|
|
4566
|
-
palette
|
|
4567
|
-
);
|
|
4568
|
-
}
|
|
4569
|
-
return { label, color };
|
|
4550
|
+
return { label: labelResult.label };
|
|
4570
4551
|
}
|
|
4571
4552
|
return {};
|
|
4572
4553
|
}
|
|
@@ -4632,13 +4613,12 @@ function parseFlowchart(content, palette) {
|
|
|
4632
4613
|
result.nodes.push(node);
|
|
4633
4614
|
return node;
|
|
4634
4615
|
}
|
|
4635
|
-
function addEdge(sourceId, targetId, lineNumber, label
|
|
4616
|
+
function addEdge(sourceId, targetId, lineNumber, label) {
|
|
4636
4617
|
const edge = {
|
|
4637
4618
|
source: sourceId,
|
|
4638
4619
|
target: targetId,
|
|
4639
4620
|
lineNumber,
|
|
4640
|
-
...label && { label }
|
|
4641
|
-
...color && { color }
|
|
4621
|
+
...label && { label }
|
|
4642
4622
|
};
|
|
4643
4623
|
result.edges.push(edge);
|
|
4644
4624
|
}
|
|
@@ -4704,13 +4684,7 @@ function parseFlowchart(content, palette) {
|
|
|
4704
4684
|
if (pendingArrow !== null) {
|
|
4705
4685
|
const sourceId = lastNodeId ?? implicitSourceId;
|
|
4706
4686
|
if (sourceId) {
|
|
4707
|
-
addEdge(
|
|
4708
|
-
sourceId,
|
|
4709
|
-
node.id,
|
|
4710
|
-
lineNumber,
|
|
4711
|
-
pendingArrow.label,
|
|
4712
|
-
pendingArrow.color
|
|
4713
|
-
);
|
|
4687
|
+
addEdge(sourceId, node.id, lineNumber, pendingArrow.label);
|
|
4714
4688
|
}
|
|
4715
4689
|
pendingArrow = null;
|
|
4716
4690
|
} else if (lastNodeId === null && implicitSourceId === null) {
|
|
@@ -4835,7 +4809,6 @@ var NODE_ID_RE;
|
|
|
4835
4809
|
var init_flowchart_parser = __esm({
|
|
4836
4810
|
"src/graph/flowchart-parser.ts"() {
|
|
4837
4811
|
"use strict";
|
|
4838
|
-
init_colors();
|
|
4839
4812
|
init_diagnostics();
|
|
4840
4813
|
init_arrows();
|
|
4841
4814
|
init_parsing();
|
|
@@ -4863,7 +4836,6 @@ function splitArrows2(line12) {
|
|
|
4863
4836
|
const arrowEnd = idx + 2;
|
|
4864
4837
|
let arrowStart;
|
|
4865
4838
|
let label;
|
|
4866
|
-
let color;
|
|
4867
4839
|
let openingStart = -1;
|
|
4868
4840
|
for (let i = scanFloor; i < runStart; i++) {
|
|
4869
4841
|
if (line12[i] !== "-") continue;
|
|
@@ -4876,21 +4848,13 @@ function splitArrows2(line12) {
|
|
|
4876
4848
|
if (openingStart !== -1) {
|
|
4877
4849
|
let openingEnd = openingStart;
|
|
4878
4850
|
while (openingEnd < runStart && line12[openingEnd] === "-") openingEnd++;
|
|
4879
|
-
const
|
|
4880
|
-
|
|
4881
|
-
if (colorMatch) {
|
|
4882
|
-
color = colorMatch[1].trim();
|
|
4883
|
-
const labelPart = arrowContent.substring(0, colorMatch.index).trim();
|
|
4884
|
-
if (labelPart) label = labelPart;
|
|
4885
|
-
} else {
|
|
4886
|
-
const labelPart = arrowContent.trim();
|
|
4887
|
-
if (labelPart) label = labelPart;
|
|
4888
|
-
}
|
|
4851
|
+
const labelPart = line12.substring(openingEnd, runStart).trim();
|
|
4852
|
+
if (labelPart) label = labelPart;
|
|
4889
4853
|
arrowStart = openingStart;
|
|
4890
4854
|
} else {
|
|
4891
4855
|
arrowStart = runStart;
|
|
4892
4856
|
}
|
|
4893
|
-
arrowPositions.push({ start: arrowStart, end: arrowEnd, label
|
|
4857
|
+
arrowPositions.push({ start: arrowStart, end: arrowEnd, label });
|
|
4894
4858
|
searchFrom = arrowEnd;
|
|
4895
4859
|
scanFloor = arrowEnd;
|
|
4896
4860
|
}
|
|
@@ -4900,11 +4864,7 @@ function splitArrows2(line12) {
|
|
|
4900
4864
|
const arrow = arrowPositions[i];
|
|
4901
4865
|
const beforeText = line12.substring(lastIndex, arrow.start).trim();
|
|
4902
4866
|
if (beforeText || i === 0) segments.push(beforeText);
|
|
4903
|
-
|
|
4904
|
-
if (arrow.label && arrow.color)
|
|
4905
|
-
arrowToken = `-${arrow.label}(${arrow.color})->`;
|
|
4906
|
-
else if (arrow.label) arrowToken = `-${arrow.label}->`;
|
|
4907
|
-
else if (arrow.color) arrowToken = `-(${arrow.color})->`;
|
|
4867
|
+
const arrowToken = arrow.label ? `-${arrow.label}->` : "->";
|
|
4908
4868
|
segments.push(arrowToken);
|
|
4909
4869
|
lastIndex = arrow.end;
|
|
4910
4870
|
}
|
|
@@ -4912,35 +4872,14 @@ function splitArrows2(line12) {
|
|
|
4912
4872
|
if (remaining) segments.push(remaining);
|
|
4913
4873
|
return segments;
|
|
4914
4874
|
}
|
|
4915
|
-
function parseArrowToken2(token,
|
|
4875
|
+
function parseArrowToken2(token, _palette, lineNumber, diagnostics) {
|
|
4916
4876
|
if (token === "->") return {};
|
|
4917
|
-
const
|
|
4918
|
-
if (bareParen) {
|
|
4919
|
-
const colorName = matchColorParens(bareParen[1]);
|
|
4920
|
-
if (colorName) {
|
|
4921
|
-
return {
|
|
4922
|
-
color: resolveColorWithDiagnostic(
|
|
4923
|
-
colorName,
|
|
4924
|
-
lineNumber,
|
|
4925
|
-
diagnostics,
|
|
4926
|
-
palette
|
|
4927
|
-
)
|
|
4928
|
-
};
|
|
4929
|
-
}
|
|
4930
|
-
}
|
|
4931
|
-
const m = token.match(/^-(.+?)(?:\(([^)]+)\))?->$/);
|
|
4877
|
+
const m = token.match(/^-(.+?)->$/);
|
|
4932
4878
|
if (m) {
|
|
4933
4879
|
const rawLabel = m[1] ?? "";
|
|
4934
4880
|
const labelResult = parseInArrowLabel(rawLabel, lineNumber);
|
|
4935
4881
|
diagnostics.push(...labelResult.diagnostics);
|
|
4936
|
-
|
|
4937
|
-
const color = m[2] ? resolveColorWithDiagnostic(
|
|
4938
|
-
m[2].trim(),
|
|
4939
|
-
lineNumber,
|
|
4940
|
-
diagnostics,
|
|
4941
|
-
palette
|
|
4942
|
-
) : void 0;
|
|
4943
|
-
return { label, color };
|
|
4882
|
+
return { label: labelResult.label };
|
|
4944
4883
|
}
|
|
4945
4884
|
return {};
|
|
4946
4885
|
}
|
|
@@ -5031,13 +4970,12 @@ function parseState(content, palette) {
|
|
|
5031
4970
|
}
|
|
5032
4971
|
return node;
|
|
5033
4972
|
}
|
|
5034
|
-
function addEdge(sourceId, targetId, lineNumber, label
|
|
4973
|
+
function addEdge(sourceId, targetId, lineNumber, label) {
|
|
5035
4974
|
result.edges.push({
|
|
5036
4975
|
source: sourceId,
|
|
5037
4976
|
target: targetId,
|
|
5038
4977
|
lineNumber,
|
|
5039
|
-
...label && { label }
|
|
5040
|
-
...color && { color }
|
|
4978
|
+
...label && { label }
|
|
5041
4979
|
});
|
|
5042
4980
|
}
|
|
5043
4981
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -5180,13 +5118,7 @@ function parseState(content, palette) {
|
|
|
5180
5118
|
if (pendingArrow !== null) {
|
|
5181
5119
|
const sourceId = lastNodeId ?? implicitSourceId;
|
|
5182
5120
|
if (sourceId) {
|
|
5183
|
-
addEdge(
|
|
5184
|
-
sourceId,
|
|
5185
|
-
node.id,
|
|
5186
|
-
lineNumber,
|
|
5187
|
-
pendingArrow.label,
|
|
5188
|
-
pendingArrow.color
|
|
5189
|
-
);
|
|
5121
|
+
addEdge(sourceId, node.id, lineNumber, pendingArrow.label);
|
|
5190
5122
|
}
|
|
5191
5123
|
pendingArrow = null;
|
|
5192
5124
|
}
|
|
@@ -5239,7 +5171,7 @@ var init_state_parser = __esm({
|
|
|
5239
5171
|
init_name_normalize();
|
|
5240
5172
|
PSEUDOSTATE_ID = "pseudostate:[*]";
|
|
5241
5173
|
PSEUDOSTATE_LABEL = "[*]";
|
|
5242
|
-
GROUP_BRACKET_RE = /^\[([^\]]+)\](?:\(
|
|
5174
|
+
GROUP_BRACKET_RE = /^\[([^\]]+)\](?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/;
|
|
5243
5175
|
}
|
|
5244
5176
|
});
|
|
5245
5177
|
|
|
@@ -5618,7 +5550,7 @@ var init_parser2 = __esm({
|
|
|
5618
5550
|
init_arrows();
|
|
5619
5551
|
init_parsing();
|
|
5620
5552
|
init_name_normalize();
|
|
5621
|
-
CLASS_DECL_RE = /^(?:(abstract|interface|enum)\s+)?(?:"([^"]+)"|([A-Z][^":]*?))(?:\s+extends\s+(?:"([^"]+)"|([A-Z][^":]*?)))?(?:\s+implements\s+(?:"([^"]+)"|([A-Z][^":]*?)))?(?:\s+\[(abstract|interface|enum)\])?(?:\s
|
|
5553
|
+
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*$/;
|
|
5622
5554
|
INDENT_REL_ARROW_RE = /^(--\|>|\.\.\|>|\*--|o--|\.\.>|->)\s*(?:"([^"]+)"|([A-Za-z][^":]*?))(?:\s+:?\s*(.+))?$/;
|
|
5623
5555
|
REL_ARROW_RE = /^(?:"([^"]+)"|([A-Z][^":]*?))\s*(--\|>|\.\.\|>|\*--|o--|\.\.>|->)\s*(?:"([^"]+)"|([A-Z][^":]*?))(?:\s+:?\s*(.+))?$/;
|
|
5624
5556
|
VISIBILITY_RE = /^([+\-#])\s*/;
|
|
@@ -5825,7 +5757,7 @@ function parseERDiagram(content, palette) {
|
|
|
5825
5757
|
result.diagnostics.push(
|
|
5826
5758
|
makeDgmoError(
|
|
5827
5759
|
lineNumber,
|
|
5828
|
-
`Expected 'Value
|
|
5760
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`,
|
|
5829
5761
|
"warning"
|
|
5830
5762
|
)
|
|
5831
5763
|
);
|
|
@@ -5937,7 +5869,7 @@ function parseERDiagram(content, palette) {
|
|
|
5937
5869
|
if (result.tables.length === 0 && !result.error) {
|
|
5938
5870
|
const diag = makeDgmoError(
|
|
5939
5871
|
1,
|
|
5940
|
-
'No tables found. Add table declarations like "users" or "orders
|
|
5872
|
+
'No tables found. Add table declarations like "users" or "orders blue".'
|
|
5941
5873
|
);
|
|
5942
5874
|
result.diagnostics.push(diag);
|
|
5943
5875
|
result.error = formatDgmoError(diag);
|
|
@@ -6023,15 +5955,19 @@ function extractSymbols3(docText) {
|
|
|
6023
5955
|
for (const rawLine of docText.split("\n")) {
|
|
6024
5956
|
const line12 = rawLine.trim();
|
|
6025
5957
|
if (inMetadata && /^er(\s|$)/i.test(line12)) continue;
|
|
6026
|
-
if (inMetadata && OPTION_NOCOLON_RE.test(line12)) continue;
|
|
6027
|
-
inMetadata = false;
|
|
6028
|
-
if (line12.length === 0) continue;
|
|
6029
5958
|
if (/^\s/.test(rawLine)) continue;
|
|
5959
|
+
if (line12.length === 0) continue;
|
|
6030
5960
|
const m = TABLE_DECL_RE.exec(line12);
|
|
6031
5961
|
if (m) {
|
|
6032
5962
|
const name = (m[1] ?? m[2] ?? "").trim();
|
|
6033
|
-
if (name)
|
|
5963
|
+
if (name) {
|
|
5964
|
+
inMetadata = false;
|
|
5965
|
+
entities.push(name);
|
|
5966
|
+
continue;
|
|
5967
|
+
}
|
|
6034
5968
|
}
|
|
5969
|
+
if (inMetadata && OPTION_NOCOLON_RE.test(line12)) continue;
|
|
5970
|
+
inMetadata = false;
|
|
6035
5971
|
}
|
|
6036
5972
|
return {
|
|
6037
5973
|
kind: "er",
|
|
@@ -6049,7 +5985,7 @@ var init_parser3 = __esm({
|
|
|
6049
5985
|
init_name_normalize();
|
|
6050
5986
|
init_parsing();
|
|
6051
5987
|
init_tag_groups();
|
|
6052
|
-
TABLE_DECL_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":(]*?))(?:\s
|
|
5988
|
+
TABLE_DECL_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":(]*?))(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?(?:\s*\|(.+))?$/;
|
|
6053
5989
|
INDENT_REL_RE = /^([1*?])-{1,2}(?:(.+?)-{1,2})?([1*?])\s+(?:"([^"]+)"|([a-zA-Z_][^":]*?))\s*$/;
|
|
6054
5990
|
CONSTRAINT_MAP = {
|
|
6055
5991
|
pk: "pk",
|
|
@@ -6129,18 +6065,22 @@ function parseChart(content, palette) {
|
|
|
6129
6065
|
return fail(lineNumber, msg2);
|
|
6130
6066
|
}
|
|
6131
6067
|
}
|
|
6132
|
-
const eraMatch = trimmed.match(
|
|
6133
|
-
/^era\s+(.+?)\s*->\s*(.+?)(?:\s*\(([^)]+)\))?\s*$/
|
|
6134
|
-
);
|
|
6068
|
+
const eraMatch = trimmed.match(/^era\s+(.+?)\s*->\s*(.+?)\s*$/);
|
|
6135
6069
|
if (eraMatch) {
|
|
6136
6070
|
const afterArrow = eraMatch[2].trim();
|
|
6137
6071
|
const spaceIdx2 = afterArrow.indexOf(" ");
|
|
6138
6072
|
if (spaceIdx2 >= 0) {
|
|
6073
|
+
const lastSpaceIdx = afterArrow.lastIndexOf(" ");
|
|
6074
|
+
const trailing = afterArrow.substring(lastSpaceIdx + 1);
|
|
6075
|
+
const hasColor = RECOGNIZED_COLOR_NAMES.includes(
|
|
6076
|
+
trailing
|
|
6077
|
+
);
|
|
6078
|
+
const labelPart = hasColor ? afterArrow.substring(0, lastSpaceIdx).trimEnd() : afterArrow;
|
|
6139
6079
|
rawEras.push({
|
|
6140
6080
|
start: eraMatch[1].trim(),
|
|
6141
|
-
afterArrow,
|
|
6142
|
-
color:
|
|
6143
|
-
|
|
6081
|
+
afterArrow: labelPart,
|
|
6082
|
+
color: hasColor ? resolveColorWithDiagnostic(
|
|
6083
|
+
trailing,
|
|
6144
6084
|
lineNumber,
|
|
6145
6085
|
result.diagnostics,
|
|
6146
6086
|
palette
|
|
@@ -6662,11 +6602,12 @@ function parseExtendedChart(content, palette) {
|
|
|
6662
6602
|
return result;
|
|
6663
6603
|
}
|
|
6664
6604
|
}
|
|
6665
|
-
const categoryMatch = trimmed.match(/^\[(.+?)\](?:\s
|
|
6605
|
+
const categoryMatch = trimmed.match(/^\[(.+?)\](?:\s+(\S+))?\s*$/);
|
|
6666
6606
|
if (categoryMatch) {
|
|
6667
6607
|
const catName = categoryMatch[1].trim();
|
|
6668
|
-
const
|
|
6669
|
-
|
|
6608
|
+
const rawCatColor = categoryMatch[2]?.trim();
|
|
6609
|
+
const catColor = rawCatColor ? resolveColorWithDiagnostic(
|
|
6610
|
+
rawCatColor,
|
|
6670
6611
|
lineNumber,
|
|
6671
6612
|
result.diagnostics,
|
|
6672
6613
|
palette
|
|
@@ -6681,7 +6622,7 @@ function parseExtendedChart(content, palette) {
|
|
|
6681
6622
|
continue;
|
|
6682
6623
|
}
|
|
6683
6624
|
const arrowMatch = trimmed.match(
|
|
6684
|
-
/^(.+?)\s*(->|--)\s*(.+?)\s+(-?[\d,_]+(?:\.[\d]+)?)
|
|
6625
|
+
/^(.+?)\s*(->|--)\s*(.+?)\s+(-?[\d,_]+(?:\.[\d]+)?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
6685
6626
|
);
|
|
6686
6627
|
if (arrowMatch) {
|
|
6687
6628
|
const [, rawSource, arrow, rawTarget, rawVal, rawLinkColor] = arrowMatch;
|
|
@@ -6726,9 +6667,12 @@ function parseExtendedChart(content, palette) {
|
|
|
6726
6667
|
}
|
|
6727
6668
|
if (sankeyStack.length > 0) {
|
|
6728
6669
|
const valColorMatch = trimmed.match(
|
|
6729
|
-
/(-?[\d,_]+(?:\.[\d]+)?)\s
|
|
6670
|
+
/(-?[\d,_]+(?:\.[\d]+)?)\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\s*$/
|
|
6730
6671
|
);
|
|
6731
|
-
const strippedLine = valColorMatch ? trimmed.replace(
|
|
6672
|
+
const strippedLine = valColorMatch ? trimmed.replace(
|
|
6673
|
+
/\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\s*$/,
|
|
6674
|
+
""
|
|
6675
|
+
) : trimmed;
|
|
6732
6676
|
const dataRow2 = parseDataRowValues(strippedLine);
|
|
6733
6677
|
if (dataRow2 && dataRow2.values.length === 1) {
|
|
6734
6678
|
const source = sankeyStack.at(-1).name;
|
|
@@ -9104,7 +9048,7 @@ function parseOrg(content, palette) {
|
|
|
9104
9048
|
if (!color) {
|
|
9105
9049
|
pushError(
|
|
9106
9050
|
lineNumber,
|
|
9107
|
-
`Expected 'Value
|
|
9051
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9108
9052
|
);
|
|
9109
9053
|
continue;
|
|
9110
9054
|
}
|
|
@@ -9395,7 +9339,7 @@ function parseKanban(content, palette) {
|
|
|
9395
9339
|
if (!color) {
|
|
9396
9340
|
warn(
|
|
9397
9341
|
lineNumber,
|
|
9398
|
-
`Expected 'Value
|
|
9342
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9399
9343
|
);
|
|
9400
9344
|
continue;
|
|
9401
9345
|
}
|
|
@@ -9438,8 +9382,9 @@ function parseKanban(content, palette) {
|
|
|
9438
9382
|
currentCard = null;
|
|
9439
9383
|
columnCounter++;
|
|
9440
9384
|
const colName = columnMatch[1].trim();
|
|
9441
|
-
const
|
|
9442
|
-
|
|
9385
|
+
const rawTrailing = columnMatch[2]?.trim();
|
|
9386
|
+
const colColor = rawTrailing ? resolveColorWithDiagnostic(
|
|
9387
|
+
rawTrailing,
|
|
9443
9388
|
lineNumber,
|
|
9444
9389
|
result.diagnostics,
|
|
9445
9390
|
palette
|
|
@@ -9594,7 +9539,7 @@ var init_parser5 = __esm({
|
|
|
9594
9539
|
init_tag_groups();
|
|
9595
9540
|
init_parsing();
|
|
9596
9541
|
init_name_normalize();
|
|
9597
|
-
COLUMN_RE = /^\[(.+?)\](?:\s
|
|
9542
|
+
COLUMN_RE = /^\[(.+?)\](?:\s+(\S+))?(?:\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11}))?\s*(?:\|\s*(.+))?$/;
|
|
9598
9543
|
LEGACY_COLUMN_RE = /^==\s+(.+?)\s*(?:\[wip:\s*(\d+)\])?\s*==$/;
|
|
9599
9544
|
KNOWN_OPTIONS4 = /* @__PURE__ */ new Set(["hide", "active-tag"]);
|
|
9600
9545
|
KNOWN_BOOLEANS3 = /* @__PURE__ */ new Set([
|
|
@@ -9777,7 +9722,7 @@ function parseC4(content, palette) {
|
|
|
9777
9722
|
if (!color) {
|
|
9778
9723
|
pushError(
|
|
9779
9724
|
lineNumber,
|
|
9780
|
-
`Expected 'Value
|
|
9725
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9781
9726
|
);
|
|
9782
9727
|
continue;
|
|
9783
9728
|
}
|
|
@@ -10373,7 +10318,7 @@ __export(parser_exports7, {
|
|
|
10373
10318
|
looksLikeSitemap: () => looksLikeSitemap,
|
|
10374
10319
|
parseSitemap: () => parseSitemap
|
|
10375
10320
|
});
|
|
10376
|
-
function parseArrowLine(trimmed,
|
|
10321
|
+
function parseArrowLine(trimmed, _palette, _lineNumber, _diagnostics) {
|
|
10377
10322
|
const bareMatch = trimmed.match(BARE_ARROW_RE);
|
|
10378
10323
|
if (bareMatch) {
|
|
10379
10324
|
const rawTarget = bareMatch[1].trim();
|
|
@@ -10386,27 +10331,10 @@ function parseArrowLine(trimmed, palette, lineNumber, diagnostics) {
|
|
|
10386
10331
|
const arrowMatch = trimmed.match(ARROW_RE);
|
|
10387
10332
|
if (arrowMatch) {
|
|
10388
10333
|
const label = arrowMatch[1]?.trim() || void 0;
|
|
10389
|
-
|
|
10390
|
-
arrowMatch[2].trim(),
|
|
10391
|
-
lineNumber,
|
|
10392
|
-
diagnostics,
|
|
10393
|
-
palette
|
|
10394
|
-
) : void 0;
|
|
10395
|
-
if (label && !color) {
|
|
10396
|
-
const inferred = inferArrowColor(label);
|
|
10397
|
-
if (inferred)
|
|
10398
|
-
color = resolveColorWithDiagnostic(
|
|
10399
|
-
inferred,
|
|
10400
|
-
lineNumber,
|
|
10401
|
-
diagnostics,
|
|
10402
|
-
palette
|
|
10403
|
-
);
|
|
10404
|
-
}
|
|
10405
|
-
const rawTarget = arrowMatch[3].trim();
|
|
10334
|
+
const rawTarget = arrowMatch[2].trim();
|
|
10406
10335
|
const groupMatch = rawTarget.match(/^\[(.+)\]$/);
|
|
10407
10336
|
return {
|
|
10408
10337
|
label,
|
|
10409
|
-
color,
|
|
10410
10338
|
target: groupMatch ? groupMatch[1].trim() : rawTarget,
|
|
10411
10339
|
targetIsGroup: !!groupMatch
|
|
10412
10340
|
};
|
|
@@ -10548,7 +10476,7 @@ function parseSitemap(content, palette) {
|
|
|
10548
10476
|
if (!color) {
|
|
10549
10477
|
pushError(
|
|
10550
10478
|
lineNumber,
|
|
10551
|
-
`Expected 'Value
|
|
10479
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
10552
10480
|
);
|
|
10553
10481
|
continue;
|
|
10554
10482
|
}
|
|
@@ -10585,7 +10513,6 @@ function parseSitemap(content, palette) {
|
|
|
10585
10513
|
targetLabel: arrowInfo.target,
|
|
10586
10514
|
targetIsGroup: arrowInfo.targetIsGroup,
|
|
10587
10515
|
label: arrowInfo.label,
|
|
10588
|
-
color: arrowInfo.color,
|
|
10589
10516
|
lineNumber
|
|
10590
10517
|
});
|
|
10591
10518
|
}
|
|
@@ -10683,7 +10610,6 @@ function parseSitemap(content, palette) {
|
|
|
10683
10610
|
sourceId: arrow.sourceNode.id,
|
|
10684
10611
|
targetId: aliasHit,
|
|
10685
10612
|
label: arrow.label,
|
|
10686
|
-
color: arrow.color,
|
|
10687
10613
|
lineNumber: arrow.lineNumber
|
|
10688
10614
|
});
|
|
10689
10615
|
continue;
|
|
@@ -10703,7 +10629,6 @@ function parseSitemap(content, palette) {
|
|
|
10703
10629
|
sourceId: arrow.sourceNode.id,
|
|
10704
10630
|
targetId: targetContainer.id,
|
|
10705
10631
|
label: arrow.label,
|
|
10706
|
-
color: arrow.color,
|
|
10707
10632
|
lineNumber: arrow.lineNumber
|
|
10708
10633
|
});
|
|
10709
10634
|
} else {
|
|
@@ -10720,7 +10645,6 @@ function parseSitemap(content, palette) {
|
|
|
10720
10645
|
sourceId: arrow.sourceNode.id,
|
|
10721
10646
|
targetId: targetNode.id,
|
|
10722
10647
|
label: arrow.label,
|
|
10723
|
-
color: arrow.color,
|
|
10724
10648
|
lineNumber: arrow.lineNumber
|
|
10725
10649
|
});
|
|
10726
10650
|
}
|
|
@@ -10810,7 +10734,6 @@ var CONTAINER_RE3, METADATA_RE3, ARROW_RE, BARE_ARROW_RE;
|
|
|
10810
10734
|
var init_parser7 = __esm({
|
|
10811
10735
|
"src/sitemap/parser.ts"() {
|
|
10812
10736
|
"use strict";
|
|
10813
|
-
init_colors();
|
|
10814
10737
|
init_diagnostics();
|
|
10815
10738
|
init_name_normalize();
|
|
10816
10739
|
init_tag_groups();
|
|
@@ -10818,7 +10741,7 @@ var init_parser7 = __esm({
|
|
|
10818
10741
|
init_description_helpers();
|
|
10819
10742
|
CONTAINER_RE3 = /^\[([^\]]+)\]\s*(?:\|\s*(.+))?$/;
|
|
10820
10743
|
METADATA_RE3 = /^([^:]+):\s*(.+)$/;
|
|
10821
|
-
ARROW_RE = /^-([
|
|
10744
|
+
ARROW_RE = /^-([^>][^>]*?)?\s*->\s*(.+)$/;
|
|
10822
10745
|
BARE_ARROW_RE = /^->\s*(.+)$/;
|
|
10823
10746
|
}
|
|
10824
10747
|
});
|
|
@@ -11109,13 +11032,18 @@ function parseInfra(content) {
|
|
|
11109
11032
|
}
|
|
11110
11033
|
if (currentTagGroup && indent > 0) {
|
|
11111
11034
|
const { text: cleanEntry, isDefault } = stripDefaultModifier(trimmed);
|
|
11112
|
-
const
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11035
|
+
const lastSpaceIdx = cleanEntry.lastIndexOf(" ");
|
|
11036
|
+
let valueName = cleanEntry;
|
|
11037
|
+
let rawColor;
|
|
11038
|
+
if (lastSpaceIdx > 0) {
|
|
11039
|
+
const trailing = cleanEntry.substring(lastSpaceIdx + 1);
|
|
11040
|
+
if (isRecognizedColorName(trailing)) {
|
|
11041
|
+
rawColor = trailing;
|
|
11042
|
+
valueName = cleanEntry.substring(0, lastSpaceIdx).trimEnd();
|
|
11043
|
+
}
|
|
11044
|
+
}
|
|
11045
|
+
const tvMatch = valueName.match(TAG_VALUE_RE);
|
|
11046
|
+
if (tvMatch || /^\w+$/.test(valueName)) {
|
|
11119
11047
|
currentTagGroup.values.push({
|
|
11120
11048
|
name: valueName,
|
|
11121
11049
|
color: rawColor
|
|
@@ -11527,9 +11455,9 @@ var init_parser8 = __esm({
|
|
|
11527
11455
|
"use strict";
|
|
11528
11456
|
init_diagnostics();
|
|
11529
11457
|
init_description_helpers();
|
|
11530
|
-
init_colors();
|
|
11531
11458
|
init_arrows();
|
|
11532
11459
|
init_parsing();
|
|
11460
|
+
init_colors();
|
|
11533
11461
|
init_name_normalize();
|
|
11534
11462
|
init_tag_groups();
|
|
11535
11463
|
init_types();
|
|
@@ -11539,7 +11467,7 @@ var init_parser8 = __esm({
|
|
|
11539
11467
|
ASYNC_SIMPLE_CONNECTION_RE = /^~>\s*(.+?)\s*$/;
|
|
11540
11468
|
DEPRECATED_FANOUT_RE = /\bx(\d+)\s*$/;
|
|
11541
11469
|
GROUP_RE = /^\[([^\]]+)\]\s*(?:as\s+([A-Za-z][A-Za-z0-9_]{0,11})\s*)?(?:\|\s*(.+))?$/;
|
|
11542
|
-
TAG_VALUE_RE = /^(\w[\w\s]
|
|
11470
|
+
TAG_VALUE_RE = /^(\w[\w\s]+?)\s*$/;
|
|
11543
11471
|
COMPONENT_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":]*?))\s*(\|.*)?$/;
|
|
11544
11472
|
PIPE_META_RE = /[|,]\s*(\w+)\s*:\s*([^|,]+)/g;
|
|
11545
11473
|
PROPERTY_RE = /^([\w-]+)\s+(.+)$/;
|
|
@@ -12976,7 +12904,7 @@ function parsePert(content, parseOpts = {}) {
|
|
|
12976
12904
|
if (!color) {
|
|
12977
12905
|
warn(
|
|
12978
12906
|
lineNumber,
|
|
12979
|
-
`Expected 'Value
|
|
12907
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
12980
12908
|
);
|
|
12981
12909
|
continue;
|
|
12982
12910
|
}
|
|
@@ -12999,7 +12927,7 @@ function parsePert(content, parseOpts = {}) {
|
|
|
12999
12927
|
if (!color) {
|
|
13000
12928
|
warn(
|
|
13001
12929
|
lineNumber,
|
|
13002
|
-
`Expected 'Value
|
|
12930
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
13003
12931
|
);
|
|
13004
12932
|
continue;
|
|
13005
12933
|
}
|
|
@@ -14548,7 +14476,7 @@ function parseMindmap(content, palette) {
|
|
|
14548
14476
|
if (!color) {
|
|
14549
14477
|
pushError(
|
|
14550
14478
|
lineNumber,
|
|
14551
|
-
`Expected 'Value
|
|
14479
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
14552
14480
|
);
|
|
14553
14481
|
continue;
|
|
14554
14482
|
}
|
|
@@ -15134,7 +15062,7 @@ function parseWireframe(content) {
|
|
|
15134
15062
|
} else {
|
|
15135
15063
|
pushWarning(
|
|
15136
15064
|
lineNumber,
|
|
15137
|
-
`Expected 'Value
|
|
15065
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
15138
15066
|
);
|
|
15139
15067
|
}
|
|
15140
15068
|
continue;
|
|
@@ -15751,6 +15679,13 @@ function parseCycle(content) {
|
|
|
15751
15679
|
warn(lineNum, "Empty node label.");
|
|
15752
15680
|
continue;
|
|
15753
15681
|
}
|
|
15682
|
+
if (!metadata["color"]) {
|
|
15683
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
15684
|
+
if (shortcutColor) {
|
|
15685
|
+
metadata["color"] = shortcutColor;
|
|
15686
|
+
label = stripped;
|
|
15687
|
+
}
|
|
15688
|
+
}
|
|
15754
15689
|
const color = metadata["color"];
|
|
15755
15690
|
const spanStr = metadata["span"];
|
|
15756
15691
|
let span = 1;
|
|
@@ -15980,8 +15915,12 @@ function parseJourneyMap(content, palette) {
|
|
|
15980
15915
|
const key = part.substring(0, colonIdx).trim().toLowerCase();
|
|
15981
15916
|
const value = part.substring(colonIdx + 1).trim();
|
|
15982
15917
|
if (key === "color") {
|
|
15983
|
-
|
|
15984
|
-
|
|
15918
|
+
personaColor = resolveColorWithDiagnostic(
|
|
15919
|
+
value,
|
|
15920
|
+
lineNumber,
|
|
15921
|
+
result.diagnostics,
|
|
15922
|
+
palette
|
|
15923
|
+
) ?? void 0;
|
|
15985
15924
|
}
|
|
15986
15925
|
}
|
|
15987
15926
|
}
|
|
@@ -16039,7 +15978,7 @@ function parseJourneyMap(content, palette) {
|
|
|
16039
15978
|
if (!color) {
|
|
16040
15979
|
warn(
|
|
16041
15980
|
lineNumber,
|
|
16042
|
-
`Expected 'Value
|
|
15981
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
16043
15982
|
);
|
|
16044
15983
|
continue;
|
|
16045
15984
|
}
|
|
@@ -16282,6 +16221,7 @@ var PHASE_RE, SCORE_RE, ANNOTATION_RE, KNOWN_OPTIONS9, KNOWN_BOOLEANS6;
|
|
|
16282
16221
|
var init_parser16 = __esm({
|
|
16283
16222
|
"src/journey-map/parser.ts"() {
|
|
16284
16223
|
"use strict";
|
|
16224
|
+
init_colors();
|
|
16285
16225
|
init_diagnostics();
|
|
16286
16226
|
init_tag_groups();
|
|
16287
16227
|
init_parsing();
|
|
@@ -16380,6 +16320,13 @@ function parsePyramid(content) {
|
|
|
16380
16320
|
warn(lineNum, "Empty layer label.");
|
|
16381
16321
|
continue;
|
|
16382
16322
|
}
|
|
16323
|
+
if (!color) {
|
|
16324
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
16325
|
+
if (shortcutColor) {
|
|
16326
|
+
color = shortcutColor;
|
|
16327
|
+
label = stripped;
|
|
16328
|
+
}
|
|
16329
|
+
}
|
|
16383
16330
|
currentLayer = {
|
|
16384
16331
|
label,
|
|
16385
16332
|
lineNumber: lineNum,
|
|
@@ -16543,6 +16490,13 @@ function parseRing(content) {
|
|
|
16543
16490
|
warn(lineNum, "Empty layer label.");
|
|
16544
16491
|
continue;
|
|
16545
16492
|
}
|
|
16493
|
+
if (!color) {
|
|
16494
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
16495
|
+
if (shortcutColor) {
|
|
16496
|
+
color = shortcutColor;
|
|
16497
|
+
label = stripped;
|
|
16498
|
+
}
|
|
16499
|
+
}
|
|
16546
16500
|
currentLayer = {
|
|
16547
16501
|
label,
|
|
16548
16502
|
lineNumber: lineNum,
|
|
@@ -17037,7 +16991,7 @@ function parseRaci(content, palette) {
|
|
|
17037
16991
|
if (next.length > 0 && next[0] !== " " && next[0] !== " ") break;
|
|
17038
16992
|
const stripped = nextTrim.replace(/,\s*$/, "");
|
|
17039
16993
|
const segments = stripped.split("|").map((s) => s.trim());
|
|
17040
|
-
|
|
16994
|
+
let roleLabel = segments[0] ?? "";
|
|
17041
16995
|
let roleColor;
|
|
17042
16996
|
if (segments.length > 1) {
|
|
17043
16997
|
const meta = parsePipeMetadata(segments);
|
|
@@ -17050,6 +17004,18 @@ function parseRaci(content, palette) {
|
|
|
17050
17004
|
);
|
|
17051
17005
|
}
|
|
17052
17006
|
}
|
|
17007
|
+
if (!roleColor) {
|
|
17008
|
+
const { label: stripLabel, colorName: shortcutColor } = peelTrailingColorName(roleLabel);
|
|
17009
|
+
if (shortcutColor) {
|
|
17010
|
+
roleColor = resolveColorWithDiagnostic(
|
|
17011
|
+
shortcutColor,
|
|
17012
|
+
j + 1,
|
|
17013
|
+
result.diagnostics,
|
|
17014
|
+
palette
|
|
17015
|
+
);
|
|
17016
|
+
roleLabel = stripLabel;
|
|
17017
|
+
}
|
|
17018
|
+
}
|
|
17053
17019
|
if (roleLabel) getOrAddRole(roleLabel, j + 1, roleColor);
|
|
17054
17020
|
}
|
|
17055
17021
|
i = j - 1;
|
|
@@ -17108,8 +17074,10 @@ function parseRaci(content, palette) {
|
|
|
17108
17074
|
continue;
|
|
17109
17075
|
}
|
|
17110
17076
|
let phaseColor;
|
|
17111
|
-
|
|
17112
|
-
|
|
17077
|
+
const trailingToken = phaseMatch[2];
|
|
17078
|
+
const pipeMeta = phaseMatch[3];
|
|
17079
|
+
if (pipeMeta) {
|
|
17080
|
+
const meta = parsePipeMetadata(["", pipeMeta]);
|
|
17113
17081
|
if (meta["color"]) {
|
|
17114
17082
|
phaseColor = resolveColorWithDiagnostic(
|
|
17115
17083
|
meta["color"],
|
|
@@ -17119,6 +17087,17 @@ function parseRaci(content, palette) {
|
|
|
17119
17087
|
);
|
|
17120
17088
|
}
|
|
17121
17089
|
}
|
|
17090
|
+
if (!phaseColor && trailingToken) {
|
|
17091
|
+
const { colorName } = peelTrailingColorName(`x ${trailingToken}`);
|
|
17092
|
+
if (colorName) {
|
|
17093
|
+
phaseColor = resolveColorWithDiagnostic(
|
|
17094
|
+
colorName,
|
|
17095
|
+
lineNumber,
|
|
17096
|
+
result.diagnostics,
|
|
17097
|
+
palette
|
|
17098
|
+
);
|
|
17099
|
+
}
|
|
17100
|
+
}
|
|
17122
17101
|
currentPhase = {
|
|
17123
17102
|
id: normalizeName(display),
|
|
17124
17103
|
displayName: display,
|
|
@@ -17349,7 +17328,7 @@ var init_parser19 = __esm({
|
|
|
17349
17328
|
"no-title",
|
|
17350
17329
|
...Object.keys(VARIANT_LOCK_DIRECTIVES)
|
|
17351
17330
|
]);
|
|
17352
|
-
PHASE_RE2 = /^\[(.+?)\]
|
|
17331
|
+
PHASE_RE2 = /^\[(.+?)\](?:\s+(\S+))?(?:\s*\|\s*(.+))?\s*$/;
|
|
17353
17332
|
ROLE_ASSIGNMENT_RE = /^([^:]+):\s*(.*)$/;
|
|
17354
17333
|
}
|
|
17355
17334
|
});
|
|
@@ -19066,7 +19045,7 @@ function containerFill(palette, isDark, nodeColor2) {
|
|
|
19066
19045
|
function containerStroke(palette, nodeColor2) {
|
|
19067
19046
|
return nodeColor2 ?? palette.textMuted;
|
|
19068
19047
|
}
|
|
19069
|
-
function renderOrg(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, ancestorPath) {
|
|
19048
|
+
function renderOrg(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, ancestorPath, exportMode) {
|
|
19070
19049
|
d3Selection.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
19071
19050
|
const width = exportDims?.width ?? container.clientWidth;
|
|
19072
19051
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -19326,7 +19305,7 @@ function renderOrg(container, parsed, layout, palette, isDark, onClickItem, expo
|
|
|
19326
19305
|
}
|
|
19327
19306
|
],
|
|
19328
19307
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
19329
|
-
mode: "
|
|
19308
|
+
mode: exportMode ? "export" : "preview"
|
|
19330
19309
|
};
|
|
19331
19310
|
const singleState = { activeGroup: lg.name };
|
|
19332
19311
|
const groupG = legendParentBase.append("g").attr("transform", `translate(${lg.x}, ${lg.y})`);
|
|
@@ -19346,7 +19325,7 @@ function renderOrg(container, parsed, layout, palette, isDark, onClickItem, expo
|
|
|
19346
19325
|
const legendConfig = {
|
|
19347
19326
|
groups,
|
|
19348
19327
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
19349
|
-
mode: "
|
|
19328
|
+
mode: exportMode ? "export" : "preview",
|
|
19350
19329
|
capsulePillAddonWidth: eyeAddonWidth
|
|
19351
19330
|
};
|
|
19352
19331
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
@@ -19813,7 +19792,6 @@ function layoutSitemap(parsed, hiddenCounts, activeTagGroup, hiddenAttributes, e
|
|
|
19813
19792
|
targetId: edge.targetId,
|
|
19814
19793
|
points,
|
|
19815
19794
|
label: edge.label,
|
|
19816
|
-
color: edge.color,
|
|
19817
19795
|
lineNumber: edge.lineNumber,
|
|
19818
19796
|
deferred: deferredSet.has(i) || void 0
|
|
19819
19797
|
});
|
|
@@ -20270,7 +20248,7 @@ function containerFill2(palette, isDark, nodeColor2) {
|
|
|
20270
20248
|
function containerStroke2(palette, nodeColor2) {
|
|
20271
20249
|
return nodeColor2 ?? palette.textMuted;
|
|
20272
20250
|
}
|
|
20273
|
-
function renderSitemap(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes) {
|
|
20251
|
+
function renderSitemap(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, exportMode) {
|
|
20274
20252
|
d3Selection2.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
20275
20253
|
const width = exportDims?.width ?? container.clientWidth;
|
|
20276
20254
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -20301,9 +20279,6 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20301
20279
|
const defs = svg.append("defs");
|
|
20302
20280
|
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);
|
|
20303
20281
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
20304
|
-
for (const edge of layout.edges) {
|
|
20305
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
20306
|
-
}
|
|
20307
20282
|
for (const color of edgeColors) {
|
|
20308
20283
|
const id = `sm-arrow-${color.replace("#", "")}`;
|
|
20309
20284
|
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);
|
|
@@ -20382,8 +20357,8 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20382
20357
|
for (const edge of layout.edges) {
|
|
20383
20358
|
if (edge.points.length < 2) continue;
|
|
20384
20359
|
const edgeG = contentG.append("g").attr("class", "sitemap-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
20385
|
-
const edgeColor3 =
|
|
20386
|
-
const markerId =
|
|
20360
|
+
const edgeColor3 = palette.textMuted;
|
|
20361
|
+
const markerId = "sm-arrow";
|
|
20387
20362
|
const gen = edge.deferred ? lineGeneratorLinear : lineGenerator;
|
|
20388
20363
|
const pathD = gen(edge.points);
|
|
20389
20364
|
if (pathD) {
|
|
@@ -20464,7 +20439,8 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20464
20439
|
isDark,
|
|
20465
20440
|
activeTagGroup,
|
|
20466
20441
|
void 0,
|
|
20467
|
-
hiddenAttributes
|
|
20442
|
+
hiddenAttributes,
|
|
20443
|
+
exportMode
|
|
20468
20444
|
);
|
|
20469
20445
|
}
|
|
20470
20446
|
if (fixedTitle) {
|
|
@@ -20489,11 +20465,12 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20489
20465
|
isDark,
|
|
20490
20466
|
activeTagGroup,
|
|
20491
20467
|
width,
|
|
20492
|
-
hiddenAttributes
|
|
20468
|
+
hiddenAttributes,
|
|
20469
|
+
exportMode
|
|
20493
20470
|
);
|
|
20494
20471
|
}
|
|
20495
20472
|
}
|
|
20496
|
-
function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fixedWidth, hiddenAttributes) {
|
|
20473
|
+
function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fixedWidth, hiddenAttributes, exportMode) {
|
|
20497
20474
|
if (legendGroups.length === 0) return;
|
|
20498
20475
|
const groups = legendGroups.map((g) => ({
|
|
20499
20476
|
name: g.name,
|
|
@@ -20504,7 +20481,7 @@ function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fix
|
|
|
20504
20481
|
const legendConfig = {
|
|
20505
20482
|
groups,
|
|
20506
20483
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
20507
|
-
mode: "
|
|
20484
|
+
mode: exportMode ? "export" : "preview",
|
|
20508
20485
|
capsulePillAddonWidth: eyeAddonWidth
|
|
20509
20486
|
};
|
|
20510
20487
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
@@ -20789,7 +20766,7 @@ function renderKanban(container, parsed, palette, isDark, options) {
|
|
|
20789
20766
|
const legendConfig = {
|
|
20790
20767
|
groups: parsed.tagGroups,
|
|
20791
20768
|
position: { placement: "top-center", titleRelation: "inline-with-title" },
|
|
20792
|
-
mode:
|
|
20769
|
+
mode: options?.exportMode ? "export" : "preview"
|
|
20793
20770
|
};
|
|
20794
20771
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
20795
20772
|
const legendG = svg.append("g").attr("class", "kanban-legend").attr("transform", `translate(${legendX},${legendY})`);
|
|
@@ -20947,7 +20924,8 @@ function renderKanbanForExport(content, theme, palette) {
|
|
|
20947
20924
|
const layout = computeLayout(parsed, palette);
|
|
20948
20925
|
const container = document.createElement("div");
|
|
20949
20926
|
renderKanban(container, parsed, palette, isDark, {
|
|
20950
|
-
exportDims: { width: layout.totalWidth, height: layout.totalHeight }
|
|
20927
|
+
exportDims: { width: layout.totalWidth, height: layout.totalHeight },
|
|
20928
|
+
exportMode: true
|
|
20951
20929
|
});
|
|
20952
20930
|
const svgEl = container.querySelector("svg");
|
|
20953
20931
|
return svgEl?.outerHTML ?? "";
|
|
@@ -21486,7 +21464,7 @@ function markerIdForType(type) {
|
|
|
21486
21464
|
function isSourceMarker(type) {
|
|
21487
21465
|
return type === "composes" || type === "aggregates";
|
|
21488
21466
|
}
|
|
21489
|
-
function renderClassDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, legendActive) {
|
|
21467
|
+
function renderClassDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, legendActive, exportMode) {
|
|
21490
21468
|
d3Selection4.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
21491
21469
|
const width = exportDims?.width ?? container.clientWidth;
|
|
21492
21470
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -21548,7 +21526,7 @@ function renderClassDiagram(container, parsed, layout, palette, isDark, onClickI
|
|
|
21548
21526
|
const legendConfig = {
|
|
21549
21527
|
groups: legendGroups,
|
|
21550
21528
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
21551
|
-
mode: "
|
|
21529
|
+
mode: exportMode ? "export" : "preview"
|
|
21552
21530
|
};
|
|
21553
21531
|
const legendState = {
|
|
21554
21532
|
activeGroup: isLegendExpanded ? LEGEND_GROUP_NAME : null
|
|
@@ -21688,10 +21666,22 @@ function renderClassDiagramForExport(content, theme, palette) {
|
|
|
21688
21666
|
const exportWidth = layout.width + DIAGRAM_PADDING4 * 2;
|
|
21689
21667
|
const exportHeight = layout.height + DIAGRAM_PADDING4 * 2 + (parsed.title ? 40 : 0) + legendReserve;
|
|
21690
21668
|
return runInExportContainer(exportWidth, exportHeight, (container) => {
|
|
21691
|
-
renderClassDiagram(
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21669
|
+
renderClassDiagram(
|
|
21670
|
+
container,
|
|
21671
|
+
parsed,
|
|
21672
|
+
layout,
|
|
21673
|
+
palette,
|
|
21674
|
+
isDark,
|
|
21675
|
+
void 0,
|
|
21676
|
+
{
|
|
21677
|
+
width: exportWidth,
|
|
21678
|
+
height: exportHeight
|
|
21679
|
+
},
|
|
21680
|
+
true,
|
|
21681
|
+
// legendActive for export
|
|
21682
|
+
true
|
|
21683
|
+
// exportMode
|
|
21684
|
+
);
|
|
21695
21685
|
return extractExportSvg(container, theme);
|
|
21696
21686
|
});
|
|
21697
21687
|
}
|
|
@@ -22167,7 +22157,7 @@ function drawCardinality(g, point, prevPoint, cardinality, color, useLabels) {
|
|
|
22167
22157
|
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);
|
|
22168
22158
|
}
|
|
22169
22159
|
}
|
|
22170
|
-
function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, semanticColorsActive) {
|
|
22160
|
+
function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, semanticColorsActive, exportMode) {
|
|
22171
22161
|
d3Selection5.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
22172
22162
|
const useSemanticColors = parsed.tagGroups.length === 0 && layout.nodes.every((n) => !n.color);
|
|
22173
22163
|
const LEGEND_FIXED_GAP4 = 8;
|
|
@@ -22323,7 +22313,7 @@ function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem
|
|
|
22323
22313
|
const legendConfig = {
|
|
22324
22314
|
groups: parsed.tagGroups,
|
|
22325
22315
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22326
|
-
mode: "
|
|
22316
|
+
mode: exportMode ? "export" : "preview"
|
|
22327
22317
|
};
|
|
22328
22318
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
22329
22319
|
const legendG = svg.append("g").attr("class", "er-tag-legend").attr("transform", `translate(0,${legendY})`);
|
|
@@ -22359,7 +22349,7 @@ function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem
|
|
|
22359
22349
|
const legendConfig = {
|
|
22360
22350
|
groups: semanticGroups,
|
|
22361
22351
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22362
|
-
mode: "
|
|
22352
|
+
mode: exportMode ? "export" : "preview"
|
|
22363
22353
|
};
|
|
22364
22354
|
const legendState = {
|
|
22365
22355
|
activeGroup: semanticActive ? "Role" : null
|
|
@@ -22392,10 +22382,21 @@ function renderERDiagramForExport(content, theme, palette) {
|
|
|
22392
22382
|
container.style.left = "-9999px";
|
|
22393
22383
|
document.body.appendChild(container);
|
|
22394
22384
|
try {
|
|
22395
|
-
renderERDiagram(
|
|
22396
|
-
|
|
22397
|
-
|
|
22398
|
-
|
|
22385
|
+
renderERDiagram(
|
|
22386
|
+
container,
|
|
22387
|
+
parsed,
|
|
22388
|
+
layout,
|
|
22389
|
+
palette,
|
|
22390
|
+
isDark,
|
|
22391
|
+
void 0,
|
|
22392
|
+
{
|
|
22393
|
+
width: exportWidth,
|
|
22394
|
+
height: exportHeight
|
|
22395
|
+
},
|
|
22396
|
+
void 0,
|
|
22397
|
+
void 0,
|
|
22398
|
+
true
|
|
22399
|
+
);
|
|
22399
22400
|
const svgEl = container.querySelector("svg");
|
|
22400
22401
|
if (!svgEl) return "";
|
|
22401
22402
|
if (theme === "transparent") {
|
|
@@ -22630,7 +22631,8 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
|
|
|
22630
22631
|
hideDescriptions,
|
|
22631
22632
|
controlsExpanded,
|
|
22632
22633
|
onToggleDescriptions,
|
|
22633
|
-
onToggleControlsExpand
|
|
22634
|
+
onToggleControlsExpand,
|
|
22635
|
+
exportMode = false
|
|
22634
22636
|
} = options ?? {};
|
|
22635
22637
|
d3Selection6.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
22636
22638
|
const width = exportDims?.width ?? container.clientWidth;
|
|
@@ -22966,7 +22968,7 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
|
|
|
22966
22968
|
const legendConfig = {
|
|
22967
22969
|
groups: parsed.tagGroups,
|
|
22968
22970
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22969
|
-
mode: "
|
|
22971
|
+
mode: exportMode ? "export" : "preview",
|
|
22970
22972
|
controlsGroup
|
|
22971
22973
|
};
|
|
22972
22974
|
const legendState = {
|
|
@@ -22998,7 +23000,8 @@ function renderBoxesAndLinesForExport(container, parsed, layout, palette, isDark
|
|
|
22998
23000
|
renderBoxesAndLines(container, parsed, layout, palette, isDark, {
|
|
22999
23001
|
exportDims: options?.exportDims,
|
|
23000
23002
|
activeTagGroup: options?.activeTagGroup,
|
|
23001
|
-
hiddenTagValues: options?.hiddenTagValues
|
|
23003
|
+
hiddenTagValues: options?.hiddenTagValues,
|
|
23004
|
+
exportMode: options?.exportMode
|
|
23002
23005
|
});
|
|
23003
23006
|
}
|
|
23004
23007
|
var 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;
|
|
@@ -24235,7 +24238,7 @@ function renderMindmap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
24235
24238
|
};
|
|
24236
24239
|
}),
|
|
24237
24240
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
24238
|
-
mode: "
|
|
24241
|
+
mode: options?.exportMode ? "export" : "preview",
|
|
24239
24242
|
controlsGroup: controlsToggles
|
|
24240
24243
|
};
|
|
24241
24244
|
const legendState = {
|
|
@@ -27038,7 +27041,7 @@ function drawPersonIcon(g, cx, cy, color) {
|
|
|
27038
27041
|
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);
|
|
27039
27042
|
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);
|
|
27040
27043
|
}
|
|
27041
|
-
function renderC4Context(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
27044
|
+
function renderC4Context(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27042
27045
|
d3Selection9.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
27043
27046
|
const width = exportDims?.width ?? container.clientWidth;
|
|
27044
27047
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -27214,7 +27217,8 @@ function renderC4Context(container, parsed, layout, palette, isDark, onClickItem
|
|
|
27214
27217
|
palette,
|
|
27215
27218
|
isDark,
|
|
27216
27219
|
activeTagGroup,
|
|
27217
|
-
fixedLegend ? width : null
|
|
27220
|
+
fixedLegend ? width : null,
|
|
27221
|
+
exportMode
|
|
27218
27222
|
);
|
|
27219
27223
|
}
|
|
27220
27224
|
}
|
|
@@ -27569,7 +27573,7 @@ function placeEdgeLabels(labels, edges, obstacleRects) {
|
|
|
27569
27573
|
placedRects.push({ x: lbl.x, y: lbl.y, w: lbl.bgW, h: lbl.bgH });
|
|
27570
27574
|
}
|
|
27571
27575
|
}
|
|
27572
|
-
function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWidth) {
|
|
27576
|
+
function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWidth, exportMode) {
|
|
27573
27577
|
const groups = layout.legend.map((g) => ({
|
|
27574
27578
|
name: g.name,
|
|
27575
27579
|
entries: g.entries.map((e) => ({ value: e.value, color: e.color }))
|
|
@@ -27577,7 +27581,7 @@ function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWid
|
|
|
27577
27581
|
const legendConfig = {
|
|
27578
27582
|
groups,
|
|
27579
27583
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
27580
|
-
mode: "
|
|
27584
|
+
mode: exportMode ? "export" : "preview"
|
|
27581
27585
|
};
|
|
27582
27586
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
27583
27587
|
const containerWidth = fixedWidth ?? layout.width;
|
|
@@ -27592,7 +27596,7 @@ function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWid
|
|
|
27592
27596
|
);
|
|
27593
27597
|
parent.selectAll("[data-legend-group]").classed("c4-legend-group", true);
|
|
27594
27598
|
}
|
|
27595
|
-
function renderC4Containers(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
27599
|
+
function renderC4Containers(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27596
27600
|
d3Selection9.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
27597
27601
|
const width = exportDims?.width ?? container.clientWidth;
|
|
27598
27602
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -27823,7 +27827,8 @@ function renderC4Containers(container, parsed, layout, palette, isDark, onClickI
|
|
|
27823
27827
|
palette,
|
|
27824
27828
|
isDark,
|
|
27825
27829
|
activeTagGroup,
|
|
27826
|
-
fixedLegend ? width : null
|
|
27830
|
+
fixedLegend ? width : null,
|
|
27831
|
+
exportMode
|
|
27827
27832
|
);
|
|
27828
27833
|
}
|
|
27829
27834
|
}
|
|
@@ -27891,7 +27896,7 @@ function renderC4ComponentsForExport(content, systemName, containerName, theme,
|
|
|
27891
27896
|
document.body.removeChild(el);
|
|
27892
27897
|
}
|
|
27893
27898
|
}
|
|
27894
|
-
function renderC4Deployment(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
27899
|
+
function renderC4Deployment(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27895
27900
|
renderC4Containers(
|
|
27896
27901
|
container,
|
|
27897
27902
|
parsed,
|
|
@@ -27900,7 +27905,8 @@ function renderC4Deployment(container, parsed, layout, palette, isDark, onClickI
|
|
|
27900
27905
|
isDark,
|
|
27901
27906
|
onClickItem,
|
|
27902
27907
|
exportDims,
|
|
27903
|
-
activeTagGroup
|
|
27908
|
+
activeTagGroup,
|
|
27909
|
+
exportMode
|
|
27904
27910
|
);
|
|
27905
27911
|
}
|
|
27906
27912
|
function renderC4DeploymentForExport(content, theme, palette) {
|
|
@@ -28081,7 +28087,6 @@ function layoutGraph(graph, options) {
|
|
|
28081
28087
|
target: edge.target,
|
|
28082
28088
|
points: edgeData?.points ?? [],
|
|
28083
28089
|
label: edge.label,
|
|
28084
|
-
color: edge.color,
|
|
28085
28090
|
lineNumber: edge.lineNumber
|
|
28086
28091
|
};
|
|
28087
28092
|
});
|
|
@@ -28405,9 +28410,6 @@ function renderFlowchart(container, graph, layout, palette, isDark, onClickItem,
|
|
|
28405
28410
|
const defs = svg.append("defs");
|
|
28406
28411
|
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);
|
|
28407
28412
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
28408
|
-
for (const edge of layout.edges) {
|
|
28409
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
28410
|
-
}
|
|
28411
28413
|
for (const color of edgeColors) {
|
|
28412
28414
|
const id = `fc-arrow-${color.replace("#", "")}`;
|
|
28413
28415
|
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);
|
|
@@ -28471,8 +28473,8 @@ function renderFlowchart(container, graph, layout, palette, isDark, onClickItem,
|
|
|
28471
28473
|
const edge = layout.edges[ei];
|
|
28472
28474
|
if (edge.points.length < 2) continue;
|
|
28473
28475
|
const edgeG = contentG.append("g").attr("class", "fc-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
28474
|
-
const edgeColor3 =
|
|
28475
|
-
const markerId =
|
|
28476
|
+
const edgeColor3 = palette.textMuted;
|
|
28477
|
+
const markerId = "fc-arrow";
|
|
28476
28478
|
const pathD = lineGenerator5(edge.points);
|
|
28477
28479
|
if (pathD) {
|
|
28478
28480
|
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");
|
|
@@ -31096,7 +31098,7 @@ function computeInfraLegendGroups(nodes, tagGroups, palette, edges) {
|
|
|
31096
31098
|
}
|
|
31097
31099
|
return groups;
|
|
31098
31100
|
}
|
|
31099
|
-
function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDark, activeGroup, playback) {
|
|
31101
|
+
function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDark, activeGroup, playback, exportMode = false) {
|
|
31100
31102
|
if (legendGroups.length === 0 && !playback) return;
|
|
31101
31103
|
const legendG = rootSvg.append("g").attr("transform", `translate(0, ${legendY})`);
|
|
31102
31104
|
if (activeGroup) {
|
|
@@ -31112,7 +31114,7 @@ function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDa
|
|
|
31112
31114
|
const legendConfig = {
|
|
31113
31115
|
groups: allGroups,
|
|
31114
31116
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
31115
|
-
mode: "
|
|
31117
|
+
mode: exportMode ? "export" : "preview",
|
|
31116
31118
|
showEmptyGroups: true
|
|
31117
31119
|
};
|
|
31118
31120
|
const legendState = { activeGroup };
|
|
@@ -31300,7 +31302,8 @@ function renderInfra(container, layout, palette, isDark, title, titleLineNumber,
|
|
|
31300
31302
|
palette,
|
|
31301
31303
|
isDark,
|
|
31302
31304
|
activeGroup ?? null,
|
|
31303
|
-
playback ?? void 0
|
|
31305
|
+
playback ?? void 0,
|
|
31306
|
+
exportMode
|
|
31304
31307
|
);
|
|
31305
31308
|
legendSvg.selectAll(".infra-legend-group").style("pointer-events", "auto");
|
|
31306
31309
|
} else {
|
|
@@ -31312,7 +31315,8 @@ function renderInfra(container, layout, palette, isDark, title, titleLineNumber,
|
|
|
31312
31315
|
palette,
|
|
31313
31316
|
isDark,
|
|
31314
31317
|
activeGroup ?? null,
|
|
31315
|
-
playback ?? void 0
|
|
31318
|
+
playback ?? void 0,
|
|
31319
|
+
exportMode
|
|
31316
31320
|
);
|
|
31317
31321
|
}
|
|
31318
31322
|
}
|
|
@@ -33211,7 +33215,8 @@ function renderPert(container, resolved, layout, palette, isDark, options = {})
|
|
|
33211
33215
|
x: 0,
|
|
33212
33216
|
y: tagLegendY,
|
|
33213
33217
|
width: exportWidth,
|
|
33214
|
-
activeGroup: tagLegendActive
|
|
33218
|
+
activeGroup: tagLegendActive,
|
|
33219
|
+
exportMode: options.exportMode
|
|
33215
33220
|
});
|
|
33216
33221
|
}
|
|
33217
33222
|
const root = svg.append("g").attr("transform", `translate(${offsetX}, ${offsetY})`);
|
|
@@ -33272,7 +33277,8 @@ function renderPertForExport(content, theme, palette, now) {
|
|
|
33272
33277
|
renderPert(container, resolved, layout, palette, isDark, {
|
|
33273
33278
|
title: hasTitle ? parsed.title : null,
|
|
33274
33279
|
subtitle: resolved.projectSubtitle,
|
|
33275
|
-
exportDims: { width: exportWidth, height: exportHeight }
|
|
33280
|
+
exportDims: { width: exportWidth, height: exportHeight },
|
|
33281
|
+
exportMode: true
|
|
33276
33282
|
});
|
|
33277
33283
|
const svgEl = container.querySelector("svg");
|
|
33278
33284
|
if (!svgEl) return "";
|
|
@@ -34359,7 +34365,7 @@ function renderLegendBlock(svg, entries, args) {
|
|
|
34359
34365
|
}
|
|
34360
34366
|
function renderTagLegendRow(svg, resolved, palette, isDark, args) {
|
|
34361
34367
|
if (resolved.tagGroups.length === 0) return;
|
|
34362
|
-
const { x, y, width, activeGroup } = args;
|
|
34368
|
+
const { x, y, width, activeGroup, exportMode } = args;
|
|
34363
34369
|
const groups = resolved.tagGroups.map((g) => ({
|
|
34364
34370
|
name: g.name,
|
|
34365
34371
|
entries: g.entries.map((e) => ({ value: e.value, color: e.color }))
|
|
@@ -34370,7 +34376,7 @@ function renderTagLegendRow(svg, resolved, palette, isDark, args) {
|
|
|
34370
34376
|
{
|
|
34371
34377
|
groups,
|
|
34372
34378
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
34373
|
-
mode: "
|
|
34379
|
+
mode: exportMode ? "export" : "preview"
|
|
34374
34380
|
},
|
|
34375
34381
|
{ activeGroup },
|
|
34376
34382
|
palette,
|
|
@@ -35810,7 +35816,8 @@ function renderGantt(container, resolved, palette, isDark, options, exportDims)
|
|
|
35810
35816
|
).attr("display", active ? null : "none");
|
|
35811
35817
|
}
|
|
35812
35818
|
drawLegend();
|
|
35813
|
-
}
|
|
35819
|
+
},
|
|
35820
|
+
options?.exportMode ?? false
|
|
35814
35821
|
);
|
|
35815
35822
|
}
|
|
35816
35823
|
}
|
|
@@ -36599,7 +36606,7 @@ function buildControlsToggles(hasCriticalPath, criticalPathActive, hasDependenci
|
|
|
36599
36606
|
}
|
|
36600
36607
|
return toggles;
|
|
36601
36608
|
}
|
|
36602
|
-
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) {
|
|
36609
|
+
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) {
|
|
36603
36610
|
let visibleGroups;
|
|
36604
36611
|
if (activeGroupName) {
|
|
36605
36612
|
const activeGroup = tagGroups.filter(
|
|
@@ -36694,7 +36701,7 @@ function renderTagLegend(svg, chartG, tagGroups, activeGroupName, chartLeftMargi
|
|
|
36694
36701
|
placement: "top-center",
|
|
36695
36702
|
titleRelation: "below-title"
|
|
36696
36703
|
},
|
|
36697
|
-
mode: "
|
|
36704
|
+
mode: exportMode ? "export" : "preview",
|
|
36698
36705
|
capsulePillAddonWidth: iconReserve,
|
|
36699
36706
|
controlsGroup: controlsToggles.length > 0 ? { toggles: controlsToggles } : void 0
|
|
36700
36707
|
};
|
|
@@ -36801,7 +36808,7 @@ function renderTagLegend(svg, chartG, tagGroups, activeGroupName, chartLeftMargi
|
|
|
36801
36808
|
placement: "top-center",
|
|
36802
36809
|
titleRelation: "below-title"
|
|
36803
36810
|
},
|
|
36804
|
-
mode: "
|
|
36811
|
+
mode: exportMode ? "export" : "preview",
|
|
36805
36812
|
controlsGroup: { toggles: controlsToggles }
|
|
36806
36813
|
};
|
|
36807
36814
|
const tagGroupG = legendRow.append("g");
|
|
@@ -37684,9 +37691,6 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
|
|
|
37684
37691
|
const defs = svg.append("defs");
|
|
37685
37692
|
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);
|
|
37686
37693
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
37687
|
-
for (const edge of layout.edges) {
|
|
37688
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
37689
|
-
}
|
|
37690
37694
|
for (const color of edgeColors) {
|
|
37691
37695
|
const id = `st-arrow-${color.replace("#", "")}`;
|
|
37692
37696
|
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);
|
|
@@ -37781,8 +37785,8 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
|
|
|
37781
37785
|
for (let ei = 0; ei < layout.edges.length; ei++) {
|
|
37782
37786
|
const edge = layout.edges[ei];
|
|
37783
37787
|
const edgeG = contentG.append("g").attr("class", "st-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
37784
|
-
const edgeColor3 =
|
|
37785
|
-
const markerId =
|
|
37788
|
+
const edgeColor3 = palette.textMuted;
|
|
37789
|
+
const markerId = "st-arrow";
|
|
37786
37790
|
if (edge.source === edge.target) {
|
|
37787
37791
|
const node = nodePositionMap.get(edge.source);
|
|
37788
37792
|
if (node) {
|
|
@@ -38651,7 +38655,7 @@ function renderTechRadar(container, parsed, palette, isDark, onClickItem, export
|
|
|
38651
38655
|
}
|
|
38652
38656
|
],
|
|
38653
38657
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
38654
|
-
mode: "
|
|
38658
|
+
mode: options?.exportMode ? "export" : "preview",
|
|
38655
38659
|
controlsGroup: {
|
|
38656
38660
|
toggles: [
|
|
38657
38661
|
{
|
|
@@ -39254,7 +39258,7 @@ function getQuadrantLabelPosition(position, cx, cy, maxRadius) {
|
|
|
39254
39258
|
};
|
|
39255
39259
|
}
|
|
39256
39260
|
}
|
|
39257
|
-
function renderTechRadarForExport(container, parsed, palette, isDark, exportDims, viewState) {
|
|
39261
|
+
function renderTechRadarForExport(container, parsed, palette, isDark, exportDims, viewState, exportMode) {
|
|
39258
39262
|
renderTechRadar(
|
|
39259
39263
|
container,
|
|
39260
39264
|
parsed,
|
|
@@ -39262,7 +39266,8 @@ function renderTechRadarForExport(container, parsed, palette, isDark, exportDims
|
|
|
39262
39266
|
isDark,
|
|
39263
39267
|
void 0,
|
|
39264
39268
|
exportDims,
|
|
39265
|
-
viewState
|
|
39269
|
+
viewState,
|
|
39270
|
+
{ exportMode }
|
|
39266
39271
|
);
|
|
39267
39272
|
}
|
|
39268
39273
|
var 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;
|
|
@@ -39642,7 +39647,7 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
|
|
|
39642
39647
|
titleRelation: "inline-with-title"
|
|
39643
39648
|
},
|
|
39644
39649
|
titleWidth: 0,
|
|
39645
|
-
mode:
|
|
39650
|
+
mode: options?.exportMode ? "export" : "preview"
|
|
39646
39651
|
};
|
|
39647
39652
|
const legendState = { activeGroup: effectiveActiveGroup };
|
|
39648
39653
|
const legendCallbacks = {
|
|
@@ -40355,7 +40360,8 @@ function renderJourneyMapForExport(content, theme, palette) {
|
|
|
40355
40360
|
const layout = layoutJourneyMap(parsed, palette, { isDark });
|
|
40356
40361
|
const container = document.createElement("div");
|
|
40357
40362
|
renderJourneyMap(container, parsed, palette, isDark, {
|
|
40358
|
-
exportDims: { width: layout.totalWidth, height: layout.totalHeight }
|
|
40363
|
+
exportDims: { width: layout.totalWidth, height: layout.totalHeight },
|
|
40364
|
+
exportMode: true
|
|
40359
40365
|
});
|
|
40360
40366
|
const svgEl = container.querySelector("svg");
|
|
40361
40367
|
if (!svgEl) return "";
|
|
@@ -41120,7 +41126,7 @@ function renderCycle(container, parsed, palette, isDark, onClickItem, exportDims
|
|
|
41120
41126
|
const legendConfig = {
|
|
41121
41127
|
groups: [],
|
|
41122
41128
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
41123
|
-
mode: "
|
|
41129
|
+
mode: renderOptions?.exportMode ? "export" : "preview",
|
|
41124
41130
|
controlsGroup
|
|
41125
41131
|
};
|
|
41126
41132
|
const legendState = {
|
|
@@ -41304,7 +41310,7 @@ function renderCycle(container, parsed, palette, isDark, onClickItem, exportDims
|
|
|
41304
41310
|
}
|
|
41305
41311
|
}
|
|
41306
41312
|
}
|
|
41307
|
-
function renderCycleForExport(container, parsed, palette, isDark, exportDims, viewState) {
|
|
41313
|
+
function renderCycleForExport(container, parsed, palette, isDark, exportDims, viewState, exportMode) {
|
|
41308
41314
|
renderCycle(
|
|
41309
41315
|
container,
|
|
41310
41316
|
parsed,
|
|
@@ -41312,7 +41318,8 @@ function renderCycleForExport(container, parsed, palette, isDark, exportDims, vi
|
|
|
41312
41318
|
isDark,
|
|
41313
41319
|
void 0,
|
|
41314
41320
|
exportDims,
|
|
41315
|
-
viewState
|
|
41321
|
+
viewState,
|
|
41322
|
+
{ exportMode }
|
|
41316
41323
|
);
|
|
41317
41324
|
}
|
|
41318
41325
|
function resolveNodeColor5(color, palette, defaultColor) {
|
|
@@ -44236,7 +44243,7 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
44236
44243
|
const legendConfig = {
|
|
44237
44244
|
groups: resolvedGroups,
|
|
44238
44245
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
44239
|
-
mode: "
|
|
44246
|
+
mode: "preview"
|
|
44240
44247
|
};
|
|
44241
44248
|
const legendState = {
|
|
44242
44249
|
activeGroup: activeTagGroup ?? null,
|
|
@@ -44641,7 +44648,9 @@ function parseVisualization(content, palette) {
|
|
|
44641
44648
|
if (currentTimelineTagGroup && indent === 0) {
|
|
44642
44649
|
currentTimelineTagGroup = null;
|
|
44643
44650
|
}
|
|
44644
|
-
const groupMatch = line12.match(
|
|
44651
|
+
const groupMatch = line12.match(
|
|
44652
|
+
/^\[(.+?)\](?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
44653
|
+
);
|
|
44645
44654
|
if (groupMatch) {
|
|
44646
44655
|
if (result.type === "arc") {
|
|
44647
44656
|
const name = groupMatch[1].trim();
|
|
@@ -44683,7 +44692,7 @@ function parseVisualization(content, palette) {
|
|
|
44683
44692
|
}
|
|
44684
44693
|
if (result.type === "arc") {
|
|
44685
44694
|
const linkMatch = line12.match(
|
|
44686
|
-
/^(.+?)\s*->\s*(.+?)(?:\(
|
|
44695
|
+
/^(.+?)\s*->\s*(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?(?:\s+(-?[\d,_]+(?:\.[\d]+)?))?$/
|
|
44687
44696
|
);
|
|
44688
44697
|
if (linkMatch) {
|
|
44689
44698
|
const source = linkMatch[1].trim();
|
|
@@ -44722,7 +44731,7 @@ function parseVisualization(content, palette) {
|
|
|
44722
44731
|
} else {
|
|
44723
44732
|
if (line12.startsWith("//")) continue;
|
|
44724
44733
|
const eraEntryMatch = line12.match(
|
|
44725
|
-
/^(\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
|
|
44734
|
+
/^(\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*$/
|
|
44726
44735
|
);
|
|
44727
44736
|
if (eraEntryMatch) {
|
|
44728
44737
|
const colorAnnotation = eraEntryMatch[4]?.trim() || null;
|
|
@@ -44750,7 +44759,7 @@ function parseVisualization(content, palette) {
|
|
|
44750
44759
|
} else {
|
|
44751
44760
|
if (line12.startsWith("//")) continue;
|
|
44752
44761
|
const markerEntryMatch = line12.match(
|
|
44753
|
-
/^(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s
|
|
44762
|
+
/^(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
44754
44763
|
);
|
|
44755
44764
|
if (markerEntryMatch) {
|
|
44756
44765
|
const colorAnnotation = markerEntryMatch[3]?.trim() || null;
|
|
@@ -44783,7 +44792,7 @@ function parseVisualization(content, palette) {
|
|
|
44783
44792
|
continue;
|
|
44784
44793
|
}
|
|
44785
44794
|
const eraMatch = line12.match(
|
|
44786
|
-
/^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
|
|
44795
|
+
/^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*$/
|
|
44787
44796
|
);
|
|
44788
44797
|
if (eraMatch) {
|
|
44789
44798
|
const colorAnnotation = eraMatch[4]?.trim() || null;
|
|
@@ -44802,7 +44811,7 @@ function parseVisualization(content, palette) {
|
|
|
44802
44811
|
continue;
|
|
44803
44812
|
}
|
|
44804
44813
|
const markerMatch = line12.match(
|
|
44805
|
-
/^marker\s+(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s
|
|
44814
|
+
/^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*$/
|
|
44806
44815
|
);
|
|
44807
44816
|
if (markerMatch) {
|
|
44808
44817
|
const colorAnnotation = markerMatch[3]?.trim() || null;
|
|
@@ -44923,13 +44932,11 @@ function parseVisualization(content, palette) {
|
|
|
44923
44932
|
}
|
|
44924
44933
|
}
|
|
44925
44934
|
if (!/^(solid-fill|no-name|no-value|no-percent|no-title)$/i.test(line12)) {
|
|
44926
|
-
const legacyAliasMatch = line12.match(
|
|
44927
|
-
/^([^(:]+?)(?:\(([^)]+)\))?\s+alias\s+(\S+)\s*$/i
|
|
44928
|
-
);
|
|
44935
|
+
const legacyAliasMatch = line12.match(/^(.+?)\s+alias\s+(\S+)\s*$/i);
|
|
44929
44936
|
if (legacyAliasMatch) {
|
|
44930
|
-
const
|
|
44931
|
-
const
|
|
44932
|
-
const
|
|
44937
|
+
const nameWithMaybeColor = legacyAliasMatch[1].trim();
|
|
44938
|
+
const aliasToken = legacyAliasMatch[2].trim();
|
|
44939
|
+
const { label: name, colorName } = peelTrailingColorName(nameWithMaybeColor);
|
|
44933
44940
|
let color = null;
|
|
44934
44941
|
if (colorName) {
|
|
44935
44942
|
color = resolveColorWithDiagnostic(
|
|
@@ -44951,11 +44958,12 @@ function parseVisualization(content, palette) {
|
|
|
44951
44958
|
continue;
|
|
44952
44959
|
}
|
|
44953
44960
|
const setDeclMatch = line12.match(
|
|
44954
|
-
/^(
|
|
44961
|
+
/^(.+?)(?:\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11}))?\s*$/i
|
|
44955
44962
|
);
|
|
44956
44963
|
if (setDeclMatch) {
|
|
44957
|
-
const
|
|
44958
|
-
const
|
|
44964
|
+
const nameWithMaybeColor = setDeclMatch[1].trim();
|
|
44965
|
+
const alias = setDeclMatch[2]?.trim() ?? null;
|
|
44966
|
+
const { label: name, colorName } = peelTrailingColorName(nameWithMaybeColor);
|
|
44959
44967
|
let color = null;
|
|
44960
44968
|
if (colorName) {
|
|
44961
44969
|
color = resolveColorWithDiagnostic(
|
|
@@ -44965,7 +44973,6 @@ function parseVisualization(content, palette) {
|
|
|
44965
44973
|
palette
|
|
44966
44974
|
) ?? null;
|
|
44967
44975
|
}
|
|
44968
|
-
const alias = setDeclMatch[3]?.trim() ?? null;
|
|
44969
44976
|
result.vennSets.push({ name, alias, color, lineNumber });
|
|
44970
44977
|
continue;
|
|
44971
44978
|
}
|
|
@@ -45011,10 +45018,9 @@ function parseVisualization(content, palette) {
|
|
|
45011
45018
|
if (quadrantMatch) {
|
|
45012
45019
|
const position = quadrantMatch[1].toLowerCase();
|
|
45013
45020
|
const labelPart = quadrantMatch[2].trim();
|
|
45014
|
-
const
|
|
45015
|
-
const
|
|
45016
|
-
|
|
45017
|
-
labelColorMatch[2].trim(),
|
|
45021
|
+
const { label: text, colorName } = peelTrailingColorName(labelPart);
|
|
45022
|
+
const color = colorName ? resolveColorWithDiagnostic(
|
|
45023
|
+
colorName,
|
|
45018
45024
|
lineNumber,
|
|
45019
45025
|
result.diagnostics,
|
|
45020
45026
|
palette
|
|
@@ -45204,10 +45210,9 @@ function parseVisualization(content, palette) {
|
|
|
45204
45210
|
);
|
|
45205
45211
|
continue;
|
|
45206
45212
|
}
|
|
45207
|
-
const
|
|
45208
|
-
const
|
|
45209
|
-
|
|
45210
|
-
colorMatch[2].trim(),
|
|
45213
|
+
const { label: labelPart, colorName: colorWord } = peelTrailingColorName(joinedLabel);
|
|
45214
|
+
const colorPart = colorWord ? resolveColorWithDiagnostic(
|
|
45215
|
+
colorWord,
|
|
45211
45216
|
lineNumber,
|
|
45212
45217
|
result.diagnostics,
|
|
45213
45218
|
palette
|
|
@@ -46496,7 +46501,7 @@ function makeTimelineHoverHelpers() {
|
|
|
46496
46501
|
setTagAttrs
|
|
46497
46502
|
};
|
|
46498
46503
|
}
|
|
46499
|
-
function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setup, hovers, onClickItem, exportDims, swimlaneTagGroup, activeTagGroup, onTagStateChange, viewMode) {
|
|
46504
|
+
function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setup, hovers, onClickItem, exportDims, swimlaneTagGroup, activeTagGroup, onTagStateChange, viewMode, exportMode) {
|
|
46500
46505
|
if (parsed.timelineTagGroups.length === 0) return;
|
|
46501
46506
|
const { width, textColor, groupColorMap, solid } = setup;
|
|
46502
46507
|
const { FADE_OPACITY: FADE_OPACITY3, fadeReset, fadeToTagValue } = hovers;
|
|
@@ -46567,7 +46572,7 @@ function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setu
|
|
|
46567
46572
|
const centralConfig = {
|
|
46568
46573
|
groups: centralGroups,
|
|
46569
46574
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
46570
|
-
mode: "
|
|
46575
|
+
mode: exportMode ? "export" : "preview",
|
|
46571
46576
|
capsulePillAddonWidth: iconAddon
|
|
46572
46577
|
};
|
|
46573
46578
|
const centralState = { activeGroup: centralActive };
|
|
@@ -47411,7 +47416,7 @@ function renderTimelineVertical(container, parsed, palette, isDark, setup, hover
|
|
|
47411
47416
|
}
|
|
47412
47417
|
}
|
|
47413
47418
|
}
|
|
47414
|
-
function renderTimeline(container, parsed, palette, isDark, onClickItem, exportDims, activeTagGroup, swimlaneTagGroup, onTagStateChange, viewMode) {
|
|
47419
|
+
function renderTimeline(container, parsed, palette, isDark, onClickItem, exportDims, activeTagGroup, swimlaneTagGroup, onTagStateChange, viewMode, exportMode) {
|
|
47415
47420
|
const setup = setupTimeline(
|
|
47416
47421
|
container,
|
|
47417
47422
|
parsed,
|
|
@@ -47486,7 +47491,8 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
|
|
|
47486
47491
|
swimlaneTagGroup,
|
|
47487
47492
|
activeTagGroup,
|
|
47488
47493
|
onTagStateChange,
|
|
47489
|
-
viewMode
|
|
47494
|
+
viewMode,
|
|
47495
|
+
exportMode
|
|
47490
47496
|
);
|
|
47491
47497
|
}
|
|
47492
47498
|
function getRotateFn(mode) {
|
|
@@ -48583,6 +48589,7 @@ function finalizeSvgExport(container, theme, palette) {
|
|
|
48583
48589
|
return svgHtml;
|
|
48584
48590
|
}
|
|
48585
48591
|
async function renderForExport(content, theme, palette, viewState, options) {
|
|
48592
|
+
const exportMode = options?.exportMode ?? false;
|
|
48586
48593
|
const { parseDgmoChartType: parseDgmoChartType2 } = await Promise.resolve().then(() => (init_dgmo_router(), dgmo_router_exports));
|
|
48587
48594
|
const detectedType = parseDgmoChartType2(content);
|
|
48588
48595
|
if (detectedType === "org") {
|
|
@@ -48624,7 +48631,9 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48624
48631
|
void 0,
|
|
48625
48632
|
{ width: exportWidth, height: exportHeight },
|
|
48626
48633
|
activeTagGroup,
|
|
48627
|
-
hiddenAttributes
|
|
48634
|
+
hiddenAttributes,
|
|
48635
|
+
void 0,
|
|
48636
|
+
exportMode
|
|
48628
48637
|
);
|
|
48629
48638
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48630
48639
|
}
|
|
@@ -48666,7 +48675,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48666
48675
|
void 0,
|
|
48667
48676
|
{ width: exportWidth, height: exportHeight },
|
|
48668
48677
|
activeTagGroup,
|
|
48669
|
-
hiddenAttributes
|
|
48678
|
+
hiddenAttributes,
|
|
48679
|
+
exportMode
|
|
48670
48680
|
);
|
|
48671
48681
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48672
48682
|
}
|
|
@@ -48689,7 +48699,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48689
48699
|
currentSwimlaneGroup: viewState?.swim ?? null,
|
|
48690
48700
|
collapsedLanes: viewState?.cl ? new Set(viewState.cl) : void 0,
|
|
48691
48701
|
collapsedColumns: viewState?.cc ? new Set(viewState.cc) : void 0,
|
|
48692
|
-
compactMeta: viewState?.cm
|
|
48702
|
+
compactMeta: viewState?.cm,
|
|
48703
|
+
exportMode
|
|
48693
48704
|
});
|
|
48694
48705
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48695
48706
|
}
|
|
@@ -48713,7 +48724,9 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48713
48724
|
effectivePalette2,
|
|
48714
48725
|
theme === "dark",
|
|
48715
48726
|
void 0,
|
|
48716
|
-
{ width: exportWidth, height: exportHeight }
|
|
48727
|
+
{ width: exportWidth, height: exportHeight },
|
|
48728
|
+
void 0,
|
|
48729
|
+
exportMode
|
|
48717
48730
|
);
|
|
48718
48731
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48719
48732
|
}
|
|
@@ -48743,7 +48756,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48743
48756
|
erParsed.options["active-tag"],
|
|
48744
48757
|
viewState?.tag ?? options?.tagGroup
|
|
48745
48758
|
),
|
|
48746
|
-
viewState?.sem
|
|
48759
|
+
viewState?.sem,
|
|
48760
|
+
exportMode
|
|
48747
48761
|
);
|
|
48748
48762
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48749
48763
|
}
|
|
@@ -48776,7 +48790,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48776
48790
|
{
|
|
48777
48791
|
exportDims: { width: exportWidth, height: exportHeight },
|
|
48778
48792
|
activeTagGroup: viewState?.tag ?? options?.tagGroup,
|
|
48779
|
-
hiddenTagValues: blHiddenTagValues
|
|
48793
|
+
hiddenTagValues: blHiddenTagValues,
|
|
48794
|
+
exportMode
|
|
48780
48795
|
}
|
|
48781
48796
|
);
|
|
48782
48797
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
@@ -48822,7 +48837,7 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48822
48837
|
void 0,
|
|
48823
48838
|
hideDescriptions,
|
|
48824
48839
|
colorByDepth ? null : activeTagGroup,
|
|
48825
|
-
colorByDepth ? { colorByDepth: true } :
|
|
48840
|
+
colorByDepth ? { colorByDepth: true, exportMode } : { exportMode }
|
|
48826
48841
|
);
|
|
48827
48842
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48828
48843
|
}
|
|
@@ -48885,7 +48900,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48885
48900
|
c4Parsed.tagGroups,
|
|
48886
48901
|
c4Parsed.options["active-tag"],
|
|
48887
48902
|
viewState?.tag ?? options?.tagGroup
|
|
48888
|
-
)
|
|
48903
|
+
),
|
|
48904
|
+
exportMode
|
|
48889
48905
|
);
|
|
48890
48906
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48891
48907
|
}
|
|
@@ -49021,7 +49037,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49021
49037
|
resolved.tagGroups,
|
|
49022
49038
|
resolved.options.activeTag ?? void 0,
|
|
49023
49039
|
viewState?.tag ?? options?.tagGroup
|
|
49024
|
-
)
|
|
49040
|
+
),
|
|
49041
|
+
exportMode
|
|
49025
49042
|
},
|
|
49026
49043
|
{ width: EXPORT_W, height: EXPORT_H }
|
|
49027
49044
|
);
|
|
@@ -49062,7 +49079,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49062
49079
|
effectivePalette2,
|
|
49063
49080
|
theme === "dark",
|
|
49064
49081
|
{ width: RADAR_EXPORT_W, height: RADAR_EXPORT_H },
|
|
49065
|
-
viewState
|
|
49082
|
+
viewState,
|
|
49083
|
+
exportMode
|
|
49066
49084
|
);
|
|
49067
49085
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49068
49086
|
}
|
|
@@ -49082,7 +49100,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49082
49100
|
jmLayout.totalHeight
|
|
49083
49101
|
);
|
|
49084
49102
|
renderJourneyMap2(container2, jmParsed, effectivePalette2, theme === "dark", {
|
|
49085
|
-
exportDims: { width: jmLayout.totalWidth, height: jmLayout.totalHeight }
|
|
49103
|
+
exportDims: { width: jmLayout.totalWidth, height: jmLayout.totalHeight },
|
|
49104
|
+
exportMode
|
|
49086
49105
|
});
|
|
49087
49106
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49088
49107
|
}
|
|
@@ -49099,7 +49118,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49099
49118
|
effectivePalette2,
|
|
49100
49119
|
theme === "dark",
|
|
49101
49120
|
{ width: EXPORT_WIDTH, height: EXPORT_HEIGHT },
|
|
49102
|
-
viewState
|
|
49121
|
+
viewState,
|
|
49122
|
+
exportMode
|
|
49103
49123
|
);
|
|
49104
49124
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49105
49125
|
}
|
|
@@ -49218,7 +49238,10 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49218
49238
|
void 0,
|
|
49219
49239
|
viewState?.tag ?? options?.tagGroup
|
|
49220
49240
|
),
|
|
49221
|
-
viewState?.swim
|
|
49241
|
+
viewState?.swim,
|
|
49242
|
+
void 0,
|
|
49243
|
+
void 0,
|
|
49244
|
+
exportMode
|
|
49222
49245
|
);
|
|
49223
49246
|
} else if (parsed.type === "venn") {
|
|
49224
49247
|
renderVenn(container, parsed, effectivePalette, isDark, void 0, dims);
|