@depict-ai/ui 1.4.10 → 1.4.11

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/latest/index.js CHANGED
@@ -5,7 +5,7 @@ import { createSignal as $9HbP8$createSignal, createMemo as $9HbP8$createMemo, u
5
5
  /*! Depict.ai search and product listing SDK */
6
6
  import { register_es_version } from "../multi_import_deduplicator.mjs";
7
7
  register_es_version("ui", "latest");
8
- const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.10";
8
+ const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.11";
9
9
  function $24e27fab9c821b86$export$5bad61ecde080b1f(...params) {
10
10
  const {
11
11
  collapse: collapse,
@@ -5684,11 +5684,10 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
5684
5684
  const crumb_data_ = (0, $9HbP8$createMemo)(() => plp_results_()?.breadcrumb);
5685
5685
  const quicklinks_data_ = (0, $9HbP8$createMemo)(() => plp_results_()?.quick_links);
5686
5686
  const meta_tag_data_ = (0, $9HbP8$createMemo)(() => {
5687
- meta_title_suffix_();
5688
- return plp_results_()?.metadata?.replace_meta_tags ? {
5687
+ if (plp_results_()?.metadata?.replace_meta_tags) return {
5689
5688
  title: plp_results_()?.metadata?.title + (meta_title_suffix_() || ""),
5690
5689
  description: plp_results_()?.metadata?.description
5691
- } : null;
5690
+ };
5692
5691
  });
5693
5692
  (0, $9HbP8$edit_current_page_meta_tags)(meta_tag_data_);
5694
5693
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $9HbP8$createSignal)(false);
@@ -6027,8 +6026,12 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
6027
6026
  const router_ = options.router_;
6028
6027
  const search_query_url_param_name_ = "search_query_url_param_name_" in options ? options.search_query_url_param_name_ : undefined;
6029
6028
  const search_query_ = search_query_url_param_name_ ? (0, $9HbP8$createSignal)("") : undefined;
6029
+ const override_query_id_query_param_names_ = "override_query_id_query_param_names_" in options ? options.override_query_id_query_param_names_ : undefined;
6030
+ const override_query_id_ = override_query_id_query_param_names_ ? (0, $9HbP8$createSignal)(null) : undefined;
6030
6031
  const get_search_query_ = search_query_?.[0];
6031
6032
  const set_search_query = search_query_?.[1];
6033
+ const get_override_query_id_ = override_query_id_?.[0];
6034
+ const set_override_query_id = override_query_id_?.[1];
6032
6035
  const current_sorting_ = (0, $9HbP8$createSignal)();
6033
6036
  const selected_filters_ = (0, $9HbP8$createSignal)([]);
6034
6037
  const sideways_filter_clearing_flag_ = (0, $9HbP8$createSignal)(false);
@@ -6073,6 +6076,12 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
6073
6076
  const found_query = searchParams.get(search_query_url_param_name_);
6074
6077
  set_search_query(found_query || "");
6075
6078
  }
6079
+ if (override_query_id_query_param_names_) {
6080
+ const found_override_query_id = override_query_id_query_param_names_.map(n => searchParams.get(n)).find(n => n);
6081
+ set_override_query_id(found_override_query_id || null);
6082
+ if (found_override_query_id) (0, $9HbP8$dlog)("Found override query id:", found_override_query_id); // This stuff might get confusing so better log it
6083
+ }
6084
+
6076
6085
  if (searchParams.get((0, $4147651646da990a$export$cf5feb2102aec7f2)) === "true") set_has_sideways_filter_clearing_flag(true);
6077
6086
  if (!writer_started) {
6078
6087
  // The owner here is the createComputed which gets disposed the next time the computation runs - but we actually just want to delay the start of the href_writer until our signals contain the current value of the URL, therefore the runWithOwner
@@ -6096,7 +6105,10 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
6096
6105
  search_query_accessor_: get_search_query_
6097
6106
  } : {
6098
6107
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
6099
- })
6108
+ }),
6109
+ ...(typeof override_query_id_query_param_names_ === "object" ? {
6110
+ override_query_id_accessor_: get_override_query_id_
6111
+ } : {})
6100
6112
  };
6101
6113
  }
