@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/ES10/index.cjs CHANGED
@@ -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,
@@ -6072,6 +6072,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6072
6072
  depict_api_: depict_api_,
6073
6073
  query_id_: query_id_,
6074
6074
  listing_type_: listing_type_,
6075
+ meta_title_suffix_: meta_title_suffix_,
6075
6076
  current_sorting_: current_sorting_,
6076
6077
  min_products_to_fetch_: min_products_to_fetch_,
6077
6078
  category_filters_open_: category_filters_open_,
@@ -6165,12 +6166,21 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6165
6166
  var _plp_results_4;
6166
6167
  return (_plp_results_4 = plp_results_()) === null || _plp_results_4 === void 0 ? void 0 : _plp_results_4.quick_links;
6167
6168
  });
6169
+ const meta_tag_data_ = (0, $52FdA$solidjs.createMemo)(() => {
6170
+ var _plp_results_5, _plp_results_5$metada, _plp_results_6, _plp_results_6$metada, _plp_results_7, _plp_results_7$metada;
6171
+ meta_title_suffix_();
6172
+ 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 ? {
6173
+ 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_() || ""),
6174
+ 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
6175
+ } : null;
6176
+ });
6177
+ (0, $52FdA$depictaiutilishared.edit_current_page_meta_tags)(meta_tag_data_);
6168
6178
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $52FdA$solidjs.createSignal)(false);
6169
6179
  const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $52FdA$solidjs.createSignal)();
6170
6180
  const formatted_number_of_results_ = (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
6171
6181
  number_: (0, $52FdA$solidjs.createMemo)(() => {
6172
- var _plp_results_5;
6173
- return (_plp_results_5 = plp_results_()) === null || _plp_results_5 === void 0 ? void 0 : _plp_results_5.n_hits;
6182
+ var _plp_results_8;
6183
+ return (_plp_results_8 = plp_results_()) === null || _plp_results_8 === void 0 ? void 0 : _plp_results_8.n_hits;
6174
6184
  }),
6175
6185
  i18n_: i18n_
6176
6186
  });
@@ -6202,8 +6212,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6202
6212
  }), _el$4, _co$);
6203
6213
  (0, $52FdA$solidjsweb.insert)(_el$, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
6204
6214
  get when() {
6205
- var _plp_results_6;
6206
- return ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : _plp_results_6.n_hits) === 1;
6215
+ var _plp_results_9;
6216
+ return ((_plp_results_9 = plp_results_()) === null || _plp_results_9 === void 0 ? void 0 : _plp_results_9.n_hits) === 1;
6207
6217
  },
6208
6218
  get fallback() {
6209
6219
  return i18n_.products_();
@@ -6422,8 +6432,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6422
6432
  formatted_number_of_results_: formatted_number_of_results_,
6423
6433
  i18n_: i18n_,
6424
6434
  number_of_results_: (0, $52FdA$solidjs.createMemo)(() => {
6425
- var _plp_results_7;
6426
- return (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : _plp_results_7.n_hits;
6435
+ var _plp_results_10;
6436
+ return (_plp_results_10 = plp_results_()) === null || _plp_results_10 === void 0 ? void 0 : _plp_results_10.n_hits;
6427
6437
  })
6428
6438
  });
6429
6439
  }
@@ -6763,6 +6773,24 @@ function $73014ff36186a4dd$var$_get_navigation_happened_promise2(is_replace) {
6763
6773
  (0, $52FdA$depictaiutilishared.instant_exec_on_suspect_history_change).add(handler);
6764
6774
  });
6765
6775
  }
