@depict-ai/ui 4.9.8 → 4.10.0

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.cjs CHANGED
@@ -109,7 +109,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
109
109
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
110
110
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
111
111
  /*! Depict.ai search and product listing SDK */
112
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.9.8";
112
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.10.0";
113
113
  function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
114
114
  const signal = $gVhhF$solidjs.createSignal(false);
115
115
  $gVhhF$solidjs.onCleanup($gVhhF$depictaiutilishared.javascript_media_query(media_query, ({
@@ -4946,8 +4946,26 @@ function $aff9a96d30ed3563$export$3f1a388cc0d8fed7(props) {
4946
4946
  }
4947
4947
  function $aff9a96d30ed3563$var$ActualFilterBody(props) {
4948
4948
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
4949
- const togglable_filters = $gVhhF$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => item?.meta?.group_title));
4950
- const untogglable_filters = $gVhhF$solidjs.createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => !item?.meta?.group_title));
4949
+ const withMaybeCount0Removed = $gVhhF$solidjs.createMemo(() => {
4950
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
4951
+ if (!props.hideCount0FilterOptions_()) return filters;
4952
+ return filters.map(filter => {
4953
+ const oldMeta = filter.meta;
4954
+ if (!oldMeta) return filter;
4955
+ const modifiedMeta = {
4956
+ ...oldMeta
4957
+ };
4958
+ if ("counts" in modifiedMeta)
4959
+ // Remove all count 0 filter options, important that counts is last option
4960
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] &&= modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0);
4961
+ return {
4962
+ ...filter,
4963
+ meta: modifiedMeta
4964
+ };
4965
+ });
4966
+ });
4967
+ const togglable_filters = $gVhhF$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => item?.meta?.group_title));
4968
+ const untogglable_filters = $gVhhF$solidjs.createMemo(() => withMaybeCount0Removed().filter(item => !item?.meta?.group_title));
4951
4969
  const togglable_filters_grouped_by_collapsible = $gVhhF$solidjs.createMemo(() => {
4952
4970
  const output = {};
4953
4971
  for (const filter of togglable_filters()) {
@@ -4968,9 +4986,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
4968
4986
  },
4969
4987
  get children() {
4970
4988
  return (() => {
4971
- const filter_array_ = $gVhhF$solidjs.createMemo(() => {
4972
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
4973
- });
4989
+ const filter_array_ = $gVhhF$solidjs.createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
4974
4990
  const {
4975
4991
  SearchThisFilterGroup_: SearchThisFilterGroup_,
4976
4992
  searched_filter_array_: searched_filter_array_,
@@ -5929,7 +5945,8 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
5929
5945
  local_filter_cache_: local_filter_cache_,
5930
5946
  get_extra_filters_button_: get_extra_filters_button_,
5931
5947
  get_extra_sorting_button_: get_extra_sorting_button_,
5932
- filterModalParent_: filterModalParent_
5948
+ filterModalParent_: filterModalParent_,
5949
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5933
5950
  }) {
5934
5951
  const Self = () => {
5935
5952
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -5960,7 +5977,8 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
5960
5977
  available_filters_: available_filters_,
5961
5978
  expanded_filters_: expanded_filters_,
5962
5979
  selected_filters_: selected_filters_,
5963
- i18n_: i18n_
5980
+ i18n_: i18n_,
5981
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5964
5982
  };
5965
5983
  const hide_filters = $gVhhF$solidjs.createMemo(() => $7e91f9b0c6d56424$export$50f68cc9882e36a4(filter_options));
5966
5984
  const sorting_options = {
@@ -7603,7 +7621,7 @@ async function $20ff40266d725403$export$5d2f6cd705125cd3() {
7603
7621
  $20ff40266d725403$var$cachedHlsModule = hlsModule;
7604
7622
  return hlsModule;
7605
7623
  }
7606
- var $32c662f618f5d80d$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<video loop class=d-standard-content>`);
7624
+ var $32c662f618f5d80d$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<video class=d-standard-content>`);
7607
7625
  function $32c662f618f5d80d$export$780a853d15174484({
7608
7626
  link_: link_,
7609
7627
  type_: type_,
@@ -7679,9 +7697,18 @@ function $32c662f618f5d80d$export$780a853d15174484({
7679
7697
  hls.loadSource(mediaUrl_);
7680
7698
  hls.attachMedia(element);
7681
7699
  }
7700
+ const [retryPlayToggle, setRetryPlayToggle] = $gVhhF$solidjs.createSignal(false);
7682
7701
  // need runWithOwner for createEffect, because we potentially awaited above
7683
7702
  $gVhhF$solidjs.runWithOwner(owner, () => $gVhhF$solidjs.createEffect(() => {
7684
- if (pageVisible()) element.play().catch(e => $gVhhF$depictaiutilishared.dlog("Failed to play", e));else element.pause();
7703
+ retryPlayToggle();
7704
+ if (pageVisible()) element.play().catch(async e => {
7705
+ $gVhhF$depictaiutilishared.dlog("Failed to play", e);
7706
+ // If we're not in the DOM yet, wait until we are and then try again
7707
+ if (!document.documentElement.contains(element)) {
7708
+ await (0, $gVhhF$depictaiutilisharedlatest.observer).wait_for_element(element);
7709
+ setRetryPlayToggle(prev => !prev);
7710
+ }
7711
+ });else element.pause();
7685
7712
  }));
7686
7713
  });
7687
7714
  typeof _ref$ === "function" && $gVhhF$solidjsweb.use(_ref$, _el$);
@@ -7691,6 +7718,8 @@ function $32c662f618f5d80d$export$780a853d15174484({
7691
7718
  $gVhhF$solidjsweb.setProperty(_el$, "muted", true);
7692
7719
  $gVhhF$solidjsweb.setProperty(_el$, "autoplay", true);
7693
7720
  $gVhhF$solidjsweb.setProperty(_el$, "playsinline", true);
7721
+ $gVhhF$solidjsweb.setProperty(_el$, "loop", true);
7722
+ $gVhhF$solidjsweb.setAttribute(_el$, "disablepictureinpicture", true);
7694
7723
  return _el$;
7695
7724
  }
7696
7725
  })];
@@ -7810,7 +7839,8 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
7810
7839
  filter_query_param_prefix_: filter_query_param_prefix_,
7811
7840
  content_blocks_by_row_: content_blocks_by_row_,
7812
7841
  filterModalParent_: filterModalParent_,
7813
- showSliderArrow_: showSliderArrow_
7842
+ showSliderArrow_: showSliderArrow_,
7843
+ hideCount0FilterOptions_: hideCount0FilterOptions_
7814
7844
  }) {
7815
7845
  let results_for;
7816
7846
  let only_show_filters_opener_;
@@ -8024,6 +8054,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
8024
8054
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
8025
8055
  sort_and_filter_disabled_: sort_and_filter_disabled_,
8026
8056
  filterModalParent_: filterModalParent_,
8057
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
8027
8058
  ...extra_sort_and_filter_args_
8028
8059
  });
8029
8060
  $gVhhF$depictaiutilisharedlatest.catchify((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
@@ -10026,11 +10057,11 @@ function $1dbed937c406bdf0$export$e872e2339fb04a7f({
10026
10057
  searching_for_value_: searching_for_value_
10027
10058
  })), (() => {
10028
10059
  var _el$3 = $gVhhF$solidjsweb.getNextElement($1dbed937c406bdf0$var$_tmpl$3);
10029
- $gVhhF$solidjsweb.insert(_el$3, $gVhhF$solidjs.createMemo(() => {
10060
+ $gVhhF$solidjsweb.insert(_el$3, () => $gVhhF$solidjs.createMemo(() => {
10030
10061
  if (input_obj().type === "content") return i18n_.content_();
10031
10062
  if (input_obj().listing_type === "brand") return i18n_.brand_();
10032
10063
  return i18n_.category_();
10033
- }));
10064
+ })());
10034
10065
  return _el$3;
10035
10066
  })()];
10036
10067
  })());
