@depict-ai/ui 2.0.5 → 2.0.6
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 +131 -107
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +131 -107
- package/latest/index.cjs +117 -90
- package/latest/index.d.ts +1 -1
- package/latest/index.js +117 -90
- package/package.json +2 -2
- package/server/ES10/index.cjs +75 -66
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +75 -66
- package/server/latest/index.cjs +66 -54
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +66 -54
- package/locales/require.js +0 -1152
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.6";
|
|
71
71
|
|
|
72
72
|
/** @jsxImportSource solid-js */
|
|
73
73
|
|
|
@@ -1920,6 +1920,7 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
1920
1920
|
const [get_current_range] = current_range_;
|
|
1921
1921
|
const pre_price = $52FdA$solidjs.createMemo(() => price_formatting_().pre_);
|
|
1922
1922
|
const post_price = $52FdA$solidjs.createMemo(() => price_formatting_().post_);
|
|
1923
|
+
const should_be_disabled_ = $52FdA$solidjs.createMemo(() => Math.abs(min_() - max_()) < 2);
|
|
1923
1924
|
return (() => {
|
|
1924
1925
|
const _el$ = $52FdA$solidjsweb.getNextElement($0257c760a99bfacb$var$_tmpl$),
|
|
1925
1926
|
_el$2 = _el$.firstChild,
|
|
@@ -1967,7 +1968,8 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
1967
1968
|
max_: max_,
|
|
1968
1969
|
min_: min_,
|
|
1969
1970
|
current_range_: current_range_,
|
|
1970
|
-
i18n_: i18n_
|
|
1971
|
+
i18n_: i18n_,
|
|
1972
|
+
should_be_disabled_: should_be_disabled_
|
|
1971
1973
|
}), _el$24, _co$7);
|
|
1972
1974
|
$52FdA$solidjsweb.insert(_el$9, pre_price, _el$11, _co$);
|
|
1973
1975
|
$52FdA$solidjsweb.insert(_el$9, $52FdA$solidjsweb.createComponent((0, $f38f2e64ebe2da86$export$a71e92cfbb498adc), {
|
|
@@ -1990,18 +1992,24 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
1990
1992
|
}), _el$20, _co$5);
|
|
1991
1993
|
$52FdA$solidjsweb.insert(_el$16, post_price, _el$22, _co$6);
|
|
1992
1994
|
$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$
|
|
1995
|
+
const _v$ = !!(min_() === max_()),
|
|
1996
|
+
_v$2 = should_be_disabled_(),
|
|
1997
|
+
_v$3 = i18n_.range_filter_low_point_aria_label_(),
|
|
1998
|
+
_v$4 = min_(),
|
|
1999
|
+
_v$5 = max_(),
|
|
2000
|
+
_v$6 = should_be_disabled_(),
|
|
2001
|
+
_v$7 = i18n_.range_filter_high_point_aria_label_(),
|
|
2002
|
+
_v$8 = min_(),
|
|
2003
|
+
_v$9 = max_();
|
|
2004
|
+
_v$ !== _p$._v$ && _el$.classList.toggle("disabled", _p$._v$ = _v$);
|
|
2005
|
+
_v$2 !== _p$._v$2 && (_el$4.disabled = _p$._v$2 = _v$2);
|
|
2006
|
+
_v$3 !== _p$._v$3 && $52FdA$solidjsweb.setAttribute(_el$4, "aria-label", _p$._v$3 = _v$3);
|
|
2007
|
+
_v$4 !== _p$._v$4 && $52FdA$solidjsweb.setAttribute(_el$4, "min", _p$._v$4 = _v$4);
|
|
2008
|
+
_v$5 !== _p$._v$5 && $52FdA$solidjsweb.setAttribute(_el$4, "max", _p$._v$5 = _v$5);
|
|
2009
|
+
_v$6 !== _p$._v$6 && (_el$7.disabled = _p$._v$6 = _v$6);
|
|
2010
|
+
_v$7 !== _p$._v$7 && $52FdA$solidjsweb.setAttribute(_el$7, "aria-label", _p$._v$7 = _v$7);
|
|
2011
|
+
_v$8 !== _p$._v$8 && $52FdA$solidjsweb.setAttribute(_el$7, "min", _p$._v$8 = _v$8);
|
|
2012
|
+
_v$9 !== _p$._v$9 && $52FdA$solidjsweb.setAttribute(_el$7, "max", _p$._v$9 = _v$9);
|
|
2005
2013
|
return _p$;
|
|
2006
2014
|
}, {
|
|
2007
2015
|
_v$: undefined,
|
|
@@ -2009,7 +2017,10 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
|
|
|
2009
2017
|
_v$3: undefined,
|
|
2010
2018
|
_v$4: undefined,
|
|
2011
2019
|
_v$5: undefined,
|
|
2012
|
-
_v$6: undefined
|
|
2020
|
+
_v$6: undefined,
|
|
2021
|
+
_v$7: undefined,
|
|
2022
|
+
_v$8: undefined,
|
|
2023
|
+
_v$9: undefined
|
|
2013
2024
|
});
|
|
2014
2025
|
$52FdA$solidjsweb.effect(() => _el$4.value = get_current_range()[0]);
|
|
2015
2026
|
$52FdA$solidjsweb.effect(() => _el$7.value = get_current_range()[1]);
|
|
@@ -2022,7 +2033,8 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref6) {
|
|
|
2022
2033
|
current_range_: current_range_,
|
|
2023
2034
|
min_: min_,
|
|
2024
2035
|
i18n_: i18n_,
|
|
2025
|
-
max_: max_
|
|
2036
|
+
max_: max_,
|
|
2037
|
+
should_be_disabled_: should_be_disabled_
|
|
2026
2038
|
} = _ref6;
|
|
2027
2039
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
2028
2040
|
const transform_linear_to_nonlinear = _ref7 => {
|
|
@@ -2030,8 +2042,7 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref6) {
|
|
|
2030
2042
|
return [Math.sqrt(smaller), Math.sqrt(larger)];
|
|
2031
2043
|
};
|
|
2032
2044
|
const [read_current_range, write_current_range] = current_range_;
|
|
2033
|
-
const
|
|
2034
|
-
const [read_modified_range, write_modified_range] = modified_range;
|
|
2045
|
+
const modified_range_accessor = $52FdA$solidjs.createMemo(() => transform_linear_to_nonlinear(read_current_range()));
|
|
2035
2046
|
const modified_max = $52FdA$solidjs.createMemo(() => Math.sqrt(max_()));
|
|
2036
2047
|
const modified_min = $52FdA$solidjs.createMemo(() => Math.sqrt(min_()));
|
|
2037
2048
|
const offset_value_calculator_ = (value, how_many) => {
|
|
@@ -2039,36 +2050,39 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref6) {
|
|
|
2039
2050
|
const changed = number_in_linear + how_many;
|
|
2040
2051
|
return Math.sqrt(changed);
|
|
2041
2052
|
};
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
const
|
|
2045
|
-
const
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
}
|
|
2053
|
+
const convert_back = (smaller, larger) => [Math.round(smaller * smaller), Math.round(larger * larger)];
|
|
2054
|
+
const modified_range_setter = new_range_or_function => {
|
|
2055
|
+
const old_range = $52FdA$solidjs.untrack(modified_range_accessor);
|
|
2056
|
+
const new_range = typeof new_range_or_function === "function" ? new_range_or_function(old_range) : new_range_or_function;
|
|
2057
|
+
const [smaller, larger] = new_range;
|
|
2058
|
+
const [old_smaller, old_larger] = old_range;
|
|
2059
|
+
const new_range_converted = convert_back(smaller, larger);
|
|
2060
|
+
const old_range_converted = convert_back(old_smaller, old_larger);
|
|
2061
|
+
if (new_range_converted[0] === old_range_converted[0] && new_range_converted[1] === old_range_converted[1])
|
|
2062
|
+
// 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
|
|
2063
|
+
return new_range;
|
|
2064
|
+
write_current_range(new_range_converted);
|
|
2065
|
+
return new_range;
|
|
2066
|
+
};
|
|
2056
2067
|
return $0257c760a99bfacb$var$LinearSlider({
|
|
2057
|
-
current_range_:
|
|
2068
|
+
current_range_: [modified_range_accessor, modified_range_setter],
|
|
2069
|
+
// "Lie" to the actual slider so we don't have to implement exponential handling in there
|
|
2058
2070
|
min_: modified_min,
|
|
2059
2071
|
max_: modified_max,
|
|
2060
2072
|
offset_value_calculator_: offset_value_calculator_,
|
|
2061
|
-
i18n_: i18n_
|
|
2073
|
+
i18n_: i18n_,
|
|
2074
|
+
should_be_disabled_: should_be_disabled_
|
|
2062
2075
|
});
|
|
2063
2076
|
}
|
|
2064
|
-
function $0257c760a99bfacb$var$LinearSlider(
|
|
2077
|
+
function $0257c760a99bfacb$var$LinearSlider(_ref8) {
|
|
2065
2078
|
let {
|
|
2066
2079
|
max_: max_,
|
|
2067
2080
|
min_: min_,
|
|
2068
2081
|
current_range_: current_range_,
|
|
2069
2082
|
offset_value_calculator_: offset_value_calculator_,
|
|
2070
|
-
i18n_: i18n_
|
|
2071
|
-
|
|
2083
|
+
i18n_: i18n_,
|
|
2084
|
+
should_be_disabled_: should_be_disabled_
|
|
2085
|
+
} = _ref8;
|
|
2072
2086
|
let range_input_1;
|
|
2073
2087
|
let range_input_2;
|
|
2074
2088
|
let clickable_slider;
|
|
@@ -2077,6 +2091,7 @@ function $0257c760a99bfacb$var$LinearSlider(_ref9) {
|
|
|
2077
2091
|
const min = min_();
|
|
2078
2092
|
const span = max_() - min;
|
|
2079
2093
|
const [start, end] = get_current_range();
|
|
2094
|
+
if (should_be_disabled_()) return "left:50%;right:50%";
|
|
2080
2095
|
return "left:".concat((start - min) / span * 100, "%;right:").concat(100 - (end - min) / span * 100, "%");
|
|
2081
2096
|
});
|
|
2082
2097
|
const set_value = (el, index) => {
|
|
@@ -2126,26 +2141,32 @@ function $0257c760a99bfacb$var$LinearSlider(_ref9) {
|
|
|
2126
2141
|
}, _el$29);
|
|
2127
2142
|
$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
2143
|
$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$
|
|
2144
|
+
const _v$10 = should_be_disabled_(),
|
|
2145
|
+
_v$11 = i18n_.range_filter_low_point_aria_label_(),
|
|
2146
|
+
_v$12 = min_(),
|
|
2147
|
+
_v$13 = max_(),
|
|
2148
|
+
_v$14 = should_be_disabled_(),
|
|
2149
|
+
_v$15 = i18n_.range_filter_high_point_aria_label_(),
|
|
2150
|
+
_v$16 = min_(),
|
|
2151
|
+
_v$17 = max_();
|
|
2152
|
+
_v$10 !== _p$._v$10 && (_el$28.disabled = _p$._v$10 = _v$10);
|
|
2153
|
+
_v$11 !== _p$._v$11 && $52FdA$solidjsweb.setAttribute(_el$28, "aria-label", _p$._v$11 = _v$11);
|
|
2154
|
+
_v$12 !== _p$._v$12 && $52FdA$solidjsweb.setAttribute(_el$28, "min", _p$._v$12 = _v$12);
|
|
2155
|
+
_v$13 !== _p$._v$13 && $52FdA$solidjsweb.setAttribute(_el$28, "max", _p$._v$13 = _v$13);
|
|
2156
|
+
_v$14 !== _p$._v$14 && (_el$29.disabled = _p$._v$14 = _v$14);
|
|
2157
|
+
_v$15 !== _p$._v$15 && $52FdA$solidjsweb.setAttribute(_el$29, "aria-label", _p$._v$15 = _v$15);
|
|
2158
|
+
_v$16 !== _p$._v$16 && $52FdA$solidjsweb.setAttribute(_el$29, "min", _p$._v$16 = _v$16);
|
|
2159
|
+
_v$17 !== _p$._v$17 && $52FdA$solidjsweb.setAttribute(_el$29, "max", _p$._v$17 = _v$17);
|
|
2141
2160
|
return _p$;
|
|
2142
2161
|
}, {
|
|
2143
|
-
_v$7: undefined,
|
|
2144
|
-
_v$8: undefined,
|
|
2145
|
-
_v$9: undefined,
|
|
2146
2162
|
_v$10: undefined,
|
|
2147
2163
|
_v$11: undefined,
|
|
2148
|
-
_v$12: undefined
|
|
2164
|
+
_v$12: undefined,
|
|
2165
|
+
_v$13: undefined,
|
|
2166
|
+
_v$14: undefined,
|
|
2167
|
+
_v$15: undefined,
|
|
2168
|
+
_v$16: undefined,
|
|
2169
|
+
_v$17: undefined
|
|
2149
2170
|
});
|
|
2150
2171
|
$52FdA$solidjsweb.effect(() => _el$28.value = $52FdA$solidjs.createMemo(() => {
|
|
2151
2172
|
min_();
|
|
@@ -2455,59 +2476,62 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
2455
2476
|
return has_expandable();
|
|
2456
2477
|
},
|
|
2457
2478
|
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
|
-
|
|
2479
|
+
return (() => {
|
|
2480
|
+
const is_open = $52FdA$solidjs.createMemo(() => {
|
|
2481
|
+
const v = value();
|
|
2482
|
+
if (!v)
|
|
2483
|
+
// only to prevent cleanup errors
|
|
2484
|
+
return $52FdA$solidjs.createSignal(false);
|
|
2485
|
+
const {
|
|
2486
|
+
is_expanded_: {
|
|
2487
|
+
ui_should_show_expanded_: ui_should_show_expanded_,
|
|
2488
|
+
set_user_expanded_: set_user_expanded_
|
|
2489
|
+
}
|
|
2490
|
+
} = v;
|
|
2491
|
+
return [ui_should_show_expanded_, set_user_expanded_];
|
|
2492
|
+
});
|
|
2493
|
+
return $52FdA$solidjsweb.createComponent((0, $4cfe8400ed3f92c4$export$6c6d7a51fa9aa15d), {
|
|
2494
|
+
get details_() {
|
|
2495
|
+
return $52FdA$solidjsweb.getNextElement($9c1d49181fb3002a$var$_tmpl$3);
|
|
2496
|
+
},
|
|
2497
|
+
get summary_() {
|
|
2498
|
+
return (() => {
|
|
2499
|
+
const _el$12 = $52FdA$solidjsweb.getNextElement($9c1d49181fb3002a$var$_tmpl$4),
|
|
2500
|
+
_el$13 = _el$12.firstChild,
|
|
2501
|
+
_el$14 = _el$13.firstChild,
|
|
2502
|
+
_el$15 = _el$14.nextSibling,
|
|
2503
|
+
[_el$16, _co$5] = $52FdA$solidjsweb.getNextMarker(_el$15.nextSibling);
|
|
2504
|
+
$52FdA$solidjsweb.insert(_el$14, () => {
|
|
2505
|
+
var _value10;
|
|
2506
|
+
return (_value10 = value()) === null || _value10 === void 0 ? void 0 : _value10.count_;
|
|
2507
|
+
});
|
|
2508
|
+
$52FdA$solidjsweb.insert(_el$13, $52FdA$solidjsweb.createComponent((0, $ac040bdfeed58ee4$export$e5c2828934226505), {
|
|
2509
|
+
i18n_: i18n_,
|
|
2510
|
+
get expanded_() {
|
|
2511
|
+
return $52FdA$solidjs.createMemo(() => {
|
|
2512
|
+
var _value$is_expanded_$u, _value11, _value11$is_expanded_, _value11$is_expanded_2;
|
|
2513
|
+
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;
|
|
2514
|
+
});
|
|
2515
|
+
}
|
|
2516
|
+
}), _el$16, _co$5);
|
|
2517
|
+
$52FdA$solidjsweb.effect(() => {
|
|
2518
|
+
var _value12;
|
|
2519
|
+
return _el$14.classList.toggle("count-0", !!(((_value12 = value()) === null || _value12 === void 0 ? void 0 : _value12.count_) === 0));
|
|
2520
|
+
});
|
|
2521
|
+
return _el$12;
|
|
2522
|
+
})();
|
|
2523
|
+
},
|
|
2524
|
+
get is_open_() {
|
|
2525
|
+
return is_open();
|
|
2526
|
+
},
|
|
2527
|
+
get children() {
|
|
2528
|
+
return $9c1d49181fb3002a$var$render_stuff($52FdA$solidjs.createMemo(() => {
|
|
2529
|
+
var _value13;
|
|
2530
|
+
return ((_value13 = value()) === null || _value13 === void 0 ? void 0 : _value13.children_) || {};
|
|
2531
|
+
}), existing_filter, i18n_);
|
|
2532
|
+
}
|
|
2533
|
+
});
|
|
2534
|
+
})();
|
|
2511
2535
|
}
|
|
2512
2536
|
}), _el$10, _co$4);
|
|
2513
2537
|
$52FdA$solidjsweb.effect(() => _el$6.classList.toggle("expandable", !!has_expandable()));
|
|
@@ -2575,7 +2599,7 @@ function $9c1d49181fb3002a$var$create_updating_signal(_ref3) {
|
|
|
2575
2599
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
2576
2600
|
let updating_blocked = false;
|
|
2577
2601
|
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
|
|
2602
|
+
signal_.push(...$52FdA$solidjs.createSignal(index_of_us_in_selected_filter >= 0));
|
|
2579
2603
|
const [read_checked, write_checked] = signal_;
|
|
2580
2604
|
const child_objects = Object.values(self_.children_);
|
|
2581
2605
|
const get_child_object_values = child_objects.map(_ref4 => {
|
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.6";
|
|
11
11
|
/**
|
|
12
12
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
13
13
|
*/
|