@optiaxiom/proteus 0.2.13-next.2 → 0.2.14
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/esm/assets/src/proteus-chart/{ProteusChart.css.ts.vanilla-dJjly98l.css → ProteusChart.css.ts.vanilla-CfYErTvq.css} +2 -2
- package/dist/esm/assets/src/proteus-chart/{ProteusChartTooltipContent.css.ts.vanilla-Crdo1SWy.css → ProteusChartTooltipContent.css.ts.vanilla-CFiMPH60.css} +2 -2
- package/dist/esm/assets/src/proteus-document/{ProteusDocumentShell.css.ts.vanilla-DvoqWndD.css → ProteusDocumentShell.css.ts.vanilla-C6b32Qx3.css} +2 -2
- package/dist/esm/assets/src/proteus-image-carousel/{ProteusImageCarousel.css.ts.vanilla-DWOlO6KM.css → ProteusImageCarousel.css.ts.vanilla-Dvvb8Qx5.css} +2 -2
- package/dist/esm/assets/src/proteus-question/{ProteusQuestion.css.ts.vanilla-DLqLEZxX.css → ProteusQuestion.css.ts.vanilla-BTVHkw1E.css} +2 -2
- package/dist/esm/proteus-card-link/ProteusCardLink.js +41 -0
- package/dist/esm/proteus-chart/ProteusChart-css.js +1 -1
- package/dist/esm/proteus-chart/ProteusChartTooltipContent-css.js +1 -1
- package/dist/esm/proteus-document/ProteusDocumentShell-css.js +1 -1
- package/dist/esm/proteus-document/ProteusDocumentShell.js +9 -5
- package/dist/esm/proteus-element/ProteusElement.js +6 -2
- package/dist/esm/proteus-file-icon/ProteusFileIcon.js +46 -0
- package/dist/esm/proteus-image-carousel/ProteusImageCarousel-css.js +1 -1
- package/dist/esm/proteus-question/ProteusQuestion-css.js +1 -1
- package/dist/esm/schema/public-schema.json.js +336 -111
- package/dist/esm/schema/runtime-schema.json.js +334 -111
- package/dist/index.d.ts +9 -1
- package/dist/spec.d.ts +2768 -2409
- package/package.json +4 -5
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { CardLink } from '@optiaxiom/react';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
|
|
6
|
+
import { useResolveProteusValues } from '../proteus-document/useResolveProteusValues.js';
|
|
7
|
+
|
|
8
|
+
function ProteusCardLink({
|
|
9
|
+
children,
|
|
10
|
+
onClick,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
const { onEvent } = useProteusDocumentContext(
|
|
14
|
+
"@optiaxiom/proteus/ProteusCardLink"
|
|
15
|
+
);
|
|
16
|
+
const resolvedOnClick = useResolveProteusValues(
|
|
17
|
+
onClick ?? {}
|
|
18
|
+
);
|
|
19
|
+
const [loading, setLoading] = useState(false);
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
CardLink,
|
|
22
|
+
{
|
|
23
|
+
"aria-busy": loading || void 0,
|
|
24
|
+
onClick: onClick ? async (event) => {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
if (loading) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
setLoading(true);
|
|
30
|
+
await onEvent(resolvedOnClick);
|
|
31
|
+
setLoading(false);
|
|
32
|
+
} : void 0,
|
|
33
|
+
target: "_blank",
|
|
34
|
+
...props,
|
|
35
|
+
children
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
ProteusCardLink.displayName = "@optiaxiom/proteus/ProteusCardLink";
|
|
40
|
+
|
|
41
|
+
export { ProteusCardLink };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-chart/ProteusChart.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-chart/ProteusChart.css.ts.vanilla-CfYErTvq.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var chart = recipe({base:[{border:'1',borderColor:'border.tertiary',fontSize:'sm',p:'16'},'ProteusChart__jmlqij1','ProteusChart__jmlqij0']});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-chart/ProteusChartTooltipContent.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-chart/ProteusChartTooltipContent.css.ts.vanilla-CFiMPH60.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var tooltip = recipe({base:[{bg:'bg.default',border:'1',borderColor:'border.secondary',display:'grid',fontSize:'sm',gap:'6',pointerEvents:'none',px:'8',py:'10',rounded:'lg',shadow:'lg',transition:'all',z:'popover'},'ProteusChartTooltipContent__1gsvq810']});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-document/ProteusDocumentShell.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-document/ProteusDocumentShell.css.ts.vanilla-C6b32Qx3.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var body = recipe({base:[{flexDirection:'column',gap:'16'},'ProteusDocumentShell__vpuvfj0'],variants:{truncate:{false:{},true:[{maxH:'sm',overflow:'auto',p:'4'},'ProteusDocumentShell__vpuvfj1']}}});
|
|
@@ -20,6 +20,7 @@ function ProteusDocumentShell({
|
|
|
20
20
|
onInteraction,
|
|
21
21
|
onMessage,
|
|
22
22
|
onOpenChange,
|
|
23
|
+
onPreview,
|
|
23
24
|
onTrack,
|
|
24
25
|
onUpload,
|
|
25
26
|
open: openProp,
|
|
@@ -61,6 +62,7 @@ function ProteusDocumentShell({
|
|
|
61
62
|
}, []);
|
|
62
63
|
const collapsible = collapsibleProp && element.appName;
|
|
63
64
|
const Trigger = collapsible ? DisclosureTrigger : Box;
|
|
65
|
+
const inline = !element.title && !element.appName && !element.blocking;
|
|
64
66
|
return /* @__PURE__ */ jsx(
|
|
65
67
|
ProteusDocumentProvider,
|
|
66
68
|
{
|
|
@@ -98,6 +100,8 @@ function ProteusDocumentShell({
|
|
|
98
100
|
if (typeof event.url === "string") {
|
|
99
101
|
window.open(event.url, "_blank", "noopener,noreferrer");
|
|
100
102
|
}
|
|
103
|
+
} else if (event.action === "preview") {
|
|
104
|
+
await onPreview?.(event.file);
|
|
101
105
|
}
|
|
102
106
|
return;
|
|
103
107
|
}),
|
|
@@ -114,13 +118,13 @@ function ProteusDocumentShell({
|
|
|
114
118
|
children: /* @__PURE__ */ jsxs(
|
|
115
119
|
Disclosure,
|
|
116
120
|
{
|
|
117
|
-
bg: "bg.default",
|
|
118
|
-
border: "1",
|
|
119
|
-
borderColor: "border.tertiary",
|
|
121
|
+
bg: inline ? void 0 : "bg.default",
|
|
122
|
+
border: inline ? void 0 : "1",
|
|
123
|
+
borderColor: inline ? void 0 : "border.tertiary",
|
|
120
124
|
onOpenChange: setOpen,
|
|
121
125
|
open,
|
|
122
|
-
p: "20",
|
|
123
|
-
rounded: "xl",
|
|
126
|
+
p: inline ? void 0 : "20",
|
|
127
|
+
rounded: inline ? void 0 : "xl",
|
|
124
128
|
children: [
|
|
125
129
|
element.appName && /* @__PURE__ */ jsx(Trigger, { py: "0", ...collapsible ? { chevronPosition: "end" } : {}, children: /* @__PURE__ */ jsxs(Group, { fontSize: "sm", gap: "8", children: [
|
|
126
130
|
/* @__PURE__ */ jsx(
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { Text, Separator, SelectTrigger, SelectContent, Link, Box, Heading, Group, Field,
|
|
3
|
+
import { Text, Separator, SelectTrigger, SelectContent, Link, Box, Heading, Group, Field, CardHeader, Card, Badge, Avatar } from '@optiaxiom/react';
|
|
4
4
|
import { Time, Range } from '@optiaxiom/react/unstable';
|
|
5
5
|
import { lazy, Suspense } from 'react';
|
|
6
6
|
import { IconCalendar } from '../icons/IconCalendar.js';
|
|
7
7
|
import { ProteusAction } from '../proteus-action/ProteusAction.js';
|
|
8
8
|
import { ProteusBridge } from '../proteus-bridge/ProteusBridge.js';
|
|
9
|
+
import { ProteusCardLink } from '../proteus-card-link/ProteusCardLink.js';
|
|
9
10
|
import { ProteusDataTable } from '../proteus-data-table/ProteusDataTable.js';
|
|
10
11
|
import { useProteusDocumentContext } from '../proteus-document/ProteusDocumentContext.js';
|
|
11
12
|
import { useProteusDocumentPathContext } from '../proteus-document/ProteusDocumentPathContext.js';
|
|
12
13
|
import { resolveProteusProp } from '../proteus-document/resolveProteusProp.js';
|
|
13
14
|
import { safeParseElement } from '../proteus-document/schemas.js';
|
|
14
15
|
import { ProteusFederated } from '../proteus-federated/ProteusFederated.js';
|
|
16
|
+
import { ProteusFileIcon } from '../proteus-file-icon/ProteusFileIcon.js';
|
|
15
17
|
import { ProteusFileUpload } from '../proteus-file-upload/ProteusFileUpload.js';
|
|
16
18
|
import { ProteusImageCarousel } from '../proteus-image-carousel/ProteusImageCarousel.js';
|
|
17
19
|
import { ProteusImage } from '../proteus-image/ProteusImage.js';
|
|
@@ -82,7 +84,7 @@ const ProteusElement = ({
|
|
|
82
84
|
case "CardHeader":
|
|
83
85
|
return /* @__PURE__ */ jsx(CardHeader, { ...resolve(element) });
|
|
84
86
|
case "CardLink":
|
|
85
|
-
return /* @__PURE__ */ jsx(
|
|
87
|
+
return /* @__PURE__ */ jsx(ProteusCardLink, { ...resolve(element) });
|
|
86
88
|
case "Chart":
|
|
87
89
|
return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
88
90
|
ProteusChart,
|
|
@@ -106,6 +108,8 @@ const ProteusElement = ({
|
|
|
106
108
|
);
|
|
107
109
|
case "Field":
|
|
108
110
|
return /* @__PURE__ */ jsx(Field, { ...resolve(element) });
|
|
111
|
+
case "FileIcon":
|
|
112
|
+
return /* @__PURE__ */ jsx(ProteusFileIcon, { ...resolve(element) });
|
|
109
113
|
case "FileUpload":
|
|
110
114
|
return /* @__PURE__ */ jsx(ProteusFileUpload, { ...resolve(element) });
|
|
111
115
|
case "Group":
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { IconFileImage, IconFileVideo, IconMusic, IconPresentationScreen, IconTableLayout, IconFileZipper, IconFileLines, IconCode, IconFile } from '@optiaxiom/icons';
|
|
4
|
+
import { Box } from '@optiaxiom/react';
|
|
5
|
+
|
|
6
|
+
const mimeIconMap = [
|
|
7
|
+
[/^image\//, IconFileImage],
|
|
8
|
+
[/^video\//, IconFileVideo],
|
|
9
|
+
[/^audio\//, IconMusic],
|
|
10
|
+
[/presentation|powerpoint|keynote|slides/, IconPresentationScreen],
|
|
11
|
+
[/spreadsheet|excel|csv|tsv|parquet/, IconTableLayout],
|
|
12
|
+
[/zip|tar|compress|archive|x-7z|x-rar/, IconFileZipper],
|
|
13
|
+
[/pdf|word|wordprocessing|opendocument\.text|^text\//, IconFileLines],
|
|
14
|
+
[
|
|
15
|
+
/json|xml|yaml|javascript|typescript|html|css|x-sh|x-python|code|script/,
|
|
16
|
+
IconCode
|
|
17
|
+
]
|
|
18
|
+
];
|
|
19
|
+
function ProteusFileIcon({ mimeType, ...props }) {
|
|
20
|
+
const Icon = getIconForMimeType(mimeType);
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
Box,
|
|
23
|
+
{
|
|
24
|
+
asChild: true,
|
|
25
|
+
bg: "bg.secondary",
|
|
26
|
+
color: "fg.tertiary",
|
|
27
|
+
p: "8",
|
|
28
|
+
rounded: "md",
|
|
29
|
+
...props,
|
|
30
|
+
children: /* @__PURE__ */ jsx(Icon, {})
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function getIconForMimeType(mimeType) {
|
|
35
|
+
if (mimeType) {
|
|
36
|
+
for (const [pattern, Icon] of mimeIconMap) {
|
|
37
|
+
if (pattern.test(mimeType)) {
|
|
38
|
+
return Icon;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return IconFile;
|
|
43
|
+
}
|
|
44
|
+
ProteusFileIcon.displayName = "@optiaxiom/proteus/ProteusFileIcon";
|
|
45
|
+
|
|
46
|
+
export { ProteusFileIcon };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-image-carousel/ProteusImageCarousel.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-image-carousel/ProteusImageCarousel.css.ts.vanilla-Dvvb8Qx5.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var carousel = recipe({base:[{flexDirection:'column',gap:'12'},'ProteusImageCarousel__1t6qej70']});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './../assets/src/proteus-question/ProteusQuestion.css.ts.vanilla-
|
|
1
|
+
import './../assets/src/proteus-question/ProteusQuestion.css.ts.vanilla-BTVHkw1E.css';
|
|
2
2
|
import { recipe } from '@optiaxiom/react/css-runtime';
|
|
3
3
|
|
|
4
4
|
var addon = recipe({base:[{display:'grid',fontWeight:'500',placeItems:'center',rounded:'lg',size:'md',transition:'colors'},'ProteusQuestion__8f590p3'],variants:{cursor:{pointer:{cursor:'pointer'}}}});
|