@nyris/nyris-webapp 0.3.62 → 0.3.63

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,14 +1,14 @@
1
1
  {
2
2
  "name": "@nyris/nyris-webapp",
3
- "version": "0.3.62",
3
+ "version": "0.3.63",
4
4
  "dependencies": {
5
5
  "@auth0/auth0-react": "^2.2.4",
6
6
  "@emailjs/browser": "^4.3.3",
7
7
  "@material-ui/core": "^4.12.4",
8
8
  "@material-ui/icons": "^4.11.3",
9
9
  "@material-ui/lab": "^4.0.0-alpha.61",
10
- "@nyris/nyris-api": "^0.3.62",
11
- "@nyris/nyris-react-components": "^0.3.62",
10
+ "@nyris/nyris-api": "^0.3.63",
11
+ "@nyris/nyris-react-components": "^0.3.63",
12
12
  "@reduxjs/toolkit": "^2.2.1",
13
13
  "@splidejs/react-splide": "^0.7.12",
14
14
  "@testing-library/jest-dom": "^5.17.0",
package/public/index.html CHANGED
@@ -21,24 +21,6 @@
21
21
  />
22
22
 
23
23
  <script src="js/settings.js?CI_COMMIT_SHA"></script>
24
- <link
25
- rel="stylesheet"
26
- href="https://cdn.jsdelivr.net/npm/@algolia/autocomplete-theme-classic"
27
- />
28
-
29
-
30
- <!-- Piwik Analytics -->
31
- <script type="text/javascript">
32
- (function(window, document, dataLayerName, id) {
33
- window[dataLayerName]=window[dataLayerName]||[],window[dataLayerName].push({start:(new Date).getTime(),event:"stg.start"});var scripts=document.getElementsByTagName('script')[0],tags=document.createElement('script');
34
- function stgCreateCookie(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+24*c*60*60*1e3),d="; expires="+e.toUTCString();f="; SameSite=Strict"}document.cookie=a+"="+b+d+f+"; path=/"}
35
- var isStgDebug=(window.location.href.match("stg_debug")||document.cookie.match("stg_debug"))&&!window.location.href.match("stg_disable_debug");stgCreateCookie("stg_debug",isStgDebug?1:"",isStgDebug?14:-1);
36
- var qP=[];dataLayerName!=="dataLayer"&&qP.push("data_layer_name="+dataLayerName),isStgDebug&&qP.push("stg_debug");var qPString=qP.length>0?("?"+qP.join("&")):"";
37
- tags.async=!0,tags.src="https://nyris.containers.piwik.pro/"+id+".js"+qPString,scripts.parentNode.insertBefore(tags,scripts);
38
- !function(a,n,i){a[n]=a[n]||{};for(var c=0;c<i.length;c++)!function(i){a[n][i]=a[n][i]||{},a[n][i].api=a[n][i].api||function(){var a=[].slice.call(arguments,0);"string"==typeof a[0]&&window[dataLayerName].push({event:n+"."+i+":"+a[0],parameters:[].slice.call(arguments,1)})}}(i[c])}(window,"ppms",["tm","cm"]);
39
- })(window, document, 'dataLayer', 'ace6a922-26e4-44b2-becf-ac94e9e5ecb4');
40
- </script>
41
- <!-- End Piwik Analytics -->
42
24
 
43
25
  <script>
44
26
  let vh = window.innerHeight * 0.01;
@@ -39,19 +39,12 @@ var settings = {
39
39
  logoWidth: '',
40
40
  primaryColor: '',
41
41
  secondaryColor: '',
42
- CTAButtonColor: '',
43
- CTAButtonTextColor: '',
44
- secondaryCTAButtonColor: '',
45
- mainTextColor: '',
46
- brandFieldBackground: '',
47
- brandFieldPadding: '',
48
42
  },
49
43
  // Card Results
50
44
  mainTitle: '',
51
45
  secondaryTitle: '',
