@depict-ai/ui 4.3.2 → 4.3.4

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
@@ -12,7 +12,7 @@ function $parcel$export(e, n, v, s) {
12
12
  configurable: true
13
13
  });
14
14
  }
15
- $parcel$export(module.exports, "LooksSlider", () => $072863633018e322$export$1935e6bdfc5ed8ce);
15
+ $parcel$export(module.exports, "LooksSlider", () => $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa);
16
16
  $parcel$export(module.exports, "promiseSafeStructuredClone", () => $ac946c6b782bb900$export$83bb9af5671e1dbe);
17
17
  $parcel$export(module.exports, "preserve_items_in_history_dot_state", () => $d84fe647b84b5dc5$export$5162a71f252e6122);
18
18
  $parcel$export(module.exports, "prefixes_to_preserve_in_history_dot_state", () => $d84fe647b84b5dc5$export$3064e1e8c6513da3);
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
94
94
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
95
95
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
96
96
  /*! Depict.ai search and product listing SDK */
97
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.3.2";
97
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.3.4";
98
98
  const $4e04be41243c3d80$var$transform_elements = sorted_cols_at_size => {
99
99
  const cols_at_size = [];
100
100
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -1294,7 +1294,7 @@ var $1ae437d7d388a66e$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div
1294
1294
  function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1295
1295
  display_: display_,
1296
1296
  FavoriteButton_: FavoriteButton_,
1297
- isExpanded_: isExpanded_,
1297
+ userWantsExpandedSignal_: [userWantsExpanded, setUserWantsExpanded],
1298
1298
  textFadeInAnimationRunning_: textFadeInAnimationRunning_,
1299
1299
  outerRef_: outerRef_,
1300
1300
  animationDuration_: animationDuration_,
@@ -1307,12 +1307,12 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1307
1307
  });
1308
1308
  const imageUrl = $gVhhF$solidjs.createMemo(() => variantToUse()?.image_urls?.[0]);
1309
1309
  const [animationIsRunning, setAnimationIsRunning] = textFadeInAnimationRunning_;
1310
- const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $gVhhF$solidjs.createSignal($gVhhF$solidjs.untrack(isExpanded_));
1310
+ const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $gVhhF$solidjs.createSignal($gVhhF$solidjs.untrack(userWantsExpanded));
1311
1311
  const [animationEffectExists, setAnimationEffectExists] = $gVhhF$solidjs.createSignal(false);
1312
1312
  const [salePrice] = $gVhhF$solidjs.createResource(() => variantToUse()?.sale_price);
1313
1313
  const [originalPrice] = $gVhhF$solidjs.createResource(() => variantToUse()?.original_price);
1314
1314
  const isOnSale = $gVhhF$solidjs.createMemo(() => !salePrice.loading && !originalPrice.loading && salePrice.latest !== originalPrice.latest); // .latest doesn't trigger suspense after the initial load
1315
- const enableLink = $gVhhF$solidjs.createMemo(() => isExpanded_() && !animationIsRunning());
1315
+ const enableLink = $gVhhF$solidjs.createMemo(() => userWantsExpanded() && !animationIsRunning());
1316
1316
  const href = $gVhhF$solidjs.createMemo(() => variantToUse()?.page_url);
1317
1317
  const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
1318
1318
  return (() => {
@@ -1327,11 +1327,18 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1327
1327
  href: href()
1328
1328
  } : {}, {
1329
1329
  get onClick() {
1330
- return $gVhhF$depictaiutilishared.catchify(event_ => enableLink() && pseudoRouter_.navigate_.go_to_({
1331
- new_url_: href(),
1332
- is_replace_: false,
1333
- event_: event_
1334
- }));
1330
+ return $gVhhF$depictaiutilishared.catchify(event_ => {
1331
+ if (enableLink()) {
1332
+ pseudoRouter_.navigate_.go_to_({
1333
+ new_url_: href(),
1334
+ is_replace_: false,
1335
+ event_: event_
1336
+ });
1337
+ if (event_.defaultPrevented)
1338
+ // We single-page-navigated in this tab, close the look
1339
+ setUserWantsExpanded(false);
1340
+ }
1341
+ });
1335
1342
  }
1336
1343
  }), false, true);
