@nyris/nyris-webapp 0.3.33 → 0.3.35

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 (83) hide show
  1. package/build/asset-manifest.json +28 -14
  2. package/build/index.html +1 -1
  3. package/build/js/settings.example.js +13 -25
  4. package/build/{precache-manifest.4cff5b8aafe3d00d59bc2c9725eb6ade.js → precache-manifest.375ac411683570ee1df5aea6de03409d.js} +70 -14
  5. package/build/service-worker.js +1 -1
  6. package/build/static/css/main.f5a1c730.chunk.css +2 -0
  7. package/build/static/css/main.f5a1c730.chunk.css.map +1 -0
  8. package/build/static/js/2.724f4cba.chunk.js +3 -0
  9. package/build/static/js/2.724f4cba.chunk.js.map +1 -0
  10. package/build/static/js/main.f579fa9f.chunk.js +3 -0
  11. package/build/static/js/main.f579fa9f.chunk.js.map +1 -0
  12. package/build/static/media/filter.bc412f08.svg +3 -0
  13. package/build/static/media/icon_search_image2.fab34be4.svg +3 -0
  14. package/build/static/media/img-1-1.6144e5f9.png +0 -0
  15. package/build/static/media/img-1-2.ad943f0f.png +0 -0
  16. package/build/static/media/img2-1.a87c79c7.png +0 -0
  17. package/build/static/media/img2-2.39c5b73f.png +0 -0
  18. package/build/static/media/img3-1.443b0c3a.png +0 -0
  19. package/build/static/media/img3-2.37db7999.png +0 -0
  20. package/build/static/media/img4-1.9c34c158.png +0 -0
  21. package/build/static/media/img4-2.9d280a04.png +0 -0
  22. package/build/static/media/img5-1.b61dbd4d.png +0 -0
  23. package/build/static/media/img5-2.1c77c093.png +0 -0
  24. package/build/static/media/img6-1.8b03dd21.png +0 -0
  25. package/build/static/media/img6-2.1e3e7fed.png +0 -0
  26. package/build/static/media/{info-tooltip.5feeef22.svg → info-tooltip.b98e8a9c.svg} +2 -2
  27. package/build/static/media/take_photo.76423216.svg +5 -0
  28. package/package.json +3 -3
  29. package/public/js/settings.example.js +13 -25
  30. package/src/Store/constants.ts +0 -1
  31. package/src/Store/search/Search.ts +32 -17
  32. package/src/Store/search/search.initialState.ts +17 -16
  33. package/src/Store/search/types.ts +15 -14
  34. package/src/common/assets/icons/expand.svg +3 -27
  35. package/src/common/assets/icons/filter.svg +3 -0
  36. package/src/common/assets/icons/icon_search_image2.svg +2 -25
  37. package/src/common/assets/icons/info-tooltip.svg +2 -2
  38. package/src/common/assets/icons/take_photo.svg +5 -0
  39. package/src/common/assets/images/imageCaptureHelp/img-1-1.png +0 -0
  40. package/src/common/assets/images/imageCaptureHelp/img-1-2.png +0 -0
  41. package/src/common/assets/images/imageCaptureHelp/img2-1.png +0 -0
  42. package/src/common/assets/images/imageCaptureHelp/img2-2.png +0 -0
  43. package/src/common/assets/images/imageCaptureHelp/img3-1.png +0 -0
  44. package/src/common/assets/images/imageCaptureHelp/img3-2.png +0 -0
  45. package/src/common/assets/images/imageCaptureHelp/img4-1.png +0 -0
  46. package/src/common/assets/images/imageCaptureHelp/img4-2.png +0 -0
  47. package/src/common/assets/images/imageCaptureHelp/img5-1.png +0 -0
  48. package/src/common/assets/images/imageCaptureHelp/img5-2.png +0 -0
  49. package/src/common/assets/images/imageCaptureHelp/img6-1.png +0 -0
  50. package/src/common/assets/images/imageCaptureHelp/img6-2.png +0 -0
  51. package/src/components/DetailItem.tsx +62 -78
  52. package/src/components/FooterMobile.tsx +80 -41
  53. package/src/components/HeaderMobile.tsx +225 -227
  54. package/src/components/ImageCaptureHelpModal.tsx +90 -0
  55. package/src/components/Layout.tsx +39 -9
  56. package/src/components/MobilePostFilter.tsx +20 -0
  57. package/src/components/PanelResult/expandable-panel.tsx +21 -21
  58. package/src/components/PanelResult/index.tsx +52 -19
  59. package/src/components/ProductList/index.tsx +5 -3
  60. package/src/components/appMobile.scss +64 -32
  61. package/src/components/carousel/ImagePreviewCarousel.tsx +2 -8
  62. package/src/components/drawer/cameraCustom.tsx +8 -33
  63. package/src/components/input/inputSearch.tsx +68 -80
  64. package/src/components/pre-filter/index.tsx +70 -57
  65. package/src/components/results/ItemResult.tsx +73 -89
  66. package/src/constants.ts +56 -0
  67. package/src/page/landingPage/AppMobile.tsx +34 -104
  68. package/src/page/landingPage/common.scss +167 -38
  69. package/src/page/result/index.tsx +70 -56
  70. package/src/services/Feedback.ts +20 -2
  71. package/src/services/types.ts +0 -1
  72. package/src/translations.ts +4 -0
  73. package/src/types.ts +3 -2
  74. package/build/static/css/main.d0b21fa5.chunk.css +0 -2
  75. package/build/static/css/main.d0b21fa5.chunk.css.map +0 -1
  76. package/build/static/js/2.69ce0823.chunk.js +0 -3
  77. package/build/static/js/2.69ce0823.chunk.js.map +0 -1
  78. package/build/static/js/main.6122377b.chunk.js +0 -3
  79. package/build/static/js/main.6122377b.chunk.js.map +0 -1
  80. package/build/static/media/icon_search_image2.e46fdfc5.svg +0 -26
  81. package/src/hooks/useVisualSearch.tsx +0 -77
  82. /package/build/static/js/{2.69ce0823.chunk.js.LICENSE.txt → 2.724f4cba.chunk.js.LICENSE.txt} +0 -0
  83. /package/build/static/js/{main.6122377b.chunk.js.LICENSE.txt → main.f579fa9f.chunk.js.LICENSE.txt} +0 -0
@@ -457,6 +457,17 @@ button {
457
457
  right: 16px;
458
458
  z-index: 9;
459
459
 
460
+ border-radius: 100%;
461
+ background-color: #F3F3F5;
462
+ display: block;
463
+ overflow: hidden;
464
+ z-index: 11;
465
+ width: 48px;
466
+ height: 48px;
467
+ display: flex;
468
+ align-items: center;
469
+ justify-content: center;
470
+
460
471
  @media only screen and (max-width: 776px) {
461
472
  bottom: 50px;
462
473
  }
@@ -587,23 +598,20 @@ button {
587
598
  }
588
599
  }
589
600
  .box-icon-modal {
590
- bottom: -2px;
601
+ bottom: 6px;
591
602
  right: 6px;
592
603
  position: absolute;
593
604
  border-radius: 100%;
594
- filter: drop-shadow(0px 0px 2.66667px rgba(85, 86, 107, 0.502974));
605
+ background-color: #F3F3F5;
595
606
  display: block;
596
607
  overflow: hidden;
597
608
  z-index: 11;
598
- span {
599
- display: block;
600
- img {
601
- padding: 0px;
602
- }
603
- }
604
- button {
605
- padding: 0px;
606
- }
609
+ width: 32px;
610
+ height: 32px;
611
+ display: flex;
612
+ align-items: center;
613
+ justify-content: center;
614
+ cursor: pointer;
607
615
  }
