hr-design-system-handlebars 0.65.0 → 0.67.0
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 -1
- package/CHANGELOG.md +24 -0
- package/README.md +62 -5
- package/build/handlebars/handlebars.js +29 -0
- package/build/handlebars/helpers/handlebar-helpers.js +21 -6
- package/build/handlebars/partials/handlebar-partials.js +23 -22
- package/build/scripts/build.js +1 -0
- package/config.js +1 -0
- package/dist/assets/brand/_default/conf/locatags.json +82 -0
- package/dist/assets/brand/hessenschau/conf/locatags.json +3 -0
- package/dist/assets/brand/hr/conf/locatags.json +3 -0
- package/dist/assets/brand/hr-bigband/conf/locatags.json +3 -0
- package/dist/assets/brand/hr-fernsehen/conf/locatags.json +3 -0
- package/dist/assets/brand/hr-inforadio/conf/locatags.json +3 -0
- package/dist/assets/brand/hr-rundfunkrat/conf/locatags.json +3 -0
- package/dist/assets/brand/hr-sinfonieorchester/conf/locatags.json +3 -0
- package/dist/assets/brand/hr-werbung/conf/locatags.json +3 -0
- package/dist/assets/brand/hr1/conf/locatags.json +3 -0
- package/dist/assets/brand/hr2/conf/locatags.json +3 -0
- package/dist/assets/brand/hr3/conf/locatags.json +3 -0
- package/dist/assets/brand/hr4/conf/locatags.json +3 -0
- package/dist/assets/brand/you-fm/conf/locatags.json +3 -0
- package/dist/assets/index.css +3 -3
- package/dist/assets/js/components/mediaplayer/ardPlayerLoader.subfeature.js +5 -1
- package/dist/views/components/teaser/components/teaser_av_consumption.hbs +41 -19
- package/dist/views/components/teaser/components/teaser_av_consumption_close_button.hbs +1 -0
- package/dist/views/components/teaser/podcast/podcast_player_ui.hbs +5 -5
- package/gulpfile.js +69 -6
- package/package.json +7 -3
- package/src/assets/brand/_default/conf/locatags.json +82 -0
- package/src/assets/brand/hessenschau/conf/locatags.json +3 -0
- package/src/assets/brand/hessenschau/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr/conf/locatags.json +3 -0
- package/src/assets/brand/hr/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr-bigband/conf/locatags.json +3 -0
- package/src/assets/brand/hr-bigband/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr-fernsehen/conf/locatags.json +3 -0
- package/src/assets/brand/hr-fernsehen/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr-inforadio/conf/locatags.json +3 -0
- package/src/assets/brand/hr-inforadio/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr-rundfunkrat/conf/locatags.json +3 -0
- package/src/assets/brand/hr-rundfunkrat/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr-sinfonieorchester/conf/locatags.json +3 -0
- package/src/assets/brand/hr-sinfonieorchester/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr-werbung/conf/locatags.json +3 -0
- package/src/assets/brand/hr-werbung/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr1/conf/locatags.json +3 -0
- package/src/assets/brand/hr1/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr2/conf/locatags.json +3 -0
- package/src/assets/brand/hr2/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr3/conf/locatags.json +3 -0
- package/src/assets/brand/hr3/conf/locatags.merged.json +82 -0
- package/src/assets/brand/hr4/conf/locatags.json +3 -0
- package/src/assets/brand/hr4/conf/locatags.merged.json +82 -0
- package/src/assets/brand/you-fm/conf/locatags.json +3 -0
- package/src/assets/brand/you-fm/conf/locatags.merged.json +82 -0
- package/src/assets/fixtures/teaser/teasers.inc.json +15 -16
- package/src/assets/js/podcastPlayer.alpine.js +2 -16
- package/src/stories/views/components/mediaplayer/ardPlayerLoader.subfeature.js +5 -1
- package/src/stories/views/components/teaser/components/teaser_av_consumption.hbs +41 -19
- package/src/stories/views/components/teaser/components/teaser_av_consumption_close_button.hbs +1 -0
- package/src/stories/views/components/teaser/fixtures/teaser_podcast.json +1 -1
- package/src/stories/views/components/teaser/podcast/podcast_player_ui.hbs +5 -5
package/.storybook/preview.js
CHANGED
|
@@ -163,7 +163,7 @@ export const parameters = {
|
|
|
163
163
|
{ id: 'hr2', title: 'hr2.de' },
|
|
164
164
|
{ id: 'hr3', title: 'hr3.de' },
|
|
165
165
|
{ id: 'hr4', title: 'hr4.de' },
|
|
166
|
-
{ id: '
|
|
166
|
+
{ id: 'you-fm', title: 'you-fm.de' },
|
|
167
167
|
{ id: 'hr-inforadio', title: 'hr-info.de' },
|
|
168
168
|
{ id: 'hr-fernsehen', title: 'hr-fernsehen.de' },
|
|
169
169
|
{ id: 'hr-rundfunkrat', title: 'hr-rundfunkrat.de' },
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v0.67.0 (Wed Oct 19 2022)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Bugfix/dpe 1567 [#342](https://github.com/mumprod/hr-design-system-handlebars/pull/342) ([@szuelch](https://github.com/szuelch))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- [@szuelch](https://github.com/szuelch)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v0.66.0 (Tue Oct 18 2022)
|
|
14
|
+
|
|
15
|
+
#### 🚀 Enhancement
|
|
16
|
+
|
|
17
|
+
- Dpe 1696 podcast player refactoring part5 [#343](https://github.com/mumprod/hr-design-system-handlebars/pull/343) ([@StefanVesper](https://github.com/StefanVesper))
|
|
18
|
+
|
|
19
|
+
#### Authors: 1
|
|
20
|
+
|
|
21
|
+
- SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
1
25
|
# v0.65.0 (Fri Oct 14 2022)
|
|
2
26
|
|
|
3
27
|
#### 🚀 Enhancement
|
package/README.md
CHANGED
|
@@ -38,15 +38,72 @@ Mit dem Befehl
|
|
|
38
38
|
npm run storybook
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
kann das Designsystem lokal gestartet werden.
|
|
42
|
-
noch in einem anderen Terminal Fenster der Befehl
|
|
41
|
+
kann das Designsystem lokal gestartet werden. Damit dieses immer mit den aktuellsten Daten arbeitet, muss in einem weiteren Terminalfenster zudem das Skript `optimize-assets` mit dem Befehl
|
|
43
42
|
|
|
44
43
|
```
|
|
45
44
|
npm run optimize-assets
|
|
46
45
|
```
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
gestartet werden. Dieses Skript erzeugt für die einzelnen Features JSON-Testdaten, optimiert im SVG-Format vorliegende Icons, erzeugt eine angepasste Version von Modernizr.js und stellt alle Handelbars-Templates als JS-Exporte zur Verfügung. Es läuft im Watch-Modus,
|
|
48
|
+
sodass Dateiänderungen automatisch erkannt und die entsprechenden Optimierungs-Operationen neu ausgeführt werden.
|
|
49
|
+
Beim ersten Aufruf des Skripts cached es die Rohdaten der jeweiligen Assets im Verzeichnis `build/gulp/cache`. Bei allen zukünftigen Aufrufen vergleicht es die Rohdaten mit den Daten im Cache und führt die Optimierungen lediglich noch für geänderte Dateien aus. Dies verkürzt zukünftige Builds erheblich.
|
|
50
|
+
|
|
51
|
+
## Einrichten eines VS-Code Makros zur komfortableren Ausführung der Skripte
|
|
52
|
+
|
|
53
|
+
Die NPM-Skripte `storybook` und `optimize-assets` müssen für die korrekte Funktionsweise von Storybook immer zusammen ausgeführt werden. Zur Zeitersparnis und
|
|
54
|
+
weil insbesondere der Aufruf des Skripts `optimize-assets` gerne mal vergessen wird, erlaubt es der Code Editor VS-Code zum gemeinsamen Starten der Skripte
|
|
55
|
+
ein Makro zu erstellen. Damit VS-Code Makros ausführen kann, muss das Add-On [Macro-Commander](https://marketplace.visualstudio.com/items?itemName=jeff-hykin.macro-commander) installiert werden. Zur Einrichtung des eigentlichen Makros, müsssen an zwei Dateien Änderungen vorgenommen werden.
|
|
56
|
+
Zunächst muss der Code des Makros in den benutzerspezifischen Einstellungen (`Strg + Shift + P` > "User Settings (JSON)") eingetragen werden.
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
settings.json
|
|
60
|
+
{
|
|
61
|
+
// Weitere benutzerspezifische Einstellungen
|
|
62
|
+
...
|
|
63
|
+
"macros": {
|
|
64
|
+
"start_storybook_scripts": [
|
|
65
|
+
"workbench.action.terminal.killAll",
|
|
66
|
+
"workbench.action.terminal.new",
|
|
67
|
+
"workbench.action.terminal.split",
|
|
68
|
+
"workbench.action.terminal.focusPreviousPane",
|
|
69
|
+
{
|
|
70
|
+
"command": "workbench.action.terminal.sendSequence",
|
|
71
|
+
"args": { "text": "npm run storybook-only\r" }
|
|
72
|
+
},
|
|
73
|
+
"workbench.action.terminal.focusNextPane",
|
|
74
|
+
{
|
|
75
|
+
"command": "workbench.action.terminal.sendSequence",
|
|
76
|
+
"args": { "text": "npm run optimize-assets\r" }
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Im Anschluss daran muss, um das Makro aufrufen zu können, eine Tastenkombination mit dem Makro verknüpft werden. Hierfür muss in der
|
|
84
|
+
benutzerspezifischen Datei `keybindings.json` (`Strg + Shift + P` > Open Keyboard Shortcuts (JSON)) eine Tastenkombination zugeordet
|
|
85
|
+
werden.
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
[
|
|
89
|
+
{
|
|
90
|
+
"key": "ctrl+shift+9",
|
|
91
|
+
"command": "macros.start_storybook_scripts"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Als `key` kann eine beliebige Tastenkombination festgelegt werden. Um einzusehen welche Tastenkombinationen gegegebenenfalls schon in
|
|
97
|
+
Verwendung sind, empfiehlt es sich unter `Datei>Einstellungen>Tastenkombinationen` die derzeitigen Tastenzuordnungen in VS-Code einzusehen.
|
|
98
|
+
Ist dem Makro eine Tastenkombination zugeordnet, kann es, wenn alles korrekt gemacht wurde, ausgeführt werden. Folgende `Kommandos` führt das
|
|
99
|
+
Makro hintereinander aus:
|
|
100
|
+
|
|
101
|
+
1. Beenden aller derzeit geöffneten Terminal Instanzen
|
|
102
|
+
2. Öffnen eines neuen Terminal Fensters
|
|
103
|
+
3. Teilen des Terminal Fensters
|
|
104
|
+
4. Setze den Fokus auf das linke Terminal Fenster
|
|
105
|
+
5. Setze den Befehl `npm run storybook` ab und führe ihn aus
|
|
106
|
+
6. Setze den Fokus auf das rechte Terminal Fenster
|
|
107
|
+
7. Setze den Befehl `npm run optimize-assets` ab und führe ihn aus
|
|
51
108
|
|
|
52
109
|
Weitere Details und Grundlagen zum Gebrauch des Designsystems können direkt in dessen Dokumentation eingesehen werden.
|
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
const handlebars = require('handlebars'),
|
|
3
3
|
partials = require('./partials/handlebar-partials'),
|
|
4
4
|
runtime = require('handlebars/runtime'),
|
|
5
|
+
locatagsHessenschau = require('../../src/assets/brand/hessenschau/conf/locatags.merged.json'),
|
|
6
|
+
locatagsHr = require('../../src/assets/brand/hr/conf/locatags.merged.json'),
|
|
7
|
+
locatagsHrBigband = require('../../src/assets/brand/hr-bigband/conf/locatags.merged.json'),
|
|
8
|
+
locatagsHrFernsehen = require('../../src/assets/brand/hr-fernsehen/conf/locatags.merged.json'),
|
|
9
|
+
locatagsHrInforadio = require('../../src/assets/brand/hr-inforadio/conf/locatags.merged.json'),
|
|
10
|
+
locatagsHrRundfunkrat = require('../../src/assets/brand/hr-rundfunkrat/conf/locatags.merged.json'),
|
|
11
|
+
locatagsHrSinfonieorchester = require('../../src/assets/brand/hr-sinfonieorchester/conf/locatags.merged.json'),
|
|
12
|
+
locatagsHrWerbung = require('../../src/assets/brand/hr-werbung/conf/locatags.merged.json'),
|
|
13
|
+
locatagsHr1 = require('../../src/assets/brand/hr1/conf/locatags.merged.json'),
|
|
14
|
+
locatagsHr2 = require('../../src/assets/brand/hr2/conf/locatags.merged.json'),
|
|
15
|
+
locatagsHr3 = require('../../src/assets/brand/hr3/conf/locatags.merged.json'),
|
|
16
|
+
locatagsHr4 = require('../../src/assets/brand/hr4/conf/locatags.merged.json'),
|
|
17
|
+
locatagsYouFm = require('../../src/assets/brand/you-fm/conf/locatags.merged.json'),
|
|
5
18
|
fs = require('fs'),
|
|
6
19
|
path = require('path'),
|
|
7
20
|
options = {
|
|
@@ -10,6 +23,21 @@ const handlebars = require('handlebars'),
|
|
|
10
23
|
partialsBaseDir: './src/stories/views',
|
|
11
24
|
precompile: false,
|
|
12
25
|
writeJson: true,
|
|
26
|
+
locaTags: {
|
|
27
|
+
'hessenschau': locatagsHessenschau,
|
|
28
|
+
'hr': locatagsHr,
|
|
29
|
+
'hr-bigband': locatagsHrBigband,
|
|
30
|
+
'hr-fernsehen': locatagsHrFernsehen,
|
|
31
|
+
'hr-inforadio': locatagsHrInforadio,
|
|
32
|
+
'hr-rundfunkrat': locatagsHrRundfunkrat,
|
|
33
|
+
'hr-sinfonieorchester': locatagsHrSinfonieorchester,
|
|
34
|
+
'hr-werbung': locatagsHrWerbung,
|
|
35
|
+
'hr1': locatagsHr1,
|
|
36
|
+
'hr2': locatagsHr2,
|
|
37
|
+
'hr3': locatagsHr3,
|
|
38
|
+
'hr4': locatagsHr4,
|
|
39
|
+
'you-fm': locatagsYouFm,
|
|
40
|
+
},
|
|
13
41
|
}
|
|
14
42
|
|
|
15
43
|
/*
|
|
@@ -35,6 +63,7 @@ for (const [key, partial] of Object.entries(partials)) {
|
|
|
35
63
|
const register = require('./helpers/handlebar-helpers').register
|
|
36
64
|
register(handlebars, {
|
|
37
65
|
partialsDir: options.partialsDir,
|
|
66
|
+
locaTags: options.locaTags,
|
|
38
67
|
})
|
|
39
68
|
|
|
40
69
|
/**
|
|
@@ -12,6 +12,14 @@ var generateRandom = function () {
|
|
|
12
12
|
return Math.floor(Math.random() * (max - min + 1)) + min
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
const extractBrandFromUrl = function () {
|
|
16
|
+
let url = window.location.href
|
|
17
|
+
let extractBrandFromUrlRegex = /(?<=brands\:).*?(?=\&)/g
|
|
18
|
+
let brand = url.match(extractBrandFromUrlRegex)
|
|
19
|
+
brand = null != brand ? brand[0] : 'hessenschau'
|
|
20
|
+
return brand
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
var helpers = {
|
|
16
24
|
'helperOptions': null,
|
|
17
25
|
|
|
@@ -359,7 +367,8 @@ var helpers = {
|
|
|
359
367
|
return null
|
|
360
368
|
},
|
|
361
369
|
|
|
362
|
-
|
|
370
|
+
'loca': function () {
|
|
371
|
+
let brand = extractBrandFromUrl()
|
|
363
372
|
var loca = ''
|
|
364
373
|
|
|
365
374
|
if (arguments.length >= 1) {
|
|
@@ -367,8 +376,8 @@ var helpers = {
|
|
|
367
376
|
|
|
368
377
|
if (typeof loca === 'string') {
|
|
369
378
|
// Check loca-tag
|
|
370
|
-
if (typeof helpers.helperOptions.locaTags[loca] === 'string') {
|
|
371
|
-
loca = helpers.helperOptions.locaTags[loca]
|
|
379
|
+
if (typeof helpers.helperOptions.locaTags[brand][loca] === 'string') {
|
|
380
|
+
loca = helpers.helperOptions.locaTags[brand][loca]
|
|
372
381
|
|
|
373
382
|
// Exchange variables in loca-text
|
|
374
383
|
// - the last argument is the "context" object which can be
|
|
@@ -388,7 +397,7 @@ var helpers = {
|
|
|
388
397
|
}
|
|
389
398
|
|
|
390
399
|
return new handlebars.SafeString(loca)
|
|
391
|
-
}
|
|
400
|
+
},
|
|
392
401
|
|
|
393
402
|
'getRandom': function () {
|
|
394
403
|
return randomNumber
|
|
@@ -426,7 +435,13 @@ var helpers = {
|
|
|
426
435
|
|
|
427
436
|
return tokenStr
|
|
428
437
|
},
|
|
429
|
-
'loca': function (text, options) {
|
|
438
|
+
/*'loca': function (text, options) {
|
|
439
|
+
let url = window.location.href
|
|
440
|
+
console.log(url)
|
|
441
|
+
const regex = /(?<=brands\:).*?(?=\&)/g
|
|
442
|
+
let brand = url.match(regex)
|
|
443
|
+
brand = null != brand ? brand[0] : 'hessenschau'
|
|
444
|
+
console.log(brand)
|
|
430
445
|
var loca
|
|
431
446
|
var locas = {
|
|
432
447
|
anchor_brandNav: 'Übersicht der Marken des HR anspringen',
|
|
@@ -458,7 +473,7 @@ var helpers = {
|
|
|
458
473
|
return loca
|
|
459
474
|
}
|
|
460
475
|
}
|
|
461
|
-
}
|
|
476
|
+
},*/
|
|
462
477
|
|
|
463
478
|
/*staticSSI: function (filepath) {
|
|
464
479
|
var template = grunt.file.read(helpers.helperOptions.libraryDir + '/' + filepath, {
|