@diagrammo/dgmo 0.8.11 → 0.8.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1951,6 +1951,16 @@ function validateTagValues(entities, tagGroups, pushWarning, suggestFn) {
1951
1951
  }
1952
1952
  }
1953
1953
  }
1954
+ function validateTagGroupNames(tagGroups, pushWarning) {
1955
+ for (const group of tagGroups) {
1956
+ if (group.name.toLowerCase() === "none") {
1957
+ pushWarning(
1958
+ group.lineNumber,
1959
+ `'none' is a reserved keyword and cannot be used as a tag group name`
1960
+ );
1961
+ }
1962
+ }
1963
+ }
1954
1964
  function injectDefaultTagMetadata(entities, tagGroups, skip) {
1955
1965
  const defaults = [];
1956
1966
  for (const group of tagGroups) {
@@ -1971,6 +1981,19 @@ function injectDefaultTagMetadata(entities, tagGroups, skip) {
1971
1981
  }
1972
1982
  }
1973
1983
  }
1984
+ function resolveActiveTagGroup(tagGroups, explicitActiveTag, programmaticOverride) {
1985
+ if (programmaticOverride !== void 0) {
1986
+ if (!programmaticOverride) return null;
1987
+ if (programmaticOverride.toLowerCase() === "none") return null;
1988
+ return programmaticOverride;
1989
+ }
1990
+ if (explicitActiveTag) {
1991
+ if (explicitActiveTag.toLowerCase() === "none") return null;
1992
+ return explicitActiveTag;
1993
+ }
1994
+ if (tagGroups.length > 0) return tagGroups[0].name;
1995
+ return null;
1996
+ }
1974
1997
  function matchTagBlockHeading(trimmed) {
1975
1998
  return parseTagDeclaration(trimmed);
1976
1999
  }
@@ -2274,13 +2297,15 @@ function computeLegendLayout(config, state, containerWidth) {
2274
2297
  });
2275
2298
  }
2276
2299
  }
2300
+ const alignLeft = config.position.titleRelation === "inline-with-title";
2277
2301
  const rows = layoutRows(
2278
2302
  activeCapsule,
2279
2303
  pills,
2280
2304
  controlLayouts,
2281
2305
  groupAvailW,
2282
2306
  containerWidth,
2283
- totalControlsW
2307
+ totalControlsW,
2308
+ alignLeft
2284
2309
  );
2285
2310
  const height = rows.length * LEGEND_HEIGHT;
2286
2311
  const width = containerWidth;
@@ -2354,7 +2379,7 @@ function buildCapsuleLayout(group, containerWidth, addonWidth = 0) {
2354
2379
  addonX: addonWidth > 0 ? LEGEND_CAPSULE_PAD + pw + 4 : void 0
2355
2380
  };
2356
2381
  }
