@blocklet/pages-kit 0.2.317 → 0.2.319
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/locales/index.js +26 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +13 -9
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Input.js +66 -36
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Output.js +190 -57
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +236 -83
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +101 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.js +60 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +152 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js +80 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +32 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +54 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/utils.js +13 -0
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +52 -23
- package/lib/cjs/components/CustomComponentRenderer/state.js +23 -4
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/inject-global-components-dump-json.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/locales/index.js +26 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +16 -12
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Input.js +60 -30
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Output.js +191 -58
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Page.js +236 -83
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +92 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.js +55 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +144 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js +75 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +26 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +49 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/utils.js +9 -0
- package/lib/esm/builtin/async/ai-runtime/state/session.js +52 -23
- package/lib/esm/components/CustomComponentRenderer/state.js +22 -4
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/inject-global-components-dump-json.js +1 -1
- package/lib/types/builtin/async/ai-runtime/api/session.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +26 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.d.ts +2 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/Input.d.ts +1 -1
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.d.ts +20 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/Loading.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.d.ts +6 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.d.ts +16 -0
- package/lib/types/builtin/async/ai-runtime/runtime-components/V0/utils.d.ts +7 -0
- package/lib/types/builtin/async/ai-runtime/state/session.d.ts +11 -3
- package/lib/types/components/CustomComponentRenderer/state.d.ts +1 -0
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/types/core.d.ts +2 -1
- package/package.json +7 -7
|
@@ -424,7 +424,7 @@ export default function FormDemo() {
|
|
|
424
424
|
import { Icon } from '@blocklet/pages-kit/builtin/iconify/react';
|
|
425
425
|
|
|
426
426
|
export default function TablerSuccessIcon() {
|
|
427
|
-
return <Icon icon="tabler:check" />;
|
|
427
|
+
return <Icon icon="tabler:check" fontSize={24} color="rgba(75, 85, 99, 1)"/>;
|
|
428
428
|
}
|
|
429
429
|
`,
|
|
430
430
|
},
|
|
@@ -34,6 +34,7 @@ export declare const translations: {
|
|
|
34
34
|
rename: string;
|
|
35
35
|
delete: string;
|
|
36
36
|
confirmDelete: string;
|
|
37
|
+
confirm: string;
|
|
37
38
|
noData: string;
|
|
38
39
|
createObject: string;
|
|
39
40
|
title: string;
|
|
@@ -80,6 +81,18 @@ export declare const translations: {
|
|
|
80
81
|
send: string;
|
|
81
82
|
session: string;
|
|
82
83
|
loadMore: string;
|
|
84
|
+
v0: {
|
|
85
|
+
title: string;
|
|
86
|
+
description: string;
|
|
87
|
+
noData: string;
|
|
88
|
+
deleteSessionTitle: string;
|
|
89
|
+
deleteSessionTip: string;
|
|
90
|
+
propertiesSetting: string;
|
|
91
|
+
propertiesSettingTip: string;
|
|
92
|
+
cannotSetPropertiesTip: string;
|
|
93
|
+
codePreview: string;
|
|
94
|
+
codePreviewTip: string;
|
|
95
|
+
};
|
|
83
96
|
};
|
|
84
97
|
zh: {
|
|
85
98
|
by: string;
|
|
@@ -116,6 +129,7 @@ export declare const translations: {
|
|
|
116
129
|
rename: string;
|
|
117
130
|
delete: string;
|
|
118
131
|
confirmDelete: string;
|
|
132
|
+
confirm: string;
|
|
119
133
|
noData: string;
|
|
120
134
|
createObject: string;
|
|
121
135
|
title: string;
|
|
@@ -162,5 +176,17 @@ export declare const translations: {
|
|
|
162
176
|
send: string;
|
|
163
177
|
session: string;
|
|
164
178
|
loadMore: string;
|
|
179
|
+
v0: {
|
|
180
|
+
title: string;
|
|
181
|
+
description: string;
|
|
182
|
+
noData: string;
|
|
183
|
+
deleteSessionTitle: string;
|
|
184
|
+
deleteSessionTip: string;
|
|
185
|
+
propertiesSetting: string;
|
|
186
|
+
propertiesSettingTip: string;
|
|
187
|
+
cannotSetPropertiesTip: string;
|
|
188
|
+
codePreview: string;
|
|
189
|
+
codePreviewTip: string;
|
|
190
|
+
};
|
|
165
191
|
};
|
|
166
192
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function
|
|
1
|
+
export default function V0Input({ submitText, inlineLabel, autoFillLastForm, submitInQuestionField, chatMode, }: {
|
|
2
2
|
submitText?: string;
|
|
3
3
|
inlineLabel?: boolean;
|
|
4
4
|
autoFillLastForm?: boolean;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BoxProps } from '@mui/material';
|
|
3
|
+
import { MessageItem } from '../../../state/session';
|
|
4
|
+
export default function CodePreview({ componentId, code, propertiesValue, ...restProps }: {
|
|
5
|
+
componentId?: string;
|
|
6
|
+
code: string | undefined;
|
|
7
|
+
propertiesValue?: any;
|
|
8
|
+
} & BoxProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare const CodePreviewMemo: import("react").MemoExoticComponent<typeof CodePreview>;
|
|
10
|
+
export declare function CodeRenderByMessage({ zoom, message, minHeight, sx, propertiesValueMap, }: {
|
|
11
|
+
zoom?: number;
|
|
12
|
+
message: MessageItem | undefined;
|
|
13
|
+
minHeight?: number;
|
|
14
|
+
sx?: any;
|
|
15
|
+
propertiesValueMap?: {
|
|
16
|
+
[taskId: string]: any;
|
|
17
|
+
};
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const CodeRenderByMessageMemo: import("react").MemoExoticComponent<typeof CodeRenderByMessage>;
|
|
20
|
+
export declare function getCurrentCodeByTaskId(message: MessageItem | undefined, taskId: string): any;
|
package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DialogProps } from '@mui/material';
|
|
3
|
+
interface ConfirmDialogProps extends Omit<DialogProps, 'open'> {
|
|
4
|
+
}
|
|
5
|
+
declare const ConfirmDialog: import("react").ForwardRefExoticComponent<Omit<ConfirmDialogProps, "ref"> & import("react").RefAttributes<unknown>>;
|
|
6
|
+
export default ConfirmDialog;
|
package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DialogProps } from '@mui/material';
|
|
3
|
+
interface PropertiesSettingProps extends Omit<DialogProps, 'open'> {
|
|
4
|
+
}
|
|
5
|
+
declare const PropertiesSetting: import("react").ForwardRefExoticComponent<Omit<PropertiesSettingProps, "ref"> & import("react").RefAttributes<unknown>>;
|
|
6
|
+
export default PropertiesSetting;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface V0RuntimeContext {
|
|
3
|
+
setCurrentMessageTaskId: (messageId: string | undefined) => void;
|
|
4
|
+
currentMessageTaskId: string | undefined;
|
|
5
|
+
propertiesValueMap: {
|
|
6
|
+
[taskId: string]: any;
|
|
7
|
+
};
|
|
8
|
+
setPropertiesValueMap: (valueMap: {
|
|
9
|
+
[taskId: string]: any;
|
|
10
|
+
}) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function V0RuntimeProvider({ children }: {
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function useV0RuntimeContext(): V0RuntimeContext;
|
|
16
|
+
export {};
|
|
@@ -24,18 +24,26 @@ export interface SessionState {
|
|
|
24
24
|
currentSessionId?: string;
|
|
25
25
|
error?: Error;
|
|
26
26
|
reset: () => void;
|
|
27
|
-
load: (
|
|
27
|
+
load: (args?: {
|
|
28
|
+
autoSetCurrentSessionId?: boolean;
|
|
29
|
+
}) => Promise<void>;
|
|
30
|
+
reload: () => Promise<void>;
|
|
28
31
|
setCurrentSessionId: (sessionId: string) => void;
|
|
29
|
-
createSession: (
|
|
32
|
+
createSession: (args?: {
|
|
33
|
+
name?: string;
|
|
34
|
+
}) => Promise<Session>;
|
|
30
35
|
deleteSession: (args?: {
|
|
31
36
|
sessionId?: string;
|
|
37
|
+
autoSetCurrentSessionId?: boolean;
|
|
32
38
|
}) => Promise<void>;
|
|
33
39
|
clearSession: (args?: {
|
|
34
40
|
sessionId?: string;
|
|
35
41
|
}) => Promise<void>;
|
|
36
42
|
loadMoreMessages: (args?: {
|
|
37
43
|
sessionId?: string;
|
|
44
|
+
limit?: number;
|
|
38
45
|
}) => Promise<void>;
|
|
46
|
+
loadLatestMessagesForAllSessions: () => Promise<void>;
|
|
39
47
|
execute: (options: {
|
|
40
48
|
sessionId?: string;
|
|
41
49
|
aid: string;
|
|
@@ -47,6 +55,6 @@ export interface SessionState {
|
|
|
47
55
|
export declare const createSessionState: ({ aid }: {
|
|
48
56
|
aid: string;
|
|
49
57
|
}) => import("zustand").UseBoundStore<import("zustand").StoreApi<import("immer").WritableDraft<SessionState>>>;
|
|
50
|
-
export declare function useAutoLoadSessionState(): void;
|
|
58
|
+
export declare function useAutoLoadSessionState(...args: Parameters<SessionState['load']>): void;
|
|
51
59
|
export declare function useSessionState<U>(selector: (s: SessionState) => U): U;
|
|
52
60
|
export declare function useCurrentSessionState<U>(selector: (s?: SessionItemState) => U): U;
|