@@ -10637,7 +10668,7 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
10637
10668
  },
10638
10669
  get children() {
10639
10670
  var _el$4 = $gVhhF$solidjsweb.getNextElement($66b8b9a9613c141d$var$_tmpl$3);
10640
- $gVhhF$solidjsweb.effect(() => (getBackButtonWidth(), _el$4.style.setProperty("width", getBackButtonWidth() + "px")));
10671
+ $gVhhF$solidjsweb.effect(_$p => (_$p = getBackButtonWidth() + "px", _el$4.style.setProperty("width", _$p)));
10641
10672
  return _el$4;
10642
10673
  }
10643
10674
  }), _el$13, _co$3);
@@ -11319,7 +11350,7 @@ function $83e616b38be339e4$export$c8d7e00464029b45({
11319
11350
  });
11320
11351
  }
11321
11352
  }), _el$4, _co$);
11322
- $gVhhF$solidjsweb.effect(() => itemIndex_() != null ? _el$.style.setProperty("order", itemIndex_()) : _el$.style.removeProperty("order"));
11353
+ $gVhhF$solidjsweb.effect(_$p => (_$p = itemIndex_()) != null ? _el$.style.setProperty("order", _$p) : _el$.style.removeProperty("order"));
11323
11354
  return _el$;
11324
11355
  }
