@depict-ai/ui 2.0.8 → 2.0.9
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 +186 -151
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +188 -153
- package/latest/index.cjs +182 -151
- package/latest/index.d.ts +1 -1
- package/latest/index.js +184 -153
- package/package.json +1 -1
- package/server/ES10/index.cjs +163 -132
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +165 -134
- package/server/latest/index.cjs +159 -132
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +161 -134
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.9";
|
|
71
71
|
|
|
72
72
|
/** @jsxImportSource solid-js */
|
|
73
73
|
|
|
@@ -255,6 +255,7 @@ function $76012c4468a53d1f$export$7f8bd308237ab5a5(get_displays_) {
|
|
|
255
255
|
});
|
|
256
256
|
return displays_by_key_;
|
|
257
257
|
}
|
|
258
|
+
const $76012c4468a53d1f$var$result_ids = ["search_result_id", "product_listing_result_id", "recommendation_id"];
|
|
258
259
|
function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
|
|
259
260
|
let {
|
|
260
261
|
displays_by_key_: displays_by_key_,
|
|
@@ -269,17 +270,25 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
|
|
|
269
270
|
},
|
|
270
271
|
children: (product_id, index) => {
|
|
271
272
|
const owner = $3hooq$solidjs.getOwner();
|
|
272
|
-
const display_accessor = $3hooq$solidjs.createMemo(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
const display_accessor = $3hooq$solidjs.createMemo(prev => {
|
|
274
|
+
const new_display = displays_by_key_().get(product_id);
|
|
275
|
+
if (prev && $76012c4468a53d1f$var$deep_equal(prev, new_display))
|
|
276
|
+
// If displays are identical, they haven't changed due to merchant/market changing OR we made a new query and the displays are the same. Return the old display (same object reference) to avoid re-rendering.
|
|
277
|
+
// This doesn't work if people mutate the displays from within the template but we hope they don't
|
|
278
|
+
// (We can't know if the display changing is due to merchant/market changing or a new query otherwise and don't want to run into https://gitlab.com/depict-ai/depict.ai/-/merge_requests/6890/diffs)
|
|
279
|
+
return prev;
|
|
280
|
+
return new_display;
|
|
281
|
+
});
|
|
282
|
+
const [product_card_resource] = $3hooq$solidjs.createResource(() => [merchant_(), market_(), display_accessor()],
|
|
283
|
+
// re-render when the reference to the display object changes or the merchant or market changes
|
|
284
|
+
// (We don't want to re-render if nothing has changed)
|
|
285
|
+
_ref2 => {
|
|
286
|
+
let [merchant, market, display] = _ref2;
|
|
277
287
|
// get display in the function that re-runs when merchant or market have changed, since the display may have changed but product_id not
|
|
278
288
|
return product_card_template_(display, {
|
|
279
289
|
set_on_index_change: fn => $3hooq$solidjs.runWithOwner(owner, () => $3hooq$solidjs.createEffect(() => fn(index()))),
|
|
280
|
-
merchant:
|
|
281
|
-
|
|
282
|
-
market: $3hooq$solidjs.untrack(market_) // recommendation_grid can provide a sneaky undefined here just FYI
|
|
290
|
+
merchant: merchant,
|
|
291
|
+
market: market // recommendation_grid can provide a sneaky undefined here just FYI
|
|
283
292
|
});
|
|
284
293
|
});
|
|
285
294
|
|
|
@@ -294,15 +303,13 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
|
|
|
294
303
|
elements.push(element);
|
|
295
304
|
// Add tracking ids
|
|
296
305
|
if (!(element instanceof HTMLElement)) continue; // Apparently only HTMLElements have dataset
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
} = display;
|
|
305
|
-
if (search_result_id) dataset.searchResultId = search_result_id;else if (product_listing_result_id) dataset.productListingResultId = product_listing_result_id;else if (recommendation_id) dataset.recommendationId = recommendation_id;
|
|
306
|
+
for (let i = 0; i < $76012c4468a53d1f$var$result_ids.length; i++) {
|
|
307
|
+
const id = $76012c4468a53d1f$var$result_ids[i];
|
|
308
|
+
const value = display[id];
|
|
309
|
+
if (value) Object.assign(element.dataset, $3hooq$depictaiutilishared.camelCasifyObject({
|
|
310
|
+
[id]: value
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
306
313
|
}
|
|
307
314
|
do_per_elements_ === null || do_per_elements_ === void 0 || do_per_elements_(elements, index);
|
|
308
315
|
});
|
|
@@ -310,6 +317,23 @@ function $76012c4468a53d1f$export$43f0fb951fcb0c54(_ref) {
|
|
|
310
317
|
}
|
|
311
318
|
});
|
|
312
319
|
}
|
|
320
|
+
// Source: https://dmitripavlutin.com/how-to-compare-objects-in-javascript/
|
|
321
|
+
function $76012c4468a53d1f$var$deep_equal(object1, object2) {
|
|
322
|
+
const keys1 = Object.keys(object1);
|
|
323
|
+
const keys2 = Object.keys(object2);
|
|
324
|
+
if (keys1.length !== keys2.length) return false;
|
|
325
|
+
for (const key of keys1) {
|
|
326
|
+
if ($76012c4468a53d1f$var$result_ids.includes(key)) continue; // ignore result ids that change per response
|
|
327
|
+
const val1 = object1[key];
|
|
328
|
+
const val2 = object2[key];
|
|
329
|
+
const areObjects = $76012c4468a53d1f$var$is_object(val1) && $76012c4468a53d1f$var$is_object(val2);
|
|
330
|
+
if (areObjects && !$76012c4468a53d1f$var$deep_equal(val1, val2) || !areObjects && val1 !== val2) return false;
|
|
331
|
+
}
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
function $76012c4468a53d1f$var$is_object(object) {
|
|
335
|
+
return object != null && typeof object === "object";
|
|
336
|
+
}
|
|
313
337
|
|
|
314
338
|
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
315
339
|
class $95e4006e1dcb5b72$export$e1d52e4f0c7557a1 extends Error {}
|
|
@@ -638,44 +662,43 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
638
662
|
return recommendations_resource_.loading || ((_recommendations_reso = recommendations_resource_()) === null || _recommendations_reso === void 0 ? void 0 : _recommendations_reso.length);
|
|
639
663
|
});
|
|
640
664
|
const num_placeholders_ = () => 20;
|
|
641
|
-
|
|
642
|
-
get
|
|
643
|
-
return
|
|
665
|
+
const elements = $3hooq$solidjsweb.ssr($2c920813c92d6987$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($8edd3cf30d1fd8b4$export$a2cc176055f8f08()), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), $3hooq$solidjsweb.mergeProps({
|
|
666
|
+
get rows() {
|
|
667
|
+
return rows_object_();
|
|
644
668
|
},
|
|
669
|
+
layout: "grid",
|
|
670
|
+
element_attributes: {
|
|
671
|
+
class: "cards"
|
|
672
|
+
}
|
|
673
|
+
}, layout_options_, {
|
|
645
674
|
get children() {
|
|
646
|
-
return $3hooq$solidjsweb.
|
|
647
|
-
get
|
|
648
|
-
return
|
|
675
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
|
|
676
|
+
get fallback() {
|
|
677
|
+
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
678
|
+
num_placeholders_: num_placeholders_,
|
|
679
|
+
product_card_template_: product_card_template_
|
|
680
|
+
});
|
|
649
681
|
},
|
|
650
|
-
layout: "grid",
|
|
651
|
-
element_attributes: {
|
|
652
|
-
class: "cards"
|
|
653
|
-
}
|
|
654
|
-
}, layout_options_, {
|
|
655
682
|
get children() {
|
|
656
|
-
return
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
667
|
-
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
668
|
-
displays_by_key_: displays_by_key_,
|
|
669
|
-
merchant_: merchant_,
|
|
670
|
-
market_: market_,
|
|
671
|
-
product_card_template_: product_card_template_
|
|
672
|
-
});
|
|
673
|
-
})();
|
|
674
|
-
}
|
|
675
|
-
});
|
|
683
|
+
return (() => {
|
|
684
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
685
|
+
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
686
|
+
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
687
|
+
displays_by_key_: displays_by_key_,
|
|
688
|
+
merchant_: merchant_,
|
|
689
|
+
market_: market_,
|
|
690
|
+
product_card_template_: product_card_template_
|
|
691
|
+
});
|
|
692
|
+
})();
|
|
676
693
|
}
|
|
677
|
-
})
|
|
694
|
+
});
|
|
678
695
|
}
|
|
696
|
+
}))));
|
|
697
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
698
|
+
get when() {
|
|
699
|
+
return is_showing_something();
|
|
700
|
+
},
|
|
701
|
+
children: elements
|
|
679
702
|
});
|
|
680
703
|
}
|
|
681
704
|
const $41227f10ad680afd$var$_tmpl$ = ["<button", ' class="show-more major" type="button">', "</button>"],
|
|
@@ -3719,7 +3742,10 @@ function $0d3ee7000f047e67$export$a1fd619a4743ca08(_ref) {
|
|
|
3719
3742
|
const [get_extra_displays, set_extra_displays_] = $3hooq$solidjs.createSignal([], {
|
|
3720
3743
|
equals: false
|
|
3721
3744
|
});
|
|
3722
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(() =>
|
|
3745
|
+
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(() => {
|
|
3746
|
+
var _plp_results_;
|
|
3747
|
+
return [...(((_plp_results_ = plp_results_()) === null || _plp_results_ === void 0 ? void 0 : _plp_results_.displays) || []), ...get_extra_displays()];
|
|
3748
|
+
}));
|
|
3723
3749
|
const percentage_in_view_ = $45c16e404a883f74$export$63dd0350f8559dda({
|
|
3724
3750
|
get_last_result_in_viewport_: get_last_result_in_viewport_,
|
|
3725
3751
|
displays_by_key_: displays_by_key_,
|
|
@@ -3839,18 +3865,18 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
3839
3865
|
layout_options_: layout_options_,
|
|
3840
3866
|
sort_or_filter_open_: sort_or_filter_open_
|
|
3841
3867
|
});
|
|
3842
|
-
$3hooq$solidjs.createComputed(() => {
|
|
3843
|
-
if (!is_loading_()) return;
|
|
3844
|
-
set_should_have_placeholders_rendered(true);
|
|
3845
|
-
set_suspense_is_blocked(false);
|
|
3846
|
-
is_just_after_plp_results_update = true;
|
|
3847
|
-
});
|
|
3848
3868
|
const block_suspense_if_needed = () => {
|
|
3849
3869
|
if (!is_just_after_plp_results_update) return;
|
|
3850
3870
|
is_just_after_plp_results_update = false;
|
|
3851
3871
|
fallback_is_alive = false;
|
|
3852
3872
|
set_suspense_is_blocked(true);
|
|
3853
3873
|
};
|
|
3874
|
+
$3hooq$solidjs.createComputed(() => {
|
|
3875
|
+
if (!is_loading_()) return;
|
|
3876
|
+
set_should_have_placeholders_rendered(true);
|
|
3877
|
+
set_suspense_is_blocked(false);
|
|
3878
|
+
is_just_after_plp_results_update = true;
|
|
3879
|
+
});
|
|
3854
3880
|
$3hooq$solidjs.createEffect($3hooq$solidjs.on(plp_results_, () => {
|
|
3855
3881
|
if (!fallback_is_alive) {
|
|
3856
3882
|
// if all product card rendering functions after the initial rendering are synchronous the suspense boundary will never go into the fallback, so we don't know when they have finished rendering, and we can't block the suspense. Therefore, we're just doing it with this effect
|
|
@@ -3860,6 +3886,48 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
3860
3886
|
}, {
|
|
3861
3887
|
defer: true
|
|
3862
3888
|
}));
|
|
3889
|
+
/*
|
|
3890
|
+
This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
|
|
3891
|
+
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
3892
|
+
(For the whole idea of the displays being cached to work we can't tear down and re-run ProductCards for every new result.
|
|
3893
|
+
We have to keep ProductCards alive, but hidden, and feed them new data as soon as we had it)
|
|
3894
|
+
*/
|
|
3895
|
+
const product_cards_when_data = $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
|
|
3896
|
+
get fallback() {
|
|
3897
|
+
return (() => {
|
|
3898
|
+
fallback_is_alive = true;
|
|
3899
|
+
$3hooq$solidjs.onCleanup(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
3900
|
+
return $3hooq$solidjs.createMemo(() => {
|
|
3901
|
+
// We need to be able to block the suspense since when async product cards are *rendering* we want to show the placeholders on initial load but not when loading more
|
|
3902
|
+
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
3903
|
+
if (get_suspense_is_blocked()) return suspense_contents;
|
|
3904
|
+
set_should_have_placeholders_rendered(true); // just in case
|
|
3905
|
+
$3hooq$solidjs.onCleanup(() => set_should_have_placeholders_rendered(false));
|
|
3906
|
+
return rendered_placeholders; // I lifted the placeholders into the memo since we don't want to re-render them when switching from <Show> to <Suspense>
|
|
3907
|
+
});
|
|
3908
|
+
})();
|
|
3909
|
+
},
|
|
3910
|
+
|
|
3911
|
+
get children() {
|
|
3912
|
+
return (() => {
|
|
3913
|
+
suspense_contents = $0d3ee7000f047e67$export$a1fd619a4743ca08({
|
|
3914
|
+
product_card_template_: product_card_template_,
|
|
3915
|
+
plp_results_: plp_results_,
|
|
3916
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
3917
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
3918
|
+
market_: market_,
|
|
3919
|
+
merchant_: merchant_,
|
|
3920
|
+
all_products_loaded_: all_products_loaded_,
|
|
3921
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
3922
|
+
query_base_: query_base_,
|
|
3923
|
+
depict_api_: depict_api_,
|
|
3924
|
+
is_loading_: is_loading_
|
|
3925
|
+
});
|
|
3926
|
+
$3hooq$solidjs.onCleanup(() => suspense_contents = undefined);
|
|
3927
|
+
return suspense_contents;
|
|
3928
|
+
})();
|
|
3929
|
+
}
|
|
3930
|
+
});
|
|
3863
3931
|
return [$8edd3cf30d1fd8b4$export$a2cc176055f8f08(), $3hooq$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), {
|
|
3864
3932
|
get cols_at_size() {
|
|
3865
3933
|
return modified_cols_at_size();
|
|
@@ -3883,44 +3951,7 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
3883
3951
|
get fallback() {
|
|
3884
3952
|
return rendered_placeholders();
|
|
3885
3953
|
},
|
|
3886
|
-
|
|
3887
|
-
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
|
|
3888
|
-
get fallback() {
|
|
3889
|
-
return (() => {
|
|
3890
|
-
fallback_is_alive = true;
|
|
3891
|
-
$3hooq$solidjs.onCleanup(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
3892
|
-
return $3hooq$solidjs.createMemo(() => {
|
|
3893
|
-
// We need to be able to block the suspense since when async product cards are *rendering* we want to show the placeholders on initial load but not when loading more
|
|
3894
|
-
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
3895
|
-
if (get_suspense_is_blocked()) return suspense_contents;
|
|
3896
|
-
set_should_have_placeholders_rendered(true); // just in case
|
|
3897
|
-
$3hooq$solidjs.onCleanup(() => set_should_have_placeholders_rendered(false));
|
|
3898
|
-
return rendered_placeholders; // I lifted the placeholders into the memo since we don't want to re-render them when switching from <Show> to <Suspense>
|
|
3899
|
-
});
|
|
3900
|
-
})();
|
|
3901
|
-
},
|
|
3902
|
-
|
|
3903
|
-
get children() {
|
|
3904
|
-
return (() => {
|
|
3905
|
-
suspense_contents = $0d3ee7000f047e67$export$a1fd619a4743ca08({
|
|
3906
|
-
product_card_template_: product_card_template_,
|
|
3907
|
-
plp_results_: plp_results_,
|
|
3908
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
3909
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
3910
|
-
market_: market_,
|
|
3911
|
-
merchant_: merchant_,
|
|
3912
|
-
all_products_loaded_: all_products_loaded_,
|
|
3913
|
-
min_products_to_fetch_: min_products_to_fetch_,
|
|
3914
|
-
query_base_: query_base_,
|
|
3915
|
-
depict_api_: depict_api_,
|
|
3916
|
-
is_loading_: is_loading_
|
|
3917
|
-
});
|
|
3918
|
-
$3hooq$solidjs.onCleanup(() => suspense_contents = undefined);
|
|
3919
|
-
return suspense_contents;
|
|
3920
|
-
})();
|
|
3921
|
-
}
|
|
3922
|
-
});
|
|
3923
|
-
}
|
|
3954
|
+
children: product_cards_when_data
|
|
3924
3955
|
});
|
|
3925
3956
|
}
|
|
3926
3957
|
})];
|
|
@@ -6610,7 +6641,8 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
6610
6641
|
product_card_template_: product_card_template_,
|
|
6611
6642
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
6612
6643
|
view_more_button_ = true,
|
|
6613
|
-
layout_options_: layout_options_
|
|
6644
|
+
layout_options_: layout_options_,
|
|
6645
|
+
all_products_loaded_: all_products_loaded_
|
|
6614
6646
|
} = _ref;
|
|
6615
6647
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6616
6648
|
const rows_object = view_more_button_ ? $c77adcdf5346b187$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
@@ -6623,42 +6655,42 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
6623
6655
|
let [per_column] = _ref2;
|
|
6624
6656
|
return per_column;
|
|
6625
6657
|
})));
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6658
|
+
// Don't tear down elements every time one updates the page - don't put them within <Show>
|
|
6659
|
+
const elements = $3hooq$solidjsweb.ssr($c77adcdf5346b187$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape(i18n_.search_recs_title_()), $3hooq$solidjsweb.escape($8edd3cf30d1fd8b4$export$a2cc176055f8f08()), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), $3hooq$solidjsweb.mergeProps({
|
|
6660
|
+
rows: rows_object,
|
|
6661
|
+
layout: "grid",
|
|
6662
|
+
element_attributes: {
|
|
6663
|
+
class: "cards"
|
|
6664
|
+
}
|
|
6665
|
+
}, layout_options_, {
|
|
6630
6666
|
get children() {
|
|
6631
|
-
return $3hooq$solidjsweb.
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
}
|
|
6637
|
-
}, layout_options_, {
|
|
6638
|
-
get children() {
|
|
6639
|
-
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
|
|
6640
|
-
get fallback() {
|
|
6641
|
-
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
6642
|
-
num_placeholders_: num_placeholders_,
|
|
6643
|
-
product_card_template_: product_card_template_
|
|
6644
|
-
});
|
|
6645
|
-
},
|
|
6646
|
-
get children() {
|
|
6647
|
-
return (() => {
|
|
6648
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6649
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(() => recommendations_resource() || []));
|
|
6650
|
-
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
6651
|
-
displays_by_key_: displays_by_key_,
|
|
6652
|
-
merchant_: $3hooq$solidjs.createMemo(() => search_query_base_().tenant),
|
|
6653
|
-
market_: $3hooq$solidjs.createMemo(() => search_query_base_().market),
|
|
6654
|
-
product_card_template_: product_card_template_
|
|
6655
|
-
});
|
|
6656
|
-
})();
|
|
6657
|
-
}
|
|
6667
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
|
|
6668
|
+
get fallback() {
|
|
6669
|
+
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
6670
|
+
num_placeholders_: num_placeholders_,
|
|
6671
|
+
product_card_template_: product_card_template_
|
|
6658
6672
|
});
|
|
6673
|
+
},
|
|
6674
|
+
get children() {
|
|
6675
|
+
return (() => {
|
|
6676
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6677
|
+
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(() => recommendations_resource() || []));
|
|
6678
|
+
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
6679
|
+
displays_by_key_: displays_by_key_,
|
|
6680
|
+
merchant_: $3hooq$solidjs.createMemo(() => search_query_base_().tenant),
|
|
6681
|
+
market_: $3hooq$solidjs.createMemo(() => search_query_base_().market),
|
|
6682
|
+
product_card_template_: product_card_template_
|
|
6683
|
+
});
|
|
6684
|
+
})();
|
|
6659
6685
|
}
|
|
6660
|
-
})
|
|
6686
|
+
});
|
|
6661
6687
|
}
|
|
6688
|
+
}))));
|
|
6689
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
6690
|
+
get when() {
|
|
6691
|
+
return is_showing_something() && all_products_loaded_();
|
|
6692
|
+
},
|
|
6693
|
+
children: elements
|
|
6662
6694
|
});
|
|
6663
6695
|
}
|
|
6664
6696
|
function $c77adcdf5346b187$var$make_state_saved_rows(_ref3, i18n_) {
|
|
@@ -8780,9 +8812,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
8780
8812
|
});
|
|
8781
8813
|
}
|
|
8782
8814
|
})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
8783
|
-
|
|
8784
|
-
return get_all_products_loaded() && !disable_search_recommendations_;
|
|
8785
|
-
},
|
|
8815
|
+
when: !disable_search_recommendations_,
|
|
8786
8816
|
keyed: false,
|
|
8787
8817
|
get children() {
|
|
8788
8818
|
return $3hooq$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
@@ -8801,7 +8831,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
8801
8831
|
},
|
|
8802
8832
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8803
8833
|
view_more_button_: search_recs_view_more_,
|
|
8804
|
-
product_card_template_: product_card_template_
|
|
8834
|
+
product_card_template_: product_card_template_,
|
|
8835
|
+
all_products_loaded_: get_all_products_loaded
|
|
8805
8836
|
});
|
|
8806
8837
|
}
|
|
8807
8838
|
});
|
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.9";
|
|
11
11
|
/**
|
|
12
12
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
13
13
|
*/
|