@nyris/nyris-webapp 0.3.22 → 0.3.24

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 (95) hide show
  1. package/README.md +1 -1
  2. package/build/asset-manifest.json +12 -18
  3. package/build/index.html +1 -1
  4. package/build/{precache-manifest.6f6124db008881782a26c64db1f10264.js → precache-manifest.982b135daeb2c083ccf4eeeddf132bf3.js} +11 -35
  5. package/build/service-worker.js +1 -1
  6. package/build/static/css/{main.c956b74c.chunk.css → main.1e43a778.chunk.css} +2 -2
  7. package/build/static/css/main.1e43a778.chunk.css.map +1 -0
  8. package/build/static/js/2.fe9108d5.chunk.js +3 -0
  9. package/build/static/js/{2.a2732c2b.chunk.js.LICENSE.txt → 2.fe9108d5.chunk.js.LICENSE.txt} +0 -15
  10. package/build/static/js/2.fe9108d5.chunk.js.map +1 -0
  11. package/build/static/js/main.83cb88a3.chunk.js +3 -0
  12. package/build/static/js/main.83cb88a3.chunk.js.map +1 -0
  13. package/package.json +3 -3
  14. package/src/App.tsx +6 -14
  15. package/src/Router.tsx +6 -41
  16. package/src/Store/Store.ts +14 -23
  17. package/src/components/DetailItem.tsx +33 -22
  18. package/src/components/FooterMobile.tsx +3 -51
  19. package/src/components/FooterResult.tsx +1 -1
  20. package/src/components/HeaderMobile.tsx +13 -20
  21. package/src/components/HeaderNewVersion.tsx +5 -83
  22. package/src/components/Layout.tsx +3 -19
  23. package/src/components/PanelResult/index.tsx +1 -1
  24. package/src/components/clear-refinements/clear-refinements.tsx +1 -1
  25. package/src/components/drawer/cameraCustom.tsx +6 -12
  26. package/src/components/input/inputSearch.tsx +3 -3
  27. package/src/components/pre-filter/desktop/index.tsx +2 -2
  28. package/src/components/results/ItemResult.tsx +8 -8
  29. package/src/defaults.ts +19 -35
  30. package/src/helpers/CommonHelper.ts +10 -6
  31. package/src/hooks/useVisualSearch.tsx +1 -1
  32. package/src/index.css +13 -0
  33. package/src/index.tsx +0 -20
  34. package/src/modules/LandingPage/AppMD.tsx +59 -386
  35. package/src/modules/LandingPage/AppMobile.tsx +1 -1
  36. package/src/modules/LandingPage/propsType.ts +35 -37
  37. package/src/page/result/index.tsx +2 -2
  38. package/src/services/Feedback.ts +48 -71
  39. package/src/services/filter.tsx +1 -1
  40. package/src/services/types.ts +30 -39
  41. package/src/types.ts +8 -63
  42. package/build/js/test.js +0 -84
  43. package/build/static/css/main.c956b74c.chunk.css.map +0 -1
  44. package/build/static/js/2.a2732c2b.chunk.js +0 -3
  45. package/build/static/js/2.a2732c2b.chunk.js.map +0 -1
  46. package/build/static/js/main.93b05e17.chunk.js +0 -3
  47. package/build/static/js/main.93b05e17.chunk.js.map +0 -1
  48. package/build/static/media/Rectangle.4dd8b747.png +0 -0
  49. package/build/static/media/icon_company.2b2a0a61.svg +0 -3
  50. package/build/static/media/icon_email.132d632b.svg +0 -3
  51. package/build/static/media/icon_phone.09335da9.svg +0 -3
  52. package/build/static/media/icon_textArea.f6d78b61.svg +0 -3
  53. package/build/static/media/icon_users.2013c76e.svg +0 -3
  54. package/public/js/test.js +0 -84
  55. package/src/App.css +0 -65
  56. package/src/components/AppContainer.tsx +0 -126
  57. package/src/components/CategoryFilter.tsx +0 -17
  58. package/src/components/Codes.tsx +0 -20
  59. package/src/components/CustomHits/index.tsx +0 -47
  60. package/src/components/Footer.tsx +0 -96
  61. package/src/components/FooterMD.tsx +0 -54
  62. package/src/components/HeaderMd.tsx +0 -38
  63. package/src/components/Navigation.tsx +0 -34
  64. package/src/components/PredictedCategories.tsx +0 -14
  65. package/src/components/Refine.tsx +0 -28
  66. package/src/components/RelevantSort.tsx +0 -12
  67. package/src/components/Result.tsx +0 -210
  68. package/src/components/Saved/AllItem.tsx +0 -32
  69. package/src/components/Saved/Category.tsx +0 -16
  70. package/src/components/auto-complete/basic.tsx +0 -153
  71. package/src/components/autocomplete/plugins/popular-searches/popular-searches.css +0 -3
  72. package/src/components/autocomplete/plugins/popular-searches/popular-searches.tsx +0 -75
  73. package/src/components/button/clear-fillter.tsx +0 -30
  74. package/src/components/camera/screenshot.tsx +0 -33
  75. package/src/components/count/count.tsx +0 -20
  76. package/src/components/hitItem/hits.tsx +0 -50
  77. package/src/components/hitItem/infinitiHits.tsx +0 -33
  78. package/src/components/icon/icon.tsx +0 -13
  79. package/src/components/icon_textArea.svg +0 -3
  80. package/src/components/refinement-list/index.tsx +0 -42
  81. package/src/components/results/pagination.tsx +0 -34
  82. package/src/components/search/ListSearch.tsx +0 -209
  83. package/src/modules/LandingPage/App.tsx +0 -318
  84. package/src/modules/LandingPage/index.tsx +0 -186
  85. package/src/modules/LandingPage/indexNewVersion.tsx +0 -72
  86. package/src/page/Auth/login.tsx +0 -7
  87. package/src/page/Exception/404.tsx +0 -11
  88. package/src/page/History/index.tsx +0 -76
  89. package/src/page/Profile/index.tsx +0 -140
  90. package/src/page/ResultMobile/index.tsx +0 -12
  91. package/src/page/Saved/MockData.ts +0 -223
  92. package/src/page/Saved/index.tsx +0 -166
  93. package/src/page/Support/MockData.ts +0 -45
  94. package/src/page/Support/index.tsx +0 -492
  95. /package/build/static/js/{main.93b05e17.chunk.js.LICENSE.txt → main.83cb88a3.chunk.js.LICENSE.txt} +0 -0
