@depict-ai/ui 4.0.11 → 4.0.13

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 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.11";
97
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.13";
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,7 +597,6 @@ 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;
601
600
  function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
602
601
  let {
603
602
  depict_api_: depict_api_,
@@ -623,7 +622,7 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
623
622
  // don't wait if it's the first request
624
623
  write_current_instant_query(value);
625
624
  clearTimeout(timeout);
626
- timeout = setTimeout($52FdA$depictaiutilishared.catchify(() => write_current_instant_query(value)), $6e8d48eea3d0469d$export$62fda23edba5cc9b);
625
+ timeout = setTimeout($52FdA$depictaiutilishared.catchify(() => write_current_instant_query(value)), 250);
627
626
  });
628
627
  const [search_results] = $52FdA$solidjs.createResource($52FdA$solidjs.createMemo(() => ({
629
628
  // <-- key order important, see comment below
@@ -3236,15 +3235,16 @@ function $f765bad01136eee1$export$c8d7e00464029b45(_ref) {
3236
3235
  itemIndex_: itemIndex_,
3237
3236
  selected_index_: selected_index_,
3238
3237
  modalLayoutStacked_: modalLayoutStacked_,
3238
+ showPlaceholders_: showPlaceholders_,
3239
3239
  currently_showing_suggestions_: [, set_currently_showing_suggestions]
3240
3240
  } = _ref;
3241
3241
  const listings_by_id = $52FdA$solidjs.createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
3242
3242
  const productCards = $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.For), {
3243
3243
  get each() {
3244
- return Object.keys(listings_by_id());
3244
+ return $52FdA$solidjsweb.memo(() => !!showPlaceholders_())() ? [,,,] : Object.keys(listings_by_id());
3245
3245
  },
3246
3246
  children: (listingId, index) => {
3247
- const listing = $52FdA$solidjs.createMemo(() => listings_by_id()[listingId]);
3247
+ const listing = $52FdA$solidjs.createMemo(() => listingId == undefined ? undefined : listings_by_id()[listingId]);
3248
3248
  return $52FdA$solidjsweb.createComponent((0, $d1e7b96fb13cd1d3$export$67152d26d4f56ee8), {
3249
3249
  listing_: listing,
3250
3250
  i18n_: i18n_,
@@ -3268,7 +3268,7 @@ function $f765bad01136eee1$export$c8d7e00464029b45(_ref) {
3268
3268
  return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
3269
3269
  get when() {
3270
3270
  var _listing_suggestions_2;
3271
- return (_listing_suggestions_2 = listing_suggestions_()) === null || _listing_suggestions_2 === void 0 ? void 0 : _listing_suggestions_2.length;
3271
+ return ((_listing_suggestions_2 = listing_suggestions_()) === null || _listing_suggestions_2 === void 0 ? void 0 : _listing_suggestions_2.length) || showPlaceholders_();
3272
3272
  },
3273
3273
  get children() {
3274
3274
  var _el$ = $52FdA$solidjsweb.getNextElement($f765bad01136eee1$var$_tmpl$),
@@ -3775,7 +3775,7 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
3775
3775
  $52FdA$solidjs.createEffect($52FdA$solidjs.on(get_search_field_value_, () => {
3776
3776
  setShowStaleListingSuggestions(true);
3777
3777
  clearTimeout(listingSuggestionsDebounceTimeout);
3778
- listingSuggestionsDebounceTimeout = setTimeout($52FdA$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), (0, $6e8d48eea3d0469d$export$62fda23edba5cc9b));
3778
+ listingSuggestionsDebounceTimeout = setTimeout($52FdA$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), 350);
3779
3779
  }, {
3780
3780
  defer: true
3781
3781
  }));
@@ -3885,7 +3885,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
3885
3885
  },
3886
3886
  selected_index_: selected_index_,
3887
3887
  currently_showing_suggestions_: currently_showing_suggestions_,
3888
- modalLayoutStacked_: modalLayoutStacked_
3888
+ modalLayoutStacked_: modalLayoutStacked_,
3889
+ showPlaceholders_: () => !suggestions_response_.latest
3889
3890
  });
3890
3891
  }
3891
3892
  });
@@ -14776,6 +14777,7 @@ const $a24cfef36ef12dc5$export$d86a33413558014e = openModalParams => {
14776
14777
  search: search,
14777
14778
  makesNewSearch = true
14778
14779
  } = openModalParams;
14780
+ let cleanup;
14779
14781
  openModalParams.location || (openModalParams.location = "centered");
14780
14782
  if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
14781
14783
  if (openModalParams.location !== "aligned") {
@@ -14793,9 +14795,9 @@ const $a24cfef36ef12dc5$export$d86a33413558014e = openModalParams => {
14793
14795
  }];
14794
14796
  return;
14795
14797
  }
14796
- const {
14798
+ if (!openModalParams.ignoreFieldSize_) ({
14797
14799
  cleanup: cleanup
14798
- } = $98bd00c15a2e3159$export$828dcdd425fd3231(openModalParams.element);
14800
+ } = $98bd00c15a2e3159$export$828dcdd425fd3231(openModalParams.element));
14799
14801
  let dispose_aligner;
14800
14802
  /**
14801
14803
  * Setting position to fixed is important to make the modal work with align_field.
@@ -14808,7 +14810,8 @@ const $a24cfef36ef12dc5$export$d86a33413558014e = openModalParams => {
14808
14810
  };
14809
14811
  $52FdA$solidjs.createRoot(dispose => {
14810
14812
  dispose_aligner = () => {
14811
- cleanup();
14813
+ var _cleanup;
14814
+ (_cleanup = cleanup) === null || _cleanup === void 0 || _cleanup();
14812
14815
  dispose();
14813
14816
  };
14814
14817
  $d6ed4dbb6507996d$export$b3ad617e9036868(alignmentSignals_, openModalParams.element, (0, $d6ed4dbb6507996d$export$3f238c96c45e6cc6));
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.11";
13
+ export const version = "4.0.13";
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").Node_Array;
1210
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1211
1211
  export function BreadCrumbs<T extends Display>({
1212
1212
  depict_category
1213
1213
  }: {
@@ -1323,6 +1323,10 @@ type CenteredLocation = {
1323
1323
  type AlignedLocation = {
1324
1324
  location: "aligned";
1325
1325
  element: HTMLElement;
1326
+ /**
1327
+ * If true, the height of the search field in the modal won't be set to the height of the element we're aligning to
1328
+ */
1329
+ ignoreFieldSize_?: boolean;
1326
1330
  };