46
+ productDetails: 'keyword_1',
52
47
  attributes: {
53
- productAttributes: true,
54
- labelsAttributes: true,
55
48
  attributeOneLabelValue: '',
56
49
  attributeOneValue: '',
57
50
  attributeTwoLabelValue: '',
@@ -67,7 +60,6 @@ var settings = {
67
60
  secondaryCTAButtonTextColor: '',
68
61
  secondaryCTAButtonColor: '',
69
62
  secondaryCTAIcon: '',
70
- secondaryCTAIconSource: '',
71
63
  secondaryCTALinkField: '',
72
64
  },
73
65
  CTAButton: {
@@ -76,13 +68,8 @@ var settings = {
76
68
  CTAButtonTextColor: '',
77
69
  CTAButtonColor: '',
78
70
  CTAIcon: '',
79
- CTAIconSource: '',
80
71
  CTALinkField: '',
81
72
  },
82
- //field mappins
83
- field: {
84
- productDetails: 'keyword_1',
85
- },
86
73
  language: 'en',
87
74
  // features
88
75
  showPoweredByNyris: '',
@@ -90,6 +77,10 @@ var settings = {
90
77
  preFilterOption: '',
91
78
  experienceVisualSearch: false,
92
79
  experienceVisualSearchImages: [],
80
+ simpleCardView: false,
81
+ clarityId: '',
82
+ noSimilarSearch: false,
83
+ showFeedback: false,
93
84
  rfq: {
94
85
  enabled: '',
95
86
  emailTemplateId: '',
@@ -108,14 +99,8 @@ var settings = {
108
99
  },
109
100
  //UI - labels
110
101
  appTitle: '',
111
- brandName: '',
112
102
  headerText: '',
113
103
  preFilterTitle: '',
114
- CTAButtonText: 'View More',
115
- simpleCardView: false,
116
- secondaryCTAButtonText: 'Configure Now',
117
- clarityId: '',
118
- noSimilarSearch: false,
119
104
  };
120
105
  settings['customSearchRequest'] = null;
121
106
  settings['responseHook'] = null;
@@ -26,7 +26,5 @@ export const defaultSettings: AppSettings = {
26
26
  mainTitle: '',
27
27
  secondaryTitle: '',
28
28
  theme: {},
29
- field: {
30
- productDetails: '',
31
- },
29
+ productDetails: '',
32
30
  };
@@ -98,13 +98,13 @@ function ProductDetailView(props: Props) {
98
98
  setDataImageCarouSel(valueKey);
99
99
  };
100
100
  const productDetails = useMemo(() => {
101
- const details = get(dataItem, settings.field.productDetails);
101
+ const details = get(dataItem, settings.productDetails);
102
102
  try {
103
103
  return details.join(', ');
104
104
  } catch (e) {
105
105
  return details;
106
106
  }
107
- }, [dataItem, settings.field.productDetails]);
107
+ }, [dataItem, settings.productDetails]);
108
108
 
109
109
  return (
110
110
  <div
@@ -316,7 +316,7 @@ function ProductDetailView(props: Props) {
316
316
  <Typography
317
317
  className="text-f16 max-line-1 fw-700"
318
318
  style={{
319
- color: settings.theme.mainTextColor || '#2B2C46',
319
+ color: '#2B2C46',
320
320
  fontFamily: 'Source Sans 3',
321
321
  fontSize: '16px',
322
322
  lineHeight: '22.78px',
@@ -337,7 +337,7 @@ function ProductDetailView(props: Props) {
337
337
  <Typography
338
338
  className="text-f14 max-line-1 fw-400"
339
339
  style={{
340
- color: settings.theme.mainTextColor || '#2B2C46',
340
+ color: '#2B2C46',
341
341
  width: 'fit-content',
342
342
  marginLeft: 8,
343
343
  fontSize: 14,
@@ -357,36 +357,36 @@ function ProductDetailView(props: Props) {
357
357
  <ProductAttribute
358
358
  title={settings.attributes?.attributeOneLabelValue}
359
359
  value={get(dataItem, settings.attributes?.attributeOneValue || '')}
360
- padding={settings.theme.brandFieldPadding || '4px 8px'}
361
- backgroundColor={settings.theme.brandFieldBackground}
362
- isTitleVisible={settings.attributes?.labelsAttributes}
360
+ padding={'4px 8px'}
361
+ backgroundColor={'#E0E0E0'}
362
+ isTitleVisible={!!settings.attributes?.attributeOneLabelValue}
363
363
  />
364
364
  )}
365
365
  {!!get(dataItem, settings.attributes?.attributeTwoValue || '') && (
366
366
  <ProductAttribute
367
367
  title={settings.attributes?.attributeTwoLabelValue}
368
368
  value={get(dataItem, settings.attributes?.attributeTwoValue || '')}
369
- padding={settings.theme.brandFieldPadding || '4px 8px'}
370
- backgroundColor={settings.theme.brandFieldBackground}
371
- isTitleVisible={settings.attributes?.labelsAttributes}
369
+ padding={'4px 8px'}
370
+ backgroundColor={'#E0E0E0'}
371
+ isTitleVisible={!!settings.attributes?.attributeTwoLabelValue}
372
372
  />
373
373
  )}
374
374
  {!!get(dataItem, settings.attributes?.attributeThreeValue || '') && (
375
375
  <ProductAttribute
376
376
  title={settings.attributes?.attributeThreeLabelValue}
377
377
  value={get(dataItem, settings.attributes?.attributeThreeValue || '')}
378
- padding={settings.theme.brandFieldPadding || '4px 8px'}
379
- backgroundColor={settings.theme.brandFieldBackground}
380
- isTitleVisible={settings.attributes?.labelsAttributes}
378
+ padding={'4px 8px'}
379
+ backgroundColor={'#E0E0E0'}
380
+ isTitleVisible={!!settings.attributes?.attributeThreeLabelValue}
381
381
  />
382
382
  )}
383
383
  {!!get(dataItem, settings.attributes?.attributeFourValue || '') && (
384
384
  <ProductAttribute
385
385
  title={settings.attributes?.attributeFourLabelValue}
386
386
  value={get(dataItem, settings.attributes?.attributeFourValue || '')}
387
- padding={settings.theme.brandFieldPadding || '4px 8px'}
388
- backgroundColor={settings.theme.brandFieldBackground}
389
- isTitleVisible={settings.attributes?.labelsAttributes}
387
+ padding={'4px 8px'}
388
+ backgroundColor={'#E0E0E0'}
389
+ isTitleVisible={!!settings.attributes?.attributeFourLabelValue}
390
390
  />
391
391
  )}
392
392
  </div>
@@ -530,7 +530,7 @@ function ProductDetailView(props: Props) {
530
530
  className="w-100 button-hover"
531
531
  style={{
532
532
  backgroundColor: '#F3F3F5',
533
- color: settings.theme.mainTextColor || '#2b2c46',
533
+ color: '#2b2c46',
534
534
  display: 'flex',
535
535
  fontSize: 14,
536
536
  justifyContent: 'space-between',
@@ -559,7 +559,7 @@ function ProductDetailView(props: Props) {
559
559
  padding: 5,
560
560
  paddingLeft: 15,
561
561
  paddingRight: 15,
562
- color: settings.theme.mainTextColor || '#2b2c46',
562
+ color: '#2b2c46',
563
563
  }}
564
564
  >
565
565
  {productDetails}
@@ -241,7 +241,7 @@ function ItemResult(props: Props) {
241
241
  display: 'flex',
242
242
  justifyContent: 'space-between',
243
243
  flexDirection: 'column',
244
- color: settings.theme.mainTextColor || '#2B2C46',
244
+ color: '#2B2C46',
245
245
  }}
246
246
  >
247
247
  <div
@@ -259,7 +259,7 @@ function ItemResult(props: Props) {
259
259
  <Typography
260
260
  className="text-f12 max-line-1 fw-700"
261
261
  style={{
262
- color: settings.theme.mainTextColor || '#2B2C46',
262
+ color: '#2B2C46',
263
263
  marginBottom: 4,
264
264
  marginLeft: 8,
265
265
  }}
@@ -274,7 +274,7 @@ function ItemResult(props: Props) {
274
274
  display: 'flex',
275
275
  justifyContent: 'space-between',
276
276
  flexDirection: 'row',
277
- color: settings.theme.mainTextColor || '#2B2C46',
277
+ color: '#2B2C46',
278
278
  }}
279
279
  >
280
280
  <Tooltip
@@ -286,7 +286,7 @@ function ItemResult(props: Props) {
286
286
  <Typography
287
287
  className="text-f10 max-line-1 fw-400"
288
288
  style={{
289
- color: settings.theme.mainTextColor || '#2B2C46',
289
+ color: '#2B2C46',
290
290
  marginBottom: 8,
291
291
  marginLeft: 8,
292
292
  }}
@@ -314,43 +314,43 @@ function ItemResult(props: Props) {
314
314
  flexWrap: 'wrap',
315
315
  marginBottom: settings.CTAButton?.CTAButton || settings.secondaryCTAButton?.secondaryCTAButton ? 8 : 0,
316
316
  gridGap: 8,
317
- color: settings.theme.mainTextColor || '#2B2C46',
317
+ color: '#2B2C46',
318
318
  }}
319
319
  >
320
320
  {!!get(dataItem, settings.attributes?.attributeOneValue || '') && (
321
321
  <ProductAttribute
322
322
  title={settings.attributes?.attributeOneLabelValue}
323
323
  value={get(dataItem, settings.attributes?.attributeOneValue || '')}
324
- padding={settings.theme.brandFieldPadding || '4px 8px'}
325
- backgroundColor={settings.theme.brandFieldBackground}
326
- isTitleVisible={settings.attributes?.labelsAttributes}
324
+ padding={'4px 8px'}
325
+ backgroundColor={'#E0E0E0'}
326
+ isTitleVisible={!!settings.attributes?.attributeOneLabelValue}
327
327
  />
328
328
  )}
329
329
  {!!get(dataItem, settings.attributes?.attributeTwoValue || '') && (
330
330
  <ProductAttribute
331
331
  title={settings.attributes?.attributeTwoLabelValue}
332
332
  value={get(dataItem, settings.attributes?.attributeTwoValue || '')}
333
- padding={settings.theme.brandFieldPadding || '4px 8px'}
334
- backgroundColor={settings.theme.brandFieldBackground}
335
- isTitleVisible={settings.attributes?.labelsAttributes}
333
+ padding={'4px 8px'}
334
+ backgroundColor={'#E0E0E0'}
335
+ isTitleVisible={!!settings.attributes?.attributeTwoLabelValue}
336
336
  />
337
337
  )}
338
338
  {!!get(dataItem, settings.attributes?.attributeThreeValue || '') && (
339
339
  <ProductAttribute
340
340
  title={settings.attributes?.attributeThreeLabelValue}
341
341
  value={get(dataItem, settings.attributes?.attributeThreeValue || '')}
342
- padding={settings.theme.brandFieldPadding || '4px 8px'}
343
- backgroundColor={settings.theme.brandFieldBackground}
344
- isTitleVisible={settings.attributes?.labelsAttributes}
342
+ padding={'4px 8px'}
343
+ backgroundColor={'#E0E0E0'}
344
+ isTitleVisible={!!settings.attributes?.attributeThreeLabelValue}
345
345
  />
346
346
  )}
347
347
  {!!get(dataItem, settings.attributes?.attributeFourValue || '') && (
348
348
  <ProductAttribute
349
349
  title={settings.attributes?.attributeFourLabelValue}
350
350
  value={get(dataItem, settings.attributes?.attributeFourValue || '')}
351
- padding={settings.theme.brandFieldPadding || '4px 8px'}
352
- backgroundColor={settings.theme.brandFieldBackground}
353
- isTitleVisible={settings.attributes?.labelsAttributes}
351
+ padding={'4px 8px'}
352
+ backgroundColor={'#E0E0E0'}
353
+ isTitleVisible={!!settings.attributes?.attributeFourLabelValue}
354
354
  />
355
355
  )}
356
356
  </div>
package/src/types.ts CHANGED
@@ -55,7 +55,6 @@ interface SecondaryCTAButton {
55
55
 
56
56
  interface Attributes {
57
57
  productAttributes?: boolean,
58
- labelsAttributes?: boolean,
59
58
  attributeOneLabelValue?: string,
60
59
  attributeOneValue?: string,
61
60
  attributeTwoLabelValue?: string,
@@ -75,13 +74,13 @@ export interface AppSettings extends NyrisAPISettings {
75
74
  cadenas?: Cadenas;
76
75
  clarityId?: string;
77
76
  mainTitle: string,
77
+ productDetails: string;
78
78
  secondaryTitle: string,
79
79
  CTAButton?: CTAButtonSettings;
80
80
  secondaryCTAButton?: SecondaryCTAButton;
81
81
  attributes?: Attributes;
82
82
  experienceVisualSearch?: boolean;
83
83
  experienceVisualSearchImages?: string[];
84
- field: Field;
85
84
  headerText?: string;
86
85
  instantRedirectPatterns: string[];
87
86
  isBrandNameTitleVisible?: boolean;
@@ -117,9 +116,6 @@ export interface SearchSuiteSettings {
117
116
  mobileFooterImageColor?: string;
118
117
  primaryColor?: string;
119
118
  secondaryColor?: string;
120
- mainTextColor?: string;
121
- brandFieldBackground?: string;
122
- brandFieldPadding?: string;
123
119
  }
124
120
 
125
121
  export type AppState = {