@@ -1,88 +1,65 @@
1
- import NyrisAPI, {FeedbackEventPayload, NyrisAPISettings, RectCoords,} from '@nyris/nyris-api';
2
- import {RootState} from '../Store/Store';
3
- import {ToastHelper} from "../helpers/ToastHelper";
1
+ import NyrisAPI, {
2
+ FeedbackEventPayload,
3
+ NyrisAPISettings,
4
+ RectCoords,
5
+ } from '@nyris/nyris-api';
6
+ import { RootState } from '../Store/Store';
7
+ import { ToastHelper } from '../helpers/ToastHelper';
4
8
 
5
9
  export const feedbackSuccessEpic = async (
6
- state: RootState,
7
- success: boolean,
10
+ state: RootState,
11
+ success: boolean,
8
12
  ) => {
9
- const {search, settings} = state;
10
- const sessionId = search.sessionId;
11
- const requestId = search.requestId || search.sessionId;
13
+ const { search, settings } = state;
14
+ const sessionId = search.sessionId;
15
+ const requestId = search.requestId || search.sessionId;
12
16
 
13
- try {
14
- const res = await sendFeedbackByApi(settings, sessionId, requestId, {
15
- event: 'feedback',
16
- data: {success},
17
- });
18
- ToastHelper.success('Thank you for your feedback.');
19
- return res;
20
- } catch (err: any) {
21
- console.log(err)
22
- }
17
+ try {
18
+ const res = await sendFeedbackByApi(settings, sessionId, requestId, {
19
+ event: 'feedback',
20
+ data: { success },
21
+ });
22
+ ToastHelper.success('Thank you for your feedback.');
23
+ return res;
24
+ } catch (err: any) {
25
+ console.log(err);
26
+ }
23
27
  };
24
28
 
25
29
  export const feedbackClickEpic = async (state: RootState, position: number) => {
26
- const {search, settings} = state;
27
- return await sendFeedbackByApi(settings, search.sessionId, search.requestId, {
28
- event: 'click',
29
- data: {positions: [position]},
30
- });
30
+ const { search, settings } = state;
31
+ return await sendFeedbackByApi(settings, search.sessionId, search.requestId, {
32
+ event: 'click',
33
+ data: { positions: [position] },
34
+ });
31
35
  };
32
36
 
