@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/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.10.22";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.10.25";
11
11
  function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
12
12
  const signal = $9HbP8$createSignal(false);
13
13
  $9HbP8$onCleanup($9HbP8$javascript_media_query(media_query, ({
@@ -1314,7 +1314,10 @@ function $6dee9211e57ac31a$export$e2f22da34aaf310a(props, container_element, ins
1314
1314
  const base_styling = $9HbP8$createMemo(() => {
1315
1315
  return `${container_selector}{display:grid;}`;
1316
1316
  });
1317
- const get_styling = $9HbP8$createMemo(() => base_styling() + col_styling());
1317
+ const get_styling = $9HbP8$createMemo(() => base_styling() + col_styling() + (props.content_block_row_styles || []).map(({
1318
+ row: row,
1319
+ template: template
1320
+ }) => `${container_selector}:has(>.content-block-wrapper.spans-multiple-rows[data-content-block-row="${row}"]){grid-template-rows:${template};}`).join(""));
1318
1321
  const style_element = (() => {
1319
1322
  var _el$2 = $9HbP8$getNextElement($6dee9211e57ac31a$var$_tmpl$2);
1320
1323
  $9HbP8$insert(_el$2, get_styling);
@@ -1493,6 +1496,7 @@ function $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
1493
1496
  }));
1494
1497
  const content_blocks_by_index_ = $9HbP8$createMemo(() => remapped_().content_blocks_by_index_);
1495
1498
  return Object.assign(content_blocks_by_index_, {
1499
+ row_styles_: $9HbP8$createMemo(() => $e7a7eb102ddc0c79$export$c4e1acd6a7f84fcf(get_wrapped_blocks_(), n_cols_currently_showing_())),
1496
1500
  trailing_: product_count => $e7a7eb102ddc0c79$export$b94605e5b3ce01c({
1497
1501
  ...remapped_(),
1498
1502
  n_cols_currently_showing_: n_cols_currently_showing_(),
@@ -1500,6 +1504,24 @@ function $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
1500
1504
  })
1501
1505
  });
1502
1506
  }
1507
+ function $e7a7eb102ddc0c79$export$c4e1acd6a7f84fcf(blocks, n_cols) {
1508
+ const styles = [];
1509
+ if (!n_cols) return styles;
1510
+ let last_row = 0;
1511
+ blocks.forEach((block, row) => {
1512
+ if (!block || block.span_rows <= 1 || block.span_columns >= n_cols) return;
1513
+ last_row = Math.max(last_row, row + block.span_rows);
1514
+ // Give product rows equal heights. Full-width cards keep their own height.
1515
+ const tracks = Array.from({
1516
+ length: last_row
1517
+ }, (_, index) => blocks[index]?.span_columns === n_cols ? "auto" : "1fr");
1518
+ styles.push({
1519
+ row: row,
1520
+ template: tracks.join(" ")
1521
+ });
1522
+ });
1523
+ return styles;
1524
+ }
1503
1525
  function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
1504
1526
  wrapped_blocks_: wrapped_blocks_,
1505
1527
  n_cols_currently_showing_: n_cols_currently_showing_
@@ -1584,11 +1606,16 @@ function $e7a7eb102ddc0c79$export$b94605e5b3ce01c({
1584
1606
  if (!n_cols_currently_showing_ || product_count <= 0) return trailing;
1585
1607
  // Find the row the last product lands in: each row has room for the columns that blocks don't take up
1586
1608
  let last_product_row = 0;
1609
+ let last_product_row_is_full = false;
1587
1610
  for (let seen_products = 0;; last_product_row++) {
1588
1611
  const row = displaced_products_[last_product_row];
1589
1612
  const taken_by_blocks = typeof row === "number" ? row : row ? row.filter(item => item).length : 0;
1590
- seen_products += Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
1591
- if (seen_products >= product_count) break;
1613
+ const product_slots_in_row = Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
1614
+ if (seen_products + product_slots_in_row >= product_count) {
1615
+ last_product_row_is_full = seen_products + product_slots_in_row === product_count;
1616
+ break;
1617
+ }
1618
+ seen_products += product_slots_in_row;
1592
1619
  // Rows past the ones blocks take up all have room for products, so we're done by then at the latest
1593
1620
  if (last_product_row >= displaced_products_.length + product_count) break;
1594
1621
  }
@@ -1596,28 +1623,34 @@ function $e7a7eb102ddc0c79$export$b94605e5b3ce01c({
1596
1623
  const block = content_blocks_by_index_[i];
1597
1624
  if (block === undefined) continue;
1598
1625
  const rows = rows_by_index_[i] || [];
1626
+ const last_allowed_row = last_product_row + (last_product_row_is_full ? 1 : 0);
1599
1627
  if (Array.isArray(block) && rows.length > 1) {
1600
- // Several blocks share this index (e.g. the end of one row and the start of the next): keep the ones in the last product's row
1601
- const in_last_row = block.filter((_, j) => rows[j] <= last_product_row);
1602
- if (in_last_row.length) trailing.push(in_last_row);
1628
+ // Several blocks can share this index. Keep only blocks in allowed trailing rows.
1629
+ const in_trailing_rows = block.filter((_, j) => rows[j] <= last_allowed_row);
1630
+ if (in_trailing_rows.length) trailing.push(in_trailing_rows);
1603
1631
  continue;
1604
1632
  }
1605
- if ((rows[0] ?? Infinity) > last_product_row) continue; // a row below the last product's row: keep it hidden
1633
+ if ((rows[0] ?? Infinity) > last_allowed_row) continue; // Keep cards meant for later rows hidden after filtering.
1606
1634
  trailing.push(block);
1607
1635
  }
1608
1636
  return trailing;
1609
1637
  }
1610
- /**
1611
- * Takes a store that contains an array from where index is number of row and value is the result of executing the content block rendering function.
1612
- * Then renders the content and wraps it into a div with the correct styling.
1613
- * Also caps span_columns to max available columns
1614
- */
1638
+ function $e7a7eb102ddc0c79$export$911278b0390ae36e(block, max_span_columns) {
1639
+ const span_columns = Math.min(block.span_columns, max_span_columns ?? Infinity);
1640
+ const spans_whole_row = span_columns === max_span_columns;
1641
+ return {
1642
+ span_columns: span_columns,
1643
+ span_rows: spans_whole_row ? 1 : block.span_rows,
1644
+ spans_whole_row: spans_whole_row,
1645
+ spans_multiple_rows: !spans_whole_row && block.span_rows > 1
1646
+ };
1647
+ }
1615
1648
  function $e7a7eb102ddc0c79$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
1616
- const get_wrapped_blocks = $9HbP8$mapArray(() => rendered_content_blocks, block => {
1649
+ const get_wrapped_blocks = $9HbP8$mapArray(() => rendered_content_blocks, (block, row) => {
1617
1650
  if (!block) return;
1618
- const final_span_columns = $9HbP8$createMemo(() => Math.min(block.span_columns, max_span_columns() ?? Infinity));
1619
- // 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
1620
- const final_span_rows = $9HbP8$createMemo(() => final_span_columns() === max_span_columns() ? 1 : block.span_rows);
1651
+ const final_spans = $9HbP8$createMemo(() => $e7a7eb102ddc0c79$export$911278b0390ae36e(block, max_span_columns()));
1652
+ const final_span_columns = $9HbP8$createMemo(() => final_spans().span_columns);
1653
+ const final_span_rows = $9HbP8$createMemo(() => final_spans().span_rows);
1621
1654
  const [rendering_delayed, set_rendering_delayed_] = $9HbP8$createSignal(true);
1622
1655
  const content = $9HbP8$createComponent((0, $9HbP8$Show), {
1623
1656
  get when() {
@@ -1631,22 +1664,28 @@ function $e7a7eb102ddc0c79$var$wrap_blocks_in_div(rendered_content_blocks, max_s
1631
1664
  }
1632
1665
  }));
1633
1666
  $9HbP8$effect(_p$ => {
1634
- var _v$ = !!(final_span_columns() === max_span_columns()),
1635
- _v$2 = {
1667
+ var _v$ = row(),
1668
+ _v$2 = !!final_spans().spans_whole_row,
1669
+ _v$3 = !!final_spans().spans_multiple_rows,
1670
+ _v$4 = {
1636
1671
  [(0, $6dee9211e57ac31a$export$c500183c31c2b22e)]: final_span_columns()
1637
1672
  },
1638
- _v$3 = `span ${final_span_columns()}`,
1639
- _v$4 = `span ${final_span_rows()}`;
1640
- _v$ !== _p$.e && _el$.classList.toggle("spans-whole-row", _p$.e = _v$);
1641
- _p$.t = $9HbP8$style(_el$, _v$2, _p$.t);
1642
- _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$.style.setProperty("grid-column", _v$3) : _el$.style.removeProperty("grid-column"));
1643
- _v$4 !== _p$.o && ((_p$.o = _v$4) != null ? _el$.style.setProperty("grid-row", _v$4) : _el$.style.removeProperty("grid-row"));
1673
+ _v$5 = `span ${final_span_columns()}`,
1674
+ _v$6 = `span ${final_span_rows()}`;
1675
+ _v$ !== _p$.e && $9HbP8$setAttribute(_el$, "data-content-block-row", _p$.e = _v$);
1676
+ _v$2 !== _p$.t && _el$.classList.toggle("spans-whole-row", _p$.t = _v$2);
1677
+ _v$3 !== _p$.a && _el$.classList.toggle("spans-multiple-rows", _p$.a = _v$3);
1678
+ _p$.o = $9HbP8$style(_el$, _v$4, _p$.o);
1679
+ _v$5 !== _p$.i && ((_p$.i = _v$5) != null ? _el$.style.setProperty("grid-column", _v$5) : _el$.style.removeProperty("grid-column"));
1680
+ _v$6 !== _p$.n && ((_p$.n = _v$6) != null ? _el$.style.setProperty("grid-row", _v$6) : _el$.style.removeProperty("grid-row"));
1644
1681
  return _p$;
1645
1682
  }, {
1646
1683
  e: undefined,
1647
1684
  t: undefined,
1648
1685
  a: undefined,
1649
- o: undefined
1686
+ o: undefined,
1687
+ i: undefined,
1688
+ n: undefined
1650
1689
  });
1651
1690
  return _el$;
1652
1691
  }
@@ -1903,6 +1942,10 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
1903
1942
  cols_at_size_: modified_cols_at_size,
1904
1943
  set_top_row_shortened_by_: set_top_row_shortened_by_
1905
1944
  }));
1945
+ const content_block_row_styles = $9HbP8$createMemo(() => {
1946
+ const blocks = content_blocks_();
1947
+ return "row_styles_" in blocks ? blocks.row_styles_() : [];
1948
+ });
1906
1949
  const rendered_placeholders = $9HbP8$createMemo(() => {
1907
1950
  if (get_should_have_placeholders_rendered()) return $6e41f1fde994db72$export$f33414a4df0afd3f({
1908
1951
  content_blocks_: content_blocks_,
@@ -2002,6 +2045,9 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
2002
2045
  class: "cards css-grid"
2003
2046
  },
2004
2047
  top_row_shortened_by_: top_row_shortened_by_,
2048
+ get content_block_row_styles() {
2049
+ return content_block_row_styles();
2050
+ },
2005
2051
  children: listing_contents
2006
2052
  });
2007
2053
  },
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.10.22",
3
+ "repository": {
4
+ "type": "git",
5
+ "url": "git+https://github.com/depict-org/depict-ui.git",
6
+ "directory": "browser-tags-v2/packages/ui"
7
+ },
8
+ "version": "4.10.25",
4
9
  "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
10
  "packageManager": "yarn@3.2.2",
6
11
  "sass": "styles.scss",
@@ -236,9 +241,9 @@
236
241
  "@babel/plugin-transform-typescript": "^7.22.9",
237
242
  "@babel/runtime": "^7.22.6",
238
243
  "@babel/runtime-corejs3": "^7.22.6",
239
- "@depict-ai/plp-styling": "^4.6.14",
240
- "@depict-ai/types": "^5.6.12",
241
- "@depict-ai/utilishared": "^2.6.12",
244
+ "@depict-ai/plp-styling": "^4.6.16",
245
+ "@depict-ai/types": "^5.6.14",
246
+ "@depict-ai/utilishared": "^2.6.14",
242
247
  "solid-js": "^1.9.10"
243
248
  },
244
249
  "type": "module",
@@ -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.22";
118
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.25";
119
119
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
120
120
  const signal = $3hooq$solidjs.createSignal(false);
121
121
  $3hooq$solidjs.onCleanup($3hooq$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -1206,19 +1206,25 @@ function $830518481649feb1$export$e2f22da34aaf310a(props, container_element) {
1206
1206
  const base_styling = $3hooq$solidjs.createMemo(() => {
1207
1207
  return "".concat(container_selector, "{display:grid;}");
1208
1208
  });
1209
- const get_styling = $3hooq$solidjs.createMemo(() => base_styling() + col_styling());
1209
+ const get_styling = $3hooq$solidjs.createMemo(() => base_styling() + col_styling() + (props.content_block_row_styles || []).map(_ref => {
1210
+ let {
1211
+ row: row,
1212
+ template: template
1213
+ } = _ref;
1214
+ return "".concat(container_selector, ':has(>.content-block-wrapper.spans-multiple-rows[data-content-block-row="').concat(row, '"]){grid-template-rows:').concat(template, ";}");
1215
+ }).join(""));
1210
1216
  const style_element = $3hooq$solidjsweb.ssr($830518481649feb1$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), get_styling); // need to create this after set_styling has been called or else there will be no styling in the SSR'd output
1211
1217
  if (insert_after_container) container_element.after(style_element);
1212
1218
  return [container_element, style_element];
1213
1219
  }
1214
- function $830518481649feb1$var$generate_media_queried_declarations(_ref) {
1220
+ function $830518481649feb1$var$generate_media_queried_declarations(_ref2) {
1215
1221
  let {
1216
1222
  container_selector_: container_selector_,
1217
1223
  default_grid_spacing_text: default_grid_spacing_text,
1218
1224
  cols_at_size_: cols_at_size_,
1219
1225
  override_vertical_spacing_: override_vertical_spacing_,
1220
1226
  top_row_shortened_by_: top_row_shortened_by_
1221
- } = _ref;
1227
+ } = _ref2;
1222
1228
  return cols_at_size_.map(options => {
1223
1229
  const [n_cols, min, max, grid_spacing_for_size] = options;
1224
1230
  const main_spacing_to_use = grid_spacing_for_size || default_grid_spacing_text;
@@ -1338,7 +1344,7 @@ function $b8a8d61b3ec5f5ac$export$3f37af283f8fb843(props) {
1338
1344
  }
1339
1345
  });
1340
1346
  }
1341
- var $f8f375d6245ffff2$var$_tmpl$ = ["<div", ' class="', '" style="', '">', "</div>"];
1347
+ var $f8f375d6245ffff2$var$_tmpl$ = ["<div", ' class="', '"', ' style="', '">', "</div>"];
1342
1348
  function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
1343
1349
  let {
1344
1350
  content_blocks_: incoming_content_blocks,
@@ -1378,6 +1384,7 @@ function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
1378
1384
  }));
1379
1385
  const content_blocks_by_index_ = $3hooq$solidjs.createMemo(() => remapped_().content_blocks_by_index_);
1380
1386
  return Object.assign(content_blocks_by_index_, {
1387
+ row_styles_: $3hooq$solidjs.createMemo(() => $f8f375d6245ffff2$export$c4e1acd6a7f84fcf(get_wrapped_blocks_(), n_cols_currently_showing_())),
1381
1388
  trailing_: product_count => $f8f375d6245ffff2$export$b94605e5b3ce01c({
1382
1389
  ...remapped_(),
1383
1390
  n_cols_currently_showing_: n_cols_currently_showing_(),
@@ -1385,6 +1392,27 @@ function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
1385
1392
  })
1386
1393
  });
1387
1394
  }
1395
+ function $f8f375d6245ffff2$export$c4e1acd6a7f84fcf(blocks, n_cols) {
1396
+ const styles = [];
1397
+ if (!n_cols) return styles;
1398
+ let last_row = 0;
1399
+ blocks.forEach((block, row) => {
1400
+ if (!block || block.span_rows <= 1 || block.span_columns >= n_cols) return;
1401
+ last_row = Math.max(last_row, row + block.span_rows);
1402
+ // Give product rows equal heights. Full-width cards keep their own height.
1403
+ const tracks = Array.from({
1404
+ length: last_row
1405
+ }, (_, index) => {
1406
+ var _blocks$index;
1407
+ return ((_blocks$index = blocks[index]) === null || _blocks$index === void 0 ? void 0 : _blocks$index.span_columns) === n_cols ? "auto" : "1fr";
1408
+ });
1409
+ styles.push({
1410
+ row: row,
1411
+ template: tracks.join(" ")
1412
+ });
1413
+ });
1414
+ return styles;
1415
+ }
1388
1416
  function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
1389
1417
  let {
1390
1418
  wrapped_blocks_: wrapped_blocks_,
@@ -1475,11 +1503,16 @@ function $f8f375d6245ffff2$export$b94605e5b3ce01c(_ref4) {
1475
1503
  if (!n_cols_currently_showing_ || product_count <= 0) return trailing;
1476
1504
  // Find the row the last product lands in: each row has room for the columns that blocks don't take up
1477
1505
  let last_product_row = 0;
1506
+ let last_product_row_is_full = false;
1478
1507
  for (let seen_products = 0;; last_product_row++) {
1479
1508
  const row = displaced_products_[last_product_row];
1480
1509
  const taken_by_blocks = typeof row === "number" ? row : row ? row.filter(item => item).length : 0;
1481
- seen_products += Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
1482
- if (seen_products >= product_count) break;
1510
+ const product_slots_in_row = Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
1511
+ if (seen_products + product_slots_in_row >= product_count) {
1512
+ last_product_row_is_full = seen_products + product_slots_in_row === product_count;
1513
+ break;
1514
+ }
1515
+ seen_products += product_slots_in_row;
1483
1516
  // Rows past the ones blocks take up all have room for products, so we're done by then at the latest
1484
1517
  if (last_product_row >= displaced_products_.length + product_count) break;
1485
1518
  }
@@ -1488,38 +1521,41 @@ function $f8f375d6245ffff2$export$b94605e5b3ce01c(_ref4) {
1488
1521
  const block = content_blocks_by_index_[i];
1489
1522
  if (block === undefined) continue;
1490
1523
  const rows = rows_by_index_[i] || [];
1524
+ const last_allowed_row = last_product_row + (last_product_row_is_full ? 1 : 0);
1491
1525
  if (Array.isArray(block) && rows.length > 1) {
1492
- // Several blocks share this index (e.g. the end of one row and the start of the next): keep the ones in the last product's row
1493
- const in_last_row = block.filter((_, j) => rows[j] <= last_product_row);
1494
- if (in_last_row.length) trailing.push(in_last_row);
1526
+ // Several blocks can share this index. Keep only blocks in allowed trailing rows.
1527
+ const in_trailing_rows = block.filter((_, j) => rows[j] <= last_allowed_row);
1528
+ if (in_trailing_rows.length) trailing.push(in_trailing_rows);
1495
1529
  continue;
1496
1530
  }
1497
- if (((_rows$ = rows[0]) !== null && _rows$ !== void 0 ? _rows$ : Infinity) > last_product_row) continue; // a row below the last product's row: keep it hidden
1531
+ if (((_rows$ = rows[0]) !== null && _rows$ !== void 0 ? _rows$ : Infinity) > last_allowed_row) continue; // Keep cards meant for later rows hidden after filtering.
1498
1532
  trailing.push(block);
1499
1533
  }
1500
1534
  return trailing;
1501
1535
  }
1502
- /**
1503
- * Takes a store that contains an array from where index is number of row and value is the result of executing the content block rendering function.
1504
- * Then renders the content and wraps it into a div with the correct styling.
1505
- * Also caps span_columns to max available columns
1506
- */
1536
+ function $f8f375d6245ffff2$export$911278b0390ae36e(block, max_span_columns) {
1537
+ const span_columns = Math.min(block.span_columns, max_span_columns !== null && max_span_columns !== void 0 ? max_span_columns : Infinity);
1538
+ const spans_whole_row = span_columns === max_span_columns;
1539
+ return {
1540
+ span_columns: span_columns,
1541
+ span_rows: spans_whole_row ? 1 : block.span_rows,
1542
+ spans_whole_row: spans_whole_row,
1543
+ spans_multiple_rows: !spans_whole_row && block.span_rows > 1
1544
+ };
1545
+ }
1507
1546
  function $f8f375d6245ffff2$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
1508
- const get_wrapped_blocks = $3hooq$solidjs.mapArray(() => rendered_content_blocks, block => {
1547
+ const get_wrapped_blocks = $3hooq$solidjs.mapArray(() => rendered_content_blocks, (block, row) => {
1509
1548
  if (!block) return;
1510
- const final_span_columns = $3hooq$solidjs.createMemo(() => {
1511
- var _max_span_columns;
1512
- return Math.min(block.span_columns, (_max_span_columns = max_span_columns()) !== null && _max_span_columns !== void 0 ? _max_span_columns : Infinity);
1513
- });
1514
- // 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
1515
- const final_span_rows = $3hooq$solidjs.createMemo(() => final_span_columns() === max_span_columns() ? 1 : block.span_rows);
1549
+ const final_spans = $3hooq$solidjs.createMemo(() => $f8f375d6245ffff2$export$911278b0390ae36e(block, max_span_columns()));
1550
+ const final_span_columns = $3hooq$solidjs.createMemo(() => final_spans().span_columns);
1551
+ const final_span_rows = $3hooq$solidjs.createMemo(() => final_spans().span_rows);
1516
1552
  const [rendering_delayed, set_rendering_delayed_] = $3hooq$solidjs.createSignal(true);
1517
1553
  const content = $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
1518
1554
  get when() {
1519
1555
  return !rendering_delayed();
1520
1556
  },
1521
1557
  get children() {
1522
- return $3hooq$solidjsweb.ssr($f8f375d6245ffff2$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "content-block-wrapper ".concat(final_span_columns() === max_span_columns() ? "spans-whole-row" : ""), "grid-column:" + "span ".concat($3hooq$solidjsweb.escape(final_span_columns(), true)) + (";grid-row:" + "span ".concat($3hooq$solidjsweb.escape(final_span_rows(), true))) + (";spans_columns_variable_name:" + $3hooq$solidjsweb.escape(final_span_columns(), true)), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent($f8f375d6245ffff2$var$RenderContent, {
1558
+ return $3hooq$solidjsweb.ssr($f8f375d6245ffff2$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "content-block-wrapper ".concat(final_spans().spans_whole_row ? "spans-whole-row" : "", " ").concat(final_spans().spans_multiple_rows ? "spans-multiple-rows" : ""), $3hooq$solidjsweb.ssrAttribute("data-content-block-row", $3hooq$solidjsweb.escape(row(), true), false), "grid-column:" + "span ".concat($3hooq$solidjsweb.escape(final_span_columns(), true)) + (";grid-row:" + "span ".concat($3hooq$solidjsweb.escape(final_span_rows(), true))) + (";spans_columns_variable_name:" + $3hooq$solidjsweb.escape(final_span_columns(), true)), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent($f8f375d6245ffff2$var$RenderContent, {
1523
1559
  get content() {
1524
1560
  return block.content;
1525
1561
  }
@@ -1748,6 +1784,10 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
1748
1784
  cols_at_size_: modified_cols_at_size,
1749
1785
  set_top_row_shortened_by_: set_top_row_shortened_by_
1750
1786
  }));
1787
+ const content_block_row_styles = $3hooq$solidjs.createMemo(() => {
1788
+ const blocks = content_blocks_();
1789
+ return "row_styles_" in blocks ? blocks.row_styles_() : [];
1790
+ });
1751
1791
  const rendered_placeholders = $3hooq$solidjs.createMemo(() => {
1752
1792
  if (get_should_have_placeholders_rendered()) return $e3915574cfd3466c$export$f33414a4df0afd3f({
1753
1793
  content_blocks_: content_blocks_,
@@ -1847,6 +1887,9 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
1847
1887
  class: "cards css-grid"
1848
1888
  },
1849
1889
  top_row_shortened_by_: top_row_shortened_by_,
1890
+ get content_block_row_styles() {
1891
+ return content_block_row_styles();
1892
+ },
1850
1893
  children: listing_contents
1851
1894
  });
1852
1895
  },
@@ -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.22";
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
  */
@@ -10,7 +10,7 @@ import $b8hua$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.22";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.10.25";
14
14
  function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
15
15
  const signal = $b8hua$createSignal(false);
16
16
  $b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
@@ -1101,19 +1101,25 @@ function $64d94dcaa058dc7b$export$e2f22da34aaf310a(props, container_element) {
1101
1101
  const base_styling = $b8hua$createMemo(() => {
1102
1102
  return "".concat(container_selector, "{display:grid;}");
1103
1103
  });
1104
- const get_styling = $b8hua$createMemo(() => base_styling() + col_styling());
1104
+ const get_styling = $b8hua$createMemo(() => base_styling() + col_styling() + (props.content_block_row_styles || []).map(_ref => {
1105
+ let {
1106
+ row: row,
1107
+ template: template
1108
+ } = _ref;
1109
+ return "".concat(container_selector, ':has(>.content-block-wrapper.spans-multiple-rows[data-content-block-row="').concat(row, '"]){grid-template-rows:').concat(template, ";}");
1110
+ }).join(""));
1105
1111
  const style_element = $b8hua$ssr($64d94dcaa058dc7b$var$_tmpl$, $b8hua$ssrHydrationKey(), get_styling); // need to create this after set_styling has been called or else there will be no styling in the SSR'd output
1106
1112
  if (insert_after_container) container_element.after(style_element);
1107
1113
  return [container_element, style_element];
1108
1114
  }
1109
- function $64d94dcaa058dc7b$var$generate_media_queried_declarations(_ref) {
1115
+ function $64d94dcaa058dc7b$var$generate_media_queried_declarations(_ref2) {
1110
1116
  let {
1111
1117
  container_selector_: container_selector_,
1112
1118
  default_grid_spacing_text: default_grid_spacing_text,
1113
1119
  cols_at_size_: cols_at_size_,
1114
1120
  override_vertical_spacing_: override_vertical_spacing_,
1115
1121
  top_row_shortened_by_: top_row_shortened_by_
1116
- } = _ref;
1122
+ } = _ref2;
1117
1123
  return cols_at_size_.map(options => {
1118
1124
  const [n_cols, min, max, grid_spacing_for_size] = options;
1119
1125
  const main_spacing_to_use = grid_spacing_for_size || default_grid_spacing_text;
@@ -1233,7 +1239,7 @@ function $3ab4aa97880fb88d$export$3f37af283f8fb843(props) {
1233
1239
  }
1234
1240
  });
1235
1241
  }
1236
- var $ff7feae4dddd6073$var$_tmpl$ = ["<div", ' class="', '" style="', '">', "</div>"];
1242
+ var $ff7feae4dddd6073$var$_tmpl$ = ["<div", ' class="', '"', ' style="', '">', "</div>"];
1237
1243
  function $ff7feae4dddd6073$export$791ef57e62e21c3f(_ref) {
1238
1244
  let {
1239
1245
  content_blocks_: incoming_content_blocks,
@@ -1273,6 +1279,7 @@ function $ff7feae4dddd6073$export$791ef57e62e21c3f(_ref) {
1273
1279
  }));
1274
1280
  const content_blocks_by_index_ = $b8hua$createMemo(() => remapped_().content_blocks_by_index_);
1275
1281
  return Object.assign(content_blocks_by_index_, {
1282
+ row_styles_: $b8hua$createMemo(() => $ff7feae4dddd6073$export$c4e1acd6a7f84fcf(get_wrapped_blocks_(), n_cols_currently_showing_())),
1276
1283
  trailing_: product_count => $ff7feae4dddd6073$export$b94605e5b3ce01c({
1277
1284
  ...remapped_(),
1278
1285
  n_cols_currently_showing_: n_cols_currently_showing_(),
@@ -1280,6 +1287,27 @@ function $ff7feae4dddd6073$export$791ef57e62e21c3f(_ref) {
1280
1287
  })
1281
1288
  });
1282
1289
  }
1290
+ function $ff7feae4dddd6073$export$c4e1acd6a7f84fcf(blocks, n_cols) {
1291
+ const styles = [];
1292
+ if (!n_cols) return styles;
1293
+ let last_row = 0;
1294
+ blocks.forEach((block, row) => {
1295
+ if (!block || block.span_rows <= 1 || block.span_columns >= n_cols) return;
1296
+ last_row = Math.max(last_row, row + block.span_rows);
1297
+ // Give product rows equal heights. Full-width cards keep their own height.
1298
+ const tracks = Array.from({
1299
+ length: last_row
1300
+ }, (_, index) => {
1301
+ var _blocks$index;
1302
+ return ((_blocks$index = blocks[index]) === null || _blocks$index === void 0 ? void 0 : _blocks$index.span_columns) === n_cols ? "auto" : "1fr";
1303
+ });
1304
+ styles.push({
1305
+ row: row,
1306
+ template: tracks.join(" ")
1307
+ });
1308
+ });
1309
+ return styles;
1310
+ }
1283
1311
  function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
1284
1312
  let {
1285
1313
  wrapped_blocks_: wrapped_blocks_,
@@ -1370,11 +1398,16 @@ function $ff7feae4dddd6073$export$b94605e5b3ce01c(_ref4) {
1370
1398
  if (!n_cols_currently_showing_ || product_count <= 0) return trailing;
1371
1399
  // Find the row the last product lands in: each row has room for the columns that blocks don't take up
1372
1400
  let last_product_row = 0;
1401
+ let last_product_row_is_full = false;
1373
1402
  for (let seen_products = 0;; last_product_row++) {
1374
1403
  const row = displaced_products_[last_product_row];
1375
1404
  const taken_by_blocks = typeof row === "number" ? row : row ? row.filter(item => item).length : 0;
1376
- seen_products += Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
1377
- if (seen_products >= product_count) break;
1405
+ const product_slots_in_row = Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
1406
+ if (seen_products + product_slots_in_row >= product_count) {
1407
+ last_product_row_is_full = seen_products + product_slots_in_row === product_count;
1408
+ break;
1409
+ }
1410
+ seen_products += product_slots_in_row;
1378
1411
  // Rows past the ones blocks take up all have room for products, so we're done by then at the latest
1379
1412
  if (last_product_row >= displaced_products_.length + product_count) break;
1380
1413
  }
@@ -1383,38 +1416,41 @@ function $ff7feae4dddd6073$export$b94605e5b3ce01c(_ref4) {
1383
1416
  const block = content_blocks_by_index_[i];
1384
1417
  if (block === undefined) continue;
1385
1418
  const rows = rows_by_index_[i] || [];
1419
+ const last_allowed_row = last_product_row + (last_product_row_is_full ? 1 : 0);
1386
1420
  if (Array.isArray(block) && rows.length > 1) {
1387
- // Several blocks share this index (e.g. the end of one row and the start of the next): keep the ones in the last product's row
1388
- const in_last_row = block.filter((_, j) => rows[j] <= last_product_row);
1389
- if (in_last_row.length) trailing.push(in_last_row);
1421
+ // Several blocks can share this index. Keep only blocks in allowed trailing rows.
1422
+ const in_trailing_rows = block.filter((_, j) => rows[j] <= last_allowed_row);
1423
+ if (in_trailing_rows.length) trailing.push(in_trailing_rows);
1390
1424
  continue;
1391
1425
  }
1392
- if (((_rows$ = rows[0]) !== null && _rows$ !== void 0 ? _rows$ : Infinity) > last_product_row) continue; // a row below the last product's row: keep it hidden
1426
+ if (((_rows$ = rows[0]) !== null && _rows$ !== void 0 ? _rows$ : Infinity) > last_allowed_row) continue; // Keep cards meant for later rows hidden after filtering.
1393
1427
  trailing.push(block);
1394
1428
  }
1395
1429
  return trailing;
1396
1430
  }
1397
- /**
1398
- * Takes a store that contains an array from where index is number of row and value is the result of executing the content block rendering function.
1399
- * Then renders the content and wraps it into a div with the correct styling.
1400
- * Also caps span_columns to max available columns
1401
- */
1431
+ function $ff7feae4dddd6073$export$911278b0390ae36e(block, max_span_columns) {
1432
+ const span_columns = Math.min(block.span_columns, max_span_columns !== null && max_span_columns !== void 0 ? max_span_columns : Infinity);
1433
+ const spans_whole_row = span_columns === max_span_columns;
1434
+ return {
1435
+ span_columns: span_columns,
1436
+ span_rows: spans_whole_row ? 1 : block.span_rows,
1437
+ spans_whole_row: spans_whole_row,
1438
+ spans_multiple_rows: !spans_whole_row && block.span_rows > 1
1439
+ };
1440
+ }
1402
1441
  function $ff7feae4dddd6073$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
1403
- const get_wrapped_blocks = $b8hua$mapArray(() => rendered_content_blocks, block => {
1442
+ const get_wrapped_blocks = $b8hua$mapArray(() => rendered_content_blocks, (block, row) => {
1404
1443
  if (!block) return;
1405
- const final_span_columns = $b8hua$createMemo(() => {
1406
- var _max_span_columns;
1407
- return Math.min(block.span_columns, (_max_span_columns = max_span_columns()) !== null && _max_span_columns !== void 0 ? _max_span_columns : Infinity);
1408
- });
1409
- // 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
1410
- const final_span_rows = $b8hua$createMemo(() => final_span_columns() === max_span_columns() ? 1 : block.span_rows);
1444
+ const final_spans = $b8hua$createMemo(() => $ff7feae4dddd6073$export$911278b0390ae36e(block, max_span_columns()));
1445
+ const final_span_columns = $b8hua$createMemo(() => final_spans().span_columns);
1446
+ const final_span_rows = $b8hua$createMemo(() => final_spans().span_rows);
1411
1447
  const [rendering_delayed, set_rendering_delayed_] = $b8hua$createSignal(true);
1412
1448
  const content = $b8hua$createComponent((0, $b8hua$Show), {
1413
1449
  get when() {
1414
1450
  return !rendering_delayed();
1415
1451
  },
1416
1452
  get children() {
1417
- return $b8hua$ssr($ff7feae4dddd6073$var$_tmpl$, $b8hua$ssrHydrationKey(), "content-block-wrapper ".concat(final_span_columns() === max_span_columns() ? "spans-whole-row" : ""), "grid-column:" + "span ".concat($b8hua$escape(final_span_columns(), true)) + (";grid-row:" + "span ".concat($b8hua$escape(final_span_rows(), true))) + (";spans_columns_variable_name:" + $b8hua$escape(final_span_columns(), true)), $b8hua$escape($b8hua$createComponent($ff7feae4dddd6073$var$RenderContent, {
1453
+ return $b8hua$ssr($ff7feae4dddd6073$var$_tmpl$, $b8hua$ssrHydrationKey(), "content-block-wrapper ".concat(final_spans().spans_whole_row ? "spans-whole-row" : "", " ").concat(final_spans().spans_multiple_rows ? "spans-multiple-rows" : ""), $b8hua$ssrAttribute("data-content-block-row", $b8hua$escape(row(), true), false), "grid-column:" + "span ".concat($b8hua$escape(final_span_columns(), true)) + (";grid-row:" + "span ".concat($b8hua$escape(final_span_rows(), true))) + (";spans_columns_variable_name:" + $b8hua$escape(final_span_columns(), true)), $b8hua$escape($b8hua$createComponent($ff7feae4dddd6073$var$RenderContent, {
1418
1454
  get content() {
1419
1455
  return block.content;
1420
1456
  }
@@ -1643,6 +1679,10 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
1643
1679
  cols_at_size_: modified_cols_at_size,
1644
1680
  set_top_row_shortened_by_: set_top_row_shortened_by_
1645
1681
  }));
1682
+ const content_block_row_styles = $b8hua$createMemo(() => {
1683
+ const blocks = content_blocks_();
1684
+ return "row_styles_" in blocks ? blocks.row_styles_() : [];
1685
+ });
1646
1686
  const rendered_placeholders = $b8hua$createMemo(() => {
1647
1687
  if (get_should_have_placeholders_rendered()) return $bdd80c7862246dc2$export$f33414a4df0afd3f({
1648
1688
  content_blocks_: content_blocks_,
@@ -1742,6 +1782,9 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
1742
1782
  class: "cards css-grid"
1743
1783
  },
1744
1784
  top_row_shortened_by_: top_row_shortened_by_,
1785
+ get content_block_row_styles() {
1786
+ return content_block_row_styles();
1787
+ },
1745
1788
  children: listing_contents
1746
1789
  });
1747
1790
  },