@depict-ai/react-ui 2.1.5 → 2.1.6

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.
Files changed (47) hide show
  1. package/ES10/index.cjs +1 -1
  2. package/ES10/index.d.ts +1 -1
  3. package/ES10/index.js +1 -1
  4. package/latest/index.cjs +1 -1
  5. package/latest/index.d.ts +1 -1
  6. package/latest/index.js +1 -1
  7. package/package.json +2 -2
  8. package/server/ES10/index.cjs +1 -1
  9. package/server/ES10/index.d.ts +1 -1
  10. package/server/ES10/index.js +1 -1
  11. package/server/latest/index.cjs +1 -1
  12. package/server/latest/index.d.ts +1 -1
  13. package/server/latest/index.js +1 -1
  14. package/dist/main.js +0 -527
  15. package/dist/module.js +0 -510
  16. package/dist/styles/components/PLP/Buttons.scss +0 -181
  17. package/dist/styles/components/PLP/MorphingSign.scss +0 -30
  18. package/dist/styles/components/PLP/PLPResults.scss +0 -26
  19. package/dist/styles/components/PLP/ProductListingPage.scss +0 -168
  20. package/dist/styles/components/PLP/ScrollStatus.scss +0 -31
  21. package/dist/styles/components/PLP/SelectedFilters.scss +0 -82
  22. package/dist/styles/components/PLP/SlidableItems.scss +0 -121
  23. package/dist/styles/components/PLP/SortAndFilter/FloatingButtons.scss +0 -84
  24. package/dist/styles/components/PLP/SortAndFilter/SortAndFilter.scss +0 -800
  25. package/dist/styles/components/PLP/SortAndFilter/SortAndFilterModal.scss +0 -158
  26. package/dist/styles/components/PLP/SortAndFilter/WhiteSortAndFilter.scss +0 -152
  27. package/dist/styles/components/PLP/Toast.scss +0 -59
  28. package/dist/styles/components/PLP/index.scss +0 -51
  29. package/dist/styles/components/category/BreadCrumbs.scss +0 -32
  30. package/dist/styles/components/category/CategoryTitle.scss +0 -40
  31. package/dist/styles/components/category/QuickLinks.scss +0 -80
  32. package/dist/styles/components/category/index.scss +0 -23
  33. package/dist/styles/components/search/Autocomplete.scss +0 -197
  34. package/dist/styles/components/search/CategorySuggestions.scss +0 -82
  35. package/dist/styles/components/search/InstantCard.scss +0 -122
  36. package/dist/styles/components/search/InstantResults.scss +0 -12
  37. package/dist/styles/components/search/PreviousSearches.scss +0 -90
  38. package/dist/styles/components/search/QueryInput.scss +0 -189
  39. package/dist/styles/components/search/SearchModal.scss +0 -101
  40. package/dist/styles/components/search/SearchRecommendations.scss +0 -28
  41. package/dist/styles/components/search/ShowingResultsFor.scss +0 -13
  42. package/dist/styles/components/search/index.scss +0 -40
  43. package/dist/styles/default.css +0 -1
  44. package/dist/styles/helpers/custom_input.scss +0 -194
  45. package/dist/styles/helpers/supports-hover.scss +0 -7
  46. package/dist/styles/helpers/utils.scss +0 -90
  47. package/dist/styles/variables.scss +0 -61