33
- // export const feedbackTextSearchEpic = async (
34
- // state: RootState,
35
- // query: string,
36
- // page: number,
37
- // productIds: string[],
38
- // ) => {
39
- // try {
40
- // const { search, settings } = state;
41
- // const eventData = {
42
- // query,
43
- // page,
44
- // product_ids: productIds,
45
- // };
46
- // const textSearchEvent = { event: 'text-search', data: eventData };
47
- // // @ts-ignore
48
- // return await sendFeedbackByApi(
49
- // settings,
50
- // search.sessionId,
51
- // search.requestId,
52
- // textSearchEvent,
53
- // );
54
- // } catch (error) {
55
- // console.log('error feedbackTextSearchEpic', error);
56
- // }
57
- // };
58
-
59
37
  export const feedbackRegionEpic = async (
60
- state: RootState,
61
- region: RectCoords,
38
+ state: RootState,
39
+ region: RectCoords,
62
40
  ) => {
63
- const {settings, search} = state;
64
- const {sessionId, requestId} = search;
65
- const {x1, x2, y1, y2} = region;
66
- const payload: FeedbackEventPayload = {
67
- event: 'region',
68
- data: {rect: {x: x1, y: y1, w: x2 - x1, h: y2 - y1}},
69
- };
70
- return await sendFeedbackByApi(settings, sessionId, requestId, payload);
41
+ const { settings, search } = state;
42
+ const { sessionId, requestId } = search;
43
+ const { x1, x2, y1, y2 } = region;
44
+ const payload: FeedbackEventPayload = {
45
+ event: 'region',
46
+ data: { rect: { x: x1, y: y1, w: x2 - x1, h: y2 - y1 } },
47
+ };
48
+ return await sendFeedbackByApi(settings, sessionId, requestId, payload);
71
49
  };
72
50
 
