@nyris/nyris-webapp 0.3.57 → 0.3.59
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/build/asset-manifest.json +15 -16
- package/build/index.html +1 -1
- package/build/js/settings.example.js +1 -0
- package/build/static/css/main.cb6e2cfd.css +4 -0
- package/build/static/css/main.cb6e2cfd.css.map +1 -0
- package/build/static/js/main.a1e24447.js +3 -0
- package/build/static/js/{main.5143aa56.js.LICENSE.txt → main.a1e24447.js.LICENSE.txt} +55 -0
- package/build/static/js/main.a1e24447.js.map +1 -0
- package/build/static/media/camera_simple.bff4194954bbb5f4bc33bd99014a93e8.svg +3 -0
- package/build/static/media/collpase.50dae91fff891c46b10dfc281344d0ef.svg +6 -0
- package/build/static/media/crop.0676ebbbdc1375ed67e32bba890ce941.svg +3 -0
- package/build/static/media/{download.8007f7c72e2080a9ffa96fa63d480dcf.svg → download.a8452bc23334e9f8e53fe1225742d216.svg} +1 -1
- package/build/static/media/gallery.15d1f3308921480a8c9d96d9a77c9966.svg +3 -0
- package/build/static/media/{logout.b544fcd2969edf431a1e998333119834.svg → logout.bab56bd407f25eb34d6eff401a436ce1.svg} +1 -1
- package/build/static/media/next-arrow.b13263d05d107ceb5e99bc4fabb41279.svg +3 -0
- package/build/static/media/plus.329672cb2feb55345490589e91481b88.svg +3 -0
- package/package.json +8 -5
- package/public/index.html +0 -3
- package/public/js/settings.example.js +1 -0
- package/src/Router.tsx +2 -2
- package/src/Store/Store.ts +2 -0
- package/src/Store/requestStore.ts +70 -0
- package/src/Store/resultStore.ts +25 -0
- package/src/Store/search/Search.ts +2 -33
- package/src/Store/search/search.initialState.ts +1 -4
- package/src/Store/search/types.ts +0 -5
- package/src/common/assets/icons/arrow_enter.svg +3 -0
- package/src/common/assets/icons/camera_simple.svg +3 -0
- package/src/common/assets/icons/collpase.svg +6 -0
- package/src/common/assets/icons/crop.svg +3 -0
- package/src/common/assets/icons/download.svg +1 -1
- package/src/common/assets/icons/gallery.svg +3 -0
- package/src/common/assets/icons/logout.svg +1 -1
- package/src/common/assets/icons/next-arrow.svg +3 -0
- package/src/common/assets/icons/plus.svg +3 -0
- package/src/components/CadenasWebViewer.tsx +1 -1
- package/src/components/DragDropFile.tsx +17 -77
- package/src/components/Experience-visual-search/ExperienceVisualSearch.tsx +47 -71
- package/src/components/Feedback.tsx +23 -9
- package/src/components/GoBackButton.tsx +15 -18
- package/src/components/HeaderMobile.tsx +342 -246
- package/src/components/ImageCaptureHelpModal.tsx +63 -65
- package/src/components/ImagePreview.tsx +564 -0
- package/src/components/Inquiry/InquiryBanner.tsx +1 -1
- package/src/components/Inquiry/InquiryModal.tsx +4 -7
- package/src/components/Layout.tsx +9 -18
- package/src/components/MobileLayout.tsx +51 -0
- package/src/components/MobilePostFilter.tsx +9 -3
- package/src/components/PanelResult/PostFilterAlgolia.tsx +4 -32
- package/src/components/PanelResult/expandable-panel.tsx +3 -16
- package/src/components/PanelResult/virtual-state-results.ts +17 -22
- package/src/components/ProductDetailView.tsx +1 -1
- package/src/components/SidePanel.tsx +7 -97
- package/src/components/UploadDisclaimer.tsx +85 -0
- package/src/components/appMobile.scss +2 -2
- package/src/components/common.scss +57 -27
- package/src/components/drawer/cameraCustom.tsx +389 -231
- package/src/components/icon-label/icon-label.tsx +1 -1
- package/src/components/input/inputSearch.tsx +197 -338
- package/src/components/pre-filter/index.tsx +70 -72
- package/src/components/results/ItemResult.tsx +34 -17
- package/src/components/rfq/RfqBanner.tsx +1 -4
- package/src/components/rfq/RfqModal.tsx +10 -10
- package/src/hooks/useFilteredRegions.ts +1 -1
- package/src/hooks/useImageSearch.ts +189 -0
- package/src/hooks/useSearchOrRedirect.ts +84 -0
- package/src/index.css +4 -0
- package/src/page/landingPage/Home.tsx +49 -0
- package/src/page/landingPage/{AppMD.tsx → HomeDesktop.tsx} +7 -34
- package/src/page/landingPage/{AppMobile.tsx → HomeMobile.tsx} +8 -37
- package/src/page/landingPage/common.scss +9 -1
- package/src/page/result/index.tsx +118 -232
- package/src/services/Feedback.ts +4 -5
- package/src/services/image.ts +19 -0
- package/src/types.ts +9 -7
- package/src/utils.ts +44 -0
- package/tailwind.config.js +54 -0
- package/build/static/css/main.67965609.css +0 -2
- package/build/static/css/main.67965609.css.map +0 -1
- package/build/static/js/main.5143aa56.js +0 -3
- package/build/static/js/main.5143aa56.js.map +0 -1
- package/build/static/media/arrow_down.f417689ce292978a8292a7f00407fdd5.svg +0 -3
- package/build/static/media/arrow_left.73d03a534eaf9b99ab196e0fb67da602.svg +0 -3
- package/build/static/media/arrow_right.59a4594a3a1657037537dbae1eee0251.svg +0 -3
- package/build/static/media/arrow_up.85dbe70bc51ec32c8894a06499330f14.svg +0 -3
- package/build/static/media/home.9ffb65a9c0be8fc5a502ba05cf5f719c.svg +0 -3
- package/build/static/media/icon_camera_mobile.6772053c4dfef487255649d2a05cc9d4.svg +0 -3
- package/build/static/media/reverse_camera.cee0200b151941cc83c182167a85d667.svg +0 -5
- package/src/App.tsx +0 -18
- package/src/components/AppMobile.tsx +0 -117
- package/src/components/FooterMobile.tsx +0 -230
- package/src/components/ImagePreviewMobile.tsx +0 -237
- /package/build/static/media/{add.2b72cedb98c4c89c954266d2356c166c.svg → add-rounded.2b72cedb98c4c89c954266d2356c166c.svg} +0 -0
- /package/src/common/assets/icons/{add.svg → add-rounded.svg} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M16 13.7139C16 14.0295 15.7442 14.2853 15.4286 14.2853H0.571429C0.255837 14.2853 0 14.0295 0 13.7139V3.99958C0 3.68399 0.255837 3.42815 0.571429 3.42815H4.26286L5.24 1.97101C5.34513 1.81136 5.52313 1.71486 5.71429 1.71387H10.2857C10.4769 1.71486 10.6549 1.81136 10.76 1.97101L11.7371 3.42815H15.4286C15.7442 3.42815 16 3.68399 16 3.99958V13.7139ZM1.14286 13.1424H14.8571V4.57101H11.4286C11.2374 4.57002 11.0594 4.47352 10.9543 4.31387L9.97714 2.85672H6.02286L5.04571 4.31387C4.94058 4.47352 4.76258 4.57002 4.57143 4.57101H1.14286V13.1424ZM8 11.9996C6.10645 11.9996 4.57143 10.4646 4.57143 8.57101C4.57143 6.67746 6.10645 5.14244 8 5.14244C9.89355 5.14244 11.4286 6.67746 11.4286 8.57101C11.4286 10.4646 9.89355 11.9996 8 11.9996ZM8 6.2853C6.73764 6.2853 5.71429 7.30865 5.71429 8.57101C5.71429 9.83337 6.73764 10.8567 8 10.8567C9.26237 10.8567 10.2857 9.83337 10.2857 8.57101C10.2857 7.30865 9.26237 6.2853 8 6.2853Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M1.48039 1.48039C1.74571 1.21508 2.17586 1.21508 2.44118 1.48039L5.5451 4.58431C5.67096 4.71018 5.88618 4.62127 5.88652 4.44328L5.88908 3.11787C5.88981 2.74393 6.19315 2.44118 6.56709 2.44118C6.94154 2.44118 7.2451 2.74473 7.2451 3.11918V6.2451C7.2451 6.79738 6.79738 7.2451 6.2451 7.2451H3.11918C2.74473 7.2451 2.44118 6.94154 2.44118 6.56709C2.44118 6.19315 2.74393 5.88981 3.11787 5.88908L4.44328 5.88652C4.62127 5.88618 4.71018 5.67096 4.58431 5.5451L1.48039 2.44118C1.21508 2.17586 1.21508 1.74571 1.48039 1.48039Z" fill="#55566B"/>
|
|
3
|
+
<path d="M3.11918 8.7549C2.74473 8.7549 2.44118 9.05846 2.44118 9.43291C2.44118 9.80685 2.74393 10.1102 3.11787 10.1109L4.44328 10.1135C4.62127 10.1138 4.71018 10.329 4.58431 10.4549L1.48039 13.5588C1.21508 13.8241 1.21508 14.2543 1.48039 14.5196C1.74571 14.7849 2.17586 14.7849 2.44118 14.5196L5.5451 11.4157C5.67096 11.2898 5.88618 11.3787 5.88652 11.5567L5.88908 12.8821C5.88981 13.2561 6.19315 13.5588 6.56709 13.5588C6.94154 13.5588 7.2451 13.2553 7.2451 12.8808V9.7549C7.2451 9.20262 6.79738 8.7549 6.2451 8.7549H3.11918Z" fill="#55566B"/>
|
|
4
|
+
<path d="M14.5196 1.48039C14.2543 1.21508 13.8241 1.21508 13.5588 1.48039L10.4549 4.58431C10.329 4.71018 10.1138 4.62127 10.1135 4.44328L10.1109 3.11787C10.1102 2.74393 9.80685 2.44118 9.43291 2.44118C9.05846 2.44118 8.7549 2.74473 8.7549 3.11918V6.2451C8.7549 6.79738 9.20262 7.2451 9.7549 7.2451H12.8808C13.2553 7.2451 13.5588 6.94154 13.5588 6.56709C13.5588 6.19315 13.2561 5.88981 12.8821 5.88908L11.5567 5.88652C11.3787 5.88618 11.2898 5.67096 11.4157 5.5451L14.5196 2.44118C14.7849 2.17586 14.7849 1.74571 14.5196 1.48039Z" fill="#55566B"/>
|
|
5
|
+
<path d="M14.5196 14.5196C14.2543 14.7849 13.8241 14.7849 13.5588 14.5196L10.4549 11.4157C10.329 11.2898 10.1138 11.3787 10.1135 11.5567L10.1109 12.8821C10.1102 13.2561 9.80685 13.5588 9.43291 13.5588C9.05846 13.5588 8.7549 13.2553 8.7549 12.8808V9.7549C8.7549 9.20262 9.20262 8.7549 9.7549 8.7549H12.8808C13.2553 8.7549 13.5588 9.05846 13.5588 9.43291C13.5588 9.80685 13.2561 10.1102 12.8821 10.1109L11.5567 10.1135C11.3787 10.1138 11.2898 10.329 11.4157 10.4549L14.5196 13.5588C14.7849 13.8241 14.7849 14.2543 14.5196 14.5196Z" fill="#55566B"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.710142 5.53825C1.10221 5.53825 1.42028 5.22014 1.42028 4.82804V2.69216C1.42028 1.99087 1.99071 1.4204 2.69193 1.4204H4.87323C5.26529 1.4204 5.58337 1.1023 5.58337 0.710201C5.58337 0.318104 5.26529 0 4.87323 0H2.69193C1.20757 0 0 1.20767 0 2.69216V4.82804C0 5.22014 0.318078 5.53825 0.710142 5.53825ZM11.1268 0H13.3081C14.7925 0 16 1.20767 16 2.69216V4.82804C16 5.22014 15.682 5.53825 15.2899 5.53825C14.8978 5.53825 14.5798 5.22014 14.5798 4.82804V2.69216C14.5798 1.99087 14.0093 1.4204 13.3081 1.4204H11.1268C10.7347 1.4204 10.4167 1.1023 10.4167 0.710201C10.4167 0.318104 10.7347 0 11.1268 0ZM14.5798 11.1716C14.5798 10.7795 14.8978 10.4614 15.2899 10.4614C15.682 10.4614 16 10.7795 16 11.1716V13.3078C16 14.7923 14.7925 16 13.3081 16H11.1268C10.7347 16 10.4167 15.6819 10.4167 15.2898C10.4167 14.8977 10.7347 14.5796 11.1268 14.5796H13.3081C14.0093 14.5796 14.5798 14.0091 14.5798 13.3078V11.1716ZM2.69193 14.5796H4.87323C5.26529 14.5796 5.58337 14.8977 5.58337 15.2898C5.58337 15.6819 5.26529 16 4.87323 16H2.69193C1.20757 16 0 14.7923 0 13.3078V11.1716C0 10.7792 0.318078 10.4614 0.710142 10.4614C1.10221 10.4614 1.42028 10.7795 1.42028 11.1716V13.3078C1.42028 14.0091 1.99071 14.5796 2.69193 14.5796Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5055 6.45389C12.7282 6.23157 13.0888 6.23169 13.3113 6.45415C13.5338 6.67672 13.5338 7.03757 13.3113 7.26013L8.70707 11.8643C8.31655 12.2548 7.68338 12.2548 7.29286 11.8643L2.68867 7.26013C2.4661 7.03757 2.4661 6.67672 2.68867 6.45415C2.91113 6.23169 3.27178 6.23157 3.49438 6.45389L5.7219 8.67847C6.35205 9.30779 7.42854 8.86148 7.42854 7.97089V0.571428C7.42854 0.255837 7.68437 0 7.99996 0C8.31556 0 8.57139 0.255838 8.57139 0.571429V7.97089C8.57139 8.86148 9.64788 9.30779 10.278 8.67847L12.5055 6.45389ZM12.7143 14.8571C13.2665 14.8571 13.7143 14.4094 13.7143 13.8571V13.1429C13.7143 12.8273 13.9701 12.5714 14.2857 12.5714C14.6013 12.5714 14.8571 12.8273 14.8571 13.1429V14.8571C14.8571 15.4883 14.3454 16 13.7143 16H2.28568C1.6545 16 1.14282 15.4883 1.14282 14.8571V13.1429C1.14282 12.8273 1.39866 12.5714 1.71425 12.5714C2.02984 12.5714 2.28568 12.8273 2.28568 13.1429V13.8571C2.28568 14.4094 2.7334 14.8571 3.28568 14.8571H12.7143Z" fill="
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5055 6.45389C12.7282 6.23157 13.0888 6.23169 13.3113 6.45415C13.5338 6.67672 13.5338 7.03757 13.3113 7.26013L8.70707 11.8643C8.31655 12.2548 7.68338 12.2548 7.29286 11.8643L2.68867 7.26013C2.4661 7.03757 2.4661 6.67672 2.68867 6.45415C2.91113 6.23169 3.27178 6.23157 3.49438 6.45389L5.7219 8.67847C6.35205 9.30779 7.42854 8.86148 7.42854 7.97089V0.571428C7.42854 0.255837 7.68437 0 7.99996 0C8.31556 0 8.57139 0.255838 8.57139 0.571429V7.97089C8.57139 8.86148 9.64788 9.30779 10.278 8.67847L12.5055 6.45389ZM12.7143 14.8571C13.2665 14.8571 13.7143 14.4094 13.7143 13.8571V13.1429C13.7143 12.8273 13.9701 12.5714 14.2857 12.5714C14.6013 12.5714 14.8571 12.8273 14.8571 13.1429V14.8571C14.8571 15.4883 14.3454 16 13.7143 16H2.28568C1.6545 16 1.14282 15.4883 1.14282 14.8571V13.1429C1.14282 12.8273 1.39866 12.5714 1.71425 12.5714C2.02984 12.5714 2.28568 12.8273 2.28568 13.1429V13.8571C2.28568 14.4094 2.7334 14.8571 3.28568 14.8571H12.7143Z" fill="currentColor"/>
|
|
3
3
|
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.33333 0H14.6667C15.0203 0 15.3594 0.138515 15.6095 0.385075C15.8595 0.631636 16 0.966042 16 1.31473V14.462C16 14.8107 15.8595 15.1451 15.6095 15.3917C15.3594 15.6382 15.0203 15.7767 14.6667 15.7767H1.33333C0.979711 15.7767 0.640573 15.6382 0.390524 15.3917C0.140476 15.1451 0 14.8107 0 14.462V1.31473C0 0.966042 0.140476 0.631636 0.390524 0.385075C0.640573 0.138515 0.979711 0 1.33333 0ZM1.33333 10.5178V14.462H14.6667V13.1473L11.3333 9.86047L10.2733 10.9057C10.0235 11.1505 9.68558 11.288 9.33333 11.288C8.98109 11.288 8.64315 11.1505 8.39333 10.9057L4.66667 7.23101L1.33333 10.5178ZM12.2733 8.92701L14.6667 11.2869V1.31473H1.33333V8.65749L3.72667 6.29755C3.97648 6.05268 4.31442 5.91524 4.66667 5.91524C5.01891 5.91524 5.35685 6.05268 5.60667 6.29755L9.33333 9.97222L10.3933 8.92701C10.6432 8.68214 10.9811 8.5447 11.3333 8.5447C11.6856 8.5447 12.0235 8.68214 12.2733 8.92701ZM11.1111 6.24074C10.7822 6.45744 10.3956 6.57309 10 6.57309C9.46957 6.57309 8.96086 6.36532 8.58579 5.99548C8.21071 5.62564 8 5.12403 8 4.601C8 4.21096 8.1173 3.82967 8.33706 3.50536C8.55682 3.18106 8.86918 2.92829 9.23463 2.77902C9.60009 2.62976 10.0022 2.59071 10.3902 2.6668C10.7781 2.74289 11.1345 2.93072 11.4142 3.20652C11.6939 3.48232 11.8844 3.83372 11.9616 4.21627C12.0387 4.59881 11.9991 4.99533 11.8478 5.35569C11.6964 5.71604 11.44 6.02404 11.1111 6.24074ZM10.3704 4.05442C10.2607 3.98219 10.1319 3.94364 10 3.94364C9.82319 3.94364 9.65362 4.01289 9.52859 4.13617C9.40357 4.25945 9.33333 4.42666 9.33333 4.601C9.33333 4.73101 9.37243 4.85811 9.44569 4.96621C9.51894 5.07432 9.62306 5.15857 9.74488 5.20833C9.8667 5.25808 10.0007 5.2711 10.1301 5.24574C10.2594 5.22037 10.3782 5.15776 10.4714 5.06583C10.5646 4.9739 10.6281 4.85676 10.6539 4.72925C10.6796 4.60173 10.6664 4.46955 10.6159 4.34944C10.5655 4.22932 10.48 4.12666 10.3704 4.05442Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 22.5H4.5C4.10232 22.4995 3.72105 22.3414 3.43984 22.0602C3.15864 21.7789 3.00046 21.3977 3 21V3C3.00046 2.60232 3.15864 2.22105 3.43984 1.93984C3.72105 1.65864 4.10232 1.50046 4.5 1.5H13.5C13.8977 1.50046 14.279 1.65864 14.5602 1.93984C14.8414 2.22105 14.9995 2.60232 15 3V5.25H13.5V3H4.5V21H13.5V18.75H15V21C14.9995 21.3977 14.8414 21.7789 14.5602 22.0602C14.279 22.3414 13.8977 22.4995 13.5 22.5ZM18.129 12.75L15.4395 15.4395L16.5 16.5L21 12L16.5 7.5L15.4395 8.5605L18.129 11.25H8.25C7.83579 11.25 7.5 11.5858 7.5 12C7.5 12.4142 7.83579 12.75 8.25 12.75H18.129Z" fill="
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 22.5H4.5C4.10232 22.4995 3.72105 22.3414 3.43984 22.0602C3.15864 21.7789 3.00046 21.3977 3 21V3C3.00046 2.60232 3.15864 2.22105 3.43984 1.93984C3.72105 1.65864 4.10232 1.50046 4.5 1.5H13.5C13.8977 1.50046 14.279 1.65864 14.5602 1.93984C14.8414 2.22105 14.9995 2.60232 15 3V5.25H13.5V3H4.5V21H13.5V18.75H15V21C14.9995 21.3977 14.8414 21.7789 14.5602 22.0602C14.279 22.3414 13.8977 22.4995 13.5 22.5ZM18.129 12.75L15.4395 15.4395L16.5 16.5L21 12L16.5 7.5L15.4395 8.5605L18.129 11.25H8.25C7.83579 11.25 7.5 11.5858 7.5 12C7.5 12.4142 7.83579 12.75 8.25 12.75H18.129Z" fill="currentColor"/>
|
|
3
3
|
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M9.58515 2.44905C9.33729 2.20119 8.93544 2.20119 8.68758 2.44905C8.43984 2.69679 8.43971 3.09842 8.68728 3.34632L12.2105 6.87422C12.5252 7.1893 12.302 7.72754 11.8567 7.72754L2.13636 7.72754C1.78491 7.72754 1.5 8.01245 1.5 8.3639C1.5 8.71536 1.78491 9.00027 2.13636 9.00027L11.8567 9.00027C12.302 9.00027 12.5252 9.53851 12.2105 9.85359L8.68728 13.3815C8.43971 13.6294 8.43984 14.031 8.68758 14.2788C8.93544 14.5266 9.33729 14.5266 9.58515 14.2788L14.7929 9.07101C15.1834 8.68049 15.1834 8.04732 14.7929 7.6568L9.58515 2.44905Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyris/nyris-webapp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.59",
|
|
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.
|
|
11
|
-
"@nyris/nyris-react-components": "^0.3.
|
|
10
|
+
"@nyris/nyris-api": "^0.3.59",
|
|
11
|
+
"@nyris/nyris-react-components": "^0.3.59",
|
|
12
12
|
"@reduxjs/toolkit": "^2.2.1",
|
|
13
13
|
"@splidejs/react-splide": "^0.7.12",
|
|
14
14
|
"@testing-library/jest-dom": "^5.17.0",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"axios": "^0.26.1",
|
|
23
23
|
"blueimp-load-image": "^5.16.0",
|
|
24
24
|
"classnames": "^2.5.1",
|
|
25
|
+
"compressorjs": "^1.2.1",
|
|
25
26
|
"framer-motion": "^11.0.12",
|
|
26
27
|
"i18next": "^23.10.1",
|
|
27
28
|
"jotai": "^1.4.7",
|
|
@@ -43,7 +44,8 @@
|
|
|
43
44
|
"sass": "^1.71.1",
|
|
44
45
|
"typeface-roboto": "^1.1.13",
|
|
45
46
|
"typescript": "^4.9.5",
|
|
46
|
-
"web-vitals": "^2.1.4"
|
|
47
|
+
"web-vitals": "^2.1.4",
|
|
48
|
+
"zustand": "^4.5.5"
|
|
47
49
|
},
|
|
48
50
|
"scripts": {
|
|
49
51
|
"start": "react-scripts start",
|
|
@@ -73,6 +75,7 @@
|
|
|
73
75
|
"@types/jquery": "^3.5.29",
|
|
74
76
|
"@types/lodash": "^4.17.0",
|
|
75
77
|
"@types/react-instantsearch-dom": "^6.12.7",
|
|
76
|
-
"@types/react-router-dom": "^5.3.3"
|
|
78
|
+
"@types/react-router-dom": "^5.3.3",
|
|
79
|
+
"tailwindcss": "^3.4.10"
|
|
77
80
|
}
|
|
78
81
|
}
|
package/public/index.html
CHANGED
|
@@ -45,10 +45,7 @@
|
|
|
45
45
|
document.documentElement.style.setProperty("--vh", `${vh}px`);
|
|
46
46
|
</script>
|
|
47
47
|
<!-- Cadenas web viewer -->
|
|
48
|
-
<!-- <link rel="stylesheet" href="./cadenas/8.1.0/api/css/thirdparty.min.css?v=1693816692897"> -->
|
|
49
48
|
<link rel="stylesheet" href="./cadenas/8.1.0/api/css/psol.components.min.css?v=1693816692897">
|
|
50
|
-
<script type="text/javascript" src="./cadenas/8.1.0/api/js/fabric.min.js?v=1693816692897"></script>
|
|
51
|
-
<script type="text/javascript" src="./cadenas/8.1.0/api/js/quill.min.js?v=169381669289"></script>
|
|
52
49
|
<script type="text/javascript" src="./cadenas/8.1.0/api/js/thirdparty.min.js?v=1693816692897"></script>
|
|
53
50
|
<script type="text/javascript" src="./cadenas/8.1.0/api/js/psol.components.min.js?v=1693816692897"></script>
|
|
54
51
|
<!-- End Cadenas web viewer -->
|
package/src/Router.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { Route, Switch } from 'react-router-dom';
|
|
3
3
|
import Layout from 'components/Layout';
|
|
4
|
-
import App from 'App';
|
|
5
4
|
import ResultComponent from 'page/result';
|
|
6
5
|
import AuthenticatedRoute from 'components/AuthenticatedRoute';
|
|
7
6
|
import Login from 'page/Login';
|
|
8
7
|
import Logout from 'page/Logout';
|
|
8
|
+
import Home from 'page/landingPage/Home';
|
|
9
9
|
|
|
10
10
|
function Router(): JSX.Element {
|
|
11
11
|
return (
|
|
@@ -15,7 +15,7 @@ function Router(): JSX.Element {
|
|
|
15
15
|
<Route path={'/logout'} exact component={Logout} />
|
|
16
16
|
|
|
17
17
|
<Layout>
|
|
18
|
-
<AuthenticatedRoute exact strict path="/" component={
|
|
18
|
+
<AuthenticatedRoute exact strict path="/" component={Home} />
|
|
19
19
|
<AuthenticatedRoute
|
|
20
20
|
exact
|
|
21
21
|
strict
|
package/src/Store/Store.ts
CHANGED
|
@@ -11,6 +11,8 @@ declare var settings: AppSettings;
|
|
|
11
11
|
settings.algolia.enabled = true;
|
|
12
12
|
settings.preview = true;
|
|
13
13
|
settings.showFeedbackAndShare = false;
|
|
14
|
+
settings.multiImageSearch = false;
|
|
15
|
+
settings.showFeedback = false;
|
|
14
16
|
|
|
15
17
|
if (settings.rfq?.enabled && settings.support?.enabled) {
|
|
16
18
|
settings.support.enabled = false;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { RectCoords } from '@nyris/nyris-api';
|
|
2
|
+
import { create } from 'zustand';
|
|
3
|
+
|
|
4
|
+
interface RequestState {
|
|
5
|
+
requestImages: HTMLCanvasElement[];
|
|
6
|
+
query?: string;
|
|
7
|
+
regions: RectCoords[];
|
|
8
|
+
|
|
9
|
+
addRequestImage: (image: HTMLCanvasElement) => void;
|
|
10
|
+
setRequestImages: (images: HTMLCanvasElement[]) => void;
|
|
11
|
+
updateRegion: (r: RectCoords, index: number) => void;
|
|
12
|
+
setRegions: (r: RectCoords[]) => void;
|
|
13
|
+
setQuery: (query: string) => void;
|
|
14
|
+
removeImage: (index: number) => void;
|
|
15
|
+
resetRegions: () => void;
|
|
16
|
+
reset: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const useRequestStore = create<RequestState>()((set, get) => ({
|
|
20
|
+
requestImages: [],
|
|
21
|
+
query: '',
|
|
22
|
+
regions: [Array(3)].map(() => {
|
|
23
|
+
return { x1: 0, x2: 1, y1: 0, y2: 1 };
|
|
24
|
+
}),
|
|
25
|
+
|
|
26
|
+
addRequestImage: image =>
|
|
27
|
+
set(state => ({ requestImages: [...state.requestImages, image] })),
|
|
28
|
+
|
|
29
|
+
setRequestImages: images => set(state => ({ requestImages: images })),
|
|
30
|
+
|
|
31
|
+
removeImage: index => {
|
|
32
|
+
const images = get().requestImages;
|
|
33
|
+
let updatedImages = [...images];
|
|
34
|
+
|
|
35
|
+
if (index < 0 || index >= images.length) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
updatedImages.splice(index, 1);
|
|
39
|
+
set(state => ({ requestImages: updatedImages }));
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
updateRegion: (region, index) => {
|
|
43
|
+
const regions = get().regions;
|
|
44
|
+
let updatedRegions = [...regions];
|
|
45
|
+
updatedRegions[index] = region;
|
|
46
|
+
|
|
47
|
+
set(state => ({ regions: updatedRegions }));
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
setRegions: regions => set(state => ({ regions: regions })),
|
|
51
|
+
setQuery: query => set(state => ({ query: query })),
|
|
52
|
+
|
|
53
|
+
resetRegions: () =>
|
|
54
|
+
set(state => ({
|
|
55
|
+
regions: [Array(3)].map(() => {
|
|
56
|
+
return { x1: 0, x2: 1, y1: 0, y2: 1 };
|
|
57
|
+
}),
|
|
58
|
+
})),
|
|
59
|
+
|
|
60
|
+
reset: () =>
|
|
61
|
+
set(state => ({
|
|
62
|
+
requestImages: [],
|
|
63
|
+
query: '',
|
|
64
|
+
regions: [Array(3)].map(() => {
|
|
65
|
+
return { x1: 0, x2: 1, y1: 0, y2: 1 };
|
|
66
|
+
}),
|
|
67
|
+
})),
|
|
68
|
+
}));
|
|
69
|
+
|
|
70
|
+
export default useRequestStore;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Region } from '@nyris/nyris-api';
|
|
2
|
+
import { create } from 'zustand';
|
|
3
|
+
|
|
4
|
+
interface ResultState {
|
|
5
|
+
detectedObject: Record<number, Region[]>;
|
|
6
|
+
setDetectedObject: (region: Region[], index: number) => void;
|
|
7
|
+
reset: () => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const useResultStore = create<ResultState>()((set, get) => ({
|
|
11
|
+
detectedObject: {},
|
|
12
|
+
setDetectedObject: (region, index) => {
|
|
13
|
+
const detectedObject = get().detectedObject;
|
|
14
|
+
let updatedDetectedObject = { ...detectedObject };
|
|
15
|
+
updatedDetectedObject[index] = region;
|
|
16
|
+
set(state => ({ detectedObject: updatedDetectedObject }));
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
reset: () =>
|
|
20
|
+
set(state => ({
|
|
21
|
+
detectedObject: {},
|
|
22
|
+
})),
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
export default useResultStore;
|
|
@@ -105,18 +105,14 @@ export const searchSlice = createSlice({
|
|
|
105
105
|
resultSearchText: [],
|
|
106
106
|
filters: [],
|
|
107
107
|
loadingSearchAlgolia: false,
|
|
108
|
-
imageThumbSearchInput: '',
|
|
109
|
-
textSearchInputMobile: '',
|
|
110
108
|
isShowModalDetailItemMobile: false,
|
|
111
109
|
preFilter: state.preFilter || {},
|
|
112
110
|
postFilter: {},
|
|
113
|
-
preFilterDropdown: false,
|
|
114
111
|
imageCaptureHelpModal: false,
|
|
115
112
|
showFeedback: false,
|
|
116
113
|
firstSearchImage: null,
|
|
117
114
|
firstSearchResults: null,
|
|
118
115
|
firstSearchPrefilters: null,
|
|
119
|
-
firstSearchThumbSearchInput: null,
|
|
120
116
|
};
|
|
121
117
|
},
|
|
122
118
|
|
|
@@ -124,7 +120,6 @@ export const searchSlice = createSlice({
|
|
|
124
120
|
return {
|
|
125
121
|
...state,
|
|
126
122
|
requestImage: undefined,
|
|
127
|
-
imageThumbSearchInput: '',
|
|
128
123
|
results: [],
|
|
129
124
|
regions: [],
|
|
130
125
|
};
|
|
@@ -148,27 +143,15 @@ export const searchSlice = createSlice({
|
|
|
148
143
|
};
|
|
149
144
|
},
|
|
150
145
|
|
|
151
|
-
setImageSearchInput: (state, data: PayloadAction<string>) => {
|
|
152
|
-
const { payload } = data;
|
|
153
|
-
return {
|
|
154
|
-
...state,
|
|
155
|
-
imageThumbSearchInput: payload,
|
|
156
|
-
};
|
|
157
|
-
},
|
|
158
146
|
updateStatusLoading: (state, data: PayloadAction<any>) => {
|
|
159
147
|
const { payload } = data;
|
|
160
148
|
return {
|
|
161
149
|
...state,
|
|
162
150
|
loadingSearchAlgolia: payload,
|
|
151
|
+
fetchingResults: payload,
|
|
163
152
|
};
|
|
164
153
|
},
|
|
165
|
-
|
|
166
|
-
const { payload } = data;
|
|
167
|
-
return {
|
|
168
|
-
...state,
|
|
169
|
-
textSearchInputMobile: payload,
|
|
170
|
-
};
|
|
171
|
-
},
|
|
154
|
+
|
|
172
155
|
onToggleModalItemDetail: (state, data: PayloadAction<boolean>) => {
|
|
173
156
|
const { payload } = data;
|
|
174
157
|
|
|
@@ -184,12 +167,6 @@ export const searchSlice = createSlice({
|
|
|
184
167
|
preFilter: payload,
|
|
185
168
|
};
|
|
186
169
|
},
|
|
187
|
-
setPreFilterDropdown: (state, data: PayloadAction<boolean>) => {
|
|
188
|
-
return {
|
|
189
|
-
...state,
|
|
190
|
-
preFilterDropdown: data.payload,
|
|
191
|
-
};
|
|
192
|
-
},
|
|
193
170
|
setImageCaptureHelpModal: (state, data: PayloadAction<boolean>) => {
|
|
194
171
|
return {
|
|
195
172
|
...state,
|
|
@@ -250,10 +227,6 @@ export const searchSlice = createSlice({
|
|
|
250
227
|
...state,
|
|
251
228
|
firstSearchPrefilters: data.payload,
|
|
252
229
|
}),
|
|
253
|
-
setFirstSearchThumbSearchInput: (state, data: PayloadAction<any>) => ({
|
|
254
|
-
...state,
|
|
255
|
-
firstSearchThumbSearchInput: data.payload,
|
|
256
|
-
}),
|
|
257
230
|
},
|
|
258
231
|
});
|
|
259
232
|
|
|
@@ -267,10 +240,8 @@ export const {
|
|
|
267
240
|
selectionChanged,
|
|
268
241
|
setFilter,
|
|
269
242
|
setImageCaptureHelpModal,
|
|
270
|
-
setImageSearchInput,
|
|
271
243
|
setPostFilter,
|
|
272
244
|
setPreFilter,
|
|
273
|
-
setPreFilterDropdown,
|
|
274
245
|
setRegions,
|
|
275
246
|
setRequestImage,
|
|
276
247
|
setSearchResults,
|
|
@@ -280,11 +251,9 @@ export const {
|
|
|
280
251
|
updateResultChangePosition,
|
|
281
252
|
updateResults,
|
|
282
253
|
updateStatusLoading,
|
|
283
|
-
updateValueTextSearchMobile,
|
|
284
254
|
setShowFeedback,
|
|
285
255
|
setFirstSearchImage,
|
|
286
256
|
setFirstSearchResults,
|
|
287
257
|
setFirstSearchPrefilters,
|
|
288
|
-
setFirstSearchThumbSearchInput,
|
|
289
258
|
} = searchSlice.actions;
|
|
290
259
|
export default searchSlice.reducer;
|
|
@@ -6,17 +6,15 @@ export const initialState: SearchState = {
|
|
|
6
6
|
fetchingResults: false,
|
|
7
7
|
filterOptions: [],
|
|
8
8
|
filters: [],
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
isShowModalDetailItemMobile: false,
|
|
11
11
|
preFilter: {},
|
|
12
12
|
loadingSearchAlgolia: false,
|
|
13
|
-
preFilterDropdown: false,
|
|
14
13
|
imageCaptureHelpModal: false,
|
|
15
14
|
regions: [],
|
|
16
15
|
requestImage: undefined,
|
|
17
16
|
results: [],
|
|
18
17
|
selectedRegion: undefined,
|
|
19
|
-
textSearchInputMobile: '',
|
|
20
18
|
valueTextSearch: {
|
|
21
19
|
configure: { filters: '' },
|
|
22
20
|
page: 1,
|
|
@@ -27,5 +25,4 @@ export const initialState: SearchState = {
|
|
|
27
25
|
firstSearchImage: '',
|
|
28
26
|
firstSearchResults: null,
|
|
29
27
|
firstSearchPrefilters: null,
|
|
30
|
-
firstSearchThumbSearchInput: null,
|
|
31
28
|
};
|
|
@@ -13,11 +13,9 @@ export interface SearchState {
|
|
|
13
13
|
fetchingResults: boolean;
|
|
14
14
|
filterOptions: string[];
|
|
15
15
|
filters: any[];
|
|
16
|
-
imageThumbSearchInput?: any;
|
|
17
16
|
isShowModalDetailItemMobile?: boolean;
|
|
18
17
|
preFilter: Record<string, boolean>;
|
|
19
18
|
loadingSearchAlgolia: boolean;
|
|
20
|
-
preFilterDropdown?: boolean;
|
|
21
19
|
imageCaptureHelpModal?: boolean;
|
|
22
20
|
regions: Region[];
|
|
23
21
|
requestId?: string;
|
|
@@ -26,13 +24,10 @@ export interface SearchState {
|
|
|
26
24
|
selectedRegion?: RectCoords;
|
|
27
25
|
sessionId?: string;
|
|
28
26
|
queryText?: string;
|
|
29
|
-
setPreFilterDropdown?: any;
|
|
30
|
-
textSearchInputMobile?: string;
|
|
31
27
|
valueTextSearch: any;
|
|
32
28
|
postFilter: Record<string, Record<string, boolean>>;
|
|
33
29
|
showFeedback?: boolean;
|
|
34
30
|
firstSearchImage: any;
|
|
35
31
|
firstSearchResults: any;
|
|
36
32
|
firstSearchPrefilters: any;
|
|
37
|
-
firstSearchThumbSearchInput: any;
|
|
38
33
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!-- License: CC Attribution. Made by iconhub: https://iconhub.io/ -->
|
|
3
|
+
<svg width="16px" height="16px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" id="up" class="icon glyph"><path d="M19.71,9.29l-7-7h0a1.15,1.15,0,0,0-.33-.21.94.94,0,0,0-.76,0,1.15,1.15,0,0,0-.33.21h0l-7,7a1,1,0,0,0,1.42,1.42L11,5.41V21a1,1,0,0,0,2,0V5.41l5.29,5.3a1,1,0,0,0,1.42,0A1,1,0,0,0,19.71,9.29Z" fill="currentColor"></path></svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M16 13.7139C16 14.0295 15.7442 14.2853 15.4286 14.2853H0.571429C0.255837 14.2853 0 14.0295 0 13.7139V3.99958C0 3.68399 0.255837 3.42815 0.571429 3.42815H4.26286L5.24 1.97101C5.34513 1.81136 5.52313 1.71486 5.71429 1.71387H10.2857C10.4769 1.71486 10.6549 1.81136 10.76 1.97101L11.7371 3.42815H15.4286C15.7442 3.42815 16 3.68399 16 3.99958V13.7139ZM1.14286 13.1424H14.8571V4.57101H11.4286C11.2374 4.57002 11.0594 4.47352 10.9543 4.31387L9.97714 2.85672H6.02286L5.04571 4.31387C4.94058 4.47352 4.76258 4.57002 4.57143 4.57101H1.14286V13.1424ZM8 11.9996C6.10645 11.9996 4.57143 10.4646 4.57143 8.57101C4.57143 6.67746 6.10645 5.14244 8 5.14244C9.89355 5.14244 11.4286 6.67746 11.4286 8.57101C11.4286 10.4646 9.89355 11.9996 8 11.9996ZM8 6.2853C6.73764 6.2853 5.71429 7.30865 5.71429 8.57101C5.71429 9.83337 6.73764 10.8567 8 10.8567C9.26237 10.8567 10.2857 9.83337 10.2857 8.57101C10.2857 7.30865 9.26237 6.2853 8 6.2853Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M1.48039 1.48039C1.74571 1.21508 2.17586 1.21508 2.44118 1.48039L5.5451 4.58431C5.67096 4.71018 5.88618 4.62127 5.88652 4.44328L5.88908 3.11787C5.88981 2.74393 6.19315 2.44118 6.56709 2.44118C6.94154 2.44118 7.2451 2.74473 7.2451 3.11918V6.2451C7.2451 6.79738 6.79738 7.2451 6.2451 7.2451H3.11918C2.74473 7.2451 2.44118 6.94154 2.44118 6.56709C2.44118 6.19315 2.74393 5.88981 3.11787 5.88908L4.44328 5.88652C4.62127 5.88618 4.71018 5.67096 4.58431 5.5451L1.48039 2.44118C1.21508 2.17586 1.21508 1.74571 1.48039 1.48039Z" fill="#55566B"/>
|
|
3
|
+
<path d="M3.11918 8.7549C2.74473 8.7549 2.44118 9.05846 2.44118 9.43291C2.44118 9.80685 2.74393 10.1102 3.11787 10.1109L4.44328 10.1135C4.62127 10.1138 4.71018 10.329 4.58431 10.4549L1.48039 13.5588C1.21508 13.8241 1.21508 14.2543 1.48039 14.5196C1.74571 14.7849 2.17586 14.7849 2.44118 14.5196L5.5451 11.4157C5.67096 11.2898 5.88618 11.3787 5.88652 11.5567L5.88908 12.8821C5.88981 13.2561 6.19315 13.5588 6.56709 13.5588C6.94154 13.5588 7.2451 13.2553 7.2451 12.8808V9.7549C7.2451 9.20262 6.79738 8.7549 6.2451 8.7549H3.11918Z" fill="#55566B"/>
|
|
4
|
+
<path d="M14.5196 1.48039C14.2543 1.21508 13.8241 1.21508 13.5588 1.48039L10.4549 4.58431C10.329 4.71018 10.1138 4.62127 10.1135 4.44328L10.1109 3.11787C10.1102 2.74393 9.80685 2.44118 9.43291 2.44118C9.05846 2.44118 8.7549 2.74473 8.7549 3.11918V6.2451C8.7549 6.79738 9.20262 7.2451 9.7549 7.2451H12.8808C13.2553 7.2451 13.5588 6.94154 13.5588 6.56709C13.5588 6.19315 13.2561 5.88981 12.8821 5.88908L11.5567 5.88652C11.3787 5.88618 11.2898 5.67096 11.4157 5.5451L14.5196 2.44118C14.7849 2.17586 14.7849 1.74571 14.5196 1.48039Z" fill="#55566B"/>
|
|
5
|
+
<path d="M14.5196 14.5196C14.2543 14.7849 13.8241 14.7849 13.5588 14.5196L10.4549 11.4157C10.329 11.2898 10.1138 11.3787 10.1135 11.5567L10.1109 12.8821C10.1102 13.2561 9.80685 13.5588 9.43291 13.5588C9.05846 13.5588 8.7549 13.2553 8.7549 12.8808V9.7549C8.7549 9.20262 9.20262 8.7549 9.7549 8.7549H12.8808C13.2553 8.7549 13.5588 9.05846 13.5588 9.43291C13.5588 9.80685 13.2561 10.1102 12.8821 10.1109L11.5567 10.1135C11.3787 10.1138 11.2898 10.329 11.4157 10.4549L14.5196 13.5588C14.7849 13.8241 14.7849 14.2543 14.5196 14.5196Z" fill="#55566B"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.710142 5.53825C1.10221 5.53825 1.42028 5.22014 1.42028 4.82804V2.69216C1.42028 1.99087 1.99071 1.4204 2.69193 1.4204H4.87323C5.26529 1.4204 5.58337 1.1023 5.58337 0.710201C5.58337 0.318104 5.26529 0 4.87323 0H2.69193C1.20757 0 0 1.20767 0 2.69216V4.82804C0 5.22014 0.318078 5.53825 0.710142 5.53825ZM11.1268 0H13.3081C14.7925 0 16 1.20767 16 2.69216V4.82804C16 5.22014 15.682 5.53825 15.2899 5.53825C14.8978 5.53825 14.5798 5.22014 14.5798 4.82804V2.69216C14.5798 1.99087 14.0093 1.4204 13.3081 1.4204H11.1268C10.7347 1.4204 10.4167 1.1023 10.4167 0.710201C10.4167 0.318104 10.7347 0 11.1268 0ZM14.5798 11.1716C14.5798 10.7795 14.8978 10.4614 15.2899 10.4614C15.682 10.4614 16 10.7795 16 11.1716V13.3078C16 14.7923 14.7925 16 13.3081 16H11.1268C10.7347 16 10.4167 15.6819 10.4167 15.2898C10.4167 14.8977 10.7347 14.5796 11.1268 14.5796H13.3081C14.0093 14.5796 14.5798 14.0091 14.5798 13.3078V11.1716ZM2.69193 14.5796H4.87323C5.26529 14.5796 5.58337 14.8977 5.58337 15.2898C5.58337 15.6819 5.26529 16 4.87323 16H2.69193C1.20757 16 0 14.7923 0 13.3078V11.1716C0 10.7792 0.318078 10.4614 0.710142 10.4614C1.10221 10.4614 1.42028 10.7795 1.42028 11.1716V13.3078C1.42028 14.0091 1.99071 14.5796 2.69193 14.5796Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5055 6.45389C12.7282 6.23157 13.0888 6.23169 13.3113 6.45415C13.5338 6.67672 13.5338 7.03757 13.3113 7.26013L8.70707 11.8643C8.31655 12.2548 7.68338 12.2548 7.29286 11.8643L2.68867 7.26013C2.4661 7.03757 2.4661 6.67672 2.68867 6.45415C2.91113 6.23169 3.27178 6.23157 3.49438 6.45389L5.7219 8.67847C6.35205 9.30779 7.42854 8.86148 7.42854 7.97089V0.571428C7.42854 0.255837 7.68437 0 7.99996 0C8.31556 0 8.57139 0.255838 8.57139 0.571429V7.97089C8.57139 8.86148 9.64788 9.30779 10.278 8.67847L12.5055 6.45389ZM12.7143 14.8571C13.2665 14.8571 13.7143 14.4094 13.7143 13.8571V13.1429C13.7143 12.8273 13.9701 12.5714 14.2857 12.5714C14.6013 12.5714 14.8571 12.8273 14.8571 13.1429V14.8571C14.8571 15.4883 14.3454 16 13.7143 16H2.28568C1.6545 16 1.14282 15.4883 1.14282 14.8571V13.1429C1.14282 12.8273 1.39866 12.5714 1.71425 12.5714C2.02984 12.5714 2.28568 12.8273 2.28568 13.1429V13.8571C2.28568 14.4094 2.7334 14.8571 3.28568 14.8571H12.7143Z" fill="
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5055 6.45389C12.7282 6.23157 13.0888 6.23169 13.3113 6.45415C13.5338 6.67672 13.5338 7.03757 13.3113 7.26013L8.70707 11.8643C8.31655 12.2548 7.68338 12.2548 7.29286 11.8643L2.68867 7.26013C2.4661 7.03757 2.4661 6.67672 2.68867 6.45415C2.91113 6.23169 3.27178 6.23157 3.49438 6.45389L5.7219 8.67847C6.35205 9.30779 7.42854 8.86148 7.42854 7.97089V0.571428C7.42854 0.255837 7.68437 0 7.99996 0C8.31556 0 8.57139 0.255838 8.57139 0.571429V7.97089C8.57139 8.86148 9.64788 9.30779 10.278 8.67847L12.5055 6.45389ZM12.7143 14.8571C13.2665 14.8571 13.7143 14.4094 13.7143 13.8571V13.1429C13.7143 12.8273 13.9701 12.5714 14.2857 12.5714C14.6013 12.5714 14.8571 12.8273 14.8571 13.1429V14.8571C14.8571 15.4883 14.3454 16 13.7143 16H2.28568C1.6545 16 1.14282 15.4883 1.14282 14.8571V13.1429C1.14282 12.8273 1.39866 12.5714 1.71425 12.5714C2.02984 12.5714 2.28568 12.8273 2.28568 13.1429V13.8571C2.28568 14.4094 2.7334 14.8571 3.28568 14.8571H12.7143Z" fill="currentColor"/>
|
|
3
3
|
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.33333 0H14.6667C15.0203 0 15.3594 0.138515 15.6095 0.385075C15.8595 0.631636 16 0.966042 16 1.31473V14.462C16 14.8107 15.8595 15.1451 15.6095 15.3917C15.3594 15.6382 15.0203 15.7767 14.6667 15.7767H1.33333C0.979711 15.7767 0.640573 15.6382 0.390524 15.3917C0.140476 15.1451 0 14.8107 0 14.462V1.31473C0 0.966042 0.140476 0.631636 0.390524 0.385075C0.640573 0.138515 0.979711 0 1.33333 0ZM1.33333 10.5178V14.462H14.6667V13.1473L11.3333 9.86047L10.2733 10.9057C10.0235 11.1505 9.68558 11.288 9.33333 11.288C8.98109 11.288 8.64315 11.1505 8.39333 10.9057L4.66667 7.23101L1.33333 10.5178ZM12.2733 8.92701L14.6667 11.2869V1.31473H1.33333V8.65749L3.72667 6.29755C3.97648 6.05268 4.31442 5.91524 4.66667 5.91524C5.01891 5.91524 5.35685 6.05268 5.60667 6.29755L9.33333 9.97222L10.3933 8.92701C10.6432 8.68214 10.9811 8.5447 11.3333 8.5447C11.6856 8.5447 12.0235 8.68214 12.2733 8.92701ZM11.1111 6.24074C10.7822 6.45744 10.3956 6.57309 10 6.57309C9.46957 6.57309 8.96086 6.36532 8.58579 5.99548C8.21071 5.62564 8 5.12403 8 4.601C8 4.21096 8.1173 3.82967 8.33706 3.50536C8.55682 3.18106 8.86918 2.92829 9.23463 2.77902C9.60009 2.62976 10.0022 2.59071 10.3902 2.6668C10.7781 2.74289 11.1345 2.93072 11.4142 3.20652C11.6939 3.48232 11.8844 3.83372 11.9616 4.21627C12.0387 4.59881 11.9991 4.99533 11.8478 5.35569C11.6964 5.71604 11.44 6.02404 11.1111 6.24074ZM10.3704 4.05442C10.2607 3.98219 10.1319 3.94364 10 3.94364C9.82319 3.94364 9.65362 4.01289 9.52859 4.13617C9.40357 4.25945 9.33333 4.42666 9.33333 4.601C9.33333 4.73101 9.37243 4.85811 9.44569 4.96621C9.51894 5.07432 9.62306 5.15857 9.74488 5.20833C9.8667 5.25808 10.0007 5.2711 10.1301 5.24574C10.2594 5.22037 10.3782 5.15776 10.4714 5.06583C10.5646 4.9739 10.6281 4.85676 10.6539 4.72925C10.6796 4.60173 10.6664 4.46955 10.6159 4.34944C10.5655 4.22932 10.48 4.12666 10.3704 4.05442Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 22.5H4.5C4.10232 22.4995 3.72105 22.3414 3.43984 22.0602C3.15864 21.7789 3.00046 21.3977 3 21V3C3.00046 2.60232 3.15864 2.22105 3.43984 1.93984C3.72105 1.65864 4.10232 1.50046 4.5 1.5H13.5C13.8977 1.50046 14.279 1.65864 14.5602 1.93984C14.8414 2.22105 14.9995 2.60232 15 3V5.25H13.5V3H4.5V21H13.5V18.75H15V21C14.9995 21.3977 14.8414 21.7789 14.5602 22.0602C14.279 22.3414 13.8977 22.4995 13.5 22.5ZM18.129 12.75L15.4395 15.4395L16.5 16.5L21 12L16.5 7.5L15.4395 8.5605L18.129 11.25H8.25C7.83579 11.25 7.5 11.5858 7.5 12C7.5 12.4142 7.83579 12.75 8.25 12.75H18.129Z" fill="
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 22.5H4.5C4.10232 22.4995 3.72105 22.3414 3.43984 22.0602C3.15864 21.7789 3.00046 21.3977 3 21V3C3.00046 2.60232 3.15864 2.22105 3.43984 1.93984C3.72105 1.65864 4.10232 1.50046 4.5 1.5H13.5C13.8977 1.50046 14.279 1.65864 14.5602 1.93984C14.8414 2.22105 14.9995 2.60232 15 3V5.25H13.5V3H4.5V21H13.5V18.75H15V21C14.9995 21.3977 14.8414 21.7789 14.5602 22.0602C14.279 22.3414 13.8977 22.4995 13.5 22.5ZM18.129 12.75L15.4395 15.4395L16.5 16.5L21 12L16.5 7.5L15.4395 8.5605L18.129 11.25H8.25C7.83579 11.25 7.5 11.5858 7.5 12C7.5 12.4142 7.83579 12.75 8.25 12.75H18.129Z" fill="currentColor"/>
|
|
3
3
|
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M9.58515 2.44905C9.33729 2.20119 8.93544 2.20119 8.68758 2.44905C8.43984 2.69679 8.43971 3.09842 8.68728 3.34632L12.2105 6.87422C12.5252 7.1893 12.302 7.72754 11.8567 7.72754L2.13636 7.72754C1.78491 7.72754 1.5 8.01245 1.5 8.3639C1.5 8.71536 1.78491 9.00027 2.13636 9.00027L11.8567 9.00027C12.302 9.00027 12.5252 9.53851 12.2105 9.85359L8.68728 13.3815C8.43971 13.6294 8.43984 14.031 8.68758 14.2788C8.93544 14.5266 9.33729 14.5266 9.58515 14.2788L14.7929 9.07101C15.1834 8.68049 15.1834 8.04732 14.7929 7.6568L9.58515 2.44905Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { memo } from 'react';
|
|
2
2
|
import { useDropzone } from 'react-dropzone';
|
|
3
3
|
import { useAppDispatch, useAppSelector } from 'Store/Store';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
setSearchResults,
|
|
7
|
-
setRequestImage,
|
|
8
|
-
setImageSearchInput,
|
|
9
|
-
updateStatusLoading,
|
|
10
|
-
loadingActionResults,
|
|
11
|
-
setRegions,
|
|
12
|
-
setSelectedRegion,
|
|
13
|
-
setShowFeedback,
|
|
14
|
-
setFirstSearchResults,
|
|
15
|
-
setFirstSearchImage,
|
|
16
|
-
setFirstSearchPrefilters,
|
|
17
|
-
setFirstSearchThumbSearchInput
|
|
18
|
-
} from 'Store/search/Search';
|
|
4
|
+
import { updateStatusLoading, loadingActionResults } from 'Store/search/Search';
|
|
19
5
|
import { useHistory } from 'react-router-dom';
|
|
20
6
|
import { ReactComponent as IconDownload } from 'common/assets/icons/IconUploadDownward.svg';
|
|
21
7
|
|
|
22
|
-
import { RectCoords } from '@nyris/nyris-api';
|
|
23
8
|
import { useTranslation } from 'react-i18next';
|
|
24
|
-
import { isEmpty } from 'lodash';
|
|
25
9
|
import Loading from './Loading';
|
|
10
|
+
import { useImageSearch } from 'hooks/useImageSearch';
|
|
26
11
|
|
|
27
12
|
interface Props {
|
|
28
13
|
acceptTypes: any;
|
|
@@ -33,78 +18,32 @@ interface Props {
|
|
|
33
18
|
function DragDropFile(props: Props) {
|
|
34
19
|
const history = useHistory();
|
|
35
20
|
const dispatch = useAppDispatch();
|
|
36
|
-
const {
|
|
37
|
-
const
|
|
38
|
-
const {
|
|
39
|
-
settings,
|
|
40
|
-
search: { preFilter },
|
|
41
|
-
} = searchState;
|
|
21
|
+
const { isLoading } = props;
|
|
22
|
+
const settings = useAppSelector(state => state.settings);
|
|
42
23
|
const { t } = useTranslation();
|
|
24
|
+
|
|
25
|
+
const { singleImageSearch } = useImageSearch();
|
|
26
|
+
|
|
43
27
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({
|
|
44
28
|
onDrop: async (fs: File[], _, e) => {
|
|
45
29
|
e.stopPropagation();
|
|
46
30
|
history.push('/result');
|
|
31
|
+
|
|
47
32
|
dispatch(updateStatusLoading(true));
|
|
48
33
|
dispatch(loadingActionResults());
|
|
49
|
-
onChangeLoading(true);
|
|
50
|
-
let payload: any;
|
|
51
|
-
let filters: any[] = [];
|
|
52
|
-
console.log('fs', fs);
|
|
53
|
-
dispatch(setImageSearchInput(URL.createObjectURL(fs[0])));
|
|
54
|
-
let image = await createImage(fs[0]);
|
|
55
|
-
dispatch(setRequestImage(image));
|
|
56
|
-
const preFilterValues = [
|
|
57
|
-
{
|
|
58
|
-
key: settings.visualSearchFilterKey,
|
|
59
|
-
values: Object.keys(preFilter),
|
|
60
|
-
},
|
|
61
|
-
];
|
|
62
|
-
let region: RectCoords | undefined;
|
|
63
34
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
let res = await findRegions(image, settings);
|
|
67
|
-
dispatch(setRegions(res.regions));
|
|
68
|
-
region = res.selectedRegion;
|
|
69
|
-
dispatch(setSelectedRegion(region));
|
|
70
|
-
}
|
|
71
|
-
} catch (error) {
|
|
72
|
-
} finally {
|
|
73
|
-
return find({
|
|
74
|
-
image,
|
|
75
|
-
settings,
|
|
76
|
-
region,
|
|
77
|
-
filters: !isEmpty(preFilter) ? preFilterValues : undefined,
|
|
78
|
-
}).then((res: any) => {
|
|
79
|
-
res?.results.forEach((item: any) => {
|
|
80
|
-
filters.push({
|
|
81
|
-
sku: item.sku,
|
|
82
|
-
score: item.score,
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
payload = {
|
|
86
|
-
...res,
|
|
87
|
-
filters,
|
|
88
|
-
};
|
|
89
|
-
dispatch(setSearchResults(payload));
|
|
90
|
-
onChangeLoading(false);
|
|
35
|
+
singleImageSearch({ image: fs[0], settings, showFeedback: true }).then(
|
|
36
|
+
() => {
|
|
91
37
|
dispatch(updateStatusLoading(false));
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
dispatch(setFirstSearchResults(payload));
|
|
95
|
-
dispatch(setFirstSearchImage(image));
|
|
96
|
-
dispatch(setFirstSearchPrefilters(preFilter));
|
|
97
|
-
dispatch(setFirstSearchThumbSearchInput(URL.createObjectURL(fs[0])));
|
|
98
|
-
return;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
38
|
+
},
|
|
39
|
+
);
|
|
101
40
|
},
|
|
102
41
|
});
|
|
103
42
|
|
|
104
43
|
return (
|
|
105
44
|
<div
|
|
106
45
|
className={`box-content-main`}
|
|
107
|
-
style={{ marginTop: 32, paddingTop: 0 }}
|
|
46
|
+
style={{ marginTop: 32, paddingTop: 0, display: 'flex' }}
|
|
108
47
|
>
|
|
109
48
|
{isLoading && <Loading />}
|
|
110
49
|
|
|
@@ -121,8 +60,9 @@ function DragDropFile(props: Props) {
|
|
|
121
60
|
className={`box-content-drop ${isDragActive ? 'drag-active' : ''}`}
|
|
122
61
|
{...getRootProps({
|
|
123
62
|
onClick: e => {
|
|
124
|
-
e.stopPropagation();
|
|
125
|
-
}
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
},
|
|
65
|
+
})}
|
|
126
66
|
>
|
|
127
67
|
<div style={{ marginBottom: 16 }}>
|
|
128
68
|
<IconDownload width={48} height={48} />
|