@depict-ai/ui 4.9.2 → 4.9.3

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.
@@ -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.9.2";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.9.3";
11
11
  function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
12
12
  const signal = $i7OB2$createSignal(false);
13
13
  $i7OB2$onCleanup($i7OB2$javascript_media_query(media_query, ({
@@ -8528,8 +8528,8 @@ function $081752ca508a876f$export$f7658c347b037c3f(props = {}) {
8528
8528
  }, props), () => $i7OB2$ssr($081752ca508a876f$var$_tmpl$), true);
8529
8529
  }
8530
8530
  var $5285d2814d0fac0c$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
8531
- $5285d2814d0fac0c$var$_tmpl$2 = ["<button", ' class="submit major" type="button"', ">", "</button>"],
8532
- $5285d2814d0fac0c$var$_tmpl$3 = ["<div", ' class="', '" role="search"><!--$-->', "<!--/--><!--$-->", '<!--/--><div class="field"><!--$-->', '<!--/--><input class="', '" tabindex="0" enterkeyhint="search"', "><!--$-->", "<!--/--></div><!--$-->", "<!--/--><!--$-->", "<!--/--></div>"];
8531
+ $5285d2814d0fac0c$var$_tmpl$2 = ['<div class="field"><!--$-->', "<!--/-->", "<!--$-->", "<!--/--></div>"],
8532
+ $5285d2814d0fac0c$var$_tmpl$3 = ["<button", ' class="submit major" type="button"', ">", "</button>"];
8533
8533
  function $5285d2814d0fac0c$export$b94867ecbd698f21({
8534
8534
  search_field_value_: [searchFieldValue, setSearchFieldValue],
8535
8535
  input_field_ref_: input_field_ref_,
@@ -8543,7 +8543,8 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
8543
8543
  after_focusing_: after_focusing_,
8544
8544
  BackIcon_: BackIcon_,
8545
8545
  buttonInFieldRef_: buttonInFieldRef_,
8546
- class_: class_
8546
+ class_: class_,
8547
+ setSearchRoleOnContainer_ = true
8547
8548
  }) {
8548
8549
  let input_element;
8549
8550
  // This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
@@ -8601,19 +8602,42 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
8601
8602
  return $i7OB2$createComponent(BackIcon_, {});
8602
8603
  }
8603
8604
  })) : $i7OB2$escape($i7OB2$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {})), true);
8604
- return $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$3, $i7OB2$ssrHydrationKey(), `search-field${on_back_ ? " in-modal" : ""}${class_?.() ? ` ${$i7OB2$escape(class_(), true)}` : ""}`, $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
8605
+ return $i7OB2$ssrElement("div", $i7OB2$mergeProps1({
8606
+ get ["class"]() {
8607
+ return `search-field${on_back_ ? " in-modal" : ""}${class_?.() ? ` ${class_()}` : ""}`;
8608
+ }
8609
+ }, setSearchRoleOnContainer_ && {
8610
+ role: "search"
8611
+ }), () => ["<!--$-->", $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
8605
8612
  get when() {
8606
8613
  return getBackButtonWidth() !== undefined && on_back_;
8607
8614
  },
8608
8615
  get children() {
8609
8616
  return $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$, $i7OB2$ssrHydrationKey(), "width:" + ($i7OB2$escape(getBackButtonWidth(), true) + "px"));
8610
8617
  }
8611
- })), !isNewModal && $i7OB2$escape($i7OB2$createComponent(BackButton, {})), isNewModal && $i7OB2$escape($i7OB2$createComponent(ClearButton, {})), `query ${!!on_back_ ? "has-adjacent-back-button" : ""}`, $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.search_field_field_aria_label_(), true), false) + $i7OB2$ssrAttribute("value", $i7OB2$escape(searchFieldValue(), true), false) + $i7OB2$ssrAttribute("placeholder", $i7OB2$escape(i18n_.placeholder_text_(), true), false), !isNewModal && $i7OB2$escape($i7OB2$createComponent(ClearButton, {})), isNewModal && $i7OB2$escape($i7OB2$createComponent(BackButton, {})), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
8618
+ })), "<!--/-->", "<!--$-->", !isNewModal && $i7OB2$escape($i7OB2$createComponent(BackButton, {})), "<!--/-->", $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$2, isNewModal && $i7OB2$escape($i7OB2$createComponent(ClearButton, {})), $i7OB2$ssrElement("input", $i7OB2$mergeProps1({
8619
+ "class": `query ${!!on_back_ ? "has-adjacent-back-button" : ""}`,
8620
+ tabindex: "0",
8621
+ enterkeyhint: "search"
8622
+ }, () => setSearchRoleOnContainer_ ? {
8623
+ "aria-label": i18n_.search_field_field_aria_label_()
8624
+ } :
8625
+ // Searchbox announces basically the same as our aria-label, we could explore always using searchbox in the future
8626
+ {
8627
+ role: "searchbox"
8628
+ }, {
8629
+ get value() {
8630
+ return searchFieldValue();
8631
+ },
8632
+ get placeholder() {
8633
+ return i18n_.placeholder_text_();
8634
+ }
8635
+ }), undefined, false), !isNewModal && $i7OB2$escape($i7OB2$createComponent(ClearButton, {}))), "<!--$-->", isNewModal && $i7OB2$escape($i7OB2$createComponent(BackButton, {})), "<!--/-->", "<!--$-->", $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
8612
8636
  when: !isNewModal,
