@nyris/nyris-webapp 0.4.0 → 0.4.1
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 +3 -3
- package/build/index.html +1 -1
- package/build/static/js/{main.916c157c.js → main.1fdb0ec6.js} +3 -3
- package/build/static/js/{main.916c157c.js.map → main.1fdb0ec6.js.map} +1 -1
- package/package.json +3 -3
- package/src/components/PostFilter/PostFilterComponent.tsx +22 -8
- package/src/components/SidePanel.tsx +3 -4
- package/src/components/TextSearch.tsx +12 -4
- /package/build/static/js/{main.916c157c.js.LICENSE.txt → main.1fdb0ec6.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyris/nyris-webapp",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@auth0/auth0-react": "^2.2.4",
|
|
6
6
|
"@emailjs/browser": "^4.3.3",
|
|
7
7
|
"@google/genai": "^1.46.0",
|
|
8
|
-
"@nyris/nyris-api": "^0.4.
|
|
9
|
-
"@nyris/nyris-react-components": "^0.4.
|
|
8
|
+
"@nyris/nyris-api": "^0.4.1",
|
|
9
|
+
"@nyris/nyris-react-components": "^0.4.1",
|
|
10
10
|
"@radix-ui/react-accordion": "^1.2.2",
|
|
11
11
|
"@radix-ui/react-dialog": "^1.1.4",
|
|
12
12
|
"@radix-ui/react-popover": "^1.1.4",
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import PostFilter from './PostFilter';
|
|
9
10
|
import PostFilterFindApi from './PostFilterFindApi';
|
|
10
11
|
|
|
11
12
|
function PostFilterComponent({ className }: { className?: string }) {
|
|
@@ -116,14 +117,27 @@ function PostFilterComponent({ className }: { className?: string }) {
|
|
|
116
117
|
refinement.attribute;
|
|
117
118
|
|
|
118
119
|
return (
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
<React.Fragment key={index}>
|
|
121
|
+
{window.settings.algolia.enabled && (
|
|
122
|
+
<PostFilter
|
|
123
|
+
attribute={refinement.attribute}
|
|
124
|
+
label={refinement.header}
|
|
125
|
+
searchable={refinement.searchable}
|
|
126
|
+
onVisibilityChange={handleVisibilityChange}
|
|
127
|
+
isLastVisible={isLastVisible}
|
|
128
|
+
/>
|
|
129
|
+
)}
|
|
130
|
+
|
|
131
|
+
{!window.settings.algolia.enabled && (
|
|
132
|
+
<PostFilterFindApi
|
|
133
|
+
attribute={refinement.attribute}
|
|
134
|
+
label={refinement.header}
|
|
135
|
+
searchable={false}
|
|
136
|
+
onVisibilityChange={handleVisibilityChange}
|
|
137
|
+
isLastVisible={isLastVisible}
|
|
138
|
+
/>
|
|
139
|
+
)}
|
|
140
|
+
</React.Fragment>
|
|
127
141
|
);
|
|
128
142
|
},
|
|
129
143
|
)}
|
|
@@ -16,7 +16,8 @@ export default function SidePanel({ className }: { className?: string }) {
|
|
|
16
16
|
const settings = window.settings;
|
|
17
17
|
const isSmartFiltersEnabled = !!settings.useSmartFilters;
|
|
18
18
|
const requestImages = useRequestStore(state => state.requestImages);
|
|
19
|
-
const [isRequestQualityExpanded, setIsRequestQualityExpanded] =
|
|
19
|
+
const [isRequestQualityExpanded, setIsRequestQualityExpanded] =
|
|
20
|
+
useState(true);
|
|
20
21
|
|
|
21
22
|
const specificationFilter = useRequestStore(
|
|
22
23
|
state => state.specificationFilter,
|
|
@@ -181,9 +182,7 @@ export default function SidePanel({ className }: { className?: string }) {
|
|
|
181
182
|
<button
|
|
182
183
|
type="button"
|
|
183
184
|
className="w-full flex items-center justify-between gap-2"
|
|
184
|
-
onClick={() =>
|
|
185
|
-
setIsRequestQualityExpanded(prev => !prev)
|
|
186
|
-
}
|
|
185
|
+
onClick={() => setIsRequestQualityExpanded(prev => !prev)}
|
|
187
186
|
>
|
|
188
187
|
<span className="text-[#3B3E5F] font-bold text-sm leading-4">
|
|
189
188
|
Request Image Quality
|
|
@@ -23,6 +23,8 @@ function machinePartsListingText() {
|
|
|
23
23
|
return firstMachinePartsListingText();
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
const TEXT_SEARCH_DEBOUNCE = 1500;
|
|
27
|
+
|
|
26
28
|
function TextSearch({
|
|
27
29
|
className,
|
|
28
30
|
onCameraClick,
|
|
@@ -137,7 +139,7 @@ function TextSearch({
|
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
navigate('/result');
|
|
140
|
-
},
|
|
142
|
+
}, TEXT_SEARCH_DEBOUNCE),
|
|
141
143
|
[requestImages, preFilter, regions],
|
|
142
144
|
);
|
|
143
145
|
|
|
@@ -226,9 +228,7 @@ function TextSearch({
|
|
|
226
228
|
}
|
|
227
229
|
>
|
|
228
230
|
{isScopeMode && (
|
|
229
|
-
<TypePlateUpload
|
|
230
|
-
iconOnly={location.pathname === '/result'}
|
|
231
|
-
/>
|
|
231
|
+
<TypePlateUpload iconOnly={location.pathname === '/result'} />
|
|
232
232
|
)}
|
|
233
233
|
{showPreFilter && (
|
|
234
234
|
<Tooltip
|
|
@@ -444,6 +444,14 @@ function TextSearch({
|
|
|
444
444
|
placeholder={t('Search part names, SKU, or description...')}
|
|
445
445
|
value={valueInput}
|
|
446
446
|
onChange={onChangeText}
|
|
447
|
+
onKeyDown={event => {
|
|
448
|
+
if (event.key === 'Enter') {
|
|
449
|
+
event.preventDefault();
|
|
450
|
+
searchOrRedirect.cancel();
|
|
451
|
+
searchOrRedirect(event.currentTarget.value);
|
|
452
|
+
searchOrRedirect.flush();
|
|
453
|
+
}
|
|
454
|
+
}}
|
|
447
455
|
onFocus={() => setIsInputFocused(true)}
|
|
448
456
|
onBlur={() => setIsInputFocused(false)}
|
|
449
457
|
ref={focusInp}
|
|
File without changes
|