@depict-ai/ui 4.7.31 → 4.7.32

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
@@ -111,7 +111,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
111
111
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
112
112
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
113
113
  /*! Depict.ai search and product listing SDK */
114
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.31";
114
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.32";
115
115
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
116
116
  const signal = $52FdA$solidjs.createSignal(false);
117
117
  $52FdA$solidjs.onCleanup($52FdA$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -485,19 +485,22 @@ function $f8f375d6245ffff2$var$wrap_blocks_in_div(rendered_content_blocks, max_s
485
485
  }
486
486
  }));
487
487
  $52FdA$solidjsweb.effect(_p$ => {
488
- var _v$ = {
488
+ var _v$ = !!(final_span_columns() === max_span_columns()),
489
+ _v$2 = {
489
490
  [(0, $830518481649feb1$export$c500183c31c2b22e)]: final_span_columns()
490
491
  },
491
- _v$2 = "span ".concat(final_span_columns()),
492
- _v$3 = "span ".concat(final_span_rows());
493
- _p$.e = $52FdA$solidjsweb.style(_el$, _v$, _p$.e);
494
- _v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$.style.setProperty("grid-column", _v$2) : _el$.style.removeProperty("grid-column"));
495
- _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$.style.setProperty("grid-row", _v$3) : _el$.style.removeProperty("grid-row"));
492
+ _v$3 = "span ".concat(final_span_columns()),
493
+ _v$4 = "span ".concat(final_span_rows());
494
+ _v$ !== _p$.e && _el$.classList.toggle("spans-whole-row", _p$.e = _v$);
495
+ _p$.t = $52FdA$solidjsweb.style(_el$, _v$2, _p$.t);
496
+ _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$.style.setProperty("grid-column", _v$3) : _el$.style.removeProperty("grid-column"));
497
+ _v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$.style.setProperty("grid-row", _v$4) : _el$.style.removeProperty("grid-row"));
496
498
  return _p$;
497
499
  }, {
498
500
  e: undefined,
499
501
  t: undefined,
500
- a: undefined
502
+ a: undefined,
503
+ o: undefined
501
504
  });
502
505
  return _el$;
503
506
  }
@@ -11137,7 +11140,8 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
11137
11140
  // Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
11138
11141
  local_filter_cache: [],
11139
11142
  expanded_hierarchical_filters: [],
11140
- scroll_restoration_data: []
11143
+ scroll_restoration_data: [],
11144
+ history_content_blocks: []
11141
11145
  }),
11142
11146
  router_: $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_router),
11143
11147
  prefix_: "category" + unique_instance_key_for_state + "_"
@@ -15925,71 +15929,99 @@ function $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el, listing_id, i18n_) {
15925
15929
  $52FdA$solidjs.onCleanup(disconnect);
15926
15930
  }
15927
15931
  $52FdA$solidjsweb.delegateEvents(["click"]);
