@nuskin/react-search-components 1.0.0-comx-3067.5 → 1.0.0-comx-3067.6
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -12675,7 +12675,7 @@ var SearchPanelRoot = styled6__default.default.section`
|
|
|
12675
12675
|
${({ $chatMode }) => $chatMode && `
|
|
12676
12676
|
display: flex;
|
|
12677
12677
|
flex-direction: column;
|
|
12678
|
-
height: 805px;
|
|
12678
|
+
max-height: 805px;
|
|
12679
12679
|
overflow: hidden;
|
|
12680
12680
|
`}
|
|
12681
12681
|
`;
|
|
@@ -13623,8 +13623,9 @@ function toCarouselItem(product, index2, showPricing, history) {
|
|
|
13623
13623
|
price: showPricing ? priceText : void 0,
|
|
13624
13624
|
addToCartLabel: "View Product",
|
|
13625
13625
|
addToCartAriaLabel: `View ${productName}`,
|
|
13626
|
-
onProductClick: () => {
|
|
13626
|
+
onProductClick: ({ event } = {}) => {
|
|
13627
13627
|
if (href === "#") return;
|
|
13628
|
+
event == null ? void 0 : event.preventDefault();
|
|
13628
13629
|
if (history && typeof history.push === "function") {
|
|
13629
13630
|
history.push(href);
|
|
13630
13631
|
}
|
|
@@ -14187,14 +14188,13 @@ function SearchModal({
|
|
|
14187
14188
|
}, [enableAIChat, isOpen, isInChatMode, hasQuery, query]);
|
|
14188
14189
|
const sendAIMessage = React.useCallback(
|
|
14189
14190
|
(queryText) => {
|
|
14190
|
-
var _a2;
|
|
14191
14191
|
const config = aiChatConfigRef.current;
|
|
14192
14192
|
if (!config || !queryText.trim()) return;
|
|
14193
14193
|
setSearchInput("");
|
|
14194
14194
|
setPendingQuery(queryText.trim());
|
|
14195
14195
|
setAiStatus(aiStatusLabels.analyzing);
|
|
14196
14196
|
const requestId = aiRequestCounterRef.current;
|
|
14197
|
-
const
|
|
14197
|
+
const productBasePath = `/${config.market.toLowerCase()}/${config.language.toLowerCase()}/product`;
|
|
14198
14198
|
const chatService = reactSearchSdk.createChatService({
|
|
14199
14199
|
conversationsUrl: config.conversationsUrl,
|
|
14200
14200
|
messagesUrl: config.messagesUrl,
|
|
@@ -14220,8 +14220,8 @@ function SearchModal({
|
|
|
14220
14220
|
).then((result) => {
|
|
14221
14221
|
if (!result || requestId !== aiRequestCounterRef.current) return;
|
|
14222
14222
|
const products = result.products.map((p, i) => {
|
|
14223
|
-
var
|
|
14224
|
-
const productId = getProductId((_b2 = (
|
|
14223
|
+
var _a2, _b2;
|
|
14224
|
+
const productId = getProductId((_b2 = (_a2 = p.id) != null ? _a2 : p.sku) != null ? _b2 : i);
|
|
14225
14225
|
const productName = getProductName(p, productId);
|
|
14226
14226
|
return {
|
|
14227
14227
|
id: productId,
|
|
@@ -14232,7 +14232,10 @@ function SearchModal({
|
|
|
14232
14232
|
...p.retail_price != null ? { retail_price: p.retail_price } : {},
|
|
14233
14233
|
...p.description ? { description: p.description } : {},
|
|
14234
14234
|
...p.badge ? { badge: p.badge } : {},
|
|
14235
|
-
...p.sku != null ? {
|
|
14235
|
+
...p.sku != null ? {
|
|
14236
|
+
url: `${productBasePath}/${p.sku}`,
|
|
14237
|
+
routeUrl: `/product/${p.sku}`
|
|
14238
|
+
} : {}
|
|
14236
14239
|
};
|
|
14237
14240
|
});
|
|
14238
14241
|
setAiStatus("");
|