@seekora-ai/ui-sdk-react 0.2.16 → 0.2.18
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/dist/components/suggestions-primitives/CategoriesTabs.js +1 -1
- package/dist/components/suggestions-primitives/ItemCard.js +3 -3
- package/dist/components/suggestions-primitives/ProductCard.js +3 -3
- package/dist/components/suggestions-primitives/ProductCardLayouts.js +6 -6
- package/dist/components/suggestions-primitives/RecentSearchesList.js +3 -3
- package/dist/components/suggestions-primitives/SearchInput.js +2 -2
- package/dist/components/suggestions-primitives/SuggestionItem.js +3 -3
- package/dist/components/suggestions-primitives/SuggestionsContext.d.ts +3 -0
- package/dist/components/suggestions-primitives/SuggestionsContext.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SuggestionsProvider.d.ts.map +1 -1
- package/dist/components/suggestions-primitives/SuggestionsProvider.js +46 -9
- package/dist/components/suggestions-primitives/TrendingList.js +4 -4
- package/dist/docsearch/components/Footer.d.ts.map +1 -1
- package/dist/docsearch/components/Footer.js +11 -1
- package/dist/docsearch/hooks/useDocSearch.d.ts.map +1 -1
- package/dist/docsearch/hooks/useDocSearch.js +25 -12
- package/dist/hooks/useQuerySuggestionsEnhanced.d.ts +2 -0
- package/dist/hooks/useQuerySuggestionsEnhanced.d.ts.map +1 -1
- package/dist/hooks/useQuerySuggestionsEnhanced.js +26 -2
- package/dist/index.umd.js +1 -1
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.esm.js +133 -49
- package/dist/src/index.esm.js.map +1 -1
- package/dist/src/index.js +133 -49
- package/dist/src/index.js.map +1 -1
- package/package.json +7 -7
package/dist/src/index.js
CHANGED
|
@@ -6802,7 +6802,7 @@ function transformFilteredTab(raw) {
|
|
|
6802
6802
|
// Main Hook
|
|
6803
6803
|
// ============================================================================
|
|
6804
6804
|
function useQuerySuggestionsEnhanced(options) {
|
|
6805
|
-
const { client, query, enabled = true, debounceMs = 200, maxSuggestions = 10, minQueryLength = 1, includeDropdownRecommendations = false, includeDropdownProductList = true, includeFilteredTabs = true, includeCategories = true, includeFacets = true, // CHANGED: Enable facets by default
|
|
6805
|
+
const { client, query, enabled = true, prefetch = false, debounceMs = 200, maxSuggestions = 10, minQueryLength = 1, includeDropdownRecommendations = false, includeDropdownProductList = true, includeFilteredTabs = true, includeCategories = true, includeFacets = true, // CHANGED: Enable facets by default
|
|
6806
6806
|
maxCategories = 3, maxFacets = 5, filteredTabs, minPopularity, timeRange, disableTypoTolerance, analyticsTags, enableRecentSearches = true, maxRecentSearches = MAX_RECENT_SEARCHES_DEFAULT, recentSearchesKey = RECENT_SEARCHES_DEFAULT_KEY, onSuggestionsLoaded, onError, } = options;
|
|
6807
6807
|
// State
|
|
6808
6808
|
const [suggestions, setSuggestions] = React.useState([]);
|
|
@@ -6975,17 +6975,41 @@ function useQuerySuggestionsEnhanced(options) {
|
|
|
6975
6975
|
onSuggestionsLoaded,
|
|
6976
6976
|
onError,
|
|
6977
6977
|
]);
|
|
6978
|
+
// Prefetch: fire initial empty-query fetch once client is ready (before dropdown opens)
|
|
6979
|
+
const prefetchedRef = React.useRef(false);
|
|
6980
|
+
React.useEffect(() => {
|
|
6981
|
+
if (!prefetch || prefetchedRef.current)
|
|
6982
|
+
return;
|
|
6983
|
+
if (minQueryLength > 0)
|
|
6984
|
+
return;
|
|
6985
|
+
if (!client?.getSuggestions)
|
|
6986
|
+
return;
|
|
6987
|
+
prefetchedRef.current = true;
|
|
6988
|
+
fetchSuggestions('');
|
|
6989
|
+
}, [prefetch, client, minQueryLength, fetchSuggestions]);
|
|
6978
6990
|
// Debounced fetch effect
|
|
6979
6991
|
React.useEffect(() => {
|
|
6980
6992
|
if (debounceTimerRef.current) {
|
|
6981
6993
|
clearTimeout(debounceTimerRef.current);
|
|
6982
6994
|
}
|
|
6983
6995
|
if (!enabled || query.length < minQueryLength) {
|
|
6996
|
+
// Don't clear prefetched data when dropdown is closed
|
|
6997
|
+
if (prefetch && prefetchedRef.current && query === '') {
|
|
6998
|
+
// Keep prefetched data intact
|
|
6999
|
+
setLoading(false);
|
|
7000
|
+
setError(null);
|
|
7001
|
+
return;
|
|
7002
|
+
}
|
|
6984
7003
|
setSuggestions([]);
|
|
7004
|
+
setDropdownRecommendations(null);
|
|
6985
7005
|
setLoading(false);
|
|
6986
7006
|
setError(null);
|
|
6987
7007
|
return;
|
|
6988
7008
|
}
|
|
7009
|
+
// When dropdown opens with empty query and we already have prefetched data, skip re-fetch
|
|
7010
|
+
if (prefetch && prefetchedRef.current && query === '') {
|
|
7011
|
+
return;
|
|
7012
|
+
}
|
|
6989
7013
|
setLoading(true);
|
|
6990
7014
|
debounceTimerRef.current = setTimeout(() => {
|
|
6991
7015
|
fetchSuggestions(query);
|
|
@@ -6995,7 +7019,7 @@ function useQuerySuggestionsEnhanced(options) {
|
|
|
6995
7019
|
clearTimeout(debounceTimerRef.current);
|
|
6996
7020
|
}
|
|
6997
7021
|
};
|
|
6998
|
-
}, [query, enabled, minQueryLength, debounceMs, fetchSuggestions]);
|
|
7022
|
+
}, [query, enabled, prefetch, minQueryLength, debounceMs, fetchSuggestions]);
|
|
6999
7023
|
// Recent search management
|
|
7000
7024
|
const addRecentSearch = React.useCallback((searchQuery, resultsCount) => {
|
|
7001
7025
|
if (!enableRecentSearches || !searchQuery.trim())
|
|
@@ -9030,10 +9054,28 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
|
|
|
9030
9054
|
const [isOpen, setIsOpenState] = React.useState(false);
|
|
9031
9055
|
const [activeIndex, setActiveIndex] = React.useState(-1);
|
|
9032
9056
|
const [activeTabId, setActiveTabId] = React.useState('');
|
|
9057
|
+
const [prefetchedProducts, setPrefetchedProducts] = React.useState([]);
|
|
9058
|
+
// Prefetch product results on mount so they're available instantly when dropdown opens
|
|
9059
|
+
const prefetchedProductsRef = React.useRef(false);
|
|
9060
|
+
React.useEffect(() => {
|
|
9061
|
+
if (prefetchedProductsRef.current || !client?.search)
|
|
9062
|
+
return;
|
|
9063
|
+
prefetchedProductsRef.current = true;
|
|
9064
|
+
client.search('*', { per_page: 12, page: 1 })
|
|
9065
|
+
.then((res) => {
|
|
9066
|
+
const data = res?.data;
|
|
9067
|
+
const items = data?.results || data?.data || res?.results || res?.hits || [];
|
|
9068
|
+
if (Array.isArray(items) && items.length > 0) {
|
|
9069
|
+
setPrefetchedProducts(items);
|
|
9070
|
+
}
|
|
9071
|
+
})
|
|
9072
|
+
.catch(() => { });
|
|
9073
|
+
}, [client]);
|
|
9033
9074
|
const suggestionsData = useQuerySuggestionsEnhanced({
|
|
9034
9075
|
client,
|
|
9035
9076
|
query,
|
|
9036
9077
|
enabled: isOpen,
|
|
9078
|
+
prefetch: minQueryLength === 0,
|
|
9037
9079
|
minQueryLength,
|
|
9038
9080
|
debounceMs,
|
|
9039
9081
|
maxSuggestions,
|
|
@@ -9051,7 +9093,22 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
|
|
|
9051
9093
|
trackClicks: true,
|
|
9052
9094
|
trackImpressions: true,
|
|
9053
9095
|
});
|
|
9054
|
-
const { suggestions, recentSearches, trendingSearches, trendingProducts, filteredTabs: filteredTabsData, loading, error, hasContent, getAllNavigableItems, addRecentSearch, } = suggestionsData;
|
|
9096
|
+
const { suggestions, recentSearches, trendingSearches, trendingProducts, filteredTabs: filteredTabsData, loading, error, hasContent, getAllNavigableItems, addRecentSearch, clearRecentSearches, } = suggestionsData;
|
|
9097
|
+
// Wrap getAllNavigableItems to include prefetchedProducts when trendingProducts is empty
|
|
9098
|
+
const getAllNavigableItemsWithPrefetched = React.useCallback(() => {
|
|
9099
|
+
const items = getAllNavigableItems();
|
|
9100
|
+
// If there are already product items in the list, return as-is
|
|
9101
|
+
if (items.some(i => i.type === 'product'))
|
|
9102
|
+
return items;
|
|
9103
|
+
// Otherwise append prefetchedProducts as navigable product items
|
|
9104
|
+
if (prefetchedProducts.length > 0) {
|
|
9105
|
+
let idx = items.length;
|
|
9106
|
+
prefetchedProducts.forEach(product => {
|
|
9107
|
+
items.push({ type: 'product', index: idx++, data: product });
|
|
9108
|
+
});
|
|
9109
|
+
}
|
|
9110
|
+
return items;
|
|
9111
|
+
}, [getAllNavigableItems, prefetchedProducts]);
|
|
9055
9112
|
const onSearchRef = React.useRef(onSearch);
|
|
9056
9113
|
const onSuggestionSelectRef = React.useRef(onSuggestionSelect);
|
|
9057
9114
|
const onProductClickRef = React.useRef(onProductClick);
|
|
@@ -9129,19 +9186,19 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
|
|
|
9129
9186
|
onSearchRef.current?.(trimmed);
|
|
9130
9187
|
}, [analytics, addRecentSearch, close]);
|
|
9131
9188
|
const navigateNext = React.useCallback(() => {
|
|
9132
|
-
const items =
|
|
9189
|
+
const items = getAllNavigableItemsWithPrefetched();
|
|
9133
9190
|
if (items.length === 0)
|
|
9134
9191
|
return;
|
|
9135
9192
|
setActiveIndex((i) => (i < items.length - 1 ? i + 1 : 0));
|
|
9136
|
-
}, [
|
|
9193
|
+
}, [getAllNavigableItemsWithPrefetched]);
|
|
9137
9194
|
const navigatePrev = React.useCallback(() => {
|
|
9138
|
-
const items =
|
|
9195
|
+
const items = getAllNavigableItemsWithPrefetched();
|
|
9139
9196
|
if (items.length === 0)
|
|
9140
9197
|
return;
|
|
9141
9198
|
setActiveIndex((i) => (i <= 0 ? items.length - 1 : i - 1));
|
|
9142
|
-
}, [
|
|
9199
|
+
}, [getAllNavigableItemsWithPrefetched]);
|
|
9143
9200
|
const selectActive = React.useCallback(() => {
|
|
9144
|
-
const items =
|
|
9201
|
+
const items = getAllNavigableItemsWithPrefetched();
|
|
9145
9202
|
if (activeIndex < 0 || activeIndex >= items.length) {
|
|
9146
9203
|
submitSearch(query);
|
|
9147
9204
|
return;
|
|
@@ -9163,7 +9220,7 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
|
|
|
9163
9220
|
default:
|
|
9164
9221
|
submitSearch(query);
|
|
9165
9222
|
}
|
|
9166
|
-
}, [activeIndex,
|
|
9223
|
+
}, [activeIndex, getAllNavigableItemsWithPrefetched, query, submitSearch, selectSuggestion, selectProduct, selectRecentSearch, selectTrendingSearch]);
|
|
9167
9224
|
// Impression when open and content changes
|
|
9168
9225
|
React.useEffect(() => {
|
|
9169
9226
|
if (!isOpen || !hasContent || !query)
|
|
@@ -9186,19 +9243,21 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
|
|
|
9186
9243
|
recentSearches,
|
|
9187
9244
|
trendingSearches,
|
|
9188
9245
|
trendingProducts,
|
|
9246
|
+
prefetchedProducts,
|
|
9189
9247
|
filteredTabs: filteredTabsData,
|
|
9190
9248
|
activeTabId,
|
|
9191
9249
|
setActiveTabId,
|
|
9192
9250
|
loading,
|
|
9193
9251
|
error,
|
|
9194
9252
|
hasContent,
|
|
9195
|
-
getAllNavigableItems,
|
|
9253
|
+
getAllNavigableItems: getAllNavigableItemsWithPrefetched,
|
|
9196
9254
|
selectSuggestion,
|
|
9197
9255
|
selectProduct,
|
|
9198
9256
|
selectRecentSearch,
|
|
9199
9257
|
selectTrendingSearch,
|
|
9200
9258
|
setActiveTab,
|
|
9201
9259
|
submitSearch,
|
|
9260
|
+
clearRecentSearches,
|
|
9202
9261
|
close,
|
|
9203
9262
|
navigateNext,
|
|
9204
9263
|
navigatePrev,
|
|
@@ -9214,19 +9273,21 @@ function SuggestionsProvider({ children, minQueryLength = 1, debounceMs = 200, m
|
|
|
9214
9273
|
recentSearches,
|
|
9215
9274
|
trendingSearches,
|
|
9216
9275
|
trendingProducts,
|
|
9276
|
+
prefetchedProducts,
|
|
9217
9277
|
filteredTabsData,
|
|
9218
9278
|
activeTabId,
|
|
9219
9279
|
setActiveTabId,
|
|
9220
9280
|
loading,
|
|
9221
9281
|
error,
|
|
9222
9282
|
hasContent,
|
|
9223
|
-
|
|
9283
|
+
getAllNavigableItemsWithPrefetched,
|
|
9224
9284
|
selectSuggestion,
|
|
9225
9285
|
selectProduct,
|
|
9226
9286
|
selectRecentSearch,
|
|
9227
9287
|
selectTrendingSearch,
|
|
9228
9288
|
setActiveTab,
|
|
9229
9289
|
submitSearch,
|
|
9290
|
+
clearRecentSearches,
|
|
9230
9291
|
close,
|
|
9231
9292
|
navigateNext,
|
|
9232
9293
|
navigatePrev,
|
|
@@ -9317,14 +9378,14 @@ function SearchInput({ placeholder = 'Powered by Seekora', autoFocus = false, sh
|
|
|
9317
9378
|
}, [setQuery]);
|
|
9318
9379
|
return (React.createElement("div", { className: clsx('seekora-suggestions-search-input-wrapper', className), style: { ...defaultStyles, ...style } },
|
|
9319
9380
|
React.createElement("div", { className: "seekora-suggestions-input-wrapper", style: inputWrapperStyles },
|
|
9320
|
-
leftIcon ? (React.createElement("span", { className: "seekora-suggestions-input-left-icon", style: { display: 'flex', flexShrink: 0, color: '
|
|
9381
|
+
leftIcon ? (React.createElement("span", { className: "seekora-suggestions-input-left-icon", style: { display: 'flex', flexShrink: 0, color: 'inherit', opacity: 0.5 } }, leftIcon)) : null,
|
|
9321
9382
|
React.createElement("input", { ref: inputRef, type: "text", value: query, onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, placeholder: placeholder, autoFocus: autoFocus, autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: false, "aria-label": ariaLabel, "aria-expanded": isOpen, "aria-haspopup": "listbox", "aria-autocomplete": "list", role: "combobox", className: clsx('seekora-suggestions-input', inputClassName), style: { ...inputStyles, ...inputStyle } }),
|
|
9322
9383
|
showClearButton && query ? (React.createElement("button", { type: "button", onClick: handleClear, className: "seekora-suggestions-input-clear", "aria-label": "Clear search", style: {
|
|
9323
9384
|
padding: 8,
|
|
9324
9385
|
border: 'none',
|
|
9325
9386
|
background: 'transparent',
|
|
9326
9387
|
cursor: 'pointer',
|
|
9327
|
-
color: '
|
|
9388
|
+
color: 'inherit', opacity: 0.5,
|
|
9328
9389
|
display: 'flex',
|
|
9329
9390
|
alignItems: 'center',
|
|
9330
9391
|
justifyContent: 'center',
|
|
@@ -9475,7 +9536,7 @@ const defaultItemStyle = {
|
|
|
9475
9536
|
fontSize: 'inherit',
|
|
9476
9537
|
fontFamily: 'inherit',
|
|
9477
9538
|
backgroundColor: 'transparent',
|
|
9478
|
-
color: '
|
|
9539
|
+
color: 'inherit',
|
|
9479
9540
|
transition: 'background-color 120ms ease',
|
|
9480
9541
|
overflow: 'hidden',
|
|
9481
9542
|
textOverflow: 'ellipsis',
|
|
@@ -9492,14 +9553,14 @@ function SuggestionItem({ suggestion, index, isActive, onSelect, className, styl
|
|
|
9492
9553
|
const showHighlight = isActive || isHovered;
|
|
9493
9554
|
return (React.createElement("li", { role: "option", "aria-selected": isActive, id: `seekora-suggestion-${index}`, className: clsx('seekora-suggestions-item', isActive && 'seekora-suggestions-item--active', isHovered && 'seekora-suggestions-item--hover', className), style: {
|
|
9494
9555
|
...defaultItemStyle,
|
|
9495
|
-
...(showHighlight ? { backgroundColor: 'var(--seekora-bg-hover,
|
|
9556
|
+
...(showHighlight ? { backgroundColor: 'var(--seekora-bg-hover, rgba(0,0,0,0.05))' } : {}),
|
|
9496
9557
|
...style,
|
|
9497
9558
|
}, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onMouseDown: (e) => {
|
|
9498
9559
|
e.preventDefault();
|
|
9499
9560
|
onSelect();
|
|
9500
9561
|
} },
|
|
9501
9562
|
content,
|
|
9502
|
-
suggestion.count != null ? (React.createElement("span", { className: "seekora-suggestions-item-count", style: { marginLeft: 8, color: '
|
|
9563
|
+
suggestion.count != null ? (React.createElement("span", { className: "seekora-suggestions-item-count", style: { marginLeft: 8, color: 'inherit', opacity: 0.6, fontSize: '0.875em' } }, suggestion.count)) : null));
|
|
9503
9564
|
}
|
|
9504
9565
|
|
|
9505
9566
|
/**
|
|
@@ -10185,7 +10246,7 @@ const imgStyle$1 = {
|
|
|
10185
10246
|
aspectRatio: 'var(--seekora-card-aspect-ratio, 1)',
|
|
10186
10247
|
objectFit: 'cover',
|
|
10187
10248
|
borderRadius: BORDER_RADIUS$3.sm,
|
|
10188
|
-
backgroundColor: 'var(--seekora-bg-secondary,
|
|
10249
|
+
backgroundColor: 'var(--seekora-bg-secondary, rgba(0,0,0,0.04))',
|
|
10189
10250
|
display: 'block',
|
|
10190
10251
|
overflow: 'hidden',
|
|
10191
10252
|
};
|
|
@@ -10211,7 +10272,7 @@ function ItemCard({ item, position, onSelect, className, style, asLink = true, i
|
|
|
10211
10272
|
// Hover style
|
|
10212
10273
|
const cardHoverStyle = isHovered
|
|
10213
10274
|
? {
|
|
10214
|
-
backgroundColor: 'var(--seekora-card-hover-bg, var(--seekora-bg-hover,
|
|
10275
|
+
backgroundColor: 'var(--seekora-card-hover-bg, var(--seekora-bg-hover, rgba(0,0,0,0.03)))',
|
|
10215
10276
|
boxShadow: 'var(--seekora-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08))',
|
|
10216
10277
|
}
|
|
10217
10278
|
: {};
|
|
@@ -10220,7 +10281,7 @@ function ItemCard({ item, position, onSelect, className, style, asLink = true, i
|
|
|
10220
10281
|
actionButtons && actionButtons.length > 0 && actionButtonsPosition?.startsWith('overlay') && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" })))) : (React.createElement("div", { className: "seekora-item-card-placeholder", style: { ...imgStyle$1, ...(isHorizontal ? { minWidth: imageMinWidth, flexBasis: imageFlex, maxWidth: imageMaxWidth, height: imageHeight, flexShrink: 0 } : {}) }, "aria-hidden": true }));
|
|
10221
10282
|
const textBlock = (React.createElement("div", { style: isHorizontal ? { display: 'flex', flexDirection: 'column', gap: textGap, flex: 1, minWidth: 0 } : undefined },
|
|
10222
10283
|
React.createElement("span", { className: "seekora-item-card-title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: isHorizontal ? 2 : 3, WebkitBoxOrient: 'vertical' } }, String(title)),
|
|
10223
|
-
description ? (React.createElement("span", { className: "seekora-item-card-description", style: { fontSize: descriptionFontSize, color: '
|
|
10284
|
+
description ? (React.createElement("span", { className: "seekora-item-card-description", style: { fontSize: descriptionFontSize, color: 'inherit', opacity: 0.6, lineHeight: 1.3, display: '-webkit-box', WebkitLineClamp: lineClamp, WebkitBoxOrient: 'vertical', overflow: 'hidden' } }, String(description))) : null,
|
|
10224
10285
|
actionButtons && actionButtons.length > 0 && actionButtonsPosition === 'inline' && (React.createElement(ActionButtons, { buttons: actionButtons, position: "inline", showLabels: showActionLabels, size: "small", layout: "horizontal" }))));
|
|
10225
10286
|
const content = isHorizontal ? (React.createElement("div", { style: { display: 'flex', gap: horizontalGap, alignItems: 'flex-start' } },
|
|
10226
10287
|
imageBlock,
|
|
@@ -11215,7 +11276,7 @@ const imgPlaceholderStyle = {
|
|
|
11215
11276
|
aspectRatio: '1',
|
|
11216
11277
|
objectFit: 'cover',
|
|
11217
11278
|
borderRadius: BORDER_RADIUS$1.sm,
|
|
11218
|
-
backgroundColor: 'var(--seekora-bg-secondary,
|
|
11279
|
+
backgroundColor: 'var(--seekora-bg-secondary, rgba(0,0,0,0.04))',
|
|
11219
11280
|
};
|
|
11220
11281
|
function ImageBlock({ images, title, imageVariant, aspectRatio, enableZoom, zoomMode, zoomLevel }) {
|
|
11221
11282
|
const ar = aspectRatio
|
|
@@ -11235,7 +11296,7 @@ function MinimalLayout({ images, title, price, product, imageVariant, displayCon
|
|
|
11235
11296
|
return (React.createElement(React.Fragment, null,
|
|
11236
11297
|
React.createElement(ImageBlock, { images: images, title: title, imageVariant: imageVariant, aspectRatio: displayConfig.imageAspectRatio, enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel }),
|
|
11237
11298
|
React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' } }, title),
|
|
11238
|
-
price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price seekora-suggestions-product-card-price", style: { fontSize: priceFontSize, color: '
|
|
11299
|
+
price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price seekora-suggestions-product-card-price", style: { fontSize: priceFontSize, color: 'inherit', opacity: 0.6 } },
|
|
11239
11300
|
product.currency ?? '$',
|
|
11240
11301
|
price.toFixed(2)))));
|
|
11241
11302
|
}
|
|
@@ -11255,7 +11316,7 @@ function StandardLayout({ images, title, price, comparePrice, brand, badges, opt
|
|
|
11255
11316
|
cfg.showBadges !== false && badges.length > 0 && (React.createElement(BadgeList, { badges: badges, position: "top-left", maxBadges: 2 })),
|
|
11256
11317
|
actionButtons && actionButtons.length > 0 && isOverlayPosition && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" }))),
|
|
11257
11318
|
React.createElement("div", { className: "seekora-product-card__body", style: { display: 'flex', flexDirection: 'column', gap: bodyGap } },
|
|
11258
|
-
cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: brandFontSize, color: '
|
|
11319
|
+
cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: brandFontSize, color: 'inherit', opacity: 0.6, textTransform: 'uppercase', letterSpacing: '0.02em' } }, brand)),
|
|
11259
11320
|
React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' } }, title),
|
|
11260
11321
|
React.createElement("div", { className: "seekora-product-card__price" },
|
|
11261
11322
|
React.createElement(PriceDisplay, { price: price ?? undefined, comparePrice: comparePrice ?? undefined, currency: cfg.currency ?? product.currency, currencyPosition: cfg.currencyPosition, priceDecimals: cfg.priceDecimals, showDiscount: cfg.showDiscount, style: { fontSize: priceFontSize } })),
|
|
@@ -11274,7 +11335,7 @@ function DetailedLayout({ images, title, price, comparePrice, brand, badges, pri
|
|
|
11274
11335
|
cfg.showBadges !== false && badges.length > 0 && (React.createElement(BadgeList, { badges: badges, position: "top-left" })),
|
|
11275
11336
|
actionButtons && actionButtons.length > 0 && isOverlayPosition && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" }))),
|
|
11276
11337
|
React.createElement("div", { className: "seekora-product-card__body", style: { display: 'flex', flexDirection: 'column', gap: 4 } },
|
|
11277
|
-
cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: '0.75rem', color: '
|
|
11338
|
+
cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: '0.75rem', color: 'inherit', opacity: 0.6, textTransform: 'uppercase', letterSpacing: '0.02em' } }, brand)),
|
|
11278
11339
|
React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: '0.875rem', fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis' } }, title),
|
|
11279
11340
|
cfg.showRating !== false && product.rating != null && (React.createElement(RatingDisplay, { rating: product.rating, reviewCount: product.reviewCount, variant: "compact", size: "small", showNumeric: false, showReviewCount: true, className: "seekora-product-card__rating" })),
|
|
11280
11341
|
React.createElement("div", { className: "seekora-product-card__price" }, cfg.showPriceRange && priceRange ? (React.createElement(PriceDisplay, { priceRange: priceRange, currency: cfg.currency ?? product.currency, currencyPosition: cfg.currencyPosition, priceDecimals: cfg.priceDecimals, style: { fontSize: '0.875rem' } })) : (React.createElement(PriceDisplay, { price: price ?? undefined, comparePrice: comparePrice ?? undefined, currency: cfg.currency ?? product.currency, currencyPosition: cfg.currencyPosition, priceDecimals: cfg.priceDecimals, showDiscount: cfg.showDiscount, style: { fontSize: '0.875rem' } }))),
|
|
@@ -11296,7 +11357,7 @@ function CompactLayout({ images, title, price, product, imageVariant, displayCon
|
|
|
11296
11357
|
textOverflow: 'ellipsis',
|
|
11297
11358
|
whiteSpace: 'nowrap',
|
|
11298
11359
|
} }, title),
|
|
11299
|
-
price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price", style: { fontSize: '0.8125rem', color: '
|
|
11360
|
+
price != null && !Number.isNaN(price) && (React.createElement("span", { className: "seekora-product-card__price", style: { fontSize: '0.8125rem', color: 'inherit', opacity: 0.6 } },
|
|
11300
11361
|
product.currency ?? '$',
|
|
11301
11362
|
price.toFixed(2)))));
|
|
11302
11363
|
}
|
|
@@ -11320,7 +11381,7 @@ function HorizontalLayout({ images, title, price, comparePrice, brand, badges, o
|
|
|
11320
11381
|
cfg.showBadges !== false && badges.length > 0 && (React.createElement(BadgeList, { badges: badges, position: "top-left", maxBadges: 1 })),
|
|
11321
11382
|
actionButtons && actionButtons.length > 0 && actionButtonsPosition?.startsWith('overlay') && (React.createElement(ActionButtons, { buttons: actionButtons, position: actionButtonsPosition === 'overlay-top-right' ? 'top-right' : 'bottom-center', showLabels: showActionLabels, size: "small" }))),
|
|
11322
11383
|
React.createElement("div", { className: "seekora-product-card__body", style: { display: 'flex', flexDirection: 'column', gap: bodyGap, flex: 1, minWidth: 0 } },
|
|
11323
|
-
cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: brandFontSize, color: '
|
|
11384
|
+
cfg.showBrand !== false && brand && (React.createElement("span", { className: "seekora-product-card__brand", style: { fontSize: brandFontSize, color: 'inherit', opacity: 0.6, textTransform: 'uppercase' } }, brand)),
|
|
11324
11385
|
React.createElement("span", { className: "seekora-product-card__title", style: { fontSize: titleFontSize, fontWeight: 500, lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box', WebkitLineClamp: isMobile ? 3 : 2, WebkitBoxOrient: 'vertical' } }, title),
|
|
11325
11386
|
React.createElement("div", { className: "seekora-product-card__price" },
|
|
11326
11387
|
React.createElement(PriceDisplay, { price: price ?? undefined, comparePrice: comparePrice ?? undefined, currency: cfg.currency ?? product.currency, currencyPosition: cfg.currencyPosition, priceDecimals: cfg.priceDecimals, showDiscount: cfg.showDiscount, style: { fontSize: priceFontSize } })),
|
|
@@ -11356,7 +11417,7 @@ const imgStyle = {
|
|
|
11356
11417
|
aspectRatio: '1',
|
|
11357
11418
|
objectFit: 'cover',
|
|
11358
11419
|
borderRadius: BORDER_RADIUS.sm,
|
|
11359
|
-
backgroundColor: 'var(--seekora-bg-secondary,
|
|
11420
|
+
backgroundColor: 'var(--seekora-bg-secondary, rgba(0,0,0,0.04))',
|
|
11360
11421
|
};
|
|
11361
11422
|
function ProductCard({ product, position, section, tabId, onSelect, className, style, imageVariant = 'single', displayConfig, onVariantHover, onVariantClick, selectedVariants, asLink, actionButtons, actionButtonsPosition = 'inline', showActionLabels = false, enableImageZoom = false, imageZoomMode = 'both', imageZoomLevel = 2.5, }) {
|
|
11362
11423
|
// Find selected variant if selections are provided
|
|
@@ -11405,7 +11466,7 @@ function ProductCard({ product, position, section, tabId, onSelect, className, s
|
|
|
11405
11466
|
const [isHovered, setIsHovered] = React.useState(false);
|
|
11406
11467
|
const cardHoverStyle = isHovered
|
|
11407
11468
|
? {
|
|
11408
|
-
backgroundColor: 'var(--seekora-card-hover-bg, var(--seekora-bg-hover,
|
|
11469
|
+
backgroundColor: 'var(--seekora-card-hover-bg, var(--seekora-bg-hover, rgba(0,0,0,0.03)))',
|
|
11409
11470
|
boxShadow: 'var(--seekora-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08))',
|
|
11410
11471
|
}
|
|
11411
11472
|
: {};
|
|
@@ -11419,7 +11480,7 @@ function ProductCard({ product, position, section, tabId, onSelect, className, s
|
|
|
11419
11480
|
}, "data-position": position, "data-section": section, "data-tab-id": tabId },
|
|
11420
11481
|
images.length > 0 ? (React.createElement(ImageDisplay, { images: images, variant: imageVariant, alt: title, className: "seekora-suggestions-product-card-image", enableZoom: enableImageZoom, zoomMode: imageZoomMode, zoomLevel: imageZoomLevel })) : (React.createElement("div", { className: "seekora-suggestions-product-card-placeholder", style: imgStyle, "aria-hidden": true })),
|
|
11421
11482
|
React.createElement("span", { className: "seekora-suggestions-product-card-title", style: { fontSize: '0.875rem', fontWeight: 500 } }, title),
|
|
11422
|
-
price != null && !Number.isNaN(price) ? (React.createElement("span", { className: "seekora-suggestions-product-card-price", style: { fontSize: '0.875rem', color: '
|
|
11483
|
+
price != null && !Number.isNaN(price) ? (React.createElement("span", { className: "seekora-suggestions-product-card-price", style: { fontSize: '0.875rem', color: 'inherit', opacity: 0.6 } },
|
|
11423
11484
|
product.currency ?? '$',
|
|
11424
11485
|
price.toFixed(2))) : null));
|
|
11425
11486
|
}
|
|
@@ -11555,7 +11616,7 @@ function CategoriesTabs({ className, style, tabClassName }) {
|
|
|
11555
11616
|
border: 'none',
|
|
11556
11617
|
borderRadius: 'var(--seekora-border-radius, 6px)',
|
|
11557
11618
|
backgroundColor: isActive ? 'var(--seekora-primary-light, rgba(59, 130, 246, 0.1))' : 'transparent',
|
|
11558
|
-
color: isActive ? 'var(--seekora-primary, #3b82f6)' : '
|
|
11619
|
+
color: isActive ? 'var(--seekora-primary, #3b82f6)' : 'inherit',
|
|
11559
11620
|
cursor: 'pointer',
|
|
11560
11621
|
fontSize: '0.875rem',
|
|
11561
11622
|
fontWeight: isActive ? 600 : 400,
|
|
@@ -11579,7 +11640,7 @@ const itemStyle$1 = {
|
|
|
11579
11640
|
fontSize: 'inherit',
|
|
11580
11641
|
fontFamily: 'inherit',
|
|
11581
11642
|
backgroundColor: 'transparent',
|
|
11582
|
-
color: '
|
|
11643
|
+
color: 'inherit',
|
|
11583
11644
|
transition: 'background-color 120ms ease',
|
|
11584
11645
|
};
|
|
11585
11646
|
function RecentSearchItem({ search, onSelect }) {
|
|
@@ -11587,7 +11648,7 @@ function RecentSearchItem({ search, onSelect }) {
|
|
|
11587
11648
|
return (React.createElement("li", null,
|
|
11588
11649
|
React.createElement("button", { type: "button", className: clsx('seekora-suggestions-recent-item', isHovered && 'seekora-suggestions-recent-item--hover'), style: {
|
|
11589
11650
|
...itemStyle$1,
|
|
11590
|
-
...(isHovered ? { backgroundColor: 'var(--seekora-bg-hover,
|
|
11651
|
+
...(isHovered ? { backgroundColor: 'var(--seekora-bg-hover, rgba(0,0,0,0.05))' } : {}),
|
|
11591
11652
|
}, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onMouseDown: (e) => {
|
|
11592
11653
|
e.preventDefault();
|
|
11593
11654
|
onSelect();
|
|
@@ -11599,7 +11660,7 @@ function RecentSearchesList({ title = 'Recent', maxItems = 8, className, style,
|
|
|
11599
11660
|
if (items.length === 0)
|
|
11600
11661
|
return null;
|
|
11601
11662
|
return (React.createElement("div", { className: clsx('seekora-suggestions-recent-list', className), style: style },
|
|
11602
|
-
title ? (React.createElement("div", { className: "seekora-suggestions-recent-title", style: { padding: '8px 12px', fontSize: '0.75rem', fontWeight: 600, color: '
|
|
11663
|
+
title ? (React.createElement("div", { className: "seekora-suggestions-recent-title", style: { padding: '8px 12px', fontSize: '0.75rem', fontWeight: 600, color: 'inherit', opacity: 0.6, textTransform: 'uppercase' } }, title)) : null,
|
|
11603
11664
|
React.createElement("ul", { className: clsx('seekora-suggestions-recent-ul', listClassName), style: { margin: 0, padding: 0, listStyle: 'none' } }, items.map((search, i) => {
|
|
11604
11665
|
const onSelect = () => selectRecentSearch(search);
|
|
11605
11666
|
if (renderItem) {
|
|
@@ -11623,7 +11684,7 @@ const itemStyle = {
|
|
|
11623
11684
|
fontSize: 'inherit',
|
|
11624
11685
|
fontFamily: 'inherit',
|
|
11625
11686
|
backgroundColor: 'transparent',
|
|
11626
|
-
color: '
|
|
11687
|
+
color: 'inherit',
|
|
11627
11688
|
transition: 'background-color 120ms ease',
|
|
11628
11689
|
};
|
|
11629
11690
|
function TrendingItem({ trending, onSelect }) {
|
|
@@ -11631,13 +11692,13 @@ function TrendingItem({ trending, onSelect }) {
|
|
|
11631
11692
|
return (React.createElement("li", null,
|
|
11632
11693
|
React.createElement("button", { type: "button", className: clsx('seekora-suggestions-trending-item', isHovered && 'seekora-suggestions-trending-item--hover'), style: {
|
|
11633
11694
|
...itemStyle,
|
|
11634
|
-
...(isHovered ? { backgroundColor: 'var(--seekora-bg-hover,
|
|
11695
|
+
...(isHovered ? { backgroundColor: 'var(--seekora-bg-hover, rgba(0,0,0,0.05))' } : {}),
|
|
11635
11696
|
}, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onMouseDown: (e) => {
|
|
11636
11697
|
e.preventDefault();
|
|
11637
11698
|
onSelect();
|
|
11638
11699
|
} },
|
|
11639
11700
|
trending.query,
|
|
11640
|
-
trending.count != null ? (React.createElement("span", { style: { marginLeft: 8, color: '
|
|
11701
|
+
trending.count != null ? (React.createElement("span", { style: { marginLeft: 8, color: 'inherit', opacity: 0.6, fontSize: '0.875em' } }, trending.count)) : null)));
|
|
11641
11702
|
}
|
|
11642
11703
|
function TrendingList({ title = 'Trending', maxItems = 8, className, style, listClassName, renderItem, }) {
|
|
11643
11704
|
const { trendingSearches, selectTrendingSearch } = useSuggestionsContext();
|
|
@@ -11645,7 +11706,7 @@ function TrendingList({ title = 'Trending', maxItems = 8, className, style, list
|
|
|
11645
11706
|
if (items.length === 0)
|
|
11646
11707
|
return null;
|
|
11647
11708
|
return (React.createElement("div", { className: clsx('seekora-suggestions-trending-list', className), style: style },
|
|
11648
|
-
title ? (React.createElement("div", { className: "seekora-suggestions-trending-title", style: { padding: '8px 12px', fontSize: '0.75rem', fontWeight: 600, color: '
|
|
11709
|
+
title ? (React.createElement("div", { className: "seekora-suggestions-trending-title", style: { padding: '8px 12px', fontSize: '0.75rem', fontWeight: 600, color: 'inherit', opacity: 0.6, textTransform: 'uppercase' } }, title)) : null,
|
|
11649
11710
|
React.createElement("ul", { className: clsx('seekora-suggestions-trending-ul', listClassName), style: { margin: 0, padding: 0, listStyle: 'none' } }, items.map((trending, i) => {
|
|
11650
11711
|
const onSelect = () => selectTrendingSearch(trending, i);
|
|
11651
11712
|
if (renderItem) {
|
|
@@ -16642,6 +16703,15 @@ function Results({ hits, groupedHits, selectedIndex, onSelect, onHover, scrollSe
|
|
|
16642
16703
|
}))))))));
|
|
16643
16704
|
}
|
|
16644
16705
|
|
|
16706
|
+
function SeekoraLogo() {
|
|
16707
|
+
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 563 636", width: "20", height: "22", "aria-hidden": "true" },
|
|
16708
|
+
React.createElement("path", { fill: "#03d1ff", d: "M243.44,231.23l-99.23,98.52-9.41,9.41c-14.83,14.83-38.57,13.17-51.4-1.5-2.39-2.73-4.39-5.89-5.89-9.49-.05-.16-.13-.32-.18-.47-1.55-3.68-2.95-7.41-4.29-11.2-7.39-21.24-11.33-44.04-11.25-67.81h.24c-.05-.6-.05-1.24-.08-1.87-.08-2.13-.11-4.29-.11-6.44,0-126.81,102.78-229.59,229.6-229.59,30.84,0,60.29,6.07,87.16,17.14-10.18,10.36-15.22,25.4-12.23,40.7,1.42,7.05,4.39,13.41,8.55,18.75,1.26,1.68,2.68,3.26,4.18,4.73-.58-.34-1.16-.68-1.76-1-25.29-14.62-54.64-22.95-85.9-22.95-95.13,0-172.22,77.12-172.22,172.22,0,1.95.03,3.87.11,5.78v.05c.39,11.94,2,23.59,4.73,34.79l.82-.82,23.14-23.16,47.14-47.14,20.09-20.06c11.31-11.31,27.69-15.57,42.99-11.2.05.03.13.03.18.05.24.05.45.11.68.18,9.47,2.87,17.46,8.73,22.95,16.49,3.6,5.02,6.15,10.83,7.39,17.06l5.94,30.21,1.5,7.57.11.63,1.97-2.05,69.62-72.57,15.28-15.93,33.68-35.15,5.47-5.68,11.31-11.78,23.32-24.32,4.23-4.39,7.94-8.28-6.07,1.18-12.46,2.45-2.18.42-16.36,3.23-.03.03-18.64,3.68c-11.86,2.34-23.4-5.39-25.77-17.25-2.08-10.52,3.73-20.75,13.33-24.64,1.26-.5,2.58-.89,3.97-1.16l45.54-8.99,34.44-6.81,14.99-2.92,23.06-4.58c.58-.11,1.16-.21,1.71-.26.5-.05,1-.11,1.5-.13,1-.05,2-.03,3,.05,4.47.39,8.78,2.18,12.3,5.18,3.76,3.21,6.28,7.52,7.26,12.25.13.68.24,1.37.31,2.05.11,1.05.13,2.1.11,3.16l-1.05,28.08-.66,18.64-.24,6.68-2.26,62.63-.03,1.1c-.39,11.83-10.12,21.14-21.9,21.14-.26,0-.53-.03-.79-.03-5.13-.18-9.75-2.1-13.36-5.15-4.97-4.18-8.05-10.54-7.76-17.54l.11-2.76.42-11.86.58-16.33.58-16.3-235.99,252.7-24.03-127.37Z" }),
|
|
16709
|
+
React.createElement("path", { fill: "#4d66fe", d: "M11.11,572.49c-1.27-6.46.68-13.13,5.22-17.89l105.47-110.63,15.28-15.93,33.68-35.15,5.47-5.68,34.63-36.1,8.23-8.57,11.91,57.94.63,1.42h0c10.78,4,22.09,6.94,33.76,8.73v57.87c-27.58-3.1-53.69-11.12-77.43-23.14L21.34,623.95l-10.23-51.46Z" }),
|
|
16710
|
+
React.createElement("path", { fill: "#4d66fe", d: "M325.32,330.56v136.38c-10.31,1.44-20.85,2.17-31.56,2.17-1.56,0-3.13,0-4.69-.08v-101.86l36.25-36.61Z" }),
|
|
16711
|
+
React.createElement("polygon", { fill: "#4d66fe", points: "381.47 451.71 381.47 385.94 381.55 270.05 345.17 308.07 345.17 463.34 381.47 451.71" }),
|
|
16712
|
+
React.createElement("polygon", { fill: "#4d66fe", points: "437.61 418.26 437.65 321.78 437.69 213.67 401.32 251.68 401.32 442.32 437.61 418.26" }),
|
|
16713
|
+
React.createElement("path", { fill: "#4d66fe", d: "M493.87,157.13l-.08,108.11v86.38c-9.91,17.8-22.14,34.13-36.29,48.56v-205l36.37-38.05Z" })));
|
|
16714
|
+
}
|
|
16645
16715
|
function Footer({ translations = {} }) {
|
|
16646
16716
|
return (React.createElement("footer", { className: "seekora-docsearch-footer" },
|
|
16647
16717
|
React.createElement("div", { className: "seekora-docsearch-footer-commands" },
|
|
@@ -16662,7 +16732,8 @@ function Footer({ translations = {} }) {
|
|
|
16662
16732
|
React.createElement("div", { className: "seekora-docsearch-footer-logo" },
|
|
16663
16733
|
React.createElement("span", { className: "seekora-docsearch-footer-logo-text" }, translations.searchByText || 'Search by'),
|
|
16664
16734
|
React.createElement("a", { href: "https://seekora.ai", target: "_blank", rel: "noopener noreferrer", className: "seekora-docsearch-footer-logo-link" },
|
|
16665
|
-
React.createElement(
|
|
16735
|
+
React.createElement(SeekoraLogo, null),
|
|
16736
|
+
React.createElement("span", { className: "seekora-docsearch-logo", style: { fontWeight: 600 } }, "Seekora")))));
|
|
16666
16737
|
}
|
|
16667
16738
|
|
|
16668
16739
|
function useKeyboard(options) {
|
|
@@ -16806,18 +16877,31 @@ function useDocSearch(options) {
|
|
|
16806
16877
|
const abortControllersRef = React.useRef(new Map());
|
|
16807
16878
|
const debounceTimerRef = React.useRef(null);
|
|
16808
16879
|
const defaultTransform = (data, sourceId) => {
|
|
16809
|
-
const items = data.data?.suggestions || data.data?.results || data.suggestions || data.results || data.hits || [];
|
|
16810
|
-
return items.map((item) =>
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16880
|
+
const items = data.data?.suggestions || data.data?.results || data.data?.hits || data.suggestions || data.results || data.hits || [];
|
|
16881
|
+
return items.map((item) => {
|
|
16882
|
+
const doc = item.document || item;
|
|
16883
|
+
// Build hierarchy from nested object or flat dot-notation keys
|
|
16884
|
+
const hierarchy = doc.hierarchy || {
|
|
16885
|
+
lvl0: doc['hierarchy.lvl0'],
|
|
16886
|
+
lvl1: doc['hierarchy.lvl1'],
|
|
16887
|
+
lvl2: doc['hierarchy.lvl2'],
|
|
16888
|
+
lvl3: doc['hierarchy.lvl3'],
|
|
16889
|
+
lvl4: doc['hierarchy.lvl4'],
|
|
16890
|
+
lvl5: doc['hierarchy.lvl5'],
|
|
16891
|
+
};
|
|
16892
|
+
return {
|
|
16893
|
+
url: doc.url || doc.route || item.url || '',
|
|
16894
|
+
title: (doc.title || '').replace?.(/<\/?mark>/g, '') || '',
|
|
16895
|
+
content: (doc.content || doc.description || '').replace?.(/<\/?mark>/g, '')?.substring?.(0, 100) || '',
|
|
16896
|
+
description: doc.description || doc.content?.substring?.(0, 100) || '',
|
|
16897
|
+
category: doc.category || hierarchy?.lvl0 || '',
|
|
16898
|
+
hierarchy,
|
|
16899
|
+
route: doc.route,
|
|
16900
|
+
parentTitle: doc.parent_title || doc.parentTitle,
|
|
16901
|
+
anchor: doc.anchor || item.anchor,
|
|
16902
|
+
_source: sourceId,
|
|
16903
|
+
};
|
|
16904
|
+
});
|
|
16821
16905
|
};
|
|
16822
16906
|
const transformPublicSearchResults = React.useCallback((data, sourceId) => {
|
|
16823
16907
|
const results = data?.data?.results || [];
|