@nyris/nyris-webapp 0.3.6 → 0.3.13

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 (37) hide show
  1. package/build/asset-manifest.json +11 -11
  2. package/build/index.html +1 -1
  3. package/build/{precache-manifest.bffed513ca17d8ac16af1cc3aaa7d908.js → precache-manifest.793f0a4375602ec8cd0fba83bf0e3e67.js} +9 -9
  4. package/build/service-worker.js +1 -1
  5. package/build/static/css/main.0c9239ba.chunk.css +2 -0
  6. package/build/static/css/main.0c9239ba.chunk.css.map +1 -0
  7. package/build/static/js/2.520bb6d6.chunk.js +3 -0
  8. package/build/static/js/{2.4e9a4ce1.chunk.js.LICENSE.txt → 2.520bb6d6.chunk.js.LICENSE.txt} +0 -0
  9. package/build/static/js/2.520bb6d6.chunk.js.map +1 -0
  10. package/build/static/js/main.8405239a.chunk.js +2 -0
  11. package/build/static/js/main.8405239a.chunk.js.map +1 -0
  12. package/package.json +2 -2
  13. package/src/App.tsx +346 -213
  14. package/src/actions/nyrisAppActions.ts +69 -65
  15. package/src/actions/searchActions.ts +301 -196
  16. package/src/components/CategoryFilter.tsx +16 -13
  17. package/src/components/Codes.tsx +20 -16
  18. package/src/components/ExampleImages.tsx +27 -17
  19. package/src/components/Feedback.tsx +78 -48
  20. package/src/components/FiltersList.tsx +106 -59
  21. package/src/components/Header.tsx +29 -17
  22. package/src/components/PredictedCategories.tsx +15 -12
  23. package/src/components/Result.tsx +186 -113
  24. package/src/components/SelectedFiltersSummary.tsx +84 -0
  25. package/src/components/Sidebar.tsx +41 -32
  26. package/src/epics/index.ts +173 -104
  27. package/src/epics/search.ts +209 -177
  28. package/src/index.css +98 -9
  29. package/src/index.tsx +148 -144
  30. package/src/utils.ts +5 -0
  31. package/build/static/css/main.2a76dc8a.chunk.css +0 -2
  32. package/build/static/css/main.2a76dc8a.chunk.css.map +0 -1
  33. package/build/static/js/2.4e9a4ce1.chunk.js +0 -3
  34. package/build/static/js/2.4e9a4ce1.chunk.js.map +0 -1
  35. package/build/static/js/main.ec93aa4d.chunk.js +0 -2
  36. package/build/static/js/main.ec93aa4d.chunk.js.map +0 -1
  37. package/src/Demo2.tsx +0 -220
@@ -1,76 +1,80 @@
1
- import {AppAction} from "../types";
2
-
3
-
4
- export type NyrisAppPart = 'start' | 'camera' | 'results';
5
- export type NyrisFeedbackState = 'hidden' | 'question' | 'positive' | 'negative';
1
+ import { AppAction } from "../types";
6
2
 
3
+ export type NyrisAppPart = "start" | "camera" | "results";
4
+ export type NyrisFeedbackState =
5
+ | "hidden"
6
+ | "question"
7
+ | "positive"
8
+ | "negative";
7
9
 
8
10
  export interface NyrisAppState {
9
- showPart: NyrisAppPart,
10
- feedbackState: NyrisFeedbackState
11
+ showPart: NyrisAppPart;
12
+ feedbackState: NyrisFeedbackState;
11
13
  }
12
14
 
13
15
  export type NyrisAction =
14
- | { type: 'SHOW_START' }
15
- | { type: 'SHOW_CAMERA' }
16
- | { type: 'SHOW_RESULTS' }
17
- | { type: 'SHOW_FEEDBACK' }
18
- | { type: 'HIDE_FEEDBACK' }
19
- | { type: 'RESULT_LINK_CLICKED', position: number, url: string}
20
- | { type: 'RESULT_IMAGE_CLICKED', position: number, url: string}
21
-
16
+ | { type: "SHOW_START" }
17
+ | { type: "SHOW_CAMERA" }
18
+ | { type: "SHOW_RESULTS" }
19
+ | { type: "SHOW_FEEDBACK" }
20
+ | { type: "HIDE_FEEDBACK" }
21
+ | { type: "RESULT_LINK_CLICKED"; position: number; url: string }
22
+ | { type: "RESULT_IMAGE_CLICKED"; position: number; url: string };
22
23
 