6102
6114
  /**
@@ -6282,6 +6294,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
6282
6294
  #market_signal = (0, $9HbP8$createSignal)();
6283
6295
  #query_id_signal = (0, $9HbP8$createSignal)("");
6284
6296
  #meta_title_suffix_ = (0, $9HbP8$createSignal)();
6297
+ #disable_override_query_id = (0, $9HbP8$createSignal)();
6285
6298
  #listing_type_signal = (0, $9HbP8$createSignal)();
6286
6299
  static #keys_constructed_with = new Set();
6287
6300
  get localization() {
@@ -6321,6 +6334,12 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
6321
6334
  set meta_title_suffix(new_suffix) {
6322
6335
  this.#meta_title_suffix_[1](new_suffix);
6323
6336
  }
6337
+ get disable_override_query_id() {
6338
+ return this.#disable_override_query_id[0]();
6339
+ }
6340
+ set disable_override_query_id(new_value) {
6341
+ this.#disable_override_query_id[1](new_value);
6342
+ }
6324
6343
  get on_navigation() {
6325
6344
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
6326
6345
  return this.#router.on_navigation_;
@@ -6346,16 +6365,19 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
6346
6365
  (0, $90980bd87c9960f9$export$5162a71f252e6122)();
6347
6366
  this.#router = new (0, $4fd2ba03703a7d92$export$7e1297a3a19f10d8)("hard_navigation", query_id_state_key);
6348
6367
  if (on_navigation) this.#router.on_navigation_ = on_navigation;
6368
+ const override_query_id_query_param_names_ = ["query_id_" + unique_instance_key_for_state, "query_id"]; // If you're wondering why this is an array https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7958#note_1511700842
6349
6369
  const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
6350
6370
  const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
6351
6371
  const {
6352
6372
  selected_filters_: selected_filters_,
6353
6373
  current_sorting_: current_sorting_,
6354
- sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
6374
+ sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
6375
+ override_query_id_accessor_: override_query_id_accessor_
6355
6376
  } = (0, $ccd5db07a3a069c5$export$477caf01aecaeb2a)({
6356
6377
  router_: this.#router,
6357
6378
  sorting_query_param_: sorting_query_param_,
6358
- filter_query_param_prefix_: filter_query_param_prefix_
6379
+ filter_query_param_prefix_: filter_query_param_prefix_,
6380
+ override_query_id_query_param_names_: override_query_id_query_param_names_
6359
6381
  });
6360
6382
  const [reset_history_state_, state_] = (0, $a8fa7302d6f93c0b$export$9862539c89138352)({
6361
6383
  get_default_values_: () => ({
@@ -6385,6 +6407,7 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
6385
6407
  router_: this.#router,
6386
6408
  selected_filters_: selected_filters_,
6387
6409
  current_sorting_: current_sorting_,
6410
+ override_query_id_accessor_: override_query_id_accessor_,
6388
6411
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
6389
6412
  sorting_query_param_: sorting_query_param_,
6390
6413
  filter_query_param_prefix_: filter_query_param_prefix_
@@ -6431,6 +6454,7 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
6431
6454
  },
6432
6455
  current_sorting_: current_sorting_,
6433
6456
  selected_filters_: selected_filters_,
6457
+ override_query_id_accessor_: override_query_id_accessor_,
6434
6458
  reset_history_state_: reset_history_state_,
6435
6459
  depict_api_: depict_api_,
6436
6460
  i18n_: i18n_,
@@ -6448,8 +6472,8 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
6448
6472
  depict_api_: depict_api_,
6449
6473
  min_products_to_fetch_: $961b5c64bef4662f$var$min_products_to_fetch_,
6450
6474
  local_filter_cache_: local_filter_cache_,
6475
+ query_id_: (0, $9HbP8$createMemo)(() => !depict_category.disable_override_query_id && override_query_id_accessor_() || depict_category.category_id),
6451
6476
  meta_title_suffix_: () => depict_category.meta_title_suffix,
6452
- query_id_: () => depict_category.category_id,
6453
6477
  listing_type_: () => depict_category.listing_type,
6454
6478
  i18n_: i18n_,
6455
6479
  show_quicklinks_: (0, $9HbP8$createMemo)(() => props.show_quicklinks ?? true),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
5
5
  "packageManager": "yarn@3.2.2",
6
6
  "sass": "styles.scss",
@@ -237,8 +237,8 @@
237
237
  "@babel/runtime": "latest",
238
238
  "@babel/runtime-corejs3": "^7.22.6",
239
239
  "@depict-ai/plp-styling": "^1.0.33",
240
- "@depict-ai/types": "^1.0.34",
241
- "@depict-ai/utilishared": "^1.0.32",
240
+ "@depict-ai/types": "^1.0.35",
241
+ "@depict-ai/utilishared": "^1.0.33",
242
242
  "solid-js": "^1.7.3"
243
243
  },
244
244
  "type": "module",
@@ -60,7 +60,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
60
60
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
61
61
  $parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
62
62
  /*! Depict.ai search and product listing SDK */
