@depict-ai/ui 4.2.2 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,3 +11,4 @@ Breaking changes:
11
11
  - 2.0.0 Made `enable_content_search` `true` by default. Redesigned filter counts.
12
12
  - 3.0.19 (first `latest` tagged release of version 3): Please see this [migration guide](https://docs.depict.ai/other-guides/sdk-migration-v2-v3)
13
13
  - 4.x.x: See https://docs.depict.ai/other-guides/sdk-migration-v3-v4
14
+ - 4.3.0: Removed `recommendations_cols_at_size`. Technically breaking change but since this wasn't ever exposed in the js-ui and react-ui packages, I'm releasing it as minor version.
package/latest/index.cjs CHANGED
@@ -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.2.2";
97
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.3.1";
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++) {
@@ -1298,7 +1298,7 @@ function $d212a67662c5cf38$export$9d4a4b669b1929ab(props) {
1298
1298
  }
1299
1299
  }));
1300
1300
  }
1301
- var $1ae437d7d388a66e$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=img-wrapper><!$><!/><!$><!/>`),
1301
+ var $1ae437d7d388a66e$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=img-wrapper>`),
1302
1302
  $1ae437d7d388a66e$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<span class="d-price original">`),
1303
1303
  $1ae437d7d388a66e$var$_tmpl$3 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=right-part><div class=text-container><span class="d-title line-clamp"></span><span class=d-price></span><!$><!/></div><!$><!/>`),