1327
1331
  /**
1328
1332
  * How the modal should be opened.
@@ -1339,7 +1343,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1339
1343
  * Open the modal with support for alignment.
1340
1344
  * @returns {void}
1341
1345
  */
1342
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1346
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1343
1347
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1344
1348
  export interface PageReplacer {
1345
1349
  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.11";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0.13";
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,7 +513,6 @@ 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;
517
516
  function $f7414b949aeabc90$export$62f101a8aa597bf8(_ref) {
518
517
  let {
519
518
  depict_api_: depict_api_,
@@ -539,7 +538,7 @@ function $f7414b949aeabc90$export$62f101a8aa597bf8(_ref) {
539
538
  // don't wait if it's the first request
540
539
  write_current_instant_query(value);
541
540
  clearTimeout(timeout);
542
- timeout = setTimeout($8tj43$catchify(() => write_current_instant_query(value)), $f7414b949aeabc90$export$62fda23edba5cc9b);
541
+ timeout = setTimeout($8tj43$catchify(() => write_current_instant_query(value)), 250);
543
542
  });
544
543
  const [search_results] = $8tj43$createResource($8tj43$createMemo(() => ({
545
544
  // <-- key order important, see comment below
@@ -3152,15 +3151,16 @@ function $ab401afaded322ab$export$c8d7e00464029b45(_ref) {
3152
3151
  itemIndex_: itemIndex_,
3153
3152
  selected_index_: selected_index_,
3154
3153
  modalLayoutStacked_: modalLayoutStacked_,
3154
+ showPlaceholders_: showPlaceholders_,
3155
3155
  currently_showing_suggestions_: [, set_currently_showing_suggestions]
3156
3156
  } = _ref;
3157
3157
  const listings_by_id = $8tj43$createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
3158
3158
  const productCards = $8tj43$createComponent((0, $8tj43$For), {
3159
3159
  get each() {
3160
- return Object.keys(listings_by_id());
3160
+ return $8tj43$memo(() => !!showPlaceholders_())() ? [,,,] : Object.keys(listings_by_id());
3161
3161
  },
3162
3162
  children: (listingId, index) => {
3163
- const listing = $8tj43$createMemo(() => listings_by_id()[listingId]);
3163
+ const listing = $8tj43$createMemo(() => listingId == undefined ? undefined : listings_by_id()[listingId]);
3164
3164
  return $8tj43$createComponent((0, $26db6925469636a4$export$67152d26d4f56ee8), {
3165
3165
  listing_: listing,
3166
3166
  i18n_: i18n_,
@@ -3184,7 +3184,7 @@ function $ab401afaded322ab$export$c8d7e00464029b45(_ref) {
3184
3184
  return $8tj43$createComponent((0, $8tj43$Show), {
3185
3185
  get when() {
3186
3186
  var _listing_suggestions_2;
3187
- return (_listing_suggestions_2 = listing_suggestions_()) === null || _listing_suggestions_2 === void 0 ? void 0 : _listing_suggestions_2.length;
3187
+ return ((_listing_suggestions_2 = listing_suggestions_()) === null || _listing_suggestions_2 === void 0 ? void 0 : _listing_suggestions_2.length) || showPlaceholders_();
3188
3188
  },
3189
3189
  get children() {
3190
3190
  var _el$ = $8tj43$getNextElement($ab401afaded322ab$var$_tmpl$),
@@ -3691,7 +3691,7 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
3691
3691
  $8tj43$createEffect($8tj43$on(get_search_field_value_, () => {
3692
3692
  setShowStaleListingSuggestions(true);
3693
3693
  clearTimeout(listingSuggestionsDebounceTimeout);
3694
- listingSuggestionsDebounceTimeout = setTimeout($8tj43$catchify(() => setShowStaleListingSuggestions(false)), (0, $f7414b949aeabc90$export$62fda23edba5cc9b));
3694
+ listingSuggestionsDebounceTimeout = setTimeout($8tj43$catchify(() => setShowStaleListingSuggestions(false)), 350);
3695
3695
  }, {
3696
3696
  defer: true
3697
3697
  }));
@@ -3801,7 +3801,8 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
3801
3801
  },
3802
3802
  selected_index_: selected_index_,
3803
3803
  currently_showing_suggestions_: currently_showing_suggestions_,
3804
- modalLayoutStacked_: modalLayoutStacked_
3804
+ modalLayoutStacked_: modalLayoutStacked_,
3805
+ showPlaceholders_: () => !suggestions_response_.latest
3805
3806
  });
3806
3807
  }
3807
3808
  });
@@ -14692,6 +14693,7 @@ const $169c13c0531d91d2$export$d86a33413558014e = openModalParams => {
14692
14693
  search: search,
14693
14694
  makesNewSearch = true
14694
14695
  } = openModalParams;
14696
+ let cleanup;
14695
14697
  openModalParams.location || (openModalParams.location = "centered");
14696
14698
  if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
14697
14699
  if (openModalParams.location !== "aligned") {
@@ -14709,9 +14711,9 @@ const $169c13c0531d91d2$export$d86a33413558014e = openModalParams => {
14709
14711
  }];
14710
14712
  return;
14711
14713
  }
14712
- const {
14714
+ if (!openModalParams.ignoreFieldSize_) ({
14713
14715
  cleanup: cleanup
14714
- } = $37e8c97bb6876197$export$828dcdd425fd3231(openModalParams.element);
14716
+ } = $37e8c97bb6876197$export$828dcdd425fd3231(openModalParams.element));
14715
14717
  let dispose_aligner;
14716
14718
  /**
14717
14719
  * Setting position to fixed is important to make the modal work with align_field.
@@ -14724,7 +14726,8 @@ const $169c13c0531d91d2$export$d86a33413558014e = openModalParams => {
14724
14726
  };
14725
14727
  $8tj43$createRoot(dispose => {
14726
14728
  dispose_aligner = () => {
14727
- cleanup();
14729
+ var _cleanup;
14730
+ (_cleanup = cleanup) === null || _cleanup === void 0 || _cleanup();
14728
14731
  dispose();
14729
14732
  };
14730
14733
  $1308a7816c3d4f2d$export$b3ad617e9036868(alignmentSignals_, openModalParams.element, (0, $1308a7816c3d4f2d$export$3f238c96c45e6cc6));
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.11";
91
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.13";
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,7 +571,6 @@ 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;
575
574
  function $6ae556e536054e87$export$62f101a8aa597bf8({
576
575
  depict_api_: depict_api_,
577
576
  search_field_value_: [get_search_field_value],
@@ -596,7 +595,7 @@ function $6ae556e536054e87$export$62f101a8aa597bf8({
596
595
  // don't wait if it's the first request
597
596
  write_current_instant_query(value);
598
597
  clearTimeout(timeout);
599
- timeout = setTimeout($gVhhF$depictaiutilishared.catchify(() => write_current_instant_query(value)), $6ae556e536054e87$export$62fda23edba5cc9b);
598
+ timeout = setTimeout($gVhhF$depictaiutilishared.catchify(() => write_current_instant_query(value)), 250);
600
599
  });
601
600
  const [search_results] = $gVhhF$solidjs.createResource($gVhhF$solidjs.createMemo(() => ({
602
601
  // <-- key order important, see comment below
@@ -3089,15 +3088,16 @@ function $83e616b38be339e4$export$c8d7e00464029b45({
3089
3088
  itemIndex_: itemIndex_,
3090
3089
  selected_index_: selected_index_,
3091
3090
  modalLayoutStacked_: modalLayoutStacked_,
3091
+ showPlaceholders_: showPlaceholders_,
3092
3092
  currently_showing_suggestions_: [, set_currently_showing_suggestions]
3093
3093
  }) {
3094
3094
  const listings_by_id = $gVhhF$solidjs.createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
3095
3095
  const productCards = $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.For), {
3096
3096
  get each() {
3097
- return Object.keys(listings_by_id());
3097
+ return $gVhhF$solidjsweb.memo(() => !!showPlaceholders_())() ? [,,,] : Object.keys(listings_by_id());
3098
3098
  },
3099
3099
  children: (listingId, index) => {
3100
- const listing = $gVhhF$solidjs.createMemo(() => listings_by_id()[listingId]);
3100
+ const listing = $gVhhF$solidjs.createMemo(() => listingId == undefined ? undefined : listings_by_id()[listingId]);
3101
3101
  return $gVhhF$solidjsweb.createComponent((0, $1f3b5fa875714dea$export$67152d26d4f56ee8), {
3102
3102
  listing_: listing,
3103
3103
  i18n_: i18n_,
@@ -3117,7 +3117,7 @@ function $83e616b38be339e4$export$c8d7e00464029b45({
3117
3117
  })) || []));
3118
3118
  return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
3119
3119
  get when() {
3120
- return listing_suggestions_()?.length;
3120
+ return listing_suggestions_()?.length || showPlaceholders_();
3121
3121
  },
3122
3122
  get children() {
3123
3123
  var _el$ = $gVhhF$solidjsweb.getNextElement($83e616b38be339e4$var$_tmpl$),
@@ -3610,7 +3610,7 @@ function $11597ae03e703a47$var$RawSearchModalV2({
3610
3610
  $gVhhF$solidjs.createEffect($gVhhF$solidjs.on(get_search_field_value_, () => {
3611
3611
  setShowStaleListingSuggestions(true);
3612
3612
  clearTimeout(listingSuggestionsDebounceTimeout);
3613
- listingSuggestionsDebounceTimeout = setTimeout($gVhhF$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), (0, $6ae556e536054e87$export$62fda23edba5cc9b));
3613
+ listingSuggestionsDebounceTimeout = setTimeout($gVhhF$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), 350);
3614
3614
  }, {
3615
3615
  defer: true
3616
3616
  }));
@@ -3720,7 +3720,8 @@ function $11597ae03e703a47$var$RawSearchModalV2({
3720
3720
  },
3721
3721
  selected_index_: selected_index_,
3722
3722
  currently_showing_suggestions_: currently_showing_suggestions_,
3723
- modalLayoutStacked_: modalLayoutStacked_
3723
+ modalLayoutStacked_: modalLayoutStacked_,
3724
+ showPlaceholders_: () => !suggestions_response_.latest
3724
3725
  });
3725
3726
  }
3726
3727
  });
@@ -13834,6 +13835,7 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = openModalParams => {
13834
13835
  search: search,
13835
13836
  makesNewSearch = true
13836
13837
  } = openModalParams;
13838
+ let cleanup;
13837
13839
  openModalParams.location ||= "centered";
13838
13840
  if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
13839
13841
  if (openModalParams.location !== "aligned") {
@@ -13851,9 +13853,9 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = openModalParams => {
13851
13853
  }];
13852
13854
  return;
13853
13855
  }
13854
- const {
13856
+ if (!openModalParams.ignoreFieldSize_) ({
13855
13857
  cleanup: cleanup
13856
- } = $d8e94ea381ab57fa$export$828dcdd425fd3231(openModalParams.element);
13858
+ } = $d8e94ea381ab57fa$export$828dcdd425fd3231(openModalParams.element));
13857
13859
  let dispose_aligner;
13858
13860
  /**
13859
13861
  * Setting position to fixed is important to make the modal work with align_field.
@@ -13866,7 +13868,7 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = openModalParams => {
13866
13868
  };
13867
13869
  $gVhhF$solidjs.createRoot(dispose => {
13868
13870
  dispose_aligner = () => {
13869
- cleanup();
13871
+ cleanup?.();
13870
13872
  dispose();
13871
13873
  };
13872
13874
  $fd463ff0edb29915$export$b3ad617e9036868(alignmentSignals_, openModalParams.element, (0, $fd463ff0edb29915$export$3f238c96c45e6cc6));
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.11";
13
+ export const version = "4.0.13";
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").Node_Array;
1210
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1211
1211
  export function BreadCrumbs<T extends Display>({
1212
1212
  depict_category
1213
1213
  }: {
@@ -1323,6 +1323,10 @@ type CenteredLocation = {
1323
1323
  type AlignedLocation = {
1324
1324
  location: "aligned";
1325
1325
  element: HTMLElement;
1326
+ /**
1327
+ * If true, the height of the search field in the modal won't be set to the height of the element we're aligning to
1328
+ */
1329
+ ignoreFieldSize_?: boolean;
1326
1330
  };
1327
1331
  /**
1328
1332
  * How the modal should be opened.
@@ -1339,7 +1343,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1339
1343
  * Open the modal with support for alignment.
1340
1344
  * @returns {void}
1341
1345
  */
1342
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1346
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1343
1347
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1344
1348
  export interface PageReplacer {
1345
1349
  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.11";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.13";
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,7 +490,6 @@ 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;
494
493
  function $eea41f703612261b$export$62f101a8aa597bf8({
495
494
  depict_api_: depict_api_,
496
495
  search_field_value_: [get_search_field_value],
@@ -515,7 +514,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
515
514
  // don't wait if it's the first request
516
515
  write_current_instant_query(value);
517
516
  clearTimeout(timeout);
518
- timeout = setTimeout($9HbP8$catchify(() => write_current_instant_query(value)), $eea41f703612261b$export$62fda23edba5cc9b);
517
+ timeout = setTimeout($9HbP8$catchify(() => write_current_instant_query(value)), 250);
519
518
  });
520
519
  const [search_results] = $9HbP8$createResource($9HbP8$createMemo(() => ({
521
520
  // <-- key order important, see comment below
@@ -3008,15 +3007,16 @@ function $44f30a4222ce604b$export$c8d7e00464029b45({
3008
3007
  itemIndex_: itemIndex_,
3009
3008
  selected_index_: selected_index_,
3010
3009
  modalLayoutStacked_: modalLayoutStacked_,
3010
+ showPlaceholders_: showPlaceholders_,
3011
3011
  currently_showing_suggestions_: [, set_currently_showing_suggestions]
3012
3012
  }) {
3013
3013
  const listings_by_id = $9HbP8$createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
3014
3014
  const productCards = $9HbP8$createComponent((0, $9HbP8$For), {
3015
3015
  get each() {
3016
- return Object.keys(listings_by_id());
3016
+ return $9HbP8$memo(() => !!showPlaceholders_())() ? [,,,] : Object.keys(listings_by_id());
3017
3017
  },
3018
3018
  children: (listingId, index) => {
3019
- const listing = $9HbP8$createMemo(() => listings_by_id()[listingId]);
3019
+ const listing = $9HbP8$createMemo(() => listingId == undefined ? undefined : listings_by_id()[listingId]);
3020
3020
  return $9HbP8$createComponent((0, $4ce5b8892775b62d$export$67152d26d4f56ee8), {
3021
3021
  listing_: listing,
3022
3022
  i18n_: i18n_,
@@ -3036,7 +3036,7 @@ function $44f30a4222ce604b$export$c8d7e00464029b45({
3036
3036
  })) || []));
3037
3037
  return $9HbP8$createComponent((0, $9HbP8$Show), {
3038
3038
  get when() {
3039
- return listing_suggestions_()?.length;
3039
+ return listing_suggestions_()?.length || showPlaceholders_();
3040
3040
  },
3041
3041
  get children() {
3042
3042
  var _el$ = $9HbP8$getNextElement($44f30a4222ce604b$var$_tmpl$),
@@ -3529,7 +3529,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
3529
3529
  $9HbP8$createEffect($9HbP8$on(get_search_field_value_, () => {
3530
3530
  setShowStaleListingSuggestions(true);
3531
3531
  clearTimeout(listingSuggestionsDebounceTimeout);
3532
- listingSuggestionsDebounceTimeout = setTimeout($9HbP8$catchify(() => setShowStaleListingSuggestions(false)), (0, $eea41f703612261b$export$62fda23edba5cc9b));
3532
+ listingSuggestionsDebounceTimeout = setTimeout($9HbP8$catchify(() => setShowStaleListingSuggestions(false)), 350);
3533
3533
  }, {
3534
3534
  defer: true
3535
3535
  }));
@@ -3639,7 +3639,8 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
3639
3639
  },
3640
3640
  selected_index_: selected_index_,
3641
3641
  currently_showing_suggestions_: currently_showing_suggestions_,
3642
- modalLayoutStacked_: modalLayoutStacked_
3642
+ modalLayoutStacked_: modalLayoutStacked_,
3643
+ showPlaceholders_: () => !suggestions_response_.latest
3643
3644
  });
3644
3645
  }
3645
3646
  });
@@ -13753,6 +13754,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
13753
13754
  search: search,
13754
13755
  makesNewSearch = true
13755
13756
  } = openModalParams;
13757
+ let cleanup;
13756
13758
  openModalParams.location ||= "centered";
13757
13759
  if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
13758
13760
  if (openModalParams.location !== "aligned") {
@@ -13770,9 +13772,9 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
13770
13772
  }];
13771
13773
  return;
13772
13774
  }
13773
- const {
13775
+ if (!openModalParams.ignoreFieldSize_) ({
13774
13776
  cleanup: cleanup
13775
- } = $4ca91518c9a35379$export$828dcdd425fd3231(openModalParams.element);
13777
+ } = $4ca91518c9a35379$export$828dcdd425fd3231(openModalParams.element));
13776
13778
  let dispose_aligner;
13777
13779
  /**
13778
13780
  * Setting position to fixed is important to make the modal work with align_field.
@@ -13785,7 +13787,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
13785
13787
  };
13786
13788
  $9HbP8$createRoot(dispose => {
13787
13789
  dispose_aligner = () => {
13788
- cleanup();
13790
+ cleanup?.();
13789
13791
  dispose();
13790
13792
  };
13791
13793
  $b6d5529b253681aa$export$b3ad617e9036868(alignmentSignals_, openModalParams.element, (0, $b6d5529b253681aa$export$3f238c96c45e6cc6));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.0.11",
3
+ "version": "4.0.13",
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",
@@ -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.11";
97
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0.13";
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,7 +489,6 @@ 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;
493
492
  function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
494
493
  let {
495
494
  depict_api_: depict_api_,
@@ -515,7 +514,7 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
515
514
  // don't wait if it's the first request
516
515
  write_current_instant_query(value);
517
516
  clearTimeout(timeout);
518
- timeout = setTimeout($3hooq$depictaiutilishared.catchify(() => write_current_instant_query(value)), $6e8d48eea3d0469d$export$62fda23edba5cc9b);
517
+ timeout = setTimeout($3hooq$depictaiutilishared.catchify(() => write_current_instant_query(value)), 250);
519
518
  });
520
519
  const [search_results] = $3hooq$solidjs.createResource($3hooq$solidjs.createMemo(() => ({
521
520
  // <-- key order important, see comment below
@@ -2541,15 +2540,16 @@ function $f765bad01136eee1$export$c8d7e00464029b45(_ref) {
2541
2540
  itemIndex_: itemIndex_,
2542
2541
  selected_index_: selected_index_,
2543
2542
  modalLayoutStacked_: modalLayoutStacked_,
2543
+ showPlaceholders_: showPlaceholders_,
2544
2544
  currently_showing_suggestions_: [, set_currently_showing_suggestions]
2545
2545
  } = _ref;
2546
2546
  const listings_by_id = $3hooq$solidjs.createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
2547
2547
  const productCards = $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.For), {
2548
2548
  get each() {
2549
- return Object.keys(listings_by_id());
2549
+ return showPlaceholders_() ? [,,,] : Object.keys(listings_by_id());
2550
2550
  },
2551
2551
  children: (listingId, index) => {
2552
- const listing = $3hooq$solidjs.createMemo(() => listings_by_id()[listingId]);
2552
+ const listing = $3hooq$solidjs.createMemo(() => listingId == undefined ? undefined : listings_by_id()[listingId]);
2553
2553
  return $3hooq$solidjsweb.createComponent((0, $d1e7b96fb13cd1d3$export$67152d26d4f56ee8), {
2554
2554
  listing_: listing,
2555
2555
  i18n_: i18n_,
@@ -2573,7 +2573,7 @@ function $f765bad01136eee1$export$c8d7e00464029b45(_ref) {
2573
2573
  return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
2574
2574
  get when() {
2575
2575
  var _listing_suggestions_2;
2576
- return (_listing_suggestions_2 = listing_suggestions_()) === null || _listing_suggestions_2 === void 0 ? void 0 : _listing_suggestions_2.length;
2576
+ return ((_listing_suggestions_2 = listing_suggestions_()) === null || _listing_suggestions_2 === void 0 ? void 0 : _listing_suggestions_2.length) || showPlaceholders_();
2577
2577
  },
2578
2578
  get children() {
2579
2579
  return $3hooq$solidjsweb.ssr($f765bad01136eee1$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "order:" + $3hooq$solidjsweb.escape(itemIndex_(), true), $3hooq$solidjsweb.escape(i18n_.listing_suggestions_()), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
@@ -3013,7 +3013,7 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
3013
3013
  $3hooq$solidjs.createEffect($3hooq$solidjs.on(get_search_field_value_, () => {
3014
3014
  setShowStaleListingSuggestions(true);
3015
3015
  clearTimeout(listingSuggestionsDebounceTimeout);
3016
- listingSuggestionsDebounceTimeout = setTimeout($3hooq$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), (0, $6e8d48eea3d0469d$export$62fda23edba5cc9b));
3016
+ listingSuggestionsDebounceTimeout = setTimeout($3hooq$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), 350);
3017
3017
  }, {
3018
3018
  defer: true
3019
3019
  }));
@@ -3116,7 +3116,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
3116
3116
  },
3117
3117
  selected_index_: selected_index_,
3118
3118
  currently_showing_suggestions_: currently_showing_suggestions_,
3119
- modalLayoutStacked_: modalLayoutStacked_
3119
+ modalLayoutStacked_: modalLayoutStacked_,
3120
+ showPlaceholders_: () => !suggestions_response_.latest
3120
3121
  });
3121
3122
  }
3122
3123
  });
@@ -12297,6 +12298,7 @@ const $a24cfef36ef12dc5$export$d86a33413558014e = openModalParams => {
12297
12298
  search: search,
12298
12299
  makesNewSearch = true
12299
12300
  } = openModalParams;
12301
+ let cleanup;
12300
12302
  openModalParams.location || (openModalParams.location = "centered");
12301
12303
  if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
12302
12304
  if (openModalParams.location !== "aligned") {
@@ -12314,9 +12316,9 @@ const $a24cfef36ef12dc5$export$d86a33413558014e = openModalParams => {
12314
12316
  }];
12315
12317
  return;
12316
12318
  }
12317
- const {
12319
+ if (!openModalParams.ignoreFieldSize_) ({
12318
12320
  cleanup: cleanup
12319
- } = $98bd00c15a2e3159$export$828dcdd425fd3231(openModalParams.element);
12321
+ } = $98bd00c15a2e3159$export$828dcdd425fd3231(openModalParams.element));
12320
12322
  let dispose_aligner;
12321
12323
  /**
12322
12324
  * Setting position to fixed is important to make the modal work with align_field.
@@ -12329,7 +12331,8 @@ const $a24cfef36ef12dc5$export$d86a33413558014e = openModalParams => {
12329
12331
  };
12330
12332
  $3hooq$solidjs.createRoot(dispose => {
12331
12333
  dispose_aligner = () => {
12332
- cleanup();
12334
+ var _cleanup;
12335
+ (_cleanup = cleanup) === null || _cleanup === void 0 || _cleanup();
12333
12336
  dispose();
12334
12337
  };
12335
12338
  $d6ed4dbb6507996d$export$b3ad617e9036868(alignmentSignals_, openModalParams.element, (0, $d6ed4dbb6507996d$export$3f238c96c45e6cc6));
@@ -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.11";
13
+ export const version = "4.0.13";
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").Node_Array;
1210
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1211
1211
  export function BreadCrumbs<T extends Display>({
1212
1212
  depict_category
1213
1213
  }: {
@@ -1323,6 +1323,10 @@ type CenteredLocation = {
1323
1323
  type AlignedLocation = {
1324
1324
  location: "aligned";
1325
1325
  element: HTMLElement;
1326
+ /**
1327
+ * If true, the height of the search field in the modal won't be set to the height of the element we're aligning to
1328
+ */
1329
+ ignoreFieldSize_?: boolean;
1326
1330
  };
1327
1331
  /**
1328
1332
  * How the modal should be opened.
@@ -1339,7 +1343,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1339
1343
  * Open the modal with support for alignment.
1340
1344
  * @returns {void}
1341
1345
  */
1342
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1346
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1343
1347
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1344
1348
  export interface PageReplacer {
1345
1349
  readonly render_: () => Node_Array;
@@ -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.11";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0.13";
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,7 +405,6 @@ 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;
409
408
  function $f7414b949aeabc90$export$62f101a8aa597bf8(_ref) {
410
409
  let {
411
410
  depict_api_: depict_api_,
@@ -431,7 +430,7 @@ function $f7414b949aeabc90$export$62f101a8aa597bf8(_ref) {
431
430
  // don't wait if it's the first request
432
431
  write_current_instant_query(value);
433
432
  clearTimeout(timeout);
434
- timeout = setTimeout($b8hua$catchify(() => write_current_instant_query(value)), $f7414b949aeabc90$export$62fda23edba5cc9b);
433
+ timeout = setTimeout($b8hua$catchify(() => write_current_instant_query(value)), 250);
435
434
  });
436
435
  const [search_results] = $b8hua$createResource($b8hua$createMemo(() => ({
437
436
  // <-- key order important, see comment below
@@ -2457,15 +2456,16 @@ function $ab401afaded322ab$export$c8d7e00464029b45(_ref) {
2457
2456
  itemIndex_: itemIndex_,
2458
2457
  selected_index_: selected_index_,
2459
2458
  modalLayoutStacked_: modalLayoutStacked_,
2459
+ showPlaceholders_: showPlaceholders_,
2460
2460
  currently_showing_suggestions_: [, set_currently_showing_suggestions]
2461
2461
  } = _ref;
2462
2462
  const listings_by_id = $b8hua$createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
2463
2463
  const productCards = $b8hua$createComponent((0, $b8hua$For), {
2464
2464
  get each() {
2465
- return Object.keys(listings_by_id());
2465
+ return showPlaceholders_() ? [,,,] : Object.keys(listings_by_id());
2466
2466
  },
2467
2467
  children: (listingId, index) => {
2468
- const listing = $b8hua$createMemo(() => listings_by_id()[listingId]);
2468
+ const listing = $b8hua$createMemo(() => listingId == undefined ? undefined : listings_by_id()[listingId]);
2469
2469
  return $b8hua$createComponent((0, $26db6925469636a4$export$67152d26d4f56ee8), {
2470
2470
  listing_: listing,
2471
2471
  i18n_: i18n_,
@@ -2489,7 +2489,7 @@ function $ab401afaded322ab$export$c8d7e00464029b45(_ref) {
2489
2489
  return $b8hua$createComponent((0, $b8hua$Show), {
2490
2490
  get when() {
2491
2491
  var _listing_suggestions_2;
2492
- return (_listing_suggestions_2 = listing_suggestions_()) === null || _listing_suggestions_2 === void 0 ? void 0 : _listing_suggestions_2.length;
2492
+ return ((_listing_suggestions_2 = listing_suggestions_()) === null || _listing_suggestions_2 === void 0 ? void 0 : _listing_suggestions_2.length) || showPlaceholders_();
2493
2493
  },
2494
2494
  get children() {
2495
2495
  return $b8hua$ssr($ab401afaded322ab$var$_tmpl$, $b8hua$ssrHydrationKey(), "order:" + $b8hua$escape(itemIndex_(), true), $b8hua$escape(i18n_.listing_suggestions_()), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
@@ -2929,7 +2929,7 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
2929
2929
  $b8hua$createEffect($b8hua$on(get_search_field_value_, () => {
2930
2930
  setShowStaleListingSuggestions(true);
2931
2931
  clearTimeout(listingSuggestionsDebounceTimeout);
2932
- listingSuggestionsDebounceTimeout = setTimeout($b8hua$catchify(() => setShowStaleListingSuggestions(false)), (0, $f7414b949aeabc90$export$62fda23edba5cc9b));
2932
+ listingSuggestionsDebounceTimeout = setTimeout($b8hua$catchify(() => setShowStaleListingSuggestions(false)), 350);
2933
2933
  }, {
2934
2934
  defer: true
2935
2935
  }));
@@ -3032,7 +3032,8 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
3032
3032
  },
3033
3033
  selected_index_: selected_index_,
3034
3034
  currently_showing_suggestions_: currently_showing_suggestions_,
3035
- modalLayoutStacked_: modalLayoutStacked_
3035
+ modalLayoutStacked_: modalLayoutStacked_,
3036
+ showPlaceholders_: () => !suggestions_response_.latest
3036
3037
  });
3037
3038
  }
3038
3039
  });
@@ -12213,6 +12214,7 @@ const $169c13c0531d91d2$export$d86a33413558014e = openModalParams => {
12213
12214
  search: search,
12214
12215
  makesNewSearch = true
12215
12216
  } = openModalParams;
12217
+ let cleanup;
12216
12218
  openModalParams.location || (openModalParams.location = "centered");
12217
12219
  if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
12218
12220
  if (openModalParams.location !== "aligned") {
@@ -12230,9 +12232,9 @@ const $169c13c0531d91d2$export$d86a33413558014e = openModalParams => {
12230
12232
  }];
12231
12233
  return;
12232
12234
  }
12233
- const {
12235
+ if (!openModalParams.ignoreFieldSize_) ({
12234
12236
  cleanup: cleanup
12235
- } = $37e8c97bb6876197$export$828dcdd425fd3231(openModalParams.element);
12237
+ } = $37e8c97bb6876197$export$828dcdd425fd3231(openModalParams.element));
12236
12238
  let dispose_aligner;
12237
12239
  /**
12238
12240
  * Setting position to fixed is important to make the modal work with align_field.
@@ -12245,7 +12247,8 @@ const $169c13c0531d91d2$export$d86a33413558014e = openModalParams => {
12245
12247
  };
12246
12248
  $b8hua$createRoot(dispose => {
12247
12249
  dispose_aligner = () => {
12248
- cleanup();
12250
+ var _cleanup;
12251
+ (_cleanup = cleanup) === null || _cleanup === void 0 || _cleanup();
12249
12252
  dispose();
12250
12253
  };
12251
12254
  $1308a7816c3d4f2d$export$b3ad617e9036868(alignmentSignals_, openModalParams.element, (0, $1308a7816c3d4f2d$export$3f238c96c45e6cc6));
@@ -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.11";
91
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0.13";
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,7 +466,6 @@ 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;
470
469
  function $6ae556e536054e87$export$62f101a8aa597bf8({
471
470
  depict_api_: depict_api_,
472
471
  search_field_value_: [get_search_field_value],
@@ -491,7 +490,7 @@ function $6ae556e536054e87$export$62f101a8aa597bf8({
491
490
  // don't wait if it's the first request
492
491
  write_current_instant_query(value);
493
492
  clearTimeout(timeout);
494
- timeout = setTimeout($5vyXB$depictaiutilishared.catchify(() => write_current_instant_query(value)), $6ae556e536054e87$export$62fda23edba5cc9b);
493
+ timeout = setTimeout($5vyXB$depictaiutilishared.catchify(() => write_current_instant_query(value)), 250);
495
494
  });
496
495
  const [search_results] = $5vyXB$solidjs.createResource($5vyXB$solidjs.createMemo(() => ({
497
496
  // <-- key order important, see comment below
@@ -2415,15 +2414,16 @@ function $83e616b38be339e4$export$c8d7e00464029b45({
2415
2414
  itemIndex_: itemIndex_,
2416
2415
  selected_index_: selected_index_,
2417
2416
  modalLayoutStacked_: modalLayoutStacked_,
2417
+ showPlaceholders_: showPlaceholders_,
2418
2418
  currently_showing_suggestions_: [, set_currently_showing_suggestions]
2419
2419
  }) {
2420
2420
  const listings_by_id = $5vyXB$solidjs.createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
2421
2421
  const productCards = $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.For), {
2422
2422
  get each() {
2423
- return Object.keys(listings_by_id());
2423
+ return showPlaceholders_() ? [,,,] : Object.keys(listings_by_id());
2424
2424
  },
2425
2425
  children: (listingId, index) => {
2426
- const listing = $5vyXB$solidjs.createMemo(() => listings_by_id()[listingId]);
2426
+ const listing = $5vyXB$solidjs.createMemo(() => listingId == undefined ? undefined : listings_by_id()[listingId]);
2427
2427
  return $5vyXB$solidjsweb.createComponent((0, $1f3b5fa875714dea$export$67152d26d4f56ee8), {
2428
2428
  listing_: listing,
2429
2429
  i18n_: i18n_,
@@ -2443,7 +2443,7 @@ function $83e616b38be339e4$export$c8d7e00464029b45({
2443
2443
  })) || []));
2444
2444
  return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
2445
2445
  get when() {
2446
- return listing_suggestions_()?.length;
2446
+ return listing_suggestions_()?.length || showPlaceholders_();
2447
2447
  },
2448
2448
  get children() {
2449
2449
  return $5vyXB$solidjsweb.ssr($83e616b38be339e4$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), "order:" + $5vyXB$solidjsweb.escape(itemIndex_(), true), $5vyXB$solidjsweb.escape(i18n_.listing_suggestions_()), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
@@ -2869,7 +2869,7 @@ function $11597ae03e703a47$var$RawSearchModalV2({
2869
2869
  $5vyXB$solidjs.createEffect($5vyXB$solidjs.on(get_search_field_value_, () => {
2870
2870
  setShowStaleListingSuggestions(true);
2871
2871
  clearTimeout(listingSuggestionsDebounceTimeout);
2872
- listingSuggestionsDebounceTimeout = setTimeout($5vyXB$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), (0, $6ae556e536054e87$export$62fda23edba5cc9b));
2872
+ listingSuggestionsDebounceTimeout = setTimeout($5vyXB$depictaiutilishared.catchify(() => setShowStaleListingSuggestions(false)), 350);
2873
2873
  }, {
2874
2874
  defer: true
2875
2875
  }));
@@ -2972,7 +2972,8 @@ function $11597ae03e703a47$var$RawSearchModalV2({
2972
2972
  },
2973
2973
  selected_index_: selected_index_,
2974
2974
  currently_showing_suggestions_: currently_showing_suggestions_,
2975
- modalLayoutStacked_: modalLayoutStacked_
2975
+ modalLayoutStacked_: modalLayoutStacked_,
2976
+ showPlaceholders_: () => !suggestions_response_.latest
2976
2977
  });
2977
2978
  }
2978
2979
  });
@@ -11427,6 +11428,7 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = openModalParams => {
11427
11428
  search: search,
11428
11429
  makesNewSearch = true
11429
11430
  } = openModalParams;
11431
+ let cleanup;
11430
11432
  openModalParams.location ||= "centered";
11431
11433
  if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
11432
11434
  if (openModalParams.location !== "aligned") {
@@ -11444,9 +11446,9 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = openModalParams => {
11444
11446
  }];
11445
11447
  return;
11446
11448
  }
11447
- const {
11449
+ if (!openModalParams.ignoreFieldSize_) ({
11448
11450
  cleanup: cleanup
11449
- } = $d8e94ea381ab57fa$export$828dcdd425fd3231(openModalParams.element);
11451
+ } = $d8e94ea381ab57fa$export$828dcdd425fd3231(openModalParams.element));
11450
11452
  let dispose_aligner;
11451
11453
  /**
11452
11454
  * Setting position to fixed is important to make the modal work with align_field.
@@ -11459,7 +11461,7 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = openModalParams => {
11459
11461
  };
11460
11462
  $5vyXB$solidjs.createRoot(dispose => {
11461
11463
  dispose_aligner = () => {
11462
- cleanup();
11464
+ cleanup?.();
11463
11465
  dispose();
11464
11466
  };
11465
11467
  $fd463ff0edb29915$export$b3ad617e9036868(alignmentSignals_, openModalParams.element, (0, $fd463ff0edb29915$export$3f238c96c45e6cc6));
@@ -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.11";
13
+ export const version = "4.0.13";
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").Node_Array;
1210
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1211
1211
  export function BreadCrumbs<T extends Display>({
1212
1212
  depict_category
1213
1213
  }: {
@@ -1323,6 +1323,10 @@ type CenteredLocation = {
1323
1323
  type AlignedLocation = {
1324
1324
  location: "aligned";
1325
1325
  element: HTMLElement;
1326
+ /**
1327
+ * If true, the height of the search field in the modal won't be set to the height of the element we're aligning to
1328
+ */
1329
+ ignoreFieldSize_?: boolean;
1326
1330
  };
1327
1331
  /**
1328
1332
  * How the modal should be opened.
@@ -1339,7 +1343,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1339
1343
  * Open the modal with support for alignment.
1340
1344
  * @returns {void}
1341
1345
  */
1342
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1346
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1343
1347
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1344
1348
  export interface PageReplacer {
1345
1349
  readonly render_: () => Node_Array;
@@ -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.11";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.0.13";
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,7 +385,6 @@ 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;
389
388
  function $eea41f703612261b$export$62f101a8aa597bf8({
390
389
  depict_api_: depict_api_,
391
390
  search_field_value_: [get_search_field_value],
@@ -410,7 +409,7 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
410
409
  // don't wait if it's the first request
411
410
  write_current_instant_query(value);
412
411
  clearTimeout(timeout);
413
- timeout = setTimeout($i7OB2$catchify(() => write_current_instant_query(value)), $eea41f703612261b$export$62fda23edba5cc9b);
412
+ timeout = setTimeout($i7OB2$catchify(() => write_current_instant_query(value)), 250);
414
413
  });
415
414
  const [search_results] = $i7OB2$createResource($i7OB2$createMemo(() => ({
416
415
  // <-- key order important, see comment below
@@ -2334,15 +2333,16 @@ function $44f30a4222ce604b$export$c8d7e00464029b45({
2334
2333
  itemIndex_: itemIndex_,
2335
2334
  selected_index_: selected_index_,
2336
2335
  modalLayoutStacked_: modalLayoutStacked_,
2336
+ showPlaceholders_: showPlaceholders_,
2337
2337
  currently_showing_suggestions_: [, set_currently_showing_suggestions]
2338
2338
  }) {
2339
2339
  const listings_by_id = $i7OB2$createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
2340
2340
  const productCards = $i7OB2$createComponent((0, $i7OB2$For), {
2341
2341
  get each() {
2342
- return Object.keys(listings_by_id());
2342
+ return showPlaceholders_() ? [,,,] : Object.keys(listings_by_id());
2343
2343
  },
2344
2344
  children: (listingId, index) => {
2345
- const listing = $i7OB2$createMemo(() => listings_by_id()[listingId]);
2345
+ const listing = $i7OB2$createMemo(() => listingId == undefined ? undefined : listings_by_id()[listingId]);
2346
2346
  return $i7OB2$createComponent((0, $4ce5b8892775b62d$export$67152d26d4f56ee8), {
2347
2347
  listing_: listing,
2348
2348
  i18n_: i18n_,
@@ -2362,7 +2362,7 @@ function $44f30a4222ce604b$export$c8d7e00464029b45({
2362
2362
  })) || []));
2363
2363
  return $i7OB2$createComponent((0, $i7OB2$Show), {
2364
2364
  get when() {
2365
- return listing_suggestions_()?.length;
2365
+ return listing_suggestions_()?.length || showPlaceholders_();
2366
2366
  },
2367
2367
  get children() {
2368
2368
  return $i7OB2$ssr($44f30a4222ce604b$var$_tmpl$, $i7OB2$ssrHydrationKey(), "order:" + $i7OB2$escape(itemIndex_(), true), $i7OB2$escape(i18n_.listing_suggestions_()), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
@@ -2788,7 +2788,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
2788
2788
  $i7OB2$createEffect($i7OB2$on(get_search_field_value_, () => {
2789
2789
  setShowStaleListingSuggestions(true);
2790
2790
  clearTimeout(listingSuggestionsDebounceTimeout);
2791
- listingSuggestionsDebounceTimeout = setTimeout($i7OB2$catchify(() => setShowStaleListingSuggestions(false)), (0, $eea41f703612261b$export$62fda23edba5cc9b));
2791
+ listingSuggestionsDebounceTimeout = setTimeout($i7OB2$catchify(() => setShowStaleListingSuggestions(false)), 350);
2792
2792
  }, {
2793
2793
  defer: true
2794
2794
  }));
@@ -2891,7 +2891,8 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
2891
2891
  },
2892
2892
  selected_index_: selected_index_,
2893
2893
  currently_showing_suggestions_: currently_showing_suggestions_,
2894
- modalLayoutStacked_: modalLayoutStacked_
2894
+ modalLayoutStacked_: modalLayoutStacked_,
2895
+ showPlaceholders_: () => !suggestions_response_.latest
2895
2896
  });
2896
2897
  }
2897
2898
  });
@@ -11346,6 +11347,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
11346
11347
  search: search,
11347
11348
  makesNewSearch = true
11348
11349
  } = openModalParams;
11350
+ let cleanup;
11349
11351
  openModalParams.location ||= "centered";
11350
11352
  if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
11351
11353
  if (openModalParams.location !== "aligned") {
@@ -11363,9 +11365,9 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
11363
11365
  }];
11364
11366
  return;
11365
11367
  }
11366
- const {
11368
+ if (!openModalParams.ignoreFieldSize_) ({
11367
11369
  cleanup: cleanup
11368
- } = $4ca91518c9a35379$export$828dcdd425fd3231(openModalParams.element);
11370
+ } = $4ca91518c9a35379$export$828dcdd425fd3231(openModalParams.element));
11369
11371
  let dispose_aligner;
11370
11372
  /**
11371
11373
  * Setting position to fixed is important to make the modal work with align_field.
@@ -11378,7 +11380,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
11378
11380
  };
11379
11381
  $i7OB2$createRoot(dispose => {
11380
11382
  dispose_aligner = () => {
11381
- cleanup();
11383
+ cleanup?.();
11382
11384
  dispose();
11383
11385
  };
11384
11386
  $b6d5529b253681aa$export$b3ad617e9036868(alignmentSignals_, openModalParams.element, (0, $b6d5529b253681aa$export$3f238c96c45e6cc6));