@depict-ai/react-ui 0.0.61 → 0.0.62
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 -3
- package/dist/main.js +73 -74
- package/dist/module.js +76 -77
- package/dist-server/index.d.ts +5 -4
- package/dist-server/main.js +2 -2
- package/dist-server/module.js +2 -2
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -394,11 +394,14 @@ export function useDepictSearchModal(params: UseSearchModalParams): UseSearchMod
|
|
|
394
394
|
interface SearchFieldProps {
|
|
395
395
|
alignerRef?: React.RefObject<HTMLElement>;
|
|
396
396
|
}
|
|
397
|
-
interface
|
|
397
|
+
interface UseDepictSearchFieldReturn {
|
|
398
398
|
DepictSearchField: React.FC;
|
|
399
399
|
}
|
|
400
|
-
|
|
401
|
-
|
|
400
|
+
interface SearchFieldProps {
|
|
401
|
+
alignerRef?: React.RefObject<HTMLElement>;
|
|
402
|
+
}
|
|
403
|
+
export const useDepictSearchField: (props: SearchFieldProps) => UseDepictSearchFieldReturn;
|
|
404
|
+
export const version = "0.0.62";
|
|
402
405
|
/**
|
|
403
406
|
* Helper function to navigate to a new page depending on the navigation library used.
|
|
404
407
|
*/
|
package/dist/main.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var $4GYXz$depictaiutilishared = require("@depict-ai/utilishared");
|
|
2
2
|
var $4GYXz$depictaiui = require("@depict-ai/ui");
|
|
3
3
|
var $4GYXz$solidjs = require("solid-js");
|
|
4
|
-
var $4GYXz$solidjsweb = require("solid-js/web");
|
|
5
4
|
var $4GYXz$react = require("react");
|
|
5
|
+
var $4GYXz$depictaiuilocales = require("@depict-ai/ui/locales");
|
|
6
|
+
var $4GYXz$solidjsweb = require("solid-js/web");
|
|
6
7
|
var $4GYXz$reactjsxruntime = require("react/jsx-runtime");
|
|
7
8
|
var $4GYXz$reactdom = require("react-dom");
|
|
8
|
-
var $4GYXz$depictaiuilocales = require("@depict-ai/ui/locales");
|
|
9
9
|
|
|
10
10
|
function $parcel$export(e, n, v, s) {
|
|
11
11
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -20,7 +20,7 @@ $parcel$export(module.exports, "DepictSearchPage", () => $7ad7a3d0011b7b1b$expor
|
|
|
20
20
|
$parcel$export(module.exports, "ImagePlaceholder", () => $df522c8a81ed5a01$export$3f37af283f8fb843);
|
|
21
21
|
$parcel$export(module.exports, "TextPlaceholder", () => $7c8b440edc188ad5$export$89c6019e4baa40b1);
|
|
22
22
|
$parcel$export(module.exports, "useDepictSearchModal", () => $3647cad61d03b89c$export$cc1e9aaf280afdcb);
|
|
23
|
-
$parcel$export(module.exports, "useDepictSearchField", () => $
|
|
23
|
+
$parcel$export(module.exports, "useDepictSearchField", () => $ca5840628781f899$export$45080d603eda647c);
|
|
24
24
|
$parcel$export(module.exports, "CategoryTitle", () => $b03e4eee8610ebbe$re_export$CategoryTitle);
|
|
25
25
|
$parcel$export(module.exports, "EmbeddedNumProducts", () => $b03e4eee8610ebbe$re_export$EmbeddedNumProducts);
|
|
26
26
|
$parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
|
|
@@ -30,6 +30,60 @@ $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a6
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
let $6319748b4f0426f0$var$set = false;
|
|
37
|
+
let $6319748b4f0426f0$var$padding_animation;
|
|
38
|
+
function $6319748b4f0426f0$export$6453cbc34515a94d(is_search_page) {
|
|
39
|
+
if ($6319748b4f0426f0$var$set) return; // Just being safe
|
|
40
|
+
$6319748b4f0426f0$var$set = true;
|
|
41
|
+
let should_use_old_scroll = false;
|
|
42
|
+
const old_scrollTo = window.scrollTo;
|
|
43
|
+
window.scrollTo = (...args)=>{
|
|
44
|
+
if (should_use_old_scroll || process.env.__NEXT_SCROLL_RESTORATION || !is_search_page(location)) return Reflect.apply(old_scrollTo, window, args);
|
|
45
|
+
else should_use_old_scroll = true;
|
|
46
|
+
};
|
|
47
|
+
addEventListener("popstate", (0, $4GYXz$depictaiutilishared.catchify)(()=>{
|
|
48
|
+
if (!is_search_page(location)) {
|
|
49
|
+
$6319748b4f0426f0$var$removeLotsOfPadding(); // Just making sure
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
should_use_old_scroll = false;
|
|
53
|
+
$6319748b4f0426f0$var$addLotsOfPadding();
|
|
54
|
+
(0, $4GYXz$depictaiutilishared.observer).wait_for_element(".depict.plp .listing-page").then(()=>{
|
|
55
|
+
$6319748b4f0426f0$var$removeLotsOfPadding();
|
|
56
|
+
});
|
|
57
|
+
}));
|
|
58
|
+
(0, $4GYXz$depictaiutilishared.history_replacer)(()=>{
|
|
59
|
+
(0, $4GYXz$depictaiutilishared.queueMacroTask)(()=>{
|
|
60
|
+
$6319748b4f0426f0$var$removeLotsOfPadding();
|
|
61
|
+
});
|
|
62
|
+
}, false);
|
|
63
|
+
window?.next?.router?.events?.on("routeChangeStart", ()=>{
|
|
64
|
+
$6319748b4f0426f0$var$addLotsOfPadding();
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/*
|
|
68
|
+
Here we want to be able to add padding that *definitely* gets applied and then be able to revert precisely to what was before.
|
|
69
|
+
The best way to achieve this is using an animation that with the fill set to none. This is because animations have the absolute highest precedence in CSS, even higher than !important. Then, to revert to the old padding, we just play the animation which is 1ms long so, it immediately finishes and whatever was defined before takes precedence again.
|
|
70
|
+
*/ function $6319748b4f0426f0$var$addLotsOfPadding() {
|
|
71
|
+
if ($6319748b4f0426f0$var$padding_animation) return; // We're already showing a bunch of padding
|
|
72
|
+
$6319748b4f0426f0$var$padding_animation = document.body.animate({
|
|
73
|
+
paddingBottom: (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px",
|
|
74
|
+
offset: 0
|
|
75
|
+
}, 1);
|
|
76
|
+
$6319748b4f0426f0$var$padding_animation.pause();
|
|
77
|
+
}
|
|
78
|
+
function $6319748b4f0426f0$var$removeLotsOfPadding() {
|
|
79
|
+
if ($6319748b4f0426f0$var$padding_animation) {
|
|
80
|
+
$6319748b4f0426f0$var$padding_animation.play();
|
|
81
|
+
$6319748b4f0426f0$var$padding_animation = undefined;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
33
87
|
const $0b7cd4fb39fc3502$export$8e769ad4338a911e = {
|
|
34
88
|
search: null,
|
|
35
89
|
category: null,
|
|
@@ -117,74 +171,6 @@ async function $b4d0d98857ed9934$export$79c79419c1ef0081({ display: display , in
|
|
|
117
171
|
}
|
|
118
172
|
|
|
119
173
|
|
|
120
|
-
const $03c714523ff406fc$export$bde46b5bb6287cea = (props)=>{
|
|
121
|
-
const ReactSearchField = ()=>{
|
|
122
|
-
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(()=>(0, $4GYXz$depictaiui.SearchField)({
|
|
123
|
-
depict_search: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search,
|
|
124
|
-
aligner_ref: props?.alignerRef?.current
|
|
125
|
-
})), {});
|
|
126
|
-
};
|
|
127
|
-
return ReactSearchField;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
let $6319748b4f0426f0$var$set = false;
|
|
137
|
-
let $6319748b4f0426f0$var$padding_animation;
|
|
138
|
-
function $6319748b4f0426f0$export$6453cbc34515a94d(is_search_page) {
|
|
139
|
-
if ($6319748b4f0426f0$var$set) return; // Just being safe
|
|
140
|
-
$6319748b4f0426f0$var$set = true;
|
|
141
|
-
let should_use_old_scroll = false;
|
|
142
|
-
const old_scrollTo = window.scrollTo;
|
|
143
|
-
window.scrollTo = (...args)=>{
|
|
144
|
-
if (should_use_old_scroll || process.env.__NEXT_SCROLL_RESTORATION || !is_search_page(location)) return Reflect.apply(old_scrollTo, window, args);
|
|
145
|
-
else should_use_old_scroll = true;
|
|
146
|
-
};
|
|
147
|
-
addEventListener("popstate", (0, $4GYXz$depictaiutilishared.catchify)(()=>{
|
|
148
|
-
if (!is_search_page(location)) {
|
|
149
|
-
$6319748b4f0426f0$var$removeLotsOfPadding(); // Just making sure
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
should_use_old_scroll = false;
|
|
153
|
-
$6319748b4f0426f0$var$addLotsOfPadding();
|
|
154
|
-
(0, $4GYXz$depictaiutilishared.observer).wait_for_element(".depict.plp .listing-page").then(()=>{
|
|
155
|
-
$6319748b4f0426f0$var$removeLotsOfPadding();
|
|
156
|
-
});
|
|
157
|
-
}));
|
|
158
|
-
(0, $4GYXz$depictaiutilishared.history_replacer)(()=>{
|
|
159
|
-
(0, $4GYXz$depictaiutilishared.queueMacroTask)(()=>{
|
|
160
|
-
$6319748b4f0426f0$var$removeLotsOfPadding();
|
|
161
|
-
});
|
|
162
|
-
}, false);
|
|
163
|
-
window?.next?.router?.events?.on("routeChangeStart", ()=>{
|
|
164
|
-
$6319748b4f0426f0$var$addLotsOfPadding();
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
/*
|
|
168
|
-
Here we want to be able to add padding that *definitely* gets applied and then be able to revert precisely to what was before.
|
|
169
|
-
The best way to achieve this is using an animation that with the fill set to none. This is because animations have the absolute highest precedence in CSS, even higher than !important. Then, to revert to the old padding, we just play the animation which is 1ms long so, it immediately finishes and whatever was defined before takes precedence again.
|
|
170
|
-
*/ function $6319748b4f0426f0$var$addLotsOfPadding() {
|
|
171
|
-
if ($6319748b4f0426f0$var$padding_animation) return; // We're already showing a bunch of padding
|
|
172
|
-
$6319748b4f0426f0$var$padding_animation = document.body.animate({
|
|
173
|
-
paddingBottom: (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px",
|
|
174
|
-
offset: 0
|
|
175
|
-
}, 1);
|
|
176
|
-
$6319748b4f0426f0$var$padding_animation.pause();
|
|
177
|
-
}
|
|
178
|
-
function $6319748b4f0426f0$var$removeLotsOfPadding() {
|
|
179
|
-
if ($6319748b4f0426f0$var$padding_animation) {
|
|
180
|
-
$6319748b4f0426f0$var$padding_animation.play();
|
|
181
|
-
$6319748b4f0426f0$var$padding_animation = undefined;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
174
|
const $bc389476eeb2b615$export$599d4515591ef232 = (href)=>{
|
|
189
175
|
const shallow = (0, $b4d0d98857ed9934$export$92a8f8b3c630fa0d)(location);
|
|
190
176
|
window.next.router.push(href, undefined, {
|
|
@@ -485,8 +471,21 @@ function $3647cad61d03b89c$export$cc1e9aaf280afdcb(params) {
|
|
|
485
471
|
|
|
486
472
|
|
|
487
473
|
|
|
488
|
-
|
|
489
|
-
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
const $5e06ce09dcfaf030$export$bde46b5bb6287cea = (props)=>{
|
|
477
|
+
const ReactSearchField = ()=>{
|
|
478
|
+
return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(()=>(0, $4GYXz$depictaiui.SearchField)({
|
|
479
|
+
depict_search: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search,
|
|
480
|
+
aligner_ref: props?.alignerRef?.current
|
|
481
|
+
})), {});
|
|
482
|
+
};
|
|
483
|
+
return ReactSearchField;
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
const $ca5840628781f899$export$45080d603eda647c = (props)=>{
|
|
488
|
+
const SearchField = (0, $5e06ce09dcfaf030$export$bde46b5bb6287cea)({
|
|
490
489
|
alignerRef: props.alignerRef
|
|
491
490
|
});
|
|
492
491
|
return {
|
|
@@ -498,7 +497,7 @@ const $913da7f4d0bc77f2$export$45080d603eda647c = (props)=>{
|
|
|
498
497
|
|
|
499
498
|
|
|
500
499
|
|
|
501
|
-
const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.
|
|
500
|
+
const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.62";
|
|
502
501
|
|
|
503
502
|
|
|
504
503
|
|
package/dist/module.js
CHANGED
|
@@ -1,17 +1,71 @@
|
|
|
1
|
-
import {dlog as $TZSbU$dlog,
|
|
2
|
-
import {add_to_version_info as $TZSbU$add_to_version_info, CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts,
|
|
3
|
-
import {
|
|
1
|
+
import {dlog as $TZSbU$dlog, catchify as $TZSbU$catchify, observer as $TZSbU$observer, history_replacer as $TZSbU$history_replacer, queueMacroTask as $TZSbU$queueMacroTask, href_change_ipns as $TZSbU$href_change_ipns, ContainedPlaceholderImage as $TZSbU$ContainedPlaceholderImage, Placeholder as $TZSbU$Placeholder} from "@depict-ai/utilishared";
|
|
2
|
+
import {add_to_version_info as $TZSbU$add_to_version_info, CategoryTitle as $43099132aad1ceb6$re_export$CategoryTitle, embedded_num_products as $43099132aad1ceb6$re_export$EmbeddedNumProducts, DepictSearch as $TZSbU$DepictSearch, DepictCategory as $TZSbU$DepictCategory, get_search_query_updating_blocked_signal as $TZSbU$get_search_query_updating_blocked_signal, SearchPage as $TZSbU$SearchPage, CategoryPage as $TZSbU$CategoryPage, BreadCrumbs as $TZSbU$BreadCrumbs, QuickLinks as $TZSbU$QuickLinks, styles_to_valid_css_string as $TZSbU$styles_to_valid_css_string, align_field as $TZSbU$align_field, SearchField as $TZSbU$SearchField} from "@depict-ai/ui";
|
|
3
|
+
import {createRoot as $TZSbU$createRoot, untrack as $TZSbU$untrack, createSignal as $TZSbU$createSignal, createComponent as $TZSbU$createComponent, Show as $TZSbU$Show, onCleanup as $TZSbU$onCleanup, createComputed as $TZSbU$createComputed} from "solid-js";
|
|
4
|
+
import {createElement as $TZSbU$createElement, Fragment as $TZSbU$Fragment, useState as $TZSbU$useState, useRef as $TZSbU$useRef, useEffect as $TZSbU$useEffect, forwardRef as $TZSbU$forwardRef} from "react";
|
|
5
|
+
import {en as $TZSbU$en} from "@depict-ai/ui/locales";
|
|
4
6
|
import {render as $TZSbU$render} from "solid-js/web";
|
|
5
|
-
import {useState as $TZSbU$useState, useRef as $TZSbU$useRef, useEffect as $TZSbU$useEffect, createElement as $TZSbU$createElement, Fragment as $TZSbU$Fragment, forwardRef as $TZSbU$forwardRef} from "react";
|
|
6
7
|
import {jsx as $TZSbU$jsx} from "react/jsx-runtime";
|
|
7
8
|
import {createPortal as $TZSbU$createPortal} from "react-dom";
|
|
8
|
-
import {en as $TZSbU$en} from "@depict-ai/ui/locales";
|
|
9
9
|
|
|
10
10
|
/*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
|
|
11
11
|
// Note, if you add an export here, also add one in src-server/main.ts
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
let $8071251ee4e9ffa1$var$set = false;
|
|
19
|
+
let $8071251ee4e9ffa1$var$padding_animation;
|
|
20
|
+
function $8071251ee4e9ffa1$export$6453cbc34515a94d(is_search_page) {
|
|
21
|
+
if ($8071251ee4e9ffa1$var$set) return; // Just being safe
|
|
22
|
+
$8071251ee4e9ffa1$var$set = true;
|
|
23
|
+
let should_use_old_scroll = false;
|
|
24
|
+
const old_scrollTo = window.scrollTo;
|
|
25
|
+
window.scrollTo = (...args)=>{
|
|
26
|
+
if (should_use_old_scroll || process.env.__NEXT_SCROLL_RESTORATION || !is_search_page(location)) return Reflect.apply(old_scrollTo, window, args);
|
|
27
|
+
else should_use_old_scroll = true;
|
|
28
|
+
};
|
|
29
|
+
addEventListener("popstate", (0, $TZSbU$catchify)(()=>{
|
|
30
|
+
if (!is_search_page(location)) {
|
|
31
|
+
$8071251ee4e9ffa1$var$removeLotsOfPadding(); // Just making sure
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
should_use_old_scroll = false;
|
|
35
|
+
$8071251ee4e9ffa1$var$addLotsOfPadding();
|
|
36
|
+
(0, $TZSbU$observer).wait_for_element(".depict.plp .listing-page").then(()=>{
|
|
37
|
+
$8071251ee4e9ffa1$var$removeLotsOfPadding();
|
|
38
|
+
});
|
|
39
|
+
}));
|
|
40
|
+
(0, $TZSbU$history_replacer)(()=>{
|
|
41
|
+
(0, $TZSbU$queueMacroTask)(()=>{
|
|
42
|
+
$8071251ee4e9ffa1$var$removeLotsOfPadding();
|
|
43
|
+
});
|
|
44
|
+
}, false);
|
|
45
|
+
window?.next?.router?.events?.on("routeChangeStart", ()=>{
|
|
46
|
+
$8071251ee4e9ffa1$var$addLotsOfPadding();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/*
|
|
50
|
+
Here we want to be able to add padding that *definitely* gets applied and then be able to revert precisely to what was before.
|
|
51
|
+
The best way to achieve this is using an animation that with the fill set to none. This is because animations have the absolute highest precedence in CSS, even higher than !important. Then, to revert to the old padding, we just play the animation which is 1ms long so, it immediately finishes and whatever was defined before takes precedence again.
|
|
52
|
+
*/ function $8071251ee4e9ffa1$var$addLotsOfPadding() {
|
|
53
|
+
if ($8071251ee4e9ffa1$var$padding_animation) return; // We're already showing a bunch of padding
|
|
54
|
+
$8071251ee4e9ffa1$var$padding_animation = document.body.animate({
|
|
55
|
+
paddingBottom: (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px",
|
|
56
|
+
offset: 0
|
|
57
|
+
}, 1);
|
|
58
|
+
$8071251ee4e9ffa1$var$padding_animation.pause();
|
|
59
|
+
}
|
|
60
|
+
function $8071251ee4e9ffa1$var$removeLotsOfPadding() {
|
|
61
|
+
if ($8071251ee4e9ffa1$var$padding_animation) {
|
|
62
|
+
$8071251ee4e9ffa1$var$padding_animation.play();
|
|
63
|
+
$8071251ee4e9ffa1$var$padding_animation = undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
15
69
|
const $42858f023ef23dab$export$8e769ad4338a911e = {
|
|
16
70
|
search: null,
|
|
17
71
|
category: null,
|
|
@@ -99,74 +153,6 @@ async function $c83ba9ab79386687$export$79c79419c1ef0081({ display: display , in
|
|
|
99
153
|
}
|
|
100
154
|
|
|
101
155
|
|
|
102
|
-
const $02e2452814b6e7d6$export$bde46b5bb6287cea = (props)=>{
|
|
103
|
-
const ReactSearchField = ()=>{
|
|
104
|
-
return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)(()=>(0, $TZSbU$SearchField)({
|
|
105
|
-
depict_search: (0, $42858f023ef23dab$export$8e769ad4338a911e).search,
|
|
106
|
-
aligner_ref: props?.alignerRef?.current
|
|
107
|
-
})), {});
|
|
108
|
-
};
|
|
109
|
-
return ReactSearchField;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
let $8071251ee4e9ffa1$var$set = false;
|
|
119
|
-
let $8071251ee4e9ffa1$var$padding_animation;
|
|
120
|
-
function $8071251ee4e9ffa1$export$6453cbc34515a94d(is_search_page) {
|
|
121
|
-
if ($8071251ee4e9ffa1$var$set) return; // Just being safe
|
|
122
|
-
$8071251ee4e9ffa1$var$set = true;
|
|
123
|
-
let should_use_old_scroll = false;
|
|
124
|
-
const old_scrollTo = window.scrollTo;
|
|
125
|
-
window.scrollTo = (...args)=>{
|
|
126
|
-
if (should_use_old_scroll || process.env.__NEXT_SCROLL_RESTORATION || !is_search_page(location)) return Reflect.apply(old_scrollTo, window, args);
|
|
127
|
-
else should_use_old_scroll = true;
|
|
128
|
-
};
|
|
129
|
-
addEventListener("popstate", (0, $TZSbU$catchify)(()=>{
|
|
130
|
-
if (!is_search_page(location)) {
|
|
131
|
-
$8071251ee4e9ffa1$var$removeLotsOfPadding(); // Just making sure
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
should_use_old_scroll = false;
|
|
135
|
-
$8071251ee4e9ffa1$var$addLotsOfPadding();
|
|
136
|
-
(0, $TZSbU$observer).wait_for_element(".depict.plp .listing-page").then(()=>{
|
|
137
|
-
$8071251ee4e9ffa1$var$removeLotsOfPadding();
|
|
138
|
-
});
|
|
139
|
-
}));
|
|
140
|
-
(0, $TZSbU$history_replacer)(()=>{
|
|
141
|
-
(0, $TZSbU$queueMacroTask)(()=>{
|
|
142
|
-
$8071251ee4e9ffa1$var$removeLotsOfPadding();
|
|
143
|
-
});
|
|
144
|
-
}, false);
|
|
145
|
-
window?.next?.router?.events?.on("routeChangeStart", ()=>{
|
|
146
|
-
$8071251ee4e9ffa1$var$addLotsOfPadding();
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
/*
|
|
150
|
-
Here we want to be able to add padding that *definitely* gets applied and then be able to revert precisely to what was before.
|
|
151
|
-
The best way to achieve this is using an animation that with the fill set to none. This is because animations have the absolute highest precedence in CSS, even higher than !important. Then, to revert to the old padding, we just play the animation which is 1ms long so, it immediately finishes and whatever was defined before takes precedence again.
|
|
152
|
-
*/ function $8071251ee4e9ffa1$var$addLotsOfPadding() {
|
|
153
|
-
if ($8071251ee4e9ffa1$var$padding_animation) return; // We're already showing a bunch of padding
|
|
154
|
-
$8071251ee4e9ffa1$var$padding_animation = document.body.animate({
|
|
155
|
-
paddingBottom: (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px",
|
|
156
|
-
offset: 0
|
|
157
|
-
}, 1);
|
|
158
|
-
$8071251ee4e9ffa1$var$padding_animation.pause();
|
|
159
|
-
}
|
|
160
|
-
function $8071251ee4e9ffa1$var$removeLotsOfPadding() {
|
|
161
|
-
if ($8071251ee4e9ffa1$var$padding_animation) {
|
|
162
|
-
$8071251ee4e9ffa1$var$padding_animation.play();
|
|
163
|
-
$8071251ee4e9ffa1$var$padding_animation = undefined;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
156
|
const $7216ca4c8308a0f9$export$599d4515591ef232 = (href)=>{
|
|
171
157
|
const shallow = (0, $c83ba9ab79386687$export$92a8f8b3c630fa0d)(location);
|
|
172
158
|
window.next.router.push(href, undefined, {
|
|
@@ -467,8 +453,21 @@ function $cfa72c75e6cf6901$export$cc1e9aaf280afdcb(params) {
|
|
|
467
453
|
|
|
468
454
|
|
|
469
455
|
|
|
470
|
-
|
|
471
|
-
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
const $a732d80ca44c466d$export$bde46b5bb6287cea = (props)=>{
|
|
459
|
+
const ReactSearchField = ()=>{
|
|
460
|
+
return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)(()=>(0, $TZSbU$SearchField)({
|
|
461
|
+
depict_search: (0, $42858f023ef23dab$export$8e769ad4338a911e).search,
|
|
462
|
+
aligner_ref: props?.alignerRef?.current
|
|
463
|
+
})), {});
|
|
464
|
+
};
|
|
465
|
+
return ReactSearchField;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
const $e3ccaca62718bae4$export$45080d603eda647c = (props)=>{
|
|
470
|
+
const SearchField = (0, $a732d80ca44c466d$export$bde46b5bb6287cea)({
|
|
472
471
|
alignerRef: props.alignerRef
|
|
473
472
|
});
|
|
474
473
|
return {
|
|
@@ -480,7 +479,7 @@ const $2b886cf548a4775c$export$45080d603eda647c = (props)=>{
|
|
|
480
479
|
|
|
481
480
|
|
|
482
481
|
|
|
483
|
-
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.
|
|
482
|
+
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.62";
|
|
484
483
|
|
|
485
484
|
|
|
486
485
|
|
|
@@ -522,4 +521,4 @@ const $43099132aad1ceb6$var$package_name = "@depict-ai/react-ui";
|
|
|
522
521
|
});
|
|
523
522
|
|
|
524
523
|
|
|
525
|
-
export {$b68a14248b7ef667$export$466cdc317043f6cb as QuickLinks, $f866f7ed9f751af4$export$5646050d516e06bc as BreadCrumbs, $4db0e2f013fc5124$export$3f4580d6398c5027 as DepictAligner, $5376eb2a386cd90d$export$9fac37a9c21c2f3b as DepictProvider, $48d7f568740a317d$export$d87c61cecb2edf0d as DepictCategoryPage, $4a678f0c87b12e78$export$210723f5a54a7028 as DepictSearchPage, $f446a84f85ba06f6$export$3f37af283f8fb843 as ImagePlaceholder, $cbd250061abf11cb$export$89c6019e4baa40b1 as TextPlaceholder, $cfa72c75e6cf6901$export$cc1e9aaf280afdcb as useDepictSearchModal, $
|
|
524
|
+
export {$b68a14248b7ef667$export$466cdc317043f6cb as QuickLinks, $f866f7ed9f751af4$export$5646050d516e06bc as BreadCrumbs, $4db0e2f013fc5124$export$3f4580d6398c5027 as DepictAligner, $5376eb2a386cd90d$export$9fac37a9c21c2f3b as DepictProvider, $48d7f568740a317d$export$d87c61cecb2edf0d as DepictCategoryPage, $4a678f0c87b12e78$export$210723f5a54a7028 as DepictSearchPage, $f446a84f85ba06f6$export$3f37af283f8fb843 as ImagePlaceholder, $cbd250061abf11cb$export$89c6019e4baa40b1 as TextPlaceholder, $cfa72c75e6cf6901$export$cc1e9aaf280afdcb as useDepictSearchModal, $e3ccaca62718bae4$export$45080d603eda647c as useDepictSearchField, $43099132aad1ceb6$re_export$CategoryTitle as CategoryTitle, $43099132aad1ceb6$re_export$EmbeddedNumProducts as EmbeddedNumProducts, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version, $97603d19204ec48d$export$b8a61e5c71402559 as Navigation};
|
package/dist-server/index.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ type OpenModal = () => void;
|
|
|
2
2
|
interface UseSearchModalReturn {
|
|
3
3
|
open: OpenModal;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
interface UseDepictSearchFieldReturn {
|
|
6
|
+
DepictSearchField: React.FC;
|
|
7
|
+
}
|
|
8
|
+
export const version = "0.0.62";
|
|
6
9
|
export function DepictProvider(props: any): any;
|
|
7
10
|
export function DepictSearchPage(): any;
|
|
8
11
|
export function DepictCategoryPage(): any;
|
|
@@ -16,8 +19,6 @@ export function DepictAligner(): import("react").DetailedReactHTMLElement<{
|
|
|
16
19
|
}, HTMLElement>;
|
|
17
20
|
export function ImagePlaceHolder(): any;
|
|
18
21
|
export function TextPlaceholder(): any;
|
|
19
|
-
export function useDepictSearchField():
|
|
20
|
-
SearchField: any;
|
|
21
|
-
};
|
|
22
|
+
export function useDepictSearchField(): UseDepictSearchFieldReturn;
|
|
22
23
|
export function openModal(): void;
|
|
23
24
|
export function useDepictSearchModal(): UseSearchModalReturn;
|
package/dist-server/main.js
CHANGED
|
@@ -19,7 +19,7 @@ $parcel$export(module.exports, "useDepictSearchModal", () => $41e7e5d85b5e0d49$e
|
|
|
19
19
|
$parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.
|
|
22
|
+
const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.62";
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
|
|
@@ -65,7 +65,7 @@ function $41e7e5d85b5e0d49$export$89c6019e4baa40b1() {
|
|
|
65
65
|
}
|
|
66
66
|
function $41e7e5d85b5e0d49$export$45080d603eda647c() {
|
|
67
67
|
return {
|
|
68
|
-
|
|
68
|
+
DepictSearchField: (0, $5efvh$reactjsxruntime.jsx)("div", {
|
|
69
69
|
children: []
|
|
70
70
|
})
|
|
71
71
|
};
|
package/dist-server/module.js
CHANGED
|
@@ -3,7 +3,7 @@ import {jsx as $1RlIW$jsx} from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.
|
|
6
|
+
const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.62";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
|
|
@@ -49,7 +49,7 @@ function $2b1fdeb83610500f$export$89c6019e4baa40b1() {
|
|
|
49
49
|
}
|
|
50
50
|
function $2b1fdeb83610500f$export$45080d603eda647c() {
|
|
51
51
|
return {
|
|
52
|
-
|
|
52
|
+
DepictSearchField: (0, $1RlIW$jsx)("div", {
|
|
53
53
|
children: []
|
|
54
54
|
})
|
|
55
55
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/react-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.62",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"/locales"
|
|
91
91
|
],
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@depict-ai/ui": "^0.0.
|
|
94
|
-
"@depict-ai/utilishared": "^0.0.
|
|
93
|
+
"@depict-ai/ui": "^0.0.39",
|
|
94
|
+
"@depict-ai/utilishared": "^0.0.37",
|
|
95
95
|
"solid-js": "^1.6.2"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|