@diagrammo/dgmo 0.48.0 → 0.48.2
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/advanced.js +12 -12
- package/dist/auto.css +11 -5
- package/dist/auto.js +94 -88
- package/dist/auto.mjs +101 -22
- package/dist/block.css +11 -5
- package/dist/block.js +15 -9
- package/dist/{chunk-FNB3PNGF.js → chunk-7DTWEFUE.js} +3 -3
- package/dist/{chunk-2DXMZRWJ.js → chunk-B65G5DNL.js} +8 -1
- package/dist/{chunk-RZCF2VVM.js → chunk-B7JUCQUA.js} +3 -1
- package/dist/{chunk-DU7W62N5.js → chunk-FANX6UJR.js} +3 -3
- package/dist/{chunk-6FZYCKXB.js → chunk-HSH73DP6.js} +2 -2
- package/dist/{chunk-P4RH4OSP.js → chunk-ILKORZ3H.js} +2 -2
- package/dist/{chunk-Y5QGVTVC.js → chunk-JTSMEYIZ.js} +7 -3
- package/dist/{chunk-RCERWOJR.js → chunk-ODZVHU3R.js} +1 -2
- package/dist/{chunk-IH6ZMVQ5.js → chunk-PZMETGLY.js} +30 -12
- package/dist/{chunk-DZAQBW35.js → chunk-SGZYXELT.js} +3 -7
- package/dist/{chunk-CUVHQHZ7.js → chunk-THXCFRTU.js} +3 -3
- package/dist/{chunk-A4VFQH5G.js → chunk-YGJZWZTY.js} +51 -6
- package/dist/{chunk-EMS2SK26.js → chunk-ZBWMSD5N.js} +3 -1
- package/dist/cli.cjs +110 -110
- package/dist/{dgmo-router-DZCIDUO5.js → dgmo-router-X35VLZLM.js} +3 -3
- package/dist/element.js +95 -89
- package/dist/element.mjs +101 -22
- package/dist/{flowchart-renderer-ZAEOL4DX.js → flowchart-renderer-SNDSII4D.js} +2 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -4
- package/dist/{parser-FUSKFGZN.js → parser-2EWECDSA.js} +2 -2
- package/dist/{renderer-UWA5XS74.js → renderer-4JHRUBE6.js} +3 -3
- package/dist/{renderer-WZRREQ2P.js → renderer-5MYBMBYO.js} +2 -2
- package/dist/{renderer-TOCOVLHS.js → renderer-B2OMQIQG.js} +3 -3
- package/dist/{renderer-2XQQQ6QR.js → renderer-N43WR5GV.js} +3 -3
- package/dist/{renderer-ZTR3DER3.js → renderer-UV6MI64M.js} +2 -2
- package/dist/{renderer-T7YKC5VP.js → renderer-ZRNG54CW.js} +3 -3
- package/dist/{state-renderer-RFYHSP4K.js → state-renderer-B4DQBM6M.js} +2 -2
- package/package.json +5 -2
package/dist/auto.mjs
CHANGED
|
@@ -16260,6 +16260,13 @@ function parseC4(content, palette) {
|
|
|
16260
16260
|
}
|
|
16261
16261
|
namePart = namePart.substring(0, nameIsAMatch.index).trim();
|
|
16262
16262
|
}
|
|
16263
|
+
const bareTail = metaTail.trim();
|
|
16264
|
+
if (bareTail && !bareTail.includes(":")) {
|
|
16265
|
+
pushError(
|
|
16266
|
+
lineNumber,
|
|
16267
|
+
`text after 'is a ${rawType}' must be 'key: value' metadata \u2014 '${bareTail}' is not recognized (did you mean 'description: ${bareTail}'?)`
|
|
16268
|
+
);
|
|
16269
|
+
}
|
|
16263
16270
|
const metadata = parseC4MetaTail(metaTail, metaAliasMap);
|
|
16264
16271
|
const shape = explicitShape ?? inferC4Shape(namePart, metadata["tech"] ?? metadata["technology"]);
|
|
16265
16272
|
let isADescription;
|
|
@@ -29389,10 +29396,14 @@ function runInExportContainer(width, height, fn) {
|
|
|
29389
29396
|
document.body.removeChild(container);
|
|
29390
29397
|
}
|
|
29391
29398
|
}
|
|
29392
|
-
function extractExportSvg(container, theme) {
|
|
29399
|
+
function extractExportSvg(container, theme, palette) {
|
|
29393
29400
|
const svgEl = container.querySelector("svg");
|
|
29394
29401
|
if (!svgEl) return "";
|
|
29395
|
-
if (theme === "transparent")
|
|
29402
|
+
if (theme === "transparent") {
|
|
29403
|
+
svgEl.style.background = "none";
|
|
29404
|
+
} else if (palette && !svgEl.style.background) {
|
|
29405
|
+
svgEl.style.background = palette.bg;
|
|
29406
|
+
}
|
|
29396
29407
|
svgEl.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
29397
29408
|
svgEl.style.fontFamily = FONT_FAMILY;
|
|
29398
29409
|
svgEl.querySelectorAll("[data-export-ignore]").forEach((el) => el.remove());
|
|
@@ -29811,7 +29822,7 @@ function renderOrgForExport(content, theme, palette) {
|
|
|
29811
29822
|
width: exportWidth,
|
|
29812
29823
|
height: exportHeight
|
|
29813
29824
|
});
|
|
29814
|
-
return extractExportSvg(container, theme);
|
|
29825
|
+
return extractExportSvg(container, theme, palette);
|
|
29815
29826
|
});
|
|
29816
29827
|
}
|
|
29817
29828
|
var DIAGRAM_PADDING, MAX_SCALE, TITLE_HEIGHT, ANCESTOR_DOT_R, ANCESTOR_LABEL_FONT_SIZE, ANCESTOR_ROW_HEIGHT, ANCESTOR_TRAIL_BOTTOM_GAP, LEGEND_FIXED_GAP;
|
|
@@ -32314,7 +32325,7 @@ function renderClassDiagramForExport(content, theme, palette) {
|
|
|
32314
32325
|
true
|
|
32315
32326
|
// exportMode
|
|
32316
32327
|
);
|
|
32317
|
-
return extractExportSvg(container, theme);
|
|
32328
|
+
return extractExportSvg(container, theme, palette);
|
|
32318
32329
|
});
|
|
32319
32330
|
}
|
|
32320
32331
|
var DIAGRAM_PADDING4, MAX_SCALE3, CLASS_FONT_SIZE2, MEMBER_FONT_SIZE2, EDGE_LABEL_FONT_SIZE2, MEMBER_LINE_HEIGHT2, COMPARTMENT_PADDING_Y2, MEMBER_PADDING_X, CLASS_TYPE_MAP, CLASS_TYPE_ORDER, LEGEND_GROUP_NAME, lineGenerator2;
|
|
@@ -38493,7 +38504,7 @@ function renderMindmapForExport(content, theme, palette) {
|
|
|
38493
38504
|
void 0,
|
|
38494
38505
|
hideDescriptions
|
|
38495
38506
|
);
|
|
38496
|
-
return extractExportSvg(container, theme);
|
|
38507
|
+
return extractExportSvg(container, theme, palette);
|
|
38497
38508
|
});
|
|
38498
38509
|
}
|
|
38499
38510
|
var DIAGRAM_PADDING7, TITLE_HEIGHT4, SINGLE_LABEL_HEIGHT2, LABEL_LINE_HEIGHT4, DESC_LINE_HEIGHT4, NODE_RADIUS, ROOT_STROKE_WIDTH, DEPTH_COLOR_KEYS;
|
|
@@ -42876,6 +42887,8 @@ function renderFlowchartForExport(content, theme, palette) {
|
|
|
42876
42887
|
if (!svgEl) return "";
|
|
42877
42888
|
if (theme === "transparent") {
|
|
42878
42889
|
svgEl.style.background = "none";
|
|
42890
|
+
} else if (!svgEl.style.background) {
|
|
42891
|
+
svgEl.style.background = palette.bg;
|
|
42879
42892
|
}
|
|
42880
42893
|
svgEl.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
42881
42894
|
svgEl.style.fontFamily = FONT_FAMILY;
|
|
@@ -52521,6 +52534,8 @@ function renderStateForExport(content, theme, palette) {
|
|
|
52521
52534
|
if (!svgEl) return "";
|
|
52522
52535
|
if (theme === "transparent") {
|
|
52523
52536
|
svgEl.style.background = "none";
|
|
52537
|
+
} else if (!svgEl.style.background) {
|
|
52538
|
+
svgEl.style.background = palette.bg;
|
|
52524
52539
|
}
|
|
52525
52540
|
svgEl.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
52526
52541
|
svgEl.style.fontFamily = FONT_FAMILY;
|
|
@@ -61535,20 +61550,35 @@ function renderRing(container, parsed, palette, isDark, onClickItem, exportDims)
|
|
|
61535
61550
|
}
|
|
61536
61551
|
if (inBandLabelsVisible) {
|
|
61537
61552
|
const labelsG = svg.append("g").attr("class", "ring-labels");
|
|
61553
|
+
const labelDefs = labelsG.append("defs");
|
|
61554
|
+
let ringLabelSeq = 0;
|
|
61538
61555
|
for (let i = 0; i < N; i++) {
|
|
61539
61556
|
const layer = parsed.layers[i];
|
|
61540
61557
|
const fill2 = layerFills[i];
|
|
61541
61558
|
const isInnermost = i === 0;
|
|
61542
|
-
const labelY = isInnermost ? cy : cy - (i + 0.5) * thickness;
|
|
61543
|
-
const fittedFont = labelFont;
|
|
61544
61559
|
const textColor = contrastText(
|
|
61545
61560
|
fill2,
|
|
61546
61561
|
palette.textOnFillLight,
|
|
61547
61562
|
palette.textOnFillDark
|
|
61548
61563
|
);
|
|
61549
61564
|
const labelG = labelsG.append("g").attr("class", "ring-label-group").attr("data-line-number", layer.lineNumber);
|
|
61550
|
-
|
|
61551
|
-
|
|
61565
|
+
if (isInnermost) {
|
|
61566
|
+
const label = labelG.append("text").attr("class", "ring-label").attr("x", cx).attr("y", cy).attr("dy", "0.35em").attr("text-anchor", "middle").attr("fill", textColor).attr("font-family", FONT_FAMILY).attr("font-size", labelFont).attr("font-weight", 600).style("pointer-events", "none");
|
|
61567
|
+
renderInlineText(label, layer.label, palette, labelFont);
|
|
61568
|
+
continue;
|
|
61569
|
+
}
|
|
61570
|
+
drawRingCurvedLabel(
|
|
61571
|
+
labelG,
|
|
61572
|
+
labelDefs,
|
|
61573
|
+
`dgmo-ring-lbl-${ringLabelSeq++}`,
|
|
61574
|
+
layer.label,
|
|
61575
|
+
cx,
|
|
61576
|
+
cy,
|
|
61577
|
+
(i + 0.5) * thickness,
|
|
61578
|
+
labelFont,
|
|
61579
|
+
textColor,
|
|
61580
|
+
palette
|
|
61581
|
+
);
|
|
61552
61582
|
}
|
|
61553
61583
|
}
|
|
61554
61584
|
if (hasAnyDescription || !inBandLabelsVisible) {
|
|
@@ -61568,6 +61598,34 @@ function renderRing(container, parsed, palette, isDark, onClickItem, exportDims)
|
|
|
61568
61598
|
});
|
|
61569
61599
|
}
|
|
61570
61600
|
}
|
|
61601
|
+
function drawRingCurvedLabel(labelG, defs, pathId, text, cx, cy, rMid, labelFont, textColor, palette) {
|
|
61602
|
+
const PAD = 1.18;
|
|
61603
|
+
let fs = labelFont;
|
|
61604
|
+
let rPath = rMid - fs * 0.32;
|
|
61605
|
+
const maxLen = MAX_LABEL_ARC * rPath;
|
|
61606
|
+
const wPadded = measureText(text, labelFont) * PAD;
|
|
61607
|
+
if (wPadded > maxLen) {
|
|
61608
|
+
fs = Math.max(LABEL_FONT_MIN2, Math.floor(labelFont * maxLen / wPadded));
|
|
61609
|
+
rPath = rMid - fs * 0.32;
|
|
61610
|
+
}
|
|
61611
|
+
const arcLen = measureText(text, fs) * PAD;
|
|
61612
|
+
const halfAngle = Math.min(arcLen / (2 * rPath), MAX_LABEL_ARC / 2);
|
|
61613
|
+
const largeArc = halfAngle * 2 > Math.PI ? 1 : 0;
|
|
61614
|
+
const p0x = cx - Math.sin(halfAngle) * rPath;
|
|
61615
|
+
const p0y = cy - Math.cos(halfAngle) * rPath;
|
|
61616
|
+
const p1x = cx + Math.sin(halfAngle) * rPath;
|
|
61617
|
+
const p1y = cy - Math.cos(halfAngle) * rPath;
|
|
61618
|
+
const d = `M ${p0x.toFixed(2)} ${p0y.toFixed(2)} A ${rPath.toFixed(2)} ${rPath.toFixed(2)} 0 ${largeArc} 1 ${p1x.toFixed(2)} ${p1y.toFixed(2)}`;
|
|
61619
|
+
defs.append("path").attr("id", pathId).attr("d", d);
|
|
61620
|
+
const label = labelG.append("text").attr("class", "ring-label").attr("fill", textColor).attr("font-family", FONT_FAMILY).attr("font-size", fs).attr("font-weight", 600).style("pointer-events", "none");
|
|
61621
|
+
const textPath = label.append("textPath").attr("href", `#${pathId}`).attr("startOffset", "50%").attr("text-anchor", "middle");
|
|
61622
|
+
renderInlineText(
|
|
61623
|
+
textPath,
|
|
61624
|
+
text,
|
|
61625
|
+
palette,
|
|
61626
|
+
fs
|
|
61627
|
+
);
|
|
61628
|
+
}
|
|
61571
61629
|
function renderRingForExport(container, parsed, palette, isDark, exportDims) {
|
|
61572
61630
|
renderRing(container, parsed, palette, isDark, void 0, exportDims);
|
|
61573
61631
|
}
|
|
@@ -61651,7 +61709,7 @@ function truncateWithEllipsis2(lines, cap) {
|
|
|
61651
61709
|
function clamp2(x, lo, hi) {
|
|
61652
61710
|
return Math.max(lo, Math.min(hi, x));
|
|
61653
61711
|
}
|
|
61654
|
-
var TITLE_AREA_HEIGHT3, H_MARGIN_FRAC2, V_MARGIN2, RING_AREA_FRAC_NO_DESC, RING_AREA_FRAC_WITH_DESC, DESC_GAP2, DESC_ACCENT_WIDTH2, DESC_ACCENT_GAP2, BULLET_BODY_INDENT2, RING_STROKE_WIDTH, RING_STROKE_OPACITY, DESC_LINE_CAP, LABEL_FONT_MIN2, LABEL_FONT_MAX2, DESC_FONT_MIN2, DESC_FONT_MAX2;
|
|
61712
|
+
var TITLE_AREA_HEIGHT3, H_MARGIN_FRAC2, V_MARGIN2, RING_AREA_FRAC_NO_DESC, RING_AREA_FRAC_WITH_DESC, DESC_GAP2, DESC_ACCENT_WIDTH2, DESC_ACCENT_GAP2, BULLET_BODY_INDENT2, RING_STROKE_WIDTH, RING_STROKE_OPACITY, DESC_LINE_CAP, LABEL_FONT_MIN2, LABEL_FONT_MAX2, DESC_FONT_MIN2, DESC_FONT_MAX2, MAX_LABEL_ARC;
|
|
61655
61713
|
var init_renderer22 = __esm({
|
|
61656
61714
|
"src/ring/renderer.ts"() {
|
|
61657
61715
|
"use strict";
|
|
@@ -61679,6 +61737,7 @@ var init_renderer22 = __esm({
|
|
|
61679
61737
|
LABEL_FONT_MAX2 = 22;
|
|
61680
61738
|
DESC_FONT_MIN2 = 11;
|
|
61681
61739
|
DESC_FONT_MAX2 = 15;
|
|
61740
|
+
MAX_LABEL_ARC = 1.6 * Math.PI;
|
|
61682
61741
|
}
|
|
61683
61742
|
});
|
|
61684
61743
|
|
|
@@ -63074,7 +63133,7 @@ function renderRaci(container, parsed, palette, isDark, handlers, exportDims) {
|
|
|
63074
63133
|
const colBottomY = cursorY + sColumnBottomPad;
|
|
63075
63134
|
const totalHeight = colBottomY + sVMargin;
|
|
63076
63135
|
const svgHeight = exportDims ? totalHeight : Math.max(height, totalHeight);
|
|
63077
|
-
const svg = d3Selection32.select(container).append("svg").attr("xmlns", "http://www.w3.org/2000/svg").attr("width", width).attr("height", svgHeight).attr("viewBox", `0 0 ${width} ${svgHeight}`).attr("preserveAspectRatio", "xMidYMin meet").attr("font-family", FONT_FAMILY)
|
|
63136
|
+
const svg = d3Selection32.select(container).append("svg").attr("xmlns", "http://www.w3.org/2000/svg").attr("width", width).attr("height", svgHeight).attr("viewBox", `0 0 ${width} ${svgHeight}`).attr("preserveAspectRatio", "xMidYMin meet").attr("font-family", FONT_FAMILY);
|
|
63078
63137
|
if (ctx.isBelowFloor) {
|
|
63079
63138
|
svg.attr("width", "100%");
|
|
63080
63139
|
}
|
|
@@ -63153,11 +63212,7 @@ function renderRaci(container, parsed, palette, isDark, handlers, exportDims) {
|
|
|
63153
63212
|
const cw = roleColW - 2 * sColumnInset;
|
|
63154
63213
|
const roleColor = parsed.roleColors[i] ?? autoAccent(i, palette);
|
|
63155
63214
|
const bodyFill = mix(roleColor, themeBaseBg(palette, isDark), 16);
|
|
63156
|
-
const headerFill = mix(
|
|
63157
|
-
roleColor,
|
|
63158
|
-
themeBaseBg(palette, isDark),
|
|
63159
|
-
30
|
|
63160
|
-
);
|
|
63215
|
+
const headerFill = mix(roleColor, themeBaseBg(palette, isDark), 30);
|
|
63161
63216
|
const colG = columnsG.append("g").attr("class", "raci-column").attr("data-role-id", roleId);
|
|
63162
63217
|
colG.append("rect").attr("class", "raci-column-body").attr("x", cx).attr("y", headerY).attr("width", cw).attr("height", colTotalHeight).attr("rx", sColumnRadius).attr("fill", bodyFill);
|
|
63163
63218
|
colG.append("path").attr("class", "raci-column-header").attr(
|
|
@@ -68752,34 +68807,50 @@ function buildHoverCss(spec, derived = {}, emphasisOverride) {
|
|
|
68752
68807
|
return parts.join("");
|
|
68753
68808
|
}
|
|
68754
68809
|
var HOVER_SPECS = {
|
|
68810
|
+
// Data-chart family (`.dgmo-datum`): `dim` at 0.18 to MIRROR the app's live
|
|
68811
|
+
// hover (charts-d3/interactions.ts `.dgmo-dim{opacity:.18}` — hover a mark →
|
|
68812
|
+
// every other emph-key drops out). `lift` (saturate/brightness) read as
|
|
68813
|
+
// "nothing happened" on muted fills. Safe to dim: these export renderers set
|
|
68814
|
+
// NO inline `style="opacity"` on datums (only presentation `*-opacity` attrs,
|
|
68815
|
+
// which a `<style>` rule outranks), so no RED-2 inline-defeat.
|
|
68755
68816
|
pie: {
|
|
68756
68817
|
markSelector: ".dgmo-datum",
|
|
68757
68818
|
strategy: "enumerated",
|
|
68758
68819
|
groupAttr: "data-emph-key",
|
|
68820
|
+
emphasis: "dim",
|
|
68821
|
+
dimOpacity: 0.18,
|
|
68759
68822
|
legend: true
|
|
68760
68823
|
},
|
|
68761
68824
|
bar: {
|
|
68762
68825
|
markSelector: ".dgmo-datum",
|
|
68763
68826
|
strategy: "enumerated",
|
|
68764
68827
|
groupAttr: "data-emph-key",
|
|
68828
|
+
emphasis: "dim",
|
|
68829
|
+
dimOpacity: 0.18,
|
|
68765
68830
|
legend: true
|
|
68766
68831
|
},
|
|
68767
68832
|
funnel: {
|
|
68768
68833
|
markSelector: ".dgmo-datum",
|
|
68769
68834
|
strategy: "enumerated",
|
|
68770
68835
|
groupAttr: "data-emph-key",
|
|
68836
|
+
emphasis: "dim",
|
|
68837
|
+
dimOpacity: 0.18,
|
|
68771
68838
|
legend: true
|
|
68772
68839
|
},
|
|
68773
68840
|
heatmap: {
|
|
68774
68841
|
markSelector: ".dgmo-datum",
|
|
68775
68842
|
strategy: "enumerated",
|
|
68776
68843
|
groupAttr: "data-emph-key",
|
|
68844
|
+
emphasis: "dim",
|
|
68845
|
+
dimOpacity: 0.18,
|
|
68777
68846
|
legend: true
|
|
68778
68847
|
},
|
|
68779
68848
|
"polar-area": {
|
|
68780
68849
|
markSelector: ".dgmo-datum",
|
|
68781
68850
|
strategy: "enumerated",
|
|
68782
68851
|
groupAttr: "data-emph-key",
|
|
68852
|
+
emphasis: "dim",
|
|
68853
|
+
dimOpacity: 0.18,
|
|
68783
68854
|
legend: true
|
|
68784
68855
|
},
|
|
68785
68856
|
// ── CROSS-FREE diagram charts — FIXED-attr keys, DOM-verified (Task 3) ──
|
|
@@ -68953,6 +69024,8 @@ var HOVER_SPECS = {
|
|
|
68953
69024
|
markSelector: ".dgmo-datum",
|
|
68954
69025
|
strategy: "enumerated",
|
|
68955
69026
|
groupAttr: "data-category",
|
|
69027
|
+
emphasis: "dim",
|
|
69028
|
+
dimOpacity: 0.18,
|
|
68956
69029
|
legend: true
|
|
68957
69030
|
},
|
|
68958
69031
|
quadrant: {
|
|
@@ -69783,15 +69856,21 @@ var BLOCK_CSS = `
|
|
|
69783
69856
|
opacity: 1;
|
|
69784
69857
|
}
|
|
69785
69858
|
|
|
69786
|
-
/* ===
|
|
69859
|
+
/* === Frame the whole block ===
|
|
69787
69860
|
* When the source panel is open, diagram + toolbar + code get one shared
|
|
69788
|
-
* border so the code visibly belongs to the chart above it
|
|
69789
|
-
*
|
|
69790
|
-
|
|
69791
|
-
|
|
69861
|
+
* border so the code visibly belongs to the chart above it. The frame box
|
|
69862
|
+
* (border + padding) is RESERVED at all times \u2014 with the border transparent
|
|
69863
|
+
* while closed \u2014 so opening the panel only paints the border in. It never
|
|
69864
|
+
* reflows the diagram or shifts the toolbar: the SVG box and toolbar position
|
|
69865
|
+
* are identical open vs closed. */
|
|
69866
|
+
.dgmo:has(> .dgmo-source-wrap) {
|
|
69867
|
+
border: 1px solid transparent;
|
|
69792
69868
|
border-radius: 0.6em;
|
|
69793
69869
|
padding: 0.75em 0.75em 0.5em;
|
|
69794
69870
|
}
|
|
69871
|
+
.dgmo:has(> .dgmo-source-wrap[open]) {
|
|
69872
|
+
border-color: rgba(127, 127, 127, 0.3);
|
|
69873
|
+
}
|
|
69795
69874
|
|
|
69796
69875
|
/* === Source panel (hidden until toggled) === */
|
|
69797
69876
|
.dgmo-source-inner {
|
|
@@ -70072,7 +70151,7 @@ var CSS = AUTO_BASE_CSS + "\n" + BLOCK_CSS + "\n" + darkScopedBlockCss(BLOCK_CSS
|
|
|
70072
70151
|
|
|
70073
70152
|
// src/auto/shared.ts
|
|
70074
70153
|
init_safe_href();
|
|
70075
|
-
var VERSION = "0.48.
|
|
70154
|
+
var VERSION = "0.48.2";
|
|
70076
70155
|
var ARIA_LABEL_MAX = 200;
|
|
70077
70156
|
var COPIED_INTERACTION_MS = 1500;
|
|
70078
70157
|
var LOG_PREFIX = "[dgmo]";
|
package/dist/block.css
CHANGED
|
@@ -109,15 +109,21 @@
|
|
|
109
109
|
opacity: 1;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
/* ===
|
|
112
|
+
/* === Frame the whole block ===
|
|
113
113
|
* When the source panel is open, diagram + toolbar + code get one shared
|
|
114
|
-
* border so the code visibly belongs to the chart above it
|
|
115
|
-
*
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
* border so the code visibly belongs to the chart above it. The frame box
|
|
115
|
+
* (border + padding) is RESERVED at all times — with the border transparent
|
|
116
|
+
* while closed — so opening the panel only paints the border in. It never
|
|
117
|
+
* reflows the diagram or shifts the toolbar: the SVG box and toolbar position
|
|
118
|
+
* are identical open vs closed. */
|
|
119
|
+
.dgmo:has(> .dgmo-source-wrap) {
|
|
120
|
+
border: 1px solid transparent;
|
|
118
121
|
border-radius: 0.6em;
|
|
119
122
|
padding: 0.75em 0.75em 0.5em;
|
|
120
123
|
}
|
|
124
|
+
.dgmo:has(> .dgmo-source-wrap[open]) {
|
|
125
|
+
border-color: rgba(127, 127, 127, 0.3);
|
|
126
|
+
}
|
|
121
127
|
|
|
122
128
|
/* === Source panel (hidden until toggled) === */
|
|
123
129
|
.dgmo-source-inner {
|
package/dist/block.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeSvgForEmbed
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ODZVHU3R.js";
|
|
4
4
|
import {
|
|
5
5
|
encodeDiagramUrl,
|
|
6
6
|
render
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PZMETGLY.js";
|
|
8
8
|
import "./chunk-PBAHEPLQ.js";
|
|
9
9
|
import "./chunk-OJR3MQYV.js";
|
|
10
10
|
import "./chunk-UWN33VNX.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-A4GOY3PE.js";
|
|
|
17
17
|
import "./chunk-6KFWC4CO.js";
|
|
18
18
|
import "./chunk-QOOUC2J5.js";
|
|
19
19
|
import "./chunk-WCT3NYCV.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-HSH73DP6.js";
|
|
21
21
|
import "./chunk-P235SVAH.js";
|
|
22
22
|
import "./chunk-6HO5ZTXK.js";
|
|
23
23
|
import "./chunk-44CM72SQ.js";
|
|
@@ -52,7 +52,7 @@ import "./chunk-5QXL4NYS.js";
|
|
|
52
52
|
import "./chunk-GMR5MFHJ.js";
|
|
53
53
|
import "./chunk-ERLBPDGU.js";
|
|
54
54
|
import "./chunk-AELOBFW5.js";
|
|
55
|
-
import "./chunk-
|
|
55
|
+
import "./chunk-B65G5DNL.js";
|
|
56
56
|
import "./chunk-IYULMRBE.js";
|
|
57
57
|
import {
|
|
58
58
|
resolvePaletteOrFallback
|
|
@@ -583,15 +583,21 @@ var BLOCK_CSS = `
|
|
|
583
583
|
opacity: 1;
|
|
584
584
|
}
|
|
585
585
|
|
|
586
|
-
/* ===
|
|
586
|
+
/* === Frame the whole block ===
|
|
587
587
|
* When the source panel is open, diagram + toolbar + code get one shared
|
|
588
|
-
* border so the code visibly belongs to the chart above it
|
|
589
|
-
*
|
|
590
|
-
|
|
591
|
-
|
|
588
|
+
* border so the code visibly belongs to the chart above it. The frame box
|
|
589
|
+
* (border + padding) is RESERVED at all times \u2014 with the border transparent
|
|
590
|
+
* while closed \u2014 so opening the panel only paints the border in. It never
|
|
591
|
+
* reflows the diagram or shifts the toolbar: the SVG box and toolbar position
|
|
592
|
+
* are identical open vs closed. */
|
|
593
|
+
.dgmo:has(> .dgmo-source-wrap) {
|
|
594
|
+
border: 1px solid transparent;
|
|
592
595
|
border-radius: 0.6em;
|
|
593
596
|
padding: 0.75em 0.75em 0.5em;
|
|
594
597
|
}
|
|
598
|
+
.dgmo:has(> .dgmo-source-wrap[open]) {
|
|
599
|
+
border-color: rgba(127, 127, 127, 0.3);
|
|
600
|
+
}
|
|
595
601
|
|
|
596
602
|
/* === Source panel (hidden until toggled) === */
|
|
597
603
|
.dgmo-source-inner {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
extractExportSvg,
|
|
13
13
|
runInExportContainer
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JTSMEYIZ.js";
|
|
15
15
|
import {
|
|
16
16
|
EDGE_STROKE_WIDTH,
|
|
17
17
|
NODE_STROKE_WIDTH
|
|
@@ -399,7 +399,7 @@ function renderClassDiagramForExport(content, theme, palette) {
|
|
|
399
399
|
true
|
|
400
400
|
// exportMode
|
|
401
401
|
);
|
|
402
|
-
return extractExportSvg(container, theme);
|
|
402
|
+
return extractExportSvg(container, theme, palette);
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
|
|
@@ -407,4 +407,4 @@ export {
|
|
|
407
407
|
renderClassDiagram,
|
|
408
408
|
renderClassDiagramForExport
|
|
409
409
|
};
|
|
410
|
-
//# sourceMappingURL=chunk-
|
|
410
|
+
//# sourceMappingURL=chunk-7DTWEFUE.js.map
|
|
@@ -542,6 +542,13 @@ function parseC4(content, palette) {
|
|
|
542
542
|
}
|
|
543
543
|
namePart = namePart.substring(0, nameIsAMatch.index).trim();
|
|
544
544
|
}
|
|
545
|
+
const bareTail = metaTail.trim();
|
|
546
|
+
if (bareTail && !bareTail.includes(":")) {
|
|
547
|
+
pushError(
|
|
548
|
+
lineNumber,
|
|
549
|
+
`text after 'is a ${rawType}' must be 'key: value' metadata \u2014 '${bareTail}' is not recognized (did you mean 'description: ${bareTail}'?)`
|
|
550
|
+
);
|
|
551
|
+
}
|
|
545
552
|
const metadata = parseC4MetaTail(metaTail, metaAliasMap);
|
|
546
553
|
const shape = explicitShape ?? inferC4Shape(namePart, metadata["tech"] ?? metadata["technology"]);
|
|
547
554
|
let isADescription;
|
|
@@ -797,4 +804,4 @@ function validateDeploymentRefs(result, knownNames, pushWarning) {
|
|
|
797
804
|
export {
|
|
798
805
|
parseC4
|
|
799
806
|
};
|
|
800
|
-
//# sourceMappingURL=chunk-
|
|
807
|
+
//# sourceMappingURL=chunk-B65G5DNL.js.map
|
|
@@ -512,6 +512,8 @@ function renderFlowchartForExport(content, theme, palette) {
|
|
|
512
512
|
if (!svgEl) return "";
|
|
513
513
|
if (theme === "transparent") {
|
|
514
514
|
svgEl.style.background = "none";
|
|
515
|
+
} else if (!svgEl.style.background) {
|
|
516
|
+
svgEl.style.background = palette.bg;
|
|
515
517
|
}
|
|
516
518
|
svgEl.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
517
519
|
svgEl.style.fontFamily = FONT_FAMILY;
|
|
@@ -525,4 +527,4 @@ export {
|
|
|
525
527
|
renderFlowchart,
|
|
526
528
|
renderFlowchartForExport
|
|
527
529
|
};
|
|
528
|
-
//# sourceMappingURL=chunk-
|
|
530
|
+
//# sourceMappingURL=chunk-B7JUCQUA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
extractExportSvg,
|
|
3
3
|
runInExportContainer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JTSMEYIZ.js";
|
|
5
5
|
import {
|
|
6
6
|
renderCollapseBar,
|
|
7
7
|
renderNodeCard
|
|
@@ -476,7 +476,7 @@ function renderOrgForExport(content, theme, palette) {
|
|
|
476
476
|
width: exportWidth,
|
|
477
477
|
height: exportHeight
|
|
478
478
|
});
|
|
479
|
-
return extractExportSvg(container, theme);
|
|
479
|
+
return extractExportSvg(container, theme, palette);
|
|
480
480
|
});
|
|
481
481
|
}
|
|
482
482
|
|
|
@@ -484,4 +484,4 @@ export {
|
|
|
484
484
|
renderOrg,
|
|
485
485
|
renderOrgForExport
|
|
486
486
|
};
|
|
487
|
-
//# sourceMappingURL=chunk-
|
|
487
|
+
//# sourceMappingURL=chunk-FANX6UJR.js.map
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
} from "./chunk-AELOBFW5.js";
|
|
84
84
|
import {
|
|
85
85
|
parseC4
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-B65G5DNL.js";
|
|
87
87
|
import {
|
|
88
88
|
looksLikeSequence,
|
|
89
89
|
parseSequenceDgmo
|
|
@@ -2062,4 +2062,4 @@ export {
|
|
|
2062
2062
|
knownChartTypeIds,
|
|
2063
2063
|
parseDgmo
|
|
2064
2064
|
};
|
|
2065
|
-
//# sourceMappingURL=chunk-
|
|
2065
|
+
//# sourceMappingURL=chunk-HSH73DP6.js.map
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./chunk-WCT3NYCV.js";
|
|
35
35
|
import {
|
|
36
36
|
parseC4
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-B65G5DNL.js";
|
|
38
38
|
import {
|
|
39
39
|
preprocessDescriptionLine
|
|
40
40
|
} from "./chunk-IYULMRBE.js";
|
|
@@ -1035,4 +1035,4 @@ export {
|
|
|
1035
1035
|
renderC4Deployment,
|
|
1036
1036
|
renderC4DeploymentForExport
|
|
1037
1037
|
};
|
|
1038
|
-
//# sourceMappingURL=chunk-
|
|
1038
|
+
//# sourceMappingURL=chunk-ILKORZ3H.js.map
|
|
@@ -16,10 +16,14 @@ function runInExportContainer(width, height, fn) {
|
|
|
16
16
|
document.body.removeChild(container);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function extractExportSvg(container, theme) {
|
|
19
|
+
function extractExportSvg(container, theme, palette) {
|
|
20
20
|
const svgEl = container.querySelector("svg");
|
|
21
21
|
if (!svgEl) return "";
|
|
22
|
-
if (theme === "transparent")
|
|
22
|
+
if (theme === "transparent") {
|
|
23
|
+
svgEl.style.background = "none";
|
|
24
|
+
} else if (palette && !svgEl.style.background) {
|
|
25
|
+
svgEl.style.background = palette.bg;
|
|
26
|
+
}
|
|
23
27
|
svgEl.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
24
28
|
svgEl.style.fontFamily = FONT_FAMILY;
|
|
25
29
|
svgEl.querySelectorAll("[data-export-ignore]").forEach((el) => el.remove());
|
|
@@ -30,4 +34,4 @@ export {
|
|
|
30
34
|
runInExportContainer,
|
|
31
35
|
extractExportSvg
|
|
32
36
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-JTSMEYIZ.js.map
|
|
@@ -27,7 +27,6 @@ function normalizeSvgForEmbed(input) {
|
|
|
27
27
|
}
|
|
28
28
|
svg = svg.replace(/(<svg[^>]*?) width="[^"]*"/g, "$1");
|
|
29
29
|
svg = svg.replace(/(<svg[^>]*?) height="[^"]*"/g, "$1");
|
|
30
|
-
svg = svg.replace(/(<svg[^>]*?style="[^"]*?)background:[^;"]*;?\s*/g, "$1");
|
|
31
30
|
svg = svg.replace(/<svg\s{2,}/g, "<svg ");
|
|
32
31
|
return svg;
|
|
33
32
|
}
|
|
@@ -151,4 +150,4 @@ export {
|
|
|
151
150
|
normalizeSvgForEmbed,
|
|
152
151
|
getEmbedSvgViewBox
|
|
153
152
|
};
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
153
|
+
//# sourceMappingURL=chunk-ODZVHU3R.js.map
|