1304
1304
  $1ae437d7d388a66e$var$_tmpl$4 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<a class=look-item><!$><!/><!$><!/>`);
@@ -1314,9 +1314,7 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1314
1314
  const display = display_();
1315
1315
  return display?.variant_displays[display?.variant_index];
1316
1316
  });
1317
- const imageUrls = () => variantToUse()?.image_urls;
1318
- const imageUrl = $gVhhF$solidjs.createMemo(() => imageUrls()?.[0]);
1319
- const secondaryImageUrl = $gVhhF$solidjs.createMemo(() => imageUrls()?.[1]);
1317
+ const imageUrl = $gVhhF$solidjs.createMemo(() => variantToUse()?.image_urls?.[0]);
1320
1318
  const [animationIsRunning, setAnimationIsRunning] = textFadeInAnimationRunning_;
1321
1319
  const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $gVhhF$solidjs.createSignal($gVhhF$solidjs.untrack(isExpanded_));
1322
1320
  const [animationEffectExists, setAnimationEffectExists] = $gVhhF$solidjs.createSignal(false);
@@ -1326,10 +1324,10 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1326
1324
  const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
1327
1325
  return (() => {
1328
1326
  var _el$ = $gVhhF$solidjsweb.getNextElement($1ae437d7d388a66e$var$_tmpl$4),
1329
- _el$16 = _el$.firstChild,
1330
- [_el$17, _co$5] = $gVhhF$solidjsweb.getNextMarker(_el$16.nextSibling),
1331
- _el$18 = _el$17.nextSibling,
1332
- [_el$19, _co$6] = $gVhhF$solidjsweb.getNextMarker(_el$18.nextSibling);
1327
+ _el$12 = _el$.firstChild,
1328
+ [_el$13, _co$3] = $gVhhF$solidjsweb.getNextMarker(_el$12.nextSibling),
1329
+ _el$14 = _el$13.nextSibling,
1330
+ [_el$15, _co$4] = $gVhhF$solidjsweb.getNextMarker(_el$14.nextSibling);
1333
1331
  var _ref$ = outerRef_;
1334
1332
  typeof _ref$ === "function" ? $gVhhF$solidjsweb.use(_ref$, _el$) : outerRef_ = _el$;
1335
1333
  $gVhhF$solidjsweb.spread(_el$, $gVhhF$solidjsweb.mergeProps(() => isExpanded_() && !animationIsRunning() ? {
@@ -1343,11 +1341,7 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1343
1341
  });
1344
1342
  },
1345
1343
  get children() {
1346
- var _el$2 = $gVhhF$solidjsweb.getNextElement($1ae437d7d388a66e$var$_tmpl$),
1347
- _el$3 = _el$2.firstChild,
1348
- [_el$4, _co$] = $gVhhF$solidjsweb.getNextMarker(_el$3.nextSibling),
1349
- _el$5 = _el$4.nextSibling,
1350
- [_el$6, _co$2] = $gVhhF$solidjsweb.getNextMarker(_el$5.nextSibling);
1344
+ var _el$2 = $gVhhF$solidjsweb.getNextElement($1ae437d7d388a66e$var$_tmpl$);
1351
1345
  $gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1352
1346
  get when() {
1353
1347
  return imageUrl();
@@ -1370,42 +1364,23 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1370
1364
  }
1371
1365
  });
1372
1366
  }
1373
- }), _el$4, _co$);
1374
- $gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1375
- get when() {
1376
- return secondaryImageUrl();
1377
- },
1378
- get children() {
1379
- return $gVhhF$solidjsweb.createComponent((0, $d212a67662c5cf38$export$9d4a4b669b1929ab), {
1380
- get src() {
1381
- return secondaryImageUrl();
1382
- },
1383
- get aspectRatio() {
1384
- return isExpanded_() ? 0.75 : 1;
1385
- },
1386
- "class": "secondary",
1387
- get autoAdjustAspectRatio() {
1388
- return isExpanded_() ? "smoothed" : false;
1389
- }
1390
- });
1391
- }
1392
- }), _el$6, _co$2);
1367
+ }));
1393
1368
  return _el$2;
1394
1369
  }
1395
- }), _el$17, _co$5);
1370
+ }), _el$13, _co$3);
1396
1371
  $gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1397
1372
  get when() {
1398
1373
  return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : isExpanded_()) || animationIsRunning();
1399
1374
  },
1400
1375
  get children() {
1401
- var _el$7 = $gVhhF$solidjsweb.getNextElement($1ae437d7d388a66e$var$_tmpl$3),
1402
- _el$8 = _el$7.firstChild,
1403
- _el$9 = _el$8.firstChild,
1404
- _el$10 = _el$9.nextSibling,
1405
- _el$12 = _el$10.nextSibling,
1406
- [_el$13, _co$3] = $gVhhF$solidjsweb.getNextMarker(_el$12.nextSibling),
1407
- _el$14 = _el$8.nextSibling,
1408
- [_el$15, _co$4] = $gVhhF$solidjsweb.getNextMarker(_el$14.nextSibling);
1376
+ var _el$3 = $gVhhF$solidjsweb.getNextElement($1ae437d7d388a66e$var$_tmpl$3),
1377
+ _el$4 = _el$3.firstChild,
1378
+ _el$5 = _el$4.firstChild,
1379
+ _el$6 = _el$5.nextSibling,
1380
+ _el$8 = _el$6.nextSibling,
1381
+ [_el$9, _co$] = $gVhhF$solidjsweb.getNextMarker(_el$8.nextSibling),
1382
+ _el$10 = _el$4.nextSibling,
1383
+ [_el$11, _co$2] = $gVhhF$solidjsweb.getNextMarker(_el$10.nextSibling);
1409
1384
  $gVhhF$solidjsweb.use(element => {
1410
1385
  const owner = $gVhhF$solidjs.getOwner();
1411
1386
  $gVhhF$solidjs.onCleanup((0, $gVhhF$depictaiutilishared.observer).onexists(element, ({
@@ -1437,46 +1412,46 @@ function $1ae437d7d388a66e$export$b73ed90f0ee50dc3({
1437
1412
  for (const ev of ["cancel", "finish"]) textContainerAnimation.addEventListener(ev, $gVhhF$depictaiutilishared.catchify(() => setAnimationIsRunning(false)));
1438
1413
  disconnector();
1439
1414
  }));
1440
- }, _el$7);
1441
- $gVhhF$solidjsweb.insert(_el$9, () => variantToUse()?.title ?? $gVhhF$solidjsweb.createComponent((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
1415
+ }, _el$3);
1416
+ $gVhhF$solidjsweb.insert(_el$5, () => variantToUse()?.title ?? $gVhhF$solidjsweb.createComponent((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
1442
1417
  height: "1em",
1443
1418
  width: "20ch"
1444
1419
  }));
1445
- $gVhhF$solidjsweb.insert(_el$10, (() => {
1420
+ $gVhhF$solidjsweb.insert(_el$6, (() => {
1446
1421
  var _c$ = $gVhhF$solidjsweb.memo(() => !!(!variantToUse() || salePrice.loading));
1447
1422
  return () => _c$() ? $gVhhF$solidjsweb.createComponent((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
1448
1423
  height: "1em",
1449
1424
  width: "20ch"
1450
1425
  }) : salePrice();
1451
1426
  })());
1452
- $gVhhF$solidjsweb.insert(_el$8, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1427
+ $gVhhF$solidjsweb.insert(_el$4, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1453
1428
  get when() {
1454
1429
  return isOnSale();
1455
1430
  },
1456
1431
  get children() {
1457
- var _el$11 = $gVhhF$solidjsweb.getNextElement($1ae437d7d388a66e$var$_tmpl$2);
1458
- $gVhhF$solidjsweb.insert(_el$11, (() => {
1432
+ var _el$7 = $gVhhF$solidjsweb.getNextElement($1ae437d7d388a66e$var$_tmpl$2);
1433
+ $gVhhF$solidjsweb.insert(_el$7, (() => {
1459
1434
  var _c$2 = $gVhhF$solidjsweb.memo(() => !!(!variantToUse() || originalPrice.loading));
1460
1435
  return () => _c$2() ? $gVhhF$solidjsweb.createComponent((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
1461
1436
  height: "1em",
1462
1437
  width: "20ch"
1463
1438
  }) : originalPrice();
1464
1439
  })());
1465
- return _el$11;
1440
+ return _el$7;
1466
1441
  }
1467
- }), _el$13, _co$3);
1468
- $gVhhF$solidjsweb.insert(_el$7, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1442
+ }), _el$9, _co$);
1443
+ $gVhhF$solidjsweb.insert(_el$3, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
1469
1444
  when: FavoriteButton_,
1470
1445
  get children() {
1471
1446
  return $gVhhF$solidjsweb.createComponent(FavoriteButton, {
1472
1447
  display_: display_
1473
1448
  });
1474
1449
  }
1475
- }), _el$15, _co$4);
1476
- $gVhhF$solidjsweb.effect(() => _el$10.classList.toggle("sale", !!isOnSale()));
1477
- return _el$7;
1450
+ }), _el$11, _co$2);
1451
+ $gVhhF$solidjsweb.effect(() => _el$6.classList.toggle("sale", !!isOnSale()));
1452
+ return _el$3;
1478
1453
  }
1479
- }), _el$19, _co$6);
1454
+ }), _el$15, _co$4);
1480
1455
  $gVhhF$solidjsweb.runHydrationEvents();
1481
1456
  return _el$;
1482
1457
  })();
@@ -1650,7 +1625,13 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
1650
1625
  const us = Symbol("look");
1651
1626
  const container = (() => {
1652
1627
  var _el$ = $gVhhF$solidjsweb.getNextElement($ad882bbe664dbd53$var$_tmpl$);
1653
- $gVhhF$solidjsweb.addEventListener(_el$, "click", $gVhhF$depictaiutilishared.catchify(() => setUserWantsExpanded(prev => !prev)), true);
1628
+ $gVhhF$solidjsweb.addEventListener(_el$, "click", $gVhhF$depictaiutilishared.catchify(({
1629
+ target: target
1630
+ }) => {
1631
+ // Don't toggle when clicking on the links
1632
+ if (target.matches("a") || target.closest("a")) return;
1633
+ setUserWantsExpanded(prev => !prev);
1634
+ }), true);
1654
1635
  _el$.classList.toggle("placeholder", !!!display_);
1655
1636
  $gVhhF$solidjsweb.runHydrationEvents();
1656
1637
  return _el$;
@@ -11661,7 +11642,8 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
11661
11642
  selected_filters_: selected_filters_,
11662
11643
  local_filter_cache_: local_filter_cache_,
11663
11644
  get_extra_filters_button_: get_extra_filters_button_,
11664
- get_extra_sorting_button_: get_extra_sorting_button_
11645
+ get_extra_sorting_button_: get_extra_sorting_button_,
11646
+ filterModalParent_: filterModalParent_
11665
11647
  }) {
11666
11648
  const Self = () => {
11667
11649
  // 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
@@ -11781,7 +11763,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({
11781
11763
  formatted_number_of_results_: formatted_number_of_results_,
11782
11764
  dismiss_modal_: dismiss_modal_,
11783
11765
  i18n_: i18n_
11784
- }));
11766
+ }, filterModalParent_));
11785
11767
  const {
11786
11768
  remove: remove
11787
11769
  } = $gVhhF$depictaiutilishared.javascript_media_query("(max-width:651px)", ({
@@ -12794,7 +12776,6 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
12794
12776
  market_: market_,
12795
12777
  showing_recommendation_rows_: showing_recommendation_rows_,
12796
12778
  layout_options_: layout_options_,
12797
- recommendations_layout_options_: recommendations_layout_options_,
12798
12779
  scroll_restoration_data_: scroll_restoration_data_,
12799
12780
  product_card_template_: product_card_template_,
12800
12781
  modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
@@ -12804,7 +12785,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
12804
12785
  content_search_enabled_: content_search_enabled_,
12805
12786
  content_blocks_by_row_: content_blocks_by_row_,
12806
12787
  modalVersionUsed_: modalVersionUsed_,
12807
- BackIcon_: BackIcon_
12788
+ BackIcon_: BackIcon_,
12789
+ filterModalParent_: filterModalParent_
12808
12790
  }) {
12809
12791
  const [get_sorting] = current_sorting_;
12810
12792
  const all_products_loaded_ = $gVhhF$solidjs.createSignal(false);
@@ -12910,7 +12892,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
12910
12892
  formatted_number_of_results_: formatted_number_of_results_,
12911
12893
  local_filter_cache_: local_filter_cache_,
12912
12894
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12913
- number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_
12895
+ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
12896
+ filterModalParent_: filterModalParent_
12914
12897
  });
12915
12898
  const results_filters = $gVhhF$solidjs.createSignal();
12916
12899
  const owner = $gVhhF$solidjs.getOwner();
@@ -13164,9 +13147,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
13164
13147
  depict_api_: depict_api_,
13165
13148
  i18n_: i18n_,
13166
13149
  search_query_base_: search_query_base_,
13167
- get layout_options_() {
13168
- return $gVhhF$solidjs.createMemo(() => recommendations_layout_options_?.() ?? layout_options_());
13169
- },
13150
+ layout_options_: layout_options_,
13170
13151
  showing_recommendation_rows_: showing_recommendation_rows_,
13171
13152
  product_card_template_: product_card_template_,
13172
13153
  all_products_loaded_: get_all_products_loaded
@@ -13579,15 +13560,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
13579
13560
  cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77($ab7c6c7911bae2f5$export$ff7109b9b2b206ba(props.cols_at_size)),
13580
13561
  ...grid_spacing_override()
13581
13562
  })),
13582
- recommendations_layout_options_: $gVhhF$solidjs.createMemo(() => {
13583
- const {
13584
- extra_depict_options: extra_depict_options
13585
- } = props;
13586
- return extra_depict_options?.recommendations_cols_at_size ? {
13587
- cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(extra_depict_options.recommendations_cols_at_size),
13588
- ...grid_spacing_override()
13589
- } : undefined;
13590
- }),
13563
+ filterModalParent_: $gVhhF$solidjs.untrack(() => props.filterModalParent_),
13591
13564
  product_card_template_: product_card_template
13592
13565
  });
13593
13566
  }, "Entire SearchPage failed");
@@ -14418,7 +14391,8 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
14418
14391
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
14419
14392
  sorting_query_param_: sorting_query_param_,
14420
14393
  filter_query_param_prefix_: filter_query_param_prefix_,
14421
- content_blocks_by_row_: content_blocks_by_row_
14394
+ content_blocks_by_row_: content_blocks_by_row_,
14395
+ filterModalParent_: filterModalParent_
14422
14396
  }) {
14423
14397
  let results_for;
14424
14398
  let only_show_filters_opener_;
@@ -14596,6 +14570,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
14596
14570
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14597
14571
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
14598
14572
  sort_and_filter_disabled_: sort_and_filter_disabled_,
14573
+ filterModalParent_: filterModalParent_,
14599
14574
  ...extra_sort_and_filter_args_
14600
14575
  });
14601
14576
  $gVhhF$depictaiutilisharedlatest.catchify((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
@@ -14873,6 +14848,7 @@ function $14f289047713d67a$export$e2bf8ce7779e827e(props) {
14873
14848
  category_sorting_open_: category_sorting_open_,
14874
14849
  expanded_filters_: expanded_filters_,
14875
14850
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14851
+ filterModalParent_: $gVhhF$solidjs.untrack(() => props.filterModalParent_),
14876
14852
  selected_filters_: selected_filters_,
14877
14853
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
14878
14854
  content_blocks_by_row_: () => props.content_blocks_by_row,
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.2.2";
13
+ export const version = "4.3.1";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
@@ -1337,9 +1337,7 @@ export function SearchPage<OriginalDisplay extends Display, TransformedDisplay e
1337
1337
  product_card_template: ProductCardTemplate<[TransformedDisplay] extends [never] ? OriginalDisplay : ModernDisplayWithPageUrl<TransformedDisplay>>;
1338
1338
  content_blocks_by_row?: ContentBlocksByRow;
1339
1339
  on_query_change?: (new_query?: string | undefined, old_query?: string | undefined) => void;
1340
- extra_depict_options?: {
1341
- recommendations_cols_at_size?: SDKColsAtSize;
1342
- };
1340
+ filterModalParent_?: HTMLElement | ShadowRoot;
1343
1341
  }): import("@depict-ai/utilishared").Node_Array;
1344
1342
  /**
1345
1343
  * Connects the height of the search field to the height of the aligner.
@@ -1379,7 +1377,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1379
1377
  * Open the modal with support for alignment.
1380
1378
  * @returns {void}
1381
1379
  */
1382
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1380
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1383
1381
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1384
1382
  export interface PageReplacer {
1385
1383
  readonly render_: () => Node_Array;
@@ -1456,5 +1454,6 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1456
1454
  on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
1457
1455
  content_blocks_by_row?: ContentBlocksByRow;
1458
1456
  layout?: PossibleLayout;
1459
- }): import("@depict-ai/utilishared/latest").Node_Array;
1457
+ filterModalParent_?: HTMLElement | ShadowRoot;
1458
+ }): import("@depict-ai/utilishared").Node_Array;
1460
1459
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/latest/index.js CHANGED
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.2.2";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.3.1";
11
11
  const $b5cccc8ee7d24677$var$transform_elements = sorted_cols_at_size => {
12
12
  const cols_at_size = [];
13
13
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -1211,7 +1211,7 @@ function $70bb27cc6be01fc7$export$9d4a4b669b1929ab(props) {
1211
1211
  }
1212
1212
  }));
1213
1213
  }
1214
- var $5a6c386e1bde5665$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=img-wrapper><!$><!/><!$><!/>`),
1214
+ var $5a6c386e1bde5665$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=img-wrapper>`),
1215
1215
  $5a6c386e1bde5665$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<span class="d-price original">`),