2357
- function layoutRows(activeCapsule, pills, controls, groupAvailW, containerWidth, totalControlsW) {
2382
+ function layoutRows(activeCapsule, pills, controls, groupAvailW, containerWidth, totalControlsW, alignLeft = false) {
2358
2383
  const rows = [];
2359
2384
  const groupItems = [];
2360
2385
  if (activeCapsule) groupItems.push(activeCapsule);
@@ -2365,7 +2390,8 @@ function layoutRows(activeCapsule, pills, controls, groupAvailW, containerWidth,
2365
2390
  for (const item of groupItems) {
2366
2391
  const itemW = item.width + LEGEND_GROUP_GAP;
2367
2392
  if (currentRowW + item.width > groupAvailW && currentRowItems.length > 0) {
2368
- centerRowItems(currentRowItems, containerWidth, totalControlsW);
2393
+ if (!alignLeft)
2394
+ centerRowItems(currentRowItems, containerWidth, totalControlsW);
2369
2395
  rows.push({ y: rowY, items: currentRowItems });
2370
2396
  rowY += LEGEND_HEIGHT;
2371
2397
  currentRowItems = [];
@@ -3769,6 +3795,7 @@ function parseSequenceDgmo(content) {
3769
3795
  entities.push({ metadata: g.metadata, lineNumber: g.lineNumber });
3770
3796
  }
3771
3797
  validateTagValues(entities, result.tagGroups, pushWarning, suggest);
3798
+ validateTagGroupNames(result.tagGroups, pushWarning);
3772
3799
  }
3773
3800
  return result;
3774
3801
  }
@@ -5045,6 +5072,10 @@ function parseERDiagram(content, palette) {
5045
5072
  (line10, msg) => result.diagnostics.push(makeDgmoError(line10, msg, "warning")),
5046
5073
  suggest
5047
5074
  );
5075
+ validateTagGroupNames(
5076
+ result.tagGroups,
5077
+ (line10, msg) => result.diagnostics.push(makeDgmoError(line10, msg, "warning"))
5078
+ );
5048
5079
  for (const group of result.tagGroups) {
5049
5080
  if (!group.defaultValue) continue;
5050
5081
  const key = group.name.toLowerCase();
@@ -5140,7 +5171,7 @@ var init_parser3 = __esm({
5140
5171
  unique: "unique",
5141
5172
  nullable: "nullable"
5142
5173
  };
5143
- KNOWN_OPTIONS = /* @__PURE__ */ new Set(["notation"]);
5174
+ KNOWN_OPTIONS = /* @__PURE__ */ new Set(["notation", "active-tag"]);
5144
5175
  REL_SYMBOLIC_RE = /^([a-zA-Z_]\w*)\s+([1*?])\s*-{1,2}\s*([1*?])\s+([a-zA-Z_]\w*)(?:\s+(.+))?$/;
5145
5176
  REL_KEYWORD_RE = /^([a-zA-Z_]\w*)\s+(one|many|zero)[- ]to[- ](one|many|zero)\s+([a-zA-Z_]\w*)(?:\s+(.+))?$/i;
5146
5177
  KEYWORD_TO_SYMBOL = {
@@ -6233,7 +6264,7 @@ function buildChordOption(parsed, textColor, colors, bg, titleConfig) {
6233
6264
  };
6234
6265
  });
6235
6266
  })(),
6236
- roam: true,
6267
+ roam: false,
6237
6268
  label: {
6238
6269
  position: "right",
6239
6270
  formatter: "{b}"
@@ -7989,6 +8020,7 @@ function parseOrg(content, palette) {
7989
8020
  };
7990
8021
  collectAll(result.roots);
7991
8022
  validateTagValues(allNodes, result.tagGroups, pushWarning, suggest);
8023
+ validateTagGroupNames(result.tagGroups, pushWarning);
7992
8024
  }
7993
8025
  if (result.roots.length === 0 && result.tagGroups.length === 0 && !result.error) {
7994
8026
  const diag = makeDgmoError(1, "No nodes found in org chart");
@@ -8055,7 +8087,8 @@ var init_parser4 = __esm({
8055
8087
  KNOWN_OPTIONS3 = /* @__PURE__ */ new Set([
8056
8088
  "sub-node-label",
8057
8089
  "hide",
8058
- "show-sub-node-count"
8090
+ "show-sub-node-count",
8091
+ "active-tag"
8059
8092
  ]);
8060
8093
  KNOWN_BOOLEANS2 = /* @__PURE__ */ new Set(["show-sub-node-count", "direction-tb"]);
8061
8094
  }
@@ -8316,6 +8349,7 @@ function parseKanban(content, palette) {
8316
8349
  if (result.columns.length === 0 && !result.error) {
8317
8350
  return fail(1, "No columns found. Use [Column Name] to define columns");
8318
8351
  }
8352
+ validateTagGroupNames(result.tagGroups, warn);
8319
8353
  return result;
8320
8354
  }
8321
8355
  function parseCardLine(trimmed, lineNumber, counter, aliasMap, palette) {
@@ -8361,7 +8395,7 @@ var init_parser5 = __esm({
8361
8395
  init_parsing();
8362
8396
  COLUMN_RE = /^\[(.+?)\](?:\s*\(([^)]+)\))?\s*(?:\|\s*(.+))?$/;
8363
8397
  LEGACY_COLUMN_RE = /^==\s+(.+?)\s*(?:\[wip:\s*(\d+)\])?\s*==$/;
8364
- KNOWN_OPTIONS4 = /* @__PURE__ */ new Set(["hide"]);
8398
+ KNOWN_OPTIONS4 = /* @__PURE__ */ new Set(["hide", "active-tag"]);
8365
8399
  KNOWN_BOOLEANS3 = /* @__PURE__ */ new Set(["no-auto-color"]);
8366
8400
  }
8367
8401
  });
@@ -8904,6 +8938,10 @@ function parseC4(content, palette) {
8904
8938
  }
8905
8939
  validateRelationshipTargets(result, knownNames, pushError);
8906
8940
  validateDeploymentRefs(result, knownNames, pushError);
8941
+ validateTagGroupNames(
8942
+ result.tagGroups,
8943
+ (line10, msg) => pushError(line10, msg, "warning")
8944
+ );
8907
8945
  return result;
8908
8946
  }
8909
8947
  function findParentElement(indent, stack) {
@@ -9030,7 +9068,7 @@ var init_parser6 = __esm({
9030
9068
  "cloud",
9031
9069
  "external"
9032
9070
  ]);
9033
- KNOWN_C4_OPTIONS = /* @__PURE__ */ new Set(["layout"]);
9071
+ KNOWN_C4_OPTIONS = /* @__PURE__ */ new Set(["layout", "active-tag"]);
9034
9072
  KNOWN_C4_BOOLEANS = /* @__PURE__ */ new Set(["direction-tb"]);
9035
9073
  ALL_CHART_TYPES2 = [
9036
9074
  "c4",
@@ -9368,6 +9406,7 @@ function parseSitemap(content, palette) {
9368
9406
  };
9369
9407
  collectAll(result.roots);
9370
9408
  validateTagValues(allNodes, result.tagGroups, pushWarning, suggest);
9409
+ validateTagGroupNames(result.tagGroups, pushWarning);
9371
9410
  }
9372
9411
  if (result.roots.length === 0 && result.tagGroups.length === 0 && !result.error) {
9373
9412
  const diag = makeDgmoError(1, "No pages found in sitemap");
@@ -9968,6 +10007,7 @@ function parseInfra(content) {
9968
10007
  }
9969
10008
  }
9970
10009
  }
10010
+ validateTagGroupNames(result.tagGroups, warn);
9971
10011
  return result;
9972
10012
  }
9973
10013
  function extractSymbols4(docText) {
@@ -10046,7 +10086,8 @@ var init_parser8 = __esm({
10046
10086
  "slo-warning-margin",
10047
10087
  "default-latency-ms",
10048
10088
  "default-uptime",
10049
- "default-rps"
10089
+ "default-rps",
10090
+ "active-tag"
10050
10091
  ]);
10051
10092
  UNPARSED_SPLIT_RE = /\bsplit\s+(\d+)%/;
10052
10093
  }
@@ -10244,6 +10285,7 @@ function parseGantt(content, palette) {
10244
10285
  dependencies: true,
10245
10286
  sort: "default",
10246
10287
  defaultSwimlaneGroup: null,
10288
+ activeTag: null,
10247
10289
  optionLineNumbers: {},
10248
10290
  holidaysLineNumber: null
10249
10291
  },
@@ -10658,6 +10700,9 @@ function parseGantt(content, palette) {
10658
10700
  );
10659
10701
  }