8613
8637
  get children() {
8614
- return $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.search_submit_button_aria_label_(), true), false), $i7OB2$escape($i7OB2$createComponent((0, $16f0ed5ea30d8d9c$export$82eafebb825fc23f), {})));
8638
+ return $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.search_submit_button_aria_label_(), true), false), $i7OB2$escape($i7OB2$createComponent((0, $16f0ed5ea30d8d9c$export$82eafebb825fc23f), {})));
8615
8639
  }
8616
- })));
8640
+ })), "<!--/-->"], true);
8617
8641
  }
8618
8642
  var $ffb84ffbf4014982$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg" width="24" height="16"><path d="M.773 7.371L7.98.176C8.098.059 8.238 0 8.402 0s.305.059.422.176S9 .434 9 .598s-.059.305-.176.422L2.648 7.195h19.547a.59.59 0 0 1 .609.609c0 .172-.059.305-.176.422s-.262.176-.434.176H2.648l6.176 6.176a.59.59 0 0 1 .176.426c0 .16-.059.301-.176.422-.055.059-.121.109-.199.137s-.148.039-.223.039-.156-.012-.234-.039a.54.54 0 0 1-.187-.137L.773 8.227c-.117-.117-.176-.258-.176-.422a.6.6 0 0 1 .176-.434zm0 0"></path></svg>'];
8619
8643
  function $ffb84ffbf4014982$export$8d8893ffd8aca39a() {
@@ -8644,7 +8668,7 @@ function $512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
8644
8668
  }
8645
8669
  var $42912431795f188e$var$_tmpl$ = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
8646
8670
  $42912431795f188e$var$_tmpl$2 = ["<b", ">", "</b>"],
8647
- $42912431795f188e$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '"><!--$-->', '<!--/--><div class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
8671
+ $42912431795f188e$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '" role="search"><!--$-->', '<!--/--><div class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
8648
8672
  $42912431795f188e$var$_tmpl$4 = ["<div", ' class="', '"><div class="depict-search-modal-backdrop"></div><!--$-->', "<!--/--></div>"];
