bootstrap-italia 2.3.8 → 2.4.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.
Files changed (34) hide show
  1. package/dist/bootstrap-italia.esm.js +2 -0
  2. package/dist/bootstrap-italia.esm.js.map +1 -1
  3. package/dist/css/bootstrap-italia-comuni.min.css +1 -1
  4. package/dist/css/bootstrap-italia.min.css +1 -1
  5. package/dist/css/bootstrap-italia.min.css.map +1 -1
  6. package/dist/js/bootstrap-italia.bundle.min.js +198 -72
  7. package/dist/js/bootstrap-italia.min.js +54 -47
  8. package/dist/plugins/accept-overlay.js +118 -0
  9. package/dist/plugins/accept-overlay.js.map +1 -0
  10. package/dist/plugins/dimmer.js +0 -16
  11. package/dist/plugins/dimmer.js.map +1 -1
  12. package/dist/plugins/util/cookies.js +29 -0
  13. package/dist/plugins/util/cookies.js.map +1 -0
  14. package/dist/plugins/videoplayer.js +151 -0
  15. package/dist/plugins/videoplayer.js.map +1 -0
  16. package/dist/version.js +1 -1
  17. package/dist/version.js.map +1 -1
  18. package/package.json +6 -5
  19. package/src/js/bootstrap-italia.entry.js +6 -0
  20. package/src/js/bootstrap-italia.esm.js +2 -0
  21. package/src/js/plugins/accept-overlay.js +118 -0
  22. package/src/js/plugins/dimmer.js +0 -15
  23. package/src/js/plugins/util/cookies.js +28 -0
  24. package/src/js/plugins/videoplayer.js +151 -0
  25. package/src/js/version.js +1 -1
  26. package/src/scss/bootstrap-italia.scss +2 -0
  27. package/src/scss/custom/_accept-overlay.scss +128 -0
  28. package/src/scss/custom/_accordion.scss +6 -0
  29. package/src/scss/custom/_alert.scss +1 -1
  30. package/src/scss/custom/_callout.scss +53 -10
  31. package/src/scss/custom/_version.scss +1 -1
  32. package/src/scss/custom/_videoplayer.scss +40 -0
  33. package/types/index.d.ts +2 -0
  34. package/types/plugins/fonts-loader.d.ts +5 -0
