@depict-ai/ui 4.3.3 → 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/ES10/index.cjs +137 -126
- package/ES10/index.d.ts +12 -1
- package/ES10/index.js +171 -160
- package/latest/index.cjs +131 -120
- package/latest/index.d.ts +12 -1
- package/latest/index.js +165 -154
- package/package.json +2 -2
- package/server/ES10/index.cjs +120 -109
- package/server/ES10/index.d.ts +12 -1
- package/server/ES10/index.js +159 -148
- package/server/latest/index.cjs +114 -103
- package/server/latest/index.d.ts +12 -1
- package/server/latest/index.js +153 -142
package/server/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", () => $
|
|
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.
|
|
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++) {
|
|
@@ -1641,11 +1641,85 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
1641
1641
|
this.on_navigation_ = on_navigation;
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
|
-
var $
|
|
1645
|
-
|
|
1646
|
-
|
|
1644
|
+
var $b8e79813f4f7ebe4$var$_tmpl$ = ["<button", ' class="show-more major" type="button">', "</button>"],
|
|
1645
|
+
$b8e79813f4f7ebe4$var$_tmpl$2 = ["<h2", ' class="recs-title">', "</h2>"],
|
|
1646
|
+
$b8e79813f4f7ebe4$var$_tmpl$3 = ["<div", ' class="recommendation-grid"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
1647
|
+
function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
1648
|
+
recommendations_resource_: recommendations_resource_,
|
|
1649
|
+
product_card_template_: product_card_template_,
|
|
1650
|
+
layout_options_: layout_options_,
|
|
1651
|
+
title_: title_,
|
|
1652
|
+
max_rows_: max_rows_,
|
|
1653
|
+
view_more_button_: view_more_button_
|
|
1654
|
+
}) {
|
|
1655
|
+
const rows_object_ = $5vyXB$solidjs.createMemo(() => {
|
|
1656
|
+
const view_more_button = view_more_button_?.();
|
|
1657
|
+
const max_rows = max_rows_?.();
|
|
1658
|
+
if (!view_more_button) {
|
|
1659
|
+
if (max_rows) return {
|
|
1660
|
+
max_rows: max_rows
|
|
1661
|
+
};
|
|
1662
|
+
return "all";
|
|
1663
|
+
}
|
|
1664
|
+
return {
|
|
1665
|
+
max_rows: max_rows,
|
|
1666
|
+
start_rows: view_more_button.start_rows,
|
|
1667
|
+
rows_per_click: view_more_button.rows_per_click ?? 2,
|
|
1668
|
+
button: $5vyXB$solidjsweb.ssr($b8e79813f4f7ebe4$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(view_more_button.text))
|
|
1669
|
+
};
|
|
1670
|
+
});
|
|
1671
|
+
const is_showing_something = $5vyXB$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
|
|
1672
|
+
const title = $5vyXB$solidjs.createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
|
|
1673
|
+
const num_placeholders_ = () => 20;
|
|
1674
|
+
const elements = [$5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
1675
|
+
get when() {
|
|
1676
|
+
return title();
|
|
1677
|
+
},
|
|
1678
|
+
get children() {
|
|
1679
|
+
return $5vyXB$solidjsweb.ssr($b8e79813f4f7ebe4$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(title()));
|
|
1680
|
+
}
|
|
1681
|
+
}), $5vyXB$solidjsweb.ssr($b8e79813f4f7ebe4$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($fc23d7668ae0011d$export$a2cc176055f8f08()), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), $5vyXB$solidjsweb.mergeProps({
|
|
1682
|
+
get rows() {
|
|
1683
|
+
return rows_object_();
|
|
1684
|
+
},
|
|
1685
|
+
layout: "grid",
|
|
1686
|
+
element_attributes: {
|
|
1687
|
+
class: "cards"
|
|
1688
|
+
}
|
|
1689
|
+
}, layout_options_, {
|
|
1690
|
+
get children() {
|
|
1691
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Suspense), {
|
|
1692
|
+
get fallback() {
|
|
1693
|
+
return $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
1694
|
+
num_placeholders_: num_placeholders_,
|
|
1695
|
+
product_card_template_: product_card_template_
|
|
1696
|
+
});
|
|
1697
|
+
},
|
|
1698
|
+
get children() {
|
|
1699
|
+
return (() => {
|
|
1700
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
1701
|
+
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
1702
|
+
return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
1703
|
+
displays_by_key_: displays_by_key_,
|
|
1704
|
+
product_card_template_: product_card_template_
|
|
1705
|
+
});
|
|
1706
|
+
})();
|
|
1707
|
+
}
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
}))))];
|
|
1711
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
1712
|
+
get when() {
|
|
1713
|
+
return is_showing_something();
|
|
1714
|
+
},
|
|
1715
|
+
children: elements
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
var $a3bbfa5fdaa39f3a$var$_tmpl$ = ["<div", ' class="depict recommendations looks" style="', '">', "</div>"];
|
|
1719
|
+
let $a3bbfa5fdaa39f3a$var$expandedLooksSignal_;
|
|
1720
|
+
function $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa(props) {
|
|
1647
1721
|
return $95837413165cc2df$export$23fca46f3143581f(() => {
|
|
1648
|
-
$
|
|
1722
|
+
$a3bbfa5fdaa39f3a$var$expandedLooksSignal_ ||= $5vyXB$solidjs.createSignal(new Set(), {
|
|
1649
1723
|
equals: false
|
|
1650
1724
|
});
|
|
1651
1725
|
const expandingAnimationDuration = 240;
|
|
@@ -1685,38 +1759,49 @@ function $072863633018e322$export$1935e6bdfc5ed8ce(props) {
|
|
|
1685
1759
|
market: market,
|
|
1686
1760
|
locale: locale
|
|
1687
1761
|
};
|
|
1688
|
-
return $
|
|
1762
|
+
return $a3bbfa5fdaa39f3a$var$runDisplayTransformersForLooks(baseData, listings, props.displayTransformers_);
|
|
1689
1763
|
});
|
|
1764
|
+
const sharedOptions = {
|
|
1765
|
+
product_card_template_: display => $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
1766
|
+
display_: display,
|
|
1767
|
+
FavoriteButton_: props.FavoriteButton_,
|
|
1768
|
+
placeholderImageAspectRatio_: props.imagePlaceholderAspectRatio_,
|
|
1769
|
+
animationDuration_: expandingAnimationDuration,
|
|
1770
|
+
expandedLooksSignal_: $a3bbfa5fdaa39f3a$var$expandedLooksSignal_,
|
|
1771
|
+
priceFormatting_: () => props.priceFormatting_,
|
|
1772
|
+
pseudoRouter_: pseudoRouter
|
|
1773
|
+
}),
|
|
1774
|
+
recommendations_resource_: looksResource,
|
|
1775
|
+
title_: () => props.title_,
|
|
1776
|
+
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
1777
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
1778
|
+
...grid_spacing_override()
|
|
1779
|
+
}))
|
|
1780
|
+
};
|
|
1690
1781
|
$5vyXB$solidjs.createEffect(() => {
|
|
1691
1782
|
const {
|
|
1692
1783
|
onNavigation_: onNavigation_
|
|
1693
1784
|
} = props;
|
|
1694
1785
|
if (onNavigation_) pseudoRouter.on_navigation_ = onNavigation_;
|
|
1695
1786
|
});
|
|
1696
|
-
return $5vyXB$solidjsweb.ssr($
|
|
1787
|
+
return $5vyXB$solidjsweb.ssr($a3bbfa5fdaa39f3a$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrStyle(`--animation-duration: ${expandingAnimationDuration}ms`), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
1697
1788
|
get children() {
|
|
1698
|
-
return $
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
}
|
|
1708
|
-
recommendations_resource_: looksResource,
|
|
1709
|
-
title_: () => props.title_,
|
|
1710
|
-
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
1711
|
-
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
1712
|
-
...grid_spacing_override()
|
|
1713
|
-
}))
|
|
1789
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
1790
|
+
get when() {
|
|
1791
|
+
return props.gridOptions_;
|
|
1792
|
+
},
|
|
1793
|
+
get fallback() {
|
|
1794
|
+
return $5vyXB$solidjsweb.createComponent((0, $363ce4d1d71041aa$export$d41d19e89346fa2), sharedOptions);
|
|
1795
|
+
},
|
|
1796
|
+
get children() {
|
|
1797
|
+
return $5vyXB$solidjsweb.createComponent((0, $b8e79813f4f7ebe4$export$7da560f849543dff), $5vyXB$solidjsweb.mergeProps(sharedOptions, () => props.gridOptions_));
|
|
1798
|
+
}
|
|
1714
1799
|
});
|
|
1715
1800
|
}
|
|
1716
1801
|
})));
|
|
1717
1802
|
}, "LookSlider failed");
|
|
1718
1803
|
}
|
|
1719
|
-
async function $
|
|
1804
|
+
async function $a3bbfa5fdaa39f3a$var$runDisplayTransformersForLooks(baseData, listings, displayTransformers) {
|
|
1720
1805
|
try {
|
|
1721
1806
|
const {
|
|
1722
1807
|
products: productTransformer,
|
|
@@ -4340,84 +4425,9 @@ const $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1 = /*@__PURE__*/(() => {
|
|
|
4340
4425
|
const $a3280f0aad997933$export$c3834fa86c616831 = [[4], [3, 1024], [2, 901]];
|
|
4341
4426
|
const $a3280f0aad997933$export$864d304a0bc46829 = "2%";
|
|
4342
4427
|
const $a3280f0aad997933$export$7bf543b9d9be2c22 = (0, $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1);
|
|
4343
|
-
var $
|
|
4344
|
-
$b8e79813f4f7ebe4$var$_tmpl$2 = ["<div", ' class="recommendation-grid"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"];
|
|
4345
|
-
function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
4346
|
-
recommendations_resource_: recommendations_resource_,
|
|
4347
|
-
product_card_template_: product_card_template_,
|
|
4348
|
-
layout_options_: layout_options_,
|
|
4349
|
-
rows_object_: rows_object_,
|
|
4350
|
-
title_: title_
|
|
4351
|
-
}) {
|
|
4352
|
-
const is_showing_something = $5vyXB$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
|
|
4353
|
-
const title = $5vyXB$solidjs.createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
|
|
4354
|
-
const num_placeholders_ = () => 20;
|
|
4355
|
-
const elements = [$5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
4356
|
-
get when() {
|
|
4357
|
-
return title();
|
|
4358
|
-
},
|
|
4359
|
-
get children() {
|
|
4360
|
-
return $5vyXB$solidjsweb.ssr($b8e79813f4f7ebe4$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(title()));
|
|
4361
|
-
}
|
|
4362
|
-
}), $5vyXB$solidjsweb.ssr($b8e79813f4f7ebe4$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($fc23d7668ae0011d$export$a2cc176055f8f08()), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), $5vyXB$solidjsweb.mergeProps({
|
|
4363
|
-
get rows() {
|
|
4364
|
-
return rows_object_();
|
|
4365
|
-
},
|
|
4366
|
-
layout: "grid",
|
|
4367
|
-
element_attributes: {
|
|
4368
|
-
class: "cards"
|
|
4369
|
-
}
|
|
4370
|
-
}, layout_options_, {
|
|
4371
|
-
get children() {
|
|
4372
|
-
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Suspense), {
|
|
4373
|
-
get fallback() {
|
|
4374
|
-
return $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
4375
|
-
num_placeholders_: num_placeholders_,
|
|
4376
|
-
product_card_template_: product_card_template_
|
|
4377
|
-
});
|
|
4378
|
-
},
|
|
4379
|
-
get children() {
|
|
4380
|
-
return (() => {
|
|
4381
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
4382
|
-
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
4383
|
-
return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
4384
|
-
displays_by_key_: displays_by_key_,
|
|
4385
|
-
product_card_template_: product_card_template_
|
|
4386
|
-
});
|
|
4387
|
-
})();
|
|
4388
|
-
}
|
|
4389
|
-
});
|
|
4390
|
-
}
|
|
4391
|
-
}))))];
|
|
4392
|
-
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
4393
|
-
get when() {
|
|
4394
|
-
return is_showing_something();
|
|
4395
|
-
},
|
|
4396
|
-
children: elements
|
|
4397
|
-
});
|
|
4398
|
-
}
|
|
4399
|
-
var $1f8dbf7e28b3eff2$var$_tmpl$ = ["<button", ' class="show-more major" type="button">', "</button>"],
|
|
4400
|
-
$1f8dbf7e28b3eff2$var$_tmpl$2 = ["<div", ' class="depict plp recommendations">', "</div>"];
|
|
4428
|
+
var $1f8dbf7e28b3eff2$var$_tmpl$ = ["<div", ' class="depict plp recommendations">', "</div>"];
|
|
4401
4429
|
function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
|
|
4402
4430
|
return $95837413165cc2df$export$23fca46f3143581f(() => {
|
|
4403
|
-
const rows_object_ = $5vyXB$solidjs.createMemo(() => {
|
|
4404
|
-
const {
|
|
4405
|
-
view_more_button: view_more_button,
|
|
4406
|
-
max_rows: max_rows
|
|
4407
|
-
} = props;
|
|
4408
|
-
if (!view_more_button) {
|
|
4409
|
-
if (max_rows) return {
|
|
4410
|
-
max_rows: max_rows
|
|
4411
|
-
};
|
|
4412
|
-
return "all";
|
|
4413
|
-
}
|
|
4414
|
-
return {
|
|
4415
|
-
max_rows: max_rows,
|
|
4416
|
-
start_rows: view_more_button.start_rows,
|
|
4417
|
-
rows_per_click: view_more_button.rows_per_click ?? 2,
|
|
4418
|
-
button: $5vyXB$solidjsweb.ssr($1f8dbf7e28b3eff2$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(view_more_button.text))
|
|
4419
|
-
};
|
|
4420
|
-
});
|
|
4421
4431
|
const grid_spacing_override = $5vyXB$solidjs.createMemo(() => {
|
|
4422
4432
|
const {
|
|
4423
4433
|
grid_spacing: grid_spacing
|
|
@@ -4430,10 +4440,11 @@ function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
|
|
|
4430
4440
|
};
|
|
4431
4441
|
});
|
|
4432
4442
|
const [recommendations_resource_] = $5vyXB$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
4433
|
-
return $5vyXB$solidjsweb.ssr($1f8dbf7e28b3eff2$var$_tmpl
|
|
4443
|
+
return $5vyXB$solidjsweb.ssr($1f8dbf7e28b3eff2$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $84798aaa863a4909$export$e68cff63f76bd15b), {
|
|
4434
4444
|
get children() {
|
|
4435
4445
|
return $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
4436
|
-
|
|
4446
|
+
max_rows_: () => props.max_rows,
|
|
4447
|
+
view_more_button_: () => props.view_more_button,
|
|
4437
4448
|
product_card_template_: (...args) => props.product_card_template(...args),
|
|
4438
4449
|
recommendations_resource_: recommendations_resource_,
|
|
4439
4450
|
title_: () => props.title,
|
package/server/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.
|
|
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;
|