@blocklet/pages-kit 0.2.367 → 0.2.369
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/AgentSettings/AgentSettingsDialog.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/locales/index.js +2 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +3 -3
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/AgentSettings/AgentSettingsDialog.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/locales/index.js +2 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/AutoForm/index.js +3 -3
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +2 -0
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
};
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
import { LoadingButton } from '@mui/lab';
|
|
23
|
-
import { Button, Dialog, DialogActions, DialogContent, DialogTitle,
|
|
23
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Link, Stack, TextField, Typography, } from '@mui/material';
|
|
24
24
|
import { useForm } from 'react-hook-form';
|
|
25
25
|
import { create } from 'zustand';
|
|
26
26
|
import { immer } from 'zustand/middleware/immer';
|
|
@@ -72,5 +72,5 @@ export default function AgentSettingsDialog(_a) {
|
|
|
72
72
|
throw error;
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
|
-
return (_jsxs(Dialog, Object.assign({ fullWidth: true, maxWidth: "md" }, props, { open: isOpen, onClose: onClose, component: "form", onSubmit: form.handleSubmit(onSubmit), children: [_jsx(DialogTitle, { children: t('settings') }), _jsx(DialogContent, { children: _jsx(Stack, { gap: 1, children: agent.config.secrets.map(({ targetInput, hasValue }, index) => (_jsxs(Stack, { gap: 0.5, children: [
|
|
75
|
+
return (_jsxs(Dialog, Object.assign({ fullWidth: true, maxWidth: "md" }, props, { open: isOpen, onClose: onClose, component: "form", onSubmit: form.handleSubmit(onSubmit), children: [_jsx(DialogTitle, { children: t('settings') }), _jsx(DialogContent, { children: _jsx(Stack, { gap: 1, children: agent.config.secrets.map(({ targetInput, hasValue }, index) => (_jsxs(Stack, { gap: 0.5, children: [_jsxs(Typography, { variant: "caption", children: [targetInput.label || targetInput.key, ' ', targetInput.docLink && (_jsx(Link, { href: targetInput.docLink, target: "_blank", children: t('docLink') }))] }), _jsx(TextField, Object.assign({ autoFocus: index === 0, type: "password", fullWidth: true, hiddenLabel: true, size: "small", inputProps: { maxLength: 100 }, placeholder: hasValue ? '******' : targetInput.placeholder }, form.register(`secrets.${index}.secret`, { required: true })))] }, targetInput.id))) }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: onClose, children: t('cancel') }), _jsx(LoadingButton, { type: "submit", variant: "contained", loading: form.formState.isSubmitting, children: t('save') })] })] })));
|
|
76
76
|
}
|
|
@@ -113,6 +113,7 @@ export const translations = {
|
|
|
113
113
|
},
|
|
114
114
|
settings: 'Settings',
|
|
115
115
|
setup: 'Setup',
|
|
116
|
+
docLink: 'Document Link',
|
|
116
117
|
},
|
|
117
118
|
zh: {
|
|
118
119
|
by: '作者',
|
|
@@ -228,5 +229,6 @@ export const translations = {
|
|
|
228
229
|
},
|
|
229
230
|
settings: '设置',
|
|
230
231
|
setup: '设置',
|
|
232
|
+
docLink: '文档链接',
|
|
231
233
|
},
|
|
232
234
|
};
|
|
@@ -82,13 +82,13 @@ export default function AutoForm({ submitText, inlineLabel, autoFillLastForm = t
|
|
|
82
82
|
: undefined,
|
|
83
83
|
}, render: ({ field, fieldState }) => {
|
|
84
84
|
var _a;
|
|
85
|
-
return (_jsxs(Stack, { className: "form-item", children: [parameter.label && _jsx(FormLabel, { children: parameter.label }), _jsx(AgentInputField, { inputRef: field.ref, autoFocus: index === 0, size: "small", hiddenLabel: true, fullWidth: true, label: undefined, parameter: parameter, maxRows: !(parameter === null || parameter === void 0 ? void 0 : parameter.type) || (parameter === null || parameter === void 0 ? void 0 : parameter.type) === 'string' ? 5 : undefined, value: field.value || '', onChange: (value) => field.onChange({ target: { value } }), error: Boolean(fieldState.error), helperText: ((_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message) || (parameter === null || parameter === void 0 ? void 0 : parameter.helper), InputProps: parameter.key === 'question' && submitInQuestionField
|
|
85
|
+
return (_jsxs(Stack, { className: "form-item", children: [parameter.label && _jsx(FormLabel, { children: parameter.label }), _jsx(AgentInputField, { inputProps: { 'data-testid': `runtime-input-${key}` }, inputRef: field.ref, autoFocus: index === 0, size: "small", hiddenLabel: true, fullWidth: true, label: undefined, parameter: parameter, maxRows: !(parameter === null || parameter === void 0 ? void 0 : parameter.type) || (parameter === null || parameter === void 0 ? void 0 : parameter.type) === 'string' ? 5 : undefined, value: field.value || '', onChange: (value) => field.onChange({ target: { value } }), error: Boolean(fieldState.error), helperText: ((_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message) || (parameter === null || parameter === void 0 ? void 0 : parameter.helper), InputProps: parameter.key === 'question' && submitInQuestionField
|
|
86
86
|
? {
|
|
87
|
-
endAdornment: (_jsx(InputAdornment, { position: "end", sx: { py: 3, mr: -0.75, alignSelf: 'flex-end' }, children: _jsx(LoadingButton, { ref: submitRef, type: "submit", variant: "contained", loading: running, disabled: submitDisabled, sx: { borderRadius: 1.5 }, children: submitText }) })),
|
|
87
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", sx: { py: 3, mr: -0.75, alignSelf: 'flex-end' }, children: _jsx(LoadingButton, { "data-testid": "runtime-submit-button", ref: submitRef, type: "submit", variant: "contained", loading: running, disabled: submitDisabled, sx: { borderRadius: 1.5 }, children: submitText }) })),
|
|
88
88
|
}
|
|
89
89
|
: undefined })] }));
|
|
90
90
|
} }) }, parameter.id));
|
|
91
|
-
}), !(submitInQuestionField && (parameters === null || parameters === void 0 ? void 0 : parameters.some((i) => i.key === 'question'))) && (_jsx(LoadingButton, { ref: submitRef, type: "submit", variant: "contained", loading: running, disabled: submitDisabled, sx: { height: 40 }, children: submitText || t('generate') }))] }));
|
|
91
|
+
}), !(submitInQuestionField && (parameters === null || parameters === void 0 ? void 0 : parameters.some((i) => i.key === 'question'))) && (_jsx(LoadingButton, { "data-testid": "runtime-submit-button", ref: submitRef, type: "submit", variant: "contained", loading: running, disabled: submitDisabled, sx: { height: 40 }, children: submitText || t('generate') }))] }));
|
|
92
92
|
}
|
|
93
93
|
function useInitialFormValues() {
|
|
94
94
|
const preferences = useComponentPreferences();
|