@@ -0,0 +1,28 @@
1
+ const preferencesMap = { ck3: {} }
2
+
3
+ /*
4
+ Possible choices:
5
+ false => Accept once
6
+ true => Accept always
7
+ */
8
+ const rememberChoice = (service, remember) => {
9
+ preferencesMap.ck3[service] = remember
10
+ localStorage.setItem('bs-ck3', JSON.stringify(preferencesMap.ck3))
11
+ }
12
+
13
+ const isChoiceRemembered = (service) => {
14
+ preferencesMap.ck3 = JSON.parse(localStorage.getItem('bs-ck3') || '{}')
15
+ return preferencesMap.ck3[service] || false
16
+ }
17
+
18
+ const clearAllRememberedChoices = () => {
19
+ localStorage.removeItem('bs-ck3')
20
+ }
21
+
22
+ const cookies = {
23
+ rememberChoice,
24
+ isChoiceRemembered,
25
+ clearAllRememberedChoices,
26
+ }
27
+
28
+ export { cookies }
@@ -0,0 +1,151 @@
1
+ import BaseComponent from 'bootstrap/js/src/base-component.js'
2
+
3
+ import SelectorEngine from 'bootstrap/js/src/dom/selector-engine'
4
+ import Manipulator from 'bootstrap/js/src/dom/manipulator'
5
+ import videojs from 'video.js'
6
+
7
+ const NAME = 'videoplayer'
8
+
9
+ const SELECTOR_TOGGLE = '[data-bs-video]'
10
+
11
+ const itLang = {
12
+ 'Audio Player': 'Lettore audio',
13
+ 'Video Player': 'Lettore video',
14
+ Play: 'Play',
15
+ Pause: 'Pausa',
16
+ Replay: 'Replay',
17
+ 'Current Time': 'Orario attuale',
18
+ Duration: 'Durata',
19
+ 'Remaining Time': 'Tempo rimanente',
20
+ 'Stream Type': 'Tipo del Streaming',
21
+ LIVE: 'LIVE',
22
+ Loaded: 'Caricato',
23
+ Progress: 'Stato',
24
+ 'Progress Bar': 'Barra di avanzamento',
25
+ 'progress bar timing: currentTime={1} duration={2}': '{1} di {2}',
26
+ Fullscreen: 'Schermo intero',
27
+ 'Exit Fullscreen': 'Chiudi Schermo intero',
28
+ Mute: 'Muto',
29
+ Unmute: 'Audio',
30
+ 'Playback Rate': 'Tasso di riproduzione',
31
+ Subtitles: 'Sottotitoli',
32
+ 'subtitles off': 'Senza sottotitoli',
33
+ Captions: 'Sottotitoli non udenti',
34
+ 'captions off': 'Senza sottotitoli non udenti',
35
+ Chapters: 'Capitolo',
36
+ Descriptions: 'Descrizioni',
37
+ 'descriptions off': 'Descrizioni disattivate',
38
+ 'Audio Track': 'Traccia audio',
39
+ 'Volume Level': 'Livello del volume',
40
+ 'You aborted the media playback': 'La riproduzione del filmato è stata interrotta.',
41
+ 'A network error caused the media download to fail part-way.': 'Il download del filmato è stato interrotto a causa di un problema rete.',
42
+ 'The media could not be loaded, either because the server or network failed or because the format is not supported.':
43
+ 'Il filmato non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.',
44
+ 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.':
45
+ 'La riproduzione del filmato è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.',
46
+ 'No compatible source was found for this media.': 'Non ci sono fonti compatibili per questo filmato.',
47
+ 'The media is encrypted and we do not have the keys to decrypt it.': 'Il contenuto multimediale è criptato e non disponiamo delle chiavi per decifrarlo.',
48
+ 'Play Video': 'Riprduci il video',
49
+ Close: 'Chiudi',
50
+ 'Close Modal Dialog': 'Chiudi la finestra di dialogo',
51
+ 'Modal Window': 'Finestra di dialogo',
52
+ 'This is a modal window': 'Questa è una finestra di dialogo',
53
+ 'This modal can be closed by pressing the Escape key or activating the close button.':
54
+ 'Questa finestra di dialogo può essere chiusa premendo sul tasto Esc o attivando il pulsante di chiusura.',
55
+ ', opens captions settings dialog': ', aprire i parametri della trascrizione dei sottotitoli',
56
+ ', opens subtitles settings dialog': ', aprire i parametri dei sottotitoli',
57
+ ', opens descriptions settings dialog': ', aprire i parametri delle descrizioni',
58
+ ', selected': ', selezionato',
59
+ 'captions settings': 'Parametri della trascrizione dei sottotitoli',
60
+ 'subtitles settings': 'Parametri dei sottotitoli',
61
+ 'descriptions settings': 'Parametri delle descrizioni',
62
+ Text: 'Testo',
63
+ White: 'Bianco',
64
+ Black: 'Nero',
65
+ Red: 'Rosso',
66
+ Green: 'Verde',
67
+ Blue: 'Blu',
68
+ Yellow: 'Giallo',
69
+ Magenta: 'Magenta',
70
+ Cyan: 'Ciano',
71
+ Background: 'Sfondo',
72
+ Window: 'Finestra',
73
+ Transparent: 'Trasparente',
74
+ 'Semi-Transparent': 'Semi-Trasparente',
75
+ Opaque: 'Opaco',
76
+ 'Font Size': 'Dimensione dei caratteri',
77
+ 'Text Edge Style': 'Stile dei bordi del testo',
78
+ None: 'Nessuno',
79
+ Uniform: 'Uniforme',
80
+ Dropshadow: 'Ombreggiatura',
81
+ 'Font Family': 'Famiglia di caratteri',
82
+ 'Proportional Sans-Serif': 'Carattere a spaziatura variabile senza grazie (Proportional Sans-Serif)',
83
+ 'Monospace Sans-Serif': 'Carattere a spaziatura fissa senza grazie (Monospace Sans-Serif)',
84
+ 'Proportional Serif': 'Carattere a spaziatura variabile con grazie (Proportional Serif)',
85
+ 'Monospace Serif': 'Carattere a spaziatura fissa con grazie (Monospace Serif)',
86
+ 'Small Caps': 'Maiuscoletto',
87
+ Reset: 'Reinizializza',
88
+ 'restore all settings to the default values': 'Ripristina i valori predefiniti per tutti i parametri',
89
+ Done: 'Operazione completata',
90
+ 'Caption Settings Dialog': 'Finestra di dialogo dei parametri della trascrizione dei sottotitoli',
91
+ 'Beginning of dialog window. Escape will cancel and close the window.':
92
+ 'Inizio della finestra di dialogo. Il tasto Esc annullerà l’operazione e chiuderà la finestra.',
93
+ 'End of dialog window.': 'Fine della finestra di dialogo.',
94
+ '{1} is loading.': '{1} in fase di caricamento.',
95
+ 'Exit Picture-in-Picture': 'Esci dalla modalità Picture-in-Picture',
96
+ 'Picture-in-Picture': 'Picture-in-Picture',
97
+ }
98
+
99
+ const DEFAULT_CONFIG = { languages: { it: itLang }, language: 'it' }
100
+
101
+ const Default = {}
102
+
103
+ window.videojs = videojs
104
+
105
+ class VideoPlayer extends BaseComponent {
106
+ constructor(element, config) {
107
+ super(element)
108
+ element.classList.add('video-js', 'vjs-theme-bootstrap-italia', 'vjs-fluid', 'vjs-big-play-centered')
109
+ this._config = this._getConfig(config)
110
+
111
+ this.player = videojs(element, DEFAULT_CONFIG)
112
+ }
113
+
114
+ // Public
115
+
116
+ setYouTubeVideo(url) {
117
+ this.player.tech('youtube')
118
+ this.player.src({ type: 'video/youtube', src: url })
119
+ }
120
+
121
+ // Getters
122
+
123
+ static get NAME() {
124
+ return NAME
125
+ }
126
+
127
+ // Private
128
+ _getConfig(config) {
129
+ config = {
130
+ ...Default,
131
+ ...Manipulator.getDataAttributes(this._element),
132
+ ...(typeof config === 'object' ? config : {}),
133
+ }
134
+ return config
135
+ }
136
+ }
137
+
138
+ /**
139
+ * ------------------------------------------------------------------------
140
+ * Data Api implementation
141
+ * ------------------------------------------------------------------------
142
+ */
143
+
144
+ const players = SelectorEngine.find(SELECTOR_TOGGLE)
145
+ if (players.length > 0) {
146
+ players.forEach((player) => {
147
+ VideoPlayer.getOrCreateInstance(player)
148
+ })
149
+ }
150
+
151
+ export default VideoPlayer
package/src/js/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // bootstrap italia version variable
2
2
  // useful to check for the current version
