@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/latest/index.cjs
CHANGED
|
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
|
|
|
94
94
|
$parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
|
|
95
95
|
$parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
|
|
96
96
|
/*! Depict.ai search and product listing SDK */
|
|
97
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.3.
|
|
97
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.3.13";
|
|
98
98
|
const $4e04be41243c3d80$var$transform_elements = sorted_cols_at_size => {
|
|
99
99
|
const cols_at_size = [];
|
|
100
100
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -731,7 +731,8 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
|
731
731
|
recommendations_resource_: recommendations_resource_,
|
|
732
732
|
product_card_template_: product_card_template_,
|
|
733
733
|
layout_options_: layout_options_,
|
|
734
|
-
title_: title_
|
|
734
|
+
title_: title_,
|
|
735
|
+
NoResultsFallback_: NoResultsFallback_
|
|
735
736
|
}) {
|
|
736
737
|
const is_showing_something = $gVhhF$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
|
|
737
738
|
const title = $gVhhF$solidjs.createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
|
|
@@ -789,6 +790,9 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
|
789
790
|
get when() {
|
|
790
791
|
return is_showing_something();
|
|
791
792
|
},
|
|
793
|
+
get fallback() {
|
|
794
|
+
return NoResultsFallback_?.();
|
|
795
|
+
},
|
|
792
796
|
children: slider
|
|
793
797
|
});
|
|
794
798
|
}
|
|
@@ -1692,7 +1696,8 @@ function $ad882bbe664dbd53$export$44809a8a3e867e30({
|
|
|
1692
1696
|
target: target
|
|
1693
1697
|
}) => {
|
|
1694
1698
|
// Don't toggle when clicking on the links
|
|
1695
|
-
|
|
1699
|
+
const selector = "a[href]";
|
|
1700
|
+
if (target.matches(selector) || target.closest(selector)) return;
|
|
1696
1701
|
setUserWantsExpanded(prev => !prev);
|
|
1697
1702
|
}), true);
|
|
1698
1703
|
_el$.classList.toggle("placeholder", !!!display_);
|
|
@@ -1870,7 +1875,8 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
|
1870
1875
|
layout_options_: layout_options_,
|
|
1871
1876
|
title_: title_,
|
|
1872
1877
|
max_rows_: max_rows_,
|
|
1873
|
-
view_more_button_: view_more_button_
|
|
1878
|
+
view_more_button_: view_more_button_,
|
|
1879
|
+
NoResultsFallback_: NoResultsFallback_
|
|
1874
1880
|
}) {
|
|
1875
1881
|
const rows_object_ = $gVhhF$solidjs.createMemo(() => {
|
|
1876
1882
|
const view_more_button = view_more_button_?.();
|
|
@@ -1947,6 +1953,9 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
|
1947
1953
|
get when() {
|
|
1948
1954
|
return is_showing_something();
|
|
1949
1955
|
},
|
|
1956
|
+
get fallback() {
|
|
1957
|
+
return NoResultsFallback_?.();
|
|
1958
|
+
},
|
|
1950
1959
|
children: elements
|
|
1951
1960
|
});
|
|
1952
1961
|
}
|
|
@@ -2014,7 +2023,8 @@ function $a3bbfa5fdaa39f3a$export$2c9f9bf2092486aa(props) {
|
|
|
2014
2023
|
layout_options_: $gVhhF$solidjs.createMemo(() => ({
|
|
2015
2024
|
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
2016
2025
|
...grid_spacing_override()
|
|
2017
|
-
}))
|
|
2026
|
+
})),
|
|
2027
|
+
NoResultsFallback_: () => props.NoResultsFallback_
|
|
2018
2028
|
};
|
|
2019
2029
|
$gVhhF$solidjs.createEffect(() => {
|
|
2020
2030
|
const {
|
|
@@ -7153,44 +7163,20 @@ function $7567511a7c3e4bd7$export$e5c2828934226505({
|
|
|
7153
7163
|
expanded_: expanded_,
|
|
7154
7164
|
i18n_: i18n_
|
|
7155
7165
|
}) {
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
var _ref$2 = second_span;
|
|
7169
|
-
typeof _ref$2 === "function" ? $gVhhF$solidjsweb.use(_ref$2, _el$3) : second_span = _el$3;
|
|
7170
|
-
$gVhhF$solidjsweb.effect(() => $gVhhF$solidjsweb.setAttribute(_el$, "aria-label", expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_()));
|
|
7166
|
+
return (() => {
|
|
7167
|
+
var _el$ = $gVhhF$solidjsweb.getNextElement($7567511a7c3e4bd7$var$_tmpl$);
|
|
7168
|
+
$gVhhF$solidjsweb.effect(_p$ => {
|
|
7169
|
+
var _v$ = !!expanded_(),
|
|
7170
|
+
_v$2 = expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_();
|
|
7171
|
+
_v$ !== _p$.e && _el$.classList.toggle("expanded", _p$.e = _v$);
|
|
7172
|
+
_v$2 !== _p$.t && $gVhhF$solidjsweb.setAttribute(_el$, "aria-label", _p$.t = _v$2);
|
|
7173
|
+
return _p$;
|
|
7174
|
+
}, {
|
|
7175
|
+
e: undefined,
|
|
7176
|
+
t: undefined
|
|
7177
|
+
});
|
|
7171
7178
|
return _el$;
|
|
7172
7179
|
})();
|
|
7173
|
-
const [is_in_dom, set_is_in_dom] = $gVhhF$solidjs.createSignal(false);
|
|
7174
|
-
(0, $gVhhF$depictaiutilishared.observer).wait_for_element(outer_div).then($gVhhF$depictaiutilishared.catchify(() => set_is_in_dom(true)));
|
|
7175
|
-
$gVhhF$solidjs.createEffect(() => {
|
|
7176
|
-
if (!is_in_dom())
|
|
7177
|
-
// wait for us to being in DOM as animations don't work otherwise
|
|
7178
|
-
return;
|
|
7179
|
-
try {
|
|
7180
|
-
const expanded = expanded_();
|
|
7181
|
-
for (const span of [first_span, second_span]) span.animate([{
|
|
7182
|
-
transform: `rotate(${expanded ? 90 : "0"}deg)`
|
|
7183
|
-
}], animation_options);
|
|
7184
|
-
const percentage_value = `${expanded ? 50 : 25}%`;
|
|
7185
|
-
second_span.animate([{
|
|
7186
|
-
left: percentage_value,
|
|
7187
|
-
right: percentage_value
|
|
7188
|
-
}], animation_options);
|
|
7189
|
-
} catch (e) {
|
|
7190
|
-
$gVhhF$depictaiutilishared.dlog("partial keyframes probably not supported", e);
|
|
7191
|
-
}
|
|
7192
|
-
});
|
|
7193
|
-
return outer_div;
|
|
7194
7180
|
}
|
|
7195
7181
|
var $5ea5a82e398f6f44$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<span class=highlighted-part>`);
|
|
7196
7182
|
const $5ea5a82e398f6f44$var$dont_cut_in_between_less_than_characters = 30;
|
|
@@ -8936,12 +8922,14 @@ function $70482f04605572e2$export$b288c38ae3fddb56({
|
|
|
8936
8922
|
const data_objs_in_remote = Object.fromEntries(remote_meta.values.map((value, index) => [JSON.stringify(value), {
|
|
8937
8923
|
value_: value,
|
|
8938
8924
|
count_: remote_meta.counts?.[index],
|
|
8939
|
-
name_: remote_meta.names?.[index]
|
|
8925
|
+
name_: remote_meta.names?.[index],
|
|
8926
|
+
swatches_: remote_meta.swatches?.[index]
|
|
8940
8927
|
}]));
|
|
8941
8928
|
const data_objs_in_local = Object.fromEntries(local_meta.values.map((value, index) => [JSON.stringify(value), {
|
|
8942
8929
|
value_: value,
|
|
8943
8930
|
count_: 0,
|
|
8944
|
-
name_: local_meta.names?.[index]
|
|
8931
|
+
name_: local_meta.names?.[index],
|
|
8932
|
+
swatches_: local_meta.swatches?.[index]
|
|
8945
8933
|
}]));
|
|
8946
8934
|
const new_data = [...Object.keys(data_objs_in_local).filter(key => {
|
|
8947
8935
|
// put data entries that are selected and don't exist in new remote state first
|
|
@@ -8976,7 +8964,12 @@ function $70482f04605572e2$export$b288c38ae3fddb56({
|
|
|
8976
8964
|
}) => name_),
|
|
8977
8965
|
counts: new_data.map(({
|
|
8978
8966
|
count_: count_
|
|
8979
|
-
}) => count_)
|
|
8967
|
+
}) => count_),
|
|
8968
|
+
...("swatches" in remote_filter && {
|
|
8969
|
+
swatches: new_data.map(({
|
|
8970
|
+
swatches_: swatches_
|
|
8971
|
+
}) => swatches_)
|
|
8972
|
+
})
|
|
8980
8973
|
}
|
|
8981
8974
|
};
|
|
8982
8975
|
new_local_filter_state.push(result);
|
|
@@ -9025,6 +9018,7 @@ function $70482f04605572e2$var$modify_only_local_filter(local_filter_object, sel
|
|
|
9025
9018
|
}
|
|
9026
9019
|
new_meta.values = values.filter((_, index) => !indexes_to_remove.has(index));
|
|
9027
9020
|
if (new_meta.names) new_meta.names = new_meta.names.filter((_, index) => !indexes_to_remove.has(index));
|
|
9021
|
+
if ("swatches" in new_meta) new_meta.swatches = new_meta.swatches?.filter((_, index) => !indexes_to_remove.has(index));
|
|
9028
9022
|
if (new_meta.counts)
|
|
9029
9023
|
// remove counts that are too much, they're all zero anyway if they exist
|
|
9030
9024
|
new_meta.counts.length -= indexes_to_remove.size;
|
|
@@ -12531,7 +12525,7 @@ function $76227de40be817e5$export$f631859cab12b342({
|
|
|
12531
12525
|
function $8781fcec27b20709$export$9ff751cd77687edc({
|
|
12532
12526
|
search_results_: search_results_,
|
|
12533
12527
|
router_: router_,
|
|
12534
|
-
|
|
12528
|
+
setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
|
|
12535
12529
|
get_search_query_: get_search_query_
|
|
12536
12530
|
}) {
|
|
12537
12531
|
const content_results = $gVhhF$solidjs.createMemo(() => search_results_()?.content_search_links);
|
|
@@ -12547,7 +12541,11 @@ function $8781fcec27b20709$export$9ff751cd77687edc({
|
|
|
12547
12541
|
});
|
|
12548
12542
|
$gVhhF$solidjs.createEffect(() => {
|
|
12549
12543
|
const results = content_results();
|
|
12550
|
-
|
|
12544
|
+
const numberResults = Array.isArray(results) ? results.length : 0;
|
|
12545
|
+
setNumberContentResultsPerQuery_(prev => {
|
|
12546
|
+
prev.set($gVhhF$solidjs.untrack(get_search_query_), numberResults);
|
|
12547
|
+
return prev;
|
|
12548
|
+
});
|
|
12551
12549
|
});
|
|
12552
12550
|
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.For), {
|
|
12553
12551
|
get each() {
|
|
@@ -12564,7 +12562,8 @@ function $8781fcec27b20709$export$9ff751cd77687edc({
|
|
|
12564
12562
|
}
|
|
12565
12563
|
function $c2f92eb265a14529$export$4405d077f0a20494({
|
|
12566
12564
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
12567
|
-
cols_at_size_: cols_at_size_
|
|
12565
|
+
cols_at_size_: cols_at_size_,
|
|
12566
|
+
overrideAmount_: overrideAmount_
|
|
12568
12567
|
}) {
|
|
12569
12568
|
const colsShowingNow = $17d06b3bcb035500$export$a79e666719b3647c(cols_at_size_);
|
|
12570
12569
|
const largest_column = $gVhhF$solidjs.createMemo(() => {
|
|
@@ -12572,9 +12571,12 @@ function $c2f92eb265a14529$export$4405d077f0a20494({
|
|
|
12572
12571
|
if (isNaN(largest_in_cols_at_size) || Math.abs(largest_in_cols_at_size) === Infinity) return 4; // fallback to something big so we always have the right amount of placeholders
|
|
12573
12572
|
return largest_in_cols_at_size;
|
|
12574
12573
|
});
|
|
12575
|
-
const num_placeholders = $gVhhF$solidjs.createMemo(() =>
|
|
12576
|
-
|
|
12577
|
-
|
|
12574
|
+
const num_placeholders = $gVhhF$solidjs.createMemo(() => {
|
|
12575
|
+
const override = overrideAmount_();
|
|
12576
|
+
if (override !== undefined) return override;
|
|
12577
|
+
// 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
|
|
12578
|
+
return (get_history_state_content_results_rows() ?? (0, $3716b8caf7f959e2$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
|
|
12579
|
+
});
|
|
12578
12580
|
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Index), {
|
|
12579
12581
|
get each() {
|
|
12580
12582
|
return Array.from({
|
|
@@ -12604,15 +12606,13 @@ function $3716b8caf7f959e2$export$6d0c9c22f6652669({
|
|
|
12604
12606
|
number_: num_results,
|
|
12605
12607
|
i18n_: i18n_
|
|
12606
12608
|
});
|
|
12607
|
-
const
|
|
12608
|
-
|
|
12609
|
-
const placeholders_enabled = $gVhhF$solidjs.createMemo(() => {
|
|
12610
|
-
// don't show placeholders when the user toggles filters
|
|
12611
|
-
check_query();
|
|
12612
|
-
return !queries_without_content_results_.has(get_search_query_());
|
|
12609
|
+
const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $gVhhF$solidjs.createSignal(new Map(), {
|
|
12610
|
+
equals: false
|
|
12613
12611
|
});
|
|
12612
|
+
const contentResultsForCurrentQuery = $gVhhF$solidjs.createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
|
|
12613
|
+
// Don't show placeholder if we know there will not be any content results and someone is just toggling filters
|
|
12614
|
+
const placeholders_enabled = $gVhhF$solidjs.createMemo(() => contentResultsForCurrentQuery() !== 0);
|
|
12614
12615
|
const rows_object = $3716b8caf7f959e2$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
12615
|
-
for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
|
|
12616
12616
|
return (() => {
|
|
12617
12617
|
var _el$ = $gVhhF$solidjsweb.getNextElement($3716b8caf7f959e2$var$_tmpl$),
|
|
12618
12618
|
_el$2 = _el$.firstChild,
|
|
@@ -12642,14 +12642,15 @@ function $3716b8caf7f959e2$export$6d0c9c22f6652669({
|
|
|
12642
12642
|
content_results_rows_: content_results_rows_,
|
|
12643
12643
|
get cols_at_size_() {
|
|
12644
12644
|
return $gVhhF$solidjs.createMemo(() => layout_options_().cols_at_size);
|
|
12645
|
-
}
|
|
12645
|
+
},
|
|
12646
|
+
overrideAmount_: contentResultsForCurrentQuery
|
|
12646
12647
|
});
|
|
12647
12648
|
},
|
|
12648
12649
|
get children() {
|
|
12649
12650
|
return $gVhhF$solidjsweb.createComponent((0, $8781fcec27b20709$export$9ff751cd77687edc), {
|
|
12650
12651
|
router_: router_,
|
|
12651
12652
|
search_results_: search_results_,
|
|
12652
|
-
|
|
12653
|
+
setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
|
|
12653
12654
|
get_search_query_: get_search_query_
|
|
12654
12655
|
});
|
|
12655
12656
|
}
|
package/latest/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/latest/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { add_to_version_info as $9HbP8$add_to_version_info, fetch_retry as $9HbP8$fetch_retry, base_url as $9HbP8$base_url, dwarn as $9HbP8$dwarn, slider_fractional_factory as $9HbP8$slider_fractional_factory, dlog as $9HbP8$dlog, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, catchify as $9HbP8$catchify, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, report as $9HbP8$report, slider_fading_factory as $9HbP8$slider_fading_factory, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, observer as $9HbP8$observer, javascript_media_query as $9HbP8$javascript_media_query, queueMacroTask as $9HbP8$queueMacroTask, findMostFrequentItem as $9HbP8$findMostFrequentItem, standard_price_format as $9HbP8$standard_price_format, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, ContainedImage as $9HbP8$ContainedImage, buildThresholdList as $9HbP8$buildThresholdList, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, use_href_accessor as $9HbP8$use_href_accessor, get_session_id as $9HbP8$get_session_id, add_version_query_params as $9HbP8$add_version_query_params, useExpandingContainer as $9HbP8$useExpandingContainer, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, snakeCasifyObject as $9HbP8$snakeCasifyObject, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params,
|
|
1
|
+
import { add_to_version_info as $9HbP8$add_to_version_info, fetch_retry as $9HbP8$fetch_retry, base_url as $9HbP8$base_url, dwarn as $9HbP8$dwarn, slider_fractional_factory as $9HbP8$slider_fractional_factory, dlog as $9HbP8$dlog, camelCasifyObject as $9HbP8$camelCasifyObject, make_random_classname as $9HbP8$make_random_classname, n_col_styling_with_dist as $9HbP8$n_col_styling_with_dist, catchify as $9HbP8$catchify, layout_get_visible_recs_without_partial_rows as $9HbP8$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $9HbP8$layout_get_total_rec_amount_for_row, layout_media_query_header as $9HbP8$layout_media_query_header, report as $9HbP8$report, slider_fading_factory as $9HbP8$slider_fading_factory, Amazing_Slider as $9HbP8$Amazing_Slider, slider_snap_css as $9HbP8$slider_snap_css, observer as $9HbP8$observer, javascript_media_query as $9HbP8$javascript_media_query, queueMacroTask as $9HbP8$queueMacroTask, findMostFrequentItem as $9HbP8$findMostFrequentItem, standard_price_format as $9HbP8$standard_price_format, instant_exec_on_suspect_history_change as $9HbP8$instant_exec_on_suspect_history_change, deparallelize_no_drop as $9HbP8$deparallelize_no_drop, ContainedImage as $9HbP8$ContainedImage, buildThresholdList as $9HbP8$buildThresholdList, make_asyncIterable_exiter as $9HbP8$make_asyncIterable_exiter, href_change_ipns as $9HbP8$href_change_ipns, base64_encode_unicode as $9HbP8$base64_encode_unicode, base64_decode_unicode as $9HbP8$base64_decode_unicode, use_href_accessor as $9HbP8$use_href_accessor, get_session_id as $9HbP8$get_session_id, add_version_query_params as $9HbP8$add_version_query_params, useExpandingContainer as $9HbP8$useExpandingContainer, hex_to_rgb as $9HbP8$hex_to_rgb, relative_luminance_from_rgb as $9HbP8$relative_luminance_from_rgb, snakeCasifyObject as $9HbP8$snakeCasifyObject, sort_obj as $9HbP8$sort_obj, make_url_with_query_params as $9HbP8$make_url_with_query_params, insert_surfaces as $9HbP8$insert_surfaces, is_debug as $9HbP8$is_debug } from "@depict-ai/utilishared/latest";
|
|
2
2
|
import { template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, insert as $9HbP8$insert, createComponent as $9HbP8$createComponent, mergeProps as $9HbP8$mergeProps, effect as $9HbP8$effect, className as $9HbP8$className, isServer as $9HbP8$isServer, spread as $9HbP8$spread, runHydrationEvents as $9HbP8$runHydrationEvents, addEventListener as $9HbP8$addEventListener, memo as $9HbP8$memo, delegateEvents as $9HbP8$delegateEvents, getNextMarker as $9HbP8$getNextMarker, classList as $9HbP8$classList, setAttribute as $9HbP8$setAttribute, style as $9HbP8$style, use as $9HbP8$use, setProperty as $9HbP8$setProperty, Dynamic as $9HbP8$Dynamic } from "solid-js/web";
|
|
3
3
|
import { createSignal as $9HbP8$createSignal, createMemo as $9HbP8$createMemo, createResource as $9HbP8$createResource, createEffect as $9HbP8$createEffect, Show as $9HbP8$Show, mergeProps as $9HbP8$mergeProps1, Suspense as $9HbP8$Suspense, untrack as $9HbP8$untrack, createRenderEffect as $9HbP8$createRenderEffect, Index as $9HbP8$Index, createRoot as $9HbP8$createRoot, onCleanup as $9HbP8$onCleanup, For as $9HbP8$For, getOwner as $9HbP8$getOwner, runWithOwner as $9HbP8$runWithOwner, createContext as $9HbP8$createContext, useContext as $9HbP8$useContext, createUniqueId as $9HbP8$createUniqueId, createComputed as $9HbP8$createComputed, ErrorBoundary as $9HbP8$ErrorBoundary, splitProps as $9HbP8$splitProps, on as $9HbP8$on, batch as $9HbP8$batch, createSelector as $9HbP8$createSelector, children as $9HbP8$children, createReaction as $9HbP8$createReaction, mapArray as $9HbP8$mapArray } from "solid-js";
|
|
4
4
|
import { ListenableSet as $9HbP8$ListenableSet, catchify as $9HbP8$catchify1, use_href_accessor as $9HbP8$use_href_accessor1, report as $9HbP8$report1 } from "@depict-ai/utilishared/latest";
|
|
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.3.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.3.13";
|
|
11
11
|
const $b5cccc8ee7d24677$var$transform_elements = sorted_cols_at_size => {
|
|
12
12
|
const cols_at_size = [];
|
|
13
13
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -644,7 +644,8 @@ function $c4492d24952ed731$export$d41d19e89346fa2({
|
|
|
644
644
|
recommendations_resource_: recommendations_resource_,
|
|
645
645
|
product_card_template_: product_card_template_,
|
|
646
646
|
layout_options_: layout_options_,
|
|
647
|
-
title_: title_
|
|
647
|
+
title_: title_,
|
|
648
|
+
NoResultsFallback_: NoResultsFallback_
|
|
648
649
|
}) {
|
|
649
650
|
const is_showing_something = $9HbP8$createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
|
|
650
651
|
const title = $9HbP8$createMemo(() => title_?.()); // In case getter/accessor creates elements, don't create them twice
|
|
@@ -702,6 +703,9 @@ function $c4492d24952ed731$export$d41d19e89346fa2({
|
|
|
702
703
|
get when() {
|
|
703
704
|
return is_showing_something();
|
|
704
705
|
},
|
|
706
|
+
get fallback() {
|
|
707
|
+
return NoResultsFallback_?.();
|
|
708
|
+
},
|
|
705
709
|
children: slider
|
|
706
710
|
});
|
|
707
711
|
}
|
|
@@ -1605,7 +1609,8 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1605
1609
|
target: target
|
|
1606
1610
|
}) => {
|
|
1607
1611
|
// Don't toggle when clicking on the links
|
|
1608
|
-
|
|
1612
|
+
const selector = "a[href]";
|
|
1613
|
+
if (target.matches(selector) || target.closest(selector)) return;
|
|
1609
1614
|
setUserWantsExpanded(prev => !prev);
|
|
1610
1615
|
}), true);
|
|
1611
1616
|
_el$.classList.toggle("placeholder", !!!display_);
|
|
@@ -1783,7 +1788,8 @@ function $3da8afe3ed57cf34$export$7da560f849543dff({
|
|
|
1783
1788
|
layout_options_: layout_options_,
|
|
1784
1789
|
title_: title_,
|
|
1785
1790
|
max_rows_: max_rows_,
|
|
1786
|
-
view_more_button_: view_more_button_
|
|
1791
|
+
view_more_button_: view_more_button_,
|
|
1792
|
+
NoResultsFallback_: NoResultsFallback_
|
|
1787
1793
|
}) {
|
|
1788
1794
|
const rows_object_ = $9HbP8$createMemo(() => {
|
|
1789
1795
|
const view_more_button = view_more_button_?.();
|
|
@@ -1860,6 +1866,9 @@ function $3da8afe3ed57cf34$export$7da560f849543dff({
|
|
|
1860
1866
|
get when() {
|
|
1861
1867
|
return is_showing_something();
|
|
1862
1868
|
},
|
|
1869
|
+
get fallback() {
|
|
1870
|
+
return NoResultsFallback_?.();
|
|
1871
|
+
},
|
|
1863
1872
|
children: elements
|
|
1864
1873
|
});
|
|
1865
1874
|
}
|
|
@@ -1927,7 +1936,8 @@ function $07ef910e8ef6b783$export$2c9f9bf2092486aa(props) {
|
|
|
1927
1936
|
layout_options_: $9HbP8$createMemo(() => ({
|
|
1928
1937
|
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.columnsAtSize_),
|
|
1929
1938
|
...grid_spacing_override()
|
|
1930
|
-
}))
|
|
1939
|
+
})),
|
|
1940
|
+
NoResultsFallback_: () => props.NoResultsFallback_
|
|
1931
1941
|
};
|
|
1932
1942
|
$9HbP8$createEffect(() => {
|
|
1933
1943
|
const {
|
|
@@ -7066,44 +7076,20 @@ function $0b6bc2f8309efa8a$export$e5c2828934226505({
|
|
|
7066
7076
|
expanded_: expanded_,
|
|
7067
7077
|
i18n_: i18n_
|
|
7068
7078
|
}) {
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
var _ref$2 = second_span;
|
|
7082
|
-
typeof _ref$2 === "function" ? $9HbP8$use(_ref$2, _el$3) : second_span = _el$3;
|
|
7083
|
-
$9HbP8$effect(() => $9HbP8$setAttribute(_el$, "aria-label", expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_()));
|
|
7079
|
+
return (() => {
|
|
7080
|
+
var _el$ = $9HbP8$getNextElement($0b6bc2f8309efa8a$var$_tmpl$);
|
|
7081
|
+
$9HbP8$effect(_p$ => {
|
|
7082
|
+
var _v$ = !!expanded_(),
|
|
7083
|
+
_v$2 = expanded_() ? i18n_.morphing_sign_expanded_aria_label_() : i18n_.morphing_sign_collapsed_aria_label_();
|
|
7084
|
+
_v$ !== _p$.e && _el$.classList.toggle("expanded", _p$.e = _v$);
|
|
7085
|
+
_v$2 !== _p$.t && $9HbP8$setAttribute(_el$, "aria-label", _p$.t = _v$2);
|
|
7086
|
+
return _p$;
|
|
7087
|
+
}, {
|
|
7088
|
+
e: undefined,
|
|
7089
|
+
t: undefined
|
|
7090
|
+
});
|
|
7084
7091
|
return _el$;
|
|
7085
7092
|
})();
|
|
7086
|
-
const [is_in_dom, set_is_in_dom] = $9HbP8$createSignal(false);
|
|
7087
|
-
(0, $9HbP8$observer).wait_for_element(outer_div).then($9HbP8$catchify(() => set_is_in_dom(true)));
|
|
7088
|
-
$9HbP8$createEffect(() => {
|
|
7089
|
-
if (!is_in_dom())
|
|
7090
|
-
// wait for us to being in DOM as animations don't work otherwise
|
|
7091
|
-
return;
|
|
7092
|
-
try {
|
|
7093
|
-
const expanded = expanded_();
|
|
7094
|
-
for (const span of [first_span, second_span]) span.animate([{
|
|
7095
|
-
transform: `rotate(${expanded ? 90 : "0"}deg)`
|
|
7096
|
-
}], animation_options);
|
|
7097
|
-
const percentage_value = `${expanded ? 50 : 25}%`;
|
|
7098
|
-
second_span.animate([{
|
|
7099
|
-
left: percentage_value,
|
|
7100
|
-
right: percentage_value
|
|
7101
|
-
}], animation_options);
|
|
7102
|
-
} catch (e) {
|
|
7103
|
-
$9HbP8$dlog("partial keyframes probably not supported", e);
|
|
7104
|
-
}
|
|
7105
|
-
});
|
|
7106
|
-
return outer_div;
|
|
7107
7093
|
}
|
|
7108
7094
|
var $522a690e0e2bd46d$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<span class=highlighted-part>`);
|
|
7109
7095
|
const $522a690e0e2bd46d$var$dont_cut_in_between_less_than_characters = 30;
|
|
@@ -8849,12 +8835,14 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({
|
|
|
8849
8835
|
const data_objs_in_remote = Object.fromEntries(remote_meta.values.map((value, index) => [JSON.stringify(value), {
|
|
8850
8836
|
value_: value,
|
|
8851
8837
|
count_: remote_meta.counts?.[index],
|
|
8852
|
-
name_: remote_meta.names?.[index]
|
|
8838
|
+
name_: remote_meta.names?.[index],
|
|
8839
|
+
swatches_: remote_meta.swatches?.[index]
|
|
8853
8840
|
}]));
|
|
8854
8841
|
const data_objs_in_local = Object.fromEntries(local_meta.values.map((value, index) => [JSON.stringify(value), {
|
|
8855
8842
|
value_: value,
|
|
8856
8843
|
count_: 0,
|
|
8857
|
-
name_: local_meta.names?.[index]
|
|
8844
|
+
name_: local_meta.names?.[index],
|
|
8845
|
+
swatches_: local_meta.swatches?.[index]
|
|
8858
8846
|
}]));
|
|
8859
8847
|
const new_data = [...Object.keys(data_objs_in_local).filter(key => {
|
|
8860
8848
|
// put data entries that are selected and don't exist in new remote state first
|
|
@@ -8889,7 +8877,12 @@ function $5efb5894079b220e$export$b288c38ae3fddb56({
|
|
|
8889
8877
|
}) => name_),
|
|
8890
8878
|
counts: new_data.map(({
|
|
8891
8879
|
count_: count_
|
|
8892
|
-
}) => count_)
|
|
8880
|
+
}) => count_),
|
|
8881
|
+
...("swatches" in remote_filter && {
|
|
8882
|
+
swatches: new_data.map(({
|
|
8883
|
+
swatches_: swatches_
|
|
8884
|
+
}) => swatches_)
|
|
8885
|
+
})
|
|
8893
8886
|
}
|
|
8894
8887
|
};
|
|
8895
8888
|
new_local_filter_state.push(result);
|
|
@@ -8938,6 +8931,7 @@ function $5efb5894079b220e$var$modify_only_local_filter(local_filter_object, sel
|
|
|
8938
8931
|
}
|
|
8939
8932
|
new_meta.values = values.filter((_, index) => !indexes_to_remove.has(index));
|
|
8940
8933
|
if (new_meta.names) new_meta.names = new_meta.names.filter((_, index) => !indexes_to_remove.has(index));
|
|
8934
|
+
if ("swatches" in new_meta) new_meta.swatches = new_meta.swatches?.filter((_, index) => !indexes_to_remove.has(index));
|
|
8941
8935
|
if (new_meta.counts)
|
|
8942
8936
|
// remove counts that are too much, they're all zero anyway if they exist
|
|
8943
8937
|
new_meta.counts.length -= indexes_to_remove.size;
|
|
@@ -12444,7 +12438,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
|
|
|
12444
12438
|
function $b26bdbd081f63e3f$export$9ff751cd77687edc({
|
|
12445
12439
|
search_results_: search_results_,
|
|
12446
12440
|
router_: router_,
|
|
12447
|
-
|
|
12441
|
+
setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
|
|
12448
12442
|
get_search_query_: get_search_query_
|
|
12449
12443
|
}) {
|
|
12450
12444
|
const content_results = $9HbP8$createMemo(() => search_results_()?.content_search_links);
|
|
@@ -12460,7 +12454,11 @@ function $b26bdbd081f63e3f$export$9ff751cd77687edc({
|
|
|
12460
12454
|
});
|
|
12461
12455
|
$9HbP8$createEffect(() => {
|
|
12462
12456
|
const results = content_results();
|
|
12463
|
-
|
|
12457
|
+
const numberResults = Array.isArray(results) ? results.length : 0;
|
|
12458
|
+
setNumberContentResultsPerQuery_(prev => {
|
|
12459
|
+
prev.set($9HbP8$untrack(get_search_query_), numberResults);
|
|
12460
|
+
return prev;
|
|
12461
|
+
});
|
|
12464
12462
|
});
|
|
12465
12463
|
return $9HbP8$createComponent((0, $9HbP8$For), {
|
|
12466
12464
|
get each() {
|
|
@@ -12477,7 +12475,8 @@ function $b26bdbd081f63e3f$export$9ff751cd77687edc({
|
|
|
12477
12475
|
}
|
|
12478
12476
|
function $9d5b3ed1fc91c672$export$4405d077f0a20494({
|
|
12479
12477
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
12480
|
-
cols_at_size_: cols_at_size_
|
|
12478
|
+
cols_at_size_: cols_at_size_,
|
|
12479
|
+
overrideAmount_: overrideAmount_
|
|
12481
12480
|
}) {
|
|
12482
12481
|
const colsShowingNow = $77348875ac090fcd$export$a79e666719b3647c(cols_at_size_);
|
|
12483
12482
|
const largest_column = $9HbP8$createMemo(() => {
|
|
@@ -12485,9 +12484,12 @@ function $9d5b3ed1fc91c672$export$4405d077f0a20494({
|
|
|
12485
12484
|
if (isNaN(largest_in_cols_at_size) || Math.abs(largest_in_cols_at_size) === Infinity) return 4; // fallback to something big so we always have the right amount of placeholders
|
|
12486
12485
|
return largest_in_cols_at_size;
|
|
12487
12486
|
});
|
|
12488
|
-
const num_placeholders = $9HbP8$createMemo(() =>
|
|
12489
|
-
|
|
12490
|
-
|
|
12487
|
+
const num_placeholders = $9HbP8$createMemo(() => {
|
|
12488
|
+
const override = overrideAmount_();
|
|
12489
|
+
if (override !== undefined) return override;
|
|
12490
|
+
// 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
|
|
12491
|
+
return (get_history_state_content_results_rows() ?? (0, $49de9d31aeea1b5e$export$70ceae36059a1036)) * (colsShowingNow() || largest_column());
|
|
12492
|
+
});
|
|
12491
12493
|
return $9HbP8$createComponent((0, $9HbP8$Index), {
|
|
12492
12494
|
get each() {
|
|
12493
12495
|
return Array.from({
|
|
@@ -12517,15 +12519,13 @@ function $49de9d31aeea1b5e$export$6d0c9c22f6652669({
|
|
|
12517
12519
|
number_: num_results,
|
|
12518
12520
|
i18n_: i18n_
|
|
12519
12521
|
});
|
|
12520
|
-
const
|
|
12521
|
-
|
|
12522
|
-
const placeholders_enabled = $9HbP8$createMemo(() => {
|
|
12523
|
-
// don't show placeholders when the user toggles filters
|
|
12524
|
-
check_query();
|
|
12525
|
-
return !queries_without_content_results_.has(get_search_query_());
|
|
12522
|
+
const [numberContentResultsPerQuery, setNumberContentResultsPerQuery_] = $9HbP8$createSignal(new Map(), {
|
|
12523
|
+
equals: false
|
|
12526
12524
|
});
|
|
12525
|
+
const contentResultsForCurrentQuery = $9HbP8$createMemo(() => numberContentResultsPerQuery().get(get_search_query_()));
|
|
12526
|
+
// Don't show placeholder if we know there will not be any content results and someone is just toggling filters
|
|
12527
|
+
const placeholders_enabled = $9HbP8$createMemo(() => contentResultsForCurrentQuery() !== 0);
|
|
12527
12528
|
const rows_object = $49de9d31aeea1b5e$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
12528
|
-
for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
|
|
12529
12529
|
return (() => {
|
|
12530
12530
|
var _el$ = $9HbP8$getNextElement($49de9d31aeea1b5e$var$_tmpl$),
|
|
12531
12531
|
_el$2 = _el$.firstChild,
|
|
@@ -12555,14 +12555,15 @@ function $49de9d31aeea1b5e$export$6d0c9c22f6652669({
|
|
|
12555
12555
|
content_results_rows_: content_results_rows_,
|
|
12556
12556
|
get cols_at_size_() {
|
|
12557
12557
|
return $9HbP8$createMemo(() => layout_options_().cols_at_size);
|
|
12558
|
-
}
|
|
12558
|
+
},
|
|
12559
|
+
overrideAmount_: contentResultsForCurrentQuery
|
|
12559
12560
|
});
|
|
12560
12561
|
},
|
|
12561
12562
|
get children() {
|
|
12562
12563
|
return $9HbP8$createComponent((0, $b26bdbd081f63e3f$export$9ff751cd77687edc), {
|
|
12563
12564
|
router_: router_,
|
|
12564
12565
|
search_results_: search_results_,
|
|
12565
|
-
|
|
12566
|
+
setNumberContentResultsPerQuery_: setNumberContentResultsPerQuery_,
|
|
12566
12567
|
get_search_query_: get_search_query_
|
|
12567
12568
|
});
|
|
12568
12569
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.13",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"sass": "styles.scss",
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
237
237
|
"@babel/runtime": "latest",
|
|
238
238
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
239
|
-
"@depict-ai/plp-styling": "^4.0.
|
|
239
|
+
"@depict-ai/plp-styling": "^4.0.4",
|
|
240
240
|
"@depict-ai/types": "^5.1.2",
|
|
241
241
|
"@depict-ai/utilishared": "^2.1.2",
|
|
242
242
|
"solid-js": "^1.8.12"
|