63
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "1.4.10";
63
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "1.4.11";
64
64
  function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
65
65
  const {
66
66
  collapse: collapse,
@@ -4941,12 +4941,14 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
4941
4941
  return (_plp_results_4 = plp_results_()) === null || _plp_results_4 === void 0 ? void 0 : _plp_results_4.quick_links;
4942
4942
  });
4943
4943
  const meta_tag_data_ = (0, $3hooq$solidjs.createMemo)(() => {
4944
- var _plp_results_5, _plp_results_5$metada, _plp_results_6, _plp_results_6$metada, _plp_results_7, _plp_results_7$metada;
4945
- meta_title_suffix_();
4946
- return (_plp_results_5 = plp_results_()) !== null && _plp_results_5 !== void 0 && (_plp_results_5$metada = _plp_results_5.metadata) !== null && _plp_results_5$metada !== void 0 && _plp_results_5$metada.replace_meta_tags ? {
4947
- title: ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : (_plp_results_6$metada = _plp_results_6.metadata) === null || _plp_results_6$metada === void 0 ? void 0 : _plp_results_6$metada.title) + (meta_title_suffix_() || ""),
4948
- description: (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : (_plp_results_7$metada = _plp_results_7.metadata) === null || _plp_results_7$metada === void 0 ? void 0 : _plp_results_7$metada.description
4949
- } : null;
4944
+ var _plp_results_5, _plp_results_5$metada;
4945
+ if ((_plp_results_5 = plp_results_()) !== null && _plp_results_5 !== void 0 && (_plp_results_5$metada = _plp_results_5.metadata) !== null && _plp_results_5$metada !== void 0 && _plp_results_5$metada.replace_meta_tags) {
4946
+ var _plp_results_6, _plp_results_6$metada, _plp_results_7, _plp_results_7$metada;
4947
+ return {
4948
+ title: ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : (_plp_results_6$metada = _plp_results_6.metadata) === null || _plp_results_6$metada === void 0 ? void 0 : _plp_results_6$metada.title) + (meta_title_suffix_() || ""),
4949
+ description: (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : (_plp_results_7$metada = _plp_results_7.metadata) === null || _plp_results_7$metada === void 0 ? void 0 : _plp_results_7$metada.description
4950
+ };
4951
+ }
4950
4952
  });
4951
4953
  (0, $3hooq$depictaiutilishared.edit_current_page_meta_tags)(meta_tag_data_);
4952
4954
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $3hooq$solidjs.createSignal)(false);
@@ -5253,8 +5255,12 @@ function $5dd9d0d3ea82e2dd$export$477caf01aecaeb2a(options) {
5253
5255
  const router_ = options.router_;
5254
5256
  const search_query_url_param_name_ = "search_query_url_param_name_" in options ? options.search_query_url_param_name_ : undefined;
5255
5257
  const search_query_ = search_query_url_param_name_ ? (0, $3hooq$solidjs.createSignal)("") : undefined;
5258
+ const override_query_id_query_param_names_ = "override_query_id_query_param_names_" in options ? options.override_query_id_query_param_names_ : undefined;
5259
+ const override_query_id_ = override_query_id_query_param_names_ ? (0, $3hooq$solidjs.createSignal)(null) : undefined;
5256
5260
  const get_search_query_ = search_query_ === null || search_query_ === void 0 ? void 0 : search_query_[0];
5257
5261
  const set_search_query = search_query_ === null || search_query_ === void 0 ? void 0 : search_query_[1];
5262
+ const get_override_query_id_ = override_query_id_ === null || override_query_id_ === void 0 ? void 0 : override_query_id_[0];
5263
+ const set_override_query_id = override_query_id_ === null || override_query_id_ === void 0 ? void 0 : override_query_id_[1];
5258
5264
  const current_sorting_ = (0, $3hooq$solidjs.createSignal)();
5259
5265
  const selected_filters_ = (0, $3hooq$solidjs.createSignal)([]);
5260
5266
  const sideways_filter_clearing_flag_ = (0, $3hooq$solidjs.createSignal)(false);
@@ -5305,6 +5311,12 @@ function $5dd9d0d3ea82e2dd$export$477caf01aecaeb2a(options) {
5305
5311
  const found_query = searchParams.get(search_query_url_param_name_);
5306
5312
  set_search_query(found_query || "");
5307
5313
  }
5314
+ if (override_query_id_query_param_names_) {
5315
+ const found_override_query_id = override_query_id_query_param_names_.map(n => searchParams.get(n)).find(n => n);
5316
+ set_override_query_id(found_override_query_id || null);
5317
+ if (found_override_query_id) (0, $3hooq$depictaiutilishared.dlog)("Found override query id:", found_override_query_id); // This stuff might get confusing so better log it
5318
+ }
5319
+
5308
5320
  if (searchParams.get((0, $a68b73fd7ba0853f$export$cf5feb2102aec7f2)) === "true") set_has_sideways_filter_clearing_flag(true);
5309
5321
  if (!writer_started) {
5310
5322
  // The owner here is the createComputed which gets disposed the next time the computation runs - but we actually just want to delay the start of the href_writer until our signals contain the current value of the URL, therefore the runWithOwner
@@ -5328,7 +5340,10 @@ function $5dd9d0d3ea82e2dd$export$477caf01aecaeb2a(options) {
5328
5340
  search_query_accessor_: get_search_query_
5329
5341
  } : {
5330
5342
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
5331
- })
5343
+ }),
5344
+ ...(typeof override_query_id_query_param_names_ === "object" ? {
5345
+ override_query_id_accessor_: get_override_query_id_
5346
+ } : {})
5332
5347
  };
