@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.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",
|
package/server/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, $3hooq$solidjsweb.isServer) ? {
|
|
161
129
|
t: "<!-- ".concat(text, " -->")
|
|
162
130
|
} : document.createComment(text);
|
|
@@ -613,7 +581,14 @@ function $d05611ff6b8c8357$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, $3hooq$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements,
|
|
584
|
+
(0, $3hooq$depictaiutilishared.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
|
|
@@ -642,7 +617,7 @@ function $2badc30d7c6610e1$export$9574e176201e5e8d(props) {
|
|
|
642
617
|
market_: () => props.market,
|
|
643
618
|
merchant_: () => props.merchant,
|
|
644
619
|
layout_options_: $3hooq$solidjs.createMemo(() => ({
|
|
645
|
-
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(
|
|
620
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
646
621
|
...grid_spacing_override()
|
|
647
622
|
}))
|
|
648
623
|
})));
|
|
@@ -747,7 +722,7 @@ function $41227f10ad680afd$export$9756467d34d91cdb(props) {
|
|
|
747
722
|
market_: () => props.market,
|
|
748
723
|
merchant_: () => props.merchant,
|
|
749
724
|
layout_options_: $3hooq$solidjs.createMemo(() => ({
|
|
750
|
-
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(
|
|
725
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
751
726
|
...grid_spacing_override()
|
|
752
727
|
}))
|
|
753
728
|
})));
|
|
@@ -8880,6 +8855,38 @@ function $98bd00c15a2e3159$export$828dcdd425fd3231(aligner) {
|
|
|
8880
8855
|
cleanup: cleanup
|
|
8881
8856
|
};
|
|
8882
8857
|
}
|
|
8858
|
+
|
|
8859
|
+
/**
|
|
8860
|
+
* 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
|
|
8861
|
+
*/
|
|
8862
|
+
function $b1ea8d47bcf03111$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
8863
|
+
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
8864
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
8865
|
+
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
8866
|
+
let [cols, max_width] = _ref;
|
|
8867
|
+
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
8868
|
+
}).sort((_ref2, _ref3) => {
|
|
8869
|
+
let [, a] = _ref2;
|
|
8870
|
+
let [, b] = _ref3;
|
|
8871
|
+
return a - b;
|
|
8872
|
+
});
|
|
8873
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
8874
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
8875
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
8876
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
8877
|
+
const to_delete = [];
|
|
8878
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
8879
|
+
const [, max_width] = sorted_sizes[i];
|
|
8880
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
8881
|
+
to_delete.push(i);
|
|
8882
|
+
}
|
|
8883
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
8884
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
8885
|
+
return sorted_sizes.map(_ref4 => {
|
|
8886
|
+
let [cols, max_width] = _ref4;
|
|
8887
|
+
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
8888
|
+
});
|
|
8889
|
+
}
|
|
8883
8890
|
const $ddd39c5f36f49703$var$_tmpl$ = ["<div", ' class="depict plp search">', "</div>"];
|
|
8884
8891
|
function $ddd39c5f36f49703$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
8885
8892
|
$ddd39c5f36f49703$var$_checkPrivateRedeclaration(obj, privateMap);
|
package/server/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/server/ES10/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import $b8hua$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, $b8hua$isServer) ? {
|
|
102
70
|
t: "<!-- ".concat(text, " -->")
|
|
103
71
|
} : document.createComment(text);
|
|
@@ -554,7 +522,14 @@ function $83e8cf2c0b87a58a$export$23fca46f3143581f(component, error_message) {
|
|
|
554
522
|
return component_in_error_boundary(elements => {
|
|
555
523
|
const have_multiple = Array.isArray(elements);
|
|
556
524
|
if (have_multiple ? !(elements !== null && elements !== void 0 && elements.length) : !elements) return;
|
|
557
|
-
(0, $b8hua$observer).onremoved(have_multiple ? elements[0] : elements,
|
|
525
|
+
(0, $b8hua$observer).onremoved(have_multiple ? elements[0] : elements, _ref => {
|
|
526
|
+
let {
|
|
527
|
+
element: element
|
|
528
|
+
} = _ref;
|
|
529
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
530
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
531
|
+
dispose();
|
|
532
|
+
});
|
|
558
533
|
});
|
|
559
534
|
});else
|
|
560
535
|
// we're already in a root so cleanups are handled
|
|
@@ -583,7 +558,7 @@ function $d5d7e58c5c9d8db0$export$9574e176201e5e8d(props) {
|
|
|
583
558
|
market_: () => props.market,
|
|
584
559
|
merchant_: () => props.merchant,
|
|
585
560
|
layout_options_: $b8hua$createMemo(() => ({
|
|
586
|
-
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(
|
|
561
|
+
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
|
|
587
562
|
...grid_spacing_override()
|
|
588
563
|
}))
|
|
589
564
|
})));
|
|
@@ -688,7 +663,7 @@ function $b432b11321ad4c97$export$9756467d34d91cdb(props) {
|
|
|
688
663
|
market_: () => props.market,
|
|
689
664
|
merchant_: () => props.merchant,
|
|
690
665
|
layout_options_: $b8hua$createMemo(() => ({
|
|
691
|
-
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(
|
|
666
|
+
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
|
|
692
667
|
...grid_spacing_override()
|
|
693
668
|
}))
|
|
694
669
|
})));
|
|
@@ -8821,6 +8796,38 @@ function $37e8c97bb6876197$export$828dcdd425fd3231(aligner) {
|
|
|
8821
8796
|
cleanup: cleanup
|
|
8822
8797
|
};
|
|
8823
8798
|
}
|
|
8799
|
+
|
|
8800
|
+
/**
|
|
8801
|
+
* 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
|
|
8802
|
+
*/
|
|
8803
|
+
function $3f7203368ad0d3ca$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
8804
|
+
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
8805
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
8806
|
+
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
8807
|
+
let [cols, max_width] = _ref;
|
|
8808
|
+
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
8809
|
+
}).sort((_ref2, _ref3) => {
|
|
8810
|
+
let [, a] = _ref2;
|
|
8811
|
+
let [, b] = _ref3;
|
|
8812
|
+
return a - b;
|
|
8813
|
+
});
|
|
8814
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
8815
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
8816
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
8817
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
8818
|
+
const to_delete = [];
|
|
8819
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
8820
|
+
const [, max_width] = sorted_sizes[i];
|
|
8821
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
8822
|
+
to_delete.push(i);
|
|
8823
|
+
}
|
|
8824
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
8825
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
8826
|
+
return sorted_sizes.map(_ref4 => {
|
|
8827
|
+
let [cols, max_width] = _ref4;
|
|
8828
|
+
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
8829
|
+
});
|
|
8830
|
+
}
|
|
8824
8831
|
const $eb064bc3350276c1$var$_tmpl$ = ["<div", ' class="depict plp search">', "</div>"];
|
|
8825
8832
|
function $eb064bc3350276c1$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
8826
8833
|
$eb064bc3350276c1$var$_checkPrivateRedeclaration(obj, privateMap);
|
package/server/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, $5vyXB$solidjsweb.isServer) ? {
|
|
139
118
|
t: `<!-- ${text} -->`
|
|
140
119
|
} : document.createComment(text);
|
|
@@ -571,7 +550,13 @@ function $95837413165cc2df$export$23fca46f3143581f(component, error_message) {
|
|
|
571
550
|
return component_in_error_boundary(elements => {
|
|
572
551
|
const have_multiple = Array.isArray(elements);
|
|
573
552
|
if (have_multiple ? !elements?.length : !elements) return;
|
|
574
|
-
(0, $5vyXB$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements,
|
|
553
|
+
(0, $5vyXB$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements, ({
|
|
554
|
+
element: element
|
|
555
|
+
}) => {
|
|
556
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
557
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
558
|
+
dispose();
|
|
559
|
+
});
|
|
575
560
|
});
|
|
576
561
|
});else
|
|
577
562
|
// we're already in a root so cleanups are handled
|
|
@@ -598,7 +583,7 @@ function $72f96c4782db0b1b$export$9574e176201e5e8d(props) {
|
|
|
598
583
|
market_: () => props.market,
|
|
599
584
|
merchant_: () => props.merchant,
|
|
600
585
|
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
601
|
-
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(
|
|
586
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
602
587
|
...grid_spacing_override()
|
|
603
588
|
}))
|
|
604
589
|
})));
|
|
@@ -696,7 +681,7 @@ function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
|
|
|
696
681
|
market_: () => props.market,
|
|
697
682
|
merchant_: () => props.merchant,
|
|
698
683
|
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
699
|
-
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(
|
|
684
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
700
685
|
...grid_spacing_override()
|
|
701
686
|
}))
|
|
702
687
|
})));
|
|
@@ -8192,6 +8177,27 @@ function $d8e94ea381ab57fa$export$828dcdd425fd3231(aligner) {
|
|
|
8192
8177
|
cleanup: cleanup
|
|
8193
8178
|
};
|
|
8194
8179
|
}
|
|
8180
|
+
|
|
8181
|
+
/**
|
|
8182
|
+
* 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
|
|
8183
|
+
*/
|
|
8184
|
+
function $ab7c6c7911bae2f5$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_for_more_than_one_column = 500) {
|
|
8185
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
8186
|
+
const sorted_sizes = sdk_cols_at_size.map(([cols, max_width]) => [cols, max_width ?? Infinity]).sort(([, a], [, b]) => a - b);
|
|
8187
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
8188
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
8189
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
8190
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
8191
|
+
const to_delete = [];
|
|
8192
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
8193
|
+
const [, max_width] = sorted_sizes[i];
|
|
8194
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
8195
|
+
to_delete.push(i);
|
|
8196
|
+
}
|
|
8197
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
8198
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
8199
|
+
return sorted_sizes.map(([cols, max_width]) => max_width == Infinity ? [cols] : [cols, max_width]);
|
|
8200
|
+
}
|
|
8195
8201
|
const $2c61e4cd8229c49a$var$_tmpl$ = ["<div", ' class="depict plp search">', "</div>"];
|
|
8196
8202
|
// 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
|
|
8197
8203
|
/**
|
package/server/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/server/latest/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, escape as
|
|
|
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, $i7OB2$isServer) ? {
|
|
83
62
|
t: `<!-- ${text} -->`
|
|
84
63
|
} : document.createComment(text);
|
|
@@ -515,7 +494,13 @@ function $16b52438165aafe2$export$23fca46f3143581f(component, error_message) {
|
|
|
515
494
|
return component_in_error_boundary(elements => {
|
|
516
495
|
const have_multiple = Array.isArray(elements);
|
|
517
496
|
if (have_multiple ? !elements?.length : !elements) return;
|
|
518
|
-
(0, $i7OB2$observer).onremoved(have_multiple ? elements[0] : elements,
|
|
497
|
+
(0, $i7OB2$observer).onremoved(have_multiple ? elements[0] : elements, ({
|
|
498
|
+
element: element
|
|
499
|
+
}) => {
|
|
500
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
501
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
502
|
+
dispose();
|
|
503
|
+
});
|
|
519
504
|
});
|
|
520
505
|
});else
|
|
521
506
|
// we're already in a root so cleanups are handled
|
|
@@ -542,7 +527,7 @@ function $ee116da074deb002$export$9574e176201e5e8d(props) {
|
|
|
542
527
|
market_: () => props.market,
|
|
543
528
|
merchant_: () => props.merchant,
|
|
544
529
|
layout_options_: $i7OB2$createMemo(() => ({
|
|
545
|
-
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(
|
|
530
|
+
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.cols_at_size),
|
|
546
531
|
...grid_spacing_override()
|
|
547
532
|
}))
|
|
548
533
|
})));
|
|
@@ -640,7 +625,7 @@ function $9ea5383493360761$export$9756467d34d91cdb(props) {
|
|
|
640
625
|
market_: () => props.market,
|
|
641
626
|
merchant_: () => props.merchant,
|
|
642
627
|
layout_options_: $i7OB2$createMemo(() => ({
|
|
643
|
-
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(
|
|
628
|
+
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.cols_at_size),
|
|
644
629
|
...grid_spacing_override()
|
|
645
630
|
}))
|
|
646
631
|
})));
|
|
@@ -8136,6 +8121,27 @@ function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
|
8136
8121
|
cleanup: cleanup
|
|
8137
8122
|
};
|
|
8138
8123
|
}
|
|
8124
|
+
|
|
8125
|
+
/**
|
|
8126
|
+
* 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
|
|
8127
|
+
*/
|
|
8128
|
+
function $1848f7cca286fbab$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_for_more_than_one_column = 500) {
|
|
8129
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
8130
|
+
const sorted_sizes = sdk_cols_at_size.map(([cols, max_width]) => [cols, max_width ?? Infinity]).sort(([, a], [, b]) => a - b);
|
|
8131
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
8132
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
8133
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
8134
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
8135
|
+
const to_delete = [];
|
|
8136
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
8137
|
+
const [, max_width] = sorted_sizes[i];
|
|
8138
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
8139
|
+
to_delete.push(i);
|
|
8140
|
+
}
|
|
8141
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
8142
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
8143
|
+
return sorted_sizes.map(([cols, max_width]) => max_width == Infinity ? [cols] : [cols, max_width]);
|
|
8144
|
+
}
|
|
8139
8145
|
const $806c97b931758897$var$_tmpl$ = ["<div", ' class="depict plp search">', "</div>"];
|
|
8140
8146
|
// 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
|
|
8141
8147
|
/**
|