15928
- var $c19709057a32b2e7$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<a><img>`),
15929
- $c19709057a32b2e7$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<a><video loop>`);
15932
+ var $c19709057a32b2e7$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<a class=d-standard-content-wrapper><video loop class=d-standard-content>`);
15930
15933
  function $c19709057a32b2e7$export$780a853d15174484(_ref) {
15931
15934
  let {
15932
- contentBlock: contentBlock,
15935
+ contentBlock_: {
15936
+ content: {
15937
+ link: link,
15938
+ type: type,
15939
+ url: mediaUrl
15940
+ }
15941
+ },
15933
15942
  router_: router_
15934
15943
  } = _ref;
15935
- if (contentBlock.content.type === "image") return () => (() => {
15936
- var _el$ = $52FdA$solidjsweb.getNextElement($c19709057a32b2e7$var$_tmpl$),
15937
- _el$2 = _el$.firstChild;
15938
- $52FdA$solidjsweb.addEventListener(_el$, "click", $52FdA$depictaiutilisharedlatest.catchify(ev => router_.navigate_.go_to_({
15939
- new_url_: contentBlock.content.link,
15940
- is_replace_: false,
15941
- event_: ev
15942
- })), true);
15943
- _el$2.style.setProperty("width", "100%");
15944
- _el$2.style.setProperty("height", "100%");
15945
- _el$2.style.setProperty("object-fit", "cover");
15946
- _el$2.style.setProperty("position", "absolute");
15947
- _el$2.style.setProperty("inset", "0");
15948
- $52FdA$solidjsweb.effect(_p$ => {
15949
- var _v$ = contentBlock.content.link,
15950
- _v$2 = contentBlock.content.url;
15951
- _v$ !== _p$.e && $52FdA$solidjsweb.setAttribute(_el$, "href", _p$.e = _v$);
15952
- _v$2 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$2, "src", _p$.t = _v$2);
15953
- return _p$;
15954
- }, {
15955
- e: undefined,
15956
- t: undefined
15957
- });
15958
- $52FdA$solidjsweb.runHydrationEvents();
15959
- return _el$;
15960
- })();
15961
- if (contentBlock.content.type === "video") return () => (() => {
15962
- var _el$3 = $52FdA$solidjsweb.getNextElement($c19709057a32b2e7$var$_tmpl$2),
15963
- _el$4 = _el$3.firstChild;
15964
- $52FdA$solidjsweb.addEventListener(_el$3, "click", $52FdA$depictaiutilisharedlatest.catchify(ev => router_.navigate_.go_to_({
15965
- new_url_: contentBlock.content.link,
15966
- is_replace_: false,
15967
- event_: ev
15968
- })), true);
15969
- $52FdA$solidjsweb.setProperty(_el$4, "controls", false);
15970
- $52FdA$solidjsweb.setProperty(_el$4, "muted", true);
15971
- $52FdA$solidjsweb.setProperty(_el$4, "autoplay", true);
15972
- $52FdA$solidjsweb.setProperty(_el$4, "playsinline", true);
15973
- _el$4.style.setProperty("width", "100%");
15974
- _el$4.style.setProperty("height", "100%");
15975
- _el$4.style.setProperty("object-fit", "cover");
15976
- _el$4.style.setProperty("position", "absolute");
15977
- _el$4.style.setProperty("inset", "0");
15978
- $52FdA$solidjsweb.effect(_p$ => {
15979
- var _v$3 = contentBlock.content.link,
15980
- _v$4 = contentBlock.content.url;
15981
- _v$3 !== _p$.e && $52FdA$solidjsweb.setAttribute(_el$3, "href", _p$.e = _v$3);
15982
- _v$4 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$4, "src", _p$.t = _v$4);
15983
- return _p$;
15944
+ if (type === "image") {
15945
+ const [wrapperSize, setWrapperSize] = $52FdA$solidjs.createSignal();
15946
+ return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjsweb.Dynamic), $52FdA$solidjsweb.mergeProps({
15947
+ component: link ? "a" : "div",
15948
+ "class": "d-standard-content-wrapper",
15949
+ ref: el => setWrapperSize(() => $858fdcf73148519f$export$e6fffe67d4cdd848(el)),
15950
+ get onClick() {
15951
+ return $52FdA$depictaiutilisharedlatest.catchify(ev => link && router_.navigate_.go_to_({
15952
+ new_url_: link,
15953
+ is_replace_: false,
15954
+ event_: ev
15955
+ }));
15956
+ }
15957
+ }, link && {
15958
+ href: link
15984
15959
  }, {
15985
- e: undefined,
15986
- t: undefined
15987
- });
15988
- $52FdA$solidjsweb.runHydrationEvents();
15989
- return _el$3;
15990
- })();
15960
+ get children() {
15961
+ return $52FdA$solidjsweb.createComponent((0, $858fdcf73148519f$export$6e5611bc7e57e477), {
15962
+ get size() {
15963
+ return $52FdA$solidjs.createMemo(() => {
15964
+ var _wrapperSize;
15965
+ return ((_wrapperSize = wrapperSize()) === null || _wrapperSize === void 0 ? void 0 : _wrapperSize()) || 0;
15966
+ });
15967
+ },
15968
+ src: mediaUrl,
15969
+ "class": "d-standard-content"
15970
+ });
15971
+ }
15972
+ }));
15973
+ }
15974
+ if (type === "video") {
15975
+ const pageVisible = $e7a7d2fe8a8217d8$export$54299a3c81f5425();
15976
+ return (() => {
15977
+ var _el$ = $52FdA$solidjsweb.getNextElement($c19709057a32b2e7$var$_tmpl$),
15978
+ _el$2 = _el$.firstChild;
15979
+ $52FdA$solidjsweb.addEventListener(_el$, "click", $52FdA$depictaiutilisharedlatest.catchify(ev => router_.navigate_.go_to_({
15980
+ new_url_: link,
15981
+ is_replace_: false,
15982
+ event_: ev
15983
+ })), true);
15984
+ $52FdA$solidjsweb.setAttribute(_el$, "href", link);
15985
+ $52FdA$solidjsweb.use(element => $52FdA$solidjs.createEffect(() => {
15986
+ if (pageVisible()) element.play().catch(e => $52FdA$depictaiutilishared.dlog("Failed to play", e));else element.pause();
15987
+ }), _el$2);
15988
+ $52FdA$solidjsweb.setAttribute(_el$2, "src", mediaUrl);
15989
+ $52FdA$solidjsweb.setProperty(_el$2, "controls", false);
15990
+ $52FdA$solidjsweb.setProperty(_el$2, "muted", true);
15991
+ $52FdA$solidjsweb.setProperty(_el$2, "autoplay", true);
15992
+ $52FdA$solidjsweb.setProperty(_el$2, "playsinline", true);
15993
+ $52FdA$solidjsweb.runHydrationEvents();
15994
+ return _el$;
15995
+ })();
15996
+ }
15991
15997
  }
15992
15998
  $52FdA$solidjsweb.delegateEvents(["click"]);
15999
+ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
16000
+ const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
16001
+ $52FdA$solidjs.createEffect(() => {
16002
+ var _plp_meta;
16003
+ const serverContentBlock = (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
16004
+ if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
16005
+ });
16006
+ const contentBlocksByRow = $52FdA$solidjs.createMemo(() => {
16007
+ if (content_blocks_by_row_()) return content_blocks_by_row_();
16008
+ const content = [];
16009
+ historyContentBlocks().forEach(row => {
16010
+ const contentBlock = {
16011
+ span_columns: row.span_columns,
16012
+ span_rows: row.span_rows,
16013
+ position: row.position,
16014
+ content: () => $52FdA$solidjsweb.createComponent((0, $c19709057a32b2e7$export$780a853d15174484), {
16015
+ contentBlock_: row,
16016
+ router_: router_
16017
+ })
16018
+ };
16019
+ content[row.row] = contentBlock;
16020
+ });
16021
+ return content;
16022
+ });
16023
+ return contentBlocksByRow;
16024
+ }
15993
16025
  var $ede6c70ecdca46fe$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=product-count><!$><!/> <!$><!/>`),
