@depict-ai/react-ui 0.0.17 → 0.0.19

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
- export function DepictProvider(props: PropsWithChildren<SearchConfig>): PropsWithChildren<SearchConfig>;
12
+ export function DepictProvider(props: PropsWithChildren<SearchConfig>): any;
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,87 @@
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
+
69
+
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
+ }
47
76
 
48
77
 
49
78
 
50
79
 
51
80
 
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;
81
+ let $6319748b4f0426f0$var$set = false;
82
+ function $6319748b4f0426f0$export$6453cbc34515a94d(is_search_page) {
83
+ if ($6319748b4f0426f0$var$set) return; // Just being safe
84
+ $6319748b4f0426f0$var$set = true;
56
85
  let should_use_old_scroll = false;
57
86
  const old_scrollTo = window.scrollTo;
58
87
  window.scrollTo = (...args)=>{
@@ -61,76 +90,69 @@ function $80a9072c96ebf849$export$6453cbc34515a94d(is_search_page) {
61
90
  };
62
91
  addEventListener("popstate", (e)=>{
63
92
  if (!is_search_page(location)) {
64
- $80a9072c96ebf849$var$removeLotsOfPadding(); // Just making sure
93
+ $6319748b4f0426f0$var$removeLotsOfPadding(); // Just making sure
65
94
  return;
66
95
  }
67
96
  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();
97
+ $6319748b4f0426f0$var$addLotsOfPadding();
98
+ (0, $4GYXz$depictaiutilishared.observer).wait_for_element(".depict.plp .listing-page").then(()=>{
99
+ $6319748b4f0426f0$var$removeLotsOfPadding();
71
100
  });
72
101
  });
73
- (0, $1pn1h$depictaiutilishared.history_replacer)(()=>{
74
- (0, $1pn1h$depictaiutilishared.queueMacroTask)(()=>{
75
- $80a9072c96ebf849$var$removeLotsOfPadding();
102
+ (0, $4GYXz$depictaiutilishared.history_replacer)(()=>{
103
+ (0, $4GYXz$depictaiutilishared.queueMacroTask)(()=>{
104
+ $6319748b4f0426f0$var$removeLotsOfPadding();
76
105
  });
77
106
  }, false);
78
107
  window?.next?.router?.events?.on("routeChangeStart", ()=>{
79
- $80a9072c96ebf849$var$addLotsOfPadding();
108
+ $6319748b4f0426f0$var$addLotsOfPadding();
80
109
  });
81
110
  }
82
- function $80a9072c96ebf849$var$addLotsOfPadding() {
111
+ // TODO: Make these animations so they don't collide with whatever padding is already on the body
112
+ function $6319748b4f0426f0$var$addLotsOfPadding() {
83
113
  document.body.style.paddingBottom = (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px";
84
114
  }
85
- function $80a9072c96ebf849$var$removeLotsOfPadding() {
115
+ function $6319748b4f0426f0$var$removeLotsOfPadding() {
86
116
  document.body.style.paddingBottom = "";
87
117
  }
88
118
 
89
119
 
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
- };
120
+
123
121
 
124
122
 
125
123
  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);
133
- return children;
124
+ const { children: children , search_page_path: search_page_path , url_param_name: url_param_name , ...assignable_options } = props;
125
+ const { search: search } = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e);
126
+ const [get_search_page_path, set_search_page_path] = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_;
127
+ set_search_page_path(search_page_path);
128
+ if (!search) {
129
+ (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search = new (0, $4GYXz$depictaiui.DepictSearch)({
130
+ search_query_url_param_name: url_param_name,
131
+ ...assignable_options,
132
+ enable_category_suggestions: false,
133
+ localization: {
134
+ ...(0, $4GYXz$depictaiui.swedish_search_translation),
135
+ price_formatting_: {
136
+ pre_: "€ ",
137
+ post_: "",
138
+ decimal_places_delimiter_: ",",
139
+ thousands_delimiter_: " ",
140
+ places_after_comma_: 2
141
+ }
142
+ },
143
+ on_navigation: (new_href)=>{
144
+ const shallow = (0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43)(location);
145
+ window.next.router.push(new_href, undefined, {
146
+ shallow: shallow,
147
+ scroll: true
148
+ });
149
+ },
150
+ url_transformer: (url)=>url.pathname = (0, $4GYXz$solidjs.untrack)(get_search_page_path)
151
+ });
152
+ (0, $6319748b4f0426f0$export$6453cbc34515a94d)((0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43));
153
+ } else Object.assign(search, assignable_options);
154
+ if (props.market && props.merchant) (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).required_state_set_[1](true);
155
+ return (0, $4GYXz$react.createElement)((0, $4GYXz$react.Fragment), null, children);
134
156
  }
135
157
 
136
158
 
@@ -141,38 +163,38 @@ function $18b830ef84ac138a$export$9fac37a9c21c2f3b(props) {
141
163
 
142
164
 
143
165
  function $20bf907adee775ba$export$cbcd1ecdb41b1d0a() {
144
- return (0, $1pn1h$react.createElement)("div", {
166
+ return (0, $4GYXz$react.createElement)("div", {
145
167
  className: "depict aligner",
146
- ref: (e)=>(0, $e589c49931886c97$export$8e769ad4338a911e).header_alignment = e
168
+ ref: (e)=>(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment = e
147
169
  });
148
170
  }
149
171
  let $20bf907adee775ba$var$sheet;
150
172
  function $20bf907adee775ba$export$a7f6cffb6b8ba11c() {
151
- if (!(0, $e589c49931886c97$export$8e769ad4338a911e).search) {
173
+ if (!(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search) {
152
174
  console.error("No active search in the app!");
153
175
  return;
154
176
  }
155
- if (!(0, $e589c49931886c97$export$8e769ad4338a911e).header_alignment) {
177
+ if (!(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment) {
156
178
  console.error("No active search header aligner on the page!");
157
179
  return;
158
180
  }
159
- const style_props_ = (0, $1pn1h$solidjs.createSignal)({
181
+ const style_props_ = (0, $4GYXz$solidjs.createSignal)({
160
182
  position: "fixed",
161
183
  top: 0
162
184
  });
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; }`;
185
+ if ((0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment?.clientHeight) {
186
+ let styles = `.depict.plp.in_header .depict-search-modal .query_input { height: ${(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
187
+ styles += `.depict.plp.in_header .depict-search-modal-backdrop { top: ${(0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
166
188
  if (!$20bf907adee775ba$var$sheet) {
167
189
  const style = document.createElement("style");
168
190
  style.append(styles);
169
191
  document.head.appendChild(style);
170
192
  }
171
193
  }
172
- const class_list_ = (0, $1pn1h$solidjs.createMemo)(()=>({
194
+ const class_list_ = (0, $4GYXz$solidjs.createMemo)(()=>({
173
195
  in_header: true
174
196
  }));
175
- (0, $e589c49931886c97$export$8e769ad4338a911e).search.modal_open = [
197
+ (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search.modal_open = [
176
198
  {
177
199
  style_props_: style_props_,
178
200
  class_list_: class_list_
@@ -181,13 +203,52 @@ function $20bf907adee775ba$export$a7f6cffb6b8ba11c() {
181
203
  }
182
204
 
183
205
 
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)=>{
206
+
207
+
208
+
209
+
210
+
211
+
212
+ function $a6bedbe4b4d6d027$export$210723f5a54a7028(opts) {
213
+ return (0, $b4d0d98857ed9934$export$f6e64e17bd69eeef)((0, $b4d0d98857ed9934$export$e5139bbbb9a05035)($a6bedbe4b4d6d027$var$SolidSearchPage), opts);
214
+ }
215
+ function $a6bedbe4b4d6d027$var$SolidSearchPage(props, set_portals) {
216
+ const depict_search = (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search;
217
+ if (!depict_search) throw Error("No depict_search instance when rendering SearchPage.");
218
+ const search_query_updating_blocked_signal = (0, $4GYXz$depictaiui.get_search_query_updating_blocked_signal)(depict_search);
219
+ if (!search_query_updating_blocked_signal) throw Error("No search_query_updating_blocked_signal when rendering SearchPage");
220
+ const [, set_search_query_updating_blocked_signal] = search_query_updating_blocked_signal;
221
+ const update_updating_blocked_signal = ()=>{
222
+ set_search_query_updating_blocked_signal(!(0, $b4d0d98857ed9934$export$6cb4d3a5c1ac9b43)(location));
223
+ };
224
+ // 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
225
+ (0, $b4d0d98857ed9934$export$74f3924c5027fe1d)(update_updating_blocked_signal); // if we navigate, re-check
226
+ (0, $4GYXz$solidjs.createComputed)(()=>{
227
+ (0, $0b7cd4fb39fc3502$export$8e769ad4338a911e).search_page_path_[0](); // if react defined path changes, re-check
228
+ update_updating_blocked_signal();
229
+ });
230
+ const component_portals = new Set();
231
+ return (0, $4GYXz$depictaiui.SearchPage)({
232
+ // Default config goes here
233
+ include_input_field: props.includeInputField ?? true,
234
+ cols_at_size: props.columnsAtSize ?? [
235
+ [
236
+ 4
237
+ ],
238
+ [
239
+ 3,
240
+ 1024
241
+ ],
242
+ [
243
+ 2,
244
+ 901
245
+ ]
246
+ ],
247
+ grid_spacing: props.gridSpacing ?? "2%",
248
+ // Todo: Do we need this?
249
+ get_product_id: ()=>"",
250
+ depict_search: depict_search,
251
+ product_card_template: async (display)=>{
191
252
  const solid_container = document.createElement("div");
192
253
  const react_has_rendered = new Promise((r)=>{
193
254
  const m_o = new MutationObserver(()=>{
@@ -198,15 +259,15 @@ function $7c7f5a6b750dca70$var$DepictSearchPageContent(opts) {
198
259
  childList: true
199
260
  });
200
261
  });
201
- const reactProductCard = (0, $1pn1h$reactjsxruntime.jsx)(opts.productCardFactory, {
262
+ const reactProductCard = (0, $4GYXz$reactjsxruntime.jsx)(props.productCard, {
202
263
  display: display
203
264
  });
204
- const portal = $1pn1h$reactdom.createPortal(reactProductCard, solid_container);
265
+ const portal = $4GYXz$reactdom.createPortal(reactProductCard, solid_container);
205
266
  component_portals.add(portal);
206
267
  set_portals([
207
268
  ...component_portals
208
269
  ]);
209
- (0, $1pn1h$solidjs.onCleanup)(()=>{
270
+ (0, $4GYXz$solidjs.onCleanup)(()=>{
210
271
  // 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
272
  component_portals.delete(portal);
212
273
  set_portals([
@@ -217,58 +278,10 @@ function $7c7f5a6b750dca70$var$DepictSearchPageContent(opts) {
217
278
  return [
218
279
  solid_container
219
280
  ];
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)
281
+ }
271
282
  });
272
283
  }
273
284
 
274
285
 
286
+
287
+
package/dist/module.js CHANGED
@@ -1,50 +1,78 @@
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, Fragment as $TZSbU$Fragment} 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
+
60
+
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
+ }
39
67
 
40
68
 
41
69
 
42
70
 
43
71
 
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;
72
+ let $8071251ee4e9ffa1$var$set = false;
73
+ function $8071251ee4e9ffa1$export$6453cbc34515a94d(is_search_page) {
74
+ if ($8071251ee4e9ffa1$var$set) return; // Just being safe
75
+ $8071251ee4e9ffa1$var$set = true;
48
76
  let should_use_old_scroll = false;
49
77
  const old_scrollTo = window.scrollTo;
50
78
  window.scrollTo = (...args)=>{
@@ -53,76 +81,69 @@ function $01e7216f8f859389$export$6453cbc34515a94d(is_search_page) {
53
81
  };
54
82
  addEventListener("popstate", (e)=>{
55
83
  if (!is_search_page(location)) {
56
- $01e7216f8f859389$var$removeLotsOfPadding(); // Just making sure
84
+ $8071251ee4e9ffa1$var$removeLotsOfPadding(); // Just making sure
57
85
  return;
58
86
  }
59
87
  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();
88
+ $8071251ee4e9ffa1$var$addLotsOfPadding();
89
+ (0, $TZSbU$observer).wait_for_element(".depict.plp .listing-page").then(()=>{
90
+ $8071251ee4e9ffa1$var$removeLotsOfPadding();
63
91
  });
64
92
  });
65
- (0, $9xHCU$history_replacer)(()=>{
66
- (0, $9xHCU$queueMacroTask)(()=>{
67
- $01e7216f8f859389$var$removeLotsOfPadding();
93
+ (0, $TZSbU$history_replacer)(()=>{
94
+ (0, $TZSbU$queueMacroTask)(()=>{
95
+ $8071251ee4e9ffa1$var$removeLotsOfPadding();
68
96
  });
69
97
  }, false);
70
98
  window?.next?.router?.events?.on("routeChangeStart", ()=>{
71
- $01e7216f8f859389$var$addLotsOfPadding();
99
+ $8071251ee4e9ffa1$var$addLotsOfPadding();
72
100
  });
73
101
  }
74
- function $01e7216f8f859389$var$addLotsOfPadding() {
102
+ // TODO: Make these animations so they don't collide with whatever padding is already on the body
103
+ function $8071251ee4e9ffa1$var$addLotsOfPadding() {
75
104
  document.body.style.paddingBottom = (history.state?.search_scroll_restoration_data?.[0]?.min_results_loaded || 150) * 500 + "px";
76
105
  }
77
- function $01e7216f8f859389$var$removeLotsOfPadding() {
106
+ function $8071251ee4e9ffa1$var$removeLotsOfPadding() {
78
107
  document.body.style.paddingBottom = "";
79
108
  }
80
109
 
81
110
 
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
- };
111
+
115
112
 
116
113
 
117
114
  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);
125
- return children;
115
+ const { children: children , search_page_path: search_page_path , url_param_name: url_param_name , ...assignable_options } = props;
116
+ const { search: search } = (0, $42858f023ef23dab$export$8e769ad4338a911e);
117
+ const [get_search_page_path, set_search_page_path] = (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_;
118
+ set_search_page_path(search_page_path);
119
+ if (!search) {
120
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).search = new (0, $TZSbU$DepictSearch)({
121
+ search_query_url_param_name: url_param_name,
122
+ ...assignable_options,
123
+ enable_category_suggestions: false,
124
+ localization: {
125
+ ...(0, $TZSbU$swedish_search_translation),
126
+ price_formatting_: {
127
+ pre_: "€ ",
128
+ post_: "",
129
+ decimal_places_delimiter_: ",",
130
+ thousands_delimiter_: " ",
131
+ places_after_comma_: 2
132
+ }
133
+ },
134
+ on_navigation: (new_href)=>{
135
+ const shallow = (0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location);
136
+ window.next.router.push(new_href, undefined, {
137
+ shallow: shallow,
138
+ scroll: true
139
+ });
140
+ },
141
+ url_transformer: (url)=>url.pathname = (0, $TZSbU$untrack)(get_search_page_path)
142
+ });
143
+ (0, $8071251ee4e9ffa1$export$6453cbc34515a94d)((0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43));
144
+ } else Object.assign(search, assignable_options);
145
+ if (props.market && props.merchant) (0, $42858f023ef23dab$export$8e769ad4338a911e).required_state_set_[1](true);
146
+ return (0, $TZSbU$createElement)((0, $TZSbU$Fragment), null, children);
126
147
  }
127
148
 
128
149
 
@@ -133,38 +154,38 @@ function $faf794495ff8b304$export$9fac37a9c21c2f3b(props) {
133
154
 
134
155
 
135
156
  function $f41a371216eff80b$export$cbcd1ecdb41b1d0a() {
136
- return (0, $9xHCU$createElement)("div", {
157
+ return (0, $TZSbU$createElement)("div", {
137
158
  className: "depict aligner",
138
- ref: (e)=>(0, $9ce874af9a04465f$export$8e769ad4338a911e).header_alignment = e
159
+ ref: (e)=>(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment = e
139
160
  });
140
161
  }
141
162
  let $f41a371216eff80b$var$sheet;
142
163
  function $f41a371216eff80b$export$a7f6cffb6b8ba11c() {
143
- if (!(0, $9ce874af9a04465f$export$8e769ad4338a911e).search) {
164
+ if (!(0, $42858f023ef23dab$export$8e769ad4338a911e).search) {
144
165
  console.error("No active search in the app!");
145
166
  return;
146
167
  }
147
- if (!(0, $9ce874af9a04465f$export$8e769ad4338a911e).header_alignment) {
168
+ if (!(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment) {
148
169
  console.error("No active search header aligner on the page!");
149
170
  return;
150
171
  }
151
- const style_props_ = (0, $9xHCU$createSignal)({
172
+ const style_props_ = (0, $TZSbU$createSignal)({
152
173
  position: "fixed",
153
174
  top: 0
154
175
  });
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; }`;
176
+ if ((0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment?.clientHeight) {
177
+ let styles = `.depict.plp.in_header .depict-search-modal .query_input { height: ${(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
178
+ styles += `.depict.plp.in_header .depict-search-modal-backdrop { top: ${(0, $42858f023ef23dab$export$8e769ad4338a911e).header_alignment?.clientHeight}px; }`;
158
179
  if (!$f41a371216eff80b$var$sheet) {
159
180
  const style = document.createElement("style");
160
181
  style.append(styles);
161
182
  document.head.appendChild(style);
162
183
  }
163
184
  }
164
- const class_list_ = (0, $9xHCU$createMemo)(()=>({
185
+ const class_list_ = (0, $TZSbU$createMemo)(()=>({
165
186
  in_header: true
166
187
  }));
167
- (0, $9ce874af9a04465f$export$8e769ad4338a911e).search.modal_open = [
188
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).search.modal_open = [
168
189
  {
169
190
  style_props_: style_props_,
170
191
  class_list_: class_list_
@@ -173,13 +194,52 @@ function $f41a371216eff80b$export$a7f6cffb6b8ba11c() {
173
194
  }
174
195
 
175
196
 
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)=>{
197
+
198
+
199
+
200
+
201
+
202
+
203
+ function $9f8d5ef3c016c493$export$210723f5a54a7028(opts) {
204
+ return (0, $c83ba9ab79386687$export$f6e64e17bd69eeef)((0, $c83ba9ab79386687$export$e5139bbbb9a05035)($9f8d5ef3c016c493$var$SolidSearchPage), opts);
205
+ }
206
+ function $9f8d5ef3c016c493$var$SolidSearchPage(props, set_portals) {
207
+ const depict_search = (0, $42858f023ef23dab$export$8e769ad4338a911e).search;
208
+ if (!depict_search) throw Error("No depict_search instance when rendering SearchPage.");
209
+ const search_query_updating_blocked_signal = (0, $TZSbU$get_search_query_updating_blocked_signal)(depict_search);
210
+ if (!search_query_updating_blocked_signal) throw Error("No search_query_updating_blocked_signal when rendering SearchPage");
211
+ const [, set_search_query_updating_blocked_signal] = search_query_updating_blocked_signal;
212
+ const update_updating_blocked_signal = ()=>{
213
+ set_search_query_updating_blocked_signal(!(0, $c83ba9ab79386687$export$6cb4d3a5c1ac9b43)(location));
214
+ };
215
+ // 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
216
+ (0, $c83ba9ab79386687$export$74f3924c5027fe1d)(update_updating_blocked_signal); // if we navigate, re-check
217
+ (0, $TZSbU$createComputed)(()=>{
218
+ (0, $42858f023ef23dab$export$8e769ad4338a911e).search_page_path_[0](); // if react defined path changes, re-check
219
+ update_updating_blocked_signal();
220
+ });
221
+ const component_portals = new Set();
222
+ return (0, $TZSbU$SearchPage)({
223
+ // Default config goes here
224
+ include_input_field: props.includeInputField ?? true,
225
+ cols_at_size: props.columnsAtSize ?? [
226
+ [
227
+ 4
228
+ ],
229
+ [
230
+ 3,
231
+ 1024
232
+ ],
233
+ [
234
+ 2,
235
+ 901
236
+ ]
237
+ ],
238
+ grid_spacing: props.gridSpacing ?? "2%",
239
+ // Todo: Do we need this?
240
+ get_product_id: ()=>"",
241
+ depict_search: depict_search,
242
+ product_card_template: async (display)=>{
183
243
  const solid_container = document.createElement("div");
184
244
  const react_has_rendered = new Promise((r)=>{
185
245
  const m_o = new MutationObserver(()=>{
@@ -190,15 +250,15 @@ function $a854d2a2f2059f57$var$DepictSearchPageContent(opts) {
190
250
  childList: true
191
251
  });
192
252
  });
193
- const reactProductCard = (0, $9xHCU$jsx)(opts.productCardFactory, {
253
+ const reactProductCard = (0, $TZSbU$jsx)(props.productCard, {
194
254
  display: display
195
255
  });
196
- const portal = $9xHCU$createPortal(reactProductCard, solid_container);
256
+ const portal = $TZSbU$createPortal(reactProductCard, solid_container);
197
257
  component_portals.add(portal);
198
258
  set_portals([
199
259
  ...component_portals
200
260
  ]);
201
- (0, $9xHCU$onCleanup)(()=>{
261
+ (0, $TZSbU$onCleanup)(()=>{
202
262
  // 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
263
  component_portals.delete(portal);
204
264
  set_portals([
@@ -209,59 +269,11 @@ function $a854d2a2f2059f57$var$DepictSearchPageContent(opts) {
209
269
  return [
210
270
  solid_container
211
271
  ];
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)
272
+ }
263
273
  });
264
274
  }
265
275
 
266
276
 
267
- export {$a854d2a2f2059f57$export$210723f5a54a7028 as DepictSearchPage, $faf794495ff8b304$export$9fac37a9c21c2f3b as DepictProvider, $f41a371216eff80b$export$a7f6cffb6b8ba11c as openModal, $f41a371216eff80b$export$cbcd1ecdb41b1d0a as DepictSearchHeader};
277
+
278
+
279
+ 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.19",
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.6",
82
+ "@depict-ai/utilishared": "^0.0.6",
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%;}