1337
1344
  $gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
@@ -1358,10 +1365,10 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1358
1365
  return imageUrl();
1359
1366
  },
1360
1367
  get aspectRatio() {
1361
- return isExpanded_() ? 0.75 : 1;
1368
+ return userWantsExpanded() ? 0.75 : 1;
1362
1369
  },
1363
1370
  get autoAdjustAspectRatio() {
1364
- return isExpanded_();
1371
+ return userWantsExpanded();
1365
1372
  },
1366
1373
  imgProps: {
1367
1374
  keyRatioUpdating: true
@@ -1374,7 +1381,7 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1374
1381
  }), _el$13, _co$3);
1375
1382
  $gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1376
1383
  get when() {
1377
- return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : isExpanded_()) || animationIsRunning();
1384
+ return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : userWantsExpanded()) || animationIsRunning();
1378
1385
  },
1379
1386
  get children() {
1380
1387
  var _el$3 = $gVhhF$solidjsweb.getNextElement($1ae437d7d388a66e$var$_tmpl$3),
@@ -1401,7 +1408,7 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1401
1408
  setAnimationIsRunning(true);
1402
1409
  $gVhhF$solidjs.runWithOwner(owner, () => {
1403
1410
  $gVhhF$solidjs.createRenderEffect(() => {
1404
- const expanded = isExpanded_();
1411
+ const expanded = userWantsExpanded();
1405
1412
  // Still glitches in chrome (probably not fixable) and sometimes the timing is off in Safari but fuck it, I couldn't massage the WAAPI to improve it in any way (without reading computed style) to make the reversing of animations glitch less
1406
1413
  textContainerAnimation.pause();
1407
1414
  textContainerAnimation.updatePlaybackRate(expanded ? 1 : -1);
@@ -1556,7 +1563,7 @@ var $905010a06f9aeae5$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div
1556
1563
  function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
1557
1564
  displays_: displays_,
1558
1565
  FavoriteButton_: FavoriteButton_,
1559
- userWantsExpandedSignal_: [userWantsExpanded, setUserWantsExpanded],
1566
+ userWantsExpandedSignal_: userWantsExpandedSignal_,
1560
1567
  containerWidth_: containerWidth_,
1561
1568
  animationDuration_: animationDuration_,
1562
1569
  supportsHover_: supportsHover_,
@@ -1570,6 +1577,7 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
1570
1577
  // The following three signals just contain the state if the animations are actually running and should only be set by the respective animation code
1571
1578
  const textFadeInAnimationRunning = $gVhhF$solidjs.createSignal(false);
1572
1579
  const [getSecondPartAnimationRunning] = textFadeInAnimationRunning;
1580
+ const [userWantsExpanded, setUserWantsExpanded] = userWantsExpandedSignal_;
1573
1581
  $b9e830d616d01b31$export$7b9a0e99f0aeb2f3().then(is => isAffectedByChromeBug = is);
1574
1582
  return $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
1575
1583
  get children() {
@@ -1619,7 +1627,7 @@ function $905010a06f9aeae5$export$ebf0b1d4f90c09ae({
1619
1627
  animationDuration_: animationDuration_,
1620
1628
  display_: display,
1621
1629
  FavoriteButton_: FavoriteButton_,
1622
- isExpanded_: userWantsExpanded,
1630
+ userWantsExpandedSignal_: userWantsExpandedSignal_,
1623
1631
  textFadeInAnimationRunning_: textFadeInAnimationRunning,
1624
1632
  priceFormatting_: priceFormatting_,
1625
1633
  outerRef_: el => $gVhhF$solidjs.createEffect(() => {
@@ -1848,11 +1856,100 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
1848
1856
  this.on_navigation_ = on_navigation;
1849
1857
  }
1850
1858
  }
1851
- var $072863633018e322$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict recommendations looks"style=--animation-duration:240ms>`);
1852
- let $072863633018e322$var$expandedLooksSignal_;
1853
- function $072863633018e322$export$1935e6bdfc5ed8ce(props) {
1859
+ var $b8e79813f4f7ebe4$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<button class="show-more major"type=button>`),
1860
+ $b8e79813f4f7ebe4$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<h2 class=recs-title>`),
1861
+ $b8e79813f4f7ebe4$var$_tmpl$3 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=recommendation-grid><!$><!/><!$><!/>`);
1862
+ function $b8e79813f4f7ebe4$export$7da560f849543dff({
1863
+ recommendations_resource_: recommendations_resource_,
1864
+ product_card_template_: product_card_template_,
1865
+ layout_options_: layout_options_,
1866
+ title_: title_,
1867
+ max_rows_: max_rows_,
1868
+ view_more_button_: view_more_button_
1869
+ }) {
1870
+ const rows_object_ = $gVhhF$solidjs.createMemo(() => {
1871
+ const view_more_button = view_more_button_?.();
1872
+ const max_rows = max_rows_?.();
1873
+ if (!view_more_button) {
1874
+ if (max_rows) return {
1875
+ max_rows: max_rows
1876
+ };
1877
+ return "all";
1878
+ }
1879
+ return {
1880
+ max_rows: max_rows,
1881
+ start_rows: view_more_button.start_rows,
1882
+ rows_per_click: view_more_button.rows_per_click ?? 2,
1883
+ button: (() => {
1884
+ var _el$ = $gVhhF$solidjsweb.getNextElement($b8e79813f4f7ebe4$var$_tmpl$);
1885
+ $gVhhF$solidjsweb.insert(_el$, () => view_more_button.text);
1886
+ return _el$;
1887
+ })()
1888
+ };
1889
+ });
1890
+ const is_showing_something = $gVhhF$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
1891
+ const title = $gVhhF$solidjs.createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
1892
+ const num_placeholders_ = () => 20;
1893
+ const elements = [$gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1894
+ get when() {
1895
+ return title();
1896
+ },
1897
+ get children() {
1898
+ var _el$2 = $gVhhF$solidjsweb.getNextElement($b8e79813f4f7ebe4$var$_tmpl$2);
1899
+ $gVhhF$solidjsweb.insert(_el$2, title);
1900
+ return _el$2;
1901
+ }
1902
+ }), (() => {
1903
+ var _el$3 = $gVhhF$solidjsweb.getNextElement($b8e79813f4f7ebe4$var$_tmpl$3),
1904
+ _el$4 = _el$3.firstChild,
1905
+ [_el$5, _co$] = $gVhhF$solidjsweb.getNextMarker(_el$4.nextSibling),
1906
+ _el$6 = _el$5.nextSibling,
1907
+ [_el$7, _co$2] = $gVhhF$solidjsweb.getNextMarker(_el$6.nextSibling);
1908
+ $gVhhF$solidjsweb.insert(_el$3, (0, $fc23d7668ae0011d$export$a2cc176055f8f08), _el$5, _co$);
1909
+ $gVhhF$solidjsweb.insert(_el$3, $gVhhF$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), $gVhhF$solidjsweb.mergeProps({
1910
+ get rows() {
1911
+ return rows_object_();
1912
+ },
1913
+ layout: "grid",
1914
+ element_attributes: {
1915
+ class: "cards"
1916
+ }
1917
+ }, layout_options_, {
1918
+ get children() {
1919
+ return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Suspense), {
1920
+ get fallback() {
1921
+ return $0caf87eaa19079da$export$f33414a4df0afd3f({
1922
+ num_placeholders_: num_placeholders_,
1923
+ product_card_template_: product_card_template_
1924
+ });
1925
+ },
1926
+ get children() {
1927
+ return (() => {
1928
+ // IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
1929
+ const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($gVhhF$solidjs.createMemo(() => recommendations_resource_() || []));
1930
+ return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
1931
+ displays_by_key_: displays_by_key_,
1932
+ product_card_template_: product_card_template_
1933
+ });
1934
+ })();
1935
+ }
1936
+ });
1937
+ }
1938
+ })), _el$7, _co$2);
1939
+ return _el$3;
1940
+ })()];
1941
+ return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1942
+ get when() {
1943
+ return is_showing_something();
1944
+ },
1945
+ children: elements
1946
+ });
1947
+ }
1948
+ var $a3bbfa5fdaa39f3a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict recommendations looks"style=--animation-duration:240ms>`);
1949
+ let $a3bbfa5fdaa39f3a$var$expandedLooksSignal_;
1950
+ function $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa(props) {
1854
1951
  return $95837413165cc2df$export$23fca46f3143581f(() => {
1855
- $072863633018e322$var$expandedLooksSignal_ ||= $gVhhF$solidjs.createSignal(new Set(), {
1952
+ $a3bbfa5fdaa39f3a$var$expandedLooksSignal_ ||= $gVhhF$solidjs.createSignal(new Set(), {
1856
1953
  equals: false
1857
1954
  });
1858
1955
  const expandingAnimationDuration = 240;
@@ -1892,8 +1989,25 @@ function $072863633018e322$export$1935e6bdfc5ed8ce(props) {
1892
1989
  market: market,
1893
1990
  locale: locale
1894
1991
  };
1895
- return $072863633018e322$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
1992
+ return $a3bbfa5fdaa39f3a$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
1896
1993
  });
1994
+ const sharedOptions = {
1995
+ product_card_template_: display => $ad882bbe664dbd53$export$44809a8a3e867e30({
1996
+ display_: display,
1997
+ FavoriteButton_: props.FavoriteButton_,
1998
+ placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
1999
+ animationDuration_: expandingAnimationDuration,
2000
+ expandedLooksSignal_: $a3bbfa5fdaa39f3a$var$expandedLooksSignal_,
2001
+ priceFormatting_: () => props.priceFormatting_,
2002
+ pseudoRouter_: pseudoRouter
2003
+ }),
2004
+ recommendations_resource_: looksResource,
2005
+ title_: () => props.title_,
2006
+ layout_options_: $gVhhF$solidjs.createMemo(() => ({
2007
+ cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.columnsAtSize_),
2008
+ ...grid_spacing_override()
2009
+ }))
2010
+ };
1897
2011
  $gVhhF$solidjs.createEffect(() => {
1898
2012
  const {
1899
2013
  onNavigation_: onNavigation_
@@ -1901,25 +2015,19 @@ function $072863633018e322$export$1935e6bdfc5ed8ce(props) {
1901
2015
  if (onNavigation_) pseudoRouter.on_navigation_ = onNavigation_;
1902
2016
  });
1903
2017
  return (() => {
1904
- var _el$ = $gVhhF$solidjsweb.getNextElement($072863633018e322$var$_tmpl$);
2018
+ var _el$ = $gVhhF$solidjsweb.getNextElement($a3bbfa5fdaa39f3a$var$_tmpl$);
1905
2019
  $gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
1906
2020
  get children() {
1907
- return $363ce4d1d71041aa$export$d41d19e89346fa2({
1908
- product_card_template_: display => $ad882bbe664dbd53$export$44809a8a3e867e30({
1909
- display_: display,
1910
- FavoriteButton_: props.FavoriteButton_,
1911
- placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
1912
- animationDuration_: expandingAnimationDuration,
1913
- expandedLooksSignal_: $072863633018e322$var$expandedLooksSignal_,
1914
- priceFormatting_: () => props.priceFormatting_,
1915
- pseudoRouter_: pseudoRouter
1916
- }),
1917
- recommendations_resource_: looksResource,
1918
- title_: () => props.title_,
1919
- layout_options_: $gVhhF$solidjs.createMemo(() => ({
1920
- cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.columnsAtSize_),
1921
- ...grid_spacing_override()
1922
- }))
2021
+ return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
2022
+ get when() {
2023
+ return props.gridOptions_;
2024
+ },
2025
+ get fallback() {
2026
+ return $gVhhF$solidjsweb.createComponent((0, $363ce4d1d71041aa$export$d41d19e89346fa2), sharedOptions);
2027
+ },
2028
+ get children() {
2029
+ return $gVhhF$solidjsweb.createComponent((0, $b8e79813f4f7ebe4$export$7da560f849543dff), $gVhhF$solidjsweb.mergeProps(sharedOptions, () => props.gridOptions_));
2030
+ }
1923
2031
  });
1924
2032
  }
1925
2033
  }));
@@ -1927,7 +2035,7 @@ function $072863633018e322$export$1935e6bdfc5ed8ce(props) {
1927
2035
  })();
1928
2036
  }, "LookSlider failed");
1929
2037
  }
1930
- async function $072863633018e322$var$runDisplayTransformersForLooks(baseData, listings, displayTransformers) {
2038
+ async function $a3bbfa5fdaa39f3a$var$runDisplayTransformersForLooks(baseData, listings, displayTransformers) {
1931
2039
  try {
1932
2040
  const {
1933
2041
  products: productTransformer,
@@ -5338,99 +5446,9 @@ const $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1 = /*@__PURE__*/(() => {
5338
5446
  const $a3280f0aad997933$export$c3834fa86c616831 = [[4], [3, 1024], [2, 901]];
5339
5447
  const $a3280f0aad997933$export$864d304a0bc46829 = "2%";
5340
5448
  const $a3280f0aad997933$export$7bf543b9d9be2c22 = (0, $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1);
5341
- var $b8e79813f4f7ebe4$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<h2 class=recs-title>`),
5342
- $b8e79813f4f7ebe4$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=recommendation-grid><!$><!/><!$><!/>`);
5343
- function $b8e79813f4f7ebe4$export$7da560f849543dff({
5344
- recommendations_resource_: recommendations_resource_,
5345
- product_card_template_: product_card_template_,
5346
- layout_options_: layout_options_,
5347
- rows_object_: rows_object_,
5348
- title_: title_
5349
- }) {
5350
- const is_showing_something = $gVhhF$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
5351
- const title = $gVhhF$solidjs.createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
5352
- const num_placeholders_ = () => 20;
5353
- const elements = [$gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
5354
- get when() {
5355
- return title();
5356
- },
5357
- get children() {
5358
- var _el$ = $gVhhF$solidjsweb.getNextElement($b8e79813f4f7ebe4$var$_tmpl$);
5359
- $gVhhF$solidjsweb.insert(_el$, title);
5360
- return _el$;
5361
- }
5362
- }), (() => {
5363
- var _el$2 = $gVhhF$solidjsweb.getNextElement($b8e79813f4f7ebe4$var$_tmpl$2),
5364
- _el$3 = _el$2.firstChild,
5365
- [_el$4, _co$] = $gVhhF$solidjsweb.getNextMarker(_el$3.nextSibling),
5366
- _el$5 = _el$4.nextSibling,
5367
- [_el$6, _co$2] = $gVhhF$solidjsweb.getNextMarker(_el$5.nextSibling);
5368
- $gVhhF$solidjsweb.insert(_el$2, (0, $fc23d7668ae0011d$export$a2cc176055f8f08), _el$4, _co$);
5369
- $gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), $gVhhF$solidjsweb.mergeProps({
5370
- get rows() {
5371
- return rows_object_();
5372
- },
5373
- layout: "grid",
5374
- element_attributes: {
5375
- class: "cards"
5376
- }
5377
- }, layout_options_, {
5378
- get children() {
5379
- return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Suspense), {
5380
- get fallback() {
5381
- return $0caf87eaa19079da$export$f33414a4df0afd3f({
5382
- num_placeholders_: num_placeholders_,
5383
- product_card_template_: product_card_template_
5384
- });
5385
- },
5386
- get children() {
5387
- return (() => {
5388
- // IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
5389
- const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($gVhhF$solidjs.createMemo(() => recommendations_resource_() || []));
5390
- return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
5391
- displays_by_key_: displays_by_key_,
5392
- product_card_template_: product_card_template_
5393
- });
5394
- })();
5395
- }
5396
- });
5397
- }
5398
- })), _el$6, _co$2);
5399
- return _el$2;
5400
- })()];
5401
- return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
5402
- get when() {
5403
- return is_showing_something();
5404
- },
5405
- children: elements
5406
- });
5407
- }
5408
- var $1f8dbf7e28b3eff2$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<button class="show-more major"type=button>`),
5409
- $1f8dbf7e28b3eff2$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict plp recommendations">`);
5449
+ var $1f8dbf7e28b3eff2$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict plp recommendations">`);
5410
5450
  function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
