@depict-ai/ui 4.7.31 → 4.7.33

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
@@ -18,6 +18,8 @@ function $parcel$export(e, n, v, s) {
18
18
  function $parcel$interopDefault(a) {
19
19
  return a && a.__esModule ? a.default : a;
20
20
  }
21
+ $parcel$export(module.exports, "setExtraDisplayTransformers", () => $cc9aacef898ccc9a$export$f98b8d5ea7207a1);
22
+ $parcel$export(module.exports, "getExtraDisplayTransformers", () => $cc9aacef898ccc9a$export$b2d94be4f02525b2);
21
23
  $parcel$export(module.exports, "remap_blocks_to_index", () => $f8f375d6245ffff2$export$92aa5d691d588f3f);
22
24
  $parcel$export(module.exports, "useMobileHover", () => $0deb6ff75e3d67c6$export$d4d96868197be50e);
23
25
  $parcel$export(module.exports, "useVisibilityState", () => $e7a7d2fe8a8217d8$export$54299a3c81f5425);
@@ -111,7 +113,14 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
111
113
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
112
114
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
113
115
  /*! Depict.ai search and product listing SDK */
114
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.31";
116
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.33";
117
+
118
+ // Value first so shopify merchants can set (extra) display transformers in the shopify app
119
+ // Calling these functions normally doesn't do anything, but our shopify app respects them
120
+ // Them being here is value first too because this can be easily imported in the product card editor
121
+ let $cc9aacef898ccc9a$var$extraDisplayTransformers;
122
+ const $cc9aacef898ccc9a$export$b2d94be4f02525b2 = () => $cc9aacef898ccc9a$var$extraDisplayTransformers;
123
+ const $cc9aacef898ccc9a$export$f98b8d5ea7207a1 = displayTransformers => $cc9aacef898ccc9a$var$extraDisplayTransformers = displayTransformers;
115
124
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
116
125
  const signal = $52FdA$solidjs.createSignal(false);
117
126
  $52FdA$solidjs.onCleanup($52FdA$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -485,19 +494,22 @@ function $f8f375d6245ffff2$var$wrap_blocks_in_div(rendered_content_blocks, max_s
485
494
  }
486
495
  }));
487
496
  $52FdA$solidjsweb.effect(_p$ => {
488
- var _v$ = {
497
+ var _v$ = !!(final_span_columns() === max_span_columns()),
498
+ _v$2 = {
489
499
  [(0, $830518481649feb1$export$c500183c31c2b22e)]: final_span_columns()
490
500
  },
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"));
501
+ _v$3 = "span ".concat(final_span_columns()),
502
+ _v$4 = "span ".concat(final_span_rows());
503
+ _v$ !== _p$.e && _el$.classList.toggle("spans-whole-row", _p$.e = _v$);
504
+ _p$.t = $52FdA$solidjsweb.style(_el$, _v$2, _p$.t);
505
+ _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$.style.setProperty("grid-column", _v$3) : _el$.style.removeProperty("grid-column"));
506
+ _v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$.style.setProperty("grid-row", _v$4) : _el$.style.removeProperty("grid-row"));
496
507
  return _p$;
497
508
  }, {
498
509
  e: undefined,
499
510
  t: undefined,
500
- a: undefined
511
+ a: undefined,
512
+ o: undefined
501
513
  });
502
514
  return _el$;
503
515
  }
@@ -1845,25 +1857,30 @@ function $28535bb7671c63d1$export$e4b984597b71e989(props) {
1845
1857
  })));
1846
1858
  return container;
1847
1859
  }
