@depict-ai/ui 4.3.11 → 4.3.13
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 +65 -61
- package/ES10/index.d.ts +2 -1
- package/ES10/index.js +66 -62
- package/latest/index.cjs +60 -59
- package/latest/index.d.ts +2 -1
- package/latest/index.js +61 -60
- package/package.json +2 -2
- package/server/ES10/index.cjs +53 -53
- package/server/ES10/index.d.ts +2 -1
- package/server/ES10/index.js +54 -54
- package/server/latest/index.cjs +48 -51
- package/server/latest/index.d.ts +2 -1
- package/server/latest/index.js +49 -52
package/ES10/index.cjs
CHANGED
|
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
100
100
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
101
101
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
102
102
|
/*! Depict.ai search and product listing SDK */
|
|
103
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.
|
|
103
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.3.13";
|
|
104
104
|
const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
|
|
105
105
|
const cols_at_size = [];
|
|
106
106
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -776,7 +776,8 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
|
776
776
|
recommendations_resource_: recommendations_resource_,
|
|
777
777
|
product_card_template_: product_card_template_,
|
|
778
778
|
layout_options_: layout_options_,
|
|
779
|
-
title_: title_
|
|
779
|
+
title_: title_,
|
|
780
|
+
NoResultsFallback_: NoResultsFallback_
|
|
780
781
|
} = _ref;
|
|
781
782
|
const is_showing_something = $52FdA$solidjs.createMemo(() => {
|
|
782
783
|
var _recommendations_reso;
|
|
@@ -837,6 +838,9 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
|
837
838
|
get when() {
|
|
838
839
|
return is_showing_something();
|
|
839
840
|
},
|
|
841
|
+
get fallback() {
|
|
842
|
+
return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
|
|
843
|
+
},
|
|
840
844
|
children: slider
|
|
841
845
|
});
|
|
842
846
|
}
|
|
@@ -1780,7 +1784,8 @@ function $47e3c3102c78121b$export$44809a8a3e867e30(_ref) {
|
|
|
1780
1784
|
target: target
|
|
1781
1785
|
} = _ref2;
|
|
1782
1786
|
// Don't toggle when clicking on the links
|
|
1783
|
-
|
|
1787
|
+
const selector = "a[href]";
|
|
1788
|
+
if (target.matches(selector) || target.closest(selector)) return;
|
|
1784
1789
|
setUserWantsExpanded(prev => !prev);
|
|
1785
1790
|
}), true);
|
|
1786
1791
|
_el$.classList.toggle("placeholder", !!!display_);
|
|
@@ -1972,7 +1977,8 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
1972
1977
|
layout_options_: layout_options_,
|
|
1973
1978
|
title_: title_,
|
|
1974
1979
|
max_rows_: max_rows_,
|
|
1975
|
-
view_more_button_: view_more_button_
|
|
1980
|
+
view_more_button_: view_more_button_,
|
|
1981
|
+
NoResultsFallback_: NoResultsFallback_
|
|
1976
1982
|
} = _ref;
|
|
1977
1983
|
const rows_object_ = $52FdA$solidjs.createMemo(() => {
|
|
1978
1984
|
var _view_more_button$row;
|
|
@@ -2053,6 +2059,9 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
2053
2059
|
get when() {
|
|
2054
2060
|
return is_showing_something();
|
|
2055
2061
|
},
|
|
2062
|
+
get fallback() {
|
|
2063
|
+
return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
|
|
2064
|
+
},
|
|
2056
2065
|
children: elements
|
|
2057
2066
|
});
|
|
2058
2067
|
}
|
|
@@ -2122,7 +2131,8 @@ function $e57cd46536ad992e$export$2c9f9bf2092486aa(props) {
|
|
|
2122
2131
|
layout_options_: $52FdA$solidjs.createMemo(() => ({
|
|
2123
2132
|
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
2124
2133
|
...grid_spacing_override()
|
|
2125
|
-
}))
|
|
2134
|
+
})),
|
|
2135
|
+
NoResultsFallback_: () => props.NoResultsFallback_
|
|
2126
2136
|
};
|
|
2127
2137
|
$52FdA$solidjs.createEffect(() => {
|
|
2128
2138
|
const {
|
|
@@ -7493,44 +7503,20 @@ function $ac040bdfeed58ee4$export$e5c2828934226505(_ref) {
|
|
|
7493
7503
|
expanded_: expanded_,
|
|
7494
7504
|
i18n_: i18n_
|
|
7495
7505
|
} = _ref;
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
var _ref$2 = second_span;
|
|
7509
|
-
typeof _ref$2 === "function" ? $52FdA$solidjsweb.use(_ref$2, _el$3) : second_span = _el$3;
|
|
7510
|
-
$52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setAttribute(_el$, "aria-label", expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_()));
|
|
7506
|
+
return (() => {
|
|
7507
|
+
var _el$ = $52FdA$solidjsweb.getNextElement($ac040bdfeed58ee4$var$_tmpl$);
|
|
7508
|
+
$52FdA$solidjsweb.effect(_p$ => {
|
|
7509
|
+
var _v$ = !!expanded_(),
|
|
7510
|
+
_v$2 = expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_();
|
|
7511
|
+
_v$ !== _p$.e && _el$.classList.toggle("expanded", _p$.e = _v$);
|
|
7512
|
+
_v$2 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$, "aria-label", _p$.t = _v$2);
|
|
7513
|
+
return _p$;
|
|
7514
|
+
}, {
|
|
7515
|
+
e: undefined,
|
|
7516
|
+
t: undefined
|
|
7517
|
+
});
|
|
7511
7518
|
return _el$;
|
|
7512
7519
|
})();
|
|
7513
|
-
const [is_in_dom, set_is_in_dom] = $52FdA$solidjs.createSignal(false);
|
|
7514
|
-
(0, $52FdA$depictaiutilishared.observer).wait_for_element(outer_div).then($52FdA$depictaiutilishared.catchify(() => set_is_in_dom(true)));
|
|
7515
|
-
$52FdA$solidjs.createEffect(() => {
|
|
7516
|
-
if (!is_in_dom())
|
|
7517
|
-
// wait for us to being in DOM as animations don't work otherwise
|
|
7518
|
-
return;
|
|
7519
|
-
try {
|
|
7520
|
-
const expanded = expanded_();
|
|
7521
|
-
for (const span of [first_span, second_span]) span.animate([{
|
|
7522
|
-
transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
|
|
7523
|
-
}], animation_options);
|
|
7524
|
-
const percentage_value = "".concat(expanded ? 50 : 25, "%");
|
|
7525
|
-
second_span.animate([{
|
|
7526
|
-
left: percentage_value,
|
|
7527
|
-
right: percentage_value
|
|
7528
|
-
}], animation_options);
|
|
7529
|
-
} catch (e) {
|
|
7530
|
-
$52FdA$depictaiutilishared.dlog("partial keyframes probably not supported", e);
|
|
7531
|
-
}
|
|
7532
|
-
});
|
|
7533
|
-
return outer_div;
|
|
7534
7520
|
}
|
|
7535
7521
|
var $99472afa7112c427$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<span class=highlighted-part>`);
|
|
7536
7522
|
const $99472afa7112c427$var$dont_cut_in_between_less_than_characters = 30;
|
|
@@ -9403,19 +9389,21 @@ function $a162c9a08dc208c2$export$b288c38ae3fddb56(_ref) {
|
|
|
9403
9389
|
// can't or shouldn't be merged due to not being selected, just take remote one
|
|
9404
9390
|
new_local_filter_state.push(remote_filter);else {
|
|
9405
9391
|
const data_objs_in_remote = Object.fromEntries(remote_meta.values.map((value, index) => {
|
|
9406
|
-
var _remote_meta$counts, _remote_meta$names;
|
|
9392
|
+
var _remote_meta$counts, _remote_meta$names, _swatches;
|
|
9407
9393
|
return [JSON.stringify(value), {
|
|
9408
9394
|
value_: value,
|
|
9409
9395
|
count_: (_remote_meta$counts = remote_meta.counts) === null || _remote_meta$counts === void 0 ? void 0 : _remote_meta$counts[index],
|
|
9410
|
-
name_: (_remote_meta$names = remote_meta.names) === null || _remote_meta$names === void 0 ? void 0 : _remote_meta$names[index]
|
|
9396
|
+
name_: (_remote_meta$names = remote_meta.names) === null || _remote_meta$names === void 0 ? void 0 : _remote_meta$names[index],
|
|
9397
|
+
swatches_: (_swatches = remote_meta.swatches) === null || _swatches === void 0 ? void 0 : _swatches[index]
|
|
9411
9398
|
}];
|
|
9412
9399
|
}));
|
|
9413
9400
|
const data_objs_in_local = Object.fromEntries(local_meta.values.map((value, index) => {
|
|
9414
|
-
var _local_meta$names;
|
|
9401
|
+
var _local_meta$names, _swatches2;
|
|
9415
9402
|
return [JSON.stringify(value), {
|
|
9416
9403
|
value_: value,
|
|
9417
9404
|
count_: 0,
|
|
9418
|
-
name_: (_local_meta$names = local_meta.names) === null || _local_meta$names === void 0 ? void 0 : _local_meta$names[index]
|
|
9405
|
+
name_: (_local_meta$names = local_meta.names) === null || _local_meta$names === void 0 ? void 0 : _local_meta$names[index],
|
|
9406
|
+
swatches_: (_swatches2 = local_meta.swatches) === null || _swatches2 === void 0 ? void 0 : _swatches2[index]
|
|
9419
9407
|
}];
|
|
9420
9408
|
}));
|
|
9421
9409
|
const new_data = [...Object.keys(data_objs_in_local).filter(key => {
|
|
@@ -9460,6 +9448,14 @@ function $a162c9a08dc208c2$export$b288c38ae3fddb56(_ref) {
|
|
|
9460
9448
|
count_: count_
|
|
9461
9449
|
} = _ref4;
|
|
9462
9450
|
return count_;
|
|
9451
|
+
}),
|
|
9452
|
+
...("swatches" in remote_filter && {
|
|
9453
|
+
swatches: new_data.map(_ref5 => {
|
|
9454
|
+
let {
|
|
9455
|
+
swatches_: swatches_
|
|
9456
|
+
} = _ref5;
|
|
9457
|
+
return swatches_;
|
|
9458
|
+
})
|
|
9463
9459
|
})
|
|
9464
9460
|
}
|
|
9465
9461
|
};
|
|
@@ -9509,6 +9505,10 @@ function $a162c9a08dc208c2$var$modify_only_local_filter(local_filter_object, sel
|
|
|
9509
9505
|
}
|
|
9510
9506
|
new_meta.values = values.filter((_, index) => !indexes_to_remove.has(index));
|
|
9511
9507
|
if (new_meta.names) new_meta.names = new_meta.names.filter((_, index) => !indexes_to_remove.has(index));
|
|
9508
|
+
if ("swatches" in new_meta) {
|
|
9509
|
+
var _new_meta$swatches;
|
|
9510
|
+
new_meta.swatches = (_new_meta$swatches = new_meta.swatches) === null || _new_meta$swatches === void 0 ? void 0 : _new_meta$swatches.filter((_, index) => !indexes_to_remove.has(index));
|
|
9511
|
+
}
|
|
9512
9512
|
if (new_meta.counts)
|
|
9513
9513
|
// remove counts that are too much, they're all zero anyway if they exist
|
|
9514
9514
|
new_meta.counts.length -= indexes_to_remove.size;
|
|
@@ -13291,7 +13291,7 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
|
13291
13291
|
let {
|
|
13292
13292
|
search_results_: search_results_,
|
|
13293
13293
|
router_: router_,
|
|
13294
|
-
|
|
13294
|
+
setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
|
|
13295
13295
|
get_search_query_: get_search_query_
|
|
13296
13296
|
} = _ref;
|
|
13297
13297
|
const content_results = $52FdA$solidjs.createMemo(() => {
|
|
@@ -13310,7 +13310,11 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
|
13310
13310
|
});
|
|
13311
13311
|
$52FdA$solidjs.createEffect(() => {
|
|
13312
13312
|
const results = content_results();
|
|
13313
|
-
|
|
13313
|
+
const numberResults = Array.isArray(results) ? results.length : 0;
|
|
13314
|
+
setNumberContentResultsPerQuery_(prev => {
|
|
13315
|
+
prev.set($52FdA$solidjs.untrack(get_search_query_), numberResults);
|
|
13316
|
+
return prev;
|
|
13317
|
+
});
|
|
13314
13318
|
});
|
|
13315
13319
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.For), {
|
|
13316
13320
|
get each() {
|
|
@@ -13328,7 +13332,8 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
|
13328
13332
|
function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
|
|
13329
13333
|
let {
|
|
13330
13334
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
13331
|
-
cols_at_size_: cols_at_size_
|
|
13335
|
+
cols_at_size_: cols_at_size_,
|
|
13336
|
+
overrideAmount_: overrideAmount_
|
|
13332
13337
|
} = _ref;
|
|
13333
13338
|
const colsShowingNow = $478e5a09664da64c$export$a79e666719b3647c(cols_at_size_);
|
|
13334
13339
|
const largest_column = $52FdA$solidjs.createMemo(() => {
|
|
@@ -13341,10 +13346,10 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
|
|
|
13341
13346
|
});
|
|
13342
13347
|
const num_placeholders = $52FdA$solidjs.createMemo(() => {
|
|
13343
13348
|
var _get_history_state_co;
|
|
13344
|
-
|
|
13345
|
-
|
|
13346
|
-
|
|
13347
|
-
);
|
|
13349
|
+
const override = overrideAmount_();
|
|
13350
|
+
if (override !== undefined) return override;
|
|
13351
|
+
// Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
|
|
13352
|
+
return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
|
|
13348
13353
|
});
|
|
13349
13354
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Index), {
|
|
13350
13355
|
get each() {
|
|
@@ -13382,15 +13387,13 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
|
|
|
13382
13387
|
number_: num_results,
|
|
13383
13388
|
i18n_: i18n_
|
|
13384
13389
|
});
|
|
13385
|
-
const
|
|
13386
|
-
|
|
13387
|
-
const placeholders_enabled = $52FdA$solidjs.createMemo(() => {
|
|
13388
|
-
// don't show placeholders when the user toggles filters
|
|
13389
|
-
check_query();
|
|
13390
|
-
return !queries_without_content_results_.has(get_search_query_());
|
|
13390
|
+
const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $52FdA$solidjs.createSignal(new Map(), {
|
|
13391
|
+
equals: false
|
|
13391
13392
|
});
|
|
13393
|
+
const contentResultsForCurrentQuery = $52FdA$solidjs.createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
|
|
13394
|
+
// Don't show placeholder if we know there will not be any content results and someone is just toggling filters
|
|
13395
|
+
const placeholders_enabled = $52FdA$solidjs.createMemo(() => contentResultsForCurrentQuery() !== 0);
|
|
13392
13396
|
const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
13393
|
-
for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
|
|
13394
13397
|
return (() => {
|
|
13395
13398
|
var _el$ = $52FdA$solidjsweb.getNextElement($eab939d0b95b75ee$var$_tmpl$),
|
|
13396
13399
|
_el$2 = _el$.firstChild,
|
|
@@ -13420,14 +13423,15 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
|
|
|
13420
13423
|
content_results_rows_: content_results_rows_,
|
|
13421
13424
|
get cols_at_size_() {
|
|
13422
13425
|
return $52FdA$solidjs.createMemo(() => layout_options_().cols_at_size);
|
|
13423
|
-
}
|
|
13426
|
+
},
|
|
13427
|
+
overrideAmount_: contentResultsForCurrentQuery
|
|
13424
13428
|
});
|
|
13425
13429
|
},
|
|
13426
13430
|
get children() {
|
|
13427
13431
|
return $52FdA$solidjsweb.createComponent((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
|
|
13428
13432
|
router_: router_,
|
|
13429
13433
|
search_results_: search_results_,
|
|
13430
|
-
|
|
13434
|
+
setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
|
|
13431
13435
|
get_search_query_: get_search_query_
|
|
13432
13436
|
});
|
|
13433
13437
|
}
|
package/ES10/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.3.
|
|
13
|
+
export const version = "4.3.13";
|
|
14
14
|
declare const LISTING_ID = "listingId";
|
|
15
15
|
declare const EXTERNAL_ID = "externalId";
|
|
16
16
|
type ScrollRestorationData = {
|
|
@@ -877,6 +877,7 @@ export function LooksSliderOrGrid(props: {
|
|
|
877
877
|
FavoriteButton_?: (props: {
|
|
878
878
|
display_: Accessor<ModernDisplay | null | undefined>;
|
|
879
879
|
}) => JSX.Element;
|
|
880
|
+
NoResultsFallback_?: () => JSX.Element;
|
|
880
881
|
displayTransformers_?: DisplayTransformers<ModernDisplay, ModernDisplayWithPageUrl<ModernDisplay>>;
|
|
881
882
|
/**
|
|
882
883
|
* If provided, will render as grid instead of slider
|
package/ES10/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { add_to_version_info as $8tj43$add_to_version_info, fetch_retry as $8tj43$fetch_retry, base_url as $8tj43$base_url, dwarn as $8tj43$dwarn, slider_fractional_factory as $8tj43$slider_fractional_factory, dlog as $8tj43$dlog, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, catchify as $8tj43$catchify, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, report as $8tj43$report, slider_fading_factory as $8tj43$slider_fading_factory, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, observer as $8tj43$observer, javascript_media_query as $8tj43$javascript_media_query, queueMacroTask as $8tj43$queueMacroTask, findMostFrequentItem as $8tj43$findMostFrequentItem, standard_price_format as $8tj43$standard_price_format, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, deparallelize_no_drop as $8tj43$deparallelize_no_drop, ContainedImage as $8tj43$ContainedImage, buildThresholdList as $8tj43$buildThresholdList, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, use_href_accessor as $8tj43$use_href_accessor, get_session_id as $8tj43$get_session_id, add_version_query_params as $8tj43$add_version_query_params, useExpandingContainer as $8tj43$useExpandingContainer, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, snakeCasifyObject as $8tj43$snakeCasifyObject, make_url_with_query_params as $8tj43$make_url_with_query_params, sort_obj as $8tj43$sort_obj,
|
|
1
|
+
import { add_to_version_info as $8tj43$add_to_version_info, fetch_retry as $8tj43$fetch_retry, base_url as $8tj43$base_url, dwarn as $8tj43$dwarn, slider_fractional_factory as $8tj43$slider_fractional_factory, dlog as $8tj43$dlog, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, catchify as $8tj43$catchify, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, report as $8tj43$report, slider_fading_factory as $8tj43$slider_fading_factory, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, observer as $8tj43$observer, javascript_media_query as $8tj43$javascript_media_query, queueMacroTask as $8tj43$queueMacroTask, findMostFrequentItem as $8tj43$findMostFrequentItem, standard_price_format as $8tj43$standard_price_format, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, deparallelize_no_drop as $8tj43$deparallelize_no_drop, ContainedImage as $8tj43$ContainedImage, buildThresholdList as $8tj43$buildThresholdList, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, use_href_accessor as $8tj43$use_href_accessor, get_session_id as $8tj43$get_session_id, add_version_query_params as $8tj43$add_version_query_params, useExpandingContainer as $8tj43$useExpandingContainer, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, snakeCasifyObject as $8tj43$snakeCasifyObject, make_url_with_query_params as $8tj43$make_url_with_query_params, sort_obj as $8tj43$sort_obj, insert_surfaces as $8tj43$insert_surfaces, is_debug as $8tj43$is_debug } from "@depict-ai/utilishared/ES10";
|
|
2
2
|
import { template as $8tj43$template, getNextElement as $8tj43$getNextElement, insert as $8tj43$insert, createComponent as $8tj43$createComponent, mergeProps as $8tj43$mergeProps, effect as $8tj43$effect, className as $8tj43$className, isServer as $8tj43$isServer, spread as $8tj43$spread, runHydrationEvents as $8tj43$runHydrationEvents, addEventListener as $8tj43$addEventListener, memo as $8tj43$memo, delegateEvents as $8tj43$delegateEvents, getNextMarker as $8tj43$getNextMarker, classList as $8tj43$classList, setAttribute as $8tj43$setAttribute, style as $8tj43$style, use as $8tj43$use, setProperty as $8tj43$setProperty, Dynamic as $8tj43$Dynamic } from "solid-js/web";
|
|
3
3
|
import { createSignal as $8tj43$createSignal, createMemo as $8tj43$createMemo, createResource as $8tj43$createResource, createEffect as $8tj43$createEffect, Show as $8tj43$Show, mergeProps as $8tj43$mergeProps1, Suspense as $8tj43$Suspense, untrack as $8tj43$untrack, createRenderEffect as $8tj43$createRenderEffect, Index as $8tj43$Index, createRoot as $8tj43$createRoot, onCleanup as $8tj43$onCleanup, For as $8tj43$For, getOwner as $8tj43$getOwner, runWithOwner as $8tj43$runWithOwner, createContext as $8tj43$createContext, useContext as $8tj43$useContext, createUniqueId as $8tj43$createUniqueId, createComputed as $8tj43$createComputed, ErrorBoundary as $8tj43$ErrorBoundary, splitProps as $8tj43$splitProps, on as $8tj43$on, batch as $8tj43$batch, createSelector as $8tj43$createSelector, children as $8tj43$children, createReaction as $8tj43$createReaction, mapArray as $8tj43$mapArray } from "solid-js";
|
|
4
4
|
import $8tj43$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
|
|
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.3.13";
|
|
14
14
|
const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
|
|
15
15
|
const cols_at_size = [];
|
|
16
16
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -686,7 +686,8 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
|
|
|
686
686
|
recommendations_resource_: recommendations_resource_,
|
|
687
687
|
product_card_template_: product_card_template_,
|
|
688
688
|
layout_options_: layout_options_,
|
|
689
|
-
title_: title_
|
|
689
|
+
title_: title_,
|
|
690
|
+
NoResultsFallback_: NoResultsFallback_
|
|
690
691
|
} = _ref;
|
|
691
692
|
const is_showing_something = $8tj43$createMemo(() => {
|
|
692
693
|
var _recommendations_reso;
|
|
@@ -747,6 +748,9 @@ function $39ddb986053fb759$export$d41d19e89346fa2(_ref) {
|
|
|
747
748
|
get when() {
|
|
748
749
|
return is_showing_something();
|
|
749
750
|
},
|
|
751
|
+
get fallback() {
|
|
752
|
+
return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
|
|
753
|
+
},
|
|
750
754
|
children: slider
|
|
751
755
|
});
|
|
752
756
|
}
|
|
@@ -1690,7 +1694,8 @@ function $697d8713dc82b9ab$export$44809a8a3e867e30(_ref) {
|
|
|
1690
1694
|
target: target
|
|
1691
1695
|
} = _ref2;
|
|
1692
1696
|
// Don't toggle when clicking on the links
|
|
1693
|
-
|
|
1697
|
+
const selector = "a[href]";
|
|
1698
|
+
if (target.matches(selector) || target.closest(selector)) return;
|
|
1694
1699
|
setUserWantsExpanded(prev => !prev);
|
|
1695
1700
|
}), true);
|
|
1696
1701
|
_el$.classList.toggle("placeholder", !!!display_);
|
|
@@ -1882,7 +1887,8 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
|
|
|
1882
1887
|
layout_options_: layout_options_,
|
|
1883
1888
|
title_: title_,
|
|
1884
1889
|
max_rows_: max_rows_,
|
|
1885
|
-
view_more_button_: view_more_button_
|
|
1890
|
+
view_more_button_: view_more_button_,
|
|
1891
|
+
NoResultsFallback_: NoResultsFallback_
|
|
1886
1892
|
} = _ref;
|
|
1887
1893
|
const rows_object_ = $8tj43$createMemo(() => {
|
|
1888
1894
|
var _view_more_button$row;
|
|
@@ -1963,6 +1969,9 @@ function $e3efeb558d952696$export$7da560f849543dff(_ref) {
|
|
|
1963
1969
|
get when() {
|
|
1964
1970
|
return is_showing_something();
|
|
1965
1971
|
},
|
|
1972
|
+
get fallback() {
|
|
1973
|
+
return NoResultsFallback_ === null || NoResultsFallback_ === void 0 ? void 0 : NoResultsFallback_();
|
|
1974
|
+
},
|
|
1966
1975
|
children: elements
|
|
1967
1976
|
});
|
|
1968
1977
|
}
|
|
@@ -2032,7 +2041,8 @@ function $bb34cd283e904784$export$2c9f9bf2092486aa(props) {
|
|
|
2032
2041
|
layout_options_: $8tj43$createMemo(() => ({
|
|
2033
2042
|
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
2034
2043
|
...grid_spacing_override()
|
|
2035
|
-
}))
|
|
2044
|
+
})),
|
|
2045
|
+
NoResultsFallback_: () => props.NoResultsFallback_
|
|
2036
2046
|
};
|
|
2037
2047
|
$8tj43$createEffect(() => {
|
|
2038
2048
|
const {
|
|
@@ -7403,44 +7413,20 @@ function $457279ff15864cb9$export$e5c2828934226505(_ref) {
|
|
|
7403
7413
|
expanded_: expanded_,
|
|
7404
7414
|
i18n_: i18n_
|
|
7405
7415
|
} = _ref;
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
var _ref$2 = second_span;
|
|
7419
|
-
typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$3) : second_span = _el$3;
|
|
7420
|
-
$8tj43$effect(() => $8tj43$setAttribute(_el$, "aria-label", expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_()));
|
|
7416
|
+
return (() => {
|
|
7417
|
+
var _el$ = $8tj43$getNextElement($457279ff15864cb9$var$_tmpl$);
|
|
7418
|
+
$8tj43$effect(_p$ => {
|
|
7419
|
+
var _v$ = !!expanded_(),
|
|
7420
|
+
_v$2 = expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_();
|
|
7421
|
+
_v$ !== _p$.e && _el$.classList.toggle("expanded", _p$.e = _v$);
|
|
7422
|
+
_v$2 !== _p$.t && $8tj43$setAttribute(_el$, "aria-label", _p$.t = _v$2);
|
|
7423
|
+
return _p$;
|
|
7424
|
+
}, {
|
|
7425
|
+
e: undefined,
|
|
7426
|
+
t: undefined
|
|
7427
|
+
});
|
|
7421
7428
|
return _el$;
|
|
7422
7429
|
})();
|
|
7423
|
-
const [is_in_dom, set_is_in_dom] = $8tj43$createSignal(false);
|
|
7424
|
-
(0, $8tj43$observer).wait_for_element(outer_div).then($8tj43$catchify(() => set_is_in_dom(true)));
|
|
7425
|
-
$8tj43$createEffect(() => {
|
|
7426
|
-
if (!is_in_dom())
|
|
7427
|
-
// wait for us to being in DOM as animations don't work otherwise
|
|
7428
|
-
return;
|
|
7429
|
-
try {
|
|
7430
|
-
const expanded = expanded_();
|
|
7431
|
-
for (const span of [first_span, second_span]) span.animate([{
|
|
7432
|
-
transform: "rotate(".concat(expanded ? 90 : "0", "deg)")
|
|
7433
|
-
}], animation_options);
|
|
7434
|
-
const percentage_value = "".concat(expanded ? 50 : 25, "%");
|
|
7435
|
-
second_span.animate([{
|
|
7436
|
-
left: percentage_value,
|
|
7437
|
-
right: percentage_value
|
|
7438
|
-
}], animation_options);
|
|
7439
|
-
} catch (e) {
|
|
7440
|
-
$8tj43$dlog("partial keyframes probably not supported", e);
|
|
7441
|
-
}
|
|
7442
|
-
});
|
|
7443
|
-
return outer_div;
|
|
7444
7430
|
}
|
|
7445
7431
|
var $f3a159279dc1a8fb$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<span class=highlighted-part>`);
|
|
7446
7432
|
const $f3a159279dc1a8fb$var$dont_cut_in_between_less_than_characters = 30;
|
|
@@ -9313,19 +9299,21 @@ function $44aa24b1bb793549$export$b288c38ae3fddb56(_ref) {
|
|
|
9313
9299
|
// can't or shouldn't be merged due to not being selected, just take remote one
|
|
9314
9300
|
new_local_filter_state.push(remote_filter);else {
|
|
9315
9301
|
const data_objs_in_remote = Object.fromEntries(remote_meta.values.map((value, index) => {
|
|
9316
|
-
var _remote_meta$counts, _remote_meta$names;
|
|
9302
|
+
var _remote_meta$counts, _remote_meta$names, _swatches;
|
|
9317
9303
|
return [JSON.stringify(value), {
|
|
9318
9304
|
value_: value,
|
|
9319
9305
|
count_: (_remote_meta$counts = remote_meta.counts) === null || _remote_meta$counts === void 0 ? void 0 : _remote_meta$counts[index],
|
|
9320
|
-
name_: (_remote_meta$names = remote_meta.names) === null || _remote_meta$names === void 0 ? void 0 : _remote_meta$names[index]
|
|
9306
|
+
name_: (_remote_meta$names = remote_meta.names) === null || _remote_meta$names === void 0 ? void 0 : _remote_meta$names[index],
|
|
9307
|
+
swatches_: (_swatches = remote_meta.swatches) === null || _swatches === void 0 ? void 0 : _swatches[index]
|
|
9321
9308
|
}];
|
|
9322
9309
|
}));
|
|
9323
9310
|
const data_objs_in_local = Object.fromEntries(local_meta.values.map((value, index) => {
|
|
9324
|
-
var _local_meta$names;
|
|
9311
|
+
var _local_meta$names, _swatches2;
|
|
9325
9312
|
return [JSON.stringify(value), {
|
|
9326
9313
|
value_: value,
|
|
9327
9314
|
count_: 0,
|
|
9328
|
-
name_: (_local_meta$names = local_meta.names) === null || _local_meta$names === void 0 ? void 0 : _local_meta$names[index]
|
|
9315
|
+
name_: (_local_meta$names = local_meta.names) === null || _local_meta$names === void 0 ? void 0 : _local_meta$names[index],
|
|
9316
|
+
swatches_: (_swatches2 = local_meta.swatches) === null || _swatches2 === void 0 ? void 0 : _swatches2[index]
|
|
9329
9317
|
}];
|
|
9330
9318
|
}));
|
|
9331
9319
|
const new_data = [...Object.keys(data_objs_in_local).filter(key => {
|
|
@@ -9370,6 +9358,14 @@ function $44aa24b1bb793549$export$b288c38ae3fddb56(_ref) {
|
|
|
9370
9358
|
count_: count_
|
|
9371
9359
|
} = _ref4;
|
|
9372
9360
|
return count_;
|
|
9361
|
+
}),
|
|
9362
|
+
...("swatches" in remote_filter && {
|
|
9363
|
+
swatches: new_data.map(_ref5 => {
|
|
9364
|
+
let {
|
|
9365
|
+
swatches_: swatches_
|
|
9366
|
+
} = _ref5;
|
|
9367
|
+
return swatches_;
|
|
9368
|
+
})
|
|
9373
9369
|
})
|
|
9374
9370
|
}
|
|
9375
9371
|
};
|
|
@@ -9419,6 +9415,10 @@ function $44aa24b1bb793549$var$modify_only_local_filter(local_filter_object, sel
|
|
|
9419
9415
|
}
|
|
9420
9416
|
new_meta.values = values.filter((_, index) => !indexes_to_remove.has(index));
|
|
9421
9417
|
if (new_meta.names) new_meta.names = new_meta.names.filter((_, index) => !indexes_to_remove.has(index));
|
|
9418
|
+
if ("swatches" in new_meta) {
|
|
9419
|
+
var _new_meta$swatches;
|
|
9420
|
+
new_meta.swatches = (_new_meta$swatches = new_meta.swatches) === null || _new_meta$swatches === void 0 ? void 0 : _new_meta$swatches.filter((_, index) => !indexes_to_remove.has(index));
|
|
9421
|
+
}
|
|
9422
9422
|
if (new_meta.counts)
|
|
9423
9423
|
// remove counts that are too much, they're all zero anyway if they exist
|
|
9424
9424
|
new_meta.counts.length -= indexes_to_remove.size;
|
|
@@ -13201,7 +13201,7 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
|
|
|
13201
13201
|
let {
|
|
13202
13202
|
search_results_: search_results_,
|
|
13203
13203
|
router_: router_,
|
|
13204
|
-
|
|
13204
|
+
setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
|
|
13205
13205
|
get_search_query_: get_search_query_
|
|
13206
13206
|
} = _ref;
|
|
13207
13207
|
const content_results = $8tj43$createMemo(() => {
|
|
@@ -13220,7 +13220,11 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
|
|
|
13220
13220
|
});
|
|
13221
13221
|
$8tj43$createEffect(() => {
|
|
13222
13222
|
const results = content_results();
|
|
13223
|
-
|
|
13223
|
+
const numberResults = Array.isArray(results) ? results.length : 0;
|
|
13224
|
+
setNumberContentResultsPerQuery_(prev => {
|
|
13225
|
+
prev.set($8tj43$untrack(get_search_query_), numberResults);
|
|
13226
|
+
return prev;
|
|
13227
|
+
});
|
|
13224
13228
|
});
|
|
13225
13229
|
return $8tj43$createComponent((0, $8tj43$For), {
|
|
13226
13230
|
get each() {
|
|
@@ -13238,7 +13242,8 @@ function $881e8953a9103f10$export$9ff751cd77687edc(_ref) {
|
|
|
13238
13242
|
function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
|
|
13239
13243
|
let {
|
|
13240
13244
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
13241
|
-
cols_at_size_: cols_at_size_
|
|
13245
|
+
cols_at_size_: cols_at_size_,
|
|
13246
|
+
overrideAmount_: overrideAmount_
|
|
13242
13247
|
} = _ref;
|
|
13243
13248
|
const colsShowingNow = $40e2fa435715a1a0$export$a79e666719b3647c(cols_at_size_);
|
|
13244
13249
|
const largest_column = $8tj43$createMemo(() => {
|
|
@@ -13251,10 +13256,10 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
|
|
|
13251
13256
|
});
|
|
13252
13257
|
const num_placeholders = $8tj43$createMemo(() => {
|
|
13253
13258
|
var _get_history_state_co;
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
);
|
|
13259
|
+
const override = overrideAmount_();
|
|
13260
|
+
if (override !== undefined) return override;
|
|
13261
|
+
// Use how many columns we're actually showing, if available, so that we're showing exactly as many placeholders as we'd show content, so that the view more button doesn't appear/disappear and makes the layout shift
|
|
13262
|
+
return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $d53ebed6f63304e4$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
|
|
13258
13263
|
});
|
|
13259
13264
|
return $8tj43$createComponent((0, $8tj43$Index), {
|
|
13260
13265
|
get each() {
|
|
@@ -13292,15 +13297,13 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
|
|
|
13292
13297
|
number_: num_results,
|
|
13293
13298
|
i18n_: i18n_
|
|
13294
13299
|
});
|
|
13295
|
-
const
|
|
13296
|
-
|
|
13297
|
-
const placeholders_enabled = $8tj43$createMemo(() => {
|
|
13298
|
-
// don't show placeholders when the user toggles filters
|
|
13299
|
-
check_query();
|
|
13300
|
-
return !queries_without_content_results_.has(get_search_query_());
|
|
13300
|
+
const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $8tj43$createSignal(new Map(), {
|
|
13301
|
+
equals: false
|
|
13301
13302
|
});
|
|
13303
|
+
const contentResultsForCurrentQuery = $8tj43$createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
|
|
13304
|
+
// Don't show placeholder if we know there will not be any content results and someone is just toggling filters
|
|
13305
|
+
const placeholders_enabled = $8tj43$createMemo(() => contentResultsForCurrentQuery() !== 0);
|
|
13302
13306
|
const rows_object = $d53ebed6f63304e4$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
13303
|
-
for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
|
|
13304
13307
|
return (() => {
|
|
13305
13308
|
var _el$ = $8tj43$getNextElement($d53ebed6f63304e4$var$_tmpl$),
|
|
13306
13309
|
_el$2 = _el$.firstChild,
|
|
@@ -13330,14 +13333,15 @@ function $d53ebed6f63304e4$export$6d0c9c22f6652669(_ref) {
|
|
|
13330
13333
|
content_results_rows_: content_results_rows_,
|
|
13331
13334
|
get cols_at_size_() {
|
|
13332
13335
|
return $8tj43$createMemo(() => layout_options_().cols_at_size);
|
|
13333
|
-
}
|
|
13336
|
+
},
|
|
13337
|
+
overrideAmount_: contentResultsForCurrentQuery
|
|
13334
13338
|
});
|
|
13335
13339
|
},
|
|
13336
13340
|
get children() {
|
|
13337
13341
|
return $8tj43$createComponent((0, $881e8953a9103f10$export$9ff751cd77687edc), {
|
|
13338
13342
|
router_: router_,
|
|
13339
13343
|
search_results_: search_results_,
|
|
13340
|
-
|
|
13344
|
+
setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
|
|
13341
13345
|
get_search_query_: get_search_query_
|
|
13342
13346
|
});
|
|
13343
13347
|
}
|