- commit
- 6b3e30fec08f0ab2074e5d3991b0821e080c7a2a
- parent
- 8b5cae6c1b3c3e8897211af0543edbabaae3d0b7
- author
- Dami <dami.etoile@gmail.com>
| M | apps/ | 4 | ++-- |
| M | shared/ | 6 | +++++- |
@@ -309,8 +309,8 @@ test('normalizes CSS-driven Mermaid and BPMN neutral structures', () => {
309309 assert.match(mermaid, /id="diagramzip-sequence-arrowhead"[^>]*>.*data-dz-fill="line"[^>]*data-dz-stroke="line"/)310310 assert.match(mermaid, /class="flowchart-link"[^>]*data-dz-stroke="line"/)311311 assert.match(mermaid, /class="basic label-container"[^>]*data-dz-fill="surface-1"[^>]*data-dz-stroke="line"/)312- assert.match(mermaid, /class="cluster"[^>]*>[\s\S]*?<rect style=""[^>]*data-dz-fill="surface-2"/)313- assert.match(mermaid, /class="edgeLabel"[^>]*>[\s\S]*?class="background"[^>]*data-dz-fill="surface-2"/)312+ assert.match(mermaid, /class="cluster"[^>]*>[\s\S]*?<rect style=""[^>]*data-dz-fill="surface-2"[^>]*data-dz-stroke="line-muted"/)313+ assert.match(mermaid, /class="edgeLabel"[^>]*>[\s\S]*?class="background"[^>]*data-dz-fill="surface-1"/)314314 assert.doesNotMatch(mermaid.match(/class="cluster-label"[\s\S]*?<rect[^>]*>/)?.[0] ?? '', /data-dz-fill/)315315 const authoredCluster = canonicalizeSvg(316316 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><g class="cluster"><rect fill="#ffffde" x="1" y="1" width="18" height="18"></rect></g></svg>',@@ -671,7 +671,11 @@ function applyNeutralRendererDetails(root, engine) {
671671 }672672 if (name === 'rect' && (nextContext === 'cluster' || (nextContext === 'edge-label' && classes.has('background')))673673 && neutralPaint(node, 'fill', new Set(['', 'none', 'white', '#fff', '#ffffff']))) {674- node.attributes.set('data-dz-fill', 'surface-2')674+ node.attributes.set('data-dz-fill', nextContext === 'cluster' ? 'surface-2' : 'surface-1')675+ if (nextContext === 'cluster'676+ && neutralPaint(node, 'stroke', new Set(['', 'none', 'gray', 'grey', '#aaa', '#aaaaaa', '#aaaa33']))) {677+ node.attributes.set('data-dz-stroke', 'line-muted')678+ }675679 }676680 }677681 if (engine === 'blockdiag' && SHAPE_ELEMENTS.has(name) && (fill === '#dbeafe' || fill === 'rgb(219,234,254)')) {