15994
16026
  $ede6c70ecdca46fe$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div>`),
15995
16027
  $ede6c70ecdca46fe$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
@@ -16018,6 +16050,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16018
16050
  show_breadcrumbs_: show_breadcrumbs_,
16019
16051
  layout_options_: layout_options_,
16020
16052
  scroll_restoration_data_: scroll_restoration_data_,
16053
+ history_content_blocks_: history_content_blocks_,
16021
16054
  product_card_template_: product_card_template_,
16022
16055
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
16023
16056
  sorting_query_param_: sorting_query_param_,
@@ -16086,24 +16119,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16086
16119
  }));
16087
16120
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
16088
16121
  const [plp_meta] = $52FdA$solidjs.createResource(meta_query_base, $52FdA$depictaiutilisharedlatest.catchify(query => depict_api_.get_listing(query)));
16089
- const contentBlocksByRow = $52FdA$solidjs.createMemo(() => {
16090
- var _plp_meta, _plp_meta$content_blo;
16091
- if (content_blocks_by_row_()) return content_blocks_by_row_();
16092
- const content = [];
16093
- (_plp_meta = plp_meta()) === null || _plp_meta === void 0 || (_plp_meta$content_blo = _plp_meta.content_blocks) === null || _plp_meta$content_blo === void 0 || _plp_meta$content_blo.forEach(row => {
16094
- const contentBlock = {
16095
- span_columns: row.span_columns,
16096
- span_rows: row.span_rows,
16097
- position: row.position,
16098
- content: $c19709057a32b2e7$export$780a853d15174484({
16099
- contentBlock: row,
16100
- router_: router_
16101
- })
16102
- };
16103
- content[row.row] = contentBlock;
16104
- });
16105
- return content;
16106
- });
16122
+ const contentBlocksByRow = $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
16107
16123
  const available_sortings_ = $52FdA$solidjs.createMemo(() => {
16108
16124
  var _plp_products_, _plp_products_$sorts;
16109
16125
  return (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : (_plp_products_$sorts = _plp_products_.sorts) === null || _plp_products_$sorts === void 0 ? void 0 : _plp_products_$sorts.map(sort => {
@@ -16119,13 +16135,13 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16119
16135
  return (_plp_products_2 = plp_products_()) === null || _plp_products_2 === void 0 ? void 0 : _plp_products_2.filters;
16120
16136
  });
16121
16137
  const title = $52FdA$solidjs.createMemo(() => {
16122
- var _plp_meta2;
16123
- return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.title;
16138
+ var _plp_meta;
16139
+ return (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.title;
16124
16140
  });
16125
16141
  const crumb_data_ = $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta);
16126
16142
  const quicklinks_data_ = $52FdA$solidjs.createMemo(() => {
16127
- var _plp_meta3;
16128
- return (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.quick_links;
16143
+ var _plp_meta2;
16144
+ return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
16129
16145
  });
16130
16146
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $52FdA$solidjs.createSignal(false);
16131
16147
  const [desktop_filter_elements_, set_desktop_filter_elements] = $52FdA$solidjs.createSignal();
@@ -16437,8 +16453,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16437
16453
  function $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta) {
16438
16454
  const href_accessor = $52FdA$depictaiutilisharedlatest.use_href_accessor();
16439
16455
  return $52FdA$solidjs.createMemo(() => {
16440
- var _plp_meta4;
16441
- const api_value = (_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.breadcrumbs;
16456
+ var _plp_meta3;
16457
+ const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
16442
16458
  if (!api_value) return api_value;
16443
16459
  return [...api_value, $52FdA$solidjs.mergeProps(plp_meta(), {
16444
16460
  get page_url() {
@@ -16488,7 +16504,8 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
16488
16504
  sorting_open: category_sorting_open_,
16489
16505
  expanded_filters: expanded_filters_,
16490
16506
  expanded_hierarchical_filters: expanded_hierarchical_filters_,
16491
- scroll_restoration_data: scroll_restoration_data_
16507
+ scroll_restoration_data: scroll_restoration_data_,
16508
+ history_content_blocks: history_content_blocks_
16492
16509
  } = depict_category.historyStateSignals_;
16493
16510
  const {
16494
16511
  current_sorting_: current_sorting_,
@@ -16540,6 +16557,7 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
16540
16557
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
16541
16558
  content_blocks_by_row_: () => props.content_blocks_by_row,
16542
16559
  scroll_restoration_data_: scroll_restoration_data_,
16560
+ history_content_blocks_: history_content_blocks_,
16543
16561
  layout_options_: $52FdA$solidjs.createMemo(() => ({
16544
16562
  cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
16545
16563
  ...grid_spacing_override(),
package/ES10/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { report, Amazing_Slider, Display, useExpandingContainer, ColsAtSize, Ele
3
3
  import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/SearchRequestV3";
4
4
  import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
5
5
  import { Ancestors, ListingSuggestion, SearchSuggestionsResponseV3 } from "@depict-ai/types/api/SearchSuggestionsResponseV3";
6
- import { ProductListing, GetListingResponse } from "@depict-ai/types/api/GetListingResponse";
6
+ import { ProductListing, GetListingResponse, ContentBlock as _ContentBlock1 } from "@depict-ai/types/api/GetListingResponse";
7
7
  import { ProductListingResponseV3, SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/ProductListingResponseV3";
8
8
  import { SearchSuggestionsRequestV3 } from "@depict-ai/types/api/SearchSuggestionsRequestV3";
9
9
  import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequestV3";
@@ -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.7.31";
14
+ export const version = "4.7.32";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -108,10 +108,10 @@ export function remap_blocks_to_index<T = () => JSX.Element | Promise<JSX.Elemen
108
108
  })[];
109
109
  n_cols_currently_showing_: number | null;
110
110
  }): {
111
- content_blocks_by_index_: JSX.Element[];
111
+ content_blocks_by_index_: (Awaited<T> | T[])[];
112
112
  readonly displaced_products_?: undefined;
113
113
  } | {
114
- readonly content_blocks_by_index_: JSX.Element[];
114
+ readonly content_blocks_by_index_: (Awaited<T> | T[])[];
115
115
  readonly displaced_products_: (number | (true | undefined)[])[];
116
116
  };
117
117
  /**
@@ -1334,6 +1334,7 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
1334
1334
  expanded_: boolean;
1335
1335
  }[]>;
1336
1336
  scroll_restoration_data: Signal<ScrollRestorationData>;
1337
+ history_content_blocks: Signal<_ContentBlock1[]>;
1337
1338
  };
1338
1339
  /**
1339
1340
  * Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
@@ -1484,7 +1485,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1484
1485
  * Open the modal with support for alignment.
1485
1486
  * @returns {void}
1486
1487
  */
1487
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1488
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1488
1489
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1489
1490
  export interface PageReplacer {
1490
1491
  readonly render_: () => Node_Array;
@@ -1563,5 +1564,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1563
1564
  content_blocks_by_row?: ContentBlocksByRow;
1564
1565
  layout?: PossibleLayout;
1565
1566
  filterModalParent_?: HTMLElement | ShadowRoot;
1566
- }): import("@depict-ai/utilishared").Node_Array;
1567
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1567
1568
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/ES10/index.js CHANGED
@@ -10,7 +10,7 @@ import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.31";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.32";
14
14
  function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
15
15
  const signal = $8tj43$createSignal(false);
16
16
  $8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
@@ -384,19 +384,22 @@ function $ff7feae4dddd6073$var$wrap_blocks_in_div(rendered_content_blocks, max_s
384
384
  }
385
385
  }));
386
386
  $8tj43$effect(_p$ => {
387
- var _v$ = {
387
+ var _v$ = !!(final_span_columns() === max_span_columns()),
388
+ _v$2 = {
388
389
  [(0, $64d94dcaa058dc7b$export$c500183c31c2b22e)]: final_span_columns()
389
390
  },
390
- _v$2 = "span ".concat(final_span_columns()),
391
- _v$3 = "span ".concat(final_span_rows());
392
- _p$.e = $8tj43$style(_el$, _v$, _p$.e);
393
- _v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$.style.setProperty("grid-column", _v$2) : _el$.style.removeProperty("grid-column"));
394
- _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$.style.setProperty("grid-row", _v$3) : _el$.style.removeProperty("grid-row"));
391
+ _v$3 = "span ".concat(final_span_columns()),
392
+ _v$4 = "span ".concat(final_span_rows());
393
+ _v$ !== _p$.e && _el$.classList.toggle("spans-whole-row", _p$.e = _v$);
394
+ _p$.t = $8tj43$style(_el$, _v$2, _p$.t);
395
+ _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$.style.setProperty("grid-column", _v$3) : _el$.style.removeProperty("grid-column"));
396
+ _v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$.style.setProperty("grid-row", _v$4) : _el$.style.removeProperty("grid-row"));
395
397
  return _p$;
396
398
  }, {
397
399
  e: undefined,
398
400
  t: undefined,
399
- a: undefined
401
+ a: undefined,
402
+ o: undefined
400
403
  });
401
404
  return _el$;
402
405
  }
@@ -11036,7 +11039,8 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
11036
11039
  // Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
11037
11040
  local_filter_cache: [],
11038
11041
  expanded_hierarchical_filters: [],
11039
- scroll_restoration_data: []
11042
+ scroll_restoration_data: [],
11043
+ history_content_blocks: []
11040
11044
  }),
11041
11045
  router_: $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_router),
11042
11046
  prefix_: "category" + unique_instance_key_for_state + "_"
@@ -15824,71 +15828,99 @@ function $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id, i18n_) {
15824
15828
  $8tj43$onCleanup(disconnect);
15825
15829
  }
15826
15830
  $8tj43$delegateEvents(["click"]);
15827
- var $3b772ef9a35560fe$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<a><img>`),
15828
- $3b772ef9a35560fe$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<a><video loop>`);
15831
+ var $3b772ef9a35560fe$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<a class=d-standard-content-wrapper><video loop class=d-standard-content>`);
15829
15832
  function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
