@zombie-mermaid/svg-renderer 4.2.2 → 4.2.3
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/index.ts +34 -1
- package/src/__tests__/c4-label-clearance-1290.test.ts +0 -112
- package/src/__tests__/c4-line-ends-1208.test.ts +0 -52
- package/src/__tests__/c4-mermaid-reference.test.ts +0 -124
- package/src/__tests__/c4-svg.test.ts +0 -337
- package/src/__tests__/c4-text-width-1210.test.ts +0 -43
- package/src/__tests__/class-component-order-1249.test.ts +0 -40
- package/src/__tests__/class-diamond-markers-1232.test.ts +0 -59
- package/src/__tests__/class-member-right-padding-1238.test.ts +0 -43
- package/src/__tests__/class-namespace-1196.test.ts +0 -165
- package/src/__tests__/class-namespace-sparse-elk-1196.test.ts +0 -96
- package/src/__tests__/class-visibility-markers-1237.test.ts +0 -27
- package/src/__tests__/edge-jog-straightening-1388.test.ts +0 -57
- package/src/__tests__/elk-adapter-utils.test.ts +0 -166
- package/src/__tests__/er-attribute-right-padding-1262.test.ts +0 -47
- package/src/__tests__/er-cardinality-markers-1233.test.ts +0 -35
- package/src/__tests__/er-default-direction-1250.test.ts +0 -69
- package/src/__tests__/er-edge-label-contrast-1244.test.ts +0 -58
- package/src/__tests__/fixtures/c4-mermaid-reference.json +0 -626
- package/src/__tests__/flowchart-parallel-edge-lanes-1308.test.ts +0 -168
- package/src/__tests__/pie-layout.test.ts +0 -215
- package/src/__tests__/pie-svg.test.ts +0 -194
- package/src/__tests__/render-mermaid-svg.test.ts +0 -64
- package/src/__tests__/sequence-label-clearance-1242.test.ts +0 -162
- package/src/__tests__/sequence-nested-activation-1241.test.ts +0 -37
- package/src/__tests__/svg-edge-to-own-cluster-1310.test.ts +0 -32
- package/src/__tests__/xychart-smooth-curve.test.ts +0 -42
- package/src/__tests__/xychart-x-label-overlap-1243.test.ts +0 -62
package/dist/index.js
CHANGED
|
@@ -4955,10 +4955,18 @@ function $o(e) {
|
|
|
4955
4955
|
};
|
|
4956
4956
|
}
|
|
4957
4957
|
function es(e, t = {}) {
|
|
4958
|
-
let n = ts(e, t);
|
|
4958
|
+
let n = ts(ns(e, t));
|
|
4959
4959
|
return t.resolveColors ? ti(n, Zo(t)) : n;
|
|
4960
4960
|
}
|
|
4961
|
-
function ts(e
|
|
4961
|
+
function ts(e) {
|
|
4962
|
+
let t = new Set(Array.from(e.matchAll(/\sid="([^"]+)"/g), (e) => e[1] ?? ""));
|
|
4963
|
+
if (t.size === 0) return e;
|
|
4964
|
+
let n = 2166136261;
|
|
4965
|
+
for (let t = 0; t < e.length; t++) n = Math.imul(n ^ e.charCodeAt(t), 16777619);
|
|
4966
|
+
let r = `zm${(n >>> 0).toString(36)}-`, i = (e) => t.has(e) && !e.startsWith("zm-") ? r + e : e;
|
|
4967
|
+
return e.replace(/(\sid=")([^"]+)"/g, (e, t, n) => `${t}${i(n)}"`).replace(/url\(#([^)]+)\)/g, (e, t) => `url(#${i(t)})`).replace(/(href=")#([^"]+)"/g, (e, t, n) => `${t}#${i(n)}"`);
|
|
4968
|
+
}
|
|
4969
|
+
function ns(e, t) {
|
|
4962
4970
|
let r = oe(e), i = Zo(t), a = t.font ?? "Inter";
|
|
4963
4971
|
v(c(a));
|
|
4964
4972
|
let o = t.transparent ?? !1, s = Te(t.fontSizes), l = n(r), u = t.embedSource ? e : void 0, d = t.title, f = t.decorative, p = $o(t), m = y(r), h = Xo[l], g = h.parse(m, r), _ = h.layoutForSvg(g, t), b = {
|
|
@@ -4973,11 +4981,11 @@ function ts(e, t) {
|
|
|
4973
4981
|
};
|
|
4974
4982
|
return h.renderSvg(_, b, t);
|
|
4975
4983
|
}
|
|
4976
|
-
async function
|
|
4984
|
+
async function rs(e, t = {}) {
|
|
4977
4985
|
return es(e, t);
|
|
4978
4986
|
}
|
|
4979
|
-
var
|
|
4987
|
+
var is = es, as = rs;
|
|
4980
4988
|
//#endregion
|
|
4981
|
-
export { Gi as ACTOR_LABEL_OFFSET, Oe as ARROW_HEAD, U as CLS, je as ELK_DIRECTION_FALLBACK, I as FONT_SIZES, L as FONT_WEIGHTS, Ee as GROUP_HEADER_CONTENT_PAD, Ie as INLINE_CENTERED_EDGE_LABEL, Ce as MONO_FONT, we as MONO_FONT_STACK, De as NODE_PADDING, X as PIE, R as STROKE_WIDTHS, z as TEXT_BASELINE_SHIFT, Pe as baseElkLayoutOptions, Wi as boxLabelHeight, Re as buildElkEdge, Le as buildElkEdgeLabel, Fe as buildElkLeafNode, ke as buildSvgStyleBlock, ni as classNoteId, ot as clipEdgeToShape, Pn as convertToElkFormat, ge as createLayoutCache, Me as directionToElk, ye as elkLayoutSync, Ne as elkPadding, Se as estimateMonoTextWidth, F as estimateTextWidth, Yr as evaluateCssColorValue, St as extractEdgeLabelPosition, xt as extractEdgePoints, ka as formatTickLabels, ci as layoutClassDiagramSync, ji as layoutErDiagramSync, Nn as layoutFlowchartSync, jn as layoutGraphSync, Wa as layoutPieChart, Yi as layoutSequenceDiagram, va as layoutXYChart, Oa as niceTickValues, Ga as pieColorValue, fe as pointsToPath, fi as renderClassSvg, Pi as renderErSvg,
|
|
4989
|
+
export { Gi as ACTOR_LABEL_OFFSET, Oe as ARROW_HEAD, U as CLS, je as ELK_DIRECTION_FALLBACK, I as FONT_SIZES, L as FONT_WEIGHTS, Ee as GROUP_HEADER_CONTENT_PAD, Ie as INLINE_CENTERED_EDGE_LABEL, Ce as MONO_FONT, we as MONO_FONT_STACK, De as NODE_PADDING, X as PIE, R as STROKE_WIDTHS, z as TEXT_BASELINE_SHIFT, Pe as baseElkLayoutOptions, Wi as boxLabelHeight, Re as buildElkEdge, Le as buildElkEdgeLabel, Fe as buildElkLeafNode, ke as buildSvgStyleBlock, ni as classNoteId, ot as clipEdgeToShape, Pn as convertToElkFormat, ge as createLayoutCache, Me as directionToElk, ye as elkLayoutSync, Ne as elkPadding, Se as estimateMonoTextWidth, F as estimateTextWidth, Yr as evaluateCssColorValue, St as extractEdgeLabelPosition, xt as extractEdgePoints, ka as formatTickLabels, ci as layoutClassDiagramSync, ji as layoutErDiagramSync, Nn as layoutFlowchartSync, jn as layoutGraphSync, Wa as layoutPieChart, Yi as layoutSequenceDiagram, va as layoutXYChart, Oa as niceTickValues, Ga as pieColorValue, fe as pointsToPath, fi as renderClassSvg, Pi as renderErSvg, as as renderMermaid, es as renderMermaidSVG, rs as renderMermaidSVGAsync, is as renderMermaidSync, qa as renderPieSvg, Xi as renderSequenceSvg, Wn as renderSvg, Ma as renderXYChartSvg, ti as resolveCssColors, Te as resolveFontSizes, Ia as smoothCurvePath, Qo as themeCssVariables, Br as withDataSrc, wa as xLabelStep };
|
|
4982
4990
|
|
|
4983
4991
|
//# sourceMappingURL=index.js.map
|