@depict-ai/ui 4.1.6 → 4.1.8
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 +34 -16
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +34 -16
- package/latest/index.cjs +33 -12
- package/latest/index.d.ts +1 -1
- package/latest/index.js +33 -12
- package/package.json +2 -2
- package/server/ES10/index.cjs +34 -16
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +34 -16
- package/server/latest/index.cjs +33 -12
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +33 -12
package/ES10/index.cjs
CHANGED
|
@@ -99,7 +99,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
99
99
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
100
100
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
101
101
|
/*! Depict.ai search and product listing SDK */
|
|
102
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.
|
|
102
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.8";
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* This is a function that will safely clone an object that may contain promises.
|
|
@@ -7930,25 +7930,33 @@ function $476a3dc36afc1938$export$82ed4b28ecb67608(_ref) {
|
|
|
7930
7930
|
const checkboxes = $52FdA$solidjs.createMemo(() => {
|
|
7931
7931
|
const meta = filter_().meta;
|
|
7932
7932
|
return meta.values.map((value_, index) => {
|
|
7933
|
-
var _meta$names, _meta$counts;
|
|
7933
|
+
var _meta$names, _meta$counts, _meta$swatches;
|
|
7934
7934
|
return {
|
|
7935
7935
|
value_: value_,
|
|
7936
7936
|
name_: (_meta$names = meta.names) === null || _meta$names === void 0 ? void 0 : _meta$names[index],
|
|
7937
|
-
count_: (_meta$counts = meta.counts) === null || _meta$counts === void 0 ? void 0 : _meta$counts[index]
|
|
7937
|
+
count_: (_meta$counts = meta.counts) === null || _meta$counts === void 0 ? void 0 : _meta$counts[index],
|
|
7938
|
+
swatch_: (_meta$swatches = meta.swatches) === null || _meta$swatches === void 0 ? void 0 : _meta$swatches[index]
|
|
7938
7939
|
};
|
|
7939
7940
|
});
|
|
7940
7941
|
});
|
|
7942
|
+
const backendFilterV2 = $52FdA$solidjs.createMemo(() => "swatches" in (filter_().meta || {}));
|
|
7941
7943
|
const render_checkbox = checkbox => {
|
|
7942
|
-
const
|
|
7944
|
+
const hex_color = $52FdA$solidjs.createMemo(() => {
|
|
7943
7945
|
var _split;
|
|
7944
|
-
|
|
7946
|
+
if (backendFilterV2()) return checkbox().swatch_ || "#000";
|
|
7947
|
+
return ((_split = checkbox().value_.split(";")) === null || _split === void 0 ? void 0 : _split[1]) || "";
|
|
7945
7948
|
});
|
|
7946
|
-
const
|
|
7947
|
-
|
|
7948
|
-
return
|
|
7949
|
+
const hasGradientOrOtherValidNonHexColor = $52FdA$solidjs.createMemo(() => {
|
|
7950
|
+
const color = hex_color();
|
|
7951
|
+
return !!color && !color.startsWith("#");
|
|
7952
|
+
});
|
|
7953
|
+
const setBlackCheckClass = $52FdA$solidjs.createMemo(() => {
|
|
7954
|
+
// Set this to true if we should show a black tick in the checkbox for better contrast on light backgrounds
|
|
7955
|
+
if (hasGradientOrOtherValidNonHexColor()) return false;
|
|
7956
|
+
const rgb_color = $52FdA$depictaiutilishared.hex_to_rgb(hex_color());
|
|
7957
|
+
if (!rgb_color) return false;
|
|
7958
|
+
return $476a3dc36afc1938$var$does_black_contrast_better(rgb_color);
|
|
7949
7959
|
});
|
|
7950
|
-
const rgb_color = $52FdA$solidjs.createMemo(() => $52FdA$depictaiutilishared.hex_to_rgb(hex_color()));
|
|
7951
|
-
const black_contrast_better = $52FdA$solidjs.createMemo(() => rgb_color() ? $476a3dc36afc1938$var$does_black_contrast_better(rgb_color()) : false);
|
|
7952
7960
|
const is_checked = $52FdA$solidjs.createMemo(() => {
|
|
7953
7961
|
var _existing_filter;
|
|
7954
7962
|
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
@@ -7958,6 +7966,11 @@ function $476a3dc36afc1938$export$82ed4b28ecb67608(_ref) {
|
|
|
7958
7966
|
const value = $52FdA$solidjs.createMemo(() => checkbox().value_);
|
|
7959
7967
|
const label_text = $52FdA$solidjs.createMemo(() => checkbox().name_ || value() + "");
|
|
7960
7968
|
const count = $52FdA$solidjs.createMemo(() => checkbox().count_);
|
|
7969
|
+
const colorNameDatasetValue = $52FdA$solidjs.createMemo(() => {
|
|
7970
|
+
var _split2;
|
|
7971
|
+
if (backendFilterV2()) return label_text();
|
|
7972
|
+
return ((_split2 = checkbox().value_.split(";")) === null || _split2 === void 0 ? void 0 : _split2[0]) || "";
|
|
7973
|
+
});
|
|
7961
7974
|
const input_row = $52FdA$solidjsweb.createComponent((0, $902a0ca2b52f3898$export$48513f6b9f8ce62d), {
|
|
7962
7975
|
get value_() {
|
|
7963
7976
|
return value();
|
|
@@ -7990,11 +8003,12 @@ function $476a3dc36afc1938$export$82ed4b28ecb67608(_ref) {
|
|
|
7990
8003
|
style: style
|
|
7991
8004
|
} = span;
|
|
7992
8005
|
classList.add("color");
|
|
7993
|
-
$52FdA$solidjs.
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
8006
|
+
$52FdA$solidjs.createRenderEffect(() => style.background = hex_color() || "black" // default to black background so that the default-checkmark also is visible on dark page backgrounds (the or here can be removed when we fully go v2)
|
|
8007
|
+
);
|
|
8008
|
+
|
|
8009
|
+
$52FdA$solidjs.createRenderEffect(() => span.dataset.colorName = colorNameDatasetValue());
|
|
8010
|
+
$52FdA$solidjs.createRenderEffect(() => classList.toggle("black-check", setBlackCheckClass()));
|
|
8011
|
+
$52FdA$solidjs.createRenderEffect(() => classList.toggle("outlined-check", hasGradientOrOtherValidNonHexColor()));
|
|
7998
8012
|
}
|
|
7999
8013
|
});
|
|
8000
8014
|
return input_row;
|
|
@@ -13605,6 +13619,7 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
|
|
|
13605
13619
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
13606
13620
|
cols_at_size_: cols_at_size_
|
|
13607
13621
|
} = _ref;
|
|
13622
|
+
const colsShowingNow = $478e5a09664da64c$export$a79e666719b3647c(cols_at_size_);
|
|
13608
13623
|
const largest_column = $52FdA$solidjs.createMemo(() => {
|
|
13609
13624
|
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(_ref2 => {
|
|
13610
13625
|
let [cols] = _ref2;
|
|
@@ -13615,7 +13630,10 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
|
|
|
13615
13630
|
});
|
|
13616
13631
|
const num_placeholders = $52FdA$solidjs.createMemo(() => {
|
|
13617
13632
|
var _get_history_state_co;
|
|
13618
|
-
return (
|
|
13633
|
+
return (
|
|
13634
|
+
// 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
|
|
13635
|
+
((_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())
|
|
13636
|
+
);
|
|
13619
13637
|
});
|
|
13620
13638
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Index), {
|
|
13621
13639
|
get each() {
|
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.1.
|
|
13
|
+
export const version = "4.1.8";
|
|
14
14
|
/**
|
|
15
15
|
* This is a function that will safely clone an object that may contain promises.
|
|
16
16
|
* It will use structuredClone to clone the object and then re-apply (copy) any promises that were in the original object to the cloned object.
|
package/ES10/index.js
CHANGED
|
@@ -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.1.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.1.8";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* This is a function that will safely clone an object that may contain promises.
|
|
@@ -7841,25 +7841,33 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
7841
7841
|
const checkboxes = $8tj43$createMemo(() => {
|
|
7842
7842
|
const meta = filter_().meta;
|
|
7843
7843
|
return meta.values.map((value_, index) => {
|
|
7844
|
-
var _meta$names, _meta$counts;
|
|
7844
|
+
var _meta$names, _meta$counts, _meta$swatches;
|
|
7845
7845
|
return {
|
|
7846
7846
|
value_: value_,
|
|
7847
7847
|
name_: (_meta$names = meta.names) === null || _meta$names === void 0 ? void 0 : _meta$names[index],
|
|
7848
|
-
count_: (_meta$counts = meta.counts) === null || _meta$counts === void 0 ? void 0 : _meta$counts[index]
|
|
7848
|
+
count_: (_meta$counts = meta.counts) === null || _meta$counts === void 0 ? void 0 : _meta$counts[index],
|
|
7849
|
+
swatch_: (_meta$swatches = meta.swatches) === null || _meta$swatches === void 0 ? void 0 : _meta$swatches[index]
|
|
7849
7850
|
};
|
|
7850
7851
|
});
|
|
7851
7852
|
});
|
|
7853
|
+
const backendFilterV2 = $8tj43$createMemo(() => "swatches" in (filter_().meta || {}));
|
|
7852
7854
|
const render_checkbox = checkbox => {
|
|
7853
|
-
const
|
|
7855
|
+
const hex_color = $8tj43$createMemo(() => {
|
|
7854
7856
|
var _split;
|
|
7855
|
-
|
|
7857
|
+
if (backendFilterV2()) return checkbox().swatch_ || "#000";
|
|
7858
|
+
return ((_split = checkbox().value_.split(";")) === null || _split === void 0 ? void 0 : _split[1]) || "";
|
|
7856
7859
|
});
|
|
7857
|
-
const
|
|
7858
|
-
|
|
7859
|
-
return
|
|
7860
|
+
const hasGradientOrOtherValidNonHexColor = $8tj43$createMemo(() => {
|
|
7861
|
+
const color = hex_color();
|
|
7862
|
+
return !!color && !color.startsWith("#");
|
|
7863
|
+
});
|
|
7864
|
+
const setBlackCheckClass = $8tj43$createMemo(() => {
|
|
7865
|
+
// Set this to true if we should show a black tick in the checkbox for better contrast on light backgrounds
|
|
7866
|
+
if (hasGradientOrOtherValidNonHexColor()) return false;
|
|
7867
|
+
const rgb_color = $8tj43$hex_to_rgb(hex_color());
|
|
7868
|
+
if (!rgb_color) return false;
|
|
7869
|
+
return $2cb856c297c53e6c$var$does_black_contrast_better(rgb_color);
|
|
7860
7870
|
});
|
|
7861
|
-
const rgb_color = $8tj43$createMemo(() => $8tj43$hex_to_rgb(hex_color()));
|
|
7862
|
-
const black_contrast_better = $8tj43$createMemo(() => rgb_color() ? $2cb856c297c53e6c$var$does_black_contrast_better(rgb_color()) : false);
|
|
7863
7871
|
const is_checked = $8tj43$createMemo(() => {
|
|
7864
7872
|
var _existing_filter;
|
|
7865
7873
|
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
@@ -7869,6 +7877,11 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
7869
7877
|
const value = $8tj43$createMemo(() => checkbox().value_);
|
|
7870
7878
|
const label_text = $8tj43$createMemo(() => checkbox().name_ || value() + "");
|
|
7871
7879
|
const count = $8tj43$createMemo(() => checkbox().count_);
|
|
7880
|
+
const colorNameDatasetValue = $8tj43$createMemo(() => {
|
|
7881
|
+
var _split2;
|
|
7882
|
+
if (backendFilterV2()) return label_text();
|
|
7883
|
+
return ((_split2 = checkbox().value_.split(";")) === null || _split2 === void 0 ? void 0 : _split2[0]) || "";
|
|
7884
|
+
});
|
|
7872
7885
|
const input_row = $8tj43$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
|
|
7873
7886
|
get value_() {
|
|
7874
7887
|
return value();
|
|
@@ -7901,11 +7914,12 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
7901
7914
|
style: style
|
|
7902
7915
|
} = span;
|
|
7903
7916
|
classList.add("color");
|
|
7904
|
-
$8tj43$
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7917
|
+
$8tj43$createRenderEffect(() => style.background = hex_color() || "black" // default to black background so that the default-checkmark also is visible on dark page backgrounds (the or here can be removed when we fully go v2)
|
|
7918
|
+
);
|
|
7919
|
+
|
|
7920
|
+
$8tj43$createRenderEffect(() => span.dataset.colorName = colorNameDatasetValue());
|
|
7921
|
+
$8tj43$createRenderEffect(() => classList.toggle("black-check", setBlackCheckClass()));
|
|
7922
|
+
$8tj43$createRenderEffect(() => classList.toggle("outlined-check", hasGradientOrOtherValidNonHexColor()));
|
|
7909
7923
|
}
|
|
7910
7924
|
});
|
|
7911
7925
|
return input_row;
|
|
@@ -13516,6 +13530,7 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
|
|
|
13516
13530
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
13517
13531
|
cols_at_size_: cols_at_size_
|
|
13518
13532
|
} = _ref;
|
|
13533
|
+
const colsShowingNow = $40e2fa435715a1a0$export$a79e666719b3647c(cols_at_size_);
|
|
13519
13534
|
const largest_column = $8tj43$createMemo(() => {
|
|
13520
13535
|
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(_ref2 => {
|
|
13521
13536
|
let [cols] = _ref2;
|
|
@@ -13526,7 +13541,10 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
|
|
|
13526
13541
|
});
|
|
13527
13542
|
const num_placeholders = $8tj43$createMemo(() => {
|
|
13528
13543
|
var _get_history_state_co;
|
|
13529
|
-
return (
|
|
13544
|
+
return (
|
|
13545
|
+
// 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
|
|
13546
|
+
((_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())
|
|
13547
|
+
);
|
|
13530
13548
|
});
|
|
13531
13549
|
return $8tj43$createComponent((0, $8tj43$Index), {
|
|
13532
13550
|
get each() {
|
package/latest/index.cjs
CHANGED
|
@@ -93,7 +93,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
93
93
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
94
94
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
95
95
|
/*! Depict.ai search and product listing SDK */
|
|
96
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.
|
|
96
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.8";
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* This is a function that will safely clone an object that may contain promises.
|
|
@@ -7554,15 +7554,28 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
7554
7554
|
return {
|
|
7555
7555
|
value_: value_,
|
|
7556
7556
|
name_: meta.names?.[index],
|
|
7557
|
-
count_: meta.counts?.[index]
|
|
7557
|
+
count_: meta.counts?.[index],
|
|
7558
|
+
swatch_: meta.swatches?.[index]
|
|
7558
7559
|
};
|
|
7559
7560
|
});
|
|
7560
7561
|
});
|
|
7562
|
+
const backendFilterV2 = $gVhhF$solidjs.createMemo(() => "swatches" in (filter_().meta || {}));
|
|
7561
7563
|
const render_checkbox = checkbox => {
|
|
7562
|
-
const
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7564
|
+
const hex_color = $gVhhF$solidjs.createMemo(() => {
|
|
7565
|
+
if (backendFilterV2()) return checkbox().swatch_ || "#000";
|
|
7566
|
+
return checkbox().value_.split(";")?.[1] || "";
|
|
7567
|
+
});
|
|
7568
|
+
const hasGradientOrOtherValidNonHexColor = $gVhhF$solidjs.createMemo(() => {
|
|
7569
|
+
const color = hex_color();
|
|
7570
|
+
return !!color && !color.startsWith("#");
|
|
7571
|
+
});
|
|
7572
|
+
const setBlackCheckClass = $gVhhF$solidjs.createMemo(() => {
|
|
7573
|
+
// Set this to true if we should show a black tick in the checkbox for better contrast on light backgrounds
|
|
7574
|
+
if (hasGradientOrOtherValidNonHexColor()) return false;
|
|
7575
|
+
const rgb_color = $gVhhF$depictaiutilishared.hex_to_rgb(hex_color());
|
|
7576
|
+
if (!rgb_color) return false;
|
|
7577
|
+
return $b51a2b8b9355e66c$var$does_black_contrast_better(rgb_color);
|
|
7578
|
+
});
|
|
7566
7579
|
const is_checked = $gVhhF$solidjs.createMemo(() => {
|
|
7567
7580
|
const data = existing_filter()?.data;
|
|
7568
7581
|
const value = $daa394359b026187$export$325f75597868c4f0(checkbox().value_);
|
|
@@ -7571,6 +7584,10 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
7571
7584
|
const value = $gVhhF$solidjs.createMemo(() => checkbox().value_);
|
|
7572
7585
|
const label_text = $gVhhF$solidjs.createMemo(() => checkbox().name_ || value() + "");
|
|
7573
7586
|
const count = $gVhhF$solidjs.createMemo(() => checkbox().count_);
|
|
7587
|
+
const colorNameDatasetValue = $gVhhF$solidjs.createMemo(() => {
|
|
7588
|
+
if (backendFilterV2()) return label_text();
|
|
7589
|
+
return checkbox().value_.split(";")?.[0] || "";
|
|
7590
|
+
});
|
|
7574
7591
|
const input_row = $gVhhF$solidjsweb.createComponent((0, $1c63082b2da848ad$export$48513f6b9f8ce62d), {
|
|
7575
7592
|
get value_() {
|
|
7576
7593
|
return value();
|
|
@@ -7603,11 +7620,12 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
7603
7620
|
style: style
|
|
7604
7621
|
} = span;
|
|
7605
7622
|
classList.add("color");
|
|
7606
|
-
$gVhhF$solidjs.
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7623
|
+
$gVhhF$solidjs.createRenderEffect(() => style.background = hex_color() || "black" // default to black background so that the default-checkmark also is visible on dark page backgrounds (the or here can be removed when we fully go v2)
|
|
7624
|
+
);
|
|
7625
|
+
|
|
7626
|
+
$gVhhF$solidjs.createRenderEffect(() => span.dataset.colorName = colorNameDatasetValue());
|
|
7627
|
+
$gVhhF$solidjs.createRenderEffect(() => classList.toggle("black-check", setBlackCheckClass()));
|
|
7628
|
+
$gVhhF$solidjs.createRenderEffect(() => classList.toggle("outlined-check", hasGradientOrOtherValidNonHexColor()));
|
|
7611
7629
|
}
|
|
7612
7630
|
});
|
|
7613
7631
|
return input_row;
|
|
@@ -12806,12 +12824,15 @@ function $c2f92eb265a14529$export$4405d077f0a20494({
|
|
|
12806
12824
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
12807
12825
|
cols_at_size_: cols_at_size_
|
|
12808
12826
|
}) {
|
|
12827
|
+
const colsShowingNow = $17d06b3bcb035500$export$a79e666719b3647c(cols_at_size_);
|
|
12809
12828
|
const largest_column = $gVhhF$solidjs.createMemo(() => {
|
|
12810
12829
|
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(([cols]) => cols));
|
|
12811
12830
|
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
|
|
12812
12831
|
return largest_in_cols_at_size;
|
|
12813
12832
|
});
|
|
12814
|
-
const num_placeholders = $gVhhF$solidjs.createMemo(() =>
|
|
12833
|
+
const num_placeholders = $gVhhF$solidjs.createMemo(() =>
|
|
12834
|
+
// 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
|
|
12835
|
+
(get_history_state_content_results_rows() ?? (0, $3716b8caf7f959e2$export$70ceae36059a1036)) * (colsShowingNow() || largest_column()));
|
|
12815
12836
|
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Index), {
|
|
12816
12837
|
get each() {
|
|
12817
12838
|
return Array.from({
|
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.1.
|
|
13
|
+
export const version = "4.1.8";
|
|
14
14
|
/**
|
|
15
15
|
* This is a function that will safely clone an object that may contain promises.
|
|
16
16
|
* It will use structuredClone to clone the object and then re-apply (copy) any promises that were in the original object to the cloned object.
|
package/latest/index.js
CHANGED
|
@@ -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.1.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.8";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* This is a function that will safely clone an object that may contain promises.
|
|
@@ -7468,15 +7468,28 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
7468
7468
|
return {
|
|
7469
7469
|
value_: value_,
|
|
7470
7470
|
name_: meta.names?.[index],
|
|
7471
|
-
count_: meta.counts?.[index]
|
|
7471
|
+
count_: meta.counts?.[index],
|
|
7472
|
+
swatch_: meta.swatches?.[index]
|
|
7472
7473
|
};
|
|
7473
7474
|
});
|
|
7474
7475
|
});
|
|
7476
|
+
const backendFilterV2 = $9HbP8$createMemo(() => "swatches" in (filter_().meta || {}));
|
|
7475
7477
|
const render_checkbox = checkbox => {
|
|
7476
|
-
const
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7478
|
+
const hex_color = $9HbP8$createMemo(() => {
|
|
7479
|
+
if (backendFilterV2()) return checkbox().swatch_ || "#000";
|
|
7480
|
+
return checkbox().value_.split(";")?.[1] || "";
|
|
7481
|
+
});
|
|
7482
|
+
const hasGradientOrOtherValidNonHexColor = $9HbP8$createMemo(() => {
|
|
7483
|
+
const color = hex_color();
|
|
7484
|
+
return !!color && !color.startsWith("#");
|
|
7485
|
+
});
|
|
7486
|
+
const setBlackCheckClass = $9HbP8$createMemo(() => {
|
|
7487
|
+
// Set this to true if we should show a black tick in the checkbox for better contrast on light backgrounds
|
|
7488
|
+
if (hasGradientOrOtherValidNonHexColor()) return false;
|
|
7489
|
+
const rgb_color = $9HbP8$hex_to_rgb(hex_color());
|
|
7490
|
+
if (!rgb_color) return false;
|
|
7491
|
+
return $e731d52d97444b7c$var$does_black_contrast_better(rgb_color);
|
|
7492
|
+
});
|
|
7480
7493
|
const is_checked = $9HbP8$createMemo(() => {
|
|
7481
7494
|
const data = existing_filter()?.data;
|
|
7482
7495
|
const value = $91aa8ee9f431800d$export$325f75597868c4f0(checkbox().value_);
|
|
@@ -7485,6 +7498,10 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
7485
7498
|
const value = $9HbP8$createMemo(() => checkbox().value_);
|
|
7486
7499
|
const label_text = $9HbP8$createMemo(() => checkbox().name_ || value() + "");
|
|
7487
7500
|
const count = $9HbP8$createMemo(() => checkbox().count_);
|
|
7501
|
+
const colorNameDatasetValue = $9HbP8$createMemo(() => {
|
|
7502
|
+
if (backendFilterV2()) return label_text();
|
|
7503
|
+
return checkbox().value_.split(";")?.[0] || "";
|
|
7504
|
+
});
|
|
7488
7505
|
const input_row = $9HbP8$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
|
|
7489
7506
|
get value_() {
|
|
7490
7507
|
return value();
|
|
@@ -7517,11 +7534,12 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
7517
7534
|
style: style
|
|
7518
7535
|
} = span;
|
|
7519
7536
|
classList.add("color");
|
|
7520
|
-
$9HbP8$
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7537
|
+
$9HbP8$createRenderEffect(() => style.background = hex_color() || "black" // default to black background so that the default-checkmark also is visible on dark page backgrounds (the or here can be removed when we fully go v2)
|
|
7538
|
+
);
|
|
7539
|
+
|
|
7540
|
+
$9HbP8$createRenderEffect(() => span.dataset.colorName = colorNameDatasetValue());
|
|
7541
|
+
$9HbP8$createRenderEffect(() => classList.toggle("black-check", setBlackCheckClass()));
|
|
7542
|
+
$9HbP8$createRenderEffect(() => classList.toggle("outlined-check", hasGradientOrOtherValidNonHexColor()));
|
|
7525
7543
|
}
|
|
7526
7544
|
});
|
|
7527
7545
|
return input_row;
|
|
@@ -12720,12 +12738,15 @@ function $9d5b3ed1fc91c672$export$4405d077f0a20494({
|
|
|
12720
12738
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
12721
12739
|
cols_at_size_: cols_at_size_
|
|
12722
12740
|
}) {
|
|
12741
|
+
const colsShowingNow = $77348875ac090fcd$export$a79e666719b3647c(cols_at_size_);
|
|
12723
12742
|
const largest_column = $9HbP8$createMemo(() => {
|
|
12724
12743
|
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(([cols]) => cols));
|
|
12725
12744
|
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
|
|
12726
12745
|
return largest_in_cols_at_size;
|
|
12727
12746
|
});
|
|
12728
|
-
const num_placeholders = $9HbP8$createMemo(() =>
|
|
12747
|
+
const num_placeholders = $9HbP8$createMemo(() =>
|
|
12748
|
+
// 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
|
|
12749
|
+
(get_history_state_content_results_rows() ?? (0, $49de9d31aeea1b5e$export$70ceae36059a1036)) * (colsShowingNow() || largest_column()));
|
|
12729
12750
|
return $9HbP8$createComponent((0, $9HbP8$Index), {
|
|
12730
12751
|
get each() {
|
|
12731
12752
|
return Array.from({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
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": "^3.0.
|
|
239
|
+
"@depict-ai/plp-styling": "^3.0.15",
|
|
240
240
|
"@depict-ai/types": "^5.0.6",
|
|
241
241
|
"@depict-ai/utilishared": "^2.0.16",
|
|
242
242
|
"solid-js": "^1.8.12"
|
package/server/ES10/index.cjs
CHANGED
|
@@ -99,7 +99,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
99
99
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
100
100
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
101
101
|
/*! Depict.ai search and product listing SDK */
|
|
102
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.
|
|
102
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.8";
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* This is a function that will safely clone an object that may contain promises.
|
|
@@ -6231,25 +6231,33 @@ function $476a3dc36afc1938$export$82ed4b28ecb67608(_ref) {
|
|
|
6231
6231
|
const checkboxes = $3hooq$solidjs.createMemo(() => {
|
|
6232
6232
|
const meta = filter_().meta;
|
|
6233
6233
|
return meta.values.map((value_, index) => {
|
|
6234
|
-
var _meta$names, _meta$counts;
|
|
6234
|
+
var _meta$names, _meta$counts, _meta$swatches;
|
|
6235
6235
|
return {
|
|
6236
6236
|
value_: value_,
|
|
6237
6237
|
name_: (_meta$names = meta.names) === null || _meta$names === void 0 ? void 0 : _meta$names[index],
|
|
6238
|
-
count_: (_meta$counts = meta.counts) === null || _meta$counts === void 0 ? void 0 : _meta$counts[index]
|
|
6238
|
+
count_: (_meta$counts = meta.counts) === null || _meta$counts === void 0 ? void 0 : _meta$counts[index],
|
|
6239
|
+
swatch_: (_meta$swatches = meta.swatches) === null || _meta$swatches === void 0 ? void 0 : _meta$swatches[index]
|
|
6239
6240
|
};
|
|
6240
6241
|
});
|
|
6241
6242
|
});
|
|
6243
|
+
const backendFilterV2 = $3hooq$solidjs.createMemo(() => "swatches" in (filter_().meta || {}));
|
|
6242
6244
|
const render_checkbox = checkbox => {
|
|
6243
|
-
const
|
|
6245
|
+
const hex_color = $3hooq$solidjs.createMemo(() => {
|
|
6244
6246
|
var _split;
|
|
6245
|
-
|
|
6247
|
+
if (backendFilterV2()) return checkbox().swatch_ || "#000";
|
|
6248
|
+
return ((_split = checkbox().value_.split(";")) === null || _split === void 0 ? void 0 : _split[1]) || "";
|
|
6246
6249
|
});
|
|
6247
|
-
const
|
|
6248
|
-
|
|
6249
|
-
return
|
|
6250
|
+
const hasGradientOrOtherValidNonHexColor = $3hooq$solidjs.createMemo(() => {
|
|
6251
|
+
const color = hex_color();
|
|
6252
|
+
return !!color && !color.startsWith("#");
|
|
6253
|
+
});
|
|
6254
|
+
const setBlackCheckClass = $3hooq$solidjs.createMemo(() => {
|
|
6255
|
+
// Set this to true if we should show a black tick in the checkbox for better contrast on light backgrounds
|
|
6256
|
+
if (hasGradientOrOtherValidNonHexColor()) return false;
|
|
6257
|
+
const rgb_color = $3hooq$depictaiutilishared.hex_to_rgb(hex_color());
|
|
6258
|
+
if (!rgb_color) return false;
|
|
6259
|
+
return $476a3dc36afc1938$var$does_black_contrast_better(rgb_color);
|
|
6250
6260
|
});
|
|
6251
|
-
const rgb_color = $3hooq$solidjs.createMemo(() => $3hooq$depictaiutilishared.hex_to_rgb(hex_color()));
|
|
6252
|
-
const black_contrast_better = $3hooq$solidjs.createMemo(() => rgb_color() ? $476a3dc36afc1938$var$does_black_contrast_better(rgb_color()) : false);
|
|
6253
6261
|
const is_checked = $3hooq$solidjs.createMemo(() => {
|
|
6254
6262
|
var _existing_filter;
|
|
6255
6263
|
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
@@ -6259,6 +6267,11 @@ function $476a3dc36afc1938$export$82ed4b28ecb67608(_ref) {
|
|
|
6259
6267
|
const value = $3hooq$solidjs.createMemo(() => checkbox().value_);
|
|
6260
6268
|
const label_text = $3hooq$solidjs.createMemo(() => checkbox().name_ || value() + "");
|
|
6261
6269
|
const count = $3hooq$solidjs.createMemo(() => checkbox().count_);
|
|
6270
|
+
const colorNameDatasetValue = $3hooq$solidjs.createMemo(() => {
|
|
6271
|
+
var _split2;
|
|
6272
|
+
if (backendFilterV2()) return label_text();
|
|
6273
|
+
return ((_split2 = checkbox().value_.split(";")) === null || _split2 === void 0 ? void 0 : _split2[0]) || "";
|
|
6274
|
+
});
|
|
6262
6275
|
const input_row = $3hooq$solidjsweb.createComponent((0, $902a0ca2b52f3898$export$48513f6b9f8ce62d), {
|
|
6263
6276
|
get value_() {
|
|
6264
6277
|
return value();
|
|
@@ -6291,11 +6304,12 @@ function $476a3dc36afc1938$export$82ed4b28ecb67608(_ref) {
|
|
|
6291
6304
|
style: style
|
|
6292
6305
|
} = span;
|
|
6293
6306
|
classList.add("color");
|
|
6294
|
-
$3hooq$solidjs.
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6307
|
+
$3hooq$solidjs.createRenderEffect(() => style.background = hex_color() || "black" // default to black background so that the default-checkmark also is visible on dark page backgrounds (the or here can be removed when we fully go v2)
|
|
6308
|
+
);
|
|
6309
|
+
|
|
6310
|
+
$3hooq$solidjs.createRenderEffect(() => span.dataset.colorName = colorNameDatasetValue());
|
|
6311
|
+
$3hooq$solidjs.createRenderEffect(() => classList.toggle("black-check", setBlackCheckClass()));
|
|
6312
|
+
$3hooq$solidjs.createRenderEffect(() => classList.toggle("outlined-check", hasGradientOrOtherValidNonHexColor()));
|
|
6299
6313
|
}
|
|
6300
6314
|
});
|
|
6301
6315
|
return input_row;
|
|
@@ -11199,6 +11213,7 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
|
|
|
11199
11213
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
11200
11214
|
cols_at_size_: cols_at_size_
|
|
11201
11215
|
} = _ref;
|
|
11216
|
+
const colsShowingNow = $478e5a09664da64c$export$a79e666719b3647c(cols_at_size_);
|
|
11202
11217
|
const largest_column = $3hooq$solidjs.createMemo(() => {
|
|
11203
11218
|
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(_ref2 => {
|
|
11204
11219
|
let [cols] = _ref2;
|
|
@@ -11209,7 +11224,10 @@ function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
|
|
|
11209
11224
|
});
|
|
11210
11225
|
const num_placeholders = $3hooq$solidjs.createMemo(() => {
|
|
11211
11226
|
var _get_history_state_co;
|
|
11212
|
-
return (
|
|
11227
|
+
return (
|
|
11228
|
+
// 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
|
|
11229
|
+
((_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())
|
|
11230
|
+
);
|
|
11213
11231
|
});
|
|
11214
11232
|
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Index), {
|
|
11215
11233
|
get each() {
|
package/server/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.1.
|
|
13
|
+
export const version = "4.1.8";
|
|
14
14
|
/**
|
|
15
15
|
* This is a function that will safely clone an object that may contain promises.
|
|
16
16
|
* It will use structuredClone to clone the object and then re-apply (copy) any promises that were in the original object to the cloned object.
|
package/server/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$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.1.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.1.8";
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* This is a function that will safely clone an object that may contain promises.
|
|
@@ -6142,25 +6142,33 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
6142
6142
|
const checkboxes = $b8hua$createMemo(() => {
|
|
6143
6143
|
const meta = filter_().meta;
|
|
6144
6144
|
return meta.values.map((value_, index) => {
|
|
6145
|
-
var _meta$names, _meta$counts;
|
|
6145
|
+
var _meta$names, _meta$counts, _meta$swatches;
|
|
6146
6146
|
return {
|
|
6147
6147
|
value_: value_,
|
|
6148
6148
|
name_: (_meta$names = meta.names) === null || _meta$names === void 0 ? void 0 : _meta$names[index],
|
|
6149
|
-
count_: (_meta$counts = meta.counts) === null || _meta$counts === void 0 ? void 0 : _meta$counts[index]
|
|
6149
|
+
count_: (_meta$counts = meta.counts) === null || _meta$counts === void 0 ? void 0 : _meta$counts[index],
|
|
6150
|
+
swatch_: (_meta$swatches = meta.swatches) === null || _meta$swatches === void 0 ? void 0 : _meta$swatches[index]
|
|
6150
6151
|
};
|
|
6151
6152
|
});
|
|
6152
6153
|
});
|
|
6154
|
+
const backendFilterV2 = $b8hua$createMemo(() => "swatches" in (filter_().meta || {}));
|
|
6153
6155
|
const render_checkbox = checkbox => {
|
|
6154
|
-
const
|
|
6156
|
+
const hex_color = $b8hua$createMemo(() => {
|
|
6155
6157
|
var _split;
|
|
6156
|
-
|
|
6158
|
+
if (backendFilterV2()) return checkbox().swatch_ || "#000";
|
|
6159
|
+
return ((_split = checkbox().value_.split(";")) === null || _split === void 0 ? void 0 : _split[1]) || "";
|
|
6157
6160
|
});
|
|
6158
|
-
const
|
|
6159
|
-
|
|
6160
|
-
return
|
|
6161
|
+
const hasGradientOrOtherValidNonHexColor = $b8hua$createMemo(() => {
|
|
6162
|
+
const color = hex_color();
|
|
6163
|
+
return !!color && !color.startsWith("#");
|
|
6164
|
+
});
|
|
6165
|
+
const setBlackCheckClass = $b8hua$createMemo(() => {
|
|
6166
|
+
// Set this to true if we should show a black tick in the checkbox for better contrast on light backgrounds
|
|
6167
|
+
if (hasGradientOrOtherValidNonHexColor()) return false;
|
|
6168
|
+
const rgb_color = $b8hua$hex_to_rgb(hex_color());
|
|
6169
|
+
if (!rgb_color) return false;
|
|
6170
|
+
return $2cb856c297c53e6c$var$does_black_contrast_better(rgb_color);
|
|
6161
6171
|
});
|
|
6162
|
-
const rgb_color = $b8hua$createMemo(() => $b8hua$hex_to_rgb(hex_color()));
|
|
6163
|
-
const black_contrast_better = $b8hua$createMemo(() => rgb_color() ? $2cb856c297c53e6c$var$does_black_contrast_better(rgb_color()) : false);
|
|
6164
6172
|
const is_checked = $b8hua$createMemo(() => {
|
|
6165
6173
|
var _existing_filter;
|
|
6166
6174
|
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
@@ -6170,6 +6178,11 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
6170
6178
|
const value = $b8hua$createMemo(() => checkbox().value_);
|
|
6171
6179
|
const label_text = $b8hua$createMemo(() => checkbox().name_ || value() + "");
|
|
6172
6180
|
const count = $b8hua$createMemo(() => checkbox().count_);
|
|
6181
|
+
const colorNameDatasetValue = $b8hua$createMemo(() => {
|
|
6182
|
+
var _split2;
|
|
6183
|
+
if (backendFilterV2()) return label_text();
|
|
6184
|
+
return ((_split2 = checkbox().value_.split(";")) === null || _split2 === void 0 ? void 0 : _split2[0]) || "";
|
|
6185
|
+
});
|
|
6173
6186
|
const input_row = $b8hua$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
|
|
6174
6187
|
get value_() {
|
|
6175
6188
|
return value();
|
|
@@ -6202,11 +6215,12 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
6202
6215
|
style: style
|
|
6203
6216
|
} = span;
|
|
6204
6217
|
classList.add("color");
|
|
6205
|
-
$b8hua$
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6218
|
+
$b8hua$createRenderEffect(() => style.background = hex_color() || "black" // default to black background so that the default-checkmark also is visible on dark page backgrounds (the or here can be removed when we fully go v2)
|
|
6219
|
+
);
|
|
6220
|
+
|
|
6221
|
+
$b8hua$createRenderEffect(() => span.dataset.colorName = colorNameDatasetValue());
|
|
6222
|
+
$b8hua$createRenderEffect(() => classList.toggle("black-check", setBlackCheckClass()));
|
|
6223
|
+
$b8hua$createRenderEffect(() => classList.toggle("outlined-check", hasGradientOrOtherValidNonHexColor()));
|
|
6210
6224
|
}
|
|
6211
6225
|
});
|
|
6212
6226
|
return input_row;
|
|
@@ -11110,6 +11124,7 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
|
|
|
11110
11124
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
11111
11125
|
cols_at_size_: cols_at_size_
|
|
11112
11126
|
} = _ref;
|
|
11127
|
+
const colsShowingNow = $40e2fa435715a1a0$export$a79e666719b3647c(cols_at_size_);
|
|
11113
11128
|
const largest_column = $b8hua$createMemo(() => {
|
|
11114
11129
|
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(_ref2 => {
|
|
11115
11130
|
let [cols] = _ref2;
|
|
@@ -11120,7 +11135,10 @@ function $ad4f3c9872fbeb48$export$4405d077f0a20494(_ref) {
|
|
|
11120
11135
|
});
|
|
11121
11136
|
const num_placeholders = $b8hua$createMemo(() => {
|
|
11122
11137
|
var _get_history_state_co;
|
|
11123
|
-
return (
|
|
11138
|
+
return (
|
|
11139
|
+
// 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
|
|
11140
|
+
((_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())
|
|
11141
|
+
);
|
|
11124
11142
|
});
|
|
11125
11143
|
return $b8hua$createComponent((0, $b8hua$Index), {
|
|
11126
11144
|
get each() {
|
package/server/latest/index.cjs
CHANGED
|
@@ -93,7 +93,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
93
93
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
94
94
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
95
95
|
/*! Depict.ai search and product listing SDK */
|
|
96
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.
|
|
96
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.8";
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* This is a function that will safely clone an object that may contain promises.
|
|
@@ -5901,15 +5901,28 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
5901
5901
|
return {
|
|
5902
5902
|
value_: value_,
|
|
5903
5903
|
name_: meta.names?.[index],
|
|
5904
|
-
count_: meta.counts?.[index]
|
|
5904
|
+
count_: meta.counts?.[index],
|
|
5905
|
+
swatch_: meta.swatches?.[index]
|
|
5905
5906
|
};
|
|
5906
5907
|
});
|
|
5907
5908
|
});
|
|
5909
|
+
const backendFilterV2 = $5vyXB$solidjs.createMemo(() => "swatches" in (filter_().meta || {}));
|
|
5908
5910
|
const render_checkbox = checkbox => {
|
|
5909
|
-
const
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5911
|
+
const hex_color = $5vyXB$solidjs.createMemo(() => {
|
|
5912
|
+
if (backendFilterV2()) return checkbox().swatch_ || "#000";
|
|
5913
|
+
return checkbox().value_.split(";")?.[1] || "";
|
|
5914
|
+
});
|
|
5915
|
+
const hasGradientOrOtherValidNonHexColor = $5vyXB$solidjs.createMemo(() => {
|
|
5916
|
+
const color = hex_color();
|
|
5917
|
+
return !!color && !color.startsWith("#");
|
|
5918
|
+
});
|
|
5919
|
+
const setBlackCheckClass = $5vyXB$solidjs.createMemo(() => {
|
|
5920
|
+
// Set this to true if we should show a black tick in the checkbox for better contrast on light backgrounds
|
|
5921
|
+
if (hasGradientOrOtherValidNonHexColor()) return false;
|
|
5922
|
+
const rgb_color = $5vyXB$depictaiutilishared.hex_to_rgb(hex_color());
|
|
5923
|
+
if (!rgb_color) return false;
|
|
5924
|
+
return $b51a2b8b9355e66c$var$does_black_contrast_better(rgb_color);
|
|
5925
|
+
});
|
|
5913
5926
|
const is_checked = $5vyXB$solidjs.createMemo(() => {
|
|
5914
5927
|
const data = existing_filter()?.data;
|
|
5915
5928
|
const value = $daa394359b026187$export$325f75597868c4f0(checkbox().value_);
|
|
@@ -5918,6 +5931,10 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
5918
5931
|
const value = $5vyXB$solidjs.createMemo(() => checkbox().value_);
|
|
5919
5932
|
const label_text = $5vyXB$solidjs.createMemo(() => checkbox().name_ || value() + "");
|
|
5920
5933
|
const count = $5vyXB$solidjs.createMemo(() => checkbox().count_);
|
|
5934
|
+
const colorNameDatasetValue = $5vyXB$solidjs.createMemo(() => {
|
|
5935
|
+
if (backendFilterV2()) return label_text();
|
|
5936
|
+
return checkbox().value_.split(";")?.[0] || "";
|
|
5937
|
+
});
|
|
5921
5938
|
const input_row = $5vyXB$solidjsweb.createComponent((0, $1c63082b2da848ad$export$48513f6b9f8ce62d), {
|
|
5922
5939
|
get value_() {
|
|
5923
5940
|
return value();
|
|
@@ -5950,11 +5967,12 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({
|
|
|
5950
5967
|
style: style
|
|
5951
5968
|
} = span;
|
|
5952
5969
|
classList.add("color");
|
|
5953
|
-
$5vyXB$solidjs.
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5970
|
+
$5vyXB$solidjs.createRenderEffect(() => style.background = hex_color() || "black" // default to black background so that the default-checkmark also is visible on dark page backgrounds (the or here can be removed when we fully go v2)
|
|
5971
|
+
);
|
|
5972
|
+
|
|
5973
|
+
$5vyXB$solidjs.createRenderEffect(() => span.dataset.colorName = colorNameDatasetValue());
|
|
5974
|
+
$5vyXB$solidjs.createRenderEffect(() => classList.toggle("black-check", setBlackCheckClass()));
|
|
5975
|
+
$5vyXB$solidjs.createRenderEffect(() => classList.toggle("outlined-check", hasGradientOrOtherValidNonHexColor()));
|
|
5958
5976
|
}
|
|
5959
5977
|
});
|
|
5960
5978
|
return input_row;
|
|
@@ -10470,12 +10488,15 @@ function $c2f92eb265a14529$export$4405d077f0a20494({
|
|
|
10470
10488
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
10471
10489
|
cols_at_size_: cols_at_size_
|
|
10472
10490
|
}) {
|
|
10491
|
+
const colsShowingNow = $17d06b3bcb035500$export$a79e666719b3647c(cols_at_size_);
|
|
10473
10492
|
const largest_column = $5vyXB$solidjs.createMemo(() => {
|
|
10474
10493
|
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(([cols]) => cols));
|
|
10475
10494
|
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
|
|
10476
10495
|
return largest_in_cols_at_size;
|
|
10477
10496
|
});
|
|
10478
|
-
const num_placeholders = $5vyXB$solidjs.createMemo(() =>
|
|
10497
|
+
const num_placeholders = $5vyXB$solidjs.createMemo(() =>
|
|
10498
|
+
// 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
|
|
10499
|
+
(get_history_state_content_results_rows() ?? (0, $3716b8caf7f959e2$export$70ceae36059a1036)) * (colsShowingNow() || largest_column()));
|
|
10479
10500
|
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Index), {
|
|
10480
10501
|
get each() {
|
|
10481
10502
|
return Array.from({
|
package/server/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.1.
|
|
13
|
+
export const version = "4.1.8";
|
|
14
14
|
/**
|
|
15
15
|
* This is a function that will safely clone an object that may contain promises.
|
|
16
16
|
* It will use structuredClone to clone the object and then re-apply (copy) any promises that were in the original object to the cloned object.
|
package/server/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$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.1.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.8";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* This is a function that will safely clone an object that may contain promises.
|
|
@@ -5815,15 +5815,28 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
5815
5815
|
return {
|
|
5816
5816
|
value_: value_,
|
|
5817
5817
|
name_: meta.names?.[index],
|
|
5818
|
-
count_: meta.counts?.[index]
|
|
5818
|
+
count_: meta.counts?.[index],
|
|
5819
|
+
swatch_: meta.swatches?.[index]
|
|
5819
5820
|
};
|
|
5820
5821
|
});
|
|
5821
5822
|
});
|
|
5823
|
+
const backendFilterV2 = $i7OB2$createMemo(() => "swatches" in (filter_().meta || {}));
|
|
5822
5824
|
const render_checkbox = checkbox => {
|
|
5823
|
-
const
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5825
|
+
const hex_color = $i7OB2$createMemo(() => {
|
|
5826
|
+
if (backendFilterV2()) return checkbox().swatch_ || "#000";
|
|
5827
|
+
return checkbox().value_.split(";")?.[1] || "";
|
|
5828
|
+
});
|
|
5829
|
+
const hasGradientOrOtherValidNonHexColor = $i7OB2$createMemo(() => {
|
|
5830
|
+
const color = hex_color();
|
|
5831
|
+
return !!color && !color.startsWith("#");
|
|
5832
|
+
});
|
|
5833
|
+
const setBlackCheckClass = $i7OB2$createMemo(() => {
|
|
5834
|
+
// Set this to true if we should show a black tick in the checkbox for better contrast on light backgrounds
|
|
5835
|
+
if (hasGradientOrOtherValidNonHexColor()) return false;
|
|
5836
|
+
const rgb_color = $i7OB2$hex_to_rgb(hex_color());
|
|
5837
|
+
if (!rgb_color) return false;
|
|
5838
|
+
return $e731d52d97444b7c$var$does_black_contrast_better(rgb_color);
|
|
5839
|
+
});
|
|
5827
5840
|
const is_checked = $i7OB2$createMemo(() => {
|
|
5828
5841
|
const data = existing_filter()?.data;
|
|
5829
5842
|
const value = $91aa8ee9f431800d$export$325f75597868c4f0(checkbox().value_);
|
|
@@ -5832,6 +5845,10 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
5832
5845
|
const value = $i7OB2$createMemo(() => checkbox().value_);
|
|
5833
5846
|
const label_text = $i7OB2$createMemo(() => checkbox().name_ || value() + "");
|
|
5834
5847
|
const count = $i7OB2$createMemo(() => checkbox().count_);
|
|
5848
|
+
const colorNameDatasetValue = $i7OB2$createMemo(() => {
|
|
5849
|
+
if (backendFilterV2()) return label_text();
|
|
5850
|
+
return checkbox().value_.split(";")?.[0] || "";
|
|
5851
|
+
});
|
|
5835
5852
|
const input_row = $i7OB2$createComponent((0, $49b79728e7d9e2a1$export$48513f6b9f8ce62d), {
|
|
5836
5853
|
get value_() {
|
|
5837
5854
|
return value();
|
|
@@ -5864,11 +5881,12 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
5864
5881
|
style: style
|
|
5865
5882
|
} = span;
|
|
5866
5883
|
classList.add("color");
|
|
5867
|
-
$i7OB2$
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5884
|
+
$i7OB2$createRenderEffect(() => style.background = hex_color() || "black" // default to black background so that the default-checkmark also is visible on dark page backgrounds (the or here can be removed when we fully go v2)
|
|
5885
|
+
);
|
|
5886
|
+
|
|
5887
|
+
$i7OB2$createRenderEffect(() => span.dataset.colorName = colorNameDatasetValue());
|
|
5888
|
+
$i7OB2$createRenderEffect(() => classList.toggle("black-check", setBlackCheckClass()));
|
|
5889
|
+
$i7OB2$createRenderEffect(() => classList.toggle("outlined-check", hasGradientOrOtherValidNonHexColor()));
|
|
5872
5890
|
}
|
|
5873
5891
|
});
|
|
5874
5892
|
return input_row;
|
|
@@ -10384,12 +10402,15 @@ function $9d5b3ed1fc91c672$export$4405d077f0a20494({
|
|
|
10384
10402
|
content_results_rows_: [get_history_state_content_results_rows],
|
|
10385
10403
|
cols_at_size_: cols_at_size_
|
|
10386
10404
|
}) {
|
|
10405
|
+
const colsShowingNow = $77348875ac090fcd$export$a79e666719b3647c(cols_at_size_);
|
|
10387
10406
|
const largest_column = $i7OB2$createMemo(() => {
|
|
10388
10407
|
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(([cols]) => cols));
|
|
10389
10408
|
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
|
|
10390
10409
|
return largest_in_cols_at_size;
|
|
10391
10410
|
});
|
|
10392
|
-
const num_placeholders = $i7OB2$createMemo(() =>
|
|
10411
|
+
const num_placeholders = $i7OB2$createMemo(() =>
|
|
10412
|
+
// 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
|
|
10413
|
+
(get_history_state_content_results_rows() ?? (0, $49de9d31aeea1b5e$export$70ceae36059a1036)) * (colsShowingNow() || largest_column()));
|
|
10393
10414
|
return $i7OB2$createComponent((0, $i7OB2$Index), {
|
|
10394
10415
|
get each() {
|
|
10395
10416
|
return Array.from({
|