@depict-ai/ui 1.4.7 → 1.4.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
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",
@@ -236,9 +236,9 @@
236
236
  "@babel/plugin-transform-typescript": "^7.22.9",
237
237
  "@babel/runtime": "latest",
238
238
  "@babel/runtime-corejs3": "^7.22.6",
239
- "@depict-ai/plp-styling": "^1.0.32",
239
+ "@depict-ai/plp-styling": "^1.0.33",
240
240
  "@depict-ai/types": "^1.0.34",
241
- "@depict-ai/utilishared": "^1.0.30",
241
+ "@depict-ai/utilishared": "^1.0.31",
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.7";
63
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "1.4.9";
64
64
  function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
65
65
  const {
66
66
  collapse: collapse,
@@ -4846,6 +4846,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
4846
4846
  depict_api_: depict_api_,
4847
4847
  query_id_: query_id_,
4848
4848
  listing_type_: listing_type_,
4849
+ meta_title_suffix_: meta_title_suffix_,
4849
4850
  current_sorting_: current_sorting_,
4850
4851
  min_products_to_fetch_: min_products_to_fetch_,
4851
4852
  category_filters_open_: category_filters_open_,
@@ -4939,12 +4940,21 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
4939
4940
  var _plp_results_4;
4940
4941
  return (_plp_results_4 = plp_results_()) === null || _plp_results_4 === void 0 ? void 0 : _plp_results_4.quick_links;
4941
4942
  });
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;
4950
+ });
4951
+ (0, $3hooq$depictaiutilishared.edit_current_page_meta_tags)(meta_tag_data_);
4942
4952
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $3hooq$solidjs.createSignal)(false);
4943
4953
  const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $3hooq$solidjs.createSignal)();
4944
4954
  const formatted_number_of_results_ = (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
4945
4955
  number_: (0, $3hooq$solidjs.createMemo)(() => {
4946
- var _plp_results_5;
4947
- return (_plp_results_5 = plp_results_()) === null || _plp_results_5 === void 0 ? void 0 : _plp_results_5.n_hits;
4956
+ var _plp_results_8;
4957
+ return (_plp_results_8 = plp_results_()) === null || _plp_results_8 === void 0 ? void 0 : _plp_results_8.n_hits;
4948
4958
  }),
4949
4959
  i18n_: i18n_
4950
4960
  });
@@ -4968,8 +4978,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
4968
4978
  }
4969
4979
  })), (0, $3hooq$solidjsweb.escape)((0, $3hooq$solidjsweb.createComponent)((0, $3hooq$solidjs.Show), {
4970
4980
  get when() {
4971
- var _plp_results_6;
4972
- return ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : _plp_results_6.n_hits) === 1;
4981
+ var _plp_results_9;
4982
+ return ((_plp_results_9 = plp_results_()) === null || _plp_results_9 === void 0 ? void 0 : _plp_results_9.n_hits) === 1;
4973
4983
  },
4974
4984
  get fallback() {
4975
4985
  return i18n_.products_();
@@ -5151,8 +5161,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
5151
5161
  formatted_number_of_results_: formatted_number_of_results_,
5152
5162
  i18n_: i18n_,
5153
5163
  number_of_results_: (0, $3hooq$solidjs.createMemo)(() => {
5154
- var _plp_results_7;
5155
- return (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : _plp_results_7.n_hits;
5164
+ var _plp_results_10;
5165
+ return (_plp_results_10 = plp_results_()) === null || _plp_results_10 === void 0 ? void 0 : _plp_results_10.n_hits;
5156
5166
  })
5157
5167
  });
5158
5168
  }
@@ -5488,6 +5498,24 @@ function $73014ff36186a4dd$var$_get_navigation_happened_promise2(is_replace) {
5488
5498
  (0, $3hooq$depictaiutilishared.instant_exec_on_suspect_history_change).add(handler);
5489
5499
  });
5490
5500
  }