1216
1216
  $5a6c386e1bde5665$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class=right-part><div class=text-container><span class="d-title line-clamp"></span><span class=d-price></span><!$><!/></div><!$><!/>`),
1217
1217
  $5a6c386e1bde5665$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<a class=look-item><!$><!/><!$><!/>`);
@@ -1227,9 +1227,7 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1227
1227
  const display = display_();
1228
1228
  return display?.variant_displays[display?.variant_index];
1229
1229
  });
1230
- const imageUrls = () => variantToUse()?.image_urls;
1231
- const imageUrl = $9HbP8$createMemo(() => imageUrls()?.[0]);
1232
- const secondaryImageUrl = $9HbP8$createMemo(() => imageUrls()?.[1]);
1230
+ const imageUrl = $9HbP8$createMemo(() => variantToUse()?.image_urls?.[0]);
1233
1231
  const [animationIsRunning, setAnimationIsRunning] = textFadeInAnimationRunning_;
1234
1232
  const [isExpandedThrottledByOurEffectRun, setIsExpandedThrottledByOurEffectRun] = $9HbP8$createSignal($9HbP8$untrack(isExpanded_));
1235
1233
  const [animationEffectExists, setAnimationEffectExists] = $9HbP8$createSignal(false);
@@ -1239,10 +1237,10 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1239
1237
  const FavoriteButton = FavoriteButton_; // Just to get rid of the type error - TS doesn't understand <Show>
