@blocklet/aigne-hub 0.5.10 → 0.5.12
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.
|
@@ -217,11 +217,7 @@ function useConversation({ scrollToBottom, textCompletions, imageGenerations, en
|
|
|
217
217
|
setMessages((v) => (0, immer_1.produce)(v, (draft) => {
|
|
218
218
|
const item = draft.find((i) => i.id === id);
|
|
219
219
|
if (item) {
|
|
220
|
-
|
|
221
|
-
item.error = {
|
|
222
|
-
message: error instanceof Error ? error.message : String(error),
|
|
223
|
-
type: 'unknown',
|
|
224
|
-
};
|
|
220
|
+
item.error = error;
|
|
225
221
|
}
|
|
226
222
|
}));
|
|
227
223
|
return null;
|
|
@@ -16,14 +16,14 @@ function CreditErrorAlert({ error, ...props }) {
|
|
|
16
16
|
if (!isCreditError) {
|
|
17
17
|
return ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "error", ...props, children: (0, error_1.formatError)(error) || t('unknownError') }));
|
|
18
18
|
}
|
|
19
|
-
return ((0, jsx_runtime_1.
|
|
20
|
-
px:
|
|
21
|
-
py:
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Alert, { severity: "warning", ...props, sx: {
|
|
20
|
+
px: 2,
|
|
21
|
+
py: 1,
|
|
22
22
|
'& .MuiAlert-message': {
|
|
23
23
|
width: '100%',
|
|
24
24
|
},
|
|
25
25
|
...props.sx,
|
|
26
|
-
},
|
|
26
|
+
}, action: (0, jsx_runtime_1.jsx)(button_1.default, { shouldOpenInNewTab: true, size: "small", variant: "outlined", color: "warning", sx: { whiteSpace: 'nowrap' }, children: t('buyCreditsNow') }), children: t('creditNotEnoughTip') }));
|
|
27
27
|
}
|
|
28
28
|
exports.default = (0, withLocaleProvider_1.default)(CreditErrorAlert, {
|
|
29
29
|
translations: {
|
|
@@ -214,11 +214,7 @@ export default function useConversation({ scrollToBottom, textCompletions, image
|
|
|
214
214
|
setMessages((v) => produce(v, (draft) => {
|
|
215
215
|
const item = draft.find((i) => i.id === id);
|
|
216
216
|
if (item) {
|
|
217
|
-
|
|
218
|
-
item.error = {
|
|
219
|
-
message: error instanceof Error ? error.message : String(error),
|
|
220
|
-
type: 'unknown',
|
|
221
|
-
};
|
|
217
|
+
item.error = error;
|
|
222
218
|
}
|
|
223
219
|
}));
|
|
224
220
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
3
3
|
import { formatError } from '@blocklet/error';
|
|
4
|
-
import { Alert
|
|
4
|
+
import { Alert } from '@mui/material';
|
|
5
5
|
import { CreditErrorType } from '../../api/error';
|
|
6
6
|
import withLocaleProvider from '../../utils/withLocaleProvider';
|
|
7
7
|
import CreditButton from './button';
|
|
@@ -11,14 +11,14 @@ function CreditErrorAlert({ error, ...props }) {
|
|
|
11
11
|
if (!isCreditError) {
|
|
12
12
|
return (_jsx(Alert, { severity: "error", ...props, children: formatError(error) || t('unknownError') }));
|
|
13
13
|
}
|
|
14
|
-
return (
|
|
15
|
-
px:
|
|
16
|
-
py:
|
|
14
|
+
return (_jsx(Alert, { severity: "warning", ...props, sx: {
|
|
15
|
+
px: 2,
|
|
16
|
+
py: 1,
|
|
17
17
|
'& .MuiAlert-message': {
|
|
18
18
|
width: '100%',
|
|
19
19
|
},
|
|
20
20
|
...props.sx,
|
|
21
|
-
},
|
|
21
|
+
}, action: _jsx(CreditButton, { shouldOpenInNewTab: true, size: "small", variant: "outlined", color: "warning", sx: { whiteSpace: 'nowrap' }, children: t('buyCreditsNow') }), children: t('creditNotEnoughTip') }));
|
|
22
22
|
}
|
|
23
23
|
export default withLocaleProvider(CreditErrorAlert, {
|
|
24
24
|
translations: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/aigne-hub",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"description": "The react.js component library for AIGNE Hub",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@arcblock/did": "^1.27.2",
|
|
104
|
-
"@arcblock/ux": "^3.1.
|
|
105
|
-
"@blocklet/error": "0.3.
|
|
106
|
-
"@blocklet/logger": "^1.17.0-beta-
|
|
107
|
-
"@blocklet/payment-js": "^1.22.
|
|
108
|
-
"@blocklet/sdk": "^1.17.0-beta-
|
|
104
|
+
"@arcblock/ux": "^3.1.58",
|
|
105
|
+
"@blocklet/error": "0.3.1",
|
|
106
|
+
"@blocklet/logger": "^1.17.0-beta-20251105-095418-158ab2fa",
|
|
107
|
+
"@blocklet/payment-js": "^1.22.7",
|
|
108
|
+
"@blocklet/sdk": "^1.17.0-beta-20251105-095418-158ab2fa",
|
|
109
109
|
"@emotion/css": "^11.13.5",
|
|
110
110
|
"@emotion/react": "^11.14.0",
|
|
111
111
|
"@emotion/styled": "^11.14.1",
|