5501
+
5502
+ /**
5503
+ * Wraps a function in a try/catch block and throws the error globally. If undefined is provided as fn, a no-op is returned.
5504
+ * @param fn the function to wrap
5505
+ */
5506
+ function $bdea39a75c454f4f$export$f50b88e2a00918b5(fn) {
5507
+ return function () {
5508
+ if (!fn) return;
5509
+ try {
5510
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
5511
+ return Reflect.apply(fn, this, args);
5512
+ } catch (e) {
5513
+ queueMicrotask(() => {
5514
+ throw e;
5515
+ });
5516
+ }
5517
+ };
5518
+ }
5491
5519
  const $9cbefc32b9dab36d$var$_tmpl$ = ["<div", ' class="depict plp category">', "</div>"];
5492
5520
  function $9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
5493
5521
  $9cbefc32b9dab36d$var$_checkPrivateRedeclaration(obj, privateMap);
@@ -5529,6 +5557,7 @@ var $9cbefc32b9dab36d$var$_locale_signal = /*#__PURE__*/new WeakMap();
5529
5557
  var $9cbefc32b9dab36d$var$_merchant_signal = /*#__PURE__*/new WeakMap();
5530
5558
  var $9cbefc32b9dab36d$var$_market_signal = /*#__PURE__*/new WeakMap();
5531
5559
  var $9cbefc32b9dab36d$var$_query_id_signal = /*#__PURE__*/new WeakMap();
5560
+ var $9cbefc32b9dab36d$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
5532
5561
  var $9cbefc32b9dab36d$var$_listing_type_signal = /*#__PURE__*/new WeakMap();
5533
5562
  class $9cbefc32b9dab36d$export$f34314aa9505732e {
5534
5563
  get localization() {
@@ -5562,6 +5591,12 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
5562
5591
  set listing_type(listing_type) {
5563
5592
  (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_listing_type_signal)[1](listing_type);
5564
5593
  }
5594
+ get meta_title_suffix() {
5595
+ return (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_meta_title_suffix_)[0]();
5596
+ }
5597
+ set meta_title_suffix(new_suffix) {
5598
+ (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_meta_title_suffix_)[1](new_suffix);
5599
+ }
5565
5600
  get on_navigation() {
5566
5601
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
5567
5602
  return (0, $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_router).on_navigation_;
@@ -5599,6 +5634,10 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
5599
5634
  writable: true,
5600
5635
  value: (0, $3hooq$solidjs.createSignal)("")
5601
5636
  });
5637
+ $9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_meta_title_suffix_, {
5638
+ writable: true,
5639
+ value: (0, $3hooq$solidjs.createSignal)()
5640
+ });
5602
5641
  $9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_listing_type_signal, {
5603
5642
  writable: true,
5604
5643
  value: (0, $3hooq$solidjs.createSignal)()
@@ -5672,10 +5711,17 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
5672
5711
  } = props;
5673
5712
  const shared_properties = $9cbefc32b9dab36d$var$get_shared_properties(depict_category);