5333
5348
  }
5334
5349
  /**
@@ -5558,6 +5573,7 @@ var $9cbefc32b9dab36d$var$_merchant_signal = /*#__PURE__*/new WeakMap();
5558
5573
  var $9cbefc32b9dab36d$var$_market_signal = /*#__PURE__*/new WeakMap();
5559
5574
  var $9cbefc32b9dab36d$var$_query_id_signal = /*#__PURE__*/new WeakMap();
5560
5575
  var $9cbefc32b9dab36d$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
5576
+ var $9cbefc32b9dab36d$var$_disable_override_query_id = /*#__PURE__*/new WeakMap();
5561
5577
  var $9cbefc32b9dab36d$var$_listing_type_signal = /*#__PURE__*/new WeakMap();
5562
5578
  class $9cbefc32b9dab36d$export$f34314aa9505732e {
5563
5579
  get localization() {
@@ -5597,6 +5613,12 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
5597
5613
  set meta_title_suffix(new_suffix) {
5598
5614
  (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_meta_title_suffix_)[1](new_suffix);
5599
5615
  }
5616
+ get disable_override_query_id() {
5617
+ return (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_disable_override_query_id)[0]();
5618
+ }
5619
+ set disable_override_query_id(new_value) {
5620
+ (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_disable_override_query_id)[1](new_value);
5621
+ }
5600
5622
  get on_navigation() {
5601
5623
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
5602
5624
  return (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_router).on_navigation_;
@@ -5638,6 +5660,10 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
5638
5660
  writable: true,
5639
5661
  value: (0, $3hooq$solidjs.createSignal)()
5640
5662
  });
5663
+ $9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_disable_override_query_id, {
5664
+ writable: true,
5665
+ value: (0, $3hooq$solidjs.createSignal)()
5666
+ });
5641
5667
  $9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_listing_type_signal, {
5642
5668
  writable: true,
5643
5669
  value: (0, $3hooq$solidjs.createSignal)()
@@ -5651,16 +5677,19 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
5651
5677
  (0, $cfcd56242923775d$export$5162a71f252e6122)();
5652
5678
  (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldSet))(this, $9cbefc32b9dab36d$var$_router, new (0, $73014ff36186a4dd$export$7e1297a3a19f10d8)("hard_navigation", query_id_state_key));
5653
5679
  if (on_navigation) (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_router).on_navigation_ = on_navigation;
5680
+ const override_query_id_query_param_names_ = ["query_id_" + unique_instance_key_for_state, "query_id"]; // If you're wondering why this is an array https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7958#note_1511700842
5654
5681
  const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
5655
5682
  const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