package/ES10/index.cjs CHANGED
@@ -38,7 +38,7 @@ $parcel$export(module.exports, "version", () => $efbdd2dab4314170$export$83d89fb
38
38
  $parcel$export(module.exports, "Navigation", () => $0d3a2413fdeb34b9$export$b8a61e5c71402559);
39
39
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
40
40
  // Note, if you add an export here, also add one in src-server/main.ts
41
- const $efbdd2dab4314170$export$83d89fbfd8236492 = "2.1.5";
41
+ const $efbdd2dab4314170$export$83d89fbfd8236492 = "2.1.6";
42
42
  const $ef516b1f92253963$export$8e769ad4338a911e = {
43
43
  usedLocale: $2kiy7$solidjs.createSignal((0, $2kiy7$depictaiuilocales.defaultLocale)),
44
44
  search_instances: new Map(),
package/ES10/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import React, { PropsWithChildren, ReactNode, FC, ReactPortal, ReactElement } fr
3
3
  import { BaseProviderConfig, BaseSearchProviderConfig, BaseCategoryProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui/ES10";
4
4
  import { Locale } from "@depict-ai/ui/locales/ES10";
5
5
  import { Display, ModernDisplay } from "@depict-ai/utilishared/ES10";
6
- export const version = "2.1.5";
6
+ export const version = "2.1.6";
7
7
  interface UsePerformanceClientReturn {
8
8
  dpc: DPC;
9
9
  }
package/ES10/index.js CHANGED
@@ -14,7 +14,7 @@ import { renderToString as $jb2Oo$renderToString } from "react-dom/server";
14
14
  // Note, if you add an export here, also add one in src-server/main.ts
15
15
  import { register_es_version } from "../multi_import_deduplicator.mjs";
16
16
  register_es_version("react-ui", "ES10");
17
- const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "2.1.5";
17
+ const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "2.1.6";
18
18
  const $8c691d7f86317052$export$8e769ad4338a911e = {
19
19
  usedLocale: $jb2Oo$createSignal((0, $jb2Oo$defaultLocale)),
20
20
  search_instances: new Map(),
package/latest/index.cjs CHANGED
@@ -38,7 +38,7 @@ $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fb
38
38
  $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
39
39
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
40
40
  // Note, if you add an export here, also add one in src-server/main.ts
41
- const $db7b67857900028b$export$83d89fbfd8236492 = "2.1.5";
41
+ const $db7b67857900028b$export$83d89fbfd8236492 = "2.1.6";
42
42
  const $0b7cd4fb39fc3502$export$8e769ad4338a911e = {
43
43
  usedLocale: $2IzJs$solidjs.createSignal((0, $2IzJs$depictaiuilocales.defaultLocale)),
44
44
  search_instances: new Map(),
package/latest/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import React, { PropsWithChildren, ReactNode, FC, ReactPortal, ReactElement } fr
3
3
  import { BaseProviderConfig, BaseSearchProviderConfig, BaseCategoryProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui/latest";
4
4
  import { Locale } from "@depict-ai/ui/locales/latest";
5
5
  import { Display, ModernDisplay } from "@depict-ai/utilishared/latest";
6
- export const version = "2.1.5";
6
+ export const version = "2.1.6";
7
7
  interface UsePerformanceClientReturn {
8
8
  dpc: DPC;
9
9
  }
package/latest/index.js CHANGED
@@ -14,7 +14,7 @@ import { renderToString as $2GFvs$renderToString } from "react-dom/server";
14
14
  // Note, if you add an export here, also add one in src-server/main.ts
15
15
  import { register_es_version } from "../multi_import_deduplicator.mjs";
16
16
  register_es_version("react-ui", "latest");
17
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "2.1.5";
17
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "2.1.6";
18
18
  const $42858f023ef23dab$export$8e769ad4338a911e = {
19
19
  usedLocale: $2GFvs$createSignal((0, $2GFvs$defaultLocale)),
20
20
  search_instances: new Map(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "types": "ES10/index.d.ts",
@@ -137,7 +137,7 @@
137
137
  "@babel/runtime-corejs3": "latest",
138
138
  "@depict-ai/dpc": "^1.0.42",
139
139
  "@depict-ai/plp-styling": "^1.2.6",
140
- "@depict-ai/ui": "^2.1.4",
140
+ "@depict-ai/ui": "^2.1.8",
141
141
  "@depict-ai/utilishared": "^1.0.47",
142
142
  "solid-js": "^1.8.1"
143
143
  },
@@ -170,7 +170,7 @@ function $27d583018ba6e604$export$bd8acc07a8bae229(props, set_portals) {
170
170
  }
171
171
  });
172
172
  }
173
- const $efbdd2dab4314170$export$83d89fbfd8236492 = "2.1.5";
173
+ const $efbdd2dab4314170$export$83d89fbfd8236492 = "2.1.6";
174
174
  function $202459d454907b31$export$9fac37a9c21c2f3b(props) {
175
175
  return props.children;
176
176
  }
@@ -3,7 +3,7 @@ import React, { PropsWithChildren, ReactNode, FC, ReactPortal, ReactElement } fr
3
3
  import { BaseProviderConfig, BaseSearchProviderConfig, BaseCategoryProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui/ES10";
4
4
  import { Locale } from "@depict-ai/ui/locales/ES10";
5
5
  import { Display, ModernDisplay } from "@depict-ai/utilishared/ES10";
6
- export const version = "2.1.5";
6
+ export const version = "2.1.6";
7
7
  interface UsePerformanceClientReturn {
8
8
  dpc: DPC;
9
9
  }
@@ -147,7 +147,7 @@ function $48b0916cc674770c$export$bd8acc07a8bae229(props, set_portals) {
147
147
  }
148
148
  });
149
149
  }
150
- const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "2.1.5";
150
+ const $9bd9bb8700ab2ada$export$83d89fbfd8236492 = "2.1.6";
151
151
  function $5c4add0a8fe94894$export$9fac37a9c21c2f3b(props) {
152
152
  return props.children;
153
153
  }
@@ -163,7 +163,7 @@ function $0aaa03f81d756b85$export$bd8acc07a8bae229(props, set_portals) {
163
163
  }
164
164
  });
