hr-design-system-handlebars 1.114.131 → 1.114.133

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.
Files changed (20) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/assets/index.css +3 -3
  3. package/dist/assets/js/components/social_sharing/socialSharingHandler.alpine.js +71 -21
  4. package/dist/views/components/page/components/publicationdate.hbs +1 -1
  5. package/dist/views/components/page/ticker/components/header.hbs +1 -1
  6. package/dist/views/components/social_sharing/social_sharing_horizontal.hbs +1 -1
  7. package/dist/views/components/social_sharing/social_sharing_mobile.hbs +1 -0
  8. package/dist/views/components/social_sharing/social_sharing_ticker_item.hbs +2 -1
  9. package/dist/views_static/components/page/components/publicationdate.hbs +1 -1
  10. package/dist/views_static/components/page/ticker/components/header.hbs +1 -1
  11. package/dist/views_static/components/social_sharing/social_sharing_horizontal.hbs +1 -1
  12. package/dist/views_static/components/social_sharing/social_sharing_mobile.hbs +1 -0
  13. package/dist/views_static/components/social_sharing/social_sharing_ticker_item.hbs +2 -1
  14. package/package.json +1 -1
  15. package/src/stories/views/components/page/components/publicationdate.hbs +1 -1
  16. package/src/stories/views/components/page/ticker/components/header.hbs +1 -1
  17. package/src/stories/views/components/social_sharing/socialSharingHandler.alpine.js +71 -21
  18. package/src/stories/views/components/social_sharing/social_sharing_horizontal.hbs +1 -1
  19. package/src/stories/views/components/social_sharing/social_sharing_mobile.hbs +1 -0
  20. package/src/stories/views/components/social_sharing/social_sharing_ticker_item.hbs +2 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # v1.114.133 (Fri Mar 28 2025)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Add js-hook class for timestamp and ticker headline class [#1274](https://github.com/mumprod/hr-design-system-handlebars/pull/1274) ([@vascoeduardo](https://github.com/vascoeduardo) [@eduardo-hr](https://github.com/eduardo-hr))