15830
15833
  let {
15831
- contentBlock: contentBlock,
15834
+ contentBlock_: {
15835
+ content: {
15836
+ link: link,
15837
+ type: type,
15838
+ url: mediaUrl
15839
+ }
15840
+ },
15832
15841
  router_: router_
15833
15842
  } = _ref;
15834
- if (contentBlock.content.type === "image") return () => (() => {
15835
- var _el$ = $8tj43$getNextElement($3b772ef9a35560fe$var$_tmpl$),
15836
- _el$2 = _el$.firstChild;
15837
- $8tj43$addEventListener(_el$, "click", $8tj43$catchify(ev => router_.navigate_.go_to_({
15838
- new_url_: contentBlock.content.link,
15839
- is_replace_: false,
15840
- event_: ev
15841
- })), true);
15842
- _el$2.style.setProperty("width", "100%");
15843
- _el$2.style.setProperty("height", "100%");
15844
- _el$2.style.setProperty("object-fit", "cover");
15845
- _el$2.style.setProperty("position", "absolute");
15846
- _el$2.style.setProperty("inset", "0");
15847
- $8tj43$effect(_p$ => {
15848
- var _v$ = contentBlock.content.link,
15849
- _v$2 = contentBlock.content.url;
15850
- _v$ !== _p$.e && $8tj43$setAttribute(_el$, "href", _p$.e = _v$);
15851
- _v$2 !== _p$.t && $8tj43$setAttribute(_el$2, "src", _p$.t = _v$2);
15852
- return _p$;
15853
- }, {
15854
- e: undefined,
15855
- t: undefined
15856
- });
15857
- $8tj43$runHydrationEvents();
15858
- return _el$;
15859
- })();
15860
- if (contentBlock.content.type === "video") return () => (() => {
15861
- var _el$3 = $8tj43$getNextElement($3b772ef9a35560fe$var$_tmpl$2),
15862
- _el$4 = _el$3.firstChild;
15863
- $8tj43$addEventListener(_el$3, "click", $8tj43$catchify(ev => router_.navigate_.go_to_({
15864
- new_url_: contentBlock.content.link,
15865
- is_replace_: false,
15866
- event_: ev
15867
- })), true);
15868
- $8tj43$setProperty(_el$4, "controls", false);
15869
- $8tj43$setProperty(_el$4, "muted", true);
15870
- $8tj43$setProperty(_el$4, "autoplay", true);
15871
- $8tj43$setProperty(_el$4, "playsinline", true);
15872
- _el$4.style.setProperty("width", "100%");
15873
- _el$4.style.setProperty("height", "100%");
15874
- _el$4.style.setProperty("object-fit", "cover");
15875
- _el$4.style.setProperty("position", "absolute");
15876
- _el$4.style.setProperty("inset", "0");
15877
- $8tj43$effect(_p$ => {
15878
- var _v$3 = contentBlock.content.link,
15879
- _v$4 = contentBlock.content.url;
15880
- _v$3 !== _p$.e && $8tj43$setAttribute(_el$3, "href", _p$.e = _v$3);
15881
- _v$4 !== _p$.t && $8tj43$setAttribute(_el$4, "src", _p$.t = _v$4);
15882
- return _p$;
15843
+ if (type === "image") {
15844
+ const [wrapperSize, setWrapperSize] = $8tj43$createSignal();
15845
+ return $8tj43$createComponent((0, $8tj43$Dynamic), $8tj43$mergeProps1({
15846
+ component: link ? "a" : "div",
15847
+ "class": "d-standard-content-wrapper",
15848
+ ref: el => setWrapperSize(() => $56047603f9d212b6$export$e6fffe67d4cdd848(el)),
15849
+ get onClick() {
15850
+ return $8tj43$catchify(ev => link && router_.navigate_.go_to_({
15851
+ new_url_: link,
15852
+ is_replace_: false,
15853
+ event_: ev
15854
+ }));
15855
+ }
15856
+ }, link && {
15857
+ href: link
15883
15858
  }, {
15884
- e: undefined,
15885
- t: undefined
15886
- });
15887
- $8tj43$runHydrationEvents();
15888
- return _el$3;
15889
- })();
15859
+ get children() {
15860
+ return $8tj43$createComponent((0, $56047603f9d212b6$export$6e5611bc7e57e477), {
15861
+ get size() {
15862
+ return $8tj43$createMemo(() => {
15863
+ var _wrapperSize;
15864
+ return ((_wrapperSize = wrapperSize()) === null || _wrapperSize === void 0 ? void 0 : _wrapperSize()) || 0;
15865
+ });
15866
+ },
15867
+ src: mediaUrl,
15868
+ "class": "d-standard-content"
15869
+ });
15870
+ }
15871
+ }));
15872
+ }
15873
+ if (type === "video") {
15874
+ const pageVisible = $a35e6f680c5bbc60$export$54299a3c81f5425();
15875
+ return (() => {
15876
+ var _el$ = $8tj43$getNextElement($3b772ef9a35560fe$var$_tmpl$),
15877
+ _el$2 = _el$.firstChild;
15878
+ $8tj43$addEventListener(_el$, "click", $8tj43$catchify(ev => router_.navigate_.go_to_({
15879
+ new_url_: link,
15880
+ is_replace_: false,
15881
+ event_: ev
15882
+ })), true);
15883
+ $8tj43$setAttribute(_el$, "href", link);
15884
+ $8tj43$use(element => $8tj43$createEffect(() => {
15885
+ if (pageVisible()) element.play().catch(e => $8tj43$dlog1("Failed to play", e));else element.pause();
15886
+ }), _el$2);
15887
+ $8tj43$setAttribute(_el$2, "src", mediaUrl);
15888
+ $8tj43$setProperty(_el$2, "controls", false);
15889
+ $8tj43$setProperty(_el$2, "muted", true);
15890
+ $8tj43$setProperty(_el$2, "autoplay", true);
15891
+ $8tj43$setProperty(_el$2, "playsinline", true);
15892
+ $8tj43$runHydrationEvents();
15893
+ return _el$;
15894
+ })();
15895
+ }
15890
15896
  }
