@depict-ai/ui 4.6.1 → 4.7.1

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.
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
13
13
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
14
- export const version = "4.6.1";
14
+ export const version = "4.7.1";
15
15
  /**
16
16
  * Just like `useExpandingContainer` except that the children can be reactive solid-js signals, basically solid's JSX.Element instead of our JSX.Element
17
17
  */
@@ -1442,7 +1442,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1442
1442
  * Open the modal with support for alignment.
1443
1443
  * @returns {void}
1444
1444
  */
1445
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1445
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1446
1446
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1447
1447
  export interface PageReplacer {
1448
1448
  readonly render_: () => Node_Array;
@@ -1521,5 +1521,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1521
1521
  content_blocks_by_row?: ContentBlocksByRow;
1522
1522
  layout?: PossibleLayout;
1523
1523
  filterModalParent_?: HTMLElement | ShadowRoot;
1524
- }): import("@depict-ai/utilishared/latest").Node_Array;
1524
+ }): import("@depict-ai/utilishared").Node_Array;
1525
1525
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.6.1";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.1";
11
11
  function $24e27fab9c821b86$export$5bad61ecde080b1f(...params) {
12
12
  const {
13
13
  collapse: collapse,
@@ -2846,7 +2846,7 @@ function $081752ca508a876f$export$f7658c347b037c3f(props = {}) {
2846
2846
  }
2847
2847
  var $5285d2814d0fac0c$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
2848
2848
  $5285d2814d0fac0c$var$_tmpl$2 = ["<button", ' class="submit major" type="button"', ">", "</button>"],
2849
- $5285d2814d0fac0c$var$_tmpl$3 = ["<div", ' class="', '" role="search"><!--$-->', "<!--/--><!--$-->", '<!--/--><div class="field"><!--$-->', '<!--/--><input class="', '" tabindex="0"', "><!--$-->", "<!--/--></div><!--$-->", "<!--/--><!--$-->", "<!--/--></div>"];
2849
+ $5285d2814d0fac0c$var$_tmpl$3 = ["<div", ' class="', '" role="search"><!--$-->', "<!--/--><!--$-->", '<!--/--><div class="field"><!--$-->', '<!--/--><input class="', '" type="search" tabindex="0" enterkeyhint="search"', "><!--$-->", "<!--/--></div><!--$-->", "<!--/--><!--$-->", "<!--/--></div>"];
2850
2850
  function $5285d2814d0fac0c$export$b94867ecbd698f21({
2851
2851
  search_field_value_: [searchFieldValue, setSearchFieldValue],
2852
2852
  input_field_ref_: input_field_ref_,
@@ -8133,7 +8133,9 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
8133
8133
  local_filter_cache_: [get_local_filter_cache, set_local_filter_cache],
8134
8134
  selected_filters_: [get_selected_filters, set_selected_filters],
8135
8135
  expanded_hierarchical_filters_: [get_expanded_hierarchical_filters, set_expanded_hierarchical_filters],
8136
- delay_toast_: delay_toast_
8136
+ delay_toast_: delay_toast_,
8137
+ expanded_filters_: expanded_filters_,
8138
+ filters_open_: filters_open_
8137
8139
  } = props;
8138
8140
  const previous_selected_filters = $i7OB2$untrack(get_selected_filters);
8139
8141
  if (!previous_selected_filters.length) {
@@ -8142,9 +8144,13 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
8142
8144
  if (delay_toast_) return () => {};
8143
8145
  return;
8144
8146
  }
8147
+ const previousExpandedFilters = $i7OB2$untrack(() => expanded_filters_?.[0]());
8148
+ const previousFiltersOpen = $i7OB2$untrack(() => filters_open_?.[0]());
8145
8149
  const previous_expanded_hierarchical_filters = $i7OB2$untrack(get_expanded_hierarchical_filters);
8146
8150
  const previous_local_filter_cache = $i7OB2$untrack(get_local_filter_cache);
8147
8151
  const statement_accessor = user_triggered_ ? i18n_.filters_cleared_ : i18n_.we_cleared_your_filters_;
8152
+ expanded_filters_?.[1]([]);
8153
+ filters_open_?.[1](false);
8148
8154
  set_selected_filters([]);
8149
8155
  scrollTo({
8150
8156
  top: 0
@@ -8170,7 +8176,7 @@ function $e9342fb3ac73a54a$export$8895d39404bd2bb1(props) {
8170
8176
  close_toast_: close_toast_
8171
8177
  } = $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
8172
8178
  class: "cleared_filters",
8173
- close_after_: 30000,
8179
+ close_after_: 10000,
8174
8180
  on_close_: on_toast_hidden,
8175
8181
  children: [$i7OB2$ssr($e9342fb3ac73a54a$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(statement_accessor())), $i7OB2$ssr($e9342fb3ac73a54a$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape(i18n_.restore_()), $i7OB2$escape(i18n_.ok_()))]
8176
8182
  }));
@@ -8183,7 +8189,9 @@ function $48d7e4a9707315b6$export$e026af0c7b64ea5f({
8183
8189
  current_sorting_: current_sorting_,
8184
8190
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
8185
8191
  i18n_: i18n_,
8186
- local_filter_cache_: local_filter_cache_
8192
+ local_filter_cache_: local_filter_cache_,
8193
+ expanded_filters_: expanded_filters_,
8194
+ filters_open_: filters_open_
8187
8195
  }) {
8188
8196
  const [get_selected_filters] = selected_filters_;
8189
8197
  // Possible values:
@@ -8211,7 +8219,9 @@ function $48d7e4a9707315b6$export$e026af0c7b64ea5f({
8211
8219
  also_clear_sorting_: true,
8212
8220
  current_sorting_: current_sorting_,
8213
8221
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
8214
- local_filter_cache_: local_filter_cache_
8222
+ local_filter_cache_: local_filter_cache_,
8223
+ expanded_filters_: expanded_filters_,
8224
+ filters_open_: filters_open_
8215
8225
  });
8216
8226
  }
8217
8227
  }), {
@@ -11040,7 +11050,9 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
11040
11050
  current_sorting_: current_sorting_,
11041
11051
  expanded_hierarchical_filters_: state_.expanded_hierarchical_filters,
11042
11052
  i18n_: i18n_,
11043
- local_filter_cache_: state_.local_filter_cache
11053
+ local_filter_cache_: state_.local_filter_cache,
11054
+ expanded_filters_: state_.expanded_filters,
11055
+ filters_open_: state_.filters_open
11044
11056
  });