11325
11356
  });
@@ -11435,7 +11466,7 @@ function $a13dbcf80d79229c$export$d4994a86c6235f72({
11435
11466
  });
11436
11467
  }
11437
11468
  }));
11438
- $gVhhF$solidjsweb.effect(() => itemIndex_() != null ? _el$.style.setProperty("order", itemIndex_()) : _el$.style.removeProperty("order"));
11469
+ $gVhhF$solidjsweb.effect(_$p => (_$p = itemIndex_()) != null ? _el$.style.setProperty("order", _$p) : _el$.style.removeProperty("order"));
11439
11470
  return _el$;
11440
11471
  }
11441
11472
  });
@@ -11864,7 +11895,7 @@ function $11597ae03e703a47$var$RawSearchModalV2({
11864
11895
  }),
11865
11896
  ...instant_results_options_
11866
11897
  }), _el$4, _co$);
11867
- $gVhhF$solidjsweb.effect(() => itemIndexes.instantResultsIndex_() != null ? _el$.style.setProperty("order", itemIndexes.instantResultsIndex_()) : _el$.style.removeProperty("order"));
11898
+ $gVhhF$solidjsweb.effect(_$p => (_$p = itemIndexes.instantResultsIndex_()) != null ? _el$.style.setProperty("order", _$p) : _el$.style.removeProperty("order"));
11868
11899
  return _el$;
11869
11900
  }
11870
11901
  });
@@ -14244,7 +14275,7 @@ function $3716b8caf7f959e2$export$6d0c9c22f6652669({
14244
14275
  });
14245
14276
  }
14246
14277
  })), _el$5, _co$2);
14247
- $gVhhF$solidjsweb.effect(() => (is_loading_() && placeholders_enabled() || content_results()?.length, _el$.style.setProperty("display", is_loading_() && placeholders_enabled() || content_results()?.length > 0 ? "" : "none")));
14278
+ $gVhhF$solidjsweb.effect(_$p => (_$p = is_loading_() && placeholders_enabled() || content_results()?.length > 0 ? "" : "none", _el$.style.setProperty("display", _$p)));
14248
14279
  return _el$;
14249
14280
  })();
14250
14281
  }
@@ -14530,7 +14561,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
14530
14561
  BackIcon_: BackIcon_,
14531
14562
  filterModalParent_: filterModalParent_,
14532
14563
  class_: class_,
14533
- showSliderArrow_: showSliderArrow_
14564
+ showSliderArrow_: showSliderArrow_,
14565
+ hideCount0FilterOptions_: hideCount0FilterOptions_
14534
14566
  }) {
14535
14567
  const [get_sorting] = current_sorting_;
14536
14568
  const all_products_loaded_ = $gVhhF$solidjs.createSignal(false);
@@ -14638,7 +14670,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
14638
14670
  local_filter_cache_: local_filter_cache_,
14639
14671
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14640
14672
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
14641
- filterModalParent_: filterModalParent_
14673
+ filterModalParent_: filterModalParent_,
14674
+ hideCount0FilterOptions_: hideCount0FilterOptions_
14642
14675
  });
14643
14676
  const results_filters = $gVhhF$solidjs.createSignal();
14644
14677
  const shouldActuallyShowInputField = $gVhhF$solidjs.createMemo(() => include_input_field_?.() ?? true); // default to showing input field