165
165
  }
166
- const $db7b67857900028b$export$83d89fbfd8236492 = "2.1.5";
166
+ const $db7b67857900028b$export$83d89fbfd8236492 = "2.1.6";
167
167
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
168
168
  return props.children;
169
169
  }
@@ -3,7 +3,7 @@ import React, { PropsWithChildren, ReactNode, FC, ReactPortal, ReactElement } fr
3
3
  import { BaseProviderConfig, BaseSearchProviderConfig, BaseCategoryProviderConfig, ModernDisplayWithPageUrl, BaseProductListingConfig, BaseSearchPageConfig, BaseCategoryPageConfig, CategoryTitle, embedded_num_products, ImagePlaceholder as _ImagePlaceholder1, TextPlaceholder as _TextPlaceholder1, ExclusiveId, fetchDepictRecommendations } from "@depict-ai/ui/latest";
4
4
  import { Locale } from "@depict-ai/ui/locales/latest";
5
5
  import { Display, ModernDisplay } from "@depict-ai/utilishared/latest";
6
- export const version = "2.1.5";
6
+ export const version = "2.1.6";
7
7
  interface UsePerformanceClientReturn {
8
8
  dpc: DPC;
9
9
  }
@@ -140,7 +140,7 @@ function $8bee51f55543fe0c$export$bd8acc07a8bae229(props, set_portals) {
140
140
  }
141
141
  });
142
142
  }
143
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "2.1.5";
143
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "2.1.6";
144
144
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
145
145
  return props.children;
146
146
  }