15891
15897
  $8tj43$delegateEvents(["click"]);
15898
+ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
15899
+ const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
15900
+ $8tj43$createEffect(() => {
15901
+ var _plp_meta;
15902
+ const serverContentBlock = (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
15903
+ if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
15904
+ });
15905
+ const contentBlocksByRow = $8tj43$createMemo(() => {
15906
+ if (content_blocks_by_row_()) return content_blocks_by_row_();
15907
+ const content = [];
15908
+ historyContentBlocks().forEach(row => {
15909
+ const contentBlock = {
15910
+ span_columns: row.span_columns,
15911
+ span_rows: row.span_rows,
15912
+ position: row.position,
15913
+ content: () => $8tj43$createComponent((0, $3b772ef9a35560fe$export$780a853d15174484), {
15914
+ contentBlock_: row,
15915
+ router_: router_
15916
+ })
15917
+ };
15918
+ content[row.row] = contentBlock;
15919
+ });
15920
+ return content;
15921
+ });
15922
+ return contentBlocksByRow;
15923
+ }
15892
15924
  var $4b4b262708b516ee$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=product-count><!$><!/> <!$><!/>`),
15893
15925
  $4b4b262708b516ee$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div>`),
15894
15926
  $4b4b262708b516ee$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
@@ -15917,6 +15949,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
15917
15949
  show_breadcrumbs_: show_breadcrumbs_,