5411
5451
  return $95837413165cc2df$export$23fca46f3143581f(() => {
5412
- const rows_object_ = $gVhhF$solidjs.createMemo(() => {
5413
- const {
5414
- view_more_button: view_more_button,
5415
- max_rows: max_rows
5416
- } = props;
5417
- if (!view_more_button) {
5418
- if (max_rows) return {
5419
- max_rows: max_rows
5420
- };
5421
- return "all";
5422
- }
5423
- return {
5424
- max_rows: max_rows,
5425
- start_rows: view_more_button.start_rows,
5426
- rows_per_click: view_more_button.rows_per_click ?? 2,
5427
- button: (() => {
5428
- var _el$ = $gVhhF$solidjsweb.getNextElement($1f8dbf7e28b3eff2$var$_tmpl$);
5429
- $gVhhF$solidjsweb.insert(_el$, () => view_more_button.text);
5430
- return _el$;
5431
- })()
5432
- };
5433
- });
5434
5452
  const grid_spacing_override = $gVhhF$solidjs.createMemo(() => {
5435
5453
  const {
5436
5454
  grid_spacing: grid_spacing
@@ -5444,11 +5462,12 @@ function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
5444
5462
  });
5445
5463
  const [recommendations_resource_] = $gVhhF$solidjs.createResource(() => props.recommendations, recs => recs);
5446
5464
  return (() => {
5447
- var _el$2 = $gVhhF$solidjsweb.getNextElement($1f8dbf7e28b3eff2$var$_tmpl$2);
5448
- $gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
5465
+ var _el$ = $gVhhF$solidjsweb.getNextElement($1f8dbf7e28b3eff2$var$_tmpl$);
5466
+ $gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
5449
5467
  get children() {
5450
5468
  return $b8e79813f4f7ebe4$export$7da560f849543dff({
5451
- rows_object_: rows_object_,
5469
+ max_rows_: () => props.max_rows,
5470
+ view_more_button_: () => props.view_more_button,
5452
5471
  product_card_template_: (...args) => props.product_card_template(...args),
5453
5472
  recommendations_resource_: recommendations_resource_,
5454
5473
  title_: () => props.title,
@@ -5459,7 +5478,7 @@ function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
5459
5478
  });
5460
5479
  }
5461
5480
  }));
5462
- return _el$2;
5481
+ return _el$;
5463
5482
  })();
5464
5483
  }, "RecommendationGrid failed");
5465
5484
  }
package/latest/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
10
10
  import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.3.2";
13
+ export const version = "4.3.4";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
@@ -877,6 +877,17 @@ export function LooksSlider(props: {
877
877
  display_: Accessor<ModernDisplay | null | undefined>;
878
878
  }) => JSX.Element;
879
879
  displayTransformers_?: DisplayTransformers<ModernDisplay, ModernDisplayWithPageUrl<ModernDisplay>>;
880
+ /**
881
+ * If provided, will render as grid instead of slider
882
+ */
883
+ gridOptions_?: {
884
+ view_more_button?: {
885
+ text: string;
886
+ start_rows?: number;
887
+ rows_per_click?: number;
888
+ };
889
+ max_rows?: number;
890
+ };
880
891
  onNavigation_?: OnNavigation;
881
892
  priceFormatting_: plp_shared_i18n["price_formatting_"];
882
893
  }): HTMLDivElement;