swedbank-pay-design-guide-jekyll-theme 2.8.4 → 2.8.5
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.
- checksums.yaml +4 -4
- data/_includes/mermaid-dialog.html +2 -2
- data/assets/css/mermaid-dialog.css +16 -0
- data/assets/js/mermaid-dialog.js +27 -2
- data/lib/gem_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8aeaac8f9ac455049012d447a3e151e8b805446f973a3275b3aa506fe7d925e4
|
|
4
|
+
data.tar.gz: c6da741c35ba075bcd72d270e5a212894cac67b56c0d688225802ec7f90b1167
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3541031291914093d86240aaa7d924a115bb651520df26307ecb1d15f3b48b8f73ad455d5e30ce92000e4db9fd6ac4f0b569255e933fc33d55437bbbf590780f
|
|
7
|
+
data.tar.gz: 4e8ee4a5a3c0183a07cadc1e10e8fb6588d0446ed49aa5ce54c01bc7c636d1668ed7f013733ba79431f9b448cd6a7229ddb3a442ea734c49e77eef0c4a6309d2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<dialog id="mermaid-dialog">
|
|
2
|
-
<header>
|
|
3
|
-
<div role="heading"
|
|
2
|
+
<header id="mermaid-dialog-header">
|
|
3
|
+
<div id="mermaid-dialog-title" role="heading"></div>
|
|
4
4
|
<button type="button" class="dialog-close" aria-label="Close dialog" data-dialog-close="true"></button>
|
|
5
5
|
</header>
|
|
6
6
|
<div class="dialog-body">
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
#mermaid-dialog .dialog-body {
|
|
7
7
|
user-select: text;
|
|
8
8
|
cursor: text;
|
|
9
|
+
padding-bottom: 64px;
|
|
9
10
|
}
|
|
11
|
+
|
|
10
12
|
#mermaidDialogDiagram svg {
|
|
11
13
|
user-select: text;
|
|
12
14
|
pointer-events: auto;
|
|
@@ -15,3 +17,17 @@
|
|
|
15
17
|
#mermaidDialogDiagram text {
|
|
16
18
|
user-select: text;
|
|
17
19
|
}
|
|
20
|
+
|
|
21
|
+
/* Hide the mermaid title text from the diagram since it's shown in the dialog header */
|
|
22
|
+
#mermaidDialogDiagram text[y^="-"] {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Style the mermaid title text in the inline diagram*/
|
|
27
|
+
svg[id^="mermaid-"] text[y^="-"] {
|
|
28
|
+
font-family: "Swedbank Headline", "Arial", sans-serif;
|
|
29
|
+
font-size: 1.2rem;
|
|
30
|
+
font-weight: bold;
|
|
31
|
+
fill: #333;
|
|
32
|
+
text-anchor: middle;
|
|
33
|
+
}
|
data/assets/js/mermaid-dialog.js
CHANGED
|
@@ -3,15 +3,40 @@ function attachMermaidDialogEvents() {
|
|
|
3
3
|
if (!svg.classList.contains('mermaid-dialog-ready')) {
|
|
4
4
|
svg.classList.add('mermaid-dialog-ready');
|
|
5
5
|
svg.style.cursor = 'zoom-in';
|
|
6
|
+
|
|
7
|
+
// Center the mermaid title text element in the inline diagram
|
|
8
|
+
var titleTextEl = Array.from(svg.querySelectorAll('text')).find(function(t) {
|
|
9
|
+
return parseFloat(t.getAttribute('y')) < 0;
|
|
10
|
+
});
|
|
11
|
+
if (titleTextEl) {
|
|
12
|
+
var vb = svg.viewBox && svg.viewBox.baseVal;
|
|
13
|
+
var midX = vb && vb.width ? (vb.x + vb.width / 2) : parseFloat(svg.getAttribute('width') || 0) / 2;
|
|
14
|
+
titleTextEl.setAttribute('x', midX);
|
|
15
|
+
}
|
|
16
|
+
|
|
6
17
|
svg.addEventListener('click', function() {
|
|
7
18
|
var dialogDiagram = document.getElementById('mermaidDialogDiagram');
|
|
8
19
|
dialogDiagram.innerHTML = svg.outerHTML;
|
|
9
|
-
|
|
20
|
+
|
|
21
|
+
var dialogTitle = document.getElementById('mermaid-dialog-title');
|
|
22
|
+
|
|
23
|
+
// Check for mermaid title: rendered as <text> with negative y above the diagram
|
|
24
|
+
var titleTextEl = Array.from(svg.querySelectorAll('text')).find(function(t) {
|
|
25
|
+
return parseFloat(t.getAttribute('y')) < 0;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
var diagramTitle = (titleTextEl && titleTextEl.textContent.trim())
|
|
29
|
+
? titleTextEl.textContent.trim()
|
|
30
|
+
: null;
|
|
31
|
+
|
|
32
|
+
dialogTitle.textContent = (diagramTitle) ? diagramTitle : 'Sequence diagram';
|
|
33
|
+
|
|
34
|
+
// Open dialog directly
|
|
10
35
|
var dialog = document.getElementById('mermaid-dialog');
|
|
11
36
|
if (dialog && typeof dialog.showModal === 'function') {
|
|
12
37
|
dialog.showModal();
|
|
13
38
|
} else {
|
|
14
|
-
// Fallback:
|
|
39
|
+
// Fallback: toggle 'open' attribute if design-guide handles it
|
|
15
40
|
dialog.setAttribute('open', '');
|
|
16
41
|
}
|
|
17
42
|
});
|
data/lib/gem_version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: swedbank-pay-design-guide-jekyll-theme
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.
|
|
4
|
+
version: 2.8.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Swedbank Pay
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-05-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|