10660
10702
  break;
10703
+ case "active-tag":
10704
+ result.options.activeTag = value;
10705
+ break;
10661
10706
  }
10662
10707
  continue;
10663
10708
  }
@@ -10837,6 +10882,7 @@ function parseGantt(content, palette) {
10837
10882
  warn(0, "sort tag has no effect \u2014 no tag groups defined.");
10838
10883
  result.options.sort = "default";
10839
10884
  }
10885
+ validateTagGroupNames(result.tagGroups, warn);
10840
10886
  return result;
10841
10887
  function makeTask(labelRaw, duration, uncertain, ln, explicitStart) {
10842
10888
  const segments = labelRaw.split("|");
@@ -10999,7 +11045,8 @@ var init_parser9 = __esm({
10999
11045
  "critical-path",
11000
11046
  "dependencies",
11001
11047
  "chart",
11002
- "sort"
11048
+ "sort",
11049
+ "active-tag"
11003
11050
  ]);
11004
11051
  KNOWN_BOOLEANS4 = /* @__PURE__ */ new Set([
11005
11052
  "critical-path",
@@ -11419,6 +11466,7 @@ function parseBoxesAndLines(content) {
11419
11466
  if (result.tagGroups.length > 0) {
11420
11467
  injectDefaultTagMetadata(result.nodes, result.tagGroups);
11421
11468
  validateTagValues(result.nodes, result.tagGroups, pushWarning, suggest);
11469
+ validateTagGroupNames(result.tagGroups, pushWarning);
11422
11470
  }
11423
11471
  return result;
11424
11472
  }
@@ -14293,7 +14341,7 @@ function renderKanban(container, parsed, palette, isDark, _onNavigateToLine, exp
14293
14341
  const legendY = DIAGRAM_PADDING3 + (TITLE_FONT_SIZE - LEGEND_HEIGHT) / 2;
14294
14342
  const legendConfig = {
14295
14343
  groups: parsed.tagGroups,
14296
- position: { placement: "top-center", titleRelation: "below-title" },
14344
+ position: { placement: "top-center", titleRelation: "inline-with-title" },
14297
14345
  mode: exportDims ? "inline" : "fixed"
14298
14346
  };
14299
14347
  const legendState = { activeGroup: activeTagGroup ?? null };
@@ -15975,7 +16023,11 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
15975
16023
  const width = exportDims?.width ?? container.clientWidth;
15976
16024
  const height = exportDims?.height ?? container.clientHeight;
15977
16025
  if (width <= 0 || height <= 0) return;
15978
- const activeGroup = activeTagGroup ?? parsed.options["active-tag"] ?? null;
16026
+ const activeGroup = resolveActiveTagGroup(
16027
+ parsed.tagGroups,
16028
+ parsed.options["active-tag"],
16029
+ activeTagGroup
16030
+ );
15979
16031
  const hidden = hiddenTagValues ?? parsed.initialHiddenTagValues;
15980
16032
  const nodeMap = /* @__PURE__ */ new Map();
15981
16033
  for (const node of parsed.nodes) nodeMap.set(node.label, node);
@@ -16153,7 +16205,8 @@ function renderBoxesAndLines(container, parsed, layout, palette, isDark, options
16153
16205
  }
16154
16206
  function renderBoxesAndLinesForExport(container, parsed, layout, palette, isDark, options) {
16155
16207
  renderBoxesAndLines(container, parsed, layout, palette, isDark, {
16156
- exportDims: options?.exportDims
16208
+ exportDims: options?.exportDims,
16209
+ activeTagGroup: options?.activeTagGroup
16157
16210
  });
16158
16211
  }
16159
16212
  var d3Selection6, d3Shape4, DIAGRAM_PADDING6, NODE_FONT_SIZE, MIN_NODE_FONT_SIZE, META_FONT_SIZE3, EDGE_LABEL_FONT_SIZE4, EDGE_STROKE_WIDTH5, NODE_STROKE_WIDTH5, NODE_RX, COLLAPSE_BAR_HEIGHT3, ARROWHEAD_W2, ARROWHEAD_H2, CHAR_WIDTH_RATIO2, NODE_TEXT_PADDING, GROUP_RX, GROUP_LABEL_FONT_SIZE, lineGeneratorLR, lineGeneratorTB, lineGeneratorLinear2;
@@ -22769,7 +22822,11 @@ function renderGantt(container, resolved, palette, isDark, options, exportDims)
22769
22822
  const collapsedLanes = options?.collapsedLanes;
22770
22823
  const onToggleLane = options?.onToggleLane;
22771
22824
  const seriesColors2 = getSeriesColors(palette);
22772
- let currentActiveGroup = options?.currentActiveGroup !== void 0 ? options.currentActiveGroup : resolved.tagGroups.length > 0 ? resolved.tagGroups[0].name : null;
22825
+ let currentActiveGroup = resolveActiveTagGroup(
22826
+ resolved.tagGroups,
22827
+ resolved.options.activeTag ?? void 0,
22828
+ options?.currentActiveGroup
22829
+ );
22773
22830
  let criticalPathActive = false;
22774
22831
  const tagRows = currentSwimlaneGroup ? buildTagLaneRowList(resolved, currentSwimlaneGroup, collapsedLanes) : null;
22775
22832
  const rows = tagRows ?? buildRowList(resolved, collapsedGroups);
@@ -25128,7 +25185,11 @@ function renderSequenceDiagram(container, parsed, palette, isDark, _onNavigateTo
25128
25185
  );
25129
25186
  if (participants.length === 0) return;
25130
25187
  const activationsOff = parsedOptions.activations?.toLowerCase() === "off";
25131
- const activeTagGroup = options?.activeTagGroup !== void 0 ? options.activeTagGroup || void 0 : parsedOptions["active-tag"] || void 0;
25188
+ const activeTagGroup = resolveActiveTagGroup(
25189
+ parsed.tagGroups,
25190
+ parsedOptions["active-tag"],
25191
+ options?.activeTagGroup
25192
+ ) ?? void 0;
25132
25193
  let tagMap;
25133
25194
  const tagValueToColor = /* @__PURE__ */ new Map();
25134
25195
  if (activeTagGroup) {
@@ -26131,6 +26192,7 @@ var init_renderer10 = __esm({
26131
26192
  init_colors();
26132
26193
  init_parser();
26133
26194
  init_tag_resolution();
26195
+ init_tag_groups();
26134
26196
  init_legend_constants();
26135
26197
  init_legend_d3();
26136
26198
  init_title_constants();
@@ -27086,6 +27148,10 @@ function parseVisualization(content, palette) {
27086
27148
  (line10, msg) => result.diagnostics.push(makeDgmoError(line10, msg, "warning")),
27087
27149
  suggest
27088
27150
  );
27151
+ validateTagGroupNames(
27152
+ result.timelineTagGroups,
27153
+ (line10, msg) => result.diagnostics.push(makeDgmoError(line10, msg, "warning"))
27154
+ );
27089
27155
  for (const group of result.timelineTagGroups) {
27090
27156
  if (!group.defaultValue) continue;
27091
27157
  const key = group.name.toLowerCase();
@@ -27982,6 +28048,26 @@ function buildEventTooltipHtml(ev) {
27982
28048
  function buildEraTooltipHtml(era) {
27983
28049
  return `<strong>${era.label}</strong><br>${formatDateLabel(era.startDate)} \u2192 ${formatDateLabel(era.endDate)}`;
27984
28050
  }
28051
+ function renderTimelineGroupLegend(g, groups, groupColorMap, textColor, palette, isDark, legendY, onHover, onLeave) {
28052
+ const PILL_H = 22;
28053
+ const DOT_R = 4;
28054
+ const DOT_GAP = 4;
28055
+ const PAD_X = 10;
28056
+ const FONT_SIZE = 11;
28057
+ const GAP = 8;
28058
+ const pillBg = isDark ? mix(palette.surface, palette.bg, 50) : mix(palette.surface, palette.bg, 30);
28059
+ let legendX = 0;
28060
+ for (const grp of groups) {
28061
+ const color = groupColorMap.get(grp.name) ?? textColor;
28062
+ const textW = measureLegendText(grp.name, FONT_SIZE);
28063
+ const pillW = PAD_X + DOT_R * 2 + DOT_GAP + textW + PAD_X;
28064
+ const itemG = g.append("g").attr("class", "tl-legend-item").attr("data-group", grp.name).style("cursor", "pointer").on("mouseenter", () => onHover(grp.name)).on("mouseleave", () => onLeave());
28065
+ itemG.append("rect").attr("x", legendX).attr("y", legendY - PILL_H / 2).attr("width", pillW).attr("height", PILL_H).attr("rx", PILL_H / 2).attr("fill", pillBg);
28066
+ itemG.append("circle").attr("cx", legendX + PAD_X + DOT_R).attr("cy", legendY).attr("r", DOT_R).attr("fill", color);
28067
+ itemG.append("text").attr("x", legendX + PAD_X + DOT_R * 2 + DOT_GAP).attr("y", legendY).attr("dy", "0.35em").attr("fill", textColor).attr("font-size", `${FONT_SIZE}px`).attr("font-family", FONT_FAMILY).text(grp.name);
28068
+ legendX += pillW + GAP;
28069
+ }
28070
+ }
27985
28071
  function renderTimeline(container, parsed, palette, isDark, onClickItem, exportDims, activeTagGroup, swimlaneTagGroup, onTagStateChange, viewMode) {
27986
28072
  d3Selection13.select(container).selectAll(":not([data-d3-tooltip])").remove();
27987
28073
  const {
@@ -28373,15 +28459,17 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
28373
28459
  );
28374
28460
  }
28375
28461
  if (timelineGroups.length > 0) {
28376
- let legendX = 0;
28377
- const legendY = -55;
28378
- for (const grp of timelineGroups) {
28379
- const color = groupColorMap.get(grp.name) ?? textColor;
28380
- const itemG = g.append("g").attr("class", "tl-legend-item").attr("data-group", grp.name).style("cursor", "pointer").on("mouseenter", () => fadeToGroup(g, grp.name)).on("mouseleave", () => fadeReset(g));
28381
- itemG.append("circle").attr("cx", legendX).attr("cy", legendY).attr("r", 5).attr("fill", color);
28382
- itemG.append("text").attr("x", legendX + 10).attr("y", legendY).attr("dy", "0.35em").attr("fill", textColor).attr("font-size", "11px").text(grp.name);
28383
- legendX += grp.name.length * 7 + 30;
28384
- }
28462
+ renderTimelineGroupLegend(
28463
+ g,
28464
+ timelineGroups,
28465
+ groupColorMap,
28466
+ textColor,
28467
+ palette,
28468
+ isDark,
28469
+ -55,
28470
+ (name) => fadeToGroup(g, name),
28471
+ () => fadeReset(g)
28472
+ );
28385
28473
  }
28386
28474
  g.append("line").attr("x1", axisX).attr("y1", 0).attr("x2", axisX).attr("y2", innerHeight).attr("stroke", mutedColor).attr("stroke-width", 1).attr("stroke-dasharray", "4,4");
28387
28475
  for (const ev of sorted) {
@@ -28689,15 +28777,18 @@ function renderTimeline(container, parsed, palette, isDark, onClickItem, exportD
28689
28777
  );
28690
28778
  }
28691
28779
  if (timelineGroups.length > 0) {
28692
- let legendX = 0;
28693
28780
  const legendY = timelineScale ? -75 : -55;
28694
- for (const grp of timelineGroups) {
28695
- const color = groupColorMap.get(grp.name) ?? textColor;
28696
- const itemG = g.append("g").attr("class", "tl-legend-item").attr("data-group", grp.name).style("cursor", "pointer").on("mouseenter", () => fadeToGroup(g, grp.name)).on("mouseleave", () => fadeReset(g));
28697
- itemG.append("circle").attr("cx", legendX).attr("cy", legendY).attr("r", 5).attr("fill", color);
28698
- itemG.append("text").attr("x", legendX + 10).attr("y", legendY).attr("dy", "0.35em").attr("fill", textColor).attr("font-size", "11px").text(grp.name);
28699
- legendX += grp.name.length * 7 + 30;
28700
- }
28781
+ renderTimelineGroupLegend(
28782
+ g,
28783
+ timelineGroups,
28784
+ groupColorMap,
28785
+ textColor,
28786
+ palette,
28787
+ isDark,
28788
+ legendY,
28789
+ (name) => fadeToGroup(g, name),
28790
+ () => fadeReset(g)
28791
+ );
28701
28792
  }
28702
28793
  sorted.forEach((ev, i) => {
28703
28794
  const y = markerMargin + i * rowH + rowH / 2;
@@ -29809,7 +29900,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29809
29900
  const orgParsed = parseOrg2(content, effectivePalette2);
29810
29901
  if (orgParsed.error) return "";
29811
29902
  const collapsedNodes = orgExportState?.collapsedNodes;
29812
- const activeTagGroup = orgExportState?.activeTagGroup ?? options?.tagGroup ?? null;
29903
+ const activeTagGroup = resolveActiveTagGroup(
29904
+ orgParsed.tagGroups,
29905
+ orgParsed.options["active-tag"],
29906
+ orgExportState?.activeTagGroup ?? options?.tagGroup
29907
+ );
29813
29908
  const hiddenAttributes = orgExportState?.hiddenAttributes;
29814
29909
  const { parsed: effectiveParsed, hiddenCounts } = collapsedNodes && collapsedNodes.size > 0 ? collapseOrgTree2(orgParsed, collapsedNodes) : { parsed: orgParsed, hiddenCounts: /* @__PURE__ */ new Map() };
29815
29910
  const orgLayout = layoutOrg2(
@@ -29848,7 +29943,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29848
29943
  const sitemapParsed = parseSitemap2(content, effectivePalette2);
29849
29944
  if (sitemapParsed.error || sitemapParsed.roots.length === 0) return "";
29850
29945
  const collapsedNodes = orgExportState?.collapsedNodes;
29851
- const activeTagGroup = orgExportState?.activeTagGroup ?? options?.tagGroup ?? null;
29946
+ const activeTagGroup = resolveActiveTagGroup(
29947
+ sitemapParsed.tagGroups,
29948
+ sitemapParsed.options["active-tag"],
29949
+ orgExportState?.activeTagGroup ?? options?.tagGroup
29950
+ );
29852
29951
  const hiddenAttributes = orgExportState?.hiddenAttributes;
29853
29952
  const { parsed: effectiveParsed, hiddenCounts } = collapsedNodes && collapsedNodes.size > 0 ? collapseSitemapTree2(sitemapParsed, collapsedNodes) : { parsed: sitemapParsed, hiddenCounts: /* @__PURE__ */ new Map() };
29854
29953
  const sitemapLayout = layoutSitemap2(
@@ -29893,7 +29992,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29893
29992
  theme === "dark",
29894
29993
  void 0,
29895
29994
  void 0,
29896
- options?.tagGroup
29995
+ resolveActiveTagGroup(
29996
+ kanbanParsed.tagGroups,
29997
+ kanbanParsed.options["active-tag"],
29998
+ options?.tagGroup
29999
+ )
29897
30000
  );
29898
30001
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
29899
30002
  }
@@ -29942,7 +30045,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29942
30045
  theme === "dark",
29943
30046
  void 0,
29944
30047
  { width: exportWidth, height: exportHeight },
29945
- options?.tagGroup
30048
+ resolveActiveTagGroup(
30049
+ erParsed.tagGroups,
30050
+ erParsed.options["active-tag"],
30051
+ options?.tagGroup
30052
+ )
29946
30053
  );
29947
30054
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
29948
30055
  }
@@ -29965,7 +30072,10 @@ async function renderForExport(content, theme, palette, orgExportState, options)
29965
30072
  blLayout,
29966
30073
  effectivePalette2,
29967
30074
  theme === "dark",
29968
- { exportDims: { width: exportWidth, height: exportHeight } }
30075
+ {
30076
+ exportDims: { width: exportWidth, height: exportHeight },
30077
+ activeTagGroup: options?.tagGroup
30078
+ }
29969
30079
  );
29970
30080
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
29971
30081
  }
@@ -30000,7 +30110,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
30000
30110
  theme === "dark",
30001
30111
  void 0,
30002
30112
  { width: exportWidth, height: exportHeight },
30003
- options?.tagGroup
30113
+ resolveActiveTagGroup(
30114
+ c4Parsed.tagGroups,
30115
+ c4Parsed.options["active-tag"],
30116
+ options?.tagGroup
30117
+ )
30004
30118
  );
30005
30119
  return finalizeSvgExport(container2, theme, effectivePalette2, options);
30006
30120
  }
@@ -30034,7 +30148,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
30034
30148
  if (infraParsed.error || infraParsed.nodes.length === 0) return "";
30035
30149
  const infraComputed = computeInfra2(infraParsed);
30036
30150
  const infraLayout = layoutInfra2(infraComputed);
30037
- const activeTagGroup = options?.tagGroup ?? null;
30151
+ const activeTagGroup = resolveActiveTagGroup(
30152
+ infraParsed.tagGroups,
30153
+ infraParsed.options["active-tag"],
30154
+ options?.tagGroup
30155
+ );
30038
30156
  const titleOffset = infraParsed.title ? 40 : 0;
30039
30157
  const legendGroups = computeInfraLegendGroups2(
30040
30158
  infraLayout.nodes,
@@ -30169,7 +30287,11 @@ async function renderForExport(content, theme, palette, orgExportState, options)
30169
30287
  isDark,
30170
30288
  void 0,
30171
30289
  dims,
30172
- orgExportState?.activeTagGroup ?? options?.tagGroup,
30290
+ resolveActiveTagGroup(
30291
+ parsed.timelineTagGroups,
30292
+ void 0,
30293
+ orgExportState?.activeTagGroup ?? options?.tagGroup
30294
+ ),
30173
30295
  orgExportState?.swimlaneTagGroup
30174
30296
  );
30175
30297
  } else if (parsed.type === "venn") {
@@ -31308,7 +31430,7 @@ init_palettes();
31308
31430
 
31309
31431
  // src/sharing.ts
31310
31432
  var import_lz_string = require("lz-string");
31311
- var DEFAULT_BASE_URL = "https://diagrammo.app/view";
31433
+ var DEFAULT_BASE_URL = "https://online.diagrammo.app";
31312
31434
  var COMPRESSED_SIZE_LIMIT = 8192;
31313
31435
  function encodeDiagramUrl(dsl, options) {
31314
31436
  const baseUrl = options?.baseUrl ?? DEFAULT_BASE_URL;
@@ -31580,21 +31702,33 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
31580
31702
  }
31581
31703
  })
31582
31704
  ],
31583
- ["er", withGlobals()],
31705
+ [
31706
+ "er",
31707
+ withGlobals({
31708
+ "active-tag": { description: "Active tag group name" }
31709
+ })
31710
+ ],
31584
31711
  [
31585
31712
  "org",
31586
31713
  withGlobals({
31587
31714
  "sub-node-label": { description: "Label for sub-nodes" },
31588
- "show-sub-node-count": { description: "Show sub-node counts" }
31715
+ "show-sub-node-count": { description: "Show sub-node counts" },
31716
+ "active-tag": { description: "Active tag group name" }
31589
31717
  })
31590
31718
  ],
31591
31719
  [
31592
31720
  "kanban",
31593
31721
  withGlobals({
31594
- "no-auto-color": { description: "Disable automatic card coloring" }
31722
+ "no-auto-color": { description: "Disable automatic card coloring" },
31723
+ "active-tag": { description: "Active tag group name" }
31724
+ })
31725
+ ],
31726
+ [
31727
+ "c4",
31728
+ withGlobals({
31729
+ "active-tag": { description: "Active tag group name" }
31595
31730
  })
31596
31731
  ],
31597
- ["c4", withGlobals()],
31598
31732
  [
31599
31733
  "state",
31600
31734
  withGlobals({
@@ -31605,7 +31739,8 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
31605
31739
  [
31606
31740
  "sitemap",
31607
31741
  withGlobals({
31608
- "direction-tb": { description: "Switch to top-to-bottom layout" }
31742
+ "direction-tb": { description: "Switch to top-to-bottom layout" },
31743
+ "active-tag": { description: "Active tag group name" }
31609
31744
  })
31610
31745
  ],
31611
31746
  [
@@ -31619,7 +31754,8 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
31619
31754
  "default-rps": { description: "Default RPS capacity for all nodes" },
31620
31755
  "slo-availability": { description: "SLO availability target (0-1)" },
31621
31756
  "slo-p90-latency-ms": { description: "SLO p90 latency target in ms" },
31622
- "slo-warning-margin": { description: "SLO warning margin percentage" }
31757
+ "slo-warning-margin": { description: "SLO warning margin percentage" },
31758
+ "active-tag": { description: "Active tag group name" }
31623
31759
  })
31624
31760
  ],
31625
31761
  [
@@ -31631,7 +31767,8 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
31631
31767
  },
31632
31768
  sort: { description: "Sort order", values: ["time", "group", "tag"] },
31633
31769
  "critical-path": { description: "Show critical path" },
31634
- dependencies: { description: "Show dependencies" }
31770
+ dependencies: { description: "Show dependencies" },
31771
+ "active-tag": { description: "Active tag group name" }
31635
31772
  })
31636
31773
  ],
31637
31774
  [