5656
5683
  const {
5657
5684
  selected_filters_: selected_filters_,
5658
5685
  current_sorting_: current_sorting_,
5659
- sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
5686
+ sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
5687
+ override_query_id_accessor_: override_query_id_accessor_
5660
5688
  } = (0, $5dd9d0d3ea82e2dd$export$477caf01aecaeb2a)({
5661
5689
  router_: (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_router),
5662
5690
  sorting_query_param_: sorting_query_param_,
5663
- filter_query_param_prefix_: filter_query_param_prefix_
5691
+ filter_query_param_prefix_: filter_query_param_prefix_,
5692
+ override_query_id_query_param_names_: override_query_id_query_param_names_
5664
5693
  });
5665
5694
  const [reset_history_state_, state_] = (0, $2b15291bd38ac551$export$9862539c89138352)({
5666
5695
  get_default_values_: () => ({
@@ -5690,6 +5719,7 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
5690
5719
  router_: (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_router),
5691
5720
  selected_filters_: selected_filters_,
5692
5721
  current_sorting_: current_sorting_,
5722
+ override_query_id_accessor_: override_query_id_accessor_,
5693
5723
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
5694
5724
  sorting_query_param_: sorting_query_param_,
5695
5725
  filter_query_param_prefix_: filter_query_param_prefix_
@@ -5699,6 +5729,11 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
5699
5729
  });
5700
5730
  }
5701
5731
  }
5732
+ /**
5733
+ * This is the CategoryPage component visible outside - exported from @depict-ai/ui.
5734
+ * It wraps the internal, pure CategoryPage component and connects it to the DepictCategory instance and other global state such as the history or page URL.
5735
+ * It is wrapped once again in the js-ui and react-ui packages which exports the final, most simplified interface.
5736
+ */
5702
5737
  var $9cbefc32b9dab36d$var$_keys_constructed_with = {
5703
5738
  writable: true,
5704
5739
  value: new Set()
@@ -5740,6 +5775,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
5740
5775
  },
5741
5776
  current_sorting_: current_sorting_,
5742
5777
  selected_filters_: selected_filters_,
5778
+ override_query_id_accessor_: override_query_id_accessor_,
5743
5779
  reset_history_state_: reset_history_state_,
5744
5780
  depict_api_: depict_api_,
5745
5781
  i18n_: i18n_,
@@ -5757,8 +5793,8 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
5757
5793
  depict_api_: depict_api_,
5758
5794
  min_products_to_fetch_: $9cbefc32b9dab36d$var$min_products_to_fetch_,
5759
5795
  local_filter_cache_: local_filter_cache_,
5796
+ query_id_: (0, $3hooq$solidjs.createMemo)(() => !depict_category.disable_override_query_id && override_query_id_accessor_() || depict_category.category_id),
5760
5797
  meta_title_suffix_: () => depict_category.meta_title_suffix,
5761
- query_id_: () => depict_category.category_id,
5762
5798
  listing_type_: () => depict_category.listing_type,
5763
5799
  i18n_: i18n_,
