@depict-ai/ui 4.10.21 → 4.10.24
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 +81 -17
- package/ES10/index.d.ts +2 -4
- package/ES10/index.js +81 -17
- package/latest/index.cjs +78 -14
- package/latest/index.d.ts +2 -4
- package/latest/index.js +78 -14
- package/package.json +9 -4
- package/server/ES10/index.cjs +81 -17
- package/server/ES10/index.d.ts +2 -4
- package/server/ES10/index.js +81 -17
- package/server/latest/index.cjs +78 -14
- package/server/latest/index.d.ts +2 -4
- package/server/latest/index.js +78 -14
package/server/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.24";
|
|
113
113
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
114
114
|
const signal = $5vyXB$solidjs.createSignal(false);
|
|
115
115
|
$5vyXB$solidjs.onCleanup($5vyXB$depictaiutilishared.javascript_media_query(media_query, ({
|
|
@@ -1001,8 +1001,14 @@ function $ac167f6af6a48fc3$export$a1fd619a4743ca08({
|
|
|
1001
1001
|
setFirstResultInViewport(Math.min(...intersecting) + 1); // +1 because we want to start counting at 1
|
|
1002
1002
|
setLastResultsInViewport(Math.max(...intersecting) + 1);
|
|
1003
1003
|
});
|
|
1004
|
-
|
|
1004
|
+
// Content blocks placed after the last product (but still in its row) have no product card to render in front of, so render them after the cards once there are no more products to load
|
|
1005
|
+
const trailingContentBlocks_ = $5vyXB$solidjs.createMemo(() => {
|
|
1006
|
+
if (!all_products_loaded_[0]()) return [];
|
|
1007
|
+
return content_blocks_?.()?.trailing_?.(displays_by_key_().size) || [];
|
|
1008
|
+
});
|
|
1009
|
+
return [renderedDisplays_, trailingContentBlocks_]; // Regarding the as unknown: https://github.com/solidjs/solid/releases/tag/v1.7.0
|
|
1005
1010
|
}
|
|
1011
|
+
|
|
1006
1012
|
var $f48d0fbb00835aaa$var$_tmpl$ = ["<div", ' class="', '">', "</div>"],
|
|
1007
1013
|
$f48d0fbb00835aaa$var$_tmpl$2 = ["<style", ' type="text/css">', "</style>"];
|
|
1008
1014
|
function $f48d0fbb00835aaa$export$d21e32dfedac04be(props) {
|
|
@@ -1303,10 +1309,18 @@ function $d92f338ba8f9da9b$export$791ef57e62e21c3f({
|
|
|
1303
1309
|
set_top_row_shortened_by_(blocks_in_top_row_taken - 1); // minus one because the content block wrapper also is an element
|
|
1304
1310
|
});
|
|
1305
1311
|
|
|
1306
|
-
|
|
1312
|
+
const remapped_ = $5vyXB$solidjs.createMemo(() => $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
1307
1313
|
wrapped_blocks_: get_wrapped_blocks_(),
|
|
1308
1314
|
n_cols_currently_showing_: n_cols_currently_showing_()
|
|
1309
|
-
})
|
|
1315
|
+
}));
|
|
1316
|
+
const content_blocks_by_index_ = $5vyXB$solidjs.createMemo(() => remapped_().content_blocks_by_index_);
|
|
1317
|
+
return Object.assign(content_blocks_by_index_, {
|
|
1318
|
+
trailing_: product_count => $d92f338ba8f9da9b$export$b94605e5b3ce01c({
|
|
1319
|
+
...remapped_(),
|
|
1320
|
+
n_cols_currently_showing_: n_cols_currently_showing_(),
|
|
1321
|
+
product_count: product_count
|
|
1322
|
+
})
|
|
1323
|
+
});
|
|
1310
1324
|
}
|
|
1311
1325
|
function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
1312
1326
|
wrapped_blocks_: wrapped_blocks_,
|
|
@@ -1314,13 +1328,16 @@ function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
|
1314
1328
|
}) {
|
|
1315
1329
|
// This computation should be quite cheap since it just moves around things into an array
|
|
1316
1330
|
const content_blocks_by_index_ = [];
|
|
1331
|
+
const rows_by_index_ = []; // the row of each block at each index of content_blocks_by_index_, in the same order
|
|
1317
1332
|
const constructed_block_arrays = new WeakSet();
|
|
1318
1333
|
// Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
|
|
1319
1334
|
const displaced_products_ = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
|
|
1320
1335
|
if (!n_cols_currently_showing_)
|
|
1321
1336
|
// Nope out of here if we don't know how many columns are showing
|
|
1322
1337
|
return {
|
|
1323
|
-
content_blocks_by_index_: content_blocks_by_index_
|
|
1338
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
1339
|
+
rows_by_index_: rows_by_index_,
|
|
1340
|
+
displaced_products_: displaced_products_
|
|
1324
1341
|
};
|
|
1325
1342
|
for (let i = 0; i < wrapped_blocks_.length; i++) {
|
|
1326
1343
|
// i = row to show at
|
|
@@ -1365,6 +1382,7 @@ function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
|
1365
1382
|
content_blocks_by_index_[final_target_index] = array;
|
|
1366
1383
|
}
|
|
1367
1384
|
} else content_blocks_by_index_[final_target_index] = block_content;
|
|
1385
|
+
(rows_by_index_[final_target_index] ||= []).push(i);
|
|
1368
1386
|
// Update displacement
|
|
1369
1387
|
for (let j = 0; j < span_rows; j++) {
|
|
1370
1388
|
const row = displaced_products_[i + j] ||= [];
|
|
@@ -1373,27 +1391,72 @@ function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
|
1373
1391
|
}
|
|
1374
1392
|
return {
|
|
1375
1393
|
content_blocks_by_index_: content_blocks_by_index_,
|
|
1394
|
+
rows_by_index_: rows_by_index_,
|
|
1376
1395
|
displaced_products_: displaced_products_
|
|
1377
1396
|
};
|
|
1378
1397
|
}
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1398
|
+
function $d92f338ba8f9da9b$export$b94605e5b3ce01c({
|
|
1399
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
1400
|
+
rows_by_index_: rows_by_index_,
|
|
1401
|
+
displaced_products_: displaced_products_,
|
|
1402
|
+
n_cols_currently_showing_: n_cols_currently_showing_,
|
|
1403
|
+
product_count: product_count
|
|
1404
|
+
}) {
|
|
1405
|
+
const trailing = [];
|
|
1406
|
+
if (!n_cols_currently_showing_ || product_count <= 0) return trailing;
|
|
1407
|
+
// Find the row the last product lands in: each row has room for the columns that blocks don't take up
|
|
1408
|
+
let last_product_row = 0;
|
|
1409
|
+
let last_product_row_is_full = false;
|
|
1410
|
+
for (let seen_products = 0;; last_product_row++) {
|
|
1411
|
+
const row = displaced_products_[last_product_row];
|
|
1412
|
+
const taken_by_blocks = typeof row === "number" ? row : row ? row.filter(item => item).length : 0;
|
|
1413
|
+
const product_slots_in_row = Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
|
|
1414
|
+
if (seen_products + product_slots_in_row >= product_count) {
|
|
1415
|
+
last_product_row_is_full = seen_products + product_slots_in_row === product_count;
|
|
1416
|
+
break;
|
|
1417
|
+
}
|
|
1418
|
+
seen_products += product_slots_in_row;
|
|
1419
|
+
// Rows past the ones blocks take up all have room for products, so we're done by then at the latest
|
|
1420
|
+
if (last_product_row >= displaced_products_.length + product_count) break;
|
|
1421
|
+
}
|
|
1422
|
+
for (let i = product_count; i < content_blocks_by_index_.length; i++) {
|
|
1423
|
+
const block = content_blocks_by_index_[i];
|
|
1424
|
+
if (block === undefined) continue;
|
|
1425
|
+
const rows = rows_by_index_[i] || [];
|
|
1426
|
+
const last_allowed_row = last_product_row + (last_product_row_is_full ? 1 : 0);
|
|
1427
|
+
if (Array.isArray(block) && rows.length > 1) {
|
|
1428
|
+
// Several blocks can share this index. Keep only blocks in allowed trailing rows.
|
|
1429
|
+
const in_trailing_rows = block.filter((_, j) => rows[j] <= last_allowed_row);
|
|
1430
|
+
if (in_trailing_rows.length) trailing.push(in_trailing_rows);
|
|
1431
|
+
continue;
|
|
1432
|
+
}
|
|
1433
|
+
if ((rows[0] ?? Infinity) > last_allowed_row) continue; // Keep cards meant for later rows hidden after filtering.
|
|
1434
|
+
trailing.push(block);
|
|
1435
|
+
}
|
|
1436
|
+
return trailing;
|
|
1437
|
+
}
|
|
1438
|
+
function $d92f338ba8f9da9b$export$911278b0390ae36e(block, max_span_columns) {
|
|
1439
|
+
const span_columns = Math.min(block.span_columns, max_span_columns ?? Infinity);
|
|
1440
|
+
const spans_whole_row = span_columns === max_span_columns;
|
|
1441
|
+
return {
|
|
1442
|
+
span_columns: span_columns,
|
|
1443
|
+
span_rows: spans_whole_row ? 1 : block.span_rows,
|
|
1444
|
+
spans_whole_row: spans_whole_row
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1384
1447
|
function $d92f338ba8f9da9b$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
|
|
1385
1448
|
const get_wrapped_blocks = $5vyXB$solidjs.mapArray(() => rendered_content_blocks, block => {
|
|
1386
1449
|
if (!block) return;
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
const final_span_rows = $5vyXB$solidjs.createMemo(() =>
|
|
1450
|
+
const final_spans = $5vyXB$solidjs.createMemo(() => $d92f338ba8f9da9b$export$911278b0390ae36e(block, max_span_columns()));
|
|
1451
|
+
const final_span_columns = $5vyXB$solidjs.createMemo(() => final_spans().span_columns);
|
|
1452
|
+
const final_span_rows = $5vyXB$solidjs.createMemo(() => final_spans().span_rows);
|
|
1390
1453
|
const [rendering_delayed, set_rendering_delayed_] = $5vyXB$solidjs.createSignal(true);
|
|
1391
1454
|
const content = $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
1392
1455
|
get when() {
|
|
1393
1456
|
return !rendering_delayed();
|
|
1394
1457
|
},
|
|
1395
1458
|
get children() {
|
|
1396
|
-
return $5vyXB$solidjsweb.ssr($d92f338ba8f9da9b$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `content-block-wrapper ${
|
|
1459
|
+
return $5vyXB$solidjsweb.ssr($d92f338ba8f9da9b$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `content-block-wrapper ${final_spans().spans_whole_row ? "spans-whole-row" : ""}`, "grid-column:" + `span ${$5vyXB$solidjsweb.escape(final_span_columns(), true)}` + (";grid-row:" + `span ${$5vyXB$solidjsweb.escape(final_span_rows(), true)}`) + (";spans_columns_variable_name:" + $5vyXB$solidjsweb.escape(final_span_columns(), true)), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent($d92f338ba8f9da9b$var$RenderContent, {
|
|
1397
1460
|
get content() {
|
|
1398
1461
|
return block.content;
|
|
1399
1462
|
}
|
|
@@ -1405,6 +1468,7 @@ function $d92f338ba8f9da9b$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
1405
1468
|
content: () => {
|
|
1406
1469
|
// Sneaky on-demand rendering, so we don't render more blocks than we can show: we have the rendered value here and don't return a function that renders because if our block would be moved around we'd be guaranteed to re-render
|
|
1407
1470
|
// However, no need to count products to know if we should render: the <For> loops in Placeholders and render_displays will only call this function if there's actually a product here that wants to display this block
|
|
1471
|
+
// (or, once all products have loaded, ResultsProductCards renders the blocks placed after the last product)
|
|
1408
1472
|
set_rendering_delayed_(false);
|
|
1409
1473
|
return content;
|
|
1410
1474
|
},
|
package/server/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.24";
|
|
15
15
|
/**
|
|
16
16
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
17
17
|
*/
|
|
@@ -425,10 +425,8 @@ export function remap_blocks_to_index<T = () => JSX.Element | Promise<JSX.Elemen
|
|
|
425
425
|
})[];
|
|
426
426
|
n_cols_currently_showing_: number | null;
|
|
427
427
|
}): {
|
|
428
|
-
content_blocks_by_index_: (Awaited<T> | T[])[];
|
|
429
|
-
readonly displaced_products_?: undefined;
|
|
430
|
-
} | {
|
|
431
428
|
readonly content_blocks_by_index_: (Awaited<T> | T[])[];
|
|
429
|
+
readonly rows_by_index_: number[][];
|
|
432
430
|
readonly displaced_products_: (number | (true | undefined)[])[];
|
|
433
431
|
};
|
|
434
432
|
/** @jsxImportSource solid-js */
|
package/server/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$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.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.10.24";
|
|
11
11
|
function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
12
12
|
const signal = $i7OB2$createSignal(false);
|
|
13
13
|
$i7OB2$onCleanup($i7OB2$javascript_media_query(media_query, ({
|
|
@@ -899,8 +899,14 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({
|
|
|
899
899
|
setFirstResultInViewport(Math.min(...intersecting) + 1); // +1 because we want to start counting at 1
|
|
900
900
|
setLastResultsInViewport(Math.max(...intersecting) + 1);
|
|
901
901
|
});
|
|
902
|
-
|
|
902
|
+
// Content blocks placed after the last product (but still in its row) have no product card to render in front of, so render them after the cards once there are no more products to load
|
|
903
|
+
const trailingContentBlocks_ = $i7OB2$createMemo(() => {
|
|
904
|
+
if (!all_products_loaded_[0]()) return [];
|
|
905
|
+
return content_blocks_?.()?.trailing_?.(displays_by_key_().size) || [];
|
|
906
|
+
});
|
|
907
|
+
return [renderedDisplays_, trailingContentBlocks_]; // Regarding the as unknown: https://github.com/solidjs/solid/releases/tag/v1.7.0
|
|
903
908
|
}
|
|
909
|
+
|
|
904
910
|
var $c8d5ff4524619fcd$var$_tmpl$ = ["<div", ' class="', '">', "</div>"],
|
|
905
911
|
$c8d5ff4524619fcd$var$_tmpl$2 = ["<style", ' type="text/css">', "</style>"];
|
|
906
912
|
function $c8d5ff4524619fcd$export$d21e32dfedac04be(props) {
|
|
@@ -1201,10 +1207,18 @@ function $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
|
|
|
1201
1207
|
set_top_row_shortened_by_(blocks_in_top_row_taken - 1); // minus one because the content block wrapper also is an element
|
|
1202
1208
|
});
|
|
1203
1209
|
|
|
1204
|
-
|
|
1210
|
+
const remapped_ = $i7OB2$createMemo(() => $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
1205
1211
|
wrapped_blocks_: get_wrapped_blocks_(),
|
|
1206
1212
|
n_cols_currently_showing_: n_cols_currently_showing_()
|
|
1207
|
-
})
|
|
1213
|
+
}));
|
|
1214
|
+
const content_blocks_by_index_ = $i7OB2$createMemo(() => remapped_().content_blocks_by_index_);
|
|
1215
|
+
return Object.assign(content_blocks_by_index_, {
|
|
1216
|
+
trailing_: product_count => $e7a7eb102ddc0c79$export$b94605e5b3ce01c({
|
|
1217
|
+
...remapped_(),
|
|
1218
|
+
n_cols_currently_showing_: n_cols_currently_showing_(),
|
|
1219
|
+
product_count: product_count
|
|
1220
|
+
})
|
|
1221
|
+
});
|
|
1208
1222
|
}
|
|
1209
1223
|
function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
1210
1224
|
wrapped_blocks_: wrapped_blocks_,
|
|
@@ -1212,13 +1226,16 @@ function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
|
1212
1226
|
}) {
|
|
1213
1227
|
// This computation should be quite cheap since it just moves around things into an array
|
|
1214
1228
|
const content_blocks_by_index_ = [];
|
|
1229
|
+
const rows_by_index_ = []; // the row of each block at each index of content_blocks_by_index_, in the same order
|
|
1215
1230
|
const constructed_block_arrays = new WeakSet();
|
|
1216
1231
|
// Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
|
|
1217
1232
|
const displaced_products_ = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
|
|
1218
1233
|
if (!n_cols_currently_showing_)
|
|
1219
1234
|
// Nope out of here if we don't know how many columns are showing
|
|
1220
1235
|
return {
|
|
1221
|
-
content_blocks_by_index_: content_blocks_by_index_
|
|
1236
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
1237
|
+
rows_by_index_: rows_by_index_,
|
|
1238
|
+
displaced_products_: displaced_products_
|
|
1222
1239
|
};
|
|
1223
1240
|
for (let i = 0; i < wrapped_blocks_.length; i++) {
|
|
1224
1241
|
// i = row to show at
|
|
@@ -1263,6 +1280,7 @@ function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
|
1263
1280
|
content_blocks_by_index_[final_target_index] = array;
|
|
1264
1281
|
}
|
|
1265
1282
|
} else content_blocks_by_index_[final_target_index] = block_content;
|
|
1283
|
+
(rows_by_index_[final_target_index] ||= []).push(i);
|
|
1266
1284
|
// Update displacement
|
|
1267
1285
|
for (let j = 0; j < span_rows; j++) {
|
|
1268
1286
|
const row = displaced_products_[i + j] ||= [];
|
|
@@ -1271,27 +1289,72 @@ function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
|
1271
1289
|
}
|
|
1272
1290
|
return {
|
|
1273
1291
|
content_blocks_by_index_: content_blocks_by_index_,
|
|
1292
|
+
rows_by_index_: rows_by_index_,
|
|
1274
1293
|
displaced_products_: displaced_products_
|
|
1275
1294
|
};
|
|
1276
1295
|
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1296
|
+
function $e7a7eb102ddc0c79$export$b94605e5b3ce01c({
|
|
1297
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
1298
|
+
rows_by_index_: rows_by_index_,
|
|
1299
|
+
displaced_products_: displaced_products_,
|
|
1300
|
+
n_cols_currently_showing_: n_cols_currently_showing_,
|
|
1301
|
+
product_count: product_count
|
|
1302
|
+
}) {
|
|
1303
|
+
const trailing = [];
|
|
1304
|
+
if (!n_cols_currently_showing_ || product_count <= 0) return trailing;
|
|
1305
|
+
// Find the row the last product lands in: each row has room for the columns that blocks don't take up
|
|
1306
|
+
let last_product_row = 0;
|
|
1307
|
+
let last_product_row_is_full = false;
|
|
1308
|
+
for (let seen_products = 0;; last_product_row++) {
|
|
1309
|
+
const row = displaced_products_[last_product_row];
|
|
1310
|
+
const taken_by_blocks = typeof row === "number" ? row : row ? row.filter(item => item).length : 0;
|
|
1311
|
+
const product_slots_in_row = Math.max(0, n_cols_currently_showing_ - taken_by_blocks);
|
|
1312
|
+
if (seen_products + product_slots_in_row >= product_count) {
|
|
1313
|
+
last_product_row_is_full = seen_products + product_slots_in_row === product_count;
|
|
1314
|
+
break;
|
|
1315
|
+
}
|
|
1316
|
+
seen_products += product_slots_in_row;
|
|
1317
|
+
// Rows past the ones blocks take up all have room for products, so we're done by then at the latest
|
|
1318
|
+
if (last_product_row >= displaced_products_.length + product_count) break;
|
|
1319
|
+
}
|
|
1320
|
+
for (let i = product_count; i < content_blocks_by_index_.length; i++) {
|
|
1321
|
+
const block = content_blocks_by_index_[i];
|
|
1322
|
+
if (block === undefined) continue;
|
|
1323
|
+
const rows = rows_by_index_[i] || [];
|
|
1324
|
+
const last_allowed_row = last_product_row + (last_product_row_is_full ? 1 : 0);
|
|
1325
|
+
if (Array.isArray(block) && rows.length > 1) {
|
|
1326
|
+
// Several blocks can share this index. Keep only blocks in allowed trailing rows.
|
|
1327
|
+
const in_trailing_rows = block.filter((_, j) => rows[j] <= last_allowed_row);
|
|
1328
|
+
if (in_trailing_rows.length) trailing.push(in_trailing_rows);
|
|
1329
|
+
continue;
|
|
1330
|
+
}
|
|
1331
|
+
if ((rows[0] ?? Infinity) > last_allowed_row) continue; // Keep cards meant for later rows hidden after filtering.
|
|
1332
|
+
trailing.push(block);
|
|
1333
|
+
}
|
|
1334
|
+
return trailing;
|
|
1335
|
+
}
|
|
1336
|
+
function $e7a7eb102ddc0c79$export$911278b0390ae36e(block, max_span_columns) {
|
|
1337
|
+
const span_columns = Math.min(block.span_columns, max_span_columns ?? Infinity);
|
|
1338
|
+
const spans_whole_row = span_columns === max_span_columns;
|
|
1339
|
+
return {
|
|
1340
|
+
span_columns: span_columns,
|
|
1341
|
+
span_rows: spans_whole_row ? 1 : block.span_rows,
|
|
1342
|
+
spans_whole_row: spans_whole_row
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1282
1345
|
function $e7a7eb102ddc0c79$var$wrap_blocks_in_div(rendered_content_blocks, max_span_columns) {
|
|
1283
1346
|
const get_wrapped_blocks = $i7OB2$mapArray(() => rendered_content_blocks, block => {
|
|
1284
1347
|
if (!block) return;
|
|
1285
|
-
const
|
|
1286
|
-
|
|
1287
|
-
const final_span_rows = $i7OB2$createMemo(() =>
|
|
1348
|
+
const final_spans = $i7OB2$createMemo(() => $e7a7eb102ddc0c79$export$911278b0390ae36e(block, max_span_columns()));
|
|
1349
|
+
const final_span_columns = $i7OB2$createMemo(() => final_spans().span_columns);
|
|
1350
|
+
const final_span_rows = $i7OB2$createMemo(() => final_spans().span_rows);
|
|
1288
1351
|
const [rendering_delayed, set_rendering_delayed_] = $i7OB2$createSignal(true);
|
|
1289
1352
|
const content = $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
1290
1353
|
get when() {
|
|
1291
1354
|
return !rendering_delayed();
|
|
1292
1355
|
},
|
|
1293
1356
|
get children() {
|
|
1294
|
-
return $i7OB2$ssr($e7a7eb102ddc0c79$var$_tmpl$, $i7OB2$ssrHydrationKey(), `content-block-wrapper ${
|
|
1357
|
+
return $i7OB2$ssr($e7a7eb102ddc0c79$var$_tmpl$, $i7OB2$ssrHydrationKey(), `content-block-wrapper ${final_spans().spans_whole_row ? "spans-whole-row" : ""}`, "grid-column:" + `span ${$i7OB2$escape(final_span_columns(), true)}` + (";grid-row:" + `span ${$i7OB2$escape(final_span_rows(), true)}`) + (";spans_columns_variable_name:" + $i7OB2$escape(final_span_columns(), true)), $i7OB2$escape($i7OB2$createComponent($e7a7eb102ddc0c79$var$RenderContent, {
|
|
1295
1358
|
get content() {
|
|
1296
1359
|
return block.content;
|
|
1297
1360
|
}
|
|
@@ -1303,6 +1366,7 @@ function $e7a7eb102ddc0c79$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
1303
1366
|
content: () => {
|
|
1304
1367
|
// Sneaky on-demand rendering, so we don't render more blocks than we can show: we have the rendered value here and don't return a function that renders because if our block would be moved around we'd be guaranteed to re-render
|
|
1305
1368
|
// However, no need to count products to know if we should render: the <For> loops in Placeholders and render_displays will only call this function if there's actually a product here that wants to display this block
|
|
1369
|
+
// (or, once all products have loaded, ResultsProductCards renders the blocks placed after the last product)
|
|
1306
1370
|
set_rendering_delayed_(false);
|
|
1307
1371
|
return content;
|
|
1308
1372
|
},
|