hr-design-system-handlebars 1.98.3 → 1.99.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # v1.99.1 (Fri Sep 06 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Checking contenRefresher, when element detroyed [#1061](https://github.com/mumprod/hr-design-system-handlebars/pull/1061) ([@Paul-Atreidis](https://github.com/Paul-Atreidis))
6
+
7
+ #### Authors: 1
8
+
9
+ - [@Paul-Atreidis](https://github.com/Paul-Atreidis)
10
+
11
+ ---
12
+
13
+ # v1.99.0 (Wed Sep 04 2024)
14
+
15
+ #### 🚀 Enhancement
16
+
17
+ - :sparkles: add tracking for external links [#1060](https://github.com/mumprod/hr-design-system-handlebars/pull/1060) ([@mariokinzel](https://github.com/mariokinzel))
18
+
19
+ #### Authors: 1
20
+
21
+ - [@mariokinzel](https://github.com/mariokinzel)
22
+
23
+ ---
24
+
1
25
  # v1.98.3 (Wed Sep 04 2024)
2
26
 
3
27
  #### 🐛 Bug Fix
@@ -3338,7 +3338,7 @@ article.indexTextDS .indexTextHighlighted .link {
3338
3338
  border-bottom-color: var(--color-secondary-ds);
3339
3339
  }
3340
3340
  .counter-reset {
3341
- counter-reset: cnt1725446611170;
3341
+ counter-reset: cnt1725619009892;
3342
3342
  }
3343
3343
  .hyphens-auto {
3344
3344
  -webkit-hyphens: auto;
@@ -3746,7 +3746,7 @@ article.indexTextDS .indexTextHighlighted .link {
3746
3746
  --tw-ring-color: rgba(255, 255, 255, 0.5);
3747
3747
  }
3748
3748
  .-ordered {
3749
- counter-increment: cnt1725446611170 1;
3749
+ counter-increment: cnt1725619009892 1;
3750
3750
  }
3751
3751
  .-ordered::before {
3752
3752
  position: absolute;
@@ -3762,7 +3762,7 @@ article.indexTextDS .indexTextHighlighted .link {
3762
3762
  letter-spacing: .0125em;
3763
3763
  --tw-text-opacity: 1;
3764
3764
  color: rgba(0, 0, 0, var(--tw-text-opacity));
3765
- content: counter(cnt1725446611170);
3765
+ content: counter(cnt1725619009892);
3766
3766
  }
3767
3767
  /*! ****************************/
3768
3768
  /*! DataPolicy stuff */
@@ -1,5 +1,5 @@
1
1
 
2
- const DataWrapperContentRefresher = function (context, id, refreshIntervall, webcomponent) {
2
+ const DataWrapperContentRefresher = function (context, id, refreshIntervall, webcomponent, datapolicy) {
3
3
  const { element: rootElement } = context
4
4
  let remainingTime
5
5
  let timer
@@ -48,9 +48,16 @@ const DataWrapperContentRefresher = function (context, id, refreshIntervall, web
48
48
  divCounter.style.borderRadius = '0 0 4px 4px'
49
49
 
50
50
  rootElement.style.position = 'relative'
51
+ if(!datapolicy) {
51
52
  rootElement.appendChild(divCounter)
52
53
  rootElement.appendChild(divOverlay)
53
54
  startCountdown()
55
+ }
56
+ else {
57
+ rootElement.removeChild(divCounter)
58
+ rootElement.removeChild(divOverlay)
59
+ stopCountdown()
60
+ }
54
61
  }
55
62
 
56
63
  const refreshIframe = function () {
@@ -81,21 +88,29 @@ const DataWrapperContentRefresher = function (context, id, refreshIntervall, web
81
88
  checkTimer()
82
89
  }, 1000)
83
90
  }
91
+ const stopCountdown = function () {
92
+ clearInterval(timer)
93
+ }
84
94
  const checkTimer = function () {
85
- if (remainingTime >= 0) {
86
- document.getElementById('counter' + uniqueID).innerHTML =
87
- 'Dieser Inhalt wird automatisch aktualisiert in ' +
88
- secondsToTimeString(remainingTime) +
89
- ' Min.'
90
- remainingTime -= 1
91
- if (remainingTime == -1) {
92
- document.getElementById('overlay' + uniqueID).style.display = 'flex'
95
+ if(document.getElementById('counter' + uniqueID) !== null) {
96
+ if (remainingTime >= 0) {
93
97
  document.getElementById('counter' + uniqueID).innerHTML =
94
- 'Zeitintervall wird neu gestartet...'
98
+ 'Dieser Inhalt wird automatisch aktualisiert in ' +
99
+ secondsToTimeString(remainingTime) +
100
+ ' Min.'
101
+ remainingTime -= 1
102
+ if (remainingTime == -1) {
103
+ document.getElementById('overlay' + uniqueID).style.display = 'flex'
104
+ document.getElementById('counter' + uniqueID).innerHTML =
105
+ 'Zeitintervall wird neu gestartet...'
106
+ }
107
+ } else {
108
+ refreshIframe()
109
+ startCountdown()
95
110
  }
96
- } else {
97
- refreshIframe()
98
- startCountdown()
111
+ }else{
112
+ console.log("Element wurde entfernt")
113
+ clearInterval(timer)
99
114
  }
100
115
  }
101
116
  const secondsToTimeString = function (seconds) {
@@ -10,7 +10,7 @@
10
10
  {{/if}}
11
11
  {{#if _link.isStaticUrl}}href="{{#if _link.site}}{{resourceUrl _link.url _site=_link.site}}{{else}}{{resourceUrl _link.url}}{{/if}}{{else}}href="{{_link.url}}{{/if}}{{#if this.hasComments}}#commentList{{/if}}"
12
12
  class="ds-link js-load{{#if _link.isUserConsentNeeded}} js-user-consent-needed{{/if}} {{#if _isSelected}} {{defaultIfEmpty _selectedCssClass "-current"}}{{/if}}{{#if _css}} {{_css}}{{/if}} {{#> css}}{{/css}}"
13
- {{#if _link.isTargetBlank}} target="_blank" rel="noopener{{#if _link.hasNoReferrerFlag}} noreferrer{{/if}}"{{/if}}
13
+ {{#if _link.isTargetBlank}}data-hr-click-tracking='{"settings": [{"type":"uxAction", "clickLabel": "Externer-Link::{{this.sophoraId}} geklickt"}]}' target="_blank" rel="noopener{{#if _link.hasNoReferrerFlag}} noreferrer{{/if}}"{{/if}}
14
14
  {{#if _isAriaHidden}} aria-hidden="true" tabindex="-1"{{/if}}
15
15
  {{#> htmlProperties}}{{/htmlProperties}}
16
16
  >{{~> @partial-block ~}}</a>
@@ -10,7 +10,7 @@
10
10
  {{/if}}
11
11
  {{#if _link.isStaticUrl}}href="{{#if _link.site}}{{resourceUrl _link.url _site=_link.site}}{{else}}{{resourceUrl _link.url}}{{/if}}{{else}}href="{{_link.url}}{{/if}}{{#if this.hasComments}}#commentList{{/if}}"
12
12
  class="ds-link js-load{{#if _link.isUserConsentNeeded}} js-user-consent-needed{{/if}} {{#if _isSelected}} {{defaultIfEmpty _selectedCssClass "-current"}}{{/if}}{{#if _css}} {{_css}}{{/if}} {{#> css}}{{/css}}"
13
- {{#if _link.isTargetBlank}} target="_blank" rel="noopener{{#if _link.hasNoReferrerFlag}} noreferrer{{/if}}"{{/if}}
13
+ {{#if _link.isTargetBlank}}data-hr-click-tracking='{"settings": [{"type":"uxAction", "clickLabel": "Externer-Link::{{this.sophoraId}} geklickt"}]}' target="_blank" rel="noopener{{#if _link.hasNoReferrerFlag}} noreferrer{{/if}}"{{/if}}
14
14
  {{#if _isAriaHidden}} aria-hidden="true" tabindex="-1"{{/if}}
15
15
  {{#> htmlProperties}}{{/htmlProperties}}
16
16
  >{{~> @partial-block ~}}</a>
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
8
8
  "repository": "https://github.com/szuelch/hr-design-system-handlebars",
9
- "version": "1.98.3",
9
+ "version": "1.99.1",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "storybook dev -p 6006 public",
@@ -10,7 +10,7 @@
10
10
  {{/if}}
11
11
  {{#if _link.isStaticUrl}}href="{{#if _link.site}}{{resourceUrl _link.url _site=_link.site}}{{else}}{{resourceUrl _link.url}}{{/if}}{{else}}href="{{_link.url}}{{/if}}{{#if this.hasComments}}#commentList{{/if}}"
12
12
  class="ds-link js-load{{#if _link.isUserConsentNeeded}} js-user-consent-needed{{/if}} {{#if _isSelected}} {{defaultIfEmpty _selectedCssClass "-current"}}{{/if}}{{#if _css}} {{_css}}{{/if}} {{#> css}}{{/css}}"
13
- {{#if _link.isTargetBlank}} target="_blank" rel="noopener{{#if _link.hasNoReferrerFlag}} noreferrer{{/if}}"{{/if}}
13
+ {{#if _link.isTargetBlank}}data-hr-click-tracking='{"settings": [{"type":"uxAction", "clickLabel": "Externer-Link::{{this.sophoraId}} geklickt"}]}' target="_blank" rel="noopener{{#if _link.hasNoReferrerFlag}} noreferrer{{/if}}"{{/if}}
14
14
  {{#if _isAriaHidden}} aria-hidden="true" tabindex="-1"{{/if}}
15
15
  {{#> htmlProperties}}{{/htmlProperties}}
16
16
  >{{~> @partial-block ~}}</a>
@@ -1,5 +1,5 @@
1
1
 
2
- const DataWrapperContentRefresher = function (context, id, refreshIntervall, webcomponent) {
2
+ const DataWrapperContentRefresher = function (context, id, refreshIntervall, webcomponent, datapolicy) {
3
3
  const { element: rootElement } = context
4
4
  let remainingTime
5
5
  let timer
@@ -48,9 +48,16 @@ const DataWrapperContentRefresher = function (context, id, refreshIntervall, web
48
48
  divCounter.style.borderRadius = '0 0 4px 4px'
49
49
 
50
50
  rootElement.style.position = 'relative'
51
+ if(!datapolicy) {
51
52
  rootElement.appendChild(divCounter)
52
53
  rootElement.appendChild(divOverlay)
53
54
  startCountdown()
55
+ }
56
+ else {
57
+ rootElement.removeChild(divCounter)
58
+ rootElement.removeChild(divOverlay)
59
+ stopCountdown()
60
+ }
54
61
  }
55
62
 
56
63
  const refreshIframe = function () {
@@ -81,21 +88,29 @@ const DataWrapperContentRefresher = function (context, id, refreshIntervall, web
81
88
  checkTimer()
82
89
  }, 1000)
83
90
  }
91
+ const stopCountdown = function () {
92
+ clearInterval(timer)
93
+ }
84
94
  const checkTimer = function () {
85
- if (remainingTime >= 0) {
86
- document.getElementById('counter' + uniqueID).innerHTML =
87
- 'Dieser Inhalt wird automatisch aktualisiert in ' +
88
- secondsToTimeString(remainingTime) +
89
- ' Min.'
90
- remainingTime -= 1
91
- if (remainingTime == -1) {
92
- document.getElementById('overlay' + uniqueID).style.display = 'flex'
95
+ if(document.getElementById('counter' + uniqueID) !== null) {
96
+ if (remainingTime >= 0) {
93
97
  document.getElementById('counter' + uniqueID).innerHTML =
94
- 'Zeitintervall wird neu gestartet...'
98
+ 'Dieser Inhalt wird automatisch aktualisiert in ' +
99
+ secondsToTimeString(remainingTime) +
100
+ ' Min.'
101
+ remainingTime -= 1
102
+ if (remainingTime == -1) {
103
+ document.getElementById('overlay' + uniqueID).style.display = 'flex'
104
+ document.getElementById('counter' + uniqueID).innerHTML =
105
+ 'Zeitintervall wird neu gestartet...'
106
+ }
107
+ } else {
108
+ refreshIframe()
109
+ startCountdown()
95
110
  }
96
- } else {
97
- refreshIframe()
98
- startCountdown()
111
+ }else{
112
+ console.log("Element wurde entfernt")
113
+ clearInterval(timer)
99
114
  }
100
115
  }
101
116
  const secondsToTimeString = function (seconds) {