@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/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, $52FdA$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 = $52FdA$solidjs.getOwner();
|
|
272
|
-
const display_accessor = $52FdA$solidjs.createMemo(
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
const display_accessor = $52FdA$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] = $52FdA$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 => $52FdA$solidjs.runWithOwner(owner, () => $52FdA$solidjs.createEffect(() => fn(index()))),
|
|
280
|
-
merchant:
|
|
281
|
-
|
|
282
|
-
market: $52FdA$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, $52FdA$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 {}
|
|
@@ -640,7 +664,14 @@ function $d05611ff6b8c8357$export$23fca46f3143581f(component, error_message) {
|
|
|
640
664
|
return component_in_error_boundary(elements => {
|
|
641
665
|
const have_multiple = Array.isArray(elements);
|
|
642
666
|
if (have_multiple ? !(elements !== null && elements !== void 0 && elements.length) : !elements) return;
|
|
643
|
-
(0, $52FdA$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements,
|
|
667
|
+
(0, $52FdA$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements, _ref => {
|
|
668
|
+
let {
|
|
669
|
+
element: element
|
|
670
|
+
} = _ref;
|
|
671
|
+
if (document.documentElement.contains(element)) return; // If element has instantly been re-inserted, don't dispose
|
|
672
|
+
// See https://depictaiworkspace.slack.com/archives/C050GHEPBTR/p1695809102791259?thread_ts=1695106805.459729&cid=C050GHEPBTR
|
|
673
|
+
dispose();
|
|
674
|
+
});
|
|
644
675
|
});
|
|
645
676
|
});else
|
|
646
677
|
// we're already in a root so cleanups are handled
|
|
@@ -694,51 +725,52 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
694
725
|
return recommendations_resource_.loading || ((_recommendations_reso = recommendations_resource_()) === null || _recommendations_reso === void 0 ? void 0 : _recommendations_reso.length);
|
|
695
726
|
});
|
|
696
727
|
const num_placeholders_ = () => 20;
|
|
728
|
+
const elements = (() => {
|
|
729
|
+
const _el$ = $52FdA$solidjsweb.getNextElement($2c920813c92d6987$var$_tmpl$),
|
|
730
|
+
_el$2 = _el$.firstChild,
|
|
731
|
+
[_el$3, _co$] = $52FdA$solidjsweb.getNextMarker(_el$2.nextSibling),
|
|
732
|
+
_el$4 = _el$3.nextSibling,
|
|
733
|
+
[_el$5, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$4.nextSibling);
|
|
734
|
+
$52FdA$solidjsweb.insert(_el$, (0, $8edd3cf30d1fd8b4$export$a2cc176055f8f08), _el$3, _co$);
|
|
735
|
+
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), $52FdA$solidjsweb.mergeProps({
|
|
736
|
+
get rows() {
|
|
737
|
+
return rows_object_();
|
|
738
|
+
},
|
|
739
|
+
layout: "grid",
|
|
740
|
+
element_attributes: {
|
|
741
|
+
class: "cards"
|
|
742
|
+
}
|
|
743
|
+
}, layout_options_, {
|
|
744
|
+
get children() {
|
|
745
|
+
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Suspense), {
|
|
746
|
+
get fallback() {
|
|
747
|
+
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
748
|
+
num_placeholders_: num_placeholders_,
|
|
749
|
+
product_card_template_: product_card_template_
|
|
750
|
+
});
|
|
751
|
+
},
|
|
752
|
+
get children() {
|
|
753
|
+
return (() => {
|
|
754
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
755
|
+
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($52FdA$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
756
|
+
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
757
|
+
displays_by_key_: displays_by_key_,
|
|
758
|
+
merchant_: merchant_,
|
|
759
|
+
market_: market_,
|
|
760
|
+
product_card_template_: product_card_template_
|
|
761
|
+
});
|
|
762
|
+
})();
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
})), _el$5, _co$2);
|
|
767
|
+
return _el$;
|
|
768
|
+
})();
|
|
697
769
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
698
770
|
get when() {
|
|
699
771
|
return is_showing_something();
|
|
700
772
|
},
|
|
701
|
-
|
|
702
|
-
const _el$ = $52FdA$solidjsweb.getNextElement($2c920813c92d6987$var$_tmpl$),
|
|
703
|
-
_el$2 = _el$.firstChild,
|
|
704
|
-
[_el$3, _co$] = $52FdA$solidjsweb.getNextMarker(_el$2.nextSibling),
|
|
705
|
-
_el$4 = _el$3.nextSibling,
|
|
706
|
-
[_el$5, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$4.nextSibling);
|
|
707
|
-
$52FdA$solidjsweb.insert(_el$, (0, $8edd3cf30d1fd8b4$export$a2cc176055f8f08), _el$3, _co$);
|
|
708
|
-
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), $52FdA$solidjsweb.mergeProps({
|
|
709
|
-
get rows() {
|
|
710
|
-
return rows_object_();
|
|
711
|
-
},
|
|
712
|
-
layout: "grid",
|
|
713
|
-
element_attributes: {
|
|
714
|
-
class: "cards"
|
|
715
|
-
}
|
|
716
|
-
}, layout_options_, {
|
|
717
|
-
get children() {
|
|
718
|
-
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Suspense), {
|
|
719
|
-
get fallback() {
|
|
720
|
-
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
721
|
-
num_placeholders_: num_placeholders_,
|
|
722
|
-
product_card_template_: product_card_template_
|
|
723
|
-
});
|
|
724
|
-
},
|
|
725
|
-
get children() {
|
|
726
|
-
return (() => {
|
|
727
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
728
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($52FdA$solidjs.createMemo(() => recommendations_resource_() || []));
|
|
729
|
-
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
730
|
-
displays_by_key_: displays_by_key_,
|
|
731
|
-
merchant_: merchant_,
|
|
732
|
-
market_: market_,
|
|
733
|
-
product_card_template_: product_card_template_
|
|
734
|
-
});
|
|
735
|
-
})();
|
|
736
|
-
}
|
|
737
|
-
});
|
|
738
|
-
}
|
|
739
|
-
})), _el$5, _co$2);
|
|
740
|
-
return _el$;
|
|
741
|
-
}
|
|
773
|
+
children: elements
|
|
742
774
|
});
|
|
743
775
|
}
|
|
744
776
|
const $41227f10ad680afd$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<button class="show-more major" type="button"></button>`, 2),
|
|
@@ -4617,7 +4649,10 @@ function $0d3ee7000f047e67$export$a1fd619a4743ca08(_ref) {
|
|
|
4617
4649
|
const [get_extra_displays, set_extra_displays_] = $52FdA$solidjs.createSignal([], {
|
|
4618
4650
|
equals: false
|
|
4619
4651
|
});
|
|
4620
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($52FdA$solidjs.createMemo(() =>
|
|
4652
|
+
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($52FdA$solidjs.createMemo(() => {
|
|
4653
|
+
var _plp_results_;
|
|
4654
|
+
return [...(((_plp_results_ = plp_results_()) === null || _plp_results_ === void 0 ? void 0 : _plp_results_.displays) || []), ...get_extra_displays()];
|
|
4655
|
+
}));
|
|
4621
4656
|
const percentage_in_view_ = $45c16e404a883f74$export$63dd0350f8559dda({
|
|
4622
4657
|
get_last_result_in_viewport_: get_last_result_in_viewport_,
|
|
4623
4658
|
displays_by_key_: displays_by_key_,
|
|
@@ -4743,18 +4778,18 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
4743
4778
|
layout_options_: layout_options_,
|
|
4744
4779
|
sort_or_filter_open_: sort_or_filter_open_
|
|
4745
4780
|
});
|
|
4746
|
-
$52FdA$solidjs.createComputed(() => {
|
|
4747
|
-
if (!is_loading_()) return;
|
|
4748
|
-
set_should_have_placeholders_rendered(true);
|
|
4749
|
-
set_suspense_is_blocked(false);
|
|
4750
|
-
is_just_after_plp_results_update = true;
|
|
4751
|
-
});
|
|
4752
4781
|
const block_suspense_if_needed = () => {
|
|
4753
4782
|
if (!is_just_after_plp_results_update) return;
|
|
4754
4783
|
is_just_after_plp_results_update = false;
|
|
4755
4784
|
fallback_is_alive = false;
|
|
4756
4785
|
set_suspense_is_blocked(true);
|
|
4757
4786
|
};
|
|
4787
|
+
$52FdA$solidjs.createComputed(() => {
|
|
4788
|
+
if (!is_loading_()) return;
|
|
4789
|
+
set_should_have_placeholders_rendered(true);
|
|
4790
|
+
set_suspense_is_blocked(false);
|
|
4791
|
+
is_just_after_plp_results_update = true;
|
|
4792
|
+
});
|
|
4758
4793
|
$52FdA$solidjs.createEffect($52FdA$solidjs.on(plp_results_, () => {
|
|
4759
4794
|
if (!fallback_is_alive) {
|
|
4760
4795
|
// 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
|
|
@@ -4764,6 +4799,48 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
4764
4799
|
}, {
|
|
4765
4800
|
defer: true
|
|
4766
4801
|
}));
|
|
4802
|
+
/*
|
|
4803
|
+
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)
|
|
4804
|
+
We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
4805
|
+
(For the whole idea of the displays being cached to work we can't tear down and re-run ProductCards for every new result.
|
|
4806
|
+
We have to keep ProductCards alive, but hidden, and feed them new data as soon as we had it)
|
|
4807
|
+
*/
|
|
4808
|
+
const product_cards_when_data = $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Suspense), {
|
|
4809
|
+
get fallback() {
|
|
4810
|
+
return (() => {
|
|
4811
|
+
fallback_is_alive = true;
|
|
4812
|
+
$52FdA$solidjs.onCleanup(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
4813
|
+
return $52FdA$solidjs.createMemo(() => {
|
|
4814
|
+
// 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
|
|
4815
|
+
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
4816
|
+
if (get_suspense_is_blocked()) return suspense_contents;
|
|
4817
|
+
set_should_have_placeholders_rendered(true); // just in case
|
|
4818
|
+
$52FdA$solidjs.onCleanup(() => set_should_have_placeholders_rendered(false));
|
|
4819
|
+
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>
|
|
4820
|
+
});
|
|
4821
|
+
})();
|
|
4822
|
+
},
|
|
4823
|
+
|
|
4824
|
+
get children() {
|
|
4825
|
+
return (() => {
|
|
4826
|
+
suspense_contents = $0d3ee7000f047e67$export$a1fd619a4743ca08({
|
|
4827
|
+
product_card_template_: product_card_template_,
|
|
4828
|
+
plp_results_: plp_results_,
|
|
4829
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
4830
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
4831
|
+
market_: market_,
|
|
4832
|
+
merchant_: merchant_,
|
|
4833
|
+
all_products_loaded_: all_products_loaded_,
|
|
4834
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
4835
|
+
query_base_: query_base_,
|
|
4836
|
+
depict_api_: depict_api_,
|
|
4837
|
+
is_loading_: is_loading_
|
|
4838
|
+
});
|
|
4839
|
+
$52FdA$solidjs.onCleanup(() => suspense_contents = undefined);
|
|
4840
|
+
return suspense_contents;
|
|
4841
|
+
})();
|
|
4842
|
+
}
|
|
4843
|
+
});
|
|
4767
4844
|
return [$52FdA$solidjsweb.memo((0, $8edd3cf30d1fd8b4$export$a2cc176055f8f08)), $52FdA$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), {
|
|
4768
4845
|
get cols_at_size() {
|
|
4769
4846
|
return modified_cols_at_size();
|
|
@@ -4787,44 +4864,7 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
|
|
|
4787
4864
|
get fallback() {
|
|
4788
4865
|
return rendered_placeholders();
|
|
4789
4866
|
},
|
|
4790
|
-
|
|
4791
|
-
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Suspense), {
|
|
4792
|
-
get fallback() {
|
|
4793
|
-
return (() => {
|
|
4794
|
-
fallback_is_alive = true;
|
|
4795
|
-
$52FdA$solidjs.onCleanup(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
4796
|
-
return $52FdA$solidjs.createMemo(() => {
|
|
4797
|
-
// 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
|
|
4798
|
-
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
4799
|
-
if (get_suspense_is_blocked()) return suspense_contents;
|
|
4800
|
-
set_should_have_placeholders_rendered(true); // just in case
|
|
4801
|
-
$52FdA$solidjs.onCleanup(() => set_should_have_placeholders_rendered(false));
|
|
4802
|
-
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>
|
|
4803
|
-
});
|
|
4804
|
-
})();
|
|
4805
|
-
},
|
|
4806
|
-
|
|
4807
|
-
get children() {
|
|
4808
|
-
return (() => {
|
|
4809
|
-
suspense_contents = $0d3ee7000f047e67$export$a1fd619a4743ca08({
|
|
4810
|
-
product_card_template_: product_card_template_,
|
|
4811
|
-
plp_results_: plp_results_,
|
|
4812
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
4813
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
4814
|
-
market_: market_,
|
|
4815
|
-
merchant_: merchant_,
|
|
4816
|
-
all_products_loaded_: all_products_loaded_,
|
|
4817
|
-
min_products_to_fetch_: min_products_to_fetch_,
|
|
4818
|
-
query_base_: query_base_,
|
|
4819
|
-
depict_api_: depict_api_,
|
|
4820
|
-
is_loading_: is_loading_
|
|
4821
|
-
});
|
|
4822
|
-
$52FdA$solidjs.onCleanup(() => suspense_contents = undefined);
|
|
4823
|
-
return suspense_contents;
|
|
4824
|
-
})();
|
|
4825
|
-
}
|
|
4826
|
-
});
|
|
4827
|
-
}
|
|
4867
|
+
children: product_cards_when_data
|
|
4828
4868
|
});
|
|
4829
4869
|
}
|
|
4830
4870
|
})];
|
|
@@ -8099,7 +8139,8 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
8099
8139
|
product_card_template_: product_card_template_,
|
|
8100
8140
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8101
8141
|
view_more_button_ = true,
|
|
8102
|
-
layout_options_: layout_options_
|
|
8142
|
+
layout_options_: layout_options_,
|
|
8143
|
+
all_products_loaded_: all_products_loaded_
|
|
8103
8144
|
} = _ref;
|
|
8104
8145
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
8105
8146
|
const rows_object = view_more_button_ ? $c77adcdf5346b187$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
@@ -8112,51 +8153,53 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
8112
8153
|
let [per_column] = _ref2;
|
|
8113
8154
|
return per_column;
|
|
8114
8155
|
})));
|
|
8156
|
+
// Don't tear down elements every time one updates the page - don't put them within <Show>
|
|
8157
|
+
const elements = (() => {
|
|
8158
|
+
const _el$ = $52FdA$solidjsweb.getNextElement($c77adcdf5346b187$var$_tmpl$),
|
|
8159
|
+
_el$2 = _el$.firstChild,
|
|
8160
|
+
_el$3 = _el$2.nextSibling,
|
|
8161
|
+
[_el$4, _co$] = $52FdA$solidjsweb.getNextMarker(_el$3.nextSibling),
|
|
8162
|
+
_el$5 = _el$4.nextSibling,
|
|
8163
|
+
[_el$6, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$5.nextSibling);
|
|
8164
|
+
$52FdA$solidjsweb.insert(_el$2, () => i18n_.search_recs_title_());
|
|
8165
|
+
$52FdA$solidjsweb.insert(_el$, (0, $8edd3cf30d1fd8b4$export$a2cc176055f8f08), _el$4, _co$);
|
|
8166
|
+
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), $52FdA$solidjsweb.mergeProps({
|
|
8167
|
+
rows: rows_object,
|
|
8168
|
+
layout: "grid",
|
|
8169
|
+
element_attributes: {
|
|
8170
|
+
class: "cards"
|
|
8171
|
+
}
|
|
8172
|
+
}, layout_options_, {
|
|
8173
|
+
get children() {
|
|
8174
|
+
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Suspense), {
|
|
8175
|
+
get fallback() {
|
|
8176
|
+
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
8177
|
+
num_placeholders_: num_placeholders_,
|
|
8178
|
+
product_card_template_: product_card_template_
|
|
8179
|
+
});
|
|
8180
|
+
},
|
|
8181
|
+
get children() {
|
|
8182
|
+
return (() => {
|
|
8183
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
8184
|
+
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($52FdA$solidjs.createMemo(() => recommendations_resource() || []));
|
|
8185
|
+
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
8186
|
+
displays_by_key_: displays_by_key_,
|
|
8187
|
+
merchant_: $52FdA$solidjs.createMemo(() => search_query_base_().tenant),
|
|
8188
|
+
market_: $52FdA$solidjs.createMemo(() => search_query_base_().market),
|
|
8189
|
+
product_card_template_: product_card_template_
|
|
8190
|
+
});
|
|
8191
|
+
})();
|
|
8192
|
+
}
|
|
8193
|
+
});
|
|
8194
|
+
}
|
|
8195
|
+
})), _el$6, _co$2);
|
|
8196
|
+
return _el$;
|
|
8197
|
+
})();
|
|
8115
8198
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
8116
8199
|
get when() {
|
|
8117
|
-
return is_showing_something();
|
|
8200
|
+
return $52FdA$solidjsweb.memo(() => !!is_showing_something())() && all_products_loaded_();
|
|
8118
8201
|
},
|
|
8119
|
-
|
|
8120
|
-
const _el$ = $52FdA$solidjsweb.getNextElement($c77adcdf5346b187$var$_tmpl$),
|
|
8121
|
-
_el$2 = _el$.firstChild,
|
|
8122
|
-
_el$3 = _el$2.nextSibling,
|
|
8123
|
-
[_el$4, _co$] = $52FdA$solidjsweb.getNextMarker(_el$3.nextSibling),
|
|
8124
|
-
_el$5 = _el$4.nextSibling,
|
|
8125
|
-
[_el$6, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$5.nextSibling);
|
|
8126
|
-
$52FdA$solidjsweb.insert(_el$2, () => i18n_.search_recs_title_());
|
|
8127
|
-
$52FdA$solidjsweb.insert(_el$, (0, $8edd3cf30d1fd8b4$export$a2cc176055f8f08), _el$4, _co$);
|
|
8128
|
-
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), $52FdA$solidjsweb.mergeProps({
|
|
8129
|
-
rows: rows_object,
|
|
8130
|
-
layout: "grid",
|
|
8131
|
-
element_attributes: {
|
|
8132
|
-
class: "cards"
|
|
8133
|
-
}
|
|
8134
|
-
}, layout_options_, {
|
|
8135
|
-
get children() {
|
|
8136
|
-
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Suspense), {
|
|
8137
|
-
get fallback() {
|
|
8138
|
-
return $e3915574cfd3466c$export$f33414a4df0afd3f({
|
|
8139
|
-
num_placeholders_: num_placeholders_,
|
|
8140
|
-
product_card_template_: product_card_template_
|
|
8141
|
-
});
|
|
8142
|
-
},
|
|
8143
|
-
get children() {
|
|
8144
|
-
return (() => {
|
|
8145
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
8146
|
-
const displays_by_key_ = $76012c4468a53d1f$export$7f8bd308237ab5a5($52FdA$solidjs.createMemo(() => recommendations_resource() || []));
|
|
8147
|
-
return $76012c4468a53d1f$export$43f0fb951fcb0c54({
|
|
8148
|
-
displays_by_key_: displays_by_key_,
|
|
8149
|
-
merchant_: $52FdA$solidjs.createMemo(() => search_query_base_().tenant),
|
|
8150
|
-
market_: $52FdA$solidjs.createMemo(() => search_query_base_().market),
|
|
8151
|
-
product_card_template_: product_card_template_
|
|
8152
|
-
});
|
|
8153
|
-
})();
|
|
8154
|
-
}
|
|
8155
|
-
});
|
|
8156
|
-
}
|
|
8157
|
-
})), _el$6, _co$2);
|
|
8158
|
-
return _el$;
|
|
8159
|
-
}
|
|
8202
|
+
children: elements
|
|
8160
8203
|
});
|
|
8161
8204
|
}
|
|
8162
8205
|
function $c77adcdf5346b187$var$make_state_saved_rows(_ref3, i18n_) {
|
|
@@ -10729,9 +10772,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
10729
10772
|
}
|
|
10730
10773
|
}), _el$19, _co$8);
|
|
10731
10774
|
$52FdA$solidjsweb.insert(_el$7, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
10732
|
-
|
|
10733
|
-
return get_all_products_loaded() && !disable_search_recommendations_;
|
|
10734
|
-
},
|
|
10775
|
+
when: !disable_search_recommendations_,
|
|
10735
10776
|
keyed: false,
|
|
10736
10777
|
get children() {
|
|
10737
10778
|
return $52FdA$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
@@ -10750,7 +10791,8 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
10750
10791
|
},
|
|
10751
10792
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
10752
10793
|
view_more_button_: search_recs_view_more_,
|
|
10753
|
-
product_card_template_: product_card_template_
|
|
10794
|
+
product_card_template_: product_card_template_,
|
|
10795
|
+
all_products_loaded_: get_all_products_loaded
|
|
10754
10796
|
});
|
|
10755
10797
|
}
|
|
10756
10798
|
});
|
package/ES10/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { CategorySuggestion, SearchSuggestionsResponse } from "@depict-ai/types/
|
|
|
7
7
|
import { BaseSearchRequest } from "@depict-ai/types/api/BaseSearchRequest";
|
|
8
8
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
9
9
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
10
|
-
export const version = "2.0.
|
|
10
|
+
export const version = "2.0.9";
|
|
11
11
|
/**
|
|
12
12
|
* Returns accessor with the size of the provided element, including padding and border (I think)
|
|
13
13
|
*/
|