1240
1238
  return (() => {
1241
1239
  var _el$ = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$4),
1242
- _el$16 = _el$.firstChild,
1243
- [_el$17, _co$5] = $9HbP8$getNextMarker(_el$16.nextSibling),
1244
- _el$18 = _el$17.nextSibling,
1245
- [_el$19, _co$6] = $9HbP8$getNextMarker(_el$18.nextSibling);
1240
+ _el$12 = _el$.firstChild,
1241
+ [_el$13, _co$3] = $9HbP8$getNextMarker(_el$12.nextSibling),
1242
+ _el$14 = _el$13.nextSibling,
1243
+ [_el$15, _co$4] = $9HbP8$getNextMarker(_el$14.nextSibling);
1246
1244
  var _ref$ = outerRef_;
1247
1245
  typeof _ref$ === "function" ? $9HbP8$use(_ref$, _el$) : outerRef_ = _el$;
1248
1246
  $9HbP8$spread(_el$, $9HbP8$mergeProps(() => isExpanded_() && !animationIsRunning() ? {
@@ -1256,11 +1254,7 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1256
1254
  });
1257
1255
  },
1258
1256
  get children() {
1259
- var _el$2 = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$),
1260
- _el$3 = _el$2.firstChild,
1261
- [_el$4, _co$] = $9HbP8$getNextMarker(_el$3.nextSibling),
1262
- _el$5 = _el$4.nextSibling,
1263
- [_el$6, _co$2] = $9HbP8$getNextMarker(_el$5.nextSibling);
1257
+ var _el$2 = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$);
1264
1258
  $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
