@getlupa/client 1.20.3 → 1.20.5

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.
@@ -19231,7 +19231,7 @@ var __async = (__this, __arguments, generator) => {
19231
19231
  const routing = (_b25 = optionsStore.boxRoutingBehavior) != null ? _b25 : "direct-link";
19232
19232
  redirectToResultsPage(
19233
19233
  searchResultsLink.value,
19234
- searchText,
19234
+ encodeParam(searchText),
19235
19235
  optionsStore.getQueryParamName,
19236
19236
  facet,
19237
19237
  routing
@@ -20402,12 +20402,18 @@ var __async = (__this, __arguments, generator) => {
20402
20402
  var _a25, _b25;
20403
20403
  return `${suggestion.display}${(_a25 = suggestion.facet) == null ? void 0 : _a25.key}${(_b25 = suggestion.facet) == null ? void 0 : _b25.title}`;
20404
20404
  };
20405
+ const doesSuggestionHaveFacet = (suggestion) => {
20406
+ return suggestion.facet !== void 0 && suggestion.facet.key !== void 0;
20407
+ };
20405
20408
  watch(highlightedItem, () => {
20406
20409
  var _a25;
20407
20410
  if (highlightedIndex.value < 0) {
20408
20411
  return;
20409
20412
  }
20410
- const selected = (_a25 = props.items[highlightedIndex.value]) != null ? _a25 : { suggestion: { suggestion: "" }, facet: void 0 };
20413
+ const selected = (_a25 = props.items[highlightedIndex.value]) != null ? _a25 : {
20414
+ suggestion: { suggestion: "" },
20415
+ facet: void 0
20416
+ };
20411
20417
  handleSelect({
20412
20418
  suggestion: selected.suggestion,
20413
20419
  facet: selected.facet,
@@ -20419,7 +20425,11 @@ var __async = (__this, __arguments, generator) => {
20419
20425
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
20420
20426
  return openBlock(), createBlock(_sfc_main$1s, {
20421
20427
  key: getSuggestionKey(item),
20422
- class: normalizeClass(["lupa-suggestion", index === highlightedIndex.value ? "lupa-suggestion-highlighted" : ""]),
20428
+ class: normalizeClass([
20429
+ "lupa-suggestion",
20430
+ index === highlightedIndex.value ? "lupa-suggestion-highlighted" : "",
20431
+ doesSuggestionHaveFacet(item) ? "lupa-faceted-suggestion" : "lupa-plain-suggestion"
20432
+ ]),
20423
20433
  suggestion: item,
20424
20434
  highlight: highlight2.value,
20425
20435
  labels: _ctx.labels,
@@ -19231,7 +19231,7 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
19231
19231
  const routing = (_b25 = optionsStore.boxRoutingBehavior) != null ? _b25 : "direct-link";
19232
19232
  redirectToResultsPage(
19233
19233
  searchResultsLink.value,
19234
- searchText,
19234
+ encodeParam(searchText),
19235
19235
  optionsStore.getQueryParamName,
19236
19236
  facet,
19237
19237
  routing
@@ -20402,12 +20402,18 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
20402
20402
  var _a25, _b25;
20403
20403
  return `${suggestion.display}${(_a25 = suggestion.facet) == null ? void 0 : _a25.key}${(_b25 = suggestion.facet) == null ? void 0 : _b25.title}`;
20404
20404
  };
20405
+ const doesSuggestionHaveFacet = (suggestion) => {
20406
+ return suggestion.facet !== void 0 && suggestion.facet.key !== void 0;
20407
+ };
20405
20408
  watch(highlightedItem, () => {
20406
20409
  var _a25;
20407
20410
  if (highlightedIndex.value < 0) {
20408
20411
  return;
20409
20412
  }
20410
- const selected = (_a25 = props.items[highlightedIndex.value]) != null ? _a25 : { suggestion: { suggestion: "" }, facet: void 0 };
20413
+ const selected = (_a25 = props.items[highlightedIndex.value]) != null ? _a25 : {
20414
+ suggestion: { suggestion: "" },
20415
+ facet: void 0
20416
+ };
20411
20417
  handleSelect({
20412
20418
  suggestion: selected.suggestion,
20413
20419
  facet: selected.facet,
@@ -20419,7 +20425,11 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
20419
20425
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
20420
20426
  return openBlock(), createBlock(_sfc_main$1s, {
20421
20427
  key: getSuggestionKey(item),
20422
- class: normalizeClass(["lupa-suggestion", index === highlightedIndex.value ? "lupa-suggestion-highlighted" : ""]),
20428
+ class: normalizeClass([
20429
+ "lupa-suggestion",
20430
+ index === highlightedIndex.value ? "lupa-suggestion-highlighted" : "",
20431
+ doesSuggestionHaveFacet(item) ? "lupa-faceted-suggestion" : "lupa-plain-suggestion"
20432
+ ]),
20423
20433
  suggestion: item,
20424
20434
  highlight: highlight2.value,
20425
20435
  labels: _ctx.labels,
@@ -19229,7 +19229,7 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
19229
19229
  const routing = (_b25 = optionsStore.boxRoutingBehavior) != null ? _b25 : "direct-link";
19230
19230
  redirectToResultsPage(
19231
19231
  searchResultsLink.value,
19232
- searchText,
19232
+ encodeParam(searchText),
19233
19233
  optionsStore.getQueryParamName,
19234
19234
  facet,
19235
19235
  routing
@@ -20400,12 +20400,18 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
20400
20400
  var _a25, _b25;
20401
20401
  return `${suggestion.display}${(_a25 = suggestion.facet) == null ? void 0 : _a25.key}${(_b25 = suggestion.facet) == null ? void 0 : _b25.title}`;
20402
20402
  };
20403
+ const doesSuggestionHaveFacet = (suggestion) => {
20404
+ return suggestion.facet !== void 0 && suggestion.facet.key !== void 0;
20405
+ };
20403
20406
  watch(highlightedItem, () => {
20404
20407
  var _a25;
20405
20408
  if (highlightedIndex.value < 0) {
20406
20409
  return;
20407
20410
  }
20408
- const selected = (_a25 = props.items[highlightedIndex.value]) != null ? _a25 : { suggestion: { suggestion: "" }, facet: void 0 };
20411
+ const selected = (_a25 = props.items[highlightedIndex.value]) != null ? _a25 : {
20412
+ suggestion: { suggestion: "" },
20413
+ facet: void 0
20414
+ };
20409
20415
  handleSelect({
20410
20416
  suggestion: selected.suggestion,
20411
20417
  facet: selected.facet,
@@ -20417,7 +20423,11 @@ const _sfc_main$1r = /* @__PURE__ */ defineComponent({
20417
20423
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
20418
20424
  return openBlock(), createBlock(_sfc_main$1s, {
20419
20425
  key: getSuggestionKey(item),
20420
- class: normalizeClass(["lupa-suggestion", index === highlightedIndex.value ? "lupa-suggestion-highlighted" : ""]),
20426
+ class: normalizeClass([
20427
+ "lupa-suggestion",
20428
+ index === highlightedIndex.value ? "lupa-suggestion-highlighted" : "",
20429
+ doesSuggestionHaveFacet(item) ? "lupa-faceted-suggestion" : "lupa-plain-suggestion"
20430
+ ]),
20421
20431
  suggestion: item,
20422
20432
  highlight: highlight2.value,
20423
20433
  labels: _ctx.labels,
@@ -19233,7 +19233,7 @@ var __async = (__this, __arguments, generator) => {
19233
19233
  const routing = (_b25 = optionsStore.boxRoutingBehavior) != null ? _b25 : "direct-link";
19234
19234
  redirectToResultsPage(
19235
19235
  searchResultsLink.value,
19236
- searchText,
19236
+ encodeParam(searchText),
19237
19237
  optionsStore.getQueryParamName,
19238
19238
  facet,
19239
19239
  routing
@@ -20404,12 +20404,18 @@ var __async = (__this, __arguments, generator) => {
20404
20404
  var _a25, _b25;
20405
20405
  return `${suggestion.display}${(_a25 = suggestion.facet) == null ? void 0 : _a25.key}${(_b25 = suggestion.facet) == null ? void 0 : _b25.title}`;
20406
20406
  };
20407
+ const doesSuggestionHaveFacet = (suggestion) => {
20408
+ return suggestion.facet !== void 0 && suggestion.facet.key !== void 0;
20409
+ };
20407
20410
  watch(highlightedItem, () => {
20408
20411
  var _a25;
20409
20412
  if (highlightedIndex.value < 0) {
20410
20413
  return;
20411
20414
  }
20412
- const selected = (_a25 = props.items[highlightedIndex.value]) != null ? _a25 : { suggestion: { suggestion: "" }, facet: void 0 };
20415
+ const selected = (_a25 = props.items[highlightedIndex.value]) != null ? _a25 : {
20416
+ suggestion: { suggestion: "" },
20417
+ facet: void 0
20418
+ };
20413
20419
  handleSelect({
20414
20420
  suggestion: selected.suggestion,
20415
20421
  facet: selected.facet,
@@ -20421,7 +20427,11 @@ var __async = (__this, __arguments, generator) => {
20421
20427
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
20422
20428
  return openBlock(), createBlock(_sfc_main$1s, {
20423
20429
  key: getSuggestionKey(item),
20424
- class: normalizeClass(["lupa-suggestion", index === highlightedIndex.value ? "lupa-suggestion-highlighted" : ""]),
20430
+ class: normalizeClass([
20431
+ "lupa-suggestion",
20432
+ index === highlightedIndex.value ? "lupa-suggestion-highlighted" : "",
20433
+ doesSuggestionHaveFacet(item) ? "lupa-faceted-suggestion" : "lupa-plain-suggestion"
20434
+ ]),
20425
20435
  suggestion: item,
20426
20436
  highlight: highlight2.value,
20427
20437
  labels: _ctx.labels,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.20.3",
3
+ "version": "1.20.5",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/lupaSearch.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.8.1",
23
- "@getlupa/vue": "0.20.2",
23
+ "@getlupa/vue": "0.20.4",
24
24
  "@rushstack/eslint-patch": "^1.12.0",
25
25
  "@tsconfig/node18": "^18.2.4",
26
26
  "@types/jsdom": "^21.1.7",