@depict-ai/ui 0.0.74 → 0.0.76
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/dist/index.d.ts +6 -6
- package/dist/main.js +25 -18
- package/dist/module.js +25 -18
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,11 @@ import { SearchSuggestionsResponse, CategorySuggestion } from "@depict-ai/types/
|
|
|
7
7
|
import { SearchSuggestionsRequest } from "@depict-ai/types/api/SearchSuggestionsRequest";
|
|
8
8
|
import { ProductListingRequest } from "@depict-ai/types/api/ProductListingRequest";
|
|
9
9
|
import { ProductListingResponse } from "@depict-ai/types/api/ProductListingResponse";
|
|
10
|
-
export const version = "0.0.
|
|
10
|
+
export const version = "0.0.76";
|
|
11
|
+
export type OnNavigation = ((options: {
|
|
12
|
+
is_replace: boolean;
|
|
13
|
+
new_url: URL;
|
|
14
|
+
}) => void) | "hard_navigation";
|
|
11
15
|
type ExclusiveId = {
|
|
12
16
|
categoryId: string;
|
|
13
17
|
productId?: undefined;
|
|
@@ -200,10 +204,6 @@ export class ProductCardError extends SDKError {
|
|
|
200
204
|
* @returns A cleanup function to manually re-enable scrolling.
|
|
201
205
|
*/
|
|
202
206
|
export function disable_scrolling(): () => void;
|
|
203
|
-
type OnNavigation = ((options: {
|
|
204
|
-
is_replace: boolean;
|
|
205
|
-
new_url: URL;
|
|
206
|
-
}) => void) | "hard_navigation";
|
|
207
207
|
export const CategoryTitle: ({ category_title_, product_count_, }: {
|
|
208
208
|
category_title_: Accessor<string | undefined>;
|
|
209
209
|
product_count_: JSX.Element;
|
|
@@ -312,7 +312,7 @@ type ConstructorOptions<T extends Display> = {
|
|
|
312
312
|
bottom_distance_under_modal_?: Accessor<number | undefined>;
|
|
313
313
|
render_instant_card?: InstantCard<T>;
|
|
314
314
|
};
|
|
315
|
-
type OpenModalArguments = [
|
|
315
|
+
export type OpenModalArguments = [
|
|
316
316
|
options_for_modal?: {
|
|
317
317
|
style_props_?: Signal<JSX.CSSProperties>;
|
|
318
318
|
closing_animation_?: () => Promise<any>;
|
package/dist/main.js
CHANGED
|
@@ -35,7 +35,7 @@ $parcel$export(module.exports, "solid_format_price", () => $5fc9fc23df1591db$exp
|
|
|
35
35
|
$parcel$export(module.exports, "connect_search_field_height_to_aligner_height", () => $246e3e89a097f014$export$828dcdd425fd3231);
|
|
36
36
|
$parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
|
|
37
37
|
$parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
|
|
38
|
-
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.
|
|
38
|
+
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.76";
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -4566,14 +4566,15 @@ function $cdc2c00c0a7da86e$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4566
4566
|
|
|
4567
4567
|
|
|
4568
4568
|
|
|
4569
|
-
function $207f7b30db90d048$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ }) {
|
|
4569
|
+
function $207f7b30db90d048$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ , router_: router_ }) {
|
|
4570
4570
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
4571
4571
|
$207f7b30db90d048$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
4572
4572
|
plp_results_: plp_results_,
|
|
4573
4573
|
local_filter_cache_: local_filter_cache_,
|
|
4574
4574
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
4575
4575
|
selected_filters_: selected_filters_,
|
|
4576
|
-
i18n_: i18n_
|
|
4576
|
+
i18n_: i18n_,
|
|
4577
|
+
router_: router_
|
|
4577
4578
|
});
|
|
4578
4579
|
// Code below is for when we're already open and the user navigates to a new category
|
|
4579
4580
|
let previous_crumb_data = (0, $46MJV$solidjs.untrack)(crumb_data_);
|
|
@@ -4603,12 +4604,7 @@ function $207f7b30db90d048$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4603
4604
|
local_filter_cache_: local_filter_cache_
|
|
4604
4605
|
});
|
|
4605
4606
|
// Also ensure we don't have `sideways_url_params_flag` set anymore
|
|
4606
|
-
|
|
4607
|
-
const { searchParams: searchParams } = url;
|
|
4608
|
-
if (searchParams.has((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac))) {
|
|
4609
|
-
searchParams.delete((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac));
|
|
4610
|
-
history.replaceState(history.state, "", url.href);
|
|
4611
|
-
}
|
|
4607
|
+
$207f7b30db90d048$var$delete_sideways_param_flag(router_);
|
|
4612
4608
|
}
|
|
4613
4609
|
}
|
|
4614
4610
|
query_id_when_we_got_previous_data = query_id_of_new_data;
|
|
@@ -4616,14 +4612,11 @@ function $207f7b30db90d048$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4616
4612
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
4617
4613
|
})));
|
|
4618
4614
|
}
|
|
4619
|
-
function $207f7b30db90d048$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ }) {
|
|
4615
|
+
function $207f7b30db90d048$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , router_: router_ }) {
|
|
4620
4616
|
const tracking_function_for_plp_results = (0, $46MJV$solidjs.createReaction)(()=>{
|
|
4621
4617
|
// On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
|
|
4622
|
-
const
|
|
4623
|
-
|
|
4624
|
-
if (searchParams.get((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac)) !== "true") return;
|
|
4625
|
-
searchParams.delete((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac));
|
|
4626
|
-
history.replaceState(history.state, "", url_object.href);
|
|
4618
|
+
const had_flag = $207f7b30db90d048$var$delete_sideways_param_flag(router_);
|
|
4619
|
+
if (!had_flag) return;
|
|
4627
4620
|
(0, $46MJV$depictaiutilishared.dlog)("Flag to clear filters was set, clearing filters");
|
|
4628
4621
|
(0, $46MJV$depictaiutilishared.queueMacroTask)(()=>{
|
|
4629
4622
|
// Do it next task so that all the filters have time to populate
|
|
@@ -4639,6 +4632,17 @@ function $207f7b30db90d048$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
4639
4632
|
});
|
|
4640
4633
|
tracking_function_for_plp_results(plp_results_);
|
|
4641
4634
|
}
|
|
4635
|
+
function $207f7b30db90d048$var$delete_sideways_param_flag(router) {
|
|
4636
|
+
const url_object = new URL(location.href);
|
|
4637
|
+
const { searchParams: searchParams } = url_object;
|
|
4638
|
+
if (searchParams.get((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac)) !== "true") return false;
|
|
4639
|
+
searchParams.delete((0, $c6a04c153e9853a7$export$e2cf3f19dd3f8aac));
|
|
4640
|
+
router.navigate_.go_to_({
|
|
4641
|
+
new_url_: url_object,
|
|
4642
|
+
is_replace_: true
|
|
4643
|
+
});
|
|
4644
|
+
return true;
|
|
4645
|
+
}
|
|
4642
4646
|
|
|
4643
4647
|
|
|
4644
4648
|
|
|
@@ -4937,7 +4941,8 @@ function $671632478f2a7ce7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4937
4941
|
selected_filters_: selected_filters_,
|
|
4938
4942
|
local_filter_cache_: local_filter_cache_,
|
|
4939
4943
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
4940
|
-
plp_results_: plp_results_
|
|
4944
|
+
plp_results_: plp_results_,
|
|
4945
|
+
router_: router_
|
|
4941
4946
|
});
|
|
4942
4947
|
get_breadcrumb_accessor_?.(crumb_data_);
|
|
4943
4948
|
get_quicklinks_accessor_?.(quicklinks_data_);
|
|
@@ -5725,11 +5730,13 @@ const $67892c03cd3dfa66$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solid
|
|
|
5725
5730
|
function $67892c03cd3dfa66$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_ , router_: router_ }) {
|
|
5726
5731
|
return (()=>{
|
|
5727
5732
|
const _el$ = $67892c03cd3dfa66$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild;
|
|
5728
|
-
(0, $46MJV$solidjsweb.addEventListener)(_el$, "click", (0, $46MJV$depictaiutilishared.catchify)((e)=>
|
|
5733
|
+
(0, $46MJV$solidjsweb.addEventListener)(_el$, "click", (0, $46MJV$depictaiutilishared.catchify)((e)=>{
|
|
5734
|
+
router_.navigate_.go_to_({
|
|
5729
5735
|
new_url_: category_suggestion_().page_url,
|
|
5730
5736
|
is_replace_: false,
|
|
5731
5737
|
event_: e
|
|
5732
|
-
})
|
|
5738
|
+
});
|
|
5739
|
+
}), true);
|
|
5733
5740
|
(0, $46MJV$solidjsweb.insert)(_el$2, ()=>category_suggestion_().title);
|
|
5734
5741
|
(0, $46MJV$solidjsweb.insert)(_el$, (0, $46MJV$solidjsweb.createComponent)((0, $46MJV$solidjs.Show), {
|
|
5735
5742
|
get when () {
|
package/dist/module.js
CHANGED
|
@@ -3,7 +3,7 @@ import {template as $g9l4l$template, insert as $g9l4l$insert, effect as $g9l4l$e
|
|
|
3
3
|
import {createSignal as $g9l4l$createSignal, onCleanup as $g9l4l$onCleanup, createComputed as $g9l4l$createComputed, createEffect as $g9l4l$createEffect, untrack as $g9l4l$untrack, batch as $g9l4l$batch, createResource as $g9l4l$createResource, createMemo as $g9l4l$createMemo, Show as $g9l4l$Show, createRenderEffect as $g9l4l$createRenderEffect, runWithOwner as $g9l4l$runWithOwner, createRoot as $g9l4l$createRoot, getOwner as $g9l4l$getOwner, createReaction as $g9l4l$createReaction, on as $g9l4l$on, ErrorBoundary as $g9l4l$ErrorBoundary, Index as $g9l4l$Index, For as $g9l4l$For} from "solid-js";
|
|
4
4
|
import {compressToBase64 as $g9l4l$compressToBase64, decompressFromBase64 as $g9l4l$decompressFromBase64} from "lz-string";
|
|
5
5
|
|
|
6
|
-
/*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.
|
|
6
|
+
/*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "0.0.76";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -4534,14 +4534,15 @@ function $6af87e1502f04aa3$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4534
4534
|
|
|
4535
4535
|
|
|
4536
4536
|
|
|
4537
|
-
function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ }) {
|
|
4537
|
+
function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ , query_id_: query_id_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , plp_results_: plp_results_ , router_: router_ }) {
|
|
4538
4538
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
4539
4539
|
$cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
4540
4540
|
plp_results_: plp_results_,
|
|
4541
4541
|
local_filter_cache_: local_filter_cache_,
|
|
4542
4542
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
4543
4543
|
selected_filters_: selected_filters_,
|
|
4544
|
-
i18n_: i18n_
|
|
4544
|
+
i18n_: i18n_,
|
|
4545
|
+
router_: router_
|
|
4545
4546
|
});
|
|
4546
4547
|
// Code below is for when we're already open and the user navigates to a new category
|
|
4547
4548
|
let previous_crumb_data = (0, $g9l4l$untrack)(crumb_data_);
|
|
@@ -4571,12 +4572,7 @@ function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4571
4572
|
local_filter_cache_: local_filter_cache_
|
|
4572
4573
|
});
|
|
4573
4574
|
// Also ensure we don't have `sideways_url_params_flag` set anymore
|
|
4574
|
-
|
|
4575
|
-
const { searchParams: searchParams } = url;
|
|
4576
|
-
if (searchParams.has((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac))) {
|
|
4577
|
-
searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
|
|
4578
|
-
history.replaceState(history.state, "", url.href);
|
|
4579
|
-
}
|
|
4575
|
+
$cb20e79516018342$var$delete_sideways_param_flag(router_);
|
|
4580
4576
|
}
|
|
4581
4577
|
}
|
|
4582
4578
|
query_id_when_we_got_previous_data = query_id_of_new_data;
|
|
@@ -4584,14 +4580,11 @@ function $cb20e79516018342$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
4584
4580
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
4585
4581
|
})));
|
|
4586
4582
|
}
|
|
4587
|
-
function $cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ }) {
|
|
4583
|
+
function $cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , router_: router_ }) {
|
|
4588
4584
|
const tracking_function_for_plp_results = (0, $g9l4l$createReaction)(()=>{
|
|
4589
4585
|
// On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
|
|
4590
|
-
const
|
|
4591
|
-
|
|
4592
|
-
if (searchParams.get((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac)) !== "true") return;
|
|
4593
|
-
searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
|
|
4594
|
-
history.replaceState(history.state, "", url_object.href);
|
|
4586
|
+
const had_flag = $cb20e79516018342$var$delete_sideways_param_flag(router_);
|
|
4587
|
+
if (!had_flag) return;
|
|
4595
4588
|
(0, $g9l4l$dlog)("Flag to clear filters was set, clearing filters");
|
|
4596
4589
|
(0, $g9l4l$queueMacroTask)(()=>{
|
|
4597
4590
|
// Do it next task so that all the filters have time to populate
|
|
@@ -4607,6 +4600,17 @@ function $cb20e79516018342$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
4607
4600
|
});
|
|
4608
4601
|
tracking_function_for_plp_results(plp_results_);
|
|
4609
4602
|
}
|
|
4603
|
+
function $cb20e79516018342$var$delete_sideways_param_flag(router) {
|
|
4604
|
+
const url_object = new URL(location.href);
|
|
4605
|
+
const { searchParams: searchParams } = url_object;
|
|
4606
|
+
if (searchParams.get((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac)) !== "true") return false;
|
|
4607
|
+
searchParams.delete((0, $73294c7089bfc7c9$export$e2cf3f19dd3f8aac));
|
|
4608
|
+
router.navigate_.go_to_({
|
|
4609
|
+
new_url_: url_object,
|
|
4610
|
+
is_replace_: true
|
|
4611
|
+
});
|
|
4612
|
+
return true;
|
|
4613
|
+
}
|
|
4610
4614
|
|
|
4611
4615
|
|
|
4612
4616
|
|
|
@@ -4905,7 +4909,8 @@ function $1ae892b13d7746ab$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4905
4909
|
selected_filters_: selected_filters_,
|
|
4906
4910
|
local_filter_cache_: local_filter_cache_,
|
|
4907
4911
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
4908
|
-
plp_results_: plp_results_
|
|
4912
|
+
plp_results_: plp_results_,
|
|
4913
|
+
router_: router_
|
|
4909
4914
|
});
|
|
4910
4915
|
get_breadcrumb_accessor_?.(crumb_data_);
|
|
4911
4916
|
get_quicklinks_accessor_?.(quicklinks_data_);
|
|
@@ -5693,11 +5698,13 @@ const $7a7079d66c12b788$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$g9l4l$templ
|
|
|
5693
5698
|
function $7a7079d66c12b788$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_ , router_: router_ }) {
|
|
5694
5699
|
return (()=>{
|
|
5695
5700
|
const _el$ = $7a7079d66c12b788$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild;
|
|
5696
|
-
(0, $g9l4l$addEventListener)(_el$, "click", (0, $g9l4l$catchify)((e)=>
|
|
5701
|
+
(0, $g9l4l$addEventListener)(_el$, "click", (0, $g9l4l$catchify)((e)=>{
|
|
5702
|
+
router_.navigate_.go_to_({
|
|
5697
5703
|
new_url_: category_suggestion_().page_url,
|
|
5698
5704
|
is_replace_: false,
|
|
5699
5705
|
event_: e
|
|
5700
|
-
})
|
|
5706
|
+
});
|
|
5707
|
+
}), true);
|
|
5701
5708
|
(0, $g9l4l$insert)(_el$2, ()=>category_suggestion_().title);
|
|
5702
5709
|
(0, $g9l4l$insert)(_el$, (0, $g9l4l$createComponent)((0, $g9l4l$Show), {
|
|
5703
5710
|
get when () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.76",
|
|
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
|
"source": [
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"ts-jest": "^29.0.3"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@depict-ai/plp-styling": "^0.0.
|
|
89
|
-
"@depict-ai/types": "^0.0.
|
|
90
|
-
"@depict-ai/utilishared": "^0.0.
|
|
88
|
+
"@depict-ai/plp-styling": "^0.0.38",
|
|
89
|
+
"@depict-ai/types": "^0.0.28",
|
|
90
|
+
"@depict-ai/utilishared": "^0.0.80",
|
|
91
91
|
"lz-string": "^1.4.4",
|
|
92
92
|
"solid-js": "^1.6.2"
|
|
93
93
|
},
|