1265
1259
  get when() {
1266
1260
  return imageUrl();
@@ -1283,42 +1277,23 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1283
1277
  }
1284
1278
  });
1285
1279
  }
1286
- }), _el$4, _co$);
1287
- $9HbP8$insert(_el$2, $9HbP8$createComponent((0, $9HbP8$Show), {
1288
- get when() {
1289
- return secondaryImageUrl();
1290
- },
1291
- get children() {
1292
- return $9HbP8$createComponent((0, $70bb27cc6be01fc7$export$9d4a4b669b1929ab), {
1293
- get src() {
1294
- return secondaryImageUrl();
1295
- },
1296
- get aspectRatio() {
1297
- return isExpanded_() ? 0.75 : 1;
1298
- },
1299
- "class": "secondary",
1300
- get autoAdjustAspectRatio() {
1301
- return isExpanded_() ? "smoothed" : false;
1302
- }
1303
- });
1304
- }
1305
- }), _el$6, _co$2);
1280
+ }));
1306
1281
  return _el$2;
1307
1282
  }
1308
- }), _el$17, _co$5);
1283
+ }), _el$13, _co$3);
1309
1284
  $9HbP8$insert(_el$, $9HbP8$createComponent((0, $9HbP8$Show), {
1310
1285
  get when() {
1311
1286
  return (animationEffectExists() ? isExpandedThrottledByOurEffectRun() : isExpanded_()) || animationIsRunning();
1312
1287
  },
1313
1288
  get children() {
1314
- var _el$7 = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$3),
1315
- _el$8 = _el$7.firstChild,
1316
- _el$9 = _el$8.firstChild,
1317
- _el$10 = _el$9.nextSibling,
1318
- _el$12 = _el$10.nextSibling,
1319
- [_el$13, _co$3] = $9HbP8$getNextMarker(_el$12.nextSibling),
1320
- _el$14 = _el$8.nextSibling,
1321
- [_el$15, _co$4] = $9HbP8$getNextMarker(_el$14.nextSibling);
1289
+ var _el$3 = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$3),
1290
+ _el$4 = _el$3.firstChild,
1291
+ _el$5 = _el$4.firstChild,
1292
+ _el$6 = _el$5.nextSibling,
1293
+ _el$8 = _el$6.nextSibling,
1294
+ [_el$9, _co$] = $9HbP8$getNextMarker(_el$8.nextSibling),
1295
+ _el$10 = _el$4.nextSibling,
1296
+ [_el$11, _co$2] = $9HbP8$getNextMarker(_el$10.nextSibling);
1322
1297
  $9HbP8$use(element => {
1323
1298
  const owner = $9HbP8$getOwner();
1324
1299
  $9HbP8$onCleanup((0, $9HbP8$observer).onexists(element, ({
@@ -1350,46 +1325,46 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
1350
1325
  for (const ev of ["cancel", "finish"]) textContainerAnimation.addEventListener(ev, $9HbP8$catchify(() => setAnimationIsRunning(false)));
1351
1326
  disconnector();
1352
1327
  }));
1353
- }, _el$7);
1354
- $9HbP8$insert(_el$9, () => variantToUse()?.title ?? $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
1328
+ }, _el$3);
1329
+ $9HbP8$insert(_el$5, () => variantToUse()?.title ?? $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
1355
1330
  height: "1em",
1356
1331
  width: "20ch"
1357
1332
  }));
