@depict-ai/ui 2.0.6 → 2.0.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 +44 -37
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +44 -37
- package/latest/index.cjs +32 -26
- package/latest/index.d.ts +1 -1
- package/latest/index.js +32 -26
- package/locales/require.js +1152 -0
- package/package.json +1 -1
- package/server/ES10/index.cjs +44 -37
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +44 -37
- package/server/latest/index.cjs +32 -26
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +32 -26
package/ES10/index.cjs
CHANGED
|
@@ -67,7 +67,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
67
67
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
68
68
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
69
69
|
/*! Depict.ai search and product listing SDK */
|
|
70
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.
|
|
70
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.8";
|
|
71
71
|
|
|
72
72
|
/** @jsxImportSource solid-js */
|
|
73
73
|
|
|
@@ -123,40 +123,8 @@ const $5401a6698b0c0658$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
123
123
|
});
|
|
124
124
|
return $5401a6698b0c0658$var$transform_elements(sorted_cols_at_size);
|
|
125
125
|
};
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
129
|
-
*/
|
|
130
|
-
function $b1ea8d47bcf03111$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
131
|
-
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
132
|
-
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
133
|
-
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
134
|
-
let [cols, max_width] = _ref;
|
|
135
|
-
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
136
|
-
}).sort((_ref2, _ref3) => {
|
|
137
|
-
let [, a] = _ref2;
|
|
138
|
-
let [, b] = _ref3;
|
|
139
|
-
return a - b;
|
|
140
|
-
});
|
|
141
|
-
const [[, smallest_max_width]] = sorted_sizes;
|
|
142
|
-
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
143
|
-
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
144
|
-
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
145
|
-
const to_delete = [];
|
|
146
|
-
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
147
|
-
const [, max_width] = sorted_sizes[i];
|
|
148
|
-
if (max_width > min_width_for_more_than_one_column) continue;
|
|
149
|
-
to_delete.push(i);
|
|
150
|
-
}
|
|
151
|
-
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
152
|
-
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
153
|
-
return sorted_sizes.map(_ref4 => {
|
|
154
|
-
let [cols, max_width] = _ref4;
|
|
155
|
-
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
126
|
function $8edd3cf30d1fd8b4$export$a2cc176055f8f08() {
|
|
159
|
-
const text = "Please try setting `
|
|
127
|
+
const text = "Please try setting `columnsAtSize` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `ColsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
160
128
|
return (0, $52FdA$solidjsweb.isServer) ? {
|
|
161
129
|
t: "<!-- ".concat(text, " -->")
|
|
162
130
|
} : document.createComment(text);
|
|
@@ -672,7 +640,14 @@ function $d05611ff6b8c8357$export$23fca46f3143581f(component, error_message) {
|
|
|
672
640
|
return component_in_error_boundary(elements => {
|
|
673
641
|
const have_multiple = Array.isArray(elements);
|
|
674
642
|
if (have_multiple ? !(elements !== null && elements !== void 0 && elements.length) : !elements) return;
|
|
675
|
-
(0, $52FdA$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements,
|
|
643
|
+
(0, $52FdA$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements, _ref => {
|
|
644
|
+
let {
|
|
645
|
+
element: element
|
|
646
|
+
} = _ref;
|
|
647
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
648
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
649
|
+
dispose();
|
|
650
|
+
});
|
|
676
651
|
});
|
|
677
652
|
});else
|
|
678
653
|
// we're already in a root so cleanups are handled
|
|
@@ -703,7 +678,7 @@ function $2badc30d7c6610e1$export$9574e176201e5e8d(props) {
|
|
|
703
678
|
market_: () => props.market,
|
|
704
679
|
merchant_: () => props.merchant,
|
|
705
680
|
layout_options_: $52FdA$solidjs.createMemo(() => ({
|
|
706
|
-
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(
|
|
681
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
707
682
|
...grid_spacing_override()
|
|
708
683
|
}))
|
|
709
684
|
}));
|
|
@@ -823,7 +798,7 @@ function $41227f10ad680afd$export$9756467d34d91cdb(props) {
|
|
|
823
798
|
market_: () => props.market,
|
|
824
799
|
merchant_: () => props.merchant,
|
|
825
800
|
layout_options_: $52FdA$solidjs.createMemo(() => ({
|
|
826
|
-
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(
|
|
801
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
827
802
|
...grid_spacing_override()
|
|
828
803
|
}))
|
|
829
804
|
}));
|
|
@@ -10841,6 +10816,38 @@ function $98bd00c15a2e3159$export$828dcdd425fd3231(aligner) {
|
|
|
10841
10816
|
cleanup: cleanup
|
|
10842
10817
|
};
|
|
10843
10818
|
}
|
|
10819
|
+
|
|
10820
|
+
/**
|
|
10821
|
+
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
10822
|
+
*/
|
|
10823
|
+
function $b1ea8d47bcf03111$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
10824
|
+
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
10825
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
10826
|
+
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
10827
|
+
let [cols, max_width] = _ref;
|
|
10828
|
+
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
10829
|
+
}).sort((_ref2, _ref3) => {
|
|
10830
|
+
let [, a] = _ref2;
|
|
10831
|
+
let [, b] = _ref3;
|
|
10832
|
+
return a - b;
|
|
10833
|
+
});
|
|
10834
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
10835
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
10836
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
10837
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
10838
|
+
const to_delete = [];
|
|
10839
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
10840
|
+
const [, max_width] = sorted_sizes[i];
|
|
10841
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
10842
|
+
to_delete.push(i);
|
|
10843
|
+
}
|
|
10844
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
10845
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
10846
|
+
return sorted_sizes.map(_ref4 => {
|
|
10847
|
+
let [cols, max_width] = _ref4;
|
|
10848
|
+
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
10849
|
+
});
|
|
10850
|
+
}
|
|
10844
10851
|
const $ddd39c5f36f49703$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="depict plp search"></div>`, 2);
|
|
10845
10852
|
function $ddd39c5f36f49703$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
10846
10853
|
$ddd39c5f36f49703$var$_checkPrivateRedeclaration(obj, privateMap);
|
package/ES10/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/
|
|
|
7
7
|
import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
|
|
8
8
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
9
9
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
10
|
-
export const version = "2.0.
|
|
10
|
+
export const version = "2.0.8";
|
|
11
11
|
/**
|
|
12
12
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
13
13
|
*/
|
package/ES10/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import $8tj43$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/def
|
|
|
8
8
|
/*! Depict.ai search and product listing SDK */
|
|
9
9
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
10
10
|
register_es_version("ui", "ES10");
|
|
11
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "2.0.
|
|
11
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "2.0.8";
|
|
12
12
|
|
|
13
13
|
/** @jsxImportSource solid-js */
|
|
14
14
|
|
|
@@ -64,40 +64,8 @@ const $a9c7ba6087881ac2$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
64
64
|
});
|
|
65
65
|
return $a9c7ba6087881ac2$var$transform_elements(sorted_cols_at_size);
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
70
|
-
*/
|
|
71
|
-
function $3f7203368ad0d3ca$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
72
|
-
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
73
|
-
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
74
|
-
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
75
|
-
let [cols, max_width] = _ref;
|
|
76
|
-
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
77
|
-
}).sort((_ref2, _ref3) => {
|
|
78
|
-
let [, a] = _ref2;
|
|
79
|
-
let [, b] = _ref3;
|
|
80
|
-
return a - b;
|
|
81
|
-
});
|
|
82
|
-
const [[, smallest_max_width]] = sorted_sizes;
|
|
83
|
-
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
84
|
-
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
85
|
-
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
86
|
-
const to_delete = [];
|
|
87
|
-
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
88
|
-
const [, max_width] = sorted_sizes[i];
|
|
89
|
-
if (max_width > min_width_for_more_than_one_column) continue;
|
|
90
|
-
to_delete.push(i);
|
|
91
|
-
}
|
|
92
|
-
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
93
|
-
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
94
|
-
return sorted_sizes.map(_ref4 => {
|
|
95
|
-
let [cols, max_width] = _ref4;
|
|
96
|
-
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
67
|
function $ca55612a53dbbdd2$export$a2cc176055f8f08() {
|
|
100
|
-
const text = "Please try setting `
|
|
68
|
+
const text = "Please try setting `columnsAtSize` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `ColsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
101
69
|
return (0, $8tj43$isServer) ? {
|
|
102
70
|
t: "<!-- ".concat(text, " -->")
|
|
103
71
|
} : document.createComment(text);
|
|
@@ -613,7 +581,14 @@ function $83e8cf2c0b87a58a$export$23fca46f3143581f(component, error_message) {
|
|
|
613
581
|
return component_in_error_boundary(elements => {
|
|
614
582
|
const have_multiple = Array.isArray(elements);
|
|
615
583
|
if (have_multiple ? !(elements !== null && elements !== void 0 && elements.length) : !elements) return;
|
|
616
|
-
(0, $8tj43$observer).onremoved(have_multiple ? elements[0] : elements,
|
|
584
|
+
(0, $8tj43$observer).onremoved(have_multiple ? elements[0] : elements, _ref => {
|
|
585
|
+
let {
|
|
586
|
+
element: element
|
|
587
|
+
} = _ref;
|
|
588
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
589
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
590
|
+
dispose();
|
|
591
|
+
});
|
|
617
592
|
});
|
|
618
593
|
});else
|
|
619
594
|
// we're already in a root so cleanups are handled
|
|
@@ -644,7 +619,7 @@ function $d5d7e58c5c9d8db0$export$9574e176201e5e8d(props) {
|
|
|
644
619
|
market_: () => props.market,
|
|
645
620
|
merchant_: () => props.merchant,
|
|
646
621
|
layout_options_: $8tj43$createMemo(() => ({
|
|
647
|
-
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(
|
|
622
|
+
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
|
|
648
623
|
...grid_spacing_override()
|
|
649
624
|
}))
|
|
650
625
|
}));
|
|
@@ -764,7 +739,7 @@ function $b432b11321ad4c97$export$9756467d34d91cdb(props) {
|
|
|
764
739
|
market_: () => props.market,
|
|
765
740
|
merchant_: () => props.merchant,
|
|
766
741
|
layout_options_: $8tj43$createMemo(() => ({
|
|
767
|
-
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(
|
|
742
|
+
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
|
|
768
743
|
...grid_spacing_override()
|
|
769
744
|
}))
|
|
770
745
|
}));
|
|
@@ -10782,6 +10757,38 @@ function $37e8c97bb6876197$export$828dcdd425fd3231(aligner) {
|
|
|
10782
10757
|
cleanup: cleanup
|
|
10783
10758
|
};
|
|
10784
10759
|
}
|
|
10760
|
+
|
|
10761
|
+
/**
|
|
10762
|
+
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
10763
|
+
*/
|
|
10764
|
+
function $3f7203368ad0d3ca$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
10765
|
+
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
10766
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
10767
|
+
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
10768
|
+
let [cols, max_width] = _ref;
|
|
10769
|
+
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
10770
|
+
}).sort((_ref2, _ref3) => {
|
|
10771
|
+
let [, a] = _ref2;
|
|
10772
|
+
let [, b] = _ref3;
|
|
10773
|
+
return a - b;
|
|
10774
|
+
});
|
|
10775
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
10776
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
10777
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
10778
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
10779
|
+
const to_delete = [];
|
|
10780
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
10781
|
+
const [, max_width] = sorted_sizes[i];
|
|
10782
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
10783
|
+
to_delete.push(i);
|
|
10784
|
+
}
|
|
10785
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
10786
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
10787
|
+
return sorted_sizes.map(_ref4 => {
|
|
10788
|
+
let [cols, max_width] = _ref4;
|
|
10789
|
+
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
10790
|
+
});
|
|
10791
|
+
}
|
|
10785
10792
|
const $eb064bc3350276c1$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class="depict plp search"></div>`, 2);
|
|
10786
10793
|
function $eb064bc3350276c1$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
10787
10794
|
$eb064bc3350276c1$var$_checkPrivateRedeclaration(obj, privateMap);
|
package/latest/index.cjs
CHANGED
|
@@ -61,7 +61,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
|
|
|
61
61
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
62
62
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
63
63
|
/*! Depict.ai search and product listing SDK */
|
|
64
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.
|
|
64
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.8";
|
|
65
65
|
|
|
66
66
|
/** @jsxImportSource solid-js */
|
|
67
67
|
|
|
@@ -112,29 +112,8 @@ const $4e04be41243c3d80$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
112
112
|
});
|
|
113
113
|
return $4e04be41243c3d80$var$transform_elements(sorted_cols_at_size);
|
|
114
114
|
};
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
118
|
-
*/
|
|
119
|
-
function $ab7c6c7911bae2f5$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_for_more_than_one_column = 500) {
|
|
120
|
-
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
121
|
-
const sorted_sizes = sdk_cols_at_size.map(([cols, max_width]) => [cols, max_width ?? Infinity]).sort(([, a], [, b]) => a - b);
|
|
122
|
-
const [[, smallest_max_width]] = sorted_sizes;
|
|
123
|
-
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
124
|
-
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
125
|
-
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
126
|
-
const to_delete = [];
|
|
127
|
-
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
128
|
-
const [, max_width] = sorted_sizes[i];
|
|
129
|
-
if (max_width > min_width_for_more_than_one_column) continue;
|
|
130
|
-
to_delete.push(i);
|
|
131
|
-
}
|
|
132
|
-
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
133
|
-
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
134
|
-
return sorted_sizes.map(([cols, max_width]) => max_width == Infinity ? [cols] : [cols, max_width]);
|
|
135
|
-
}
|
|
136
115
|
function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
137
|
-
const text = "Please try setting `
|
|
116
|
+
const text = "Please try setting `columnsAtSize` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `ColsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
138
117
|
return (0, $gVhhF$solidjsweb.isServer) ? {
|
|
139
118
|
t: `<!-- ${text} -->`
|
|
140
119
|
} : document.createComment(text);
|
|
@@ -621,7 +600,13 @@ function $95837413165cc2df$export$23fca46f3143581f(component, error_message) {
|
|
|
621
600
|
return component_in_error_boundary(elements => {
|
|
622
601
|
const have_multiple = Array.isArray(elements);
|
|
623
602
|
if (have_multiple ? !elements?.length : !elements) return;
|
|
624
|
-
(0, $gVhhF$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements,
|
|
603
|
+
(0, $gVhhF$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements, ({
|
|
604
|
+
element: element
|
|
605
|
+
}) => {
|
|
606
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
607
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
608
|
+
dispose();
|
|
609
|
+
});
|
|
625
610
|
});
|
|
626
611
|
});else
|
|
627
612
|
// we're already in a root so cleanups are handled
|
|
@@ -650,7 +635,7 @@ function $72f96c4782db0b1b$export$9574e176201e5e8d(props) {
|
|
|
650
635
|
market_: () => props.market,
|
|
651
636
|
merchant_: () => props.merchant,
|
|
652
637
|
layout_options_: $gVhhF$solidjs.createMemo(() => ({
|
|
653
|
-
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(
|
|
638
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
654
639
|
...grid_spacing_override()
|
|
655
640
|
}))
|
|
656
641
|
}));
|
|
@@ -763,7 +748,7 @@ function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
|
|
|
763
748
|
market_: () => props.market,
|
|
764
749
|
merchant_: () => props.merchant,
|
|
765
750
|
layout_options_: $gVhhF$solidjs.createMemo(() => ({
|
|
766
|
-
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(
|
|
751
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
767
752
|
...grid_spacing_override()
|
|
768
753
|
}))
|
|
769
754
|
}));
|
|
@@ -10088,6 +10073,27 @@ function $d8e94ea381ab57fa$export$828dcdd425fd3231(aligner) {
|
|
|
10088
10073
|
cleanup: cleanup
|
|
10089
10074
|
};
|
|
10090
10075
|
}
|
|
10076
|
+
|
|
10077
|
+
/**
|
|
10078
|
+
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
10079
|
+
*/
|
|
10080
|
+
function $ab7c6c7911bae2f5$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_for_more_than_one_column = 500) {
|
|
10081
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
10082
|
+
const sorted_sizes = sdk_cols_at_size.map(([cols, max_width]) => [cols, max_width ?? Infinity]).sort(([, a], [, b]) => a - b);
|
|
10083
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
10084
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
10085
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
10086
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
10087
|
+
const to_delete = [];
|
|
10088
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
10089
|
+
const [, max_width] = sorted_sizes[i];
|
|
10090
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
10091
|
+
to_delete.push(i);
|
|
10092
|
+
}
|
|
10093
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
10094
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
10095
|
+
return sorted_sizes.map(([cols, max_width]) => max_width == Infinity ? [cols] : [cols, max_width]);
|
|
10096
|
+
}
|
|
10091
10097
|
const $2c61e4cd8229c49a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict plp search"></div>`, 2);
|
|
10092
10098
|
// We just pass page_url_creator to DepictAPI when we instantiate it, so don't allow it to be specified if api is already specified
|
|
10093
10099
|
/**
|
package/latest/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/
|
|
|
7
7
|
import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
|
|
8
8
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
9
9
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
10
|
-
export const version = "2.0.
|
|
10
|
+
export const version = "2.0.8";
|
|
11
11
|
/**
|
|
12
12
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
13
13
|
*/
|
package/latest/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { template as $9HbP8$template, getNextElement as $9HbP8$getNextElement, i
|
|
|
5
5
|
/*! Depict.ai search and product listing SDK */
|
|
6
6
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
7
7
|
register_es_version("ui", "latest");
|
|
8
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "2.0.
|
|
8
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "2.0.8";
|
|
9
9
|
|
|
10
10
|
/** @jsxImportSource solid-js */
|
|
11
11
|
|
|
@@ -56,29 +56,8 @@ const $b5cccc8ee7d24677$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
56
56
|
});
|
|
57
57
|
return $b5cccc8ee7d24677$var$transform_elements(sorted_cols_at_size);
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
62
|
-
*/
|
|
63
|
-
function $1848f7cca286fbab$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_for_more_than_one_column = 500) {
|
|
64
|
-
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
65
|
-
const sorted_sizes = sdk_cols_at_size.map(([cols, max_width]) => [cols, max_width ?? Infinity]).sort(([, a], [, b]) => a - b);
|
|
66
|
-
const [[, smallest_max_width]] = sorted_sizes;
|
|
67
|
-
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
68
|
-
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
69
|
-
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
70
|
-
const to_delete = [];
|
|
71
|
-
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
72
|
-
const [, max_width] = sorted_sizes[i];
|
|
73
|
-
if (max_width > min_width_for_more_than_one_column) continue;
|
|
74
|
-
to_delete.push(i);
|
|
75
|
-
}
|
|
76
|
-
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
77
|
-
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
78
|
-
return sorted_sizes.map(([cols, max_width]) => max_width == Infinity ? [cols] : [cols, max_width]);
|
|
79
|
-
}
|
|
80
59
|
function $a458486f22b22f63$export$a2cc176055f8f08() {
|
|
81
|
-
const text = "Please try setting `
|
|
60
|
+
const text = "Please try setting `columnsAtSize` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `ColsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
82
61
|
return (0, $9HbP8$isServer) ? {
|
|
83
62
|
t: `<!-- ${text} -->`
|
|
84
63
|
} : document.createComment(text);
|
|
@@ -565,7 +544,13 @@ function $16b52438165aafe2$export$23fca46f3143581f(component, error_message) {
|
|
|
565
544
|
return component_in_error_boundary(elements => {
|
|
566
545
|
const have_multiple = Array.isArray(elements);
|
|
567
546
|
if (have_multiple ? !elements?.length : !elements) return;
|
|
568
|
-
(0, $9HbP8$observer).onremoved(have_multiple ? elements[0] : elements,
|
|
547
|
+
(0, $9HbP8$observer).onremoved(have_multiple ? elements[0] : elements, ({
|
|
548
|
+
element: element
|
|
549
|
+
}) => {
|
|
550
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
551
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
552
|
+
dispose();
|
|
553
|
+
});
|
|
569
554
|
});
|
|
570
555
|
});else
|
|
571
556
|
// we're already in a root so cleanups are handled
|
|
@@ -594,7 +579,7 @@ function $ee116da074deb002$export$9574e176201e5e8d(props) {
|
|
|
594
579
|
market_: () => props.market,
|
|
595
580
|
merchant_: () => props.merchant,
|
|
596
581
|
layout_options_: $9HbP8$createMemo(() => ({
|
|
597
|
-
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(
|
|
582
|
+
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.cols_at_size),
|
|
598
583
|
...grid_spacing_override()
|
|
599
584
|
}))
|
|
600
585
|
}));
|
|
@@ -707,7 +692,7 @@ function $9ea5383493360761$export$9756467d34d91cdb(props) {
|
|
|
707
692
|
market_: () => props.market,
|
|
708
693
|
merchant_: () => props.merchant,
|
|
709
694
|
layout_options_: $9HbP8$createMemo(() => ({
|
|
710
|
-
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(
|
|
695
|
+
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.cols_at_size),
|
|
711
696
|
...grid_spacing_override()
|
|
712
697
|
}))
|
|
713
698
|
}));
|
|
@@ -10032,6 +10017,27 @@ function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
|
10032
10017
|
cleanup: cleanup
|
|
10033
10018
|
};
|
|
10034
10019
|
}
|
|
10020
|
+
|
|
10021
|
+
/**
|
|
10022
|
+
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
10023
|
+
*/
|
|
10024
|
+
function $1848f7cca286fbab$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_for_more_than_one_column = 500) {
|
|
10025
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
10026
|
+
const sorted_sizes = sdk_cols_at_size.map(([cols, max_width]) => [cols, max_width ?? Infinity]).sort(([, a], [, b]) => a - b);
|
|
10027
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
10028
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
10029
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
10030
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
10031
|
+
const to_delete = [];
|
|
10032
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
10033
|
+
const [, max_width] = sorted_sizes[i];
|
|
10034
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
10035
|
+
to_delete.push(i);
|
|
10036
|
+
}
|
|
10037
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
10038
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
10039
|
+
return sorted_sizes.map(([cols, max_width]) => max_width == Infinity ? [cols] : [cols, max_width]);
|
|
10040
|
+
}
|
|
10035
10041
|
const $806c97b931758897$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class="depict plp search"></div>`, 2);
|
|
10036
10042
|
// We just pass page_url_creator to DepictAPI when we instantiate it, so don't allow it to be specified if api is already specified
|
|
10037
10043
|
/**
|