@depict-ai/react-ui 4.0.23 → 4.1.1
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 +205 -92
- package/ES10/index.d.ts +11 -2
- package/ES10/index.js +204 -92
- package/latest/index.cjs +190 -87
- package/latest/index.d.ts +11 -2
- package/latest/index.js +189 -87
- package/package.json +2 -2
- package/server/ES10/index.cjs +10 -1
- package/server/ES10/index.d.ts +11 -2
- package/server/ES10/index.js +10 -2
- package/server/latest/index.cjs +10 -1
- package/server/latest/index.d.ts +11 -2
- package/server/latest/index.js +10 -2
package/ES10/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { add_to_version_info as $jb2Oo$add_to_version_info, catchify as $jb2Oo$catchify, queueMacroTask as $jb2Oo$queueMacroTask, instant_exec_on_suspect_history_change as $jb2Oo$instant_exec_on_suspect_history_change, derror as $jb2Oo$derror, dwarn as $jb2Oo$dwarn } from "@depict-ai/utilishared/ES10";
|
|
3
3
|
import { CategoryTitle as $383b6fd56bf151bd$re_export$CategoryTitle, embedded_num_products as $383b6fd56bf151bd$re_export$EmbeddedNumProducts, SearchModalV2 as $383b6fd56bf151bd$re_export$SearchModalV2, ClassicSearchModal as $383b6fd56bf151bd$re_export$ClassicSearchModal, DepictAPI as $jb2Oo$DepictAPI, DepictSearch as $jb2Oo$DepictSearch, DepictCategory as $jb2Oo$DepictCategory, get_search_query_updating_blocked_signal as $jb2Oo$get_search_query_updating_blocked_signal, SearchPage as $jb2Oo$SearchPage, defaultColsAtSize as $jb2Oo$defaultColsAtSize, defaultGridSpacing as $jb2Oo$defaultGridSpacing, ProductCardError as $jb2Oo$ProductCardError, CategoryPage as $jb2Oo$CategoryPage, defaultCategoryTitlePlugin as $jb2Oo$defaultCategoryTitlePlugin, BreadCrumbs as $jb2Oo$BreadCrumbs, QuickLinks as $jb2Oo$QuickLinks, ImagePlaceholder as $jb2Oo$ImagePlaceholder, TextPlaceholder as $jb2Oo$TextPlaceholder, RecommendationSlider as $jb2Oo$RecommendationSlider, RecommendationGrid as $jb2Oo$RecommendationGrid, modalVersionSymbol as $jb2Oo$modalVersionSymbol, open_modal_with_alignment as $jb2Oo$open_modal_with_alignment, SearchField as $jb2Oo$SearchField, fetchDepictRecommendations as $jb2Oo$fetchDepictRecommendations } from "@depict-ai/ui/ES10";
|
|
4
|
-
import { untrack as $jb2Oo$untrack, createRoot as $jb2Oo$createRoot, createEffect as $jb2Oo$createEffect,
|
|
4
|
+
import { untrack as $jb2Oo$untrack, createRoot as $jb2Oo$createRoot, createEffect as $jb2Oo$createEffect, createSignal as $jb2Oo$createSignal, createComputed as $jb2Oo$createComputed, createMemo as $jb2Oo$createMemo, onCleanup as $jb2Oo$onCleanup, getOwner as $jb2Oo$getOwner, runWithOwner as $jb2Oo$runWithOwner, on as $jb2Oo$on, mapArray as $jb2Oo$mapArray, Show as $jb2Oo$Show, createRenderEffect as $jb2Oo$createRenderEffect } from "solid-js";
|
|
5
5
|
import { createElement as $jb2Oo$createElement, Fragment as $jb2Oo$Fragment, useEffect as $jb2Oo$useEffect, useState as $jb2Oo$useState, useRef as $jb2Oo$useRef, forwardRef as $jb2Oo$forwardRef, Component as $jb2Oo$Component, useCallback as $jb2Oo$useCallback } from "react";
|
|
6
6
|
import { defaultLocale as $jb2Oo$defaultLocale } from "@depict-ai/ui/locales/ES10";
|
|
7
|
-
import { render as $jb2Oo$render, hydrate as $jb2Oo$hydrate, isServer as $jb2Oo$isServer, ssr as $jb2Oo$ssr, ssrHydrationKey as $jb2Oo$ssrHydrationKey } from "solid-js/web";
|
|
7
|
+
import { render as $jb2Oo$render, createComponent as $jb2Oo$createComponent, hydrate as $jb2Oo$hydrate, isServer as $jb2Oo$isServer, ssr as $jb2Oo$ssr, ssrHydrationKey as $jb2Oo$ssrHydrationKey } from "solid-js/web";
|
|
8
8
|
import { createStore as $jb2Oo$createStore, reconcile as $jb2Oo$reconcile } from "solid-js/store";
|
|
9
9
|
import { DPC as $jb2Oo$DPC } from "@depict-ai/dpc/ES10";
|
|
10
10
|
import { jsx as $jb2Oo$jsx } from "react/jsx-runtime";
|
|
@@ -15,7 +15,7 @@ import { renderToString as $jb2Oo$renderToString } from "react-dom/server";
|
|
|
15
15
|
// Note, if you add an export here, also add one in src-server/main.ts
|
|
16
16
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
17
17
|
register_es_version("react-ui", "ES10");
|
|
18
|
-
const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "4.
|
|
18
|
+
const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "4.1.1";
|
|
19
19
|
const $8c691d7f86317052$export$8e769ad4338a911e = {
|
|
20
20
|
usedLocale: $jb2Oo$createSignal((0, $jb2Oo$defaultLocale)),
|
|
21
21
|
search_instances: new Map(),
|
|
@@ -33,27 +33,27 @@ const $8c691d7f86317052$export$8e769ad4338a911e = {
|
|
|
33
33
|
enable_content_search: $jb2Oo$createSignal(),
|
|
34
34
|
disable_override_listing_id: $jb2Oo$createSignal()
|
|
35
35
|
};
|
|
36
|
-
let $
|
|
37
|
-
let $
|
|
38
|
-
function $
|
|
39
|
-
$
|
|
36
|
+
let $ac53b4e3251b31d0$var$run_on_href_change;
|
|
37
|
+
let $ac53b4e3251b31d0$var$old_href = location.href;
|
|
38
|
+
function $ac53b4e3251b31d0$export$74f3924c5027fe1d(cb) {
|
|
39
|
+
$ac53b4e3251b31d0$var$run_on_href_change = cb;
|
|
40
40
|
}
|
|
41
41
|
(0, $jb2Oo$instant_exec_on_suspect_history_change).add($jb2Oo$catchify(() => {
|
|
42
42
|
const {
|
|
43
43
|
href: href
|
|
44
44
|
} = location;
|
|
45
|
-
if ($
|
|
46
|
-
$
|
|
45
|
+
if ($ac53b4e3251b31d0$var$run_on_href_change && $ac53b4e3251b31d0$var$old_href !== href) $ac53b4e3251b31d0$var$run_on_href_change(href);
|
|
46
|
+
$ac53b4e3251b31d0$var$old_href = href;
|
|
47
47
|
}));
|
|
48
|
-
const $
|
|
48
|
+
const $ac53b4e3251b31d0$export$775e6b3892b5ad52 = function () {
|
|
49
49
|
let url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location;
|
|
50
50
|
return url.pathname == $jb2Oo$untrack((0, $8c691d7f86317052$export$8e769ad4338a911e).search_page_path_[0]);
|
|
51
51
|
}; // might have changed therefore get it from globalState
|
|
52
|
-
const $
|
|
52
|
+
const $ac53b4e3251b31d0$export$30c8a12df09be0e4 = function () {
|
|
53
53
|
let url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location;
|
|
54
54
|
return (0, $8c691d7f86317052$export$8e769ad4338a911e).known_category_paths.has(url.pathname);
|
|
55
55
|
};
|
|
56
|
-
function $
|
|
56
|
+
function $ac53b4e3251b31d0$export$f6e64e17bd69eeef(_ref) {
|
|
57
57
|
let {
|
|
58
58
|
solid_component: solid_component,
|
|
59
59
|
props: props,
|
|
@@ -88,7 +88,7 @@ function $0dd9d9a9c7da4c1d$export$f6e64e17bd69eeef(_ref) {
|
|
|
88
88
|
const dispose = render_function(() => solid_component(store, set_portals), wrapper_element);
|
|
89
89
|
return dispose;
|
|
90
90
|
}, []);
|
|
91
|
-
return
|
|
91
|
+
return /*#__PURE__*/$jb2Oo$createElement((0, $jb2Oo$Fragment), null, /*#__PURE__*/$jb2Oo$createElement(wrapper_type, {
|
|
92
92
|
ref: wrapper_element_ref,
|
|
93
93
|
style: wrapper_style,
|
|
94
94
|
...(hydrate_function_when_ssr ? {
|
|
@@ -100,32 +100,6 @@ function $0dd9d9a9c7da4c1d$export$f6e64e17bd69eeef(_ref) {
|
|
|
100
100
|
} : {})
|
|
101
101
|
}), ...portals);
|
|
102
102
|
}
|
|
103
|
-
function $0dd9d9a9c7da4c1d$export$e5139bbbb9a05035(component, is_set) {
|
|
104
|
-
return function () {
|
|
105
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
106
|
-
const default_is_set = $jb2Oo$createMemo(() => {
|
|
107
|
-
var _globalState$usedLoca;
|
|
108
|
-
return !!((0, $8c691d7f86317052$export$8e769ad4338a911e).merchant[0]() && (0, $8c691d7f86317052$export$8e769ad4338a911e).market[0]() && (_globalState$usedLoca = (0, $8c691d7f86317052$export$8e769ad4338a911e).usedLocale[0]()) !== null && _globalState$usedLoca !== void 0 && _globalState$usedLoca.backend_locale_);
|
|
109
|
-
}); // Apparently Show re-renders kids otherwise even if the falsiness of the condition doesn't change
|
|
110
|
-
const should_show = $jb2Oo$createMemo(prev => {
|
|
111
|
-
if (!prev && (0, $8c691d7f86317052$export$8e769ad4338a911e).provider_is_updating[0]())
|
|
112
|
-
// Why `!prev`? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7854#note_1495776987
|
|
113
|
-
// If we weren't showing the component and the DepictProvider is currently updating, wait for it to have finished updating before showing the component
|
|
114
|
-
// Otherwise as soon as tenant and market is set we render the CategoryPage, but we might not have a DepictCategory yet, see https://depictaiworkspace.slack.com/archives/C04UZ2Z0RNE/p1690895918347289?thread_ts=1688391305.529449&cid=C04UZ2Z0RNE
|
|
115
|
-
return false;
|
|
116
|
-
return (is_set || default_is_set)();
|
|
117
|
-
});
|
|
118
|
-
// @ts-ignore
|
|
119
|
-
return $jb2Oo$createComponent((0, $jb2Oo$Show), {
|
|
120
|
-
get when() {
|
|
121
|
-
return should_show();
|
|
122
|
-
},
|
|
123
|
-
get children() {
|
|
124
|
-
return component(...args);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
103
|
let $64144f6d578fd8ac$var$set = false;
|
|
130
104
|
let $64144f6d578fd8ac$var$padding_animation;
|
|
131
105
|
function $64144f6d578fd8ac$export$6453cbc34515a94d() {
|
|
@@ -133,7 +107,7 @@ function $64144f6d578fd8ac$export$6453cbc34515a94d() {
|
|
|
133
107
|
/// WARNING WARNING WARNING
|
|
134
108
|
// If you are debugging scroll restoration, make sure you're not in strict mode!!!!! Scroll restoration in nextjs won't work in strict mode because react will nuke all our elements from the DOM and render them again during going back
|
|
135
109
|
// Next 13.x+ has strict mode by default, opt out by setting reactStrictMode: false in next.config.js
|
|
136
|
-
const are_on_search_or_category_page = () => $
|
|
110
|
+
const are_on_search_or_category_page = () => $ac53b4e3251b31d0$export$775e6b3892b5ad52() || $ac53b4e3251b31d0$export$30c8a12df09be0e4();
|
|
137
111
|
if ($64144f6d578fd8ac$var$set) return; // Just being safe
|
|
138
112
|
$64144f6d578fd8ac$var$set = true;
|
|
139
113
|
// We used to initialise this variable with false which in some cases (scroll to top button in FloatingButtons) would cause the scroll to be blocked when it shouldn't (see https://depictaiworkspace.slack.com/archives/C058KQ3MU8Z/p1686141321127089?thread_ts=1686134246.109689&cid=C058KQ3MU8Z)
|
|
@@ -159,8 +133,8 @@ function $64144f6d578fd8ac$export$6453cbc34515a94d() {
|
|
|
159
133
|
const [get_category_page_in_dom] = (0, $8c691d7f86317052$export$8e769ad4338a911e).category_page_in_dom;
|
|
160
134
|
const search_page_in_dom = $jb2Oo$untrack(get_search_page_in_dom);
|
|
161
135
|
const category_page_in_dom = $jb2Oo$untrack(get_category_page_in_dom);
|
|
162
|
-
const new_is_search = $
|
|
163
|
-
const new_is_category = $
|
|
136
|
+
const new_is_search = $ac53b4e3251b31d0$export$775e6b3892b5ad52();
|
|
137
|
+
const new_is_category = $ac53b4e3251b31d0$export$30c8a12df09be0e4();
|
|
164
138
|
let accessor_to_wait_for;
|
|
165
139
|
if (search_page_in_dom && new_is_search || category_page_in_dom && new_is_category) {
|
|
166
140
|
// Already on the page we're going to
|
|
@@ -226,9 +200,9 @@ const $7abe9e29758fa0eb$export$599d4515591ef232 = (relativeUrl, isReplace, scrol
|
|
|
226
200
|
Page[Page["SEARCH"] = 1] = "SEARCH";
|
|
227
201
|
Page[Page["CATEGORY"] = 2] = "CATEGORY";
|
|
228
202
|
})(Page || (Page = {}));
|
|
229
|
-
const current_page = $
|
|
203
|
+
const current_page = $ac53b4e3251b31d0$export$775e6b3892b5ad52() ? Page.SEARCH : $ac53b4e3251b31d0$export$30c8a12df09be0e4() ? Page.CATEGORY : Page.OTHER;
|
|
230
204
|
const target_u_o = new URL(relativeUrl, location.origin);
|
|
231
|
-
const target_page = $
|
|
205
|
+
const target_page = $ac53b4e3251b31d0$export$775e6b3892b5ad52(target_u_o) ? Page.SEARCH : $ac53b4e3251b31d0$export$30c8a12df09be0e4(target_u_o) ? Page.CATEGORY : Page.OTHER;
|
|
232
206
|
window.next.router[isReplace ? "replace" : "push"](relativeUrl, undefined, {
|
|
233
207
|
shallow: current_page === target_page && target_page !== Page.OTHER,
|
|
234
208
|
scroll:
|
|
@@ -579,14 +553,45 @@ function $0565aab3357d32e9$export$84601d922bd37be1(blocks, component_portals, se
|
|
|
579
553
|
};
|
|
580
554
|
});
|
|
581
555
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
556
|
+
function $7d10b4c67928d97f$export$eb5844afe948564b(props) {
|
|
557
|
+
const default_is_set = $jb2Oo$createMemo(() => {
|
|
558
|
+
var _globalState$usedLoca;
|
|
559
|
+
return !!((0, $8c691d7f86317052$export$8e769ad4338a911e).merchant[0]() && (0, $8c691d7f86317052$export$8e769ad4338a911e).market[0]() && (_globalState$usedLoca = (0, $8c691d7f86317052$export$8e769ad4338a911e).usedLocale[0]()) !== null && _globalState$usedLoca !== void 0 && _globalState$usedLoca.backend_locale_);
|
|
560
|
+
});
|
|
561
|
+
const should_show = $jb2Oo$createMemo(prev => {
|
|
562
|
+
if (!prev && (0, $8c691d7f86317052$export$8e769ad4338a911e).provider_is_updating[0]())
|
|
563
|
+
// Why `!prev`? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7854#note_1495776987
|
|
564
|
+
// If we weren't showing the component and the DepictProvider is currently updating, wait for it to have finished updating before showing the component
|
|
565
|
+
// Otherwise as soon as tenant and market is set we render the CategoryPage, but we might not have a DepictCategory yet, see https://depictaiworkspace.slack.com/archives/C04UZ2Z0RNE/p1690895918347289?thread_ts=1688391305.529449&cid=C04UZ2Z0RNE
|
|
566
|
+
return false;
|
|
567
|
+
return (props.isSet || default_is_set)();
|
|
568
|
+
});
|
|
569
|
+
return $jb2Oo$createComponent((0, $jb2Oo$Show), {
|
|
570
|
+
get when() {
|
|
571
|
+
return should_show();
|
|
572
|
+
},
|
|
573
|
+
get children() {
|
|
574
|
+
return props.children;
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
const $f33e2dee70c97da3$var$rendered_components_with_state_key = new Set();
|
|
579
|
+
function $f33e2dee70c97da3$export$a54ec244c8863715(props) {
|
|
580
|
+
return $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
581
|
+
solid_component: function () {
|
|
582
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
583
|
+
// Work around some kind of babel bug where an optimisation turns ...args into `arguments` in the ES10 build which becomes the wrong arguments when read from teh getter
|
|
584
|
+
const ourArguments = args;
|
|
585
|
+
return $jb2Oo$createComponent((0, $7d10b4c67928d97f$export$eb5844afe948564b), {
|
|
586
|
+
get children() {
|
|
587
|
+
return $f33e2dee70c97da3$var$SolidSearchPage(...ourArguments);
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
},
|
|
586
591
|
props: props
|
|
587
592
|
});
|
|
588
593
|
}
|
|
589
|
-
function $
|
|
594
|
+
function $f33e2dee70c97da3$var$SolidSearchPage(props, set_portals) {
|
|
590
595
|
const depict_search = $jb2Oo$createMemo(() => {
|
|
591
596
|
const instance = $fda7a7820477f957$export$f4d89133c6985668("search", props.stateKey, "SearchPage");
|
|
592
597
|
$jb2Oo$onCleanup(() => {
|
|
@@ -610,7 +615,7 @@ function $d059770e7af9e2dc$var$SolidSearchPage(props, set_portals) {
|
|
|
610
615
|
// This is because on the front page the search_query updating is blocked because it's not the search page, and that means that `filtered_previous_searches` in Autocomplete.tsx doesn't filter out the current search query
|
|
611
616
|
// Because it's so minor and would be quite hard to fix (one would need a second "actual search query" signal just for this purpose) it's wontfix for now
|
|
612
617
|
// EDIT: now that we're resetting this in the onCleanup of the memo above this might no longer be the case
|
|
613
|
-
write_signal(!$
|
|
618
|
+
write_signal(!$ac53b4e3251b31d0$export$775e6b3892b5ad52(location));
|
|
614
619
|
};
|
|
615
620
|
const [, set_search_page_in_dom] = (0, $8c691d7f86317052$export$8e769ad4338a911e).search_page_in_dom;
|
|
616
621
|
const component_portals = new Set();
|
|
@@ -618,18 +623,18 @@ function $d059770e7af9e2dc$var$SolidSearchPage(props, set_portals) {
|
|
|
618
623
|
set_search_page_in_dom(true);
|
|
619
624
|
$jb2Oo$onCleanup(() => set_search_page_in_dom(false));
|
|
620
625
|
// react is really slow with disposing components, we want to avoid a flash of another search query when you click on a product and navigate away
|
|
621
|
-
$
|
|
626
|
+
$ac53b4e3251b31d0$export$74f3924c5027fe1d(update_updating_blocked_signal); // if we navigate, re-check
|
|
622
627
|
$jb2Oo$createComputed(() => {
|
|
623
628
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).search_page_path_[0](); // if react defined path changes, re-check
|
|
624
629
|
update_updating_blocked_signal();
|
|
625
630
|
});
|
|
626
|
-
$
|
|
631
|
+
$f33e2dee70c97da3$var$search_page_path_checker();
|
|
627
632
|
return $jb2Oo$createMemo(() => {
|
|
628
633
|
const stateKey = $jb2Oo$untrack(() => props.stateKey);
|
|
629
|
-
if ($
|
|
634
|
+
if ($f33e2dee70c97da3$var$rendered_components_with_state_key.has(stateKey)) throw new Error("You have multiple SearchPage components with the same stateKey: ".concat(stateKey, ". Each SearchPage component must have a unique stateKey."));
|
|
630
635
|
const transformed_content_blocks = $0565aab3357d32e9$export$84601d922bd37be1(() => props.contentBlocksByRow, component_portals, set_portals);
|
|
631
|
-
$
|
|
632
|
-
$jb2Oo$onCleanup(() => $
|
|
636
|
+
$f33e2dee70c97da3$var$rendered_components_with_state_key.add(stateKey);
|
|
637
|
+
$jb2Oo$onCleanup(() => $f33e2dee70c97da3$var$rendered_components_with_state_key.delete(stateKey));
|
|
633
638
|
return $jb2Oo$SearchPage({
|
|
634
639
|
// Default config goes here
|
|
635
640
|
get include_input_field() {
|
|
@@ -661,7 +666,7 @@ function $d059770e7af9e2dc$var$SolidSearchPage(props, set_portals) {
|
|
|
661
666
|
/**
|
|
662
667
|
* Users often set the searchPagePath to something without the market which breaks everything using the searchPagePath internally, notably refining the search query. Add a warning for them.
|
|
663
668
|
*/
|
|
664
|
-
function $
|
|
669
|
+
function $f33e2dee70c97da3$var$search_page_path_checker() {
|
|
665
670
|
let has_warned = false;
|
|
666
671
|
$jb2Oo$createEffect(() => {
|
|
667
672
|
if (has_warned) return;
|
|
@@ -677,19 +682,26 @@ function $d059770e7af9e2dc$var$search_page_path_checker() {
|
|
|
677
682
|
}
|
|
678
683
|
});
|
|
679
684
|
}
|
|
680
|
-
const $
|
|
681
|
-
function $
|
|
682
|
-
return $
|
|
685
|
+
const $710dda89475e8c05$var$rendered_components_with_state_key = new Set();
|
|
686
|
+
function $710dda89475e8c05$export$f7d2f673fc2f091d(props) {
|
|
687
|
+
return $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
683
688
|
// @ts-ignore
|
|
684
689
|
solid_component: function () {
|
|
685
|
-
|
|
690
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
691
|
+
// Work around some kind of babel bug where an optimisation turns ...args into `arguments` in the ES10 build which becomes the wrong arguments when read from teh getter
|
|
692
|
+
const ourArguments = args;
|
|
693
|
+
return $jb2Oo$createComponent((0, $7d10b4c67928d97f$export$eb5844afe948564b), {
|
|
694
|
+
get children() {
|
|
695
|
+
return $710dda89475e8c05$var$SolidCategoryPage(...ourArguments);
|
|
696
|
+
}
|
|
697
|
+
});
|
|
686
698
|
},
|
|
687
699
|
props: props,
|
|
688
700
|
wrapper_type: "div",
|
|
689
701
|
wrapper_style: {}
|
|
690
702
|
});
|
|
691
703
|
}
|
|
692
|
-
function $
|
|
704
|
+
function $710dda89475e8c05$var$SolidCategoryPage(props, set_portals) {
|
|
693
705
|
const depict_category = $jb2Oo$createMemo(() => $fda7a7820477f957$export$f4d89133c6985668("category", props.stateKey, "CategoryPage") // stateKey can change
|
|
694
706
|
);
|
|
695
707
|
|
|
@@ -709,11 +721,11 @@ function $e86a296a07b17ad5$var$SolidCategoryPage(props, set_portals) {
|
|
|
709
721
|
(0, $8c691d7f86317052$export$8e769ad4338a911e).known_category_paths.add(location.pathname);
|
|
710
722
|
}
|
|
711
723
|
});
|
|
712
|
-
const
|
|
724
|
+
const Category = () => $jb2Oo$createMemo(() => {
|
|
713
725
|
const stateKey = $jb2Oo$untrack(() => props.stateKey);
|
|
714
|
-
if ($
|
|
715
|
-
$
|
|
716
|
-
$jb2Oo$onCleanup(() => $
|
|
726
|
+
if ($710dda89475e8c05$var$rendered_components_with_state_key.has(stateKey)) throw new Error("You have multiple CategoryPage components with the same stateKey: ".concat(stateKey, ". Each CategoryPage component must have a unique stateKey."));
|
|
727
|
+
$710dda89475e8c05$var$rendered_components_with_state_key.add(stateKey);
|
|
728
|
+
$jb2Oo$onCleanup(() => $710dda89475e8c05$var$rendered_components_with_state_key.delete(stateKey));
|
|
717
729
|
const transformed_content_blocks = $0565aab3357d32e9$export$84601d922bd37be1(() => props.contentBlocksByRow, component_portals, set_portals);
|
|
718
730
|
return $jb2Oo$CategoryPage({
|
|
719
731
|
depict_category: depict_category(),
|
|
@@ -750,15 +762,24 @@ function $e86a296a07b17ad5$var$SolidCategoryPage(props, set_portals) {
|
|
|
750
762
|
})
|
|
751
763
|
});
|
|
752
764
|
});
|
|
753
|
-
return $
|
|
765
|
+
return $jb2Oo$createComponent((0, $7d10b4c67928d97f$export$eb5844afe948564b), {
|
|
766
|
+
isSet: category_state_set,
|
|
767
|
+
get children() {
|
|
768
|
+
return $jb2Oo$createComponent(Category, {});
|
|
769
|
+
}
|
|
770
|
+
});
|
|
754
771
|
}
|
|
755
772
|
function $ec632214ac078e79$export$5646050d516e06bc(react_props) {
|
|
756
|
-
return $
|
|
757
|
-
solid_component: $
|
|
773
|
+
return $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
774
|
+
solid_component: solidProps => $jb2Oo$createComponent((0, $7d10b4c67928d97f$export$eb5844afe948564b), {
|
|
775
|
+
get children() {
|
|
776
|
+
return $jb2Oo$createComponent($ec632214ac078e79$var$VanillaBreadcrumbs, solidProps);
|
|
777
|
+
}
|
|
778
|
+
}),
|
|
758
779
|
props: react_props
|
|
759
780
|
});
|
|
760
781
|
}
|
|
761
|
-
function $ec632214ac078e79$var$
|
|
782
|
+
function $ec632214ac078e79$var$VanillaBreadcrumbs(props) {
|
|
762
783
|
// memo so stateKey can be dynamically changed
|
|
763
784
|
return $jb2Oo$createMemo(() => {
|
|
764
785
|
const depict_category = $fda7a7820477f957$export$f4d89133c6985668("category", props.stateKey, "BreadCrumbs");
|
|
@@ -769,12 +790,16 @@ function $ec632214ac078e79$var$vanilla_breadcrumbs(props) {
|
|
|
769
790
|
}
|
|
770
791
|
function $c61814cfb91ead09$export$466cdc317043f6cb() {
|
|
771
792
|
let react_props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
772
|
-
return $
|
|
773
|
-
solid_component: $
|
|
793
|
+
return $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
794
|
+
solid_component: solidProps => $jb2Oo$createComponent((0, $7d10b4c67928d97f$export$eb5844afe948564b), {
|
|
795
|
+
get children() {
|
|
796
|
+
return $jb2Oo$createComponent($c61814cfb91ead09$var$VanillaQuickLinks, solidProps);
|
|
797
|
+
}
|
|
798
|
+
}),
|
|
774
799
|
props: react_props
|
|
775
800
|
});
|
|
776
801
|
}
|
|
777
|
-
function $c61814cfb91ead09$var$
|
|
802
|
+
function $c61814cfb91ead09$var$VanillaQuickLinks(props) {
|
|
778
803
|
// memo so stateKey can be dynamically changed
|
|
779
804
|
return $jb2Oo$createMemo(() => {
|
|
780
805
|
const depict_category = $fda7a7820477f957$export$f4d89133c6985668("category", props.stateKey, "QuickLinks");
|
|
@@ -788,7 +813,7 @@ const $6406849926c3f794$export$3f37af283f8fb843 = raw_react_props => {
|
|
|
788
813
|
class: raw_react_props.className,
|
|
789
814
|
...raw_react_props
|
|
790
815
|
};
|
|
791
|
-
return $
|
|
816
|
+
return $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
792
817
|
solid_component: props_store => $jb2Oo$ImagePlaceholder(props_store),
|
|
793
818
|
props: react_props,
|
|
794
819
|
wrapper_type: "span",
|
|
@@ -800,7 +825,7 @@ const $2c7738b65cbcac1c$export$89c6019e4baa40b1 = raw_react_props => {
|
|
|
800
825
|
class: raw_react_props.className,
|
|
801
826
|
...raw_react_props
|
|
802
827
|
};
|
|
803
|
-
return $
|
|
828
|
+
return $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
804
829
|
solid_component: props_store => $jb2Oo$TextPlaceholder(props_store),
|
|
805
830
|
props: react_props,
|
|
806
831
|
wrapper_type: "span",
|
|
@@ -823,7 +848,7 @@ function $758339150fbfe9d5$export$4daadad26e48a2c7(props) {
|
|
|
823
848
|
}
|
|
824
849
|
function $c02e9fd51f31a1bd$export$82cfdc85a4d15688(props) {
|
|
825
850
|
$758339150fbfe9d5$export$4daadad26e48a2c7(props);
|
|
826
|
-
return $
|
|
851
|
+
return $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
827
852
|
solid_component: $c02e9fd51f31a1bd$export$5abb40edfde2a843,
|
|
828
853
|
props: props
|
|
829
854
|
});
|
|
@@ -906,7 +931,7 @@ function $cd68097a7ee08669$export$e46079a2793e9ec7(props, set_portals) {
|
|
|
906
931
|
}
|
|
907
932
|
function $31abef71c0a2d3fc$export$b0a773486c1c2312(props) {
|
|
908
933
|
$758339150fbfe9d5$export$4daadad26e48a2c7(props);
|
|
909
|
-
return $
|
|
934
|
+
return $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
910
935
|
solid_component: (0, $cd68097a7ee08669$export$e46079a2793e9ec7),
|
|
911
936
|
props: props,
|
|
912
937
|
hydrate_function_when_ssr: (0, $jb2Oo$hydrate),
|
|
@@ -958,7 +983,7 @@ function $356d18d3ed66814e$export$912994940e660d32() {
|
|
|
958
983
|
open: open
|
|
959
984
|
};
|
|
960
985
|
}
|
|
961
|
-
const $
|
|
986
|
+
const $ab2d430c2034aa17$export$9bb30bbe003b82e0 = function () {
|
|
962
987
|
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
963
988
|
// We should just export a plain SearchField component here, not a weird hook thing, but I don't want to make a breaking change. Just fixing the re-rendering issue for now.
|
|
964
989
|
// Create signal that persists across renders
|
|
@@ -966,19 +991,21 @@ const $4c71282d292aac6d$export$9bb30bbe003b82e0 = function () {
|
|
|
966
991
|
// Update signal value when alignerRef changes
|
|
967
992
|
set_aligner_signal_value(props === null || props === void 0 ? void 0 : props.alignerRef);
|
|
968
993
|
// Make sure react never re-renders the actual SearchField component
|
|
969
|
-
const componentFunction = $jb2Oo$useCallback(() => $
|
|
970
|
-
solid_component: $
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
994
|
+
const componentFunction = $jb2Oo$useCallback(() => $ac53b4e3251b31d0$export$f6e64e17bd69eeef({
|
|
995
|
+
solid_component: () => $jb2Oo$createComponent((0, $7d10b4c67928d97f$export$eb5844afe948564b), {
|
|
996
|
+
get children() {
|
|
997
|
+
return $jb2Oo$createMemo(() => {
|
|
998
|
+
const depict_search = $fda7a7820477f957$export$f4d89133c6985668("search", props.stateKey, "useSearchField");
|
|
999
|
+
return $jb2Oo$SearchField({
|
|
1000
|
+
depict_search: depict_search,
|
|
1001
|
+
get aligner_ref() {
|
|
1002
|
+
var _get_aligner_signal_v;
|
|
1003
|
+
// React mutates the object at some random time so only get the current value once it actually is requested
|
|
1004
|
+
return (_get_aligner_signal_v = get_aligner_signal_value()) === null || _get_aligner_signal_v === void 0 ? void 0 : _get_aligner_signal_v.current;
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
980
1007
|
});
|
|
981
|
-
}
|
|
1008
|
+
}
|
|
982
1009
|
}),
|
|
983
1010
|
props: {}
|
|
984
1011
|
}), []);
|
|
@@ -1019,6 +1046,91 @@ async function $1895644749ca8d8a$var$fetchRecommendations(opts) {
|
|
|
1019
1046
|
});
|
|
1020
1047
|
return fetchedRecs;
|
|
1021
1048
|
}
|
|
1049
|
+
function $39af3ccd78996343$export$72616730c1fad2f4(stateKey) {
|
|
1050
|
+
// Create signal that will persist re-renders
|
|
1051
|
+
const [[getStateKeySignalValue, setStateKeySignalValue]] = $jb2Oo$useState($jb2Oo$createSignal(stateKey));
|
|
1052
|
+
const [cachedFunctionCalls] = $jb2Oo$useState({});
|
|
1053
|
+
const [hookFunctionsObject, setHookFunctionsObject] = $jb2Oo$useState(new Proxy({}, {
|
|
1054
|
+
get(target, property) {
|
|
1055
|
+
return function () {
|
|
1056
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
1057
|
+
// Cache function calls until we have the real functions
|
|
1058
|
+
cachedFunctionCalls[property] = args;
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
}));
|
|
1062
|
+
$jb2Oo$useEffect(() => {
|
|
1063
|
+
// get_instance_and_track_component may first return something in useEffect because the next-js router first gives us stuff from the URL after hydration (effects have ran) and we only create the instances if merchant and market is set
|
|
1064
|
+
return $jb2Oo$createRoot(dispose => {
|
|
1065
|
+
let firstRun = true;
|
|
1066
|
+
$jb2Oo$createRenderEffect(() => {
|
|
1067
|
+
const depict_category = $fda7a7820477f957$export$f4d89133c6985668("category", getStateKeySignalValue(), "useCategoryFilterHelpers");
|
|
1068
|
+
const functions = $39af3ccd78996343$var$createHookFunctions(depict_category);
|
|
1069
|
+
if (firstRun) {
|
|
1070
|
+
firstRun = false;
|
|
1071
|
+
// Run cached function calls
|
|
1072
|
+
Object.entries(cachedFunctionCalls).forEach(_ref => {
|
|
1073
|
+
var _functions$key;
|
|
1074
|
+
let [key, args] = _ref;
|
|
1075
|
+
return (_functions$key = functions[key]) === null || _functions$key === void 0 ? void 0 : _functions$key.call(functions, ...args);
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
setHookFunctionsObject(functions);
|
|
1079
|
+
});
|
|
1080
|
+
return dispose;
|
|
1081
|
+
});
|
|
1082
|
+
}, []);
|
|
1083
|
+
// When props change, update our signal value so solid can react to stateKey changing
|
|
1084
|
+
$jb2Oo$useEffect(() => {
|
|
1085
|
+
setStateKeySignalValue(stateKey);
|
|
1086
|
+
}, [stateKey]);
|
|
1087
|
+
return hookFunctionsObject;
|
|
1088
|
+
}
|
|
1089
|
+
function $39af3ccd78996343$var$createHookFunctions(depictCategory) {
|
|
1090
|
+
const categorySetShouldShowFilters = newValue => {
|
|
1091
|
+
const {
|
|
1092
|
+
historyStateSignals_: {
|
|
1093
|
+
filters_open: [, setFiltersOpen],
|
|
1094
|
+
sorting_open: [, setSortingOpen]
|
|
1095
|
+
}
|
|
1096
|
+
} = depictCategory;
|
|
1097
|
+
if (newValue)
|
|
1098
|
+
// Close sorting so we don't show both at once
|
|
1099
|
+
setSortingOpen(false);
|
|
1100
|
+
setFiltersOpen(newValue);
|
|
1101
|
+
};
|
|
1102
|
+
const categorySetFilter = filter => {
|
|
1103
|
+
const [selectedFilters, setSelectedFilters] = depictCategory.selectedFilters_;
|
|
1104
|
+
const filteredFilters = $jb2Oo$untrack(selectedFilters).filter(_ref2 => {
|
|
1105
|
+
let {
|
|
1106
|
+
field: field,
|
|
1107
|
+
op: op
|
|
1108
|
+
} = _ref2;
|
|
1109
|
+
return field !== filter.field && op !== filter.op;
|
|
1110
|
+
});
|
|
1111
|
+
filteredFilters.push(filter);
|
|
1112
|
+
setSelectedFilters(filteredFilters);
|
|
1113
|
+
};
|
|
1114
|
+
const categoryExpandFilterGroup = groupToExpand => {
|
|
1115
|
+
const [expandedFilters, setExpandedFilters] = depictCategory.historyStateSignals_.expanded_filters;
|
|
1116
|
+
const newExpanded = $jb2Oo$untrack(expandedFilters).filter(_ref3 => {
|
|
1117
|
+
let {
|
|
1118
|
+
section_: section_
|
|
1119
|
+
} = _ref3;
|
|
1120
|
+
return section_ !== groupToExpand;
|
|
1121
|
+
});
|
|
1122
|
+
newExpanded.push({
|
|
1123
|
+
section_: groupToExpand,
|
|
1124
|
+
expanded_: true
|
|
1125
|
+
});
|
|
1126
|
+
setExpandedFilters(newExpanded);
|
|
1127
|
+
};
|
|
1128
|
+
return {
|
|
1129
|
+
categorySetShouldShowFilters: categorySetShouldShowFilters,
|
|
1130
|
+
categorySetFilter: categorySetFilter,
|
|
1131
|
+
categoryExpandFilterGroup: categoryExpandFilterGroup
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1022
1134
|
const $05726fa9c7eda0a1$export$804fac5697cfbe35 = router => (relativeUrl, _ref) => {
|
|
1023
1135
|
let {
|
|
1024
1136
|
scroll: scroll,
|
|
@@ -1030,9 +1142,9 @@ const $05726fa9c7eda0a1$export$804fac5697cfbe35 = router => (relativeUrl, _ref)
|
|
|
1030
1142
|
Page[Page["SEARCH"] = 1] = "SEARCH";
|
|
1031
1143
|
Page[Page["CATEGORY"] = 2] = "CATEGORY";
|
|
1032
1144
|
})(Page || (Page = {}));
|
|
1033
|
-
const current_page = $
|
|
1145
|
+
const current_page = $ac53b4e3251b31d0$export$775e6b3892b5ad52() ? Page.SEARCH : $ac53b4e3251b31d0$export$30c8a12df09be0e4() ? Page.CATEGORY : Page.OTHER;
|
|
1034
1146
|
const target_u_o = new URL(relativeUrl, location.origin);
|
|
1035
|
-
const target_page = $
|
|
1147
|
+
const target_page = $ac53b4e3251b31d0$export$775e6b3892b5ad52(target_u_o) ? Page.SEARCH : $ac53b4e3251b31d0$export$30c8a12df09be0e4(target_u_o) ? Page.CATEGORY : Page.OTHER;
|
|
1036
1148
|
router[replace ? "replace" : "push"](relativeUrl, undefined, {
|
|
1037
1149
|
shallow: current_page === target_page && target_page !== Page.OTHER,
|
|
1038
1150
|
scroll:
|
|
@@ -1044,4 +1156,4 @@ const $a7dfdd84298ae791$export$b8a61e5c71402559 = {
|
|
|
1044
1156
|
nextRouterNavigation: $05726fa9c7eda0a1$export$804fac5697cfbe35
|
|
1045
1157
|
};
|
|
1046
1158
|
$jb2Oo$add_to_version_info("react-ui", (0, $9bd9bb8700ab2ada$export$83d89fbfd8236492));
|
|
1047
|
-
export { $c61814cfb91ead09$export$466cdc317043f6cb as QuickLinks, $ec632214ac078e79$export$5646050d516e06bc as BreadCrumbs, $f6a205a95e4fdee3$export$80e99ee6b29cadd2 as ComponentAligner, $18e5b9f66c7ade8e$export$9fac37a9c21c2f3b as DepictProvider, $
|
|
1159
|
+
export { $c61814cfb91ead09$export$466cdc317043f6cb as QuickLinks, $ec632214ac078e79$export$5646050d516e06bc as BreadCrumbs, $f6a205a95e4fdee3$export$80e99ee6b29cadd2 as ComponentAligner, $18e5b9f66c7ade8e$export$9fac37a9c21c2f3b as DepictProvider, $710dda89475e8c05$export$f7d2f673fc2f091d as CategoryPage, $f33e2dee70c97da3$export$a54ec244c8863715 as SearchPage, $6406849926c3f794$export$3f37af283f8fb843 as ImagePlaceholder, $2c7738b65cbcac1c$export$89c6019e4baa40b1 as TextPlaceholder, $31abef71c0a2d3fc$export$b0a773486c1c2312 as RecommendationGrid, $c02e9fd51f31a1bd$export$82cfdc85a4d15688 as RecommendationSlider, $356d18d3ed66814e$export$912994940e660d32 as useSearchModal, $ab2d430c2034aa17$export$9bb30bbe003b82e0 as useSearchField, $1895644749ca8d8a$export$6501da23a2770fc as useFetchRecommendations, $b34796f5ebe3470e$export$38b98fae14bd1f64 as usePerformanceClient, $39af3ccd78996343$export$72616730c1fad2f4 as useCategoryFilterHelpers, $383b6fd56bf151bd$re_export$CategoryTitle as CategoryTitle, $383b6fd56bf151bd$re_export$EmbeddedNumProducts as EmbeddedNumProducts, $383b6fd56bf151bd$re_export$SearchModalV2 as SearchModalV2, $383b6fd56bf151bd$re_export$ClassicSearchModal as ClassicSearchModal, $9bd9bb8700ab2ada$export$83d89fbfd8236492 as version, $a7dfdd84298ae791$export$b8a61e5c71402559 as Navigation };
|