1358
- $9HbP8$insert(_el$10, (() => {
1333
+ $9HbP8$insert(_el$6, (() => {
1359
1334
  var _c$ = $9HbP8$memo(() => !!(!variantToUse() || salePrice.loading));
1360
1335
  return () => _c$() ? $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
1361
1336
  height: "1em",
1362
1337
  width: "20ch"
1363
1338
  }) : salePrice();
1364
1339
  })());
1365
- $9HbP8$insert(_el$8, $9HbP8$createComponent((0, $9HbP8$Show), {
1340
+ $9HbP8$insert(_el$4, $9HbP8$createComponent((0, $9HbP8$Show), {
1366
1341
  get when() {
1367
1342
  return isOnSale();
1368
1343
  },
1369
1344
  get children() {
1370
- var _el$11 = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$2);
1371
- $9HbP8$insert(_el$11, (() => {
1345
+ var _el$7 = $9HbP8$getNextElement($5a6c386e1bde5665$var$_tmpl$2);
1346
+ $9HbP8$insert(_el$7, (() => {
1372
1347
  var _c$2 = $9HbP8$memo(() => !!(!variantToUse() || originalPrice.loading));
1373
1348
  return () => _c$2() ? $9HbP8$createComponent((0, $d134eae24341b4a1$export$89c6019e4baa40b1), {
1374
1349
  height: "1em",
1375
1350
  width: "20ch"
1376
1351
  }) : originalPrice();
1377
1352
  })());
1378
- return _el$11;
1353
+ return _el$7;
1379
1354
  }
1380
- }), _el$13, _co$3);
1381
- $9HbP8$insert(_el$7, $9HbP8$createComponent((0, $9HbP8$Show), {
1355
+ }), _el$9, _co$);
1356
+ $9HbP8$insert(_el$3, $9HbP8$createComponent((0, $9HbP8$Show), {
1382
1357
  when: FavoriteButton_,
1383
1358
  get children() {
1384
1359
  return $9HbP8$createComponent(FavoriteButton, {
1385
1360
  display_: display_
1386
1361
  });
1387
1362
  }
1388
- }), _el$15, _co$4);
1389
- $9HbP8$effect(() => _el$10.classList.toggle("sale", !!isOnSale()));
1390
- return _el$7;
1363
+ }), _el$11, _co$2);
1364
+ $9HbP8$effect(() => _el$6.classList.toggle("sale", !!isOnSale()));
1365
+ return _el$3;
1391
1366
  }
1392
- }), _el$19, _co$6);
1367
+ }), _el$15, _co$4);
1393
1368
  $9HbP8$runHydrationEvents();