@@ -15322,7 +15355,8 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
15322
15355
  })),
15323
15356
  filterModalParent_: $gVhhF$solidjs.untrack(() => props.filterModalParent_),
15324
15357
  product_card_template_: product_card_template,
15325
- class_: () => props.class
15358
+ class_: () => props.class,
15359
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false
15326
15360
  });
15327
15361
  }, "Entire SearchPage failed");
15328
15362
  }
@@ -15885,6 +15919,7 @@ function $14f289047713d67a$export$e2bf8ce7779e827e(props) {
15885
15919
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
15886
15920
  content_blocks_by_row_: () => props.content_blocks_by_row,
15887
15921
  showSliderArrow_: () => props.showSliderArrow_,
15922
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false,
15888
15923
  scroll_restoration_data_: scroll_restoration_data_,
15889
15924
  history_content_blocks_: history_content_blocks_,
15890
15925
  layout_options_: $gVhhF$solidjs.createMemo(() => ({
package/latest/index.d.ts CHANGED
@@ -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.9.8";
14
+ export const version = "4.10.0";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -1046,6 +1046,7 @@ interface FilterBodyProps {
1046
1046
  expanded_: boolean;
1047
1047
  }[]>;
1048
1048
  are_in_modal_?: boolean;
1049
+ hideCount0FilterOptions_: Accessor<boolean>;
1049
1050
  }
1050
1051
  export function FilterBody(props: FilterBodyProps): JSX.Element;
1051
1052
  /**
@@ -1500,6 +1501,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
1500
1501
  filterModalParent_?: HTMLElement | ShadowRoot;
1501
1502
  class?: string;
1502
1503
  showSliderArrow_?: boolean;
1504
+ hideCount0FilterOptions_?: boolean;
1503
1505
  }): import("@depict-ai/utilishared").Node_Array;
1504
1506
  /**
1505
1507
  * Connects the height of the search field to the height of the aligner.
@@ -1539,7 +1541,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1539
1541
  * Open the modal with support for alignment.
1540
1542
  * @returns {void}
1541
1543
  */
1542
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1544
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1543
1545
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1544
1546
  export interface PageReplacer {
1545
1547
  readonly render_: () => Node_Array;
@@ -1619,5 +1621,6 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1619
1621
  layout?: PossibleLayout;
1620
1622
  filterModalParent_?: HTMLElement | ShadowRoot;
1621
1623
  showSliderArrow_?: boolean;
1622
- }): import("@depict-ai/utilishared").Node_Array;
1624
+ hideCount0FilterOptions_?: boolean;
1625
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1623
1626
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/latest/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { add_to_version_info as $9HbP8$add_to_version_info, javascript_media_query as $9HbP8$javascript_media_query, standard_price_format as $9HbP8$standard_price_format, catchify as $9HbP8$catchify1, observer as $9HbP8$observer, slider_fractional_factory as $9HbP8$slider_fractional_factory, report as $9HbP8$report1, dlog as $9HbP8$dlog, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, dwarn as $9HbP8$dwarn, slider_fading_factory as $9HbP8$slider_fading_factory, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, useExpandingContainer as $9HbP8$useExpandingContainer, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, queueMacroTask as $9HbP8$queueMacroTask, is_debug as $9HbP8$is_debug, findMostFrequentItem as $9HbP8$findMostFrequentItem, is_available_in as $9HbP8$is_available_in, fetch_retry as $9HbP8$fetch_retry, base_url as $9HbP8$base_url, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, ContainedImage as $9HbP8$ContainedImage, buildThresholdList as $9HbP8$buildThresholdList, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, use_href_accessor as $9HbP8$use_href_accessor1, get_session_id as $9HbP8$get_session_id, add_version_query_params as $9HbP8$add_version_query_params, snakeCasifyObject as $9HbP8$snakeCasifyObject, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params, insert_surfaces as $9HbP8$insert_surfaces } from "@depict-ai/utilishared/latest";
2
2
  import { template as $9HbP8$template, createComponent as $9HbP8$createComponent, getNextElement as $9HbP8$getNextElement, getNextMarker as $9HbP8$getNextMarker, insert as $9HbP8$insert, isServer as $9HbP8$isServer, use as $9HbP8$use, effect as $9HbP8$effect, setAttribute as $9HbP8$setAttribute, memo as $9HbP8$memo, mergeProps as $9HbP8$mergeProps1, addEventListener as $9HbP8$addEventListener, runHydrationEvents as $9HbP8$runHydrationEvents, delegateEvents as $9HbP8$delegateEvents, spread as $9HbP8$spread, classList as $9HbP8$classList, className as $9HbP8$className, style as $9HbP8$style, Dynamic as $9HbP8$Dynamic, setProperty as $9HbP8$setProperty } from "solid-js/web";
3
3
  import { createContext as $9HbP8$createContext, createSignal as $9HbP8$createSignal, getOwner as $9HbP8$getOwner, createResource as $9HbP8$createResource, untrack as $9HbP8$untrack, createRoot as $9HbP8$createRoot, createEffect as $9HbP8$createEffect, runWithOwner as $9HbP8$runWithOwner, onCleanup as $9HbP8$onCleanup, createMemo as $9HbP8$createMemo, Show as $9HbP8$Show, createComputed as $9HbP8$createComputed, createRenderEffect as $9HbP8$createRenderEffect, mergeProps as $9HbP8$mergeProps, useContext as $9HbP8$useContext, createReaction as $9HbP8$createReaction, on as $9HbP8$on, Suspense as $9HbP8$Suspense, ErrorBoundary as $9HbP8$ErrorBoundary, Index as $9HbP8$Index, For as $9HbP8$For, createUniqueId as $9HbP8$createUniqueId, mapArray as $9HbP8$mapArray, batch as $9HbP8$batch, Switch as $9HbP8$Switch, Match as $9HbP8$Match, splitProps as $9HbP8$splitProps, createComponent as $9HbP8$createComponent1, createSelector as $9HbP8$createSelector, children as $9HbP8$children } from "solid-js";
4
- import { catchify as $9HbP8$catchify, report as $9HbP8$report, use_href_accessor as $9HbP8$use_href_accessor, dlog as $9HbP8$dlog1, ListenableSet as $9HbP8$ListenableSet, queueMacroTask as $9HbP8$queueMacroTask1 } from "@depict-ai/utilishared/latest";
4
+ import { catchify as $9HbP8$catchify, report as $9HbP8$report, use_href_accessor as $9HbP8$use_href_accessor, observer as $9HbP8$observer1, dlog as $9HbP8$dlog1, ListenableSet as $9HbP8$ListenableSet, queueMacroTask as $9HbP8$queueMacroTask1 } from "@depict-ai/utilishared/latest";
5
5
  import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from "solid-js/store";
6
6
 
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.9.8";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.10.0";
11
11
  function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
12
12
  const signal = $9HbP8$createSignal(false);
13
13
  $9HbP8$onCleanup($9HbP8$javascript_media_query(media_query, ({
@@ -4844,8 +4844,26 @@ function $fab07f52c9861732$export$3f1a388cc0d8fed7(props) {
4844
4844
  }
4845
4845
  function $fab07f52c9861732$var$ActualFilterBody(props) {
4846
4846
  const [modified_available_filters_with_selected_unexisting_ones_injected_from_local_state] = props.local_filter_cache_;
4847
- const togglable_filters = $9HbP8$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => item?.meta?.group_title));
4848
- const untogglable_filters = $9HbP8$createMemo(() => modified_available_filters_with_selected_unexisting_ones_injected_from_local_state().filter(item => !item?.meta?.group_title));
4847
+ const withMaybeCount0Removed = $9HbP8$createMemo(() => {
4848
+ const filters = modified_available_filters_with_selected_unexisting_ones_injected_from_local_state();
4849
+ if (!props.hideCount0FilterOptions_()) return filters;
4850
+ return filters.map(filter => {
4851
+ const oldMeta = filter.meta;
4852
+ if (!oldMeta) return filter;
4853
+ const modifiedMeta = {
4854
+ ...oldMeta
4855
+ };
4856
+ if ("counts" in modifiedMeta)
4857
+ // Remove all count 0 filter options, important that counts is last option
4858
+ for (const key of ["names", "values", "swatches", "counts"]) modifiedMeta[key] &&= modifiedMeta[key].filter((_, index) => modifiedMeta.counts[index] !== 0);
4859
+ return {
4860
+ ...filter,
4861
+ meta: modifiedMeta
4862
+ };
4863
+ });
4864
+ });
4865
+ const togglable_filters = $9HbP8$createMemo(() => withMaybeCount0Removed().filter(item => item?.meta?.group_title));
4866
+ const untogglable_filters = $9HbP8$createMemo(() => withMaybeCount0Removed().filter(item => !item?.meta?.group_title));
4849
4867
  const togglable_filters_grouped_by_collapsible = $9HbP8$createMemo(() => {
4850
4868
  const output = {};
4851
4869
  for (const filter of togglable_filters()) {
@@ -4866,9 +4884,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
4866
4884
  },
4867
4885
  get children() {
4868
4886
  return (() => {
4869
- const filter_array_ = $9HbP8$createMemo(() => {
4870
- return Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()];
4871
- });
4887
+ const filter_array_ = $9HbP8$createMemo(() => Object.values(togglable_filters_grouped_by_collapsible())[get_section_index()]);
4872
4888
  const {
4873
4889
  SearchThisFilterGroup_: SearchThisFilterGroup_,
4874
4890
  searched_filter_array_: searched_filter_array_,
@@ -5827,7 +5843,8 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5827
5843
  local_filter_cache_: local_filter_cache_,
5828
5844
  get_extra_filters_button_: get_extra_filters_button_,
5829
5845
  get_extra_sorting_button_: get_extra_sorting_button_,
5830
- filterModalParent_: filterModalParent_
5846
+ filterModalParent_: filterModalParent_,
5847
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5831
5848
  }) {
5832
5849
  const Self = () => {
5833
5850
  // This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
@@ -5858,7 +5875,8 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
5858
5875
  available_filters_: available_filters_,
5859
5876
  expanded_filters_: expanded_filters_,
5860
5877
  selected_filters_: selected_filters_,
5861
- i18n_: i18n_
5878
+ i18n_: i18n_,
5879
+ hideCount0FilterOptions_: hideCount0FilterOptions_
5862
5880
  };
5863
5881
  const hide_filters = $9HbP8$createMemo(() => $4cc1c021eee2a432$export$50f68cc9882e36a4(filter_options));
5864
5882
  const sorting_options = {
@@ -7501,7 +7519,7 @@ async function $e422ea9eccb7892b$export$5d2f6cd705125cd3() {
7501
7519
  $e422ea9eccb7892b$var$cachedHlsModule = hlsModule;
7502
7520
  return hlsModule;
7503
7521
  }
7504
- var $f916989c4b1be9f7$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<video loop class=d-standard-content>`);
7522
+ var $f916989c4b1be9f7$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<video class=d-standard-content>`);
7505
7523
  function $f916989c4b1be9f7$export$780a853d15174484({
7506
7524
  link_: link_,
7507
7525
  type_: type_,
@@ -7577,9 +7595,18 @@ function $f916989c4b1be9f7$export$780a853d15174484({
7577
7595
  hls.loadSource(mediaUrl_);
7578
7596
  hls.attachMedia(element);
7579
7597
  }
7598
+ const [retryPlayToggle, setRetryPlayToggle] = $9HbP8$createSignal(false);
7580
7599
  // need runWithOwner for createEffect, because we potentially awaited above
7581
7600
  $9HbP8$runWithOwner(owner, () => $9HbP8$createEffect(() => {
7582
- if (pageVisible()) element.play().catch(e => $9HbP8$dlog("Failed to play", e));else element.pause();
7601
+ retryPlayToggle();
7602
+ if (pageVisible()) element.play().catch(async e => {
7603
+ $9HbP8$dlog("Failed to play", e);
7604
+ // If we're not in the DOM yet, wait until we are and then try again
7605
+ if (!document.documentElement.contains(element)) {
7606
+ await (0, $9HbP8$observer1).wait_for_element(element);
7607
+ setRetryPlayToggle(prev => !prev);
7608
+ }
7609
+ });else element.pause();
7583
7610
  }));
7584
7611
  });
7585
7612
  typeof _ref$ === "function" && $9HbP8$use(_ref$, _el$);
@@ -7589,6 +7616,8 @@ function $f916989c4b1be9f7$export$780a853d15174484({
7589
7616
  $9HbP8$setProperty(_el$, "muted", true);
7590
7617
  $9HbP8$setProperty(_el$, "autoplay", true);
7591
7618
  $9HbP8$setProperty(_el$, "playsinline", true);
7619
+ $9HbP8$setProperty(_el$, "loop", true);
7620
+ $9HbP8$setAttribute(_el$, "disablepictureinpicture", true);
7592
7621
  return _el$;
7593
7622
  }
7594
7623
  })];
@@ -7708,7 +7737,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
7708
7737
  filter_query_param_prefix_: filter_query_param_prefix_,
7709
7738
  content_blocks_by_row_: content_blocks_by_row_,
7710
7739
  filterModalParent_: filterModalParent_,
7711
- showSliderArrow_: showSliderArrow_
7740
+ showSliderArrow_: showSliderArrow_,
7741
+ hideCount0FilterOptions_: hideCount0FilterOptions_
7712
7742
  }) {
7713
7743
  let results_for;
7714
7744
  let only_show_filters_opener_;
@@ -7922,6 +7952,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
7922
7952
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
7923
7953
  sort_and_filter_disabled_: sort_and_filter_disabled_,
7924
7954
  filterModalParent_: filterModalParent_,
7955
+ hideCount0FilterOptions_: hideCount0FilterOptions_,
7925
7956
  ...extra_sort_and_filter_args_
7926
7957
  });
7927
7958
  $9HbP8$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
@@ -9924,11 +9955,11 @@ function $ab4b0679fa8bd1dc$export$e872e2339fb04a7f({
9924
9955
  searching_for_value_: searching_for_value_
9925
9956
  })), (() => {
9926
9957
  var _el$3 = $9HbP8$getNextElement($ab4b0679fa8bd1dc$var$_tmpl$3);
9927
- $9HbP8$insert(_el$3, $9HbP8$createMemo(() => {
9958
+ $9HbP8$insert(_el$3, () => $9HbP8$createMemo(() => {
9928
9959
  if (input_obj().type === "content") return i18n_.content_();
9929
9960
  if (input_obj().listing_type === "brand") return i18n_.brand_();
9930
9961
  return i18n_.category_();
9931
- }));
9962
+ })());
9932
9963
  return _el$3;
9933
9964
  })()];
9934
9965
  })());
