@nuskin/react-search-sdk 1.0.0-comx-2233.2 → 1.0.0-comx-2233.3
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -237,9 +237,9 @@ interface SearchService {
|
|
|
237
237
|
* SearchApiService — Phase 0 lift-and-shift of
|
|
238
238
|
* `header-mfe/src/services/HeaderSearchService.js`.
|
|
239
239
|
*
|
|
240
|
-
* Behaviour
|
|
241
|
-
* `sessionStorage` key format,
|
|
242
|
-
*
|
|
240
|
+
* Behaviour follows the header search contract for URL formats,
|
|
241
|
+
* `sessionStorage` key format, fetch parameter shape, and fallback values.
|
|
242
|
+
* Navigation side effects are left to the consuming router.
|
|
243
243
|
*
|
|
244
244
|
* Two responsibilities were intentionally moved OUT of the SDK to preserve
|
|
245
245
|
* the SDK-narrow boundary:
|
package/dist/index.d.ts
CHANGED
|
@@ -237,9 +237,9 @@ interface SearchService {
|
|
|
237
237
|
* SearchApiService — Phase 0 lift-and-shift of
|
|
238
238
|
* `header-mfe/src/services/HeaderSearchService.js`.
|
|
239
239
|
*
|
|
240
|
-
* Behaviour
|
|
241
|
-
* `sessionStorage` key format,
|
|
242
|
-
*
|
|
240
|
+
* Behaviour follows the header search contract for URL formats,
|
|
241
|
+
* `sessionStorage` key format, fetch parameter shape, and fallback values.
|
|
242
|
+
* Navigation side effects are left to the consuming router.
|
|
243
243
|
*
|
|
244
244
|
* Two responsibilities were intentionally moved OUT of the SDK to preserve
|
|
245
245
|
* the SDK-narrow boundary:
|
package/dist/index.js
CHANGED
|
@@ -343,17 +343,13 @@ function createSearchService(options = {}) {
|
|
|
343
343
|
if (!trimmedQuery) return void 0;
|
|
344
344
|
addRecentHeaderSearch(localeParts, trimmedQuery, storage);
|
|
345
345
|
const optionHref = resolveOptionHref(option, localeParts);
|
|
346
|
-
if (optionHref
|
|
347
|
-
locationLike.assign(optionHref);
|
|
346
|
+
if (optionHref) {
|
|
348
347
|
return stripLocalePrefix(optionHref, localeParts);
|
|
349
348
|
}
|
|
350
349
|
const targetPath = buildSearchResultsPath(
|
|
351
350
|
trimmedQuery,
|
|
352
351
|
localeParts
|
|
353
352
|
);
|
|
354
|
-
if (locationLike && typeof locationLike.assign === "function") {
|
|
355
|
-
locationLike.assign(targetPath);
|
|
356
|
-
}
|
|
357
353
|
return stripLocalePrefix(targetPath, localeParts);
|
|
358
354
|
},
|
|
359
355
|
activateSuggestionAction(option) {
|
|
@@ -366,9 +362,7 @@ function createSearchService(options = {}) {
|
|
|
366
362
|
option,
|
|
367
363
|
localeParts
|
|
368
364
|
);
|
|
369
|
-
if (optionHref2
|
|
370
|
-
locationLike.assign(optionHref2);
|
|
371
|
-
} else {
|
|
365
|
+
if (!optionHref2) {
|
|
372
366
|
const optionQuery2 = option?.value ?? option?.label ?? option?.identifier ?? "";
|
|
373
367
|
service.submitProductSearch(
|
|
374
368
|
String(optionQuery2)
|
|
@@ -387,9 +381,8 @@ function createSearchService(options = {}) {
|
|
|
387
381
|
}
|
|
388
382
|
}
|
|
389
383
|
const optionHref = resolveOptionHref(option, localeParts);
|
|
390
|
-
if (optionHref
|
|
391
|
-
|
|
392
|
-
return optionHref;
|
|
384
|
+
if (optionHref) {
|
|
385
|
+
return stripLocalePrefix(optionHref, localeParts);
|
|
393
386
|
}
|
|
394
387
|
const optionQuery = option?.value ?? option?.label ?? option?.identifier ?? "";
|
|
395
388
|
return service.submitProductSearch(String(optionQuery));
|