11045
11057
  $806c97b931758897$export$dde08b2dca8cc1ce.set(this, {
11046
11058
  search_query_url_param_name_: search_query_url_param_name_,
@@ -11935,7 +11947,9 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
11935
11947
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
11936
11948
  plp_results_: plp_results_,
11937
11949
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
11938
- id_type_: id_type_
11950
+ id_type_: id_type_,
11951
+ expanded_filters_: expanded_filters_,
11952
+ filters_open_: filters_open_
11939
11953
  }) {
11940
11954
  // If we just got opened in a new tab, clear filters instantly and remove the flag
11941
11955
  $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
@@ -11944,7 +11958,9 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
11944
11958
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
11945
11959
  selected_filters_: selected_filters_,
11946
11960
  i18n_: i18n_,
11947
- sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
11961
+ sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
11962
+ expanded_filters_: expanded_filters_,
11963
+ filters_open_: filters_open_
11948
11964
  });
11949
11965
  // The code below is for when we're already open and the user navigates to a new category
11950
11966
  let previous_crumb_data = $i7OB2$untrack(crumb_data_);
@@ -11977,7 +11993,9 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
11977
11993
  also_clear_sorting_: false,
11978
11994
  selected_filters_: selected_filters_,
11979
11995
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
11980
- local_filter_cache_: local_filter_cache_
11996
+ local_filter_cache_: local_filter_cache_,
11997
+ expanded_filters_: expanded_filters_,
11998
+ filters_open_: filters_open_
11981
11999
  });
11982
12000
  // Also ensure we don't have `sideways_url_params_flag` set anymore
11983
12001
  sideways_filter_clearing_flag_[1](false);
@@ -11997,7 +12015,9 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
11997
12015
  i18n_: i18n_,
11998
12016
  selected_filters_: selected_filters_,
11999
12017
  local_filter_cache_: local_filter_cache_,
12000
- sideways_filter_clearing_flag_: [get_sideways_filter_clearing_flag_, set_sideways_filter_clearing_flag_]
12018
+ sideways_filter_clearing_flag_: [get_sideways_filter_clearing_flag_, set_sideways_filter_clearing_flag_],
12019
+ expanded_filters_: expanded_filters_,
12020
+ filters_open_: filters_open_
12001
12021
  }) {
12002
12022
  const tracking_function_for_plp_results = $i7OB2$createReaction(() => {
12003
12023
  // On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
@@ -12012,7 +12032,9 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
12012
12032
  also_clear_sorting_: false,
12013
12033
  selected_filters_: selected_filters_,
12014
12034
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12015
- local_filter_cache_: local_filter_cache_
12035
+ local_filter_cache_: local_filter_cache_,
12036
+ filters_open_: filters_open_,
12037
+ expanded_filters_: expanded_filters_
12016
12038
  });
12017
12039
  });
12018
12040
  });
@@ -12255,7 +12277,9 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
12255
12277
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12256
12278
  plp_results_: plp_products_,
12257
12279
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
12258
- id_type_: id_type_
12280
+ id_type_: id_type_,
12281
+ expanded_filters_: expanded_filters_,
12282
+ filters_open_: category_filters_open_
12259
12283
  });
12260
12284
  get_breadcrumb_accessor_?.(crumb_data_);
12261
12285
  get_quicklinks_accessor_?.(quicklinks_data_);