@depict-ai/ui 4.0.27 → 4.1.0
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 +24 -10
- package/ES10/index.d.ts +31 -6
- package/ES10/index.js +24 -10
- package/latest/index.cjs +22 -10
- package/latest/index.d.ts +31 -6
- package/latest/index.js +22 -10
- package/package.json +1 -1
- package/server/ES10/index.cjs +24 -10
- package/server/ES10/index.d.ts +31 -6
- package/server/ES10/index.js +24 -10
- package/server/latest/index.cjs +22 -10
- package/server/latest/index.d.ts +31 -6
- package/server/latest/index.js +22 -10
package/ES10/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
98
98
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
99
99
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
100
100
|
/*! Depict.ai search and product listing SDK */
|
|
101
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0
|
|
101
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.0";
|
|
102
102
|
const $cfcd56242923775d$export$3064e1e8c6513da3 = new Set();
|
|
103
103
|
let $cfcd56242923775d$var$has_ran = false;
|
|
104
104
|
function $cfcd56242923775d$export$5162a71f252e6122() {
|
|
@@ -12440,11 +12440,19 @@ var $9cbefc32b9dab36d$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
|
12440
12440
|
var $9cbefc32b9dab36d$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
|
|
12441
12441
|
var $9cbefc32b9dab36d$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
|
|
12442
12442
|
class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
12443
|
+
/**
|
|
12444
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
12445
|
+
*/ /**
|
|
12446
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
12447
|
+
*/
|
|
12443
12448
|
get localization() {
|
|
12444
12449
|
// allow reactive access
|
|
12445
12450
|
return $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_localization_signal)[0]();
|
|
12446
12451
|
}
|
|
12447
12452
|
set localization(locale_obj) {
|
|
12453
|
+
if (typeof locale_obj === "string")
|
|
12454
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
12455
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
12448
12456
|
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_localization_signal)[1](locale_obj);
|
|
12449
12457
|
}
|
|
12450
12458
|
get listing_query() {
|
|
@@ -12487,6 +12495,8 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
12487
12495
|
listing_query_state_key: listing_query_state_key,
|
|
12488
12496
|
...props_on_class
|
|
12489
12497
|
} = _ref2;
|
|
12498
|
+
$parcel$interopDefault($52FdA$babelruntimehelpersdefineProperty)(this, "historyStateSignals_", void 0);
|
|
12499
|
+
$parcel$interopDefault($52FdA$babelruntimehelpersdefineProperty)(this, "selectedFilters_", void 0);
|
|
12490
12500
|
$9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_router, {
|
|
12491
12501
|
writable: true,
|
|
12492
12502
|
value: void 0
|
|
@@ -12548,8 +12558,9 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
12548
12558
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
12549
12559
|
});
|
|
12550
12560
|
const i18n_ = $39cca429fb71d8ff$export$f091cbac892643a4($parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_localization_signal)[0]);
|
|
12561
|
+
this.historyStateSignals_ = state_;
|
|
12562
|
+
this.selectedFilters_ = selected_filters_;
|
|
12551
12563
|
$9cbefc32b9dab36d$var$privately_shared_properties.set(this, {
|
|
12552
|
-
state_: state_,
|
|
12553
12564
|
breadcrumb_signal_: $52FdA$solidjs.createSignal(),
|
|
12554
12565
|
quicklinks_signal_: $52FdA$solidjs.createSignal(),
|
|
12555
12566
|
i18n_: i18n_,
|
|
@@ -12615,14 +12626,14 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
12615
12626
|
};
|
|
12616
12627
|
});
|
|
12617
12628
|
const {
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12622
|
-
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
|
|
12629
|
+
local_filter_cache: local_filter_cache_,
|
|
12630
|
+
filters_open: category_filters_open_,
|
|
12631
|
+
sorting_open: category_sorting_open_,
|
|
12632
|
+
expanded_filters: expanded_filters_,
|
|
12633
|
+
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
12634
|
+
scroll_restoration_data: scroll_restoration_data_
|
|
12635
|
+
} = depict_category.historyStateSignals_;
|
|
12636
|
+
const {
|
|
12626
12637
|
current_sorting_: current_sorting_,
|
|
12627
12638
|
selected_filters_: selected_filters_,
|
|
12628
12639
|
override_listing_id_accessor_: override_listing_id_accessor_,
|
|
@@ -14619,6 +14630,9 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
14619
14630
|
return $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $ddd39c5f36f49703$var$_locale_signal)[0]();
|
|
14620
14631
|
}
|
|
14621
14632
|
set localization(locale_obj) {
|
|
14633
|
+
if (typeof locale_obj === "string")
|
|
14634
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
14635
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
14622
14636
|
$parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet)(this, $ddd39c5f36f49703$var$_locale_signal)[1](locale_obj);
|
|
14623
14637
|
}
|
|
14624
14638
|
get modal_open() {
|
package/ES10/index.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/S
|
|
|
4
4
|
import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
|
|
5
5
|
import { Ancestors, ListingSuggestion, SearchSuggestionsResponseV3 } from "@depict-ai/types/api/SearchSuggestionsResponseV3";
|
|
6
6
|
import { ProductListing, GetListingResponse } from "@depict-ai/types/api/GetListingResponse";
|
|
7
|
-
import { ProductListingResponseV3 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
7
|
+
import { ProductListingResponseV3, SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
8
8
|
import { SearchSuggestionsRequestV3 } from "@depict-ai/types/api/SearchSuggestionsRequestV3";
|
|
9
9
|
import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequestV3";
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
|
-
import { SearchFilter as
|
|
13
|
-
export const version = "4.0
|
|
12
|
+
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
+
export const version = "4.1.0";
|
|
14
14
|
export const prefixes_to_preserve_in_history_dot_state: Set<string>;
|
|
15
15
|
/**
|
|
16
16
|
* Prevent, usually SPAs, from deleting our stuff from history.state when they call history.pushState with a new object they have constructed. This will only run once no matter how often it's called.
|
|
@@ -78,12 +78,16 @@ export function createDeparallelizedNoDropResource<T, X>(dependency: Accessor<T
|
|
|
78
78
|
export function throw_globally<T extends (...args: any) => any>(fn?: T): (...args: Parameters<T>) => ReturnType<T> | undefined;
|
|
79
79
|
declare const LISTING_ID = "listingId";
|
|
80
80
|
declare const EXTERNAL_ID = "externalId";
|
|
81
|
+
type ScrollRestorationData = {
|
|
82
|
+
min_results_loaded: number;
|
|
83
|
+
for_id: string;
|
|
84
|
+
}[];
|
|
81
85
|
export type SDKGridSpacing = string | {
|
|
82
86
|
horizontal: string;
|
|
83
87
|
vertical: string;
|
|
84
88
|
};
|
|
85
89
|
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
86
|
-
type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
90
|
+
export type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
87
91
|
export interface SDKRenderingInfo {
|
|
88
92
|
/**
|
|
89
93
|
* If you call this function with a provided function, the provided function will be called whenever the index of the currently displayed product changes.
|
|
@@ -667,7 +671,7 @@ export type BaseSearchProviderConfig<InputDisplay extends Display, PossibleTrans
|
|
|
667
671
|
urlParamName?: string;
|
|
668
672
|
/**
|
|
669
673
|
* Whether to enable category suggestions in the search modal and search page.
|
|
670
|
-
* @default
|
|
674
|
+
* @default true
|
|
671
675
|
*/
|
|
672
676
|
enableCategorySuggestions?: boolean;
|
|
673
677
|
/**
|
|
@@ -1184,6 +1188,27 @@ type CategoryConstructorOptionsWithoutApi<InputDisplay extends Display, OutputDi
|
|
|
1184
1188
|
type DepictCategoryConstructorOptions<InputDisplay extends Display, OutputDisplay extends ModernDisplay> = CategoryConstructorOptionsWithApi<InputDisplay, OutputDisplay> | CategoryConstructorOptionsWithoutApi<InputDisplay, OutputDisplay>;
|
|
1185
1189
|
export class DepictCategory<InputDisplay extends Display, OutputDisplay extends ModernDisplay | never = InputDisplay extends ModernDisplay ? ModernDisplayWithPageUrl<InputDisplay> : never> {
|
|
1186
1190
|
#private;
|
|
1191
|
+
/**
|
|
1192
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
1193
|
+
*/
|
|
1194
|
+
historyStateSignals_: {
|
|
1195
|
+
filters_open: Signal<boolean>;
|
|
1196
|
+
sorting_open: Signal<boolean>;
|
|
1197
|
+
expanded_filters: Signal<{
|
|
1198
|
+
section_: string;
|
|
1199
|
+
expanded_: boolean;
|
|
1200
|
+
}[]>;
|
|
1201
|
+
local_filter_cache: Signal<_SearchFilter2[]>;
|
|
1202
|
+
expanded_hierarchical_filters: Signal<{
|
|
1203
|
+
value_: string[];
|
|
1204
|
+
expanded_: boolean;
|
|
1205
|
+
}[]>;
|
|
1206
|
+
scroll_restoration_data: Signal<ScrollRestorationData>;
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
1209
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
1210
|
+
*/
|
|
1211
|
+
selectedFilters_: Signal<FilterWithData[]>;
|
|
1187
1212
|
get localization(): category_i18n;
|
|
1188
1213
|
set localization(locale_obj: category_i18n);
|
|
1189
1214
|
get listing_query(): ListingQuery;
|
|
@@ -1301,7 +1326,7 @@ export class DepictSearch<InputDisplay extends Display, OutputDisplay extends Mo
|
|
|
1301
1326
|
set merchant(tenant: string);
|
|
1302
1327
|
get market(): string;
|
|
1303
1328
|
set market(market: string);
|
|
1304
|
-
fetchSearchResults(query: string, filters?:
|
|
1329
|
+
fetchSearchResults(query: string, filters?: _SearchFilter3[], maxResults?: number): Promise<([OutputDisplay] extends [never] ? InputDisplay : ModernDisplayWithPageUrl<OutputDisplay>)[]>;
|
|
1305
1330
|
}
|
|
1306
1331
|
/**
|
|
1307
1332
|
* This is the SearchPage component visible outside - exported from @depict-ai/ui.
|
package/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $8tj43$createStore, reconcile as $8tj43$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.1.0";
|
|
14
14
|
const $68e6625c8d51f847$export$3064e1e8c6513da3 = new Set();
|
|
15
15
|
let $68e6625c8d51f847$var$has_ran = false;
|
|
16
16
|
function $68e6625c8d51f847$export$5162a71f252e6122() {
|
|
@@ -12352,11 +12352,19 @@ var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
|
12352
12352
|
var $f5f54892fd0c7d9f$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
|
|
12353
12353
|
var $f5f54892fd0c7d9f$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
|
|
12354
12354
|
class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
12355
|
+
/**
|
|
12356
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
12357
|
+
*/ /**
|
|
12358
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
12359
|
+
*/
|
|
12355
12360
|
get localization() {
|
|
12356
12361
|
// allow reactive access
|
|
12357
12362
|
return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[0]();
|
|
12358
12363
|
}
|
|
12359
12364
|
set localization(locale_obj) {
|
|
12365
|
+
if (typeof locale_obj === "string")
|
|
12366
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
12367
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
12360
12368
|
$8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[1](locale_obj);
|
|
12361
12369
|
}
|
|
12362
12370
|
get listing_query() {
|
|
@@ -12399,6 +12407,8 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
12399
12407
|
listing_query_state_key: listing_query_state_key,
|
|
12400
12408
|
...props_on_class
|
|
12401
12409
|
} = _ref2;
|
|
12410
|
+
$8tj43$babelruntimehelpersdefineProperty(this, "historyStateSignals_", void 0);
|
|
12411
|
+
$8tj43$babelruntimehelpersdefineProperty(this, "selectedFilters_", void 0);
|
|
12402
12412
|
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_router, {
|
|
12403
12413
|
writable: true,
|
|
12404
12414
|
value: void 0
|
|
@@ -12460,8 +12470,9 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
12460
12470
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
12461
12471
|
});
|
|
12462
12472
|
const i18n_ = $e18ab2868df26f40$export$f091cbac892643a4($8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[0]);
|
|
12473
|
+
this.historyStateSignals_ = state_;
|
|
12474
|
+
this.selectedFilters_ = selected_filters_;
|
|
12463
12475
|
$f5f54892fd0c7d9f$var$privately_shared_properties.set(this, {
|
|
12464
|
-
state_: state_,
|
|
12465
12476
|
breadcrumb_signal_: $8tj43$createSignal(),
|
|
12466
12477
|
quicklinks_signal_: $8tj43$createSignal(),
|
|
12467
12478
|
i18n_: i18n_,
|
|
@@ -12527,14 +12538,14 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
12527
12538
|
};
|
|
12528
12539
|
});
|
|
12529
12540
|
const {
|
|
12530
|
-
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
|
|
12537
|
-
|
|
12541
|
+
local_filter_cache: local_filter_cache_,
|
|
12542
|
+
filters_open: category_filters_open_,
|
|
12543
|
+
sorting_open: category_sorting_open_,
|
|
12544
|
+
expanded_filters: expanded_filters_,
|
|
12545
|
+
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
12546
|
+
scroll_restoration_data: scroll_restoration_data_
|
|
12547
|
+
} = depict_category.historyStateSignals_;
|
|
12548
|
+
const {
|
|
12538
12549
|
current_sorting_: current_sorting_,
|
|
12539
12550
|
selected_filters_: selected_filters_,
|
|
12540
12551
|
override_listing_id_accessor_: override_listing_id_accessor_,
|
|
@@ -14531,6 +14542,9 @@ class $eb064bc3350276c1$export$ac6237957a15b3f0 {
|
|
|
14531
14542
|
return $8tj43$babelruntimehelpersclassPrivateFieldGet(this, $eb064bc3350276c1$var$_locale_signal)[0]();
|
|
14532
14543
|
}
|
|
14533
14544
|
set localization(locale_obj) {
|
|
14545
|
+
if (typeof locale_obj === "string")
|
|
14546
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
14547
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
14534
14548
|
$8tj43$babelruntimehelpersclassPrivateFieldGet(this, $eb064bc3350276c1$var$_locale_signal)[1](locale_obj);
|
|
14535
14549
|
}
|
|
14536
14550
|
get modal_open() {
|
package/latest/index.cjs
CHANGED
|
@@ -92,7 +92,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
92
92
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
93
93
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
94
94
|
/*! Depict.ai search and product listing SDK */
|
|
95
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0
|
|
95
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.0";
|
|
96
96
|
const $d84fe647b84b5dc5$export$3064e1e8c6513da3 = new Set();
|
|
97
97
|
let $d84fe647b84b5dc5$var$has_ran = false;
|
|
98
98
|
function $d84fe647b84b5dc5$export$5162a71f252e6122() {
|
|
@@ -11712,6 +11712,11 @@ const $48567ac5b39bac56$var$InExternalAreaDiv = ({
|
|
|
11712
11712
|
return _el$;
|
|
11713
11713
|
})();
|
|
11714
11714
|
class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
11715
|
+
/**
|
|
11716
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
11717
|
+
*/ /**
|
|
11718
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
11719
|
+
*/
|
|
11715
11720
|
#router;
|
|
11716
11721
|
#localization_signal = $gVhhF$solidjs.createSignal();
|
|
11717
11722
|
#merchant_signal = $gVhhF$solidjs.createSignal();
|
|
@@ -11724,6 +11729,9 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
11724
11729
|
return this.#localization_signal[0]();
|
|
11725
11730
|
}
|
|
11726
11731
|
set localization(locale_obj) {
|
|
11732
|
+
if (typeof locale_obj === "string")
|
|
11733
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
11734
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
11727
11735
|
this.#localization_signal[1](locale_obj);
|
|
11728
11736
|
}
|
|
11729
11737
|
get listing_query() {
|
|
@@ -11802,8 +11810,9 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
11802
11810
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
11803
11811
|
});
|
|
11804
11812
|
const i18n_ = $0785f4c9947d9b5f$export$f091cbac892643a4(this.#localization_signal[0]);
|
|
11813
|
+
this.historyStateSignals_ = state_;
|
|
11814
|
+
this.selectedFilters_ = selected_filters_;
|
|
11805
11815
|
$48567ac5b39bac56$var$privately_shared_properties.set(this, {
|
|
11806
|
-
state_: state_,
|
|
11807
11816
|
breadcrumb_signal_: $gVhhF$solidjs.createSignal(),
|
|
11808
11817
|
quicklinks_signal_: $gVhhF$solidjs.createSignal(),
|
|
11809
11818
|
i18n_: i18n_,
|
|
@@ -11860,14 +11869,14 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
11860
11869
|
};
|
|
11861
11870
|
});
|
|
11862
11871
|
const {
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11872
|
+
local_filter_cache: local_filter_cache_,
|
|
11873
|
+
filters_open: category_filters_open_,
|
|
11874
|
+
sorting_open: category_sorting_open_,
|
|
11875
|
+
expanded_filters: expanded_filters_,
|
|
11876
|
+
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
11877
|
+
scroll_restoration_data: scroll_restoration_data_
|
|
11878
|
+
} = depict_category.historyStateSignals_;
|
|
11879
|
+
const {
|
|
11871
11880
|
current_sorting_: current_sorting_,
|
|
11872
11881
|
selected_filters_: selected_filters_,
|
|
11873
11882
|
override_listing_id_accessor_: override_listing_id_accessor_,
|
|
@@ -13703,6 +13712,9 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
13703
13712
|
return this.#locale_signal[0]();
|
|
13704
13713
|
}
|
|
13705
13714
|
set localization(locale_obj) {
|
|
13715
|
+
if (typeof locale_obj === "string")
|
|
13716
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
13717
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
13706
13718
|
this.#locale_signal[1](locale_obj);
|
|
13707
13719
|
}
|
|
13708
13720
|
get modal_open() {
|
package/latest/index.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/S
|
|
|
4
4
|
import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
|
|
5
5
|
import { Ancestors, ListingSuggestion, SearchSuggestionsResponseV3 } from "@depict-ai/types/api/SearchSuggestionsResponseV3";
|
|
6
6
|
import { ProductListing, GetListingResponse } from "@depict-ai/types/api/GetListingResponse";
|
|
7
|
-
import { ProductListingResponseV3 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
7
|
+
import { ProductListingResponseV3, SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
8
8
|
import { SearchSuggestionsRequestV3 } from "@depict-ai/types/api/SearchSuggestionsRequestV3";
|
|
9
9
|
import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequestV3";
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
|
-
import { SearchFilter as
|
|
13
|
-
export const version = "4.0
|
|
12
|
+
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
+
export const version = "4.1.0";
|
|
14
14
|
export const prefixes_to_preserve_in_history_dot_state: Set<string>;
|
|
15
15
|
/**
|
|
16
16
|
* Prevent, usually SPAs, from deleting our stuff from history.state when they call history.pushState with a new object they have constructed. This will only run once no matter how often it's called.
|
|
@@ -78,12 +78,16 @@ export function createDeparallelizedNoDropResource<T, X>(dependency: Accessor<T
|
|
|
78
78
|
export function throw_globally<T extends (...args: any) => any>(fn?: T): (...args: Parameters<T>) => ReturnType<T> | undefined;
|
|
79
79
|
declare const LISTING_ID = "listingId";
|
|
80
80
|
declare const EXTERNAL_ID = "externalId";
|
|
81
|
+
type ScrollRestorationData = {
|
|
82
|
+
min_results_loaded: number;
|
|
83
|
+
for_id: string;
|
|
84
|
+
}[];
|
|
81
85
|
export type SDKGridSpacing = string | {
|
|
82
86
|
horizontal: string;
|
|
83
87
|
vertical: string;
|
|
84
88
|
};
|
|
85
89
|
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
86
|
-
type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
90
|
+
export type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
87
91
|
export interface SDKRenderingInfo {
|
|
88
92
|
/**
|
|
89
93
|
* If you call this function with a provided function, the provided function will be called whenever the index of the currently displayed product changes.
|
|
@@ -667,7 +671,7 @@ export type BaseSearchProviderConfig<InputDisplay extends Display, PossibleTrans
|
|
|
667
671
|
urlParamName?: string;
|
|
668
672
|
/**
|
|
669
673
|
* Whether to enable category suggestions in the search modal and search page.
|
|
670
|
-
* @default
|
|
674
|
+
* @default true
|
|
671
675
|
*/
|
|
672
676
|
enableCategorySuggestions?: boolean;
|
|
673
677
|
/**
|
|
@@ -1184,6 +1188,27 @@ type CategoryConstructorOptionsWithoutApi<InputDisplay extends Display, OutputDi
|
|
|
1184
1188
|
type DepictCategoryConstructorOptions<InputDisplay extends Display, OutputDisplay extends ModernDisplay> = CategoryConstructorOptionsWithApi<InputDisplay, OutputDisplay> | CategoryConstructorOptionsWithoutApi<InputDisplay, OutputDisplay>;
|
|
1185
1189
|
export class DepictCategory<InputDisplay extends Display, OutputDisplay extends ModernDisplay | never = InputDisplay extends ModernDisplay ? ModernDisplayWithPageUrl<InputDisplay> : never> {
|
|
1186
1190
|
#private;
|
|
1191
|
+
/**
|
|
1192
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
1193
|
+
*/
|
|
1194
|
+
historyStateSignals_: {
|
|
1195
|
+
filters_open: Signal<boolean>;
|
|
1196
|
+
sorting_open: Signal<boolean>;
|
|
1197
|
+
expanded_filters: Signal<{
|
|
1198
|
+
section_: string;
|
|
1199
|
+
expanded_: boolean;
|
|
1200
|
+
}[]>;
|
|
1201
|
+
local_filter_cache: Signal<_SearchFilter2[]>;
|
|
1202
|
+
expanded_hierarchical_filters: Signal<{
|
|
1203
|
+
value_: string[];
|
|
1204
|
+
expanded_: boolean;
|
|
1205
|
+
}[]>;
|
|
1206
|
+
scroll_restoration_data: Signal<ScrollRestorationData>;
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
1209
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
1210
|
+
*/
|
|
1211
|
+
selectedFilters_: Signal<FilterWithData[]>;
|
|
1187
1212
|
get localization(): category_i18n;
|
|
1188
1213
|
set localization(locale_obj: category_i18n);
|
|
1189
1214
|
get listing_query(): ListingQuery;
|
|
@@ -1301,7 +1326,7 @@ export class DepictSearch<InputDisplay extends Display, OutputDisplay extends Mo
|
|
|
1301
1326
|
set merchant(tenant: string);
|
|
1302
1327
|
get market(): string;
|
|
1303
1328
|
set market(market: string);
|
|
1304
|
-
fetchSearchResults(query: string, filters?:
|
|
1329
|
+
fetchSearchResults(query: string, filters?: _SearchFilter3[], maxResults?: number): Promise<([OutputDisplay] extends [never] ? InputDisplay : ModernDisplayWithPageUrl<OutputDisplay>)[]>;
|
|
1305
1330
|
}
|
|
1306
1331
|
/**
|
|
1307
1332
|
* This is the SearchPage component visible outside - exported from @depict-ai/ui.
|
package/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.0
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.0";
|
|
11
11
|
const $90980bd87c9960f9$export$3064e1e8c6513da3 = new Set();
|
|
12
12
|
let $90980bd87c9960f9$var$has_ran = false;
|
|
13
13
|
function $90980bd87c9960f9$export$5162a71f252e6122() {
|
|
@@ -11627,6 +11627,11 @@ const $961b5c64bef4662f$var$InExternalAreaDiv = ({
|
|
|
11627
11627
|
return _el$;
|
|
11628
11628
|
})();
|
|
11629
11629
|
class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
11630
|
+
/**
|
|
11631
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
11632
|
+
*/ /**
|
|
11633
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
11634
|
+
*/
|
|
11630
11635
|
#router;
|
|
11631
11636
|
#localization_signal = $9HbP8$createSignal();
|
|
11632
11637
|
#merchant_signal = $9HbP8$createSignal();
|
|
@@ -11639,6 +11644,9 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
11639
11644
|
return this.#localization_signal[0]();
|
|
11640
11645
|
}
|
|
11641
11646
|
set localization(locale_obj) {
|
|
11647
|
+
if (typeof locale_obj === "string")
|
|
11648
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
11649
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
11642
11650
|
this.#localization_signal[1](locale_obj);
|
|
11643
11651
|
}
|
|
11644
11652
|
get listing_query() {
|
|
@@ -11717,8 +11725,9 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
11717
11725
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
11718
11726
|
});
|
|
11719
11727
|
const i18n_ = $c16e74cfe125bb05$export$f091cbac892643a4(this.#localization_signal[0]);
|
|
11728
|
+
this.historyStateSignals_ = state_;
|
|
11729
|
+
this.selectedFilters_ = selected_filters_;
|
|
11720
11730
|
$961b5c64bef4662f$var$privately_shared_properties.set(this, {
|
|
11721
|
-
state_: state_,
|
|
11722
11731
|
breadcrumb_signal_: $9HbP8$createSignal(),
|
|
11723
11732
|
quicklinks_signal_: $9HbP8$createSignal(),
|
|
11724
11733
|
i18n_: i18n_,
|
|
@@ -11775,14 +11784,14 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
11775
11784
|
};
|
|
11776
11785
|
});
|
|
11777
11786
|
const {
|
|
11778
|
-
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11787
|
+
local_filter_cache: local_filter_cache_,
|
|
11788
|
+
filters_open: category_filters_open_,
|
|
11789
|
+
sorting_open: category_sorting_open_,
|
|
11790
|
+
expanded_filters: expanded_filters_,
|
|
11791
|
+
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
11792
|
+
scroll_restoration_data: scroll_restoration_data_
|
|
11793
|
+
} = depict_category.historyStateSignals_;
|
|
11794
|
+
const {
|
|
11786
11795
|
current_sorting_: current_sorting_,
|
|
11787
11796
|
selected_filters_: selected_filters_,
|
|
11788
11797
|
override_listing_id_accessor_: override_listing_id_accessor_,
|
|
@@ -13618,6 +13627,9 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
13618
13627
|
return this.#locale_signal[0]();
|
|
13619
13628
|
}
|
|
13620
13629
|
set localization(locale_obj) {
|
|
13630
|
+
if (typeof locale_obj === "string")
|
|
13631
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
13632
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
13621
13633
|
this.#locale_signal[1](locale_obj);
|
|
13622
13634
|
}
|
|
13623
13635
|
get modal_open() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"sass": "styles.scss",
|
package/server/ES10/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447a
|
|
|
98
98
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
99
99
|
$parcel$export(module.exports, "SearchField", () => $98aef9965764903d$export$316f6f283ae64765);
|
|
100
100
|
/*! Depict.ai search and product listing SDK */
|
|
101
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.0
|
|
101
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.1.0";
|
|
102
102
|
const $cfcd56242923775d$export$3064e1e8c6513da3 = new Set();
|
|
103
103
|
let $cfcd56242923775d$var$has_ran = false;
|
|
104
104
|
function $cfcd56242923775d$export$5162a71f252e6122() {
|
|
@@ -10132,11 +10132,19 @@ var $9cbefc32b9dab36d$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
|
10132
10132
|
var $9cbefc32b9dab36d$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
|
|
10133
10133
|
var $9cbefc32b9dab36d$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
|
|
10134
10134
|
class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
10135
|
+
/**
|
|
10136
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
10137
|
+
*/ /**
|
|
10138
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
10139
|
+
*/
|
|
10135
10140
|
get localization() {
|
|
10136
10141
|
// allow reactive access
|
|
10137
10142
|
return $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_localization_signal)[0]();
|
|
10138
10143
|
}
|
|
10139
10144
|
set localization(locale_obj) {
|
|
10145
|
+
if (typeof locale_obj === "string")
|
|
10146
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
10147
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
10140
10148
|
$parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_localization_signal)[1](locale_obj);
|
|
10141
10149
|
}
|
|
10142
10150
|
get listing_query() {
|
|
@@ -10179,6 +10187,8 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
10179
10187
|
listing_query_state_key: listing_query_state_key,
|
|
10180
10188
|
...props_on_class
|
|
10181
10189
|
} = _ref2;
|
|
10190
|
+
$parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty)(this, "historyStateSignals_", void 0);
|
|
10191
|
+
$parcel$interopDefault($3hooq$babelruntimehelpersdefineProperty)(this, "selectedFilters_", void 0);
|
|
10182
10192
|
$9cbefc32b9dab36d$var$_classPrivateFieldInitSpec(this, $9cbefc32b9dab36d$var$_router, {
|
|
10183
10193
|
writable: true,
|
|
10184
10194
|
value: void 0
|
|
@@ -10240,8 +10250,9 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
10240
10250
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
10241
10251
|
});
|
|
10242
10252
|
const i18n_ = $39cca429fb71d8ff$export$f091cbac892643a4($parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_localization_signal)[0]);
|
|
10253
|
+
this.historyStateSignals_ = state_;
|
|
10254
|
+
this.selectedFilters_ = selected_filters_;
|
|
10243
10255
|
$9cbefc32b9dab36d$var$privately_shared_properties.set(this, {
|
|
10244
|
-
state_: state_,
|
|
10245
10256
|
breadcrumb_signal_: $3hooq$solidjs.createSignal(),
|
|
10246
10257
|
quicklinks_signal_: $3hooq$solidjs.createSignal(),
|
|
10247
10258
|
i18n_: i18n_,
|
|
@@ -10307,14 +10318,14 @@ function $9cbefc32b9dab36d$export$e2bf8ce7779e827e(props) {
|
|
|
10307
10318
|
};
|
|
10308
10319
|
});
|
|
10309
10320
|
const {
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10321
|
+
local_filter_cache: local_filter_cache_,
|
|
10322
|
+
filters_open: category_filters_open_,
|
|
10323
|
+
sorting_open: category_sorting_open_,
|
|
10324
|
+
expanded_filters: expanded_filters_,
|
|
10325
|
+
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
10326
|
+
scroll_restoration_data: scroll_restoration_data_
|
|
10327
|
+
} = depict_category.historyStateSignals_;
|
|
10328
|
+
const {
|
|
10318
10329
|
current_sorting_: current_sorting_,
|
|
10319
10330
|
selected_filters_: selected_filters_,
|
|
10320
10331
|
override_listing_id_accessor_: override_listing_id_accessor_,
|
|
@@ -12151,6 +12162,9 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
12151
12162
|
return $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet)(this, $ddd39c5f36f49703$var$_locale_signal)[0]();
|
|
12152
12163
|
}
|
|
12153
12164
|
set localization(locale_obj) {
|
|
12165
|
+
if (typeof locale_obj === "string")
|
|
12166
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
12167
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
12154
12168
|
$parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet)(this, $ddd39c5f36f49703$var$_locale_signal)[1](locale_obj);
|
|
12155
12169
|
}
|
|
12156
12170
|
get modal_open() {
|
package/server/ES10/index.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/S
|
|
|
4
4
|
import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
|
|
5
5
|
import { Ancestors, ListingSuggestion, SearchSuggestionsResponseV3 } from "@depict-ai/types/api/SearchSuggestionsResponseV3";
|
|
6
6
|
import { ProductListing, GetListingResponse } from "@depict-ai/types/api/GetListingResponse";
|
|
7
|
-
import { ProductListingResponseV3 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
7
|
+
import { ProductListingResponseV3, SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
8
8
|
import { SearchSuggestionsRequestV3 } from "@depict-ai/types/api/SearchSuggestionsRequestV3";
|
|
9
9
|
import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequestV3";
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
|
-
import { SearchFilter as
|
|
13
|
-
export const version = "4.0
|
|
12
|
+
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
+
export const version = "4.1.0";
|
|
14
14
|
export const prefixes_to_preserve_in_history_dot_state: Set<string>;
|
|
15
15
|
/**
|
|
16
16
|
* Prevent, usually SPAs, from deleting our stuff from history.state when they call history.pushState with a new object they have constructed. This will only run once no matter how often it's called.
|
|
@@ -78,12 +78,16 @@ export function createDeparallelizedNoDropResource<T, X>(dependency: Accessor<T
|
|
|
78
78
|
export function throw_globally<T extends (...args: any) => any>(fn?: T): (...args: Parameters<T>) => ReturnType<T> | undefined;
|
|
79
79
|
declare const LISTING_ID = "listingId";
|
|
80
80
|
declare const EXTERNAL_ID = "externalId";
|
|
81
|
+
type ScrollRestorationData = {
|
|
82
|
+
min_results_loaded: number;
|
|
83
|
+
for_id: string;
|
|
84
|
+
}[];
|
|
81
85
|
export type SDKGridSpacing = string | {
|
|
82
86
|
horizontal: string;
|
|
83
87
|
vertical: string;
|
|
84
88
|
};
|
|
85
89
|
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
86
|
-
type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
90
|
+
export type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
87
91
|
export interface SDKRenderingInfo {
|
|
88
92
|
/**
|
|
89
93
|
* If you call this function with a provided function, the provided function will be called whenever the index of the currently displayed product changes.
|
|
@@ -667,7 +671,7 @@ export type BaseSearchProviderConfig<InputDisplay extends Display, PossibleTrans
|
|
|
667
671
|
urlParamName?: string;
|
|
668
672
|
/**
|
|
669
673
|
* Whether to enable category suggestions in the search modal and search page.
|
|
670
|
-
* @default
|
|
674
|
+
* @default true
|
|
671
675
|
*/
|
|
672
676
|
enableCategorySuggestions?: boolean;
|
|
673
677
|
/**
|
|
@@ -1184,6 +1188,27 @@ type CategoryConstructorOptionsWithoutApi<InputDisplay extends Display, OutputDi
|
|
|
1184
1188
|
type DepictCategoryConstructorOptions<InputDisplay extends Display, OutputDisplay extends ModernDisplay> = CategoryConstructorOptionsWithApi<InputDisplay, OutputDisplay> | CategoryConstructorOptionsWithoutApi<InputDisplay, OutputDisplay>;
|
|
1185
1189
|
export class DepictCategory<InputDisplay extends Display, OutputDisplay extends ModernDisplay | never = InputDisplay extends ModernDisplay ? ModernDisplayWithPageUrl<InputDisplay> : never> {
|
|
1186
1190
|
#private;
|
|
1191
|
+
/**
|
|
1192
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
1193
|
+
*/
|
|
1194
|
+
historyStateSignals_: {
|
|
1195
|
+
filters_open: Signal<boolean>;
|
|
1196
|
+
sorting_open: Signal<boolean>;
|
|
1197
|
+
expanded_filters: Signal<{
|
|
1198
|
+
section_: string;
|
|
1199
|
+
expanded_: boolean;
|
|
1200
|
+
}[]>;
|
|
1201
|
+
local_filter_cache: Signal<_SearchFilter2[]>;
|
|
1202
|
+
expanded_hierarchical_filters: Signal<{
|
|
1203
|
+
value_: string[];
|
|
1204
|
+
expanded_: boolean;
|
|
1205
|
+
}[]>;
|
|
1206
|
+
scroll_restoration_data: Signal<ScrollRestorationData>;
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
1209
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
1210
|
+
*/
|
|
1211
|
+
selectedFilters_: Signal<FilterWithData[]>;
|
|
1187
1212
|
get localization(): category_i18n;
|
|
1188
1213
|
set localization(locale_obj: category_i18n);
|
|
1189
1214
|
get listing_query(): ListingQuery;
|
|
@@ -1301,7 +1326,7 @@ export class DepictSearch<InputDisplay extends Display, OutputDisplay extends Mo
|
|
|
1301
1326
|
set merchant(tenant: string);
|
|
1302
1327
|
get market(): string;
|
|
1303
1328
|
set market(market: string);
|
|
1304
|
-
fetchSearchResults(query: string, filters?:
|
|
1329
|
+
fetchSearchResults(query: string, filters?: _SearchFilter3[], maxResults?: number): Promise<([OutputDisplay] extends [never] ? InputDisplay : ModernDisplayWithPageUrl<OutputDisplay>)[]>;
|
|
1305
1330
|
}
|
|
1306
1331
|
/**
|
|
1307
1332
|
* This is the SearchPage component visible outside - exported from @depict-ai/ui.
|
package/server/ES10/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.0
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.1.0";
|
|
14
14
|
const $68e6625c8d51f847$export$3064e1e8c6513da3 = new Set();
|
|
15
15
|
let $68e6625c8d51f847$var$has_ran = false;
|
|
16
16
|
function $68e6625c8d51f847$export$5162a71f252e6122() {
|
|
@@ -10044,11 +10044,19 @@ var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
|
10044
10044
|
var $f5f54892fd0c7d9f$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
|
|
10045
10045
|
var $f5f54892fd0c7d9f$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
|
|
10046
10046
|
class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
10047
|
+
/**
|
|
10048
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
10049
|
+
*/ /**
|
|
10050
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
10051
|
+
*/
|
|
10047
10052
|
get localization() {
|
|
10048
10053
|
// allow reactive access
|
|
10049
10054
|
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[0]();
|
|
10050
10055
|
}
|
|
10051
10056
|
set localization(locale_obj) {
|
|
10057
|
+
if (typeof locale_obj === "string")
|
|
10058
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
10059
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
10052
10060
|
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[1](locale_obj);
|
|
10053
10061
|
}
|
|
10054
10062
|
get listing_query() {
|
|
@@ -10091,6 +10099,8 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
10091
10099
|
listing_query_state_key: listing_query_state_key,
|
|
10092
10100
|
...props_on_class
|
|
10093
10101
|
} = _ref2;
|
|
10102
|
+
$b8hua$babelruntimehelpersdefineProperty(this, "historyStateSignals_", void 0);
|
|
10103
|
+
$b8hua$babelruntimehelpersdefineProperty(this, "selectedFilters_", void 0);
|
|
10094
10104
|
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_router, {
|
|
10095
10105
|
writable: true,
|
|
10096
10106
|
value: void 0
|
|
@@ -10152,8 +10162,9 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
10152
10162
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
10153
10163
|
});
|
|
10154
10164
|
const i18n_ = $e18ab2868df26f40$export$f091cbac892643a4($b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[0]);
|
|
10165
|
+
this.historyStateSignals_ = state_;
|
|
10166
|
+
this.selectedFilters_ = selected_filters_;
|
|
10155
10167
|
$f5f54892fd0c7d9f$var$privately_shared_properties.set(this, {
|
|
10156
|
-
state_: state_,
|
|
10157
10168
|
breadcrumb_signal_: $b8hua$createSignal(),
|
|
10158
10169
|
quicklinks_signal_: $b8hua$createSignal(),
|
|
10159
10170
|
i18n_: i18n_,
|
|
@@ -10219,14 +10230,14 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
10219
10230
|
};
|
|
10220
10231
|
});
|
|
10221
10232
|
const {
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10233
|
+
local_filter_cache: local_filter_cache_,
|
|
10234
|
+
filters_open: category_filters_open_,
|
|
10235
|
+
sorting_open: category_sorting_open_,
|
|
10236
|
+
expanded_filters: expanded_filters_,
|
|
10237
|
+
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
10238
|
+
scroll_restoration_data: scroll_restoration_data_
|
|
10239
|
+
} = depict_category.historyStateSignals_;
|
|
10240
|
+
const {
|
|
10230
10241
|
current_sorting_: current_sorting_,
|
|
10231
10242
|
selected_filters_: selected_filters_,
|
|
10232
10243
|
override_listing_id_accessor_: override_listing_id_accessor_,
|
|
@@ -12063,6 +12074,9 @@ class $eb064bc3350276c1$export$ac6237957a15b3f0 {
|
|
|
12063
12074
|
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $eb064bc3350276c1$var$_locale_signal)[0]();
|
|
12064
12075
|
}
|
|
12065
12076
|
set localization(locale_obj) {
|
|
12077
|
+
if (typeof locale_obj === "string")
|
|
12078
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
12079
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
12066
12080
|
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $eb064bc3350276c1$var$_locale_signal)[1](locale_obj);
|
|
12067
12081
|
}
|
|
12068
12082
|
get modal_open() {
|
package/server/latest/index.cjs
CHANGED
|
@@ -92,7 +92,7 @@ $parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad99
|
|
|
92
92
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
93
93
|
$parcel$export(module.exports, "SearchField", () => $c0a0659cf97e8eb2$export$316f6f283ae64765);
|
|
94
94
|
/*! Depict.ai search and product listing SDK */
|
|
95
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.0
|
|
95
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.1.0";
|
|
96
96
|
const $d84fe647b84b5dc5$export$3064e1e8c6513da3 = new Set();
|
|
97
97
|
let $d84fe647b84b5dc5$var$has_ran = false;
|
|
98
98
|
function $d84fe647b84b5dc5$export$5162a71f252e6122() {
|
|
@@ -9474,6 +9474,11 @@ const $48567ac5b39bac56$var$InExternalAreaDiv = ({
|
|
|
9474
9474
|
children: children
|
|
9475
9475
|
}) => $5vyXB$solidjsweb.ssr($48567ac5b39bac56$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey() + $5vyXB$solidjsweb.ssrAttribute("id", $5vyXB$solidjsweb.escape((0, $0b6e2070a98de347$export$44dad306455dddf).PLP_CATEGORY, true), false), $5vyXB$solidjsweb.escape(children));
|
|
9476
9476
|
class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
9477
|
+
/**
|
|
9478
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
9479
|
+
*/ /**
|
|
9480
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
9481
|
+
*/
|
|
9477
9482
|
#router;
|
|
9478
9483
|
#localization_signal = $5vyXB$solidjs.createSignal();
|
|
9479
9484
|
#merchant_signal = $5vyXB$solidjs.createSignal();
|
|
@@ -9486,6 +9491,9 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
9486
9491
|
return this.#localization_signal[0]();
|
|
9487
9492
|
}
|
|
9488
9493
|
set localization(locale_obj) {
|
|
9494
|
+
if (typeof locale_obj === "string")
|
|
9495
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
9496
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
9489
9497
|
this.#localization_signal[1](locale_obj);
|
|
9490
9498
|
}
|
|
9491
9499
|
get listing_query() {
|
|
@@ -9564,8 +9572,9 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
9564
9572
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
9565
9573
|
});
|
|
9566
9574
|
const i18n_ = $0785f4c9947d9b5f$export$f091cbac892643a4(this.#localization_signal[0]);
|
|
9575
|
+
this.historyStateSignals_ = state_;
|
|
9576
|
+
this.selectedFilters_ = selected_filters_;
|
|
9567
9577
|
$48567ac5b39bac56$var$privately_shared_properties.set(this, {
|
|
9568
|
-
state_: state_,
|
|
9569
9578
|
breadcrumb_signal_: $5vyXB$solidjs.createSignal(),
|
|
9570
9579
|
quicklinks_signal_: $5vyXB$solidjs.createSignal(),
|
|
9571
9580
|
i18n_: i18n_,
|
|
@@ -9622,14 +9631,14 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
9622
9631
|
};
|
|
9623
9632
|
});
|
|
9624
9633
|
const {
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9634
|
+
local_filter_cache: local_filter_cache_,
|
|
9635
|
+
filters_open: category_filters_open_,
|
|
9636
|
+
sorting_open: category_sorting_open_,
|
|
9637
|
+
expanded_filters: expanded_filters_,
|
|
9638
|
+
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
9639
|
+
scroll_restoration_data: scroll_restoration_data_
|
|
9640
|
+
} = depict_category.historyStateSignals_;
|
|
9641
|
+
const {
|
|
9633
9642
|
current_sorting_: current_sorting_,
|
|
9634
9643
|
selected_filters_: selected_filters_,
|
|
9635
9644
|
override_listing_id_accessor_: override_listing_id_accessor_,
|
|
@@ -11307,6 +11316,9 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
11307
11316
|
return this.#locale_signal[0]();
|
|
11308
11317
|
}
|
|
11309
11318
|
set localization(locale_obj) {
|
|
11319
|
+
if (typeof locale_obj === "string")
|
|
11320
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
11321
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
11310
11322
|
this.#locale_signal[1](locale_obj);
|
|
11311
11323
|
}
|
|
11312
11324
|
get modal_open() {
|
package/server/latest/index.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/S
|
|
|
4
4
|
import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
|
|
5
5
|
import { Ancestors, ListingSuggestion, SearchSuggestionsResponseV3 } from "@depict-ai/types/api/SearchSuggestionsResponseV3";
|
|
6
6
|
import { ProductListing, GetListingResponse } from "@depict-ai/types/api/GetListingResponse";
|
|
7
|
-
import { ProductListingResponseV3 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
7
|
+
import { ProductListingResponseV3, SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
8
8
|
import { SearchSuggestionsRequestV3 } from "@depict-ai/types/api/SearchSuggestionsRequestV3";
|
|
9
9
|
import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequestV3";
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
|
-
import { SearchFilter as
|
|
13
|
-
export const version = "4.0
|
|
12
|
+
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
+
export const version = "4.1.0";
|
|
14
14
|
export const prefixes_to_preserve_in_history_dot_state: Set<string>;
|
|
15
15
|
/**
|
|
16
16
|
* Prevent, usually SPAs, from deleting our stuff from history.state when they call history.pushState with a new object they have constructed. This will only run once no matter how often it's called.
|
|
@@ -78,12 +78,16 @@ export function createDeparallelizedNoDropResource<T, X>(dependency: Accessor<T
|
|
|
78
78
|
export function throw_globally<T extends (...args: any) => any>(fn?: T): (...args: Parameters<T>) => ReturnType<T> | undefined;
|
|
79
79
|
declare const LISTING_ID = "listingId";
|
|
80
80
|
declare const EXTERNAL_ID = "externalId";
|
|
81
|
+
type ScrollRestorationData = {
|
|
82
|
+
min_results_loaded: number;
|
|
83
|
+
for_id: string;
|
|
84
|
+
}[];
|
|
81
85
|
export type SDKGridSpacing = string | {
|
|
82
86
|
horizontal: string;
|
|
83
87
|
vertical: string;
|
|
84
88
|
};
|
|
85
89
|
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
86
|
-
type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
90
|
+
export type FilterWithData = WithRequired<SearchFilter, "data">;
|
|
87
91
|
export interface SDKRenderingInfo {
|
|
88
92
|
/**
|
|
89
93
|
* If you call this function with a provided function, the provided function will be called whenever the index of the currently displayed product changes.
|
|
@@ -667,7 +671,7 @@ export type BaseSearchProviderConfig<InputDisplay extends Display, PossibleTrans
|
|
|
667
671
|
urlParamName?: string;
|
|
668
672
|
/**
|
|
669
673
|
* Whether to enable category suggestions in the search modal and search page.
|
|
670
|
-
* @default
|
|
674
|
+
* @default true
|
|
671
675
|
*/
|
|
672
676
|
enableCategorySuggestions?: boolean;
|
|
673
677
|
/**
|
|
@@ -1184,6 +1188,27 @@ type CategoryConstructorOptionsWithoutApi<InputDisplay extends Display, OutputDi
|
|
|
1184
1188
|
type DepictCategoryConstructorOptions<InputDisplay extends Display, OutputDisplay extends ModernDisplay> = CategoryConstructorOptionsWithApi<InputDisplay, OutputDisplay> | CategoryConstructorOptionsWithoutApi<InputDisplay, OutputDisplay>;
|
|
1185
1189
|
export class DepictCategory<InputDisplay extends Display, OutputDisplay extends ModernDisplay | never = InputDisplay extends ModernDisplay ? ModernDisplayWithPageUrl<InputDisplay> : never> {
|
|
1186
1190
|
#private;
|
|
1191
|
+
/**
|
|
1192
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
1193
|
+
*/
|
|
1194
|
+
historyStateSignals_: {
|
|
1195
|
+
filters_open: Signal<boolean>;
|
|
1196
|
+
sorting_open: Signal<boolean>;
|
|
1197
|
+
expanded_filters: Signal<{
|
|
1198
|
+
section_: string;
|
|
1199
|
+
expanded_: boolean;
|
|
1200
|
+
}[]>;
|
|
1201
|
+
local_filter_cache: Signal<_SearchFilter2[]>;
|
|
1202
|
+
expanded_hierarchical_filters: Signal<{
|
|
1203
|
+
value_: string[];
|
|
1204
|
+
expanded_: boolean;
|
|
1205
|
+
}[]>;
|
|
1206
|
+
scroll_restoration_data: Signal<ScrollRestorationData>;
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
1209
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
1210
|
+
*/
|
|
1211
|
+
selectedFilters_: Signal<FilterWithData[]>;
|
|
1187
1212
|
get localization(): category_i18n;
|
|
1188
1213
|
set localization(locale_obj: category_i18n);
|
|
1189
1214
|
get listing_query(): ListingQuery;
|
|
@@ -1301,7 +1326,7 @@ export class DepictSearch<InputDisplay extends Display, OutputDisplay extends Mo
|
|
|
1301
1326
|
set merchant(tenant: string);
|
|
1302
1327
|
get market(): string;
|
|
1303
1328
|
set market(market: string);
|
|
1304
|
-
fetchSearchResults(query: string, filters?:
|
|
1329
|
+
fetchSearchResults(query: string, filters?: _SearchFilter3[], maxResults?: number): Promise<([OutputDisplay] extends [never] ? InputDisplay : ModernDisplayWithPageUrl<OutputDisplay>)[]>;
|
|
1305
1330
|
}
|
|
1306
1331
|
/**
|
|
1307
1332
|
* This is the SearchPage component visible outside - exported from @depict-ai/ui.
|
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.0
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.1.0";
|
|
11
11
|
const $90980bd87c9960f9$export$3064e1e8c6513da3 = new Set();
|
|
12
12
|
let $90980bd87c9960f9$var$has_ran = false;
|
|
13
13
|
function $90980bd87c9960f9$export$5162a71f252e6122() {
|
|
@@ -9389,6 +9389,11 @@ const $961b5c64bef4662f$var$InExternalAreaDiv = ({
|
|
|
9389
9389
|
children: children
|
|
9390
9390
|
}) => $i7OB2$ssr($961b5c64bef4662f$var$_tmpl$, $i7OB2$ssrHydrationKey() + $i7OB2$ssrAttribute("id", $i7OB2$escape((0, $f86ba724282f6690$export$44dad306455dddf).PLP_CATEGORY, true), false), $i7OB2$escape(children));
|
|
9391
9391
|
class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
9392
|
+
/**
|
|
9393
|
+
* Used internally in @depict-ai/react-ui for `useCategoryFilterHelpers`. These are solid-js signals that contain the value of the state for this DepictCategory instance that's currently in history.state. Calling the setters updates history.state with history.replaceState.
|
|
9394
|
+
*/ /**
|
|
9395
|
+
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
|
9396
|
+
*/
|
|
9392
9397
|
#router;
|
|
9393
9398
|
#localization_signal = $i7OB2$createSignal();
|
|
9394
9399
|
#merchant_signal = $i7OB2$createSignal();
|
|
@@ -9401,6 +9406,9 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
9401
9406
|
return this.#localization_signal[0]();
|
|
9402
9407
|
}
|
|
9403
9408
|
set localization(locale_obj) {
|
|
9409
|
+
if (typeof locale_obj === "string")
|
|
9410
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
9411
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
9404
9412
|
this.#localization_signal[1](locale_obj);
|
|
9405
9413
|
}
|
|
9406
9414
|
get listing_query() {
|
|
@@ -9479,8 +9487,9 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
9479
9487
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
9480
9488
|
});
|
|
9481
9489
|
const i18n_ = $c16e74cfe125bb05$export$f091cbac892643a4(this.#localization_signal[0]);
|
|
9490
|
+
this.historyStateSignals_ = state_;
|
|
9491
|
+
this.selectedFilters_ = selected_filters_;
|
|
9482
9492
|
$961b5c64bef4662f$var$privately_shared_properties.set(this, {
|
|
9483
|
-
state_: state_,
|
|
9484
9493
|
breadcrumb_signal_: $i7OB2$createSignal(),
|
|
9485
9494
|
quicklinks_signal_: $i7OB2$createSignal(),
|
|
9486
9495
|
i18n_: i18n_,
|
|
@@ -9537,14 +9546,14 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
|
9537
9546
|
};
|
|
9538
9547
|
});
|
|
9539
9548
|
const {
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9549
|
+
local_filter_cache: local_filter_cache_,
|
|
9550
|
+
filters_open: category_filters_open_,
|
|
9551
|
+
sorting_open: category_sorting_open_,
|
|
9552
|
+
expanded_filters: expanded_filters_,
|
|
9553
|
+
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
9554
|
+
scroll_restoration_data: scroll_restoration_data_
|
|
9555
|
+
} = depict_category.historyStateSignals_;
|
|
9556
|
+
const {
|
|
9548
9557
|
current_sorting_: current_sorting_,
|
|
9549
9558
|
selected_filters_: selected_filters_,
|
|
9550
9559
|
override_listing_id_accessor_: override_listing_id_accessor_,
|
|
@@ -11222,6 +11231,9 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
11222
11231
|
return this.#locale_signal[0]();
|
|
11223
11232
|
}
|
|
11224
11233
|
set localization(locale_obj) {
|
|
11234
|
+
if (typeof locale_obj === "string")
|
|
11235
|
+
// Prevent people not using typescript from accidentally passing a string instead of an object, see https://depictaiworkspace.slack.com/archives/C04RF3KTK0A/p1707211551951239
|
|
11236
|
+
throw new Error("locale must be an object, see the TypeScript definitions");
|
|
11225
11237
|
this.#locale_signal[1](locale_obj);
|
|
11226
11238
|
}
|
|
11227
11239
|
get modal_open() {
|