@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.mjs
CHANGED
|
@@ -12669,7 +12669,7 @@ var SearchPanelRoot = styled6.section`
|
|
|
12669
12669
|
${({ $chatMode }) => $chatMode && `
|
|
12670
12670
|
display: flex;
|
|
12671
12671
|
flex-direction: column;
|
|
12672
|
-
height: 805px;
|
|
12672
|
+
max-height: 805px;
|
|
12673
12673
|
overflow: hidden;
|
|
12674
12674
|
`}
|
|
12675
12675
|
`;
|
|
@@ -13617,8 +13617,9 @@ function toCarouselItem(product, index2, showPricing, history) {
|
|
|
13617
13617
|
price: showPricing ? priceText : void 0,
|
|
13618
13618
|
addToCartLabel: "View Product",
|
|
13619
13619
|
addToCartAriaLabel: `View ${productName}`,
|
|
13620
|
-
onProductClick: () => {
|
|
13620
|
+
onProductClick: ({ event } = {}) => {
|
|
13621
13621
|
if (href === "#") return;
|
|
13622
|
+
event == null ? void 0 : event.preventDefault();
|
|
13622
13623
|
if (history && typeof history.push === "function") {
|
|
13623
13624
|
history.push(href);
|
|
13624
13625
|
}
|
|
@@ -14181,14 +14182,13 @@ function SearchModal({
|
|
|
14181
14182
|
}, [enableAIChat, isOpen, isInChatMode, hasQuery, query]);
|
|
14182
14183
|
const sendAIMessage = useCallback(
|
|
14183
14184
|
(queryText) => {
|
|
14184
|
-
var _a2;
|
|
14185
14185
|
const config = aiChatConfigRef.current;
|
|
14186
14186
|
if (!config || !queryText.trim()) return;
|
|
14187
14187
|
setSearchInput("");
|
|
14188
14188
|
setPendingQuery(queryText.trim());
|
|
14189
14189
|
setAiStatus(aiStatusLabels.analyzing);
|
|
14190
14190
|
const requestId = aiRequestCounterRef.current;
|
|
14191
|
-
const
|
|
14191
|
+
const productBasePath = `/${config.market.toLowerCase()}/${config.language.toLowerCase()}/product`;
|
|
14192
14192
|
const chatService = createChatService({
|
|
14193
14193
|
conversationsUrl: config.conversationsUrl,
|
|
14194
14194
|
messagesUrl: config.messagesUrl,
|
|
@@ -14214,8 +14214,8 @@ function SearchModal({
|
|
|
14214
14214
|
).then((result) => {
|
|
14215
14215
|
if (!result || requestId !== aiRequestCounterRef.current) return;
|
|
14216
14216
|
const products = result.products.map((p, i) => {
|
|
14217
|
-
var
|
|
14218
|
-
const productId = getProductId((_b2 = (
|
|
14217
|
+
var _a2, _b2;
|
|
14218
|
+
const productId = getProductId((_b2 = (_a2 = p.id) != null ? _a2 : p.sku) != null ? _b2 : i);
|
|
14219
14219
|
const productName = getProductName(p, productId);
|
|
14220
14220
|
return {
|
|
14221
14221
|
id: productId,
|
|
@@ -14226,7 +14226,10 @@ function SearchModal({
|
|
|
14226
14226
|
...p.retail_price != null ? { retail_price: p.retail_price } : {},
|
|
14227
14227
|
...p.description ? { description: p.description } : {},
|
|
14228
14228
|
...p.badge ? { badge: p.badge } : {},
|
|
14229
|
-
...p.sku != null ? {
|
|
14229
|
+
...p.sku != null ? {
|
|
14230
|
+
url: `${productBasePath}/${p.sku}`,
|
|
14231
|
+
routeUrl: `/product/${p.sku}`
|
|
14232
|
+
} : {}
|
|
14230
14233
|
};
|
|
14231
14234
|
});
|
|
14232
14235
|
setAiStatus("");
|