@blocklet/pages-kit 0.2.298 → 0.2.300
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/lib/cjs/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.js +9 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/SimpleOutput/index.js +3 -1
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.js +10 -1
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/SimpleOutput/index.js +3 -1
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.d.ts +1 -1
- package/package.json +7 -7
- package/tsconfig.json +1 -1
package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.js
CHANGED
|
@@ -40,6 +40,15 @@ function PhotoGalleryItem() {
|
|
|
40
40
|
const [openDialog, setOpenDialog] = (0, react_2.useState)(false);
|
|
41
41
|
const objects = (_b = (_a = message.result) === null || _a === void 0 ? void 0 : _a.objects) !== null && _b !== void 0 ? _b : [];
|
|
42
42
|
const images = objects.flatMap((i) => { var _a; return (_a = i.data[types_1.RuntimeOutputVariable.images]) !== null && _a !== void 0 ? _a : []; });
|
|
43
|
+
if (!images.length && message.error) {
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Stack, { alignItems: "center", justifyContent: "center", sx: {
|
|
45
|
+
aspectRatio: 1,
|
|
46
|
+
bgcolor: 'grey.50',
|
|
47
|
+
borderRadius: 1,
|
|
48
|
+
overflow: 'hidden',
|
|
49
|
+
wordBreak: 'break-word',
|
|
50
|
+
}, children: (0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", sx: { bgcolor: 'transparent' }, children: message.error.message }) }));
|
|
51
|
+
}
|
|
43
52
|
return images.map(({ url }, index) => {
|
|
44
53
|
var _a;
|
|
45
54
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { className: "photo-wall-item", sx: {
|
package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/SimpleOutput/index.js
CHANGED
|
@@ -8,10 +8,12 @@ const material_1 = require("@mui/material");
|
|
|
8
8
|
const common_1 = require("../../../common");
|
|
9
9
|
const MarkdownRenderer_1 = __importDefault(require("../../../MarkdownRenderer"));
|
|
10
10
|
const CurrentMessage_1 = require("../../contexts/CurrentMessage");
|
|
11
|
+
const MessageErrorView_1 = __importDefault(require("../ChatOutput/MessageErrorView"));
|
|
11
12
|
function SimpleOutput() {
|
|
12
13
|
var _a, _b;
|
|
13
14
|
const { message } = (0, CurrentMessage_1.useCurrentMessage)();
|
|
14
15
|
const objects = (_a = message.result) === null || _a === void 0 ? void 0 : _a.objects;
|
|
15
|
-
|
|
16
|
+
const { error } = message;
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { gap: 2, boxShadow: 1, borderRadius: 1, p: 2, children: [(0, jsx_runtime_1.jsx)(MarkdownRenderer_1.default, { children: (_b = message.result) === null || _b === void 0 ? void 0 : _b.content }), error && (0, jsx_runtime_1.jsx)(MessageErrorView_1.default, { error: error }), objects === null || objects === void 0 ? void 0 : objects.map((item) => (0, jsx_runtime_1.jsx)(common_1.MessageMetadataRenderer, { object: item.data }))] }));
|
|
16
18
|
}
|
|
17
19
|
exports.default = SimpleOutput;
|
package/lib/esm/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.js
CHANGED
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { RuntimeOutputVariable } from '@blocklet/ai-runtime/types';
|
|
14
14
|
import { Icon } from '@iconify/react';
|
|
15
|
-
import { Box, Button, Dialog, DialogContent, DialogTitle, Stack, Typography, alpha } from '@mui/material';
|
|
15
|
+
import { Alert, Box, Button, Dialog, DialogContent, DialogTitle, Stack, Typography, alpha, } from '@mui/material';
|
|
16
16
|
import { useState } from 'react';
|
|
17
17
|
import { RelativeTime } from '../../../../../../arcblock/ux';
|
|
18
18
|
import { useLocaleContext } from '../../../../../../locale';
|
|
@@ -35,6 +35,15 @@ export default function PhotoGalleryItem() {
|
|
|
35
35
|
const [openDialog, setOpenDialog] = useState(false);
|
|
36
36
|
const objects = (_b = (_a = message.result) === null || _a === void 0 ? void 0 : _a.objects) !== null && _b !== void 0 ? _b : [];
|
|
37
37
|
const images = objects.flatMap((i) => { var _a; return (_a = i.data[RuntimeOutputVariable.images]) !== null && _a !== void 0 ? _a : []; });
|
|
38
|
+
if (!images.length && message.error) {
|
|
39
|
+
return (_jsx(Stack, { alignItems: "center", justifyContent: "center", sx: {
|
|
40
|
+
aspectRatio: 1,
|
|
41
|
+
bgcolor: 'grey.50',
|
|
42
|
+
borderRadius: 1,
|
|
43
|
+
overflow: 'hidden',
|
|
44
|
+
wordBreak: 'break-word',
|
|
45
|
+
}, children: _jsx(Alert, { severity: "error", sx: { bgcolor: 'transparent' }, children: message.error.message }) }));
|
|
46
|
+
}
|
|
38
47
|
return images.map(({ url }, index) => {
|
|
39
48
|
var _a;
|
|
40
49
|
return (_jsxs(Box, { className: "photo-wall-item", sx: {
|
package/lib/esm/builtin/async/ai-runtime/components/runtime/components/SimpleOutput/index.js
CHANGED
|
@@ -3,9 +3,11 @@ import { Stack } from '@mui/material';
|
|
|
3
3
|
import { MessageMetadataRenderer } from '../../../common';
|
|
4
4
|
import MarkdownRenderer from '../../../MarkdownRenderer';
|
|
5
5
|
import { useCurrentMessage } from '../../contexts/CurrentMessage';
|
|
6
|
+
import MessageErrorView from '../ChatOutput/MessageErrorView';
|
|
6
7
|
export default function SimpleOutput() {
|
|
7
8
|
var _a, _b;
|
|
8
9
|
const { message } = useCurrentMessage();
|
|
9
10
|
const objects = (_a = message.result) === null || _a === void 0 ? void 0 : _a.objects;
|
|
10
|
-
|
|
11
|
+
const { error } = message;
|
|
12
|
+
return (_jsxs(Stack, { gap: 2, boxShadow: 1, borderRadius: 1, p: 2, children: [_jsx(MarkdownRenderer, { children: (_b = message.result) === null || _b === void 0 ? void 0 : _b.content }), error && _jsx(MessageErrorView, { error: error }), objects === null || objects === void 0 ? void 0 : objects.map((item) => _jsx(MessageMetadataRenderer, { object: item.data }))] }));
|
|
11
13
|
}
|
package/lib/types/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function PhotoGalleryItem(): import("react/jsx-runtime").JSX.Element[];
|
|
1
|
+
export default function PhotoGalleryItem(): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.300",
|
|
4
4
|
"description": "Pages Kit components and utils",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"url": "git+https://github.com/blocklet/pages-kit.git"
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"@arcblock/did-connect": "^2.9.
|
|
85
|
-
"@blocklet/ai-kit": "^0.1.
|
|
86
|
-
"@blocklet/ai-runtime": "^0.1.
|
|
84
|
+
"@arcblock/did-connect": "^2.9.77",
|
|
85
|
+
"@blocklet/ai-kit": "^0.1.30",
|
|
86
|
+
"@blocklet/ai-runtime": "^0.1.371",
|
|
87
87
|
"@blocklet/js-sdk": "1.16.26",
|
|
88
88
|
"@blocklet/sdk": "^1.16.26",
|
|
89
89
|
"@iconify/react": "^4.1.1",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"react-error-boundary": "^4.0.13",
|
|
100
100
|
"react-frame-component": "^5.2.6",
|
|
101
101
|
"react-helmet": "^6.1.0",
|
|
102
|
-
"react-hook-form": "^7.51.
|
|
102
|
+
"react-hook-form": "^7.51.4",
|
|
103
103
|
"react-markdown": "^9.0.1",
|
|
104
104
|
"react-scroll-to-bottom": "^4.2.0",
|
|
105
105
|
"react-share": "^5.1.0",
|
|
@@ -123,14 +123,14 @@
|
|
|
123
123
|
"react-router-dom": "^6.16.0"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|
|
126
|
-
"@arcblock/ux": "^2.9.
|
|
126
|
+
"@arcblock/ux": "^2.9.77",
|
|
127
127
|
"@emotion/cache": "^11.11.0",
|
|
128
128
|
"@emotion/css": "^11.11.2",
|
|
129
129
|
"@emotion/react": "^11.11.4",
|
|
130
130
|
"@mui/icons-material": "^5.15.16",
|
|
131
131
|
"@mui/lab": "^5.0.0-alpha.170",
|
|
132
132
|
"@mui/material": "^5.15.16",
|
|
133
|
-
"@types/lodash": "^4.17.
|
|
133
|
+
"@types/lodash": "^4.17.1",
|
|
134
134
|
"@types/mustache": "^4.2.5",
|
|
135
135
|
"@types/node-fetch": "^2.6.11",
|
|
136
136
|
"@types/react": "^18.3.1",
|
package/tsconfig.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"lib": ["DOM"],
|
|
7
7
|
"paths": {
|
|
8
8
|
// FIXME: Just for local dev, comment next line before publish
|
|
9
|
-
"@blocklet/ai-runtime/*": ["../../../ai-studio/packages/ai-runtime/src/*"]
|
|
9
|
+
// "@blocklet/ai-runtime/*": ["../../../ai-studio/packages/ai-runtime/src/*"]
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|