@depict-ai/ui 1.0.3 → 1.0.5
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/.idea/GitLink.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/ui.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +53 -0
- package/dist/index.d.ts +1 -1
- package/dist/main.js +36 -29
- package/dist/module.js +37 -30
- package/package.json +4 -4
- package/ssr/client/main.js +11064 -0
- package/ssr/client/module.js +10941 -0
- package/ssr/index.d.ts +635 -0
- package/ssr/server/main.js +9477 -0
- package/ssr/server/module.js +9321 -0
- package/dist/typescript_schema/BaseSearchRequest.d.ts +0 -197
- package/dist/typescript_schema/ProductListingQueriesRequest.d.ts +0 -14
- package/dist/typescript_schema/ProductListingQueriesResponse.d.ts +0 -10
- package/dist/typescript_schema/ProductListingRequest.d.ts +0 -221
- package/dist/typescript_schema/ProductListingResponse.d.ts +0 -232
- package/dist/typescript_schema/RecommendResponse.d.ts +0 -15
- package/dist/typescript_schema/SearchRequest.d.ts +0 -213
- package/dist/typescript_schema/SearchResponse.d.ts +0 -192
- package/dist/typescript_schema/SearchSuggestionsRequest.d.ts +0 -18
- package/dist/typescript_schema/SearchSuggestionsResponse.d.ts +0 -182
- package/dist/typescript_schema/TrackV2Request.d.ts +0 -115
package/.idea/ui.iml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
package/.idea/vcs.xml
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ChangeListManager">
|
|
4
|
+
<list default="true" id="8fb005d5-010e-47cc-ae0c-ebe2817ecfd0" name="Changes" comment="">
|
|
5
|
+
<change beforePath="$PROJECT_DIR$/../utilishared/src/components/Placeholder.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/../utilishared/src/components/Placeholder.tsx" afterDir="false" />
|
|
6
|
+
<change beforePath="$PROJECT_DIR$/../../../storefronts/next-web/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/../../../storefronts/next-web/package.json" afterDir="false" />
|
|
7
|
+
<change beforePath="$PROJECT_DIR$/../../../storefronts/next-web/yarn.lock" beforeDir="false" afterPath="$PROJECT_DIR$/../../../storefronts/next-web/yarn.lock" afterDir="false" />
|
|
8
|
+
</list>
|
|
9
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
10
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
11
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
12
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
13
|
+
</component>
|
|
14
|
+
<component name="Git.Settings">
|
|
15
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../../.." />
|
|
16
|
+
</component>
|
|
17
|
+
<component name="MarkdownSettingsMigration">
|
|
18
|
+
<option name="stateVersion" value="1" />
|
|
19
|
+
</component>
|
|
20
|
+
<component name="ProjectId" id="2P0qK3tmIHFTEmciJk9OSlP6jTP" />
|
|
21
|
+
<component name="ProjectViewState">
|
|
22
|
+
<option name="autoscrollFromSource" value="true" />
|
|
23
|
+
<option name="autoscrollToSource" value="true" />
|
|
24
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
|
25
|
+
<option name="showLibraryContents" value="true" />
|
|
26
|
+
</component>
|
|
27
|
+
<component name="PropertiesComponent"><![CDATA[{
|
|
28
|
+
"keyToString": {
|
|
29
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
30
|
+
"WebServerToolWindowFactoryState": "false",
|
|
31
|
+
"git-widget-placeholder": "dt/improve__placeholders",
|
|
32
|
+
"nodejs_package_manager_path": "npm",
|
|
33
|
+
"settings.editor.selected.configurable": "settings.nodejs",
|
|
34
|
+
"ts.external.directory.path": "/Applications/WebStorm.app/Contents/plugins/javascript-impl/jsLanguageServicesImpl/external",
|
|
35
|
+
"vue.rearranger.settings.migration": "true"
|
|
36
|
+
}
|
|
37
|
+
}]]></component>
|
|
38
|
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
39
|
+
<component name="TaskManager">
|
|
40
|
+
<task active="true" id="Default" summary="Default task">
|
|
41
|
+
<changelist id="8fb005d5-010e-47cc-ae0c-ebe2817ecfd0" name="Changes" comment="" />
|
|
42
|
+
<created>1682604279249</created>
|
|
43
|
+
<option name="number" value="Default" />
|
|
44
|
+
<option name="presentableId" value="Default" />
|
|
45
|
+
<updated>1682604279249</updated>
|
|
46
|
+
<workItem from="1682604280899" duration="29000" />
|
|
47
|
+
</task>
|
|
48
|
+
<servers />
|
|
49
|
+
</component>
|
|
50
|
+
<component name="TypeScriptGeneratedFilesManager">
|
|
51
|
+
<option name="version" value="3" />
|
|
52
|
+
</component>
|
|
53
|
+
</project>
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ 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 = "1.0.
|
|
10
|
+
export const version = "1.0.5";
|
|
11
11
|
export type OnNavigation = ((options: {
|
|
12
12
|
is_replace: boolean;
|
|
13
13
|
new_url: URL;
|
package/dist/main.js
CHANGED
|
@@ -34,7 +34,7 @@ $parcel$export(module.exports, "SolidFormatPrice", () => $5fc9fc23df1591db$expor
|
|
|
34
34
|
$parcel$export(module.exports, "connect_search_field_height_to_aligner_height", () => $246e3e89a097f014$export$828dcdd425fd3231);
|
|
35
35
|
$parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
|
|
36
36
|
$parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
|
|
37
|
-
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "1.0.
|
|
37
|
+
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "1.0.5";
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -334,6 +334,32 @@ function $5fc9fc23df1591db$export$a71e92cfbb498adc(props) {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
function $a1a6a9583c4e66ae$export$205efb947c7ffd78(handler, passive = true) {
|
|
340
|
+
const catchified_handler = (0, $46MJV$depictaiutilishared.catchify)(handler);
|
|
341
|
+
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
342
|
+
// Use observer in case that this gets called before body exists
|
|
343
|
+
const disconnect = (0, $46MJV$depictaiutilishared.observer).onexists("body", ({ element: element })=>{
|
|
344
|
+
element.addEventListener("scroll", catchified_handler, {
|
|
345
|
+
passive: passive
|
|
346
|
+
});
|
|
347
|
+
(0, $46MJV$solidjs.onCleanup)(()=>element.removeEventListener("scroll", catchified_handler));
|
|
348
|
+
});
|
|
349
|
+
(0, $46MJV$solidjs.onCleanup)(disconnect);
|
|
350
|
+
for (const event of [
|
|
351
|
+
"resize",
|
|
352
|
+
"orientationchange",
|
|
353
|
+
"scroll"
|
|
354
|
+
]){
|
|
355
|
+
addEventListener(event, catchified_handler, {
|
|
356
|
+
passive: passive
|
|
357
|
+
});
|
|
358
|
+
(0, $46MJV$solidjs.onCleanup)(()=>removeEventListener(event, catchified_handler));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
|
|
337
363
|
const $08fa9d20f7ec85af$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="scroll-status" style="display:none"><span class="text"><b></b> – <b></b> <!> <b></b></span></div>`, 11);
|
|
338
364
|
function $08fa9d20f7ec85af$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_ , first_result_in_viewport_: [get_first_result_in_viewport] , last_result_in_viewport_: [get_last_result_in_viewport] , number_of_results_: number_of_results_ , i18n_: { price_formatting_: price_formatting_ , of_: of_ } }) {
|
|
339
365
|
const [first_to_show, set_first_to_show] = (0, $46MJV$solidjs.createSignal)(0);
|
|
@@ -351,7 +377,7 @@ function $08fa9d20f7ec85af$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
351
377
|
let last_pos = scrollY;
|
|
352
378
|
let unpermit_when_possible = false;
|
|
353
379
|
let times_too_fast = 0;
|
|
354
|
-
const handle_scrollpos_change = (
|
|
380
|
+
const handle_scrollpos_change = ()=>{
|
|
355
381
|
if (animation) set_show_triggered((prev)=>!prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
|
|
356
382
|
const distance_travelled = Math.abs(scrollY - last_pos);
|
|
357
383
|
const now = +new Date();
|
|
@@ -368,17 +394,8 @@ function $08fa9d20f7ec85af$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
368
394
|
else set_permitted_to_show(false);
|
|
369
395
|
last_pos_time = now;
|
|
370
396
|
last_pos = scrollY;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
"resize",
|
|
374
|
-
"orientationchange",
|
|
375
|
-
"scroll"
|
|
376
|
-
]){
|
|
377
|
-
addEventListener(event, handle_scrollpos_change, {
|
|
378
|
-
passive: true
|
|
379
|
-
});
|
|
380
|
-
(0, $46MJV$solidjs.onCleanup)(()=>removeEventListener(event, handle_scrollpos_change));
|
|
381
|
-
}
|
|
397
|
+
};
|
|
398
|
+
(0, $a1a6a9583c4e66ae$export$205efb947c7ffd78)(handle_scrollpos_change);
|
|
382
399
|
(0, $46MJV$solidjs.createEffect)(()=>{
|
|
383
400
|
show_triggered();
|
|
384
401
|
const first = get_first_result_in_viewport();
|
|
@@ -4220,6 +4237,7 @@ function $881cb1745bafff7a$var$OpenSortingButton({ i18n_: i18n_ , get_current_so
|
|
|
4220
4237
|
|
|
4221
4238
|
|
|
4222
4239
|
|
|
4240
|
+
|
|
4223
4241
|
const $fd64465f894d1f29$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="floating-buttons"><button class="filter"><div></div></button><button class="sort"><div></div></button><button class="up"><div></div></button></div>`, 14);
|
|
4224
4242
|
function $fd64465f894d1f29$export$b23abd26de154ede(props) {
|
|
4225
4243
|
const [is_small, set_is_small] = (0, $46MJV$solidjs.createSignal)(true);
|
|
@@ -4246,7 +4264,7 @@ function $fd64465f894d1f29$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4246
4264
|
const [get_is_showing_toast] = (0, $b3e6a0e9382bf87e$export$22970a0140fc759c);
|
|
4247
4265
|
const [modal_is_closed, set_if_modal_is_closed] = (0, $46MJV$solidjs.createSignal)(!(0, $46MJV$solidjs.untrack)(get_search_filters_open_) && !(0, $46MJV$solidjs.untrack)(get_search_sorting_open_));
|
|
4248
4266
|
const [regular_buttons_are_in_view, set_regular_buttons_are_in_view] = (0, $46MJV$solidjs.createSignal)(false);
|
|
4249
|
-
const handle_scrollpos_change = (
|
|
4267
|
+
const handle_scrollpos_change = ()=>(0, $46MJV$solidjs.untrack)(()=>{
|
|
4250
4268
|
const new_pos = scrollY;
|
|
4251
4269
|
if (modal_is_closed()) {
|
|
4252
4270
|
const diff = new_pos - old_pos;
|
|
@@ -4261,7 +4279,7 @@ function $fd64465f894d1f29$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4261
4279
|
else if (diff_over_second_or_touch > 30) set_is_scrolling_upwards(false);
|
|
4262
4280
|
}
|
|
4263
4281
|
old_pos = new_pos;
|
|
4264
|
-
})
|
|
4282
|
+
});
|
|
4265
4283
|
const touchstart_handler = (0, $46MJV$depictaiutilishared.catchify)((e)=>{
|
|
4266
4284
|
is_in_touch_scroll = true;
|
|
4267
4285
|
if (e.touches.length === 1) {
|
|
@@ -4284,16 +4302,7 @@ function $fd64465f894d1f29$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4284
4302
|
removeEventListener("touchstart", touchstart_handler);
|
|
4285
4303
|
removeEventListener("touchend", touchend_handler);
|
|
4286
4304
|
});
|
|
4287
|
-
|
|
4288
|
-
"resize",
|
|
4289
|
-
"orientationchange",
|
|
4290
|
-
"scroll"
|
|
4291
|
-
]){
|
|
4292
|
-
addEventListener(event, handle_scrollpos_change, {
|
|
4293
|
-
passive: true
|
|
4294
|
-
});
|
|
4295
|
-
(0, $46MJV$solidjs.onCleanup)(()=>removeEventListener(event, handle_scrollpos_change));
|
|
4296
|
-
}
|
|
4305
|
+
(0, $a1a6a9583c4e66ae$export$205efb947c7ffd78)(handle_scrollpos_change);
|
|
4297
4306
|
(0, $46MJV$solidjs.onCleanup)(resolve_cleanup_promise);
|
|
4298
4307
|
(0, $46MJV$solidjs.createComputed)(()=>{
|
|
4299
4308
|
clearTimeout(timeout);
|
|
@@ -6192,6 +6201,7 @@ function $9f81b7ced87aabf2$var$make_state_saved_rows([get_showing_recommendation
|
|
|
6192
6201
|
|
|
6193
6202
|
|
|
6194
6203
|
|
|
6204
|
+
|
|
6195
6205
|
function $67b60b572b7b7059$export$b3ad617e9036868(modal_body_style, input_field, width_transformer, includeScroll, one_axies_only) {
|
|
6196
6206
|
let aligned_this_microtask = false;
|
|
6197
6207
|
const align_position = ()=>{
|
|
@@ -6224,8 +6234,7 @@ function $67b60b572b7b7059$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6224
6234
|
}));
|
|
6225
6235
|
ro.observe(input_field);
|
|
6226
6236
|
}
|
|
6227
|
-
|
|
6228
|
-
window.addEventListener("orientationchange", align_position);
|
|
6237
|
+
(0, $a1a6a9583c4e66ae$export$205efb947c7ffd78)(align_position);
|
|
6229
6238
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
6230
6239
|
// this works
|
|
6231
6240
|
// keeping resize just in case
|
|
@@ -6235,8 +6244,6 @@ function $67b60b572b7b7059$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6235
6244
|
(0, $46MJV$solidjs.onCleanup)((0, $46MJV$depictaiutilishared.catchify)(()=>{
|
|
6236
6245
|
ro?.disconnect();
|
|
6237
6246
|
resize_resize_observer.disconnect();
|
|
6238
|
-
window.removeEventListener("resize", align_position);
|
|
6239
|
-
window.removeEventListener("orientationchange", align_position);
|
|
6240
6247
|
}));
|
|
6241
6248
|
return align_position;
|
|
6242
6249
|
}
|
package/dist/module.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {add_to_version_info as $g9l4l$add_to_version_info, fetch_recs as $g9l4l$fetch_recs, snakeCasifyObject as $g9l4l$snakeCasifyObject, GenericSliderArrowButton as $g9l4l$GenericSliderArrowButton, catchify as $g9l4l$catchify, instant_exec_on_suspect_history_change as $g9l4l$instant_exec_on_suspect_history_change, base_url as $g9l4l$base_url, dlog as $g9l4l$dlog, get_depict_id as $g9l4l$get_depict_id, get_user_id as $g9l4l$get_user_id, get_session_id as $g9l4l$get_session_id, make_url_with_query_params as $g9l4l$make_url_with_query_params, fetch_retry as $g9l4l$fetch_retry, add_version_query_params as $g9l4l$add_version_query_params, sort_obj as $g9l4l$sort_obj, Placeholder as $g9l4l$Placeholder, report as $g9l4l$report, javascript_media_query as $g9l4l$javascript_media_query, standard_price_format as $g9l4l$standard_price_format,
|
|
1
|
+
import {add_to_version_info as $g9l4l$add_to_version_info, fetch_recs as $g9l4l$fetch_recs, snakeCasifyObject as $g9l4l$snakeCasifyObject, GenericSliderArrowButton as $g9l4l$GenericSliderArrowButton, catchify as $g9l4l$catchify, instant_exec_on_suspect_history_change as $g9l4l$instant_exec_on_suspect_history_change, base_url as $g9l4l$base_url, dlog as $g9l4l$dlog, get_depict_id as $g9l4l$get_depict_id, get_user_id as $g9l4l$get_user_id, get_session_id as $g9l4l$get_session_id, make_url_with_query_params as $g9l4l$make_url_with_query_params, fetch_retry as $g9l4l$fetch_retry, add_version_query_params as $g9l4l$add_version_query_params, sort_obj as $g9l4l$sort_obj, Placeholder as $g9l4l$Placeholder, report as $g9l4l$report, javascript_media_query as $g9l4l$javascript_media_query, standard_price_format as $g9l4l$standard_price_format, observer as $g9l4l$observer, make_random_classname as $g9l4l$make_random_classname, n_col_styling_with_dist as $g9l4l$n_col_styling_with_dist, CrossIcon as $g9l4l$CrossIcon, useExpandingContainer as $g9l4l$useExpandingContainer, Amazing_Slider as $g9l4l$Amazing_Slider, slider_snap_css as $g9l4l$slider_snap_css, slider_fading_factory as $g9l4l$slider_fading_factory, MinusIcon as $g9l4l$MinusIcon, FilterIcon as $g9l4l$FilterIcon, SortIconAsc as $g9l4l$SortIconAsc, SortIconDesc as $g9l4l$SortIconDesc, PlusIcon as $g9l4l$PlusIcon, hsl_to_rgb as $g9l4l$hsl_to_rgb, relative_luminance_from_rgb as $g9l4l$relative_luminance_from_rgb, TickIcon as $g9l4l$TickIcon, ArrowUp as $g9l4l$ArrowUp, base64_encode_unicode as $g9l4l$base64_encode_unicode, base64_decode_unicode as $g9l4l$base64_decode_unicode, queueMacroTask as $g9l4l$queueMacroTask, dwarn as $g9l4l$dwarn, ContainedPlaceholderImage as $g9l4l$ContainedPlaceholderImage, BackIcon as $g9l4l$BackIcon, SearchIcon as $g9l4l$SearchIcon, Layout as $g9l4l$Layout, async_iterable_ipns as $g9l4l$async_iterable_ipns, make_asyncIterable_exiter as $g9l4l$make_asyncIterable_exiter, href_change_ipns as $g9l4l$href_change_ipns, ContainedImage as $g9l4l$ContainedImage, buildThresholdList as $g9l4l$buildThresholdList, deparallelize_no_drop as $g9l4l$deparallelize_no_drop, PreviousSearchIcon as $g9l4l$PreviousSearchIcon, insert_surfaces as $g9l4l$insert_surfaces} from "@depict-ai/utilishared";
|
|
2
2
|
import {template as $g9l4l$template, insert as $g9l4l$insert, effect as $g9l4l$effect, setAttribute as $g9l4l$setAttribute, createComponent as $g9l4l$createComponent, use as $g9l4l$use, memo as $g9l4l$memo, addEventListener as $g9l4l$addEventListener, delegateEvents as $g9l4l$delegateEvents, spread as $g9l4l$spread, classList as $g9l4l$classList, style as $g9l4l$style, Dynamic as $g9l4l$Dynamic, mergeProps as $g9l4l$mergeProps, className as $g9l4l$className} from "solid-js/web";
|
|
3
3
|
import {createSignal as $g9l4l$createSignal, getOwner as $g9l4l$getOwner, createRoot as $g9l4l$createRoot, runWithOwner as $g9l4l$runWithOwner, onCleanup as $g9l4l$onCleanup, createComputed as $g9l4l$createComputed, createRenderEffect as $g9l4l$createRenderEffect, createEffect as $g9l4l$createEffect, untrack as $g9l4l$untrack, batch as $g9l4l$batch, createResource as $g9l4l$createResource, createMemo as $g9l4l$createMemo, Show as $g9l4l$Show, createReaction as $g9l4l$createReaction, Suspense as $g9l4l$Suspense, on as $g9l4l$on, ErrorBoundary as $g9l4l$ErrorBoundary, For as $g9l4l$For, Index as $g9l4l$Index} from "solid-js";
|
|
4
4
|
|
|
5
|
-
/*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "1.0.
|
|
5
|
+
/*! Depict.ai search and product listing SDK */ const $18bf1d29fb889cca$export$83d89fbfd8236492 = "1.0.5";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -302,6 +302,32 @@ function $5178263ed1e394ca$export$a71e92cfbb498adc(props) {
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
function $171b6a474d2e9601$export$205efb947c7ffd78(handler, passive = true) {
|
|
308
|
+
const catchified_handler = (0, $g9l4l$catchify)(handler);
|
|
309
|
+
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
310
|
+
// Use observer in case that this gets called before body exists
|
|
311
|
+
const disconnect = (0, $g9l4l$observer).onexists("body", ({ element: element })=>{
|
|
312
|
+
element.addEventListener("scroll", catchified_handler, {
|
|
313
|
+
passive: passive
|
|
314
|
+
});
|
|
315
|
+
(0, $g9l4l$onCleanup)(()=>element.removeEventListener("scroll", catchified_handler));
|
|
316
|
+
});
|
|
317
|
+
(0, $g9l4l$onCleanup)(disconnect);
|
|
318
|
+
for (const event of [
|
|
319
|
+
"resize",
|
|
320
|
+
"orientationchange",
|
|
321
|
+
"scroll"
|
|
322
|
+
]){
|
|
323
|
+
addEventListener(event, catchified_handler, {
|
|
324
|
+
passive: passive
|
|
325
|
+
});
|
|
326
|
+
(0, $g9l4l$onCleanup)(()=>removeEventListener(event, catchified_handler));
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
305
331
|
const $51b5c03492337d58$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$g9l4l$template)(`<div class="scroll-status" style="display:none"><span class="text"><b></b> – <b></b> <!> <b></b></span></div>`, 11);
|
|
306
332
|
function $51b5c03492337d58$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_ , first_result_in_viewport_: [get_first_result_in_viewport] , last_result_in_viewport_: [get_last_result_in_viewport] , number_of_results_: number_of_results_ , i18n_: { price_formatting_: price_formatting_ , of_: of_ } }) {
|
|
307
333
|
const [first_to_show, set_first_to_show] = (0, $g9l4l$createSignal)(0);
|
|
@@ -319,7 +345,7 @@ function $51b5c03492337d58$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
319
345
|
let last_pos = scrollY;
|
|
320
346
|
let unpermit_when_possible = false;
|
|
321
347
|
let times_too_fast = 0;
|
|
322
|
-
const handle_scrollpos_change = (
|
|
348
|
+
const handle_scrollpos_change = ()=>{
|
|
323
349
|
if (animation) set_show_triggered((prev)=>!prev); // make sure that once we've decided to show the indicator it doesn't disappear before we stop scrolling
|
|
324
350
|
const distance_travelled = Math.abs(scrollY - last_pos);
|
|
325
351
|
const now = +new Date();
|
|
@@ -336,17 +362,8 @@ function $51b5c03492337d58$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
336
362
|
else set_permitted_to_show(false);
|
|
337
363
|
last_pos_time = now;
|
|
338
364
|
last_pos = scrollY;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
"resize",
|
|
342
|
-
"orientationchange",
|
|
343
|
-
"scroll"
|
|
344
|
-
]){
|
|
345
|
-
addEventListener(event, handle_scrollpos_change, {
|
|
346
|
-
passive: true
|
|
347
|
-
});
|
|
348
|
-
(0, $g9l4l$onCleanup)(()=>removeEventListener(event, handle_scrollpos_change));
|
|
349
|
-
}
|
|
365
|
+
};
|
|
366
|
+
(0, $171b6a474d2e9601$export$205efb947c7ffd78)(handle_scrollpos_change);
|
|
350
367
|
(0, $g9l4l$createEffect)(()=>{
|
|
351
368
|
show_triggered();
|
|
352
369
|
const first = get_first_result_in_viewport();
|
|
@@ -4188,6 +4205,7 @@ function $bf7fe049e78f975a$var$OpenSortingButton({ i18n_: i18n_ , get_current_so
|
|
|
4188
4205
|
|
|
4189
4206
|
|
|
4190
4207
|
|
|
4208
|
+
|
|
4191
4209
|
const $4a2667e8d77eb55a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$g9l4l$template)(`<div class="floating-buttons"><button class="filter"><div></div></button><button class="sort"><div></div></button><button class="up"><div></div></button></div>`, 14);
|
|
4192
4210
|
function $4a2667e8d77eb55a$export$b23abd26de154ede(props) {
|
|
4193
4211
|
const [is_small, set_is_small] = (0, $g9l4l$createSignal)(true);
|
|
@@ -4214,7 +4232,7 @@ function $4a2667e8d77eb55a$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4214
4232
|
const [get_is_showing_toast] = (0, $886fa987db4f3805$export$22970a0140fc759c);
|
|
4215
4233
|
const [modal_is_closed, set_if_modal_is_closed] = (0, $g9l4l$createSignal)(!(0, $g9l4l$untrack)(get_search_filters_open_) && !(0, $g9l4l$untrack)(get_search_sorting_open_));
|
|
4216
4234
|
const [regular_buttons_are_in_view, set_regular_buttons_are_in_view] = (0, $g9l4l$createSignal)(false);
|
|
4217
|
-
const handle_scrollpos_change = (
|
|
4235
|
+
const handle_scrollpos_change = ()=>(0, $g9l4l$untrack)(()=>{
|
|
4218
4236
|
const new_pos = scrollY;
|
|
4219
4237
|
if (modal_is_closed()) {
|
|
4220
4238
|
const diff = new_pos - old_pos;
|
|
@@ -4229,7 +4247,7 @@ function $4a2667e8d77eb55a$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4229
4247
|
else if (diff_over_second_or_touch > 30) set_is_scrolling_upwards(false);
|
|
4230
4248
|
}
|
|
4231
4249
|
old_pos = new_pos;
|
|
4232
|
-
})
|
|
4250
|
+
});
|
|
4233
4251
|
const touchstart_handler = (0, $g9l4l$catchify)((e)=>{
|
|
4234
4252
|
is_in_touch_scroll = true;
|
|
4235
4253
|
if (e.touches.length === 1) {
|
|
@@ -4252,16 +4270,7 @@ function $4a2667e8d77eb55a$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4252
4270
|
removeEventListener("touchstart", touchstart_handler);
|
|
4253
4271
|
removeEventListener("touchend", touchend_handler);
|
|
4254
4272
|
});
|
|
4255
|
-
|
|
4256
|
-
"resize",
|
|
4257
|
-
"orientationchange",
|
|
4258
|
-
"scroll"
|
|
4259
|
-
]){
|
|
4260
|
-
addEventListener(event, handle_scrollpos_change, {
|
|
4261
|
-
passive: true
|
|
4262
|
-
});
|
|
4263
|
-
(0, $g9l4l$onCleanup)(()=>removeEventListener(event, handle_scrollpos_change));
|
|
4264
|
-
}
|
|
4273
|
+
(0, $171b6a474d2e9601$export$205efb947c7ffd78)(handle_scrollpos_change);
|
|
4265
4274
|
(0, $g9l4l$onCleanup)(resolve_cleanup_promise);
|
|
4266
4275
|
(0, $g9l4l$createComputed)(()=>{
|
|
4267
4276
|
clearTimeout(timeout);
|
|
@@ -6160,6 +6169,7 @@ function $aee0c68312d971f4$var$make_state_saved_rows([get_showing_recommendation
|
|
|
6160
6169
|
|
|
6161
6170
|
|
|
6162
6171
|
|
|
6172
|
+
|
|
6163
6173
|
function $079defea521d5e2a$export$b3ad617e9036868(modal_body_style, input_field, width_transformer, includeScroll, one_axies_only) {
|
|
6164
6174
|
let aligned_this_microtask = false;
|
|
6165
6175
|
const align_position = ()=>{
|
|
@@ -6192,8 +6202,7 @@ function $079defea521d5e2a$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6192
6202
|
}));
|
|
6193
6203
|
ro.observe(input_field);
|
|
6194
6204
|
}
|
|
6195
|
-
|
|
6196
|
-
window.addEventListener("orientationchange", align_position);
|
|
6205
|
+
(0, $171b6a474d2e9601$export$205efb947c7ffd78)(align_position);
|
|
6197
6206
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
6198
6207
|
// this works
|
|
6199
6208
|
// keeping resize just in case
|
|
@@ -6203,8 +6212,6 @@ function $079defea521d5e2a$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6203
6212
|
(0, $g9l4l$onCleanup)((0, $g9l4l$catchify)(()=>{
|
|
6204
6213
|
ro?.disconnect();
|
|
6205
6214
|
resize_resize_observer.disconnect();
|
|
6206
|
-
window.removeEventListener("resize", align_position);
|
|
6207
|
-
window.removeEventListener("orientationchange", align_position);
|
|
6208
6215
|
}));
|
|
6209
6216
|
return align_position;
|
|
6210
6217
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
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": [
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"ts-jest": "^29.0.3"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@depict-ai/plp-styling": "^1.0.
|
|
96
|
-
"@depict-ai/types": "^1.0.
|
|
97
|
-
"@depict-ai/utilishared": "^1.0.
|
|
95
|
+
"@depict-ai/plp-styling": "^1.0.5",
|
|
96
|
+
"@depict-ai/types": "^1.0.4",
|
|
97
|
+
"@depict-ai/utilishared": "^1.0.4",
|
|
98
98
|
"solid-js": "^1.7.3"
|
|
99
99
|
},
|
|
100
100
|
"types": "dist/index.d.ts"
|