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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ee894b96aae3e6f74209e87d256d0ad35d4954a3b24c1825a8e2344ce15f535
4
- data.tar.gz: d976f8ca09c2244e8f2f761aa028f64b7fa271562ed9cecc81d3eac105517ac4
3
+ metadata.gz: 8aeaac8f9ac455049012d447a3e151e8b805446f973a3275b3aa506fe7d925e4
4
+ data.tar.gz: c6da741c35ba075bcd72d270e5a212894cac67b56c0d688225802ec7f90b1167
5
5
  SHA512:
6
- metadata.gz: b5a1ab135836725121376dcdb286e153cb0f695d4849ff6fcabfd09daaec7883dcb641e792721a91b63123ff48172e2580d7cee08744c1eebec34cb7928e18fb
7
- data.tar.gz: 70ef9fc00016b8e197b80ca54cef7427b62a12fc04009da4245e7515b09f7543f31b3d9dc4da3e65e9ea01d50e59f8026641967b17e4fa65b5c7b946a01a1c69
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">Mermaid-diagram</div>
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
+ }
@@ -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
- // Öppna dialogen direkt
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: toggla 'open' attribut om design-guide hanterar det
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
@@ -4,7 +4,7 @@ module Gem
4
4
  # Gem Specification
5
5
  class Specification
6
6
  def self.gem_version
7
- '2.8.4'
7
+ '2.8.5'
8
8
  end
9
9
  end
10
10
  end
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
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-02-25 00:00:00.000000000 Z
11
+ date: 2026-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday