@nyris/nyris-webapp 0.3.33 → 0.3.34

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 (82) 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.b85c7807a93875355f9f0f6490e6dc8c.js} +70 -14
  5. package/build/service-worker.js +1 -1
  6. package/build/static/css/main.f2aa67fc.chunk.css +2 -0
  7. package/build/static/css/main.f2aa67fc.chunk.css.map +1 -0
  8. package/build/static/js/2.d1f7e826.chunk.js +3 -0
  9. package/build/static/js/2.d1f7e826.chunk.js.map +1 -0
  10. package/build/static/js/main.e9aec8a9.chunk.js +3 -0
  11. package/build/static/js/main.e9aec8a9.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 +54 -73
  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 +1 -1
  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 +31 -22
  65. package/src/components/results/ItemResult.tsx +79 -84
  66. package/src/constants.ts +56 -0
  67. package/src/page/landingPage/AppMobile.tsx +34 -104
  68. package/src/page/landingPage/common.scss +164 -36
  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/build/static/js/{2.69ce0823.chunk.js.LICENSE.txt → 2.d1f7e826.chunk.js.LICENSE.txt} +0 -0
  82. /package/build/static/js/{main.6122377b.chunk.js.LICENSE.txt → main.e9aec8a9.chunk.js.LICENSE.txt} +0 -0
@@ -1,126 +1,56 @@
1
- import { Box, Typography } from '@material-ui/core';
2
- import { RectCoords } from '@nyris/nyris-api';
1
+ import { Box } from '@material-ui/core';
3
2
  import CameraCustom from 'components/drawer/cameraCustom';
4
- import ExampleImages from 'components/ExampleImages';
5
3
  import React, { useEffect, useState } from 'react';
6
- import { useHistory } from 'react-router-dom';
7
- import { feedbackClickEpic } from 'services/Feedback';
8
- import { createImage, findByImage, findRegions } from 'services/image';
9
- import { showFeedback, showResults } from 'Store/nyris/Nyris';
10
- import {
11
- loadingActionResults,
12
- reset,
13
- setImageSearchInput,
14
- setRegions,
15
- setRequestImage,
16
- setSearchResults,
17
- setSelectedRegion,
18
- updateStatusLoading,
19
- } from 'Store/search/Search';
20
- import { useAppDispatch, useAppSelector } from 'Store/Store';
4
+ import { reset } from 'Store/search/Search';
5
+ import { useAppDispatch } from 'Store/Store';
6
+ import { ReactComponent as CameraIcon } from 'common/assets/icons/take_photo.svg';
21
7
 
22
8
  function AppMobile(): JSX.Element {
23
- const history = useHistory();
24
9
  const dispatch = useAppDispatch();
25
- const searchState = useAppSelector(state => state);
26
- const {
27
- settings,
28
- search: { keyFilter },
29
- } = searchState;
30
10
  const [isOpenModalCamera, setOpenModalCamera] = useState<boolean>(false);
31
11
 
32
12
  useEffect(() => {
33
13
  dispatch(reset(''));
34
14
  }, [dispatch]);
35
15
 
36
- const getUrlToCanvasFile = async (url: string, position?: number) => {
37
- if (history.location?.pathname === '/') {
38
- history.push('/result');
39
- }
40
- dispatch(updateStatusLoading(true));
41
- dispatch(showResults());
42
- dispatch(loadingActionResults());
43
- dispatch(setImageSearchInput(url));
44
- if (position) {
45
- feedbackClickEpic(searchState, position);
46
- }
47
- let image = await createImage(url);
48
- dispatch(setRequestImage(image));
49
- let searchRegion: RectCoords | undefined = undefined;
50
- if (settings.regions) {
51
- let res = await findRegions(image, settings);
52
- dispatch(setRegions(res.regions));
53
- searchRegion = res.selectedRegion;
54
- dispatch(setSelectedRegion(searchRegion));
55
- }
56
- const preFilter = [
57
- {
58
- key: settings.visualSearchFilterKey,
59
- values: [`${keyFilter}`],
60
- },
61
- ];
62
- findByImage({
63
- image,
64
- settings,
65
- region: searchRegion,
66
- filters: keyFilter ? preFilter : undefined,
67
- })
68
- .then(res => {
69
- dispatch(setSearchResults(res));
70
- dispatch(updateStatusLoading(false));
71
- dispatch(showFeedback());
72
- return;
73
- })
74
- .catch((err: any) => {
75
- console.log('err getUrlToCanvasFile mobile', err);
76
- });
77
- };
78
-
79
16
  return (
80
- <>
81
- <Box className="wrap-content-body" style={{ position: 'relative' }}>
17
+ <div
18
+ style={{
19
+ display: 'flex',
20
+ flexDirection: 'column',
21
+ justifyContent: 'center',
22
+ alignItems: 'center',
23
+ width: '100%',
24
+ }}
25
+ >
26
+ <div className="take-photo">
82
27
  <div
28
+ className="take-photo-wrapper"
83
29
  style={{
84
- position: 'absolute',
85
- top: '1px',
86
- height: '100%',
87
- width: '100%',
88
- zIndex: 1,
89
- background: `${settings.theme?.mobileFooterImageColor}`,
30
+ background: 'linear-gradient(90deg, #55566B 0%, #2B2C46 100%)',
90
31
  }}
91
- ></div>
92
- <Box style={{ position: 'inherit', zIndex: 100 }} className="title-top">
93
- <Typography className="text-center text-white">
94
- Snap a photo or attach any image in the <br /> following formats:
95
- </Typography>
96
- <Typography className="text-center text-white">
97
- jpg, png, svg, pdf or tiff
98
- </Typography>
99
- </Box>
100
- <Box
101
- style={{ position: 'inherit', zIndex: 100 }}
102
- className="box-drag-mobile"
103
32
  >
104
- <ExampleImages
105
- images={settings.exampleImages}
106
- onExampleImageClicked={(url: string) => {
107
- return getUrlToCanvasFile(url);
108
- }}
109
- onToggleModalCamera={() => {
33
+ <div
34
+ className="outer"
35
+ onClick={() => {
110
36
  setOpenModalCamera(!isOpenModalCamera);
111
37
  }}
112
- />
113
- </Box>
114
- <Box className="box-screenshot-camera">
115
- <CameraCustom
116
- isToggle={isOpenModalCamera}
117
- onToggleModal={() => {
118
- setOpenModalCamera(!isOpenModalCamera);
119
- }}
120
- />
121
- </Box>
38
+ >
39
+ <div className="inner">
40
+ <CameraIcon color={'#2B2C46'} />
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ <Box className="box-screenshot-camera">
46
+ <CameraCustom
47
+ isToggle={isOpenModalCamera}
48
+ onToggleModal={() => {
49
+ setOpenModalCamera(!isOpenModalCamera);
50
+ }}
51
+ />
122
52
  </Box>
123
- </>
53
+ </div>
124
54
  );
125
55
  }
126
56
 
@@ -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,10 +1956,9 @@ 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
1963
  width: 70%;
1967
1964
  height: 80%;
@@ -1973,6 +1970,11 @@ button {
1973
1970
  background-color: #fff;
1974
1971
  width: 100%;
1975
1972
  height: 100%;
1973
+ padding: 10px 24px 24px 24px;
1974
+ @media only screen and (max-width: 776px) {
1975
+ height: fit-content;
1976
+ padding-bottom: 56px;
1977
+ }
1976
1978
  .box-top {
1977
1979
  padding: 24px 16px;
1978
1980
  .box-input-search-filter {
@@ -2005,7 +2007,6 @@ button {
2005
2007
  width: 100%;
2006
2008
  max-width: 100%;
2007
2009
  height: fit-content;
2008
- background-color: #fafafa;
2009
2010
  overflow-y: auto;
2010
2011
  .box-group-items {
2011
2012
  margin-top: 20px;
@@ -2102,4 +2103,131 @@ button {
2102
2103
  &::-webkit-scrollbar-thumb:hover {
2103
2104
  background: #555;
2104
2105
  }
2106
+ }
2107
+
2108
+
2109
+ .wrap-input-search-field {
2110
+ width: 512px;
2111
+ height: 48px;
2112
+ .box-input-search {
2113
+ justify-content: space-between;
2114
+ box-shadow: 0px 2px 12px rgba(43, 44, 70, 0.13);;
2115
+ background-color: #fff;
2116
+ border-radius: 24px;
2117
+ padding: 0px !important;
2118
+ height: 48px;
2119
+ overflow: hidden;
2120
+ padding-right: 12px !important;
2121
+ form {
2122
+ width: 100%;
2123
+ display: flex;
2124
+ justify-content: center;
2125
+ align-items: center;
2126
+ .box-inp {
2127
+ input {
2128
+ background-color: #fff;
2129
+ }
2130
+ .pre-filter-icon {
2131
+ display: flex;
2132
+ width: 60px;
2133
+ height: 100%;
2134
+ justify-content: center;
2135
+ align-items: center;
2136
+ border-right: 1px solid rgb(224, 224, 224);
2137
+ background: rgb(250, 250, 250);
2138
+ cursor: pointer;
2139
+ }
2140
+ .box-key-filter {
2141
+ padding: 8px;
2142
+ background-color: #E0E0E0;
2143
+ border-radius: 42px;
2144
+ min-width: fit-content;
2145
+ display: flex;
2146
+ align-items: center;
2147
+ height: 75%;
2148
+ margin-left: 5px;
2149
+ p {
2150
+ font-size: 14px;
2151
+ font-size: 700;
2152
+ color: #2B2C46;
2153
+ }
2154
+ }
2155
+
2156
+ position: relative;
2157
+ display: flex;
2158
+ justify-content: center;
2159
+ align-items: center;
2160
+ width: 100%;
2161
+ height: 100%;
2162
+ .icon-search {
2163
+ display: flex;
2164
+ // position: absolute;
2165
+ // left: 12px;
2166
+ // top: 0;
2167
+ bottom: 0;
2168
+ margin: auto;
2169
+ order: 0;
2170
+ }
2171
+ }
2172
+ }
2173
+ .input-search {
2174
+ // padding: 0 6px;
2175
+ // padding-left: 40px;
2176
+ padding-left: 6px;
2177
+ order: 2;
2178
+ width: 100%;
2179
+ border: 0px !important;
2180
+ &::placeholder {
2181
+ font-size: 14px !important;
2182
+ color: #AAABB5 !important;
2183
+ font-weight: 500 !important;
2184
+ }
2185
+ &::-webkit-search-cancel-button {
2186
+ position: relative;
2187
+ right: 20px;
2188
+
2189
+ -webkit-appearance: none;
2190
+ height: 20px;
2191
+ width: 20px;
2192
+ border-radius: 10px;
2193
+ background: red;
2194
+ }
2195
+ &:focus-visible {
2196
+ outline: none !important;
2197
+ }
2198
+ &::before,
2199
+ &::after {
2200
+ display: none !important;
2201
+ }
2202
+ }
2203
+ .btn-clear-text {
2204
+ width: 32px;
2205
+ height: 32px;
2206
+ border-radius: 100%;
2207
+ z-index: 10;
2208
+ cursor: pointer !important;
2209
+ margin-right: 8px;
2210
+
2211
+ &:after {
2212
+ content: "";
2213
+ font-size: 39px;
2214
+ position: absolute;
2215
+ right: -3px;
2216
+ font-weight: 100;
2217
+ background-color: #E0E0E0;
2218
+ width: 1px;
2219
+ height: 35px;
2220
+ }
2221
+ }
2222
+ }
2223
+ }
2224
+
2225
+ .icon-hover {
2226
+ padding: 8px;
2227
+ border-radius: 100%;
2228
+ display: flex;
2229
+ &:hover {
2230
+ background-color: #0000000a;
2231
+ }
2232
+
2105
2233
  }