@@ -10535,7 +10566,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
10535
10566
  },
10536
10567
  get children() {
10537
10568
  var _el$4 = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$3);
10538
- $9HbP8$effect(() => (getBackButtonWidth(), _el$4.style.setProperty("width", getBackButtonWidth() + "px")));
10569
+ $9HbP8$effect(_$p => (_$p = getBackButtonWidth() + "px", _el$4.style.setProperty("width", _$p)));
10539
10570
  return _el$4;
10540
10571
  }
10541
10572
  }), _el$13, _co$3);
@@ -11217,7 +11248,7 @@ function $44f30a4222ce604b$export$c8d7e00464029b45({
11217
11248
  });
11218
11249
  }
11219
11250
  }), _el$4, _co$);
11220
- $9HbP8$effect(() => itemIndex_() != null ? _el$.style.setProperty("order", itemIndex_()) : _el$.style.removeProperty("order"));
11251
+ $9HbP8$effect(_$p => (_$p = itemIndex_()) != null ? _el$.style.setProperty("order", _$p) : _el$.style.removeProperty("order"));
11221
11252
  return _el$;
11222
11253
  }
11223
11254
  });
@@ -11333,7 +11364,7 @@ function $903297121898e5ff$export$d4994a86c6235f72({
11333
11364
  });