3
3
  // eslint-disable-next-line no-unused-vars
4
- const BOOTSTRAP_ITALIA_VERSION = '2.3.8'
4
+ const BOOTSTRAP_ITALIA_VERSION = '2.4.1'
5
5
  export default BOOTSTRAP_ITALIA_VERSION
@@ -120,10 +120,12 @@
120
120
  @import 'custom/gridlist';
121
121
  @import 'custom/popover';
122
122
  @import 'custom/tooltip';
123
+ @import 'custom/videoplayer';
123
124
  @import 'custom/list';
124
125
  @import 'custom/chips';
125
126
  @import 'custom/rating';
126
127
  @import 'custom/dimmer';
128
+ @import 'custom/accept-overlay';
127
129
  @import 'custom/timeline';
128
130
  @import 'custom/anchor';
129
131
  @import 'custom/map';
@@ -0,0 +1,128 @@
1
+ //mobile
2
+
3
+ .acceptoverlayable {
4
+ position: relative;
5
+ min-height: 400px;
6
+ }
7
+
8
+ .acceptoverlay {
9
+ display: flex;
10
+ background-color: $color-background-emphasis;
11
+ opacity: 0.92;
12
+ position: absolute;
13
+ top: 0;
14
+ bottom: 0;
15
+ left: 0;
16
+ right: 0;
17
+ z-index: 1;
18
+ padding: $v-gap * 4;
19
+ justify-content: center;
20
+ flex-wrap: wrap;
21
+ align-items: flex-start;
22
+
23
+ label {
24
+ color: $white;
25
+ &::after {
26
+ border-color: $white !important;
27
+ }
28
+ }
29
+
30
+ &[aria-hidden='true'] {
31
+ display: none;
32
+ }
33
+
34
+ &.acceptoverlay-primary {
35
+ background-color: $primary;
36
+ &.show {
37
+ opacity: 0.9;
38
+ }
39
+ }
40
+
41
+ h1,
42
+ h2,
43
+ h3,
44
+ h4,
45
+ h5,
46
+ h6,
47
+ p {
48
+ color: $white;
49
+ margin-bottom: 0;
50
+ }
51
+
52
+ h4 {
53
+ text-align: center;
54
+ font-size: 2.222rem;
55
+ }
56
+
57
+ p {
58
+ text-align: justify;
59
+ font-family: $font-family-serif;
60
+ font-size: 1rem;
61
+ }
62
+
63
+ .acceptoverlay-inner {
64
+ width: 100%;
65
+ max-width: 480px;
66
+ }
67
+
68
+ .acceptoverlay-icon {
69
+ text-align: center;
70
+ margin-bottom: $v-gap * 3;
71
+ .icon {
72
+ fill: $white;
73
+ }
74
+ }
75
+
76
+ .acceptoverlay-buttons {
77
+ background-color: transparent !important;
78
+ margin-top: $v-gap * 4;
79
+ display: flex;
80
+ justify-content: space-between;
81
+ flex-wrap: wrap;
82
+ button {
83
+ width: 100%;
84
+ &:last-child {
85
+ margin-top: $v-gap * 2;
86
+ }
87
+ }
88
+ &.single-button {
89
+ button {
90
+ margin-top: 0;
91
+ }
92
+ }
93
+ }
94
+ }
95
+ //Tablet vertical
96
+ @include media-breakpoint-up(md) {
97
+ .acceptoverlay {
98
+ padding: $v-gap * 3;
99
+ .acceptoverlay-icon {
100
+ margin-bottom: $v-gap * 6;
101
+ }
102
+ .acceptoverlay-buttons {
103
+ flex-wrap: nowrap;
104
+ button {
105
+ width: 50%;
106
+ margin-top: 0 !important;
107
+ &:last-child {
108
+ margin-left: $v-gap * 3;
109
+ }
110
+ }
111
+ &.single-button {
112
+ //text-align: center;
113
+ button {
114
+ width: auto;
115
+ min-width: 50%;
116
+ margin: 0 auto;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ //Tablet horizontal / small desktop
124
+ @include media-breakpoint-up(lg) {
125
+ .acceptoverlay {
126
+ align-items: center;
127
+ }
128
+ }
@@ -38,6 +38,9 @@ $arrow-size: $font-size-base * 0.5;
38
38
  &:before {
39
39
  color: $white;
40
40
  }
41
+ &:after {
42
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 24 24' %3E%3Cg%3E%3Cpath fill='#{url-friendly-color($white)}' d='M12,10.3l4.8,4.8c0.3,0.3,0.8,0.3,1.1,0c0.3-0.3,0.3-0.8,0-1c0,0,0,0,0,0l-4.8-4.8c-0.6-0.6-1.5-0.6-2.1,0L6.2,14c-0.3,0.3-0.3,0.8,0,1c0,0,0,0,0,0c0.3,0.3,0.8,0.3,1.1,0L12,10.3z'/%3E%3C/g%3E%3C/svg%3E");
43
+ }
41
44
  }
42
45
  }
43
46
  }
@@ -52,6 +55,9 @@ $arrow-size: $font-size-base * 0.5;
52
55
  &:before {
53
56
  color: $white;
54
57
  }
58
+ &:after {
59
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' viewBox='0 0 24 24' %3E%3Cg%3E%3Cpath fill='#{url-friendly-color($white)}' d='M12,10.3l4.8,4.8c0.3,0.3,0.8,0.3,1.1,0c0.3-0.3,0.3-0.8,0-1c0,0,0,0,0,0l-4.8-4.8c-0.6-0.6-1.5-0.6-2.1,0L6.2,14c-0.3,0.3-0.3,0.8,0,1c0,0,0,0,0,0c0.3,0.3,0.8,0.3,1.1,0L12,10.3z'/%3E%3C/g%3E%3C/svg%3E");
60
+ }
55
61
  }
56
62
  }