23
- export const showCamera = () :NyrisAction => ({type: 'SHOW_CAMERA'});
24
- export const showStart = () :NyrisAction => ({type: 'SHOW_START'});
25
- export const showResults = () :NyrisAction => ({type: 'SHOW_RESULTS'});
26
- export const showFeedback = () :NyrisAction => ({type: 'SHOW_FEEDBACK'});
27
- export const hideFeedback = () :NyrisAction => ({type: 'HIDE_FEEDBACK'});
24
+ export const showCamera = (): NyrisAction => ({ type: "SHOW_CAMERA" });
25
+ export const showStart = (): NyrisAction => ({ type: "SHOW_START" });
26
+ export const showResults = (): NyrisAction => ({ type: "SHOW_RESULTS" });
27
+ export const showFeedback = (): NyrisAction => ({ type: "SHOW_FEEDBACK" });
28
+ export const hideFeedback = (): NyrisAction => ({ type: "HIDE_FEEDBACK" });
28
29
 
29
- const initialNyrisState : NyrisAppState = {
30
- showPart: 'start',
31
- feedbackState: 'hidden'
30
+ const initialNyrisState: NyrisAppState = {
31
+ showPart: "start",
32
+ feedbackState: "hidden",
32
33
  };
33
34
 
34
- export function reducer(state : NyrisAppState = initialNyrisState, action: AppAction) : NyrisAppState {
35
- switch (action.type) {
36
- case 'SHOW_START':
37
- return {
38
- ...state,
39
- showPart: 'start'
40
- };
41
- case 'SHOW_CAMERA':
42
- return {
43
- ...state,
44
- showPart: 'camera'
45
- };
46
- case 'SEARCH_REQUEST_START':
47
- case 'REGION_REQUEST_START':
48
- case 'SHOW_RESULTS':
49
- return {
50
- ...state,
51
- showPart: 'results'
52
- };
53
- case 'SHOW_FEEDBACK':
54
- return {
55
- ...state,
56
- feedbackState: 'question'
57
- };
58
- case 'HIDE_FEEDBACK':
59
- return {
60
- ...state,
61
- feedbackState: 'hidden'
62
- };
63
- case 'FEEDBACK_SUBMIT_POSITIVE':
64
- return {
65
- ...state,
66
- feedbackState: 'positive'
67
- };
68
- case 'FEEDBACK_SUBMIT_NEGATIVE':
69
- return {
70
- ...state,
71
- feedbackState: 'negative'
72
- };
73
- default:
74
- return state;
75
- }
35
+ export function reducer(
36
+ state: NyrisAppState = initialNyrisState,
37
+ action: AppAction
38
+ ): NyrisAppState {
39
+ switch (action.type) {
40
+ case "SHOW_START":
41
+ return {
42
+ ...state,
43
+ showPart: "start",
44
+ };
45
+ case "SHOW_CAMERA":
46
+ return {
47
+ ...state,
48
+ showPart: "camera",
49
+ };
50
+ case "SEARCH_REQUEST_START":
51
+ case "REGION_REQUEST_START":
52
+ case "SHOW_RESULTS":
53
+ return {
54
+ ...state,
55
+ showPart: "results",
56
+ };
57
+ case "SHOW_FEEDBACK":
58
+ return {
59
+ ...state,
60
+ feedbackState: "question",
61
+ };
62
+ case "HIDE_FEEDBACK":
63
+ return {
64
+ ...state,
65
+ feedbackState: "hidden",
66
+ };
67
+ case "FEEDBACK_SUBMIT_POSITIVE":
68
+ return {
69
+ ...state,
70
+ feedbackState: "positive",
71
+ };
72
+ case "FEEDBACK_SUBMIT_NEGATIVE":
73
+ return {
74
+ ...state,
75
+ feedbackState: "negative",
76
+ };
77
+ default:
78
+ return state;
79
+ }
76
80
  }