@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/ES10/index.cjs
CHANGED
|
@@ -67,7 +67,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
67
67
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
68
68
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
69
69
|
/*! Depict.ai search and product listing SDK */
|
|
70
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.
|
|
70
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.7";
|
|
71
71
|
|
|
72
72
|
/** @jsxImportSource solid-js */
|
|
73
73
|
|
|
@@ -123,38 +123,6 @@ const $5401a6698b0c0658$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
123
123
|
});
|
|
124
124
|
return $5401a6698b0c0658$var$transform_elements(sorted_cols_at_size);
|
|
125
125
|
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* 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
|
|
129
|
-
*/
|
|
130
|
-
function $b1ea8d47bcf03111$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
131
|
-
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
132
|
-
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
133
|
-
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
134
|
-
let [cols, max_width] = _ref;
|
|
135
|
-
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
136
|
-
}).sort((_ref2, _ref3) => {
|
|
137
|
-
let [, a] = _ref2;
|
|
138
|
-
let [, b] = _ref3;
|
|
139
|
-
return a - b;
|
|
140
|
-
});
|
|
141
|
-
const [[, smallest_max_width]] = sorted_sizes;
|
|
142
|
-
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
143
|
-
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
144
|
-
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
145
|
-
const to_delete = [];
|
|
146
|
-
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
147
|
-
const [, max_width] = sorted_sizes[i];
|
|
148
|
-
if (max_width > min_width_for_more_than_one_column) continue;
|
|
149
|
-
to_delete.push(i);
|
|
150
|
-
}
|
|
151
|
-
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
152
|
-
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
153
|
-
return sorted_sizes.map(_ref4 => {
|
|
154
|
-
let [cols, max_width] = _ref4;
|
|
155
|
-
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
126
|
function $8edd3cf30d1fd8b4$export$a2cc176055f8f08() {
|
|
159
127
|
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.";
|
|
160
128
|
return (0, $52FdA$solidjsweb.isServer) ? {
|
|
@@ -703,7 +671,7 @@ function $2badc30d7c6610e1$export$9574e176201e5e8d(props) {
|
|
|
703
671
|
market_: () => props.market,
|
|
704
672
|
merchant_: () => props.merchant,
|
|
705
673
|
layout_options_: $52FdA$solidjs.createMemo(() => ({
|
|
706
|
-
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(
|
|
674
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
707
675
|
...grid_spacing_override()
|
|
708
676
|
}))
|
|
709
677
|
}));
|
|
@@ -823,7 +791,7 @@ function $41227f10ad680afd$export$9756467d34d91cdb(props) {
|
|
|
823
791
|
market_: () => props.market,
|
|
824
792
|
merchant_: () => props.merchant,
|
|
825
793
|
layout_options_: $52FdA$solidjs.createMemo(() => ({
|
|
826
|
-
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(
|
|
794
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
827
795
|
...grid_spacing_override()
|
|
828
796
|
}))
|
|
829
797
|
}));
|
|
@@ -1920,6 +1888,7 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
1920
1888
|
const [get_current_range] = current_range_;
|
|
1921
1889
|
const pre_price = $52FdA$solidjs.createMemo(() => price_formatting_().pre_);
|
|
1922
1890
|
const post_price = $52FdA$solidjs.createMemo(() => price_formatting_().post_);
|
|
1891
|
+
const should_be_disabled_ = $52FdA$solidjs.createMemo(() => Math.abs(min_() - max_()) < 2);
|
|
1923
1892
|
return (() => {
|
|
1924
1893
|
const _el$ = $52FdA$solidjsweb.getNextElement($0257c760a99bfacb$var$_tmpl$),
|
|
1925
1894
|
_el$2 = _el$.firstChild,
|
|
@@ -1967,7 +1936,8 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
1967
1936
|
max_: max_,
|
|
1968
1937
|
min_: min_,
|
|
1969
1938
|
current_range_: current_range_,
|
|
1970
|
-
i18n_: i18n_
|
|
1939
|
+
i18n_: i18n_,
|
|
1940
|
+
should_be_disabled_: should_be_disabled_
|
|
1971
1941
|
}), _el$24, _co$7);
|
|
1972
1942
|
$52FdA$solidjsweb.insert(_el$9, pre_price, _el$11, _co$);
|
|
1973
1943
|
$52FdA$solidjsweb.insert(_el$9, $52FdA$solidjsweb.createComponent((0, $f38f2e64ebe2da86$export$a71e92cfbb498adc), {
|
|
@@ -1990,18 +1960,24 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
1990
1960
|
}), _el$20, _co$5);
|
|
1991
1961
|
$52FdA$solidjsweb.insert(_el$16, post_price, _el$22, _co$6);
|
|
1992
1962
|
$52FdA$solidjsweb.effect(_p$ => {
|
|
1993
|
-
const _v$ =
|
|
1994
|
-
_v$2 =
|
|
1995
|
-
_v$3 =
|
|
1996
|
-
_v$4 =
|
|
1997
|
-
_v$5 =
|
|
1998
|
-
_v$6 =
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
_v$
|
|
2003
|
-
_v$
|
|
2004
|
-
_v$
|
|
1963
|
+
const _v$ = !!(min_() === max_()),
|
|
1964
|
+
_v$2 = should_be_disabled_(),
|
|
1965
|
+
_v$3 = i18n_.range_filter_low_point_aria_label_(),
|
|
1966
|
+
_v$4 = min_(),
|
|
1967
|
+
_v$5 = max_(),
|
|
1968
|
+
_v$6 = should_be_disabled_(),
|
|
1969
|
+
_v$7 = i18n_.range_filter_high_point_aria_label_(),
|
|
1970
|
+
_v$8 = min_(),
|
|
1971
|
+
_v$9 = max_();
|
|
1972
|
+
_v$ !== _p$._v$ && _el$.classList.toggle("disabled", _p$._v$ = _v$);
|
|
1973
|
+
_v$2 !== _p$._v$2 && (_el$4.disabled = _p$._v$2 = _v$2);
|
|
1974
|
+
_v$3 !== _p$._v$3 && $52FdA$solidjsweb.setAttribute(_el$4, "aria-label", _p$._v$3 = _v$3);
|
|
1975
|
+
_v$4 !== _p$._v$4 && $52FdA$solidjsweb.setAttribute(_el$4, "min", _p$._v$4 = _v$4);
|
|
1976
|
+
_v$5 !== _p$._v$5 && $52FdA$solidjsweb.setAttribute(_el$4, "max", _p$._v$5 = _v$5);
|
|
1977
|
+
_v$6 !== _p$._v$6 && (_el$7.disabled = _p$._v$6 = _v$6);
|
|
1978
|
+
_v$7 !== _p$._v$7 && $52FdA$solidjsweb.setAttribute(_el$7, "aria-label", _p$._v$7 = _v$7);
|
|
1979
|
+
_v$8 !== _p$._v$8 && $52FdA$solidjsweb.setAttribute(_el$7, "min", _p$._v$8 = _v$8);
|
|
1980
|
+
_v$9 !== _p$._v$9 && $52FdA$solidjsweb.setAttribute(_el$7, "max", _p$._v$9 = _v$9);
|
|
2005
1981
|
return _p$;
|
|
2006
1982
|
}, {
|
|
2007
1983
|
_v$: undefined,
|
|
@@ -2009,7 +1985,10 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
2009
1985
|
_v$3: undefined,
|
|
2010
1986
|
_v$4: undefined,
|
|
2011
1987
|
_v$5: undefined,
|
|
2012
|
-
_v$6: undefined
|
|
1988
|
+
_v$6: undefined,
|
|
1989
|
+
_v$7: undefined,
|
|
1990
|
+
_v$8: undefined,
|
|
1991
|
+
_v$9: undefined
|
|
2013
1992
|
});
|
|
2014
1993
|
$52FdA$solidjsweb.effect(() => _el$4.value = get_current_range()[0]);
|
|
2015
1994
|
$52FdA$solidjsweb.effect(() => _el$7.value = get_current_range()[1]);
|
|
@@ -2022,7 +2001,8 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref6) {
|
|
|
2022
2001
|
current_range_: current_range_,
|
|
2023
2002
|
min_: min_,
|
|
2024
2003
|
i18n_: i18n_,
|
|
2025
|
-
max_: max_
|
|
2004
|
+
max_: max_,
|
|
2005
|
+
should_be_disabled_: should_be_disabled_
|
|
2026
2006
|
} = _ref6;
|
|
2027
2007
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
2028
2008
|
const transform_linear_to_nonlinear = _ref7 => {
|
|
@@ -2030,8 +2010,7 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref6) {
|
|
|
2030
2010
|
return [Math.sqrt(smaller), Math.sqrt(larger)];
|
|
2031
2011
|
};
|
|
2032
2012
|
const [read_current_range, write_current_range] = current_range_;
|
|
2033
|
-
const
|
|
2034
|
-
const [read_modified_range, write_modified_range] = modified_range;
|
|
2013
|
+
const modified_range_accessor = $52FdA$solidjs.createMemo(() => transform_linear_to_nonlinear(read_current_range()));
|
|
2035
2014
|
const modified_max = $52FdA$solidjs.createMemo(() => Math.sqrt(max_()));
|
|
2036
2015
|
const modified_min = $52FdA$solidjs.createMemo(() => Math.sqrt(min_()));
|
|
2037
2016
|
const offset_value_calculator_ = (value, how_many) => {
|
|
@@ -2039,36 +2018,39 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref6) {
|
|
|
2039
2018
|
const changed = number_in_linear + how_many;
|
|
2040
2019
|
return Math.sqrt(changed);
|
|
2041
2020
|
};
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
const
|
|
2045
|
-
const
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
}
|
|
2021
|
+
const convert_back = (smaller, larger) => [Math.round(smaller * smaller), Math.round(larger * larger)];
|
|
2022
|
+
const modified_range_setter = new_range_or_function => {
|
|
2023
|
+
const old_range = $52FdA$solidjs.untrack(modified_range_accessor);
|
|
2024
|
+
const new_range = typeof new_range_or_function === "function" ? new_range_or_function(old_range) : new_range_or_function;
|
|
2025
|
+
const [smaller, larger] = new_range;
|
|
2026
|
+
const [old_smaller, old_larger] = old_range;
|
|
2027
|
+
const new_range_converted = convert_back(smaller, larger);
|
|
2028
|
+
const old_range_converted = convert_back(old_smaller, old_larger);
|
|
2029
|
+
if (new_range_converted[0] === old_range_converted[0] && new_range_converted[1] === old_range_converted[1])
|
|
2030
|
+
// 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
|
|
2031
|
+
return new_range;
|
|
2032
|
+
write_current_range(new_range_converted);
|
|
2033
|
+
return new_range;
|
|
2034
|
+
};
|
|
2056
2035
|
return $0257c760a99bfacb$var$LinearSlider({
|
|
2057
|
-
current_range_:
|
|
2036
|
+
current_range_: [modified_range_accessor, modified_range_setter],
|
|
2037
|
+
// "Lie" to the actual slider so we don't have to implement exponential handling in there
|
|
2058
2038
|
min_: modified_min,
|
|
2059
2039
|
max_: modified_max,
|
|
2060
2040
|
offset_value_calculator_: offset_value_calculator_,
|
|
2061
|
-
i18n_: i18n_
|
|
2041
|
+
i18n_: i18n_,
|
|
2042
|
+
should_be_disabled_: should_be_disabled_
|
|
2062
2043
|
});
|
|
2063
2044
|
}
|
|
2064
|
-
function $0257c760a99bfacb$var$LinearSlider(
|
|
2045
|
+
function $0257c760a99bfacb$var$LinearSlider(_ref8) {
|
|
2065
2046
|
let {
|
|
2066
2047
|
max_: max_,
|
|
2067
2048
|
min_: min_,
|
|
2068
2049
|
current_range_: current_range_,
|
|
2069
2050
|
offset_value_calculator_: offset_value_calculator_,
|
|
2070
|
-
i18n_: i18n_
|
|
2071
|
-
|
|
2051
|
+
i18n_: i18n_,
|
|
2052
|
+
should_be_disabled_: should_be_disabled_
|
|
2053
|
+
} = _ref8;
|
|
2072
2054
|
let range_input_1;
|
|
2073
2055
|
let range_input_2;
|
|
2074
2056
|
let clickable_slider;
|
|
@@ -2077,6 +2059,7 @@ function $0257c760a99bfacb$var$LinearSlider(_ref9) {
|
|
|
2077
2059
|
const min = min_();
|
|
2078
2060
|
const span = max_() - min;
|
|
2079
2061
|
const [start, end] = get_current_range();
|
|
2062
|
+
if (should_be_disabled_()) return "left:50%;right:50%";
|
|
2080
2063
|
return "left:".concat((start - min) / span * 100, "%;right:").concat(100 - (end - min) / span * 100, "%");
|
|
2081
2064
|
});
|
|
2082
2065
|
const set_value = (el, index) => {
|
|
@@ -2126,26 +2109,32 @@ function $0257c760a99bfacb$var$LinearSlider(_ref9) {
|
|
|
2126
2109
|
}, _el$29);
|
|
2127
2110
|
$52FdA$solidjsweb.addEventListener(_el$29, "input", $52FdA$depictaiutilishared.catchify(() => $0257c760a99bfacb$var$set_range_with_sanitation(min_, max_, current_range_, 1, range_input_2, offset_value_calculator_)), true);
|
|
2128
2111
|
$52FdA$solidjsweb.effect(_p$ => {
|
|
2129
|
-
const _v$
|
|
2130
|
-
_v$
|
|
2131
|
-
_v$
|
|
2132
|
-
_v$
|
|
2133
|
-
_v$
|
|
2134
|
-
_v$
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
_v$
|
|
2138
|
-
_v$
|
|
2139
|
-
_v$
|
|
2140
|
-
_v$
|
|
2112
|
+
const _v$10 = should_be_disabled_(),
|
|
2113
|
+
_v$11 = i18n_.range_filter_low_point_aria_label_(),
|
|
2114
|
+
_v$12 = min_(),
|
|
2115
|
+
_v$13 = max_(),
|
|
2116
|
+
_v$14 = should_be_disabled_(),
|
|
2117
|
+
_v$15 = i18n_.range_filter_high_point_aria_label_(),
|
|
2118
|
+
_v$16 = min_(),
|
|
2119
|
+
_v$17 = max_();
|
|
2120
|
+
_v$10 !== _p$._v$10 && (_el$28.disabled = _p$._v$10 = _v$10);
|
|
2121
|
+
_v$11 !== _p$._v$11 && $52FdA$solidjsweb.setAttribute(_el$28, "aria-label", _p$._v$11 = _v$11);
|
|
2122
|
+
_v$12 !== _p$._v$12 && $52FdA$solidjsweb.setAttribute(_el$28, "min", _p$._v$12 = _v$12);
|
|
2123
|
+
_v$13 !== _p$._v$13 && $52FdA$solidjsweb.setAttribute(_el$28, "max", _p$._v$13 = _v$13);
|
|
2124
|
+
_v$14 !== _p$._v$14 && (_el$29.disabled = _p$._v$14 = _v$14);
|
|
2125
|
+
_v$15 !== _p$._v$15 && $52FdA$solidjsweb.setAttribute(_el$29, "aria-label", _p$._v$15 = _v$15);
|
|
2126
|
+
_v$16 !== _p$._v$16 && $52FdA$solidjsweb.setAttribute(_el$29, "min", _p$._v$16 = _v$16);
|
|
2127
|
+
_v$17 !== _p$._v$17 && $52FdA$solidjsweb.setAttribute(_el$29, "max", _p$._v$17 = _v$17);
|
|
2141
2128
|
return _p$;
|
|
2142
2129
|
}, {
|
|
2143
|
-
_v$7: undefined,
|
|
2144
|
-
_v$8: undefined,
|
|
2145
|
-
_v$9: undefined,
|
|
2146
2130
|
_v$10: undefined,
|
|
2147
2131
|
_v$11: undefined,
|
|
2148
|
-
_v$12: undefined
|
|
2132
|
+
_v$12: undefined,
|
|
2133
|
+
_v$13: undefined,
|
|
2134
|
+
_v$14: undefined,
|
|
2135
|
+
_v$15: undefined,
|
|
2136
|
+
_v$16: undefined,
|
|
2137
|
+
_v$17: undefined
|
|
2149
2138
|
});
|
|
2150
2139
|
$52FdA$solidjsweb.effect(() => _el$28.value = $52FdA$solidjs.createMemo(() => {
|
|
2151
2140
|
min_();
|
|
@@ -2455,59 +2444,62 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
2455
2444
|
return has_expandable();
|
|
2456
2445
|
},
|
|
2457
2446
|
get children() {
|
|
2458
|
-
return
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
}
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
return ((
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2447
|
+
return (() => {
|
|
2448
|
+
const is_open = $52FdA$solidjs.createMemo(() => {
|
|
2449
|
+
const v = value();
|
|
2450
|
+
if (!v)
|
|
2451
|
+
// only to prevent cleanup errors
|
|
2452
|
+
return $52FdA$solidjs.createSignal(false);
|
|
2453
|
+
const {
|
|
2454
|
+
is_expanded_: {
|
|
2455
|
+
ui_should_show_expanded_: ui_should_show_expanded_,
|
|
2456
|
+
set_user_expanded_: set_user_expanded_
|
|
2457
|
+
}
|
|
2458
|
+
} = v;
|
|
2459
|
+
return [ui_should_show_expanded_, set_user_expanded_];
|
|
2460
|
+
});
|
|
2461
|
+
return $52FdA$solidjsweb.createComponent((0, $4cfe8400ed3f92c4$export$6c6d7a51fa9aa15d), {
|
|
2462
|
+
get details_() {
|
|
2463
|
+
return $52FdA$solidjsweb.getNextElement($9c1d49181fb3002a$var$_tmpl$3);
|
|
2464
|
+
},
|
|
2465
|
+
get summary_() {
|
|
2466
|
+
return (() => {
|
|
2467
|
+
const _el$12 = $52FdA$solidjsweb.getNextElement($9c1d49181fb3002a$var$_tmpl$4),
|
|
2468
|
+
_el$13 = _el$12.firstChild,
|
|
2469
|
+
_el$14 = _el$13.firstChild,
|
|
2470
|
+
_el$15 = _el$14.nextSibling,
|
|
2471
|
+
[_el$16, _co$5] = $52FdA$solidjsweb.getNextMarker(_el$15.nextSibling);
|
|
2472
|
+
$52FdA$solidjsweb.insert(_el$14, () => {
|
|
2473
|
+
var _value10;
|
|
2474
|
+
return (_value10 = value()) === null || _value10 === void 0 ? void 0 : _value10.count_;
|
|
2475
|
+
});
|
|
2476
|
+
$52FdA$solidjsweb.insert(_el$13, $52FdA$solidjsweb.createComponent((0, $ac040bdfeed58ee4$export$e5c2828934226505), {
|
|
2477
|
+
i18n_: i18n_,
|
|
2478
|
+
get expanded_() {
|
|
2479
|
+
return $52FdA$solidjs.createMemo(() => {
|
|
2480
|
+
var _value$is_expanded_$u, _value11, _value11$is_expanded_, _value11$is_expanded_2;
|
|
2481
|
+
return (_value$is_expanded_$u = (_value11 = value()) === null || _value11 === void 0 ? void 0 : (_value11$is_expanded_ = _value11.is_expanded_) === null || _value11$is_expanded_ === void 0 ? void 0 : (_value11$is_expanded_2 = _value11$is_expanded_.ui_should_show_expanded_) === null || _value11$is_expanded_2 === void 0 ? void 0 : _value11$is_expanded_2.call(_value11$is_expanded_)) !== null && _value$is_expanded_$u !== void 0 ? _value$is_expanded_$u : false;
|
|
2482
|
+
});
|
|
2483
|
+
}
|
|
2484
|
+
}), _el$16, _co$5);
|
|
2485
|
+
$52FdA$solidjsweb.effect(() => {
|
|
2486
|
+
var _value12;
|
|
2487
|
+
return _el$14.classList.toggle("count-0", !!(((_value12 = value()) === null || _value12 === void 0 ? void 0 : _value12.count_) === 0));
|
|
2488
|
+
});
|
|
2489
|
+
return _el$12;
|
|
2490
|
+
})();
|
|
2491
|
+
},
|
|
2492
|
+
get is_open_() {
|
|
2493
|
+
return is_open();
|
|
2494
|
+
},
|
|
2495
|
+
get children() {
|
|
2496
|
+
return $9c1d49181fb3002a$var$render_stuff($52FdA$solidjs.createMemo(() => {
|
|
2497
|
+
var _value13;
|
|
2498
|
+
return ((_value13 = value()) === null || _value13 === void 0 ? void 0 : _value13.children_) || {};
|
|
2499
|
+
}), existing_filter, i18n_);
|
|
2500
|
+
}
|
|
2501
|
+
});
|
|
2502
|
+
})();
|
|
2511
2503
|
}
|
|
2512
2504
|
}), _el$10, _co$4);
|
|
2513
2505
|
$52FdA$solidjsweb.effect(() => _el$6.classList.toggle("expandable", !!has_expandable()));
|
|
@@ -2575,7 +2567,7 @@ function $9c1d49181fb3002a$var$create_updating_signal(_ref3) {
|
|
|
2575
2567
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
2576
2568
|
let updating_blocked = false;
|
|
2577
2569
|
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));
|
|
2578
|
-
signal_.push(...$52FdA$solidjs.createSignal(index_of_us_in_selected_filter >= 0
|
|
2570
|
+
signal_.push(...$52FdA$solidjs.createSignal(index_of_us_in_selected_filter >= 0));
|
|
2579
2571
|
const [read_checked, write_checked] = signal_;
|
|
2580
2572
|
const child_objects = Object.values(self_.children_);
|
|
2581
2573
|
const get_child_object_values = child_objects.map(_ref4 => {
|
|
@@ -10817,6 +10809,38 @@ function $98bd00c15a2e3159$export$828dcdd425fd3231(aligner) {
|
|
|
10817
10809
|
cleanup: cleanup
|
|
10818
10810
|
};
|
|
10819
10811
|
}
|
|
10812
|
+
|
|
10813
|
+
/**
|
|
10814
|
+
* 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
|
|
10815
|
+
*/
|
|
10816
|
+
function $b1ea8d47bcf03111$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
10817
|
+
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
10818
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
10819
|
+
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
10820
|
+
let [cols, max_width] = _ref;
|
|
10821
|
+
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
10822
|
+
}).sort((_ref2, _ref3) => {
|
|
10823
|
+
let [, a] = _ref2;
|
|
10824
|
+
let [, b] = _ref3;
|
|
10825
|
+
return a - b;
|
|
10826
|
+
});
|
|
10827
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
10828
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
10829
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
10830
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
10831
|
+
const to_delete = [];
|
|
10832
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
10833
|
+
const [, max_width] = sorted_sizes[i];
|
|
10834
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
10835
|
+
to_delete.push(i);
|
|
10836
|
+
}
|
|
10837
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
10838
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
10839
|
+
return sorted_sizes.map(_ref4 => {
|
|
10840
|
+
let [cols, max_width] = _ref4;
|
|
10841
|
+
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
10842
|
+
});
|
|
10843
|
+
}
|
|
10820
10844
|
const $ddd39c5f36f49703$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="depict plp search"></div>`, 2);
|
|
10821
10845
|
function $ddd39c5f36f49703$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
10822
10846
|
$ddd39c5f36f49703$var$_checkPrivateRedeclaration(obj, privateMap);
|
package/ES10/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
|
*/
|