11334
11365
  }
11335
11366
  }));
11336
- $9HbP8$effect(() => itemIndex_() != null ? _el$.style.setProperty("order", itemIndex_()) : _el$.style.removeProperty("order"));
11367
+ $9HbP8$effect(_$p => (_$p = itemIndex_()) != null ? _el$.style.setProperty("order", _$p) : _el$.style.removeProperty("order"));
11337
11368
  return _el$;
11338
11369
  }
11339
11370
  });
@@ -11762,7 +11793,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
11762
11793
  }),
11763
11794
  ...instant_results_options_
11764
11795
  }), _el$4, _co$);
11765
- $9HbP8$effect(() => itemIndexes.instantResultsIndex_() != null ? _el$.style.setProperty("order", itemIndexes.instantResultsIndex_()) : _el$.style.removeProperty("order"));
11796
+ $9HbP8$effect(_$p => (_$p = itemIndexes.instantResultsIndex_()) != null ? _el$.style.setProperty("order", _$p) : _el$.style.removeProperty("order"));
11766
11797
  return _el$;
11767
11798
  }
11768
11799
  });
@@ -14142,7 +14173,7 @@ function $49de9d31aeea1b5e$export$6d0c9c22f6652669({
14142
14173
  });
14143
14174
  }
14144
14175
  })), _el$5, _co$2);
