@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/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.9";
|
|
65
65
|
|
|
66
66
|
/** @jsxImportSource solid-js */
|
|
67
67
|
|
|
@@ -113,7 +113,7 @@ const $4e04be41243c3d80$export$6daf8749b65a1b77 = cols_at_size => {
|
|
|
113
113
|
return $4e04be41243c3d80$var$transform_elements(sorted_cols_at_size);
|
|
114
114
|
};
|
|
115
115
|
function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
116
|
-
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.";
|
|
117
117
|
return (0, $5vyXB$solidjsweb.isServer) ? {
|
|
118
118
|
t: `<!-- ${text} -->`
|
|
119
119
|
} : document.createComment(text);
|
|
@@ -238,6 +238,7 @@ function $a73063cc642f3e5f$export$7f8bd308237ab5a5(get_displays_) {
|
|
|
238
238
|
});
|
|
239
239
|
return displays_by_key_;
|
|
240
240
|
}
|
|
241
|
+
const $a73063cc642f3e5f$var$result_ids = ["search_result_id", "product_listing_result_id", "recommendation_id"];
|
|
241
242
|
function $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
242
243
|
displays_by_key_: displays_by_key_,
|
|
243
244
|
merchant_: merchant_,
|
|
@@ -251,17 +252,24 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
|
251
252
|
},
|
|
252
253
|
children: (product_id, index) => {
|
|
253
254
|
const owner = $5vyXB$solidjs.getOwner();
|
|
254
|
-
const display_accessor = $5vyXB$solidjs.createMemo(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
const display_accessor = $5vyXB$solidjs.createMemo(prev => {
|
|
256
|
+
const new_display = displays_by_key_().get(product_id);
|
|
257
|
+
if (prev && $a73063cc642f3e5f$var$deep_equal(prev, new_display))
|
|
258
|
+
// 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.
|
|
259
|
+
// This doesn't work if people mutate the displays from within the template but we hope they don't
|
|
260
|
+
// (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)
|
|
261
|
+
return prev;
|
|
262
|
+
return new_display;
|
|
263
|
+
});
|
|
264
|
+
const [product_card_resource] = $5vyXB$solidjs.createResource(() => [merchant_(), market_(), display_accessor()],
|
|
265
|
+
// re-render when the reference to the display object changes or the merchant or market changes
|
|
266
|
+
// (We don't want to re-render if nothing has changed)
|
|
267
|
+
([merchant, market, display]) => {
|
|
259
268
|
// get display in the function that re-runs when merchant or market have changed, since the display may have changed but product_id not
|
|
260
269
|
return product_card_template_(display, {
|
|
261
270
|
set_on_index_change: fn => $5vyXB$solidjs.runWithOwner(owner, () => $5vyXB$solidjs.createEffect(() => fn(index()))),
|
|
262
|
-
merchant:
|
|
263
|
-
|
|
264
|
-
market: $5vyXB$solidjs.untrack(market_) // recommendation_grid can provide a sneaky undefined here just FYI
|
|
271
|
+
merchant: merchant,
|
|
272
|
+
market: market // recommendation_grid can provide a sneaky undefined here just FYI
|
|
265
273
|
});
|
|
266
274
|
});
|
|
267
275
|
|
|
@@ -276,15 +284,13 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
|
276
284
|
elements.push(element);
|
|
277
285
|
// Add tracking ids
|
|
278
286
|
if (!(element instanceof HTMLElement)) continue; // Apparently only HTMLElements have dataset
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
} = display;
|
|
287
|
-
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;
|
|
287
|
+
for (let i = 0; i < $a73063cc642f3e5f$var$result_ids.length; i++) {
|
|
288
|
+
const id = $a73063cc642f3e5f$var$result_ids[i];
|
|
289
|
+
const value = display[id];
|
|
290
|
+
if (value) Object.assign(element.dataset, $5vyXB$depictaiutilishared.camelCasifyObject({
|
|
291
|
+
[id]: value
|
|
292
|
+
}));
|
|
293
|
+
}
|
|
288
294
|
}
|
|
289
295
|
do_per_elements_?.(elements, index);
|
|
290
296
|
});
|
|
@@ -292,6 +298,23 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
|
292
298
|
}
|
|
293
299
|
});
|
|
294
300
|
}
|
|
301
|
+
// Source: https://dmitripavlutin.com/how-to-compare-objects-in-javascript/
|
|
302
|
+
function $a73063cc642f3e5f$var$deep_equal(object1, object2) {
|
|
303
|
+
const keys1 = Object.keys(object1);
|
|
304
|
+
const keys2 = Object.keys(object2);
|
|
305
|
+
if (keys1.length !== keys2.length) return false;
|
|
306
|
+
for (const key of keys1) {
|
|
307
|
+
if ($a73063cc642f3e5f$var$result_ids.includes(key)) continue; // ignore result ids that change per response
|
|
308
|
+
const val1 = object1[key];
|
|
309
|
+
const val2 = object2[key];
|
|
310
|
+
const areObjects = $a73063cc642f3e5f$var$is_object(val1) && $a73063cc642f3e5f$var$is_object(val2);
|
|
311
|
+
if (areObjects && !$a73063cc642f3e5f$var$deep_equal(val1, val2) || !areObjects && val1 !== val2) return false;
|
|
312
|
+
}
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
function $a73063cc642f3e5f$var$is_object(object) {
|
|
316
|
+
return object != null && typeof object === "object";
|
|
317
|
+
}
|
|
295
318
|
|
|
296
319
|
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
297
320
|
class $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 extends Error {}
|
|
@@ -550,7 +573,13 @@ function $95837413165cc2df$export$23fca46f3143581f(component, error_message) {
|
|
|
550
573
|
return component_in_error_boundary(elements => {
|
|
551
574
|
const have_multiple = Array.isArray(elements);
|
|
552
575
|
if (have_multiple ? !elements?.length : !elements) return;
|
|
553
|
-
(0, $5vyXB$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements,
|
|
576
|
+
(0, $5vyXB$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements, ({
|
|
577
|
+
element: element
|
|
578
|
+
}) => {
|
|
579
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
580
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
581
|
+
dispose();
|
|
582
|
+
});
|
|
554
583
|
});
|
|
555
584
|
});else
|
|
556
585
|
// we're already in a root so cleanups are handled
|
|
@@ -594,44 +623,43 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
|
594
623
|
}) {
|
|
595
624
|
const is_showing_something = $5vyXB$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
|
|
596
625
|
const num_placeholders_ = () => 20;
|
|
597
|
-
|
|
598
|
-
get
|
|
599
|
-
return
|
|
626
|
+
const elements = $5vyXB$solidjsweb.ssr($b8e79813f4f7ebe4$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape($fc23d7668ae0011d$export$a2cc176055f8f08()), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), $5vyXB$solidjsweb.mergeProps({
|
|
627
|
+
get rows() {
|
|
628
|
+
return rows_object_();
|
|
600
629
|
},
|
|
630
|
+
layout: "grid",
|
|
631
|
+
element_attributes: {
|
|
632
|
+
class: "cards"
|
|
633
|
+
}
|
|
634
|
+
}, layout_options_, {
|
|
601
635
|
get children() {
|
|
602
|
-
return $5vyXB$solidjsweb.
|
|
603
|
-
get
|
|
604
|
-
return
|
|
636
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Suspense), {
|
|
637
|
+
get fallback() {
|
|
638
|
+
return $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
639
|
+
num_placeholders_: num_placeholders_,
|
|
640
|
+
product_card_template_: product_card_template_
|
|
641
|
+
});
|
|
605
642
|
},
|
|
606
|
-
layout: "grid",
|
|
607
|
-
element_attributes: {
|
|
608
|
-
class: "cards"
|
|
609
|
-
}
|
|
610
|
-
}, layout_options_, {
|
|
611
643
|
get children() {
|
|
612
|
-
return
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
623
|
-
return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
624
|
-
displays_by_key_: displays_by_key_,
|
|
625
|
-
merchant_: merchant_,
|
|
626
|
-
market_: market_,
|
|
627
|
-
product_card_template_: product_card_template_
|
|
628
|
-
});
|
|
629
|
-
})();
|
|
630
|
-
}
|
|
631
|
-
});
|
|
644
|
+
return (() => {
|
|
645
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
646
|
+
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
647
|
+
return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
648
|
+
displays_by_key_: displays_by_key_,
|
|
649
|
+
merchant_: merchant_,
|
|
650
|
+
market_: market_,
|
|
651
|
+
product_card_template_: product_card_template_
|
|
652
|
+
});
|
|
653
|
+
})();
|
|
632
654
|
}
|
|
633
|
-
})
|
|
655
|
+
});
|
|
634
656
|
}
|
|
657
|
+
}))));
|
|
658
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
659
|
+
get when() {
|
|
660
|
+
return is_showing_something();
|
|
661
|
+
},
|
|
662
|
+
children: elements
|
|
635
663
|
});
|
|
636
664
|
}
|
|
637
665
|
const $1f8dbf7e28b3eff2$var$_tmpl$ = ["<button", ' class="show-more major" type="button">', "</button>"],
|
|
@@ -3430,7 +3458,7 @@ function $ac167f6af6a48fc3$export$a1fd619a4743ca08({
|
|
|
3430
3458
|
const [get_extra_displays, set_extra_displays_] = $5vyXB$solidjs.createSignal([], {
|
|
3431
3459
|
equals: false
|
|
3432
3460
|
});
|
|
3433
|
-
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(() => [...plp_results_()
|
|
3461
|
+
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(() => [...(plp_results_()?.displays || []), ...get_extra_displays()]));
|
|
3434
3462
|
const percentage_in_view_ = $4117463e2939f5f4$export$63dd0350f8559dda({
|
|
3435
3463
|
get_last_result_in_viewport_: get_last_result_in_viewport_,
|
|
3436
3464
|
displays_by_key_: displays_by_key_,
|
|
@@ -3543,18 +3571,18 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
3543
3571
|
layout_options_: layout_options_,
|
|
3544
3572
|
sort_or_filter_open_: sort_or_filter_open_
|
|
3545
3573
|
});
|
|
3546
|
-
$5vyXB$solidjs.createComputed(() => {
|
|
3547
|
-
if (!is_loading_()) return;
|
|
3548
|
-
set_should_have_placeholders_rendered(true);
|
|
3549
|
-
set_suspense_is_blocked(false);
|
|
3550
|
-
is_just_after_plp_results_update = true;
|
|
3551
|
-
});
|
|
3552
3574
|
const block_suspense_if_needed = () => {
|
|
3553
3575
|
if (!is_just_after_plp_results_update) return;
|
|
3554
3576
|
is_just_after_plp_results_update = false;
|
|
3555
3577
|
fallback_is_alive = false;
|
|
3556
3578
|
set_suspense_is_blocked(true);
|
|
3557
3579
|
};
|
|
3580
|
+
$5vyXB$solidjs.createComputed(() => {
|
|
3581
|
+
if (!is_loading_()) return;
|
|
3582
|
+
set_should_have_placeholders_rendered(true);
|
|
3583
|
+
set_suspense_is_blocked(false);
|
|
3584
|
+
is_just_after_plp_results_update = true;
|
|
3585
|
+
});
|
|
3558
3586
|
$5vyXB$solidjs.createEffect($5vyXB$solidjs.on(plp_results_, () => {
|
|
3559
3587
|
if (!fallback_is_alive) {
|
|
3560
3588
|
// 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
|
|
@@ -3564,6 +3592,48 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
3564
3592
|
}, {
|
|
3565
3593
|
defer: true
|
|
3566
3594
|
}));
|
|
3595
|
+
/*
|
|
3596
|
+
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)
|
|
3597
|
+
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
3598
|
+
(For the whole idea of the displays being cached to work we can't tear down and re-run ProductCards for every new result.
|
|
3599
|
+
We have to keep ProductCards alive, but hidden, and feed them new data as soon as we had it)
|
|
3600
|
+
*/
|
|
3601
|
+
const product_cards_when_data = $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Suspense), {
|
|
3602
|
+
get fallback() {
|
|
3603
|
+
return (() => {
|
|
3604
|
+
fallback_is_alive = true;
|
|
3605
|
+
$5vyXB$solidjs.onCleanup(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
3606
|
+
return $5vyXB$solidjs.createMemo(() => {
|
|
3607
|
+
// 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
|
|
3608
|
+
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
3609
|
+
if (get_suspense_is_blocked()) return suspense_contents;
|
|
3610
|
+
set_should_have_placeholders_rendered(true); // just in case
|
|
3611
|
+
$5vyXB$solidjs.onCleanup(() => set_should_have_placeholders_rendered(false));
|
|
3612
|
+
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>
|
|
3613
|
+
});
|
|
3614
|
+
})();
|
|
3615
|
+
},
|
|
3616
|
+
|
|
3617
|
+
get children() {
|
|
3618
|
+
return (() => {
|
|
3619
|
+
suspense_contents = $ac167f6af6a48fc3$export$a1fd619a4743ca08({
|
|
3620
|
+
product_card_template_: product_card_template_,
|
|
3621
|
+
plp_results_: plp_results_,
|
|
3622
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
3623
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
3624
|
+
market_: market_,
|
|
3625
|
+
merchant_: merchant_,
|
|
3626
|
+
all_products_loaded_: all_products_loaded_,
|
|
3627
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
3628
|
+
query_base_: query_base_,
|
|
3629
|
+
depict_api_: depict_api_,
|
|
3630
|
+
is_loading_: is_loading_
|
|
3631
|
+
});
|
|
3632
|
+
$5vyXB$solidjs.onCleanup(() => suspense_contents = undefined);
|
|
3633
|
+
return suspense_contents;
|
|
3634
|
+
})();
|
|
3635
|
+
}
|
|
3636
|
+
});
|
|
3567
3637
|
return [$fc23d7668ae0011d$export$a2cc176055f8f08(), $5vyXB$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), {
|
|
3568
3638
|
get cols_at_size() {
|
|
3569
3639
|
return modified_cols_at_size();
|
|
@@ -3587,44 +3657,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
|
|
|
3587
3657
|
get fallback() {
|
|
3588
3658
|
return rendered_placeholders();
|
|
3589
3659
|
},
|
|
3590
|
-
|
|
3591
|
-
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Suspense), {
|
|
3592
|
-
get fallback() {
|
|
3593
|
-
return (() => {
|
|
3594
|
-
fallback_is_alive = true;
|
|
3595
|
-
$5vyXB$solidjs.onCleanup(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
3596
|
-
return $5vyXB$solidjs.createMemo(() => {
|
|
3597
|
-
// 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
|
|
3598
|
-
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
3599
|
-
if (get_suspense_is_blocked()) return suspense_contents;
|
|
3600
|
-
set_should_have_placeholders_rendered(true); // just in case
|
|
3601
|
-
$5vyXB$solidjs.onCleanup(() => set_should_have_placeholders_rendered(false));
|
|
3602
|
-
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>
|
|
3603
|
-
});
|
|
3604
|
-
})();
|
|
3605
|
-
},
|
|
3606
|
-
|
|
3607
|
-
get children() {
|
|
3608
|
-
return (() => {
|
|
3609
|
-
suspense_contents = $ac167f6af6a48fc3$export$a1fd619a4743ca08({
|
|
3610
|
-
product_card_template_: product_card_template_,
|
|
3611
|
-
plp_results_: plp_results_,
|
|
3612
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
3613
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
3614
|
-
market_: market_,
|
|
3615
|
-
merchant_: merchant_,
|
|
3616
|
-
all_products_loaded_: all_products_loaded_,
|
|
3617
|
-
min_products_to_fetch_: min_products_to_fetch_,
|
|
3618
|
-
query_base_: query_base_,
|
|
3619
|
-
depict_api_: depict_api_,
|
|
3620
|
-
is_loading_: is_loading_
|
|
3621
|
-
});
|
|
3622
|
-
$5vyXB$solidjs.onCleanup(() => suspense_contents = undefined);
|
|
3623
|
-
return suspense_contents;
|
|
3624
|
-
})();
|
|
3625
|
-
}
|
|
3626
|
-
});
|
|
3627
|
-
}
|
|
3660
|
+
children: product_cards_when_data
|
|
3628
3661
|
});
|
|
3629
3662
|
}
|
|
3630
3663
|
})];
|
|
@@ -6071,49 +6104,50 @@ function $fb29c6201c369e39$export$7de92c4c2205ebf3({
|
|
|
6071
6104
|
product_card_template_: product_card_template_,
|
|
6072
6105
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
6073
6106
|
view_more_button_ = true,
|
|
6074
|
-
layout_options_: layout_options_
|
|
6107
|
+
layout_options_: layout_options_,
|
|
6108
|
+
all_products_loaded_: all_products_loaded_
|
|
6075
6109
|
}) {
|
|
6076
6110
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6077
6111
|
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6078
6112
|
const [recommendations_resource] = $5vyXB$solidjs.createResource(search_query_base_, query => depict_api_.get_recommended(query).then(r => r.displays));
|
|
6079
6113
|
const is_showing_something = $5vyXB$solidjs.createMemo(() => recommendations_resource.loading || recommendations_resource()?.length);
|
|
6080
6114
|
const num_placeholders_ = $5vyXB$solidjs.createMemo(() => (0, $aec24316ed262dc0$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_().cols_at_size.map(([per_column]) => per_column)));
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6115
|
+
// Don't tear down elements every time one updates the page - don't put them within <Show>
|
|
6116
|
+
const elements = $5vyXB$solidjsweb.ssr($fb29c6201c369e39$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(i18n_.search_recs_title_()), $5vyXB$solidjsweb.escape($fc23d7668ae0011d$export$a2cc176055f8f08()), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $f48d0fbb00835aaa$export$d21e32dfedac04be), $5vyXB$solidjsweb.mergeProps({
|
|
6117
|
+
rows: rows_object,
|
|
6118
|
+
layout: "grid",
|
|
6119
|
+
element_attributes: {
|
|
6120
|
+
class: "cards"
|
|
6121
|
+
}
|
|
6122
|
+
}, layout_options_, {
|
|
6085
6123
|
get children() {
|
|
6086
|
-
return $5vyXB$solidjsweb.
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
}
|
|
6092
|
-
}, layout_options_, {
|
|
6093
|
-
get children() {
|
|
6094
|
-
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Suspense), {
|
|
6095
|
-
get fallback() {
|
|
6096
|
-
return $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
6097
|
-
num_placeholders_: num_placeholders_,
|
|
6098
|
-
product_card_template_: product_card_template_
|
|
6099
|
-
});
|
|
6100
|
-
},
|
|
6101
|
-
get children() {
|
|
6102
|
-
return (() => {
|
|
6103
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6104
|
-
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(() => recommendations_resource() || []));
|
|
6105
|
-
return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
6106
|
-
displays_by_key_: displays_by_key_,
|
|
6107
|
-
merchant_: $5vyXB$solidjs.createMemo(() => search_query_base_().tenant),
|
|
6108
|
-
market_: $5vyXB$solidjs.createMemo(() => search_query_base_().market),
|
|
6109
|
-
product_card_template_: product_card_template_
|
|
6110
|
-
});
|
|
6111
|
-
})();
|
|
6112
|
-
}
|
|
6124
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Suspense), {
|
|
6125
|
+
get fallback() {
|
|
6126
|
+
return $0caf87eaa19079da$export$f33414a4df0afd3f({
|
|
6127
|
+
num_placeholders_: num_placeholders_,
|
|
6128
|
+
product_card_template_: product_card_template_
|
|
6113
6129
|
});
|
|
6130
|
+
},
|
|
6131
|
+
get children() {
|
|
6132
|
+
return (() => {
|
|
6133
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6134
|
+
const displays_by_key_ = $a73063cc642f3e5f$export$7f8bd308237ab5a5($5vyXB$solidjs.createMemo(() => recommendations_resource() || []));
|
|
6135
|
+
return $a73063cc642f3e5f$export$43f0fb951fcb0c54({
|
|
6136
|
+
displays_by_key_: displays_by_key_,
|
|
6137
|
+
merchant_: $5vyXB$solidjs.createMemo(() => search_query_base_().tenant),
|
|
6138
|
+
market_: $5vyXB$solidjs.createMemo(() => search_query_base_().market),
|
|
6139
|
+
product_card_template_: product_card_template_
|
|
6140
|
+
});
|
|
6141
|
+
})();
|
|
6114
6142
|
}
|
|
6115
|
-
})
|
|
6143
|
+
});
|
|
6116
6144
|
}
|
|
6145
|
+
}))));
|
|
6146
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
6147
|
+
get when() {
|
|
6148
|
+
return is_showing_something() && all_products_loaded_();
|
|
6149
|
+
},
|
|
6150
|
+
children: elements
|
|
6117
6151
|
});
|
|
6118
6152
|
}
|
|
6119
6153
|
function $fb29c6201c369e39$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
|
|
@@ -8102,9 +8136,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
8102
8136
|
});
|
|
8103
8137
|
}
|
|
8104
8138
|
})), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
8105
|
-
|
|
8106
|
-
return get_all_products_loaded() && !disable_search_recommendations_;
|
|
8107
|
-
},
|
|
8139
|
+
when: !disable_search_recommendations_,
|
|
8108
8140
|
keyed: false,
|
|
8109
8141
|
get children() {
|
|
8110
8142
|
return $5vyXB$solidjsweb.createComponent((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
@@ -8120,7 +8152,8 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
|
|
|
8120
8152
|
},
|
|
8121
8153
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8122
8154
|
view_more_button_: search_recs_view_more_,
|
|
8123
|
-
product_card_template_: product_card_template_
|
|
8155
|
+
product_card_template_: product_card_template_,
|
|
8156
|
+
all_products_loaded_: get_all_products_loaded
|
|
8124
8157
|
});
|
|
8125
8158
|
}
|
|
8126
8159
|
});
|
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.9";
|
|
11
11
|
/**
|
|
12
12
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
13
13
|
*/
|