@nyris/nyris-webapp 0.3.91 → 0.3.93
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 +6 -6
- package/build/data/related-parts.json +83 -0
- package/build/index.html +1 -1
- package/build/js/settings.example.js +3 -0
- package/build/static/css/main.fed38059.css +4 -0
- package/build/static/css/main.fed38059.css.map +1 -0
- package/build/static/js/main.c9bbbcb9.js +3 -0
- package/build/static/js/{main.f2255597.js.map → main.c9bbbcb9.js.map} +1 -1
- package/package.json +4 -3
- package/public/data/related-parts.json +83 -0
- package/public/js/settings.example.js +3 -0
- package/src/App.test.tsx +0 -1
- package/src/App.tsx +0 -1
- package/src/assets/arrow_down_expanded.svg +3 -0
- package/src/assets/arrow_enter.svg +3 -0
- package/src/assets/camera.svg +3 -0
- package/src/assets/close.svg +3 -0
- package/src/assets/enter.svg +3 -0
- package/src/assets/refresh.svg +3 -0
- package/src/assets/vizo_avatar.svg +16 -0
- package/src/components/Cadenas/CadenasWebViewer.tsx +1 -1
- package/src/components/Cart.tsx +48 -36
- package/src/components/ChatAssistant/ChatAssistant.tsx +289 -0
- package/src/components/ChatAssistant/MobileChatAssistant.tsx +291 -0
- package/src/components/ChatAssistant/OptionChip.tsx +78 -0
- package/src/components/ChatAssistant/index.ts +3 -0
- package/src/components/ChatAssistant/useChatAssistantLogic.ts +745 -0
- package/src/components/CurrentRefinements.tsx +2 -2
- package/src/components/CustomCameraDrawer.tsx +56 -13
- package/src/components/DragDropFile.tsx +5 -5
- package/src/components/ExperienceVisualSearch/ExperienceVisualSearch.tsx +1 -1
- package/src/components/Header.tsx +116 -96
- package/src/components/Hint.tsx +1 -2
- package/src/components/HitsPerPage.tsx +9 -3
- package/src/components/IdentifiedAttributes.tsx +159 -0
- package/src/components/ImagePreview.tsx +32 -17
- package/src/components/ImageUpload.tsx +16 -8
- package/src/components/Inquiry/InquiryBanner.tsx +1 -1
- package/src/components/Inquiry/InquiryModal.tsx +35 -29
- package/src/components/ItemSpecification.tsx +58 -126
- package/src/components/LocationInfoPopup.tsx +33 -33
- package/src/components/MatchNotificationBanner.tsx +90 -36
- package/src/components/PostFilter/PostFilter.tsx +1 -1
- package/src/components/PostFilter/PostFilterComponent.tsx +0 -1
- package/src/components/PostFilter/PostFilterFindApi.tsx +0 -1
- package/src/components/PoweredBy.tsx +1 -1
- package/src/components/PreFilter/PreFilter.tsx +14 -3
- package/src/components/PreFilter/PreFilterModal.tsx +0 -1
- package/src/components/Product/Product.tsx +15 -11
- package/src/components/Product/ProductAttribute.tsx +4 -5
- package/src/components/Product/ProductDetailViewModal.tsx +2 -4
- package/src/components/Product/ProductList.tsx +26 -13
- package/src/components/Rfq/RfqModal.tsx +1 -1
- package/src/components/SidePanel.tsx +128 -46
- package/src/components/SmartFilter.tsx +320 -0
- package/src/components/TextSearch.tsx +134 -70
- package/src/components/UploadDisclaimer.tsx +1 -1
- package/src/hooks/useBadResultsRecovery.ts +407 -0
- package/src/hooks/useEffectiveGroundingResults.ts +54 -0
- package/src/hooks/useGoodResultsChat.ts +651 -0
- package/src/hooks/useGroundedSearch.ts +88 -0
- package/src/hooks/useImageSearch.ts +139 -187
- package/src/hooks/useResultEvaluator.ts +417 -0
- package/src/index.css +1 -1
- package/src/index.tsx +0 -1
- package/src/layouts/AppLayout.tsx +53 -2
- package/src/pages/Home.tsx +11 -52
- package/src/pages/Login.tsx +1 -2
- package/src/pages/Logout.tsx +1 -1
- package/src/pages/Result.tsx +254 -200
- package/src/providers/AuthProvider.tsx +0 -1
- package/src/services/Feedback.ts +1 -1
- package/src/services/visualSearch.ts +0 -21
- package/src/services/vizo.ts +192 -4
- package/src/stores/chat/chatStore.ts +150 -0
- package/src/stores/chat/conversationStore.ts +300 -0
- package/src/stores/request/Misc/misc.slice.ts +2 -2
- package/src/stores/request/filter/filter.slice.ts +8 -8
- package/src/stores/request/query/query.slice.ts +2 -2
- package/src/stores/request/requestImage/requestImage.slice.ts +6 -6
- package/src/stores/request/specifications/specifications.slice.ts +10 -7
- package/src/stores/result/detectedRegions/detectedRegions.slice.ts +1 -1
- package/src/stores/result/prodcuts/products.initialState.ts +12 -0
- package/src/stores/result/prodcuts/products.slice.ts +28 -8
- package/src/stores/result/session/session.slice.ts +2 -2
- package/src/stores/smartFilters/smartFiltersStore.ts +270 -0
- package/src/stores/types.ts +41 -0
- package/src/stores/ui/ai/ai.initialState.ts +5 -0
- package/src/stores/ui/ai/ai.slice.ts +15 -0
- package/src/stores/ui/banner/banner.initialState.ts +6 -0
- package/src/stores/ui/banner/banner.slice.ts +14 -0
- package/src/stores/ui/feedback/feedback.slice.ts +1 -1
- package/src/stores/ui/loading/loading.slice.ts +4 -4
- package/src/stores/ui/uiStore.ts +7 -1
- package/src/styles/product.scss +0 -2
- package/src/types.ts +4 -8
- package/src/utils/cropImageToBase64.ts +32 -0
- package/src/utils/fetchProductImage.ts +109 -0
- package/src/utils/imageConverters.ts +124 -0
- package/src/utils/relatedParts.ts +35 -0
- package/src/utils/specificationFilter.ts +1 -5
- package/tailwind.config.js +3 -2
- package/build/static/css/main.734b52e1.css +0 -4
- package/build/static/css/main.734b52e1.css.map +0 -1
- package/build/static/js/main.f2255597.js +0 -3
- package/src/utils/addAssets.ts +0 -40
- /package/build/static/js/{main.f2255597.js.LICENSE.txt → main.c9bbbcb9.js.LICENSE.txt} +0 -0
package/src/pages/Result.tsx
CHANGED
|
@@ -26,11 +26,15 @@ import { useCurrentRefinements } from 'react-instantsearch';
|
|
|
26
26
|
import CustomCamera from 'components/CustomCameraDrawer';
|
|
27
27
|
import { useTranslation } from 'react-i18next';
|
|
28
28
|
import { useImageSearch } from 'hooks/useImageSearch';
|
|
29
|
-
import ItemSpecification from 'components/ItemSpecification';
|
|
30
29
|
import MatchNotificationBanner from 'components/MatchNotificationBanner';
|
|
30
|
+
import ImageUpload from 'components/ImageUpload';
|
|
31
|
+
import SmartFilter from 'components/SmartFilter';
|
|
32
|
+
import { ChatAssistant, MobileChatAssistant } from 'components/ChatAssistant';
|
|
33
|
+
import IdentifiedAttributes from 'components/IdentifiedAttributes';
|
|
31
34
|
|
|
32
35
|
function Results() {
|
|
33
36
|
const settings = window.settings;
|
|
37
|
+
const isSmartFiltersEnabled = !!settings.useSmartFilters;
|
|
34
38
|
const cadenas = settings.cadenas;
|
|
35
39
|
|
|
36
40
|
const [feedbackStatus, setFeedbackStatus] = useState<
|
|
@@ -50,6 +54,7 @@ function Results() {
|
|
|
50
54
|
const setShowFeedback = useUiStore(state => state.setShowFeedback);
|
|
51
55
|
const showFeedback = useUiStore(state => state.showFeedback);
|
|
52
56
|
const setIsFindApiLoading = useUiStore(state => state.setIsFindApiLoading);
|
|
57
|
+
const isAiModeOpen = useUiStore(state => state.isAiModeOpen);
|
|
53
58
|
|
|
54
59
|
const requestId = useResultStore(state => state.requestId);
|
|
55
60
|
const imageAnalysis = useResultStore(state => state.imageAnalysis);
|
|
@@ -169,6 +174,10 @@ function Results() {
|
|
|
169
174
|
]);
|
|
170
175
|
|
|
171
176
|
const disablePostFilter = useMemo(() => {
|
|
177
|
+
if (!settings.algolia.enabled) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
|
|
172
181
|
return settings.postFilterOption && productsFromAlgolia.length > 0
|
|
173
182
|
? false
|
|
174
183
|
: true;
|
|
@@ -183,245 +192,273 @@ function Results() {
|
|
|
183
192
|
<Loading />
|
|
184
193
|
</div>
|
|
185
194
|
)}
|
|
186
|
-
<div className="h-full">
|
|
195
|
+
<div className="h-full overflow-y-auto overflow-x-hidden desktop:overflow-hidden">
|
|
187
196
|
<div
|
|
188
197
|
className={twMerge([
|
|
189
198
|
'flex',
|
|
190
199
|
'flex-col',
|
|
191
200
|
'desktop:flex-row',
|
|
192
|
-
'justify-between',
|
|
193
|
-
'relative',
|
|
194
201
|
'h-full',
|
|
202
|
+
'desktop:min-h-0',
|
|
195
203
|
])}
|
|
196
204
|
>
|
|
197
|
-
<SidePanel className="hidden desktop:flex" />
|
|
198
|
-
|
|
199
|
-
<div className="
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
requestImages[0] ? 'pt-0' : 'pt-3',
|
|
203
|
-
'desktop:pt-0',
|
|
204
|
-
'desktop:mt-0',
|
|
205
|
-
'flex',
|
|
206
|
-
'flex-col',
|
|
207
|
-
'relative',
|
|
208
|
-
'w-full',
|
|
209
|
-
'mr-auto',
|
|
210
|
-
'ml-auto',
|
|
211
|
-
'max-h-full',
|
|
212
|
-
'flex-1',
|
|
213
|
-
'overflow-y-auto',
|
|
214
|
-
])}
|
|
215
|
-
>
|
|
216
|
-
<div className="block desktop:hidden desktop:mb-0">
|
|
217
|
-
{requestImages[0] && <ImagePreview />}
|
|
218
|
-
{window.settings.showImageDetails &&
|
|
219
|
-
(imageAnalysis?.imageDescription ||
|
|
220
|
-
Object.keys(imageAnalysis?.specification || {}).length >
|
|
221
|
-
0) && (
|
|
222
|
-
<div className="p-2">
|
|
223
|
-
<div className="self-stretch p-4 bg-[#f3f3f5] rounded flex justify-start flex-col items-start gap-2 flex-wrap content-start w-full">
|
|
224
|
-
{imageAnalysis?.imageDescription !==
|
|
225
|
-
'No description available' && (
|
|
226
|
-
<div className="self-stretch flex flex-col justify-start items-start">
|
|
227
|
-
<div className="justify-start text-black text-base font-semibold">
|
|
228
|
-
Image description
|
|
229
|
-
</div>
|
|
230
|
-
<div className="self-stretch justify-start text-black text-sm font-normal">
|
|
231
|
-
{imageAnalysis?.imageDescription || ''}
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
)}
|
|
235
|
-
|
|
236
|
-
{Object.keys(imageAnalysis?.specification || {})
|
|
237
|
-
.filter(
|
|
238
|
-
key =>
|
|
239
|
-
key !== 'is_nameplate' &&
|
|
240
|
-
key !== 'prefilter_value',
|
|
241
|
-
)
|
|
242
|
-
.some(key => !!imageAnalysis?.specification[key]) && (
|
|
243
|
-
<div className="justify-start text-[#2b2c46] text-base font-semibold mt-1">
|
|
244
|
-
Identified Attributes
|
|
245
|
-
</div>
|
|
246
|
-
)}
|
|
247
|
-
<div className="flex justify-start items-start gap-4 flex-wrap content-start">
|
|
248
|
-
{Object.keys(imageAnalysis?.specification || {})
|
|
249
|
-
.filter(
|
|
250
|
-
key =>
|
|
251
|
-
key !== 'is_nameplate' &&
|
|
252
|
-
key !== 'prefilter_value',
|
|
253
|
-
)
|
|
254
|
-
.map(key => {
|
|
255
|
-
const value = imageAnalysis?.specification[key];
|
|
256
|
-
if (!value) {
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
return (
|
|
260
|
-
<ItemSpecification
|
|
261
|
-
attr={key}
|
|
262
|
-
value={value}
|
|
263
|
-
specificationFilter={specificationFilter}
|
|
264
|
-
imageAnalysis={imageAnalysis}
|
|
265
|
-
/>
|
|
266
|
-
);
|
|
267
|
-
})}
|
|
268
|
-
</div>
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
)}
|
|
272
|
-
</div>
|
|
205
|
+
<SidePanel className="hidden desktop:flex h-full max-h-full min-h-0" />
|
|
206
|
+
{/* Scrollable area: results + sticky chat. Scrollbar lands at far right. */}
|
|
207
|
+
<div className="flex-1 flex flex-col desktop:flex-row desktop:h-full desktop:min-h-0 desktop:overflow-y-auto">
|
|
208
|
+
{/* Result content */}
|
|
209
|
+
<div className="w-full min-h-full flex flex-col desktop:min-h-0 flex-1">
|
|
273
210
|
<div
|
|
274
211
|
className={twMerge([
|
|
275
|
-
requestImages[0]
|
|
276
|
-
'desktop:pt-
|
|
277
|
-
'desktop:
|
|
278
|
-
'desktop:overflow-y-auto',
|
|
212
|
+
requestImages[0] && 'pt-0',
|
|
213
|
+
'desktop:pt-0',
|
|
214
|
+
'desktop:mt-0',
|
|
279
215
|
'flex',
|
|
280
216
|
'flex-col',
|
|
281
217
|
'relative',
|
|
282
218
|
'w-full',
|
|
283
219
|
'mr-auto',
|
|
284
220
|
'ml-auto',
|
|
285
|
-
'
|
|
221
|
+
'flex-1',
|
|
286
222
|
])}
|
|
287
223
|
>
|
|
224
|
+
<div className="block desktop:hidden desktop:mb-0 mx-2">
|
|
225
|
+
{requestImages[0] && <ImagePreview />}
|
|
226
|
+
{isSmartFiltersEnabled &&
|
|
227
|
+
(imageAnalysis?.imageDescription ||
|
|
228
|
+
Object.keys(imageAnalysis?.specification || {}).length >
|
|
229
|
+
0) && (
|
|
230
|
+
<div className="my-4">
|
|
231
|
+
<SmartFilter
|
|
232
|
+
imageAnalysis={imageAnalysis}
|
|
233
|
+
specificationFilter={specificationFilter}
|
|
234
|
+
/>
|
|
235
|
+
</div>
|
|
236
|
+
)}
|
|
237
|
+
{window.settings.showImageDetails &&
|
|
238
|
+
(imageAnalysis?.imageDescription ||
|
|
239
|
+
Object.keys(imageAnalysis?.specification || {}).length >
|
|
240
|
+
0) && (
|
|
241
|
+
<div className="p-2">
|
|
242
|
+
<div className="self-stretch p-4 bg-[#e9e9ef] rounded-[32px] flex justify-start flex-col items-start gap-2 flex-wrap content-start w-full">
|
|
243
|
+
{imageAnalysis?.imageDescription !==
|
|
244
|
+
'No description available' && (
|
|
245
|
+
<div className="self-stretch flex flex-col justify-start items-start">
|
|
246
|
+
<div className="justify-start text-black text-base font-semibold">
|
|
247
|
+
Image description
|
|
248
|
+
</div>
|
|
249
|
+
<div className="self-stretch justify-start text-black text-sm font-normal">
|
|
250
|
+
{imageAnalysis?.imageDescription || ''}
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
)}
|
|
254
|
+
|
|
255
|
+
{Object.keys(imageAnalysis?.specification || {})
|
|
256
|
+
.filter(
|
|
257
|
+
key =>
|
|
258
|
+
key !== 'is_nameplate' &&
|
|
259
|
+
key !== 'prefilter_value',
|
|
260
|
+
)
|
|
261
|
+
.some(
|
|
262
|
+
key => !!imageAnalysis?.specification[key],
|
|
263
|
+
) && (
|
|
264
|
+
<div className="justify-start text-[#2b2c46] text-base font-semibold mt-1">
|
|
265
|
+
Identified Attributes
|
|
266
|
+
</div>
|
|
267
|
+
)}
|
|
268
|
+
<div className="flex justify-start items-start gap-4 flex-wrap content-start">
|
|
269
|
+
{Object.keys(imageAnalysis?.specification || {})
|
|
270
|
+
.filter(
|
|
271
|
+
key =>
|
|
272
|
+
key !== 'is_nameplate' &&
|
|
273
|
+
key !== 'prefilter_value',
|
|
274
|
+
)
|
|
275
|
+
.map(key => {
|
|
276
|
+
const value = imageAnalysis?.specification[key];
|
|
277
|
+
if (!value) {
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
return (
|
|
281
|
+
<IdentifiedAttributes
|
|
282
|
+
attr={key}
|
|
283
|
+
value={value}
|
|
284
|
+
specificationFilter={specificationFilter}
|
|
285
|
+
imageAnalysis={imageAnalysis}
|
|
286
|
+
/>
|
|
287
|
+
);
|
|
288
|
+
})}
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
</div>
|
|
292
|
+
)}
|
|
293
|
+
</div>
|
|
288
294
|
<div
|
|
289
295
|
className={twMerge([
|
|
296
|
+
requestImages[0] && 'pt-0',
|
|
297
|
+
'desktop:pt-4',
|
|
290
298
|
'flex',
|
|
291
299
|
'flex-col',
|
|
300
|
+
'relative',
|
|
301
|
+
'w-full',
|
|
302
|
+
'mr-auto',
|
|
303
|
+
'ml-auto',
|
|
292
304
|
'flex-grow',
|
|
293
|
-
'desktop:mt-0',
|
|
294
305
|
])}
|
|
295
306
|
>
|
|
296
|
-
<div
|
|
297
|
-
style={{
|
|
298
|
-
fontWeight: 700,
|
|
299
|
-
fontSize: 16,
|
|
300
|
-
marginLeft: 16,
|
|
301
|
-
marginBottom: 16,
|
|
302
|
-
}}
|
|
303
|
-
>
|
|
304
|
-
{!specifications?.specificationPrefilter &&
|
|
305
|
-
specifications?.prefilter_value &&
|
|
306
|
-
window.settings.algolia.enabled &&
|
|
307
|
-
t('Showing results for machine', {
|
|
308
|
-
prefilter_title:
|
|
309
|
-
window.settings.preFilterTitle?.toLocaleLowerCase(),
|
|
310
|
-
prefilter_value: specifications.prefilter_value,
|
|
311
|
-
})}
|
|
312
|
-
</div>
|
|
313
307
|
<div
|
|
314
308
|
className={twMerge([
|
|
315
|
-
'h-full',
|
|
316
|
-
'relative',
|
|
317
309
|
'flex',
|
|
318
|
-
'
|
|
319
|
-
'
|
|
320
|
-
'
|
|
321
|
-
'desktop:mx-4',
|
|
310
|
+
'flex-col',
|
|
311
|
+
'flex-grow',
|
|
312
|
+
'desktop:mt-0',
|
|
322
313
|
])}
|
|
323
314
|
>
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
<div className="feedback-section">
|
|
341
|
-
<div className="feedback-success">
|
|
342
|
-
{t('Thank you for your feedback')}
|
|
343
|
-
</div>
|
|
344
|
-
</div>
|
|
315
|
+
{!specifications?.specificationPrefilter &&
|
|
316
|
+
specifications?.prefilter_value &&
|
|
317
|
+
window.settings.algolia.enabled && (
|
|
318
|
+
<div
|
|
319
|
+
style={{
|
|
320
|
+
fontWeight: 700,
|
|
321
|
+
fontSize: 16,
|
|
322
|
+
marginLeft: 16,
|
|
323
|
+
marginBottom: 16,
|
|
324
|
+
}}
|
|
325
|
+
>
|
|
326
|
+
{t('Showing results for machine', {
|
|
327
|
+
prefilter_title:
|
|
328
|
+
window.settings.preFilterTitle?.toLocaleLowerCase(),
|
|
329
|
+
prefilter_value: specifications.prefilter_value,
|
|
330
|
+
})}
|
|
345
331
|
</div>
|
|
346
332
|
)}
|
|
333
|
+
<div
|
|
334
|
+
className={twMerge([
|
|
335
|
+
'relative',
|
|
336
|
+
'flex',
|
|
337
|
+
'justify-center',
|
|
338
|
+
'mx-0.5',
|
|
339
|
+
'mobile-md:mx-2',
|
|
340
|
+
'desktop:mx-4',
|
|
341
|
+
])}
|
|
342
|
+
>
|
|
343
|
+
<div className="max-w-[840px] w-full relative flex flex-col justify-between mb-20 desktop:mb-0">
|
|
344
|
+
<div
|
|
345
|
+
className={twMerge(
|
|
346
|
+
'grid grid-cols-[repeat(auto-fit,_minmax(180px,_0px))] desktop:grid-cols-[repeat(auto-fit,_minmax(190px,_0px))]',
|
|
347
|
+
'gap-2 desktop:gap-6 justify-center max-w-[100%] mx-auto',
|
|
348
|
+
'w-full',
|
|
349
|
+
)}
|
|
350
|
+
>
|
|
351
|
+
<GoBackButton className="col-span-full mb-2 desktop:mb-0 mt-2 desktop:mt-0" />
|
|
352
|
+
<CurrentRefinements className="col-span-full" />
|
|
353
|
+
<MatchNotificationBanner className="col-span-full" />
|
|
354
|
+
<ProductList />
|
|
355
|
+
</div>
|
|
347
356
|
|
|
348
|
-
|
|
349
|
-
!showFeedbackSuccess &&
|
|
350
|
-
productsFromAlgolia.length > 0 && (
|
|
357
|
+
{showFeedbackSuccess && (
|
|
351
358
|
<div className={'feedback-floating'}>
|
|
352
|
-
<div className="feedback-section feedback-backdrop-blur" />
|
|
353
|
-
|
|
354
359
|
<div className="feedback-section">
|
|
355
|
-
<
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
setFeedbackStatus('submitted');
|
|
359
|
-
setShowFeedback(false);
|
|
360
|
-
}}
|
|
361
|
-
/>
|
|
360
|
+
<div className="feedback-success">
|
|
361
|
+
{t('Thank you for your feedback')}
|
|
362
|
+
</div>
|
|
362
363
|
</div>
|
|
363
364
|
</div>
|
|
364
365
|
)}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
<RfqBanner
|
|
387
|
-
requestImage={requestImages[0]}
|
|
388
|
-
selectedRegion={regions[0]}
|
|
389
|
-
/>
|
|
390
|
-
)}
|
|
391
|
-
{!isFindApiLoading &&
|
|
392
|
-
window.settings.support &&
|
|
393
|
-
window.settings.support.enabled &&
|
|
394
|
-
(query || requestImages[0] || specifications) && (
|
|
395
|
-
<InquiryBanner
|
|
396
|
-
requestImage={requestImages[0]}
|
|
397
|
-
selectedRegion={regions[0]}
|
|
398
|
-
query={query}
|
|
399
|
-
/>
|
|
400
|
-
)}
|
|
401
|
-
</div>
|
|
402
|
-
{settings.showPoweredByNyris && (
|
|
403
|
-
<PoweredBy
|
|
366
|
+
|
|
367
|
+
{feedbackStatus === 'visible' &&
|
|
368
|
+
!showFeedbackSuccess &&
|
|
369
|
+
productsFromAlgolia.length > 0 && (
|
|
370
|
+
<div className={'feedback-floating'}>
|
|
371
|
+
<div className="feedback-section feedback-backdrop-blur" />
|
|
372
|
+
|
|
373
|
+
<div className="feedback-section">
|
|
374
|
+
<Feedback
|
|
375
|
+
submitFeedback={submitFeedback}
|
|
376
|
+
onFeedbackClose={() => {
|
|
377
|
+
setFeedbackStatus('submitted');
|
|
378
|
+
setShowFeedback(false);
|
|
379
|
+
}}
|
|
380
|
+
/>
|
|
381
|
+
</div>
|
|
382
|
+
</div>
|
|
383
|
+
)}
|
|
384
|
+
<div>
|
|
385
|
+
<Pagination
|
|
386
|
+
isLoading={isFindApiLoading || isAlgoliaLoading}
|
|
404
387
|
className={
|
|
405
|
-
|
|
388
|
+
productsFromAlgolia.length === 0 &&
|
|
389
|
+
!isAlgoliaLoading
|
|
390
|
+
? 'opacity-0 hidden'
|
|
391
|
+
: ''
|
|
406
392
|
}
|
|
407
393
|
/>
|
|
408
|
-
|
|
394
|
+
<div
|
|
395
|
+
style={{
|
|
396
|
+
display: 'flex',
|
|
397
|
+
flexGrow: 1,
|
|
398
|
+
}}
|
|
399
|
+
>
|
|
400
|
+
{requestImages.length > 0 &&
|
|
401
|
+
!isAlgoliaLoading &&
|
|
402
|
+
!isFindApiLoading &&
|
|
403
|
+
window.settings.rfq &&
|
|
404
|
+
window.settings.rfq.enabled && (
|
|
405
|
+
<RfqBanner
|
|
406
|
+
requestImage={requestImages[0]}
|
|
407
|
+
selectedRegion={regions[0]}
|
|
408
|
+
/>
|
|
409
|
+
)}
|
|
410
|
+
{!isFindApiLoading &&
|
|
411
|
+
window.settings.support &&
|
|
412
|
+
window.settings.support.enabled &&
|
|
413
|
+
(query || requestImages[0] || specifications) && (
|
|
414
|
+
<InquiryBanner
|
|
415
|
+
requestImage={requestImages[0]}
|
|
416
|
+
selectedRegion={regions[0]}
|
|
417
|
+
query={query}
|
|
418
|
+
/>
|
|
419
|
+
)}
|
|
420
|
+
</div>
|
|
421
|
+
{settings.showPoweredByNyris && (
|
|
422
|
+
<PoweredBy
|
|
423
|
+
className={
|
|
424
|
+
'flex desktop:w-0 desktop:h-0 w-full justify-center items-center mb-2'
|
|
425
|
+
}
|
|
426
|
+
/>
|
|
427
|
+
)}
|
|
428
|
+
</div>
|
|
409
429
|
</div>
|
|
410
430
|
</div>
|
|
411
431
|
</div>
|
|
432
|
+
<div className="mt-[6px] px-6 mb-6">
|
|
433
|
+
<HitsPerPage
|
|
434
|
+
items={[
|
|
435
|
+
{ label: '10', value: 10 },
|
|
436
|
+
{ label: '20', value: 20, default: true },
|
|
437
|
+
{ label: '30', value: 30 },
|
|
438
|
+
{ label: '40', value: 40 },
|
|
439
|
+
{ label: '50', value: 50 },
|
|
440
|
+
]}
|
|
441
|
+
/>
|
|
442
|
+
</div>
|
|
412
443
|
</div>
|
|
413
444
|
</div>
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
]
|
|
423
|
-
|
|
424
|
-
|
|
445
|
+
</div>
|
|
446
|
+
|
|
447
|
+
<div
|
|
448
|
+
className={twMerge(
|
|
449
|
+
'hidden desktop:flex flex-col sticky top-0 self-start',
|
|
450
|
+
'overflow-hidden transition-all duration-300',
|
|
451
|
+
'h-screen max-h-full',
|
|
452
|
+
isAiModeOpen
|
|
453
|
+
? 'w-[325px] min-w-[325px] max-w-[325px]'
|
|
454
|
+
: 'w-0 min-w-0 max-w-0',
|
|
455
|
+
'rounded-3xl',
|
|
456
|
+
|
|
457
|
+
isAiModeOpen && 'pb-4 pr-4',
|
|
458
|
+
'shadow-ds-2',
|
|
459
|
+
)}
|
|
460
|
+
>
|
|
461
|
+
<ChatAssistant />
|
|
425
462
|
</div>
|
|
426
463
|
</div>
|
|
427
464
|
</div>
|
|
@@ -430,20 +467,24 @@ function Results() {
|
|
|
430
467
|
<TextSearch
|
|
431
468
|
className="flex desktop:hidden w-full gap-2"
|
|
432
469
|
onCameraClick={() => setOpenModalCamera(true)}
|
|
470
|
+
showImageUpload={false}
|
|
471
|
+
aiMode={true}
|
|
433
472
|
/>
|
|
434
|
-
|
|
473
|
+
|
|
435
474
|
{isShowFilter && settings.postFilterOption && (
|
|
436
475
|
<div
|
|
437
476
|
style={{
|
|
438
477
|
position: 'relative',
|
|
439
|
-
width: '48px',
|
|
440
|
-
height: '48px',
|
|
441
478
|
padding: ' 8px',
|
|
442
479
|
flexShrink: 0,
|
|
443
480
|
borderRadius: '32px',
|
|
444
481
|
background: '#FAFAFA',
|
|
445
|
-
boxShadow: ' 0px 0px 8px 0px rgba(0, 0, 0, 0.15)',
|
|
446
482
|
}}
|
|
483
|
+
className={twMerge(
|
|
484
|
+
'h-14 min-w-14 flex items-center justify-center ',
|
|
485
|
+
'border border-solid border-[#DDDEE7]',
|
|
486
|
+
'shadow-ds-2',
|
|
487
|
+
)}
|
|
447
488
|
onClick={() => {
|
|
448
489
|
if (disablePostFilter && !isPostFilterApplied) return;
|
|
449
490
|
setShowPostFilter(true);
|
|
@@ -462,8 +503,8 @@ function Results() {
|
|
|
462
503
|
: '#F3F3F5'
|
|
463
504
|
}`,
|
|
464
505
|
borderRadius: '40px',
|
|
465
|
-
width: '
|
|
466
|
-
height: '
|
|
506
|
+
width: '40px',
|
|
507
|
+
height: '40px',
|
|
467
508
|
justifyContent: 'center',
|
|
468
509
|
alignItems: 'center',
|
|
469
510
|
}}
|
|
@@ -513,6 +554,14 @@ function Results() {
|
|
|
513
554
|
)}
|
|
514
555
|
</div>
|
|
515
556
|
)}
|
|
557
|
+
<div
|
|
558
|
+
className={twMerge(
|
|
559
|
+
'h-14 min-w-14 flex items-center justify-center rounded-full bg-[#FFFFFF] border border-solid border-[#DDDEE7]',
|
|
560
|
+
'shadow-ds-2',
|
|
561
|
+
)}
|
|
562
|
+
>
|
|
563
|
+
<ImageUpload onCameraClick={() => setOpenModalCamera(true)} />
|
|
564
|
+
</div>
|
|
516
565
|
</div>
|
|
517
566
|
<PostFilterDrawer
|
|
518
567
|
openModal={showPostFilter}
|
|
@@ -524,6 +573,11 @@ function Results() {
|
|
|
524
573
|
setOpenModalCamera(s => !s);
|
|
525
574
|
}}
|
|
526
575
|
/>
|
|
576
|
+
{isAiModeOpen && (
|
|
577
|
+
<div className="desktop:hidden">
|
|
578
|
+
<MobileChatAssistant />
|
|
579
|
+
</div>
|
|
580
|
+
)}
|
|
527
581
|
</div>
|
|
528
582
|
</>
|
|
529
583
|
);
|
package/src/services/Feedback.ts
CHANGED
|
@@ -65,7 +65,7 @@ export const sendFeedbackByApi = async (
|
|
|
65
65
|
const api = new NyrisAPI(settings);
|
|
66
66
|
if (requestId) {
|
|
67
67
|
try {
|
|
68
|
-
await api.sendFeedback({ sessionId, requestId, payload }).then(
|
|
68
|
+
await api.sendFeedback({ sessionId, requestId, payload }).then(() => {});
|
|
69
69
|
} catch (error) {
|
|
70
70
|
console.log('error sendFeedbackByApi', error);
|
|
71
71
|
}
|
|
@@ -85,34 +85,13 @@ export const find = async ({
|
|
|
85
85
|
return nyrisApi.find(options, image, filters);
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
export const findMulti = ({
|
|
89
|
-
images,
|
|
90
|
-
settings,
|
|
91
|
-
regions,
|
|
92
|
-
filters,
|
|
93
|
-
text,
|
|
94
|
-
}: {
|
|
95
|
-
images?: HTMLCanvasElement[];
|
|
96
|
-
settings: NyrisAPISettings;
|
|
97
|
-
regions?: RectCoords[];
|
|
98
|
-
filters?: Filter[];
|
|
99
|
-
text?: string;
|
|
100
|
-
}) => {
|
|
101
|
-
const nyrisApi = new NyrisAPI(settings);
|
|
102
|
-
let options: ImageSearchOptions = text ? { text } : {};
|
|
103
|
-
|
|
104
|
-
return nyrisApi.findMulti(options, images, regions, filters);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
88
|
export const findCad = ({
|
|
108
89
|
file,
|
|
109
|
-
options,
|
|
110
90
|
settings,
|
|
111
91
|
filters,
|
|
112
92
|
}: {
|
|
113
93
|
file: File;
|
|
114
94
|
settings: NyrisAPISettings;
|
|
115
|
-
options?: ImageSearchOptions;
|
|
116
95
|
filters?: Filter[];
|
|
117
96
|
}) => {
|
|
118
97
|
const nyrisApi = new NyrisAPI(settings);
|