@depict-ai/ui 2.0.5 → 2.0.7
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 +165 -141
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +165 -141
- package/latest/index.cjs +140 -113
- package/latest/index.d.ts +1 -1
- package/latest/index.js +140 -113
- package/package.json +2 -2
- package/server/ES10/index.cjs +109 -100
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +109 -100
- package/server/latest/index.cjs +89 -77
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +89 -77
package/server/ES10/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import $b8hua$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/def
|
|
|
8
8
|
/*! Depict.ai search and product listing SDK */
|
|
9
9
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
10
10
|
register_es_version("ui", "ES10");
|
|
11
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "2.0.
|
|
11
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "2.0.7";
|
|
12
12
|
|
|
13
13
|
/** @jsxImportSource solid-js */
|
|
14
14
|
|
|
@@ -64,38 +64,6 @@ const $a9c7ba6087881ac2$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
64
64
|
});
|
|
65
65
|
return $a9c7ba6087881ac2$var$transform_elements(sorted_cols_at_size);
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
70
|
-
*/
|
|
71
|
-
function $3f7203368ad0d3ca$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
72
|
-
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
73
|
-
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
74
|
-
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
75
|
-
let [cols, max_width] = _ref;
|
|
76
|
-
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
77
|
-
}).sort((_ref2, _ref3) => {
|
|
78
|
-
let [, a] = _ref2;
|
|
79
|
-
let [, b] = _ref3;
|
|
80
|
-
return a - b;
|
|
81
|
-
});
|
|
82
|
-
const [[, smallest_max_width]] = sorted_sizes;
|
|
83
|
-
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
84
|
-
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
85
|
-
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
86
|
-
const to_delete = [];
|
|
87
|
-
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
88
|
-
const [, max_width] = sorted_sizes[i];
|
|
89
|
-
if (max_width > min_width_for_more_than_one_column) continue;
|
|
90
|
-
to_delete.push(i);
|
|
91
|
-
}
|
|
92
|
-
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
93
|
-
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
94
|
-
return sorted_sizes.map(_ref4 => {
|
|
95
|
-
let [cols, max_width] = _ref4;
|
|
96
|
-
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
67
|
function $ca55612a53dbbdd2$export$a2cc176055f8f08() {
|
|
100
68
|
const text = "Please try setting `colsAtSize` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `ColsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
101
69
|
return (0, $b8hua$isServer) ? {
|
|
@@ -583,7 +551,7 @@ function $d5d7e58c5c9d8db0$export$9574e176201e5e8d(props) {
|
|
|
583
551
|
market_: () => props.market,
|
|
584
552
|
merchant_: () => props.merchant,
|
|
585
553
|
layout_options_: $b8hua$createMemo(() => ({
|
|
586
|
-
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(
|
|
554
|
+
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
|
|
587
555
|
...grid_spacing_override()
|
|
588
556
|
}))
|
|
589
557
|
})));
|
|
@@ -688,7 +656,7 @@ function $b432b11321ad4c97$export$9756467d34d91cdb(props) {
|
|
|
688
656
|
market_: () => props.market,
|
|
689
657
|
merchant_: () => props.merchant,
|
|
690
658
|
layout_options_: $b8hua$createMemo(() => ({
|
|
691
|
-
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(
|
|
659
|
+
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
|
|
692
660
|
...grid_spacing_override()
|
|
693
661
|
}))
|
|
694
662
|
})));
|
|
@@ -1278,9 +1246,9 @@ function $b54fc842e721c9eb$export$430444115f70a734(_ref) {
|
|
|
1278
1246
|
}
|
|
1279
1247
|
})));
|
|
1280
1248
|
}
|
|
1281
|
-
const $1e7465a8ffa97f6c$var$_tmpl$ = ["<div", ' class="
|
|
1249
|
+
const $1e7465a8ffa97f6c$var$_tmpl$ = ["<div", ' class="', '"><div class="input-group"><div class="field"><input', ' type="number"', '></div><div class="separator">-</div><div class="field"><input', ' type="number"', "></div></div><!--#-->", '<!--/--><div class="value-text"><span class="min"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", '<!--/--></span><span class="max"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></div></div>"],
|
|
1282
1250
|
$1e7465a8ffa97f6c$var$_tmpl$2 = ["<div", ' class="slider"><div class="progress" style="', '"></div></div>'],
|
|
1283
|
-
$1e7465a8ffa97f6c$var$_tmpl$3 = ["<div", ' class="range-group"><input type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1251
|
+
$1e7465a8ffa97f6c$var$_tmpl$3 = ["<div", ' class="range-group"><input', ' type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1284
1252
|
function $1e7465a8ffa97f6c$export$e0d834a0ad870cda(_ref) {
|
|
1285
1253
|
let {
|
|
1286
1254
|
filter_: filter_,
|
|
@@ -1359,11 +1327,13 @@ function $1e7465a8ffa97f6c$var$RangeSelector(_ref3) {
|
|
|
1359
1327
|
const [get_current_range] = current_range_;
|
|
1360
1328
|
const pre_price = $b8hua$createMemo(() => price_formatting_().pre_);
|
|
1361
1329
|
const post_price = $b8hua$createMemo(() => price_formatting_().post_);
|
|
1362
|
-
|
|
1330
|
+
const should_be_disabled_ = $b8hua$createMemo(() => Math.abs(min_() - max_()) < 2);
|
|
1331
|
+
return $b8hua$ssr($1e7465a8ffa97f6c$var$_tmpl$, $b8hua$ssrHydrationKey(), "range ".concat(min_() === max_() ? "disabled" : ""), $b8hua$ssrAttribute("disabled", should_be_disabled_(), true), $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $b8hua$ssrAttribute("min", $b8hua$escape(min_(), true), false) + $b8hua$ssrAttribute("max", $b8hua$escape(max_(), true), false) + $b8hua$ssrAttribute("value", $b8hua$escape(get_current_range()[0], true), false), $b8hua$ssrAttribute("disabled", should_be_disabled_(), true) + $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.range_filter_high_point_aria_label_(), true), false), $b8hua$ssrAttribute("min", $b8hua$escape(min_(), true), false) + $b8hua$ssrAttribute("max", $b8hua$escape(max_(), true), false) + $b8hua$ssrAttribute("value", $b8hua$escape(get_current_range()[1], true), false), $b8hua$escape($b8hua$createComponent($1e7465a8ffa97f6c$var$ExponentialSlider, {
|
|
1363
1332
|
max_: max_,
|
|
1364
1333
|
min_: min_,
|
|
1365
1334
|
current_range_: current_range_,
|
|
1366
|
-
i18n_: i18n_
|
|
1335
|
+
i18n_: i18n_,
|
|
1336
|
+
should_be_disabled_: should_be_disabled_
|
|
1367
1337
|
})), $b8hua$escape(pre_price()), $b8hua$escape($b8hua$createComponent((0, $60ec7a29849d81db$export$a71e92cfbb498adc), {
|
|
1368
1338
|
get price_() {
|
|
1369
1339
|
return min_();
|
|
@@ -1385,7 +1355,8 @@ function $1e7465a8ffa97f6c$var$ExponentialSlider(_ref4) {
|
|
|
1385
1355
|
current_range_: current_range_,
|
|
1386
1356
|
min_: min_,
|
|
1387
1357
|
i18n_: i18n_,
|
|
1388
|
-
max_: max_
|
|
1358
|
+
max_: max_,
|
|
1359
|
+
should_be_disabled_: should_be_disabled_
|
|
1389
1360
|
} = _ref4;
|
|
1390
1361
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
1391
1362
|
const transform_linear_to_nonlinear = _ref5 => {
|
|
@@ -1393,8 +1364,7 @@ function $1e7465a8ffa97f6c$var$ExponentialSlider(_ref4) {
|
|
|
1393
1364
|
return [Math.sqrt(smaller), Math.sqrt(larger)];
|
|
1394
1365
|
};
|
|
1395
1366
|
const [read_current_range, write_current_range] = current_range_;
|
|
1396
|
-
const
|
|
1397
|
-
const [read_modified_range, write_modified_range] = modified_range;
|
|
1367
|
+
const modified_range_accessor = $b8hua$createMemo(() => transform_linear_to_nonlinear(read_current_range()));
|
|
1398
1368
|
const modified_max = $b8hua$createMemo(() => Math.sqrt(max_()));
|
|
1399
1369
|
const modified_min = $b8hua$createMemo(() => Math.sqrt(min_()));
|
|
1400
1370
|
const offset_value_calculator_ = (value, how_many) => {
|
|
@@ -1402,36 +1372,39 @@ function $1e7465a8ffa97f6c$var$ExponentialSlider(_ref4) {
|
|
|
1402
1372
|
const changed = number_in_linear + how_many;
|
|
1403
1373
|
return Math.sqrt(changed);
|
|
1404
1374
|
};
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
const
|
|
1408
|
-
const
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
}
|
|
1375
|
+
const convert_back = (smaller, larger) => [Math.round(smaller * smaller), Math.round(larger * larger)];
|
|
1376
|
+
const modified_range_setter = new_range_or_function => {
|
|
1377
|
+
const old_range = $b8hua$untrack(modified_range_accessor);
|
|
1378
|
+
const new_range = typeof new_range_or_function === "function" ? new_range_or_function(old_range) : new_range_or_function;
|
|
1379
|
+
const [smaller, larger] = new_range;
|
|
1380
|
+
const [old_smaller, old_larger] = old_range;
|
|
1381
|
+
const new_range_converted = convert_back(smaller, larger);
|
|
1382
|
+
const old_range_converted = convert_back(old_smaller, old_larger);
|
|
1383
|
+
if (new_range_converted[0] === old_range_converted[0] && new_range_converted[1] === old_range_converted[1])
|
|
1384
|
+
// If the new value gets identical rounding errors to the old value when being converted back, don't write it to the signal since it would cause an infinite loop
|
|
1385
|
+
return new_range;
|
|
1386
|
+
write_current_range(new_range_converted);
|
|
1387
|
+
return new_range;
|
|
1388
|
+
};
|
|
1419
1389
|
return $1e7465a8ffa97f6c$var$LinearSlider({
|
|
1420
|
-
current_range_:
|
|
1390
|
+
current_range_: [modified_range_accessor, modified_range_setter],
|
|
1391
|
+
// "Lie" to the actual slider so we don't have to implement exponential handling in there
|
|
1421
1392
|
min_: modified_min,
|
|
1422
1393
|
max_: modified_max,
|
|
1423
1394
|
offset_value_calculator_: offset_value_calculator_,
|
|
1424
|
-
i18n_: i18n_
|
|
1395
|
+
i18n_: i18n_,
|
|
1396
|
+
should_be_disabled_: should_be_disabled_
|
|
1425
1397
|
});
|
|
1426
1398
|
}
|
|
1427
|
-
function $1e7465a8ffa97f6c$var$LinearSlider(
|
|
1399
|
+
function $1e7465a8ffa97f6c$var$LinearSlider(_ref6) {
|
|
1428
1400
|
let {
|
|
1429
1401
|
max_: max_,
|
|
1430
1402
|
min_: min_,
|
|
1431
1403
|
current_range_: current_range_,
|
|
1432
1404
|
offset_value_calculator_: offset_value_calculator_,
|
|
1433
|
-
i18n_: i18n_
|
|
1434
|
-
|
|
1405
|
+
i18n_: i18n_,
|
|
1406
|
+
should_be_disabled_: should_be_disabled_
|
|
1407
|
+
} = _ref6;
|
|
1435
1408
|
let range_input_1;
|
|
1436
1409
|
let range_input_2;
|
|
1437
1410
|
let clickable_slider;
|
|
@@ -1440,6 +1413,7 @@ function $1e7465a8ffa97f6c$var$LinearSlider(_ref7) {
|
|
|
1440
1413
|
const min = min_();
|
|
1441
1414
|
const span = max_() - min;
|
|
1442
1415
|
const [start, end] = get_current_range();
|
|
1416
|
+
if (should_be_disabled_()) return "left:50%;right:50%";
|
|
1443
1417
|
return "left:".concat((start - min) / span * 100, "%;right:").concat(100 - (end - min) / span * 100, "%");
|
|
1444
1418
|
});
|
|
1445
1419
|
const set_value = (el, index) => {
|
|
@@ -1453,13 +1427,13 @@ function $1e7465a8ffa97f6c$var$LinearSlider(_ref7) {
|
|
|
1453
1427
|
el.value = get_current_range()[index];
|
|
1454
1428
|
});
|
|
1455
1429
|
};
|
|
1456
|
-
return [$b8hua$ssr($1e7465a8ffa97f6c$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$ssrStyle(progress_styling())), $b8hua$ssr($1e7465a8ffa97f6c$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $b8hua$ssrAttribute("min", $b8hua$escape(min_(), true), false) + $b8hua$ssrAttribute("max", $b8hua$escape(max_(), true), false) + $b8hua$ssrAttribute("value", $b8hua$escape($b8hua$createMemo(() => {
|
|
1430
|
+
return [$b8hua$ssr($1e7465a8ffa97f6c$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$ssrStyle(progress_styling())), $b8hua$ssr($1e7465a8ffa97f6c$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("disabled", should_be_disabled_(), true), $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $b8hua$ssrAttribute("min", $b8hua$escape(min_(), true), false) + $b8hua$ssrAttribute("max", $b8hua$escape(max_(), true), false) + $b8hua$ssrAttribute("value", $b8hua$escape($b8hua$createMemo(() => {
|
|
1457
1431
|
min_();
|
|
1458
1432
|
max_();
|
|
1459
1433
|
return get_current_range()[0];
|
|
1460
1434
|
}, undefined, {
|
|
1461
1435
|
equals: false
|
|
1462
|
-
})(), true), false), $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.range_filter_high_point_aria_label_(), true), false), $b8hua$ssrAttribute("min", $b8hua$escape(min_(), true), false) + $b8hua$ssrAttribute("max", $b8hua$escape(max_(), true), false))];
|
|
1436
|
+
})(), true), false), $b8hua$ssrAttribute("disabled", should_be_disabled_(), true) + $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.range_filter_high_point_aria_label_(), true), false), $b8hua$ssrAttribute("min", $b8hua$escape(min_(), true), false) + $b8hua$ssrAttribute("max", $b8hua$escape(max_(), true), false))];
|
|
1463
1437
|
}
|
|
1464
1438
|
function $1e7465a8ffa97f6c$var$set_range_with_sanitation(min_, max_, current_range_signal, index, target_el) {
|
|
1465
1439
|
let get_offset_value = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : (value, how_many) => value + how_many;
|
|
@@ -1728,44 +1702,47 @@ function $0ae614c5c7babb43$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1728
1702
|
return has_expandable();
|
|
1729
1703
|
},
|
|
1730
1704
|
get children() {
|
|
1731
|
-
return
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
var _value$is_expanded_$u, _value12, _value12$is_expanded_, _value12$is_expanded_2;
|
|
1742
|
-
return (_value$is_expanded_$u = (_value12 = value()) === null || _value12 === void 0 ? void 0 : (_value12$is_expanded_ = _value12.is_expanded_) === null || _value12$is_expanded_ === void 0 ? void 0 : (_value12$is_expanded_2 = _value12$is_expanded_.ui_should_show_expanded_) === null || _value12$is_expanded_2 === void 0 ? void 0 : _value12$is_expanded_2.call(_value12$is_expanded_)) !== null && _value$is_expanded_$u !== void 0 ? _value$is_expanded_$u : false;
|
|
1743
|
-
});
|
|
1705
|
+
return (() => {
|
|
1706
|
+
const is_open = $b8hua$createMemo(() => {
|
|
1707
|
+
const v = value();
|
|
1708
|
+
if (!v)
|
|
1709
|
+
// only to prevent cleanup errors
|
|
1710
|
+
return $b8hua$createSignal(false);
|
|
1711
|
+
const {
|
|
1712
|
+
is_expanded_: {
|
|
1713
|
+
ui_should_show_expanded_: ui_should_show_expanded_,
|
|
1714
|
+
set_user_expanded_: set_user_expanded_
|
|
1744
1715
|
}
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1716
|
+
} = v;
|
|
1717
|
+
return [ui_should_show_expanded_, set_user_expanded_];
|
|
1718
|
+
});
|
|
1719
|
+
return $b8hua$createComponent((0, $ad371564683947ab$export$6c6d7a51fa9aa15d), {
|
|
1720
|
+
get details_() {
|
|
1721
|
+
return $b8hua$ssr($0ae614c5c7babb43$var$_tmpl$3, $b8hua$ssrHydrationKey());
|
|
1722
|
+
},
|
|
1723
|
+
get summary_() {
|
|
1724
|
+
var _value10, _value11;
|
|
1725
|
+
return $b8hua$ssr($0ae614c5c7babb43$var$_tmpl$4, $b8hua$ssrHydrationKey(), "count ".concat(((_value10 = value()) === null || _value10 === void 0 ? void 0 : _value10.count_) === 0 ? "count-0" : ""), $b8hua$escape((_value11 = value()) === null || _value11 === void 0 ? void 0 : _value11.count_), $b8hua$escape($b8hua$createComponent((0, $457279ff15864cb9$export$e5c2828934226505), {
|
|
1726
|
+
i18n_: i18n_,
|
|
1727
|
+
get expanded_() {
|
|
1728
|
+
return $b8hua$createMemo(() => {
|
|
1729
|
+
var _value$is_expanded_$u, _value12, _value12$is_expanded_, _value12$is_expanded_2;
|
|
1730
|
+
return (_value$is_expanded_$u = (_value12 = value()) === null || _value12 === void 0 ? void 0 : (_value12$is_expanded_ = _value12.is_expanded_) === null || _value12$is_expanded_ === void 0 ? void 0 : (_value12$is_expanded_2 = _value12$is_expanded_.ui_should_show_expanded_) === null || _value12$is_expanded_2 === void 0 ? void 0 : _value12$is_expanded_2.call(_value12$is_expanded_)) !== null && _value$is_expanded_$u !== void 0 ? _value$is_expanded_$u : false;
|
|
1731
|
+
});
|
|
1757
1732
|
}
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
var
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1733
|
+
})));
|
|
1734
|
+
},
|
|
1735
|
+
get is_open_() {
|
|
1736
|
+
return is_open();
|
|
1737
|
+
},
|
|
1738
|
+
get children() {
|
|
1739
|
+
return $0ae614c5c7babb43$var$render_stuff($b8hua$createMemo(() => {
|
|
1740
|
+
var _value13;
|
|
1741
|
+
return ((_value13 = value()) === null || _value13 === void 0 ? void 0 : _value13.children_) || {};
|
|
1742
|
+
}), existing_filter, i18n_);
|
|
1743
|
+
}
|
|
1744
|
+
});
|
|
1745
|
+
})();
|
|
1769
1746
|
}
|
|
1770
1747
|
})));
|
|
1771
1748
|
})();
|
|
@@ -1830,7 +1807,7 @@ function $0ae614c5c7babb43$var$create_updating_signal(_ref3) {
|
|
|
1830
1807
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
1831
1808
|
let updating_blocked = false;
|
|
1832
1809
|
const index_of_us_in_selected_filter = existing_filter_ === null || existing_filter_ === void 0 ? void 0 : (_existing_filter_$dat = existing_filter_.data) === null || _existing_filter_$dat === void 0 ? void 0 : (_existing_filter_$dat2 = _existing_filter_$dat.findIndex) === null || _existing_filter_$dat2 === void 0 ? void 0 : _existing_filter_$dat2.call(_existing_filter_$dat, el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
1833
|
-
signal_.push(...$b8hua$createSignal(index_of_us_in_selected_filter >= 0
|
|
1810
|
+
signal_.push(...$b8hua$createSignal(index_of_us_in_selected_filter >= 0));
|
|
1834
1811
|
const [read_checked, write_checked] = signal_;
|
|
1835
1812
|
const child_objects = Object.values(self_.children_);
|
|
1836
1813
|
const get_child_object_values = child_objects.map(_ref4 => {
|
|
@@ -8812,6 +8789,38 @@ function $37e8c97bb6876197$export$828dcdd425fd3231(aligner) {
|
|
|
8812
8789
|
cleanup: cleanup
|
|
8813
8790
|
};
|
|
8814
8791
|
}
|
|
8792
|
+
|
|
8793
|
+
/**
|
|
8794
|
+
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
8795
|
+
*/
|
|
8796
|
+
function $3f7203368ad0d3ca$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
8797
|
+
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
8798
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
8799
|
+
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
8800
|
+
let [cols, max_width] = _ref;
|
|
8801
|
+
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
8802
|
+
}).sort((_ref2, _ref3) => {
|
|
8803
|
+
let [, a] = _ref2;
|
|
8804
|
+
let [, b] = _ref3;
|
|
8805
|
+
return a - b;
|
|
8806
|
+
});
|
|
8807
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
8808
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
8809
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
8810
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
8811
|
+
const to_delete = [];
|
|
8812
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
8813
|
+
const [, max_width] = sorted_sizes[i];
|
|
8814
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
8815
|
+
to_delete.push(i);
|
|
8816
|
+
}
|
|
8817
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
8818
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
8819
|
+
return sorted_sizes.map(_ref4 => {
|
|
8820
|
+
let [cols, max_width] = _ref4;
|
|
8821
|
+
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
8822
|
+
});
|
|
8823
|
+
}
|
|
8815
8824
|
const $eb064bc3350276c1$var$_tmpl$ = ["<div", ' class="depict plp search">', "</div>"];
|
|
8816
8825
|
function $eb064bc3350276c1$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
8817
8826
|
$eb064bc3350276c1$var$_checkPrivateRedeclaration(obj, privateMap);
|
package/server/latest/index.cjs
CHANGED
|
@@ -61,7 +61,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
|
|
|
61
61
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
62
62
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
63
63
|
/*! Depict.ai search and product listing SDK */
|
|
64
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.
|
|
64
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.7";
|
|
65
65
|
|
|
66
66
|
/** @jsxImportSource solid-js */
|
|
67
67
|
|
|
@@ -112,27 +112,6 @@ const $4e04be41243c3d80$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
112
112
|
});
|
|
113
113
|
return $4e04be41243c3d80$var$transform_elements(sorted_cols_at_size);
|
|
114
114
|
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
118
|
-
*/
|
|
119
|
-
function $ab7c6c7911bae2f5$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_for_more_than_one_column = 500) {
|
|
120
|
-
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
121
|
-
const sorted_sizes = sdk_cols_at_size.map(([cols, max_width]) => [cols, max_width ?? Infinity]).sort(([, a], [, b]) => a - b);
|
|
122
|
-
const [[, smallest_max_width]] = sorted_sizes;
|
|
123
|
-
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
124
|
-
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
125
|
-
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
126
|
-
const to_delete = [];
|
|
127
|
-
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
128
|
-
const [, max_width] = sorted_sizes[i];
|
|
129
|
-
if (max_width > min_width_for_more_than_one_column) continue;
|
|
130
|
-
to_delete.push(i);
|
|
131
|
-
}
|
|
132
|
-
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
133
|
-
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
134
|
-
return sorted_sizes.map(([cols, max_width]) => max_width == Infinity ? [cols] : [cols, max_width]);
|
|
135
|
-
}
|
|
136
115
|
function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
137
116
|
const text = "Please try setting `colsAtSize` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `ColsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
138
117
|
return (0, $5vyXB$solidjsweb.isServer) ? {
|
|
@@ -598,7 +577,7 @@ function $72f96c4782db0b1b$export$9574e176201e5e8d(props) {
|
|
|
598
577
|
market_: () => props.market,
|
|
599
578
|
merchant_: () => props.merchant,
|
|
600
579
|
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
601
|
-
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(
|
|
580
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
602
581
|
...grid_spacing_override()
|
|
603
582
|
}))
|
|
604
583
|
})));
|
|
@@ -696,7 +675,7 @@ function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
|
|
|
696
675
|
market_: () => props.market,
|
|
697
676
|
merchant_: () => props.merchant,
|
|
698
677
|
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
699
|
-
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(
|
|
678
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
700
679
|
...grid_spacing_override()
|
|
701
680
|
}))
|
|
702
681
|
})));
|
|
@@ -1251,9 +1230,9 @@ function $c1dc1554c1b94233$export$430444115f70a734({
|
|
|
1251
1230
|
}
|
|
1252
1231
|
})));
|
|
1253
1232
|
}
|
|
1254
|
-
const $0b7222ba8a8bb72f$var$_tmpl$ = ["<div", ' class="
|
|
1233
|
+
const $0b7222ba8a8bb72f$var$_tmpl$ = ["<div", ' class="', '"><div class="input-group"><div class="field"><input', ' type="number"', '></div><div class="separator">-</div><div class="field"><input', ' type="number"', "></div></div><!--#-->", '<!--/--><div class="value-text"><span class="min"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", '<!--/--></span><span class="max"><!--#-->', "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></div></div>"],
|
|
1255
1234
|
$0b7222ba8a8bb72f$var$_tmpl$2 = ["<div", ' class="slider"><div class="progress" style="', '"></div></div>'],
|
|
1256
|
-
$0b7222ba8a8bb72f$var$_tmpl$3 = ["<div", ' class="range-group"><input type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1235
|
+
$0b7222ba8a8bb72f$var$_tmpl$3 = ["<div", ' class="range-group"><input', ' type="range"', ' step="any"><input', ' type="range"', ' step="any"></div>'];
|
|
1257
1236
|
function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({
|
|
1258
1237
|
filter_: filter_,
|
|
1259
1238
|
selected_filters_: selected_filters_,
|
|
@@ -1326,11 +1305,13 @@ function $0b7222ba8a8bb72f$var$RangeSelector({
|
|
|
1326
1305
|
const [get_current_range] = current_range_;
|
|
1327
1306
|
const pre_price = $5vyXB$solidjs.createMemo(() => price_formatting_().pre_);
|
|
1328
1307
|
const post_price = $5vyXB$solidjs.createMemo(() => price_formatting_().post_);
|
|
1329
|
-
|
|
1308
|
+
const should_be_disabled_ = $5vyXB$solidjs.createMemo(() => Math.abs(min_() - max_()) < 2);
|
|
1309
|
+
return $5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `range ${min_() === max_() ? "disabled" : ""}`, $5vyXB$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("value", $5vyXB$solidjsweb.escape(get_current_range()[0], true), false), $5vyXB$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true) + $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("value", $5vyXB$solidjsweb.escape(get_current_range()[1], true), false), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent($0b7222ba8a8bb72f$var$ExponentialSlider, {
|
|
1330
1310
|
max_: max_,
|
|
1331
1311
|
min_: min_,
|
|
1332
1312
|
current_range_: current_range_,
|
|
1333
|
-
i18n_: i18n_
|
|
1313
|
+
i18n_: i18n_,
|
|
1314
|
+
should_be_disabled_: should_be_disabled_
|
|
1334
1315
|
})), $5vyXB$solidjsweb.escape(pre_price()), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $d659702496cb72ea$export$a71e92cfbb498adc), {
|
|
1335
1316
|
get price_() {
|
|
1336
1317
|
return min_();
|
|
@@ -1351,13 +1332,13 @@ function $0b7222ba8a8bb72f$var$ExponentialSlider({
|
|
|
1351
1332
|
current_range_: current_range_,
|
|
1352
1333
|
min_: min_,
|
|
1353
1334
|
i18n_: i18n_,
|
|
1354
|
-
max_: max_
|
|
1335
|
+
max_: max_,
|
|
1336
|
+
should_be_disabled_: should_be_disabled_
|
|
1355
1337
|
}) {
|
|
1356
1338
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
1357
1339
|
const transform_linear_to_nonlinear = ([smaller, larger]) => [Math.sqrt(smaller), Math.sqrt(larger)];
|
|
1358
1340
|
const [read_current_range, write_current_range] = current_range_;
|
|
1359
|
-
const
|
|
1360
|
-
const [read_modified_range, write_modified_range] = modified_range;
|
|
1341
|
+
const modified_range_accessor = $5vyXB$solidjs.createMemo(() => transform_linear_to_nonlinear(read_current_range()));
|
|
1361
1342
|
const modified_max = $5vyXB$solidjs.createMemo(() => Math.sqrt(max_()));
|
|
1362
1343
|
const modified_min = $5vyXB$solidjs.createMemo(() => Math.sqrt(min_()));
|
|
1363
1344
|
const offset_value_calculator_ = (value, how_many) => {
|
|
@@ -1365,23 +1346,28 @@ function $0b7222ba8a8bb72f$var$ExponentialSlider({
|
|
|
1365
1346
|
const changed = number_in_linear + how_many;
|
|
1366
1347
|
return Math.sqrt(changed);
|
|
1367
1348
|
};
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
const
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1349
|
+
const convert_back = (smaller, larger) => [Math.round(smaller * smaller), Math.round(larger * larger)];
|
|
1350
|
+
const modified_range_setter = new_range_or_function => {
|
|
1351
|
+
const old_range = $5vyXB$solidjs.untrack(modified_range_accessor);
|
|
1352
|
+
const new_range = typeof new_range_or_function === "function" ? new_range_or_function(old_range) : new_range_or_function;
|
|
1353
|
+
const [smaller, larger] = new_range;
|
|
1354
|
+
const [old_smaller, old_larger] = old_range;
|
|
1355
|
+
const new_range_converted = convert_back(smaller, larger);
|
|
1356
|
+
const old_range_converted = convert_back(old_smaller, old_larger);
|
|
1357
|
+
if (new_range_converted[0] === old_range_converted[0] && new_range_converted[1] === old_range_converted[1])
|
|
1358
|
+
// If the new value gets identical rounding errors to the old value when being converted back, don't write it to the signal since it would cause an infinite loop
|
|
1359
|
+
return new_range;
|
|
1360
|
+
write_current_range(new_range_converted);
|
|
1361
|
+
return new_range;
|
|
1362
|
+
};
|
|
1379
1363
|
return $0b7222ba8a8bb72f$var$LinearSlider({
|
|
1380
|
-
current_range_:
|
|
1364
|
+
current_range_: [modified_range_accessor, modified_range_setter],
|
|
1365
|
+
// "Lie" to the actual slider so we don't have to implement exponential handling in there
|
|
1381
1366
|
min_: modified_min,
|
|
1382
1367
|
max_: modified_max,
|
|
1383
1368
|
offset_value_calculator_: offset_value_calculator_,
|
|
1384
|
-
i18n_: i18n_
|
|
1369
|
+
i18n_: i18n_,
|
|
1370
|
+
should_be_disabled_: should_be_disabled_
|
|
1385
1371
|
});
|
|
1386
1372
|
}
|
|
1387
1373
|
function $0b7222ba8a8bb72f$var$LinearSlider({
|
|
@@ -1389,7 +1375,8 @@ function $0b7222ba8a8bb72f$var$LinearSlider({
|
|
|
1389
1375
|
min_: min_,
|
|
1390
1376
|
current_range_: current_range_,
|
|
1391
1377
|
offset_value_calculator_: offset_value_calculator_,
|
|
1392
|
-
i18n_: i18n_
|
|
1378
|
+
i18n_: i18n_,
|
|
1379
|
+
should_be_disabled_: should_be_disabled_
|
|
1393
1380
|
}) {
|
|
1394
1381
|
let range_input_1;
|
|
1395
1382
|
let range_input_2;
|
|
@@ -1399,6 +1386,7 @@ function $0b7222ba8a8bb72f$var$LinearSlider({
|
|
|
1399
1386
|
const min = min_();
|
|
1400
1387
|
const span = max_() - min;
|
|
1401
1388
|
const [start, end] = get_current_range();
|
|
1389
|
+
if (should_be_disabled_()) return `left:50%;right:50%`;
|
|
1402
1390
|
return `left:${(start - min) / span * 100}%;right:${100 - (end - min) / span * 100}%`;
|
|
1403
1391
|
});
|
|
1404
1392
|
const set_value = (el, index) => {
|
|
@@ -1412,13 +1400,13 @@ function $0b7222ba8a8bb72f$var$LinearSlider({
|
|
|
1412
1400
|
el.value = get_current_range()[index];
|
|
1413
1401
|
});
|
|
1414
1402
|
};
|
|
1415
|
-
return [$5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrStyle(progress_styling())), $5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("value", $5vyXB$solidjsweb.escape($5vyXB$solidjs.createMemo(() => {
|
|
1403
|
+
return [$5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrStyle(progress_styling())), $5vyXB$solidjsweb.ssr($0b7222ba8a8bb72f$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_low_point_aria_label_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("value", $5vyXB$solidjsweb.escape($5vyXB$solidjs.createMemo(() => {
|
|
1416
1404
|
min_();
|
|
1417
1405
|
max_();
|
|
1418
1406
|
return get_current_range()[0];
|
|
1419
1407
|
}, undefined, {
|
|
1420
1408
|
equals: false
|
|
1421
|
-
})(), true), false), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false))];
|
|
1409
|
+
})(), true), false), $5vyXB$solidjsweb.ssrAttribute("disabled", should_be_disabled_(), true) + $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.range_filter_high_point_aria_label_(), true), false), $5vyXB$solidjsweb.ssrAttribute("min", $5vyXB$solidjsweb.escape(min_(), true), false) + $5vyXB$solidjsweb.ssrAttribute("max", $5vyXB$solidjsweb.escape(max_(), true), false))];
|
|
1422
1410
|
}
|
|
1423
1411
|
function $0b7222ba8a8bb72f$var$set_range_with_sanitation(min_, max_, current_range_signal, index, target_el, get_offset_value = (value, how_many) => value + how_many) {
|
|
1424
1412
|
let value_as_number = +target_el.value;
|
|
@@ -1667,37 +1655,40 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1667
1655
|
return has_expandable();
|
|
1668
1656
|
},
|
|
1669
1657
|
get children() {
|
|
1670
|
-
return
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1658
|
+
return (() => {
|
|
1659
|
+
const is_open = $5vyXB$solidjs.createMemo(() => {
|
|
1660
|
+
const v = value();
|
|
1661
|
+
if (!v)
|
|
1662
|
+
// only to prevent cleanup errors
|
|
1663
|
+
return $5vyXB$solidjs.createSignal(false);
|
|
1664
|
+
const {
|
|
1665
|
+
is_expanded_: {
|
|
1666
|
+
ui_should_show_expanded_: ui_should_show_expanded_,
|
|
1667
|
+
set_user_expanded_: set_user_expanded_
|
|
1679
1668
|
}
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1669
|
+
} = v;
|
|
1670
|
+
return [ui_should_show_expanded_, set_user_expanded_];
|
|
1671
|
+
});
|
|
1672
|
+
return $5vyXB$solidjsweb.createComponent((0, $a69e505a12a77874$export$6c6d7a51fa9aa15d), {
|
|
1673
|
+
get details_() {
|
|
1674
|
+
return $5vyXB$solidjsweb.ssr($3bdc00a1353c1150$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey());
|
|
1675
|
+
},
|
|
1676
|
+
get summary_() {
|
|
1677
|
+
return $5vyXB$solidjsweb.ssr($3bdc00a1353c1150$var$_tmpl$4, $5vyXB$solidjsweb.ssrHydrationKey(), `count ${value()?.count_ === 0 ? "count-0" : ""}`, $5vyXB$solidjsweb.escape(value()?.count_), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $7567511a7c3e4bd7$export$e5c2828934226505), {
|
|
1678
|
+
i18n_: i18n_,
|
|
1679
|
+
get expanded_() {
|
|
1680
|
+
return $5vyXB$solidjs.createMemo(() => value()?.is_expanded_?.ui_should_show_expanded_?.() ?? false);
|
|
1692
1681
|
}
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1682
|
+
})));
|
|
1683
|
+
},
|
|
1684
|
+
get is_open_() {
|
|
1685
|
+
return is_open();
|
|
1686
|
+
},
|
|
1687
|
+
get children() {
|
|
1688
|
+
return $3bdc00a1353c1150$var$render_stuff($5vyXB$solidjs.createMemo(() => value()?.children_ || {}), existing_filter, i18n_);
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1691
|
+
})();
|
|
1701
1692
|
}
|
|
1702
1693
|
})));
|
|
1703
1694
|
})();
|
|
@@ -1760,7 +1751,7 @@ function $3bdc00a1353c1150$var$create_updating_signal({
|
|
|
1760
1751
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
1761
1752
|
let updating_blocked = false;
|
|
1762
1753
|
const index_of_us_in_selected_filter = existing_filter_?.data?.findIndex?.(el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
1763
|
-
signal_.push(...$5vyXB$solidjs.createSignal(index_of_us_in_selected_filter >= 0
|
|
1754
|
+
signal_.push(...$5vyXB$solidjs.createSignal(index_of_us_in_selected_filter >= 0));
|
|
1764
1755
|
const [read_checked, write_checked] = signal_;
|
|
1765
1756
|
const child_objects = Object.values(self_.children_);
|
|
1766
1757
|
const get_child_object_values = child_objects.map(({
|
|
@@ -8180,6 +8171,27 @@ function $d8e94ea381ab57fa$export$828dcdd425fd3231(aligner) {
|
|
|
8180
8171
|
cleanup: cleanup
|
|
8181
8172
|
};
|
|
8182
8173
|
}
|
|
8174
|
+
|
|
8175
|
+
/**
|
|
8176
|
+
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
8177
|
+
*/
|
|
8178
|
+
function $ab7c6c7911bae2f5$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_for_more_than_one_column = 500) {
|
|
8179
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
8180
|
+
const sorted_sizes = sdk_cols_at_size.map(([cols, max_width]) => [cols, max_width ?? Infinity]).sort(([, a], [, b]) => a - b);
|
|
8181
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
8182
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
8183
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
8184
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
8185
|
+
const to_delete = [];
|
|
8186
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
8187
|
+
const [, max_width] = sorted_sizes[i];
|
|
8188
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
8189
|
+
to_delete.push(i);
|
|
8190
|
+
}
|
|
8191
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
8192
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
8193
|
+
return sorted_sizes.map(([cols, max_width]) => max_width == Infinity ? [cols] : [cols, max_width]);
|
|
8194
|
+
}
|
|
8183
8195
|
const $2c61e4cd8229c49a$var$_tmpl$ = ["<div", ' class="depict plp search">', "</div>"];
|
|
8184
8196
|
// We just pass page_url_creator to DepictAPI when we instantiate it, so don't allow it to be specified if api is already specified
|
|
8185
8197
|
/**
|
package/server/latest/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/
|
|
|
7
7
|
import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
|
|
8
8
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
9
9
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
10
|
-
export const version = "2.0.
|
|
10
|
+
export const version = "2.0.7";
|
|
11
11
|
/**
|
|
12
12
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
13
13
|
*/
|