@depict-ai/ui 4.10.22 → 4.10.25
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 +80 -31
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +80 -31
- package/latest/index.cjs +72 -26
- package/latest/index.d.ts +1 -1
- package/latest/index.js +72 -26
- package/package.json +9 -4
- package/server/ES10/index.cjs +67 -24
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +67 -24
- package/server/latest/index.cjs +59 -19
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +59 -19
package/ES10/index.cjs
CHANGED
|
@@ -115,7 +115,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
115
115
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
116
116
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
117
117
|
/*! Depict.ai search and product listing SDK */
|
|
118
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.
|
|
118
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.25";
|
|
119
119
|
function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
|
|
120
120
|
const signal = $52FdA$solidjs.createSignal(false);
|
|
121
121
|
$52FdA$solidjs.onCleanup($52FdA$depictaiutilishared.javascript_media_query(media_query, _ref => {
|
|
@@ -1482,7 +1482,13 @@ function $830518481649feb1$export$e2f22da34aaf310a(props, container_element) {
|
|
|
1482
1482
|
const base_styling = $52FdA$solidjs.createMemo(() => {
|
|
1483
1483
|
return "".concat(container_selector, "{display:grid;}");
|
|
1484
1484
|
});
|
|
1485
|
-
const get_styling = $52FdA$solidjs.createMemo(() => base_styling() + col_styling())
|
|
1485
|
+
const get_styling = $52FdA$solidjs.createMemo(() => base_styling() + col_styling() + (props.content_block_row_styles || []).map(_ref => {
|
|
1486
|
+
let {
|
|
1487
|
+
row: row,
|
|
1488
|
+
template: template
|
|
1489
|
+
} = _ref;
|
|
1490
|
+
return "".concat(container_selector, ':has(>.content-block-wrapper.spans-multiple-rows[data-content-block-row="').concat(row, '"]){grid-template-rows:').concat(template, ";}");
|
|
1491
|
+
}).join(""));
|
|
1486
1492
|
const style_element = (() => {
|
|
1487
1493
|
var _el$2 = $52FdA$solidjsweb.getNextElement($830518481649feb1$var$_tmpl$2);
|
|
1488
1494
|
$52FdA$solidjsweb.insert(_el$2, get_styling);
|
|
@@ -1491,14 +1497,14 @@ function $830518481649feb1$export$e2f22da34aaf310a(props, container_element) {
|
|
|
1491
1497
|
if (insert_after_container) container_element.after(style_element);
|
|
1492
1498
|
return [container_element, style_element];
|
|
1493
1499
|
}
|
|
1494
|
-
function $830518481649feb1$var$generate_media_queried_declarations(
|
|
1500
|
+
function $830518481649feb1$var$generate_media_queried_declarations(_ref2) {
|
|
1495
1501
|
let {
|
|
1496
1502
|
container_selector_: container_selector_,
|
|
1497
1503
|
default_grid_spacing_text: default_grid_spacing_text,
|
|
1498
1504
|
cols_at_size_: cols_at_size_,
|
|
1499
1505
|
override_vertical_spacing_: override_vertical_spacing_,
|
|
1500
1506
|
top_row_shortened_by_: top_row_shortened_by_
|
|
1501
|
-
} =
|
|
1507
|
+
} = _ref2;
|
|
1502
1508
|
return cols_at_size_.map(options => {
|
|
1503
1509
|
const [n_cols, min, max, grid_spacing_for_size] = options;
|
|
1504
1510
|
const main_spacing_to_use = grid_spacing_for_size || default_grid_spacing_text;
|
|
@@ -1671,6 +1677,7 @@ function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
|
|
|
1671
1677
|
}));
|
|
1672
1678
|
const content_blocks_by_index_ = $52FdA$solidjs.createMemo(() => remapped_().content_blocks_by_index_);
|
|
1673
1679
|
return Object.assign(content_blocks_by_index_, {
|
|
1680
|
+
row_styles_: $52FdA$solidjs.createMemo(() => $f8f375d6245ffff2$export$c4e1acd6a7f84fcf(get_wrapped_blocks_(), n_cols_currently_showing_())),
|
|
1674
1681
|
trailing_: product_count => $f8f375d6245ffff2$export$b94605e5b3ce01c({
|
|
1675
1682
|
...remapped_(),
|
|
1676
1683
|
n_cols_currently_showing_: n_cols_currently_showing_(),
|
|
@@ -1678,6 +1685,27 @@ function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
|
|
|
1678
1685
|
})
|
|
1679
1686
|
});
|
|
1680
1687
|
}
|
|
1688
|
+
function $f8f375d6245ffff2$export$c4e1acd6a7f84fcf(blocks, n_cols) {
|
|
1689
|
+
const styles = [];
|
|
1690
|
+
if (!n_cols) return styles;
|
|
1691
|
+
let last_row = 0;
|
|
1692
|
+
blocks.forEach((block, row) => {
|
|
1693
|
+
if (!block || block.span_rows <= 1 || block.span_columns >= n_cols) return;
|
|
1694
|
+
last_row = Math.max(last_row, row + block.span_rows);
|
|
1695
|
+
// Give product rows equal heights. Full-width cards keep their own height.
|
|
1696
|
+
const tracks = Array.from({
|
|
1697
|
+
length: last_row
|
|
1698
|
+
}, (_, index) => {
|
|
1699
|
+
var _blocks$index;
|
|
1700
|
+
return ((_blocks$index = blocks[index]) === null || _blocks$index === void 0 ? void 0 : _blocks$index.span_columns) === n_cols ? "auto" : "1fr";
|
|
1701
|
+
});
|
|
1702
|
+
styles.push({
|
|
1703
|
+
row: row,
|
|
1704
|
+
template: tracks.join(" ")
|
|
1705
|
+
});
|
|
1706
|
+
});
|
|
1707
|
+
return styles;
|
|
1708
|
+
}
|
|
1681
1709
|
function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
|
|
1682
1710
|
let {
|
|
1683
1711
|
wrapped_blocks_: wrapped_blocks_,
|
|
@@ -1768,11 +1796,16 @@ function $f8f375d6245ffff2$export$b94605e5b3ce01c(_ref4) {
|
|
|
1768
1796
|
if (!n_cols_currently_showing_ || product_count <= 0) return trailing;
|
|
1769
1797
|
// Find the row the last product lands in: each row has room for the columns that blocks don't take up
|
|
1770
1798
|
let last_product_row = 0;
|
|
1799
|
+
let last_product_row_is_full = false;
|
|
1771
1800
|
for (let seen_products = 0;; last_product_row++) {
|
|
1772
1801
|
const row = displaced_products_[last_product_row];
|
|
1773
1802
|
const taken_by_blocks = typeof row === "number" ? row : row ? row.filter(item => item).length : 0;
|
|
1774
|
-
|
|
1775
|
-
if (seen_products >= product_count)
|
|
1803
|
+
const product_slots_in_row = Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
|
|
1804
|
+
if (seen_products + product_slots_in_row >= product_count) {
|
|
1805
|
+
last_product_row_is_full = seen_products + product_slots_in_row === product_count;
|
|
1806
|
+
break;
|
|
1807
|
+
}
|
|
1808
|
+
seen_products += product_slots_in_row;
|
|
1776
1809
|
// Rows past the ones blocks take up all have room for products, so we're done by then at the latest
|
|
1777
1810
|
if (last_product_row >= displaced_products_.length + product_count) break;
|
|
1778
1811
|
}
|
|
@@ -1781,31 +1814,34 @@ function $f8f375d6245ffff2$export$b94605e5b3ce01c(_ref4) {
|
|
|
1781
1814
|
const block = content_blocks_by_index_[i];
|
|
1782
1815
|
if (block === undefined) continue;
|
|
1783
1816
|
const rows = rows_by_index_[i] || [];
|
|
1817
|
+
const last_allowed_row = last_product_row + (last_product_row_is_full ? 1 : 0);
|
|
1784
1818
|
if (Array.isArray(block) && rows.length > 1) {
|
|
1785
|
-
// Several blocks share this index
|
|
1786
|
-
const
|
|
1787
|
-
if (
|
|
1819
|
+
// Several blocks can share this index. Keep only blocks in allowed trailing rows.
|
|
1820
|
+
const in_trailing_rows = block.filter((_, j) => rows[j] <= last_allowed_row);
|
|
1821
|
+
if (in_trailing_rows.length) trailing.push(in_trailing_rows);
|
|
1788
1822
|
continue;
|
|
1789
1823
|
}
|
|
1790
|
-
if (((_rows$ = rows[0]) !== null && _rows$ !== void 0 ? _rows$ : Infinity) >
|
|
1824
|
+
if (((_rows$ = rows[0]) !== null && _rows$ !== void 0 ? _rows$ : Infinity) > last_allowed_row) continue; // Keep cards meant for later rows hidden after filtering.
|
|
1791
1825
|
trailing.push(block);
|
|
1792
1826
|
}
|
|
1793
1827
|
return trailing;
|
|
1794
1828
|
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1829
|
+
function $f8f375d6245ffff2$export$911278b0390ae36e(block, max_span_columns) {
|
|
1830
|
+
const span_columns = Math.min(block.span_columns, max_span_columns !== null && max_span_columns !== void 0 ? max_span_columns : Infinity);
|
|
1831
|
+
const spans_whole_row = span_columns === max_span_columns;
|
|
1832
|
+
return {
|
|
1833
|
+
span_columns: span_columns,
|
|
1834
|
+
span_rows: spans_whole_row ? 1 : block.span_rows,
|
|
1835
|
+
spans_whole_row: spans_whole_row,
|
|
1836
|
+
spans_multiple_rows: !spans_whole_row && block.span_rows > 1
|
|
1837
|
+
};
|
|
1838
|
+
}
|
|
1800
1839
|
function $f8f375d6245ffff2$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
|
|
1801
|
-
const get_wrapped_blocks = $52FdA$solidjs.mapArray(() => rendered_content_blocks, block => {
|
|
1840
|
+
const get_wrapped_blocks = $52FdA$solidjs.mapArray(() => rendered_content_blocks, (block, row) => {
|
|
1802
1841
|
if (!block) return;
|
|
1803
|
-
const
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
});
|
|
1807
|
-
// If the item spans an entire row, limit the height to 1 row since there's no concept of "rows" if there are no products beside the block
|
|
1808
|
-
const final_span_rows = $52FdA$solidjs.createMemo(() => final_span_columns() === max_span_columns() ? 1 : block.span_rows);
|
|
1842
|
+
const final_spans = $52FdA$solidjs.createMemo(() => $f8f375d6245ffff2$export$911278b0390ae36e(block, max_span_columns()));
|
|
1843
|
+
const final_span_columns = $52FdA$solidjs.createMemo(() => final_spans().span_columns);
|
|
1844
|
+
const final_span_rows = $52FdA$solidjs.createMemo(() => final_spans().span_rows);
|
|
1809
1845
|
const [rendering_delayed, set_rendering_delayed_] = $52FdA$solidjs.createSignal(true);
|
|
1810
1846
|
const content = $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
1811
1847
|
get when() {
|
|
@@ -1819,22 +1855,28 @@ function $f8f375d6245ffff2$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
1819
1855
|
}
|
|
1820
1856
|
}));
|
|
1821
1857
|
$52FdA$solidjsweb.effect(_p$ => {
|
|
1822
|
-
var _v$ =
|
|
1823
|
-
_v$2 =
|
|
1858
|
+
var _v$ = row(),
|
|
1859
|
+
_v$2 = !!final_spans().spans_whole_row,
|
|
1860
|
+
_v$3 = !!final_spans().spans_multiple_rows,
|
|
1861
|
+
_v$4 = {
|
|
1824
1862
|
[(0, $830518481649feb1$export$c500183c31c2b22e)]: final_span_columns()
|
|
1825
1863
|
},
|
|
1826
|
-
_v$
|
|
1827
|
-
_v$
|
|
1828
|
-
_v$ !== _p$.e &&
|
|
1829
|
-
_p$.t
|
|
1830
|
-
_v$3 !== _p$.a &&
|
|
1831
|
-
|
|
1864
|
+
_v$5 = "span ".concat(final_span_columns()),
|
|
1865
|
+
_v$6 = "span ".concat(final_span_rows());
|
|
1866
|
+
_v$ !== _p$.e && $52FdA$solidjsweb.setAttribute(_el$, "data-content-block-row", _p$.e = _v$);
|
|
1867
|
+
_v$2 !== _p$.t && _el$.classList.toggle("spans-whole-row", _p$.t = _v$2);
|
|
1868
|
+
_v$3 !== _p$.a && _el$.classList.toggle("spans-multiple-rows", _p$.a = _v$3);
|
|
1869
|
+
_p$.o = $52FdA$solidjsweb.style(_el$, _v$4, _p$.o);
|
|
1870
|
+
_v$5 !== _p$.i && ((_p$.i = _v$5) != null ? _el$.style.setProperty("grid-column", _v$5) : _el$.style.removeProperty("grid-column"));
|
|
1871
|
+
_v$6 !== _p$.n && ((_p$.n = _v$6) != null ? _el$.style.setProperty("grid-row", _v$6) : _el$.style.removeProperty("grid-row"));
|
|
1832
1872
|
return _p$;
|
|
1833
1873
|
}, {
|
|
1834
1874
|
e: undefined,
|
|
1835
1875
|
t: undefined,
|
|
1836
1876
|
a: undefined,
|
|
1837
|
-
o: undefined
|
|
1877
|
+
o: undefined,
|
|
1878
|
+
i: undefined,
|
|
1879
|
+
n: undefined
|
|
1838
1880
|
});
|
|
1839
1881
|
return _el$;
|
|
1840
1882
|
}
|
|
@@ -2100,6 +2142,10 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
2100
2142
|
cols_at_size_: modified_cols_at_size,
|
|
2101
2143
|
set_top_row_shortened_by_: set_top_row_shortened_by_
|
|
2102
2144
|
}));
|
|
2145
|
+
const content_block_row_styles = $52FdA$solidjs.createMemo(() => {
|
|
2146
|
+
const blocks = content_blocks_();
|
|
2147
|
+
return "row_styles_" in blocks ? blocks.row_styles_() : [];
|
|
2148
|
+
});
|
|
2103
2149
|
const rendered_placeholders = $52FdA$solidjs.createMemo(() => {
|
|
2104
2150
|
if (get_should_have_placeholders_rendered()) return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
2105
2151
|
content_blocks_: content_blocks_,
|
|
@@ -2199,6 +2245,9 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
2199
2245
|
class: "cards css-grid"
|
|
2200
2246
|
},
|
|
2201
2247
|
top_row_shortened_by_: top_row_shortened_by_,
|
|
2248
|
+
get content_block_row_styles() {
|
|
2249
|
+
return content_block_row_styles();
|
|
2250
|
+
},
|
|
2202
2251
|
children: listing_contents
|
|
2203
2252
|
});
|
|
2204
2253
|
},
|
package/ES10/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.10.
|
|
14
|
+
export const version = "4.10.25";
|
|
15
15
|
/**
|
|
16
16
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
17
17
|
*/
|
package/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.10.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.10.25";
|
|
14
14
|
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
15
15
|
const signal = $8tj43$createSignal(false);
|
|
16
16
|
$8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
|
|
@@ -1377,7 +1377,13 @@ function $64d94dcaa058dc7b$export$e2f22da34aaf310a(props, container_element) {
|
|
|
1377
1377
|
const base_styling = $8tj43$createMemo(() => {
|
|
1378
1378
|
return "".concat(container_selector, "{display:grid;}");
|
|
1379
1379
|
});
|
|
1380
|
-
const get_styling = $8tj43$createMemo(() => base_styling() + col_styling())
|
|
1380
|
+
const get_styling = $8tj43$createMemo(() => base_styling() + col_styling() + (props.content_block_row_styles || []).map(_ref => {
|
|
1381
|
+
let {
|
|
1382
|
+
row: row,
|
|
1383
|
+
template: template
|
|
1384
|
+
} = _ref;
|
|
1385
|
+
return "".concat(container_selector, ':has(>.content-block-wrapper.spans-multiple-rows[data-content-block-row="').concat(row, '"]){grid-template-rows:').concat(template, ";}");
|
|
1386
|
+
}).join(""));
|
|
1381
1387
|
const style_element = (() => {
|
|
1382
1388
|
var _el$2 = $8tj43$getNextElement($64d94dcaa058dc7b$var$_tmpl$2);
|
|
1383
1389
|
$8tj43$insert(_el$2, get_styling);
|
|
@@ -1386,14 +1392,14 @@ function $64d94dcaa058dc7b$export$e2f22da34aaf310a(props, container_element) {
|
|
|
1386
1392
|
if (insert_after_container) container_element.after(style_element);
|
|
1387
1393
|
return [container_element, style_element];
|
|
1388
1394
|
}
|
|
1389
|
-
function $64d94dcaa058dc7b$var$generate_media_queried_declarations(
|
|
1395
|
+
function $64d94dcaa058dc7b$var$generate_media_queried_declarations(_ref2) {
|
|
1390
1396
|
let {
|
|
1391
1397
|
container_selector_: container_selector_,
|
|
1392
1398
|
default_grid_spacing_text: default_grid_spacing_text,
|
|
1393
1399
|
cols_at_size_: cols_at_size_,
|
|
1394
1400
|
override_vertical_spacing_: override_vertical_spacing_,
|
|
1395
1401
|
top_row_shortened_by_: top_row_shortened_by_
|
|
1396
|
-
} =
|
|
1402
|
+
} = _ref2;
|
|
1397
1403
|
return cols_at_size_.map(options => {
|
|
1398
1404
|
const [n_cols, min, max, grid_spacing_for_size] = options;
|
|
1399
1405
|
const main_spacing_to_use = grid_spacing_for_size || default_grid_spacing_text;
|
|
@@ -1566,6 +1572,7 @@ function $ff7feae4dddd6073$export$791ef57e62e21c3f(_ref) {
|
|
|
1566
1572
|
}));
|
|
1567
1573
|
const content_blocks_by_index_ = $8tj43$createMemo(() => remapped_().content_blocks_by_index_);
|
|
1568
1574
|
return Object.assign(content_blocks_by_index_, {
|
|
1575
|
+
row_styles_: $8tj43$createMemo(() => $ff7feae4dddd6073$export$c4e1acd6a7f84fcf(get_wrapped_blocks_(), n_cols_currently_showing_())),
|
|
1569
1576
|
trailing_: product_count => $ff7feae4dddd6073$export$b94605e5b3ce01c({
|
|
1570
1577
|
...remapped_(),
|
|
1571
1578
|
n_cols_currently_showing_: n_cols_currently_showing_(),
|
|
@@ -1573,6 +1580,27 @@ function $ff7feae4dddd6073$export$791ef57e62e21c3f(_ref) {
|
|
|
1573
1580
|
})
|
|
1574
1581
|
});
|
|
1575
1582
|
}
|
|
1583
|
+
function $ff7feae4dddd6073$export$c4e1acd6a7f84fcf(blocks, n_cols) {
|
|
1584
|
+
const styles = [];
|
|
1585
|
+
if (!n_cols) return styles;
|
|
1586
|
+
let last_row = 0;
|
|
1587
|
+
blocks.forEach((block, row) => {
|
|
1588
|
+
if (!block || block.span_rows <= 1 || block.span_columns >= n_cols) return;
|
|
1589
|
+
last_row = Math.max(last_row, row + block.span_rows);
|
|
1590
|
+
// Give product rows equal heights. Full-width cards keep their own height.
|
|
1591
|
+
const tracks = Array.from({
|
|
1592
|
+
length: last_row
|
|
1593
|
+
}, (_, index) => {
|
|
1594
|
+
var _blocks$index;
|
|
1595
|
+
return ((_blocks$index = blocks[index]) === null || _blocks$index === void 0 ? void 0 : _blocks$index.span_columns) === n_cols ? "auto" : "1fr";
|
|
1596
|
+
});
|
|
1597
|
+
styles.push({
|
|
1598
|
+
row: row,
|
|
1599
|
+
template: tracks.join(" ")
|
|
1600
|
+
});
|
|
1601
|
+
});
|
|
1602
|
+
return styles;
|
|
1603
|
+
}
|
|
1576
1604
|
function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
1577
1605
|
let {
|
|
1578
1606
|
wrapped_blocks_: wrapped_blocks_,
|
|
@@ -1663,11 +1691,16 @@ function $ff7feae4dddd6073$export$b94605e5b3ce01c(_ref4) {
|
|
|
1663
1691
|
if (!n_cols_currently_showing_ || product_count <= 0) return trailing;
|
|
1664
1692
|
// Find the row the last product lands in: each row has room for the columns that blocks don't take up
|
|
1665
1693
|
let last_product_row = 0;
|
|
1694
|
+
let last_product_row_is_full = false;
|
|
1666
1695
|
for (let seen_products = 0;; last_product_row++) {
|
|
1667
1696
|
const row = displaced_products_[last_product_row];
|
|
1668
1697
|
const taken_by_blocks = typeof row === "number" ? row : row ? row.filter(item => item).length : 0;
|
|
1669
|
-
|
|
1670
|
-
if (seen_products >= product_count)
|
|
1698
|
+
const product_slots_in_row = Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
|
|
1699
|
+
if (seen_products + product_slots_in_row >= product_count) {
|
|
1700
|
+
last_product_row_is_full = seen_products + product_slots_in_row === product_count;
|
|
1701
|
+
break;
|
|
1702
|
+
}
|
|
1703
|
+
seen_products += product_slots_in_row;
|
|
1671
1704
|
// Rows past the ones blocks take up all have room for products, so we're done by then at the latest
|
|
1672
1705
|
if (last_product_row >= displaced_products_.length + product_count) break;
|
|
1673
1706
|
}
|
|
@@ -1676,31 +1709,34 @@ function $ff7feae4dddd6073$export$b94605e5b3ce01c(_ref4) {
|
|
|
1676
1709
|
const block = content_blocks_by_index_[i];
|
|
1677
1710
|
if (block === undefined) continue;
|
|
1678
1711
|
const rows = rows_by_index_[i] || [];
|
|
1712
|
+
const last_allowed_row = last_product_row + (last_product_row_is_full ? 1 : 0);
|
|
1679
1713
|
if (Array.isArray(block) && rows.length > 1) {
|
|
1680
|
-
// Several blocks share this index
|
|
1681
|
-
const
|
|
1682
|
-
if (
|
|
1714
|
+
// Several blocks can share this index. Keep only blocks in allowed trailing rows.
|
|
1715
|
+
const in_trailing_rows = block.filter((_, j) => rows[j] <= last_allowed_row);
|
|
1716
|
+
if (in_trailing_rows.length) trailing.push(in_trailing_rows);
|
|
1683
1717
|
continue;
|
|
1684
1718
|
}
|
|
1685
|
-
if (((_rows$ = rows[0]) !== null && _rows$ !== void 0 ? _rows$ : Infinity) >
|
|
1719
|
+
if (((_rows$ = rows[0]) !== null && _rows$ !== void 0 ? _rows$ : Infinity) > last_allowed_row) continue; // Keep cards meant for later rows hidden after filtering.
|
|
1686
1720
|
trailing.push(block);
|
|
1687
1721
|
}
|
|
1688
1722
|
return trailing;
|
|
1689
1723
|
}
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1724
|
+
function $ff7feae4dddd6073$export$911278b0390ae36e(block, max_span_columns) {
|
|
1725
|
+
const span_columns = Math.min(block.span_columns, max_span_columns !== null && max_span_columns !== void 0 ? max_span_columns : Infinity);
|
|
1726
|
+
const spans_whole_row = span_columns === max_span_columns;
|
|
1727
|
+
return {
|
|
1728
|
+
span_columns: span_columns,
|
|
1729
|
+
span_rows: spans_whole_row ? 1 : block.span_rows,
|
|
1730
|
+
spans_whole_row: spans_whole_row,
|
|
1731
|
+
spans_multiple_rows: !spans_whole_row && block.span_rows > 1
|
|
1732
|
+
};
|
|
1733
|
+
}
|
|
1695
1734
|
function $ff7feae4dddd6073$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
|
|
1696
|
-
const get_wrapped_blocks = $8tj43$mapArray(() => rendered_content_blocks, block => {
|
|
1735
|
+
const get_wrapped_blocks = $8tj43$mapArray(() => rendered_content_blocks, (block, row) => {
|
|
1697
1736
|
if (!block) return;
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
});
|
|
1702
|
-
// If the item spans an entire row, limit the height to 1 row since there's no concept of "rows" if there are no products beside the block
|
|
1703
|
-
const final_span_rows = $8tj43$createMemo(() => final_span_columns() === max_span_columns() ? 1 : block.span_rows);
|
|
1737
|
+
const final_spans = $8tj43$createMemo(() => $ff7feae4dddd6073$export$911278b0390ae36e(block, max_span_columns()));
|
|
1738
|
+
const final_span_columns = $8tj43$createMemo(() => final_spans().span_columns);
|
|
1739
|
+
const final_span_rows = $8tj43$createMemo(() => final_spans().span_rows);
|
|
1704
1740
|
const [rendering_delayed, set_rendering_delayed_] = $8tj43$createSignal(true);
|
|
1705
1741
|
const content = $8tj43$createComponent((0, $8tj43$Show), {
|
|
1706
1742
|
get when() {
|
|
@@ -1714,22 +1750,28 @@ function $ff7feae4dddd6073$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
1714
1750
|
}
|
|
1715
1751
|
}));
|
|
1716
1752
|
$8tj43$effect(_p$ => {
|
|
1717
|
-
var _v$ =
|
|
1718
|
-
_v$2 =
|
|
1753
|
+
var _v$ = row(),
|
|
1754
|
+
_v$2 = !!final_spans().spans_whole_row,
|
|
1755
|
+
_v$3 = !!final_spans().spans_multiple_rows,
|
|
1756
|
+
_v$4 = {
|
|
1719
1757
|
[(0, $64d94dcaa058dc7b$export$c500183c31c2b22e)]: final_span_columns()
|
|
1720
1758
|
},
|
|
1721
|
-
_v$
|
|
1722
|
-
_v$
|
|
1723
|
-
_v$ !== _p$.e && _el
|
|
1724
|
-
_p$.t
|
|
1725
|
-
_v$3 !== _p$.a &&
|
|
1726
|
-
|
|
1759
|
+
_v$5 = "span ".concat(final_span_columns()),
|
|
1760
|
+
_v$6 = "span ".concat(final_span_rows());
|
|
1761
|
+
_v$ !== _p$.e && $8tj43$setAttribute(_el$, "data-content-block-row", _p$.e = _v$);
|
|
1762
|
+
_v$2 !== _p$.t && _el$.classList.toggle("spans-whole-row", _p$.t = _v$2);
|
|
1763
|
+
_v$3 !== _p$.a && _el$.classList.toggle("spans-multiple-rows", _p$.a = _v$3);
|
|
1764
|
+
_p$.o = $8tj43$style(_el$, _v$4, _p$.o);
|
|
1765
|
+
_v$5 !== _p$.i && ((_p$.i = _v$5) != null ? _el$.style.setProperty("grid-column", _v$5) : _el$.style.removeProperty("grid-column"));
|
|
1766
|
+
_v$6 !== _p$.n && ((_p$.n = _v$6) != null ? _el$.style.setProperty("grid-row", _v$6) : _el$.style.removeProperty("grid-row"));
|
|
1727
1767
|
return _p$;
|
|
1728
1768
|
}, {
|
|
1729
1769
|
e: undefined,
|
|
1730
1770
|
t: undefined,
|
|
1731
1771
|
a: undefined,
|
|
1732
|
-
o: undefined
|
|
1772
|
+
o: undefined,
|
|
1773
|
+
i: undefined,
|
|
1774
|
+
n: undefined
|
|
1733
1775
|
});
|
|
1734
1776
|
return _el$;
|
|
1735
1777
|
}
|
|
@@ -1995,6 +2037,10 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
1995
2037
|
cols_at_size_: modified_cols_at_size,
|
|
1996
2038
|
set_top_row_shortened_by_: set_top_row_shortened_by_
|
|
1997
2039
|
}));
|
|
2040
|
+
const content_block_row_styles = $8tj43$createMemo(() => {
|
|
2041
|
+
const blocks = content_blocks_();
|
|
2042
|
+
return "row_styles_" in blocks ? blocks.row_styles_() : [];
|
|
2043
|
+
});
|
|
1998
2044
|
const rendered_placeholders = $8tj43$createMemo(() => {
|
|
1999
2045
|
if (get_should_have_placeholders_rendered()) return $bdd80c7862246dc2$export$f33414a4df0afd3f({
|
|
2000
2046
|
content_blocks_: content_blocks_,
|
|
@@ -2094,6 +2140,9 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
|
|
|
2094
2140
|
class: "cards css-grid"
|
|
2095
2141
|
},
|
|
2096
2142
|
top_row_shortened_by_: top_row_shortened_by_,
|
|
2143
|
+
get content_block_row_styles() {
|
|
2144
|
+
return content_block_row_styles();
|
|
2145
|
+
},
|
|
2097
2146
|
children: listing_contents
|
|
2098
2147
|
});
|
|
2099
2148
|
},
|
package/latest/index.cjs
CHANGED
|
@@ -109,7 +109,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
|
|
|
109
109
|
$parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
|
|
110
110
|
$parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
|
|
111
111
|
/*! Depict.ai search and product listing SDK */
|
|
112
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.10.
|
|
112
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.10.25";
|
|
113
113
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
114
114
|
const signal = $gVhhF$solidjs.createSignal(false);
|
|
115
115
|
$gVhhF$solidjs.onCleanup($gVhhF$depictaiutilishared.javascript_media_query(media_query, ({
|
|
@@ -1416,7 +1416,10 @@ function $75777da1687ba3f6$export$e2f22da34aaf310a(props, container_element, ins
|
|
|
1416
1416
|
const base_styling = $gVhhF$solidjs.createMemo(() => {
|
|
1417
1417
|
return `${container_selector}{display:grid;}`;
|
|
1418
1418
|
});
|
|
1419
|
-
const get_styling = $gVhhF$solidjs.createMemo(() => base_styling() + col_styling())
|
|
1419
|
+
const get_styling = $gVhhF$solidjs.createMemo(() => base_styling() + col_styling() + (props.content_block_row_styles || []).map(({
|
|
1420
|
+
row: row,
|
|
1421
|
+
template: template
|
|
1422
|
+
}) => `${container_selector}:has(>.content-block-wrapper.spans-multiple-rows[data-content-block-row="${row}"]){grid-template-rows:${template};}`).join(""));
|
|
1420
1423
|
const style_element = (() => {
|
|
1421
1424
|
var _el$2 = $gVhhF$solidjsweb.getNextElement($75777da1687ba3f6$var$_tmpl$2);
|
|
1422
1425
|
$gVhhF$solidjsweb.insert(_el$2, get_styling);
|
|
@@ -1595,6 +1598,7 @@ function $d92f338ba8f9da9b$export$791ef57e62e21c3f({
|
|
|
1595
1598
|
}));
|
|
1596
1599
|
const content_blocks_by_index_ = $gVhhF$solidjs.createMemo(() => remapped_().content_blocks_by_index_);
|
|
1597
1600
|
return Object.assign(content_blocks_by_index_, {
|
|
1601
|
+
row_styles_: $gVhhF$solidjs.createMemo(() => $d92f338ba8f9da9b$export$c4e1acd6a7f84fcf(get_wrapped_blocks_(), n_cols_currently_showing_())),
|
|
1598
1602
|
trailing_: product_count => $d92f338ba8f9da9b$export$b94605e5b3ce01c({
|
|
1599
1603
|
...remapped_(),
|
|
1600
1604
|
n_cols_currently_showing_: n_cols_currently_showing_(),
|
|
@@ -1602,6 +1606,24 @@ function $d92f338ba8f9da9b$export$791ef57e62e21c3f({
|
|
|
1602
1606
|
})
|
|
1603
1607
|
});
|
|
1604
1608
|
}
|
|
1609
|
+
function $d92f338ba8f9da9b$export$c4e1acd6a7f84fcf(blocks, n_cols) {
|
|
1610
|
+
const styles = [];
|
|
1611
|
+
if (!n_cols) return styles;
|
|
1612
|
+
let last_row = 0;
|
|
1613
|
+
blocks.forEach((block, row) => {
|
|
1614
|
+
if (!block || block.span_rows <= 1 || block.span_columns >= n_cols) return;
|
|
1615
|
+
last_row = Math.max(last_row, row + block.span_rows);
|
|
1616
|
+
// Give product rows equal heights. Full-width cards keep their own height.
|
|
1617
|
+
const tracks = Array.from({
|
|
1618
|
+
length: last_row
|
|
1619
|
+
}, (_, index) => blocks[index]?.span_columns === n_cols ? "auto" : "1fr");
|
|
1620
|
+
styles.push({
|
|
1621
|
+
row: row,
|
|
1622
|
+
template: tracks.join(" ")
|
|
1623
|
+
});
|
|
1624
|
+
});
|
|
1625
|
+
return styles;
|
|
1626
|
+
}
|
|
1605
1627
|
function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
1606
1628
|
wrapped_blocks_: wrapped_blocks_,
|
|
1607
1629
|
n_cols_currently_showing_: n_cols_currently_showing_
|
|
@@ -1686,11 +1708,16 @@ function $d92f338ba8f9da9b$export$b94605e5b3ce01c({
|
|
|
1686
1708
|
if (!n_cols_currently_showing_ || product_count <= 0) return trailing;
|
|
1687
1709
|
// Find the row the last product lands in: each row has room for the columns that blocks don't take up
|
|
1688
1710
|
let last_product_row = 0;
|
|
1711
|
+
let last_product_row_is_full = false;
|
|
1689
1712
|
for (let seen_products = 0;; last_product_row++) {
|
|
1690
1713
|
const row = displaced_products_[last_product_row];
|
|
1691
1714
|
const taken_by_blocks = typeof row === "number" ? row : row ? row.filter(item => item).length : 0;
|
|
1692
|
-
|
|
1693
|
-
if (seen_products >= product_count)
|
|
1715
|
+
const product_slots_in_row = Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
|
|
1716
|
+
if (seen_products + product_slots_in_row >= product_count) {
|
|
1717
|
+
last_product_row_is_full = seen_products + product_slots_in_row === product_count;
|
|
1718
|
+
break;
|
|
1719
|
+
}
|
|
1720
|
+
seen_products += product_slots_in_row;
|
|
1694
1721
|
// Rows past the ones blocks take up all have room for products, so we're done by then at the latest
|
|
1695
1722
|
if (last_product_row >= displaced_products_.length + product_count) break;
|
|
1696
1723
|
}
|
|
@@ -1698,28 +1725,34 @@ function $d92f338ba8f9da9b$export$b94605e5b3ce01c({
|
|
|
1698
1725
|
const block = content_blocks_by_index_[i];
|
|
1699
1726
|
if (block === undefined) continue;
|
|
1700
1727
|
const rows = rows_by_index_[i] || [];
|
|
1728
|
+
const last_allowed_row = last_product_row + (last_product_row_is_full ? 1 : 0);
|
|
1701
1729
|
if (Array.isArray(block) && rows.length > 1) {
|
|
1702
|
-
// Several blocks share this index
|
|
1703
|
-
const
|
|
1704
|
-
if (
|
|
1730
|
+
// Several blocks can share this index. Keep only blocks in allowed trailing rows.
|
|
1731
|
+
const in_trailing_rows = block.filter((_, j) => rows[j] <= last_allowed_row);
|
|
1732
|
+
if (in_trailing_rows.length) trailing.push(in_trailing_rows);
|
|
1705
1733
|
continue;
|
|
1706
1734
|
}
|
|
1707
|
-
if ((rows[0] ?? Infinity) >
|
|
1735
|
+
if ((rows[0] ?? Infinity) > last_allowed_row) continue; // Keep cards meant for later rows hidden after filtering.
|
|
1708
1736
|
trailing.push(block);
|
|
1709
1737
|
}
|
|
1710
1738
|
return trailing;
|
|
1711
1739
|
}
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1740
|
+
function $d92f338ba8f9da9b$export$911278b0390ae36e(block, max_span_columns) {
|
|
1741
|
+
const span_columns = Math.min(block.span_columns, max_span_columns ?? Infinity);
|
|
1742
|
+
const spans_whole_row = span_columns === max_span_columns;
|
|
1743
|
+
return {
|
|
1744
|
+
span_columns: span_columns,
|
|
1745
|
+
span_rows: spans_whole_row ? 1 : block.span_rows,
|
|
1746
|
+
spans_whole_row: spans_whole_row,
|
|
1747
|
+
spans_multiple_rows: !spans_whole_row && block.span_rows > 1
|
|
1748
|
+
};
|
|
1749
|
+
}
|
|
1717
1750
|
function $d92f338ba8f9da9b$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
|
|
1718
|
-
const get_wrapped_blocks = $gVhhF$solidjs.mapArray(() => rendered_content_blocks, block => {
|
|
1751
|
+
const get_wrapped_blocks = $gVhhF$solidjs.mapArray(() => rendered_content_blocks, (block, row) => {
|
|
1719
1752
|
if (!block) return;
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1722
|
-
const final_span_rows = $gVhhF$solidjs.createMemo(() =>
|
|
1753
|
+
const final_spans = $gVhhF$solidjs.createMemo(() => $d92f338ba8f9da9b$export$911278b0390ae36e(block, max_span_columns()));
|
|
1754
|
+
const final_span_columns = $gVhhF$solidjs.createMemo(() => final_spans().span_columns);
|
|
1755
|
+
const final_span_rows = $gVhhF$solidjs.createMemo(() => final_spans().span_rows);
|
|
1723
1756
|
const [rendering_delayed, set_rendering_delayed_] = $gVhhF$solidjs.createSignal(true);
|
|
1724
1757
|
const content = $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
1725
1758
|
get when() {
|
|
@@ -1733,22 +1766,28 @@ function $d92f338ba8f9da9b$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
1733
1766
|
}
|
|
1734
1767
|
}));
|
|
1735
1768
|
$gVhhF$solidjsweb.effect(_p$ => {
|
|
1736
|
-
var _v$ =
|
|
1737
|
-
_v$2 =
|
|
1769
|
+
var _v$ = row(),
|
|
1770
|
+
_v$2 = !!final_spans().spans_whole_row,
|
|
1771
|
+
_v$3 = !!final_spans().spans_multiple_rows,
|
|
1772
|
+
_v$4 = {
|
|
1738
1773
|
[(0, $75777da1687ba3f6$export$c500183c31c2b22e)]: final_span_columns()
|
|
1739
1774
|
},
|
|
1740
|
-
_v$
|
|
1741
|
-
_v$
|
|
1742
|
-
_v$ !== _p$.e &&
|
|
1743
|
-
_p$.t
|
|
1744
|
-
_v$3 !== _p$.a &&
|
|
1745
|
-
|
|
1775
|
+
_v$5 = `span ${final_span_columns()}`,
|
|
1776
|
+
_v$6 = `span ${final_span_rows()}`;
|
|
1777
|
+
_v$ !== _p$.e && $gVhhF$solidjsweb.setAttribute(_el$, "data-content-block-row", _p$.e = _v$);
|
|
1778
|
+
_v$2 !== _p$.t && _el$.classList.toggle("spans-whole-row", _p$.t = _v$2);
|
|
1779
|
+
_v$3 !== _p$.a && _el$.classList.toggle("spans-multiple-rows", _p$.a = _v$3);
|
|
1780
|
+
_p$.o = $gVhhF$solidjsweb.style(_el$, _v$4, _p$.o);
|
|
1781
|
+
_v$5 !== _p$.i && ((_p$.i = _v$5) != null ? _el$.style.setProperty("grid-column", _v$5) : _el$.style.removeProperty("grid-column"));
|
|
1782
|
+
_v$6 !== _p$.n && ((_p$.n = _v$6) != null ? _el$.style.setProperty("grid-row", _v$6) : _el$.style.removeProperty("grid-row"));
|
|
1746
1783
|
return _p$;
|
|
1747
1784
|
}, {
|
|
1748
1785
|
e: undefined,
|
|
1749
1786
|
t: undefined,
|
|
1750
1787
|
a: undefined,
|
|
1751
|
-
o: undefined
|
|
1788
|
+
o: undefined,
|
|
1789
|
+
i: undefined,
|
|
1790
|
+
n: undefined
|
|
1752
1791
|
});
|
|
1753
1792
|
return _el$;
|
|
1754
1793
|
}
|
|
@@ -2005,6 +2044,10 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
2005
2044
|
cols_at_size_: modified_cols_at_size,
|
|
2006
2045
|
set_top_row_shortened_by_: set_top_row_shortened_by_
|
|
2007
2046
|
}));
|
|
2047
|
+
const content_block_row_styles = $gVhhF$solidjs.createMemo(() => {
|
|
2048
|
+
const blocks = content_blocks_();
|
|
2049
|
+
return "row_styles_" in blocks ? blocks.row_styles_() : [];
|
|
2050
|
+
});
|
|
2008
2051
|
const rendered_placeholders = $gVhhF$solidjs.createMemo(() => {
|
|
2009
2052
|
if (get_should_have_placeholders_rendered()) return $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
2010
2053
|
content_blocks_: content_blocks_,
|
|
@@ -2104,6 +2147,9 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
2104
2147
|
class: "cards css-grid"
|
|
2105
2148
|
},
|
|
2106
2149
|
top_row_shortened_by_: top_row_shortened_by_,
|
|
2150
|
+
get content_block_row_styles() {
|
|
2151
|
+
return content_block_row_styles();
|
|
2152
|
+
},
|
|
2107
2153
|
children: listing_contents
|
|
2108
2154
|
});
|
|
2109
2155
|
},
|
package/latest/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.10.
|
|
14
|
+
export const version = "4.10.25";
|
|
15
15
|
/**
|
|
16
16
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
17
17
|
*/
|