8649
8673
  /**
8650
8674
  * First generation (classic) search modal - the solid component that gets added to <body> when the search modal is opened
@@ -8776,7 +8800,8 @@ function $42912431795f188e$var$RawClassicSearchModal({
8776
8800
  const [start, end] = selected_text_range_;
8777
8801
  if (start === null || end === null) return;
8778
8802
  input_el.setSelectionRange(start, end);
8779
- }
8803
+ },
8804
+ setSearchRoleOnContainer_: false
8780
8805
  });
8781
8806
  const modal_element = $i7OB2$ssr($42912431795f188e$var$_tmpl$3, $i7OB2$ssrHydrationKey(), `depict-search-modal`, `${`body` || ""} ${$i7OB2$escape($i7OB2$escape(random_classname, true), true)}`, $i7OB2$escape(search_field), $i7OB2$escape($i7OB2$createComponent((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
8782
8807
  severity_: "error",
@@ -9088,11 +9113,10 @@ function $903297121898e5ff$export$d4994a86c6235f72({
9088
9113
  return urlObject.href;
9089
9114
  });
9090
9115
  const [isSelected, selectedDueToKeyboardNavigation] = $f4125ce4984deee6$export$fb40a80c530e5f2b(read_selected_index_, itemIndex_, () => index);
9091
- return $i7OB2$ssr($903297121898e5ff$var$_tmpl$2, $i7OB2$ssrHydrationKey(), `suggestion ${isSelected() ? "selected" : ""}`, $i7OB2$ssrAttribute("href", $i7OB2$escape(href(), true), false), $i7OB2$escape($i7OB2$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
9116
+ const wholeTextToDisplay = $i7OB2$createMemo(() => item().title_);
9117
+ return $i7OB2$ssr($903297121898e5ff$var$_tmpl$2, $i7OB2$ssrHydrationKey(), `suggestion ${isSelected() ? "selected" : ""}`, $i7OB2$ssrAttribute("href", $i7OB2$escape(href(), true), false) + $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(wholeTextToDisplay(), true), false), $i7OB2$escape($i7OB2$createComponent((0, $f3213c0640246d58$export$ba17c5b7e6dda39f), {
9092
9118
  class_: "title line-clamp",
9093
- get whole_text_to_display_() {
9094
- return $i7OB2$createMemo(() => item().title_);
9095
- },
9119
+ whole_text_to_display_: wholeTextToDisplay,
9096
9120
  searching_for_value_: searching_for_value_
9097
9121
  })));
9098
9122
  }
@@ -9268,7 +9292,7 @@ var $500a16dd18ee5a71$var$_tmpl$ = ["<div", ' class="instant-results-wrapper" st
9268
9292
  $500a16dd18ee5a71$var$_tmpl$2 = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
9269
9293
  $500a16dd18ee5a71$var$_tmpl$3 = ["<b", ">", "</b>"],
9270
9294
  $500a16dd18ee5a71$var$_tmpl$4 = ["<div", ' class="', '"></div>'],
9271
- $500a16dd18ee5a71$var$_tmpl$5 = ["<div", ' class="', '"><div class="', '"><!--$-->', '<!--/--><div class="', '"></div></div><!--$-->', "<!--/--></div>"];
9295
+ $500a16dd18ee5a71$var$_tmpl$5 = ["<div", ' class="', '"><div class="', '" role="search"><!--$-->', '<!--/--><div class="', '"></div></div><!--$-->', "<!--/--></div>"];
9272
9296
  /**
9273
9297
  * Second generation search modal - the solid component that gets added to <body> when the search modal is opened
9274
9298
  */
@@ -9503,6 +9527,9 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
9503
9527
  aspectRatio: 1,
9504
9528
  get ["class"]() {
9505
9529
  return props.class_;
9530
+ },
9531
+ imgProps: {
9532
+ alt: "Product image"
9506
9533
  }
9507
9534
  }),
9508
9535
  ...instant_results_options_
@@ -9580,7 +9607,8 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
9580
9607
  const [start, end] = selected_text_range_;
9581
9608
  if (start === null || end === null) return;
9582
9609
  input_el.setSelectionRange(start, end);
9583
- }
9610
+ },
9611
+ setSearchRoleOnContainer_: false
9584
9612
  });
9585
9613
  if (setSearchFieldOuterWidth_) {
9586
9614
  const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));