package/dist/main.js DELETED
@@ -1,527 +0,0 @@
1
- var $4GYXz$depictaiutilishared = require("@depict-ai/utilishared");
2
- var $4GYXz$depictaiui = require("@depict-ai/ui");
3
- var $4GYXz$solidjs = require("solid-js");
4
- var $4GYXz$solidjsweb = require("solid-js/web");
5
- var $4GYXz$react = require("react");
6
- var $4GYXz$reactjsxruntime = require("react/jsx-runtime");
7
- var $4GYXz$reactdom = require("react-dom");
8
- var $4GYXz$depictaiuilocales = require("@depict-ai/ui/locales");
9
-
10
- function $parcel$export(e, n, v, s) {
11
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
- }
13
-
14
- $parcel$export(module.exports, "QuickLinks", () => $f16af0e861aff3d0$export$466cdc317043f6cb);
15
- $parcel$export(module.exports, "BreadCrumbs", () => $d88e98b11c182b8e$export$5646050d516e06bc);
16
- $parcel$export(module.exports, "DepictAligner", () => $d96434e62e08087d$export$3f4580d6398c5027);
17
- $parcel$export(module.exports, "DepictProvider", () => $24b00503eef73528$export$9fac37a9c21c2f3b);
18
- $parcel$export(module.exports, "DepictCategoryPage", () => $5aa5fcb9f8a2bebc$export$d87c61cecb2edf0d);
19
- $parcel$export(module.exports, "DepictSearchPage", () => $7ad7a3d0011b7b1b$export$210723f5a54a7028);
20
- $parcel$export(module.exports, "DepictSearchField", () => $03c714523ff406fc$export$4c0fa313cf50c4ad);
21
- $parcel$export(module.exports, "ImagePlaceholder", () => $df522c8a81ed5a01$export$3f37af283f8fb843);
22
- $parcel$export(module.exports, "TextPlaceholder", () => $7c8b440edc188ad5$export$89c6019e4baa40b1);
23
- $parcel$export(module.exports, "useDepictSearchModal", () => $3647cad61d03b89c$export$cc1e9aaf280afdcb);
24
- $parcel$export(module.exports, "CategoryTitle", () => $b03e4eee8610ebbe$re_export$CategoryTitle);
25
- $parcel$export(module.exports, "EmbeddedNumProducts", () => $b03e4eee8610ebbe$re_export$EmbeddedNumProducts);
26
- $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
27
- $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
28
- /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
29
- // Note, if you add an export here, also add one in src-server/main.ts
30
-
31
-
32
-
33
- const $0b7cd4fb39fc3502$export$8e769ad4338a911e = {
34
- search: null,
35
- category: null,
36
- category_path: null,
37
- search_page_path_: (0, $4GYXz$solidjs.createSignal)(),
38
- required_state_set_: (0, $4GYXz$solidjs.createSignal)(false)
39
- };
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
- let $b4d0d98857ed9934$var$run_on_href_change;
48
- function $b4d0d98857ed9934$export$74f3924c5027fe1d(cb) {
49
- $b4d0d98857ed9934$var$run_on_href_change = cb;
50
- }
51
- (async ()=>{
52
- for await (const href of (0, $4GYXz$depictaiutilishared.href_change_ipns))$b4d0d98857ed9934$var$run_on_href_change?.(href);
53
- })();
54
- const $b4d0d98857ed9934$export$775e6b3892b5ad52 = (url)=>url.pathname == (0, $4GYXz$solidjs.untrack)((0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_[0]); // might have changed therefore get it from globalState
55
- const $b4d0d98857ed9934$export$92a8f8b3c630fa0d = (url)=>{
56
- return $b4d0d98857ed9934$export$775e6b3892b5ad52(url) || url.pathname === (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category_path;
57
- };
58
- function $b4d0d98857ed9934$export$f6e64e17bd69eeef(solid_component, props, wrapper_type = "div", wrapper_style = {}, react_render_handler) {
59
- const [portals, set_portals] = (0, $4GYXz$react.useState)([]);
60
- const wrapper_element_ref = (0, $4GYXz$react.useRef)();
61
- (0, $4GYXz$react.useEffect)(()=>{
62
- const wrapper_element = wrapper_element_ref.current;
63
- const dispose = (0, $4GYXz$solidjsweb.render)(()=>solid_component(props, set_portals), wrapper_element);
64
- return dispose;
65
- }, []);
66
- react_render_handler?.(props);
67
- return (0, $4GYXz$react.createElement)(wrapper_type, {
68
- ref: wrapper_element_ref,
69
- style: wrapper_style
70
- }, portals);
71
- }
72
- function $b4d0d98857ed9934$export$e5139bbbb9a05035(component, is_set = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[0]) {
73
- return (...args)=>{
74
- return (0, $4GYXz$solidjs.createComponent)((0, $4GYXz$solidjs.Show), {
75
- get when () {
76
- return is_set();
77
- },
78
- get children () {
79
- return component(...args);
80
- }
81
- });
82
- };
83
- }
84
- async function $b4d0d98857ed9934$export$79c79419c1ef0081({ display: display , info: info , component_portals: component_portals , set_portals: set_portals , react_template: react_template }) {
85
- const solid_container = document.createElement("div");
86
- const react_has_rendered = new Promise((r)=>{
87
- const m_o = new MutationObserver(()=>{
88
- m_o.disconnect();
89
- r();
90
- });
91
- m_o.observe(solid_container, {
92
- childList: true
93
- });
94
- });
95
- const is_placeholder = info.rendering_options.type === "placeholder";
96
- const reactProductCard = (0, $4GYXz$reactjsxruntime.jsx)(react_template, {
97
- display: is_placeholder ? null : display
98
- });
99
- const portal = $4GYXz$reactdom.createPortal(reactProductCard, solid_container);
100
- component_portals.add(portal);
101
- set_portals([
102
- ...component_portals
103
- ]);
104
- (0, $4GYXz$solidjs.onCleanup)(()=>{
105
- // this will stop working after any await so be careful to not await before this, or you'll have to carry the owner over with getOwner and runWithOwner
106
- component_portals.delete(portal);
107
- set_portals([
108
- ...component_portals
109
- ]);
110
- });
111
- await react_has_rendered; // wait for react to have finish portaling the elements so that the placeholders get removed once we have an actual result and so that the PLP code knows it has a placeholder when this is a placeholder rendering
112
- return [
113
- solid_container
114
- ];
115
- }
116
-
117
-
118
-
119
-
120
- function $03c714523ff406fc$export$4c0fa313cf50c4ad() {
121
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(()=>(0, $4GYXz$depictaiui.SearchField)({
122
- depict_search: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search
123
- })), {});
124
- }
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
- let $6319748b4f0426f0$var$set = false;
133
- let $6319748b4f0426f0$var$padding_animation;
134
- function $6319748b4f0426f0$export$6453cbc34515a94d(is_search_page) {
135
- if ($6319748b4f0426f0$var$set) return; // Just being safe
136
- $6319748b4f0426f0$var$set = true;
137
- let should_use_old_scroll = false;
138
- const old_scrollTo = window.scrollTo;
139
- window.scrollTo = (...args)=>{
140
- if (should_use_old_scroll || process.env.__NEXT_SCROLL_RESTORATION || !is_search_page(location)) return Reflect.apply(old_scrollTo, window, args);
141
- else should_use_old_scroll = true;
142
- };
143
- addEventListener("popstate", (0, $4GYXz$depictaiutilishared.catchify)(()=>{
144
- if (!is_search_page(location)) {
145
- $6319748b4f0426f0$var$removeLotsOfPadding(); // Just making sure
146
- return;
147
- }
148
- should_use_old_scroll = false;
149
- $6319748b4f0426f0$var$addLotsOfPadding();
150
- (0, $4GYXz$depictaiutilishared.observer).wait_for_element(".depict.plp .listing-page").then(()=>{
151
- $6319748b4f0426f0$var$removeLotsOfPadding();
152
- });
153
- }));
154
- (0, $4GYXz$depictaiutilishared.history_replacer)(()=>{
155
- (0, $4GYXz$depictaiutilishared.queueMacroTask)(()=>{
156
- $6319748b4f0426f0$var$removeLotsOfPadding();
157
- });
158
- }, false);
159
- window?.next?.router?.events?.on("routeChangeStart", ()=>{
160
- $6319748b4f0426f0$var$addLotsOfPadding();
161
- });
162
- }
163
- /*
164
- Here we want to be able to add padding that *definitely* gets applied and then be able to revert precisely to what was before.
165
- 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.
166
- */ function $6319748b4f0426f0$var$addLotsOfPadding() {
167
- if ($6319748b4f0426f0$var$padding_animation) return; // We're already showing a bunch of padding
168
- $6319748b4f0426f0$var$padding_animation = document.body.animate({
169
- paddingBottom: (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px",
170
- offset: 0
171
- }, 1);
172
- $6319748b4f0426f0$var$padding_animation.pause();
173
- }
174
- function $6319748b4f0426f0$var$removeLotsOfPadding() {
175
- if ($6319748b4f0426f0$var$padding_animation) {
176
- $6319748b4f0426f0$var$padding_animation.play();
177
- $6319748b4f0426f0$var$padding_animation = undefined;
178
- }
179
- }
180
-
181
-
182
-
183
-
184
- const $bc389476eeb2b615$export$599d4515591ef232 = (href)=>{
185
- const shallow = (0, $b4d0d98857ed9934$export$92a8f8b3c630fa0d)(location);
186
- window.next.router.push(href, undefined, {
187
- shallow: shallow,
188
- scroll: true
189
- });
190
- };
191
-
192
-
193
-
194
- function $24b00503eef73528$export$9fac37a9c21c2f3b(props) {
195
- const { children: children , navigateFunction: navigateFunction , market: market , merchant: merchant , locale: locale } = props;
196
- const usedLocale = locale ?? (0, $4GYXz$depictaiuilocales.en);
197
- const { searchPagePath: searchPagePath , urlParamName: urlParamName , enableCategorySuggestions: enableCategorySuggestions } = props.search ?? {};
198
- if (!market || !merchant) {
199
- (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[1](false);
200
- return (0, $4GYXz$react.createElement)((0, $4GYXz$react.Fragment), null, children);
201
- }
202
- try {
203
- const { search: search , category: category } = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e);
204
- const [get_search_page_path, set_search_page_path] = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_;
205
- set_search_page_path(searchPagePath);
206
- const on_navigation = typeof window?.next?.router !== "undefined" || navigateFunction ? (new_href)=>{
207
- if (navigateFunction) navigateFunction(new_href);
208
- else (0, $bc389476eeb2b615$export$599d4515591ef232)(new_href);
209
- } : undefined;
210
- if (!search) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
211
- search_query_url_param_name: urlParamName,
212
- market: market,
213
- merchant: merchant,
214
- enable_category_suggestions: enableCategorySuggestions ?? false,
215
- // default category suggestions to false for @depict-ai/react-ui (https://linear.app/depictai/issue/FRO-401/default-enablecategorysuggestions-to-false)
216
- localization: usedLocale,
217
- url_transformer: (url)=>url.pathname = (0, $4GYXz$solidjs.untrack)(get_search_page_path),
218
- on_navigation: on_navigation
219
- }));
220
- else {
221
- search.market = market;
222
- search.merchant = merchant;
223
- search.localization = usedLocale;
224
- }
225
- if (!category) (0, $4GYXz$solidjs.createRoot)(()=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category = new (0, $4GYXz$depictaiui.DepictCategory)({
226
- market: market,
227
- merchant: merchant,
228
- localization: usedLocale,
229
- on_navigation: on_navigation
230
- }));
231
- else {
232
- category.market = market;
233
- category.merchant = merchant;
234
- category.localization = usedLocale;
235
- }
236
- (0, $6319748b4f0426f0$export$6453cbc34515a94d)((0, $b4d0d98857ed9934$export$92a8f8b3c630fa0d));
237
- (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[1](true);
238
- } catch (e) {
239
- // Make sure to not break the users app if we throw
240
- queueMicrotask(()=>{
241
- throw e;
242
- });
243
- }
244
- return (0, $4GYXz$react.createElement)((0, $4GYXz$react.Fragment), null, children);
245
- }
246
-
247
-
248
-
249
- const $d96434e62e08087d$export$3f4580d6398c5027 = /*#__PURE__*/ (0, $4GYXz$react.forwardRef)((_, ref)=>{
250
- return /*#__PURE__*/ (0, $4GYXz$react.createElement)("div", {
251
- className: "depict aligner",
252
- style: {
253
- height: "100%"
254
- },
255
- ref: ref
256
- });
257
- });
258
-
259
-
260
-
261
-
262
-
263
-
264
- function $7ad7a3d0011b7b1b$export$210723f5a54a7028(props) {
265
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($7ad7a3d0011b7b1b$var$SolidSearchPage), props);
266
- }
267
- function $7ad7a3d0011b7b1b$var$SolidSearchPage(props, set_portals) {
268
- const depict_search = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search;
269
- if (!depict_search) throw Error("No depict_search instance when rendering SearchPage. Did you forget to wrap your app in DepictProvider?");
270
- const search_query_updating_blocked_signal = (0, $4GYXz$depictaiui.get_search_query_updating_blocked_signal)(depict_search);
271
- if (!search_query_updating_blocked_signal) throw Error("No search_query_updating_blocked_signal when rendering SearchPage");
272
- const [, set_search_query_updating_blocked_signal] = search_query_updating_blocked_signal;
273
- const update_updating_blocked_signal = ()=>{
274
- set_search_query_updating_blocked_signal(!(0, $b4d0d98857ed9934$export$775e6b3892b5ad52)(location));
275
- };
276
- // 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
277
- (0, $b4d0d98857ed9934$export$74f3924c5027fe1d)(update_updating_blocked_signal); // if we navigate, re-check
278
- (0, $4GYXz$solidjs.createComputed)(()=>{
279
- (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_[0](); // if react defined path changes, re-check
280
- update_updating_blocked_signal();
281
- });
282
- const component_portals = new Set();
283
- return (0, $4GYXz$depictaiui.SearchPage)({
284
- // Default config goes here
285
- include_input_field: props.includeInputField ?? true,
286
- cols_at_size: props.columnsAtSize ?? [
287
- [
288
- 4
289
- ],
290
- [
291
- 3,
292
- 1024
293
- ],
294
- [
295
- 2,
296
- 901
297
- ]
298
- ],
299
- grid_spacing: props.gridSpacing ?? "2%",
300
- // Todo: Do we need this?
301
- get_product_id: ()=>"",
302
- depict_search: depict_search,
303
- product_card_template: (display, info)=>(0, $b4d0d98857ed9934$export$79c79419c1ef0081)({
304
- display: display,
305
- info: info,
306
- react_template: props.productCard,
307
- component_portals: component_portals,
308
- set_portals: set_portals
309
- })
310
- });
311
- }
312
-
313
-
314
-
315
-
316
-
317
-
318
- let $5aa5fcb9f8a2bebc$var$render_cb;
319
- function $5aa5fcb9f8a2bebc$export$d87c61cecb2edf0d(props) {
320
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($5aa5fcb9f8a2bebc$var$SolidCategoryPage), props, "div", {}, (props)=>$5aa5fcb9f8a2bebc$var$render_cb?.(props));
321
- }
322
- function $5aa5fcb9f8a2bebc$var$SolidCategoryPage(props, set_portals) {
323
- const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
324
- if (!depict_category) throw Error("No depict_category instance when rendering SearchPage. Did you forget to wrap your app in DepictProvider?");
325
- const [category_state_set, set_category_state_set] = (0, $4GYXz$solidjs.createSignal)(false);
326
- $5aa5fcb9f8a2bebc$var$render_cb = (props)=>{
327
- depict_category.category_id = props.categoryId;
328
- (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category_path = location.pathname;
329
- if (props.categoryId) set_category_state_set(true);
330
- };
331
- $5aa5fcb9f8a2bebc$var$render_cb(props);
332
- const component_portals = new Set();
333
- const category = ()=>(0, $4GYXz$depictaiui.CategoryPage)({
334
- depict_category: depict_category,
335
- cols_at_size: props.columnsAtSize ?? [
336
- [
337
- 4
338
- ],
339
- [
340
- 3,
341
- 1024
342
- ],
343
- [
344
- 2,
345
- 901
346
- ]
347
- ],
348
- grid_spacing: props.gridSpacing ?? "2%",
349
- get_product_id: ()=>"",
350
- category_title: props.categoryTitlePlugin || (0, $4GYXz$depictaiui.CategoryTitle),
351
- show_breadcrumbs: props.showBreadcrumbs === undefined ? true : props.showBreadcrumbs,
352
- show_quicklinks: props.showQuicklinks === undefined ? true : props.showQuicklinks,
353
- product_card_template: (display, info)=>(0, $b4d0d98857ed9934$export$79c79419c1ef0081)({
354
- display: display,
355
- info: info,
356
- react_template: props.productCard,
357
- component_portals: component_portals,
358
- set_portals: set_portals
359
- })
360
- });
361
- return (0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(category, category_state_set);
362
- }
363
-
364
-
365
-
366
-
367
-
368
- function $d88e98b11c182b8e$export$5646050d516e06bc() {
369
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($d88e98b11c182b8e$var$vanilla_breadcrumbs), {});
370
- }
371
- function $d88e98b11c182b8e$var$vanilla_breadcrumbs() {
372
- const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
373
- if (!depict_category) throw Error("No depict_category instance when rendering BreadCrumbs. Did you forget to wrap your app in DepictProvider?");
374
- return (0, $4GYXz$depictaiui.BreadCrumbs)({
375
- depict_category: depict_category
376
- });
377
- }
378
-
379
-
380
-
381
-
382
-
383
- function $f16af0e861aff3d0$export$466cdc317043f6cb() {
384
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($f16af0e861aff3d0$var$vanilla_quick_links), {});
385
- }
386
- function $f16af0e861aff3d0$var$vanilla_quick_links() {
387
- const depict_category = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).category;
388
- if (!depict_category) throw Error("No depict_category instance when rendering QuickLinks. Did you forget to wrap your app in DepictProvider?");
389
- return (0, $4GYXz$depictaiui.QuickLinks)({
390
- depict_category: depict_category
391
- });
392
- }
393
-
394
-
395
-
396
-
397
- const $df522c8a81ed5a01$export$3f37af283f8fb843 = ({ aspectRatio: aspectRatio })=>{
398
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)(()=>(0, $4GYXz$depictaiutilishared.ContainedPlaceholderImage)({
399
- aspect_ratio: aspectRatio
400
- }), {}, "div", {
401
- "height": "100%"
402
- });
403
- };
404
-
405
-
406
-
407
-
408
- const $7c8b440edc188ad5$export$89c6019e4baa40b1 = ({ width: width , height: height })=>{
409
- return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)(()=>(0, $4GYXz$depictaiutilishared.Placeholder)({
410
- width: width,
411
- height: height
412
- }), {}, "div", {
413
- "height": "100%"
414
- });
415
- };
416
-
417
-
418
-
419
-
420
-
421
-
422
-
423
-
424
- const $ef7db890e488d4f4$export$d69d8daa20eae175 = (createOpenModalParams)=>{
425
- const { globalState: globalState , location: location , alignerRef: alignerRef } = createOpenModalParams;
426
- const openModal = ()=>{
427
- const headerAligner = alignerRef?.current;
428
- if (!globalState.search) throw new Error("No active search in the app!");
429
- if (!headerAligner && location === "aligned") throw new Error("No active search header aligner on the page!");
430
- const alignment_height = headerAligner?.clientHeight;
431
- if (location !== "aligned" || isNaN(alignment_height)) {
432
- // Open centered modal
433
- globalState.search.modal_open = true;
434
- return;
435
- }
436
- const style_element = document.createElement("style");
437
- document.head.append(style_element);
438
- const resize_observer = new ResizeObserver((0, $4GYXz$depictaiutilishared.catchify)(()=>{
439
- const styles = (0, $4GYXz$depictaiui.styles_to_valid_css_string)({
440
- ".depict.plp .depict-search-modal .query-input": {
441
- "height": `${headerAligner?.clientHeight}px`
442
- }
443
- });
444
- style_element.replaceChildren(styles);
445
- }));
446
- resize_observer.observe(headerAligner);
447
- let dispose_aligner;
448
- /**
449
- * Setting position to fixed is important to make the modal work with align_field.
450
- */ const style_props_ = (0, $4GYXz$solidjs.createSignal)({
451
- position: "fixed"
452
- });
453
- (0, $4GYXz$solidjs.createRoot)((dispose)=>{
454
- dispose_aligner = ()=>{
455
- resize_observer.disconnect();
456
- style_element.remove();
457
- dispose();
458
- };
459
- (0, $4GYXz$depictaiui.align_field)(style_props_, headerAligner, undefined, false, "top");
460
- });
461
- globalState.search.modal_open = [
462
- {
463
- style_props_: style_props_
464
- },
465
- dispose_aligner
466
- ];
467
- };
468
- return openModal;
469
- };
470
-
471
-
472
- function $3647cad61d03b89c$export$cc1e9aaf280afdcb(params) {
473
- const open = (0, $ef7db890e488d4f4$export$d69d8daa20eae175)({
474
- globalState: $0b7cd4fb39fc3502$export$8e769ad4338a911e,
475
- ...params
476
- });
477
- return {
478
- open: open
479
- };
480
- }
481
-
482
-
483
-
484
-
485
-
486
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.59";
487
-
488
-
489
-
490
-
491
- const $e387bd534de10acd$export$804fac5697cfbe35 = (router)=>(href)=>{
492
- const shallow = (0, $b4d0d98857ed9934$export$92a8f8b3c630fa0d)(location);
493
- router.push(href, undefined, {
494
- shallow: shallow,
495
- scroll: true
496
- });
497
- };
498
-
499
-
500
- /**
501
- * Helper function that creates a function that can be used as the
502
- * navigateFunction callback for DepictProvider when using react-router.
503
- *
504
- * React-router expect relative URLs, so this function will strip the
505
- * protocol, hostname and port from the URL.
506
- *
507
- * @param navigateFunction what useNavigate() returns
508
- * @returns a function that can be used as the navigateFunction callback for DepictProvider
509
- */ const $201a023b63de7d2f$export$d53481656a62aebe = (navigateFunction)=>(href)=>{
510
- const url_object = new URL(href);
511
- return navigateFunction(url_object.pathname + url_object.search + url_object.hash);
512
- };
513
-
514
-
515
- const $b742053c966024b4$export$b8a61e5c71402559 = {
516
- nextRouterNavigation: $e387bd534de10acd$export$804fac5697cfbe35,
517
- reactRouterNavigation: $201a023b63de7d2f$export$d53481656a62aebe
518
- };
519
-
520
-
521
- const $b03e4eee8610ebbe$var$package_name = "@depict-ai/react-ui";
522
- (0, $4GYXz$depictaiutilishared.dlog)($b03e4eee8610ebbe$var$package_name + " version", (0, $db7b67857900028b$export$83d89fbfd8236492));
523
- (0, $4GYXz$depictaiui.add_to_version_info)({
524
- [$b03e4eee8610ebbe$var$package_name]: (0, $db7b67857900028b$export$83d89fbfd8236492)
525
- });
526
-
527
-