@depict-ai/ui 4.4.0 → 4.4.1

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
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
100
100
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
101
101
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
102
102
  /*! Depict.ai search and product listing SDK */
103
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.4.0";
103
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.4.1";
104
104
  const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
105
105
  const cols_at_size = [];
106
106
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -3618,7 +3618,7 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3618
3618
  i18n_: i18n_,
3619
3619
  after_focusing_: after_focusing_,
3620
3620
  BackIcon_: BackIcon_,
3621
- submit_button_ref_: submit_button_ref_
3621
+ buttonInFieldRef_: buttonInFieldRef_
3622
3622
  } = _ref;
3623
3623
  let input_element;
3624
3624
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -3662,6 +3662,8 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3662
3662
  });
3663
3663
  const ClearButton = () => (() => {
3664
3664
  var _el$2 = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$2);
3665
+ var _ref$ = buttonInFieldRef_;
3666
+ typeof _ref$ === "function" ? $52FdA$solidjsweb.use(_ref$, _el$2) : buttonInFieldRef_ = _el$2;
3665
3667
  $52FdA$solidjsweb.spread(_el$2, $52FdA$solidjsweb.mergeProps({
3666
3668
  get classList() {
3667
3669
  return {
@@ -3805,11 +3807,11 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3805
3807
  if (!dont_submit) submit_query_();
3806
3808
  }
3807
3809
  }), true);
3808
- var _ref$ = $52FdA$depictaiutilishared.catchify(el => {
3810
+ var _ref$2 = $52FdA$depictaiutilishared.catchify(el => {
3809
3811
  input_element = el;
3810
3812
  input_field_ref_ === null || input_field_ref_ === void 0 || input_field_ref_(el);
3811
3813
  });
3812
- typeof _ref$ === "function" && $52FdA$solidjsweb.use(_ref$, _el$6);
3814
+ typeof _ref$2 === "function" && $52FdA$solidjsweb.use(_ref$2, _el$6);
3813
3815
  _el$6.classList.toggle("has-adjacent-back-button", !!!!on_back_);
3814
3816
  $52FdA$solidjsweb.insert(_el$5, !isNewModal && $52FdA$solidjsweb.createComponent(ClearButton, {}), _el$10, _co$2);
3815
3817
  $52FdA$solidjsweb.insert(_el$3, isNewModal && $52FdA$solidjsweb.createComponent(BackButton, {}), _el$17, _co$5);
@@ -3818,8 +3820,6 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3818
3820
  get children() {
3819
3821
  var _el$11 = $52FdA$solidjsweb.getNextElement($29e5dbeb69da7a36$var$_tmpl$4);
3820
3822
  $52FdA$solidjsweb.addEventListener(_el$11, "click", $52FdA$depictaiutilishared.catchify(() => submit_query_()), true);
3821
- var _ref$2 = submit_button_ref_;
3822
- typeof _ref$2 === "function" ? $52FdA$solidjsweb.use(_ref$2, _el$11) : submit_button_ref_ = _el$11;
3823
3823
  $52FdA$solidjsweb.insert(_el$11, $52FdA$solidjsweb.createComponent((0, $5b88b077e48a4451$export$82eafebb825fc23f), {}));
3824
3824
  $52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setAttribute(_el$11, "aria-label", i18n_.search_submit_button_aria_label_()));
3825
3825
  $52FdA$solidjsweb.runHydrationEvents();
@@ -13612,7 +13612,7 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
13612
13612
  bodyAlignmentSignal_: [, setBodyAlignment_],
13613
13613
  backdropStyleSignal_: [, setBackdropStyle_],
13614
13614
  setPollAlignment_: setPollAlignment_,
13615
- submitButton_: submitButton_,
13615
+ buttonInField_: buttonInField_,
13616
13616
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
13617
13617
  } = _ref;
13618
13618
  return $52FdA$solidjs.createRoot(dispose => {
@@ -13659,7 +13659,7 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
13659
13659
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
13660
13660
  setPollAlignment_(true);
13661
13661
  // Fade out submit button so there aren't two overlapping buttons for a split second
13662
- submitButton_ === null || submitButton_ === void 0 || submitButton_.animate([{
13662
+ if (pxOffCenter > 10) buttonInField_.animate([{
13663
13663
  opacity: 1
13664
13664
  }, {
13665
13665
  opacity: 0
@@ -13726,6 +13726,8 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
13726
13726
  width: width,
13727
13727
  left: left
13728
13728
  } = fakeField.getBoundingClientRect();
13729
+ // Just copy-pasted below line without thinking, it might be wrong
13730
+ const pxOffCenter = Math.abs($52FdA$solidjs.untrack(innerWidthReactive) / 2 - (left + width / 2));
13729
13731
  $ce2f7ec02a8f2173$export$23d40cc5971c3acd({
13730
13732
  setBackdropStyle_: setBackdropStyle_,
13731
13733
  setBodyAlignment_: setBodyAlignment_,
@@ -13741,12 +13743,12 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
13741
13743
  duration: closeDuration_,
13742
13744
  fill: "forwards",
13743
13745
  easing: "ease-out"
13744
- }).finished, submitButton_ === null || submitButton_ === void 0 ? void 0 : submitButton_.animate([{
13746
+ }).finished, buttonInField_.animate([{
13745
13747
  opacity: 0
13746
13748
  }, {
13747
13749
  opacity: 1
13748
13750
  }], {
13749
- duration: closeDuration_ / 3,
13751
+ duration: pxOffCenter > 10 ? closeDuration_ / 3 : 1,
13750
13752
  delay: closeDuration_ * (2 / 3),
13751
13753
  fill: "forwards"
13752
13754
  }).finished]);
@@ -13966,7 +13968,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
13966
13968
  if (!input_field_accessor_value) break add_input_field;
13967
13969
  let input_element;
13968
13970
  let div_with_field_class;
13969
- let submitButton_;
13971
+ let buttonInField;
13970
13972
  const search_field = SafeSearchField({
13971
13973
  i18n_: i18n_,
13972
13974
  search_field_value_: search_field_value_,
@@ -13976,7 +13978,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
13976
13978
  field_element_ref_: el => div_with_field_class = el,
13977
13979
  disabled_: true,
13978
13980
  BackIcon_: BackIcon_,
13979
- submit_button_ref_: el => submitButton_ = el
13981
+ buttonInFieldRef_: el => buttonInField = el
13980
13982
  });
13981
13983
  if (!search_field) break add_input_field;
13982
13984
  setModalBodyStyle({});
@@ -14011,7 +14013,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
14011
14013
  bodyAlignmentSignal_: modal_body_style,
14012
14014
  backdropStyleSignal_: modal_backdrop_style,
14013
14015
  setPollAlignment_: setPollAlignment_,
14014
- submitButton_: submitButton_,
14016
+ buttonInField_: buttonInField,
14015
14017
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
14016
14018
  });
14017
14019
  }
@@ -15066,7 +15068,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
15066
15068
  const shared_properties = $ddd39c5f36f49703$export$12fa711345994013(depict_search);
15067
15069
  return $d05611ff6b8c8357$export$23fca46f3143581f(() => {
15068
15070
  let input_element;
15069
- let submitButton_;
15071
+ let buttonInField;
15070
15072
  const search_field = $52FdA$solidjsweb.createComponent((0, $29e5dbeb69da7a36$export$b94867ecbd698f21), {
15071
15073
  get BackIcon_() {
15072
15074
  return shared_properties.BackIcon_;
@@ -15085,7 +15087,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
15085
15087
  },
15086
15088
  disabled_: true,
15087
15089
  input_field_ref_: el => input_element = el,
15088
- submit_button_ref_: el => submitButton_ = el,
15090
+ buttonInFieldRef_: el => buttonInField = el,
15089
15091
  field_element_ref_: field => {
15090
15092
  const bodyAlignmentSignal_ = $52FdA$solidjs.createSignal({
15091
15093
  position: "fixed"
@@ -15132,7 +15134,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
15132
15134
  bodyAlignmentSignal_: bodyAlignmentSignal_,
15133
15135
  backdropStyleSignal_: backdropAlignmentSignal_,
15134
15136
  setPollAlignment_: setPollAlignment_,
15135
- submitButton_: submitButton_,
15137
+ buttonInField_: buttonInField,
15136
15138
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
15137
15139
  });
15138
15140
  }
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 _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.4.0";
13
+ export const version = "4.4.1";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
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.4.0";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.4.1";
14
14
  const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
15
15
  const cols_at_size = [];
16
16
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -3528,7 +3528,7 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3528
3528
  i18n_: i18n_,
3529
3529
  after_focusing_: after_focusing_,
3530
3530
  BackIcon_: BackIcon_,
3531
- submit_button_ref_: submit_button_ref_
3531
+ buttonInFieldRef_: buttonInFieldRef_
3532
3532
  } = _ref;
3533
3533
  let input_element;
3534
3534
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -3572,6 +3572,8 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3572
3572
  });
3573
3573
  const ClearButton = () => (() => {
3574
3574
  var _el$2 = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$2);
3575
+ var _ref$ = buttonInFieldRef_;
3576
+ typeof _ref$ === "function" ? $8tj43$use(_ref$, _el$2) : buttonInFieldRef_ = _el$2;
3575
3577
  $8tj43$spread(_el$2, $8tj43$mergeProps({
3576
3578
  get classList() {
3577
3579
  return {
@@ -3715,11 +3717,11 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3715
3717
  if (!dont_submit) submit_query_();
3716
3718
  }
3717
3719
  }), true);
3718
- var _ref$ = $8tj43$catchify(el => {
3720
+ var _ref$2 = $8tj43$catchify(el => {
3719
3721
  input_element = el;
3720
3722
  input_field_ref_ === null || input_field_ref_ === void 0 || input_field_ref_(el);
3721
3723
  });
3722
- typeof _ref$ === "function" && $8tj43$use(_ref$, _el$6);
3724
+ typeof _ref$2 === "function" && $8tj43$use(_ref$2, _el$6);
3723
3725
  _el$6.classList.toggle("has-adjacent-back-button", !!!!on_back_);
3724
3726
  $8tj43$insert(_el$5, !isNewModal && $8tj43$createComponent(ClearButton, {}), _el$10, _co$2);
3725
3727
  $8tj43$insert(_el$3, isNewModal && $8tj43$createComponent(BackButton, {}), _el$17, _co$5);
@@ -3728,8 +3730,6 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
3728
3730
  get children() {
3729
3731
  var _el$11 = $8tj43$getNextElement($584c06c09cf4609d$var$_tmpl$4);
3730
3732
  $8tj43$addEventListener(_el$11, "click", $8tj43$catchify(() => submit_query_()), true);
3731
- var _ref$2 = submit_button_ref_;
3732
- typeof _ref$2 === "function" ? $8tj43$use(_ref$2, _el$11) : submit_button_ref_ = _el$11;
3733
3733
  $8tj43$insert(_el$11, $8tj43$createComponent((0, $ef0f18a578b32578$export$82eafebb825fc23f), {}));
3734
3734
  $8tj43$effect(() => $8tj43$setAttribute(_el$11, "aria-label", i18n_.search_submit_button_aria_label_()));
3735
3735
  $8tj43$runHydrationEvents();
@@ -13522,7 +13522,7 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
13522
13522
  bodyAlignmentSignal_: [, setBodyAlignment_],
13523
13523
  backdropStyleSignal_: [, setBackdropStyle_],
13524
13524
  setPollAlignment_: setPollAlignment_,
13525
- submitButton_: submitButton_,
13525
+ buttonInField_: buttonInField_,
13526
13526
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
13527
13527
  } = _ref;
13528
13528
  return $8tj43$createRoot(dispose => {
@@ -13569,7 +13569,7 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
13569
13569
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
13570
13570
  setPollAlignment_(true);
13571
13571
  // Fade out submit button so there aren't two overlapping buttons for a split second
13572
- submitButton_ === null || submitButton_ === void 0 || submitButton_.animate([{
13572
+ if (pxOffCenter > 10) buttonInField_.animate([{
13573
13573
  opacity: 1
13574
13574
  }, {
13575
13575
  opacity: 0
@@ -13636,6 +13636,8 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
13636
13636
  width: width,
13637
13637
  left: left
13638
13638
  } = fakeField.getBoundingClientRect();
13639
+ // Just copy-pasted below line without thinking, it might be wrong
13640
+ const pxOffCenter = Math.abs($8tj43$untrack(innerWidthReactive) / 2 - (left + width / 2));
13639
13641
  $d7833ca17fc05c5e$export$23d40cc5971c3acd({
13640
13642
  setBackdropStyle_: setBackdropStyle_,
13641
13643
  setBodyAlignment_: setBodyAlignment_,
@@ -13651,12 +13653,12 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
13651
13653
  duration: closeDuration_,
13652
13654
  fill: "forwards",
13653
13655
  easing: "ease-out"
13654
- }).finished, submitButton_ === null || submitButton_ === void 0 ? void 0 : submitButton_.animate([{
13656
+ }).finished, buttonInField_.animate([{
13655
13657
  opacity: 0
13656
13658
  }, {
13657
13659
  opacity: 1
13658
13660
  }], {
13659
- duration: closeDuration_ / 3,
13661
+ duration: pxOffCenter > 10 ? closeDuration_ / 3 : 1,
13660
13662
  delay: closeDuration_ * (2 / 3),
13661
13663
  fill: "forwards"
13662
13664
  }).finished]);
@@ -13876,7 +13878,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
13876
13878
  if (!input_field_accessor_value) break add_input_field;
13877
13879
  let input_element;
13878
13880
  let div_with_field_class;
13879
- let submitButton_;
13881
+ let buttonInField;
13880
13882
  const search_field = SafeSearchField({
13881
13883
  i18n_: i18n_,
13882
13884
  search_field_value_: search_field_value_,
@@ -13886,7 +13888,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
13886
13888
  field_element_ref_: el => div_with_field_class = el,
13887
13889
  disabled_: true,
13888
13890
  BackIcon_: BackIcon_,
13889
- submit_button_ref_: el => submitButton_ = el
13891
+ buttonInFieldRef_: el => buttonInField = el
13890
13892
  });
13891
13893
  if (!search_field) break add_input_field;
13892
13894
  setModalBodyStyle({});
@@ -13921,7 +13923,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
13921
13923
  bodyAlignmentSignal_: modal_body_style,
13922
13924
  backdropStyleSignal_: modal_backdrop_style,
13923
13925
  setPollAlignment_: setPollAlignment_,
13924
- submitButton_: submitButton_,
13926
+ buttonInField_: buttonInField,
13925
13927
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
13926
13928
  });
13927
13929
  }
@@ -14976,7 +14978,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
14976
14978
  const shared_properties = $eb064bc3350276c1$export$12fa711345994013(depict_search);
14977
14979
  return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
14978
14980
  let input_element;
14979
- let submitButton_;
14981
+ let buttonInField;
14980
14982
  const search_field = $8tj43$createComponent((0, $584c06c09cf4609d$export$b94867ecbd698f21), {
14981
14983
  get BackIcon_() {
14982
14984
  return shared_properties.BackIcon_;
@@ -14995,7 +14997,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
14995
14997
  },
14996
14998
  disabled_: true,
14997
14999
  input_field_ref_: el => input_element = el,
14998
- submit_button_ref_: el => submitButton_ = el,
15000
+ buttonInFieldRef_: el => buttonInField = el,
14999
15001
  field_element_ref_: field => {
15000
15002
  const bodyAlignmentSignal_ = $8tj43$createSignal({
15001
15003
  position: "fixed"
@@ -15042,7 +15044,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
15042
15044
  bodyAlignmentSignal_: bodyAlignmentSignal_,
15043
15045
  backdropStyleSignal_: backdropAlignmentSignal_,
15044
15046
  setPollAlignment_: setPollAlignment_,
15045
- submitButton_: submitButton_,
15047
+ buttonInField_: buttonInField,
15046
15048
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
15047
15049
  });
15048
15050
  }
package/latest/index.cjs CHANGED
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
94
94
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
95
95
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
96
96
  /*! Depict.ai search and product listing SDK */
97
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.4.0";
97
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.4.1";
98
98
  const $4e04be41243c3d80$var$transform_elements = sorted_cols_at_size => {
99
99
  const cols_at_size = [];
100
100
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -3427,7 +3427,7 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
3427
3427
  i18n_: i18n_,
3428
3428
  after_focusing_: after_focusing_,
3429
3429
  BackIcon_: BackIcon_,
3430
- submit_button_ref_: submit_button_ref_
3430
+ buttonInFieldRef_: buttonInFieldRef_
3431
3431
  }) {
3432
3432
  let input_element;
3433
3433
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -3468,6 +3468,8 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
3468
3468
  });
3469
3469
  const ClearButton = () => (() => {
3470
3470
  var _el$2 = $gVhhF$solidjsweb.getNextElement($66b8b9a9613c141d$var$_tmpl$2);
3471
+ var _ref$ = buttonInFieldRef_;
3472
+ typeof _ref$ === "function" ? $gVhhF$solidjsweb.use(_ref$, _el$2) : buttonInFieldRef_ = _el$2;
3471
3473
  $gVhhF$solidjsweb.spread(_el$2, $gVhhF$solidjsweb.mergeProps({
3472
3474
  get classList() {
3473
3475
  return {
@@ -3608,11 +3610,11 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
3608
3610
  if (!dont_submit) submit_query_();
3609
3611
  }
3610
3612
  }), true);
3611
- var _ref$ = $gVhhF$depictaiutilishared.catchify(el => {
3613
+ var _ref$2 = $gVhhF$depictaiutilishared.catchify(el => {
3612
3614
  input_element = el;
3613
3615
  input_field_ref_?.(el);
3614
3616
  });
3615
- typeof _ref$ === "function" && $gVhhF$solidjsweb.use(_ref$, _el$6);
3617
+ typeof _ref$2 === "function" && $gVhhF$solidjsweb.use(_ref$2, _el$6);
3616
3618
  _el$6.classList.toggle("has-adjacent-back-button", !!!!on_back_);
3617
3619
  $gVhhF$solidjsweb.insert(_el$5, !isNewModal && $gVhhF$solidjsweb.createComponent(ClearButton, {}), _el$10, _co$2);
3618
3620
  $gVhhF$solidjsweb.insert(_el$3, isNewModal && $gVhhF$solidjsweb.createComponent(BackButton, {}), _el$17, _co$5);
@@ -3621,8 +3623,6 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
3621
3623
  get children() {
3622
3624
  var _el$11 = $gVhhF$solidjsweb.getNextElement($66b8b9a9613c141d$var$_tmpl$4);
3623
3625
  $gVhhF$solidjsweb.addEventListener(_el$11, "click", $gVhhF$depictaiutilishared.catchify(() => submit_query_()), true);
3624
- var _ref$2 = submit_button_ref_;
3625
- typeof _ref$2 === "function" ? $gVhhF$solidjsweb.use(_ref$2, _el$11) : submit_button_ref_ = _el$11;
3626
3626
  $gVhhF$solidjsweb.insert(_el$11, $gVhhF$solidjsweb.createComponent((0, $87d7574e1d89d69b$export$82eafebb825fc23f), {}));
3627
3627
  $gVhhF$solidjsweb.effect(() => $gVhhF$solidjsweb.setAttribute(_el$11, "aria-label", i18n_.search_submit_button_aria_label_()));
3628
3628
  $gVhhF$solidjsweb.runHydrationEvents();
@@ -12818,7 +12818,7 @@ function $5cbaffcb5602e671$export$44f738469d5570cf({
12818
12818
  bodyAlignmentSignal_: [, setBodyAlignment_],
12819
12819
  backdropStyleSignal_: [, setBackdropStyle_],
12820
12820
  setPollAlignment_: setPollAlignment_,
12821
- submitButton_: submitButton_,
12821
+ buttonInField_: buttonInField_,
12822
12822
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
12823
12823
  }) {
12824
12824
  return $gVhhF$solidjs.createRoot(dispose => {
@@ -12865,7 +12865,7 @@ function $5cbaffcb5602e671$export$44f738469d5570cf({
12865
12865
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
12866
12866
  setPollAlignment_(true);
12867
12867
  // Fade out submit button so there aren't two overlapping buttons for a split second
12868
- submitButton_?.animate([{
12868
+ if (pxOffCenter > 10) buttonInField_.animate([{
12869
12869
  opacity: 1
12870
12870
  }, {
12871
12871
  opacity: 0
@@ -12932,6 +12932,8 @@ function $5cbaffcb5602e671$export$44f738469d5570cf({
12932
12932
  width: width,
12933
12933
  left: left
12934
12934
  } = fakeField.getBoundingClientRect();
12935
+ // Just copy-pasted below line without thinking, it might be wrong
12936
+ const pxOffCenter = Math.abs($gVhhF$solidjs.untrack(innerWidthReactive) / 2 - (left + width / 2));
12935
12937
  $6892e0748f94faa6$export$23d40cc5971c3acd({
12936
12938
  setBackdropStyle_: setBackdropStyle_,
12937
12939
  setBodyAlignment_: setBodyAlignment_,
@@ -12947,12 +12949,12 @@ function $5cbaffcb5602e671$export$44f738469d5570cf({
12947
12949
  duration: closeDuration_,
12948
12950
  fill: "forwards",
12949
12951
  easing: "ease-out"
12950
- }).finished, submitButton_?.animate([{
12952
+ }).finished, buttonInField_.animate([{
12951
12953
  opacity: 0
12952
12954
  }, {
12953
12955
  opacity: 1
12954
12956
  }], {
12955
- duration: closeDuration_ / 3,
12957
+ duration: pxOffCenter > 10 ? closeDuration_ / 3 : 1,
12956
12958
  delay: closeDuration_ * (2 / 3),
12957
12959
  fill: "forwards"
12958
12960
  }).finished]);
@@ -13154,7 +13156,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
13154
13156
  if (!input_field_accessor_value) break add_input_field;
13155
13157
  let input_element;
13156
13158
  let div_with_field_class;
13157
- let submitButton_;
13159
+ let buttonInField;
13158
13160
  const search_field = SafeSearchField({
13159
13161
  i18n_: i18n_,
13160
13162
  search_field_value_: search_field_value_,
@@ -13164,7 +13166,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
13164
13166
  field_element_ref_: el => div_with_field_class = el,
13165
13167
  disabled_: true,
13166
13168
  BackIcon_: BackIcon_,
13167
- submit_button_ref_: el => submitButton_ = el
13169
+ buttonInFieldRef_: el => buttonInField = el
13168
13170
  });
13169
13171
  if (!search_field) break add_input_field;
13170
13172
  setModalBodyStyle({});
@@ -13198,7 +13200,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
13198
13200
  bodyAlignmentSignal_: modal_body_style,
13199
13201
  backdropStyleSignal_: modal_backdrop_style,
13200
13202
  setPollAlignment_: setPollAlignment_,
13201
- submitButton_: submitButton_,
13203
+ buttonInField_: buttonInField,
13202
13204
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
13203
13205
  });
13204
13206
  }
@@ -14068,7 +14070,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
14068
14070
  const shared_properties = $2c61e4cd8229c49a$export$12fa711345994013(depict_search);
14069
14071
  return $95837413165cc2df$export$23fca46f3143581f(() => {
14070
14072
  let input_element;
14071
- let submitButton_;
14073
+ let buttonInField;
14072
14074
  const search_field = $gVhhF$solidjsweb.createComponent((0, $66b8b9a9613c141d$export$b94867ecbd698f21), {
14073
14075
  get BackIcon_() {
14074
14076
  return shared_properties.BackIcon_;
@@ -14087,7 +14089,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
14087
14089
  },
14088
14090
  disabled_: true,
14089
14091
  input_field_ref_: el => input_element = el,
14090
- submit_button_ref_: el => submitButton_ = el,
14092
+ buttonInFieldRef_: el => buttonInField = el,
14091
14093
  field_element_ref_: field => {
14092
14094
  const bodyAlignmentSignal_ = $gVhhF$solidjs.createSignal({
14093
14095
  position: "fixed"
@@ -14134,7 +14136,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
14134
14136
  bodyAlignmentSignal_: bodyAlignmentSignal_,
14135
14137
  backdropStyleSignal_: backdropAlignmentSignal_,
14136
14138
  setPollAlignment_: setPollAlignment_,
14137
- submitButton_: submitButton_,
14139
+ buttonInField_: buttonInField,
14138
14140
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
14139
14141
  });
14140
14142
  }
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 _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.4.0";
13
+ export const version = "4.4.1";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
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.4.0";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.4.1";
11
11
  const $b5cccc8ee7d24677$var$transform_elements = sorted_cols_at_size => {
12
12
  const cols_at_size = [];
13
13
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -3340,7 +3340,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
3340
3340
  i18n_: i18n_,
3341
3341
  after_focusing_: after_focusing_,
3342
3342
  BackIcon_: BackIcon_,
3343
- submit_button_ref_: submit_button_ref_
3343
+ buttonInFieldRef_: buttonInFieldRef_
3344
3344
  }) {
3345
3345
  let input_element;
3346
3346
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -3381,6 +3381,8 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
3381
3381
  });
3382
3382
  const ClearButton = () => (() => {
3383
3383
  var _el$2 = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$2);
3384
+ var _ref$ = buttonInFieldRef_;
3385
+ typeof _ref$ === "function" ? $9HbP8$use(_ref$, _el$2) : buttonInFieldRef_ = _el$2;
3384
3386
  $9HbP8$spread(_el$2, $9HbP8$mergeProps({
3385
3387
  get classList() {
3386
3388
  return {
@@ -3521,11 +3523,11 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
3521
3523
  if (!dont_submit) submit_query_();
3522
3524
  }
3523
3525
  }), true);
3524
- var _ref$ = $9HbP8$catchify(el => {
3526
+ var _ref$2 = $9HbP8$catchify(el => {
3525
3527
  input_element = el;
3526
3528
  input_field_ref_?.(el);
3527
3529
  });
3528
- typeof _ref$ === "function" && $9HbP8$use(_ref$, _el$6);
3530
+ typeof _ref$2 === "function" && $9HbP8$use(_ref$2, _el$6);
3529
3531
  _el$6.classList.toggle("has-adjacent-back-button", !!!!on_back_);
3530
3532
  $9HbP8$insert(_el$5, !isNewModal && $9HbP8$createComponent(ClearButton, {}), _el$10, _co$2);
3531
3533
  $9HbP8$insert(_el$3, isNewModal && $9HbP8$createComponent(BackButton, {}), _el$17, _co$5);
@@ -3534,8 +3536,6 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
3534
3536
  get children() {
3535
3537
  var _el$11 = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$4);
3536
3538
  $9HbP8$addEventListener(_el$11, "click", $9HbP8$catchify(() => submit_query_()), true);
3537
- var _ref$2 = submit_button_ref_;
3538
- typeof _ref$2 === "function" ? $9HbP8$use(_ref$2, _el$11) : submit_button_ref_ = _el$11;
3539
3539
  $9HbP8$insert(_el$11, $9HbP8$createComponent((0, $16f0ed5ea30d8d9c$export$82eafebb825fc23f), {}));
3540
3540
  $9HbP8$effect(() => $9HbP8$setAttribute(_el$11, "aria-label", i18n_.search_submit_button_aria_label_()));
3541
3541
  $9HbP8$runHydrationEvents();
@@ -12731,7 +12731,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
12731
12731
  bodyAlignmentSignal_: [, setBodyAlignment_],
12732
12732
  backdropStyleSignal_: [, setBackdropStyle_],
12733
12733
  setPollAlignment_: setPollAlignment_,
12734
- submitButton_: submitButton_,
12734
+ buttonInField_: buttonInField_,
12735
12735
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
12736
12736
  }) {
12737
12737
  return $9HbP8$createRoot(dispose => {
@@ -12778,7 +12778,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
12778
12778
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
12779
12779
  setPollAlignment_(true);
12780
12780
  // Fade out submit button so there aren't two overlapping buttons for a split second
12781
- submitButton_?.animate([{
12781
+ if (pxOffCenter > 10) buttonInField_.animate([{
12782
12782
  opacity: 1
12783
12783
  }, {
12784
12784
  opacity: 0
@@ -12845,6 +12845,8 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
12845
12845
  width: width,
12846
12846
  left: left
12847
12847
  } = fakeField.getBoundingClientRect();
12848
+ // Just copy-pasted below line without thinking, it might be wrong
12849
+ const pxOffCenter = Math.abs($9HbP8$untrack(innerWidthReactive) / 2 - (left + width / 2));
12848
12850
  $0a901077d5c8a2b2$export$23d40cc5971c3acd({
12849
12851
  setBackdropStyle_: setBackdropStyle_,
12850
12852
  setBodyAlignment_: setBodyAlignment_,
@@ -12860,12 +12862,12 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
12860
12862
  duration: closeDuration_,
12861
12863
  fill: "forwards",
12862
12864
  easing: "ease-out"
12863
- }).finished, submitButton_?.animate([{
12865
+ }).finished, buttonInField_.animate([{
12864
12866
  opacity: 0
12865
12867
  }, {
12866
12868
  opacity: 1
12867
12869
  }], {
12868
- duration: closeDuration_ / 3,
12870
+ duration: pxOffCenter > 10 ? closeDuration_ / 3 : 1,
12869
12871
  delay: closeDuration_ * (2 / 3),
12870
12872
  fill: "forwards"
12871
12873
  }).finished]);
@@ -13067,7 +13069,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
13067
13069
  if (!input_field_accessor_value) break add_input_field;
13068
13070
  let input_element;
13069
13071
  let div_with_field_class;
13070
- let submitButton_;
13072
+ let buttonInField;
13071
13073
  const search_field = SafeSearchField({
13072
13074
  i18n_: i18n_,
13073
13075
  search_field_value_: search_field_value_,
@@ -13077,7 +13079,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
13077
13079
  field_element_ref_: el => div_with_field_class = el,
13078
13080
  disabled_: true,
13079
13081
  BackIcon_: BackIcon_,
13080
- submit_button_ref_: el => submitButton_ = el
13082
+ buttonInFieldRef_: el => buttonInField = el
13081
13083
  });
13082
13084
  if (!search_field) break add_input_field;
13083
13085
  setModalBodyStyle({});
@@ -13111,7 +13113,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
13111
13113
  bodyAlignmentSignal_: modal_body_style,
13112
13114
  backdropStyleSignal_: modal_backdrop_style,
13113
13115
  setPollAlignment_: setPollAlignment_,
13114
- submitButton_: submitButton_,
13116
+ buttonInField_: buttonInField,
13115
13117
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
13116
13118
  });
13117
13119
  }
@@ -13981,7 +13983,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
13981
13983
  const shared_properties = $806c97b931758897$export$12fa711345994013(depict_search);
13982
13984
  return $16b52438165aafe2$export$23fca46f3143581f(() => {
13983
13985
  let input_element;
13984
- let submitButton_;
13986
+ let buttonInField;
13985
13987
  const search_field = $9HbP8$createComponent((0, $5285d2814d0fac0c$export$b94867ecbd698f21), {
13986
13988
  get BackIcon_() {
13987
13989
  return shared_properties.BackIcon_;
@@ -14000,7 +14002,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
14000
14002
  },
14001
14003
  disabled_: true,
14002
14004
  input_field_ref_: el => input_element = el,
14003
- submit_button_ref_: el => submitButton_ = el,
14005
+ buttonInFieldRef_: el => buttonInField = el,
14004
14006
  field_element_ref_: field => {
14005
14007
  const bodyAlignmentSignal_ = $9HbP8$createSignal({
14006
14008
  position: "fixed"
@@ -14047,7 +14049,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
14047
14049
  bodyAlignmentSignal_: bodyAlignmentSignal_,
14048
14050
  backdropStyleSignal_: backdropAlignmentSignal_,
14049
14051
  setPollAlignment_: setPollAlignment_,
14050
- submitButton_: submitButton_,
14052
+ buttonInField_: buttonInField,
14051
14053
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
14052
14054
  });
14053
14055
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
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",
@@ -236,7 +236,7 @@
236
236
  "@babel/plugin-transform-typescript": "^7.22.9",
237
237
  "@babel/runtime": "latest",
238
238
  "@babel/runtime-corejs3": "^7.22.6",
239
- "@depict-ai/plp-styling": "^4.1.0",
239
+ "@depict-ai/plp-styling": "^4.1.1",
240
240
  "@depict-ai/types": "^5.1.2",
241
241
  "@depict-ai/utilishared": "^2.1.2",
242
242
  "solid-js": "^1.8.12"
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
100
100
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
101
101
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
102
102
  /*! Depict.ai search and product listing SDK */
103
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.4.0";
103
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.4.1";
104
104
  const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
105
105
  const cols_at_size = [];
106
106
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -3071,7 +3071,7 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
3071
3071
  i18n_: i18n_,
3072
3072
  after_focusing_: after_focusing_,
3073
3073
  BackIcon_: BackIcon_,
3074
- submit_button_ref_: submit_button_ref_
3074
+ buttonInFieldRef_: buttonInFieldRef_
3075
3075
  } = _ref;
3076
3076
  let input_element;
3077
3077
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -11162,7 +11162,7 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
11162
11162
  bodyAlignmentSignal_: [, setBodyAlignment_],
11163
11163
  backdropStyleSignal_: [, setBackdropStyle_],
11164
11164
  setPollAlignment_: setPollAlignment_,
11165
- submitButton_: submitButton_,
11165
+ buttonInField_: buttonInField_,
11166
11166
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
11167
11167
  } = _ref;
11168
11168
  return $3hooq$solidjs.createRoot(dispose => {
@@ -11205,7 +11205,7 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
11205
11205
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
11206
11206
  setPollAlignment_(true);
11207
11207
  // Fade out submit button so there aren't two overlapping buttons for a split second
11208
- submitButton_ === null || submitButton_ === void 0 || submitButton_.animate([{
11208
+ if (pxOffCenter > 10) buttonInField_.animate([{
11209
11209
  opacity: 1
11210
11210
  }, {
11211
11211
  opacity: 0
@@ -11272,6 +11272,8 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
11272
11272
  width: width,
11273
11273
  left: left
11274
11274
  } = fakeField.getBoundingClientRect();
11275
+ // Just copy-pasted below line without thinking, it might be wrong
11276
+ const pxOffCenter = Math.abs($3hooq$solidjs.untrack(innerWidthReactive) / 2 - (left + width / 2));
11275
11277
  $ce2f7ec02a8f2173$export$23d40cc5971c3acd({
11276
11278
  setBackdropStyle_: setBackdropStyle_,
11277
11279
  setBodyAlignment_: setBodyAlignment_,
@@ -11287,12 +11289,12 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
11287
11289
  duration: closeDuration_,
11288
11290
  fill: "forwards",
11289
11291
  easing: "ease-out"
11290
- }).finished, submitButton_ === null || submitButton_ === void 0 ? void 0 : submitButton_.animate([{
11292
+ }).finished, buttonInField_.animate([{
11291
11293
  opacity: 0
11292
11294
  }, {
11293
11295
  opacity: 1
11294
11296
  }], {
11295
- duration: closeDuration_ / 3,
11297
+ duration: pxOffCenter > 10 ? closeDuration_ / 3 : 1,
11296
11298
  delay: closeDuration_ * (2 / 3),
11297
11299
  fill: "forwards"
11298
11300
  }).finished]);
@@ -11503,7 +11505,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
11503
11505
  if (!input_field_accessor_value) break add_input_field;
11504
11506
  let input_element;
11505
11507
  let div_with_field_class;
11506
- let submitButton_;
11508
+ let buttonInField;
11507
11509
  const search_field = SafeSearchField({
11508
11510
  i18n_: i18n_,
11509
11511
  search_field_value_: search_field_value_,
@@ -11513,7 +11515,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
11513
11515
  field_element_ref_: el => div_with_field_class = el,
11514
11516
  disabled_: true,
11515
11517
  BackIcon_: BackIcon_,
11516
- submit_button_ref_: el => submitButton_ = el
11518
+ buttonInFieldRef_: el => buttonInField = el
11517
11519
  });
11518
11520
  if (!search_field) break add_input_field;
11519
11521
  setModalBodyStyle({});
@@ -11548,7 +11550,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
11548
11550
  bodyAlignmentSignal_: modal_body_style,
11549
11551
  backdropStyleSignal_: modal_backdrop_style,
11550
11552
  setPollAlignment_: setPollAlignment_,
11551
- submitButton_: submitButton_,
11553
+ buttonInField_: buttonInField,
11552
11554
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
11553
11555
  });
11554
11556
  }
@@ -12571,7 +12573,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
12571
12573
  const shared_properties = $ddd39c5f36f49703$export$12fa711345994013(depict_search);
12572
12574
  return $d05611ff6b8c8357$export$23fca46f3143581f(() => {
12573
12575
  let input_element;
12574
- let submitButton_;
12576
+ let buttonInField;
12575
12577
  const search_field = $3hooq$solidjsweb.createComponent((0, $29e5dbeb69da7a36$export$b94867ecbd698f21), {
12576
12578
  get BackIcon_() {
12577
12579
  return shared_properties.BackIcon_;
@@ -12590,7 +12592,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
12590
12592
  },
12591
12593
  disabled_: true,
12592
12594
  input_field_ref_: el => input_element = el,
12593
- submit_button_ref_: el => submitButton_ = el,
12595
+ buttonInFieldRef_: el => buttonInField = el,
12594
12596
  field_element_ref_: field => {
12595
12597
  const bodyAlignmentSignal_ = $3hooq$solidjs.createSignal({
12596
12598
  position: "fixed"
@@ -12637,7 +12639,7 @@ function $98aef9965764903d$export$316f6f283ae64765(props) {
12637
12639
  bodyAlignmentSignal_: bodyAlignmentSignal_,
12638
12640
  backdropStyleSignal_: backdropAlignmentSignal_,
12639
12641
  setPollAlignment_: setPollAlignment_,
12640
- submitButton_: submitButton_,
12642
+ buttonInField_: buttonInField,
12641
12643
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
12642
12644
  });
12643
12645
  }
@@ -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 _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.4.0";
13
+ export const version = "4.4.1";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
@@ -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.4.0";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.4.1";
14
14
  const $a9c7ba6087881ac2$var$transform_elements = sorted_cols_at_size => {
15
15
  const cols_at_size = [];
16
16
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -2981,7 +2981,7 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
2981
2981
  i18n_: i18n_,
2982
2982
  after_focusing_: after_focusing_,
2983
2983
  BackIcon_: BackIcon_,
2984
- submit_button_ref_: submit_button_ref_
2984
+ buttonInFieldRef_: buttonInFieldRef_
2985
2985
  } = _ref;
2986
2986
  let input_element;
2987
2987
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -11072,7 +11072,7 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
11072
11072
  bodyAlignmentSignal_: [, setBodyAlignment_],
11073
11073
  backdropStyleSignal_: [, setBackdropStyle_],
11074
11074
  setPollAlignment_: setPollAlignment_,
11075
- submitButton_: submitButton_,
11075
+ buttonInField_: buttonInField_,
11076
11076
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
11077
11077
  } = _ref;
11078
11078
  return $b8hua$createRoot(dispose => {
@@ -11115,7 +11115,7 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
11115
11115
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
11116
11116
  setPollAlignment_(true);
11117
11117
  // Fade out submit button so there aren't two overlapping buttons for a split second
11118
- submitButton_ === null || submitButton_ === void 0 || submitButton_.animate([{
11118
+ if (pxOffCenter > 10) buttonInField_.animate([{
11119
11119
  opacity: 1
11120
11120
  }, {
11121
11121
  opacity: 0
@@ -11182,6 +11182,8 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
11182
11182
  width: width,
11183
11183
  left: left
11184
11184
  } = fakeField.getBoundingClientRect();
11185
+ // Just copy-pasted below line without thinking, it might be wrong
11186
+ const pxOffCenter = Math.abs($b8hua$untrack(innerWidthReactive) / 2 - (left + width / 2));
11185
11187
  $d7833ca17fc05c5e$export$23d40cc5971c3acd({
11186
11188
  setBackdropStyle_: setBackdropStyle_,
11187
11189
  setBodyAlignment_: setBodyAlignment_,
@@ -11197,12 +11199,12 @@ function $937791b86d3d1509$export$44f738469d5570cf(_ref) {
11197
11199
  duration: closeDuration_,
11198
11200
  fill: "forwards",
11199
11201
  easing: "ease-out"
11200
- }).finished, submitButton_ === null || submitButton_ === void 0 ? void 0 : submitButton_.animate([{
11202
+ }).finished, buttonInField_.animate([{
11201
11203
  opacity: 0
11202
11204
  }, {
11203
11205
  opacity: 1
11204
11206
  }], {
11205
- duration: closeDuration_ / 3,
11207
+ duration: pxOffCenter > 10 ? closeDuration_ / 3 : 1,
11206
11208
  delay: closeDuration_ * (2 / 3),
11207
11209
  fill: "forwards"
11208
11210
  }).finished]);
@@ -11413,7 +11415,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
11413
11415
  if (!input_field_accessor_value) break add_input_field;
11414
11416
  let input_element;
11415
11417
  let div_with_field_class;
11416
- let submitButton_;
11418
+ let buttonInField;
11417
11419
  const search_field = SafeSearchField({
11418
11420
  i18n_: i18n_,
11419
11421
  search_field_value_: search_field_value_,
@@ -11423,7 +11425,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
11423
11425
  field_element_ref_: el => div_with_field_class = el,
11424
11426
  disabled_: true,
11425
11427
  BackIcon_: BackIcon_,
11426
- submit_button_ref_: el => submitButton_ = el
11428
+ buttonInFieldRef_: el => buttonInField = el
11427
11429
  });
11428
11430
  if (!search_field) break add_input_field;
11429
11431
  setModalBodyStyle({});
@@ -11458,7 +11460,7 @@ function $da279c5a540c6846$export$a54ec244c8863715(_ref) {
11458
11460
  bodyAlignmentSignal_: modal_body_style,
11459
11461
  backdropStyleSignal_: modal_backdrop_style,
11460
11462
  setPollAlignment_: setPollAlignment_,
11461
- submitButton_: submitButton_,
11463
+ buttonInField_: buttonInField,
11462
11464
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
11463
11465
  });
11464
11466
  }
@@ -12481,7 +12483,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
12481
12483
  const shared_properties = $eb064bc3350276c1$export$12fa711345994013(depict_search);
12482
12484
  return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
12483
12485
  let input_element;
12484
- let submitButton_;
12486
+ let buttonInField;
12485
12487
  const search_field = $b8hua$createComponent((0, $584c06c09cf4609d$export$b94867ecbd698f21), {
12486
12488
  get BackIcon_() {
12487
12489
  return shared_properties.BackIcon_;
@@ -12500,7 +12502,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
12500
12502
  },
12501
12503
  disabled_: true,
12502
12504
  input_field_ref_: el => input_element = el,
12503
- submit_button_ref_: el => submitButton_ = el,
12505
+ buttonInFieldRef_: el => buttonInField = el,
12504
12506
  field_element_ref_: field => {
12505
12507
  const bodyAlignmentSignal_ = $b8hua$createSignal({
12506
12508
  position: "fixed"
@@ -12547,7 +12549,7 @@ function $a3026fb727bc7550$export$316f6f283ae64765(props) {
12547
12549
  bodyAlignmentSignal_: bodyAlignmentSignal_,
12548
12550
  backdropStyleSignal_: backdropAlignmentSignal_,
12549
12551
  setPollAlignment_: setPollAlignment_,
12550
- submitButton_: submitButton_,
12552
+ buttonInField_: buttonInField,
12551
12553
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
12552
12554
  });
12553
12555
  }
@@ -94,7 +94,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
94
94
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
95
95
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
96
96
  /*! Depict.ai search and product listing SDK */
97
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.4.0";
97
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.4.1";
98
98
  const $4e04be41243c3d80$var$transform_elements = sorted_cols_at_size => {
99
99
  const cols_at_size = [];
100
100
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -2900,7 +2900,7 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
2900
2900
  i18n_: i18n_,
2901
2901
  after_focusing_: after_focusing_,
2902
2902
  BackIcon_: BackIcon_,
2903
- submit_button_ref_: submit_button_ref_
2903
+ buttonInFieldRef_: buttonInFieldRef_
2904
2904
  }) {
2905
2905
  let input_element;
2906
2906
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -10439,7 +10439,7 @@ function $5cbaffcb5602e671$export$44f738469d5570cf({
10439
10439
  bodyAlignmentSignal_: [, setBodyAlignment_],
10440
10440
  backdropStyleSignal_: [, setBackdropStyle_],
10441
10441
  setPollAlignment_: setPollAlignment_,
10442
- submitButton_: submitButton_,
10442
+ buttonInField_: buttonInField_,
10443
10443
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
10444
10444
  }) {
10445
10445
  return $5vyXB$solidjs.createRoot(dispose => {
@@ -10482,7 +10482,7 @@ function $5cbaffcb5602e671$export$44f738469d5570cf({
10482
10482
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
10483
10483
  setPollAlignment_(true);
10484
10484
  // Fade out submit button so there aren't two overlapping buttons for a split second
10485
- submitButton_?.animate([{
10485
+ if (pxOffCenter > 10) buttonInField_.animate([{
10486
10486
  opacity: 1
10487
10487
  }, {
10488
10488
  opacity: 0
@@ -10549,6 +10549,8 @@ function $5cbaffcb5602e671$export$44f738469d5570cf({
10549
10549
  width: width,
10550
10550
  left: left
10551
10551
  } = fakeField.getBoundingClientRect();
10552
+ // Just copy-pasted below line without thinking, it might be wrong
10553
+ const pxOffCenter = Math.abs($5vyXB$solidjs.untrack(innerWidthReactive) / 2 - (left + width / 2));
10552
10554
  $6892e0748f94faa6$export$23d40cc5971c3acd({
10553
10555
  setBackdropStyle_: setBackdropStyle_,
10554
10556
  setBodyAlignment_: setBodyAlignment_,
@@ -10564,12 +10566,12 @@ function $5cbaffcb5602e671$export$44f738469d5570cf({
10564
10566
  duration: closeDuration_,
10565
10567
  fill: "forwards",
10566
10568
  easing: "ease-out"
10567
- }).finished, submitButton_?.animate([{
10569
+ }).finished, buttonInField_.animate([{
10568
10570
  opacity: 0
10569
10571
  }, {
10570
10572
  opacity: 1
10571
10573
  }], {
10572
- duration: closeDuration_ / 3,
10574
+ duration: pxOffCenter > 10 ? closeDuration_ / 3 : 1,
10573
10575
  delay: closeDuration_ * (2 / 3),
10574
10576
  fill: "forwards"
10575
10577
  }).finished]);
@@ -10762,7 +10764,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
10762
10764
  if (!input_field_accessor_value) break add_input_field;
10763
10765
  let input_element;
10764
10766
  let div_with_field_class;
10765
- let submitButton_;
10767
+ let buttonInField;
10766
10768
  const search_field = SafeSearchField({
10767
10769
  i18n_: i18n_,
10768
10770
  search_field_value_: search_field_value_,
@@ -10772,7 +10774,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
10772
10774
  field_element_ref_: el => div_with_field_class = el,
10773
10775
  disabled_: true,
10774
10776
  BackIcon_: BackIcon_,
10775
- submit_button_ref_: el => submitButton_ = el
10777
+ buttonInFieldRef_: el => buttonInField = el
10776
10778
  });
10777
10779
  if (!search_field) break add_input_field;
10778
10780
  setModalBodyStyle({});
@@ -10806,7 +10808,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({
10806
10808
  bodyAlignmentSignal_: modal_body_style,
10807
10809
  backdropStyleSignal_: modal_backdrop_style,
10808
10810
  setPollAlignment_: setPollAlignment_,
10809
- submitButton_: submitButton_,
10811
+ buttonInField_: buttonInField,
10810
10812
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
10811
10813
  });
10812
10814
  }
@@ -11644,7 +11646,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
11644
11646
  const shared_properties = $2c61e4cd8229c49a$export$12fa711345994013(depict_search);
11645
11647
  return $95837413165cc2df$export$23fca46f3143581f(() => {
11646
11648
  let input_element;
11647
- let submitButton_;
11649
+ let buttonInField;
11648
11650
  const search_field = $5vyXB$solidjsweb.createComponent((0, $66b8b9a9613c141d$export$b94867ecbd698f21), {
11649
11651
  get BackIcon_() {
11650
11652
  return shared_properties.BackIcon_;
@@ -11663,7 +11665,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
11663
11665
  },
11664
11666
  disabled_: true,
11665
11667
  input_field_ref_: el => input_element = el,
11666
- submit_button_ref_: el => submitButton_ = el,
11668
+ buttonInFieldRef_: el => buttonInField = el,
11667
11669
  field_element_ref_: field => {
11668
11670
  const bodyAlignmentSignal_ = $5vyXB$solidjs.createSignal({
11669
11671
  position: "fixed"
@@ -11710,7 +11712,7 @@ function $c0a0659cf97e8eb2$export$316f6f283ae64765(props) {
11710
11712
  bodyAlignmentSignal_: bodyAlignmentSignal_,
11711
11713
  backdropStyleSignal_: backdropAlignmentSignal_,
11712
11714
  setPollAlignment_: setPollAlignment_,
11713
- submitButton_: submitButton_,
11715
+ buttonInField_: buttonInField,
11714
11716
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
11715
11717
  });
11716
11718
  }
@@ -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 _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
13
- export const version = "4.4.0";
13
+ export const version = "4.4.1";
14
14
  declare const LISTING_ID = "listingId";
15
15
  declare const EXTERNAL_ID = "externalId";
16
16
  type ScrollRestorationData = {
@@ -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.4.0";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.4.1";
11
11
  const $b5cccc8ee7d24677$var$transform_elements = sorted_cols_at_size => {
12
12
  const cols_at_size = [];
13
13
  for (let i = 0; i < sorted_cols_at_size.length; i++) {
@@ -2813,7 +2813,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
2813
2813
  i18n_: i18n_,
2814
2814
  after_focusing_: after_focusing_,
2815
2815
  BackIcon_: BackIcon_,
2816
- submit_button_ref_: submit_button_ref_
2816
+ buttonInFieldRef_: buttonInFieldRef_
2817
2817
  }) {
2818
2818
  let input_element;
2819
2819
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -10352,7 +10352,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
10352
10352
  bodyAlignmentSignal_: [, setBodyAlignment_],
10353
10353
  backdropStyleSignal_: [, setBackdropStyle_],
10354
10354
  setPollAlignment_: setPollAlignment_,
10355
- submitButton_: submitButton_,
10355
+ buttonInField_: buttonInField_,
10356
10356
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
10357
10357
  }) {
10358
10358
  return $i7OB2$createRoot(dispose => {
@@ -10395,7 +10395,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
10395
10395
  const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
10396
10396
  setPollAlignment_(true);
10397
10397
  // Fade out submit button so there aren't two overlapping buttons for a split second
10398
- submitButton_?.animate([{
10398
+ if (pxOffCenter > 10) buttonInField_.animate([{
10399
10399
  opacity: 1
10400
10400
  }, {
10401
10401
  opacity: 0
@@ -10462,6 +10462,8 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
10462
10462
  width: width,
10463
10463
  left: left
10464
10464
  } = fakeField.getBoundingClientRect();
10465
+ // Just copy-pasted below line without thinking, it might be wrong
10466
+ const pxOffCenter = Math.abs($i7OB2$untrack(innerWidthReactive) / 2 - (left + width / 2));
10465
10467
  $0a901077d5c8a2b2$export$23d40cc5971c3acd({
10466
10468
  setBackdropStyle_: setBackdropStyle_,
10467
10469
  setBodyAlignment_: setBodyAlignment_,
@@ -10477,12 +10479,12 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
10477
10479
  duration: closeDuration_,
10478
10480
  fill: "forwards",
10479
10481
  easing: "ease-out"
10480
- }).finished, submitButton_?.animate([{
10482
+ }).finished, buttonInField_.animate([{
10481
10483
  opacity: 0
10482
10484
  }, {
10483
10485
  opacity: 1
10484
10486
  }], {
10485
- duration: closeDuration_ / 3,
10487
+ duration: pxOffCenter > 10 ? closeDuration_ / 3 : 1,
10486
10488
  delay: closeDuration_ * (2 / 3),
10487
10489
  fill: "forwards"
10488
10490
  }).finished]);
@@ -10675,7 +10677,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
10675
10677
  if (!input_field_accessor_value) break add_input_field;
10676
10678
  let input_element;
10677
10679
  let div_with_field_class;
10678
- let submitButton_;
10680
+ let buttonInField;
10679
10681
  const search_field = SafeSearchField({
10680
10682
  i18n_: i18n_,
10681
10683
  search_field_value_: search_field_value_,
@@ -10685,7 +10687,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
10685
10687
  field_element_ref_: el => div_with_field_class = el,
10686
10688
  disabled_: true,
10687
10689
  BackIcon_: BackIcon_,
10688
- submit_button_ref_: el => submitButton_ = el
10690
+ buttonInFieldRef_: el => buttonInField = el
10689
10691
  });
10690
10692
  if (!search_field) break add_input_field;
10691
10693
  setModalBodyStyle({});
@@ -10719,7 +10721,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
10719
10721
  bodyAlignmentSignal_: modal_body_style,
10720
10722
  backdropStyleSignal_: modal_backdrop_style,
10721
10723
  setPollAlignment_: setPollAlignment_,
10722
- submitButton_: submitButton_,
10724
+ buttonInField_: buttonInField,
10723
10725
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
10724
10726
  });
10725
10727
  }
@@ -11557,7 +11559,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
11557
11559
  const shared_properties = $806c97b931758897$export$12fa711345994013(depict_search);
11558
11560
  return $16b52438165aafe2$export$23fca46f3143581f(() => {
11559
11561
  let input_element;
11560
- let submitButton_;
11562
+ let buttonInField;
11561
11563
  const search_field = $i7OB2$createComponent((0, $5285d2814d0fac0c$export$b94867ecbd698f21), {
11562
11564
  get BackIcon_() {
11563
11565
  return shared_properties.BackIcon_;
@@ -11576,7 +11578,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
11576
11578
  },
11577
11579
  disabled_: true,
11578
11580
  input_field_ref_: el => input_element = el,
11579
- submit_button_ref_: el => submitButton_ = el,
11581
+ buttonInFieldRef_: el => buttonInField = el,
11580
11582
  field_element_ref_: field => {
11581
11583
  const bodyAlignmentSignal_ = $i7OB2$createSignal({
11582
11584
  position: "fixed"
@@ -11623,7 +11625,7 @@ function $58b3487626e85ece$export$316f6f283ae64765(props) {
11623
11625
  bodyAlignmentSignal_: bodyAlignmentSignal_,
11624
11626
  backdropStyleSignal_: backdropAlignmentSignal_,
11625
11627
  setPollAlignment_: setPollAlignment_,
11626
- submitButton_: submitButton_,
11628
+ buttonInField_: buttonInField,
11627
11629
  modalSearchFieldOuterWidth_: modalSearchFieldOuterWidth_
11628
11630
  });
11629
11631
  }