hr-design-system-handlebars 1.114.131 → 1.114.132
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 +13 -0
- package/dist/assets/index.css +3 -3
- package/dist/assets/js/components/social_sharing/socialSharingHandler.alpine.js +71 -21
- package/dist/views/components/social_sharing/social_sharing_horizontal.hbs +1 -1
- package/dist/views/components/social_sharing/social_sharing_mobile.hbs +1 -0
- package/dist/views/components/social_sharing/social_sharing_ticker_item.hbs +2 -1
- package/dist/views_static/components/social_sharing/social_sharing_horizontal.hbs +1 -1
- package/dist/views_static/components/social_sharing/social_sharing_mobile.hbs +1 -0
- package/dist/views_static/components/social_sharing/social_sharing_ticker_item.hbs +2 -1
- package/package.json +1 -1
- package/src/stories/views/components/social_sharing/socialSharingHandler.alpine.js +71 -21
- package/src/stories/views/components/social_sharing/social_sharing_horizontal.hbs +1 -1
- package/src/stories/views/components/social_sharing/social_sharing_mobile.hbs +1 -0
- package/src/stories/views/components/social_sharing/social_sharing_ticker_item.hbs +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# v1.114.132 (Mon Mar 24 2025)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- 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))
|
|
6
|
+
|
|
7
|
+
#### Authors: 2
|
|
8
|
+
|
|
9
|
+
- [@eduardo-hr](https://github.com/eduardo-hr)
|
|
10
|
+
- Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
1
14
|
# v1.114.131 (Thu Mar 20 2025)
|
|
2
15
|
|
|
3
16
|
#### 🐛 Bug Fix
|
package/dist/assets/index.css
CHANGED
|
@@ -3857,7 +3857,7 @@ article #commentList {
|
|
|
3857
3857
|
border-bottom-color: var(--color-secondary-ds);
|
|
3858
3858
|
}
|
|
3859
3859
|
.counter-reset {
|
|
3860
|
-
counter-reset:
|
|
3860
|
+
counter-reset: cnt1742821545333;
|
|
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:
|
|
4305
|
+
counter-increment: cnt1742821545333 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(
|
|
4323
|
+
content: counter(cnt1742821545333);
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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" }}"
|
|
@@ -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.
|
|
9
|
+
"version": "1.114.132",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "storybook dev -p 6006 public",
|
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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" }}"
|