1394
1369
  return _el$;
1395
1370
  })();
@@ -1563,7 +1538,13 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
1563
1538
  const us = Symbol("look");
1564
1539
  const container = (() => {
1565
1540
  var _el$ = $9HbP8$getNextElement($28ee4f7db3cc44b8$var$_tmpl$);
1566
- $9HbP8$addEventListener(_el$, "click", $9HbP8$catchify(() => setUserWantsExpanded(prev => !prev)), true);
1541
+ $9HbP8$addEventListener(_el$, "click", $9HbP8$catchify(({
1542
+ target: target
1543
+ }) => {
1544
+ // Don't toggle when clicking on the links
1545
+ if (target.matches("a") || target.closest("a")) return;
1546
+ setUserWantsExpanded(prev => !prev);
1547
+ }), true);
1567
1548
  _el$.classList.toggle("placeholder", !!!display_);
1568
1549
  $9HbP8$runHydrationEvents();
1569
1550
  return _el$;
@@ -11574,7 +11555,8 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
11574
11555
  selected_filters_: selected_filters_,
11575
11556
  local_filter_cache_: local_filter_cache_,
11576
11557
  get_extra_filters_button_: get_extra_filters_button_,
11577
- get_extra_sorting_button_: get_extra_sorting_button_
11558
+ get_extra_sorting_button_: get_extra_sorting_button_,
11559
+ filterModalParent_: filterModalParent_
11578
11560
  }) {
11579
11561
  const Self = () => {
11580
11562
  // 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
@@ -11694,7 +11676,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
11694
11676
  formatted_number_of_results_: formatted_number_of_results_,
11695
11677
  dismiss_modal_: dismiss_modal_,
11696
11678
  i18n_: i18n_
11697
- }));
11679
+ }, filterModalParent_));
11698
11680
  const {
11699
11681
  remove: remove
11700
11682
  } = $9HbP8$javascript_media_query("(max-width:651px)", ({
@@ -12707,7 +12689,6 @@ function $7097477c78a89208$export$a54ec244c8863715({
12707
12689
  market_: market_,
12708
12690
  showing_recommendation_rows_: showing_recommendation_rows_,
12709
12691
  layout_options_: layout_options_,
12710
- recommendations_layout_options_: recommendations_layout_options_,
12711
12692
  scroll_restoration_data_: scroll_restoration_data_,
12712
12693
  product_card_template_: product_card_template_,
12713
12694
  modalAlignmentSignalsRef_: modalAlignmentSignalsRef_,
@@ -12717,7 +12698,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
12717
12698
  content_search_enabled_: content_search_enabled_,
12718
12699
  content_blocks_by_row_: content_blocks_by_row_,
12719
12700
  modalVersionUsed_: modalVersionUsed_,
12720
- BackIcon_: BackIcon_
12701
+ BackIcon_: BackIcon_,
12702
+ filterModalParent_: filterModalParent_
12721
12703
  }) {
12722
12704
  const [get_sorting] = current_sorting_;
12723
12705
  const all_products_loaded_ = $9HbP8$createSignal(false);
@@ -12823,7 +12805,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
12823
12805
  formatted_number_of_results_: formatted_number_of_results_,
12824
12806
  local_filter_cache_: local_filter_cache_,
12825
12807
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
12826
- number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_
12808
+ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
12809
+ filterModalParent_: filterModalParent_
12827
12810
  });
12828
12811
  const results_filters = $9HbP8$createSignal();
12829
12812
  const owner = $9HbP8$getOwner();
@@ -13077,9 +13060,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
13077
13060
  depict_api_: depict_api_,
13078
13061
  i18n_: i18n_,
13079
13062
  search_query_base_: search_query_base_,
13080
- get layout_options_() {
13081
- return $9HbP8$createMemo(() => recommendations_layout_options_?.() ?? layout_options_());
13082
- },
13063
+ layout_options_: layout_options_,
13083
13064
  showing_recommendation_rows_: showing_recommendation_rows_,
13084
13065
  product_card_template_: product_card_template_,
13085
13066
  all_products_loaded_: get_all_products_loaded
@@ -13492,15 +13473,7 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
13492
13473
  cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77($1848f7cca286fbab$export$ff7109b9b2b206ba(props.cols_at_size)),
13493
13474
  ...grid_spacing_override()
13494
13475
  })),