14145
- $9HbP8$effect(() => (is_loading_() && placeholders_enabled() || content_results()?.length, _el$.style.setProperty("display", is_loading_() && placeholders_enabled() || content_results()?.length > 0 ? "" : "none")));
14176
+ $9HbP8$effect(_$p => (_$p = is_loading_() && placeholders_enabled() || content_results()?.length > 0 ? "" : "none", _el$.style.setProperty("display", _$p)));
14146
14177
  return _el$;
14147
14178
  })();
14148
14179
  }
@@ -14428,7 +14459,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
14428
14459
  BackIcon_: BackIcon_,
14429
14460
  filterModalParent_: filterModalParent_,
14430
14461
  class_: class_,
14431
- showSliderArrow_: showSliderArrow_
14462
+ showSliderArrow_: showSliderArrow_,
14463
+ hideCount0FilterOptions_: hideCount0FilterOptions_
14432
14464
  }) {
14433
14465
  const [get_sorting] = current_sorting_;
14434
14466
  const all_products_loaded_ = $9HbP8$createSignal(false);
@@ -14536,7 +14568,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
14536
14568
  local_filter_cache_: local_filter_cache_,
14537
14569
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14538
14570
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
14539
- filterModalParent_: filterModalParent_
14571
+ filterModalParent_: filterModalParent_,
14572
+ hideCount0FilterOptions_: hideCount0FilterOptions_
14540
14573
  });