5674
5713
  return (0, $d05611ff6b8c8357$export$23fca46f3143581f)(() => {
5714
+ (0, $3hooq$solidjs.createEffect)(prev => {
5715
+ // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
5716
+ const id = depict_category.category_id; // <- this is a reactive getter
5717
+ (0, $bdea39a75c454f4f$export$f50b88e2a00918b5)(props.on_query_id_change)(id, prev);
5718
+ return id;
5719
+ });
5720
+ (0, $3hooq$solidjs.onCleanup)(() => (0, $bdea39a75c454f4f$export$f50b88e2a00918b5)(props.on_query_id_change)());
5675
5721
  const grid_spacing_override = (0, $3hooq$solidjs.createMemo)(() => {
5676
5722
  const {
5677
5723
  grid_spacing: grid_spacing
5678
- } = props; // can be reactive
5724
+ } = props; // can be reactive, therefore read in the memo
5679
5725
  return typeof grid_spacing === "string" ? {
5680
5726
  grid_spacing: grid_spacing
5681
5727
  } : {
@@ -5711,6 +5757,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
5711
5757
  depict_api_: depict_api_,
5712
5758
  min_products_to_fetch_: $9cbefc32b9dab36d$var$min_products_to_fetch_,
5713
5759
  local_filter_cache_: local_filter_cache_,
5760
+ meta_title_suffix_: () => depict_category.meta_title_suffix,
5714
5761
  query_id_: () => depict_category.category_id,
5715
5762
  listing_type_: () => depict_category.listing_type,
5716
5763
  i18n_: i18n_,
@@ -8698,6 +8745,13 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
8698
8745
  grid_spacing: grid_spacing.horizontal
8699
8746
  };
8700
8747
  });
8748
+ (0, $3hooq$solidjs.createEffect)(prev => {
8749
+ // this is here (and not on DepictSearch) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
8750
+ const search_query = shared_properties.get_search_query_();
8751
+ (0, $bdea39a75c454f4f$export$f50b88e2a00918b5)(props.on_query_change)(search_query, prev);
8752
+ return search_query;
8753
+ });
8754
+ (0, $3hooq$solidjs.onCleanup)(() => (0, $bdea39a75c454f4f$export$f50b88e2a00918b5)(props.on_query_change)());
8701
8755
  (0, $3hooq$solidjs.onCleanup)(shared_properties.reset_history_state_);
8702
8756
  return (0, $739c927cbecd26b0$export$a54ec244c8863715)({
8703
8757
  input_modal_open_: () => !!depict_search.modal_open,
@@ -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.7";
10
+ export const version = "1.4.9";
11
11
  export function ExpandingDetails(props: {
12
12
  details_: HTMLDetailsElement;
13
13
  summary_: HTMLElement;
@@ -548,6 +548,8 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
548
548
  set market(market: string);
549
549
  get listing_type(): ListingType | undefined;
550
550
  set listing_type(listing_type: ListingType | undefined);
551
+ get meta_title_suffix(): string | undefined;
552
+ set meta_title_suffix(new_suffix: string | undefined);
551
553
  get on_navigation(): OnNavigation;
552
554
  set on_navigation(new_function: OnNavigation);
553
555
  constructor({
@@ -568,6 +570,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
568
570
  show_quicklinks?: boolean;
569
571
  show_breadcrumbs?: boolean;
570
572
  category_title: typeof CategoryTitle | typeof embedded_num_products;
573
+ on_query_id_change?: (new_query_id?: string | undefined, old_query_id?: string | undefined) => void;
571
574
  }): import("@depict-ai/utilishared").Node_Array;
572
575
  export function BreadCrumbs<T extends Display>({
573
576
  depict_category
@@ -703,6 +706,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
703
706
  grid_spacing: SDKGridSpacing;
704
707
  cols_at_size: SDKColsAtSize;
705
708
  product_card_template: ProductCardTemplate<[TransformedDisplay] extends [never] ? OriginalDisplay : ModernDisplayWithPageUrl<TransformedDisplay>>;
709
+ on_query_change?: (new_query?: string | undefined, old_query?: string | undefined) => void;
706
710
  extra_depict_options?: {
707
711
  recommendations_cols_at_size?: SDKColsAtSize;
708
712
  };
@@ -813,6 +817,12 @@ export type BaseSearchProviderConfig = {
813
817
  */
814
818
  enableContentSearch?: boolean;
815
819
  };
820
+ export type BaseCategoryProviderConfig = {
821
+ /**
822
+ * Currently used for SEO long tail only. Example: {generatedTitle} + {metaTitleSuffix}
823
+ */
824
+ metaTitleSuffix?: string;
825
+ };
816
826
  export interface BaseProductListingConfig {
817
827
  /**
818
828
  * How many columns to show at each media size.
@@ -1,4 +1,4 @@
1
- import { add_to_version_info as $b8hua$add_to_version_info, observer as $b8hua$observer, catchify as $b8hua$catchify, useExpandingContainer as $b8hua$useExpandingContainer, standard_price_format as $b8hua$standard_price_format, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, slider_fading_factory as $b8hua$slider_fading_factory, make_random_classname as $b8hua$make_random_classname, dlog as $b8hua$dlog, hex_to_rgb as $b8hua$hex_to_rgb, report as $b8hua$report, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, javascript_media_query as $b8hua$javascript_media_query, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, fetch_recs as $b8hua$fetch_recs, snakeCasifyObject as $b8hua$snakeCasifyObject, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, base_url as $b8hua$base_url, get_depict_id as $b8hua$get_depict_id, get_user_id as $b8hua$get_user_id, get_session_id as $b8hua$get_session_id, make_url_with_query_params as $b8hua$make_url_with_query_params, fetch_retry as $b8hua$fetch_retry, add_version_query_params as $b8hua$add_version_query_params, dwarn as $b8hua$dwarn, sort_obj as $b8hua$sort_obj, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, queueMacroTask as $b8hua$queueMacroTask, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, ContainedImage as $b8hua$ContainedImage, deparallelize_no_drop as $b8hua$deparallelize_no_drop, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
1
+ import { add_to_version_info as $b8hua$add_to_version_info, observer as $b8hua$observer, catchify as $b8hua$catchify, useExpandingContainer as $b8hua$useExpandingContainer, standard_price_format as $b8hua$standard_price_format, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, slider_fading_factory as $b8hua$slider_fading_factory, make_random_classname as $b8hua$make_random_classname, dlog as $b8hua$dlog, hex_to_rgb as $b8hua$hex_to_rgb, report as $b8hua$report, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, javascript_media_query as $b8hua$javascript_media_query, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, fetch_recs as $b8hua$fetch_recs, snakeCasifyObject as $b8hua$snakeCasifyObject, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, base_url as $b8hua$base_url, get_depict_id as $b8hua$get_depict_id, get_user_id as $b8hua$get_user_id, get_session_id as $b8hua$get_session_id, make_url_with_query_params as $b8hua$make_url_with_query_params, fetch_retry as $b8hua$fetch_retry, add_version_query_params as $b8hua$add_version_query_params, dwarn as $b8hua$dwarn, sort_obj as $b8hua$sort_obj, edit_current_page_meta_tags as $b8hua$edit_current_page_meta_tags, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, queueMacroTask as $b8hua$queueMacroTask, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, ContainedImage as $b8hua$ContainedImage, deparallelize_no_drop as $b8hua$deparallelize_no_drop, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
2
2
  import { insert as $b8hua$insert, createComponent as $b8hua$createComponent, ssr as $b8hua$ssr, ssrHydrationKey as $b8hua$ssrHydrationKey, escape as $b8hua$escape, ssrAttribute as $b8hua$ssrAttribute, ssrElement as $b8hua$ssrElement, Dynamic as $b8hua$Dynamic, ssrStyle as $b8hua$ssrStyle, ssrClassList as $b8hua$ssrClassList, isServer as $b8hua$isServer, mergeProps as $b8hua$mergeProps } from "solid-js/web";
3
3
  import { createSignal as $b8hua$createSignal, createMemo as $b8hua$createMemo, untrack as $b8hua$untrack, createEffect as $b8hua$createEffect, getOwner as $b8hua$getOwner, Show as $b8hua$Show, Index as $b8hua$Index, onCleanup as $b8hua$onCleanup, For as $b8hua$For, createRenderEffect as $b8hua$createRenderEffect, createComputed as $b8hua$createComputed, on as $b8hua$on, batch as $b8hua$batch, ErrorBoundary as $b8hua$ErrorBoundary, createRoot as $b8hua$createRoot, runWithOwner as $b8hua$runWithOwner, createResource as $b8hua$createResource, createReaction as $b8hua$createReaction, Suspense as $b8hua$Suspense } from "solid-js";
4
4
  import $b8hua$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
@@ -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.7";
11
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "1.4.9";
12
12
  function $8e8b179489080711$export$5bad61ecde080b1f() {
13
13
  const {
14
14
  collapse: collapse,
@@ -4794,6 +4794,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
4794
4794
  depict_api_: depict_api_,
4795
4795
  query_id_: query_id_,
4796
4796
  listing_type_: listing_type_,
4797
+ meta_title_suffix_: meta_title_suffix_,
4797
4798
  current_sorting_: current_sorting_,
4798
4799
  min_products_to_fetch_: min_products_to_fetch_,
4799
4800
  category_filters_open_: category_filters_open_,
@@ -4887,12 +4888,21 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
4887
4888
  var _plp_results_4;
4888
4889
  return (_plp_results_4 = plp_results_()) === null || _plp_results_4 === void 0 ? void 0 : _plp_results_4.quick_links;
4889
4890
  });
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;
4898
+ });
4899
+ (0, $b8hua$edit_current_page_meta_tags)(meta_tag_data_);
4890
4900
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $b8hua$createSignal)(false);
4891
4901
  const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $b8hua$createSignal)();
4892
4902
  const formatted_number_of_results_ = (0, $43fbdca0f726a34b$export$92f2da32c6e7e7ee)({
4893
4903
  number_: (0, $b8hua$createMemo)(() => {
4894
- var _plp_results_5;
4895
- return (_plp_results_5 = plp_results_()) === null || _plp_results_5 === void 0 ? void 0 : _plp_results_5.n_hits;
4904
+ var _plp_results_8;
4905
+ return (_plp_results_8 = plp_results_()) === null || _plp_results_8 === void 0 ? void 0 : _plp_results_8.n_hits;
4896
4906
  }),
4897
4907
  i18n_: i18n_
4898
4908
  });
@@ -4916,8 +4926,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
4916
4926
  }
4917
4927
  })), (0, $b8hua$escape)((0, $b8hua$createComponent)((0, $b8hua$Show), {
4918
4928
  get when() {
4919
- var _plp_results_6;
4920
- return ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : _plp_results_6.n_hits) === 1;
4929
+ var _plp_results_9;
4930
+ return ((_plp_results_9 = plp_results_()) === null || _plp_results_9 === void 0 ? void 0 : _plp_results_9.n_hits) === 1;
4921
4931
  },
4922
4932
  get fallback() {
4923
4933
  return i18n_.products_();
@@ -5099,8 +5109,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
5099
5109
  formatted_number_of_results_: formatted_number_of_results_,
5100
5110
  i18n_: i18n_,
5101
5111
  number_of_results_: (0, $b8hua$createMemo)(() => {
5102
- var _plp_results_7;
5103
- return (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : _plp_results_7.n_hits;
5112
+ var _plp_results_10;
5113
+ return (_plp_results_10 = plp_results_()) === null || _plp_results_10 === void 0 ? void 0 : _plp_results_10.n_hits;
5104
5114
  })
5105
5115
  });
5106
5116
  }
@@ -5436,6 +5446,24 @@ function $ac571292d606f30b$var$_get_navigation_happened_promise2(is_replace) {
5436
5446
  (0, $b8hua$instant_exec_on_suspect_history_change).add(handler);
5437
5447
  });
5438
5448
  }
5449
+
5450
+ /**
5451
+ * Wraps a function in a try/catch block and throws the error globally. If undefined is provided as fn, a no-op is returned.
5452
+ * @param fn the function to wrap
5453
+ */
5454
+ function $01c33966d9ddb108$export$f50b88e2a00918b5(fn) {
5455
+ return function () {
5456
+ if (!fn) return;
5457
+ try {
5458
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
5459
+ return Reflect.apply(fn, this, args);
5460
+ } catch (e) {
5461
+ queueMicrotask(() => {
5462
+ throw e;
5463
+ });
5464
+ }
5465
+ };
5466
+ }
5439
5467
  const $f5f54892fd0c7d9f$var$_tmpl$ = ["<div", ' class="depict plp category">', "</div>"];
5440
5468
  function $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
5441
5469
  $f5f54892fd0c7d9f$var$_checkPrivateRedeclaration(obj, privateMap);
@@ -5477,6 +5505,7 @@ var $f5f54892fd0c7d9f$var$_locale_signal = /*#__PURE__*/new WeakMap();
5477
5505
  var $f5f54892fd0c7d9f$var$_merchant_signal = /*#__PURE__*/new WeakMap();
5478
5506
  var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
5479
5507
  var $f5f54892fd0c7d9f$var$_query_id_signal = /*#__PURE__*/new WeakMap();
5508
+ var $f5f54892fd0c7d9f$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
5480
5509
  var $f5f54892fd0c7d9f$var$_listing_type_signal = /*#__PURE__*/new WeakMap();
5481
5510
  class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5482
5511
  get localization() {
@@ -5510,6 +5539,12 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5510
5539
  set listing_type(listing_type) {
5511
5540
  (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_listing_type_signal)[1](listing_type);
5512
5541
  }
5542
+ get meta_title_suffix() {
5543
+ return (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[0]();
5544
+ }
5545
+ set meta_title_suffix(new_suffix) {
5546
+ (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[1](new_suffix);
5547
+ }
5513
5548
  get on_navigation() {
5514
5549
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
5515
5550
  return (0, $b8hua$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_router).on_navigation_;
@@ -5547,6 +5582,10 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
5547
5582
  writable: true,
5548
5583
  value: (0, $b8hua$createSignal)("")
5549
5584
  });
5585
+ $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_, {
5586
+ writable: true,
5587
+ value: (0, $b8hua$createSignal)()
5588
+ });
5550
5589
  $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_listing_type_signal, {
5551
5590
  writable: true,
5552
5591
  value: (0, $b8hua$createSignal)()
@@ -5620,10 +5659,17 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
5620
5659
  } = props;
5621
5660
  const shared_properties = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
5622
5661
  return (0, $83e8cf2c0b87a58a$export$23fca46f3143581f)(() => {
5662
+ (0, $b8hua$createEffect)(prev => {
5663
+ // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
5664
+ const id = depict_category.category_id; // <- this is a reactive getter
5665
+ (0, $01c33966d9ddb108$export$f50b88e2a00918b5)(props.on_query_id_change)(id, prev);
5666
+ return id;
5667
+ });
5668
+ (0, $b8hua$onCleanup)(() => (0, $01c33966d9ddb108$export$f50b88e2a00918b5)(props.on_query_id_change)());
5623
5669
  const grid_spacing_override = (0, $b8hua$createMemo)(() => {
5624
5670
  const {
5625
5671
  grid_spacing: grid_spacing
5626
- } = props; // can be reactive
5672
+ } = props; // can be reactive, therefore read in the memo
5627
5673
  return typeof grid_spacing === "string" ? {
5628
5674
  grid_spacing: grid_spacing
5629
5675
  } : {
@@ -5659,6 +5705,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
5659
5705
  depict_api_: depict_api_,
5660
5706
  min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
5661
5707
  local_filter_cache_: local_filter_cache_,
5708
+ meta_title_suffix_: () => depict_category.meta_title_suffix,
5662
5709
  query_id_: () => depict_category.category_id,
5663
5710
  listing_type_: () => depict_category.listing_type,
5664
5711
  i18n_: i18n_,
@@ -8646,6 +8693,13 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
8646
8693
  grid_spacing: grid_spacing.horizontal
8647
8694
  };
8648
8695
  });
8696
+ (0, $b8hua$createEffect)(prev => {
8697
+ // this is here (and not on DepictSearch) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
8698
+ const search_query = shared_properties.get_search_query_();
8699
+ (0, $01c33966d9ddb108$export$f50b88e2a00918b5)(props.on_query_change)(search_query, prev);
8700
+ return search_query;
8701
+ });
8702
+ (0, $b8hua$onCleanup)(() => (0, $01c33966d9ddb108$export$f50b88e2a00918b5)(props.on_query_change)());
8649
8703
  (0, $b8hua$onCleanup)(shared_properties.reset_history_state_);
8650
8704
  return (0, $da279c5a540c6846$export$a54ec244c8863715)({
8651
8705
  input_modal_open_: () => !!depict_search.modal_open,
@@ -54,7 +54,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
54
54
  $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
55
55
  $parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
56
56
  /*! Depict.ai search and product listing SDK */
57
- const $b757f75811f3261f$export$83d89fbfd8236492 = "1.4.7";
57
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.4.9";
58
58
  function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
59
59
  const {
60
60
  collapse: collapse,
@@ -4482,6 +4482,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
4482
4482
  depict_api_: depict_api_,
4483
4483
  query_id_: query_id_,
4484
4484
  listing_type_: listing_type_,
4485
+ meta_title_suffix_: meta_title_suffix_,
4485
4486
  current_sorting_: current_sorting_,
4486
4487
  min_products_to_fetch_: min_products_to_fetch_,
4487
4488
  category_filters_open_: category_filters_open_,
@@ -4560,6 +4561,14 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
4560
4561
  const available_filters_ = (0, $5vyXB$solidjs.createMemo)(() => plp_results_()?.filters);
4561
4562
  const crumb_data_ = (0, $5vyXB$solidjs.createMemo)(() => plp_results_()?.breadcrumb);
4562
4563
  const quicklinks_data_ = (0, $5vyXB$solidjs.createMemo)(() => plp_results_()?.quick_links);
4564
+ const meta_tag_data_ = (0, $5vyXB$solidjs.createMemo)(() => {
4565
+ meta_title_suffix_();
4566
+ return plp_results_()?.metadata?.replace_meta_tags ? {
4567
+ title: plp_results_()?.metadata?.title + (meta_title_suffix_() || ""),
4568
+ description: plp_results_()?.metadata?.description
4569
+ } : null;
4570
+ });
4571
+ (0, $5vyXB$depictaiutilishared.edit_current_page_meta_tags)(meta_tag_data_);
4563
4572
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $5vyXB$solidjs.createSignal)(false);
4564
4573
  const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $5vyXB$solidjs.createSignal)();
4565
4574
  const formatted_number_of_results_ = (0, $0f400c3f7248d5f1$export$92f2da32c6e7e7ee)({
@@ -5062,6 +5071,23 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
5062
5071
  this.on_navigation_ = on_navigation;
5063
5072
  }
5064
5073
  }
5074
+
5075
+ /**
5076
+ * Wraps a function in a try/catch block and throws the error globally. If undefined is provided as fn, a no-op is returned.
5077
+ * @param fn the function to wrap
5078
+ */
5079
+ function $deaaf04362a1bc71$export$f50b88e2a00918b5(fn) {
5080
+ return function (...args) {
5081
+ if (!fn) return;
5082
+ try {
5083
+ return Reflect.apply(fn, this, args);
5084
+ } catch (e) {
5085
+ queueMicrotask(() => {
5086
+ throw e;
5087
+ });
5088
+ }
5089
+ };
5090
+ }
5065
5091
  const $48567ac5b39bac56$var$_tmpl$ = ["<div", ' class="depict plp category">', "</div>"];
5066
5092
  // We just pass page_url_creator to DepictAPI when we instantiate it, so don't allow it to be specified if api is already specified
5067
5093
  /**
@@ -5079,6 +5105,7 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
5079
5105
  #merchant_signal = (0, $5vyXB$solidjs.createSignal)();
5080
5106
  #market_signal = (0, $5vyXB$solidjs.createSignal)();
5081
5107
  #query_id_signal = (0, $5vyXB$solidjs.createSignal)("");
5108
+ #meta_title_suffix_ = (0, $5vyXB$solidjs.createSignal)();
5082
5109
  #listing_type_signal = (0, $5vyXB$solidjs.createSignal)();
5083
5110
  static #keys_constructed_with = new Set();
5084
5111
  get localization() {
@@ -5112,6 +5139,12 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
5112
5139
  set listing_type(listing_type) {
5113
5140
  this.#listing_type_signal[1](listing_type);
5114
5141
  }
5142
+ get meta_title_suffix() {
5143
+ return this.#meta_title_suffix_[0]();
5144
+ }
5145
+ set meta_title_suffix(new_suffix) {
5146
+ this.#meta_title_suffix_[1](new_suffix);
5147
+ }
5115
5148
  get on_navigation() {
5116
5149
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
5117
5150
  return this.#router.on_navigation_;
@@ -5193,10 +5226,17 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
5193
5226
  } = props;
5194
5227
  const shared_properties = $48567ac5b39bac56$var$get_shared_properties(depict_category);
5195
5228
  return (0, $95837413165cc2df$export$23fca46f3143581f)(() => {
5229
+ (0, $5vyXB$solidjs.createEffect)(prev => {
5230
+ // this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
5231
+ const id = depict_category.category_id; // <- this is a reactive getter
5232
+ (0, $deaaf04362a1bc71$export$f50b88e2a00918b5)(props.on_query_id_change)(id, prev);
5233
+ return id;
5234
+ });
5235
+ (0, $5vyXB$solidjs.onCleanup)(() => (0, $deaaf04362a1bc71$export$f50b88e2a00918b5)(props.on_query_id_change)());
5196
5236
  const grid_spacing_override = (0, $5vyXB$solidjs.createMemo)(() => {
5197
5237
  const {
5198
5238
  grid_spacing: grid_spacing
5199
- } = props; // can be reactive
5239
+ } = props; // can be reactive, therefore read in the memo
5200
5240
  return typeof grid_spacing === "string" ? {
5201
5241
  grid_spacing: grid_spacing
5202
5242
  } : {
@@ -5232,6 +5272,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
5232
5272
  depict_api_: depict_api_,
5233
5273
  min_products_to_fetch_: $48567ac5b39bac56$var$min_products_to_fetch_,
5234
5274
  local_filter_cache_: local_filter_cache_,
5275
+ meta_title_suffix_: () => depict_category.meta_title_suffix,
5235
5276
  query_id_: () => depict_category.category_id,
5236
5277
  listing_type_: () => depict_category.listing_type,
5237
5278
  i18n_: i18n_,
@@ -7982,6 +8023,13 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
7982
8023
  grid_spacing: grid_spacing.horizontal
7983
8024
  };
7984
8025
  });
8026
+ (0, $5vyXB$solidjs.createEffect)(prev => {
8027
+ // this is here (and not on DepictSearch) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
8028
+ const search_query = shared_properties.get_search_query_();
8029
+ (0, $deaaf04362a1bc71$export$f50b88e2a00918b5)(props.on_query_change)(search_query, prev);
8030
+ return search_query;
8031
+ });
8032
+ (0, $5vyXB$solidjs.onCleanup)(() => (0, $deaaf04362a1bc71$export$f50b88e2a00918b5)(props.on_query_change)());
7985
8033
  (0, $5vyXB$solidjs.onCleanup)(shared_properties.reset_history_state_);
7986
8034
  return (0, $f1d7cb69f839a526$export$a54ec244c8863715)({
7987
8035
  input_modal_open_: () => !!depict_search.modal_open,
@@ -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.7";
10
+ export const version = "1.4.9";
11
11
  export function ExpandingDetails(props: {
12
12
  details_: HTMLDetailsElement;
13
13
  summary_: HTMLElement;
@@ -548,6 +548,8 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
548
548
  set market(market: string);
549
549
  get listing_type(): ListingType | undefined;
550
550
  set listing_type(listing_type: ListingType | undefined);
551
+ get meta_title_suffix(): string | undefined;
552
+ set meta_title_suffix(new_suffix: string | undefined);
551
553
  get on_navigation(): OnNavigation;
552
554
  set on_navigation(new_function: OnNavigation);
553
555
  constructor({
@@ -568,6 +570,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
568
570
  show_quicklinks?: boolean;
569
571
  show_breadcrumbs?: boolean;
570
572
  category_title: typeof CategoryTitle | typeof embedded_num_products;
573
+ on_query_id_change?: (new_query_id?: string | undefined, old_query_id?: string | undefined) => void;
571
574
  }): import("@depict-ai/utilishared").Node_Array;
572
575
  export function BreadCrumbs<T extends Display>({
573
576
  depict_category
@@ -703,6 +706,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
703
706
  grid_spacing: SDKGridSpacing;
704
707
  cols_at_size: SDKColsAtSize;
705
708
  product_card_template: ProductCardTemplate<[TransformedDisplay] extends [never] ? OriginalDisplay : ModernDisplayWithPageUrl<TransformedDisplay>>;
709
+ on_query_change?: (new_query?: string | undefined, old_query?: string | undefined) => void;
706
710
  extra_depict_options?: {
707
711
  recommendations_cols_at_size?: SDKColsAtSize;
708
712
  };
@@ -813,6 +817,12 @@ export type BaseSearchProviderConfig = {
813
817
  */
814
818
  enableContentSearch?: boolean;
815
819
  };
820
+ export type BaseCategoryProviderConfig = {
821
+ /**
822
+ * Currently used for SEO long tail only. Example: {generatedTitle} + {metaTitleSuffix}
823
+ */
824
+ metaTitleSuffix?: string;
825
+ };
816
826
  export interface BaseProductListingConfig {
817
827
  /**
818
828
  * How many columns to show at each media size.