1860
+ const $f3db423dc84bc35d$var$customUrls = (url, width) => {
1861
+ var _url$startsWith;
1862
+ if (url !== null && url !== void 0 && (_url$startsWith = url.startsWith) !== null && _url$startsWith !== void 0 && _url$startsWith.call(url, "https://cdn.shopify.com"))
1863
+ // The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
1864
+ // but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
1865
+ return $858fdcf73148519f$export$1d6267828870adda(url, width);
1866
+ // Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
1867
+ return "https://app.depict.ai/cdn-cgi/image/width=".concat(width, ",format=auto/").concat(url);
1868
+ };
1848
1869
  function $f3db423dc84bc35d$export$9d4a4b669b1929ab(props) {
1849
1870
  return $52FdA$solidjsweb.createComponent((0, $28535bb7671c63d1$export$e4b984597b71e989), $52FdA$solidjsweb.mergeProps(props, {
1850
1871
  get imgProps() {
1851
1872
  return {
1852
1873
  ...props.imgProps,
1853
- customUrls: (url, width // Apparently don't have to encode url for CF's service
1854
- ) => {
1855
- var _url$startsWith;
1856
- if (url !== null && url !== void 0 && (_url$startsWith = url.startsWith) !== null && _url$startsWith !== void 0 && _url$startsWith.call(url, "https://cdn.shopify.com"))
1857
- // The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
1858
- // but it seems like the URLs returned by the Depict API always goes to the cdn.shopify.com version of an image, so this simple workaround works.
1859
- return $858fdcf73148519f$export$1d6267828870adda(url, width);
1860
- // Use cloudflare image resizer instead of img.depict.ai because it's a lot faster (and also auto-chooses other formats if webp is not supported)
1861
- return "https://app.depict.ai/cdn-cgi/image/width=".concat(width, ",format=auto/").concat(url);
1862
- }
1874
+ customUrls: $f3db423dc84bc35d$var$customUrls
1863
1875
  };
1864
1876
  }
1865
1877
  }));
1866
1878
  }
1879
+ function $f3db423dc84bc35d$export$140423fa4bfb6d63(props) {
1880
+ return $52FdA$solidjsweb.createComponent((0, $858fdcf73148519f$export$6e5611bc7e57e477), $52FdA$solidjsweb.mergeProps(props, {
1881
+ customUrls: $f3db423dc84bc35d$var$customUrls
1882
+ }));
1883
+ }
1867
1884
  function $f38f2e64ebe2da86$export$a71e92cfbb498adc(props) {
1868
1885
  return $52FdA$solidjs.createMemo(() => {
1869
1886
  const price_formatting = props.price_formatting_;
@@ -11137,7 +11154,8 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
11137
11154
  // 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
11155
  local_filter_cache: [],
11139
11156
  expanded_hierarchical_filters: [],
11140
- scroll_restoration_data: []
11157
+ scroll_restoration_data: [],
11158
+ history_content_blocks: []
11141
11159
  }),
11142
11160
  router_: $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_router),
11143
11161
  prefix_: "category" + unique_instance_key_for_state + "_"
@@ -15925,71 +15943,99 @@ function $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el, listing_id, i18n_) {
15925
15943
  $52FdA$solidjs.onCleanup(disconnect);
15926
15944
  }