14541
14574
  const results_filters = $9HbP8$createSignal();
14542
14575
  const shouldActuallyShowInputField = $9HbP8$createMemo(() => include_input_field_?.() ?? true); // default to showing input field
@@ -15220,7 +15253,8 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
15220
15253
  })),
15221
15254
  filterModalParent_: $9HbP8$untrack(() => props.filterModalParent_),
15222
15255
  product_card_template_: product_card_template,
15223
- class_: () => props.class
15256
+ class_: () => props.class,
15257
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false
15224
15258
  });
15225
15259
  }, "Entire SearchPage failed");
15226
15260
  }
@@ -15783,6 +15817,7 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
15783
15817
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
15784
15818
  content_blocks_by_row_: () => props.content_blocks_by_row,
15785
15819
  showSliderArrow_: () => props.showSliderArrow_,
15820
+ hideCount0FilterOptions_: () => props.hideCount0FilterOptions_ ?? false,
15786
15821
  scroll_restoration_data_: scroll_restoration_data_,
15787
15822
  history_content_blocks_: history_content_blocks_,
15788
15823
  layout_options_: $9HbP8$createMemo(() => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.9.8",
3
+ "version": "4.10.0",
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",
@@ -226,7 +226,7 @@
226
226
  "@parcel/resolver-default": "^2.10.3",
227
227
  "@types/jest": "^29.2.4",
228
228
  "@types/node": "^18.11.11",
229
- "babel-preset-solid": "^1.8.16",
229
+ "babel-preset-solid": "^1.9.3",
230
230
  "jest": "^29.3.1",
231
231
  "lodash": "^4.17.21",
232
232
  "parcel": "^2.10.3",
@@ -236,10 +236,10 @@
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": "^4.5.1",
240
- "@depict-ai/types": "^5.5.1",
241
- "@depict-ai/utilishared": "^2.5.1",
242
- "solid-js": "^1.8.16"
239
+ "@depict-ai/plp-styling": "^4.6.0",
240
+ "@depict-ai/types": "^5.6.0",
241
+ "@depict-ai/utilishared": "^2.6.0",
242
+ "solid-js": "^1.9.3"
243
243
  },
244
244
  "type": "module",
245
245
  "types": "ES10/index.d.ts",