@depict-ai/ui 4.0.10 → 4.0.11
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 +16 -3
- package/ES10/index.d.ts +3 -3
- package/ES10/index.js +16 -3
- package/latest/index.cjs +16 -3
- package/latest/index.d.ts +3 -3
- package/latest/index.js +16 -3
- package/package.json +1 -1
- package/server/ES10/index.cjs +16 -3
- package/server/ES10/index.d.ts +3 -3
- package/server/ES10/index.js +16 -3
- package/server/latest/index.cjs +16 -3
- package/server/latest/index.d.ts +3 -3
- package/server/latest/index.js +16 -3
package/ES10/index.cjs
CHANGED
|
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
94
94
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
95
95
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
96
96
|
/*! Depict.ai search and product listing SDK */
|
|
97
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.
|
|
97
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.11";
|
|
98
98
|
function $a28000bc10de28ad$export$e417c49320921907(dependency, fetcher) {
|
|
99
99
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $52FdA$solidjs.createSignal();
|
|
100
100
|
const deparallelizedFetcher = $52FdA$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -597,6 +597,7 @@ function $76012c4468a53d1f$var$deep_equal(obj1, obj2) {
|
|
|
597
597
|
return true;
|
|
598
598
|
}
|
|
599
599
|
var $6e8d48eea3d0469d$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=instant-results>`);
|
|
600
|
+
const $6e8d48eea3d0469d$export$62fda23edba5cc9b = 250;
|
|
600
601
|
function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
601
602
|
let {
|
|
602
603
|
depict_api_: depict_api_,
|
|
@@ -622,7 +623,7 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
|
622
623
|
// don't wait if it's the first request
|
|
623
624
|
write_current_instant_query(value);
|
|
624
625
|
clearTimeout(timeout);
|
|
625
|
-
timeout = setTimeout($52FdA$depictaiutilishared.catchify(() => write_current_instant_query(value)),
|
|
626
|
+
timeout = setTimeout($52FdA$depictaiutilishared.catchify(() => write_current_instant_query(value)), $6e8d48eea3d0469d$export$62fda23edba5cc9b);
|
|
626
627
|
});
|
|
627
628
|
const [search_results] = $52FdA$solidjs.createResource($52FdA$solidjs.createMemo(() => ({
|
|
628
629
|
// <-- key order important, see comment below
|
|
@@ -3643,6 +3644,7 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
3643
3644
|
forceUseDiv_: forceUseDiv_
|
|
3644
3645
|
} = _ref;
|
|
3645
3646
|
let on_enter_in_search_field_function;
|
|
3647
|
+
let listingSuggestionsDebounceTimeout;
|
|
3646
3648
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
3647
3649
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
3648
3650
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
@@ -3658,6 +3660,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
3658
3660
|
const [input_field, set_input_field] = $52FdA$solidjs.createSignal();
|
|
3659
3661
|
const [searching_for_value_, set_searching_for_value_] = $52FdA$solidjs.createSignal();
|
|
3660
3662
|
const [show_stale_content_results_, set_show_stale_content_results_] = $52FdA$solidjs.createSignal(false);
|
|
3663
|
+
// For fake debounce
|
|
3664
|
+
const [showStaleListingSuggestions, setShowStaleListingSuggestions] = $52FdA$solidjs.createSignal(false);
|
|
3661
3665
|
const suggestions_updating_blocked_ = $52FdA$solidjs.createSignal(false);
|
|
3662
3666
|
const [modalBodyWidth, setModalBodyWidth] = $52FdA$solidjs.createSignal(0);
|
|
3663
3667
|
const modalLayoutStacked_ = $52FdA$solidjs.createMemo(() => modalBodyWidth() < 650);
|
|
@@ -3689,9 +3693,11 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
3689
3693
|
set_searching_for_value_: set_searching_for_value_,
|
|
3690
3694
|
set_show_stale_content_results_: set_show_stale_content_results_
|
|
3691
3695
|
});
|
|
3692
|
-
const listing_suggestions_ = $52FdA$solidjs.createMemo(
|
|
3696
|
+
const listing_suggestions_ = $52FdA$solidjs.createMemo(prev => {
|
|
3693
3697
|
var _suggestions_response;
|
|
3694
3698
|
const all = enable_category_suggestions_ ? (_suggestions_response = suggestions_response_()) === null || _suggestions_response === void 0 ? void 0 : _suggestions_response.filter(item => item.type === "listing") : [];
|
|
3699
|
+
// To prevent jumping of the modal when the visual listing suggestions exist/don't exist we debounce it the same way as the product results
|
|
3700
|
+
if (showStaleListingSuggestions() && !(all !== null && all !== void 0 && all.length)) return prev;
|
|
3695
3701
|
if (modalLayoutStacked_()) return all;
|
|
3696
3702
|
return all === null || all === void 0 ? void 0 : all.slice(0, 3);
|
|
3697
3703
|
});
|
|
@@ -3766,6 +3772,13 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
3766
3772
|
$4b71b4fabdee5753$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
3767
3773
|
addEventListener("keydown", close_on_escape_handler);
|
|
3768
3774
|
$52FdA$solidjs.onCleanup(() => removeEventListener("keydown", close_on_escape_handler));
|
|
3775
|
+
$52FdA$solidjs.createEffect($52FdA$solidjs.on(get_search_field_value_, () => {
|
|
3776
|
+
setShowStaleListingSuggestions(true);
|
|
3777
|
+
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
3778
|
+
listingSuggestionsDebounceTimeout = setTimeout($52FdA$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), (0, $6e8d48eea3d0469d$export$62fda23edba5cc9b));
|
|
3779
|
+
}, {
|
|
3780
|
+
defer: true
|
|
3781
|
+
}));
|
|
3769
3782
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
3770
3783
|
$4e44eb7e21ff022a$export$3340fdd8259bd4fd({
|
|
3771
3784
|
get_search_field_value_: get_search_field_value_,
|
package/ES10/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.0.
|
|
13
|
+
export const version = "4.0.11";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
|
@@ -1207,7 +1207,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1207
1207
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
1208
1208
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1209
1209
|
layout?: PossibleLayout;
|
|
1210
|
-
}): import("@depict-ai/utilishared
|
|
1210
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1211
1211
|
export function BreadCrumbs<T extends Display>({
|
|
1212
1212
|
depict_category
|
|
1213
1213
|
}: {
|
|
@@ -1339,7 +1339,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1339
1339
|
* Open the modal with support for alignment.
|
|
1340
1340
|
* @returns {void}
|
|
1341
1341
|
*/
|
|
1342
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1342
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1343
1343
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1344
1344
|
export interface PageReplacer {
|
|
1345
1345
|
readonly render_: () => Node_Array;
|
package/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0.11";
|
|
14
14
|
function $a604a8ffa4e4c03f$export$e417c49320921907(dependency, fetcher) {
|
|
15
15
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $8tj43$createSignal();
|
|
16
16
|
const deparallelizedFetcher = $8tj43$deparallelize_no_drop(async dependencyValue => {
|
|
@@ -513,6 +513,7 @@ function $2d7bad8684bc7f44$var$deep_equal(obj1, obj2) {
|
|
|
513
513
|
return true;
|
|
514
514
|
}
|
|
515
515
|
var $f7414b949aeabc90$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=instant-results>`);
|
|
516
|
+
const $f7414b949aeabc90$export$62fda23edba5cc9b = 250;
|
|
516
517
|
function $f7414b949aeabc90$export$62f101a8aa597bf8(_ref) {
|
|
517
518
|
let {
|
|
518
519
|
depict_api_: depict_api_,
|
|
@@ -538,7 +539,7 @@ function $f7414b949aeabc90$export$62f101a8aa597bf8(_ref) {
|
|
|
538
539
|
// don't wait if it's the first request
|
|
539
540
|
write_current_instant_query(value);
|
|
540
541
|
clearTimeout(timeout);
|
|
541
|
-
timeout = setTimeout($8tj43$catchify(() => write_current_instant_query(value)),
|
|
542
|
+
timeout = setTimeout($8tj43$catchify(() => write_current_instant_query(value)), $f7414b949aeabc90$export$62fda23edba5cc9b);
|
|
542
543
|
});
|
|
543
544
|
const [search_results] = $8tj43$createResource($8tj43$createMemo(() => ({
|
|
544
545
|
// <-- key order important, see comment below
|
|
@@ -3559,6 +3560,7 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
3559
3560
|
forceUseDiv_: forceUseDiv_
|
|
3560
3561
|
} = _ref;
|
|
3561
3562
|
let on_enter_in_search_field_function;
|
|
3563
|
+
let listingSuggestionsDebounceTimeout;
|
|
3562
3564
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
3563
3565
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
3564
3566
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
@@ -3574,6 +3576,8 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
3574
3576
|
const [input_field, set_input_field] = $8tj43$createSignal();
|
|
3575
3577
|
const [searching_for_value_, set_searching_for_value_] = $8tj43$createSignal();
|
|
3576
3578
|
const [show_stale_content_results_, set_show_stale_content_results_] = $8tj43$createSignal(false);
|
|
3579
|
+
// For fake debounce
|
|
3580
|
+
const [showStaleListingSuggestions, setShowStaleListingSuggestions] = $8tj43$createSignal(false);
|
|
3577
3581
|
const suggestions_updating_blocked_ = $8tj43$createSignal(false);
|
|
3578
3582
|
const [modalBodyWidth, setModalBodyWidth] = $8tj43$createSignal(0);
|
|
3579
3583
|
const modalLayoutStacked_ = $8tj43$createMemo(() => modalBodyWidth() < 650);
|
|
@@ -3605,9 +3609,11 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
3605
3609
|
set_searching_for_value_: set_searching_for_value_,
|
|
3606
3610
|
set_show_stale_content_results_: set_show_stale_content_results_
|
|
3607
3611
|
});
|
|
3608
|
-
const listing_suggestions_ = $8tj43$createMemo(
|
|
3612
|
+
const listing_suggestions_ = $8tj43$createMemo(prev => {
|
|
3609
3613
|
var _suggestions_response;
|
|
3610
3614
|
const all = enable_category_suggestions_ ? (_suggestions_response = suggestions_response_()) === null || _suggestions_response === void 0 ? void 0 : _suggestions_response.filter(item => item.type === "listing") : [];
|
|
3615
|
+
// To prevent jumping of the modal when the visual listing suggestions exist/don't exist we debounce it the same way as the product results
|
|
3616
|
+
if (showStaleListingSuggestions() && !(all !== null && all !== void 0 && all.length)) return prev;
|
|
3611
3617
|
if (modalLayoutStacked_()) return all;
|
|
3612
3618
|
return all === null || all === void 0 ? void 0 : all.slice(0, 3);
|
|
3613
3619
|
});
|
|
@@ -3682,6 +3688,13 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
3682
3688
|
$a82a41ab7188eda2$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
3683
3689
|
addEventListener("keydown", close_on_escape_handler);
|
|
3684
3690
|
$8tj43$onCleanup(() => removeEventListener("keydown", close_on_escape_handler));
|
|
3691
|
+
$8tj43$createEffect($8tj43$on(get_search_field_value_, () => {
|
|
3692
|
+
setShowStaleListingSuggestions(true);
|
|
3693
|
+
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
3694
|
+
listingSuggestionsDebounceTimeout = setTimeout($8tj43$catchify(() => setShowStaleListingSuggestions(false)), (0, $f7414b949aeabc90$export$62fda23edba5cc9b));
|
|
3695
|
+
}, {
|
|
3696
|
+
defer: true
|
|
3697
|
+
}));
|
|
3685
3698
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
3686
3699
|
$a09bb7c652acf957$export$3340fdd8259bd4fd({
|
|
3687
3700
|
get_search_field_value_: get_search_field_value_,
|
package/latest/index.cjs
CHANGED
|
@@ -88,7 +88,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
88
88
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
89
89
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
90
90
|
/*! Depict.ai search and product listing SDK */
|
|
91
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.
|
|
91
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.11";
|
|
92
92
|
function $53df95e470b2f8d2$export$e417c49320921907(dependency, fetcher) {
|
|
93
93
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $gVhhF$solidjs.createSignal();
|
|
94
94
|
const deparallelizedFetcher = $gVhhF$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -571,6 +571,7 @@ function $a73063cc642f3e5f$var$deep_equal(obj1, obj2) {
|
|
|
571
571
|
return true;
|
|
572
572
|
}
|
|
573
573
|
var $6ae556e536054e87$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=instant-results>`);
|
|
574
|
+
const $6ae556e536054e87$export$62fda23edba5cc9b = 250;
|
|
574
575
|
function $6ae556e536054e87$export$62f101a8aa597bf8({
|
|
575
576
|
depict_api_: depict_api_,
|
|
576
577
|
search_field_value_: [get_search_field_value],
|
|
@@ -595,7 +596,7 @@ function $6ae556e536054e87$export$62f101a8aa597bf8({
|
|
|
595
596
|
// don't wait if it's the first request
|
|
596
597
|
write_current_instant_query(value);
|
|
597
598
|
clearTimeout(timeout);
|
|
598
|
-
timeout = setTimeout($gVhhF$depictaiutilishared.catchify(() => write_current_instant_query(value)),
|
|
599
|
+
timeout = setTimeout($gVhhF$depictaiutilishared.catchify(() => write_current_instant_query(value)), $6ae556e536054e87$export$62fda23edba5cc9b);
|
|
599
600
|
});
|
|
600
601
|
const [search_results] = $gVhhF$solidjs.createResource($gVhhF$solidjs.createMemo(() => ({
|
|
601
602
|
// <-- key order important, see comment below
|
|
@@ -3485,6 +3486,7 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
3485
3486
|
forceUseDiv_: forceUseDiv_
|
|
3486
3487
|
}) {
|
|
3487
3488
|
let on_enter_in_search_field_function;
|
|
3489
|
+
let listingSuggestionsDebounceTimeout;
|
|
3488
3490
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
3489
3491
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
3490
3492
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
@@ -3500,6 +3502,8 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
3500
3502
|
const [input_field, set_input_field] = $gVhhF$solidjs.createSignal();
|
|
3501
3503
|
const [searching_for_value_, set_searching_for_value_] = $gVhhF$solidjs.createSignal();
|
|
3502
3504
|
const [show_stale_content_results_, set_show_stale_content_results_] = $gVhhF$solidjs.createSignal(false);
|
|
3505
|
+
// For fake debounce
|
|
3506
|
+
const [showStaleListingSuggestions, setShowStaleListingSuggestions] = $gVhhF$solidjs.createSignal(false);
|
|
3503
3507
|
const suggestions_updating_blocked_ = $gVhhF$solidjs.createSignal(false);
|
|
3504
3508
|
const [modalBodyWidth, setModalBodyWidth] = $gVhhF$solidjs.createSignal(0);
|
|
3505
3509
|
const modalLayoutStacked_ = $gVhhF$solidjs.createMemo(() => modalBodyWidth() < 650);
|
|
@@ -3531,8 +3535,10 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
3531
3535
|
set_searching_for_value_: set_searching_for_value_,
|
|
3532
3536
|
set_show_stale_content_results_: set_show_stale_content_results_
|
|
3533
3537
|
});
|
|
3534
|
-
const listing_suggestions_ = $gVhhF$solidjs.createMemo(
|
|
3538
|
+
const listing_suggestions_ = $gVhhF$solidjs.createMemo(prev => {
|
|
3535
3539
|
const all = enable_category_suggestions_ ? suggestions_response_()?.filter(item => item.type === "listing") : [];
|
|
3540
|
+
// To prevent jumping of the modal when the visual listing suggestions exist/don't exist we debounce it the same way as the product results
|
|
3541
|
+
if (showStaleListingSuggestions() && !all?.length) return prev;
|
|
3536
3542
|
if (modalLayoutStacked_()) return all;
|
|
3537
3543
|
return all?.slice(0, 3);
|
|
3538
3544
|
});
|
|
@@ -3601,6 +3607,13 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
3601
3607
|
$eb3039a27db40508$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
3602
3608
|
addEventListener("keydown", close_on_escape_handler);
|
|
3603
3609
|
$gVhhF$solidjs.onCleanup(() => removeEventListener("keydown", close_on_escape_handler));
|
|
3610
|
+
$gVhhF$solidjs.createEffect($gVhhF$solidjs.on(get_search_field_value_, () => {
|
|
3611
|
+
setShowStaleListingSuggestions(true);
|
|
3612
|
+
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
3613
|
+
listingSuggestionsDebounceTimeout = setTimeout($gVhhF$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), (0, $6ae556e536054e87$export$62fda23edba5cc9b));
|
|
3614
|
+
}, {
|
|
3615
|
+
defer: true
|
|
3616
|
+
}));
|
|
3604
3617
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
3605
3618
|
$036d367ce3058351$export$3340fdd8259bd4fd({
|
|
3606
3619
|
get_search_field_value_: get_search_field_value_,
|
package/latest/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.0.
|
|
13
|
+
export const version = "4.0.11";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
|
@@ -1207,7 +1207,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1207
1207
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
1208
1208
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1209
1209
|
layout?: PossibleLayout;
|
|
1210
|
-
}): import("@depict-ai/utilishared
|
|
1210
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1211
1211
|
export function BreadCrumbs<T extends Display>({
|
|
1212
1212
|
depict_category
|
|
1213
1213
|
}: {
|
|
@@ -1339,7 +1339,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1339
1339
|
* Open the modal with support for alignment.
|
|
1340
1340
|
* @returns {void}
|
|
1341
1341
|
*/
|
|
1342
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1342
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1343
1343
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1344
1344
|
export interface PageReplacer {
|
|
1345
1345
|
readonly render_: () => Node_Array;
|
package/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.11";
|
|
11
11
|
function $136f1d4d6c7ba6ac$export$e417c49320921907(dependency, fetcher) {
|
|
12
12
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $9HbP8$createSignal();
|
|
13
13
|
const deparallelizedFetcher = $9HbP8$deparallelize_no_drop(async dependencyValue => {
|
|
@@ -490,6 +490,7 @@ function $29ec7cddbe1d3484$var$deep_equal(obj1, obj2) {
|
|
|
490
490
|
return true;
|
|
491
491
|
}
|
|
492
492
|
var $eea41f703612261b$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=instant-results>`);
|
|
493
|
+
const $eea41f703612261b$export$62fda23edba5cc9b = 250;
|
|
493
494
|
function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
494
495
|
depict_api_: depict_api_,
|
|
495
496
|
search_field_value_: [get_search_field_value],
|
|
@@ -514,7 +515,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
|
514
515
|
// don't wait if it's the first request
|
|
515
516
|
write_current_instant_query(value);
|
|
516
517
|
clearTimeout(timeout);
|
|
517
|
-
timeout = setTimeout($9HbP8$catchify(() => write_current_instant_query(value)),
|
|
518
|
+
timeout = setTimeout($9HbP8$catchify(() => write_current_instant_query(value)), $eea41f703612261b$export$62fda23edba5cc9b);
|
|
518
519
|
});
|
|
519
520
|
const [search_results] = $9HbP8$createResource($9HbP8$createMemo(() => ({
|
|
520
521
|
// <-- key order important, see comment below
|
|
@@ -3404,6 +3405,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3404
3405
|
forceUseDiv_: forceUseDiv_
|
|
3405
3406
|
}) {
|
|
3406
3407
|
let on_enter_in_search_field_function;
|
|
3408
|
+
let listingSuggestionsDebounceTimeout;
|
|
3407
3409
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
3408
3410
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
3409
3411
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
@@ -3419,6 +3421,8 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3419
3421
|
const [input_field, set_input_field] = $9HbP8$createSignal();
|
|
3420
3422
|
const [searching_for_value_, set_searching_for_value_] = $9HbP8$createSignal();
|
|
3421
3423
|
const [show_stale_content_results_, set_show_stale_content_results_] = $9HbP8$createSignal(false);
|
|
3424
|
+
// For fake debounce
|
|
3425
|
+
const [showStaleListingSuggestions, setShowStaleListingSuggestions] = $9HbP8$createSignal(false);
|
|
3422
3426
|
const suggestions_updating_blocked_ = $9HbP8$createSignal(false);
|
|
3423
3427
|
const [modalBodyWidth, setModalBodyWidth] = $9HbP8$createSignal(0);
|
|
3424
3428
|
const modalLayoutStacked_ = $9HbP8$createMemo(() => modalBodyWidth() < 650);
|
|
@@ -3450,8 +3454,10 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3450
3454
|
set_searching_for_value_: set_searching_for_value_,
|
|
3451
3455
|
set_show_stale_content_results_: set_show_stale_content_results_
|
|
3452
3456
|
});
|
|
3453
|
-
const listing_suggestions_ = $9HbP8$createMemo(
|
|
3457
|
+
const listing_suggestions_ = $9HbP8$createMemo(prev => {
|
|
3454
3458
|
const all = enable_category_suggestions_ ? suggestions_response_()?.filter(item => item.type === "listing") : [];
|
|
3459
|
+
// To prevent jumping of the modal when the visual listing suggestions exist/don't exist we debounce it the same way as the product results
|
|
3460
|
+
if (showStaleListingSuggestions() && !all?.length) return prev;
|
|
3455
3461
|
if (modalLayoutStacked_()) return all;
|
|
3456
3462
|
return all?.slice(0, 3);
|
|
3457
3463
|
});
|
|
@@ -3520,6 +3526,13 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
3520
3526
|
$512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
3521
3527
|
addEventListener("keydown", close_on_escape_handler);
|
|
3522
3528
|
$9HbP8$onCleanup(() => removeEventListener("keydown", close_on_escape_handler));
|
|
3529
|
+
$9HbP8$createEffect($9HbP8$on(get_search_field_value_, () => {
|
|
3530
|
+
setShowStaleListingSuggestions(true);
|
|
3531
|
+
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
3532
|
+
listingSuggestionsDebounceTimeout = setTimeout($9HbP8$catchify(() => setShowStaleListingSuggestions(false)), (0, $eea41f703612261b$export$62fda23edba5cc9b));
|
|
3533
|
+
}, {
|
|
3534
|
+
defer: true
|
|
3535
|
+
}));
|
|
3523
3536
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
3524
3537
|
$c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
3525
3538
|
get_search_field_value_: get_search_field_value_,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.11",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"sass": "styles.scss",
|
package/server/ES10/index.cjs
CHANGED
|
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
94
94
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
95
95
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
96
96
|
/*! Depict.ai search and product listing SDK */
|
|
97
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.
|
|
97
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.11";
|
|
98
98
|
function $a28000bc10de28ad$export$e417c49320921907(dependency, fetcher) {
|
|
99
99
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $3hooq$solidjs.createSignal();
|
|
100
100
|
const deparallelizedFetcher = $3hooq$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -489,6 +489,7 @@ function $76012c4468a53d1f$var$deep_equal(obj1, obj2) {
|
|
|
489
489
|
return true;
|
|
490
490
|
}
|
|
491
491
|
var $6e8d48eea3d0469d$var$_tmpl$ = ["<div", ' class="instant-results" style="', '">', "</div>"];
|
|
492
|
+
const $6e8d48eea3d0469d$export$62fda23edba5cc9b = 250;
|
|
492
493
|
function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
493
494
|
let {
|
|
494
495
|
depict_api_: depict_api_,
|
|
@@ -514,7 +515,7 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
|
514
515
|
// don't wait if it's the first request
|
|
515
516
|
write_current_instant_query(value);
|
|
516
517
|
clearTimeout(timeout);
|
|
517
|
-
timeout = setTimeout($3hooq$depictaiutilishared.catchify(() => write_current_instant_query(value)),
|
|
518
|
+
timeout = setTimeout($3hooq$depictaiutilishared.catchify(() => write_current_instant_query(value)), $6e8d48eea3d0469d$export$62fda23edba5cc9b);
|
|
518
519
|
});
|
|
519
520
|
const [search_results] = $3hooq$solidjs.createResource($3hooq$solidjs.createMemo(() => ({
|
|
520
521
|
// <-- key order important, see comment below
|
|
@@ -2881,6 +2882,7 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
2881
2882
|
forceUseDiv_: forceUseDiv_
|
|
2882
2883
|
} = _ref;
|
|
2883
2884
|
let on_enter_in_search_field_function;
|
|
2885
|
+
let listingSuggestionsDebounceTimeout;
|
|
2884
2886
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
2885
2887
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
2886
2888
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
@@ -2896,6 +2898,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
2896
2898
|
const [input_field, set_input_field] = $3hooq$solidjs.createSignal();
|
|
2897
2899
|
const [searching_for_value_, set_searching_for_value_] = $3hooq$solidjs.createSignal();
|
|
2898
2900
|
const [show_stale_content_results_, set_show_stale_content_results_] = $3hooq$solidjs.createSignal(false);
|
|
2901
|
+
// For fake debounce
|
|
2902
|
+
const [showStaleListingSuggestions, setShowStaleListingSuggestions] = $3hooq$solidjs.createSignal(false);
|
|
2899
2903
|
const suggestions_updating_blocked_ = $3hooq$solidjs.createSignal(false);
|
|
2900
2904
|
const [modalBodyWidth, setModalBodyWidth] = $3hooq$solidjs.createSignal(0);
|
|
2901
2905
|
const modalLayoutStacked_ = $3hooq$solidjs.createMemo(() => modalBodyWidth() < 650);
|
|
@@ -2927,9 +2931,11 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
2927
2931
|
set_searching_for_value_: set_searching_for_value_,
|
|
2928
2932
|
set_show_stale_content_results_: set_show_stale_content_results_
|
|
2929
2933
|
});
|
|
2930
|
-
const listing_suggestions_ = $3hooq$solidjs.createMemo(
|
|
2934
|
+
const listing_suggestions_ = $3hooq$solidjs.createMemo(prev => {
|
|
2931
2935
|
var _suggestions_response;
|
|
2932
2936
|
const all = enable_category_suggestions_ ? (_suggestions_response = suggestions_response_()) === null || _suggestions_response === void 0 ? void 0 : _suggestions_response.filter(item => item.type === "listing") : [];
|
|
2937
|
+
// To prevent jumping of the modal when the visual listing suggestions exist/don't exist we debounce it the same way as the product results
|
|
2938
|
+
if (showStaleListingSuggestions() && !(all !== null && all !== void 0 && all.length)) return prev;
|
|
2933
2939
|
if (modalLayoutStacked_()) return all;
|
|
2934
2940
|
return all === null || all === void 0 ? void 0 : all.slice(0, 3);
|
|
2935
2941
|
});
|
|
@@ -3004,6 +3010,13 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
3004
3010
|
$4b71b4fabdee5753$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
3005
3011
|
addEventListener("keydown", close_on_escape_handler);
|
|
3006
3012
|
$3hooq$solidjs.onCleanup(() => removeEventListener("keydown", close_on_escape_handler));
|
|
3013
|
+
$3hooq$solidjs.createEffect($3hooq$solidjs.on(get_search_field_value_, () => {
|
|
3014
|
+
setShowStaleListingSuggestions(true);
|
|
3015
|
+
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
3016
|
+
listingSuggestionsDebounceTimeout = setTimeout($3hooq$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), (0, $6e8d48eea3d0469d$export$62fda23edba5cc9b));
|
|
3017
|
+
}, {
|
|
3018
|
+
defer: true
|
|
3019
|
+
}));
|
|
3007
3020
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
3008
3021
|
$4e44eb7e21ff022a$export$3340fdd8259bd4fd({
|
|
3009
3022
|
get_search_field_value_: get_search_field_value_,
|
package/server/ES10/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.0.
|
|
13
|
+
export const version = "4.0.11";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
|
@@ -1207,7 +1207,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1207
1207
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
1208
1208
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1209
1209
|
layout?: PossibleLayout;
|
|
1210
|
-
}): import("@depict-ai/utilishared
|
|
1210
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1211
1211
|
export function BreadCrumbs<T extends Display>({
|
|
1212
1212
|
depict_category
|
|
1213
1213
|
}: {
|
|
@@ -1339,7 +1339,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1339
1339
|
* Open the modal with support for alignment.
|
|
1340
1340
|
* @returns {void}
|
|
1341
1341
|
*/
|
|
1342
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1342
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1343
1343
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1344
1344
|
export interface PageReplacer {
|
|
1345
1345
|
readonly render_: () => Node_Array;
|
package/server/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0.11";
|
|
14
14
|
function $a604a8ffa4e4c03f$export$e417c49320921907(dependency, fetcher) {
|
|
15
15
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $b8hua$createSignal();
|
|
16
16
|
const deparallelizedFetcher = $b8hua$deparallelize_no_drop(async dependencyValue => {
|
|
@@ -405,6 +405,7 @@ function $2d7bad8684bc7f44$var$deep_equal(obj1, obj2) {
|
|
|
405
405
|
return true;
|
|
406
406
|
}
|
|
407
407
|
var $f7414b949aeabc90$var$_tmpl$ = ["<div", ' class="instant-results" style="', '">', "</div>"];
|
|
408
|
+
const $f7414b949aeabc90$export$62fda23edba5cc9b = 250;
|
|
408
409
|
function $f7414b949aeabc90$export$62f101a8aa597bf8(_ref) {
|
|
409
410
|
let {
|
|
410
411
|
depict_api_: depict_api_,
|
|
@@ -430,7 +431,7 @@ function $f7414b949aeabc90$export$62f101a8aa597bf8(_ref) {
|
|
|
430
431
|
// don't wait if it's the first request
|
|
431
432
|
write_current_instant_query(value);
|
|
432
433
|
clearTimeout(timeout);
|
|
433
|
-
timeout = setTimeout($b8hua$catchify(() => write_current_instant_query(value)),
|
|
434
|
+
timeout = setTimeout($b8hua$catchify(() => write_current_instant_query(value)), $f7414b949aeabc90$export$62fda23edba5cc9b);
|
|
434
435
|
});
|
|
435
436
|
const [search_results] = $b8hua$createResource($b8hua$createMemo(() => ({
|
|
436
437
|
// <-- key order important, see comment below
|
|
@@ -2797,6 +2798,7 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
2797
2798
|
forceUseDiv_: forceUseDiv_
|
|
2798
2799
|
} = _ref;
|
|
2799
2800
|
let on_enter_in_search_field_function;
|
|
2801
|
+
let listingSuggestionsDebounceTimeout;
|
|
2800
2802
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
2801
2803
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
2802
2804
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
@@ -2812,6 +2814,8 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
2812
2814
|
const [input_field, set_input_field] = $b8hua$createSignal();
|
|
2813
2815
|
const [searching_for_value_, set_searching_for_value_] = $b8hua$createSignal();
|
|
2814
2816
|
const [show_stale_content_results_, set_show_stale_content_results_] = $b8hua$createSignal(false);
|
|
2817
|
+
// For fake debounce
|
|
2818
|
+
const [showStaleListingSuggestions, setShowStaleListingSuggestions] = $b8hua$createSignal(false);
|
|
2815
2819
|
const suggestions_updating_blocked_ = $b8hua$createSignal(false);
|
|
2816
2820
|
const [modalBodyWidth, setModalBodyWidth] = $b8hua$createSignal(0);
|
|
2817
2821
|
const modalLayoutStacked_ = $b8hua$createMemo(() => modalBodyWidth() < 650);
|
|
@@ -2843,9 +2847,11 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
2843
2847
|
set_searching_for_value_: set_searching_for_value_,
|
|
2844
2848
|
set_show_stale_content_results_: set_show_stale_content_results_
|
|
2845
2849
|
});
|
|
2846
|
-
const listing_suggestions_ = $b8hua$createMemo(
|
|
2850
|
+
const listing_suggestions_ = $b8hua$createMemo(prev => {
|
|
2847
2851
|
var _suggestions_response;
|
|
2848
2852
|
const all = enable_category_suggestions_ ? (_suggestions_response = suggestions_response_()) === null || _suggestions_response === void 0 ? void 0 : _suggestions_response.filter(item => item.type === "listing") : [];
|
|
2853
|
+
// To prevent jumping of the modal when the visual listing suggestions exist/don't exist we debounce it the same way as the product results
|
|
2854
|
+
if (showStaleListingSuggestions() && !(all !== null && all !== void 0 && all.length)) return prev;
|
|
2849
2855
|
if (modalLayoutStacked_()) return all;
|
|
2850
2856
|
return all === null || all === void 0 ? void 0 : all.slice(0, 3);
|
|
2851
2857
|
});
|
|
@@ -2920,6 +2926,13 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
2920
2926
|
$a82a41ab7188eda2$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
2921
2927
|
addEventListener("keydown", close_on_escape_handler);
|
|
2922
2928
|
$b8hua$onCleanup(() => removeEventListener("keydown", close_on_escape_handler));
|
|
2929
|
+
$b8hua$createEffect($b8hua$on(get_search_field_value_, () => {
|
|
2930
|
+
setShowStaleListingSuggestions(true);
|
|
2931
|
+
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
2932
|
+
listingSuggestionsDebounceTimeout = setTimeout($b8hua$catchify(() => setShowStaleListingSuggestions(false)), (0, $f7414b949aeabc90$export$62fda23edba5cc9b));
|
|
2933
|
+
}, {
|
|
2934
|
+
defer: true
|
|
2935
|
+
}));
|
|
2923
2936
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
2924
2937
|
$a09bb7c652acf957$export$3340fdd8259bd4fd({
|
|
2925
2938
|
get_search_field_value_: get_search_field_value_,
|
package/server/latest/index.cjs
CHANGED
|
@@ -88,7 +88,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
88
88
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
89
89
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
90
90
|
/*! Depict.ai search and product listing SDK */
|
|
91
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.
|
|
91
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.11";
|
|
92
92
|
function $53df95e470b2f8d2$export$e417c49320921907(dependency, fetcher) {
|
|
93
93
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $5vyXB$solidjs.createSignal();
|
|
94
94
|
const deparallelizedFetcher = $5vyXB$depictaiutilishared.deparallelize_no_drop(async dependencyValue => {
|
|
@@ -466,6 +466,7 @@ function $a73063cc642f3e5f$var$deep_equal(obj1, obj2) {
|
|
|
466
466
|
return true;
|
|
467
467
|
}
|
|
468
468
|
var $6ae556e536054e87$var$_tmpl$ = ["<div", ' class="instant-results" style="', '">', "</div>"];
|
|
469
|
+
const $6ae556e536054e87$export$62fda23edba5cc9b = 250;
|
|
469
470
|
function $6ae556e536054e87$export$62f101a8aa597bf8({
|
|
470
471
|
depict_api_: depict_api_,
|
|
471
472
|
search_field_value_: [get_search_field_value],
|
|
@@ -490,7 +491,7 @@ function $6ae556e536054e87$export$62f101a8aa597bf8({
|
|
|
490
491
|
// don't wait if it's the first request
|
|
491
492
|
write_current_instant_query(value);
|
|
492
493
|
clearTimeout(timeout);
|
|
493
|
-
timeout = setTimeout($5vyXB$depictaiutilishared.catchify(() => write_current_instant_query(value)),
|
|
494
|
+
timeout = setTimeout($5vyXB$depictaiutilishared.catchify(() => write_current_instant_query(value)), $6ae556e536054e87$export$62fda23edba5cc9b);
|
|
494
495
|
});
|
|
495
496
|
const [search_results] = $5vyXB$solidjs.createResource($5vyXB$solidjs.createMemo(() => ({
|
|
496
497
|
// <-- key order important, see comment below
|
|
@@ -2744,6 +2745,7 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
2744
2745
|
forceUseDiv_: forceUseDiv_
|
|
2745
2746
|
}) {
|
|
2746
2747
|
let on_enter_in_search_field_function;
|
|
2748
|
+
let listingSuggestionsDebounceTimeout;
|
|
2747
2749
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
2748
2750
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
2749
2751
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
@@ -2759,6 +2761,8 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
2759
2761
|
const [input_field, set_input_field] = $5vyXB$solidjs.createSignal();
|
|
2760
2762
|
const [searching_for_value_, set_searching_for_value_] = $5vyXB$solidjs.createSignal();
|
|
2761
2763
|
const [show_stale_content_results_, set_show_stale_content_results_] = $5vyXB$solidjs.createSignal(false);
|
|
2764
|
+
// For fake debounce
|
|
2765
|
+
const [showStaleListingSuggestions, setShowStaleListingSuggestions] = $5vyXB$solidjs.createSignal(false);
|
|
2762
2766
|
const suggestions_updating_blocked_ = $5vyXB$solidjs.createSignal(false);
|
|
2763
2767
|
const [modalBodyWidth, setModalBodyWidth] = $5vyXB$solidjs.createSignal(0);
|
|
2764
2768
|
const modalLayoutStacked_ = $5vyXB$solidjs.createMemo(() => modalBodyWidth() < 650);
|
|
@@ -2790,8 +2794,10 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
2790
2794
|
set_searching_for_value_: set_searching_for_value_,
|
|
2791
2795
|
set_show_stale_content_results_: set_show_stale_content_results_
|
|
2792
2796
|
});
|
|
2793
|
-
const listing_suggestions_ = $5vyXB$solidjs.createMemo(
|
|
2797
|
+
const listing_suggestions_ = $5vyXB$solidjs.createMemo(prev => {
|
|
2794
2798
|
const all = enable_category_suggestions_ ? suggestions_response_()?.filter(item => item.type === "listing") : [];
|
|
2799
|
+
// To prevent jumping of the modal when the visual listing suggestions exist/don't exist we debounce it the same way as the product results
|
|
2800
|
+
if (showStaleListingSuggestions() && !all?.length) return prev;
|
|
2795
2801
|
if (modalLayoutStacked_()) return all;
|
|
2796
2802
|
return all?.slice(0, 3);
|
|
2797
2803
|
});
|
|
@@ -2860,6 +2866,13 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
2860
2866
|
$eb3039a27db40508$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
2861
2867
|
addEventListener("keydown", close_on_escape_handler);
|
|
2862
2868
|
$5vyXB$solidjs.onCleanup(() => removeEventListener("keydown", close_on_escape_handler));
|
|
2869
|
+
$5vyXB$solidjs.createEffect($5vyXB$solidjs.on(get_search_field_value_, () => {
|
|
2870
|
+
setShowStaleListingSuggestions(true);
|
|
2871
|
+
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
2872
|
+
listingSuggestionsDebounceTimeout = setTimeout($5vyXB$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), (0, $6ae556e536054e87$export$62fda23edba5cc9b));
|
|
2873
|
+
}, {
|
|
2874
|
+
defer: true
|
|
2875
|
+
}));
|
|
2863
2876
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
2864
2877
|
$036d367ce3058351$export$3340fdd8259bd4fd({
|
|
2865
2878
|
get_search_field_value_: get_search_field_value_,
|
package/server/latest/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.0.
|
|
13
|
+
export const version = "4.0.11";
|
|
14
14
|
export type ModalAlignmentSignals = {
|
|
15
15
|
body_: Signal<JSX.CSSProperties>;
|
|
16
16
|
field_: Signal<JSX.CSSProperties>;
|
|
@@ -1207,7 +1207,7 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1207
1207
|
on_listing_query_change?: (new_listing_query?: ListingQuery | undefined, old_listing_query?: ListingQuery | undefined) => void;
|
|
1208
1208
|
content_blocks_by_row?: ContentBlocksByRow;
|
|
1209
1209
|
layout?: PossibleLayout;
|
|
1210
|
-
}): import("@depict-ai/utilishared
|
|
1210
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1211
1211
|
export function BreadCrumbs<T extends Display>({
|
|
1212
1212
|
depict_category
|
|
1213
1213
|
}: {
|
|
@@ -1339,7 +1339,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1339
1339
|
* Open the modal with support for alignment.
|
|
1340
1340
|
* @returns {void}
|
|
1341
1341
|
*/
|
|
1342
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1342
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1343
1343
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1344
1344
|
export interface PageReplacer {
|
|
1345
1345
|
readonly render_: () => Node_Array;
|
package/server/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.11";
|
|
11
11
|
function $136f1d4d6c7ba6ac$export$e417c49320921907(dependency, fetcher) {
|
|
12
12
|
const [promiseOfCurrentFetcherRun, setPromiseOfCurrentFetcherRun] = $i7OB2$createSignal();
|
|
13
13
|
const deparallelizedFetcher = $i7OB2$deparallelize_no_drop(async dependencyValue => {
|
|
@@ -385,6 +385,7 @@ function $29ec7cddbe1d3484$var$deep_equal(obj1, obj2) {
|
|
|
385
385
|
return true;
|
|
386
386
|
}
|
|
387
387
|
var $eea41f703612261b$var$_tmpl$ = ["<div", ' class="instant-results" style="', '">', "</div>"];
|
|
388
|
+
const $eea41f703612261b$export$62fda23edba5cc9b = 250;
|
|
388
389
|
function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
389
390
|
depict_api_: depict_api_,
|
|
390
391
|
search_field_value_: [get_search_field_value],
|
|
@@ -409,7 +410,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
|
409
410
|
// don't wait if it's the first request
|
|
410
411
|
write_current_instant_query(value);
|
|
411
412
|
clearTimeout(timeout);
|
|
412
|
-
timeout = setTimeout($i7OB2$catchify(() => write_current_instant_query(value)),
|
|
413
|
+
timeout = setTimeout($i7OB2$catchify(() => write_current_instant_query(value)), $eea41f703612261b$export$62fda23edba5cc9b);
|
|
413
414
|
});
|
|
414
415
|
const [search_results] = $i7OB2$createResource($i7OB2$createMemo(() => ({
|
|
415
416
|
// <-- key order important, see comment below
|
|
@@ -2663,6 +2664,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
2663
2664
|
forceUseDiv_: forceUseDiv_
|
|
2664
2665
|
}) {
|
|
2665
2666
|
let on_enter_in_search_field_function;
|
|
2667
|
+
let listingSuggestionsDebounceTimeout;
|
|
2666
2668
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
2667
2669
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
2668
2670
|
// Basically the UI signals that the button that opens the modal starts a new search.
|
|
@@ -2678,6 +2680,8 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
2678
2680
|
const [input_field, set_input_field] = $i7OB2$createSignal();
|
|
2679
2681
|
const [searching_for_value_, set_searching_for_value_] = $i7OB2$createSignal();
|
|
2680
2682
|
const [show_stale_content_results_, set_show_stale_content_results_] = $i7OB2$createSignal(false);
|
|
2683
|
+
// For fake debounce
|
|
2684
|
+
const [showStaleListingSuggestions, setShowStaleListingSuggestions] = $i7OB2$createSignal(false);
|
|
2681
2685
|
const suggestions_updating_blocked_ = $i7OB2$createSignal(false);
|
|
2682
2686
|
const [modalBodyWidth, setModalBodyWidth] = $i7OB2$createSignal(0);
|
|
2683
2687
|
const modalLayoutStacked_ = $i7OB2$createMemo(() => modalBodyWidth() < 650);
|
|
@@ -2709,8 +2713,10 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
2709
2713
|
set_searching_for_value_: set_searching_for_value_,
|
|
2710
2714
|
set_show_stale_content_results_: set_show_stale_content_results_
|
|
2711
2715
|
});
|
|
2712
|
-
const listing_suggestions_ = $i7OB2$createMemo(
|
|
2716
|
+
const listing_suggestions_ = $i7OB2$createMemo(prev => {
|
|
2713
2717
|
const all = enable_category_suggestions_ ? suggestions_response_()?.filter(item => item.type === "listing") : [];
|
|
2718
|
+
// To prevent jumping of the modal when the visual listing suggestions exist/don't exist we debounce it the same way as the product results
|
|
2719
|
+
if (showStaleListingSuggestions() && !all?.length) return prev;
|
|
2714
2720
|
if (modalLayoutStacked_()) return all;
|
|
2715
2721
|
return all?.slice(0, 3);
|
|
2716
2722
|
});
|
|
@@ -2779,6 +2785,13 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
2779
2785
|
$512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
|
|
2780
2786
|
addEventListener("keydown", close_on_escape_handler);
|
|
2781
2787
|
$i7OB2$onCleanup(() => removeEventListener("keydown", close_on_escape_handler));
|
|
2788
|
+
$i7OB2$createEffect($i7OB2$on(get_search_field_value_, () => {
|
|
2789
|
+
setShowStaleListingSuggestions(true);
|
|
2790
|
+
clearTimeout(listingSuggestionsDebounceTimeout);
|
|
2791
|
+
listingSuggestionsDebounceTimeout = setTimeout($i7OB2$catchify(() => setShowStaleListingSuggestions(false)), (0, $eea41f703612261b$export$62fda23edba5cc9b));
|
|
2792
|
+
}, {
|
|
2793
|
+
defer: true
|
|
2794
|
+
}));
|
|
2782
2795
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
2783
2796
|
$c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
2784
2797
|
get_search_field_value_: get_search_field_value_,
|