15927
15945
  $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>`);
15946
+ var $c19709057a32b2e7$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<a class=d-standard-content-wrapper><video loop class=d-standard-content>`);
15930
15947
  function $c19709057a32b2e7$export$780a853d15174484(_ref) {
15931
15948
  let {
15932
- contentBlock: contentBlock,
15949
+ contentBlock_: {
15950
+ content: {
15951
+ link: link,
15952
+ type: type,
15953
+ url: mediaUrl
15954
+ }
15955
+ },
15933
15956
  router_: router_
15934
15957
  } = _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$;
15958
+ if (type === "image") {
15959
+ const [wrapperSize, setWrapperSize] = $52FdA$solidjs.createSignal();
15960
+ return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjsweb.Dynamic), $52FdA$solidjsweb.mergeProps({
15961
+ component: link ? "a" : "div",
15962
+ "class": "d-standard-content-wrapper",
15963
+ ref: el => setWrapperSize(() => $858fdcf73148519f$export$e6fffe67d4cdd848(el)),
15964
+ get onClick() {
15965
+ return $52FdA$depictaiutilisharedlatest.catchify(ev => link && router_.navigate_.go_to_({
15966
+ new_url_: link,
15967
+ is_replace_: false,
15968
+ event_: ev
15969
+ }));
15970
+ }
15971
+ }, link && {
15972
+ href: link
15984
15973
  }, {
15985
- e: undefined,
15986
- t: undefined
15987
- });
15988
- $52FdA$solidjsweb.runHydrationEvents();
15989
- return _el$3;
15990
- })();
15974
+ get children() {
15975
+ return $52FdA$solidjsweb.createComponent((0, $f3db423dc84bc35d$export$140423fa4bfb6d63), {
15976
+ get size() {
15977
+ return $52FdA$solidjs.createMemo(() => {
15978
+ var _wrapperSize;
15979
+ return ((_wrapperSize = wrapperSize()) === null || _wrapperSize === void 0 ? void 0 : _wrapperSize()) || 0;
15980
+ });
15981
+ },
15982
+ src: mediaUrl,
15983
+ "class": "d-standard-content"
15984
+ });
15985
+ }
15986
+ }));
15987
+ }
15988
+ if (type === "video") {
15989
+ const pageVisible = $e7a7d2fe8a8217d8$export$54299a3c81f5425();
15990
+ return (() => {
15991
+ var _el$ = $52FdA$solidjsweb.getNextElement($c19709057a32b2e7$var$_tmpl$),
15992
+ _el$2 = _el$.firstChild;
15993
+ $52FdA$solidjsweb.addEventListener(_el$, "click", $52FdA$depictaiutilisharedlatest.catchify(ev => router_.navigate_.go_to_({
15994
+ new_url_: link,
15995
+ is_replace_: false,
15996
+ event_: ev
15997
+ })), true);
15998
+ $52FdA$solidjsweb.setAttribute(_el$, "href", link);
15999
+ $52FdA$solidjsweb.use(element => $52FdA$solidjs.createEffect(() => {
16000
+ if (pageVisible()) element.play().catch(e => $52FdA$depictaiutilishared.dlog("Failed to play", e));else element.pause();
16001
+ }), _el$2);
16002
+ $52FdA$solidjsweb.setAttribute(_el$2, "src", mediaUrl);
16003
+ $52FdA$solidjsweb.setProperty(_el$2, "controls", false);
16004
+ $52FdA$solidjsweb.setProperty(_el$2, "muted", true);
16005
+ $52FdA$solidjsweb.setProperty(_el$2, "autoplay", true);
16006
+ $52FdA$solidjsweb.setProperty(_el$2, "playsinline", true);
16007
+ $52FdA$solidjsweb.runHydrationEvents();
16008
+ return _el$;
16009
+ })();
16010
+ }
15991
16011
  }
15992
16012
  $52FdA$solidjsweb.delegateEvents(["click"]);
16013
+ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
16014
+ const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
16015
+ $52FdA$solidjs.createEffect(() => {
16016
+ var _plp_meta;
16017
+ const serverContentBlock = (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
16018
+ if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
16019
+ });
16020
+ const contentBlocksByRow = $52FdA$solidjs.createMemo(() => {
16021
+ if (content_blocks_by_row_()) return content_blocks_by_row_();
16022
+ const content = [];
16023
+ historyContentBlocks().forEach(row => {
16024
+ const contentBlock = {
16025
+ span_columns: row.span_columns,
16026
+ span_rows: row.span_rows,
16027
+ position: row.position,
16028
+ content: () => $52FdA$solidjsweb.createComponent((0, $c19709057a32b2e7$export$780a853d15174484), {
16029
+ contentBlock_: row,
16030
+ router_: router_
16031
+ })
16032
+ };
16033
+ content[row.row] = contentBlock;
16034
+ });
16035
+ return content;
16036
+ });
16037
+ return contentBlocksByRow;
16038
+ }
15993
16039
  var $ede6c70ecdca46fe$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=product-count><!$><!/> <!$><!/>`),
15994
16040
  $ede6c70ecdca46fe$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div>`),
15995
16041
  $ede6c70ecdca46fe$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
@@ -16018,6 +16064,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16018
16064
  show_breadcrumbs_: show_breadcrumbs_,
16019
16065
  layout_options_: layout_options_,
16020
16066
  scroll_restoration_data_: scroll_restoration_data_,
16067
+ history_content_blocks_: history_content_blocks_,
16021
16068
  product_card_template_: product_card_template_,
