@depict-ai/ui 4.9.2 → 4.9.4
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 +124 -81
- package/ES10/index.d.ts +3 -3
- package/ES10/index.js +124 -81
- package/latest/index.cjs +122 -79
- package/latest/index.d.ts +3 -3
- package/latest/index.js +122 -79
- package/package.json +1 -1
- package/server/ES10/index.cjs +55 -20
- package/server/ES10/index.d.ts +3 -3
- package/server/ES10/index.js +55 -20
- package/server/latest/index.cjs +55 -20
- package/server/latest/index.d.ts +3 -3
- package/server/latest/index.js +55 -20
package/server/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import $b8hua$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
|
|
|
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.9.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.9.4";
|
|
14
14
|
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
15
15
|
const signal = $b8hua$createSignal(false);
|
|
16
16
|
$b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
|
|
@@ -8218,7 +8218,7 @@ const $9a693c7e832d3f18$export$b05c0ae390cf3e06 = _ref => {
|
|
|
8218
8218
|
const secondary_image_url = ((_variant$image_urls = variant.image_urls) === null || _variant$image_urls === void 0 ? void 0 : _variant$image_urls[1]) || variant.secondary_image_url || variant.alternative_display_image_url;
|
|
8219
8219
|
const brandInTagline = selected_index_ && variant.brand;
|
|
8220
8220
|
const TitleBrandTagline = () => [!selected_index_ && $b8hua$ssr($9a693c7e832d3f18$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape(variant.brand)), $b8hua$ssr($9a693c7e832d3f18$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("title", $b8hua$escape(variant.title, true), false), $b8hua$escape(variant.title)), (variant.sub_heading_1 || variant.sub_heading_2 || brandInTagline) && $b8hua$ssr($9a693c7e832d3f18$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$escape([brandInTagline, variant.sub_heading_1, variant.sub_heading_2].filter(v => v).join(" | ")))];
|
|
8221
|
-
return $b8hua$ssr($9a693c7e832d3f18$var$_tmpl$6, $b8hua$ssrHydrationKey(), "instant-card ".concat(isSelected !== null && isSelected !== void 0 && isSelected() ? "selected" : ""), $b8hua$ssrAttribute("href", $b8hua$escape(href(), true), false) + $b8hua$ssrAttribute("data-search-result-id", $b8hua$escape(display_.search_result_id, true), false), $b8hua$escape($b8hua$createComponent(InstantCardImageComponent_, {
|
|
8221
|
+
return $b8hua$ssr($9a693c7e832d3f18$var$_tmpl$6, $b8hua$ssrHydrationKey(), "instant-card ".concat(isSelected !== null && isSelected !== void 0 && isSelected() ? "selected" : ""), $b8hua$ssrAttribute("href", $b8hua$escape(href(), true), false) + $b8hua$ssrAttribute("data-search-result-id", $b8hua$escape(display_.search_result_id, true), false) + $b8hua$ssrAttribute("aria-selected", $b8hua$escape(isSelected === null || isSelected === void 0 ? void 0 : isSelected(), true), false), $b8hua$escape($b8hua$createComponent(InstantCardImageComponent_, {
|
|
8222
8222
|
get src_() {
|
|
8223
8223
|
var _variant$image_urls2;
|
|
8224
8224
|
return ((_variant$image_urls2 = variant.image_urls) === null || _variant$image_urls2 === void 0 ? void 0 : _variant$image_urls2[0]) || variant.image_url || variant.display_image_url;
|
|
@@ -9065,8 +9065,8 @@ function $83c36ed4520d0335$export$f7658c347b037c3f() {
|
|
|
9065
9065
|
}, props), () => $b8hua$ssr($83c36ed4520d0335$var$_tmpl$), true);
|
|
9066
9066
|
}
|
|
9067
9067
|
var $584c06c09cf4609d$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
|
|
9068
|
-
$584c06c09cf4609d$var$_tmpl$2 = [
|
|
9069
|
-
$584c06c09cf4609d$var$_tmpl$3 = ["<
|
|
9068
|
+
$584c06c09cf4609d$var$_tmpl$2 = ['<div class="field"><!--$-->', "<!--/-->", "<!--$-->", "<!--/--></div>"],
|
|
9069
|
+
$584c06c09cf4609d$var$_tmpl$3 = ["<button", ' class="submit major" type="button"', ">", "</button>"];
|
|
9070
9070
|
function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
|
|
9071
9071
|
let {
|
|
9072
9072
|
search_field_value_: [searchFieldValue, setSearchFieldValue],
|
|
@@ -9081,7 +9081,9 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
|
|
|
9081
9081
|
after_focusing_: after_focusing_,
|
|
9082
9082
|
BackIcon_: BackIcon_,
|
|
9083
9083
|
buttonInFieldRef_: buttonInFieldRef_,
|
|
9084
|
-
class_: class_
|
|
9084
|
+
class_: class_,
|
|
9085
|
+
setSearchRoleOnContainer_ = true,
|
|
9086
|
+
ariaControls: ariaControls
|
|
9085
9087
|
} = _ref;
|
|
9086
9088
|
let input_element;
|
|
9087
9089
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
@@ -9142,19 +9144,46 @@ function $584c06c09cf4609d$export$b94867ecbd698f21(_ref) {
|
|
|
9142
9144
|
return $b8hua$createComponent(BackIcon_, {});
|
|
9143
9145
|
}
|
|
9144
9146
|
})) : $b8hua$escape($b8hua$createComponent((0, $9783d437ad61594c$export$3b621d86b1566b2), {})), true);
|
|
9145
|
-
return $b8hua$
|
|
9147
|
+
return $b8hua$ssrElement("div", $b8hua$mergeProps1({
|
|
9148
|
+
get ["class"]() {
|
|
9149
|
+
return "search-field".concat(on_back_ ? " in-modal" : "").concat(class_ !== null && class_ !== void 0 && class_() ? " ".concat(class_()) : "");
|
|
9150
|
+
}
|
|
9151
|
+
}, setSearchRoleOnContainer_ && {
|
|
9152
|
+
role: "search"
|
|
9153
|
+
}), () => ["<!--$-->", $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
|
|
9146
9154
|
get when() {
|
|
9147
9155
|
return getBackButtonWidth() !== undefined && on_back_;
|
|
9148
9156
|
},
|
|
9149
9157
|
get children() {
|
|
9150
9158
|
return $b8hua$ssr($584c06c09cf4609d$var$_tmpl$, $b8hua$ssrHydrationKey(), "width:" + ($b8hua$escape(getBackButtonWidth(), true) + "px"));
|
|
9151
9159
|
}
|
|
9152
|
-
})),
|
|
9160
|
+
})), "<!--/-->", "<!--$-->", !isNewModal && $b8hua$escape($b8hua$createComponent(BackButton, {})), "<!--/-->", $b8hua$ssr($584c06c09cf4609d$var$_tmpl$2, isNewModal && $b8hua$escape($b8hua$createComponent(ClearButton, {})), $b8hua$ssrElement("input", $b8hua$mergeProps1({
|
|
9161
|
+
"class": "query ".concat(!!on_back_ ? "has-adjacent-back-button" : ""),
|
|
9162
|
+
tabindex: "0",
|
|
9163
|
+
enterkeyhint: "search"
|
|
9164
|
+
}, () => setSearchRoleOnContainer_ ? {
|
|
9165
|
+
"aria-label": i18n_.search_field_field_aria_label_()
|
|
9166
|
+
} :
|
|
9167
|
+
// Searchbox announces basically the same as our aria-label, we could explore always using searchbox in the future
|
|
9168
|
+
{
|
|
9169
|
+
role: "searchbox"
|
|
9170
|
+
}, {
|
|
9171
|
+
get value() {
|
|
9172
|
+
return searchFieldValue();
|
|
9173
|
+
},
|
|
9174
|
+
get placeholder() {
|
|
9175
|
+
return i18n_.placeholder_text_();
|
|
9176
|
+
},
|
|
9177
|
+
"aria-autocomplete": "list",
|
|
9178
|
+
"aria-haspopup": "dialog"
|
|
9179
|
+
}, ariaControls && {
|
|
9180
|
+
"aria-controls": ariaControls
|
|
9181
|
+
}), undefined, false), !isNewModal && $b8hua$escape($b8hua$createComponent(ClearButton, {}))), "<!--$-->", isNewModal && $b8hua$escape($b8hua$createComponent(BackButton, {})), "<!--/-->", "<!--$-->", $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
|
|
9153
9182
|
when: !isNewModal,
|
|
9154
9183
|
get children() {
|
|
9155
|
-
return $b8hua$ssr($584c06c09cf4609d$var$_tmpl$
|
|
9184
|
+
return $b8hua$ssr($584c06c09cf4609d$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.search_submit_button_aria_label_(), true), false), $b8hua$escape($b8hua$createComponent((0, $ef0f18a578b32578$export$82eafebb825fc23f), {})));
|
|
9156
9185
|
}
|
|
9157
|
-
})));
|
|
9186
|
+
})), "<!--/-->"], true);
|
|
9158
9187
|
}
|
|
9159
9188
|
var $fac58b5610eec6a9$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>'];
|
|
9160
9189
|
function $fac58b5610eec6a9$export$8d8893ffd8aca39a() {
|
|
@@ -9185,8 +9214,8 @@ function $a82a41ab7188eda2$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
|
|
|
9185
9214
|
}
|
|
9186
9215
|
var $40411f2ec772c376$var$_tmpl$ = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
|
|
9187
9216
|
$40411f2ec772c376$var$_tmpl$2 = ["<b", ">", "</b>"],
|
|
9188
|
-
$40411f2ec772c376$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '"><!--$-->', '<!--/--><div class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
|
|
9189
|
-
$40411f2ec772c376$var$_tmpl$4 = ["<div", ' class="', '"><div class="depict-search-modal-backdrop"></div><!--$-->', "<!--/--></div>"];
|
|
9217
|
+
$40411f2ec772c376$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '" role="search" aria-label="Search modal with search field, query suggestions and result preview"><!--$-->', '<!--/--><div id="depict-suggestions-and-result-preview" class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
|
|
9218
|
+
$40411f2ec772c376$var$_tmpl$4 = ["<div", ' class="', '" role="dialog"><div class="depict-search-modal-backdrop"></div><!--$-->', "<!--/--></div>"];
|
|
9190
9219
|
/**
|
|
9191
9220
|
* First generation (classic) search modal - the solid component that gets added to <body> when the search modal is opened
|
|
9192
9221
|
*/
|
|
@@ -9323,7 +9352,9 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
|
|
|
9323
9352
|
const [start, end] = selected_text_range_;
|
|
9324
9353
|
if (start === null || end === null) return;
|
|
9325
9354
|
input_el.setSelectionRange(start, end);
|
|
9326
|
-
}
|
|
9355
|
+
},
|
|
9356
|
+
setSearchRoleOnContainer_: false,
|
|
9357
|
+
ariaControls: "depict-suggestions-and-result-preview"
|
|
9327
9358
|
});
|
|
9328
9359
|
const modal_element = $b8hua$ssr($40411f2ec772c376$var$_tmpl$3, $b8hua$ssrHydrationKey(), "depict-search-modal", "".concat("body", " ").concat($b8hua$escape($b8hua$escape(random_classname, true), true)), $b8hua$escape(search_field), $b8hua$escape($b8hua$createComponent((0, $74777e8fe65b3dcb$export$b69d0d92862de18b), {
|
|
9329
9360
|
severity_: "error",
|
|
@@ -9412,7 +9443,7 @@ function $4a3ed70b3b7c60d5$export$9ca09caa9c849d9c() {
|
|
|
9412
9443
|
return $b8hua$ssr($4a3ed70b3b7c60d5$var$_tmpl$, $b8hua$ssrHydrationKey());
|
|
9413
9444
|
}
|
|
9414
9445
|
var $26db6925469636a4$var$_tmpl$ = ["<div", ' class="images-wrapper">', "</div>"],
|
|
9415
|
-
$26db6925469636a4$var$_tmpl$2 = ["<div", ' class="', '"
|
|
9446
|
+
$26db6925469636a4$var$_tmpl$2 = ["<div", ' class="', '"', "><!--$-->", "<!--/--><!--$-->", '<!--/--><h3 class="title">', "</h3></div>"],
|
|
9416
9447
|
$26db6925469636a4$var$_tmpl$3 = ["<div", ' class="empty-image" style="', '">', "</div>"];
|
|
9417
9448
|
const $26db6925469636a4$var$aspectRatioWidthComponent = 400;
|
|
9418
9449
|
const $26db6925469636a4$var$aspectRatioHeightComponent = 200;
|
|
@@ -9447,7 +9478,7 @@ function $26db6925469636a4$export$67152d26d4f56ee8(_ref) {
|
|
|
9447
9478
|
var _listing_3;
|
|
9448
9479
|
return (_listing_3 = listing_()) === null || _listing_3 === void 0 ? void 0 : _listing_3.ancestors;
|
|
9449
9480
|
});
|
|
9450
|
-
return $b8hua$ssr($26db6925469636a4$var$_tmpl$2, $b8hua$ssrHydrationKey(), "listing-card ".concat(isSelected() ? "selected" : ""), $b8hua$escape($b8hua$createComponent(LinkToListing, {
|
|
9481
|
+
return $b8hua$ssr($26db6925469636a4$var$_tmpl$2, $b8hua$ssrHydrationKey(), "listing-card ".concat(isSelected() ? "selected" : ""), $b8hua$ssrAttribute("aria-selected", $b8hua$escape(isSelected(), true), false), $b8hua$escape($b8hua$createComponent(LinkToListing, {
|
|
9451
9482
|
"class": "image-part",
|
|
9452
9483
|
get style() {
|
|
9453
9484
|
var _image_urls$length, _image_urls;
|
|
@@ -9657,11 +9688,10 @@ function $5175a47d13b7c228$export$d4994a86c6235f72(_ref) {
|
|
|
9657
9688
|
return urlObject.href;
|
|
9658
9689
|
});
|
|
9659
9690
|
const [isSelected, selectedDueToKeyboardNavigation] = $d0883254246d3eb6$export$fb40a80c530e5f2b(read_selected_index_, itemIndex_, () => index);
|
|
9660
|
-
|
|
9691
|
+
const wholeTextToDisplay = $b8hua$createMemo(() => item().title_);
|
|
9692
|
+
return $b8hua$ssr($5175a47d13b7c228$var$_tmpl$2, $b8hua$ssrHydrationKey(), "suggestion ".concat(isSelected() ? "selected" : ""), $b8hua$ssrAttribute("aria-selected", $b8hua$escape(isSelected(), true), false) + $b8hua$ssrAttribute("href", $b8hua$escape(href(), true), false) + $b8hua$ssrAttribute("aria-label", $b8hua$escape(wholeTextToDisplay(), true), false), $b8hua$escape($b8hua$createComponent((0, $02b6641aa50ce528$export$ba17c5b7e6dda39f), {
|
|
9661
9693
|
class_: "title line-clamp",
|
|
9662
|
-
|
|
9663
|
-
return $b8hua$createMemo(() => item().title_);
|
|
9664
|
-
},
|
|
9694
|
+
whole_text_to_display_: wholeTextToDisplay,
|
|
9665
9695
|
searching_for_value_: searching_for_value_
|
|
9666
9696
|
})));
|
|
9667
9697
|
}
|
|
@@ -9841,7 +9871,7 @@ var $06fcd2a345efd24d$var$_tmpl$ = ["<div", ' class="instant-results-wrapper" st
|
|
|
9841
9871
|
$06fcd2a345efd24d$var$_tmpl$2 = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
|
|
9842
9872
|
$06fcd2a345efd24d$var$_tmpl$3 = ["<b", ">", "</b>"],
|
|
9843
9873
|
$06fcd2a345efd24d$var$_tmpl$4 = ["<div", ' class="', '"></div>'],
|
|
9844
|
-
$06fcd2a345efd24d$var$_tmpl$5 = ["<div", ' class="', '"><div class="', '"><!--$-->', '<!--/--><div class="', '"></div></div><!--$-->', "<!--/--></div>"];
|
|
9874
|
+
$06fcd2a345efd24d$var$_tmpl$5 = ["<div", ' class="', '"><div class="', '" role="search" aria-label="Search modal with search field, query suggestions and result preview"><!--$-->', '<!--/--><div id="depict-suggestions-and-result-preview" class="', '"></div></div><!--$-->', "<!--/--></div>"];
|
|
9845
9875
|
/**
|
|
9846
9876
|
* Second generation search modal - the solid component that gets added to <body> when the search modal is opened
|
|
9847
9877
|
*/
|
|
@@ -10084,6 +10114,9 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
10084
10114
|
aspectRatio: 1,
|
|
10085
10115
|
get ["class"]() {
|
|
10086
10116
|
return props.class_;
|
|
10117
|
+
},
|
|
10118
|
+
imgProps: {
|
|
10119
|
+
alt: "Product image"
|
|
10087
10120
|
}
|
|
10088
10121
|
}),
|
|
10089
10122
|
...instant_results_options_
|
|
@@ -10164,7 +10197,9 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
|
|
|
10164
10197
|
const [start, end] = selected_text_range_;
|
|
10165
10198
|
if (start === null || end === null) return;
|
|
10166
10199
|
input_el.setSelectionRange(start, end);
|
|
10167
|
-
}
|
|
10200
|
+
},
|
|
10201
|
+
setSearchRoleOnContainer_: false,
|
|
10202
|
+
ariaControls: "depict-suggestions-and-result-preview"
|
|
10168
10203
|
});
|
|
10169
10204
|
if (setSearchFieldOuterWidth_) {
|
|
10170
10205
|
const resizeObserver = new ResizeObserver($b8hua$catchify1(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
|
package/server/latest/index.cjs
CHANGED
|
@@ -109,7 +109,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
|
|
|
109
109
|
$parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
|
|
110
110
|
$parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
|
|
111
111
|
/*! Depict.ai search and product listing SDK */
|
|
112
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.9.
|
|
112
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.9.4";
|
|
113
113
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
114
114
|
const signal = $5vyXB$solidjs.createSignal(false);
|
|
115
115
|
$5vyXB$solidjs.onCleanup($5vyXB$depictaiutilishared.javascript_media_query(media_query, ({
|
|
@@ -7834,7 +7834,7 @@ const $6ae613870d3380fc$export$b05c0ae390cf3e06 = ({
|
|
|
7834
7834
|
const secondary_image_url = variant.image_urls?.[1] || variant.secondary_image_url || variant.alternative_display_image_url;
|
|
7835
7835
|
const brandInTagline = selected_index_ && variant.brand;
|
|
7836
7836
|
const TitleBrandTagline = () => [!selected_index_ && $5vyXB$solidjsweb.ssr($6ae613870d3380fc$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape(variant.brand)), $5vyXB$solidjsweb.ssr($6ae613870d3380fc$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("title", $5vyXB$solidjsweb.escape(variant.title, true), false), $5vyXB$solidjsweb.escape(variant.title)), (variant.sub_heading_1 || variant.sub_heading_2 || brandInTagline) && $5vyXB$solidjsweb.ssr($6ae613870d3380fc$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.escape([brandInTagline, variant.sub_heading_1, variant.sub_heading_2].filter(v => v).join(" | ")))];
|
|
7837
|
-
return $5vyXB$solidjsweb.ssr($6ae613870d3380fc$var$_tmpl$6, $5vyXB$solidjsweb.ssrHydrationKey(), `instant-card ${isSelected?.() ? "selected" : ""}`, $5vyXB$solidjsweb.ssrAttribute("href", $5vyXB$solidjsweb.escape(href(), true), false) + $5vyXB$solidjsweb.ssrAttribute("data-search-result-id", $5vyXB$solidjsweb.escape(display_.search_result_id, true), false), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(InstantCardImageComponent_, {
|
|
7837
|
+
return $5vyXB$solidjsweb.ssr($6ae613870d3380fc$var$_tmpl$6, $5vyXB$solidjsweb.ssrHydrationKey(), `instant-card ${isSelected?.() ? "selected" : ""}`, $5vyXB$solidjsweb.ssrAttribute("href", $5vyXB$solidjsweb.escape(href(), true), false) + $5vyXB$solidjsweb.ssrAttribute("data-search-result-id", $5vyXB$solidjsweb.escape(display_.search_result_id, true), false) + $5vyXB$solidjsweb.ssrAttribute("aria-selected", $5vyXB$solidjsweb.escape(isSelected?.(), true), false), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(InstantCardImageComponent_, {
|
|
7838
7838
|
get src_() {
|
|
7839
7839
|
return variant.image_urls?.[0] || variant.image_url || variant.display_image_url;
|
|
7840
7840
|
}
|
|
@@ -8630,8 +8630,8 @@ function $0175183387c8923a$export$f7658c347b037c3f(props = {}) {
|
|
|
8630
8630
|
}, props), () => $5vyXB$solidjsweb.ssr($0175183387c8923a$var$_tmpl$), true);
|
|
8631
8631
|
}
|
|
8632
8632
|
var $66b8b9a9613c141d$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
|
|
8633
|
-
$66b8b9a9613c141d$var$_tmpl$2 = [
|
|
8634
|
-
$66b8b9a9613c141d$var$_tmpl$3 = ["<
|
|
8633
|
+
$66b8b9a9613c141d$var$_tmpl$2 = ['<div class="field"><!--$-->', "<!--/-->", "<!--$-->", "<!--/--></div>"],
|
|
8634
|
+
$66b8b9a9613c141d$var$_tmpl$3 = ["<button", ' class="submit major" type="button"', ">", "</button>"];
|
|
8635
8635
|
function $66b8b9a9613c141d$export$b94867ecbd698f21({
|
|
8636
8636
|
search_field_value_: [searchFieldValue, setSearchFieldValue],
|
|
8637
8637
|
input_field_ref_: input_field_ref_,
|
|
@@ -8645,7 +8645,9 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
|
|
|
8645
8645
|
after_focusing_: after_focusing_,
|
|
8646
8646
|
BackIcon_: BackIcon_,
|
|
8647
8647
|
buttonInFieldRef_: buttonInFieldRef_,
|
|
8648
|
-
class_: class_
|
|
8648
|
+
class_: class_,
|
|
8649
|
+
setSearchRoleOnContainer_ = true,
|
|
8650
|
+
ariaControls: ariaControls
|
|
8649
8651
|
}) {
|
|
8650
8652
|
let input_element;
|
|
8651
8653
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
@@ -8703,19 +8705,46 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({
|
|
|
8703
8705
|
return $5vyXB$solidjsweb.createComponent(BackIcon_, {});
|
|
8704
8706
|
}
|
|
8705
8707
|
})) : $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $c77c68e559a1506c$export$3b621d86b1566b2), {})), true);
|
|
8706
|
-
return $5vyXB$solidjsweb.
|
|
8708
|
+
return $5vyXB$solidjsweb.ssrElement("div", $5vyXB$solidjsweb.mergeProps({
|
|
8709
|
+
get ["class"]() {
|
|
8710
|
+
return `search-field${on_back_ ? " in-modal" : ""}${class_?.() ? ` ${class_()}` : ""}`;
|
|
8711
|
+
}
|
|
8712
|
+
}, setSearchRoleOnContainer_ && {
|
|
8713
|
+
role: "search"
|
|
8714
|
+
}), () => ["<!--$-->", $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
8707
8715
|
get when() {
|
|
8708
8716
|
return getBackButtonWidth() !== undefined && on_back_;
|
|
8709
8717
|
},
|
|
8710
8718
|
get children() {
|
|
8711
8719
|
return $5vyXB$solidjsweb.ssr($66b8b9a9613c141d$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), "width:" + ($5vyXB$solidjsweb.escape(getBackButtonWidth(), true) + "px"));
|
|
8712
8720
|
}
|
|
8713
|
-
})),
|
|
8721
|
+
})), "<!--/-->", "<!--$-->", !isNewModal && $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(BackButton, {})), "<!--/-->", $5vyXB$solidjsweb.ssr($66b8b9a9613c141d$var$_tmpl$2, isNewModal && $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(ClearButton, {})), $5vyXB$solidjsweb.ssrElement("input", $5vyXB$solidjsweb.mergeProps({
|
|
8722
|
+
"class": `query ${!!on_back_ ? "has-adjacent-back-button" : ""}`,
|
|
8723
|
+
tabindex: "0",
|
|
8724
|
+
enterkeyhint: "search"
|
|
8725
|
+
}, () => setSearchRoleOnContainer_ ? {
|
|
8726
|
+
"aria-label": i18n_.search_field_field_aria_label_()
|
|
8727
|
+
} :
|
|
8728
|
+
// Searchbox announces basically the same as our aria-label, we could explore always using searchbox in the future
|
|
8729
|
+
{
|
|
8730
|
+
role: "searchbox"
|
|
8731
|
+
}, {
|
|
8732
|
+
get value() {
|
|
8733
|
+
return searchFieldValue();
|
|
8734
|
+
},
|
|
8735
|
+
get placeholder() {
|
|
8736
|
+
return i18n_.placeholder_text_();
|
|
8737
|
+
},
|
|
8738
|
+
"aria-autocomplete": "list",
|
|
8739
|
+
"aria-haspopup": "dialog"
|
|
8740
|
+
}, ariaControls && {
|
|
8741
|
+
"aria-controls": ariaControls
|
|
8742
|
+
}), undefined, false), !isNewModal && $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(ClearButton, {}))), "<!--$-->", isNewModal && $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(BackButton, {})), "<!--/-->", "<!--$-->", $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
|
|
8714
8743
|
when: !isNewModal,
|
|
8715
8744
|
get children() {
|
|
8716
|
-
return $5vyXB$solidjsweb.ssr($66b8b9a9613c141d$var$_tmpl$
|
|
8745
|
+
return $5vyXB$solidjsweb.ssr($66b8b9a9613c141d$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(i18n_.search_submit_button_aria_label_(), true), false), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $87d7574e1d89d69b$export$82eafebb825fc23f), {})));
|
|
8717
8746
|
}
|
|
8718
|
-
})));
|
|
8747
|
+
})), "<!--/-->"], true);
|
|
8719
8748
|
}
|
|
8720
8749
|
var $610b584d4f54699e$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>'];
|
|
8721
8750
|
function $610b584d4f54699e$export$8d8893ffd8aca39a() {
|
|
@@ -8746,8 +8775,8 @@ function $eb3039a27db40508$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
|
|
|
8746
8775
|
}
|
|
8747
8776
|
var $44f0b2e312a9b710$var$_tmpl$ = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
|
|
8748
8777
|
$44f0b2e312a9b710$var$_tmpl$2 = ["<b", ">", "</b>"],
|
|
8749
|
-
$44f0b2e312a9b710$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '"><!--$-->', '<!--/--><div class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
|
|
8750
|
-
$44f0b2e312a9b710$var$_tmpl$4 = ["<div", ' class="', '"><div class="depict-search-modal-backdrop"></div><!--$-->', "<!--/--></div>"];
|
|
8778
|
+
$44f0b2e312a9b710$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '" role="search" aria-label="Search modal with search field, query suggestions and result preview"><!--$-->', '<!--/--><div id="depict-suggestions-and-result-preview" class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
|
|
8779
|
+
$44f0b2e312a9b710$var$_tmpl$4 = ["<div", ' class="', '" role="dialog"><div class="depict-search-modal-backdrop"></div><!--$-->', "<!--/--></div>"];
|
|
8751
8780
|
/**
|
|
8752
8781
|
* First generation (classic) search modal - the solid component that gets added to <body> when the search modal is opened
|
|
8753
8782
|
*/
|
|
@@ -8878,7 +8907,9 @@ function $44f0b2e312a9b710$var$RawClassicSearchModal({
|
|
|
8878
8907
|
const [start, end] = selected_text_range_;
|
|
8879
8908
|
if (start === null || end === null) return;
|
|
8880
8909
|
input_el.setSelectionRange(start, end);
|
|
8881
|
-
}
|
|
8910
|
+
},
|
|
8911
|
+
setSearchRoleOnContainer_: false,
|
|
8912
|
+
ariaControls: "depict-suggestions-and-result-preview"
|
|
8882
8913
|
});
|
|
8883
8914
|
const modal_element = $5vyXB$solidjsweb.ssr($44f0b2e312a9b710$var$_tmpl$3, $5vyXB$solidjsweb.ssrHydrationKey(), `depict-search-modal`, `${`body` || ""} ${$5vyXB$solidjsweb.escape($5vyXB$solidjsweb.escape(random_classname, true), true)}`, $5vyXB$solidjsweb.escape(search_field), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $edafe91daf3091d7$export$b69d0d92862de18b), {
|
|
8884
8915
|
severity_: "error",
|
|
@@ -8967,7 +8998,7 @@ function $3a1c4fee88fb8672$export$9ca09caa9c849d9c() {
|
|
|
8967
8998
|
return $5vyXB$solidjsweb.ssr($3a1c4fee88fb8672$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey());
|
|
8968
8999
|
}
|
|
8969
9000
|
var $1f3b5fa875714dea$var$_tmpl$ = ["<div", ' class="images-wrapper">', "</div>"],
|
|
8970
|
-
$1f3b5fa875714dea$var$_tmpl$2 = ["<div", ' class="', '"
|
|
9001
|
+
$1f3b5fa875714dea$var$_tmpl$2 = ["<div", ' class="', '"', "><!--$-->", "<!--/--><!--$-->", '<!--/--><h3 class="title">', "</h3></div>"],
|
|
8971
9002
|
$1f3b5fa875714dea$var$_tmpl$3 = ["<div", ' class="empty-image" style="', '">', "</div>"];
|
|
8972
9003
|
const $1f3b5fa875714dea$var$aspectRatioWidthComponent = 400;
|
|
8973
9004
|
const $1f3b5fa875714dea$var$aspectRatioHeightComponent = 200;
|
|
@@ -8992,7 +9023,7 @@ function $1f3b5fa875714dea$export$67152d26d4f56ee8({
|
|
|
8992
9023
|
const image_urls = $5vyXB$solidjs.createMemo(() => listing_()?.image_urls?.slice(0, 3));
|
|
8993
9024
|
const [isSelected, selectedDueToKeyboardNavigation] = $f144ea315d9e4caa$export$fb40a80c530e5f2b(read_selected_index_, keyboardNavigationGroupIndex_, index_);
|
|
8994
9025
|
const crumbData = $5vyXB$solidjs.createMemo(() => listing_()?.ancestors);
|
|
8995
|
-
return $5vyXB$solidjsweb.ssr($1f3b5fa875714dea$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), `listing-card ${isSelected() ? "selected" : ""}`, $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(LinkToListing, {
|
|
9026
|
+
return $5vyXB$solidjsweb.ssr($1f3b5fa875714dea$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), `listing-card ${isSelected() ? "selected" : ""}`, $5vyXB$solidjsweb.ssrAttribute("aria-selected", $5vyXB$solidjsweb.escape(isSelected(), true), false), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent(LinkToListing, {
|
|
8996
9027
|
"class": "image-part",
|
|
8997
9028
|
get style() {
|
|
8998
9029
|
return `--image-count: ${image_urls()?.length ?? 0}`;
|
|
@@ -9190,11 +9221,10 @@ function $a13dbcf80d79229c$export$d4994a86c6235f72({
|
|
|
9190
9221
|
return urlObject.href;
|
|
9191
9222
|
});
|
|
9192
9223
|
const [isSelected, selectedDueToKeyboardNavigation] = $f144ea315d9e4caa$export$fb40a80c530e5f2b(read_selected_index_, itemIndex_, () => index);
|
|
9193
|
-
|
|
9224
|
+
const wholeTextToDisplay = $5vyXB$solidjs.createMemo(() => item().title_);
|
|
9225
|
+
return $5vyXB$solidjsweb.ssr($a13dbcf80d79229c$var$_tmpl$2, $5vyXB$solidjsweb.ssrHydrationKey(), `suggestion ${isSelected() ? "selected" : ""}`, $5vyXB$solidjsweb.ssrAttribute("aria-selected", $5vyXB$solidjsweb.escape(isSelected(), true), false) + $5vyXB$solidjsweb.ssrAttribute("href", $5vyXB$solidjsweb.escape(href(), true), false) + $5vyXB$solidjsweb.ssrAttribute("aria-label", $5vyXB$solidjsweb.escape(wholeTextToDisplay(), true), false), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent((0, $d023ed916c84e75d$export$ba17c5b7e6dda39f), {
|
|
9194
9226
|
class_: "title line-clamp",
|
|
9195
|
-
|
|
9196
|
-
return $5vyXB$solidjs.createMemo(() => item().title_);
|
|
9197
|
-
},
|
|
9227
|
+
whole_text_to_display_: wholeTextToDisplay,
|
|
9198
9228
|
searching_for_value_: searching_for_value_
|
|
9199
9229
|
})));
|
|
9200
9230
|
}
|
|
@@ -9370,7 +9400,7 @@ var $11597ae03e703a47$var$_tmpl$ = ["<div", ' class="instant-results-wrapper" st
|
|
|
9370
9400
|
$11597ae03e703a47$var$_tmpl$2 = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
|
|
9371
9401
|
$11597ae03e703a47$var$_tmpl$3 = ["<b", ">", "</b>"],
|
|
9372
9402
|
$11597ae03e703a47$var$_tmpl$4 = ["<div", ' class="', '"></div>'],
|
|
9373
|
-
$11597ae03e703a47$var$_tmpl$5 = ["<div", ' class="', '"><div class="', '"><!--$-->', '<!--/--><div class="', '"></div></div><!--$-->', "<!--/--></div>"];
|
|
9403
|
+
$11597ae03e703a47$var$_tmpl$5 = ["<div", ' class="', '"><div class="', '" role="search" aria-label="Search modal with search field, query suggestions and result preview"><!--$-->', '<!--/--><div id="depict-suggestions-and-result-preview" class="', '"></div></div><!--$-->', "<!--/--></div>"];
|
|
9374
9404
|
/**
|
|
9375
9405
|
* Second generation search modal - the solid component that gets added to <body> when the search modal is opened
|
|
9376
9406
|
*/
|
|
@@ -9605,6 +9635,9 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
9605
9635
|
aspectRatio: 1,
|
|
9606
9636
|
get ["class"]() {
|
|
9607
9637
|
return props.class_;
|
|
9638
|
+
},
|
|
9639
|
+
imgProps: {
|
|
9640
|
+
alt: "Product image"
|
|
9608
9641
|
}
|
|
9609
9642
|
}),
|
|
9610
9643
|
...instant_results_options_
|
|
@@ -9682,7 +9715,9 @@ function $11597ae03e703a47$var$RawSearchModalV2({
|
|
|
9682
9715
|
const [start, end] = selected_text_range_;
|
|
9683
9716
|
if (start === null || end === null) return;
|
|
9684
9717
|
input_el.setSelectionRange(start, end);
|
|
9685
|
-
}
|
|
9718
|
+
},
|
|
9719
|
+
setSearchRoleOnContainer_: false,
|
|
9720
|
+
ariaControls: "depict-suggestions-and-result-preview"
|
|
9686
9721
|
});
|
|
9687
9722
|
if (setSearchFieldOuterWidth_) {
|
|
9688
9723
|
const resizeObserver = new ResizeObserver($5vyXB$depictaiutilishared.catchify(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
|
package/server/latest/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
13
13
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
14
|
-
export const version = "4.9.
|
|
14
|
+
export const version = "4.9.4";
|
|
15
15
|
/**
|
|
16
16
|
* Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
|
|
17
17
|
*/
|
|
@@ -1539,7 +1539,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
|
|
|
1539
1539
|
* Open the modal with support for alignment.
|
|
1540
1540
|
* @returns {void}
|
|
1541
1541
|
*/
|
|
1542
|
-
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends
|
|
1542
|
+
export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
|
|
1543
1543
|
export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
|
|
1544
1544
|
export interface PageReplacer {
|
|
1545
1545
|
readonly render_: () => Node_Array;
|
|
@@ -1619,5 +1619,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
|
|
|
1619
1619
|
layout?: PossibleLayout;
|
|
1620
1620
|
filterModalParent_?: HTMLElement | ShadowRoot;
|
|
1621
1621
|
showSliderArrow_?: boolean;
|
|
1622
|
-
}): import("@depict-ai/utilishared
|
|
1622
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1623
1623
|
export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
|
package/server/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $i7OB2$createStore, reconcile as $i7OB2$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.9.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.9.4";
|
|
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, ({
|
|
@@ -7732,7 +7732,7 @@ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = ({
|
|
|
7732
7732
|
const secondary_image_url = variant.image_urls?.[1] || variant.secondary_image_url || variant.alternative_display_image_url;
|
|
7733
7733
|
const brandInTagline = selected_index_ && variant.brand;
|
|
7734
7734
|
const TitleBrandTagline = () => [!selected_index_ && $i7OB2$ssr($e003be2a50d9e5bc$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape(variant.brand)), $i7OB2$ssr($e003be2a50d9e5bc$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("title", $i7OB2$escape(variant.title, true), false), $i7OB2$escape(variant.title)), (variant.sub_heading_1 || variant.sub_heading_2 || brandInTagline) && $i7OB2$ssr($e003be2a50d9e5bc$var$_tmpl$3, $i7OB2$ssrHydrationKey(), $i7OB2$escape([brandInTagline, variant.sub_heading_1, variant.sub_heading_2].filter(v => v).join(" | ")))];
|
|
7735
|
-
return $i7OB2$ssr($e003be2a50d9e5bc$var$_tmpl$6, $i7OB2$ssrHydrationKey(), `instant-card ${isSelected?.() ? "selected" : ""}`, $i7OB2$ssrAttribute("href", $i7OB2$escape(href(), true), false) + $i7OB2$ssrAttribute("data-search-result-id", $i7OB2$escape(display_.search_result_id, true), false), $i7OB2$escape($i7OB2$createComponent(InstantCardImageComponent_, {
|
|
7735
|
+
return $i7OB2$ssr($e003be2a50d9e5bc$var$_tmpl$6, $i7OB2$ssrHydrationKey(), `instant-card ${isSelected?.() ? "selected" : ""}`, $i7OB2$ssrAttribute("href", $i7OB2$escape(href(), true), false) + $i7OB2$ssrAttribute("data-search-result-id", $i7OB2$escape(display_.search_result_id, true), false) + $i7OB2$ssrAttribute("aria-selected", $i7OB2$escape(isSelected?.(), true), false), $i7OB2$escape($i7OB2$createComponent(InstantCardImageComponent_, {
|
|
7736
7736
|
get src_() {
|
|
7737
7737
|
return variant.image_urls?.[0] || variant.image_url || variant.display_image_url;
|
|
7738
7738
|
}
|
|
@@ -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 = [
|
|
8532
|
-
$5285d2814d0fac0c$var$_tmpl$3 = ["<
|
|
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,9 @@ 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,
|
|
8548
|
+
ariaControls: ariaControls
|
|
8547
8549
|
}) {
|
|
8548
8550
|
let input_element;
|
|
8549
8551
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
@@ -8601,19 +8603,46 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
8601
8603
|
return $i7OB2$createComponent(BackIcon_, {});
|
|
8602
8604
|
}
|
|
8603
8605
|
})) : $i7OB2$escape($i7OB2$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {})), true);
|
|
8604
|
-
return $i7OB2$
|
|
8606
|
+
return $i7OB2$ssrElement("div", $i7OB2$mergeProps1({
|
|
8607
|
+
get ["class"]() {
|
|
8608
|
+
return `search-field${on_back_ ? " in-modal" : ""}${class_?.() ? ` ${class_()}` : ""}`;
|
|
8609
|
+
}
|
|
8610
|
+
}, setSearchRoleOnContainer_ && {
|
|
8611
|
+
role: "search"
|
|
8612
|
+
}), () => ["<!--$-->", $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
8605
8613
|
get when() {
|
|
8606
8614
|
return getBackButtonWidth() !== undefined && on_back_;
|
|
8607
8615
|
},
|
|
8608
8616
|
get children() {
|
|
8609
8617
|
return $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$, $i7OB2$ssrHydrationKey(), "width:" + ($i7OB2$escape(getBackButtonWidth(), true) + "px"));
|
|
8610
8618
|
}
|
|
8611
|
-
})),
|
|
8619
|
+
})), "<!--/-->", "<!--$-->", !isNewModal && $i7OB2$escape($i7OB2$createComponent(BackButton, {})), "<!--/-->", $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$2, isNewModal && $i7OB2$escape($i7OB2$createComponent(ClearButton, {})), $i7OB2$ssrElement("input", $i7OB2$mergeProps1({
|
|
8620
|
+
"class": `query ${!!on_back_ ? "has-adjacent-back-button" : ""}`,
|
|
8621
|
+
tabindex: "0",
|
|
8622
|
+
enterkeyhint: "search"
|
|
8623
|
+
}, () => setSearchRoleOnContainer_ ? {
|
|
8624
|
+
"aria-label": i18n_.search_field_field_aria_label_()
|
|
8625
|
+
} :
|
|
8626
|
+
// Searchbox announces basically the same as our aria-label, we could explore always using searchbox in the future
|
|
8627
|
+
{
|
|
8628
|
+
role: "searchbox"
|
|
8629
|
+
}, {
|
|
8630
|
+
get value() {
|
|
8631
|
+
return searchFieldValue();
|
|
8632
|
+
},
|
|
8633
|
+
get placeholder() {
|
|
8634
|
+
return i18n_.placeholder_text_();
|
|
8635
|
+
},
|
|
8636
|
+
"aria-autocomplete": "list",
|
|
8637
|
+
"aria-haspopup": "dialog"
|
|
8638
|
+
}, ariaControls && {
|
|
8639
|
+
"aria-controls": ariaControls
|
|
8640
|
+
}), undefined, false), !isNewModal && $i7OB2$escape($i7OB2$createComponent(ClearButton, {}))), "<!--$-->", isNewModal && $i7OB2$escape($i7OB2$createComponent(BackButton, {})), "<!--/-->", "<!--$-->", $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
8612
8641
|
when: !isNewModal,
|
|
8613
8642
|
get children() {
|
|
8614
|
-
return $i7OB2$ssr($5285d2814d0fac0c$var$_tmpl$
|
|
8643
|
+
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
8644
|
}
|
|
8616
|
-
})));
|
|
8645
|
+
})), "<!--/-->"], true);
|
|
8617
8646
|
}
|
|
8618
8647
|
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
8648
|
function $ffb84ffbf4014982$export$8d8893ffd8aca39a() {
|
|
@@ -8644,8 +8673,8 @@ function $512b994d501f412b$export$93d9bfd0c9c1a5b8(close_modal, search_query_url
|
|
|
8644
8673
|
}
|
|
8645
8674
|
var $42912431795f188e$var$_tmpl$ = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
|
|
8646
8675
|
$42912431795f188e$var$_tmpl$2 = ["<b", ">", "</b>"],
|
|
8647
|
-
$42912431795f188e$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '"><!--$-->', '<!--/--><div class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
|
|
8648
|
-
$42912431795f188e$var$_tmpl$4 = ["<div", ' class="', '"><div class="depict-search-modal-backdrop"></div><!--$-->', "<!--/--></div>"];
|
|
8676
|
+
$42912431795f188e$var$_tmpl$3 = ["<div", ' class="', '"><div class="', '" role="search" aria-label="Search modal with search field, query suggestions and result preview"><!--$-->', '<!--/--><div id="depict-suggestions-and-result-preview" class="padded"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div><!--$-->", "<!--/--></div>"],
|
|
8677
|
+
$42912431795f188e$var$_tmpl$4 = ["<div", ' class="', '" role="dialog"><div class="depict-search-modal-backdrop"></div><!--$-->', "<!--/--></div>"];
|
|
8649
8678
|
/**
|
|
8650
8679
|
* First generation (classic) search modal - the solid component that gets added to <body> when the search modal is opened
|
|
8651
8680
|
*/
|
|
@@ -8776,7 +8805,9 @@ function $42912431795f188e$var$RawClassicSearchModal({
|
|
|
8776
8805
|
const [start, end] = selected_text_range_;
|
|
8777
8806
|
if (start === null || end === null) return;
|
|
8778
8807
|
input_el.setSelectionRange(start, end);
|
|
8779
|
-
}
|
|
8808
|
+
},
|
|
8809
|
+
setSearchRoleOnContainer_: false,
|
|
8810
|
+
ariaControls: "depict-suggestions-and-result-preview"
|
|
8780
8811
|
});
|
|
8781
8812
|
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
8813
|
severity_: "error",
|
|
@@ -8865,7 +8896,7 @@ function $0eb1f9e7ee46f1c2$export$9ca09caa9c849d9c() {
|
|
|
8865
8896
|
return $i7OB2$ssr($0eb1f9e7ee46f1c2$var$_tmpl$, $i7OB2$ssrHydrationKey());
|
|
8866
8897
|
}
|
|
8867
8898
|
var $4ce5b8892775b62d$var$_tmpl$ = ["<div", ' class="images-wrapper">', "</div>"],
|
|
8868
|
-
$4ce5b8892775b62d$var$_tmpl$2 = ["<div", ' class="', '"
|
|
8899
|
+
$4ce5b8892775b62d$var$_tmpl$2 = ["<div", ' class="', '"', "><!--$-->", "<!--/--><!--$-->", '<!--/--><h3 class="title">', "</h3></div>"],
|
|
8869
8900
|
$4ce5b8892775b62d$var$_tmpl$3 = ["<div", ' class="empty-image" style="', '">', "</div>"];
|
|
8870
8901
|
const $4ce5b8892775b62d$var$aspectRatioWidthComponent = 400;
|
|
8871
8902
|
const $4ce5b8892775b62d$var$aspectRatioHeightComponent = 200;
|
|
@@ -8890,7 +8921,7 @@ function $4ce5b8892775b62d$export$67152d26d4f56ee8({
|
|
|
8890
8921
|
const image_urls = $i7OB2$createMemo(() => listing_()?.image_urls?.slice(0, 3));
|
|
8891
8922
|
const [isSelected, selectedDueToKeyboardNavigation] = $f4125ce4984deee6$export$fb40a80c530e5f2b(read_selected_index_, keyboardNavigationGroupIndex_, index_);
|
|
8892
8923
|
const crumbData = $i7OB2$createMemo(() => listing_()?.ancestors);
|
|
8893
|
-
return $i7OB2$ssr($4ce5b8892775b62d$var$_tmpl$2, $i7OB2$ssrHydrationKey(), `listing-card ${isSelected() ? "selected" : ""}`, $i7OB2$escape($i7OB2$createComponent(LinkToListing, {
|
|
8924
|
+
return $i7OB2$ssr($4ce5b8892775b62d$var$_tmpl$2, $i7OB2$ssrHydrationKey(), `listing-card ${isSelected() ? "selected" : ""}`, $i7OB2$ssrAttribute("aria-selected", $i7OB2$escape(isSelected(), true), false), $i7OB2$escape($i7OB2$createComponent(LinkToListing, {
|
|
8894
8925
|
"class": "image-part",
|
|
8895
8926
|
get style() {
|
|
8896
8927
|
return `--image-count: ${image_urls()?.length ?? 0}`;
|
|
@@ -9088,11 +9119,10 @@ function $903297121898e5ff$export$d4994a86c6235f72({
|
|
|
9088
9119
|
return urlObject.href;
|
|
9089
9120
|
});
|
|
9090
9121
|
const [isSelected, selectedDueToKeyboardNavigation] = $f4125ce4984deee6$export$fb40a80c530e5f2b(read_selected_index_, itemIndex_, () => index);
|
|
9091
|
-
|
|
9122
|
+
const wholeTextToDisplay = $i7OB2$createMemo(() => item().title_);
|
|
9123
|
+
return $i7OB2$ssr($903297121898e5ff$var$_tmpl$2, $i7OB2$ssrHydrationKey(), `suggestion ${isSelected() ? "selected" : ""}`, $i7OB2$ssrAttribute("aria-selected", $i7OB2$escape(isSelected(), true), false) + $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
9124
|
class_: "title line-clamp",
|
|
9093
|
-
|
|
9094
|
-
return $i7OB2$createMemo(() => item().title_);
|
|
9095
|
-
},
|
|
9125
|
+
whole_text_to_display_: wholeTextToDisplay,
|
|
9096
9126
|
searching_for_value_: searching_for_value_
|
|
9097
9127
|
})));
|
|
9098
9128
|
}
|
|
@@ -9268,7 +9298,7 @@ var $500a16dd18ee5a71$var$_tmpl$ = ["<div", ' class="instant-results-wrapper" st
|
|
|
9268
9298
|
$500a16dd18ee5a71$var$_tmpl$2 = ["<div", ' class="discover-more"><button class="major" type="button">', "</button></div>"],
|
|
9269
9299
|
$500a16dd18ee5a71$var$_tmpl$3 = ["<b", ">", "</b>"],
|
|
9270
9300
|
$500a16dd18ee5a71$var$_tmpl$4 = ["<div", ' class="', '"></div>'],
|
|
9271
|
-
$500a16dd18ee5a71$var$_tmpl$5 = ["<div", ' class="', '"><div class="', '"><!--$-->', '<!--/--><div class="', '"></div></div><!--$-->', "<!--/--></div>"];
|
|
9301
|
+
$500a16dd18ee5a71$var$_tmpl$5 = ["<div", ' class="', '"><div class="', '" role="search" aria-label="Search modal with search field, query suggestions and result preview"><!--$-->', '<!--/--><div id="depict-suggestions-and-result-preview" class="', '"></div></div><!--$-->', "<!--/--></div>"];
|
|
9272
9302
|
/**
|
|
9273
9303
|
* Second generation search modal - the solid component that gets added to <body> when the search modal is opened
|
|
9274
9304
|
*/
|
|
@@ -9503,6 +9533,9 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
9503
9533
|
aspectRatio: 1,
|
|
9504
9534
|
get ["class"]() {
|
|
9505
9535
|
return props.class_;
|
|
9536
|
+
},
|
|
9537
|
+
imgProps: {
|
|
9538
|
+
alt: "Product image"
|
|
9506
9539
|
}
|
|
9507
9540
|
}),
|
|
9508
9541
|
...instant_results_options_
|
|
@@ -9580,7 +9613,9 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
9580
9613
|
const [start, end] = selected_text_range_;
|
|
9581
9614
|
if (start === null || end === null) return;
|
|
9582
9615
|
input_el.setSelectionRange(start, end);
|
|
9583
|
-
}
|
|
9616
|
+
},
|
|
9617
|
+
setSearchRoleOnContainer_: false,
|
|
9618
|
+
ariaControls: "depict-suggestions-and-result-preview"
|
|
9584
9619
|
});
|
|
9585
9620
|
if (setSearchFieldOuterWidth_) {
|
|
9586
9621
|
const resizeObserver = new ResizeObserver($i7OB2$catchify1(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
|