project-booster-vue 9.45.1 → 9.46.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "9.45.1",
3
+ "version": "9.46.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -9,6 +9,7 @@
9
9
  :role="!buttonLabel ? 'button' : 'article'"
10
10
  :style="`min-height: ${cardMinHeight}; border-color:${borderTop ? borderTop : null}`"
11
11
  @click="handleCardClick"
12
+ :data-cerberus="sanitizeCerberusAttribut('PB-CARD', answerCode)"
12
13
  >
13
14
  <m-flex
14
15
  class="pb-card__container"
@@ -119,6 +120,7 @@ import PbCardSelectionIndicator from './decorators/PbCardSelectionIndicator.vue'
119
120
  import PbCardTypeIndicator from './decorators/PbCardTypeIndicator.vue';
120
121
  import { M_FLEX_VALIDATOR } from '../mozaic/flex/MFlex.vue';
121
122
  import MLink from '../mozaic/link/MLink.vue';
123
+ import { sanitizeCerberusAttribut } from '@/services/sanitize';
122
124
 
123
125
  export const PB_CARD_VALIDATOR = {
124
126
  cardMinRatio: ['auto', '16x9', '3x2', '4x3', '1x1', '3x4', '2x3'],
@@ -316,6 +318,13 @@ export default defineComponent({
316
318
  type: String,
317
319
  default: null,
318
320
  },
321
+ /**
322
+ * Get the answer code
323
+ */
324
+ answerCode: {
325
+ type: String,
326
+ default: null,
327
+ },
319
328
  },
320
329
 
321
330
  computed: {
@@ -350,6 +359,7 @@ export default defineComponent({
350
359
  */
351
360
  this.$emit('button-click', { label: this.buttonLabel });
352
361
  },
362
+ sanitizeCerberusAttribut,
353
363
  },
354
364
  });
355
365
  </script>
@@ -99,10 +99,10 @@ export default defineComponent({
99
99
  $responsive-breakpoint: 'm';
100
100
 
101
101
  .pb-carousel {
102
- margin: 0 -$mu100 0 0;
102
+ margin: 0 - $mu100 0 0;
103
103
 
104
104
  @include set-from-screen($responsive-breakpoint) {
105
- margin: 0 -$mu100;
105
+ margin: 0 - $mu100;
106
106
  }
107
107
 
108
108
  :deep(.pb-carousel__slider.hooper) {
@@ -490,7 +490,7 @@ $responsive-breakpoint: 'l';
490
490
  }
491
491
 
492
492
  :deep(.pb-media__sticky-upload-button) {
493
- margin: 0 -$mu100;
493
+ margin: 0 - $mu100;
494
494
  width: calc(100% + 2 * #{$mu100});
495
495
 
496
496
  @include set-from-screen('m') {
@@ -281,6 +281,7 @@ $responsive-breakpoint: 'm';
281
281
  right: 0;
282
282
  top: 0;
283
283
  width: 100vw;
284
+ z-index: 999;
284
285
  }
285
286
 
286
287
  &__container--overlay {
@@ -1457,7 +1457,7 @@ $appear-duration: 100ms;
1457
1457
  width: calc(100% + 2 * #{$mu050});
1458
1458
 
1459
1459
  @include set-from-screen($responsive-breakpoint) {
1460
- margin: 0 #{-$mu100};
1460
+ margin: 0 #{- $mu100};
1461
1461
  width: calc(100% + 2 * #{$mu100});
1462
1462
  }
1463
1463
 
@@ -1453,7 +1453,7 @@ $appear-duration: 100ms;
1453
1453
  width: calc(100% + 2 * #{$mu050});
1454
1454
 
1455
1455
  @include set-from-screen($responsive-breakpoint) {
1456
- margin: 0 #{-$mu100};
1456
+ margin: 0 #{- $mu100};
1457
1457
  width: calc(100% + 2 * #{$mu100});
1458
1458
  }
1459
1459
 
@@ -71,6 +71,7 @@
71
71
  <component
72
72
  :is="payload.viewModel.answersComponent"
73
73
  v-if="payload.viewModel.answersComponent !== 'MButton'"
74
+ :answer-code="answer.code"
74
75
  class="pb-question__answer__component"
75
76
  :border-top="answer?.viewModel?.borderColor || null"
76
77
  :image="decorate(answers, runtimeOptions, answer?.viewModel?.image, payload.defaultDecoratorValue)"
@@ -464,7 +464,7 @@ $slide-animation-duration: 0.15s;
464
464
  }
465
465
  }
466
466
 
467
- @media screen and (min-color-index: 0) and(-webkit-min-device-pixel-ratio: 0) {
467
+ @media screen and (min-color-index: 0) and (-webkit-min-device-pixel-ratio: 0) {
468
468
  /* Safari */
469
469
  .pb-restitution {
470
470
  display: block !important;
@@ -844,7 +844,7 @@ $slide-sticky-bottom-animation-delay: $slide-animation-duration + 0.45s;
844
844
  }
845
845
  }
846
846
 
847
- @media screen and (min-color-index: 0) and(-webkit-min-device-pixel-ratio: 0) {
847
+ @media screen and (min-color-index: 0) and (-webkit-min-device-pixel-ratio: 0) {
848
848
  /* Safari */
849
849
  .pb-scenario {
850
850
  display: block !important;
@@ -67,6 +67,7 @@
67
67
  v-for="action in payload.callToActions"
68
68
  :key="action.label"
69
69
  @click="callAction(action.action)"
70
+ :data-cerberus="sanitizeCerberusAttribut('PB-WARNING-BUTTON', action.action.code)"
70
71
  />
71
72
  </m-flex>
72
73
  </div>
@@ -109,6 +110,7 @@ import SVGInjector from 'svg-injector';
109
110
  import { WarningMessagePayloadAction } from '@/types/pb/WarningMessage';
110
111
  import { DialogContent } from './dialogContent';
111
112
  import { string } from 'yup';
113
+ import { sanitizeCerberusAttribut } from '@/services/sanitize';
112
114
  const BACK_ICON =
113
115
  'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
114
116
  const WARNING_ICON =
@@ -233,6 +235,7 @@ export default defineComponent({
233
235
  displayDialogHelp,
234
236
  handleHelpDialog,
235
237
  dialogHelpContent,
238
+ sanitizeCerberusAttribut,
236
239
  };
237
240
  },
238
241
  });
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Sanitize cerberus data attribut
3
+ * @param field
4
+ * @param type
5
+ * @returns
6
+ */
7
+ export const sanitizeCerberusAttribut = (field: string, type: string) => {
8
+ if (type) {
9
+ type = slugifyTypeAttribut(type);
10
+ return field.toUpperCase() + '--' + type.toUpperCase();
11
+ } else {
12
+ return field;
13
+ }
14
+ };
15
+
16
+ /**
17
+ * Slugify type of attribut
18
+ * @param type
19
+ * @returns
20
+ */
21
+ export const slugifyTypeAttribut = (type: string) => {
22
+ return type
23
+ .toLowerCase()
24
+ .trim()
25
+ .replace(/[^\w\s-]/g, '')
26
+ .replace(/[\s_-]+/g, '-')
27
+ .replace(/^-+|-+$/g, '');
28
+ };