57
63
  }
@@ -5,7 +5,7 @@
5
5
  margin-bottom: $alert-margin-bottom;
6
6
  border: 1px solid $color-border-secondary;
7
7
  padding-left: 4em;
8
- background-color: transparent;
8
+ background-color: $white;
9
9
  border-radius: 0;
10
10
  color: $color-text-base; // UI kit
11
11
  .alert-link {
@@ -1,10 +1,15 @@
1
1
  .callout {
2
- padding: 2.5rem 2.222rem;
3
- border: 2px solid $color-border-secondary;
4
2
  position: relative;
5
3
  max-width: 60ch;
6
- margin: 1.75rem 0 1rem;
7
- border-radius: 8px;
4
+ overflow: hidden;
5
+
6
+ .callout-inner {
7
+ padding: 1.1rem 2.222rem;
8
+ border: 2px solid;
9
+ border-top: 0;
10
+ border-color: $color-border-secondary;
11
+ margin: 1.75rem 0 1rem;
12
+ }
8
13
 
9
14
  // Highlights version
10
15
  &.callout-highlight {
@@ -12,6 +17,11 @@
12
17
  border-left: 2px solid $color-border-secondary;
13
18
  border-radius: 0;
14
19
  padding: 0 2.222rem;
20
+ p {
21
+ &:last-child {
22
+ margin: 0;
23
+ }
24
+ }
15
25
  .callout-title {
16
26
  margin-bottom: 1.556rem;
17
27
  }
@@ -89,6 +99,9 @@
89
99
  // color versions
90
100
  &.success {
91
101
  border-color: $success;
102
+ .callout-inner {
103
+ border-color: rgba($success, 1);
104
+ }
92
105
  .callout-title {
93
106
  color: $success;
94
107
  .icon {
@@ -97,10 +110,19 @@
97
110
  span {
98
111
  border-color: $success;
99
112
  }
113
+ .text:after {
114
+ border-color: $success;
115
+ }
116
+ &:before {
117
+ border-color: $success;
118
+ }
100
119
  }
101
120
  }
102
121
  &.warning {
103
122
  border-color: $warning;
123
+ .callout-inner {
124
+ border-color: $color-border-warning;
125
+ }
104
126
  .callout-title {
105
127
  color: $color-text-warning;
106
128
  .icon {
@@ -113,6 +135,9 @@
113
135
  }
114
136
  &.danger {
115
137
  border-color: $danger;
138
+ .callout-inner {
139
+ border-color: rgba($danger, 1);
140
+ }
116
141
  .callout-title {
117
142
  color: $danger;
118
143
  .icon {
@@ -125,6 +150,9 @@
125
150
  }
126
151
  &.important {
127
152
  border-color: $success;
153
+ .callout-inner {
154
+ border-color: $success;
155
+ }
128
156
  .callout-title {
129
157
  color: $success;
130
158
  .icon {
@@ -137,6 +165,9 @@
137
165
  }
138
166
  &.note {
139
167
  border-color: $primary;
168
+ .callout-inner {
169
+ border-color: $primary;
170
+ }
140
171
  .callout-title {
141
172
  color: $primary;
142
173
  .icon {
@@ -185,11 +216,26 @@
185
216
  // standard title
186
217
  &:not(.callout-highlight):not(.callout-more) {
187
218
  .callout-title {
188
- position: absolute;
219
+ position: relative;
189
220
  font-size: 1rem;
190
221
  padding: 0 1.389rem;
191
- background: $white;
192
- top: -0.78em;
222
+ top: -2em;
223
+ .text:after {
224
+ content: '';
225
+ top: 0.78em;
226
+ border-top: 2px solid;
227
+ position: absolute;
228
+ width: 200%;
229
+ margin-left: calc(10px + 0.7rem);
230
+ }
231
+ &:before {
232
+ content: '';
233
+ top: 0.78em;
234
+ border-top: 2px solid;
235
+ position: absolute;
236
+ width: 3.222rem;
237
+ left: calc(-40px - 0.7rem);
238
+ }
193
239
  }
194
240
  }
195
241
 
@@ -198,9 +244,6 @@
198
244
  font-family: $font-family-serif;
199
245
  font-size: 0.889rem;
200
246
  color: $color-text-secondary; // UI kit
201
- &:last-child {
202
- margin: 0;
203
- }
204
247
  &.callout-big-text {
205
248
  font-weight: bold;
206
249
  font-size: 1.111rem;
@@ -1,3 +1,3 @@
1
1
  :root {
2
- --bootstrap-italia-version: '2.3.8';
2
+ --bootstrap-italia-version: '2.4.1';
3
3
  }
@@ -0,0 +1,40 @@
1
+ /* stylelint-disable */
2
+ @import 'video.js/src/css/video-js';
3
+ /* stylelint-enable */
4
+
5
+ .vjs-theme-bootstrap-italia {
6
+ .vjs-big-play-button {
7
+ background-color: $primary;
8
+ }
9
+ &:hover .vjs-big-play-button,
10
+ &.vjs-big-play-button:focus {
11
+ background-color: $primary;
12
+ }
13
+ .vjs-control-bar {
14
+ background-color: $primary;
15
+ font-size: 1.1em;
16
+ @include media-breakpoint-up(lg) {
17
+ min-height: 48px;
18
+ font-size: 1rem;
19
+ }
20
+ }
21
+ }
22
+
23
+ .acceptoverlay + .vjs-fluid {
24
+ min-height: 400px;
25
+ }
26
+
27
+ .vjs-transcription {
28
+ display: flex;
29
+ justify-content: center;
30
+ border: none;
31
+ .accordion-button {
32
+ border: none;
33
+ }
34
+ .accordion-item {
35
+ width: 100%;
36
+ @include media-breakpoint-up(lg) {
37
+ width: 75ch;
38
+ }
39
+ }
40
+ }
package/types/index.d.ts CHANGED
@@ -36,6 +36,7 @@ import { Tooltip } from './plugins/tooltip'
36
36
  import { TrackFocus } from './plugins/track-focus'
37
37
  import { Transfer } from './plugins/transfer'
38
38
  import { UploadDragDrop } from './plugins/upload-dragdrop'
39
+ import { loadFonts } from './plugins/fonts-loader'
39
40
 
40
41
  export {
41
42
  Alert,
@@ -77,4 +78,5 @@ export {
77
78
  TrackFocus,
78
79
  Transfer,
79
80
  UploadDragDrop,
81
+ loadFonts
80
82
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Load Bootstrap Italia fonts
3
+ * @param {string} path - the path where fonts live
4
+ */
5
+ export function loadFonts(path: string)