@depict-ai/ui 4.10.13 → 4.10.15
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 +167 -42
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +167 -42
- package/latest/index.cjs +163 -42
- package/latest/index.d.ts +1 -1
- package/latest/index.js +163 -42
- package/package.json +4 -4
- package/server/ES10/index.cjs +95 -21
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +95 -21
- package/server/latest/index.cjs +94 -21
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +94 -21
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.10.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.10.15";
|
|
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, ({
|
|
@@ -2111,8 +2111,10 @@ function $f8a56ba74eedd0c6$export$f21ab0717a89c77f(props) {
|
|
|
2111
2111
|
var $67b173f9db427028$var$_tmpl$ = ["<button", ' type="button" class="', '"', "><!--$-->", "<!--/--><span>", "</span></button>"];
|
|
2112
2112
|
function $67b173f9db427028$export$ca21a16d65b3dd8({
|
|
2113
2113
|
show_extras_: [get_show_extras, set_show_extras],
|
|
2114
|
-
i18n_: i18n_
|
|
2114
|
+
i18n_: i18n_,
|
|
2115
|
+
expanding_container_element_: expanding_container_element_
|
|
2115
2116
|
}) {
|
|
2117
|
+
let button;
|
|
2116
2118
|
return $i7OB2$ssr($67b173f9db427028$var$_tmpl$, $i7OB2$ssrHydrationKey(), `expand-filter ${get_show_extras() ? "expanded" : ""}`, $i7OB2$ssrAttribute("aria-expanded", $i7OB2$escape(get_show_extras(), true), false), $i7OB2$escape($i7OB2$createComponent((0, $f8a56ba74eedd0c6$export$f21ab0717a89c77f), {})), get_show_extras() ? $i7OB2$escape(i18n_.view_less_()) : $i7OB2$escape(i18n_.view_more_()));
|
|
2117
2119
|
}
|
|
2118
2120
|
var $f3213c0640246d58$var$_tmpl$ = ["<span", ' class="highlighted-part">', "</span>"],
|
|
@@ -2265,7 +2267,8 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
|
|
|
2265
2267
|
$i7OB2$createRenderEffect(() => {
|
|
2266
2268
|
set_view_more_button_below_group_(togglable_rest() ? $i7OB2$createComponent((0, $67b173f9db427028$export$ca21a16d65b3dd8), {
|
|
2267
2269
|
show_extras_: show_extras_signal,
|
|
2268
|
-
i18n_: i18n_
|
|
2270
|
+
i18n_: i18n_,
|
|
2271
|
+
expanding_container_element_: expanding_container_els
|
|
2269
2272
|
}) : []);
|
|
2270
2273
|
});
|
|
2271
2274
|
$i7OB2$onCleanup(() => set_view_more_button_below_group_());
|
|
@@ -2942,7 +2945,8 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
|
|
|
2942
2945
|
$i7OB2$createRenderEffect(() => {
|
|
2943
2946
|
set_view_more_button_below_group(some_top_level_are_hidden() ? $i7OB2$createComponent((0, $67b173f9db427028$export$ca21a16d65b3dd8), {
|
|
2944
2947
|
show_extras_: show_extras,
|
|
2945
|
-
i18n_: i18n_
|
|
2948
|
+
i18n_: i18n_,
|
|
2949
|
+
expanding_container_element_: expanding_container_els
|
|
2946
2950
|
}) : []);
|
|
2947
2951
|
});
|
|
2948
2952
|
$i7OB2$onCleanup(() => set_view_more_button_below_group());
|
|
@@ -3607,7 +3611,8 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
3607
3611
|
$i7OB2$createRenderEffect(() => {
|
|
3608
3612
|
set_view_more_button_below_group_(togglable_rest() ? $i7OB2$createComponent((0, $67b173f9db427028$export$ca21a16d65b3dd8), {
|
|
3609
3613
|
show_extras_: show_extras_signal,
|
|
3610
|
-
i18n_: i18n_
|
|
3614
|
+
i18n_: i18n_,
|
|
3615
|
+
expanding_container_element_: expanding_container_els
|
|
3611
3616
|
}) : []);
|
|
3612
3617
|
});
|
|
3613
3618
|
$i7OB2$onCleanup(() => set_view_more_button_below_group_());
|
|
@@ -4606,8 +4611,8 @@ var $11d594c749b76228$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"
|
|
|
4606
4611
|
function $11d594c749b76228$export$cb808a3c41736d8e() {
|
|
4607
4612
|
return $i7OB2$ssr($11d594c749b76228$var$_tmpl$, $i7OB2$ssrHydrationKey());
|
|
4608
4613
|
}
|
|
4609
|
-
var $cdea4cf8c5c071ef$var$_tmpl$ = ["<
|
|
4610
|
-
$cdea4cf8c5c071ef$var$_tmpl$2 = ["<
|
|
4614
|
+
var $cdea4cf8c5c071ef$var$_tmpl$ = ["<section", ' class="filters"', '><div class="body">', "</div></section>"],
|
|
4615
|
+
$cdea4cf8c5c071ef$var$_tmpl$2 = ["<section", ' class="sorting"', '><div class="body">', "</div></section>"],
|
|
4611
4616
|
$cdea4cf8c5c071ef$var$_tmpl$3 = ["<div", ' class="sort-and-filter-buttons"><div class="outer"><div class="inner"><!--$-->', "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div></div></div>"],
|
|
4612
4617
|
$cdea4cf8c5c071ef$var$_tmpl$4 = ["<span", ' class="num-filters" style="', '">', "</span>"],
|
|
4613
4618
|
$cdea4cf8c5c071ef$var$_tmpl$5 = ["<div", ' class="open-filters-button-container" style="', '"><!--$-->', "<!--/--><button", ' class="', '" type="button"', ' style="', '"><!--$-->', "<!--/--><span>", "</span></button></div>"],
|
|
@@ -4676,6 +4681,39 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
4676
4681
|
available_sortings_: available_sortings_,
|
|
4677
4682
|
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
4678
4683
|
};
|
|
4684
|
+
// Keyboard a11y for desktop panels (DOM order: after the grid). Keyboard opens move focus into the panel and
|
|
4685
|
+
// restore it to the toggle on close; mouse opens skip the focus move (already visible, and it'd jump the viewport).
|
|
4686
|
+
// `user_opened_panel` is set only on keyboard activation - `filters_open`/`sorting_open` also change
|
|
4687
|
+
// programmatically (undo toast, history restore, SDK consumers), which must not steal focus.
|
|
4688
|
+
let user_opened_panel = false;
|
|
4689
|
+
let filter_toggle_button;
|
|
4690
|
+
let sort_toggle_button;
|
|
4691
|
+
let current_panel;
|
|
4692
|
+
let current_panel_toggle_button;
|
|
4693
|
+
const focus_panel_when_in_dom = panel => $i7OB2$catchify1(async () => {
|
|
4694
|
+
// Bounded wait: if the panel never lands in the DOM (e.g. it's superseded by a rapid re-render before
|
|
4695
|
+
// insertion), the timeout lets this promise resolve instead of keeping `panel` - and the observer
|
|
4696
|
+
// listener it registers - referenced forever.
|
|
4697
|
+
await (0, $i7OB2$observer).wait_for_element(panel, 4000);
|
|
4698
|
+
if (panel.isConnected) {
|
|
4699
|
+
// Focus the first interactive control (often a group's <summary>), not the <section>: the section has no
|
|
4700
|
+
// visible focus ring and is flex-stretched to full grid height (scrolling it mis-aligns). The first
|
|
4701
|
+
// control keeps focus visible and lets Tab walk through the panel. `summary` is focusable but not matched
|
|
4702
|
+
// by the input/button/etc. selectors, so it must be listed explicitly.
|
|
4703
|
+
const focus_target = panel.querySelector("summary, input:not([type='hidden']):not(:disabled), button:not(:disabled), a[href], select:not(:disabled), [tabindex]:not([tabindex='-1'])") ?? panel;
|
|
4704
|
+
focus_target.focus({
|
|
4705
|
+
preventScroll: true
|
|
4706
|
+
});
|
|
4707
|
+
focus_target.scrollIntoView({
|
|
4708
|
+
block: "nearest"
|
|
4709
|
+
});
|
|
4710
|
+
}
|
|
4711
|
+
})();
|
|
4712
|
+
const register_desktop_panel = (el, toggle_button, should_focus) => {
|
|
4713
|
+
current_panel = el;
|
|
4714
|
+
current_panel_toggle_button = toggle_button;
|
|
4715
|
+
if (should_focus) focus_panel_when_in_dom(el);
|
|
4716
|
+
};
|
|
4679
4717
|
const make_open_filters_button = (adhere_to_width = false, is_tabbable = false) => $i7OB2$createComponent($cdea4cf8c5c071ef$var$OpenFiltersButton, {
|
|
4680
4718
|
tabindex_: is_tabbable ? 0 : -1,
|
|
4681
4719
|
i18n_: i18n_,
|
|
@@ -4683,7 +4721,11 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
4683
4721
|
search_sorting_open_: search_sorting_open_,
|
|
4684
4722
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
4685
4723
|
filter_button_width_: adhere_to_width ? filter_button_width_ : undefined,
|
|
4686
|
-
hide_button_: hide_filters
|
|
4724
|
+
hide_button_: hide_filters,
|
|
4725
|
+
on_user_open_: keyboard_activated => {
|
|
4726
|
+
if (keyboard_activated) user_opened_panel = true;
|
|
4727
|
+
},
|
|
4728
|
+
button_ref_: is_tabbable ? el => filter_toggle_button = el : undefined
|
|
4687
4729
|
});
|
|
4688
4730
|
const make_open_sorting_button = (adhere_to_width = false, is_tabbable = false) => $i7OB2$createComponent($cdea4cf8c5c071ef$var$OpenSortingButton, {
|
|
4689
4731
|
tabindex_: is_tabbable ? 0 : -1,
|
|
@@ -4693,7 +4735,11 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
4693
4735
|
search_sorting_open_: search_sorting_open_,
|
|
4694
4736
|
available_sortings_: available_sortings_,
|
|
4695
4737
|
sort_button_width_: adhere_to_width ? sort_button_width_ : undefined,
|
|
4696
|
-
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
4738
|
+
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_,
|
|
4739
|
+
on_user_open_: keyboard_activated => {
|
|
4740
|
+
if (keyboard_activated) user_opened_panel = true;
|
|
4741
|
+
},
|
|
4742
|
+
button_ref_: is_tabbable ? el => sort_toggle_button = el : undefined
|
|
4697
4743
|
});
|
|
4698
4744
|
let open_modal_;
|
|
4699
4745
|
let close_modal_;
|
|
@@ -4712,9 +4758,36 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
4712
4758
|
grid_is_in_original_state = true;
|
|
4713
4759
|
}
|
|
4714
4760
|
});
|
|
4761
|
+
// Restore focus to the relevant toggle button when a desktop panel is torn down while focus is still inside it.
|
|
4762
|
+
const restore_focus_to_toggle_on_close = () => {
|
|
4763
|
+
const button_to_restore = current_panel_toggle_button;
|
|
4764
|
+
const focus_was_in_panel = !!current_panel && current_panel.contains(document.activeElement);
|
|
4765
|
+
current_panel = undefined;
|
|
4766
|
+
current_panel_toggle_button = undefined;
|
|
4767
|
+
if (focus_was_in_panel && button_to_restore) button_to_restore.focus({
|
|
4768
|
+
preventScroll: true
|
|
4769
|
+
});
|
|
4770
|
+
};
|
|
4771
|
+
// `<section>` + `aria-label` so the panel announces itself ("Filters"/"Sort") when we move focus to it; the bare
|
|
4772
|
+
// tabindex=-1 container would otherwise give screen readers nothing to read on focus. A semantic <section> avoids
|
|
4773
|
+
// an ARIA role and the UA styling pitfalls of <fieldset>; the existing CSS targets the `.filters`/`.sorting` class.
|
|
4774
|
+
const FiltersPanel = should_focus => $i7OB2$createComponent((0, $i7OB2$Show), {
|
|
4775
|
+
get when() {
|
|
4776
|
+
return !hide_filters();
|
|
4777
|
+
},
|
|
4778
|
+
get children() {
|
|
4779
|
+
return $i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("tabindex", -1, false) + $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.filters_(), true), false), $i7OB2$escape($i7OB2$createComponent((0, $fab07f52c9861732$export$3f1a388cc0d8fed7), filter_options)));
|
|
4780
|
+
}
|
|
4781
|
+
});
|
|
4782
|
+
const SortingPanel = should_focus => $i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("tabindex", -1, false) + $i7OB2$ssrAttribute("aria-label", $i7OB2$escape(i18n_.sorting_text_(), true), false), $i7OB2$escape($i7OB2$createComponent((0, $68a258a92b88f02f$export$1f1775a58da589b5), sorting_options)));
|
|
4715
4783
|
$i7OB2$createEffect(() => {
|
|
4784
|
+
// Consume the user-intent flag once per run, in every branch, so a stale flag can't leak into a later
|
|
4785
|
+
// resize-triggered re-render and steal focus.
|
|
4786
|
+
const should_focus_panel = user_opened_panel;
|
|
4787
|
+
user_opened_panel = false;
|
|
4716
4788
|
if (!filters_open() && !sorting_open()) {
|
|
4717
4789
|
close_modal_?.();
|
|
4790
|
+
restore_focus_to_toggle_on_close();
|
|
4718
4791
|
set_extra_els_in_results_container_("");
|
|
4719
4792
|
} else if (isSmall()()) {
|
|
4720
4793
|
if ($i7OB2$untrack(() => input_modal_open_?.())) {
|
|
@@ -4723,18 +4796,14 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
4723
4796
|
set_sorting_open(false);
|
|
4724
4797
|
return;
|
|
4725
4798
|
}
|
|
4799
|
+
// The modal manages its own focus; just drop the desktop panel reference.
|
|
4800
|
+
current_panel = undefined;
|
|
4801
|
+
current_panel_toggle_button = undefined;
|
|
4726
4802
|
open_modal_?.();
|
|
4727
4803
|
set_extra_els_in_results_container_("");
|
|
4728
4804
|
} else {
|
|
4729
4805
|
close_modal_?.();
|
|
4730
|
-
if (filters_open()) set_extra_els_in_results_container_(() =>
|
|
4731
|
-
get when() {
|
|
4732
|
-
return !hide_filters();
|
|
4733
|
-
},
|
|
4734
|
-
get children() {
|
|
4735
|
-
return $i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $fab07f52c9861732$export$3f1a388cc0d8fed7), filter_options)));
|
|
4736
|
-
}
|
|
4737
|
-
}));else set_extra_els_in_results_container_($i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $68a258a92b88f02f$export$1f1775a58da589b5), sorting_options))));
|
|
4806
|
+
if (filters_open()) set_extra_els_in_results_container_(() => FiltersPanel(should_focus_panel));else set_extra_els_in_results_container_(SortingPanel(should_focus_panel));
|
|
4738
4807
|
}
|
|
4739
4808
|
});
|
|
4740
4809
|
$i7OB2$catchify1(async () => {
|
|
@@ -4784,7 +4853,9 @@ function $cdea4cf8c5c071ef$var$OpenFiltersButton({
|
|
|
4784
4853
|
filter_button_width_: filter_button_width_,
|
|
4785
4854
|
tabindex_: tabindex_,
|
|
4786
4855
|
number_of_rendered_selected_filters_items_: [num_selected_filters],
|
|
4787
|
-
hide_button_: hide_button_
|
|
4856
|
+
hide_button_: hide_button_,
|
|
4857
|
+
on_user_open_: on_user_open_,
|
|
4858
|
+
button_ref_: button_ref_
|
|
4788
4859
|
}) {
|
|
4789
4860
|
const filters_closed = $i7OB2$createMemo(() => !search_filters_open_[0]());
|
|
4790
4861
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
@@ -4797,7 +4868,7 @@ function $cdea4cf8c5c071ef$var$OpenFiltersButton({
|
|
|
4797
4868
|
get children() {
|
|
4798
4869
|
return $i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$4, $i7OB2$ssrHydrationKey(), $i7OB2$ssrStyle(filters_closed() ? `` : `opacity:0`), $i7OB2$escape(num_selected_filters()));
|
|
4799
4870
|
}
|
|
4800
|
-
})), $i7OB2$ssrAttribute("tabindex", $i7OB2$escape(tabindex_, true), false), `${!filters_closed() ? "major" : ""} ${filters_closed() ? "minor" : ""} ${"filter toggle-button major-minor-transition" + ((0, $i7OB2$isServer) ? " minor" : "")}`, $i7OB2$ssrAttribute("aria-label", $i7OB2$escape((filters_closed() ? i18n_.open_filters_ : i18n_.close_filters_)(), true), false), $i7OB2$ssrStyle(filter_button_width_?.() ? {
|
|
4871
|
+
})), $i7OB2$ssrAttribute("tabindex", $i7OB2$escape(tabindex_, true), false), `${!filters_closed() ? "major" : ""} ${filters_closed() ? "minor" : ""} ${"filter toggle-button major-minor-transition" + ((0, $i7OB2$isServer) ? " minor" : "")}`, $i7OB2$ssrAttribute("aria-label", $i7OB2$escape((filters_closed() ? i18n_.open_filters_ : i18n_.close_filters_)(), true), false) + $i7OB2$ssrAttribute("aria-expanded", !filters_closed(), false), $i7OB2$ssrStyle(filter_button_width_?.() ? {
|
|
4801
4872
|
width: filter_button_width_() + "px"
|
|
4802
4873
|
} : {}), $i7OB2$escape($i7OB2$createComponent((0, $i7OB2$Show), {
|
|
4803
4874
|
get when() {
|
|
@@ -4819,11 +4890,13 @@ function $cdea4cf8c5c071ef$var$OpenSortingButton({
|
|
|
4819
4890
|
search_sorting_open_: search_sorting_open_,
|
|
4820
4891
|
sort_button_width_: sort_button_width_,
|
|
4821
4892
|
tabindex_: tabindex_,
|
|
4822
|
-
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_
|
|
4893
|
+
meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_,
|
|
4894
|
+
on_user_open_: on_user_open_,
|
|
4895
|
+
button_ref_: button_ref_
|
|
4823
4896
|
}) {
|
|
4824
4897
|
const sorting_closed = $i7OB2$createMemo(() => !search_sorting_open_[0]());
|
|
4825
4898
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
4826
|
-
return $i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$6, $i7OB2$ssrHydrationKey(), `${!sorting_closed() ? "major" : ""} ${sorting_closed() ? "minor" : ""} toggle-button for-sorting major-minor-transition`, $i7OB2$ssrAttribute("tabindex", $i7OB2$escape(tabindex_, true), false) + $i7OB2$ssrAttribute("aria-label", $i7OB2$escape((sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(), true), false), $i7OB2$ssrStyle(sort_button_width_?.() ? {
|
|
4899
|
+
return $i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$6, $i7OB2$ssrHydrationKey(), `${!sorting_closed() ? "major" : ""} ${sorting_closed() ? "minor" : ""} toggle-button for-sorting major-minor-transition`, $i7OB2$ssrAttribute("tabindex", $i7OB2$escape(tabindex_, true), false) + $i7OB2$ssrAttribute("aria-label", $i7OB2$escape((sorting_closed() ? i18n_.open_sorting_ : i18n_.close_sorting_)(), true), false) + $i7OB2$ssrAttribute("aria-expanded", !sorting_closed(), false), $i7OB2$ssrStyle(sort_button_width_?.() ? {
|
|
4827
4900
|
width: sort_button_width_() + "px"
|
|
4828
4901
|
} : {}),
|
|
4829
4902
|
// Show the title of the currently selected sorting when the sorting is closed, if there's currently a sorting selected
|