15918
15950
  layout_options_: layout_options_,
15919
15951
  scroll_restoration_data_: scroll_restoration_data_,
15952
+ history_content_blocks_: history_content_blocks_,
15920
15953
  product_card_template_: product_card_template_,
15921
15954
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
15922
15955
  sorting_query_param_: sorting_query_param_,
@@ -15985,24 +16018,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
15985
16018
  }));
15986
16019
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
15987
16020
  const [plp_meta] = $8tj43$createResource(meta_query_base, $8tj43$catchify(query => depict_api_.get_listing(query)));
15988
- const contentBlocksByRow = $8tj43$createMemo(() => {
15989
- var _plp_meta, _plp_meta$content_blo;
15990
- if (content_blocks_by_row_()) return content_blocks_by_row_();
15991
- const content = [];
15992
- (_plp_meta = plp_meta()) === null || _plp_meta === void 0 || (_plp_meta$content_blo = _plp_meta.content_blocks) === null || _plp_meta$content_blo === void 0 || _plp_meta$content_blo.forEach(row => {
15993
- const contentBlock = {
15994
- span_columns: row.span_columns,
15995
- span_rows: row.span_rows,
15996
- position: row.position,
15997
- content: $3b772ef9a35560fe$export$780a853d15174484({
15998
- contentBlock: row,
15999
- router_: router_
16000
- })
16001
- };
16002
- content[row.row] = contentBlock;
16003
- });
16004
- return content;
16005
- });
16021
+ const contentBlocksByRow = $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
16006
16022
  const available_sortings_ = $8tj43$createMemo(() => {
16007
16023
  var _plp_products_, _plp_products_$sorts;
16008
16024
  return (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : (_plp_products_$sorts = _plp_products_.sorts) === null || _plp_products_$sorts === void 0 ? void 0 : _plp_products_$sorts.map(sort => {
@@ -16018,13 +16034,13 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
16018
16034
  return (_plp_products_2 = plp_products_()) === null || _plp_products_2 === void 0 ? void 0 : _plp_products_2.filters;
16019
16035
  });
16020
16036
  const title = $8tj43$createMemo(() => {
16021
- var _plp_meta2;
16022
- return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.title;
16037
+ var _plp_meta;
16038
+ return (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.title;
16023
16039
  });
16024
16040
  const crumb_data_ = $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta);
16025
16041
  const quicklinks_data_ = $8tj43$createMemo(() => {
16026
- var _plp_meta3;
16027
- return (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.quick_links;
16042
+ var _plp_meta2;
16043
+ return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
16028
16044
  });
16029
16045
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $8tj43$createSignal(false);
16030
16046
  const [desktop_filter_elements_, set_desktop_filter_elements] = $8tj43$createSignal();
@@ -16336,8 +16352,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
16336
16352
  function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta) {
16337
16353
  const href_accessor = $8tj43$use_href_accessor1();
16338
16354
  return $8tj43$createMemo(() => {
16339
- var _plp_meta4;
16340
- const api_value = (_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.breadcrumbs;
16355
+ var _plp_meta3;
16356
+ const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
16341
16357
  if (!api_value) return api_value;
16342
16358
  return [...api_value, $8tj43$mergeProps(plp_meta(), {
16343
16359
  get page_url() {
@@ -16387,7 +16403,8 @@ function $8821a19349c36651$export$e2bf8ce7779e827e(props) {
16387
16403
  sorting_open: category_sorting_open_,
16388
16404
  expanded_filters: expanded_filters_,
16389
16405
  expanded_hierarchical_filters: expanded_hierarchical_filters_,
16390
- scroll_restoration_data: scroll_restoration_data_
16406
+ scroll_restoration_data: scroll_restoration_data_,
16407
+ history_content_blocks: history_content_blocks_
16391
16408
  } = depict_category.historyStateSignals_;
16392
16409
  const {
16393
16410
  current_sorting_: current_sorting_,
@@ -16439,6 +16456,7 @@ function $8821a19349c36651$export$e2bf8ce7779e827e(props) {
16439
16456
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
16440
16457
  content_blocks_by_row_: () => props.content_blocks_by_row,
16441
16458
  scroll_restoration_data_: scroll_restoration_data_,
16459
+ history_content_blocks_: history_content_blocks_,
16442
16460
  layout_options_: $8tj43$createMemo(() => ({
16443
16461
  cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
16444
16462
  ...grid_spacing_override(),