@depict-ai/react-ui 0.0.17 → 0.0.18

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 CHANGED
@@ -1,14 +1,21 @@
1
1
  import { PropsWithChildren, ReactNode } from "react";
2
+ import { SDKColsAtSize, SDKGridSpacing } from "@depict-ai/ui";
2
3
  import { Display } from "@depict-ai/utilishared";
4
+ export function DepictSearchField(): any;
3
5
  interface SearchConfig {
4
6
  merchant: string;
5
7
  market: string;
6
8
  search_page_path: string;
9
+ url_param_name?: string;
10
+ enable_category_suggestions?: boolean;
7
11
  }
8
12
  export function DepictProvider(props: PropsWithChildren<SearchConfig>): PropsWithChildren<SearchConfig>;
9
13
  export function DepictSearchHeader(): any;
10
14
  export function openModal(): void;
11
- export interface SearchPageConfig {
12
- productCardFactory: (display: Display) => ReactNode;
15
+ interface SearchPageConfig {
16
+ productCard: (display: Display) => ReactNode;
17
+ columnsAtSize?: SDKColsAtSize;
18
+ gridSpacing?: SDKGridSpacing;
19
+ includeInputField?: boolean;
13
20
  }
14
21
  export function DepictSearchPage(opts: SearchPageConfig): any;
package/dist/main.js CHANGED
@@ -1,58 +1,86 @@
1
- var $1pn1h$reactdom = require("react-dom");
2
- var $1pn1h$depictaireactsolidbridge = require("@depict-ai/react-solid-bridge");
3
- var $1pn1h$react = require("react");
4
- var $1pn1h$depictaiui = require("@depict-ai/ui");
5
- var $1pn1h$reactjsxruntime = require("react/jsx-runtime");
6
- var $1pn1h$solidjs = require("solid-js");
7
- var $1pn1h$depictaiutilishared = require("@depict-ai/utilishared");
1
+ var $4GYXz$depictaiui = require("@depict-ai/ui");
2
+ var $4GYXz$depictaiutilishared = require("@depict-ai/utilishared");
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
8
 
9
9
  function $parcel$export(e, n, v, s) {
10
10
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
11
11
  }
12
12
 
13
- $parcel$export(module.exports, "DepictSearchPage", () => $7c7f5a6b750dca70$export$210723f5a54a7028);
13
+ $parcel$export(module.exports, "DepictSearchField", () => $a48f3b1a4abf2e0c$export$d2c02478244f91f7);
14
14
  $parcel$export(module.exports, "DepictProvider", () => $18b830ef84ac138a$export$9fac37a9c21c2f3b);
15
15
  $parcel$export(module.exports, "openModal", () => $20bf907adee775ba$export$a7f6cffb6b8ba11c);
16
16
  $parcel$export(module.exports, "DepictSearchHeader", () => $20bf907adee775ba$export$cbcd1ecdb41b1d0a);
17
+ $parcel$export(module.exports, "DepictSearchPage", () => $a6bedbe4b4d6d027$export$210723f5a54a7028);
18
+ // This is where the actual source of your React stuff should live
19
+ // Note, if you add an export here, also add one in src-server/main.ts
17
20
 
18
21
 
19
-
20
-
21
-
22
- const $e589c49931886c97$export$8e769ad4338a911e = {
22
+ const $0b7cd4fb39fc3502$export$8e769ad4338a911e = {
23
23
  search: null,
24
- header_alignment: null
24
+ header_alignment: null,
25
+ search_page_path_: (0, $4GYXz$solidjs.createSignal)(),
26
+ required_state_set_: (0, $4GYXz$solidjs.createSignal)(false)
25
27
  };
26
28
 
27
29
 
28
30
 
29
31
 
30
32
 
31
- function $b4d0d98857ed9934$export$5cae361ad82dce8b(value) {
32
- const ref = (0, $1pn1h$react.useRef)();
33
- (0, $1pn1h$react.useEffect)(()=>{
34
- ref.current = value;
35
- }, [
36
- value
37
- ]);
38
- return ref.current;
39
- }
33
+
40
34
  let $b4d0d98857ed9934$var$run_on_href_change;
41
35
  function $b4d0d98857ed9934$export$74f3924c5027fe1d(cb) {
42
36
  $b4d0d98857ed9934$var$run_on_href_change = cb;
43
37
  }
44
38
  (async ()=>{
45
- for await (const href of (0, $1pn1h$depictaiutilishared.href_change_ipns))$b4d0d98857ed9934$var$run_on_href_change?.(href);
39
+ for await (const href of (0, $4GYXz$depictaiutilishared.href_change_ipns))$b4d0d98857ed9934$var$run_on_href_change?.(href);
46
40
  })();
41
+ const $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43 = (url)=>url.pathname == (0, $4GYXz$solidjs.untrack)((0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_[0]); // might have changed therefore get it from globalState
42
+ function $b4d0d98857ed9934$export$f6e64e17bd69eeef(solid_component, props) {
43
+ const [portals, set_portals] = (0, $4GYXz$react.useState)([]);
44
+ const element_ref = (0, $4GYXz$react.useRef)();
45
+ (0, $4GYXz$react.useEffect)(()=>{
46
+ const div_element = element_ref.current;
47
+ const dispose = (0, $4GYXz$solidjsweb.render)(()=>solid_component(props, set_portals), div_element);
48
+ return dispose;
49
+ }, []);
50
+ return (0, $4GYXz$reactjsxruntime.jsx)("div", {
51
+ ref: element_ref,
52
+ children: portals
53
+ });
54
+ }
55
+ function $b4d0d98857ed9934$export$e5139bbbb9a05035(component) {
56
+ return (...args)=>{
57
+ return (0, $4GYXz$solidjs.createComponent)((0, $4GYXz$solidjs.Show), {
58
+ get when () {
59
+ return (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[0]();
60
+ },
61
+ get children () {
62
+ return component(...args);
63
+ }
64
+ });
65
+ };
66
+ }
67
+
68
+
47
69
 
48
70
 
71
+ function $a48f3b1a4abf2e0c$export$d2c02478244f91f7() {
72
+ return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)(()=>(0, $4GYXz$depictaiui.SearchField)({
73
+ depict_search: (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search
74
+ })), {});
75
+ }
76
+
49
77
 
50
78
 
51
79
 
52
- let $80a9072c96ebf849$var$set = false;
53
- function $80a9072c96ebf849$export$6453cbc34515a94d(is_search_page) {
54
- if ($80a9072c96ebf849$var$set) return; // Just being safe
55
- $80a9072c96ebf849$var$set = true;
80
+ let $6319748b4f0426f0$var$set = false;
81
+ function $6319748b4f0426f0$export$6453cbc34515a94d(is_search_page) {
82
+ if ($6319748b4f0426f0$var$set) return; // Just being safe
83
+ $6319748b4f0426f0$var$set = true;
56
84
  let should_use_old_scroll = false;
57
85
  const old_scrollTo = window.scrollTo;
58
86
  window.scrollTo = (...args)=>{
@@ -61,75 +89,68 @@ function $80a9072c96ebf849$export$6453cbc34515a94d(is_search_page) {
61
89
  };
62
90
  addEventListener("popstate", (e)=>{
63
91
  if (!is_search_page(location)) {
64
- $80a9072c96ebf849$var$removeLotsOfPadding(); // Just making sure
92
+ $6319748b4f0426f0$var$removeLotsOfPadding(); // Just making sure
65
93
  return;
66
94
  }
67
95
  should_use_old_scroll = false;
68
- $80a9072c96ebf849$var$addLotsOfPadding();
69
- (0, $1pn1h$depictaiutilishared.observer).wait_for_element(".depict.plp .listing-page").then(()=>{
70
- $80a9072c96ebf849$var$removeLotsOfPadding();
96
+ $6319748b4f0426f0$var$addLotsOfPadding();
97
+ (0, $4GYXz$depictaiutilishared.observer).wait_for_element(".depict.plp .listing-page").then(()=>{
98
+ $6319748b4f0426f0$var$removeLotsOfPadding();
71
99
  });
72
100
  });
73
- (0, $1pn1h$depictaiutilishared.history_replacer)(()=>{
74
- (0, $1pn1h$depictaiutilishared.queueMacroTask)(()=>{
75
- $80a9072c96ebf849$var$removeLotsOfPadding();
101
+ (0, $4GYXz$depictaiutilishared.history_replacer)(()=>{
102
+ (0, $4GYXz$depictaiutilishared.queueMacroTask)(()=>{
103
+ $6319748b4f0426f0$var$removeLotsOfPadding();
76
104
  });
77
105
  }, false);
78
106
  window?.next?.router?.events?.on("routeChangeStart", ()=>{
79
- $80a9072c96ebf849$var$addLotsOfPadding();
107
+ $6319748b4f0426f0$var$addLotsOfPadding();
80
108
  });
81
109
  }
82
- function $80a9072c96ebf849$var$addLotsOfPadding() {
110
+ // TODO: Make these animations so they don't collide with whatever padding is already on the body
111
+ function $6319748b4f0426f0$var$addLotsOfPadding() {
83
112
  document.body.style.paddingBottom = (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px";
84
113
  }
85
- function $80a9072c96ebf849$var$removeLotsOfPadding() {
114
+ function $6319748b4f0426f0$var$removeLotsOfPadding() {
86
115
  document.body.style.paddingBottom = "";
87
116
  }
88
117
 
89
118
 
90
- const $7b6eabbde6829606$export$99ae278b8f3607a0 = (opts)=>{
91
- const path = "/search";
92
- const param = "q";
93
- const is_page_ = (url)=>url.pathname == path;
94
- const search = new (0, $1pn1h$depictaiui.DepictSearch)({
95
- search_query_url_param_name: param,
96
- merchant: opts.merchant,
97
- market: opts.market,
98
- enable_category_suggestions: false,
99
- localization: {
100
- ...(0, $1pn1h$depictaiui.swedish_search_translation),
101
- price_formatting_: {
102
- pre_: "€ ",
103
- post_: "",
104
- decimal_places_delimiter_: ",",
105
- thousands_delimiter_: " ",
106
- places_after_comma_: 2
107
- }
108
- },
109
- on_navigation: (new_href)=>{
110
- const shallow = is_page_(location);
111
- window.next.router.push(new_href, undefined, {
112
- shallow: shallow,
113
- scroll: true
114
- });
115
- },
116
- url_transformer: (url)=>{
117
- url.pathname = path;
118
- }
119
- });
120
- (0, $80a9072c96ebf849$export$6453cbc34515a94d)(is_page_);
121
- return search;
122
- };
119
+
123
120
 
124
121
 
125
122
  function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
126
- const { children: children , search_page_path: search_page_path , ...assignable_options } = props;
127
- const { search: search } = (0, $e589c49931886c97$export$8e769ad4338a911e);
128
- if (!search) // Todo: use search_page_path for navigation
129
- (0, $e589c49931886c97$export$8e769ad4338a911e).search = (0, $7b6eabbde6829606$export$99ae278b8f3607a0)({
130
- ...assignable_options
131
- });
132
- else Object.assign(search, assignable_options);
123
+ const { children: children , search_page_path: search_page_path , url_param_name: url_param_name , ...assignable_options } = props;
124
+ const { search: search } = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e);
125
+ const [get_search_page_path, set_search_page_path] = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_;
126
+ set_search_page_path(search_page_path);
127
+ if (!search) {
128
+ (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
129
+ search_query_url_param_name: props.url_param_name,
130
+ ...assignable_options,
131
+ enable_category_suggestions: false,
132
+ localization: {
133
+ ...(0, $4GYXz$depictaiui.swedish_search_translation),
134
+ price_formatting_: {
135
+ pre_: "€ ",
136
+ post_: "",
137
+ decimal_places_delimiter_: ",",
138
+ thousands_delimiter_: " ",
139
+ places_after_comma_: 2
140
+ }
141
+ },
142
+ on_navigation: (new_href)=>{
143
+ const shallow = (0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43)(location);
144
+ window.next.router.push(new_href, undefined, {
145
+ shallow: shallow,
146
+ scroll: true
147
+ });
148
+ },
149
+ url_transformer: (url)=>url.pathname = (0, $4GYXz$solidjs.untrack)(get_search_page_path)
150
+ });
151
+ (0, $6319748b4f0426f0$export$6453cbc34515a94d)((0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43));
152
+ } else Object.assign(search, assignable_options);
153
+ if (props.market && props.merchant) (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[1](true);
133
154
  return children;
134
155
  }
135
156
 
@@ -141,38 +162,38 @@ function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
141
162
 
142
163
 
143
164
  function $20bf907adee775ba$export$cbcd1ecdb41b1d0a() {
144
- return (0, $1pn1h$react.createElement)("div", {
165
+ return (0, $4GYXz$react.createElement)("div", {
145
166
  className: "depict aligner",
146
- ref: (e)=>(0, $e589c49931886c97$export$8e769ad4338a911e).header_alignment = e
167
+ ref: (e)=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment = e
147
168
  });
148
169
  }
149
170
  let $20bf907adee775ba$var$sheet;
150
171
  function $20bf907adee775ba$export$a7f6cffb6b8ba11c() {
151
- if (!(0, $e589c49931886c97$export$8e769ad4338a911e).search) {
172
+ if (!(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search) {
152
173
  console.error("No active search in the app!");
153
174
  return;
154
175
  }
155
- if (!(0, $e589c49931886c97$export$8e769ad4338a911e).header_alignment) {
176
+ if (!(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment) {
156
177
  console.error("No active search header aligner on the page!");
157
178
  return;
158
179
  }
159
- const style_props_ = (0, $1pn1h$solidjs.createSignal)({
180
+ const style_props_ = (0, $4GYXz$solidjs.createSignal)({
160
181
  position: "fixed",
161
182
  top: 0
162
183
  });
163
- if ((0, $e589c49931886c97$export$8e769ad4338a911e).header_alignment?.clientHeight) {
164
- let styles = `.depict.plp.in_header .depict-search-modal .query_input { height: ${(0, $e589c49931886c97$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
165
- styles += `.depict.plp.in_header .depict-search-modal-backdrop { top: ${(0, $e589c49931886c97$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
184
+ if ((0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment?.clientHeight) {
185
+ let styles = `.depict.plp.in_header .depict-search-modal .query_input { height: ${(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
186
+ styles += `.depict.plp.in_header .depict-search-modal-backdrop { top: ${(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
166
187
  if (!$20bf907adee775ba$var$sheet) {
167
188
  const style = document.createElement("style");
168
189
  style.append(styles);
169
190
  document.head.appendChild(style);
170
191
  }
171
192
  }
172
- const class_list_ = (0, $1pn1h$solidjs.createMemo)(()=>({
193
+ const class_list_ = (0, $4GYXz$solidjs.createMemo)(()=>({
173
194
  in_header: true
174
195
  }));
175
- (0, $e589c49931886c97$export$8e769ad4338a911e).search.modal_open = [
196
+ (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search.modal_open = [
176
197
  {
177
198
  style_props_: style_props_,
178
199
  class_list_: class_list_
@@ -181,13 +202,52 @@ function $20bf907adee775ba$export$a7f6cffb6b8ba11c() {
181
202
  }
182
203
 
183
204
 
184
- let $7c7f5a6b750dca70$var$active_render_card;
185
- function $7c7f5a6b750dca70$var$DepictSearchPageContent(opts) {
186
- const [bridge, setBridge] = (0, $1pn1h$react.useState)(null);
187
- const [portals, set_portals] = (0, $1pn1h$react.useState)([]);
188
- (0, $1pn1h$react.useEffect)(()=>{
189
- const component_portals = new Set((0, $1pn1h$react.ReactPortal));
190
- $7c7f5a6b750dca70$var$active_render_card = async (display)=>{
205
+
206
+
207
+
208
+
209
+
210
+
211
+ function $a6bedbe4b4d6d027$export$210723f5a54a7028(opts) {
212
+ return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($a6bedbe4b4d6d027$var$SolidSearchPage), opts);
213
+ }
214
+ function $a6bedbe4b4d6d027$var$SolidSearchPage(props, set_portals) {
215
+ const depict_search = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search;
216
+ if (!depict_search) throw Error("No depict_search instance when rendering SearchPage.");
217
+ const search_query_updating_blocked_signal = (0, $4GYXz$depictaiui.get_search_query_updating_blocked_signal)(depict_search);
218
+ if (!search_query_updating_blocked_signal) throw Error("No search_query_updating_blocked_signal when rendering SearchPage");
219
+ const [, set_search_query_updating_blocked_signal] = search_query_updating_blocked_signal;
220
+ const update_updating_blocked_signal = ()=>{
221
+ set_search_query_updating_blocked_signal(!(0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43)(location));
222
+ };
223
+ // 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
224
+ (0, $b4d0d98857ed9934$export$74f3924c5027fe1d)(update_updating_blocked_signal); // if we navigate, re-check
225
+ (0, $4GYXz$solidjs.createComputed)(()=>{
226
+ (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_[0](); // if react defined path changes, re-check
227
+ update_updating_blocked_signal();
228
+ });
229
+ const component_portals = new Set();
230
+ return (0, $4GYXz$depictaiui.SearchPage)({
231
+ // Default config goes here
232
+ include_input_field: props.includeInputField ?? true,
233
+ cols_at_size: props.columnsAtSize ?? [
234
+ [
235
+ 4
236
+ ],
237
+ [
238
+ 3,
239
+ 1024
240
+ ],
241
+ [
242
+ 2,
243
+ 901
244
+ ]
245
+ ],
246
+ grid_spacing: props.gridSpacing ?? "2%",
247
+ // Todo: Do we need this?
248
+ get_product_id: ()=>"",
249
+ depict_search: depict_search,
250
+ product_card_template: async (display)=>{
191
251
  const solid_container = document.createElement("div");
192
252
  const react_has_rendered = new Promise((r)=>{
193
253
  const m_o = new MutationObserver(()=>{
@@ -198,15 +258,15 @@ function $7c7f5a6b750dca70$var$DepictSearchPageContent(opts) {
198
258
  childList: true
199
259
  });
200
260
  });
201
- const reactProductCard = (0, $1pn1h$reactjsxruntime.jsx)(opts.productCardFactory, {
261
+ const reactProductCard = (0, $4GYXz$reactjsxruntime.jsx)(props.productCard, {
202
262
  display: display
203
263
  });
204
- const portal = $1pn1h$reactdom.createPortal(reactProductCard, solid_container);
264
+ const portal = $4GYXz$reactdom.createPortal(reactProductCard, solid_container);
205
265
  component_portals.add(portal);
206
266
  set_portals([
207
267
  ...component_portals
208
268
  ]);
209
- (0, $1pn1h$solidjs.onCleanup)(()=>{
269
+ (0, $4GYXz$solidjs.onCleanup)(()=>{
210
270
  // 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
211
271
  component_portals.delete(portal);
212
272
  set_portals([
@@ -217,58 +277,10 @@ function $7c7f5a6b750dca70$var$DepictSearchPageContent(opts) {
217
277
  return [
218
278
  solid_container
219
279
  ];
220
- };
221
- if (!(0, $e589c49931886c97$export$8e769ad4338a911e).search) throw Error("No search when rendering SearchPage??");
222
- const solidBridge = (0, $1pn1h$reactjsxruntime.jsx)((0, $1pn1h$depictaireactsolidbridge.ReactToSolidBridge), {
223
- solidComponent: ()=>{
224
- const [el, dispose] = (0, $1pn1h$solidjs.createRoot)((dispose)=>{
225
- (0, $b4d0d98857ed9934$export$74f3924c5027fe1d)((href)=>{
226
- // TODO: Will be user specified
227
- if (!new URL(href).pathname.startsWith("/search")) dispose();
228
- });
229
- const el = (0, $1pn1h$depictaiui.SearchPage)({
230
- depict_search: (0, $e589c49931886c97$export$8e769ad4338a911e).search,
231
- include_input_field: true,
232
- cols_at_size: [
233
- [
234
- 4
235
- ],
236
- [
237
- 3,
238
- 1024
239
- ],
240
- [
241
- 2,
242
- 901
243
- ]
244
- ],
245
- grid_spacing: "10px",
246
- product_card_template: (...args)=>$7c7f5a6b750dca70$var$active_render_card(...args),
247
- // function might not exist yet,
248
- get_product_id: ()=>""
249
- });
250
- return [
251
- el,
252
- dispose
253
- ];
254
- });
255
- (0, $1pn1h$solidjs.onCleanup)(dispose);
256
- return el;
257
- },
258
- key: Math.random()
259
- });
260
- setBridge(solidBridge);
261
- }, []);
262
- console.log("Searchpage render", bridge, portals.length);
263
- return bridge ? (0, $1pn1h$react.createElement)("div", {}, [
264
- bridge,
265
- ...portals
266
- ]) : "";
267
- }
268
- function $7c7f5a6b750dca70$export$210723f5a54a7028(opts) {
269
- return (0, $1pn1h$reactjsxruntime.jsx)((0, $1pn1h$depictaireactsolidbridge.ReactToSolidBridgeProvider), {
270
- children: (0, $1pn1h$reactjsxruntime.jsx)($7c7f5a6b750dca70$var$DepictSearchPageContent, opts)
280
+ }
271
281
  });
272
282
  }
273
283
 
274
284
 
285
+
286
+
package/dist/module.js CHANGED
@@ -1,50 +1,77 @@
1
- import {createPortal as $9xHCU$createPortal} from "react-dom";
2
- import {ReactToSolidBridge as $9xHCU$ReactToSolidBridge, ReactToSolidBridgeProvider as $9xHCU$ReactToSolidBridgeProvider} from "@depict-ai/react-solid-bridge";
3
- import {useState as $9xHCU$useState, useEffect as $9xHCU$useEffect, ReactPortal as $9xHCU$ReactPortal, createElement as $9xHCU$createElement, useRef as $9xHCU$useRef} from "react";
4
- import {SearchPage as $9xHCU$SearchPage, DepictSearch as $9xHCU$DepictSearch, swedish_search_translation as $9xHCU$swedish_search_translation} from "@depict-ai/ui";
5
- import {jsx as $9xHCU$jsx} from "react/jsx-runtime";
6
- import {onCleanup as $9xHCU$onCleanup, createRoot as $9xHCU$createRoot, createSignal as $9xHCU$createSignal, createMemo as $9xHCU$createMemo} from "solid-js";
7
- import {href_change_ipns as $9xHCU$href_change_ipns, observer as $9xHCU$observer, history_replacer as $9xHCU$history_replacer, queueMacroTask as $9xHCU$queueMacroTask} from "@depict-ai/utilishared";
1
+ import {SearchField as $TZSbU$SearchField, DepictSearch as $TZSbU$DepictSearch, swedish_search_translation as $TZSbU$swedish_search_translation, get_search_query_updating_blocked_signal as $TZSbU$get_search_query_updating_blocked_signal, SearchPage as $TZSbU$SearchPage} from "@depict-ai/ui";
2
+ import {href_change_ipns as $TZSbU$href_change_ipns, observer as $TZSbU$observer, history_replacer as $TZSbU$history_replacer, queueMacroTask as $TZSbU$queueMacroTask} from "@depict-ai/utilishared";
3
+ import {untrack as $TZSbU$untrack, createComponent as $TZSbU$createComponent, Show as $TZSbU$Show, createSignal as $TZSbU$createSignal, createMemo as $TZSbU$createMemo, createComputed as $TZSbU$createComputed, onCleanup as $TZSbU$onCleanup} from "solid-js";
4
+ 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} from "react";
6
+ import {jsx as $TZSbU$jsx} from "react/jsx-runtime";
7
+ import {createPortal as $TZSbU$createPortal} from "react-dom";
8
8
 
9
+ // This is where the actual source of your React stuff should live
10
+ // Note, if you add an export here, also add one in src-server/main.ts
9
11
 
10
12
 
11
-
12
-
13
-
14
- const $9ce874af9a04465f$export$8e769ad4338a911e = {
13
+ const $42858f023ef23dab$export$8e769ad4338a911e = {
15
14
  search: null,
16
- header_alignment: null
15
+ header_alignment: null,
16
+ search_page_path_: (0, $TZSbU$createSignal)(),
17
+ required_state_set_: (0, $TZSbU$createSignal)(false)
17
18
  };
18
19
 
19
20
 
20
21
 
21
22
 
22
23
 
23
- function $c83ba9ab79386687$export$5cae361ad82dce8b(value) {
24
- const ref = (0, $9xHCU$useRef)();
25
- (0, $9xHCU$useEffect)(()=>{
26
- ref.current = value;
27
- }, [
28
- value
29
- ]);
30
- return ref.current;
31
- }
24
+
32
25
  let $c83ba9ab79386687$var$run_on_href_change;
33
26
  function $c83ba9ab79386687$export$74f3924c5027fe1d(cb) {
34
27
  $c83ba9ab79386687$var$run_on_href_change = cb;
35
28
  }
36
29
  (async ()=>{
37
- for await (const href of (0, $9xHCU$href_change_ipns))$c83ba9ab79386687$var$run_on_href_change?.(href);
30
+ for await (const href of (0, $TZSbU$href_change_ipns))$c83ba9ab79386687$var$run_on_href_change?.(href);
38
31
  })();
32
+ const $c83ba9ab79386687$export$6cb4d3a5c1ac9b43 = (url)=>url.pathname == (0, $TZSbU$untrack)((0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_[0]); // might have changed therefore get it from globalState
33
+ function $c83ba9ab79386687$export$f6e64e17bd69eeef(solid_component, props) {
34
+ const [portals, set_portals] = (0, $TZSbU$useState)([]);
35
+ const element_ref = (0, $TZSbU$useRef)();
36
+ (0, $TZSbU$useEffect)(()=>{
37
+ const div_element = element_ref.current;
38
+ const dispose = (0, $TZSbU$render)(()=>solid_component(props, set_portals), div_element);
39
+ return dispose;
40
+ }, []);
41
+ return (0, $TZSbU$jsx)("div", {
42
+ ref: element_ref,
43
+ children: portals
44
+ });
45
+ }
46
+ function $c83ba9ab79386687$export$e5139bbbb9a05035(component) {
47
+ return (...args)=>{
48
+ return (0, $TZSbU$createComponent)((0, $TZSbU$Show), {
49
+ get when () {
50
+ return (0, $42858f023ef23dab$export$8e769ad4338a911e).required_state_set_[0]();
51
+ },
52
+ get children () {
53
+ return component(...args);
54
+ }
55
+ });
56
+ };
57
+ }
58
+
59
+
39
60
 
40
61
 
62
+ function $54b0d21b77e719c4$export$d2c02478244f91f7() {
63
+ return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)(()=>(0, $TZSbU$SearchField)({
64
+ depict_search: (0, $42858f023ef23dab$export$8e769ad4338a911e).search
65
+ })), {});
66
+ }
67
+
41
68
 
42
69
 
43
70
 
44
- let $01e7216f8f859389$var$set = false;
45
- function $01e7216f8f859389$export$6453cbc34515a94d(is_search_page) {
46
- if ($01e7216f8f859389$var$set) return; // Just being safe
47
- $01e7216f8f859389$var$set = true;
71
+ let $8071251ee4e9ffa1$var$set = false;
72
+ function $8071251ee4e9ffa1$export$6453cbc34515a94d(is_search_page) {
73
+ if ($8071251ee4e9ffa1$var$set) return; // Just being safe
74
+ $8071251ee4e9ffa1$var$set = true;
48
75
  let should_use_old_scroll = false;
49
76
  const old_scrollTo = window.scrollTo;
50
77
  window.scrollTo = (...args)=>{
@@ -53,75 +80,68 @@ function $01e7216f8f859389$export$6453cbc34515a94d(is_search_page) {
53
80
  };
54
81
  addEventListener("popstate", (e)=>{
55
82
  if (!is_search_page(location)) {
56
- $01e7216f8f859389$var$removeLotsOfPadding(); // Just making sure
83
+ $8071251ee4e9ffa1$var$removeLotsOfPadding(); // Just making sure
57
84
  return;
58
85
  }
59
86
  should_use_old_scroll = false;
60
- $01e7216f8f859389$var$addLotsOfPadding();
61
- (0, $9xHCU$observer).wait_for_element(".depict.plp .listing-page").then(()=>{
62
- $01e7216f8f859389$var$removeLotsOfPadding();
87
+ $8071251ee4e9ffa1$var$addLotsOfPadding();
88
+ (0, $TZSbU$observer).wait_for_element(".depict.plp .listing-page").then(()=>{
89
+ $8071251ee4e9ffa1$var$removeLotsOfPadding();
63
90
  });
64
91
  });
65
- (0, $9xHCU$history_replacer)(()=>{
66
- (0, $9xHCU$queueMacroTask)(()=>{
67
- $01e7216f8f859389$var$removeLotsOfPadding();
92
+ (0, $TZSbU$history_replacer)(()=>{
93
+ (0, $TZSbU$queueMacroTask)(()=>{
94
+ $8071251ee4e9ffa1$var$removeLotsOfPadding();
68
95
  });
69
96
  }, false);
70
97
  window?.next?.router?.events?.on("routeChangeStart", ()=>{
71
- $01e7216f8f859389$var$addLotsOfPadding();
98
+ $8071251ee4e9ffa1$var$addLotsOfPadding();
72
99
  });
73
100
  }
74
- function $01e7216f8f859389$var$addLotsOfPadding() {
101
+ // TODO: Make these animations so they don't collide with whatever padding is already on the body
102
+ function $8071251ee4e9ffa1$var$addLotsOfPadding() {
75
103
  document.body.style.paddingBottom = (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px";
76
104
  }
77
- function $01e7216f8f859389$var$removeLotsOfPadding() {
105
+ function $8071251ee4e9ffa1$var$removeLotsOfPadding() {
78
106
  document.body.style.paddingBottom = "";
79
107
  }
80
108
 
81
109
 
82
- const $cd2077d7481df27e$export$99ae278b8f3607a0 = (opts)=>{
83
- const path = "/search";
84
- const param = "q";
85
- const is_page_ = (url)=>url.pathname == path;
86
- const search = new (0, $9xHCU$DepictSearch)({
87
- search_query_url_param_name: param,
88
- merchant: opts.merchant,
89
- market: opts.market,
90
- enable_category_suggestions: false,
91
- localization: {
92
- ...(0, $9xHCU$swedish_search_translation),
93
- price_formatting_: {
94
- pre_: "€ ",
95
- post_: "",
96
- decimal_places_delimiter_: ",",
97
- thousands_delimiter_: " ",
98
- places_after_comma_: 2
99
- }
100
- },
101
- on_navigation: (new_href)=>{
102
- const shallow = is_page_(location);
103
- window.next.router.push(new_href, undefined, {
104
- shallow: shallow,
105
- scroll: true
106
- });
107
- },
108
- url_transformer: (url)=>{
109
- url.pathname = path;
110
- }
111
- });
112
- (0, $01e7216f8f859389$export$6453cbc34515a94d)(is_page_);
113
- return search;
114
- };
110
+
115
111
 
116
112
 
117
113
  function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
118
- const { children: children , search_page_path: search_page_path , ...assignable_options } = props;
119
- const { search: search } = (0, $9ce874af9a04465f$export$8e769ad4338a911e);
120
- if (!search) // Todo: use search_page_path for navigation
121
- (0, $9ce874af9a04465f$export$8e769ad4338a911e).search = (0, $cd2077d7481df27e$export$99ae278b8f3607a0)({
122
- ...assignable_options
123
- });
124
- else Object.assign(search, assignable_options);
114
+ const { children: children , search_page_path: search_page_path , url_param_name: url_param_name , ...assignable_options } = props;
115
+ const { search: search } = (0, $42858f023ef23dab$export$8e769ad4338a911e);
116
+ const [get_search_page_path, set_search_page_path] = (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_;
117
+ set_search_page_path(search_page_path);
118
+ if (!search) {
119
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
120
+ search_query_url_param_name: props.url_param_name,
121
+ ...assignable_options,
122
+ enable_category_suggestions: false,
123
+ localization: {
124
+ ...(0, $TZSbU$swedish_search_translation),
125
+ price_formatting_: {
126
+ pre_: "€ ",
127
+ post_: "",
128
+ decimal_places_delimiter_: ",",
129
+ thousands_delimiter_: " ",
130
+ places_after_comma_: 2
131
+ }
132
+ },
133
+ on_navigation: (new_href)=>{
134
+ const shallow = (0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location);
135
+ window.next.router.push(new_href, undefined, {
136
+ shallow: shallow,
137
+ scroll: true
138
+ });
139
+ },
140
+ url_transformer: (url)=>url.pathname = (0, $TZSbU$untrack)(get_search_page_path)
141
+ });
142
+ (0, $8071251ee4e9ffa1$export$6453cbc34515a94d)((0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43));
143
+ } else Object.assign(search, assignable_options);
144
+ if (props.market && props.merchant) (0, $42858f023ef23dab$export$8e769ad4338a911e).required_state_set_[1](true);
125
145
  return children;
126
146
  }
127
147
 
@@ -133,38 +153,38 @@ function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
133
153
 
134
154
 
135
155
  function $f41a371216eff80b$export$cbcd1ecdb41b1d0a() {
136
- return (0, $9xHCU$createElement)("div", {
156
+ return (0, $TZSbU$createElement)("div", {
137
157
  className: "depict aligner",
138
- ref: (e)=>(0, $9ce874af9a04465f$export$8e769ad4338a911e).header_alignment = e
158
+ ref: (e)=>(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment = e
139
159
  });
140
160
  }
141
161
  let $f41a371216eff80b$var$sheet;
142
162
  function $f41a371216eff80b$export$a7f6cffb6b8ba11c() {
143
- if (!(0, $9ce874af9a04465f$export$8e769ad4338a911e).search) {
163
+ if (!(0, $42858f023ef23dab$export$8e769ad4338a911e).search) {
144
164
  console.error("No active search in the app!");
145
165
  return;
146
166
  }
147
- if (!(0, $9ce874af9a04465f$export$8e769ad4338a911e).header_alignment) {
167
+ if (!(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment) {
148
168
  console.error("No active search header aligner on the page!");
149
169
  return;
150
170
  }
151
- const style_props_ = (0, $9xHCU$createSignal)({
171
+ const style_props_ = (0, $TZSbU$createSignal)({
152
172
  position: "fixed",
153
173
  top: 0
154
174
  });
155
- if ((0, $9ce874af9a04465f$export$8e769ad4338a911e).header_alignment?.clientHeight) {
156
- let styles = `.depict.plp.in_header .depict-search-modal .query_input { height: ${(0, $9ce874af9a04465f$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
157
- styles += `.depict.plp.in_header .depict-search-modal-backdrop { top: ${(0, $9ce874af9a04465f$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
175
+ if ((0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment?.clientHeight) {
176
+ let styles = `.depict.plp.in_header .depict-search-modal .query_input { height: ${(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
177
+ styles += `.depict.plp.in_header .depict-search-modal-backdrop { top: ${(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
158
178
  if (!$f41a371216eff80b$var$sheet) {
159
179
  const style = document.createElement("style");
160
180
  style.append(styles);
161
181
  document.head.appendChild(style);
162
182
  }
163
183
  }
164
- const class_list_ = (0, $9xHCU$createMemo)(()=>({
184
+ const class_list_ = (0, $TZSbU$createMemo)(()=>({
165
185
  in_header: true
166
186
  }));
167
- (0, $9ce874af9a04465f$export$8e769ad4338a911e).search.modal_open = [
187
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).search.modal_open = [
168
188
  {
169
189
  style_props_: style_props_,
170
190
  class_list_: class_list_
@@ -173,13 +193,52 @@ function $f41a371216eff80b$export$a7f6cffb6b8ba11c() {
173
193
  }
174
194
 
175
195
 
176
- let $a854d2a2f2059f57$var$active_render_card;
177
- function $a854d2a2f2059f57$var$DepictSearchPageContent(opts) {
178
- const [bridge, setBridge] = (0, $9xHCU$useState)(null);
179
- const [portals, set_portals] = (0, $9xHCU$useState)([]);
180
- (0, $9xHCU$useEffect)(()=>{
181
- const component_portals = new Set((0, $9xHCU$ReactPortal));
182
- $a854d2a2f2059f57$var$active_render_card = async (display)=>{
196
+
197
+
198
+
199
+
200
+
201
+
202
+ function $9f8d5ef3c016c493$export$210723f5a54a7028(opts) {
203
+ return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($9f8d5ef3c016c493$var$SolidSearchPage), opts);
204
+ }
205
+ function $9f8d5ef3c016c493$var$SolidSearchPage(props, set_portals) {
206
+ const depict_search = (0, $42858f023ef23dab$export$8e769ad4338a911e).search;
207
+ if (!depict_search) throw Error("No depict_search instance when rendering SearchPage.");
208
+ const search_query_updating_blocked_signal = (0, $TZSbU$get_search_query_updating_blocked_signal)(depict_search);
209
+ if (!search_query_updating_blocked_signal) throw Error("No search_query_updating_blocked_signal when rendering SearchPage");
210
+ const [, set_search_query_updating_blocked_signal] = search_query_updating_blocked_signal;
211
+ const update_updating_blocked_signal = ()=>{
212
+ set_search_query_updating_blocked_signal(!(0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location));
213
+ };
214
+ // 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
215
+ (0, $c83ba9ab79386687$export$74f3924c5027fe1d)(update_updating_blocked_signal); // if we navigate, re-check
216
+ (0, $TZSbU$createComputed)(()=>{
217
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_[0](); // if react defined path changes, re-check
218
+ update_updating_blocked_signal();
219
+ });
220
+ const component_portals = new Set();
221
+ return (0, $TZSbU$SearchPage)({
222
+ // Default config goes here
223
+ include_input_field: props.includeInputField ?? true,
224
+ cols_at_size: props.columnsAtSize ?? [
225
+ [
226
+ 4
227
+ ],
228
+ [
229
+ 3,
230
+ 1024
231
+ ],
232
+ [
233
+ 2,
234
+ 901
235
+ ]
236
+ ],
237
+ grid_spacing: props.gridSpacing ?? "2%",
238
+ // Todo: Do we need this?
239
+ get_product_id: ()=>"",
240
+ depict_search: depict_search,
241
+ product_card_template: async (display)=>{
183
242
  const solid_container = document.createElement("div");
184
243
  const react_has_rendered = new Promise((r)=>{
185
244
  const m_o = new MutationObserver(()=>{
@@ -190,15 +249,15 @@ function $a854d2a2f2059f57$var$DepictSearchPageContent(opts) {
190
249
  childList: true
191
250
  });
192
251
  });
193
- const reactProductCard = (0, $9xHCU$jsx)(opts.productCardFactory, {
252
+ const reactProductCard = (0, $TZSbU$jsx)(props.productCard, {
194
253
  display: display
195
254
  });
196
- const portal = $9xHCU$createPortal(reactProductCard, solid_container);
255
+ const portal = $TZSbU$createPortal(reactProductCard, solid_container);
197
256
  component_portals.add(portal);
198
257
  set_portals([
199
258
  ...component_portals
200
259
  ]);
201
- (0, $9xHCU$onCleanup)(()=>{
260
+ (0, $TZSbU$onCleanup)(()=>{
202
261
  // 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
203
262
  component_portals.delete(portal);
204
263
  set_portals([
@@ -209,59 +268,11 @@ function $a854d2a2f2059f57$var$DepictSearchPageContent(opts) {
209
268
  return [
210
269
  solid_container
211
270
  ];
212
- };
213
- if (!(0, $9ce874af9a04465f$export$8e769ad4338a911e).search) throw Error("No search when rendering SearchPage??");
214
- const solidBridge = (0, $9xHCU$jsx)((0, $9xHCU$ReactToSolidBridge), {
215
- solidComponent: ()=>{
216
- const [el, dispose] = (0, $9xHCU$createRoot)((dispose)=>{
217
- (0, $c83ba9ab79386687$export$74f3924c5027fe1d)((href)=>{
218
- // TODO: Will be user specified
219
- if (!new URL(href).pathname.startsWith("/search")) dispose();
220
- });
221
- const el = (0, $9xHCU$SearchPage)({
222
- depict_search: (0, $9ce874af9a04465f$export$8e769ad4338a911e).search,
223
- include_input_field: true,
224
- cols_at_size: [
225
- [
226
- 4
227
- ],
228
- [
229
- 3,
230
- 1024
231
- ],
232
- [
233
- 2,
234
- 901
235
- ]
236
- ],
237
- grid_spacing: "10px",
238
- product_card_template: (...args)=>$a854d2a2f2059f57$var$active_render_card(...args),
239
- // function might not exist yet,
240
- get_product_id: ()=>""
241
- });
242
- return [
243
- el,
244
- dispose
245
- ];
246
- });
247
- (0, $9xHCU$onCleanup)(dispose);
248
- return el;
249
- },
250
- key: Math.random()
251
- });
252
- setBridge(solidBridge);
253
- }, []);
254
- console.log("Searchpage render", bridge, portals.length);
255
- return bridge ? (0, $9xHCU$createElement)("div", {}, [
256
- bridge,
257
- ...portals
258
- ]) : "";
259
- }
260
- function $a854d2a2f2059f57$export$210723f5a54a7028(opts) {
261
- return (0, $9xHCU$jsx)((0, $9xHCU$ReactToSolidBridgeProvider), {
262
- children: (0, $9xHCU$jsx)($a854d2a2f2059f57$var$DepictSearchPageContent, opts)
271
+ }
263
272
  });
264
273
  }
265
274
 
266
275
 
267
- export {$a854d2a2f2059f57$export$210723f5a54a7028 as DepictSearchPage, $faf794495ff8b304$export$9fac37a9c21c2f3b as DepictProvider, $f41a371216eff80b$export$a7f6cffb6b8ba11c as openModal, $f41a371216eff80b$export$cbcd1ecdb41b1d0a as DepictSearchHeader};
276
+
277
+
278
+ export {$54b0d21b77e719c4$export$d2c02478244f91f7 as DepictSearchField, $faf794495ff8b304$export$9fac37a9c21c2f3b as DepictProvider, $f41a371216eff80b$export$a7f6cffb6b8ba11c as openModal, $f41a371216eff80b$export$cbcd1ecdb41b1d0a as DepictSearchHeader, $9f8d5ef3c016c493$export$210723f5a54a7028 as DepictSearchPage};
@@ -1,4 +1,5 @@
1
1
  export function DepictProvider(props: any): any;
2
+ export function DepictSearchField(): any;
2
3
  export function DepictSearchPage(): any;
3
4
  export function DepictSearchHeader(): any;
4
5
  export function openModal(): void;
@@ -1,31 +1,35 @@
1
- var $hWQ57$depictaireactsolidbridge = require("@depict-ai/react-solid-bridge");
2
- var $hWQ57$react = require("react");
3
- var $hWQ57$reactjsxruntime = require("react/jsx-runtime");
1
+ var $5efvh$react = require("react");
2
+ var $5efvh$reactjsxruntime = require("react/jsx-runtime");
4
3
 
5
4
  function $parcel$export(e, n, v, s) {
6
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
7
6
  }
8
7
 
9
- $parcel$export(module.exports, "DepictProvider", () => $4649fffc467a9b4d$export$9fac37a9c21c2f3b);
10
- $parcel$export(module.exports, "DepictSearchPage", () => $4649fffc467a9b4d$export$210723f5a54a7028);
11
- $parcel$export(module.exports, "DepictSearchHeader", () => $4649fffc467a9b4d$export$cbcd1ecdb41b1d0a);
12
- $parcel$export(module.exports, "openModal", () => $4649fffc467a9b4d$export$a7f6cffb6b8ba11c);
8
+ $parcel$export(module.exports, "DepictProvider", () => $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b);
9
+ $parcel$export(module.exports, "DepictSearchField", () => $41e7e5d85b5e0d49$export$4c0fa313cf50c4ad);
10
+ $parcel$export(module.exports, "DepictSearchPage", () => $41e7e5d85b5e0d49$export$210723f5a54a7028);
11
+ $parcel$export(module.exports, "DepictSearchHeader", () => $41e7e5d85b5e0d49$export$cbcd1ecdb41b1d0a);
12
+ $parcel$export(module.exports, "openModal", () => $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c);
13
13
 
14
14
 
15
-
16
- function $4649fffc467a9b4d$export$9fac37a9c21c2f3b(props) {
15
+ function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
17
16
  return props.children;
18
17
  }
19
- function $4649fffc467a9b4d$export$210723f5a54a7028() {
20
- return (0, $hWQ57$reactjsxruntime.jsx)((0, $hWQ57$depictaireactsolidbridge.ReactToSolidBridgeProvider), {
21
- children: ""
18
+ function $41e7e5d85b5e0d49$export$4c0fa313cf50c4ad() {
19
+ return (0, $5efvh$reactjsxruntime.jsx)("div", {
20
+ children: []
21
+ });
22
+ }
23
+ function $41e7e5d85b5e0d49$export$210723f5a54a7028() {
24
+ return (0, $5efvh$reactjsxruntime.jsx)("div", {
25
+ children: []
22
26
  });
23
27
  }
24
- function $4649fffc467a9b4d$export$cbcd1ecdb41b1d0a() {
25
- return (0, $hWQ57$react.createElement)("div", {
28
+ function $41e7e5d85b5e0d49$export$cbcd1ecdb41b1d0a() {
29
+ return (0, $5efvh$react.createElement)("div", {
26
30
  className: "depict aligner"
27
31
  });
28
32
  }
29
- function $4649fffc467a9b4d$export$a7f6cffb6b8ba11c() {}
33
+ function $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c() {}
30
34
 
31
35
 
@@ -1,24 +1,27 @@
1
- import {ReactToSolidBridgeProvider as $guob4$ReactToSolidBridgeProvider} from "@depict-ai/react-solid-bridge";
2
- import {createElement as $guob4$createElement} from "react";
3
- import {jsx as $guob4$jsx} from "react/jsx-runtime";
1
+ import {createElement as $1RlIW$createElement} from "react";
2
+ import {jsx as $1RlIW$jsx} from "react/jsx-runtime";
4
3
 
5
4
 
6
5
 
7
-
8
- function $ca6cbc388a0afba3$export$9fac37a9c21c2f3b(props) {
6
+ function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
9
7
  return props.children;
10
8
  }
11
- function $ca6cbc388a0afba3$export$210723f5a54a7028() {
12
- return (0, $guob4$jsx)((0, $guob4$ReactToSolidBridgeProvider), {
13
- children: ""
9
+ function $2b1fdeb83610500f$export$4c0fa313cf50c4ad() {
10
+ return (0, $1RlIW$jsx)("div", {
11
+ children: []
12
+ });
13
+ }
14
+ function $2b1fdeb83610500f$export$210723f5a54a7028() {
15
+ return (0, $1RlIW$jsx)("div", {
16
+ children: []
14
17
  });
15
18
  }
16
- function $ca6cbc388a0afba3$export$cbcd1ecdb41b1d0a() {
17
- return (0, $guob4$createElement)("div", {
19
+ function $2b1fdeb83610500f$export$cbcd1ecdb41b1d0a() {
20
+ return (0, $1RlIW$createElement)("div", {
18
21
  className: "depict aligner"
19
22
  });
20
23
  }
21
- function $ca6cbc388a0afba3$export$a7f6cffb6b8ba11c() {}
24
+ function $2b1fdeb83610500f$export$a7f6cffb6b8ba11c() {}
22
25
 
23
26
 
24
- export {$ca6cbc388a0afba3$export$9fac37a9c21c2f3b as DepictProvider, $ca6cbc388a0afba3$export$210723f5a54a7028 as DepictSearchPage, $ca6cbc388a0afba3$export$cbcd1ecdb41b1d0a as DepictSearchHeader, $ca6cbc388a0afba3$export$a7f6cffb6b8ba11c as openModal};
27
+ export {$2b1fdeb83610500f$export$9fac37a9c21c2f3b as DepictProvider, $2b1fdeb83610500f$export$4c0fa313cf50c4ad as DepictSearchField, $2b1fdeb83610500f$export$210723f5a54a7028 as DepictSearchPage, $2b1fdeb83610500f$export$cbcd1ecdb41b1d0a as DepictSearchHeader, $2b1fdeb83610500f$export$a7f6cffb6b8ba11c as openModal};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "packageManager": "yarn@3.2.2",
5
- "source": "src/main.ts",
5
+ "source": "src/index.ts",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "scripts": {
11
11
  "clear-dist": "rm -r -f ./dist",
12
12
  "build": "yarn build-server && parcel build --no-source-maps && cp -a src/styles/plp-styling/. dist/styles/",
13
- "build-server": "yarn clear-dist && parcel build --no-source-maps ./src-server/main.ts && cp -r ./dist/ ./dist-server && yarn clear-dist",
13
+ "build-server": "yarn clear-dist && parcel build --no-source-maps ./src-server/index.ts && cp -r ./dist/ ./dist-server && yarn clear-dist",
14
14
  "print-included-package-files": "yarn pack --dry-run",
15
15
  "typecheck": "yarn g:tsc --build tsconfig.json"
16
16
  },
@@ -78,9 +78,8 @@
78
78
  "/dist-server"
79
79
  ],
80
80
  "dependencies": {
81
- "@depict-ai/react-solid-bridge": "^1.0.26",
82
- "@depict-ai/ui": "^0.0.3",
83
- "@depict-ai/utilishared": "^0.0.3",
81
+ "@depict-ai/ui": "^0.0.5",
82
+ "@depict-ai/utilishared": "^0.0.5",
84
83
  "react": "^18.2.0",
85
84
  "react-dom": "^18.2.0",
86
85
  "solid-js": "^1.6.2"
@@ -1 +0,0 @@
1
- body {height: 100%;}