73
51
  export const sendFeedbackByApi = async (
74
- settings: NyrisAPISettings,
75
- sessionId: string | undefined,
76
- requestId: string | undefined,
77
- payload: FeedbackEventPayload,
52
+ settings: NyrisAPISettings,
53
+ sessionId: string | undefined,
54
+ requestId: string | undefined,
55
+ payload: FeedbackEventPayload,
78
56
  ) => {
79
- const api = new NyrisAPI(settings);
80
- if (sessionId && requestId) {
81
- try {
82
- await api.sendFeedback(sessionId, requestId, payload).then(res => {
83
- });
84
- } catch (error) {
85
- console.log('error sendFeedbackByApi321', error);
86
- }
57
+ const api = new NyrisAPI(settings);
58
+ if (sessionId && requestId) {
59
+ try {
60
+ await api.sendFeedback(sessionId, requestId, payload).then(res => {});
61
+ } catch (error) {
62
+ console.log('error sendFeedbackByApi321', error);
87
63
  }
64
+ }
88
65
  };
@@ -14,7 +14,7 @@ export const getFilters = async (
14
14
  };
15
15
 
16
16
  export const searchFilters = async (
17
- key: any = 'machineType',
17
+ key: any = '',
18
18
  value: string,
19
19
  settingsNyris: NyrisAPISettings,
20
20
  ) => {
@@ -1,50 +1,41 @@
1
- // import {SearchAction, SearchState} from "./actions/searchActions";
2
- // import {NyrisAction, NyrisAppState} from "./actions/nyrisAppActions";
3
-
4
-
5
- import {MDSettings} from "../types";
6
-
7
1
  export interface SearchServiceSettings {
8
- xOptions: boolean | string,
9
- customSearchRequest?: ((file: Blob, client: any) => Promise<any>),
10
- responseHook?: ((response: any) => any),
11
- apiKey: string,
12
- imageMatchingUrl?: string,
13
- imageMatchingUrlBySku?: string,
14
- imageMatchingSubmitManualUrl?: string,
15
- regionProposalUrl?: string,
16
- responseFormat?: string,
17
- feedbackUrl?: string,
18
- exampleImages: string[],
19
- resultTemplate?: string,
20
- noImageUrl?: string,
21
- materialDesign?: MDSettings,
22
- preview: boolean,
23
- regions: boolean,
24
- jpegQuality: number,
25
- maxWidth: number,
26
- maxHeight: number,
27
- useRecommendations: boolean
2
+ xOptions: boolean | string;
3
+ customSearchRequest?: (file: Blob, client: any) => Promise<any>;
4
+ responseHook?: (response: any) => any;
5
+ apiKey: string;
6
+ imageMatchingUrl?: string;
7
+ imageMatchingUrlBySku?: string;
8
+ imageMatchingSubmitManualUrl?: string;
9
+ regionProposalUrl?: string;
10
+ responseFormat?: string;
11
+ feedbackUrl?: string;
12
+ exampleImages: string[];
13
+ noImageUrl?: string;
14
+ preview: boolean;
15
+ regions: boolean;
16
+ jpegQuality: number;
17
+ maxWidth: number;
18
+ maxHeight: number;
28
19
  }
29
20
 
30
21
  export interface Crop {
31
- x: number,
32
- y: number,
33
- w: number,
34
- h: number
22
+ x: number;
23
+ y: number;
24
+ w: number;
25
+ h: number;
35
26
  }
36
27
 
37
28
  export interface WH {
38
- w: number,
39
- h: number
29
+ w: number;
30
+ h: number;
40
31
  }
41
32
 
42
33
  export interface Result {
43
- position: number,
44
- sku?: string,
45
- title?: string,
46
- l?: string,
47
- img?: { url?: string },
48
- // There can be also any other data
49
- [x: string]: any
34
+ position: number;
35
+ sku?: string;
36
+ title?: string;
37
+ l?: string;
38
+ img?: { url?: string };
39
+ // There can be also any other data
40
+ [x: string]: any;
50
41
  }
package/src/types.ts CHANGED
@@ -2,22 +2,6 @@ import { NyrisAPISettings } from '@nyris/nyris-api';
2
2
  import { NyrisAppState } from 'Store/Nyris';
3
3
  import { SearchState } from 'Store/Search';
4
4
 
5
- export interface MDSettings {
6
- customFontFamily?: string;
7
- appBarLogoUrl: string;
8
- appBarTitle: string;
9
- appBarCustomBackgroundColor?: string;
10
- appBarCustomTextColor?: string;
11
- primaryColor: string;
12
- secondaryColor: string;
13
- resultFirstRowProperty: string;
14
- resultSecondRowProperty: string;
15
-
16
- resultLinkText?: string;
17
- resultLinkIcon?: string;
18
- active?: boolean;
19
- }
20
-
21
5
  export interface AlgoliaSettings {
22
6
  apiKey: string;
23
7
  appId: string;
@@ -29,10 +13,9 @@ export interface AppSettings extends NyrisAPISettings {
29
13
  preview: boolean;
30
14
  cadSearch?: boolean;
31
15
  noImageUrl?: string;
32
- resultTemplate?: string;
33
16
  regions: boolean;
34
17
  instantRedirectPatterns: string[];
35
- themePage: ThemeChoice;
18
+ theme: SearchSuiteSettings;
36
19
  algolia?: AlgoliaSettings;
37
20
  productCtaText?: string;
38
21
  appTitle?: string;
@@ -49,26 +32,15 @@ export interface AppSettings extends NyrisAPISettings {
49
32
  brandName?: string;
50
33
  }
51
34
 
52
- export interface DefaultThemeSettings {
53
- active: boolean;
54
- }
55
-
56
35
  export interface SearchSuiteSettings {
57
36
  active?: boolean;
58
- appBarLogoUrl: string;
59
- appBarLogoUrlAlt: string;
60
- headerColor: string;
61
- logoWidth: string;
62
- logoHeight: string;
63
- mobileFooterImageColor: string;
64
- primaryColor: string;
65
- secondaryColor: string;
66
- }
67
-
68
- export interface ThemeChoice {
69
- default?: DefaultThemeSettings;
70
- materialDesign?: MDSettings;
71
- searchSuite?: SearchSuiteSettings;
37
+ appBarLogoUrl?: string;
38
+ headerColor?: string;
39
+ logoWidth?: string;
40
+ logoHeight?: string;
41
+ mobileFooterImageColor?: string;
42
+ primaryColor?: string;
43
+ secondaryColor?: string;
72
44
  }
73
45
 
74
46
  export type AppState = {
@@ -81,30 +53,3 @@ export interface CanvasWithId {
81
53
  canvas: HTMLCanvasElement;
82
54
  id: string;
83
55
  }
84
-
85
- export interface SearchServiceSettings {
86
- xOptions: boolean | string;
87
- customSearchRequest?: (file: Blob, client: any) => Promise<any>;
88
- responseHook?: (response: any) => any;
89
- apiKey: string;
90
- imageMatchingUrl?: string;
91
- imageMatchingUrlBySku?: string;
92
- imageMatchingSubmitManualUrl?: string;
93
- regionProposalUrl?: string;
94
- responseFormat?: string;
95
- feedbackUrl?: string;
96
- exampleImages: string[];
97
- resultTemplate?: string;
98
- noImageUrl?: string;
99
- materialDesign?: MDSettings;
100
- preview: boolean;
101
- regions: boolean;
102
- jpegQuality: number;
103
- maxWidth: number;
104
- maxHeight: number;
105
- useRecommendations: boolean;
106
- }
107
-
108
- export interface AlgoliaResult {
109
- sku: string;
110
- }
package/build/js/test.js DELETED
@@ -1,84 +0,0 @@
1
- var settings = {
2
- apiKey: 'ZKbb76cwHmBUoXR4uqwD5PqaJK3wobdZ',
3
- // apiKeyDMGMori: 'nlLoWoR4GqT1BVbdkYiVsp85oMokpzMS',
4
- maxWidth: 300,
5
- maxHeight: 300,
6
- jpegQuality: 0.9,
7
- regions: true,
8
- preview: true,
9
- useRecommendations: false,
10
- xOptions:
11
- 'default +estimated-category similarity.threshold=0.05 similarity.threshold.discard=0.05 exact.threshold.perfect=200 similarity.threshold.perfect=2 scoring.indicative-min-hits=1 scoring.promo-min-hits=20 scoring.interpolation-cutoff=0 +barcode +barcode-detection',
12
- baseUrl: 'https://api.i.nyris.io',
13
- resultTemplate: 'default',
14
- responseFormat: 'application/offers.complete+json',
15
- exampleImages: [
16
- 'https://storage.googleapis.com/nyris/share/examples_search/example_1.jpg',
17
- 'https://storage.googleapis.com/nyris/share/examples_search/example_2.jpg',
18
- 'https://storage.googleapis.com/nyris/share/examples_search/example_3.jpg',
19
- 'https://storage.googleapis.com/nyris/share/examples_search/example_4.jpg',
20
- ],
21
- deactivated: false,
22
- cadSearch: false,
23
- themePage: {
24
- default: {
25
- active: false,
26
- },
27
- materialDesign: {
28
- active: false,
29
- appBarLogoUrl: 'https://nyris.io/wp-content/themes/nyris/img/logo.svg',
30
- appBarTitle: '',
31
- appBarCustomBackgroundColor: 'black',
32
- appBarCustomTextColor: 'white',
33
-
34
- primaryColor: '#e31b5d',
35
- secondaryColor: '#ccc',
36
- resultFirstRowProperty: 'title',
37
- resultSecondRowProperty: 'price',
38
- resultLinkText: 'show',
39
- resultLinkIcon: 'eye',
40
- },
41
- searchSuite: {
42
- active: true,
43
- moreInfoText: 'more info',
44
- },
45
- },
46
- imageMatchingUrl: 'https://api.nyris.io/find/v1',
47
- imageMatchingUrlBySku: 'https://api.nyris.io/recommend/v1',
48
- imageMatchingSubmitManualUrl: 'https://api.nyris.io/find/v1/manual',
49
- regionProposalUrl: 'https://api.nyris.io/find/v1/regions',
50
- feedbackUrl: 'https://api.nyris.io/feedback/v1',
51
- algolia: {
52
- apiKey: '6d20d5463452614ea94aae323d8d038e',
53
- appId: 'HBDJYUK5G4',
54
- indexName: 'dmg-mori',
55
- },
56
- refinements: [
57
- {
58
- type: 'list',
59
- header: 'Brands',
60
- attribute: 'brand',
61
- },
62
- {
63
- type: 'list',
64
- header: 'Norm',
65
- attribute: 'keyword_0',
66
- options: {
67
- searchable: true,
68
- },
69
- },
70
- {
71
- type: 'list',
72
- header: 'Category',
73
- attribute: 'custom_category',
74
- },
75
- ],
76
- autocompleteSearchConfig: {
77
- placeholders: ['brand', 'keyword_0', 'custom_category'],
78
- debouncing: 800,
79
- detachedMediaQuery: '(max-width: 776px)',
80
- },
81
- visualSearchFilterKey: 'machineType',
82
- };
83
- settings['customSearchRequest'] = null;
84
- settings['responseHook'] = null;