@diagrammo/dgmo 0.15.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/advanced.cjs +612 -734
- package/dist/advanced.d.cts +42 -36
- package/dist/advanced.d.ts +42 -36
- package/dist/advanced.js +612 -733
- package/dist/auto.cjs +508 -620
- package/dist/auto.js +105 -105
- package/dist/auto.mjs +508 -620
- package/dist/cli.cjs +144 -144
- 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 +497 -608
- package/dist/index.js +497 -608
- package/dist/internal.cjs +612 -734
- package/dist/internal.d.cts +42 -36
- package/dist/internal.d.ts +42 -36
- package/dist/internal.js +612 -733
- package/dist/pert.d.cts +2 -2
- package/dist/pert.d.ts +2 -2
- package/docs/language-reference.md +97 -84
- package/docs/migration-sequence-color-to-tags.md +1 -1
- 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 +11 -11
- package/gallery/fixtures/sequence-tags.dgmo +10 -10
- package/gallery/fixtures/sequence.dgmo +4 -4
- 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 +7 -3
- package/src/advanced.ts +0 -1
- package/src/auto/index.ts +2 -2
- package/src/boxes-and-lines/layout.ts +1 -2
- package/src/boxes-and-lines/renderer.ts +5 -1
- package/src/c4/parser.ts +2 -2
- package/src/c4/renderer.ts +15 -8
- package/src/chart.ts +18 -9
- package/src/class/parser.ts +8 -7
- package/src/class/renderer.ts +17 -6
- package/src/cli.ts +8 -8
- package/src/completion.ts +14 -17
- package/src/cycle/parser.ts +15 -1
- package/src/cycle/renderer.ts +6 -3
- package/src/d3.ts +88 -49
- package/src/diagnostics.ts +20 -0
- package/src/echarts.ts +28 -11
- package/src/editor/dgmo.grammar +1 -3
- package/src/editor/dgmo.grammar.d.ts +1 -1
- 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 +19 -12
- 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 +6 -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 +8 -6
- package/src/journey-map/parser.ts +11 -4
- package/src/journey-map/renderer.ts +3 -1
- package/src/kanban/parser.ts +11 -7
- package/src/kanban/renderer.ts +3 -1
- package/src/mindmap/parser.ts +4 -5
- package/src/mindmap/renderer.ts +2 -1
- package/src/org/parser.ts +3 -3
- package/src/org/renderer.ts +4 -3
- package/src/pert/analyzer.ts +10 -10
- package/src/pert/layout.ts +1 -1
- package/src/pert/parser.ts +8 -8
- package/src/pert/renderer.ts +7 -2
- package/src/pert/types.ts +1 -1
- package/src/pyramid/parser.ts +13 -1
- package/src/raci/parser.ts +42 -12
- package/src/raci/renderer.ts +2 -1
- package/src/raci/types.ts +4 -3
- package/src/ring/parser.ts +13 -1
- package/src/sequence/parser.ts +81 -23
- package/src/sequence/participant-inference.ts +18 -181
- package/src/sequence/renderer.ts +48 -137
- package/src/sitemap/layout.ts +0 -2
- package/src/sitemap/parser.ts +12 -38
- package/src/sitemap/renderer.ts +13 -13
- package/src/sitemap/types.ts +0 -1
- package/src/tech-radar/parser.ts +2 -2
- 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/extract-alias.ts +1 -1
- package/src/utils/inline-markdown.ts +1 -1
- 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/utils/time-ticks.ts +1 -1
- package/src/wireframe/parser.ts +3 -3
package/dist/auto.mjs
CHANGED
|
@@ -416,6 +416,9 @@ function nameMergedMessage(args) {
|
|
|
416
416
|
function akaRemovedMessage() {
|
|
417
417
|
return `'aka' is no longer supported \u2014 use the participant name directly`;
|
|
418
418
|
}
|
|
419
|
+
function participantTypeRemovedMessage(type) {
|
|
420
|
+
return `'${type}' is no longer supported \u2014 drop 'is a ${type}'; the participant renders as the default rectangle`;
|
|
421
|
+
}
|
|
419
422
|
function tagShorthandRemovedMessage(args) {
|
|
420
423
|
return `Bare tag shorthand 'tag ${args.name} ${args.alias}' was removed. Use 'tag ${args.name} as ${args.alias}' instead.`;
|
|
421
424
|
}
|
|
@@ -449,7 +452,15 @@ var init_diagnostics = __esm({
|
|
|
449
452
|
* participant declaration. Forgiving normalization makes aliasing
|
|
450
453
|
* unnecessary; the diagnostic directs users to the new syntax.
|
|
451
454
|
*/
|
|
452
|
-
AKA_REMOVED: "E_AKA_REMOVED"
|
|
455
|
+
AKA_REMOVED: "E_AKA_REMOVED",
|
|
456
|
+
/**
|
|
457
|
+
* Error: a removed sequence participant-type keyword was used in
|
|
458
|
+
* an `is a X` declaration. The 0.16.0 trim retained only
|
|
459
|
+
* `actor`/`database`/`cache`/`queue`; `service`/`frontend`/
|
|
460
|
+
* `networking`/`gateway`/`external` no longer carry semantic
|
|
461
|
+
* weight and emit this error so users drop the override.
|
|
462
|
+
*/
|
|
463
|
+
PARTICIPANT_TYPE_REMOVED: "E_PARTICIPANT_TYPE_REMOVED"
|
|
453
464
|
};
|
|
454
465
|
ALIAS_DIAGNOSTIC_CODES = {
|
|
455
466
|
/** Alias token used before its declaration (strict-ordering rule). */
|
|
@@ -1820,17 +1831,21 @@ function measureIndent(line12) {
|
|
|
1820
1831
|
return indent;
|
|
1821
1832
|
}
|
|
1822
1833
|
function extractColor(label, palette, diagnostics, line12) {
|
|
1823
|
-
const
|
|
1824
|
-
|
|
1825
|
-
|
|
1834
|
+
const lastSpaceIdx = Math.max(
|
|
1835
|
+
label.lastIndexOf(" "),
|
|
1836
|
+
label.lastIndexOf(" ")
|
|
1837
|
+
);
|
|
1838
|
+
if (lastSpaceIdx < 0) return { label };
|
|
1839
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
1840
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { label };
|
|
1826
1841
|
let color;
|
|
1827
1842
|
if (diagnostics && line12 !== void 0) {
|
|
1828
|
-
color = resolveColorWithDiagnostic(
|
|
1843
|
+
color = resolveColorWithDiagnostic(trailing, line12, diagnostics, palette);
|
|
1829
1844
|
} else {
|
|
1830
|
-
color = resolveColor(
|
|
1845
|
+
color = resolveColor(trailing, palette) ?? void 0;
|
|
1831
1846
|
}
|
|
1832
1847
|
return {
|
|
1833
|
-
label: label.substring(0,
|
|
1848
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
1834
1849
|
color
|
|
1835
1850
|
};
|
|
1836
1851
|
}
|
|
@@ -1963,14 +1978,18 @@ function parseSeriesNames(value, lines, lineIndex, palette, diagnostics) {
|
|
|
1963
1978
|
}
|
|
1964
1979
|
return { series, names, nameColors, nameLineNumbers, newIndex };
|
|
1965
1980
|
}
|
|
1966
|
-
function
|
|
1967
|
-
const
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
return
|
|
1981
|
+
function peelTrailingColorName(label) {
|
|
1982
|
+
const lastSpaceIdx = Math.max(
|
|
1983
|
+
label.lastIndexOf(" "),
|
|
1984
|
+
label.lastIndexOf(" ")
|
|
1985
|
+
);
|
|
1986
|
+
if (lastSpaceIdx < 0) return { label };
|
|
1987
|
+
const trailing = label.substring(lastSpaceIdx + 1);
|
|
1988
|
+
if (!RECOGNIZED_COLOR_SET.has(trailing)) return { label };
|
|
1989
|
+
return {
|
|
1990
|
+
label: label.substring(0, lastSpaceIdx).trimEnd(),
|
|
1991
|
+
colorName: trailing
|
|
1992
|
+
};
|
|
1974
1993
|
}
|
|
1975
1994
|
function parsePipeMetadata(segments, aliasMap = /* @__PURE__ */ new Map(), errorMultiplePipes) {
|
|
1976
1995
|
if (segments.length > 2) {
|
|
@@ -1992,11 +2011,14 @@ function parsePipeMetadata(segments, aliasMap = /* @__PURE__ */ new Map(), error
|
|
|
1992
2011
|
}
|
|
1993
2012
|
return metadata;
|
|
1994
2013
|
}
|
|
1995
|
-
var ALL_CHART_TYPES, PIPE_KEY_VALUE_PREFIX_RE, PIPE_LIKELY_STRUCTURED_TAIL_RE,
|
|
2014
|
+
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
2015
|
var init_parsing = __esm({
|
|
1997
2016
|
"src/utils/parsing.ts"() {
|
|
1998
2017
|
"use strict";
|
|
1999
2018
|
init_colors();
|
|
2019
|
+
RECOGNIZED_COLOR_SET = new Set(
|
|
2020
|
+
RECOGNIZED_COLOR_NAMES
|
|
2021
|
+
);
|
|
2000
2022
|
ALL_CHART_TYPES = /* @__PURE__ */ new Set([
|
|
2001
2023
|
// data charts
|
|
2002
2024
|
"bar",
|
|
@@ -2048,7 +2070,6 @@ var init_parsing = __esm({
|
|
|
2048
2070
|
]);
|
|
2049
2071
|
PIPE_KEY_VALUE_PREFIX_RE = /^\s*[A-Za-z][A-Za-z0-9_-]*\s*:/;
|
|
2050
2072
|
PIPE_LIKELY_STRUCTURED_TAIL_RE = /,\s*[A-Za-z][A-Za-z0-9_-]*\s*:/;
|
|
2051
|
-
COLOR_SUFFIX_RE = /\(([^)]+)\)\s*$/;
|
|
2052
2073
|
OPTION_NOCOLON_RE = /^([a-z][a-z0-9-]*)\s+(.+)$/i;
|
|
2053
2074
|
GLOBAL_BOOLEANS = /* @__PURE__ */ new Set([
|
|
2054
2075
|
"solid-fill",
|
|
@@ -2085,7 +2106,7 @@ function parseTagDeclaration(line12) {
|
|
|
2085
2106
|
let restStartIdx = 1;
|
|
2086
2107
|
let valueStart = tokens.length;
|
|
2087
2108
|
for (let i = 1; i < tokens.length; i++) {
|
|
2088
|
-
if (tokens[i].includes("
|
|
2109
|
+
if (tokens[i].includes(",")) {
|
|
2089
2110
|
valueStart = i;
|
|
2090
2111
|
break;
|
|
2091
2112
|
}
|
|
@@ -2117,13 +2138,29 @@ function parseTagDeclaration(line12) {
|
|
|
2117
2138
|
restStartIdx = valueStart;
|
|
2118
2139
|
}
|
|
2119
2140
|
} else {
|
|
2120
|
-
|
|
2121
|
-
|
|
2141
|
+
const isColorWord = (s) => RECOGNIZED_COLOR_NAMES.includes(s);
|
|
2142
|
+
if (valueStart < tokens.length) {
|
|
2143
|
+
const commaTokenIdx = valueStart;
|
|
2144
|
+
const lastBeforeComma = tokens[commaTokenIdx].replace(/,$/, "");
|
|
2145
|
+
const firstValueStart = isColorWord(lastBeforeComma) ? commaTokenIdx - 1 : commaTokenIdx;
|
|
2146
|
+
const prefixEnd = firstValueStart;
|
|
2147
|
+
const aliasCandidate = prefixEnd > 1 ? tokens[prefixEnd - 1] : void 0;
|
|
2148
|
+
if (aliasCandidate && isAliasToken(aliasCandidate) && !isColorWord(aliasCandidate)) {
|
|
2149
|
+
alias = aliasCandidate;
|
|
2150
|
+
legacyForm = "bare-shorthand";
|
|
2151
|
+
name = tokens.slice(0, prefixEnd - 1).map((t) => stripQuotes(t)).join(" ");
|
|
2152
|
+
restStartIdx = prefixEnd;
|
|
2153
|
+
} else {
|
|
2154
|
+
name = tokens.slice(0, prefixEnd).map((t) => stripQuotes(t)).join(" ");
|
|
2155
|
+
restStartIdx = prefixEnd;
|
|
2156
|
+
}
|
|
2157
|
+
} else if (tokens[0][0] === '"' || tokens[0][0] === "'") {
|
|
2158
|
+
if (tokens.length > 1 && isAliasToken(tokens[1]) && !isColorWord(tokens[1])) {
|
|
2122
2159
|
alias = tokens[1];
|
|
2123
2160
|
legacyForm = "bare-shorthand";
|
|
2124
2161
|
restStartIdx = 2;
|
|
2125
2162
|
}
|
|
2126
|
-
} else if (valueStart > 1 && isAliasToken(tokens[valueStart - 1])) {
|
|
2163
|
+
} else if (valueStart > 1 && isAliasToken(tokens[valueStart - 1]) && !isColorWord(tokens[valueStart - 1])) {
|
|
2127
2164
|
alias = tokens[valueStart - 1];
|
|
2128
2165
|
legacyForm = "bare-shorthand";
|
|
2129
2166
|
name = tokens.slice(0, valueStart - 1).map((t) => stripQuotes(t)).join(" ");
|
|
@@ -2138,10 +2175,13 @@ function parseTagDeclaration(line12) {
|
|
|
2138
2175
|
inlineValues = valueStr.split(",").map((v) => v.trim()).filter(Boolean);
|
|
2139
2176
|
}
|
|
2140
2177
|
if (!inlineValues || inlineValues.length === 0) {
|
|
2141
|
-
const
|
|
2142
|
-
if (
|
|
2143
|
-
|
|
2144
|
-
|
|
2178
|
+
const lastSpaceIdx = name.lastIndexOf(" ");
|
|
2179
|
+
if (lastSpaceIdx > 0) {
|
|
2180
|
+
const trailing = name.substring(lastSpaceIdx + 1);
|
|
2181
|
+
if (RECOGNIZED_COLOR_NAMES.includes(trailing)) {
|
|
2182
|
+
colorHint = trailing;
|
|
2183
|
+
name = name.substring(0, lastSpaceIdx).trimEnd();
|
|
2184
|
+
}
|
|
2145
2185
|
}
|
|
2146
2186
|
}
|
|
2147
2187
|
return {
|
|
@@ -2269,6 +2309,7 @@ var init_tag_groups = __esm({
|
|
|
2269
2309
|
"use strict";
|
|
2270
2310
|
init_parsing();
|
|
2271
2311
|
init_diagnostics();
|
|
2312
|
+
init_colors();
|
|
2272
2313
|
TAG_BLOCK_NOCOLON_RE = /^tag\s+/i;
|
|
2273
2314
|
VALID_TAG_IDENT_RE = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
2274
2315
|
}
|
|
@@ -2542,7 +2583,7 @@ function buildControlsGroupLayout(config, state) {
|
|
|
2542
2583
|
}
|
|
2543
2584
|
function computeLegendLayout(config, state, containerWidth) {
|
|
2544
2585
|
const { groups, controls: configControls, mode } = config;
|
|
2545
|
-
const isExport = mode === "
|
|
2586
|
+
const isExport = mode === "export";
|
|
2546
2587
|
const activeGroupName = state.activeGroup?.toLowerCase() ?? null;
|
|
2547
2588
|
if (isExport && !activeGroupName) {
|
|
2548
2589
|
return {
|
|
@@ -2828,7 +2869,10 @@ function renderLegendD3(container, config, state, palette, isDark, callbacks, co
|
|
|
2828
2869
|
const width = containerWidth ?? parseFloat(container.attr("width") || "800");
|
|
2829
2870
|
let currentState = { ...state };
|
|
2830
2871
|
let currentLayout;
|
|
2831
|
-
const legendG = container.append("g").attr("class", "dgmo-legend")
|
|
2872
|
+
const legendG = container.append("g").attr("class", "dgmo-legend").attr("data-legend-title-relation", config.position.titleRelation).attr(
|
|
2873
|
+
"data-legend-capsule-addon-width",
|
|
2874
|
+
String(config.capsulePillAddonWidth ?? 0)
|
|
2875
|
+
);
|
|
2832
2876
|
function render2() {
|
|
2833
2877
|
currentLayout = computeLegendLayout(config, currentState, width);
|
|
2834
2878
|
legendG.selectAll("*").remove();
|
|
@@ -3079,81 +3123,7 @@ var init_participant_inference = __esm({
|
|
|
3079
3123
|
// Names that would incorrectly match general patterns in later groups
|
|
3080
3124
|
{ pattern: /^KeyDB$/i, type: "cache" },
|
|
3081
3125
|
// not database (DB$ suffix)
|
|
3082
|
-
|
|
3083
|
-
// not frontend (Web contains)
|
|
3084
|
-
{ pattern: /^Upstream$/i, type: "external" },
|
|
3085
|
-
// not queue (Stream$ suffix)
|
|
3086
|
-
{ pattern: /^Downstream$/i, type: "external" },
|
|
3087
|
-
// not queue (Stream$ suffix)
|
|
3088
|
-
// ── 1. Infrastructure overrides ─────────────────────────
|
|
3089
|
-
// These names end in -er/-or but are NOT actors
|
|
3090
|
-
{ pattern: /^.*Router$/i, type: "networking" },
|
|
3091
|
-
{ pattern: /^.*Scheduler$/i, type: "service" },
|
|
3092
|
-
{ pattern: /^.*Dispatcher$/i, type: "service" },
|
|
3093
|
-
{ pattern: /^.*Balancer$/i, type: "networking" },
|
|
3094
|
-
{ pattern: /^.*Controller$/i, type: "service" },
|
|
3095
|
-
{ pattern: /^.*Handler$/i, type: "service" },
|
|
3096
|
-
{ pattern: /^.*Processor$/i, type: "service" },
|
|
3097
|
-
{ pattern: /^.*Connector$/i, type: "service" },
|
|
3098
|
-
{ pattern: /^.*Adapter$/i, type: "service" },
|
|
3099
|
-
{ pattern: /^.*Provider$/i, type: "service" },
|
|
3100
|
-
{ pattern: /^.*Manager$/i, type: "service" },
|
|
3101
|
-
{ pattern: /^.*Orchestrator$/i, type: "service" },
|
|
3102
|
-
{ pattern: /^.*Monitor$/i, type: "service" },
|
|
3103
|
-
{ pattern: /^.*Resolver$/i, type: "service" },
|
|
3104
|
-
{ pattern: /^.*Logger$/i, type: "service" },
|
|
3105
|
-
{ pattern: /^.*Server$/i, type: "service" },
|
|
3106
|
-
{ pattern: /^.*Broker$/i, type: "queue" },
|
|
3107
|
-
{ pattern: /^.*Worker$/i, type: "service" },
|
|
3108
|
-
{ pattern: /^.*Consumer$/i, type: "service" },
|
|
3109
|
-
{ pattern: /^.*Producer$/i, type: "service" },
|
|
3110
|
-
{ pattern: /^.*Publisher$/i, type: "service" },
|
|
3111
|
-
{ pattern: /^.*Subscriber$/i, type: "service" },
|
|
3112
|
-
{ pattern: /^.*Listener$/i, type: "service" },
|
|
3113
|
-
// New -er/-or suffixes that are services, not actors
|
|
3114
|
-
{ pattern: /^.*Watcher$/i, type: "service" },
|
|
3115
|
-
{ pattern: /^.*Executor$/i, type: "service" },
|
|
3116
|
-
{ pattern: /^.*Aggregator$/i, type: "service" },
|
|
3117
|
-
{ pattern: /^.*Collector$/i, type: "service" },
|
|
3118
|
-
{ pattern: /^.*Transformer$/i, type: "service" },
|
|
3119
|
-
{ pattern: /^.*Validator$/i, type: "service" },
|
|
3120
|
-
{ pattern: /^.*Generator$/i, type: "service" },
|
|
3121
|
-
{ pattern: /^.*Indexer$/i, type: "service" },
|
|
3122
|
-
{ pattern: /^.*Crawler$/i, type: "service" },
|
|
3123
|
-
{ pattern: /^.*Scanner$/i, type: "service" },
|
|
3124
|
-
{ pattern: /^.*Parser$/i, type: "service" },
|
|
3125
|
-
{ pattern: /^.*Emitter$/i, type: "service" },
|
|
3126
|
-
{ pattern: /^.*Exporter$/i, type: "service" },
|
|
3127
|
-
{ pattern: /^.*Importer$/i, type: "service" },
|
|
3128
|
-
{ pattern: /^.*Loader$/i, type: "service" },
|
|
3129
|
-
{ pattern: /^.*Renderer$/i, type: "service" },
|
|
3130
|
-
{ pattern: /^.*Checker$/i, type: "service" },
|
|
3131
|
-
{ pattern: /^.*Inspector$/i, type: "service" },
|
|
3132
|
-
{ pattern: /^.*Encoder$/i, type: "service" },
|
|
3133
|
-
{ pattern: /^.*Decoder$/i, type: "service" },
|
|
3134
|
-
{ pattern: /^.*Notifier$/i, type: "service" },
|
|
3135
|
-
// ── 2. Networking patterns ──────────────────────────────
|
|
3136
|
-
{ pattern: /Gateway/i, type: "networking" },
|
|
3137
|
-
{ pattern: /GW$/i, type: "networking" },
|
|
3138
|
-
{ pattern: /Proxy/i, type: "networking" },
|
|
3139
|
-
{ pattern: /LB$/i, type: "networking" },
|
|
3140
|
-
{ pattern: /LoadBalancer/i, type: "networking" },
|
|
3141
|
-
{ pattern: /CDN/i, type: "networking" },
|
|
3142
|
-
{ pattern: /Firewall/i, type: "networking" },
|
|
3143
|
-
{ pattern: /WAF$/i, type: "networking" },
|
|
3144
|
-
{ pattern: /DNS/i, type: "networking" },
|
|
3145
|
-
{ pattern: /Ingress/i, type: "networking" },
|
|
3146
|
-
// Named products & patterns
|
|
3147
|
-
{ pattern: /Nginx/i, type: "networking" },
|
|
3148
|
-
{ pattern: /Traefik/i, type: "networking" },
|
|
3149
|
-
{ pattern: /Envoy/i, type: "networking" },
|
|
3150
|
-
{ pattern: /Istio/i, type: "networking" },
|
|
3151
|
-
{ pattern: /Kong/i, type: "networking" },
|
|
3152
|
-
{ pattern: /Akamai/i, type: "networking" },
|
|
3153
|
-
{ pattern: /Cloudflare/i, type: "networking" },
|
|
3154
|
-
{ pattern: /Mesh$/i, type: "networking" },
|
|
3155
|
-
{ pattern: /ServiceMesh/i, type: "networking" },
|
|
3156
|
-
// ── 3. Database patterns ────────────────────────────────
|
|
3126
|
+
// ── 1. Database patterns ────────────────────────────────
|
|
3157
3127
|
{ pattern: /DB$/i, type: "database" },
|
|
3158
3128
|
{ pattern: /Database/i, type: "database" },
|
|
3159
3129
|
{ pattern: /Datastore/i, type: "database" },
|
|
@@ -3187,16 +3157,15 @@ var init_participant_inference = __esm({
|
|
|
3187
3157
|
{ pattern: /Milvus/i, type: "database" },
|
|
3188
3158
|
{ pattern: /Presto/i, type: "database" },
|
|
3189
3159
|
{ pattern: /Table$/i, type: "database" },
|
|
3190
|
-
// ──
|
|
3160
|
+
// ── 2. Cache patterns ──────────────────────────────────
|
|
3191
3161
|
{ pattern: /Cache/i, type: "cache" },
|
|
3192
3162
|
{ pattern: /Redis/i, type: "cache" },
|
|
3193
3163
|
{ pattern: /Memcache/i, type: "cache" },
|
|
3194
|
-
// CDN already matched by networking above
|
|
3195
3164
|
// Named products
|
|
3196
3165
|
{ pattern: /Dragonfly/i, type: "cache" },
|
|
3197
3166
|
{ pattern: /Hazelcast/i, type: "cache" },
|
|
3198
3167
|
{ pattern: /Valkey/i, type: "cache" },
|
|
3199
|
-
// ──
|
|
3168
|
+
// ── 3. Queue/Messaging patterns ─────────────────────────
|
|
3200
3169
|
{ pattern: /Queue/i, type: "queue" },
|
|
3201
3170
|
{ pattern: /MQ$/i, type: "queue" },
|
|
3202
3171
|
{ pattern: /SQS/i, type: "queue" },
|
|
@@ -3209,6 +3178,7 @@ var init_participant_inference = __esm({
|
|
|
3209
3178
|
{ pattern: /Stream$/i, type: "queue" },
|
|
3210
3179
|
{ pattern: /SNS/i, type: "queue" },
|
|
3211
3180
|
{ pattern: /PubSub/i, type: "queue" },
|
|
3181
|
+
{ pattern: /Broker$/i, type: "queue" },
|
|
3212
3182
|
// Named products & patterns
|
|
3213
3183
|
{ pattern: /NATS/i, type: "queue" },
|
|
3214
3184
|
{ pattern: /Pulsar/i, type: "queue" },
|
|
@@ -3219,7 +3189,7 @@ var init_participant_inference = __esm({
|
|
|
3219
3189
|
{ pattern: /Sidekiq/i, type: "queue" },
|
|
3220
3190
|
{ pattern: /EventHub/i, type: "queue" },
|
|
3221
3191
|
{ pattern: /Channel$/i, type: "queue" },
|
|
3222
|
-
// ──
|
|
3192
|
+
// ── 4. Actor patterns ──────────────────────────────────
|
|
3223
3193
|
// Exact matches first
|
|
3224
3194
|
{ pattern: /^Admin$/i, type: "actor" },
|
|
3225
3195
|
{ pattern: /^User$/i, type: "actor" },
|
|
@@ -3238,98 +3208,11 @@ var init_participant_inference = __esm({
|
|
|
3238
3208
|
{ pattern: /^Fan$/i, type: "actor" },
|
|
3239
3209
|
{ pattern: /^Purchaser$/i, type: "actor" },
|
|
3240
3210
|
{ pattern: /^Reviewer$/i, type: "actor" },
|
|
3241
|
-
// Suffix rules
|
|
3211
|
+
// Suffix rules
|
|
3242
3212
|
{ pattern: /User$/i, type: "actor" },
|
|
3243
3213
|
{ pattern: /Actor$/i, type: "actor" },
|
|
3244
3214
|
{ pattern: /Analyst$/i, type: "actor" },
|
|
3245
|
-
{ pattern: /Staff$/i, type: "actor" }
|
|
3246
|
-
// ── 7. Frontend patterns ────────────────────────────────
|
|
3247
|
-
{ pattern: /App$/i, type: "frontend" },
|
|
3248
|
-
{ pattern: /Application/i, type: "frontend" },
|
|
3249
|
-
{ pattern: /Mobile/i, type: "frontend" },
|
|
3250
|
-
{ pattern: /iOS/i, type: "frontend" },
|
|
3251
|
-
{ pattern: /Android/i, type: "frontend" },
|
|
3252
|
-
{ pattern: /Web/i, type: "frontend" },
|
|
3253
|
-
{ pattern: /Browser/i, type: "frontend" },
|
|
3254
|
-
{ pattern: /Frontend/i, type: "frontend" },
|
|
3255
|
-
{ pattern: /UI$/i, type: "frontend" },
|
|
3256
|
-
{ pattern: /Dashboard/i, type: "frontend" },
|
|
3257
|
-
{ pattern: /CLI$/i, type: "frontend" },
|
|
3258
|
-
{ pattern: /Terminal/i, type: "frontend" },
|
|
3259
|
-
// Frameworks & patterns
|
|
3260
|
-
{ pattern: /React/i, type: "frontend" },
|
|
3261
|
-
{ pattern: /^Vue$/i, type: "frontend" },
|
|
3262
|
-
{ pattern: /Angular/i, type: "frontend" },
|
|
3263
|
-
{ pattern: /Svelte/i, type: "frontend" },
|
|
3264
|
-
{ pattern: /NextJS/i, type: "frontend" },
|
|
3265
|
-
{ pattern: /Nuxt/i, type: "frontend" },
|
|
3266
|
-
{ pattern: /Remix/i, type: "frontend" },
|
|
3267
|
-
{ pattern: /Electron/i, type: "frontend" },
|
|
3268
|
-
{ pattern: /Tauri/i, type: "frontend" },
|
|
3269
|
-
{ pattern: /Widget$/i, type: "frontend" },
|
|
3270
|
-
{ pattern: /Portal/i, type: "frontend" },
|
|
3271
|
-
{ pattern: /Console$/i, type: "frontend" },
|
|
3272
|
-
{ pattern: /^SPA$/i, type: "frontend" },
|
|
3273
|
-
{ pattern: /^PWA$/i, type: "frontend" },
|
|
3274
|
-
// ── 8. Service patterns ─────────────────────────────────
|
|
3275
|
-
{ pattern: /Service/i, type: "service" },
|
|
3276
|
-
{ pattern: /Svc$/i, type: "service" },
|
|
3277
|
-
{ pattern: /API$/i, type: "service" },
|
|
3278
|
-
{ pattern: /Lambda/i, type: "service" },
|
|
3279
|
-
{ pattern: /Function$/i, type: "service" },
|
|
3280
|
-
{ pattern: /Fn$/i, type: "service" },
|
|
3281
|
-
{ pattern: /Job$/i, type: "service" },
|
|
3282
|
-
{ pattern: /Cron/i, type: "service" },
|
|
3283
|
-
{ pattern: /Microservice/i, type: "service" },
|
|
3284
|
-
// Auth
|
|
3285
|
-
{ pattern: /^Auth$/i, type: "service" },
|
|
3286
|
-
{ pattern: /^AuthN$/i, type: "service" },
|
|
3287
|
-
{ pattern: /^AuthZ$/i, type: "service" },
|
|
3288
|
-
{ pattern: /^SSO$/i, type: "service" },
|
|
3289
|
-
{ pattern: /OAuth/i, type: "service" },
|
|
3290
|
-
{ pattern: /^OIDC$/i, type: "service" },
|
|
3291
|
-
// SaaS
|
|
3292
|
-
{ pattern: /Stripe/i, type: "service" },
|
|
3293
|
-
{ pattern: /Twilio/i, type: "service" },
|
|
3294
|
-
{ pattern: /SendGrid/i, type: "service" },
|
|
3295
|
-
{ pattern: /Mailgun/i, type: "service" },
|
|
3296
|
-
// Cloud/infra
|
|
3297
|
-
{ pattern: /^S3$/i, type: "service" },
|
|
3298
|
-
{ pattern: /^Blob$/i, type: "service" },
|
|
3299
|
-
{ pattern: /Vercel/i, type: "service" },
|
|
3300
|
-
{ pattern: /Netlify/i, type: "service" },
|
|
3301
|
-
{ pattern: /Heroku/i, type: "service" },
|
|
3302
|
-
{ pattern: /Docker/i, type: "service" },
|
|
3303
|
-
{ pattern: /Kubernetes/i, type: "service" },
|
|
3304
|
-
{ pattern: /K8s/i, type: "service" },
|
|
3305
|
-
{ pattern: /Terraform/i, type: "service" },
|
|
3306
|
-
// Security
|
|
3307
|
-
{ pattern: /Vault/i, type: "service" },
|
|
3308
|
-
{ pattern: /^HSM$/i, type: "service" },
|
|
3309
|
-
{ pattern: /KMS/i, type: "service" },
|
|
3310
|
-
{ pattern: /^IAM$/i, type: "service" },
|
|
3311
|
-
// AI/ML
|
|
3312
|
-
{ pattern: /^LLM$/i, type: "service" },
|
|
3313
|
-
{ pattern: /GPT/i, type: "service" },
|
|
3314
|
-
{ pattern: /^Claude$/i, type: "service" },
|
|
3315
|
-
{ pattern: /Embedding/i, type: "service" },
|
|
3316
|
-
{ pattern: /Inference/i, type: "service" },
|
|
3317
|
-
// Suffixes & patterns
|
|
3318
|
-
{ pattern: /Pipeline$/i, type: "service" },
|
|
3319
|
-
{ pattern: /Registry/i, type: "service" },
|
|
3320
|
-
{ pattern: /Engine$/i, type: "service" },
|
|
3321
|
-
{ pattern: /Daemon/i, type: "service" },
|
|
3322
|
-
// ── 9. External patterns ────────────────────────────────
|
|
3323
|
-
{ pattern: /External/i, type: "external" },
|
|
3324
|
-
{ pattern: /Ext$/i, type: "external" },
|
|
3325
|
-
{ pattern: /ThirdParty/i, type: "external" },
|
|
3326
|
-
{ pattern: /3P$/i, type: "external" },
|
|
3327
|
-
{ pattern: /Vendor/i, type: "external" },
|
|
3328
|
-
// Named products & patterns
|
|
3329
|
-
{ pattern: /Callback/i, type: "external" },
|
|
3330
|
-
{ pattern: /^AWS$/i, type: "external" },
|
|
3331
|
-
{ pattern: /^GCP$/i, type: "external" },
|
|
3332
|
-
{ pattern: /Azure/i, type: "external" }
|
|
3215
|
+
{ pattern: /Staff$/i, type: "actor" }
|
|
3333
3216
|
];
|
|
3334
3217
|
RULE_COUNT = PARTICIPANT_RULES.length;
|
|
3335
3218
|
}
|
|
@@ -3390,15 +3273,6 @@ function parseInArrowLabel(rawLabel, lineNumber) {
|
|
|
3390
3273
|
const diagnostics = validateLabelCharacters(trimmed, lineNumber);
|
|
3391
3274
|
return { label: trimmed, diagnostics };
|
|
3392
3275
|
}
|
|
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
3276
|
function parseArrow(line12) {
|
|
3403
3277
|
if (BIDI_SYNC_RE.test(line12) || BIDI_ASYNC_RE.test(line12)) {
|
|
3404
3278
|
return {
|
|
@@ -3437,7 +3311,6 @@ var init_arrows = __esm({
|
|
|
3437
3311
|
"src/utils/arrows.ts"() {
|
|
3438
3312
|
"use strict";
|
|
3439
3313
|
init_diagnostics();
|
|
3440
|
-
init_colors();
|
|
3441
3314
|
ARROW_DIAGNOSTIC_CODES = {
|
|
3442
3315
|
/** Active: label contains `->` or `~>` substring (TD-13). */
|
|
3443
3316
|
ARROW_SUBSTRING_IN_LABEL: "E_ARROW_SUBSTRING_IN_LABEL",
|
|
@@ -3632,7 +3505,7 @@ function parseSequenceDgmo(content) {
|
|
|
3632
3505
|
const pushWarning = (line12, message) => {
|
|
3633
3506
|
result.diagnostics.push(makeDgmoError(line12, message, "warning"));
|
|
3634
3507
|
};
|
|
3635
|
-
if (!content
|
|
3508
|
+
if (!content?.trim()) {
|
|
3636
3509
|
return fail(0, "Empty content");
|
|
3637
3510
|
}
|
|
3638
3511
|
const lines = content.split("\n");
|
|
@@ -3643,7 +3516,7 @@ function parseSequenceDgmo(content) {
|
|
|
3643
3516
|
const fl = lines[fi].trim();
|
|
3644
3517
|
if (!fl || fl.startsWith("//")) continue;
|
|
3645
3518
|
const parsed = parseFirstLine(fl);
|
|
3646
|
-
if (parsed
|
|
3519
|
+
if (parsed?.chartType === "sequence") {
|
|
3647
3520
|
hasExplicitChart = true;
|
|
3648
3521
|
firstLineIndex = fi;
|
|
3649
3522
|
if (parsed.title) {
|
|
@@ -3762,7 +3635,7 @@ function parseSequenceDgmo(content) {
|
|
|
3762
3635
|
if (groupColor) {
|
|
3763
3636
|
pushWarning(
|
|
3764
3637
|
lineNumber,
|
|
3765
|
-
`(${groupColor}) color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3638
|
+
`'(${groupColor})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3766
3639
|
);
|
|
3767
3640
|
}
|
|
3768
3641
|
contentStarted = true;
|
|
@@ -3842,7 +3715,7 @@ function parseSequenceDgmo(content) {
|
|
|
3842
3715
|
if (!color) {
|
|
3843
3716
|
pushError(
|
|
3844
3717
|
lineNumber,
|
|
3845
|
-
`Expected 'Value
|
|
3718
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
3846
3719
|
);
|
|
3847
3720
|
continue;
|
|
3848
3721
|
}
|
|
@@ -3866,11 +3739,13 @@ function parseSequenceDgmo(content) {
|
|
|
3866
3739
|
blockStack.pop();
|
|
3867
3740
|
}
|
|
3868
3741
|
const labelRaw = sectionMatch[1].trim();
|
|
3869
|
-
const colorMatch = labelRaw.match(
|
|
3742
|
+
const colorMatch = labelRaw.match(
|
|
3743
|
+
/^(.+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)$/
|
|
3744
|
+
);
|
|
3870
3745
|
if (colorMatch) {
|
|
3871
3746
|
pushWarning(
|
|
3872
3747
|
lineNumber,
|
|
3873
|
-
`(${colorMatch[2]
|
|
3748
|
+
`'(${colorMatch[2]})' parens-color syntax removed from sequence diagrams \u2014 use 'tag:' groups for coloring`
|
|
3874
3749
|
);
|
|
3875
3750
|
}
|
|
3876
3751
|
contentStarted = true;
|
|
@@ -3956,6 +3831,17 @@ function parseSequenceDgmo(content) {
|
|
|
3956
3831
|
const id = isAMatch[1];
|
|
3957
3832
|
const typeStr = isAMatch[2].toLowerCase();
|
|
3958
3833
|
let remainder = isAMatch[3]?.trim() || "";
|
|
3834
|
+
if (REMOVED_PARTICIPANT_TYPES.has(typeStr)) {
|
|
3835
|
+
result.diagnostics.push(
|
|
3836
|
+
makeDgmoError(
|
|
3837
|
+
lineNumber,
|
|
3838
|
+
participantTypeRemovedMessage(typeStr),
|
|
3839
|
+
"error",
|
|
3840
|
+
NAME_DIAGNOSTIC_CODES.PARTICIPANT_TYPE_REMOVED
|
|
3841
|
+
)
|
|
3842
|
+
);
|
|
3843
|
+
continue;
|
|
3844
|
+
}
|
|
3959
3845
|
const participantType = VALID_PARTICIPANT_TYPES.has(
|
|
3960
3846
|
typeStr
|
|
3961
3847
|
) ? typeStr : "default";
|
|
@@ -4025,7 +3911,7 @@ function parseSequenceDgmo(content) {
|
|
|
4025
3911
|
const color = coloredMatch[2].trim();
|
|
4026
3912
|
pushError(
|
|
4027
3913
|
lineNumber,
|
|
4028
|
-
`'${id}(${color})' syntax is no longer supported \u2014 use 'tag:' groups for coloring`
|
|
3914
|
+
`'${id}(${color})' parens-color syntax is no longer supported \u2014 use 'tag:' groups for coloring`
|
|
4029
3915
|
);
|
|
4030
3916
|
contentStarted = true;
|
|
4031
3917
|
const key = addParticipant(id, lineNumber, { metadata: colorMeta });
|
|
@@ -4256,6 +4142,25 @@ function parseSequenceDgmo(content) {
|
|
|
4256
4142
|
}
|
|
4257
4143
|
continue;
|
|
4258
4144
|
}
|
|
4145
|
+
const elifMatch = trimmed.match(/^elif\b\s*(.*)$/i);
|
|
4146
|
+
if (elifMatch) {
|
|
4147
|
+
const tailRaw = elifMatch[1].trim();
|
|
4148
|
+
const tail = tailRaw ? " " + tailRaw : "";
|
|
4149
|
+
pushError(
|
|
4150
|
+
lineNumber,
|
|
4151
|
+
`'elif' is not a keyword. Did you mean 'else if${tail}'?`
|
|
4152
|
+
);
|
|
4153
|
+
continue;
|
|
4154
|
+
}
|
|
4155
|
+
const elseLabelMatch = trimmed.match(/^else\s+(.+)$/i);
|
|
4156
|
+
if (elseLabelMatch) {
|
|
4157
|
+
const tail = elseLabelMatch[1].trim();
|
|
4158
|
+
pushError(
|
|
4159
|
+
lineNumber,
|
|
4160
|
+
`'else' does not take a label. Did you mean 'else if ${tail}'?`
|
|
4161
|
+
);
|
|
4162
|
+
continue;
|
|
4163
|
+
}
|
|
4259
4164
|
{
|
|
4260
4165
|
const noteParsed = parseNoteLine(
|
|
4261
4166
|
trimmed,
|
|
@@ -4379,7 +4284,7 @@ function looksLikeSequence(content) {
|
|
|
4379
4284
|
return ARROW_PATTERN.test(trimmed);
|
|
4380
4285
|
});
|
|
4381
4286
|
}
|
|
4382
|
-
var KNOWN_SEQ_OPTIONS, KNOWN_SEQ_BOOLEANS, VALID_PARTICIPANT_TYPES, IS_A_PATTERN, POSITION_ONLY_PATTERN, COLORED_PARTICIPANT_PATTERN, GROUP_HEADING_PATTERN, GROUP_HEADING_FALLBACK, LEGACY_GROUP_PATTERN, SECTION_PATTERN, ARROW_PATTERN, NOTE_BARE, NOTE_MULTI;
|
|
4287
|
+
var KNOWN_SEQ_OPTIONS, KNOWN_SEQ_BOOLEANS, VALID_PARTICIPANT_TYPES, REMOVED_PARTICIPANT_TYPES, IS_A_PATTERN, POSITION_ONLY_PATTERN, COLORED_PARTICIPANT_PATTERN, GROUP_HEADING_PATTERN, GROUP_HEADING_FALLBACK, LEGACY_GROUP_PATTERN, SECTION_PATTERN, ARROW_PATTERN, NOTE_BARE, NOTE_MULTI;
|
|
4383
4288
|
var init_parser = __esm({
|
|
4384
4289
|
"src/sequence/parser.ts"() {
|
|
4385
4290
|
"use strict";
|
|
@@ -4392,19 +4297,21 @@ var init_parser = __esm({
|
|
|
4392
4297
|
KNOWN_SEQ_OPTIONS = /* @__PURE__ */ new Set(["active-tag"]);
|
|
4393
4298
|
KNOWN_SEQ_BOOLEANS = /* @__PURE__ */ new Set(["activations", "solid-fill", "no-title"]);
|
|
4394
4299
|
VALID_PARTICIPANT_TYPES = /* @__PURE__ */ new Set([
|
|
4395
|
-
"service",
|
|
4396
4300
|
"database",
|
|
4397
4301
|
"actor",
|
|
4398
4302
|
"queue",
|
|
4399
|
-
"cache"
|
|
4400
|
-
|
|
4401
|
-
|
|
4303
|
+
"cache"
|
|
4304
|
+
]);
|
|
4305
|
+
REMOVED_PARTICIPANT_TYPES = /* @__PURE__ */ new Set([
|
|
4306
|
+
"service",
|
|
4307
|
+
"frontend",
|
|
4402
4308
|
"networking",
|
|
4403
|
-
"
|
|
4309
|
+
"gateway",
|
|
4310
|
+
"external"
|
|
4404
4311
|
]);
|
|
4405
4312
|
IS_A_PATTERN = /^([^:]+?)\s+is\s+an?\s+(\w+)(?:\s+(.+))?$/i;
|
|
4406
4313
|
POSITION_ONLY_PATTERN = /^([^:]+?)\s+position\s+(-?\d+)$/i;
|
|
4407
|
-
COLORED_PARTICIPANT_PATTERN = /^(\S+?)\((
|
|
4314
|
+
COLORED_PARTICIPANT_PATTERN = /^(\S+?)\((red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\)\s*$/;
|
|
4408
4315
|
GROUP_HEADING_PATTERN = /^\[([^\]|]+?)(?:\(([^)]+)\))?\]\s*(.*)$/;
|
|
4409
4316
|
GROUP_HEADING_FALLBACK = /^\[([^\]]+)\]\s*(.*)$/;
|
|
4410
4317
|
LEGACY_GROUP_PATTERN = /^##\s+(.+?)(?:\(([^)]+)\))?\s*$/;
|
|
@@ -4473,7 +4380,6 @@ function splitArrows(line12) {
|
|
|
4473
4380
|
const arrowEnd = idx + 2;
|
|
4474
4381
|
let arrowStart;
|
|
4475
4382
|
let label;
|
|
4476
|
-
let color;
|
|
4477
4383
|
let openingStart = -1;
|
|
4478
4384
|
for (let i = scanFloor; i < runStart; i++) {
|
|
4479
4385
|
if (line12[i] !== "-") continue;
|
|
@@ -4486,21 +4392,13 @@ function splitArrows(line12) {
|
|
|
4486
4392
|
if (openingStart !== -1) {
|
|
4487
4393
|
let openingEnd = openingStart;
|
|
4488
4394
|
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
|
-
}
|
|
4395
|
+
const labelPart = line12.substring(openingEnd, runStart).trim();
|
|
4396
|
+
if (labelPart) label = labelPart;
|
|
4499
4397
|
arrowStart = openingStart;
|
|
4500
4398
|
} else {
|
|
4501
4399
|
arrowStart = runStart;
|
|
4502
4400
|
}
|
|
4503
|
-
arrowPositions.push({ start: arrowStart, end: arrowEnd, label
|
|
4401
|
+
arrowPositions.push({ start: arrowStart, end: arrowEnd, label });
|
|
4504
4402
|
searchFrom = arrowEnd;
|
|
4505
4403
|
scanFloor = arrowEnd;
|
|
4506
4404
|
}
|
|
@@ -4514,11 +4412,7 @@ function splitArrows(line12) {
|
|
|
4514
4412
|
if (beforeText || i === 0) {
|
|
4515
4413
|
segments.push(beforeText);
|
|
4516
4414
|
}
|
|
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})->`;
|
|
4415
|
+
const arrowToken = arrow.label ? `-${arrow.label}->` : "->";
|
|
4522
4416
|
segments.push(arrowToken);
|
|
4523
4417
|
lastIndex = arrow.end;
|
|
4524
4418
|
}
|
|
@@ -4528,45 +4422,14 @@ function splitArrows(line12) {
|
|
|
4528
4422
|
}
|
|
4529
4423
|
return segments;
|
|
4530
4424
|
}
|
|
4531
|
-
function parseArrowToken(token,
|
|
4425
|
+
function parseArrowToken(token, _palette, lineNumber, diagnostics) {
|
|
4532
4426
|
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(/^-(.+?)(?:\(([^)]+)\))?->$/);
|
|
4427
|
+
const m = token.match(/^-(.+?)->$/);
|
|
4548
4428
|
if (m) {
|
|
4549
4429
|
const rawLabel = m[1] ?? "";
|
|
4550
4430
|
const labelResult = parseInArrowLabel(rawLabel, lineNumber);
|
|
4551
4431
|
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 };
|
|
4432
|
+
return { label: labelResult.label };
|
|
4570
4433
|
}
|
|
4571
4434
|
return {};
|
|
4572
4435
|
}
|
|
@@ -4632,13 +4495,12 @@ function parseFlowchart(content, palette) {
|
|
|
4632
4495
|
result.nodes.push(node);
|
|
4633
4496
|
return node;
|
|
4634
4497
|
}
|
|
4635
|
-
function addEdge(sourceId, targetId, lineNumber, label
|
|
4498
|
+
function addEdge(sourceId, targetId, lineNumber, label) {
|
|
4636
4499
|
const edge = {
|
|
4637
4500
|
source: sourceId,
|
|
4638
4501
|
target: targetId,
|
|
4639
4502
|
lineNumber,
|
|
4640
|
-
...label && { label }
|
|
4641
|
-
...color && { color }
|
|
4503
|
+
...label && { label }
|
|
4642
4504
|
};
|
|
4643
4505
|
result.edges.push(edge);
|
|
4644
4506
|
}
|
|
@@ -4704,13 +4566,7 @@ function parseFlowchart(content, palette) {
|
|
|
4704
4566
|
if (pendingArrow !== null) {
|
|
4705
4567
|
const sourceId = lastNodeId ?? implicitSourceId;
|
|
4706
4568
|
if (sourceId) {
|
|
4707
|
-
addEdge(
|
|
4708
|
-
sourceId,
|
|
4709
|
-
node.id,
|
|
4710
|
-
lineNumber,
|
|
4711
|
-
pendingArrow.label,
|
|
4712
|
-
pendingArrow.color
|
|
4713
|
-
);
|
|
4569
|
+
addEdge(sourceId, node.id, lineNumber, pendingArrow.label);
|
|
4714
4570
|
}
|
|
4715
4571
|
pendingArrow = null;
|
|
4716
4572
|
} else if (lastNodeId === null && implicitSourceId === null) {
|
|
@@ -4835,7 +4691,6 @@ var NODE_ID_RE;
|
|
|
4835
4691
|
var init_flowchart_parser = __esm({
|
|
4836
4692
|
"src/graph/flowchart-parser.ts"() {
|
|
4837
4693
|
"use strict";
|
|
4838
|
-
init_colors();
|
|
4839
4694
|
init_diagnostics();
|
|
4840
4695
|
init_arrows();
|
|
4841
4696
|
init_parsing();
|
|
@@ -4863,7 +4718,6 @@ function splitArrows2(line12) {
|
|
|
4863
4718
|
const arrowEnd = idx + 2;
|
|
4864
4719
|
let arrowStart;
|
|
4865
4720
|
let label;
|
|
4866
|
-
let color;
|
|
4867
4721
|
let openingStart = -1;
|
|
4868
4722
|
for (let i = scanFloor; i < runStart; i++) {
|
|
4869
4723
|
if (line12[i] !== "-") continue;
|
|
@@ -4876,21 +4730,13 @@ function splitArrows2(line12) {
|
|
|
4876
4730
|
if (openingStart !== -1) {
|
|
4877
4731
|
let openingEnd = openingStart;
|
|
4878
4732
|
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
|
-
}
|
|
4733
|
+
const labelPart = line12.substring(openingEnd, runStart).trim();
|
|
4734
|
+
if (labelPart) label = labelPart;
|
|
4889
4735
|
arrowStart = openingStart;
|
|
4890
4736
|
} else {
|
|
4891
4737
|
arrowStart = runStart;
|
|
4892
4738
|
}
|
|
4893
|
-
arrowPositions.push({ start: arrowStart, end: arrowEnd, label
|
|
4739
|
+
arrowPositions.push({ start: arrowStart, end: arrowEnd, label });
|
|
4894
4740
|
searchFrom = arrowEnd;
|
|
4895
4741
|
scanFloor = arrowEnd;
|
|
4896
4742
|
}
|
|
@@ -4900,11 +4746,7 @@ function splitArrows2(line12) {
|
|
|
4900
4746
|
const arrow = arrowPositions[i];
|
|
4901
4747
|
const beforeText = line12.substring(lastIndex, arrow.start).trim();
|
|
4902
4748
|
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})->`;
|
|
4749
|
+
const arrowToken = arrow.label ? `-${arrow.label}->` : "->";
|
|
4908
4750
|
segments.push(arrowToken);
|
|
4909
4751
|
lastIndex = arrow.end;
|
|
4910
4752
|
}
|
|
@@ -4912,35 +4754,14 @@ function splitArrows2(line12) {
|
|
|
4912
4754
|
if (remaining) segments.push(remaining);
|
|
4913
4755
|
return segments;
|
|
4914
4756
|
}
|
|
4915
|
-
function parseArrowToken2(token,
|
|
4757
|
+
function parseArrowToken2(token, _palette, lineNumber, diagnostics) {
|
|
4916
4758
|
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(/^-(.+?)(?:\(([^)]+)\))?->$/);
|
|
4759
|
+
const m = token.match(/^-(.+?)->$/);
|
|
4932
4760
|
if (m) {
|
|
4933
4761
|
const rawLabel = m[1] ?? "";
|
|
4934
4762
|
const labelResult = parseInArrowLabel(rawLabel, lineNumber);
|
|
4935
4763
|
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 };
|
|
4764
|
+
return { label: labelResult.label };
|
|
4944
4765
|
}
|
|
4945
4766
|
return {};
|
|
4946
4767
|
}
|
|
@@ -5031,13 +4852,12 @@ function parseState(content, palette) {
|
|
|
5031
4852
|
}
|
|
5032
4853
|
return node;
|
|
5033
4854
|
}
|
|
5034
|
-
function addEdge(sourceId, targetId, lineNumber, label
|
|
4855
|
+
function addEdge(sourceId, targetId, lineNumber, label) {
|
|
5035
4856
|
result.edges.push({
|
|
5036
4857
|
source: sourceId,
|
|
5037
4858
|
target: targetId,
|
|
5038
4859
|
lineNumber,
|
|
5039
|
-
...label && { label }
|
|
5040
|
-
...color && { color }
|
|
4860
|
+
...label && { label }
|
|
5041
4861
|
});
|
|
5042
4862
|
}
|
|
5043
4863
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -5180,13 +5000,7 @@ function parseState(content, palette) {
|
|
|
5180
5000
|
if (pendingArrow !== null) {
|
|
5181
5001
|
const sourceId = lastNodeId ?? implicitSourceId;
|
|
5182
5002
|
if (sourceId) {
|
|
5183
|
-
addEdge(
|
|
5184
|
-
sourceId,
|
|
5185
|
-
node.id,
|
|
5186
|
-
lineNumber,
|
|
5187
|
-
pendingArrow.label,
|
|
5188
|
-
pendingArrow.color
|
|
5189
|
-
);
|
|
5003
|
+
addEdge(sourceId, node.id, lineNumber, pendingArrow.label);
|
|
5190
5004
|
}
|
|
5191
5005
|
pendingArrow = null;
|
|
5192
5006
|
}
|
|
@@ -5239,7 +5053,7 @@ var init_state_parser = __esm({
|
|
|
5239
5053
|
init_name_normalize();
|
|
5240
5054
|
PSEUDOSTATE_ID = "pseudostate:[*]";
|
|
5241
5055
|
PSEUDOSTATE_LABEL = "[*]";
|
|
5242
|
-
GROUP_BRACKET_RE = /^\[([^\]]+)\](?:\(
|
|
5056
|
+
GROUP_BRACKET_RE = /^\[([^\]]+)\](?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/;
|
|
5243
5057
|
}
|
|
5244
5058
|
});
|
|
5245
5059
|
|
|
@@ -5387,7 +5201,7 @@ function parseClassDiagram(content, palette) {
|
|
|
5387
5201
|
if (trimmed.startsWith("//")) continue;
|
|
5388
5202
|
if (!contentStarted && indent === 0 && i === 0) {
|
|
5389
5203
|
const firstLine = parseFirstLine(trimmed);
|
|
5390
|
-
if (firstLine
|
|
5204
|
+
if (firstLine?.chartType === "class") {
|
|
5391
5205
|
if (firstLine.title) {
|
|
5392
5206
|
result.title = firstLine.title;
|
|
5393
5207
|
result.titleLineNumber = lineNumber;
|
|
@@ -5618,7 +5432,7 @@ var init_parser2 = __esm({
|
|
|
5618
5432
|
init_arrows();
|
|
5619
5433
|
init_parsing();
|
|
5620
5434
|
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
|
|
5435
|
+
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
5436
|
INDENT_REL_ARROW_RE = /^(--\|>|\.\.\|>|\*--|o--|\.\.>|->)\s*(?:"([^"]+)"|([A-Za-z][^":]*?))(?:\s+:?\s*(.+))?$/;
|
|
5623
5437
|
REL_ARROW_RE = /^(?:"([^"]+)"|([A-Z][^":]*?))\s*(--\|>|\.\.\|>|\*--|o--|\.\.>|->)\s*(?:"([^"]+)"|([A-Z][^":]*?))(?:\s+:?\s*(.+))?$/;
|
|
5624
5438
|
VISIBILITY_RE = /^([+\-#])\s*/;
|
|
@@ -5788,7 +5602,7 @@ function parseERDiagram(content, palette) {
|
|
|
5788
5602
|
if (trimmed.startsWith("//")) continue;
|
|
5789
5603
|
if (!firstLineParsed && indent === 0) {
|
|
5790
5604
|
const firstLineResult = parseFirstLine(trimmed);
|
|
5791
|
-
if (firstLineResult
|
|
5605
|
+
if (firstLineResult?.chartType === "er") {
|
|
5792
5606
|
firstLineParsed = true;
|
|
5793
5607
|
if (firstLineResult.title) {
|
|
5794
5608
|
result.title = firstLineResult.title;
|
|
@@ -5825,7 +5639,7 @@ function parseERDiagram(content, palette) {
|
|
|
5825
5639
|
result.diagnostics.push(
|
|
5826
5640
|
makeDgmoError(
|
|
5827
5641
|
lineNumber,
|
|
5828
|
-
`Expected 'Value
|
|
5642
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`,
|
|
5829
5643
|
"warning"
|
|
5830
5644
|
)
|
|
5831
5645
|
);
|
|
@@ -5937,7 +5751,7 @@ function parseERDiagram(content, palette) {
|
|
|
5937
5751
|
if (result.tables.length === 0 && !result.error) {
|
|
5938
5752
|
const diag = makeDgmoError(
|
|
5939
5753
|
1,
|
|
5940
|
-
'No tables found. Add table declarations like "users" or "orders
|
|
5754
|
+
'No tables found. Add table declarations like "users" or "orders blue".'
|
|
5941
5755
|
);
|
|
5942
5756
|
result.diagnostics.push(diag);
|
|
5943
5757
|
result.error = formatDgmoError(diag);
|
|
@@ -6023,15 +5837,19 @@ function extractSymbols3(docText) {
|
|
|
6023
5837
|
for (const rawLine of docText.split("\n")) {
|
|
6024
5838
|
const line12 = rawLine.trim();
|
|
6025
5839
|
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
5840
|
if (/^\s/.test(rawLine)) continue;
|
|
5841
|
+
if (line12.length === 0) continue;
|
|
6030
5842
|
const m = TABLE_DECL_RE.exec(line12);
|
|
6031
5843
|
if (m) {
|
|
6032
5844
|
const name = (m[1] ?? m[2] ?? "").trim();
|
|
6033
|
-
if (name)
|
|
5845
|
+
if (name) {
|
|
5846
|
+
inMetadata = false;
|
|
5847
|
+
entities.push(name);
|
|
5848
|
+
continue;
|
|
5849
|
+
}
|
|
6034
5850
|
}
|
|
5851
|
+
if (inMetadata && OPTION_NOCOLON_RE.test(line12)) continue;
|
|
5852
|
+
inMetadata = false;
|
|
6035
5853
|
}
|
|
6036
5854
|
return {
|
|
6037
5855
|
kind: "er",
|
|
@@ -6049,7 +5867,7 @@ var init_parser3 = __esm({
|
|
|
6049
5867
|
init_name_normalize();
|
|
6050
5868
|
init_parsing();
|
|
6051
5869
|
init_tag_groups();
|
|
6052
|
-
TABLE_DECL_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":(]*?))(?:\s
|
|
5870
|
+
TABLE_DECL_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":(]*?))(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?(?:\s*\|(.+))?$/;
|
|
6053
5871
|
INDENT_REL_RE = /^([1*?])-{1,2}(?:(.+?)-{1,2})?([1*?])\s+(?:"([^"]+)"|([a-zA-Z_][^":]*?))\s*$/;
|
|
6054
5872
|
CONSTRAINT_MAP = {
|
|
6055
5873
|
pk: "pk",
|
|
@@ -6129,18 +5947,22 @@ function parseChart(content, palette) {
|
|
|
6129
5947
|
return fail(lineNumber, msg2);
|
|
6130
5948
|
}
|
|
6131
5949
|
}
|
|
6132
|
-
const eraMatch = trimmed.match(
|
|
6133
|
-
/^era\s+(.+?)\s*->\s*(.+?)(?:\s*\(([^)]+)\))?\s*$/
|
|
6134
|
-
);
|
|
5950
|
+
const eraMatch = trimmed.match(/^era\s+(.+?)\s*->\s*(.+?)\s*$/);
|
|
6135
5951
|
if (eraMatch) {
|
|
6136
5952
|
const afterArrow = eraMatch[2].trim();
|
|
6137
5953
|
const spaceIdx2 = afterArrow.indexOf(" ");
|
|
6138
5954
|
if (spaceIdx2 >= 0) {
|
|
5955
|
+
const lastSpaceIdx = afterArrow.lastIndexOf(" ");
|
|
5956
|
+
const trailing = afterArrow.substring(lastSpaceIdx + 1);
|
|
5957
|
+
const hasColor = RECOGNIZED_COLOR_NAMES.includes(
|
|
5958
|
+
trailing
|
|
5959
|
+
);
|
|
5960
|
+
const labelPart = hasColor ? afterArrow.substring(0, lastSpaceIdx).trimEnd() : afterArrow;
|
|
6139
5961
|
rawEras.push({
|
|
6140
5962
|
start: eraMatch[1].trim(),
|
|
6141
|
-
afterArrow,
|
|
6142
|
-
color:
|
|
6143
|
-
|
|
5963
|
+
afterArrow: labelPart,
|
|
5964
|
+
color: hasColor ? resolveColorWithDiagnostic(
|
|
5965
|
+
trailing,
|
|
6144
5966
|
lineNumber,
|
|
6145
5967
|
result.diagnostics,
|
|
6146
5968
|
palette
|
|
@@ -6662,11 +6484,12 @@ function parseExtendedChart(content, palette) {
|
|
|
6662
6484
|
return result;
|
|
6663
6485
|
}
|
|
6664
6486
|
}
|
|
6665
|
-
const categoryMatch = trimmed.match(/^\[(.+?)\](?:\s
|
|
6487
|
+
const categoryMatch = trimmed.match(/^\[(.+?)\](?:\s+(\S+))?\s*$/);
|
|
6666
6488
|
if (categoryMatch) {
|
|
6667
6489
|
const catName = categoryMatch[1].trim();
|
|
6668
|
-
const
|
|
6669
|
-
|
|
6490
|
+
const rawCatColor = categoryMatch[2]?.trim();
|
|
6491
|
+
const catColor = rawCatColor ? resolveColorWithDiagnostic(
|
|
6492
|
+
rawCatColor,
|
|
6670
6493
|
lineNumber,
|
|
6671
6494
|
result.diagnostics,
|
|
6672
6495
|
palette
|
|
@@ -6681,7 +6504,7 @@ function parseExtendedChart(content, palette) {
|
|
|
6681
6504
|
continue;
|
|
6682
6505
|
}
|
|
6683
6506
|
const arrowMatch = trimmed.match(
|
|
6684
|
-
/^(.+?)\s*(->|--)\s*(.+?)\s+(-?[\d,_]+(?:\.[\d]+)?)
|
|
6507
|
+
/^(.+?)\s*(->|--)\s*(.+?)\s+(-?[\d,_]+(?:\.[\d]+)?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
6685
6508
|
);
|
|
6686
6509
|
if (arrowMatch) {
|
|
6687
6510
|
const [, rawSource, arrow, rawTarget, rawVal, rawLinkColor] = arrowMatch;
|
|
@@ -6726,11 +6549,14 @@ function parseExtendedChart(content, palette) {
|
|
|
6726
6549
|
}
|
|
6727
6550
|
if (sankeyStack.length > 0) {
|
|
6728
6551
|
const valColorMatch = trimmed.match(
|
|
6729
|
-
/(-?[\d,_]+(?:\.[\d]+)?)\s
|
|
6552
|
+
/(-?[\d,_]+(?:\.[\d]+)?)\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\s*$/
|
|
6730
6553
|
);
|
|
6731
|
-
const strippedLine = valColorMatch ? trimmed.replace(
|
|
6554
|
+
const strippedLine = valColorMatch ? trimmed.replace(
|
|
6555
|
+
/\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white)\s*$/,
|
|
6556
|
+
""
|
|
6557
|
+
) : trimmed;
|
|
6732
6558
|
const dataRow2 = parseDataRowValues(strippedLine);
|
|
6733
|
-
if (dataRow2
|
|
6559
|
+
if (dataRow2?.values.length === 1) {
|
|
6734
6560
|
const source = sankeyStack.at(-1).name;
|
|
6735
6561
|
const linkColor = valColorMatch?.[2] ? resolveColorWithDiagnostic(
|
|
6736
6562
|
valColorMatch[2].trim(),
|
|
@@ -6962,7 +6788,7 @@ function parseExtendedChart(content, palette) {
|
|
|
6962
6788
|
}
|
|
6963
6789
|
}
|
|
6964
6790
|
const dataRow = parseDataRowValues(trimmed);
|
|
6965
|
-
if (dataRow
|
|
6791
|
+
if (dataRow?.values.length === 1) {
|
|
6966
6792
|
const { label: rawLabel, color: pointColor } = extractColor(
|
|
6967
6793
|
dataRow.label,
|
|
6968
6794
|
palette
|
|
@@ -9006,7 +8832,7 @@ function parseOrg(content, palette) {
|
|
|
9006
8832
|
const pushWarning = (line12, message) => {
|
|
9007
8833
|
result.diagnostics.push(makeDgmoError(line12, message, "warning"));
|
|
9008
8834
|
};
|
|
9009
|
-
if (!content
|
|
8835
|
+
if (!content?.trim()) {
|
|
9010
8836
|
return fail(0, "No content provided");
|
|
9011
8837
|
}
|
|
9012
8838
|
const lines = content.split("\n");
|
|
@@ -9104,7 +8930,7 @@ function parseOrg(content, palette) {
|
|
|
9104
8930
|
if (!color) {
|
|
9105
8931
|
pushError(
|
|
9106
8932
|
lineNumber,
|
|
9107
|
-
`Expected 'Value
|
|
8933
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9108
8934
|
);
|
|
9109
8935
|
continue;
|
|
9110
8936
|
}
|
|
@@ -9303,7 +9129,7 @@ function parseKanban(content, palette) {
|
|
|
9303
9129
|
const warn2 = (line12, message) => {
|
|
9304
9130
|
result.diagnostics.push(makeDgmoError(line12, message, "warning"));
|
|
9305
9131
|
};
|
|
9306
|
-
if (!content
|
|
9132
|
+
if (!content?.trim()) {
|
|
9307
9133
|
return fail(0, "No content provided");
|
|
9308
9134
|
}
|
|
9309
9135
|
const lines = content.split("\n");
|
|
@@ -9395,7 +9221,7 @@ function parseKanban(content, palette) {
|
|
|
9395
9221
|
if (!color) {
|
|
9396
9222
|
warn2(
|
|
9397
9223
|
lineNumber,
|
|
9398
|
-
`Expected 'Value
|
|
9224
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9399
9225
|
);
|
|
9400
9226
|
continue;
|
|
9401
9227
|
}
|
|
@@ -9438,8 +9264,9 @@ function parseKanban(content, palette) {
|
|
|
9438
9264
|
currentCard = null;
|
|
9439
9265
|
columnCounter++;
|
|
9440
9266
|
const colName = columnMatch[1].trim();
|
|
9441
|
-
const
|
|
9442
|
-
|
|
9267
|
+
const rawTrailing = columnMatch[2]?.trim();
|
|
9268
|
+
const colColor = rawTrailing ? resolveColorWithDiagnostic(
|
|
9269
|
+
rawTrailing,
|
|
9443
9270
|
lineNumber,
|
|
9444
9271
|
result.diagnostics,
|
|
9445
9272
|
palette
|
|
@@ -9594,7 +9421,7 @@ var init_parser5 = __esm({
|
|
|
9594
9421
|
init_tag_groups();
|
|
9595
9422
|
init_parsing();
|
|
9596
9423
|
init_name_normalize();
|
|
9597
|
-
COLUMN_RE = /^\[(.+?)\](?:\s
|
|
9424
|
+
COLUMN_RE = /^\[(.+?)\](?:\s+(\S+))?(?:\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11}))?\s*(?:\|\s*(.+))?$/;
|
|
9598
9425
|
LEGACY_COLUMN_RE = /^==\s+(.+?)\s*(?:\[wip:\s*(\d+)\])?\s*==$/;
|
|
9599
9426
|
KNOWN_OPTIONS4 = /* @__PURE__ */ new Set(["hide", "active-tag"]);
|
|
9600
9427
|
KNOWN_BOOLEANS3 = /* @__PURE__ */ new Set([
|
|
@@ -9691,7 +9518,7 @@ function parseC4(content, palette) {
|
|
|
9691
9518
|
result.error = formatDgmoError(diag);
|
|
9692
9519
|
return result;
|
|
9693
9520
|
};
|
|
9694
|
-
if (!content
|
|
9521
|
+
if (!content?.trim()) {
|
|
9695
9522
|
return fail(0, "No content provided");
|
|
9696
9523
|
}
|
|
9697
9524
|
const lines = content.split("\n");
|
|
@@ -9777,7 +9604,7 @@ function parseC4(content, palette) {
|
|
|
9777
9604
|
if (!color) {
|
|
9778
9605
|
pushError(
|
|
9779
9606
|
lineNumber,
|
|
9780
|
-
`Expected 'Value
|
|
9607
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
9781
9608
|
);
|
|
9782
9609
|
continue;
|
|
9783
9610
|
}
|
|
@@ -10373,7 +10200,7 @@ __export(parser_exports7, {
|
|
|
10373
10200
|
looksLikeSitemap: () => looksLikeSitemap,
|
|
10374
10201
|
parseSitemap: () => parseSitemap
|
|
10375
10202
|
});
|
|
10376
|
-
function parseArrowLine(trimmed,
|
|
10203
|
+
function parseArrowLine(trimmed, _palette, _lineNumber, _diagnostics) {
|
|
10377
10204
|
const bareMatch = trimmed.match(BARE_ARROW_RE);
|
|
10378
10205
|
if (bareMatch) {
|
|
10379
10206
|
const rawTarget = bareMatch[1].trim();
|
|
@@ -10386,27 +10213,10 @@ function parseArrowLine(trimmed, palette, lineNumber, diagnostics) {
|
|
|
10386
10213
|
const arrowMatch = trimmed.match(ARROW_RE);
|
|
10387
10214
|
if (arrowMatch) {
|
|
10388
10215
|
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();
|
|
10216
|
+
const rawTarget = arrowMatch[2].trim();
|
|
10406
10217
|
const groupMatch = rawTarget.match(/^\[(.+)\]$/);
|
|
10407
10218
|
return {
|
|
10408
10219
|
label,
|
|
10409
|
-
color,
|
|
10410
10220
|
target: groupMatch ? groupMatch[1].trim() : rawTarget,
|
|
10411
10221
|
targetIsGroup: !!groupMatch
|
|
10412
10222
|
};
|
|
@@ -10459,7 +10269,7 @@ function parseSitemap(content, palette) {
|
|
|
10459
10269
|
const pushWarning = (line12, message) => {
|
|
10460
10270
|
result.diagnostics.push(makeDgmoError(line12, message, "warning"));
|
|
10461
10271
|
};
|
|
10462
|
-
if (!content
|
|
10272
|
+
if (!content?.trim()) {
|
|
10463
10273
|
return fail(0, "No content provided");
|
|
10464
10274
|
}
|
|
10465
10275
|
const lines = content.split("\n");
|
|
@@ -10548,7 +10358,7 @@ function parseSitemap(content, palette) {
|
|
|
10548
10358
|
if (!color) {
|
|
10549
10359
|
pushError(
|
|
10550
10360
|
lineNumber,
|
|
10551
|
-
`Expected 'Value
|
|
10361
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
10552
10362
|
);
|
|
10553
10363
|
continue;
|
|
10554
10364
|
}
|
|
@@ -10585,7 +10395,6 @@ function parseSitemap(content, palette) {
|
|
|
10585
10395
|
targetLabel: arrowInfo.target,
|
|
10586
10396
|
targetIsGroup: arrowInfo.targetIsGroup,
|
|
10587
10397
|
label: arrowInfo.label,
|
|
10588
|
-
color: arrowInfo.color,
|
|
10589
10398
|
lineNumber
|
|
10590
10399
|
});
|
|
10591
10400
|
}
|
|
@@ -10683,7 +10492,6 @@ function parseSitemap(content, palette) {
|
|
|
10683
10492
|
sourceId: arrow.sourceNode.id,
|
|
10684
10493
|
targetId: aliasHit,
|
|
10685
10494
|
label: arrow.label,
|
|
10686
|
-
color: arrow.color,
|
|
10687
10495
|
lineNumber: arrow.lineNumber
|
|
10688
10496
|
});
|
|
10689
10497
|
continue;
|
|
@@ -10703,7 +10511,6 @@ function parseSitemap(content, palette) {
|
|
|
10703
10511
|
sourceId: arrow.sourceNode.id,
|
|
10704
10512
|
targetId: targetContainer.id,
|
|
10705
10513
|
label: arrow.label,
|
|
10706
|
-
color: arrow.color,
|
|
10707
10514
|
lineNumber: arrow.lineNumber
|
|
10708
10515
|
});
|
|
10709
10516
|
} else {
|
|
@@ -10720,7 +10527,6 @@ function parseSitemap(content, palette) {
|
|
|
10720
10527
|
sourceId: arrow.sourceNode.id,
|
|
10721
10528
|
targetId: targetNode.id,
|
|
10722
10529
|
label: arrow.label,
|
|
10723
|
-
color: arrow.color,
|
|
10724
10530
|
lineNumber: arrow.lineNumber
|
|
10725
10531
|
});
|
|
10726
10532
|
}
|
|
@@ -10810,7 +10616,6 @@ var CONTAINER_RE3, METADATA_RE3, ARROW_RE, BARE_ARROW_RE;
|
|
|
10810
10616
|
var init_parser7 = __esm({
|
|
10811
10617
|
"src/sitemap/parser.ts"() {
|
|
10812
10618
|
"use strict";
|
|
10813
|
-
init_colors();
|
|
10814
10619
|
init_diagnostics();
|
|
10815
10620
|
init_name_normalize();
|
|
10816
10621
|
init_tag_groups();
|
|
@@ -10818,7 +10623,7 @@ var init_parser7 = __esm({
|
|
|
10818
10623
|
init_description_helpers();
|
|
10819
10624
|
CONTAINER_RE3 = /^\[([^\]]+)\]\s*(?:\|\s*(.+))?$/;
|
|
10820
10625
|
METADATA_RE3 = /^([^:]+):\s*(.+)$/;
|
|
10821
|
-
ARROW_RE = /^-([
|
|
10626
|
+
ARROW_RE = /^-([^>][^>]*?)?\s*->\s*(.+)$/;
|
|
10822
10627
|
BARE_ARROW_RE = /^->\s*(.+)$/;
|
|
10823
10628
|
}
|
|
10824
10629
|
});
|
|
@@ -11109,13 +10914,18 @@ function parseInfra(content) {
|
|
|
11109
10914
|
}
|
|
11110
10915
|
if (currentTagGroup && indent > 0) {
|
|
11111
10916
|
const { text: cleanEntry, isDefault } = stripDefaultModifier(trimmed);
|
|
11112
|
-
const
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
10917
|
+
const lastSpaceIdx = cleanEntry.lastIndexOf(" ");
|
|
10918
|
+
let valueName = cleanEntry;
|
|
10919
|
+
let rawColor;
|
|
10920
|
+
if (lastSpaceIdx > 0) {
|
|
10921
|
+
const trailing = cleanEntry.substring(lastSpaceIdx + 1);
|
|
10922
|
+
if (isRecognizedColorName(trailing)) {
|
|
10923
|
+
rawColor = trailing;
|
|
10924
|
+
valueName = cleanEntry.substring(0, lastSpaceIdx).trimEnd();
|
|
10925
|
+
}
|
|
10926
|
+
}
|
|
10927
|
+
const tvMatch = valueName.match(TAG_VALUE_RE);
|
|
10928
|
+
if (tvMatch || /^\w+$/.test(valueName)) {
|
|
11119
10929
|
currentTagGroup.values.push({
|
|
11120
10930
|
name: valueName,
|
|
11121
10931
|
color: rawColor
|
|
@@ -11527,9 +11337,9 @@ var init_parser8 = __esm({
|
|
|
11527
11337
|
"use strict";
|
|
11528
11338
|
init_diagnostics();
|
|
11529
11339
|
init_description_helpers();
|
|
11530
|
-
init_colors();
|
|
11531
11340
|
init_arrows();
|
|
11532
11341
|
init_parsing();
|
|
11342
|
+
init_colors();
|
|
11533
11343
|
init_name_normalize();
|
|
11534
11344
|
init_tag_groups();
|
|
11535
11345
|
init_types();
|
|
@@ -11539,7 +11349,7 @@ var init_parser8 = __esm({
|
|
|
11539
11349
|
ASYNC_SIMPLE_CONNECTION_RE = /^~>\s*(.+?)\s*$/;
|
|
11540
11350
|
DEPRECATED_FANOUT_RE = /\bx(\d+)\s*$/;
|
|
11541
11351
|
GROUP_RE = /^\[([^\]]+)\]\s*(?:as\s+([A-Za-z][A-Za-z0-9_]{0,11})\s*)?(?:\|\s*(.+))?$/;
|
|
11542
|
-
TAG_VALUE_RE = /^(\w[\w\s]
|
|
11352
|
+
TAG_VALUE_RE = /^(\w[\w\s]+?)\s*$/;
|
|
11543
11353
|
COMPONENT_RE = /^(?:"([^"]+)"|([a-zA-Z_][^|":]*?))\s*(\|.*)?$/;
|
|
11544
11354
|
PIPE_META_RE = /[|,]\s*(\w+)\s*:\s*([^|,]+)/g;
|
|
11545
11355
|
PROPERTY_RE = /^([\w-]+)\s+(.+)$/;
|
|
@@ -12976,7 +12786,7 @@ function parsePert(content, parseOpts = {}) {
|
|
|
12976
12786
|
if (!color) {
|
|
12977
12787
|
warn2(
|
|
12978
12788
|
lineNumber,
|
|
12979
|
-
`Expected 'Value
|
|
12789
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
12980
12790
|
);
|
|
12981
12791
|
continue;
|
|
12982
12792
|
}
|
|
@@ -12999,7 +12809,7 @@ function parsePert(content, parseOpts = {}) {
|
|
|
12999
12809
|
if (!color) {
|
|
13000
12810
|
warn2(
|
|
13001
12811
|
lineNumber,
|
|
13002
|
-
`Expected 'Value
|
|
12812
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
13003
12813
|
);
|
|
13004
12814
|
continue;
|
|
13005
12815
|
}
|
|
@@ -13143,7 +12953,7 @@ function parsePert(content, parseOpts = {}) {
|
|
|
13143
12953
|
const head = trimmed.slice(0, firstSpace).toLowerCase();
|
|
13144
12954
|
const value = trimmed.slice(firstSpace + 1).trim();
|
|
13145
12955
|
const hint = NEAR_DIRECTIVE_HINTS.find((h) => h.stem === head);
|
|
13146
|
-
if (hint
|
|
12956
|
+
if (hint?.matches.test(value)) {
|
|
13147
12957
|
error(
|
|
13148
12958
|
lineNumber,
|
|
13149
12959
|
`Unknown directive '${head}'. Did you mean '${hint.canonical}'?`,
|
|
@@ -14450,7 +14260,7 @@ function parseMindmap(content, palette) {
|
|
|
14450
14260
|
const pushWarning = (line12, message) => {
|
|
14451
14261
|
result.diagnostics.push(makeDgmoError(line12, message, "warning"));
|
|
14452
14262
|
};
|
|
14453
|
-
if (!content
|
|
14263
|
+
if (!content?.trim()) {
|
|
14454
14264
|
return fail(0, "No content provided");
|
|
14455
14265
|
}
|
|
14456
14266
|
const lines = content.split("\n");
|
|
@@ -14548,7 +14358,7 @@ function parseMindmap(content, palette) {
|
|
|
14548
14358
|
if (!color) {
|
|
14549
14359
|
pushError(
|
|
14550
14360
|
lineNumber,
|
|
14551
|
-
`Expected 'Value
|
|
14361
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
14552
14362
|
);
|
|
14553
14363
|
continue;
|
|
14554
14364
|
}
|
|
@@ -14621,7 +14431,7 @@ function parseMindmap(content, palette) {
|
|
|
14621
14431
|
const diag = makeDgmoError(1, "No nodes found in mindmap");
|
|
14622
14432
|
result.diagnostics.push(diag);
|
|
14623
14433
|
result.error = formatDgmoError(diag);
|
|
14624
|
-
} else if (titleRoot
|
|
14434
|
+
} else if (titleRoot?.children.length === 0 && result.roots.length === 1 && !result.error) {
|
|
14625
14435
|
}
|
|
14626
14436
|
return result;
|
|
14627
14437
|
}
|
|
@@ -15080,7 +14890,7 @@ function parseWireframe(content) {
|
|
|
15080
14890
|
const indent = measureIndent(line12);
|
|
15081
14891
|
if (phase === "header") {
|
|
15082
14892
|
const firstLineResult = parseFirstLine(trimmed);
|
|
15083
|
-
if (firstLineResult
|
|
14893
|
+
if (firstLineResult?.chartType === "wireframe") {
|
|
15084
14894
|
title = firstLineResult.title || null;
|
|
15085
14895
|
titleLineNumber = lineNumber;
|
|
15086
14896
|
continue;
|
|
@@ -15134,7 +14944,7 @@ function parseWireframe(content) {
|
|
|
15134
14944
|
} else {
|
|
15135
14945
|
pushWarning(
|
|
15136
14946
|
lineNumber,
|
|
15137
|
-
`Expected 'Value
|
|
14947
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
15138
14948
|
);
|
|
15139
14949
|
}
|
|
15140
14950
|
continue;
|
|
@@ -15375,7 +15185,7 @@ function parseTechRadar(content) {
|
|
|
15375
15185
|
const warn2 = (line12, message) => {
|
|
15376
15186
|
result.diagnostics.push(makeDgmoError(line12, message, "warning"));
|
|
15377
15187
|
};
|
|
15378
|
-
if (!content
|
|
15188
|
+
if (!content?.trim()) {
|
|
15379
15189
|
return fail(0, "No content provided");
|
|
15380
15190
|
}
|
|
15381
15191
|
function isRingName(name) {
|
|
@@ -15412,7 +15222,7 @@ function parseTechRadar(content) {
|
|
|
15412
15222
|
if (trimmed.startsWith("//")) continue;
|
|
15413
15223
|
if (!headerParsed) {
|
|
15414
15224
|
const firstLine = parseFirstLine(trimmed);
|
|
15415
|
-
if (firstLine
|
|
15225
|
+
if (firstLine?.chartType === "tech-radar") {
|
|
15416
15226
|
result.title = firstLine.title ?? "";
|
|
15417
15227
|
result.titleLineNumber = lineNumber;
|
|
15418
15228
|
headerParsed = true;
|
|
@@ -15704,7 +15514,7 @@ function parseCycle(content) {
|
|
|
15704
15514
|
const indent = measureIndent(raw);
|
|
15705
15515
|
if (!headerParsed) {
|
|
15706
15516
|
const firstLineResult = parseFirstLine(trimmed);
|
|
15707
|
-
if (firstLineResult
|
|
15517
|
+
if (firstLineResult?.chartType === "cycle") {
|
|
15708
15518
|
result.title = firstLineResult.title ?? "";
|
|
15709
15519
|
result.titleLineNumber = lineNum;
|
|
15710
15520
|
headerParsed = true;
|
|
@@ -15751,6 +15561,13 @@ function parseCycle(content) {
|
|
|
15751
15561
|
warn2(lineNum, "Empty node label.");
|
|
15752
15562
|
continue;
|
|
15753
15563
|
}
|
|
15564
|
+
if (!metadata["color"]) {
|
|
15565
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
15566
|
+
if (shortcutColor) {
|
|
15567
|
+
metadata["color"] = shortcutColor;
|
|
15568
|
+
label = stripped;
|
|
15569
|
+
}
|
|
15570
|
+
}
|
|
15754
15571
|
const color = metadata["color"];
|
|
15755
15572
|
const spanStr = metadata["span"];
|
|
15756
15573
|
let span = 1;
|
|
@@ -15921,7 +15738,7 @@ function parseJourneyMap(content, palette) {
|
|
|
15921
15738
|
const warn2 = (line12, message) => {
|
|
15922
15739
|
result.diagnostics.push(makeDgmoError(line12, message, "warning"));
|
|
15923
15740
|
};
|
|
15924
|
-
if (!content
|
|
15741
|
+
if (!content?.trim()) {
|
|
15925
15742
|
return fail(0, "No content provided");
|
|
15926
15743
|
}
|
|
15927
15744
|
const lines = content.split("\n");
|
|
@@ -15980,8 +15797,12 @@ function parseJourneyMap(content, palette) {
|
|
|
15980
15797
|
const key = part.substring(0, colonIdx).trim().toLowerCase();
|
|
15981
15798
|
const value = part.substring(colonIdx + 1).trim();
|
|
15982
15799
|
if (key === "color") {
|
|
15983
|
-
|
|
15984
|
-
|
|
15800
|
+
personaColor = resolveColorWithDiagnostic(
|
|
15801
|
+
value,
|
|
15802
|
+
lineNumber,
|
|
15803
|
+
result.diagnostics,
|
|
15804
|
+
palette
|
|
15805
|
+
) ?? void 0;
|
|
15985
15806
|
}
|
|
15986
15807
|
}
|
|
15987
15808
|
}
|
|
@@ -16039,7 +15860,7 @@ function parseJourneyMap(content, palette) {
|
|
|
16039
15860
|
if (!color) {
|
|
16040
15861
|
warn2(
|
|
16041
15862
|
lineNumber,
|
|
16042
|
-
`Expected 'Value
|
|
15863
|
+
`Expected 'Value color' in tag group '${currentTagGroup.name}'`
|
|
16043
15864
|
);
|
|
16044
15865
|
continue;
|
|
16045
15866
|
}
|
|
@@ -16282,6 +16103,7 @@ var PHASE_RE, SCORE_RE, ANNOTATION_RE, KNOWN_OPTIONS9, KNOWN_BOOLEANS6;
|
|
|
16282
16103
|
var init_parser16 = __esm({
|
|
16283
16104
|
"src/journey-map/parser.ts"() {
|
|
16284
16105
|
"use strict";
|
|
16106
|
+
init_colors();
|
|
16285
16107
|
init_diagnostics();
|
|
16286
16108
|
init_tag_groups();
|
|
16287
16109
|
init_parsing();
|
|
@@ -16336,7 +16158,7 @@ function parsePyramid(content) {
|
|
|
16336
16158
|
const indent = measureIndent(raw);
|
|
16337
16159
|
if (!headerParsed) {
|
|
16338
16160
|
const firstLineResult = parseFirstLine(trimmed);
|
|
16339
|
-
if (firstLineResult
|
|
16161
|
+
if (firstLineResult?.chartType === "pyramid") {
|
|
16340
16162
|
result.title = firstLineResult.title ?? "";
|
|
16341
16163
|
result.titleLineNumber = lineNum;
|
|
16342
16164
|
headerParsed = true;
|
|
@@ -16380,6 +16202,13 @@ function parsePyramid(content) {
|
|
|
16380
16202
|
warn2(lineNum, "Empty layer label.");
|
|
16381
16203
|
continue;
|
|
16382
16204
|
}
|
|
16205
|
+
if (!color) {
|
|
16206
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
16207
|
+
if (shortcutColor) {
|
|
16208
|
+
color = shortcutColor;
|
|
16209
|
+
label = stripped;
|
|
16210
|
+
}
|
|
16211
|
+
}
|
|
16383
16212
|
currentLayer = {
|
|
16384
16213
|
label,
|
|
16385
16214
|
lineNumber: lineNum,
|
|
@@ -16463,7 +16292,7 @@ function parseRing(content) {
|
|
|
16463
16292
|
const indent = measureIndent(raw);
|
|
16464
16293
|
if (!headerParsed) {
|
|
16465
16294
|
const firstLineResult = parseFirstLine(trimmed);
|
|
16466
|
-
if (firstLineResult
|
|
16295
|
+
if (firstLineResult?.chartType === "ring") {
|
|
16467
16296
|
result.title = firstLineResult.title ?? "";
|
|
16468
16297
|
result.titleLineNumber = lineNum;
|
|
16469
16298
|
headerParsed = true;
|
|
@@ -16543,6 +16372,13 @@ function parseRing(content) {
|
|
|
16543
16372
|
warn2(lineNum, "Empty layer label.");
|
|
16544
16373
|
continue;
|
|
16545
16374
|
}
|
|
16375
|
+
if (!color) {
|
|
16376
|
+
const { label: stripped, colorName: shortcutColor } = peelTrailingColorName(label);
|
|
16377
|
+
if (shortcutColor) {
|
|
16378
|
+
color = shortcutColor;
|
|
16379
|
+
label = stripped;
|
|
16380
|
+
}
|
|
16381
|
+
}
|
|
16546
16382
|
currentLayer = {
|
|
16547
16383
|
label,
|
|
16548
16384
|
lineNumber: lineNum,
|
|
@@ -16903,7 +16739,7 @@ function parseRaci(content, palette) {
|
|
|
16903
16739
|
const errorAt = (line12, message, code) => {
|
|
16904
16740
|
result.diagnostics.push(makeDgmoError(line12, message, "error", code));
|
|
16905
16741
|
};
|
|
16906
|
-
if (!content
|
|
16742
|
+
if (!content?.trim()) {
|
|
16907
16743
|
return fail(0, "No content provided");
|
|
16908
16744
|
}
|
|
16909
16745
|
const lines = content.split("\n");
|
|
@@ -17037,7 +16873,7 @@ function parseRaci(content, palette) {
|
|
|
17037
16873
|
if (next.length > 0 && next[0] !== " " && next[0] !== " ") break;
|
|
17038
16874
|
const stripped = nextTrim.replace(/,\s*$/, "");
|
|
17039
16875
|
const segments = stripped.split("|").map((s) => s.trim());
|
|
17040
|
-
|
|
16876
|
+
let roleLabel = segments[0] ?? "";
|
|
17041
16877
|
let roleColor;
|
|
17042
16878
|
if (segments.length > 1) {
|
|
17043
16879
|
const meta = parsePipeMetadata(segments);
|
|
@@ -17050,6 +16886,18 @@ function parseRaci(content, palette) {
|
|
|
17050
16886
|
);
|
|
17051
16887
|
}
|
|
17052
16888
|
}
|
|
16889
|
+
if (!roleColor) {
|
|
16890
|
+
const { label: stripLabel, colorName: shortcutColor } = peelTrailingColorName(roleLabel);
|
|
16891
|
+
if (shortcutColor) {
|
|
16892
|
+
roleColor = resolveColorWithDiagnostic(
|
|
16893
|
+
shortcutColor,
|
|
16894
|
+
j + 1,
|
|
16895
|
+
result.diagnostics,
|
|
16896
|
+
palette
|
|
16897
|
+
);
|
|
16898
|
+
roleLabel = stripLabel;
|
|
16899
|
+
}
|
|
16900
|
+
}
|
|
17053
16901
|
if (roleLabel) getOrAddRole(roleLabel, j + 1, roleColor);
|
|
17054
16902
|
}
|
|
17055
16903
|
i = j - 1;
|
|
@@ -17108,8 +16956,10 @@ function parseRaci(content, palette) {
|
|
|
17108
16956
|
continue;
|
|
17109
16957
|
}
|
|
17110
16958
|
let phaseColor;
|
|
17111
|
-
|
|
17112
|
-
|
|
16959
|
+
const trailingToken = phaseMatch[2];
|
|
16960
|
+
const pipeMeta = phaseMatch[3];
|
|
16961
|
+
if (pipeMeta) {
|
|
16962
|
+
const meta = parsePipeMetadata(["", pipeMeta]);
|
|
17113
16963
|
if (meta["color"]) {
|
|
17114
16964
|
phaseColor = resolveColorWithDiagnostic(
|
|
17115
16965
|
meta["color"],
|
|
@@ -17119,6 +16969,17 @@ function parseRaci(content, palette) {
|
|
|
17119
16969
|
);
|
|
17120
16970
|
}
|
|
17121
16971
|
}
|
|
16972
|
+
if (!phaseColor && trailingToken) {
|
|
16973
|
+
const { colorName } = peelTrailingColorName(`x ${trailingToken}`);
|
|
16974
|
+
if (colorName) {
|
|
16975
|
+
phaseColor = resolveColorWithDiagnostic(
|
|
16976
|
+
colorName,
|
|
16977
|
+
lineNumber,
|
|
16978
|
+
result.diagnostics,
|
|
16979
|
+
palette
|
|
16980
|
+
);
|
|
16981
|
+
}
|
|
16982
|
+
}
|
|
17122
16983
|
currentPhase = {
|
|
17123
16984
|
id: normalizeName(display),
|
|
17124
16985
|
displayName: display,
|
|
@@ -17199,7 +17060,7 @@ function parseRaci(content, palette) {
|
|
|
17199
17060
|
if (roleId === null) continue;
|
|
17200
17061
|
if (rolesExplicit) {
|
|
17201
17062
|
const entry = roleStore.get(roleId);
|
|
17202
|
-
if (entry
|
|
17063
|
+
if (entry?.declaredLine === lineNumber) {
|
|
17203
17064
|
const candidates = result.roleDisplayNames.filter(
|
|
17204
17065
|
(n) => n !== entry.displayName
|
|
17205
17066
|
);
|
|
@@ -17349,7 +17210,7 @@ var init_parser19 = __esm({
|
|
|
17349
17210
|
"no-title",
|
|
17350
17211
|
...Object.keys(VARIANT_LOCK_DIRECTIVES)
|
|
17351
17212
|
]);
|
|
17352
|
-
PHASE_RE2 = /^\[(.+?)\]
|
|
17213
|
+
PHASE_RE2 = /^\[(.+?)\](?:\s+(\S+))?(?:\s*\|\s*(.+))?\s*$/;
|
|
17353
17214
|
ROLE_ASSIGNMENT_RE = /^([^:]+):\s*(.*)$/;
|
|
17354
17215
|
}
|
|
17355
17216
|
});
|
|
@@ -19066,7 +18927,7 @@ function containerFill(palette, isDark, nodeColor2) {
|
|
|
19066
18927
|
function containerStroke(palette, nodeColor2) {
|
|
19067
18928
|
return nodeColor2 ?? palette.textMuted;
|
|
19068
18929
|
}
|
|
19069
|
-
function renderOrg(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, ancestorPath) {
|
|
18930
|
+
function renderOrg(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, ancestorPath, exportMode) {
|
|
19070
18931
|
d3Selection.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
19071
18932
|
const width = exportDims?.width ?? container.clientWidth;
|
|
19072
18933
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -19326,7 +19187,7 @@ function renderOrg(container, parsed, layout, palette, isDark, onClickItem, expo
|
|
|
19326
19187
|
}
|
|
19327
19188
|
],
|
|
19328
19189
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
19329
|
-
mode: "
|
|
19190
|
+
mode: exportMode ? "export" : "preview"
|
|
19330
19191
|
};
|
|
19331
19192
|
const singleState = { activeGroup: lg.name };
|
|
19332
19193
|
const groupG = legendParentBase.append("g").attr("transform", `translate(${lg.x}, ${lg.y})`);
|
|
@@ -19346,7 +19207,7 @@ function renderOrg(container, parsed, layout, palette, isDark, onClickItem, expo
|
|
|
19346
19207
|
const legendConfig = {
|
|
19347
19208
|
groups,
|
|
19348
19209
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
19349
|
-
mode: "
|
|
19210
|
+
mode: exportMode ? "export" : "preview",
|
|
19350
19211
|
capsulePillAddonWidth: eyeAddonWidth
|
|
19351
19212
|
};
|
|
19352
19213
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
@@ -19813,7 +19674,6 @@ function layoutSitemap(parsed, hiddenCounts, activeTagGroup, hiddenAttributes, e
|
|
|
19813
19674
|
targetId: edge.targetId,
|
|
19814
19675
|
points,
|
|
19815
19676
|
label: edge.label,
|
|
19816
|
-
color: edge.color,
|
|
19817
19677
|
lineNumber: edge.lineNumber,
|
|
19818
19678
|
deferred: deferredSet.has(i) || void 0
|
|
19819
19679
|
});
|
|
@@ -20270,7 +20130,7 @@ function containerFill2(palette, isDark, nodeColor2) {
|
|
|
20270
20130
|
function containerStroke2(palette, nodeColor2) {
|
|
20271
20131
|
return nodeColor2 ?? palette.textMuted;
|
|
20272
20132
|
}
|
|
20273
|
-
function renderSitemap(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes) {
|
|
20133
|
+
function renderSitemap(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, hiddenAttributes, exportMode) {
|
|
20274
20134
|
d3Selection2.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
20275
20135
|
const width = exportDims?.width ?? container.clientWidth;
|
|
20276
20136
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -20301,9 +20161,6 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20301
20161
|
const defs = svg.append("defs");
|
|
20302
20162
|
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
20163
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
20304
|
-
for (const edge of layout.edges) {
|
|
20305
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
20306
|
-
}
|
|
20307
20164
|
for (const color of edgeColors) {
|
|
20308
20165
|
const id = `sm-arrow-${color.replace("#", "")}`;
|
|
20309
20166
|
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 +20239,8 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20382
20239
|
for (const edge of layout.edges) {
|
|
20383
20240
|
if (edge.points.length < 2) continue;
|
|
20384
20241
|
const edgeG = contentG.append("g").attr("class", "sitemap-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
20385
|
-
const edgeColor3 =
|
|
20386
|
-
const markerId =
|
|
20242
|
+
const edgeColor3 = palette.textMuted;
|
|
20243
|
+
const markerId = "sm-arrow";
|
|
20387
20244
|
const gen = edge.deferred ? lineGeneratorLinear : lineGenerator;
|
|
20388
20245
|
const pathD = gen(edge.points);
|
|
20389
20246
|
if (pathD) {
|
|
@@ -20464,7 +20321,8 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20464
20321
|
isDark,
|
|
20465
20322
|
activeTagGroup,
|
|
20466
20323
|
void 0,
|
|
20467
|
-
hiddenAttributes
|
|
20324
|
+
hiddenAttributes,
|
|
20325
|
+
exportMode
|
|
20468
20326
|
);
|
|
20469
20327
|
}
|
|
20470
20328
|
if (fixedTitle) {
|
|
@@ -20489,11 +20347,12 @@ function renderSitemap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
20489
20347
|
isDark,
|
|
20490
20348
|
activeTagGroup,
|
|
20491
20349
|
width,
|
|
20492
|
-
hiddenAttributes
|
|
20350
|
+
hiddenAttributes,
|
|
20351
|
+
exportMode
|
|
20493
20352
|
);
|
|
20494
20353
|
}
|
|
20495
20354
|
}
|
|
20496
|
-
function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fixedWidth, hiddenAttributes) {
|
|
20355
|
+
function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fixedWidth, hiddenAttributes, exportMode) {
|
|
20497
20356
|
if (legendGroups.length === 0) return;
|
|
20498
20357
|
const groups = legendGroups.map((g) => ({
|
|
20499
20358
|
name: g.name,
|
|
@@ -20504,7 +20363,7 @@ function renderLegend(parent, legendGroups, palette, isDark, activeTagGroup, fix
|
|
|
20504
20363
|
const legendConfig = {
|
|
20505
20364
|
groups,
|
|
20506
20365
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
20507
|
-
mode: "
|
|
20366
|
+
mode: exportMode ? "export" : "preview",
|
|
20508
20367
|
capsulePillAddonWidth: eyeAddonWidth
|
|
20509
20368
|
};
|
|
20510
20369
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
@@ -20789,7 +20648,7 @@ function renderKanban(container, parsed, palette, isDark, options) {
|
|
|
20789
20648
|
const legendConfig = {
|
|
20790
20649
|
groups: parsed.tagGroups,
|
|
20791
20650
|
position: { placement: "top-center", titleRelation: "inline-with-title" },
|
|
20792
|
-
mode:
|
|
20651
|
+
mode: options?.exportMode ? "export" : "preview"
|
|
20793
20652
|
};
|
|
20794
20653
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
20795
20654
|
const legendG = svg.append("g").attr("class", "kanban-legend").attr("transform", `translate(${legendX},${legendY})`);
|
|
@@ -20947,7 +20806,8 @@ function renderKanbanForExport(content, theme, palette) {
|
|
|
20947
20806
|
const layout = computeLayout(parsed, palette);
|
|
20948
20807
|
const container = document.createElement("div");
|
|
20949
20808
|
renderKanban(container, parsed, palette, isDark, {
|
|
20950
|
-
exportDims: { width: layout.totalWidth, height: layout.totalHeight }
|
|
20809
|
+
exportDims: { width: layout.totalWidth, height: layout.totalHeight },
|
|
20810
|
+
exportMode: true
|
|
20951
20811
|
});
|
|
20952
20812
|
const svgEl = container.querySelector("svg");
|
|
20953
20813
|
return svgEl?.outerHTML ?? "";
|
|
@@ -21486,7 +21346,7 @@ function markerIdForType(type) {
|
|
|
21486
21346
|
function isSourceMarker(type) {
|
|
21487
21347
|
return type === "composes" || type === "aggregates";
|
|
21488
21348
|
}
|
|
21489
|
-
function renderClassDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, legendActive) {
|
|
21349
|
+
function renderClassDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, legendActive, exportMode) {
|
|
21490
21350
|
d3Selection4.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
21491
21351
|
const width = exportDims?.width ?? container.clientWidth;
|
|
21492
21352
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -21548,7 +21408,7 @@ function renderClassDiagram(container, parsed, layout, palette, isDark, onClickI
|
|
|
21548
21408
|
const legendConfig = {
|
|
21549
21409
|
groups: legendGroups,
|
|
21550
21410
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
21551
|
-
mode: "
|
|
21411
|
+
mode: exportMode ? "export" : "preview"
|
|
21552
21412
|
};
|
|
21553
21413
|
const legendState = {
|
|
21554
21414
|
activeGroup: isLegendExpanded ? LEGEND_GROUP_NAME : null
|
|
@@ -21688,10 +21548,22 @@ function renderClassDiagramForExport(content, theme, palette) {
|
|
|
21688
21548
|
const exportWidth = layout.width + DIAGRAM_PADDING4 * 2;
|
|
21689
21549
|
const exportHeight = layout.height + DIAGRAM_PADDING4 * 2 + (parsed.title ? 40 : 0) + legendReserve;
|
|
21690
21550
|
return runInExportContainer(exportWidth, exportHeight, (container) => {
|
|
21691
|
-
renderClassDiagram(
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21551
|
+
renderClassDiagram(
|
|
21552
|
+
container,
|
|
21553
|
+
parsed,
|
|
21554
|
+
layout,
|
|
21555
|
+
palette,
|
|
21556
|
+
isDark,
|
|
21557
|
+
void 0,
|
|
21558
|
+
{
|
|
21559
|
+
width: exportWidth,
|
|
21560
|
+
height: exportHeight
|
|
21561
|
+
},
|
|
21562
|
+
true,
|
|
21563
|
+
// legendActive for export
|
|
21564
|
+
true
|
|
21565
|
+
// exportMode
|
|
21566
|
+
);
|
|
21695
21567
|
return extractExportSvg(container, theme);
|
|
21696
21568
|
});
|
|
21697
21569
|
}
|
|
@@ -22167,7 +22039,7 @@ function drawCardinality(g, point, prevPoint, cardinality, color, useLabels) {
|
|
|
22167
22039
|
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
22040
|
}
|
|
22169
22041
|
}
|
|
22170
|
-
function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, semanticColorsActive) {
|
|
22042
|
+
function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, semanticColorsActive, exportMode) {
|
|
22171
22043
|
d3Selection5.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
22172
22044
|
const useSemanticColors = parsed.tagGroups.length === 0 && layout.nodes.every((n) => !n.color);
|
|
22173
22045
|
const LEGEND_FIXED_GAP4 = 8;
|
|
@@ -22323,7 +22195,7 @@ function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem
|
|
|
22323
22195
|
const legendConfig = {
|
|
22324
22196
|
groups: parsed.tagGroups,
|
|
22325
22197
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22326
|
-
mode: "
|
|
22198
|
+
mode: exportMode ? "export" : "preview"
|
|
22327
22199
|
};
|
|
22328
22200
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
22329
22201
|
const legendG = svg.append("g").attr("class", "er-tag-legend").attr("transform", `translate(0,${legendY})`);
|
|
@@ -22359,7 +22231,7 @@ function renderERDiagram(container, parsed, layout, palette, isDark, onClickItem
|
|
|
22359
22231
|
const legendConfig = {
|
|
22360
22232
|
groups: semanticGroups,
|
|
22361
22233
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22362
|
-
mode: "
|
|
22234
|
+
mode: exportMode ? "export" : "preview"
|
|
22363
22235
|
};
|
|
22364
22236
|
const legendState = {
|
|
22365
22237
|
activeGroup: semanticActive ? "Role" : null
|
|
@@ -22392,10 +22264,21 @@ function renderERDiagramForExport(content, theme, palette) {
|
|
|
22392
22264
|
container.style.left = "-9999px";
|
|
22393
22265
|
document.body.appendChild(container);
|
|
22394
22266
|
try {
|
|
22395
|
-
renderERDiagram(
|
|
22396
|
-
|
|
22397
|
-
|
|
22398
|
-
|
|
22267
|
+
renderERDiagram(
|
|
22268
|
+
container,
|
|
22269
|
+
parsed,
|
|
22270
|
+
layout,
|
|
22271
|
+
palette,
|
|
22272
|
+
isDark,
|
|
22273
|
+
void 0,
|
|
22274
|
+
{
|
|
22275
|
+
width: exportWidth,
|
|
22276
|
+
height: exportHeight
|
|
22277
|
+
},
|
|
22278
|
+
void 0,
|
|
22279
|
+
void 0,
|
|
22280
|
+
true
|
|
22281
|
+
);
|
|
22399
22282
|
const svgEl = container.querySelector("svg");
|
|
22400
22283
|
if (!svgEl) return "";
|
|
22401
22284
|
if (theme === "transparent") {
|
|
@@ -22630,7 +22513,8 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
|
|
|
22630
22513
|
hideDescriptions,
|
|
22631
22514
|
controlsExpanded,
|
|
22632
22515
|
onToggleDescriptions,
|
|
22633
|
-
onToggleControlsExpand
|
|
22516
|
+
onToggleControlsExpand,
|
|
22517
|
+
exportMode = false
|
|
22634
22518
|
} = options ?? {};
|
|
22635
22519
|
d3Selection6.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
22636
22520
|
const width = exportDims?.width ?? container.clientWidth;
|
|
@@ -22966,7 +22850,7 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
|
|
|
22966
22850
|
const legendConfig = {
|
|
22967
22851
|
groups: parsed.tagGroups,
|
|
22968
22852
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
22969
|
-
mode: "
|
|
22853
|
+
mode: exportMode ? "export" : "preview",
|
|
22970
22854
|
controlsGroup
|
|
22971
22855
|
};
|
|
22972
22856
|
const legendState = {
|
|
@@ -22998,7 +22882,8 @@ function renderBoxesAndLinesForExport(container, parsed, layout, palette, isDark
|
|
|
22998
22882
|
renderBoxesAndLines(container, parsed, layout, palette, isDark, {
|
|
22999
22883
|
exportDims: options?.exportDims,
|
|
23000
22884
|
activeTagGroup: options?.activeTagGroup,
|
|
23001
|
-
hiddenTagValues: options?.hiddenTagValues
|
|
22885
|
+
hiddenTagValues: options?.hiddenTagValues,
|
|
22886
|
+
exportMode: options?.exportMode
|
|
23002
22887
|
});
|
|
23003
22888
|
}
|
|
23004
22889
|
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;
|
|
@@ -23457,8 +23342,7 @@ async function layoutBoxesAndLines(parsed, collapseInfo, layoutOptions) {
|
|
|
23457
23342
|
const edge = parsed.edges[i];
|
|
23458
23343
|
if (edgeParallelCounts[i] === 0) continue;
|
|
23459
23344
|
const elkEdge = edgeById.get(`e${i}`);
|
|
23460
|
-
if (!elkEdge
|
|
23461
|
-
continue;
|
|
23345
|
+
if (!elkEdge?.sections || elkEdge.sections.length === 0) continue;
|
|
23462
23346
|
const container = elkEdge.container ?? "root";
|
|
23463
23347
|
const off = containerAbs.get(container) ?? { x: 0, y: 0 };
|
|
23464
23348
|
const s = elkEdge.sections[0];
|
|
@@ -24235,7 +24119,7 @@ function renderMindmap(container, parsed, layout, palette, isDark, onClickItem,
|
|
|
24235
24119
|
};
|
|
24236
24120
|
}),
|
|
24237
24121
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
24238
|
-
mode: "
|
|
24122
|
+
mode: options?.exportMode ? "export" : "preview",
|
|
24239
24123
|
controlsGroup: controlsToggles
|
|
24240
24124
|
};
|
|
24241
24125
|
const legendState = {
|
|
@@ -27038,7 +26922,7 @@ function drawPersonIcon(g, cx, cy, color) {
|
|
|
27038
26922
|
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
26923
|
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
26924
|
}
|
|
27041
|
-
function renderC4Context(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
26925
|
+
function renderC4Context(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27042
26926
|
d3Selection9.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
27043
26927
|
const width = exportDims?.width ?? container.clientWidth;
|
|
27044
26928
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -27214,7 +27098,8 @@ function renderC4Context(container, parsed, layout, palette, isDark, onClickItem
|
|
|
27214
27098
|
palette,
|
|
27215
27099
|
isDark,
|
|
27216
27100
|
activeTagGroup,
|
|
27217
|
-
fixedLegend ? width : null
|
|
27101
|
+
fixedLegend ? width : null,
|
|
27102
|
+
exportMode
|
|
27218
27103
|
);
|
|
27219
27104
|
}
|
|
27220
27105
|
}
|
|
@@ -27569,7 +27454,7 @@ function placeEdgeLabels(labels, edges, obstacleRects) {
|
|
|
27569
27454
|
placedRects.push({ x: lbl.x, y: lbl.y, w: lbl.bgW, h: lbl.bgH });
|
|
27570
27455
|
}
|
|
27571
27456
|
}
|
|
27572
|
-
function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWidth) {
|
|
27457
|
+
function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWidth, exportMode) {
|
|
27573
27458
|
const groups = layout.legend.map((g) => ({
|
|
27574
27459
|
name: g.name,
|
|
27575
27460
|
entries: g.entries.map((e) => ({ value: e.value, color: e.color }))
|
|
@@ -27577,7 +27462,7 @@ function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWid
|
|
|
27577
27462
|
const legendConfig = {
|
|
27578
27463
|
groups,
|
|
27579
27464
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
27580
|
-
mode: "
|
|
27465
|
+
mode: exportMode ? "export" : "preview"
|
|
27581
27466
|
};
|
|
27582
27467
|
const legendState = { activeGroup: activeTagGroup ?? null };
|
|
27583
27468
|
const containerWidth = fixedWidth ?? layout.width;
|
|
@@ -27592,7 +27477,7 @@ function renderLegend2(parent, layout, palette, isDark, activeTagGroup, fixedWid
|
|
|
27592
27477
|
);
|
|
27593
27478
|
parent.selectAll("[data-legend-group]").classed("c4-legend-group", true);
|
|
27594
27479
|
}
|
|
27595
|
-
function renderC4Containers(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
27480
|
+
function renderC4Containers(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27596
27481
|
d3Selection9.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
27597
27482
|
const width = exportDims?.width ?? container.clientWidth;
|
|
27598
27483
|
const height = exportDims?.height ?? container.clientHeight;
|
|
@@ -27823,7 +27708,8 @@ function renderC4Containers(container, parsed, layout, palette, isDark, onClickI
|
|
|
27823
27708
|
palette,
|
|
27824
27709
|
isDark,
|
|
27825
27710
|
activeTagGroup,
|
|
27826
|
-
fixedLegend ? width : null
|
|
27711
|
+
fixedLegend ? width : null,
|
|
27712
|
+
exportMode
|
|
27827
27713
|
);
|
|
27828
27714
|
}
|
|
27829
27715
|
}
|
|
@@ -27891,7 +27777,7 @@ function renderC4ComponentsForExport(content, systemName, containerName, theme,
|
|
|
27891
27777
|
document.body.removeChild(el);
|
|
27892
27778
|
}
|
|
27893
27779
|
}
|
|
27894
|
-
function renderC4Deployment(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup) {
|
|
27780
|
+
function renderC4Deployment(container, parsed, layout, palette, isDark, onClickItem, exportDims, activeTagGroup, exportMode) {
|
|
27895
27781
|
renderC4Containers(
|
|
27896
27782
|
container,
|
|
27897
27783
|
parsed,
|
|
@@ -27900,7 +27786,8 @@ function renderC4Deployment(container, parsed, layout, palette, isDark, onClickI
|
|
|
27900
27786
|
isDark,
|
|
27901
27787
|
onClickItem,
|
|
27902
27788
|
exportDims,
|
|
27903
|
-
activeTagGroup
|
|
27789
|
+
activeTagGroup,
|
|
27790
|
+
exportMode
|
|
27904
27791
|
);
|
|
27905
27792
|
}
|
|
27906
27793
|
function renderC4DeploymentForExport(content, theme, palette) {
|
|
@@ -28081,7 +27968,6 @@ function layoutGraph(graph, options) {
|
|
|
28081
27968
|
target: edge.target,
|
|
28082
27969
|
points: edgeData?.points ?? [],
|
|
28083
27970
|
label: edge.label,
|
|
28084
|
-
color: edge.color,
|
|
28085
27971
|
lineNumber: edge.lineNumber
|
|
28086
27972
|
};
|
|
28087
27973
|
});
|
|
@@ -28383,6 +28269,8 @@ function renderNodeShape(g, node, palette, isDark, endTerminalIds, colorOff, sol
|
|
|
28383
28269
|
case "document":
|
|
28384
28270
|
renderDocument(g, node, palette, isDark, colorOff, solid);
|
|
28385
28271
|
break;
|
|
28272
|
+
default:
|
|
28273
|
+
break;
|
|
28386
28274
|
}
|
|
28387
28275
|
}
|
|
28388
28276
|
function renderFlowchart(container, graph, layout, palette, isDark, onClickItem, exportDims) {
|
|
@@ -28405,9 +28293,6 @@ function renderFlowchart(container, graph, layout, palette, isDark, onClickItem,
|
|
|
28405
28293
|
const defs = svg.append("defs");
|
|
28406
28294
|
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
28295
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
28408
|
-
for (const edge of layout.edges) {
|
|
28409
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
28410
|
-
}
|
|
28411
28296
|
for (const color of edgeColors) {
|
|
28412
28297
|
const id = `fc-arrow-${color.replace("#", "")}`;
|
|
28413
28298
|
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 +28356,8 @@ function renderFlowchart(container, graph, layout, palette, isDark, onClickItem,
|
|
|
28471
28356
|
const edge = layout.edges[ei];
|
|
28472
28357
|
if (edge.points.length < 2) continue;
|
|
28473
28358
|
const edgeG = contentG.append("g").attr("class", "fc-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
28474
|
-
const edgeColor3 =
|
|
28475
|
-
const markerId =
|
|
28359
|
+
const edgeColor3 = palette.textMuted;
|
|
28360
|
+
const markerId = "fc-arrow";
|
|
28476
28361
|
const pathD = lineGenerator5(edge.points);
|
|
28477
28362
|
if (pathD) {
|
|
28478
28363
|
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");
|
|
@@ -30956,7 +30841,7 @@ function renderNodes(svg, nodes, palette, isDark, animate, expandedNodeIds, acti
|
|
|
30956
30841
|
const badgeText = `${node.computedInstances}x`;
|
|
30957
30842
|
g.append("text").attr("x", x + node.width - 6).attr("y", y + NODE_HEADER_HEIGHT2 / 2 + META_FONT_SIZE4 * 0.35).attr("text-anchor", "end").attr("font-family", FONT_FAMILY).attr("font-size", META_FONT_SIZE4).attr("fill", textFill).attr("data-instance-node", node.id).style("cursor", "pointer").text(badgeText);
|
|
30958
30843
|
}
|
|
30959
|
-
const showDots = activeGroup
|
|
30844
|
+
const showDots = activeGroup?.toLowerCase() === "capabilities";
|
|
30960
30845
|
const roles = showDots && !node.isEdge ? inferRoles(node.properties) : [];
|
|
30961
30846
|
if (roles.length > 0) {
|
|
30962
30847
|
const dotY = isCollapsedGroup ? y + node.height - COLLAPSE_BAR_HEIGHT6 - NODE_PAD_BOTTOM2 / 2 : y + node.height - NODE_PAD_BOTTOM2 / 2;
|
|
@@ -31096,7 +30981,7 @@ function computeInfraLegendGroups(nodes, tagGroups, palette, edges) {
|
|
|
31096
30981
|
}
|
|
31097
30982
|
return groups;
|
|
31098
30983
|
}
|
|
31099
|
-
function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDark, activeGroup, playback) {
|
|
30984
|
+
function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDark, activeGroup, playback, exportMode = false) {
|
|
31100
30985
|
if (legendGroups.length === 0 && !playback) return;
|
|
31101
30986
|
const legendG = rootSvg.append("g").attr("transform", `translate(0, ${legendY})`);
|
|
31102
30987
|
if (activeGroup) {
|
|
@@ -31112,7 +30997,7 @@ function renderLegend3(rootSvg, legendGroups, totalWidth, legendY, palette, isDa
|
|
|
31112
30997
|
const legendConfig = {
|
|
31113
30998
|
groups: allGroups,
|
|
31114
30999
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
31115
|
-
mode: "
|
|
31000
|
+
mode: exportMode ? "export" : "preview",
|
|
31116
31001
|
showEmptyGroups: true
|
|
31117
31002
|
};
|
|
31118
31003
|
const legendState = { activeGroup };
|
|
@@ -31300,7 +31185,8 @@ function renderInfra(container, layout, palette, isDark, title, titleLineNumber,
|
|
|
31300
31185
|
palette,
|
|
31301
31186
|
isDark,
|
|
31302
31187
|
activeGroup ?? null,
|
|
31303
|
-
playback ?? void 0
|
|
31188
|
+
playback ?? void 0,
|
|
31189
|
+
exportMode
|
|
31304
31190
|
);
|
|
31305
31191
|
legendSvg.selectAll(".infra-legend-group").style("pointer-events", "auto");
|
|
31306
31192
|
} else {
|
|
@@ -31312,7 +31198,8 @@ function renderInfra(container, layout, palette, isDark, title, titleLineNumber,
|
|
|
31312
31198
|
palette,
|
|
31313
31199
|
isDark,
|
|
31314
31200
|
activeGroup ?? null,
|
|
31315
|
-
playback ?? void 0
|
|
31201
|
+
playback ?? void 0,
|
|
31202
|
+
exportMode
|
|
31316
31203
|
);
|
|
31317
31204
|
}
|
|
31318
31205
|
}
|
|
@@ -31751,7 +31638,7 @@ function analyzePert(parsed) {
|
|
|
31751
31638
|
for (const e of edges) {
|
|
31752
31639
|
if (!e.lag || e.lag.amount >= 0) continue;
|
|
31753
31640
|
const src = activities.find((a) => a.id === e.source);
|
|
31754
|
-
if (!src
|
|
31641
|
+
if (!src?.duration) continue;
|
|
31755
31642
|
const leadDays = -toDays(e.lag, sprintDays);
|
|
31756
31643
|
const srcDurDays = toDays(src.duration.m, sprintDays);
|
|
31757
31644
|
if (e.type === "FS" && leadDays > srcDurDays) {
|
|
@@ -32257,7 +32144,7 @@ function buildSummary(input) {
|
|
|
32257
32144
|
const anchor = input.anchor ?? null;
|
|
32258
32145
|
if (parsedActivities.length === 0) return null;
|
|
32259
32146
|
if (projectMu === null) {
|
|
32260
|
-
if (anchor
|
|
32147
|
+
if (anchor?.kind === "backward") {
|
|
32261
32148
|
return [
|
|
32262
32149
|
{ text: "Expected duration: ?", level: 0 },
|
|
32263
32150
|
{ text: "P50 latest-safe start: ?", level: 0 },
|
|
@@ -32280,13 +32167,13 @@ function buildSummary(input) {
|
|
|
32280
32167
|
const sigmaPositive = projectSigma !== null && projectSigma > 0;
|
|
32281
32168
|
const showMcDetail = mc && sigmaPositive;
|
|
32282
32169
|
const sigmaParen = showMcDetail ? ` (\xB1 ${roundForCaption(projectSigma)} ${pluralizeUnit(projectSigma, unit)})` : "";
|
|
32283
|
-
if (anchor
|
|
32170
|
+
if (anchor?.kind === "forward") {
|
|
32284
32171
|
const projectMuDays = projectMu * unitToDays(unit);
|
|
32285
32172
|
rows.push({
|
|
32286
32173
|
text: `Expected finish: ${addCalendarDays(anchor.date, projectMuDays)}${sigmaParen}.`,
|
|
32287
32174
|
level: 0
|
|
32288
32175
|
});
|
|
32289
|
-
} else if (anchor
|
|
32176
|
+
} else if (anchor?.kind === "backward") {
|
|
32290
32177
|
const projectMuDays = projectMu * unitToDays(unit);
|
|
32291
32178
|
rows.push({
|
|
32292
32179
|
text: `Expected start: ${addCalendarDays(anchor.date, -projectMuDays)}${sigmaParen}.`,
|
|
@@ -32305,13 +32192,13 @@ function buildSummary(input) {
|
|
|
32305
32192
|
{ pct: 80, days: monteCarloResult.p80 },
|
|
32306
32193
|
{ pct: 95, days: monteCarloResult.p95 }
|
|
32307
32194
|
];
|
|
32308
|
-
if (anchor
|
|
32195
|
+
if (anchor?.kind === "forward") {
|
|
32309
32196
|
for (const { pct, days } of percentiles) {
|
|
32310
32197
|
const offsetDays = roundConservative(days, "forward");
|
|
32311
32198
|
const date = addCalendarDays(anchor.date, offsetDays);
|
|
32312
32199
|
rows.push({ text: `P${pct} finish: ${date}.`, level: 1 });
|
|
32313
32200
|
}
|
|
32314
|
-
} else if (anchor
|
|
32201
|
+
} else if (anchor?.kind === "backward") {
|
|
32315
32202
|
for (const { pct, days } of percentiles) {
|
|
32316
32203
|
const offsetDays = roundConservative(days, "backward");
|
|
32317
32204
|
const date = addCalendarDays(anchor.date, -offsetDays);
|
|
@@ -32355,20 +32242,20 @@ function buildProjectSubtitle(input) {
|
|
|
32355
32242
|
const sigmaPositive = projectSigma !== null && projectSigma > 0;
|
|
32356
32243
|
const sigmaParen = sigmaPositive ? ` (\xB1 ${roundForCaption(projectSigma)})` : "";
|
|
32357
32244
|
if (projectMu === null) {
|
|
32358
|
-
if (anchor
|
|
32245
|
+
if (anchor?.kind === "forward") {
|
|
32359
32246
|
return `Expected finish: ? \xB7 \u2248 ? ${pluralizeUnit(2, unit)} of work`;
|
|
32360
32247
|
}
|
|
32361
|
-
if (anchor
|
|
32248
|
+
if (anchor?.kind === "backward") {
|
|
32362
32249
|
return `Expected start: ? \xB7 \u2248 ? ${pluralizeUnit(2, unit)} lead time`;
|
|
32363
32250
|
}
|
|
32364
32251
|
return `\u2248 ? ${pluralizeUnit(2, unit)}`;
|
|
32365
32252
|
}
|
|
32366
32253
|
const muStr = `${roundForCaption(projectMu)} ${pluralizeUnit(projectMu, unit)}`;
|
|
32367
|
-
if (anchor
|
|
32254
|
+
if (anchor?.kind === "forward") {
|
|
32368
32255
|
const projectMuDays = projectMu * unitToDays(unit);
|
|
32369
32256
|
return `Expected finish: ${addCalendarDays(anchor.date, projectMuDays)} \xB7 \u2248 ${muStr} of work${sigmaParen}`;
|
|
32370
32257
|
}
|
|
32371
|
-
if (anchor
|
|
32258
|
+
if (anchor?.kind === "backward") {
|
|
32372
32259
|
const projectMuDays = projectMu * unitToDays(unit);
|
|
32373
32260
|
return `Expected start: ${addCalendarDays(anchor.date, -projectMuDays)} \xB7 \u2248 ${muStr} lead time${sigmaParen}`;
|
|
32374
32261
|
}
|
|
@@ -32559,7 +32446,7 @@ function computeNodeSizing(resolved) {
|
|
|
32559
32446
|
return { activityWidth, milestoneWidth, outerColW, midColW };
|
|
32560
32447
|
}
|
|
32561
32448
|
function nodeDimensions(resolved, id, sizing, overrides) {
|
|
32562
|
-
if (overrides
|
|
32449
|
+
if (overrides?.[id]) {
|
|
32563
32450
|
return { width: overrides[id].width, height: overrides[id].height };
|
|
32564
32451
|
}
|
|
32565
32452
|
const r = resolved.activities.find((a) => a.activity.id === id);
|
|
@@ -33211,7 +33098,8 @@ function renderPert(container, resolved, layout, palette, isDark, options = {})
|
|
|
33211
33098
|
x: 0,
|
|
33212
33099
|
y: tagLegendY,
|
|
33213
33100
|
width: exportWidth,
|
|
33214
|
-
activeGroup: tagLegendActive
|
|
33101
|
+
activeGroup: tagLegendActive,
|
|
33102
|
+
exportMode: options.exportMode
|
|
33215
33103
|
});
|
|
33216
33104
|
}
|
|
33217
33105
|
const root = svg.append("g").attr("transform", `translate(${offsetX}, ${offsetY})`);
|
|
@@ -33272,7 +33160,8 @@ function renderPertForExport(content, theme, palette, now) {
|
|
|
33272
33160
|
renderPert(container, resolved, layout, palette, isDark, {
|
|
33273
33161
|
title: hasTitle ? parsed.title : null,
|
|
33274
33162
|
subtitle: resolved.projectSubtitle,
|
|
33275
|
-
exportDims: { width: exportWidth, height: exportHeight }
|
|
33163
|
+
exportDims: { width: exportWidth, height: exportHeight },
|
|
33164
|
+
exportMode: true
|
|
33276
33165
|
});
|
|
33277
33166
|
const svgEl = container.querySelector("svg");
|
|
33278
33167
|
if (!svgEl) return "";
|
|
@@ -34359,7 +34248,7 @@ function renderLegendBlock(svg, entries, args) {
|
|
|
34359
34248
|
}
|
|
34360
34249
|
function renderTagLegendRow(svg, resolved, palette, isDark, args) {
|
|
34361
34250
|
if (resolved.tagGroups.length === 0) return;
|
|
34362
|
-
const { x, y, width, activeGroup } = args;
|
|
34251
|
+
const { x, y, width, activeGroup, exportMode } = args;
|
|
34363
34252
|
const groups = resolved.tagGroups.map((g) => ({
|
|
34364
34253
|
name: g.name,
|
|
34365
34254
|
entries: g.entries.map((e) => ({ value: e.value, color: e.color }))
|
|
@@ -34370,7 +34259,7 @@ function renderTagLegendRow(svg, resolved, palette, isDark, args) {
|
|
|
34370
34259
|
{
|
|
34371
34260
|
groups,
|
|
34372
34261
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
34373
|
-
mode: "
|
|
34262
|
+
mode: exportMode ? "export" : "preview"
|
|
34374
34263
|
},
|
|
34375
34264
|
{ activeGroup },
|
|
34376
34265
|
palette,
|
|
@@ -35810,7 +35699,8 @@ function renderGantt(container, resolved, palette, isDark, options, exportDims)
|
|
|
35810
35699
|
).attr("display", active ? null : "none");
|
|
35811
35700
|
}
|
|
35812
35701
|
drawLegend();
|
|
35813
|
-
}
|
|
35702
|
+
},
|
|
35703
|
+
options?.exportMode ?? false
|
|
35814
35704
|
);
|
|
35815
35705
|
}
|
|
35816
35706
|
}
|
|
@@ -36599,7 +36489,7 @@ function buildControlsToggles(hasCriticalPath, criticalPathActive, hasDependenci
|
|
|
36599
36489
|
}
|
|
36600
36490
|
return toggles;
|
|
36601
36491
|
}
|
|
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) {
|
|
36492
|
+
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
36493
|
let visibleGroups;
|
|
36604
36494
|
if (activeGroupName) {
|
|
36605
36495
|
const activeGroup = tagGroups.filter(
|
|
@@ -36694,7 +36584,7 @@ function renderTagLegend(svg, chartG, tagGroups, activeGroupName, chartLeftMargi
|
|
|
36694
36584
|
placement: "top-center",
|
|
36695
36585
|
titleRelation: "below-title"
|
|
36696
36586
|
},
|
|
36697
|
-
mode: "
|
|
36587
|
+
mode: exportMode ? "export" : "preview",
|
|
36698
36588
|
capsulePillAddonWidth: iconReserve,
|
|
36699
36589
|
controlsGroup: controlsToggles.length > 0 ? { toggles: controlsToggles } : void 0
|
|
36700
36590
|
};
|
|
@@ -36801,7 +36691,7 @@ function renderTagLegend(svg, chartG, tagGroups, activeGroupName, chartLeftMargi
|
|
|
36801
36691
|
placement: "top-center",
|
|
36802
36692
|
titleRelation: "below-title"
|
|
36803
36693
|
},
|
|
36804
|
-
mode: "
|
|
36694
|
+
mode: exportMode ? "export" : "preview",
|
|
36805
36695
|
controlsGroup: { toggles: controlsToggles }
|
|
36806
36696
|
};
|
|
36807
36697
|
const tagGroupG = legendRow.append("g");
|
|
@@ -37684,9 +37574,6 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
|
|
|
37684
37574
|
const defs = svg.append("defs");
|
|
37685
37575
|
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
37576
|
const edgeColors = /* @__PURE__ */ new Set();
|
|
37687
|
-
for (const edge of layout.edges) {
|
|
37688
|
-
if (edge.color) edgeColors.add(edge.color);
|
|
37689
|
-
}
|
|
37690
37577
|
for (const color of edgeColors) {
|
|
37691
37578
|
const id = `st-arrow-${color.replace("#", "")}`;
|
|
37692
37579
|
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 +37668,8 @@ function renderState(container, graph, layout, palette, isDark, onClickItem, exp
|
|
|
37781
37668
|
for (let ei = 0; ei < layout.edges.length; ei++) {
|
|
37782
37669
|
const edge = layout.edges[ei];
|
|
37783
37670
|
const edgeG = contentG.append("g").attr("class", "st-edge-group").attr("data-line-number", String(edge.lineNumber));
|
|
37784
|
-
const edgeColor3 =
|
|
37785
|
-
const markerId =
|
|
37671
|
+
const edgeColor3 = palette.textMuted;
|
|
37672
|
+
const markerId = "st-arrow";
|
|
37786
37673
|
if (edge.source === edge.target) {
|
|
37787
37674
|
const node = nodePositionMap.get(edge.source);
|
|
37788
37675
|
if (node) {
|
|
@@ -38651,7 +38538,7 @@ function renderTechRadar(container, parsed, palette, isDark, onClickItem, export
|
|
|
38651
38538
|
}
|
|
38652
38539
|
],
|
|
38653
38540
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
38654
|
-
mode: "
|
|
38541
|
+
mode: options?.exportMode ? "export" : "preview",
|
|
38655
38542
|
controlsGroup: {
|
|
38656
38543
|
toggles: [
|
|
38657
38544
|
{
|
|
@@ -39254,7 +39141,7 @@ function getQuadrantLabelPosition(position, cx, cy, maxRadius) {
|
|
|
39254
39141
|
};
|
|
39255
39142
|
}
|
|
39256
39143
|
}
|
|
39257
|
-
function renderTechRadarForExport(container, parsed, palette, isDark, exportDims, viewState) {
|
|
39144
|
+
function renderTechRadarForExport(container, parsed, palette, isDark, exportDims, viewState, exportMode) {
|
|
39258
39145
|
renderTechRadar(
|
|
39259
39146
|
container,
|
|
39260
39147
|
parsed,
|
|
@@ -39262,7 +39149,8 @@ function renderTechRadarForExport(container, parsed, palette, isDark, exportDims
|
|
|
39262
39149
|
isDark,
|
|
39263
39150
|
void 0,
|
|
39264
39151
|
exportDims,
|
|
39265
|
-
viewState
|
|
39152
|
+
viewState,
|
|
39153
|
+
{ exportMode }
|
|
39266
39154
|
);
|
|
39267
39155
|
}
|
|
39268
39156
|
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 +39530,7 @@ function renderJourneyMap(container, parsed, palette, isDark, options) {
|
|
|
39642
39530
|
titleRelation: "inline-with-title"
|
|
39643
39531
|
},
|
|
39644
39532
|
titleWidth: 0,
|
|
39645
|
-
mode:
|
|
39533
|
+
mode: options?.exportMode ? "export" : "preview"
|
|
39646
39534
|
};
|
|
39647
39535
|
const legendState = { activeGroup: effectiveActiveGroup };
|
|
39648
39536
|
const legendCallbacks = {
|
|
@@ -40355,7 +40243,8 @@ function renderJourneyMapForExport(content, theme, palette) {
|
|
|
40355
40243
|
const layout = layoutJourneyMap(parsed, palette, { isDark });
|
|
40356
40244
|
const container = document.createElement("div");
|
|
40357
40245
|
renderJourneyMap(container, parsed, palette, isDark, {
|
|
40358
|
-
exportDims: { width: layout.totalWidth, height: layout.totalHeight }
|
|
40246
|
+
exportDims: { width: layout.totalWidth, height: layout.totalHeight },
|
|
40247
|
+
exportMode: true
|
|
40359
40248
|
});
|
|
40360
40249
|
const svgEl = container.querySelector("svg");
|
|
40361
40250
|
if (!svgEl) return "";
|
|
@@ -41120,7 +41009,7 @@ function renderCycle(container, parsed, palette, isDark, onClickItem, exportDims
|
|
|
41120
41009
|
const legendConfig = {
|
|
41121
41010
|
groups: [],
|
|
41122
41011
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
41123
|
-
mode: "
|
|
41012
|
+
mode: renderOptions?.exportMode ? "export" : "preview",
|
|
41124
41013
|
controlsGroup
|
|
41125
41014
|
};
|
|
41126
41015
|
const legendState = {
|
|
@@ -41304,7 +41193,7 @@ function renderCycle(container, parsed, palette, isDark, onClickItem, exportDims
|
|
|
41304
41193
|
}
|
|
41305
41194
|
}
|
|
41306
41195
|
}
|
|
41307
|
-
function renderCycleForExport(container, parsed, palette, isDark, exportDims, viewState) {
|
|
41196
|
+
function renderCycleForExport(container, parsed, palette, isDark, exportDims, viewState, exportMode) {
|
|
41308
41197
|
renderCycle(
|
|
41309
41198
|
container,
|
|
41310
41199
|
parsed,
|
|
@@ -41312,7 +41201,8 @@ function renderCycleForExport(container, parsed, palette, isDark, exportDims, vi
|
|
|
41312
41201
|
isDark,
|
|
41313
41202
|
void 0,
|
|
41314
41203
|
exportDims,
|
|
41315
|
-
viewState
|
|
41204
|
+
viewState,
|
|
41205
|
+
{ exportMode }
|
|
41316
41206
|
);
|
|
41317
41207
|
}
|
|
41318
41208
|
function resolveNodeColor5(color, palette, defaultColor) {
|
|
@@ -42942,9 +42832,6 @@ function wrapLabelWords(words) {
|
|
|
42942
42832
|
function renderRectParticipant(g, palette, isDark, color, solid) {
|
|
42943
42833
|
g.append("rect").attr("x", -W / 2).attr("y", 0).attr("width", W).attr("height", H).attr("rx", 2).attr("ry", 2).attr("fill", fill(palette, isDark, color, solid)).attr("stroke", stroke(palette, color)).attr("stroke-width", SW);
|
|
42944
42834
|
}
|
|
42945
|
-
function renderServiceParticipant(g, palette, isDark, color, solid) {
|
|
42946
|
-
g.append("rect").attr("x", -W / 2).attr("y", 0).attr("width", W).attr("height", H).attr("rx", SERVICE_BORDER_RADIUS).attr("ry", SERVICE_BORDER_RADIUS).attr("fill", fill(palette, isDark, color, solid)).attr("stroke", stroke(palette, color)).attr("stroke-width", SW);
|
|
42947
|
-
}
|
|
42948
42835
|
function renderActorParticipant(g, palette, color) {
|
|
42949
42836
|
const headR = 8;
|
|
42950
42837
|
const cx = 0;
|
|
@@ -42999,31 +42886,6 @@ function renderCacheParticipant(g, palette, isDark, color, solid) {
|
|
|
42999
42886
|
g.append("line").attr("x1", W / 2).attr("y1", topY).attr("x2", W / 2).attr("y2", topY + bodyH).attr("stroke", s).attr("stroke-width", SW).attr("stroke-dasharray", dash);
|
|
43000
42887
|
g.append("ellipse").attr("cx", 0).attr("cy", topY).attr("rx", W / 2).attr("ry", ry).attr("fill", f).attr("stroke", s).attr("stroke-width", SW).attr("stroke-dasharray", dash);
|
|
43001
42888
|
}
|
|
43002
|
-
function renderNetworkingParticipant(g, palette, isDark, color, solid) {
|
|
43003
|
-
const inset = 16;
|
|
43004
|
-
const points = [
|
|
43005
|
-
`${-W / 2 + inset},0`,
|
|
43006
|
-
`${W / 2 - inset},0`,
|
|
43007
|
-
`${W / 2},${H / 2}`,
|
|
43008
|
-
`${W / 2 - inset},${H}`,
|
|
43009
|
-
`${-W / 2 + inset},${H}`,
|
|
43010
|
-
`${-W / 2},${H / 2}`
|
|
43011
|
-
].join(" ");
|
|
43012
|
-
g.append("polygon").attr("points", points).attr("fill", fill(palette, isDark, color, solid)).attr("stroke", stroke(palette, color)).attr("stroke-width", SW);
|
|
43013
|
-
}
|
|
43014
|
-
function renderFrontendParticipant(g, palette, isDark, color, solid) {
|
|
43015
|
-
const screenH = H - 10;
|
|
43016
|
-
const s = stroke(palette, color);
|
|
43017
|
-
g.append("rect").attr("x", -W / 2).attr("y", 0).attr("width", W).attr("height", screenH).attr("rx", 3).attr("ry", 3).attr("fill", fill(palette, isDark, color, solid)).attr("stroke", s).attr("stroke-width", SW);
|
|
43018
|
-
g.append("line").attr("x1", 0).attr("y1", screenH).attr("x2", 0).attr("y2", H - 2).attr("stroke", s).attr("stroke-width", SW);
|
|
43019
|
-
g.append("line").attr("x1", -14).attr("y1", H - 2).attr("x2", 14).attr("y2", H - 2).attr("stroke", s).attr("stroke-width", SW);
|
|
43020
|
-
}
|
|
43021
|
-
function renderExternalParticipant(g, palette, isDark, color, solid) {
|
|
43022
|
-
g.append("rect").attr("x", -W / 2).attr("y", 0).attr("width", W).attr("height", H).attr("rx", 2).attr("ry", 2).attr("fill", fill(palette, isDark, color, solid)).attr("stroke", stroke(palette, color)).attr("stroke-width", SW).attr("stroke-dasharray", "6 3");
|
|
43023
|
-
}
|
|
43024
|
-
function renderGatewayParticipant(g, palette, isDark, color, _solid) {
|
|
43025
|
-
renderRectParticipant(g, palette, isDark, color);
|
|
43026
|
-
}
|
|
43027
42889
|
function groupMessagesBySection(elements, messages) {
|
|
43028
42890
|
const groups = [];
|
|
43029
42891
|
let currentGroup = null;
|
|
@@ -43662,7 +43524,7 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
43662
43524
|
}
|
|
43663
43525
|
}
|
|
43664
43526
|
const lastStep = renderSteps[renderSteps.length - 1];
|
|
43665
|
-
const lastIsSelfCall = lastStep
|
|
43527
|
+
const lastIsSelfCall = lastStep?.type === "call" && lastStep.from === lastStep.to;
|
|
43666
43528
|
const lastStepTrailing = lastIsSelfCall ? SELF_CALL_HEIGHT + 25 : stepSpacing;
|
|
43667
43529
|
let contentBottomY = renderSteps.length > 0 ? Math.max(
|
|
43668
43530
|
stepYPositions[stepYPositions.length - 1] + lastStepTrailing,
|
|
@@ -43836,6 +43698,9 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
43836
43698
|
const FRAME_PADDING_X = 30;
|
|
43837
43699
|
const FRAME_PADDING_BOTTOM = 15;
|
|
43838
43700
|
const FRAME_LABEL_HEIGHT = 18;
|
|
43701
|
+
const SELF_ARROW_PROJECTION = ACTIVATION_WIDTH / 2 + SELF_CALL_WIDTH;
|
|
43702
|
+
const SELF_ARROW_FRAME_PAD = 10;
|
|
43703
|
+
const frameRightmostX = Math.max(...Array.from(participantX.values()));
|
|
43839
43704
|
const collectMsgIndices = (els) => {
|
|
43840
43705
|
const indices = [];
|
|
43841
43706
|
for (const el of els) {
|
|
@@ -43902,16 +43767,40 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
43902
43767
|
maxPX = Math.max(maxPX, px);
|
|
43903
43768
|
}
|
|
43904
43769
|
}
|
|
43905
|
-
|
|
43770
|
+
let extraLeft = 0;
|
|
43771
|
+
let extraRight = 0;
|
|
43772
|
+
let maxStepIsSelfCall = false;
|
|
43773
|
+
for (const mi of allIndices) {
|
|
43774
|
+
const m = messages[mi];
|
|
43775
|
+
if (m.from === m.to) {
|
|
43776
|
+
const px = participantX.get(m.from);
|
|
43777
|
+
if (px !== void 0) {
|
|
43778
|
+
const flipLeft = px === frameRightmostX;
|
|
43779
|
+
if (flipLeft) {
|
|
43780
|
+
const loopMin = px - SELF_ARROW_PROJECTION;
|
|
43781
|
+
const need = minPX - FRAME_PADDING_X - loopMin + SELF_ARROW_FRAME_PAD;
|
|
43782
|
+
if (need > 0) extraLeft = Math.max(extraLeft, need);
|
|
43783
|
+
} else {
|
|
43784
|
+
const loopMax = px + SELF_ARROW_PROJECTION;
|
|
43785
|
+
const need = loopMax - (maxPX + FRAME_PADDING_X) + SELF_ARROW_FRAME_PAD;
|
|
43786
|
+
if (need > 0) extraRight = Math.max(extraRight, need);
|
|
43787
|
+
}
|
|
43788
|
+
}
|
|
43789
|
+
if (msgToLastStep.get(mi) === maxStep) {
|
|
43790
|
+
maxStepIsSelfCall = true;
|
|
43791
|
+
}
|
|
43792
|
+
}
|
|
43793
|
+
}
|
|
43794
|
+
const frameX = minPX - FRAME_PADDING_X - extraLeft;
|
|
43906
43795
|
const frameY = stepY(minStep) - FRAME_PADDING_TOP;
|
|
43907
|
-
const frameW = maxPX - minPX + FRAME_PADDING_X * 2;
|
|
43908
|
-
const frameH = stepY(maxStep) - stepY(minStep) + FRAME_PADDING_TOP + FRAME_PADDING_BOTTOM;
|
|
43796
|
+
const frameW = maxPX - minPX + FRAME_PADDING_X * 2 + extraLeft + extraRight;
|
|
43797
|
+
const frameH = stepY(maxStep) - stepY(minStep) + FRAME_PADDING_TOP + FRAME_PADDING_BOTTOM + (maxStepIsSelfCall ? SELF_CALL_HEIGHT : 0);
|
|
43909
43798
|
svg.append("rect").attr("x", frameX).attr("y", frameY).attr("width", frameW).attr("height", frameH).attr("fill", "none").attr("stroke", palette.textMuted).attr("stroke-width", 1).attr("stroke-dasharray", "2 3").attr("rx", 3).attr("ry", 3).attr("class", "block-frame").attr("data-block-line", String(el.lineNumber));
|
|
43910
43799
|
deferredLabels.push({
|
|
43911
43800
|
x: frameX + 6,
|
|
43912
43801
|
y: frameY + FRAME_LABEL_HEIGHT - 4,
|
|
43913
43802
|
text: `${el.type} ${el.label}`,
|
|
43914
|
-
bold:
|
|
43803
|
+
bold: false,
|
|
43915
43804
|
italic: false,
|
|
43916
43805
|
blockLine: el.lineNumber
|
|
43917
43806
|
});
|
|
@@ -43937,7 +43826,7 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
43937
43826
|
y: dividerY + 14,
|
|
43938
43827
|
text: `else if ${branchData.label}`,
|
|
43939
43828
|
bold: false,
|
|
43940
|
-
italic:
|
|
43829
|
+
italic: false,
|
|
43941
43830
|
blockLine: branchData.lineNumber
|
|
43942
43831
|
});
|
|
43943
43832
|
}
|
|
@@ -43964,7 +43853,7 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
43964
43853
|
y: dividerY + 14,
|
|
43965
43854
|
text: "else",
|
|
43966
43855
|
bold: false,
|
|
43967
|
-
italic:
|
|
43856
|
+
italic: false,
|
|
43968
43857
|
blockLine: el.elseLineNumber
|
|
43969
43858
|
});
|
|
43970
43859
|
}
|
|
@@ -44034,7 +43923,7 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
44034
43923
|
return side === "right" ? px + ACTIVATION_WIDTH / 2 + offset : px - ACTIVATION_WIDTH / 2 + offset;
|
|
44035
43924
|
};
|
|
44036
43925
|
const leftmostX = Math.min(...Array.from(participantX.values()));
|
|
44037
|
-
const rightmostX =
|
|
43926
|
+
const rightmostX = frameRightmostX;
|
|
44038
43927
|
const sectionLineX1 = leftmostX - PARTICIPANT_BOX_WIDTH / 2 - 10;
|
|
44039
43928
|
const sectionLineX2 = rightmostX + PARTICIPANT_BOX_WIDTH / 2 + 10;
|
|
44040
43929
|
for (const region of sectionRegions) {
|
|
@@ -44236,7 +44125,7 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
|
|
|
44236
44125
|
const legendConfig = {
|
|
44237
44126
|
groups: resolvedGroups,
|
|
44238
44127
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
44239
|
-
mode: "
|
|
44128
|
+
mode: "preview"
|
|
44240
44129
|
};
|
|
44241
44130
|
const legendState = {
|
|
44242
44131
|
activeGroup: activeTagGroup ?? null,
|
|
@@ -44293,27 +44182,12 @@ function renderParticipant(svg, participant, cx, cy, palette, isDark, color, tag
|
|
|
44293
44182
|
case "database":
|
|
44294
44183
|
renderDatabaseParticipant(g, palette, isDark, color, solid);
|
|
44295
44184
|
break;
|
|
44296
|
-
case "service":
|
|
44297
|
-
renderServiceParticipant(g, palette, isDark, color, solid);
|
|
44298
|
-
break;
|
|
44299
44185
|
case "queue":
|
|
44300
44186
|
renderQueueParticipant(g, palette, isDark, color, solid);
|
|
44301
44187
|
break;
|
|
44302
44188
|
case "cache":
|
|
44303
44189
|
renderCacheParticipant(g, palette, isDark, color, solid);
|
|
44304
44190
|
break;
|
|
44305
|
-
case "networking":
|
|
44306
|
-
renderNetworkingParticipant(g, palette, isDark, color, solid);
|
|
44307
|
-
break;
|
|
44308
|
-
case "frontend":
|
|
44309
|
-
renderFrontendParticipant(g, palette, isDark, color, solid);
|
|
44310
|
-
break;
|
|
44311
|
-
case "external":
|
|
44312
|
-
renderExternalParticipant(g, palette, isDark, color, solid);
|
|
44313
|
-
break;
|
|
44314
|
-
case "gateway":
|
|
44315
|
-
renderGatewayParticipant(g, palette, isDark, color, solid);
|
|
44316
|
-
break;
|
|
44317
44191
|
default:
|
|
44318
44192
|
renderRectParticipant(g, palette, isDark, color, solid);
|
|
44319
44193
|
break;
|
|
@@ -44341,7 +44215,7 @@ function renderParticipant(svg, participant, cx, cy, palette, isDark, color, tag
|
|
|
44341
44215
|
});
|
|
44342
44216
|
}
|
|
44343
44217
|
}
|
|
44344
|
-
var PARTICIPANT_GAP, PARTICIPANT_BOX_WIDTH, PARTICIPANT_BOX_HEIGHT, TOP_MARGIN, TITLE_HEIGHT8, PARTICIPANT_Y_OFFSET,
|
|
44218
|
+
var PARTICIPANT_GAP, PARTICIPANT_BOX_WIDTH, PARTICIPANT_BOX_HEIGHT, TOP_MARGIN, TITLE_HEIGHT8, PARTICIPANT_Y_OFFSET, MESSAGE_START_OFFSET, LIFELINE_TAIL, ARROWHEAD_SIZE, NOTE_MAX_W, NOTE_FOLD, NOTE_PAD_H, NOTE_PAD_V, NOTE_FONT_SIZE, NOTE_LINE_H, NOTE_GAP, NOTE_CHAR_W, NOTE_CHARS_PER_LINE, ACTIVATION_WIDTH, SELF_CALL_HEIGHT, SELF_CALL_WIDTH, NOTE_LANE_MAX, LABEL_CHAR_WIDTH, LABEL_MAX_CHARS, fill, stroke, SW, W, H;
|
|
44345
44219
|
var init_renderer19 = __esm({
|
|
44346
44220
|
"src/sequence/renderer.ts"() {
|
|
44347
44221
|
"use strict";
|
|
@@ -44362,7 +44236,6 @@ var init_renderer19 = __esm({
|
|
|
44362
44236
|
TOP_MARGIN = 20;
|
|
44363
44237
|
TITLE_HEIGHT8 = 30;
|
|
44364
44238
|
PARTICIPANT_Y_OFFSET = 10;
|
|
44365
|
-
SERVICE_BORDER_RADIUS = 10;
|
|
44366
44239
|
MESSAGE_START_OFFSET = 30;
|
|
44367
44240
|
LIFELINE_TAIL = 30;
|
|
44368
44241
|
ARROWHEAD_SIZE = 8;
|
|
@@ -44559,7 +44432,7 @@ function parseVisualization(content, palette) {
|
|
|
44559
44432
|
const warn2 = (line12, message) => {
|
|
44560
44433
|
result.diagnostics.push(makeDgmoError(line12, message, "warning"));
|
|
44561
44434
|
};
|
|
44562
|
-
if (!content
|
|
44435
|
+
if (!content?.trim()) {
|
|
44563
44436
|
return fail(0, "Empty content");
|
|
44564
44437
|
}
|
|
44565
44438
|
const lines = content.split("\n");
|
|
@@ -44641,7 +44514,9 @@ function parseVisualization(content, palette) {
|
|
|
44641
44514
|
if (currentTimelineTagGroup && indent === 0) {
|
|
44642
44515
|
currentTimelineTagGroup = null;
|
|
44643
44516
|
}
|
|
44644
|
-
const groupMatch = line12.match(
|
|
44517
|
+
const groupMatch = line12.match(
|
|
44518
|
+
/^\[(.+?)\](?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?\s*$/
|
|
44519
|
+
);
|
|
44645
44520
|
if (groupMatch) {
|
|
44646
44521
|
if (result.type === "arc") {
|
|
44647
44522
|
const name = groupMatch[1].trim();
|
|
@@ -44683,7 +44558,7 @@ function parseVisualization(content, palette) {
|
|
|
44683
44558
|
}
|
|
44684
44559
|
if (result.type === "arc") {
|
|
44685
44560
|
const linkMatch = line12.match(
|
|
44686
|
-
/^(.+?)\s*->\s*(.+?)(?:\(
|
|
44561
|
+
/^(.+?)\s*->\s*(.+?)(?:\s+(red|orange|yellow|green|blue|purple|teal|cyan|gray|black|white))?(?:\s+(-?[\d,_]+(?:\.[\d]+)?))?$/
|
|
44687
44562
|
);
|
|
44688
44563
|
if (linkMatch) {
|
|
44689
44564
|
const source = linkMatch[1].trim();
|
|
@@ -44722,7 +44597,7 @@ function parseVisualization(content, palette) {
|
|
|
44722
44597
|
} else {
|
|
44723
44598
|
if (line12.startsWith("//")) continue;
|
|
44724
44599
|
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
|
|
44600
|
+
/^(\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
44601
|
);
|
|
44727
44602
|
if (eraEntryMatch) {
|
|
44728
44603
|
const colorAnnotation = eraEntryMatch[4]?.trim() || null;
|
|
@@ -44750,7 +44625,7 @@ function parseVisualization(content, palette) {
|
|
|
44750
44625
|
} else {
|
|
44751
44626
|
if (line12.startsWith("//")) continue;
|
|
44752
44627
|
const markerEntryMatch = line12.match(
|
|
44753
|
-
/^(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s
|
|
44628
|
+
/^(\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
44629
|
);
|
|
44755
44630
|
if (markerEntryMatch) {
|
|
44756
44631
|
const colorAnnotation = markerEntryMatch[3]?.trim() || null;
|
|
@@ -44783,7 +44658,7 @@ function parseVisualization(content, palette) {
|
|
|
44783
44658
|
continue;
|
|
44784
44659
|
}
|
|
44785
44660
|
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
|
|
44661
|
+
/^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
44662
|
);
|
|
44788
44663
|
if (eraMatch) {
|
|
44789
44664
|
const colorAnnotation = eraMatch[4]?.trim() || null;
|
|
@@ -44802,7 +44677,7 @@ function parseVisualization(content, palette) {
|
|
|
44802
44677
|
continue;
|
|
44803
44678
|
}
|
|
44804
44679
|
const markerMatch = line12.match(
|
|
44805
|
-
/^marker\s+(\d{4}(?:-\d{2})?(?:-\d{2}(?: \d{2}:\d{2})?)?)\s+(.+?)(?:\s
|
|
44680
|
+
/^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
44681
|
);
|
|
44807
44682
|
if (markerMatch) {
|
|
44808
44683
|
const colorAnnotation = markerMatch[3]?.trim() || null;
|
|
@@ -44923,13 +44798,11 @@ function parseVisualization(content, palette) {
|
|
|
44923
44798
|
}
|
|
44924
44799
|
}
|
|
44925
44800
|
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
|
-
);
|
|
44801
|
+
const legacyAliasMatch = line12.match(/^(.+?)\s+alias\s+(\S+)\s*$/i);
|
|
44929
44802
|
if (legacyAliasMatch) {
|
|
44930
|
-
const
|
|
44931
|
-
const
|
|
44932
|
-
const
|
|
44803
|
+
const nameWithMaybeColor = legacyAliasMatch[1].trim();
|
|
44804
|
+
const aliasToken = legacyAliasMatch[2].trim();
|
|
44805
|
+
const { label: name, colorName } = peelTrailingColorName(nameWithMaybeColor);
|
|
44933
44806
|
let color = null;
|
|
44934
44807
|
if (colorName) {
|
|
44935
44808
|
color = resolveColorWithDiagnostic(
|
|
@@ -44951,11 +44824,12 @@ function parseVisualization(content, palette) {
|
|
|
44951
44824
|
continue;
|
|
44952
44825
|
}
|
|
44953
44826
|
const setDeclMatch = line12.match(
|
|
44954
|
-
/^(
|
|
44827
|
+
/^(.+?)(?:\s+as\s+([A-Za-z][A-Za-z0-9_]{0,11}))?\s*$/i
|
|
44955
44828
|
);
|
|
44956
44829
|
if (setDeclMatch) {
|
|
44957
|
-
const
|
|
44958
|
-
const
|
|
44830
|
+
const nameWithMaybeColor = setDeclMatch[1].trim();
|
|
44831
|
+
const alias = setDeclMatch[2]?.trim() ?? null;
|
|
44832
|
+
const { label: name, colorName } = peelTrailingColorName(nameWithMaybeColor);
|
|
44959
44833
|
let color = null;
|
|
44960
44834
|
if (colorName) {
|
|
44961
44835
|
color = resolveColorWithDiagnostic(
|
|
@@ -44965,7 +44839,6 @@ function parseVisualization(content, palette) {
|
|
|
44965
44839
|
palette
|
|
44966
44840
|
) ?? null;
|
|
44967
44841
|
}
|
|
44968
|
-
const alias = setDeclMatch[3]?.trim() ?? null;
|
|
44969
44842
|
result.vennSets.push({ name, alias, color, lineNumber });
|
|
44970
44843
|
continue;
|
|
44971
44844
|
}
|
|
@@ -45011,10 +44884,9 @@ function parseVisualization(content, palette) {
|
|
|
45011
44884
|
if (quadrantMatch) {
|
|
45012
44885
|
const position = quadrantMatch[1].toLowerCase();
|
|
45013
44886
|
const labelPart = quadrantMatch[2].trim();
|
|
45014
|
-
const
|
|
45015
|
-
const
|
|
45016
|
-
|
|
45017
|
-
labelColorMatch[2].trim(),
|
|
44887
|
+
const { label: text, colorName } = peelTrailingColorName(labelPart);
|
|
44888
|
+
const color = colorName ? resolveColorWithDiagnostic(
|
|
44889
|
+
colorName,
|
|
45018
44890
|
lineNumber,
|
|
45019
44891
|
result.diagnostics,
|
|
45020
44892
|
palette
|
|
@@ -45204,10 +45076,9 @@ function parseVisualization(content, palette) {
|
|
|
45204
45076
|
);
|
|
45205
45077
|
continue;
|
|
45206
45078
|
}
|
|
45207
|
-
const
|
|
45208
|
-
const
|
|
45209
|
-
|
|
45210
|
-
colorMatch[2].trim(),
|
|
45079
|
+
const { label: labelPart, colorName: colorWord } = peelTrailingColorName(joinedLabel);
|
|
45080
|
+
const colorPart = colorWord ? resolveColorWithDiagnostic(
|
|
45081
|
+
colorWord,
|
|
45211
45082
|
lineNumber,
|
|
45212
45083
|
result.diagnostics,
|
|
45213
45084
|
palette
|
|
@@ -46496,7 +46367,7 @@ function makeTimelineHoverHelpers() {
|
|
|
46496
46367
|
setTagAttrs
|
|
46497
46368
|
};
|
|
46498
46369
|
}
|
|
46499
|
-
function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setup, hovers, onClickItem, exportDims, swimlaneTagGroup, activeTagGroup, onTagStateChange, viewMode) {
|
|
46370
|
+
function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setup, hovers, onClickItem, exportDims, swimlaneTagGroup, activeTagGroup, onTagStateChange, viewMode, exportMode) {
|
|
46500
46371
|
if (parsed.timelineTagGroups.length === 0) return;
|
|
46501
46372
|
const { width, textColor, groupColorMap, solid } = setup;
|
|
46502
46373
|
const { FADE_OPACITY: FADE_OPACITY3, fadeReset, fadeToTagValue } = hovers;
|
|
@@ -46567,7 +46438,7 @@ function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setu
|
|
|
46567
46438
|
const centralConfig = {
|
|
46568
46439
|
groups: centralGroups,
|
|
46569
46440
|
position: { placement: "top-center", titleRelation: "below-title" },
|
|
46570
|
-
mode: "
|
|
46441
|
+
mode: exportMode ? "export" : "preview",
|
|
46571
46442
|
capsulePillAddonWidth: iconAddon
|
|
46572
46443
|
};
|
|
46573
46444
|
const centralState = { activeGroup: centralActive };
|
|
@@ -46601,7 +46472,7 @@ function renderTimelineTagLegendOverlay(container, parsed, palette, isDark, setu
|
|
|
46601
46472
|
const groupKey = groupName.toLowerCase();
|
|
46602
46473
|
groupEl.attr("data-tag-group", groupKey);
|
|
46603
46474
|
if (isActive && !viewMode) {
|
|
46604
|
-
const isSwimActive = currentSwimlaneGroup
|
|
46475
|
+
const isSwimActive = currentSwimlaneGroup?.toLowerCase() === groupKey;
|
|
46605
46476
|
const pillWidth3 = measureLegendText(groupName, LG_PILL_FONT_SIZE) + LG_PILL_PAD;
|
|
46606
46477
|
const pillXOff = LG_CAPSULE_PAD;
|
|
46607
46478
|
const iconX = pillXOff + pillWidth3 + 5;
|
|
@@ -47411,7 +47282,7 @@ function renderTimelineVertical(container, parsed, palette, isDark, setup, hover
|
|
|
47411
47282
|
}
|
|
47412
47283
|
}
|
|
47413
47284
|
}
|
|
47414
|
-
function renderTimeline(container, parsed, palette, isDark, onClickItem, exportDims, activeTagGroup, swimlaneTagGroup, onTagStateChange, viewMode) {
|
|
47285
|
+
function renderTimeline(container, parsed, palette, isDark, onClickItem, exportDims, activeTagGroup, swimlaneTagGroup, onTagStateChange, viewMode, exportMode) {
|
|
47415
47286
|
const setup = setupTimeline(
|
|
47416
47287
|
container,
|
|
47417
47288
|
parsed,
|
|
@@ -47486,7 +47357,8 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
|
|
|
47486
47357
|
swimlaneTagGroup,
|
|
47487
47358
|
activeTagGroup,
|
|
47488
47359
|
onTagStateChange,
|
|
47489
|
-
viewMode
|
|
47360
|
+
viewMode,
|
|
47361
|
+
exportMode
|
|
47490
47362
|
);
|
|
47491
47363
|
}
|
|
47492
47364
|
function getRotateFn(mode) {
|
|
@@ -48583,6 +48455,7 @@ function finalizeSvgExport(container, theme, palette) {
|
|
|
48583
48455
|
return svgHtml;
|
|
48584
48456
|
}
|
|
48585
48457
|
async function renderForExport(content, theme, palette, viewState, options) {
|
|
48458
|
+
const exportMode = options?.exportMode ?? false;
|
|
48586
48459
|
const { parseDgmoChartType: parseDgmoChartType2 } = await Promise.resolve().then(() => (init_dgmo_router(), dgmo_router_exports));
|
|
48587
48460
|
const detectedType = parseDgmoChartType2(content);
|
|
48588
48461
|
if (detectedType === "org") {
|
|
@@ -48624,7 +48497,9 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48624
48497
|
void 0,
|
|
48625
48498
|
{ width: exportWidth, height: exportHeight },
|
|
48626
48499
|
activeTagGroup,
|
|
48627
|
-
hiddenAttributes
|
|
48500
|
+
hiddenAttributes,
|
|
48501
|
+
void 0,
|
|
48502
|
+
exportMode
|
|
48628
48503
|
);
|
|
48629
48504
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48630
48505
|
}
|
|
@@ -48666,7 +48541,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48666
48541
|
void 0,
|
|
48667
48542
|
{ width: exportWidth, height: exportHeight },
|
|
48668
48543
|
activeTagGroup,
|
|
48669
|
-
hiddenAttributes
|
|
48544
|
+
hiddenAttributes,
|
|
48545
|
+
exportMode
|
|
48670
48546
|
);
|
|
48671
48547
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48672
48548
|
}
|
|
@@ -48689,7 +48565,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48689
48565
|
currentSwimlaneGroup: viewState?.swim ?? null,
|
|
48690
48566
|
collapsedLanes: viewState?.cl ? new Set(viewState.cl) : void 0,
|
|
48691
48567
|
collapsedColumns: viewState?.cc ? new Set(viewState.cc) : void 0,
|
|
48692
|
-
compactMeta: viewState?.cm
|
|
48568
|
+
compactMeta: viewState?.cm,
|
|
48569
|
+
exportMode
|
|
48693
48570
|
});
|
|
48694
48571
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48695
48572
|
}
|
|
@@ -48713,7 +48590,9 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48713
48590
|
effectivePalette2,
|
|
48714
48591
|
theme === "dark",
|
|
48715
48592
|
void 0,
|
|
48716
|
-
{ width: exportWidth, height: exportHeight }
|
|
48593
|
+
{ width: exportWidth, height: exportHeight },
|
|
48594
|
+
void 0,
|
|
48595
|
+
exportMode
|
|
48717
48596
|
);
|
|
48718
48597
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48719
48598
|
}
|
|
@@ -48743,7 +48622,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48743
48622
|
erParsed.options["active-tag"],
|
|
48744
48623
|
viewState?.tag ?? options?.tagGroup
|
|
48745
48624
|
),
|
|
48746
|
-
viewState?.sem
|
|
48625
|
+
viewState?.sem,
|
|
48626
|
+
exportMode
|
|
48747
48627
|
);
|
|
48748
48628
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48749
48629
|
}
|
|
@@ -48776,7 +48656,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48776
48656
|
{
|
|
48777
48657
|
exportDims: { width: exportWidth, height: exportHeight },
|
|
48778
48658
|
activeTagGroup: viewState?.tag ?? options?.tagGroup,
|
|
48779
|
-
hiddenTagValues: blHiddenTagValues
|
|
48659
|
+
hiddenTagValues: blHiddenTagValues,
|
|
48660
|
+
exportMode
|
|
48780
48661
|
}
|
|
48781
48662
|
);
|
|
48782
48663
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
@@ -48822,7 +48703,7 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48822
48703
|
void 0,
|
|
48823
48704
|
hideDescriptions,
|
|
48824
48705
|
colorByDepth ? null : activeTagGroup,
|
|
48825
|
-
colorByDepth ? { colorByDepth: true } :
|
|
48706
|
+
colorByDepth ? { colorByDepth: true, exportMode } : { exportMode }
|
|
48826
48707
|
);
|
|
48827
48708
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48828
48709
|
}
|
|
@@ -48885,7 +48766,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
48885
48766
|
c4Parsed.tagGroups,
|
|
48886
48767
|
c4Parsed.options["active-tag"],
|
|
48887
48768
|
viewState?.tag ?? options?.tagGroup
|
|
48888
|
-
)
|
|
48769
|
+
),
|
|
48770
|
+
exportMode
|
|
48889
48771
|
);
|
|
48890
48772
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
48891
48773
|
}
|
|
@@ -49021,7 +48903,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49021
48903
|
resolved.tagGroups,
|
|
49022
48904
|
resolved.options.activeTag ?? void 0,
|
|
49023
48905
|
viewState?.tag ?? options?.tagGroup
|
|
49024
|
-
)
|
|
48906
|
+
),
|
|
48907
|
+
exportMode
|
|
49025
48908
|
},
|
|
49026
48909
|
{ width: EXPORT_W, height: EXPORT_H }
|
|
49027
48910
|
);
|
|
@@ -49062,7 +48945,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49062
48945
|
effectivePalette2,
|
|
49063
48946
|
theme === "dark",
|
|
49064
48947
|
{ width: RADAR_EXPORT_W, height: RADAR_EXPORT_H },
|
|
49065
|
-
viewState
|
|
48948
|
+
viewState,
|
|
48949
|
+
exportMode
|
|
49066
48950
|
);
|
|
49067
48951
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49068
48952
|
}
|
|
@@ -49082,7 +48966,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49082
48966
|
jmLayout.totalHeight
|
|
49083
48967
|
);
|
|
49084
48968
|
renderJourneyMap2(container2, jmParsed, effectivePalette2, theme === "dark", {
|
|
49085
|
-
exportDims: { width: jmLayout.totalWidth, height: jmLayout.totalHeight }
|
|
48969
|
+
exportDims: { width: jmLayout.totalWidth, height: jmLayout.totalHeight },
|
|
48970
|
+
exportMode
|
|
49086
48971
|
});
|
|
49087
48972
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49088
48973
|
}
|
|
@@ -49099,7 +48984,8 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49099
48984
|
effectivePalette2,
|
|
49100
48985
|
theme === "dark",
|
|
49101
48986
|
{ width: EXPORT_WIDTH, height: EXPORT_HEIGHT },
|
|
49102
|
-
viewState
|
|
48987
|
+
viewState,
|
|
48988
|
+
exportMode
|
|
49103
48989
|
);
|
|
49104
48990
|
return finalizeSvgExport(container2, theme, effectivePalette2);
|
|
49105
48991
|
}
|
|
@@ -49218,7 +49104,10 @@ async function renderForExport(content, theme, palette, viewState, options) {
|
|
|
49218
49104
|
void 0,
|
|
49219
49105
|
viewState?.tag ?? options?.tagGroup
|
|
49220
49106
|
),
|
|
49221
|
-
viewState?.swim
|
|
49107
|
+
viewState?.swim,
|
|
49108
|
+
void 0,
|
|
49109
|
+
void 0,
|
|
49110
|
+
exportMode
|
|
49222
49111
|
);
|
|
49223
49112
|
} else if (parsed.type === "venn") {
|
|
49224
49113
|
renderVenn(container, parsed, effectivePalette, isDark, void 0, dims);
|
|
@@ -50235,18 +50124,18 @@ function specializeKeyword(value) {
|
|
|
50235
50124
|
// src/editor/dgmo.grammar.js
|
|
50236
50125
|
var parser = LRParser.deserialize({
|
|
50237
50126
|
version: 14,
|
|
50238
|
-
states: "!WQVQPOOOOQO'#
|
|
50239
|
-
stateData: "&
|
|
50240
|
-
goto: "!
|
|
50241
|
-
nodeNames: "\u26A0 ChartType TagKeyword DirectiveKeyword ControlKeyword ModifierKeyword Document Comment ContentLine SyncArrow AsyncArrow Duration DateLiteral Percentage Number SectionMarker Url OpenBracket CloseBracket OpenParen CloseParen OpenAngle CloseAngle
|
|
50242
|
-
maxTerm:
|
|
50127
|
+
states: "!WQVQPOOOOQO'#DU'#DUOOQO'#DP'#DPO%]QPO'#CdOOQO'#DO'#DOQVQPOOOOQO-E6}-E6}OOQO,59O,59OOOQO-E6|-E6|",
|
|
50128
|
+
stateData: "&Q~OvOS~OPPOQPORPOSPOTPOVSOXPOYPOZPO[PO]PO^PO_PO`POaPObPOcPOdPOePOfPOgPOhPOiPOjPOkPOlPOmPOnPOoPOpPOqPOwSO~OPPOQPORPOSPOTPOXPOYPOZPO[PO]PO^PO_PO`POaPObPOcPOdPOePOfPOgPOhPOiPOjPOkPOlPOmPOnPOoPOpPOqPO~OwVO~P#]OVXYZ[]^_`ghijklmnabcdefopqk~",
|
|
50129
|
+
goto: "!byPPPPPPPPzPPPPPPPPPPPPPPPPPPPPPPPPP!O!UPPPP!]TSOTQTORWTSROTRURVQORT",
|
|
50130
|
+
nodeNames: "\u26A0 ChartType TagKeyword DirectiveKeyword ControlKeyword ModifierKeyword Document Comment ContentLine SyncArrow AsyncArrow Duration DateLiteral Percentage Number SectionMarker Url OpenBracket CloseBracket OpenParen CloseParen OpenAngle CloseAngle Pipe Colon Comma Plus Dash Tilde Star Question QuotedString Identifier Punct",
|
|
50131
|
+
maxTerm: 40,
|
|
50243
50132
|
skippedNodes: [0],
|
|
50244
50133
|
repeatNodeCount: 2,
|
|
50245
|
-
tokenData: "
|
|
50134
|
+
tokenData: "<v~RzOX#uXY#zYZ$VZp#upq#zqr#urs$[st#uux#uxy%eyz%lz{%s{|%z|}&R}!O&Y!O!P#u!P!Q&i!Q!['Y![!]/{!]!^#u!^!_0S!_!`0Z!`!a0h!a!b0o!b!c#u!c!}0v!}#O3|#O#P#u#P#Q4R#Q#R#u#R#S0v#S#T#u#T#[0v#[#]4Y#]#o0v#o#p#u#p#q<Y#q#r#u#r#s<a#s;'S#u;'S;=`<p<%lO#u~#zOq~~$PQv~XY#zpq#z~$[Ow~~$aUq~OY$sZr$srs%Ys;'S$s;'S;=`%_<%lO$s~$vUOY$sZr$srs%Ys;'S$s;'S;=`%_<%lO$s~%_Oo~~%bP;=`<%l$s~%lOc~q~~%sOd~q~~%zOm~q~~&ROj~q~~&YOi~q~~&aPk~q~!`!a&d~&iOX~~&nPq~!P!Q&q~&vSV~OY&qZ;'S&q;'S;=`'S<%lO&q~'VP;=`<%l&q~'a]^~q~uv(Y|}(_!O!P)[!Q![*{#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~(_O]~~(bP!Q![(e~(hP!Q![(k~(nP!Q![(q~(vQ^~|}(_!O!P(|~)PP!Q![)S~)XP^~!Q![)S~)_P!Q![)b~)gY^~uv(Y!Q![)b#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~*YP#W#X*]~*bPZ~!a!b*e~*jOZ~~*oQZ~!a!b*e#]#^*u~*xP#b#c*]~+Q]^~uv(Y|}(_!O!P)[!Q![+y#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~,O]^~uv(Y|}(_!O!P)[!Q![,w#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~,|]^~uv(Y}!O-u!O!P)[!Q![.l#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~-xP!Q![-{~.OP!Q![.R~.WP[~}!O.Z~.^P!Q![.a~.dP!Q![.g~.lO[~~.q[^~uv(Y!O!P)[!Q![.l#R#S/g#U#V*V#W#X*]#[#]*]#a#b*j#e#f*]#g#h*]#k#l*]#m#n*]~/jP!Q![/m~/rR^~!O!P(|!Q![/m#R#S/g~0SOh~q~~0ZOe~q~~0`Pq~!_!`0c~0hO_~~0oOf~q~~0vOn~q~~0}_p~q~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#o1|~2R_p~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#o1|~3T]qr1|st1|vw1|wx1|{|1|!O!P1|!P!Q1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#o1|~4ROa~~4YOb~q~~4aap~q~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#h1|#h#i5f#i#o1|~5kap~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#h1|#h#i6p#i#o1|~6uap~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#d1|#d#e7z#e#o1|~8Pbp~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|![!]9X!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#g1|#g#h;R#h#o1|~9[P!P!Q9_~9bP!P!Q9e~9hYOX:WZp:Wqy:Wz|:W}!`:W!a#P:W#Q#p:W#q;'S:W;'S;=`:{<%lO:W~:]Y`~OX:WZp:Wqy:Wz|:W}!`:W!a#P:W#Q#p:W#q;'S:W;'S;=`:{<%lO:W~;OP;=`<%l:W~;W`p~qr1|st1|vw1|wx1|{|1|}!O3Q!O!P1|!P!Q1|!Q![1|![!]9X!_!`1|!a!b1|!b!c1|!c!}1|#R#S1|#T#o1|~<aOg~q~~<hPl~q~!`!a<k~<pOY~~<sP;=`<%l#u",
|
|
50246
50135
|
tokenizers: [0],
|
|
50247
50136
|
topRules: { "Document": [0, 6] },
|
|
50248
|
-
specialized: [{ term:
|
|
50249
|
-
tokenPrec:
|
|
50137
|
+
specialized: [{ term: 32, get: (value, stack) => specializeKeyword(value, stack) << 1, external: specializeKeyword }],
|
|
50138
|
+
tokenPrec: 204
|
|
50250
50139
|
});
|
|
50251
50140
|
|
|
50252
50141
|
// src/editor/highlight-api.ts
|
|
@@ -50269,7 +50158,6 @@ var NODE_TO_ROLE = {
|
|
|
50269
50158
|
Percentage: "number",
|
|
50270
50159
|
SectionMarker: "heading",
|
|
50271
50160
|
Url: "url",
|
|
50272
|
-
ColorAnnotation: "colorAnnotation",
|
|
50273
50161
|
OpenBracket: "bracket",
|
|
50274
50162
|
CloseBracket: "bracket",
|
|
50275
50163
|
OpenParen: "bracket",
|
|
@@ -50686,7 +50574,7 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
50686
50574
|
|
|
50687
50575
|
// src/auto/index.ts
|
|
50688
50576
|
init_safe_href();
|
|
50689
|
-
var VERSION = "0.
|
|
50577
|
+
var VERSION = "0.17.0";
|
|
50690
50578
|
var DEFAULTS = {
|
|
50691
50579
|
theme: "auto",
|
|
50692
50580
|
palette: "nord",
|
|
@@ -50834,7 +50722,7 @@ function resolveTheme(theme) {
|
|
|
50834
50722
|
function ensureStyles() {
|
|
50835
50723
|
if (typeof document === "undefined") return;
|
|
50836
50724
|
const html = document.documentElement;
|
|
50837
|
-
if (html
|
|
50725
|
+
if (html?.dataset?.[STYLE_FLAG] === "1") return;
|
|
50838
50726
|
const linked = document.querySelector(
|
|
50839
50727
|
'link[rel="stylesheet"][href*="auto.css"]'
|
|
50840
50728
|
);
|
|
@@ -50990,7 +50878,7 @@ function deriveAriaLabel(source) {
|
|
|
50990
50878
|
function determineReplaceTarget(matched) {
|
|
50991
50879
|
if (matched.tagName === "CODE") {
|
|
50992
50880
|
const parent = matched.parentElement;
|
|
50993
|
-
if (parent
|
|
50881
|
+
if (parent?.tagName === "PRE") {
|
|
50994
50882
|
const meaningfulChildren = Array.from(parent.childNodes).filter(
|
|
50995
50883
|
(n) => n.nodeType === 1 || n.nodeType === 3 && (n.textContent || "").trim().length > 0
|
|
50996
50884
|
);
|