13495
- recommendations_layout_options_: $9HbP8$createMemo(() => {
13496
- const {
13497
- extra_depict_options: extra_depict_options
13498
- } = props;
13499
- return extra_depict_options?.recommendations_cols_at_size ? {
13500
- cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(extra_depict_options.recommendations_cols_at_size),
13501
- ...grid_spacing_override()
13502
- } : undefined;
13503
- }),
13476
+ filterModalParent_: $9HbP8$untrack(() => props.filterModalParent_),
13504
13477
  product_card_template_: product_card_template
13505
13478
  });
13506
13479
  }, "Entire SearchPage failed");
@@ -14331,7 +14304,8 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
14331
14304
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
14332
14305
  sorting_query_param_: sorting_query_param_,
14333
14306
  filter_query_param_prefix_: filter_query_param_prefix_,
14334
- content_blocks_by_row_: content_blocks_by_row_
14307
+ content_blocks_by_row_: content_blocks_by_row_,
14308
+ filterModalParent_: filterModalParent_
14335
14309
  }) {
14336
14310
  let results_for;
14337
14311
  let only_show_filters_opener_;
@@ -14509,6 +14483,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
14509
14483
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14510
14484
  number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
14511
14485
  sort_and_filter_disabled_: sort_and_filter_disabled_,
14486
+ filterModalParent_: filterModalParent_,
14512
14487
  ...extra_sort_and_filter_args_
14513
14488
  });
14514
14489
  $9HbP8$catchify1((0, $641bba2917fe862b$export$6e49da55e449af7c))({
@@ -14786,6 +14761,7 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
14786
14761
  category_sorting_open_: category_sorting_open_,
14787
14762
  expanded_filters_: expanded_filters_,
14788
14763
  expanded_hierarchical_filters_: expanded_hierarchical_filters_,
14764
+ filterModalParent_: $9HbP8$untrack(() => props.filterModalParent_),
14789
14765
  selected_filters_: selected_filters_,
14790
14766
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
14791
14767
  content_blocks_by_row_: () => props.content_blocks_by_row,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.2.2",
3
+ "version": "4.3.1",
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",
@@ -236,7 +236,7 @@
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": "^3.1.1",
239
+ "@depict-ai/plp-styling": "^3.1.3",
240
240
  "@depict-ai/types": "^5.1.1",
241
241
  "@depict-ai/utilishared": "^2.1.1",
242
242
  "solid-js": "^1.8.12"