16022
16069
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
16023
16070
  sorting_query_param_: sorting_query_param_,
@@ -16086,24 +16133,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16086
16133
  }));
16087
16134
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
16088
16135
  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
- });
16136
+ const contentBlocksByRow = $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
16107
16137
  const available_sortings_ = $52FdA$solidjs.createMemo(() => {
16108
16138
  var _plp_products_, _plp_products_$sorts;
16109
16139
  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 +16149,13 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16119
16149
  return (_plp_products_2 = plp_products_()) === null || _plp_products_2 === void 0 ? void 0 : _plp_products_2.filters;
16120
16150
  });
16121
16151
  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;
16152
+ var _plp_meta;
16153
+ return (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.title;
16124
16154
  });
16125
16155
  const crumb_data_ = $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta);
16126
16156
  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;
16157
+ var _plp_meta2;
16158
+ return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
16129
16159
  });
16130
16160
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $52FdA$solidjs.createSignal(false);
16131
16161
  const [desktop_filter_elements_, set_desktop_filter_elements] = $52FdA$solidjs.createSignal();
@@ -16437,8 +16467,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
16437
16467
  function $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta) {
16438
16468
  const href_accessor = $52FdA$depictaiutilisharedlatest.use_href_accessor();
16439
16469
  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;
16470
+ var _plp_meta3;
16471
+ const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
16442
16472
  if (!api_value) return api_value;
16443
16473
  return [...api_value, $52FdA$solidjs.mergeProps(plp_meta(), {
16444
16474
  get page_url() {
@@ -16488,7 +16518,8 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
16488
16518
  sorting_open: category_sorting_open_,
16489
16519
  expanded_filters: expanded_filters_,
16490
16520
  expanded_hierarchical_filters: expanded_hierarchical_filters_,
16491
- scroll_restoration_data: scroll_restoration_data_
16521
+ scroll_restoration_data: scroll_restoration_data_,
16522
+ history_content_blocks: history_content_blocks_
16492
16523
  } = depict_category.historyStateSignals_;
16493
16524
  const {
16494
16525
  current_sorting_: current_sorting_,
@@ -16540,6 +16571,7 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
16540
16571
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
16541
16572
  content_blocks_by_row_: () => props.content_blocks_by_row,
16542
16573
  scroll_restoration_data_: scroll_restoration_data_,
16574
+ history_content_blocks_: history_content_blocks_,
16543
16575
  layout_options_: $52FdA$solidjs.createMemo(() => ({
16544
16576
  cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
16545
16577
  ...grid_spacing_override(),
package/ES10/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { JSX, Accessor, Setter, Signal } from "solid-js";
2
- import { report, Amazing_Slider, Display, useExpandingContainer, ColsAtSize, Elem, ModernDisplay, Node_Array } from "@depict-ai/utilishared/ES10";
3
- import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/SearchRequestV3";
1
+ import { Display, ModernDisplay, report, Amazing_Slider, useExpandingContainer, ColsAtSize, Elem, Node_Array } from "@depict-ai/utilishared/ES10";
4
2
  import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
5
3
  import { Ancestors, ListingSuggestion, SearchSuggestionsResponseV3 } from "@depict-ai/types/api/SearchSuggestionsResponseV3";
6
- import { ProductListing, GetListingResponse } from "@depict-ai/types/api/GetListingResponse";
4
+ import { ProductListing, GetListingResponse, ContentBlock as _ContentBlock1 } from "@depict-ai/types/api/GetListingResponse";
5
+ import { JSX, Accessor, Setter, Signal } from "solid-js";
6
+ import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/SearchRequestV3";
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,61 @@ 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.33";
15
+ type DisplayTransformerAlwaysThereData = {
16
+ merchant: string;
17
+ market: string;
18
+ locale: string;
19
+ };
20
+ type CanBePromiseWrapped<T> = T | Promise<T>;
21
+ export type ModernDisplayWithPageUrl<T extends ModernDisplay> = { [K in keyof T]: K extends "variant_displays" ? (T[K][number] & {
22
+ page_url: string;
23
+ })[] : T[K] };
24
+ /**
25
+ * A ProductListing with ancestors added in, this is what we pass to the display transformers as the ancestors might be required to construct the URL
26
+ */
27
+ type ProductListingWithAncestors = ProductListing & {
28
+ ancestors: Ancestors;
29
+ };
30
+ /**
31
+ * The displayTransformer for categories does not only get a list of ListingSuggestions, when a search query has listing suggestions, but also their ancestors since we show breadcrumbs for the listing suggestions. To let the user differentiate (since the suggestion ones can be added/removed but not the ancestors) we add a boolean is_suggestion to the listing suggestions passed to the displayTransformer.
32
+ */
33
+ type ListingSuggestionForTransformer = (ListingSuggestion & {
34
+ is_suggestion: true;
35
+ }) | (Omit<ListingSuggestion, "suggestions_result_id"> & {
36
+ is_suggestion: false;
37
+ });
38
+ /**
39
+ * DisplayTransformers supersede pageURLCreator
40
+ * DisplayTransformers are functions that take in a list of categories, content search results or products and then can transform or enrich the data for each category, content search result or product card in a batched way.
41
+ */
42
+ export type DisplayTransformers<InputDisplay extends ModernDisplay, OutputDisplay extends ModernDisplay | never> = {
43
+ products?: (options: DisplayTransformerAlwaysThereData & {
44
+ displays: InputDisplay[];
45
+ }) => CanBePromiseWrapped<OutputDisplay extends ModernDisplay ? ModernDisplayWithPageUrl<OutputDisplay>[] : never>;
46
+ categories?: <T extends ProductListingWithAncestors | ListingSuggestionForTransformer>(options: DisplayTransformerAlwaysThereData & {
47
+ data: T[];
48
+ }) => CanBePromiseWrapped<(T & {
49
+ page_url: string;
50
+ })[]>;
51
+ contentResults?: (options: DisplayTransformerAlwaysThereData & {
52
+ data: ContentLink[];
53
+ }) => CanBePromiseWrapped<ContentLink[]>;
54
+ };
55
+ export type SomethingTakingADisplayTransformers<InputDisplay extends Display, OutputDisplay extends ModernDisplay | never> = InputDisplay extends ModernDisplay ? "page_url" extends keyof InputDisplay["variant_displays"][number] ? {
56
+ display_transformers: DisplayTransformers<InputDisplay, OutputDisplay>;
57
+ } : {
58
+ display_transformers: DisplayTransformers<InputDisplay, OutputDisplay>;
59
+ } : {
60
+ page_url_creator?: never;
61
+ display_transformers?: never;
62
+ };
63
+ export const getExtraDisplayTransformers: () => DisplayTransformers<any, any> | undefined;
64
+ /**
65
+ *
66
+ * @param displayTransformers
67
+ */
68
+ export const setExtraDisplayTransformers: <InputDisplay extends ModernDisplay, OutputDisplay extends ModernDisplay = ModernDisplayWithPageUrl<InputDisplay>>(displayTransformers: DisplayTransformers<InputDisplay, OutputDisplay>) => DisplayTransformers<InputDisplay, OutputDisplay>;
15
69
  /**
16
70
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
71
  */
@@ -108,10 +162,10 @@ export function remap_blocks_to_index<T = () => JSX.Element | Promise<JSX.Elemen
108
162
  })[];
109
163
  n_cols_currently_showing_: number | null;
110
164
  }): {
111
- content_blocks_by_index_: JSX.Element[];
165
+ content_blocks_by_index_: (Awaited<T> | T[])[];
112
166
  readonly displaced_products_?: undefined;
113
167
  } | {
114
- readonly content_blocks_by_index_: JSX.Element[];
168
+ readonly content_blocks_by_index_: (Awaited<T> | T[])[];
115
169
  readonly displaced_products_: (number | (true | undefined)[])[];
116
170
  };
117
171
  /**
@@ -434,54 +488,6 @@ export function SolidFormatPrice(props: {
434
488
  places_after_comma_: number | "auto";
435
489
  };
436
490
  }): JSX.Element;
437
- type DisplayTransformerAlwaysThereData = {
438
- merchant: string;
439
- market: string;
440
- locale: string;
441
- };
442
- type CanBePromiseWrapped<T> = T | Promise<T>;
443
- export type ModernDisplayWithPageUrl<T extends ModernDisplay> = { [K in keyof T]: K extends "variant_displays" ? (T[K][number] & {
444
- page_url: string;
445
- })[] : T[K] };
446
- /**
447
- * A ProductListing with ancestors added in, this is what we pass to the display transformers as the ancestors might be required to construct the URL
448
- */
449
- type ProductListingWithAncestors = ProductListing & {
450
- ancestors: Ancestors;
451
- };
452
- /**
453
- * The displayTransformer for categories does not only get a list of ListingSuggestions, when a search query has listing suggestions, but also their ancestors since we show breadcrumbs for the listing suggestions. To let the user differentiate (since the suggestion ones can be added/removed but not the ancestors) we add a boolean is_suggestion to the listing suggestions passed to the displayTransformer.
454
- */
455
- type ListingSuggestionForTransformer = (ListingSuggestion & {
456
- is_suggestion: true;
457
- }) | (Omit<ListingSuggestion, "suggestions_result_id"> & {
458
- is_suggestion: false;
459
- });
460
- /**
461
- * DisplayTransformers supersede pageURLCreator
462
- * DisplayTransformers are functions that take in a list of categories, content search results or products and then can transform or enrich the data for each category, content search result or product card in a batched way.
463
- */
464
- export type DisplayTransformers<InputDisplay extends ModernDisplay, OutputDisplay extends ModernDisplay | never> = {
465
- products?: (options: DisplayTransformerAlwaysThereData & {
466
- displays: InputDisplay[];
467
- }) => CanBePromiseWrapped<OutputDisplay extends ModernDisplay ? ModernDisplayWithPageUrl<OutputDisplay>[] : never>;
468
- categories?: <T extends ProductListingWithAncestors | ListingSuggestionForTransformer>(options: DisplayTransformerAlwaysThereData & {
469
- data: T[];
470
- }) => CanBePromiseWrapped<(T & {
471
- page_url: string;
472
- })[]>;
473
- contentResults?: (options: DisplayTransformerAlwaysThereData & {
474
- data: ContentLink[];
475
- }) => CanBePromiseWrapped<ContentLink[]>;
476
- };
477
- export type SomethingTakingADisplayTransformers<InputDisplay extends Display, OutputDisplay extends ModernDisplay | never> = InputDisplay extends ModernDisplay ? "page_url" extends keyof InputDisplay["variant_displays"][number] ? {
478
- display_transformers: DisplayTransformers<InputDisplay, OutputDisplay>;
479
- } : {
480
- display_transformers: DisplayTransformers<InputDisplay, OutputDisplay>;
481
- } : {
482
- page_url_creator?: never;
483
- display_transformers?: never;
484
- };
485
491
  type ListingSuggestionAfterURLCreator = { [K in keyof ListingSuggestion]: K extends "ancestors" ? (ListingSuggestion & {
486
492
  page_url: string;
487
493
  })[] : ListingSuggestion[K] } & {
@@ -1334,6 +1340,7 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
1334
1340
  expanded_: boolean;
1335
1341
  }[]>;
1336
1342
  scroll_restoration_data: Signal<ScrollRestorationData>;
1343
+ history_content_blocks: Signal<_ContentBlock1[]>;
1337
1344
  };
1338
1345
  /**
1339
1346
  * 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 +1491,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1484
1491
  * Open the modal with support for alignment.
1485
1492
  * @returns {void}
1486
1493
  */
1487
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1494
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1488
1495
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1489
1496
  export interface PageReplacer {
1490
1497
  readonly render_: () => Node_Array;
@@ -1563,5 +1570,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1563
1570
  content_blocks_by_row?: ContentBlocksByRow;
1564
1571
  layout?: PossibleLayout;
1565
1572
  filterModalParent_?: HTMLElement | ShadowRoot;
1566
- }): import("@depict-ai/utilishared").Node_Array;
1573
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1567
1574
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";