@depict-ai/react-ui 0.0.2 → 0.0.5
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 +2 -3
- package/dist/main.js +19 -158
- package/dist/module.js +44 -1
- package/dist-server/main.js +2 -5
- package/dist-server/module.js +17 -1
- package/package.json +32 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Display } from "@depict-ai/ui";
|
|
2
|
-
import { ReactNode } from "react";
|
|
2
|
+
import { PropsWithChildren, ReactNode } from "react";
|
|
3
3
|
export interface SearchConfig {
|
|
4
4
|
merchant: string;
|
|
5
5
|
market: string;
|
|
@@ -7,6 +7,5 @@ export interface SearchConfig {
|
|
|
7
7
|
export interface SearchPageConfig {
|
|
8
8
|
productCardFactory: (display: Display) => ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export function DepictProvider(
|
|
10
|
+
export function DepictProvider({ children, merchant, market }: PropsWithChildren<SearchConfig>): ReactNode;
|
|
11
11
|
export function DepictSearchPage(opts: SearchPageConfig): any;
|
|
12
|
-
export function openModal(): void;
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
var $lgFzj$reactdom = require("react-dom");
|
|
2
1
|
var $lgFzj$depictaireactsolidbridge = require("@depict-ai/react-solid-bridge");
|
|
3
|
-
var $lgFzj$depictaiui = require("@depict-ai/ui");
|
|
4
2
|
var $lgFzj$react = require("react");
|
|
3
|
+
var $lgFzj$depictaiui = require("@depict-ai/ui");
|
|
5
4
|
var $lgFzj$reactjsxruntime = require("react/jsx-runtime");
|
|
6
5
|
var $lgFzj$solidjs = require("solid-js");
|
|
7
|
-
var $lgFzj$depictaiutilishared = require("@depict-ai/utilishared");
|
|
8
6
|
|
|
9
7
|
function $parcel$export(e, n, v, s) {
|
|
10
8
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -12,143 +10,34 @@ function $parcel$export(e, n, v, s) {
|
|
|
12
10
|
|
|
13
11
|
$parcel$export(module.exports, "DepictProvider", () => $6abe21f0d440de7c$export$9fac37a9c21c2f3b);
|
|
14
12
|
$parcel$export(module.exports, "DepictSearchPage", () => $6abe21f0d440de7c$export$210723f5a54a7028);
|
|
15
|
-
$parcel$export(module.exports, "openModal", () => $6abe21f0d440de7c$export$a7f6cffb6b8ba11c);
|
|
16
|
-
|
|
17
|
-
|
|
18
13
|
|
|
19
14
|
|
|
20
15
|
|
|
21
16
|
|
|
22
|
-
const $ed09819de7bb86d1$export$99ae278b8f3607a0 = (opts)=>{
|
|
23
|
-
const path = "/search";
|
|
24
|
-
const is_page_ = (url)=>url.pathname == path;
|
|
25
|
-
const api = new (0, $lgFzj$depictaiui.DepictAPI)();
|
|
26
|
-
const search = new (0, $lgFzj$depictaiui.Search)({
|
|
27
|
-
depict_api_: api,
|
|
28
|
-
page_replacer_ref_: ()=>{},
|
|
29
|
-
url_transformer_: (url)=>{
|
|
30
|
-
url.pathname = path;
|
|
31
|
-
},
|
|
32
|
-
alternative_query_submitter_for_spas_: (param_name, new_query, url_transformer)=>{
|
|
33
|
-
const url = new URL(location.href);
|
|
34
|
-
const was_page = is_page_(url);
|
|
35
|
-
url.searchParams.set(param_name, new_query);
|
|
36
|
-
url_transformer?.(url);
|
|
37
|
-
window.next.router.push({
|
|
38
|
-
"pathname": path,
|
|
39
|
-
"query": {
|
|
40
|
-
[param_name]: new_query
|
|
41
|
-
}
|
|
42
|
-
}, url.pathname + url.search + url.hash, {
|
|
43
|
-
shallow: was_page,
|
|
44
|
-
scroll: true
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
modal_options_: {
|
|
48
|
-
render_instant_card_: opts.instantCardFactory,
|
|
49
|
-
render_instant_card_placeholder_: (0, $lgFzj$depictaiui.DefaultInstantCardPlaceholder),
|
|
50
|
-
disable_scrolling_: false
|
|
51
|
-
},
|
|
52
|
-
search_page_: {
|
|
53
|
-
get_product_id_: ()=>"",
|
|
54
|
-
search_query_param_name_: "q",
|
|
55
|
-
is_search_page_: is_page_,
|
|
56
|
-
include_input_field_: true,
|
|
57
|
-
make_category_suggestion_card_: false,
|
|
58
|
-
slider_arrow_button_: (0, $lgFzj$depictaiutilishared.GenericSliderArrowButton)({
|
|
59
|
-
height_: 12,
|
|
60
|
-
width_: 6.46
|
|
61
|
-
}),
|
|
62
|
-
page_title_: "Search page",
|
|
63
|
-
layout_options_: {
|
|
64
|
-
cols_at_size: [
|
|
65
|
-
[
|
|
66
|
-
4,
|
|
67
|
-
"1024px"
|
|
68
|
-
],
|
|
69
|
-
[
|
|
70
|
-
3,
|
|
71
|
-
"901px",
|
|
72
|
-
"1023px"
|
|
73
|
-
],
|
|
74
|
-
[
|
|
75
|
-
2,
|
|
76
|
-
"",
|
|
77
|
-
"900px"
|
|
78
|
-
]
|
|
79
|
-
],
|
|
80
|
-
grid_spacing: "10px"
|
|
81
|
-
},
|
|
82
|
-
rr_options_: {
|
|
83
|
-
template: opts.productCardFactory
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
search.tenant_ = opts.merchant;
|
|
88
|
-
search.market_ = opts.market;
|
|
89
|
-
search.locale_ = {
|
|
90
|
-
...(0, $lgFzj$depictaiui.swedish_search_translation),
|
|
91
|
-
price_formatting_: {
|
|
92
|
-
pre_: "€ ",
|
|
93
|
-
post_: "",
|
|
94
|
-
decimal_places_delimiter_: ",",
|
|
95
|
-
thousands_delimiter_: " ",
|
|
96
|
-
places_after_comma_: 2
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
return {
|
|
100
|
-
search: search,
|
|
101
|
-
controls: search.boot_()
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
17
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
let $6abe21f0d440de7c$var$active_render_card;
|
|
111
|
-
const $6abe21f0d440de7c$var$wrapped_render_card = (d)=>$6abe21f0d440de7c$var$active_render_card(d);
|
|
112
|
-
function $6abe21f0d440de7c$export$9fac37a9c21c2f3b(opts) {
|
|
113
|
-
console.log("DEPICTPROVIDER CLIENT");
|
|
114
|
-
if (!$6abe21f0d440de7c$var$search) {
|
|
115
|
-
const init = (0, $ed09819de7bb86d1$export$99ae278b8f3607a0)({
|
|
116
|
-
merchant: opts.merchant,
|
|
117
|
-
market: opts.market,
|
|
118
|
-
productCardFactory: $6abe21f0d440de7c$var$wrapped_render_card,
|
|
119
|
-
instantCardFactory: (0, $lgFzj$depictaiui.UniversalInstantCard)
|
|
120
|
-
});
|
|
121
|
-
$6abe21f0d440de7c$var$search = init.search;
|
|
122
|
-
$6abe21f0d440de7c$var$controls = init.controls;
|
|
123
|
-
}
|
|
18
|
+
function $6abe21f0d440de7c$export$9fac37a9c21c2f3b({ children: children , merchant: merchant , market: market }) {
|
|
19
|
+
return children;
|
|
124
20
|
}
|
|
125
21
|
function $6abe21f0d440de7c$var$DepictSearchPageContent(opts) {
|
|
126
22
|
const [bridge, setBridge] = (0, $lgFzj$react.useState)(null);
|
|
127
|
-
const [portals, set_portals] = (0, $lgFzj$react.useState)([]);
|
|
128
23
|
(0, $lgFzj$react.useEffect)(()=>{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
};
|
|
142
|
-
const el = $6abe21f0d440de7c$var$search.render_;
|
|
143
|
-
const solidBridge = (0, $lgFzj$reactjsxruntime.jsx)((0, $lgFzj$depictaireactsolidbridge.ReactToSolidBridge), {
|
|
144
|
-
solidComponent: ()=>el,
|
|
145
|
-
key: Math.random()
|
|
146
|
-
});
|
|
147
|
-
setBridge(solidBridge);
|
|
24
|
+
if (!bridge) {
|
|
25
|
+
const [title] = (0, $lgFzj$solidjs.createSignal)("Category");
|
|
26
|
+
const solid_element = (0, $lgFzj$depictaiui.CategoryTitle)({
|
|
27
|
+
category_title_: title,
|
|
28
|
+
product_count_: 0
|
|
29
|
+
});
|
|
30
|
+
const solid_bridge = (0, $lgFzj$reactjsxruntime.jsx)((0, $lgFzj$depictaireactsolidbridge.ReactToSolidBridge), {
|
|
31
|
+
solidComponent: ()=>solid_element,
|
|
32
|
+
key: Math.random()
|
|
33
|
+
});
|
|
34
|
+
setBridge(solid_bridge);
|
|
35
|
+
}
|
|
148
36
|
}, []);
|
|
149
|
-
return bridge ? (0, $lgFzj$react.createElement)("div", {
|
|
150
|
-
|
|
151
|
-
|
|
37
|
+
return bridge ? (0, $lgFzj$react.createElement)("div", {
|
|
38
|
+
className: "solid_bridge"
|
|
39
|
+
}, [
|
|
40
|
+
bridge
|
|
152
41
|
]) : "";
|
|
153
42
|
}
|
|
154
43
|
function $6abe21f0d440de7c$export$210723f5a54a7028(opts) {
|
|
@@ -156,33 +45,5 @@ function $6abe21f0d440de7c$export$210723f5a54a7028(opts) {
|
|
|
156
45
|
children: (0, $lgFzj$reactjsxruntime.jsx)($6abe21f0d440de7c$var$DepictSearchPageContent, opts)
|
|
157
46
|
});
|
|
158
47
|
}
|
|
159
|
-
let $6abe21f0d440de7c$var$sheet;
|
|
160
|
-
function $6abe21f0d440de7c$export$a7f6cffb6b8ba11c() {
|
|
161
|
-
if (!$6abe21f0d440de7c$var$controls) {
|
|
162
|
-
console.error("No active search header component on the page!");
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
$6abe21f0d440de7c$var$controls.then((c)=>{
|
|
166
|
-
const style_props_ = (0, $lgFzj$solidjs.createSignal)({
|
|
167
|
-
position: "fixed",
|
|
168
|
-
top: 0
|
|
169
|
-
});
|
|
170
|
-
/*if (header?.clientHeight) {
|
|
171
|
-
let styles = `.depict.plp.in_header .depict-search-modal .query_input { height: ${header?.clientHeight}px; }`;
|
|
172
|
-
styles += `.depict.plp.in_header .depict-search-modal-backdrop { top: ${header?.clientHeight}px; }`;
|
|
173
|
-
if (!sheet) {
|
|
174
|
-
const style = document.createElement("style");
|
|
175
|
-
style.append(styles);
|
|
176
|
-
document.head.appendChild(style);
|
|
177
|
-
}
|
|
178
|
-
}*/ const class_list_ = (0, $lgFzj$solidjs.createMemo)(()=>({
|
|
179
|
-
in_header: true
|
|
180
|
-
}));
|
|
181
|
-
c.open_modal_({
|
|
182
|
-
style_props_: style_props_,
|
|
183
|
-
class_list_: class_list_
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
48
|
|
|
188
49
|
|
package/dist/module.js
CHANGED
|
@@ -1 +1,44 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {ReactToSolidBridge as $5DrVA$ReactToSolidBridge, ReactToSolidBridgeProvider as $5DrVA$ReactToSolidBridgeProvider} from "@depict-ai/react-solid-bridge";
|
|
2
|
+
import {useState as $5DrVA$useState, useEffect as $5DrVA$useEffect, createElement as $5DrVA$createElement} from "react";
|
|
3
|
+
import {CategoryTitle as $5DrVA$CategoryTitle} from "@depict-ai/ui";
|
|
4
|
+
import {jsx as $5DrVA$jsx} from "react/jsx-runtime";
|
|
5
|
+
import {createSignal as $5DrVA$createSignal} from "solid-js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $ea53d4d38ca71150$export$9fac37a9c21c2f3b({ children: children , merchant: merchant , market: market }) {
|
|
13
|
+
return children;
|
|
14
|
+
}
|
|
15
|
+
function $ea53d4d38ca71150$var$DepictSearchPageContent(opts) {
|
|
16
|
+
const [bridge, setBridge] = (0, $5DrVA$useState)(null);
|
|
17
|
+
(0, $5DrVA$useEffect)(()=>{
|
|
18
|
+
if (!bridge) {
|
|
19
|
+
const [title] = (0, $5DrVA$createSignal)("Category");
|
|
20
|
+
const solid_element = (0, $5DrVA$CategoryTitle)({
|
|
21
|
+
category_title_: title,
|
|
22
|
+
product_count_: 0
|
|
23
|
+
});
|
|
24
|
+
const solid_bridge = (0, $5DrVA$jsx)((0, $5DrVA$ReactToSolidBridge), {
|
|
25
|
+
solidComponent: ()=>solid_element,
|
|
26
|
+
key: Math.random()
|
|
27
|
+
});
|
|
28
|
+
setBridge(solid_bridge);
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
return bridge ? (0, $5DrVA$createElement)("div", {
|
|
32
|
+
className: "solid_bridge"
|
|
33
|
+
}, [
|
|
34
|
+
bridge
|
|
35
|
+
]) : "";
|
|
36
|
+
}
|
|
37
|
+
function $ea53d4d38ca71150$export$210723f5a54a7028(opts) {
|
|
38
|
+
return (0, $5DrVA$jsx)((0, $5DrVA$ReactToSolidBridgeProvider), {
|
|
39
|
+
children: (0, $5DrVA$jsx)($ea53d4d38ca71150$var$DepictSearchPageContent, opts)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export {$ea53d4d38ca71150$export$9fac37a9c21c2f3b as DepictProvider, $ea53d4d38ca71150$export$210723f5a54a7028 as DepictSearchPage};
|
package/dist-server/main.js
CHANGED
|
@@ -11,13 +11,10 @@ $parcel$export(module.exports, "openModal", () => $5767ac9f6fd2be28$export$a7f6c
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
function $5767ac9f6fd2be28$export$9fac37a9c21c2f3b(props) {
|
|
14
|
-
|
|
15
|
-
return (0, $4yCyN$reactjsxruntime.jsx)((0, $4yCyN$depictaireactsolidbridge.ReactToSolidBridgeProvider), {
|
|
16
|
-
children: props.children
|
|
17
|
-
});
|
|
14
|
+
return props.children;
|
|
18
15
|
}
|
|
19
16
|
function $5767ac9f6fd2be28$export$210723f5a54a7028() {
|
|
20
|
-
return (0, $4yCyN$reactjsxruntime.jsx)($
|
|
17
|
+
return (0, $4yCyN$reactjsxruntime.jsx)((0, $4yCyN$depictaireactsolidbridge.ReactToSolidBridgeProvider), {
|
|
21
18
|
children: ""
|
|
22
19
|
});
|
|
23
20
|
}
|
package/dist-server/module.js
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
import{ReactToSolidBridgeProvider as
|
|
1
|
+
import {ReactToSolidBridgeProvider as $8UQZK$ReactToSolidBridgeProvider} from "@depict-ai/react-solid-bridge";
|
|
2
|
+
import {jsx as $8UQZK$jsx} from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function $7def0b56bbffc00f$export$9fac37a9c21c2f3b(props) {
|
|
7
|
+
return props.children;
|
|
8
|
+
}
|
|
9
|
+
function $7def0b56bbffc00f$export$210723f5a54a7028() {
|
|
10
|
+
return (0, $8UQZK$jsx)((0, $8UQZK$ReactToSolidBridgeProvider), {
|
|
11
|
+
children: ""
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function $7def0b56bbffc00f$export$a7f6cffb6b8ba11c() {}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export {$7def0b56bbffc00f$export$9fac37a9c21c2f3b as DepictProvider, $7def0b56bbffc00f$export$210723f5a54a7028 as DepictSearchPage, $7def0b56bbffc00f$export$a7f6cffb6b8ba11c as openModal};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/react-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/main.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -29,17 +29,43 @@
|
|
|
29
29
|
"engines": {
|
|
30
30
|
"browsers": "last 1 chrome version"
|
|
31
31
|
},
|
|
32
|
-
"optimize":
|
|
32
|
+
"optimize": false
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
+
"browser": {
|
|
38
|
+
"development": {
|
|
39
|
+
"import": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"default": "./dist/module.js"
|
|
42
|
+
},
|
|
43
|
+
"require": "./dist/main.js"
|
|
44
|
+
},
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"default": "./dist/module.js"
|
|
48
|
+
},
|
|
49
|
+
"require": "./dist/main.js"
|
|
50
|
+
},
|
|
37
51
|
"node": {
|
|
38
|
-
"import":
|
|
52
|
+
"import": {
|
|
53
|
+
"default": "./dist-server/module.js"
|
|
54
|
+
},
|
|
55
|
+
"require": "./dist-server/main.js"
|
|
56
|
+
},
|
|
57
|
+
"development": {
|
|
58
|
+
"import": {
|
|
59
|
+
"types": "./dist/index.d.ts",
|
|
60
|
+
"default": "./dist/module.js"
|
|
61
|
+
},
|
|
62
|
+
"require": "./dist/main.js"
|
|
63
|
+
},
|
|
64
|
+
"import": {
|
|
65
|
+
"types": "./dist/index.d.ts",
|
|
66
|
+
"default": "./dist/module.js"
|
|
39
67
|
},
|
|
40
|
-
"
|
|
41
|
-
"import": "./dist/main.js"
|
|
42
|
-
}
|
|
68
|
+
"require": "./dist/main.js"
|
|
43
69
|
}
|
|
44
70
|
},
|
|
45
71
|
"files": [
|