608
616
  .box-image {
609
617
  text-align: center;
@@ -783,7 +791,7 @@ button {
783
791
  justify-content: space-between;
784
792
  align-items: center;
785
793
  height: 100%;
786
- background: #fff;
794
+ background: #FAFAFA;
787
795
  .box-content_top {
788
796
  width: 100%;
789
797
  // min-height: calc(100% - 341px);
@@ -960,16 +968,12 @@ button {
960
968
  }
961
969
  }
962
970
  .box-result {
963
- height: calc(100svh - 190px);
971
+ height: calc(100svh - 199px);
964
972
  display: flex;
965
973
  justify-content: space-between;
966
974
  // overflow: auto;
967
975
  position: relative;
968
- @media screen and (max-width: 776px) {
969
- padding-top: 50px;
970
- padding-bottom: 50px;
971
-
972
- }
976
+
973
977
  .btn-open-support {
974
978
  background: linear-gradient(45deg, #3e36dc 14.84%, #00ff94 85.16%);
975
979
  width: 50px;
@@ -1000,9 +1004,7 @@ button {
1000
1004
  }
1001
1005
  .box-title_col-left {
1002
1006
  position: absolute;
1003
- bottom: 5px;
1004
- left: 0;
1005
- right: 0;
1007
+ top: 50%;
1006
1008
  margin: auto;
1007
1009
  width: fit-content;
1008
1010
  background-color: #3E36DC;
@@ -1025,7 +1027,6 @@ button {
1025
1027
  align-items: center;
1026
1028
  max-width: 320px;
1027
1029
  .box-preview {
1028
- padding-top: 32px;
1029
1030
  width: 100%;
1030
1031
  // border: 2px dashed #55566b;
1031
1032
  display: flex;
@@ -1034,10 +1035,7 @@ button {
1034
1035
  height: 100%;
1035
1036
  position: relative;
1036
1037
  // transition: ease-in-out 0.5s;
1037
- @media only screen and (max-width: 776px) {
1038
- padding-bottom: 32px;
1039
-
1040
- }
1038
+
1041
1039
  .preview-item {
1042
1040
  // height: 100%;
1043
1041
  display: flex;
@@ -1332,7 +1330,6 @@ button {
1332
1330
  justify-content: center;
1333
1331
  align-items: center;
1334
1332
  height: calc(100% - 170px);
1335
- background: #fafafa;
1336
1333
  .box-content {
1337
1334
  width: 242px;
1338
1335
  span {
@@ -1816,15 +1813,16 @@ button {
1816
1813
  z-index: 11;
1817
1814
  position: relative;
1818
1815
  height: 100%;
1819
- padding: 0 4px;
1820
- border-radius: 21px;
1816
+ padding-right: 4px;
1817
+ border-radius: 4px;
1818
+ margin-left: 8px;
1821
1819
  justify-content: space-between;
1822
1820
  align-items: center;
1823
1821
  min-width: 60px;
1824
1822
  img {
1825
- width: 25px;
1826
- height: 22px;
1827
- border-radius: 100%;
1823
+ width: 35px;
1824
+ height: 100%;
1825
+ // border-radius: 100%;
1828
1826
  }
1829
1827
  button {
1830
1828
  display: flex;
@@ -1958,12 +1956,12 @@ button {
1958
1956
  }
1959
1957
  }
1960
1958
 
1961
- .wrap-filter-destop {
1959
+ .wrap-filter-desktop {
1962
1960
 
1963
-
1964
- .box-filter-destop {
1961
+ .box-filter-desktop {
1965
1962
  background-color: #fff;
1966
- width: 70%;
1963
+ width: 90%;
1964
+ max-width: 1500px;
1967
1965
  height: 80%;
1968
1966
  margin: auto;
1969
1967
  &.isMobile {
@@ -1973,6 +1971,11 @@ button {
1973
1971
  background-color: #fff;
1974
1972
  width: 100%;
1975
1973
  height: 100%;
1974
+ padding: 10px 24px 24px 24px;
1975
+ @media only screen and (max-width: 776px) {
1976
+ height: fit-content;
1977
+ padding-bottom: 56px;
1978
+ }
1976
1979
  .box-top {
1977
1980
  padding: 24px 16px;
1978
1981
  .box-input-search-filter {
@@ -1999,13 +2002,12 @@ button {
1999
2002
  }
2000
2003
  }
2001
2004
  .box-bottom {
2002
- column-gap: 30px;
2005
+ column-gap: 20px;
2003
2006
  padding: 0px 20px;
2004
2007
  flex-wrap: wrap;
2005
2008
  width: 100%;
2006
2009
  max-width: 100%;
2007
2010
  height: fit-content;
2008
- background-color: #fafafa;
2009
2011
  overflow-y: auto;
2010
2012
  .box-group-items {
2011
2013
  margin-top: 20px;
@@ -2102,4 +2104,131 @@ button {
2102
2104
  &::-webkit-scrollbar-thumb:hover {
2103
2105
  background: #555;
2104
2106
  }
2107
+ }
2108
+
2109
+
2110
+ .wrap-input-search-field {
2111
+ width: 512px;
2112
+ height: 48px;
2113
+ .box-input-search {
2114
+ justify-content: space-between;
2115
+ box-shadow: 0px 2px 12px rgba(43, 44, 70, 0.13);;
2116
+ background-color: #fff;
2117
+ border-radius: 24px;
2118
+ padding: 0px !important;
2119
+ height: 48px;
2120
+ overflow: hidden;
2121
+ padding-right: 12px !important;
2122
+ form {
2123
+ width: 100%;
2124
+ display: flex;
2125
+ justify-content: center;
2126
+ align-items: center;
2127
+ .box-inp {
2128
+ input {
2129
+ background-color: #fff;
2130
+ }
2131
+ .pre-filter-icon {
2132
+ display: flex;
2133
+ width: 60px;
2134
+ height: 100%;
2135
+ justify-content: center;
2136
+ align-items: center;
2137
+ border-right: 1px solid rgb(224, 224, 224);
2138
+ background: rgb(250, 250, 250);
2139
+ cursor: pointer;
2140
+ }
2141
+ .box-key-filter {
2142
+ padding: 8px;
2143
+ background-color: #E0E0E0;
2144
+ border-radius: 42px;
2145
+ min-width: fit-content;
2146
+ display: flex;
2147
+ align-items: center;
2148
+ height: 75%;
2149
+ margin-left: 5px;
2150
+ p {
2151
+ font-size: 14px;
2152
+ font-size: 700;
2153
+ color: #2B2C46;
2154
+ }
2155
+ }
2156
+
2157
+ position: relative;
2158
+ display: flex;
2159
+ justify-content: center;
2160
+ align-items: center;
2161
+ width: 100%;
2162
+ height: 100%;
2163
+ .icon-search {
2164
+ display: flex;
2165
+ // position: absolute;
2166
+ // left: 12px;
2167
+ // top: 0;
2168
+ bottom: 0;
2169
+ margin: auto;
2170
+ order: 0;
2171
+ }
2172
+ }
2173
+ }
2174
+ .input-search {
2175
+ // padding: 0 6px;
2176
+ // padding-left: 40px;
2177
+ padding-left: 6px;
2178
+ order: 2;
2179
+ width: 100%;
2180
+ border: 0px !important;
2181
+ &::placeholder {
2182
+ font-size: 14px !important;
2183
+ color: #AAABB5 !important;
2184
+ font-weight: 500 !important;
2185
+ }
2186
+ &::-webkit-search-cancel-button {
2187
+ position: relative;
2188
+ right: 20px;
2189
+
2190
+ -webkit-appearance: none;
2191
+ height: 20px;
2192
+ width: 20px;
2193
+ border-radius: 10px;
2194
+ background: red;
2195
+ }
2196
+ &:focus-visible {
2197
+ outline: none !important;
2198
+ }
2199
+ &::before,
2200
+ &::after {
2201
+ display: none !important;
2202
+ }
2203
+ }
2204
+ .btn-clear-text {
2205
+ width: 32px;
2206
+ height: 32px;
2207
+ border-radius: 100%;
2208
+ z-index: 10;
2209
+ cursor: pointer !important;
2210
+ margin-right: 8px;
2211
+
2212
+ &:after {
2213
+ content: "";
2214
+ font-size: 39px;
2215
+ position: absolute;
2216
+ right: -3px;
2217
+ font-weight: 100;
2218
+ background-color: #E0E0E0;
2219
+ width: 1px;
2220
+ height: 35px;
2221
+ }
2222
+ }
2223
+ }
2224
+ }
2225
+
2226
+ .icon-hover {
2227
+ padding: 8px;
2228
+ border-radius: 100%;
2229
+ display: flex;
2230
+ &:hover {
2231
+ background-color: #0000000a;
2232
+ }
2233
+
2105
2234
  }
@@ -30,7 +30,7 @@ import {
30
30
  } from 'react-instantsearch-dom';
31
31
  import { useMediaQuery } from 'react-responsive';
32
32
  import { Link } from 'react-router-dom';
33
- import { feedbackClickEpic, feedbackSuccessEpic } from 'services/Feedback';
33
+ import { feedbackRegionEpic, feedbackSuccessEpic } from 'services/Feedback';
34
34
  import { createImage, findByImage, findRegions } from 'services/image';
35
35
  import { showFeedback, showResults } from 'Store/nyris/Nyris';
36
36
  import {
@@ -92,7 +92,7 @@ function ResultComponent(props: Props) {
92
92
  setAdjustInfo(true);
93
93
  const timeout = setTimeout(() => {
94
94
  setAdjustInfo(false);
95
- }, 4000);
95
+ }, 2000);
96
96
  imageUploadRef.current = imageThumbSearchInput;
97
97
  return () => {
98
98
  clearTimeout(timeout);
@@ -161,7 +161,7 @@ function ResultComponent(props: Props) {
161
161
  }
162
162
  setTimeout(() => {
163
163
  setShowAdjustInfoBasedOnConfidence(false);
164
- }, 4000);
164
+ }, 2000);
165
165
  });
166
166
  return dispatch(showFeedback());
167
167
  }, 250),
@@ -174,7 +174,7 @@ function ResultComponent(props: Props) {
174
174
  };
175
175
 
176
176
  // TODO: Search image with url or file
177
- const getUrlToCanvasFile = async (url: string, position?: number) => {
177
+ const getUrlToCanvasFile = async (url: string) => {
178
178
  dispatch(updateStatusLoading(true));
179
179
  if (isMobile) {
180
180
  executeScroll();
@@ -187,10 +187,6 @@ function ResultComponent(props: Props) {
187
187
  let image = await createImage(url);
188
188
  dispatch(setRequestImage(image));
189
189
 
190
- if (position) {
191
- feedbackClickEpic(stateGlobal, position);
192
- return;
193
- }
194
190
  let searchRegion: RectCoords | undefined = undefined;
195
191
 
196
192
  if (settings.regions) {
@@ -273,15 +269,16 @@ function ResultComponent(props: Props) {
273
269
 
274
270
  const debouncedOnImageSelectionChange = useCallback(
275
271
  debounce((r: RectCoords) => {
272
+ feedbackRegionEpic(stateGlobal, r);
276
273
  dispatch(selectionChanged(r));
277
274
  findItemsInSelection(r);
278
275
  }, 500),
279
- [findItemsInSelection],
276
+ [findItemsInSelection, stateGlobal.search],
280
277
  );
281
278
 
282
279
  const filteredRegions = useMemo(
283
280
  () =>
284
- regions.filter(
281
+ regions.map(
285
282
  (region: {
286
283
  normalizedRect: { x1: any; x2: any; y1: any; y2: any };
287
284
  }) => {
@@ -291,7 +288,7 @@ function ResultComponent(props: Props) {
291
288
  region.normalizedRect.y1 === imageSelection.y1 &&
292
289
  region.normalizedRect.y2 === imageSelection.y2
293
290
  ) {
294
- return false;
291
+ return { ...region, show: false };
295
292
  }
296
293
  if (
297
294
  imageSelection.x1 === 0 &&
@@ -299,15 +296,23 @@ function ResultComponent(props: Props) {
299
296
  imageSelection.y1 === 0 &&
300
297
  imageSelection.y2 === 1
301
298
  ) {
302
- return false;
299
+ return { ...region, show: false };
303
300
  }
304
301
 
305
- return true;
302
+ return { ...region, show: true };
306
303
  },
307
304
  ),
308
305
  [imageSelection, regions],
309
306
  );
310
307
 
308
+ const showPostFilter = useMemo(() => {
309
+ return settings.postFilterOption && props.allSearchResults?.hits.length > 0;
310
+ // eslint-disable-next-line react-hooks/exhaustive-deps
311
+ }, [settings.postFilterOption, props.allSearchResults?.hits]);
312
+
313
+ const showSidePanel = useMemo(() => {
314
+ return requestImage || (settings.postFilterOption && showPostFilter);
315
+ }, [showPostFilter, settings.postFilterOption, requestImage]);
311
316
  return (
312
317
  <div
313
318
  className={`wrap-main-result loading`}
@@ -336,8 +341,7 @@ function ResultComponent(props: Props) {
336
341
  </Box>
337
342
  {!isMobile && (
338
343
  <>
339
- {((!settings.postFilterOption && requestImage) ||
340
- settings.postFilterOption) && (
344
+ {showSidePanel && (
341
345
  <Box
342
346
  className={`wrap-main-col-left ${
343
347
  toggleColLeft ? 'toggle' : ''
@@ -371,21 +375,34 @@ function ResultComponent(props: Props) {
371
375
  <Box className="box-preview">
372
376
  <Box
373
377
  className="preview-item"
374
- style={{ backgroundColor: 'white' }}
378
+ style={{
379
+ backgroundColor: 'white',
380
+ paddingTop: '40px',
381
+ width: '100%',
382
+ }}
375
383
  >
376
- <Preview
377
- key={requestImage?.id}
378
- onSelectionChange={(r: RectCoords) => {
379
- setImageSelection(r);
380
- debouncedOnImageSelectionChange(r);
384
+ <div
385
+ style={{
386
+ backgroundColor: '#AAABB5',
387
+ width: '100%',
381
388
  }}
382
- image={requestImage?.canvas}
383
- selection={imageSelection || DEFAULT_REGION}
384
- regions={filteredRegions}
385
- maxWidth={320}
386
- maxHeight={320}
387
- dotColor={'#FBD914'}
388
- />
389
+ >
390
+ <Preview
391
+ key={requestImage?.id}
392
+ onSelectionChange={(r: RectCoords) => {
393
+ setImageSelection(r);
394
+ debouncedOnImageSelectionChange(r);
395
+ }}
396
+ image={requestImage?.canvas}
397
+ selection={imageSelection || DEFAULT_REGION}
398
+ regions={filteredRegions}
399
+ maxWidth={320}
400
+ maxHeight={320}
401
+ dotColor={'#FBD914'}
402
+ minCropWidth={60}
403
+ minCropHeight={60}
404
+ />
405
+ </div>
389
406
  </Box>
390
407
  </Box>
391
408
  {(showAdjustInfoBasedOnConfidence ||
@@ -400,28 +417,28 @@ function ResultComponent(props: Props) {
400
417
  padding: '5px',
401
418
  }}
402
419
  >
403
- <IconInfo />
420
+ <IconInfo color="white" />
404
421
  <Typography
405
422
  style={{
406
423
  fontSize: 10,
407
424
  color: '#fff',
408
- width: '280px',
409
425
  }}
410
426
  >
411
427
  {showAdjustInfo
412
- ? t(
413
- 'Adjust the search frame around your object for improved results',
414
- )
415
- : 'Use the cropping tool for improved image accuracy and enhanced results'}
428
+ ? t('crop the image for better results')
429
+ : 'crop the image for better results'}
416
430
  </Typography>
417
431
  </Box>
418
432
  )}
419
433
  </Box>
420
434
  )}
421
- {/* TODO: Filter list Choose */}
422
- {settings.postFilterOption && (
435
+ {showPostFilter && (
423
436
  <Box className="col-left__bottom">
424
- <ExpandablePanelComponent />
437
+ <ExpandablePanelComponent
438
+ disjunctiveFacets={
439
+ props.allSearchResults.disjunctiveFacets
440
+ }
441
+ />
425
442
  </Box>
426
443
  )}
427
444
  </Box>
@@ -434,22 +451,20 @@ function ResultComponent(props: Props) {
434
451
  settings.preview && 'ml-auto mr-auto'
435
452
  } ${isMobile && 'col-right-result-mobile'}`}
436
453
  style={{
437
- paddingTop:
438
- keyFilter && isMobile
439
- ? '105px'
440
- : isMobile
441
- ? '60px'
442
- : '40px',
454
+ paddingTop: isMobile ? '16px' : '40px',
443
455
  }}
444
456
  >
445
- <Box className="wrap-box-refinements">
446
- <CurrentRefinements statusSwitchButton={true} />
447
- </Box>
457
+ {!isMobile && (
458
+ <Box className="wrap-box-refinements">
459
+ <CurrentRefinements statusSwitchButton={true} />
460
+ </Box>
461
+ )}
462
+
448
463
  {isMobile && settings.preview && requestImage && (
449
464
  <Box
450
465
  className="col-left"
451
466
  style={{
452
- backgroundColor: settings?.theme?.primaryColor,
467
+ backgroundColor: '#AAABB5',
453
468
  marginBottom: '15px',
454
469
  }}
455
470
  >
@@ -468,9 +483,11 @@ function ResultComponent(props: Props) {
468
483
  image={requestImage?.canvas}
469
484
  selection={imageSelection || DEFAULT_REGION}
470
485
  regions={filteredRegions}
471
- maxWidth={320}
472
- maxHeight={320}
486
+ maxWidth={240}
487
+ maxHeight={240}
473
488
  dotColor={'#FBD914'}
489
+ minCropWidth={60}
490
+ minCropHeight={60}
474
491
  />
475
492
  </Box>
476
493
  {(showAdjustInfoBasedOnConfidence ||
@@ -480,25 +497,22 @@ function ResultComponent(props: Props) {
480
497
  alignItems="center"
481
498
  style={{
482
499
  backgroundColor: '#3E36DC',
483
- marginBottom: '25px',
484
500
  display: 'flex',
485
501
  columnGap: '6px',
486
502
  padding: '5px',
503
+ width: 'fit-content',
487
504
  }}
488
505
  >
489
- <IconInfo />
506
+ <IconInfo color="white" />
490
507
  <Typography
491
508
  style={{
492
509
  fontSize: 10,
493
510
  color: '#fff',
494
- width: '300px',
495
511
  }}
496
512
  >
497
513
  {showAdjustInfo
498
- ? t(
499
- 'Adjust the search frame around your object for improved results',
500
- )
501
- : 'Use the cropping tool for improved image accuracy and enhanced results'}
514
+ ? t('crop the image for better results')
515
+ : 'crop the image for better results'}
502
516
  </Typography>
503
517
  </Box>
504
518
  )}
@@ -5,6 +5,7 @@ import NyrisAPI, {
5
5
  } from '@nyris/nyris-api';
6
6
  import { RootState } from '../Store/Store';
7
7
  import { ToastHelper } from '../helpers/ToastHelper';
8
+ import { toast } from 'react-hot-toast';
8
9
 
9
10
  export const feedbackSuccessEpic = async (
10
11
  state: RootState,
@@ -19,6 +20,7 @@ export const feedbackSuccessEpic = async (
19
20
  event: 'feedback',
20
21
  data: { success },
21
22
  });
23
+ toast.dismiss();
22
24
  ToastHelper.success('Thank you for your feedback.');
23
25
  return res;
24
26
  } catch (err: any) {
@@ -26,11 +28,27 @@ export const feedbackSuccessEpic = async (
26
28
  }
27
29
  };
28
30
 
29
- export const feedbackClickEpic = async (state: RootState, position: number) => {
31
+ export const feedbackClickEpic = async (
32
+ state: RootState,
33
+ position: number,
34
+ id?: string,
35
+ ) => {
30
36
  const { search, settings } = state;
31
37
  return await sendFeedbackByApi(settings, search.sessionId, search.requestId, {
32
38
  event: 'click',
33
- data: { positions: [position] },
39
+ data: { positions: [position], ...(id ? { product_ids: [id] } : {}) },
40
+ });
41
+ };
42
+
43
+ export const feedbackConversionEpic = async (
44
+ state: RootState,
45
+ position: number,
46
+ id?: string,
47
+ ) => {
48
+ const { search, settings } = state;
49
+ return await sendFeedbackByApi(settings, search.sessionId, search.requestId, {
50
+ event: 'conversion',
51
+ data: { positions: [position], ...(id ? { product_ids: [id] } : {}) },
34
52
  });
35
53
  };
36
54
 
@@ -9,7 +9,6 @@ export interface SearchServiceSettings {
9
9
  regionProposalUrl?: string;
10
10
  responseFormat?: string;
11
11
  feedbackUrl?: string;
12
- exampleImages: string[];
13
12
  noImageUrl?: string;
14
13
  preview: boolean;
15
14
  regions: boolean;
@@ -9,6 +9,7 @@ export const translations = {
9
9
  'Show group': 'Show group',
10
10
  'Adjust the search frame around your object for improved results':
11
11
  'Adjust the search frame around your object for improved results',
12
+ 'crop the image for better results': 'Crop the image for better results',
12
13
  'Items per page': 'Items per page',
13
14
  'Search with an image': 'Search with an image',
14
15
  'Clear text search': 'Clear text search',
@@ -24,6 +25,9 @@ export const translations = {
24
25
  'Show group': 'Zeige Gruppe',
25
26
  'Adjust the search frame around your object for improved results':
26
27
  'Anpassen des Rahmens für bessere Ergebnisse',
28
+ 'crop the image for better results':
29
+ 'Bildausschnitt anpassen für bessere Ergebnisse',
30
+
27
31
  'Items per page': 'Artikel pro Seite',
28
32
  'Search with an image': 'Bildsuche',
29
33
  'Clear text search': 'Suchtext löschen',
package/src/types.ts CHANGED
@@ -23,7 +23,7 @@ export interface Field {
23
23
  }
24
24
 
25
25
  export interface AppSettings extends NyrisAPISettings {
26
- exampleImages: string[];
26
+ exampleImages?: string[]; // deprecated
27
27
  preview: boolean;
28
28
  cadSearch?: boolean;
29
29
  noImageUrl?: string;
@@ -34,12 +34,13 @@ export interface AppSettings extends NyrisAPISettings {
34
34
  productCtaText?: string;
35
35
  appTitle?: string;
36
36
  refinements?: any;
37
+ showGroup?: boolean;
37
38
  preFilterOption?: boolean;
38
39
  warehouseVariant?: boolean;
39
40
  preFilterTitle?: string;
40
41
  postFilterOption?: boolean;
41
42
  showFeedbackAndShare?: boolean;
42
- showMoreInfo?: boolean;
43
+ showMoreInfo?: boolean; // deprecated
43
44
  visualSearchFilterKey?: string;
44
45
  alogoliaFilterField?: string;
45
46
  headerText?: string;