hr-design-system-handlebars 1.124.8 → 1.124.10
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/.storybook/preview.js +1 -0
- package/CHANGELOG.md +24 -0
- package/dist/assets/index.css +23 -3
- package/dist/assets/js/alpine.js +2 -0
- package/dist/assets/js/components/appBanner/appBanner.alpine.js +50 -0
- package/dist/assets/js/components/appBanner/nativeAppBanner.alpine.js +44 -0
- package/dist/views/components/appBanner/appBanner.hbs +27 -0
- package/dist/views/components/appBanner/nativeAppBanner.hbs +27 -0
- package/dist/views_static/components/appBanner/appBanner.hbs +27 -0
- package/dist/views_static/components/appBanner/nativeAppBanner.hbs +27 -0
- package/package.json +1 -1
- package/src/assets/js/alpine.js +2 -0
- package/src/stories/views/components/appBanner/appBanner.alpine.js +50 -0
- package/src/stories/views/components/appBanner/appBanner.hbs +27 -0
- package/src/stories/views/components/appBanner/appBanner.mdx +18 -0
- package/src/stories/views/components/appBanner/appBanner.stories.js +44 -0
- package/src/stories/views/components/appBanner/nativeAppBanner.alpine.js +44 -0
- package/src/stories/views/components/appBanner/nativeAppBanner.hbs +27 -0
package/.storybook/preview.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v1.124.10 (Tue Dec 16 2025)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Dpe 3046 b [#1329](https://github.com/mumprod/hr-design-system-handlebars/pull/1329) ([@vascoeduardo](https://github.com/vascoeduardo))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v1.124.9 (Mon Dec 15 2025)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- Dpe 3046 [#1328](https://github.com/mumprod/hr-design-system-handlebars/pull/1328) ([@vascoeduardo](https://github.com/vascoeduardo))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v1.124.8 (Wed Dec 10 2025)
|
|
2
26
|
|
|
3
27
|
#### ⚠️ Pushed to `main`
|
package/dist/assets/index.css
CHANGED
|
@@ -1729,6 +1729,9 @@ article #commentList {
|
|
|
1729
1729
|
.h-10 {
|
|
1730
1730
|
height: 2.5rem;
|
|
1731
1731
|
}
|
|
1732
|
+
.h-11 {
|
|
1733
|
+
height: 2.75rem;
|
|
1734
|
+
}
|
|
1732
1735
|
.h-12 {
|
|
1733
1736
|
height: 3rem;
|
|
1734
1737
|
}
|
|
@@ -1847,6 +1850,9 @@ article #commentList {
|
|
|
1847
1850
|
.w-10\/12 {
|
|
1848
1851
|
width: 83.333333%;
|
|
1849
1852
|
}
|
|
1853
|
+
.w-11 {
|
|
1854
|
+
width: 2.75rem;
|
|
1855
|
+
}
|
|
1850
1856
|
.w-12 {
|
|
1851
1857
|
width: 3rem;
|
|
1852
1858
|
}
|
|
@@ -2724,6 +2730,11 @@ article #commentList {
|
|
|
2724
2730
|
background-color: rgba(96, 165, 250, 1);
|
|
2725
2731
|
background-color: rgba(96, 165, 250, var(--tw-bg-opacity));
|
|
2726
2732
|
}
|
|
2733
|
+
.bg-blue-aqua {
|
|
2734
|
+
--tw-bg-opacity: 1;
|
|
2735
|
+
background-color: rgba(229, 237, 241, 1);
|
|
2736
|
+
background-color: rgba(229, 237, 241, var(--tw-bg-opacity));
|
|
2737
|
+
}
|
|
2727
2738
|
.bg-blue-congress-hex {
|
|
2728
2739
|
--tw-bg-opacity: 1;
|
|
2729
2740
|
background-color: rgba(0, 82, 147, 1);
|
|
@@ -3895,7 +3906,7 @@ article #commentList {
|
|
|
3895
3906
|
border-bottom-color: var(--color-secondary-ds);
|
|
3896
3907
|
}
|
|
3897
3908
|
.counter-reset {
|
|
3898
|
-
counter-reset:
|
|
3909
|
+
counter-reset: cnt1765889322588;
|
|
3899
3910
|
}
|
|
3900
3911
|
.animate-delay-100 {
|
|
3901
3912
|
--tw-animate-delay: 100ms;
|
|
@@ -4356,7 +4367,7 @@ html { scroll-behavior: smooth; }
|
|
|
4356
4367
|
--tw-ring-color: rgba(255, 255, 255, 0.5);
|
|
4357
4368
|
}
|
|
4358
4369
|
.-ordered {
|
|
4359
|
-
counter-increment:
|
|
4370
|
+
counter-increment: cnt1765889322588 1;
|
|
4360
4371
|
}
|
|
4361
4372
|
.-ordered::before {
|
|
4362
4373
|
position: absolute;
|
|
@@ -4374,7 +4385,7 @@ html { scroll-behavior: smooth; }
|
|
|
4374
4385
|
--tw-text-opacity: 1;
|
|
4375
4386
|
color: rgba(0, 0, 0, 1);
|
|
4376
4387
|
color: rgba(0, 0, 0, var(--tw-text-opacity));
|
|
4377
|
-
content: counter(
|
|
4388
|
+
content: counter(cnt1765889322588);
|
|
4378
4389
|
}
|
|
4379
4390
|
/*! ****************************/
|
|
4380
4391
|
/*! DataPolicy stuff */
|
|
@@ -7386,6 +7397,11 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
|
|
|
7386
7397
|
line-height: 2rem;
|
|
7387
7398
|
}
|
|
7388
7399
|
|
|
7400
|
+
.sm\:text-base {
|
|
7401
|
+
font-size: 1rem;
|
|
7402
|
+
line-height: 1.375rem;
|
|
7403
|
+
}
|
|
7404
|
+
|
|
7389
7405
|
.sm\:text-lg {
|
|
7390
7406
|
font-size: 1.125rem;
|
|
7391
7407
|
line-height: 1.5rem;
|
|
@@ -8511,6 +8527,10 @@ ul.restrictedToTwo li:nth-of-type(1n + 2) .timelineBorder {
|
|
|
8511
8527
|
max-width: 75%;
|
|
8512
8528
|
}
|
|
8513
8529
|
|
|
8530
|
+
.lg\:max-w-7xl {
|
|
8531
|
+
max-width: 80rem;
|
|
8532
|
+
}
|
|
8533
|
+
|
|
8514
8534
|
.lg\:flex-initial {
|
|
8515
8535
|
flex: 0 1 auto;
|
|
8516
8536
|
}
|
package/dist/assets/js/alpine.js
CHANGED
|
@@ -13,6 +13,8 @@ import dropdown from 'components/site_header/dropdown.alpine'
|
|
|
13
13
|
|
|
14
14
|
AsyncAlpine.init(Alpine)
|
|
15
15
|
.data('podcastPlayer', () => import('components/podcast/podcast_player.alpine.js'))
|
|
16
|
+
.data('appBanner', () => import('components/appBanner/appBanner.alpine.js'))
|
|
17
|
+
.data('nativeAppBanner', () => import('components/appBanner/nativeAppBanner.alpine.js'))
|
|
16
18
|
.data('slider', () =>
|
|
17
19
|
import('components/horizontal_scroll_container/horizontal_scroll_container.alpine.js')
|
|
18
20
|
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { uxAction } from 'base/tracking/pianoHelper.subfeature'
|
|
2
|
+
|
|
3
|
+
export default function appBanner() {
|
|
4
|
+
return {
|
|
5
|
+
showBanner: false,
|
|
6
|
+
deferredPrompt: null,
|
|
7
|
+
isAndroid: /Android/i.test(navigator.userAgent),
|
|
8
|
+
packageId: "de.hr.hessenschau",
|
|
9
|
+
init: function () {
|
|
10
|
+
|
|
11
|
+
if(this.isAndroid){
|
|
12
|
+
this.showBanner = true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if(window.IS_STORYBOOK){ this.showBanner = true;}
|
|
16
|
+
},
|
|
17
|
+
installClickHandler: function(){
|
|
18
|
+
this.openPlayStore()
|
|
19
|
+
this.showBanner = false
|
|
20
|
+
},
|
|
21
|
+
closeClickHandler: function(){
|
|
22
|
+
uxAction('appBanner::bannerClosed');
|
|
23
|
+
this.showBanner = false
|
|
24
|
+
},
|
|
25
|
+
openPlayStore: function() {
|
|
26
|
+
let fallbackTriggered = false;
|
|
27
|
+
|
|
28
|
+
const fallback = () => {
|
|
29
|
+
if (fallbackTriggered) return;
|
|
30
|
+
fallbackTriggered = true;
|
|
31
|
+
|
|
32
|
+
window.open(`https://play.google.com/store/apps/details?id=${this.packageId}`, "googlePlayStore");
|
|
33
|
+
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
document.addEventListener('visibilitychange', () => {
|
|
37
|
+
if (document.hidden) {
|
|
38
|
+
// App switch happened → cancel fallback
|
|
39
|
+
fallbackTriggered = true;
|
|
40
|
+
}
|
|
41
|
+
}, { once: true });
|
|
42
|
+
|
|
43
|
+
window.location.href =
|
|
44
|
+
`intent://details?id=${this.packageId}` +
|
|
45
|
+
`#Intent;scheme=market;package=com.android.vending;end`;
|
|
46
|
+
|
|
47
|
+
setTimeout(fallback, 700);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { uxAction } from 'base/tracking/pianoHelper.subfeature'
|
|
2
|
+
|
|
3
|
+
export default function nativeAppBanner() {
|
|
4
|
+
return {
|
|
5
|
+
showBanner: false,
|
|
6
|
+
deferredPrompt: null,
|
|
7
|
+
isAndroid: /Android/i.test(navigator.userAgent),
|
|
8
|
+
init: function () {
|
|
9
|
+
window.addEventListener('beforeinstallprompt', (e) => {
|
|
10
|
+
// Prevent Chrome 67 and earlier from automatically showing the prompt
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
// Stash the event so it can be triggered later.
|
|
13
|
+
this.deferredPrompt = e;
|
|
14
|
+
// Update UI notify the user they can add to home screen
|
|
15
|
+
if(this.isAndroid){
|
|
16
|
+
this.showBanner = true;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
if(window.IS_STORYBOOK){ this.showBanner = true;}
|
|
20
|
+
},
|
|
21
|
+
installClickHandler: function(){
|
|
22
|
+
if(this.deferredPrompt){
|
|
23
|
+
this.deferredPrompt.prompt();
|
|
24
|
+
// Wait for the user to respond to the prompt
|
|
25
|
+
this.deferredPrompt.userChoice
|
|
26
|
+
.then((choiceResult) => {
|
|
27
|
+
if (choiceResult.outcome === 'accepted') {
|
|
28
|
+
uxAction('nativeAppBanner::promt::accepted');
|
|
29
|
+
console.log('User accepted the A2HS prompt');
|
|
30
|
+
} else {
|
|
31
|
+
uxAction('nativeAppBanner::promt::dismissed');
|
|
32
|
+
console.log('User dismissed the A2HS prompt');
|
|
33
|
+
}
|
|
34
|
+
this.deferredPrompt = null;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
this.showBanner = false
|
|
38
|
+
},
|
|
39
|
+
closeClickHandler: function(){
|
|
40
|
+
uxAction('nativeAppBanner::bannerClosed');
|
|
41
|
+
this.showBanner = false
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<div
|
|
2
|
+
x-data="appBanner()" x-cloak x-show="showBanner" ax-load x-ignore
|
|
3
|
+
id="marketing-banner" tabindex="-1" class="fixed bottom-0 z-50 flex flex-row justify-end w-full gap-4 p-4 -translate-x-1/2 flex-nowrap bg-blue-aqua lg:max-w-7xl left-1/2">
|
|
4
|
+
<div class="flex flex-row items-center gap-4 grow">
|
|
5
|
+
<div class="flex items-center justify-center rounded-lg w-11 h-11 bg-blue-congress-hex shrink-0">
|
|
6
|
+
<img width="24" height="24" src="{{resourceUrl "assets/base/icons/logo/brandlogo--mobile.min.svg" _brand=(defaultIfEmpty this.brand "hessenschau")}}"
|
|
7
|
+
class="w-7 h-7" alt="{{loca "meta_application_name"}}">
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex flex-col items-start text-sm sm:text-base font-heading">
|
|
10
|
+
<span class="font-bold">hessenschau App</span>
|
|
11
|
+
<span>Kostenlos bei Google Play</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="flex items-center gap-4 ">
|
|
15
|
+
{{#> components/button/button _size="md" _alpineClick="installClickHandler"}}
|
|
16
|
+
{{> components/button/components/button_label _label="Laden" _css="text-sm sm:text-base"}}
|
|
17
|
+
{{/components/button/button}}
|
|
18
|
+
{{#> components/button/button _size="md" _variant="tertiary" _css="h-10" _alpineClick="closeClickHandler"}}
|
|
19
|
+
{{> components/button/components/button_icon _icon="close" _css="" _iconmap="icons"}}
|
|
20
|
+
{{> components/button/components/button_label _label="schließen" _css="sr-only"}}
|
|
21
|
+
{{/components/button/button}}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<div
|
|
2
|
+
x-data="nativeAppBanner()" x-cloak x-show="showBanner" ax-load x-ignore
|
|
3
|
+
id="marketing-banner" tabindex="-1" class="fixed bottom-0 z-50 flex flex-row justify-end w-full gap-4 p-4 -translate-x-1/2 flex-nowrap bg-blue-aqua lg:max-w-7xl left-1/2">
|
|
4
|
+
<div class="flex flex-row items-center gap-4 grow">
|
|
5
|
+
<div class="flex items-center justify-center rounded-lg w-11 h-11 bg-blue-congress-hex shrink-0">
|
|
6
|
+
<img width="24" height="24" src="{{resourceUrl "assets/base/icons/logo/brandlogo--mobile.min.svg" _brand=(defaultIfEmpty this.brand "hessenschau")}}"
|
|
7
|
+
class="w-7 h-7" alt="{{loca "meta_application_name"}}">
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex flex-col items-start text-sm sm:text-base font-heading">
|
|
10
|
+
<span class="font-bold">hessenschau App</span>
|
|
11
|
+
<span>Kostenlos bei Google Play</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="flex items-center gap-4 ">
|
|
15
|
+
{{#> components/button/button _size="md" _alpineClick="installClickHandler"}}
|
|
16
|
+
{{> components/button/components/button_label _label="Laden" _css="text-sm sm:text-base"}}
|
|
17
|
+
{{/components/button/button}}
|
|
18
|
+
{{#> components/button/button _size="md" _variant="tertiary" _css="h-10" _alpineClick="closeClickHandler"}}
|
|
19
|
+
{{> components/button/components/button_icon _icon="close" _css="" _iconmap="icons"}}
|
|
20
|
+
{{> components/button/components/button_label _label="schließen" _css="sr-only"}}
|
|
21
|
+
{{/components/button/button}}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<div
|
|
2
|
+
x-data="appBanner()" x-cloak x-show="showBanner" ax-load x-ignore
|
|
3
|
+
id="marketing-banner" tabindex="-1" class="fixed bottom-0 z-50 flex flex-row justify-end w-full gap-4 p-4 -translate-x-1/2 flex-nowrap bg-blue-aqua lg:max-w-7xl left-1/2">
|
|
4
|
+
<div class="flex flex-row items-center gap-4 grow">
|
|
5
|
+
<div class="flex items-center justify-center rounded-lg w-11 h-11 bg-blue-congress-hex shrink-0">
|
|
6
|
+
<img width="24" height="24" src="{{resourceUrl "assets/base/icons/logo/brandlogo--mobile.min.svg" _brand=(defaultIfEmpty this.brand "hessenschau")}}"
|
|
7
|
+
class="w-7 h-7" alt="{{loca "meta_application_name"}}">
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex flex-col items-start text-sm sm:text-base font-heading">
|
|
10
|
+
<span class="font-bold">hessenschau App</span>
|
|
11
|
+
<span>Kostenlos bei Google Play</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="flex items-center gap-4 ">
|
|
15
|
+
{{#> components/button/button _size="md" _alpineClick="installClickHandler"}}
|
|
16
|
+
{{> components/button/components/button_label _label="Laden" _css="text-sm sm:text-base"}}
|
|
17
|
+
{{/components/button/button}}
|
|
18
|
+
{{#> components/button/button _size="md" _variant="tertiary" _css="h-10" _alpineClick="closeClickHandler"}}
|
|
19
|
+
{{> components/button/components/button_icon _icon="close" _css="" _iconmap="icons"}}
|
|
20
|
+
{{> components/button/components/button_label _label="schließen" _css="sr-only"}}
|
|
21
|
+
{{/components/button/button}}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<div
|
|
2
|
+
x-data="nativeAppBanner()" x-cloak x-show="showBanner" ax-load x-ignore
|
|
3
|
+
id="marketing-banner" tabindex="-1" class="fixed bottom-0 z-50 flex flex-row justify-end w-full gap-4 p-4 -translate-x-1/2 flex-nowrap bg-blue-aqua lg:max-w-7xl left-1/2">
|
|
4
|
+
<div class="flex flex-row items-center gap-4 grow">
|
|
5
|
+
<div class="flex items-center justify-center rounded-lg w-11 h-11 bg-blue-congress-hex shrink-0">
|
|
6
|
+
<img width="24" height="24" src="{{resourceUrl "assets/base/icons/logo/brandlogo--mobile.min.svg" _brand=(defaultIfEmpty this.brand "hessenschau")}}"
|
|
7
|
+
class="w-7 h-7" alt="{{loca "meta_application_name"}}">
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex flex-col items-start text-sm sm:text-base font-heading">
|
|
10
|
+
<span class="font-bold">hessenschau App</span>
|
|
11
|
+
<span>Kostenlos bei Google Play</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="flex items-center gap-4 ">
|
|
15
|
+
{{#> components/button/button _size="md" _alpineClick="installClickHandler"}}
|
|
16
|
+
{{> components/button/components/button_label _label="Laden" _css="text-sm sm:text-base"}}
|
|
17
|
+
{{/components/button/button}}
|
|
18
|
+
{{#> components/button/button _size="md" _variant="tertiary" _css="h-10" _alpineClick="closeClickHandler"}}
|
|
19
|
+
{{> components/button/components/button_icon _icon="close" _css="" _iconmap="icons"}}
|
|
20
|
+
{{> components/button/components/button_label _label="schließen" _css="sr-only"}}
|
|
21
|
+
{{/components/button/button}}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
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.124.
|
|
9
|
+
"version": "1.124.10",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "storybook dev -p 6006 public",
|
package/src/assets/js/alpine.js
CHANGED
|
@@ -13,6 +13,8 @@ import dropdown from 'components/site_header/dropdown.alpine'
|
|
|
13
13
|
|
|
14
14
|
AsyncAlpine.init(Alpine)
|
|
15
15
|
.data('podcastPlayer', () => import('components/podcast/podcast_player.alpine.js'))
|
|
16
|
+
.data('appBanner', () => import('components/appBanner/appBanner.alpine.js'))
|
|
17
|
+
.data('nativeAppBanner', () => import('components/appBanner/nativeAppBanner.alpine.js'))
|
|
16
18
|
.data('slider', () =>
|
|
17
19
|
import('components/horizontal_scroll_container/horizontal_scroll_container.alpine.js')
|
|
18
20
|
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { uxAction } from 'base/tracking/pianoHelper.subfeature'
|
|
2
|
+
|
|
3
|
+
export default function appBanner() {
|
|
4
|
+
return {
|
|
5
|
+
showBanner: false,
|
|
6
|
+
deferredPrompt: null,
|
|
7
|
+
isAndroid: /Android/i.test(navigator.userAgent),
|
|
8
|
+
packageId: "de.hr.hessenschau",
|
|
9
|
+
init: function () {
|
|
10
|
+
|
|
11
|
+
if(this.isAndroid){
|
|
12
|
+
this.showBanner = true;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if(window.IS_STORYBOOK){ this.showBanner = true;}
|
|
16
|
+
},
|
|
17
|
+
installClickHandler: function(){
|
|
18
|
+
this.openPlayStore()
|
|
19
|
+
this.showBanner = false
|
|
20
|
+
},
|
|
21
|
+
closeClickHandler: function(){
|
|
22
|
+
uxAction('appBanner::bannerClosed');
|
|
23
|
+
this.showBanner = false
|
|
24
|
+
},
|
|
25
|
+
openPlayStore: function() {
|
|
26
|
+
let fallbackTriggered = false;
|
|
27
|
+
|
|
28
|
+
const fallback = () => {
|
|
29
|
+
if (fallbackTriggered) return;
|
|
30
|
+
fallbackTriggered = true;
|
|
31
|
+
|
|
32
|
+
window.open(`https://play.google.com/store/apps/details?id=${this.packageId}`, "googlePlayStore");
|
|
33
|
+
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
document.addEventListener('visibilitychange', () => {
|
|
37
|
+
if (document.hidden) {
|
|
38
|
+
// App switch happened → cancel fallback
|
|
39
|
+
fallbackTriggered = true;
|
|
40
|
+
}
|
|
41
|
+
}, { once: true });
|
|
42
|
+
|
|
43
|
+
window.location.href =
|
|
44
|
+
`intent://details?id=${this.packageId}` +
|
|
45
|
+
`#Intent;scheme=market;package=com.android.vending;end`;
|
|
46
|
+
|
|
47
|
+
setTimeout(fallback, 700);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<div
|
|
2
|
+
x-data="appBanner()" x-cloak x-show="showBanner" ax-load x-ignore
|
|
3
|
+
id="marketing-banner" tabindex="-1" class="fixed bottom-0 z-50 flex flex-row justify-end w-full gap-4 p-4 -translate-x-1/2 flex-nowrap bg-blue-aqua lg:max-w-7xl left-1/2">
|
|
4
|
+
<div class="flex flex-row items-center gap-4 grow">
|
|
5
|
+
<div class="flex items-center justify-center rounded-lg w-11 h-11 bg-blue-congress-hex shrink-0">
|
|
6
|
+
<img width="24" height="24" src="{{resourceUrl "assets/base/icons/logo/brandlogo--mobile.min.svg" _brand=(defaultIfEmpty this.brand "hessenschau")}}"
|
|
7
|
+
class="w-7 h-7" alt="{{loca "meta_application_name"}}">
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex flex-col items-start text-sm sm:text-base font-heading">
|
|
10
|
+
<span class="font-bold">hessenschau App</span>
|
|
11
|
+
<span>Kostenlos bei Google Play</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="flex items-center gap-4 ">
|
|
15
|
+
{{#> components/button/button _size="md" _alpineClick="installClickHandler"}}
|
|
16
|
+
{{> components/button/components/button_label _label="Laden" _css="text-sm sm:text-base"}}
|
|
17
|
+
{{/components/button/button}}
|
|
18
|
+
{{#> components/button/button _size="md" _variant="tertiary" _css="h-10" _alpineClick="closeClickHandler"}}
|
|
19
|
+
{{> components/button/components/button_icon _icon="close" _css="" _iconmap="icons"}}
|
|
20
|
+
{{> components/button/components/button_label _label="schließen" _css="sr-only"}}
|
|
21
|
+
{{/components/button/button}}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ArgTypes, Meta, Story, Canvas, ColorPalette, ColorItem } from '@storybook/blocks'
|
|
2
|
+
import * as AppBannerStories from './appBanner.stories';
|
|
3
|
+
|
|
4
|
+
import appBanner from './appBanner.hbs'
|
|
5
|
+
|
|
6
|
+
<Meta of={AppBannerStories} />
|
|
7
|
+
|
|
8
|
+
export const Template = ({ ...args }) => {
|
|
9
|
+
// You can either use a function to create DOM elements or use a plain html string!
|
|
10
|
+
// return `<div>${appBanner}</div>`;
|
|
11
|
+
return appBanner({ ...args })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
# AppBanner
|
|
15
|
+
|
|
16
|
+
<Canvas withToolbar>
|
|
17
|
+
<Story of={AppBannerStories.AppBanner} />
|
|
18
|
+
</Canvas>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import appBanner from './appBanner.hbs'
|
|
2
|
+
import nativeAppBanner from './nativeAppBanner.hbs'
|
|
3
|
+
|
|
4
|
+
const Template = ({ ...args }) => {
|
|
5
|
+
// You can either use a function to create DOM elements or use a plain html string!
|
|
6
|
+
// return `<div>${appBanner}</div>`;
|
|
7
|
+
return appBanner({ ...args })
|
|
8
|
+
}
|
|
9
|
+
const NativeTemplate = ({ ...args }) => {
|
|
10
|
+
// You can either use a function to create DOM elements or use a plain html string!
|
|
11
|
+
// return `<div>${nativeAppBanner}</div>`;
|
|
12
|
+
return nativeAppBanner({ ...args })
|
|
13
|
+
}
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Komponenten/App Banner',
|
|
16
|
+
|
|
17
|
+
argTypes: {
|
|
18
|
+
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
decorators: [
|
|
22
|
+
(Story) => {
|
|
23
|
+
return `${Story()}`
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const AppBanner = {
|
|
29
|
+
render: Template.bind({}),
|
|
30
|
+
name: 'AppBanner',
|
|
31
|
+
|
|
32
|
+
args: {
|
|
33
|
+
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
export const NativeAppBanner = {
|
|
37
|
+
render: NativeTemplate.bind({}),
|
|
38
|
+
name: 'NativeAppBanner',
|
|
39
|
+
|
|
40
|
+
args: {
|
|
41
|
+
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { uxAction } from 'base/tracking/pianoHelper.subfeature'
|
|
2
|
+
|
|
3
|
+
export default function nativeAppBanner() {
|
|
4
|
+
return {
|
|
5
|
+
showBanner: false,
|
|
6
|
+
deferredPrompt: null,
|
|
7
|
+
isAndroid: /Android/i.test(navigator.userAgent),
|
|
8
|
+
init: function () {
|
|
9
|
+
window.addEventListener('beforeinstallprompt', (e) => {
|
|
10
|
+
// Prevent Chrome 67 and earlier from automatically showing the prompt
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
// Stash the event so it can be triggered later.
|
|
13
|
+
this.deferredPrompt = e;
|
|
14
|
+
// Update UI notify the user they can add to home screen
|
|
15
|
+
if(this.isAndroid){
|
|
16
|
+
this.showBanner = true;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
if(window.IS_STORYBOOK){ this.showBanner = true;}
|
|
20
|
+
},
|
|
21
|
+
installClickHandler: function(){
|
|
22
|
+
if(this.deferredPrompt){
|
|
23
|
+
this.deferredPrompt.prompt();
|
|
24
|
+
// Wait for the user to respond to the prompt
|
|
25
|
+
this.deferredPrompt.userChoice
|
|
26
|
+
.then((choiceResult) => {
|
|
27
|
+
if (choiceResult.outcome === 'accepted') {
|
|
28
|
+
uxAction('nativeAppBanner::promt::accepted');
|
|
29
|
+
console.log('User accepted the A2HS prompt');
|
|
30
|
+
} else {
|
|
31
|
+
uxAction('nativeAppBanner::promt::dismissed');
|
|
32
|
+
console.log('User dismissed the A2HS prompt');
|
|
33
|
+
}
|
|
34
|
+
this.deferredPrompt = null;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
this.showBanner = false
|
|
38
|
+
},
|
|
39
|
+
closeClickHandler: function(){
|
|
40
|
+
uxAction('nativeAppBanner::bannerClosed');
|
|
41
|
+
this.showBanner = false
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<div
|
|
2
|
+
x-data="nativeAppBanner()" x-cloak x-show="showBanner" ax-load x-ignore
|
|
3
|
+
id="marketing-banner" tabindex="-1" class="fixed bottom-0 z-50 flex flex-row justify-end w-full gap-4 p-4 -translate-x-1/2 flex-nowrap bg-blue-aqua lg:max-w-7xl left-1/2">
|
|
4
|
+
<div class="flex flex-row items-center gap-4 grow">
|
|
5
|
+
<div class="flex items-center justify-center rounded-lg w-11 h-11 bg-blue-congress-hex shrink-0">
|
|
6
|
+
<img width="24" height="24" src="{{resourceUrl "assets/base/icons/logo/brandlogo--mobile.min.svg" _brand=(defaultIfEmpty this.brand "hessenschau")}}"
|
|
7
|
+
class="w-7 h-7" alt="{{loca "meta_application_name"}}">
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex flex-col items-start text-sm sm:text-base font-heading">
|
|
10
|
+
<span class="font-bold">hessenschau App</span>
|
|
11
|
+
<span>Kostenlos bei Google Play</span>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="flex items-center gap-4 ">
|
|
15
|
+
{{#> components/button/button _size="md" _alpineClick="installClickHandler"}}
|
|
16
|
+
{{> components/button/components/button_label _label="Laden" _css="text-sm sm:text-base"}}
|
|
17
|
+
{{/components/button/button}}
|
|
18
|
+
{{#> components/button/button _size="md" _variant="tertiary" _css="h-10" _alpineClick="closeClickHandler"}}
|
|
19
|
+
{{> components/button/components/button_icon _icon="close" _css="" _iconmap="icons"}}
|
|
20
|
+
{{> components/button/components/button_label _label="schließen" _css="sr-only"}}
|
|
21
|
+
{{/components/button/button}}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|