@depict-ai/ui 2.0.7 → 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 +195 -153
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +197 -155
- package/latest/index.cjs +190 -153
- package/latest/index.d.ts +1 -1
- package/latest/index.js +192 -155
- package/package.json +1 -1
- package/server/ES10/index.cjs +172 -134
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +174 -136
- package/server/latest/index.cjs +167 -134
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +169 -136
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
|
|
|
@@ -124,7 +124,7 @@ const $5401a6698b0c0658$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
124
124
|
return $5401a6698b0c0658$var$transform_elements(sorted_cols_at_size);
|
|
125
125
|
};
|
|
126
126
|
function $8edd3cf30d1fd8b4$export$a2cc176055f8f08() {
|
|
127
|
-
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.";
|
|
128
128
|
return (0, $3hooq$solidjsweb.isServer) ? {
|
|
129
129
|
t: "<!-- ".concat(text, " -->")
|
|
130
130
|
} : document.createComment(text);
|
|
@@ -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 {}
|
|
@@ -581,7 +605,14 @@ function $d05611ff6b8c8357$export$23fca46f3143581f(component, error_message) {
|
|
|
581
605
|
return component_in_error_boundary(elements => {
|
|
582
606
|
const have_multiple = Array.isArray(elements);
|
|
583
607
|
if (have_multiple ? !(elements !== null && elements !== void 0 && elements.length) : !elements) return;
|
|
584
|
-
(0, $3hooq$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements,
|
|
608
|
+
(0, $3hooq$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements, _ref => {
|
|
609
|
+
let {
|
|
610
|
+
element: element
|
|
611
|
+
} = _ref;
|
|
612
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
613
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
614
|
+
dispose();
|
|
615
|
+
});
|
|
585
616
|
});
|
|
586
617
|
});else
|
|
587
618
|
// we're already in a root so cleanups are handled
|
|
@@ -631,44 +662,43 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
631
662
|
return recommendations_resource_.loading || ((_recommendations_reso = recommendations_resource_()) === null || _recommendations_reso === void 0 ? void 0 : _recommendations_reso.length);
|
|
632
663
|
});
|
|
633
664
|
const num_placeholders_ = () => 20;
|
|
634
|
-
|
|
635
|
-
get
|
|
636
|
-
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_();
|
|
637
668
|
},
|
|
669
|
+
layout: "grid",
|
|
670
|
+
element_attributes: {
|
|
671
|
+
class: "cards"
|
|
672
|
+
}
|
|
673
|
+
}, layout_options_, {
|
|
638
674
|
get children() {
|
|
639
|
-
return $3hooq$solidjsweb.
|
|
640
|
-
get
|
|
641
|
-
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
|
+
});
|
|
642
681
|
},
|
|
643
|
-
layout: "grid",
|
|
644
|
-
element_attributes: {
|
|
645
|
-
class: "cards"
|
|
646
|
-
}
|
|
647
|
-
}, layout_options_, {
|
|
648
682
|
get children() {
|
|
649
|
-
return
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
660
|
-
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
661
|
-
displays_by_key_: displays_by_key_,
|
|
662
|
-
merchant_: merchant_,
|
|
663
|
-
market_: market_,
|
|
664
|
-
product_card_template_: product_card_template_
|
|
665
|
-
});
|
|
666
|
-
})();
|
|
667
|
-
}
|
|
668
|
-
});
|
|
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
|
+
})();
|
|
669
693
|
}
|
|
670
|
-
})
|
|
694
|
+
});
|
|
671
695
|
}
|
|
696
|
+
}))));
|
|
697
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
698
|
+
get when() {
|
|
699
|
+
return is_showing_something();
|
|
700
|
+
},
|
|
701
|
+
children: elements
|
|
672
702
|
});
|
|
673
703
|
}
|
|
674
704
|
const $41227f10ad680afd$var$_tmpl$ = ["<button", ' class="show-more major" type="button">', "</button>"],
|
|
@@ -3712,7 +3742,10 @@ function $0d3ee7000f047e67$export$a1fd619a4743ca08(_ref) {
|
|
|
3712
3742
|
const [get_extra_displays, set_extra_displays_] = $3hooq$solidjs.createSignal([], {
|
|
3713
3743
|
equals: false
|
|
3714
3744
|
});
|
|
3715
|
-
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
|
+
}));
|
|
3716
3749
|
const percentage_in_view_ = $45c16e404a883f74$export$63dd0350f8559dda({
|
|
3717
3750
|
get_last_result_in_viewport_: get_last_result_in_viewport_,
|
|
3718
3751
|
displays_by_key_: displays_by_key_,
|
|
@@ -3832,18 +3865,18 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
3832
3865
|
layout_options_: layout_options_,
|
|
3833
3866
|
sort_or_filter_open_: sort_or_filter_open_
|
|
3834
3867
|
});
|
|
3835
|
-
$3hooq$solidjs.createComputed(() => {
|
|
3836
|
-
if (!is_loading_()) return;
|
|
3837
|
-
set_should_have_placeholders_rendered(true);
|
|
3838
|
-
set_suspense_is_blocked(false);
|
|
3839
|
-
is_just_after_plp_results_update = true;
|
|
3840
|
-
});
|
|
3841
3868
|
const block_suspense_if_needed = () => {
|
|
3842
3869
|
if (!is_just_after_plp_results_update) return;
|
|
3843
3870
|
is_just_after_plp_results_update = false;
|
|
3844
3871
|
fallback_is_alive = false;
|
|
3845
3872
|
set_suspense_is_blocked(true);
|
|
3846
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
|
+
});
|
|
3847
3880
|
$3hooq$solidjs.createEffect($3hooq$solidjs.on(plp_results_, () => {
|
|
3848
3881
|
if (!fallback_is_alive) {
|
|
3849
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
|
|
@@ -3853,6 +3886,48 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
3853
3886
|
}, {
|
|
3854
3887
|
defer: true
|
|
3855
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
|
+
});
|
|
3856
3931
|
return [$8edd3cf30d1fd8b4$export$a2cc176055f8f08(), $3hooq$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), {
|
|
3857
3932
|
get cols_at_size() {
|
|
3858
3933
|
return modified_cols_at_size();
|
|
@@ -3876,44 +3951,7 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
3876
3951
|
get fallback() {
|
|
3877
3952
|
return rendered_placeholders();
|
|
3878
3953
|
},
|
|
3879
|
-
|
|
3880
|
-
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
|
|
3881
|
-
get fallback() {
|
|
3882
|
-
return (() => {
|
|
3883
|
-
fallback_is_alive = true;
|
|
3884
|
-
$3hooq$solidjs.onCleanup(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
3885
|
-
return $3hooq$solidjs.createMemo(() => {
|
|
3886
|
-
// 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
|
|
3887
|
-
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
3888
|
-
if (get_suspense_is_blocked()) return suspense_contents;
|
|
3889
|
-
set_should_have_placeholders_rendered(true); // just in case
|
|
3890
|
-
$3hooq$solidjs.onCleanup(() => set_should_have_placeholders_rendered(false));
|
|
3891
|
-
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>
|
|
3892
|
-
});
|
|
3893
|
-
})();
|
|
3894
|
-
},
|
|
3895
|
-
|
|
3896
|
-
get children() {
|
|
3897
|
-
return (() => {
|
|
3898
|
-
suspense_contents = $0d3ee7000f047e67$export$a1fd619a4743ca08({
|
|
3899
|
-
product_card_template_: product_card_template_,
|
|
3900
|
-
plp_results_: plp_results_,
|
|
3901
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
3902
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
3903
|
-
market_: market_,
|
|
3904
|
-
merchant_: merchant_,
|
|
3905
|
-
all_products_loaded_: all_products_loaded_,
|
|
3906
|
-
min_products_to_fetch_: min_products_to_fetch_,
|
|
3907
|
-
query_base_: query_base_,
|
|
3908
|
-
depict_api_: depict_api_,
|
|
3909
|
-
is_loading_: is_loading_
|
|
3910
|
-
});
|
|
3911
|
-
$3hooq$solidjs.onCleanup(() => suspense_contents = undefined);
|
|
3912
|
-
return suspense_contents;
|
|
3913
|
-
})();
|
|
3914
|
-
}
|
|
3915
|
-
});
|
|
3916
|
-
}
|
|
3954
|
+
children: product_cards_when_data
|
|
3917
3955
|
});
|
|
3918
3956
|
}
|
|
3919
3957
|
})];
|
|
@@ -6603,7 +6641,8 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
6603
6641
|
product_card_template_: product_card_template_,
|
|
6604
6642
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
6605
6643
|
view_more_button_ = true,
|
|
6606
|
-
layout_options_: layout_options_
|
|
6644
|
+
layout_options_: layout_options_,
|
|
6645
|
+
all_products_loaded_: all_products_loaded_
|
|
6607
6646
|
} = _ref;
|
|
6608
6647
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6609
6648
|
const rows_object = view_more_button_ ? $c77adcdf5346b187$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
@@ -6616,42 +6655,42 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
6616
6655
|
let [per_column] = _ref2;
|
|
6617
6656
|
return per_column;
|
|
6618
6657
|
})));
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
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_, {
|
|
6623
6666
|
get children() {
|
|
6624
|
-
return $3hooq$solidjsweb.
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
}
|
|
6630
|
-
}, layout_options_, {
|
|
6631
|
-
get children() {
|
|
6632
|
-
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Suspense), {
|
|
6633
|
-
get fallback() {
|
|
6634
|
-
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
6635
|
-
num_placeholders_: num_placeholders_,
|
|
6636
|
-
product_card_template_: product_card_template_
|
|
6637
|
-
});
|
|
6638
|
-
},
|
|
6639
|
-
get children() {
|
|
6640
|
-
return (() => {
|
|
6641
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6642
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($3hooq$solidjs.createMemo(() => recommendations_resource() || []));
|
|
6643
|
-
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
6644
|
-
displays_by_key_: displays_by_key_,
|
|
6645
|
-
merchant_: $3hooq$solidjs.createMemo(() => search_query_base_().tenant),
|
|
6646
|
-
market_: $3hooq$solidjs.createMemo(() => search_query_base_().market),
|
|
6647
|
-
product_card_template_: product_card_template_
|
|
6648
|
-
});
|
|
6649
|
-
})();
|
|
6650
|
-
}
|
|
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_
|
|
6651
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
|
+
})();
|
|
6652
6685
|
}
|
|
6653
|
-
})
|
|
6686
|
+
});
|
|
6654
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
|
|
6655
6694
|
});
|
|
6656
6695
|
}
|
|
6657
6696
|
function $c77adcdf5346b187$var$make_state_saved_rows(_ref3, i18n_) {
|
|
@@ -8773,9 +8812,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
8773
8812
|
});
|
|
8774
8813
|
}
|
|
8775
8814
|
})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
8776
|
-
|
|
8777
|
-
return get_all_products_loaded() && !disable_search_recommendations_;
|
|
8778
|
-
},
|
|
8815
|
+
when: !disable_search_recommendations_,
|
|
8779
8816
|
keyed: false,
|
|
8780
8817
|
get children() {
|
|
8781
8818
|
return $3hooq$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
@@ -8794,7 +8831,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
8794
8831
|
},
|
|
8795
8832
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8796
8833
|
view_more_button_: search_recs_view_more_,
|
|
8797
|
-
product_card_template_: product_card_template_
|
|
8834
|
+
product_card_template_: product_card_template_,
|
|
8835
|
+
all_products_loaded_: get_all_products_loaded
|
|
8798
8836
|
});
|
|
8799
8837
|
}
|
|
8800
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
|
*/
|