@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 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 is intentionally preserved verbatim: same URL formats, same
241
- * `sessionStorage` key format, same fetch parameter shape, same fallback
242
- * values. See the ported source for context.
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 is intentionally preserved verbatim: same URL formats, same
241
- * `sessionStorage` key format, same fetch parameter shape, same fallback
242
- * values. See the ported source for context.
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 && locationLike && typeof locationLike.assign === "function") {
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 && locationLike && typeof locationLike.assign === "function") {
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 && locationLike && typeof locationLike.assign === "function") {
391
- locationLike.assign(optionHref);
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));