5764
5800
  show_quicklinks_: (0, $3hooq$solidjs.createMemo)(() => {
@@ -7,7 +7,7 @@ import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/
7
7
  import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
8
8
  import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
9
9
  import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
10
- export const version = "1.4.10";
10
+ export const version = "1.4.11";
11
11
  export function ExpandingDetails(props: {
12
12
  details_: HTMLDetailsElement;
13
13
  summary_: HTMLElement;
@@ -550,6 +550,8 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
550
550
  set listing_type(listing_type: ListingType | undefined);
551
551
  get meta_title_suffix(): string | undefined;
552
552
  set meta_title_suffix(new_suffix: string | undefined);
553
+ get disable_override_query_id(): boolean | undefined;
554
+ set disable_override_query_id(new_value: boolean | undefined);
553
555
  get on_navigation(): OnNavigation;
554
556
  set on_navigation(new_function: OnNavigation);
555
557
  constructor({
@@ -562,6 +564,11 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
562
564
  ...props_on_class
563
565
  }: DepictCategoryConstructorOptions<InputDisplay, OutputDisplay>);
564
566
  }
567
+ /**
568
+ * This is the CategoryPage component visible outside - exported from @depict-ai/ui.
569
+ * It wraps the internal, pure CategoryPage component and connects it to the DepictCategory instance and other global state such as the history or page URL.
570
+ * It is wrapped once again in the js-ui and react-ui packages which exports the final, most simplified interface.
571
+ */
565
572
  export function CategoryPage<OriginalDisplay extends Display, OutputDisplay extends ModernDisplay | never>(props: {
566
573
  depict_category: DepictCategory<OriginalDisplay, OutputDisplay>;
567
574
  grid_spacing: SDKGridSpacing;
@@ -697,6 +704,11 @@ export class DepictSearch<InputDisplay extends Display, OutputDisplay extends Mo
697
704
  set market(market: string);
698
705
  fetchSearchResults(query: string, filters?: SearchFilter[], maxResults?: number): Promise<([OutputDisplay] extends [never] ? InputDisplay : ModernDisplayWithPageUrl<OutputDisplay>)[]>;
699
706
  }
707
+ /**
708
+ * This is the SearchPage component visible outside - exported from @depict-ai/ui.
709
+ * It wraps the internal, pure SearchPage component and connects it to the DepictSearch instance and other global state such as the history or page URL.
710
+ * It is wrapped once again in the js-ui and react-ui packages which exports the final, most simplified interface.
711
+ */
700
712
  export function SearchPage<OriginalDisplay extends Display, TransformedDisplay extends never | ModernDisplay>(props: {
701
713
  depict_search: DepictSearch<OriginalDisplay, TransformedDisplay>;
702
714
  include_input_field?: boolean | {
@@ -819,9 +831,18 @@ export type BaseSearchProviderConfig = {
819
831
  };
820
832
  export type BaseCategoryProviderConfig = {
821
833
  /**
822
- * Currently used for SEO long tail only. Example: {generatedTitle} + {metaTitleSuffix}
834
+ * Currently used for SEO long tail only.
835
+ * Read more about SEO collections here https://docs.depict.ai/other-guides/seo-collections-guide/introduction
836
+ * @default ""
837
+ * @example
838
+ * If the generated SEO title is "Blue Jeans", and you specify metaTitleSuffix to " | My Store", the final SEO title will be "Blue Jeans | My Store".
823
839
  */
824
840
  metaTitleSuffix?: string;
841
+ /**
842
+ * The parameter `query_id=` will override the regular category id that you have configured your SDK to use. You can consider the `query_id` as an escape-hatch if you want to easily set a category id.
843
+ * However, if your page already sets a query_id, you can disable this behaviour by setting this property to `true` (to avoid a conflict).
844
+ */
845
+ disableOverrideQueryId?: boolean;
825
846
  };
826
847
  export interface BaseProductListingConfig {
827
848
  /**
@@ -8,7 +8,7 @@ import $b8hua$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/def
8
8
  /*! Depict.ai search and product listing SDK */
9
9
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
10
10
  register_es_version("ui", "ES10");
11
- const $8db9a15135765c11$export$83d89fbfd8236492 = "1.4.10";
11
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "1.4.11";
12
12
  function $8e8b179489080711$export$5bad61ecde080b1f() {
13
13
  const {
14
14
  collapse: collapse,
@@ -4889,12 +4889,14 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
4889
4889
  return (_plp_results_4 = plp_results_()) === null || _plp_results_4 === void 0 ? void 0 : _plp_results_4.quick_links;
4890
4890
  });
4891
4891
  const meta_tag_data_ = (0, $b8hua$createMemo)(() => {
4892
- var _plp_results_5, _plp_results_5$metada, _plp_results_6, _plp_results_6$metada, _plp_results_7, _plp_results_7$metada;
4893
- meta_title_suffix_();
4894
- return (_plp_results_5 = plp_results_()) !== null && _plp_results_5 !== void 0 && (_plp_results_5$metada = _plp_results_5.metadata) !== null && _plp_results_5$metada !== void 0 && _plp_results_5$metada.replace_meta_tags ? {
4895
- title: ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : (_plp_results_6$metada = _plp_results_6.metadata) === null || _plp_results_6$metada === void 0 ? void 0 : _plp_results_6$metada.title) + (meta_title_suffix_() || ""),
4896
- description: (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : (_plp_results_7$metada = _plp_results_7.metadata) === null || _plp_results_7$metada === void 0 ? void 0 : _plp_results_7$metada.description
4897
- } : null;
4892
+ var _plp_results_5, _plp_results_5$metada;
4893
+ if ((_plp_results_5 = plp_results_()) !== null && _plp_results_5 !== void 0 && (_plp_results_5$metada = _plp_results_5.metadata) !== null && _plp_results_5$metada !== void 0 && _plp_results_5$metada.replace_meta_tags) {
4894
+ var _plp_results_6, _plp_results_6$metada, _plp_results_7, _plp_results_7$metada;
4895
+ return {
4896
+ title: ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : (_plp_results_6$metada = _plp_results_6.metadata) === null || _plp_results_6$metada === void 0 ? void 0 : _plp_results_6$metada.title) + (meta_title_suffix_() || ""),
4897
+ description: (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : (_plp_results_7$metada = _plp_results_7.metadata) === null || _plp_results_7$metada === void 0 ? void 0 : _plp_results_7$metada.description
4898
+ };
4899
+ }
4898
4900
  });
4899
4901
  (0, $b8hua$edit_current_page_meta_tags)(meta_tag_data_);
4900
4902
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $b8hua$createSignal)(false);
@@ -5201,8 +5203,12 @@ function $9d3d794b62318ecc$export$477caf01aecaeb2a(options) {
5201
5203
  const router_ = options.router_;
5202
5204
  const search_query_url_param_name_ = "search_query_url_param_name_" in options ? options.search_query_url_param_name_ : undefined;
5203
5205
  const search_query_ = search_query_url_param_name_ ? (0, $b8hua$createSignal)("") : undefined;
5206
+ const override_query_id_query_param_names_ = "override_query_id_query_param_names_" in options ? options.override_query_id_query_param_names_ : undefined;
5207
+ const override_query_id_ = override_query_id_query_param_names_ ? (0, $b8hua$createSignal)(null) : undefined;
5204
5208
  const get_search_query_ = search_query_ === null || search_query_ === void 0 ? void 0 : search_query_[0];
5205
5209
  const set_search_query = search_query_ === null || search_query_ === void 0 ? void 0 : search_query_[1];
5210
+ const get_override_query_id_ = override_query_id_ === null || override_query_id_ === void 0 ? void 0 : override_query_id_[0];
5211
+ const set_override_query_id = override_query_id_ === null || override_query_id_ === void 0 ? void 0 : override_query_id_[1];
5206
5212
  const current_sorting_ = (0, $b8hua$createSignal)();
5207
5213
  const selected_filters_ = (0, $b8hua$createSignal)([]);
5208
5214
  const sideways_filter_clearing_flag_ = (0, $b8hua$createSignal)(false);
@@ -5253,6 +5259,12 @@ function $9d3d794b62318ecc$export$477caf01aecaeb2a(options) {
5253
5259
  const found_query = searchParams.get(search_query_url_param_name_);
5254
5260
  set_search_query(found_query || "");
5255
5261
  }
5262
+ if (override_query_id_query_param_names_) {
5263
+ const found_override_query_id = override_query_id_query_param_names_.map(n => searchParams.get(n)).find(n => n);
5264
+ set_override_query_id(found_override_query_id || null);
5265
+ if (found_override_query_id) (0, $b8hua$dlog)("Found override query id:", found_override_query_id); // This stuff might get confusing so better log it
5266
+ }
5267
+
5256
5268
  if (searchParams.get((0, $2855bffe06ef7a03$export$cf5feb2102aec7f2)) === "true") set_has_sideways_filter_clearing_flag(true);
5257
5269
  if (!writer_started) {
5258
5270
  // The owner here is the createComputed which gets disposed the next time the computation runs - but we actually just want to delay the start of the href_writer until our signals contain the current value of the URL, therefore the runWithOwner
@@ -5276,7 +5288,10 @@ function $9d3d794b62318ecc$export$477caf01aecaeb2a(options) {
5276
5288
  search_query_accessor_: get_search_query_
5277
5289
  } : {
5278
5290
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
5279
- })
5291
+ }),
5292
+ ...(typeof override_query_id_query_param_names_ === "object" ? {
5293
+ override_query_id_accessor_: get_override_query_id_
5294
+ } : {})
5280
5295
  };
5281
5296
  }
5282
5297
  /**
@@ -5506,6 +5521,7 @@ var $f5f54892fd0c7d9f$var$_merchant_signal = /*#__PURE__*/new WeakMap();
5506
5521
  var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
5507
5522
  var $f5f54892fd0c7d9f$var$_query_id_signal = /*#__PURE__*/new WeakMap();
5508
5523
  var $f5f54892fd0c7d9f$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
5524
+ var $f5f54892fd0c7d9f$var$_disable_override_query_id = /*#__PURE__*/new WeakMap();
5509
5525
  var $f5f54892fd0c7d9f$var$_listing_type_signal = /*#__PURE__*/new WeakMap();
5510
5526
  class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5511
5527
  get localization() {
@@ -5545,6 +5561,12 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5545
5561
  set meta_title_suffix(new_suffix) {
5546
5562
  (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[1](new_suffix);
5547
5563
  }
5564
+ get disable_override_query_id() {
5565
+ return (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_disable_override_query_id)[0]();
5566
+ }
5567
+ set disable_override_query_id(new_value) {
5568
+ (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_disable_override_query_id)[1](new_value);
5569
+ }
5548
5570
  get on_navigation() {
5549
5571
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
5550
5572
  return (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_router).on_navigation_;
@@ -5586,6 +5608,10 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5586
5608
  writable: true,
5587
5609
  value: (0, $b8hua$createSignal)()
5588
5610
  });
5611
+ $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_disable_override_query_id, {
5612
+ writable: true,
5613
+ value: (0, $b8hua$createSignal)()
5614
+ });
5589
5615
  $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_listing_type_signal, {
5590
5616
  writable: true,
5591
5617
  value: (0, $b8hua$createSignal)()
@@ -5599,16 +5625,19 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5599
5625
  (0, $68e6625c8d51f847$export$5162a71f252e6122)();
5600
5626
  (0, $b8hua$babelruntimehelpersclassPrivateFieldSet)(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation", query_id_state_key));
5601
5627
  if (on_navigation) (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_router).on_navigation_ = on_navigation;
5628
+ const override_query_id_query_param_names_ = ["query_id_" + unique_instance_key_for_state, "query_id"]; // If you're wondering why this is an array https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7958#note_1511700842
5602
5629
  const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
5603
5630
  const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
5604
5631
  const {
5605
5632
  selected_filters_: selected_filters_,
5606
5633
  current_sorting_: current_sorting_,
5607
- sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
5634
+ sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
5635
+ override_query_id_accessor_: override_query_id_accessor_
5608
5636
  } = (0, $9d3d794b62318ecc$export$477caf01aecaeb2a)({
5609
5637
  router_: (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_router),
5610
5638
  sorting_query_param_: sorting_query_param_,
5611
- filter_query_param_prefix_: filter_query_param_prefix_
5639
+ filter_query_param_prefix_: filter_query_param_prefix_,
5640
+ override_query_id_query_param_names_: override_query_id_query_param_names_
5612
5641
  });
5613
5642
  const [reset_history_state_, state_] = (0, $bc811d9630f9579b$export$9862539c89138352)({
5614
5643
  get_default_values_: () => ({
@@ -5638,6 +5667,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5638
5667
  router_: (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_router),
5639
5668
  selected_filters_: selected_filters_,
5640
5669
  current_sorting_: current_sorting_,
5670
+ override_query_id_accessor_: override_query_id_accessor_,
5641
5671
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
5642
5672
  sorting_query_param_: sorting_query_param_,
5643
5673
  filter_query_param_prefix_: filter_query_param_prefix_
@@ -5647,6 +5677,11 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5647
5677
  });
5648
5678
  }
5649
5679
  }
5680
+ /**
5681
+ * This is the CategoryPage component visible outside - exported from @depict-ai/ui.
5682
+ * It wraps the internal, pure CategoryPage component and connects it to the DepictCategory instance and other global state such as the history or page URL.
5683
+ * It is wrapped once again in the js-ui and react-ui packages which exports the final, most simplified interface.
5684
+ */
5650
5685
  var $f5f54892fd0c7d9f$var$_keys_constructed_with = {
5651
5686
  writable: true,
5652
5687
  value: new Set()
@@ -5688,6 +5723,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
5688
5723
  },
5689
5724
  current_sorting_: current_sorting_,
5690
5725
  selected_filters_: selected_filters_,
5726
+ override_query_id_accessor_: override_query_id_accessor_,
5691
5727
  reset_history_state_: reset_history_state_,
5692
5728
  depict_api_: depict_api_,
5693
5729
  i18n_: i18n_,
@@ -5705,8 +5741,8 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
5705
5741
  depict_api_: depict_api_,
5706
5742
  min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
5707
5743
  local_filter_cache_: local_filter_cache_,
5744
+ query_id_: (0, $b8hua$createMemo)(() => !depict_category.disable_override_query_id && override_query_id_accessor_() || depict_category.category_id),
5708
5745
  meta_title_suffix_: () => depict_category.meta_title_suffix,
5709
- query_id_: () => depict_category.category_id,
5710
5746
  listing_type_: () => depict_category.listing_type,
5711
5747
  i18n_: i18n_,
5712
5748
  show_quicklinks_: (0, $b8hua$createMemo)(() => {