6
+
7
+ #### Authors: 2
8
+
9
+ - [@eduardo-hr](https://github.com/eduardo-hr)
10
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
11
+
12
+ ---
13
+
14
+ # v1.114.132 (Mon Mar 24 2025)
15
+
16
+ #### 🐛 Bug Fix
17
+
18
+ - Enhance social sharing functionality with browser detection and impro… [#1273](https://github.com/mumprod/hr-design-system-handlebars/pull/1273) ([@vascoeduardo](https://github.com/vascoeduardo) [@eduardo-hr](https://github.com/eduardo-hr))
19
+
20
+ #### Authors: 2
21
+
22
+ - [@eduardo-hr](https://github.com/eduardo-hr)
23
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
24
+
25
+ ---
26
+
1
27
  # v1.114.131 (Thu Mar 20 2025)
2
28
 
3
29
  #### 🐛 Bug Fix
@@ -3857,7 +3857,7 @@ article #commentList {
3857
3857
  border-bottom-color: var(--color-secondary-ds);
3858
3858
  }
3859
3859
  .counter-reset {
3860
- counter-reset: cnt1742479634253;
3860
+ counter-reset: cnt1743161686138;
3861
3861
  }
3862
3862
  .animate-delay-100 {
3863
3863
  --tw-animate-delay: 100ms;
@@ -4302,7 +4302,7 @@ html { scroll-behavior: smooth; }
4302
4302
  --tw-ring-color: rgba(255, 255, 255, 0.5);
4303
4303
  }
4304
4304
  .-ordered {
4305
- counter-increment: cnt1742479634253 1;
4305
+ counter-increment: cnt1743161686138 1;
4306
4306
  }
4307
4307
  .-ordered::before {
4308
4308
  position: absolute;
@@ -4320,7 +4320,7 @@ html { scroll-behavior: smooth; }
4320
4320
  --tw-text-opacity: 1;
4321
4321
  color: rgba(0, 0, 0, 1);
4322
4322
  color: rgba(0, 0, 0, var(--tw-text-opacity));
4323
- content: counter(cnt1742479634253);
4323
+ content: counter(cnt1743161686138);
4324
4324
  }
4325
4325
  /*! ****************************/
4326
4326
  /*! DataPolicy stuff */
@@ -1,4 +1,5 @@
1
1
  import { uxAction } from 'base/tracking/pianoHelper.subfeature'
2
+ import { fireEvent, getJSONCookie } from 'hrQuery'
2
3
 
3
4
  export default (module) => ({
4
5
  open: false,
@@ -7,31 +8,80 @@ export default (module) => ({
7
8
  sharingModuleWasNeverShown: true,
8
9
  desktopSharingModuleWasNeverShown: true,
9
10
  copySuccess: false,
10
- toggle() {
11
-
12
- var isMobileApple = /^iP/.test(navigator.platform) || /^Mac/.test(navigator.platform) && navigator.maxTouchPoints > 4;
13
- var isMobileOther= navigator.userAgent.match(/(Android)|(webOS)|(Blackberry)|(Windows Phone)/i);
14
- var isMobile= isMobileApple || isMobileOther;
15
-
16
- if (navigator.share && isMobile) {
17
- navigator.share({
18
- title: document.title,
19
- url: window.location.href,
11
+ cookie: {},
12
+ isMobileApple: false,
13
+ isMobileOther: false,
14
+ isMobile: false,
15
+ isWebview: false,
16
+ initBrowserDetection(){
17
+ console.log('Pre initBrowserDetection', this.isMobileApple,this.isMobileOther,this.isMobile,this.isWebview);
18
+ this.isMobileApple = /iP/.test(navigator.userAgent) || /Mac/.test(navigator.userAgent) && navigator.maxTouchPoints > 4;
19
+ this.isMobileOther = /(Android|webOS|BlackBerry|Windows Phone)/i.test(navigator.userAgent);
20
+ this.isMobile = this.isMobileApple || this.isMobileOther;
21
+
22
+ try {
23
+ this.isWebview = window.parent.document.documentElement.classList.contains('webview');
24
+ } catch (e) {
25
+ this.isWebview = false;
26
+ console.warn("Could not access window.parent.document due to cross-origin restrictions", e);
27
+ }
28
+ console.log('initBrowserDetection', this.isMobileApple,this.isMobileOther,this.isMobile,this.isWebview);
29
+ },
30
+ readAppVersionCookie() {
31
+ this.cookie = getJSONCookie('appSettings') || {}
32
+ },
33
+ nativeShare(title, url, uxActionValue) {
34
+ console.log("Native Share", title, url, uxActionValue);
35
+ navigator
36
+ .share({
37
+ title,
38
+ url,
20
39
  })
21
- .then(() => {
22
- console.log('Shared successfully');
23
- uxAction('socialShareClick::'+module+'::nativeShare');
24
- console.log('tracked: socialShareClick::'+module+'::nativeShare');
40
+ .then(function () {
41
+ console.log('Native Shared successfully');
42
+ if (uxActionValue) {
43
+ uxAction(uxActionValue);
44
+ }
45
+ console.log('tracked: '+ uxActionValue);
25
46
  })
26
47
  .catch((error) => console.error('Sharing failed:', error));
27
- } else {
28
- if (this.$store.sharingIsOpen[module]) {
29
- return this.close(true)
48
+ },
49
+ shareInWebview(title, url) {
50
+ this.readAppVersionCookie();
51
+ if(this.isMobileApple){
52
+ console.log('apple mobile browser')
53
+ this.nativeShare(title, url, 'socialShareClick::webview::nativeShareApple');
54
+ } else if (this.isMobileOther) {
55
+ console.log('non-apple mobile browser')
56
+ /*Check Build Version of App*/
57
+ if (this.cookie['fireCustomJsShareEvent'] === true) {
58
+ /*Custom Event für App unter Android*/
59
+ fireEvent('hr:global:shareCompactClickAndroidApp', {
60
+ title: title,
61
+ url: url,
62
+ })
63
+ uxAction('socialShareClick::webview::nativeShareAndroid::customEvent');
64
+ console.log('Custom-Event für Android')
65
+ } else {
66
+ this.nativeShare(title, url, 'socialShareClick::webview::nativeShareAndroid::noCustomEventCookie');
30
67
  }
31
- this.$refs.button.focus()
32
- this.$store.sharingIsOpen[module] = true
33
- uxAction('socialShareClick::'+module+'::sharingIconOpen');
34
- }
68
+ }
69
+ },
70
+ toggle(title, url) {
71
+ if (this.isWebview) {
72
+ this.shareInWebview(title,url)
73
+ } else {
74
+ if (navigator.share && this.isMobile) {
75
+ this.nativeShare(document.title, window.location.href,'socialShareClick::'+module+'::nativeShare')
76
+ } else {
77
+ if (this.$store.sharingIsOpen[module]) {
78
+ return this.close(true)
79
+ }
80
+ this.$refs.button.focus()
81
+ this.$store.sharingIsOpen[module] = true
82
+ uxAction('socialShareClick::'+module+'::sharingIconOpen');
83
+ }
84
+ }
35
85
  },
36
86
  close(trackClick) {
37
87
  if (!this.$store.sharingIsOpen[module]) return
@@ -1,4 +1,4 @@
1
- <div class="text-xs sm480:text-sm font-headingSerif text-gray-scorpion dark:text-text-dark">
1
+ <div class="text-xs sm480:text-sm font-headingSerif text-gray-scorpion dark:text-text-dark{{#if _isTicker }} js-timeStamp{{/if}}">
2
2
 
3
3
  {{#with this.documentModificationDate~}}
4
4
 
@@ -13,6 +13,6 @@
13
13
  {{#if ../../this.tickerTopic}}
14
14
  {{> components/label/label_byline _css="ml-2 mb-2 pt-1 h-6 inline-block" _text=../../../this.tickerTopic}}
15
15
  {{/if}}
16
- <span class="block text-3xl ui-test-story-title font-headingSerif sm480:text-4xl dark:text-text-dark">{{this.title}}</span>
16
+ <span class="block text-3xl ui-test-story-title font-headingSerif sm480:text-4xl dark:text-text-dark js-ticker-headline">{{this.title}}</span>
17
17
  </h2>
18
18
  </header>
@@ -1,7 +1,7 @@
1
1
  {{~#with this.socialSharing ~}}
2
2
  <div
3
3
  x-data="socialSharingHandler('metadatabox')"
4
- x-init="$watch('$store.sharingIsVisible', () => {$store.sharingIsOpen.metadatabox = false; $store.sharingIsOpen.mobilesticky = false})"
4
+ x-init="initBrowserDetection(); $watch('$store.sharingIsVisible', () => {$store.sharingIsOpen.metadatabox = false; $store.sharingIsOpen.mobilesticky = false})"
5
5
  class="flex self-center justify-end ml-3 print:hidden grow"
6
6
  x-intersect:leave="$store.sharingIsVisible=false"
7
7
  x-intersect:enter="$store.sharingIsVisible=true"
@@ -1,6 +1,7 @@
1
1
 
2
2
  {{~#with this.socialSharing ~}}
3
3
  <div x-data="socialSharingHandler('mobilesticky')"
4
+ x-init="initBrowserDetection();"
4
5
  class=" relative ml-5 z-100 h-9.5 w-9.5"
5
6
  :class="$store.footerIsVisible ? '-mt-6' : '-mt-12'"
6
7
  x-on:resize.window="$store.sharingIsOpen.mobilesticky = false"
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  x-data="socialSharingHandler('tickerItem{{nextRandom}}')"
4
4
  class="flex self-center justify-end ml-3 print:hidden grow"
5
+ x-init="initBrowserDetection();"
5
6
  x-on:resize.window="$store.sharingIsOpen.ticker = false"
6
7
  x-on:keydown.escape.prevent.stop="close()"
7
8
  @click.outside="close()"
@@ -13,7 +14,7 @@
13
14
  <button
14
15
  class="order-2 p-2 text-white border border-button bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group lg:hidden"
15
16
  x-ref="button"
16
- x-on:click="toggle()"
17
+ x-on:click="toggle('{{../this.escapedTitle}}','{{../this.socialSharingUrl}}')"
17
18
  :aria-expanded="open"
18
19
  :aria-controls="$id('dropdown-button')"
19
20
  aria-label="{{loca "share_linktitle" }}"
@@ -1,4 +1,4 @@
1
- <div class="text-xs sm480:text-sm font-headingSerif text-gray-scorpion dark:text-text-dark">
1
+ <div class="text-xs sm480:text-sm font-headingSerif text-gray-scorpion dark:text-text-dark{{#if _isTicker }} js-timeStamp{{/if}}">
2
2
 
3
3
  {{#with this.documentModificationDate~}}
4
4
 
@@ -13,6 +13,6 @@
13
13
  {{#if ../../this.tickerTopic}}
14
14
  {{> components/label/label_byline _css="ml-2 mb-2 pt-1 h-6 inline-block" _text=../../../this.tickerTopic}}
15
15
  {{/if}}
16
- <span class="block text-3xl ui-test-story-title font-headingSerif sm480:text-4xl dark:text-text-dark">{{this.title}}</span>
16
+ <span class="block text-3xl ui-test-story-title font-headingSerif sm480:text-4xl dark:text-text-dark js-ticker-headline">{{this.title}}</span>
17
17
  </h2>
18
18
  </header>
@@ -1,7 +1,7 @@
1
1
  {{~#with this.socialSharing ~}}
2
2
  <div
3
3
  x-data="socialSharingHandler('metadatabox')"
4
- x-init="$watch('$store.sharingIsVisible', () => {$store.sharingIsOpen.metadatabox = false; $store.sharingIsOpen.mobilesticky = false})"
4
+ x-init="initBrowserDetection(); $watch('$store.sharingIsVisible', () => {$store.sharingIsOpen.metadatabox = false; $store.sharingIsOpen.mobilesticky = false})"
5
5
  class="flex self-center justify-end ml-3 print:hidden grow"
6
6
  x-intersect:leave="$store.sharingIsVisible=false"
7
7
  x-intersect:enter="$store.sharingIsVisible=true"
@@ -1,6 +1,7 @@
1
1
 
2
2
  {{~#with this.socialSharing ~}}
3
3
  <div x-data="socialSharingHandler('mobilesticky')"
4
+ x-init="initBrowserDetection();"
4
5
  class=" relative ml-5 z-100 h-9.5 w-9.5"
5
6
  :class="$store.footerIsVisible ? '-mt-6' : '-mt-12'"
6
7
  x-on:resize.window="$store.sharingIsOpen.mobilesticky = false"
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  x-data="socialSharingHandler('tickerItem{{nextRandom}}')"
4
4
  class="flex self-center justify-end ml-3 print:hidden grow"
5
+ x-init="initBrowserDetection();"
5
6
  x-on:resize.window="$store.sharingIsOpen.ticker = false"
6
7
  x-on:keydown.escape.prevent.stop="close()"
7
8
  @click.outside="close()"
@@ -13,7 +14,7 @@
13
14
  <button
14
15
  class="order-2 p-2 text-white border border-button bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group lg:hidden"
15
16
  x-ref="button"
16
- x-on:click="toggle()"
17
+ x-on:click="toggle('{{../this.escapedTitle}}','{{../this.socialSharingUrl}}')"
17
18
  :aria-expanded="open"
18
19
  :aria-controls="$id('dropdown-button')"
19
20
  aria-label="{{loca "share_linktitle" }}"
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.114.131",
9
+ "version": "1.114.133",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "storybook dev -p 6006 public",
@@ -1,4 +1,4 @@
1
- <div class="text-xs sm480:text-sm font-headingSerif text-gray-scorpion dark:text-text-dark">
1
+ <div class="text-xs sm480:text-sm font-headingSerif text-gray-scorpion dark:text-text-dark{{#if _isTicker }} js-timeStamp{{/if}}">
2
2
 
3
3
  {{#with this.documentModificationDate~}}
4
4
 
@@ -13,6 +13,6 @@
13
13
  {{#if ../../this.tickerTopic}}
14
14
  {{> components/label/label_byline _css="ml-2 mb-2 pt-1 h-6 inline-block" _text=../../../this.tickerTopic}}
15
15
  {{/if}}
16
- <span class="block text-3xl ui-test-story-title font-headingSerif sm480:text-4xl dark:text-text-dark">{{this.title}}</span>
16
+ <span class="block text-3xl ui-test-story-title font-headingSerif sm480:text-4xl dark:text-text-dark js-ticker-headline">{{this.title}}</span>
17
17
  </h2>
18
18
  </header>
@@ -1,4 +1,5 @@
1
1
  import { uxAction } from 'base/tracking/pianoHelper.subfeature'
2
+ import { fireEvent, getJSONCookie } from 'hrQuery'
2
3
 
3
4
  export default (module) => ({
4
5
  open: false,
@@ -7,31 +8,80 @@ export default (module) => ({
7
8
  sharingModuleWasNeverShown: true,
8
9
  desktopSharingModuleWasNeverShown: true,
9
10
  copySuccess: false,
10
- toggle() {
11
-
12
- var isMobileApple = /^iP/.test(navigator.platform) || /^Mac/.test(navigator.platform) && navigator.maxTouchPoints > 4;
13
- var isMobileOther= navigator.userAgent.match(/(Android)|(webOS)|(Blackberry)|(Windows Phone)/i);
14
- var isMobile= isMobileApple || isMobileOther;
15
-
16
- if (navigator.share && isMobile) {
17
- navigator.share({
18
- title: document.title,
19
- url: window.location.href,
11
+ cookie: {},
12
+ isMobileApple: false,
13
+ isMobileOther: false,
14
+ isMobile: false,
15
+ isWebview: false,
16
+ initBrowserDetection(){
17
+ console.log('Pre initBrowserDetection', this.isMobileApple,this.isMobileOther,this.isMobile,this.isWebview);
18
+ this.isMobileApple = /iP/.test(navigator.userAgent) || /Mac/.test(navigator.userAgent) && navigator.maxTouchPoints > 4;
19
+ this.isMobileOther = /(Android|webOS|BlackBerry|Windows Phone)/i.test(navigator.userAgent);
20
+ this.isMobile = this.isMobileApple || this.isMobileOther;
21
+
22
+ try {
23
+ this.isWebview = window.parent.document.documentElement.classList.contains('webview');
24
+ } catch (e) {
25
+ this.isWebview = false;
26
+ console.warn("Could not access window.parent.document due to cross-origin restrictions", e);
27
+ }
28
+ console.log('initBrowserDetection', this.isMobileApple,this.isMobileOther,this.isMobile,this.isWebview);
29
+ },
30
+ readAppVersionCookie() {
31
+ this.cookie = getJSONCookie('appSettings') || {}
32
+ },
33
+ nativeShare(title, url, uxActionValue) {
34
+ console.log("Native Share", title, url, uxActionValue);
35
+ navigator
36
+ .share({
37
+ title,
38
+ url,
20
39
  })
21
- .then(() => {
22
- console.log('Shared successfully');
23
- uxAction('socialShareClick::'+module+'::nativeShare');
24
- console.log('tracked: socialShareClick::'+module+'::nativeShare');
40
+ .then(function () {
41
+ console.log('Native Shared successfully');
42
+ if (uxActionValue) {
43
+ uxAction(uxActionValue);
44
+ }
45
+ console.log('tracked: '+ uxActionValue);
25
46
  })
26
47
  .catch((error) => console.error('Sharing failed:', error));
27
- } else {
28
- if (this.$store.sharingIsOpen[module]) {
29
- return this.close(true)
48
+ },
49
+ shareInWebview(title, url) {
50
+ this.readAppVersionCookie();
51
+ if(this.isMobileApple){
52
+ console.log('apple mobile browser')
53
+ this.nativeShare(title, url, 'socialShareClick::webview::nativeShareApple');
54
+ } else if (this.isMobileOther) {
55
+ console.log('non-apple mobile browser')
56
+ /*Check Build Version of App*/
57
+ if (this.cookie['fireCustomJsShareEvent'] === true) {
58
+ /*Custom Event für App unter Android*/
59
+ fireEvent('hr:global:shareCompactClickAndroidApp', {
60
+ title: title,
61
+ url: url,
62
+ })
63
+ uxAction('socialShareClick::webview::nativeShareAndroid::customEvent');
64
+ console.log('Custom-Event für Android')
65
+ } else {
66
+ this.nativeShare(title, url, 'socialShareClick::webview::nativeShareAndroid::noCustomEventCookie');
30
67
  }
31
- this.$refs.button.focus()
32
- this.$store.sharingIsOpen[module] = true
33
- uxAction('socialShareClick::'+module+'::sharingIconOpen');
34
- }
68
+ }
69
+ },
70
+ toggle(title, url) {
71
+ if (this.isWebview) {
72
+ this.shareInWebview(title,url)
73
+ } else {
74
+ if (navigator.share && this.isMobile) {
75
+ this.nativeShare(document.title, window.location.href,'socialShareClick::'+module+'::nativeShare')
76
+ } else {
77
+ if (this.$store.sharingIsOpen[module]) {
78
+ return this.close(true)
79
+ }
80
+ this.$refs.button.focus()
81
+ this.$store.sharingIsOpen[module] = true
82
+ uxAction('socialShareClick::'+module+'::sharingIconOpen');
83
+ }
84
+ }
35
85
  },
36
86
  close(trackClick) {
37
87
  if (!this.$store.sharingIsOpen[module]) return
@@ -1,7 +1,7 @@
1
1
  {{~#with this.socialSharing ~}}
2
2
  <div
3
3
  x-data="socialSharingHandler('metadatabox')"
4
- x-init="$watch('$store.sharingIsVisible', () => {$store.sharingIsOpen.metadatabox = false; $store.sharingIsOpen.mobilesticky = false})"
4
+ x-init="initBrowserDetection(); $watch('$store.sharingIsVisible', () => {$store.sharingIsOpen.metadatabox = false; $store.sharingIsOpen.mobilesticky = false})"
5
5
  class="flex self-center justify-end ml-3 print:hidden grow"
6
6
  x-intersect:leave="$store.sharingIsVisible=false"
7
7
  x-intersect:enter="$store.sharingIsVisible=true"
@@ -1,6 +1,7 @@
1
1
 
2
2
  {{~#with this.socialSharing ~}}
3
3
  <div x-data="socialSharingHandler('mobilesticky')"
4
+ x-init="initBrowserDetection();"
4
5
  class=" relative ml-5 z-100 h-9.5 w-9.5"
5
6
  :class="$store.footerIsVisible ? '-mt-6' : '-mt-12'"
6
7
  x-on:resize.window="$store.sharingIsOpen.mobilesticky = false"
@@ -2,6 +2,7 @@
2
2
  <div
3
3
  x-data="socialSharingHandler('tickerItem{{nextRandom}}')"
4
4
  class="flex self-center justify-end ml-3 print:hidden grow"
5
+ x-init="initBrowserDetection();"
5
6
  x-on:resize.window="$store.sharingIsOpen.ticker = false"
6
7
  x-on:keydown.escape.prevent.stop="close()"
7
8
  @click.outside="close()"
@@ -13,7 +14,7 @@
13
14
  <button
14
15
  class="order-2 p-2 text-white border border-button bg-button ds-button font-heading hover:bg-button--dark hover:border-button--dark active:bg-button--dark group lg:hidden"
15
16
  x-ref="button"
16
- x-on:click="toggle()"
17
+ x-on:click="toggle('{{../this.escapedTitle}}','{{../this.socialSharingUrl}}')"
17
18
  :aria-expanded="open"
18
19
  :aria-controls="$id('dropdown-button')"
19
20
  aria-label="{{loca "share_linktitle" }}"