6776
+
6777
+ /**
6778
+ * Wraps a function in a try/catch block and throws the error globally. If undefined is provided as fn, a no-op is returned.
6779
+ * @param fn the function to wrap
6780
+ */
6781
+ function $bdea39a75c454f4f$export$f50b88e2a00918b5(fn) {
6782
+ return function () {
6783
+ if (!fn) return;
6784
+ try {
6785
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
6786
+ return Reflect.apply(fn, this, args);
6787
+ } catch (e) {
6788
+ queueMicrotask(() => {
6789
+ throw e;
6790
+ });
6791
+ }
6792
+ };
6793
+ }
6766
6794
  const $9cbefc32b9dab36d$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="depict plp category"></div>`, 2);
6767
6795
  function $9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
6768
6796
  $9cbefc32b9dab36d$var$_checkPrivateRedeclaration(obj, privateMap);
@@ -6809,6 +6837,7 @@ var $9cbefc32b9dab36d$var$_locale_signal = /*#__PURE__*/new WeakMap();
6809
6837
  var $9cbefc32b9dab36d$var$_merchant_signal = /*#__PURE__*/new WeakMap();
6810
6838
  var $9cbefc32b9dab36d$var$_market_signal = /*#__PURE__*/new WeakMap();
6811
6839
  var $9cbefc32b9dab36d$var$_query_id_signal = /*#__PURE__*/new WeakMap();
6840
+ var $9cbefc32b9dab36d$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
6812
6841
  var $9cbefc32b9dab36d$var$_listing_type_signal = /*#__PURE__*/new WeakMap();
6813
6842
  class $9cbefc32b9dab36d$export$f34314aa9505732e {
6814
6843
  get localization() {
@@ -6842,6 +6871,12 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
6842
6871
  set listing_type(listing_type) {
6843
6872
  (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_listing_type_signal)[1](listing_type);
6844
6873
  }
6874
+ get meta_title_suffix() {
6875
+ return (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_meta_title_suffix_)[0]();
6876
+ }
6877
+ set meta_title_suffix(new_suffix) {
6878
+ (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_meta_title_suffix_)[1](new_suffix);
6879
+ }
6845
6880
  get on_navigation() {
6846
6881
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
6847
6882
  return (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_router).on_navigation_;
@@ -6879,6 +6914,10 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
6879
6914
  writable: true,
6880
6915
  value: (0, $52FdA$solidjs.createSignal)("")
6881
6916
  });
6917
+ $9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_meta_title_suffix_, {
6918
+ writable: true,
6919
+ value: (0, $52FdA$solidjs.createSignal)()
6920
+ });
6882
6921
  $9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_listing_type_signal, {
6883
6922
  writable: true,
6884
6923
  value: (0, $52FdA$solidjs.createSignal)()
@@ -6952,10 +6991,17 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
6952
6991
  } = props;
6953
6992
  const shared_properties = $9cbefc32b9dab36d$var$get_shared_properties(depict_category);
6954
6993
  return (0, $d05611ff6b8c8357$export$23fca46f3143581f)(() => {
6994
+ (0, $52FdA$solidjs.createEffect)(prev => {
6995
+ // 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
6996
+ const id = depict_category.category_id; // <- this is a reactive getter
6997
+ (0, $bdea39a75c454f4f$export$f50b88e2a00918b5)(props.on_query_id_change)(id, prev);
6998
+ return id;
6999
+ });
7000
+ (0, $52FdA$solidjs.onCleanup)(() => (0, $bdea39a75c454f4f$export$f50b88e2a00918b5)(props.on_query_id_change)());
6955
7001
  const grid_spacing_override = (0, $52FdA$solidjs.createMemo)(() => {
6956
7002
  const {
6957
7003
  grid_spacing: grid_spacing
6958
- } = props; // can be reactive
7004
+ } = props; // can be reactive, therefore read in the memo
6959
7005
  return typeof grid_spacing === "string" ? {
6960
7006
  grid_spacing: grid_spacing
6961
7007
  } : {
@@ -6991,6 +7037,7 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
6991
7037
  depict_api_: depict_api_,
6992
7038
  min_products_to_fetch_: $9cbefc32b9dab36d$var$min_products_to_fetch_,
6993
7039
  local_filter_cache_: local_filter_cache_,
7040
+ meta_title_suffix_: () => depict_category.meta_title_suffix,
6994
7041
  query_id_: () => depict_category.category_id,
6995
7042
  listing_type_: () => depict_category.listing_type,
6996
7043
  i18n_: i18n_,
@@ -10611,6 +10658,13 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
10611
10658
  grid_spacing: grid_spacing.horizontal
10612
10659
  };
10613
10660
  });
10661
+ (0, $52FdA$solidjs.createEffect)(prev => {
10662
+ // 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
10663
+ const search_query = shared_properties.get_search_query_();
10664
+ (0, $bdea39a75c454f4f$export$f50b88e2a00918b5)(props.on_query_change)(search_query, prev);
10665
+ return search_query;
10666
+ });
10667
+ (0, $52FdA$solidjs.onCleanup)(() => (0, $bdea39a75c454f4f$export$f50b88e2a00918b5)(props.on_query_change)());
10614
10668
  (0, $52FdA$solidjs.onCleanup)(shared_properties.reset_history_state_);
10615
10669
  return (0, $739c927cbecd26b0$export$a54ec244c8863715)({
10616
10670
  input_modal_open_: () => !!depict_search.modal_open,
package/ES10/index.d.ts CHANGED
@@ -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.
package/ES10/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { add_to_version_info as $8tj43$add_to_version_info, observer as $8tj43$observer, catchify as $8tj43$catchify, useExpandingContainer as $8tj43$useExpandingContainer, standard_price_format as $8tj43$standard_price_format, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, slider_fading_factory as $8tj43$slider_fading_factory, make_random_classname as $8tj43$make_random_classname, dlog as $8tj43$dlog, hex_to_rgb as $8tj43$hex_to_rgb, report as $8tj43$report, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, javascript_media_query as $8tj43$javascript_media_query, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, fetch_recs as $8tj43$fetch_recs, snakeCasifyObject as $8tj43$snakeCasifyObject, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, base_url as $8tj43$base_url, get_depict_id as $8tj43$get_depict_id, get_user_id as $8tj43$get_user_id, get_session_id as $8tj43$get_session_id, make_url_with_query_params as $8tj43$make_url_with_query_params, fetch_retry as $8tj43$fetch_retry, add_version_query_params as $8tj43$add_version_query_params, dwarn as $8tj43$dwarn, sort_obj as $8tj43$sort_obj, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, queueMacroTask as $8tj43$queueMacroTask, is_debug as $8tj43$is_debug, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, ContainedImage as $8tj43$ContainedImage, buildThresholdList as $8tj43$buildThresholdList, deparallelize_no_drop as $8tj43$deparallelize_no_drop, insert_surfaces as $8tj43$insert_surfaces } from "@depict-ai/utilishared/ES10";
1
+ import { add_to_version_info as $8tj43$add_to_version_info, observer as $8tj43$observer, catchify as $8tj43$catchify, useExpandingContainer as $8tj43$useExpandingContainer, standard_price_format as $8tj43$standard_price_format, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, slider_fading_factory as $8tj43$slider_fading_factory, make_random_classname as $8tj43$make_random_classname, dlog as $8tj43$dlog, hex_to_rgb as $8tj43$hex_to_rgb, report as $8tj43$report, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, javascript_media_query as $8tj43$javascript_media_query, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, fetch_recs as $8tj43$fetch_recs, snakeCasifyObject as $8tj43$snakeCasifyObject, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, base_url as $8tj43$base_url, get_depict_id as $8tj43$get_depict_id, get_user_id as $8tj43$get_user_id, get_session_id as $8tj43$get_session_id, make_url_with_query_params as $8tj43$make_url_with_query_params, fetch_retry as $8tj43$fetch_retry, add_version_query_params as $8tj43$add_version_query_params, dwarn as $8tj43$dwarn, sort_obj as $8tj43$sort_obj, edit_current_page_meta_tags as $8tj43$edit_current_page_meta_tags, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, queueMacroTask as $8tj43$queueMacroTask, is_debug as $8tj43$is_debug, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, ContainedImage as $8tj43$ContainedImage, buildThresholdList as $8tj43$buildThresholdList, deparallelize_no_drop as $8tj43$deparallelize_no_drop, insert_surfaces as $8tj43$insert_surfaces } from "@depict-ai/utilishared/ES10";
2
2
  import { insert as $8tj43$insert, createComponent as $8tj43$createComponent, template as $8tj43$template, getNextElement as $8tj43$getNextElement, getNextMarker as $8tj43$getNextMarker, addEventListener as $8tj43$addEventListener, runHydrationEvents as $8tj43$runHydrationEvents, memo as $8tj43$memo, delegateEvents as $8tj43$delegateEvents, effect as $8tj43$effect, setAttribute as $8tj43$setAttribute, spread as $8tj43$spread, mergeProps as $8tj43$mergeProps, Dynamic as $8tj43$Dynamic, use as $8tj43$use, style as $8tj43$style, classList as $8tj43$classList, className as $8tj43$className, isServer as $8tj43$isServer } from "solid-js/web";
3
3
  import { createSignal as $8tj43$createSignal, createMemo as $8tj43$createMemo, untrack as $8tj43$untrack, createEffect as $8tj43$createEffect, getOwner as $8tj43$getOwner, Show as $8tj43$Show, runWithOwner as $8tj43$runWithOwner, Index as $8tj43$Index, onCleanup as $8tj43$onCleanup, createRoot as $8tj43$createRoot, on as $8tj43$on, For as $8tj43$For, createRenderEffect as $8tj43$createRenderEffect, createComputed as $8tj43$createComputed, batch as $8tj43$batch, ErrorBoundary as $8tj43$ErrorBoundary, createResource as $8tj43$createResource, createReaction as $8tj43$createReaction, Suspense as $8tj43$Suspense } from "solid-js";
4
4
  import $8tj43$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
@@ -8,7 +8,7 @@ import $8tj43$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,
@@ -6020,6 +6020,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6020
6020
  depict_api_: depict_api_,
6021
6021
  query_id_: query_id_,
6022
6022
  listing_type_: listing_type_,
6023
+ meta_title_suffix_: meta_title_suffix_,
6023
6024
  current_sorting_: current_sorting_,
6024
6025
  min_products_to_fetch_: min_products_to_fetch_,
6025
6026
  category_filters_open_: category_filters_open_,
@@ -6113,12 +6114,21 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6113
6114
  var _plp_results_4;
6114
6115
  return (_plp_results_4 = plp_results_()) === null || _plp_results_4 === void 0 ? void 0 : _plp_results_4.quick_links;
6115
6116
  });
6117
+ const meta_tag_data_ = (0, $8tj43$createMemo)(() => {
6118
+ var _plp_results_5, _plp_results_5$metada, _plp_results_6, _plp_results_6$metada, _plp_results_7, _plp_results_7$metada;
6119
+ meta_title_suffix_();
6120
+ 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 ? {
6121
+ 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_() || ""),
6122
+ 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
6123
+ } : null;
6124
+ });
6125
+ (0, $8tj43$edit_current_page_meta_tags)(meta_tag_data_);
6116
6126
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $8tj43$createSignal)(false);
6117
6127
  const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $8tj43$createSignal)();
6118
6128
  const formatted_number_of_results_ = (0, $43fbdca0f726a34b$export$92f2da32c6e7e7ee)({
6119
6129
  number_: (0, $8tj43$createMemo)(() => {
6120
- var _plp_results_5;
6121
- return (_plp_results_5 = plp_results_()) === null || _plp_results_5 === void 0 ? void 0 : _plp_results_5.n_hits;
6130
+ var _plp_results_8;
6131
+ return (_plp_results_8 = plp_results_()) === null || _plp_results_8 === void 0 ? void 0 : _plp_results_8.n_hits;
6122
6132
  }),
6123
6133
  i18n_: i18n_
6124
6134
  });
@@ -6150,8 +6160,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6150
6160
  }), _el$4, _co$);
6151
6161
  (0, $8tj43$insert)(_el$, (0, $8tj43$createComponent)((0, $8tj43$Show), {
6152
6162
  get when() {
6153
- var _plp_results_6;
6154
- return ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : _plp_results_6.n_hits) === 1;
6163
+ var _plp_results_9;
6164
+ return ((_plp_results_9 = plp_results_()) === null || _plp_results_9 === void 0 ? void 0 : _plp_results_9.n_hits) === 1;
6155
6165
  },
6156
6166
  get fallback() {
6157
6167
  return i18n_.products_();
@@ -6370,8 +6380,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6370
6380
  formatted_number_of_results_: formatted_number_of_results_,
6371
6381
  i18n_: i18n_,
6372
6382
  number_of_results_: (0, $8tj43$createMemo)(() => {
6373
- var _plp_results_7;
6374
- return (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : _plp_results_7.n_hits;
6383
+ var _plp_results_10;
6384
+ return (_plp_results_10 = plp_results_()) === null || _plp_results_10 === void 0 ? void 0 : _plp_results_10.n_hits;
6375
6385
  })
6376
6386
  });
6377
6387
  }
@@ -6711,6 +6721,24 @@ function $ac571292d606f30b$var$_get_navigation_happened_promise2(is_replace) {
6711
6721
  (0, $8tj43$instant_exec_on_suspect_history_change).add(handler);
6712
6722
  });
6713
6723
  }
6724
+
6725
+ /**
6726
+ * Wraps a function in a try/catch block and throws the error globally. If undefined is provided as fn, a no-op is returned.
6727
+ * @param fn the function to wrap
6728
+ */
6729
+ function $01c33966d9ddb108$export$f50b88e2a00918b5(fn) {
6730
+ return function () {
6731
+ if (!fn) return;
6732
+ try {
6733
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
6734
+ return Reflect.apply(fn, this, args);
6735
+ } catch (e) {
6736
+ queueMicrotask(() => {
6737
+ throw e;
6738
+ });
6739
+ }
6740
+ };
6741
+ }
6714
6742
  const $f5f54892fd0c7d9f$var$_tmpl$ = /*#__PURE__*/(0, $8tj43$template)(`<div class="depict plp category"></div>`, 2);
6715
6743
  function $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
6716
6744
  $f5f54892fd0c7d9f$var$_checkPrivateRedeclaration(obj, privateMap);
@@ -6757,6 +6785,7 @@ var $f5f54892fd0c7d9f$var$_locale_signal = /*#__PURE__*/new WeakMap();
6757
6785
  var $f5f54892fd0c7d9f$var$_merchant_signal = /*#__PURE__*/new WeakMap();
6758
6786
  var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
6759
6787
  var $f5f54892fd0c7d9f$var$_query_id_signal = /*#__PURE__*/new WeakMap();
6788
+ var $f5f54892fd0c7d9f$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
6760
6789
  var $f5f54892fd0c7d9f$var$_listing_type_signal = /*#__PURE__*/new WeakMap();
6761
6790
  class $f5f54892fd0c7d9f$export$f34314aa9505732e {
6762
6791
  get localization() {
@@ -6790,6 +6819,12 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
6790
6819
  set listing_type(listing_type) {
6791
6820
  (0, $8tj43$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_listing_type_signal)[1](listing_type);
6792
6821
  }
6822
+ get meta_title_suffix() {
6823
+ return (0, $8tj43$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[0]();
6824
+ }
6825
+ set meta_title_suffix(new_suffix) {
6826
+ (0, $8tj43$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[1](new_suffix);
6827
+ }
6793
6828
  get on_navigation() {
6794
6829
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
6795
6830
  return (0, $8tj43$babelruntimehelpersclassPrivateFieldGet)(this, $f5f54892fd0c7d9f$var$_router).on_navigation_;
@@ -6827,6 +6862,10 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
6827
6862
  writable: true,
6828
6863
  value: (0, $8tj43$createSignal)("")
6829
6864
  });
6865
+ $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_, {
6866
+ writable: true,
6867
+ value: (0, $8tj43$createSignal)()
6868
+ });
6830
6869
  $f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_listing_type_signal, {
6831
6870
  writable: true,
6832
6871
  value: (0, $8tj43$createSignal)()
@@ -6900,10 +6939,17 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
6900
6939
  } = props;
6901
6940
  const shared_properties = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
6902
6941
  return (0, $83e8cf2c0b87a58a$export$23fca46f3143581f)(() => {
6942
+ (0, $8tj43$createEffect)(prev => {
6943
+ // 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
6944
+ const id = depict_category.category_id; // <- this is a reactive getter
6945
+ (0, $01c33966d9ddb108$export$f50b88e2a00918b5)(props.on_query_id_change)(id, prev);
6946
+ return id;
6947
+ });
6948
+ (0, $8tj43$onCleanup)(() => (0, $01c33966d9ddb108$export$f50b88e2a00918b5)(props.on_query_id_change)());
6903
6949
  const grid_spacing_override = (0, $8tj43$createMemo)(() => {
6904
6950
  const {
6905
6951
  grid_spacing: grid_spacing
6906
- } = props; // can be reactive
6952
+ } = props; // can be reactive, therefore read in the memo
6907
6953
  return typeof grid_spacing === "string" ? {
6908
6954
  grid_spacing: grid_spacing
6909
6955
  } : {
@@ -6939,6 +6985,7 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
6939
6985
  depict_api_: depict_api_,
6940
6986
  min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
6941
6987
  local_filter_cache_: local_filter_cache_,
6988
+ meta_title_suffix_: () => depict_category.meta_title_suffix,
6942
6989
  query_id_: () => depict_category.category_id,
6943
6990
  listing_type_: () => depict_category.listing_type,
6944
6991
  i18n_: i18n_,
@@ -10559,6 +10606,13 @@ function $eb064bc3350276c1$export$f2dc7e4e4aa11abb(props) {
10559
10606
  grid_spacing: grid_spacing.horizontal
10560
10607
  };
10561
10608
  });
10609
+ (0, $8tj43$createEffect)(prev => {
10610
+ // 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
10611
+ const search_query = shared_properties.get_search_query_();
10612
+ (0, $01c33966d9ddb108$export$f50b88e2a00918b5)(props.on_query_change)(search_query, prev);
10613
+ return search_query;
10614
+ });
10615
+ (0, $8tj43$onCleanup)(() => (0, $01c33966d9ddb108$export$f50b88e2a00918b5)(props.on_query_change)());
10562
10616
  (0, $8tj43$onCleanup)(shared_properties.reset_history_state_);
10563
10617
  return (0, $da279c5a540c6846$export$a54ec244c8863715)({
10564
10618
  input_modal_open_: () => !!depict_search.modal_open,
package/latest/index.cjs CHANGED
@@ -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,
@@ -5653,6 +5653,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
5653
5653
  depict_api_: depict_api_,
5654
5654
  query_id_: query_id_,
5655
5655
  listing_type_: listing_type_,
5656
+ meta_title_suffix_: meta_title_suffix_,
5656
5657
  current_sorting_: current_sorting_,
5657
5658
  min_products_to_fetch_: min_products_to_fetch_,
5658
5659
  category_filters_open_: category_filters_open_,
@@ -5731,6 +5732,14 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
5731
5732
  const available_filters_ = (0, $gVhhF$solidjs.createMemo)(() => plp_results_()?.filters);
5732
5733
  const crumb_data_ = (0, $gVhhF$solidjs.createMemo)(() => plp_results_()?.breadcrumb);
5733
5734
  const quicklinks_data_ = (0, $gVhhF$solidjs.createMemo)(() => plp_results_()?.quick_links);
5735
+ const meta_tag_data_ = (0, $gVhhF$solidjs.createMemo)(() => {
5736
+ meta_title_suffix_();
5737
+ return plp_results_()?.metadata?.replace_meta_tags ? {
5738
+ title: plp_results_()?.metadata?.title + (meta_title_suffix_() || ""),
5739
+ description: plp_results_()?.metadata?.description
5740
+ } : null;
5741
+ });
5742
+ (0, $gVhhF$depictaiutilishared.edit_current_page_meta_tags)(meta_tag_data_);
5734
5743
  const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $gVhhF$solidjs.createSignal)(false);
5735
5744
  const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $gVhhF$solidjs.createSignal)();
5736
5745
  const formatted_number_of_results_ = (0, $0f400c3f7248d5f1$export$92f2da32c6e7e7ee)({
@@ -6282,6 +6291,23 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
6282
6291
  this.on_navigation_ = on_navigation;
6283
6292
  }
6284
6293
  }
6294
+
6295
+ /**
6296
+ * Wraps a function in a try/catch block and throws the error globally. If undefined is provided as fn, a no-op is returned.
6297
+ * @param fn the function to wrap
6298
+ */
6299
+ function $deaaf04362a1bc71$export$f50b88e2a00918b5(fn) {
6300
+ return function (...args) {
6301
+ if (!fn) return;
6302
+ try {
6303
+ return Reflect.apply(fn, this, args);
6304
+ } catch (e) {
6305
+ queueMicrotask(() => {
6306
+ throw e;
6307
+ });
6308
+ }
6309
+ };
6310
+ }
6285
6311
  const $48567ac5b39bac56$var$_tmpl$ = /*#__PURE__*/(0, $gVhhF$solidjsweb.template)(`<div class="depict plp category"></div>`, 2);
6286
6312
  // 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
6287
6313
  /**
@@ -6304,6 +6330,7 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
6304
6330
  #merchant_signal = (0, $gVhhF$solidjs.createSignal)();
6305
6331
  #market_signal = (0, $gVhhF$solidjs.createSignal)();
6306
6332
  #query_id_signal = (0, $gVhhF$solidjs.createSignal)("");
6333
+ #meta_title_suffix_ = (0, $gVhhF$solidjs.createSignal)();
6307
6334
  #listing_type_signal = (0, $gVhhF$solidjs.createSignal)();
6308
6335
  static #keys_constructed_with = new Set();
6309
6336
  get localization() {
@@ -6337,6 +6364,12 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
6337
6364
  set listing_type(listing_type) {
6338
6365
  this.#listing_type_signal[1](listing_type);
6339
6366
  }
6367
+ get meta_title_suffix() {
6368
+ return this.#meta_title_suffix_[0]();
6369
+ }
6370
+ set meta_title_suffix(new_suffix) {
6371
+ this.#meta_title_suffix_[1](new_suffix);
6372
+ }
6340
6373
  get on_navigation() {
6341
6374
  // The only non-reactive public property on the class (I don't see it making sense to have it reactive)
6342
6375
  return this.#router.on_navigation_;
@@ -6418,10 +6451,17 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
6418
6451
  } = props;
6419
6452
  const shared_properties = $48567ac5b39bac56$var$get_shared_properties(depict_category);
6420
6453
  return (0, $95837413165cc2df$export$23fca46f3143581f)(() => {
6454
+ (0, $gVhhF$solidjs.createEffect)(prev => {
6455
+ // 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
6456
+ const id = depict_category.category_id; // <- this is a reactive getter
6457
+ (0, $deaaf04362a1bc71$export$f50b88e2a00918b5)(props.on_query_id_change)(id, prev);
6458
+ return id;
6459
+ });
6460
+ (0, $gVhhF$solidjs.onCleanup)(() => (0, $deaaf04362a1bc71$export$f50b88e2a00918b5)(props.on_query_id_change)());
6421
6461
  const grid_spacing_override = (0, $gVhhF$solidjs.createMemo)(() => {
6422
6462
  const {
6423
6463
  grid_spacing: grid_spacing
6424
- } = props; // can be reactive
6464
+ } = props; // can be reactive, therefore read in the memo
6425
6465
  return typeof grid_spacing === "string" ? {
6426
6466
  grid_spacing: grid_spacing
6427
6467
  } : {
@@ -6457,6 +6497,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
6457
6497
  depict_api_: depict_api_,
6458
6498
  min_products_to_fetch_: $48567ac5b39bac56$var$min_products_to_fetch_,
6459
6499
  local_filter_cache_: local_filter_cache_,
6500
+ meta_title_suffix_: () => depict_category.meta_title_suffix,
6460
6501
  query_id_: () => depict_category.category_id,
6461
6502
  listing_type_: () => depict_category.listing_type,
6462
6503
  i18n_: i18n_,
@@ -9835,6 +9876,13 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
9835
9876
  grid_spacing: grid_spacing.horizontal
9836
9877
  };
9837
9878
  });
9879
+ (0, $gVhhF$solidjs.createEffect)(prev => {
9880
+ // 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
9881
+ const search_query = shared_properties.get_search_query_();
9882
+ (0, $deaaf04362a1bc71$export$f50b88e2a00918b5)(props.on_query_change)(search_query, prev);
9883
+ return search_query;
9884
+ });
9885
+ (0, $gVhhF$solidjs.onCleanup)(() => (0, $deaaf04362a1bc71$export$f50b88e2a00918b5)(props.on_query_change)());
9838
9886
  (0, $gVhhF$solidjs.onCleanup)(shared_properties.reset_history_state_);
9839
9887
  return (0, $f1d7cb69f839a526$export$a54ec244c8863715)({
9840
9888
  input_modal_open_: () => !!depict_search.modal_open,
package/latest/index.d.ts CHANGED
@@ -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.