@depict-ai/portal-components 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -1
- package/dist/main.js +47 -6
- package/dist/module.js +49 -9
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
|
|
2
2
|
import { Locale } from "@depict-ai/react-ui/locales";
|
|
3
|
-
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
export const version = "0.0.6";
|
|
4
5
|
export function ReactSelectedFilters(react_props: {
|
|
5
6
|
availableFilters: SearchFilter[] | undefined;
|
|
6
7
|
hidden?: boolean;
|
|
@@ -55,3 +56,13 @@ export function ReactFilterBody(react_props: {
|
|
|
55
56
|
}[]) => void;
|
|
56
57
|
hideClearAllButton?: boolean;
|
|
57
58
|
}): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
59
|
+
export function ExpandingSection({ summary: summary_children, children, className, ...other_react_props }: {
|
|
60
|
+
className?: string;
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
summary: ReactNode;
|
|
63
|
+
is_open: boolean;
|
|
64
|
+
set_is_open: (new_value: boolean) => void;
|
|
65
|
+
duration?: number;
|
|
66
|
+
}): import("react").FunctionComponentElement<{
|
|
67
|
+
children?: ReactNode;
|
|
68
|
+
}>;
|
package/dist/main.js
CHANGED
|
@@ -4,6 +4,7 @@ var $7jsgb$depictaiui = require("@depict-ai/ui");
|
|
|
4
4
|
var $7jsgb$solidjsweb = require("solid-js/web");
|
|
5
5
|
var $7jsgb$react = require("react");
|
|
6
6
|
var $7jsgb$solidjsstore = require("solid-js/store");
|
|
7
|
+
var $7jsgb$reactdom = require("react-dom");
|
|
7
8
|
|
|
8
9
|
function $parcel$export(e, n, v, s) {
|
|
9
10
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
@@ -11,9 +12,10 @@ function $parcel$export(e, n, v, s) {
|
|
|
11
12
|
|
|
12
13
|
$parcel$export(module.exports, "ReactSelectedFilters", () => $847ac8ccd5089f8b$export$aea1707d7b01c3a2);
|
|
13
14
|
$parcel$export(module.exports, "ReactFilterBody", () => $d1927de554e8e7c1$export$d929db7fb6179159);
|
|
15
|
+
$parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$export$4ea53cd12ff17334);
|
|
14
16
|
$parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
|
|
15
17
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
16
|
-
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "0.0.
|
|
18
|
+
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "0.0.6";
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
|
|
@@ -21,7 +23,7 @@ const $0a017be3a74fcc94$export$83d89fbfd8236492 = "0.0.5";
|
|
|
21
23
|
|
|
22
24
|
|
|
23
25
|
|
|
24
|
-
function $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef({ solid_component: solid_component , props: props , wrapper_type: wrapper_type = "div" , wrapper_style: wrapper_style = {} }) {
|
|
26
|
+
function $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef({ solid_component: solid_component , props: props , wrapper_type: wrapper_type = "div" , wrapper_style: wrapper_style = {} , className: className }) {
|
|
25
27
|
const wrapper_element_ref = (0, $7jsgb$react.useRef)();
|
|
26
28
|
const [[store, write_store]] = (0, $7jsgb$react.useState)(()=>(0, $7jsgb$solidjsstore.createStore)(props));
|
|
27
29
|
// Update store when props change
|
|
@@ -30,13 +32,13 @@ function $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef({ solid_component: solid_comp
|
|
|
30
32
|
const wrapper_element = wrapper_element_ref.current;
|
|
31
33
|
// If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
|
|
32
34
|
// This can happen for HMR or when SSR capable components are only rendered on the client
|
|
33
|
-
const dispose = (0, $7jsgb$solidjsweb.render)(()=>solid_component(store), wrapper_element);
|
|
35
|
+
const dispose = (0, $7jsgb$solidjsweb.render)(()=>solid_component(store, wrapper_element), wrapper_element);
|
|
34
36
|
return dispose;
|
|
35
37
|
}, []);
|
|
36
38
|
return (0, $7jsgb$react.createElement)(wrapper_type, {
|
|
37
39
|
ref: wrapper_element_ref,
|
|
38
40
|
style: wrapper_style,
|
|
39
|
-
className:
|
|
41
|
+
className: className
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -100,7 +102,8 @@ function $847ac8ccd5089f8b$export$aea1707d7b01c3a2(react_props) {
|
|
|
100
102
|
local_filter_cache_: local_filter_cache_
|
|
101
103
|
});
|
|
102
104
|
},
|
|
103
|
-
props: react_props
|
|
105
|
+
props: react_props,
|
|
106
|
+
className: "depict plp"
|
|
104
107
|
});
|
|
105
108
|
}
|
|
106
109
|
|
|
@@ -142,11 +145,49 @@ function $d1927de554e8e7c1$export$d929db7fb6179159(react_props) {
|
|
|
142
145
|
filters.append(body);
|
|
143
146
|
return filters;
|
|
144
147
|
},
|
|
145
|
-
props: react_props
|
|
148
|
+
props: react_props,
|
|
149
|
+
className: "depict plp"
|
|
146
150
|
});
|
|
147
151
|
}
|
|
148
152
|
|
|
149
153
|
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
function $2214dc111b9e2866$export$4ea53cd12ff17334({ summary: summary_children , children: children , className: className , ...other_react_props }) {
|
|
160
|
+
let [summary, set_summary] = (0, $7jsgb$react.useState)();
|
|
161
|
+
if (!summary) {
|
|
162
|
+
summary = document.createElement("summary");
|
|
163
|
+
set_summary(summary);
|
|
164
|
+
}
|
|
165
|
+
let [child_wrapper, set_child_wrapper] = (0, $7jsgb$react.useState)();
|
|
166
|
+
if (!child_wrapper) {
|
|
167
|
+
child_wrapper = document.createElement("div");
|
|
168
|
+
set_child_wrapper(child_wrapper);
|
|
169
|
+
}
|
|
170
|
+
return (0, $7jsgb$react.createElement)((0, $7jsgb$react.Fragment), null, (0, $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef)({
|
|
171
|
+
solid_component: (props, wrapper_element)=>{
|
|
172
|
+
(0, $7jsgb$depictaiui.ExpandingDetails)({
|
|
173
|
+
children: child_wrapper,
|
|
174
|
+
details_: wrapper_element,
|
|
175
|
+
summary_: props.summary,
|
|
176
|
+
is_open_: (0, $a1efb49ef2dfa3c2$export$32717ad33b14d079)(()=>props.is_open, ()=>props.set_is_open)
|
|
177
|
+
});
|
|
178
|
+
return undefined; // ExpandingDetails just returns wrapper_element so we don't want to add any children here - results in nicer element structure
|
|
179
|
+
},
|
|
180
|
+
props: {
|
|
181
|
+
...other_react_props,
|
|
182
|
+
summary: summary,
|
|
183
|
+
child_wrapper: child_wrapper
|
|
184
|
+
},
|
|
185
|
+
wrapper_type: "details",
|
|
186
|
+
className: className
|
|
187
|
+
}), $7jsgb$reactdom.createPortal(summary_children, summary), $7jsgb$reactdom.createPortal(children, child_wrapper));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
150
191
|
(0, $7jsgb$depictaiutilishared.add_to_version_info)("react-ui", (0, $0a017be3a74fcc94$export$83d89fbfd8236492));
|
|
151
192
|
|
|
152
193
|
|
package/dist/module.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {add_to_version_info as $2MCgq$add_to_version_info} from "@depict-ai/utilishared";
|
|
2
2
|
import {createSignal as $2MCgq$createSignal, createMemo as $2MCgq$createMemo, untrack as $2MCgq$untrack} from "solid-js";
|
|
3
|
-
import {accessor_of_object_to_object_with_accessor_values as $2MCgq$accessor_of_object_to_object_with_accessor_values, create_modified_filters as $2MCgq$create_modified_filters, SelectedFilters as $2MCgq$SelectedFilters, FilterBody as $2MCgq$FilterBody} from "@depict-ai/ui";
|
|
3
|
+
import {accessor_of_object_to_object_with_accessor_values as $2MCgq$accessor_of_object_to_object_with_accessor_values, create_modified_filters as $2MCgq$create_modified_filters, SelectedFilters as $2MCgq$SelectedFilters, FilterBody as $2MCgq$FilterBody, ExpandingDetails as $2MCgq$ExpandingDetails} from "@depict-ai/ui";
|
|
4
4
|
import {render as $2MCgq$render, insert as $2MCgq$insert} from "solid-js/web";
|
|
5
|
-
import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement} from "react";
|
|
5
|
+
import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
|
|
6
6
|
import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
|
|
7
|
+
import {createPortal as $2MCgq$createPortal} from "react-dom";
|
|
7
8
|
|
|
8
9
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
9
|
-
const $91c11b750e80ede3$export$83d89fbfd8236492 = "0.0.
|
|
10
|
+
const $91c11b750e80ede3$export$83d89fbfd8236492 = "0.0.6";
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
@@ -14,7 +15,7 @@ const $91c11b750e80ede3$export$83d89fbfd8236492 = "0.0.5";
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
function $0fe03f2fcd2418f8$export$f6e64e17bd69eeef({ solid_component: solid_component , props: props , wrapper_type: wrapper_type = "div" , wrapper_style: wrapper_style = {} }) {
|
|
18
|
+
function $0fe03f2fcd2418f8$export$f6e64e17bd69eeef({ solid_component: solid_component , props: props , wrapper_type: wrapper_type = "div" , wrapper_style: wrapper_style = {} , className: className }) {
|
|
18
19
|
const wrapper_element_ref = (0, $2MCgq$useRef)();
|
|
19
20
|
const [[store, write_store]] = (0, $2MCgq$useState)(()=>(0, $2MCgq$createStore)(props));
|
|
20
21
|
// Update store when props change
|
|
@@ -23,13 +24,13 @@ function $0fe03f2fcd2418f8$export$f6e64e17bd69eeef({ solid_component: solid_comp
|
|
|
23
24
|
const wrapper_element = wrapper_element_ref.current;
|
|
24
25
|
// If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
|
|
25
26
|
// This can happen for HMR or when SSR capable components are only rendered on the client
|
|
26
|
-
const dispose = (0, $2MCgq$render)(()=>solid_component(store), wrapper_element);
|
|
27
|
+
const dispose = (0, $2MCgq$render)(()=>solid_component(store, wrapper_element), wrapper_element);
|
|
27
28
|
return dispose;
|
|
28
29
|
}, []);
|
|
29
30
|
return (0, $2MCgq$createElement)(wrapper_type, {
|
|
30
31
|
ref: wrapper_element_ref,
|
|
31
32
|
style: wrapper_style,
|
|
32
|
-
className:
|
|
33
|
+
className: className
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -93,7 +94,8 @@ function $9121beb5225e68fe$export$aea1707d7b01c3a2(react_props) {
|
|
|
93
94
|
local_filter_cache_: local_filter_cache_
|
|
94
95
|
});
|
|
95
96
|
},
|
|
96
|
-
props: react_props
|
|
97
|
+
props: react_props,
|
|
98
|
+
className: "depict plp"
|
|
97
99
|
});
|
|
98
100
|
}
|
|
99
101
|
|
|
@@ -135,12 +137,50 @@ function $74910c55affb3673$export$d929db7fb6179159(react_props) {
|
|
|
135
137
|
filters.append(body);
|
|
136
138
|
return filters;
|
|
137
139
|
},
|
|
138
|
-
props: react_props
|
|
140
|
+
props: react_props,
|
|
141
|
+
className: "depict plp"
|
|
139
142
|
});
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
function $c79c5cb5e9424dd7$export$4ea53cd12ff17334({ summary: summary_children , children: children , className: className , ...other_react_props }) {
|
|
152
|
+
let [summary, set_summary] = (0, $2MCgq$useState)();
|
|
153
|
+
if (!summary) {
|
|
154
|
+
summary = document.createElement("summary");
|
|
155
|
+
set_summary(summary);
|
|
156
|
+
}
|
|
157
|
+
let [child_wrapper, set_child_wrapper] = (0, $2MCgq$useState)();
|
|
158
|
+
if (!child_wrapper) {
|
|
159
|
+
child_wrapper = document.createElement("div");
|
|
160
|
+
set_child_wrapper(child_wrapper);
|
|
161
|
+
}
|
|
162
|
+
return (0, $2MCgq$createElement)((0, $2MCgq$Fragment), null, (0, $0fe03f2fcd2418f8$export$f6e64e17bd69eeef)({
|
|
163
|
+
solid_component: (props, wrapper_element)=>{
|
|
164
|
+
(0, $2MCgq$ExpandingDetails)({
|
|
165
|
+
children: child_wrapper,
|
|
166
|
+
details_: wrapper_element,
|
|
167
|
+
summary_: props.summary,
|
|
168
|
+
is_open_: (0, $d899f63cec76a884$export$32717ad33b14d079)(()=>props.is_open, ()=>props.set_is_open)
|
|
169
|
+
});
|
|
170
|
+
return undefined; // ExpandingDetails just returns wrapper_element so we don't want to add any children here - results in nicer element structure
|
|
171
|
+
},
|
|
172
|
+
props: {
|
|
173
|
+
...other_react_props,
|
|
174
|
+
summary: summary,
|
|
175
|
+
child_wrapper: child_wrapper
|
|
176
|
+
},
|
|
177
|
+
wrapper_type: "details",
|
|
178
|
+
className: className
|
|
179
|
+
}), $2MCgq$createPortal(summary_children, summary), $2MCgq$createPortal(children, child_wrapper));
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
143
183
|
(0, $2MCgq$add_to_version_info)("react-ui", (0, $91c11b750e80ede3$export$83d89fbfd8236492));
|
|
144
184
|
|
|
145
185
|
|
|
146
|
-
export {$9121beb5225e68fe$export$aea1707d7b01c3a2 as ReactSelectedFilters, $74910c55affb3673$export$d929db7fb6179159 as ReactFilterBody, $91c11b750e80ede3$export$83d89fbfd8236492 as version};
|
|
186
|
+
export {$9121beb5225e68fe$export$aea1707d7b01c3a2 as ReactSelectedFilters, $74910c55affb3673$export$d929db7fb6179159 as ReactFilterBody, $c79c5cb5e9424dd7$export$4ea53cd12ff17334 as ExpandingSection, $91c11b750e80ede3$export$83d89fbfd8236492 as version};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/portal-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"README.md"
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@depict-ai/plp-styling": "
|
|
81
|
-
"@depict-ai/react-ui": "
|
|
82
|
-
"@depict-ai/types": "
|
|
83
|
-
"@depict-ai/ui": "
|
|
84
|
-
"@depict-ai/utilishared": "
|
|
80
|
+
"@depict-ai/plp-styling": "^1.0.28",
|
|
81
|
+
"@depict-ai/react-ui": "^1.4.1",
|
|
82
|
+
"@depict-ai/types": "^1.0.31",
|
|
83
|
+
"@depict-ai/ui": "^1.4.1",
|
|
84
|
+
"@depict-ai/utilishared": "^1.0.27",
|
|
85
85
|
"solid-js": "^1.7.3"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|