@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.
Files changed (52) hide show
  1. package/lib/cjs/builtin/async/ai-runtime/locales/index.js +26 -0
  2. package/lib/cjs/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +2 -2
  3. package/lib/cjs/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +1 -1
  4. package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +13 -9
  5. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Input.js +66 -36
  6. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Output.js +190 -57
  7. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/Page.js +236 -83
  8. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +101 -0
  9. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.js +60 -0
  10. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +152 -0
  11. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js +80 -0
  12. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +32 -0
  13. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +54 -0
  14. package/lib/cjs/builtin/async/ai-runtime/runtime-components/V0/utils.js +13 -0
  15. package/lib/cjs/builtin/async/ai-runtime/state/session.js +52 -23
  16. package/lib/cjs/components/CustomComponentRenderer/state.js +23 -4
  17. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  18. package/lib/cjs/utils/inject-global-components-dump-json.js +1 -1
  19. package/lib/esm/builtin/async/ai-runtime/locales/index.js +26 -0
  20. package/lib/esm/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.js +2 -2
  21. package/lib/esm/builtin/async/ai-runtime/runtime-components/GoogleSearch/GoogleSearchSourcesView.js +1 -1
  22. package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +16 -12
  23. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Input.js +60 -30
  24. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Output.js +191 -58
  25. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/Page.js +236 -83
  26. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.js +92 -0
  27. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.js +55 -0
  28. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/Loading.js +144 -0
  29. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.js +75 -0
  30. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.js +26 -0
  31. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.js +49 -0
  32. package/lib/esm/builtin/async/ai-runtime/runtime-components/V0/utils.js +9 -0
  33. package/lib/esm/builtin/async/ai-runtime/state/session.js +52 -23
  34. package/lib/esm/components/CustomComponentRenderer/state.js +22 -4
  35. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  36. package/lib/esm/utils/inject-global-components-dump-json.js +1 -1
  37. package/lib/types/builtin/async/ai-runtime/api/session.d.ts +1 -0
  38. package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +26 -0
  39. package/lib/types/builtin/async/ai-runtime/runtime-components/ChatOutput/MessageErrorView.d.ts +2 -1
  40. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/Input.d.ts +1 -1
  41. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/CodePreview.d.ts +20 -0
  42. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/ConfirmDialog.d.ts +6 -0
  43. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/Loading.d.ts +3 -0
  44. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/PropertiesSetting.d.ts +6 -0
  45. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/components/UserQuestion.d.ts +3 -0
  46. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/contexts/V0Runtime.d.ts +16 -0
  47. package/lib/types/builtin/async/ai-runtime/runtime-components/V0/utils.d.ts +7 -0
  48. package/lib/types/builtin/async/ai-runtime/state/session.d.ts +11 -3
  49. package/lib/types/components/CustomComponentRenderer/state.d.ts +1 -0
  50. package/lib/types/tsconfig.tsbuildinfo +1 -1
  51. package/lib/types/types/core.d.ts +2 -1
  52. 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
  },
@@ -1,6 +1,7 @@
1
1
  import { RunAssistantResponse } from '@blocklet/ai-runtime/types';
2
2
  export interface Session {
3
3
  id: string;
4
+ name?: string;
4
5
  userId: string;
5
6
  projectId: string;
6
7
  projectRef: string;
@@ -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,3 +1,4 @@
1
- export default function MessageErrorView({ error }: {
1
+ export default function MessageErrorView({ error, sx }: {
2
2
  error: any;
3
+ sx?: any;
3
4
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- export default function AutoForm({ submitText, inlineLabel, autoFillLastForm, submitInQuestionField, chatMode, }: {
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;
@@ -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;
@@ -0,0 +1,3 @@
1
+ import { BoxProps } from '@mui/material';
2
+ export default function Loading(props: BoxProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function AIRunningLoading(props: BoxProps): import("react/jsx-runtime").JSX.Element;
@@ -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,3 @@
1
+ export default function UserQuestion({ question }: {
2
+ question?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -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 {};
@@ -0,0 +1,7 @@
1
+ export declare const getLineClamp: (count: number) => {
2
+ display: string;
3
+ WebkitLineClamp: number;
4
+ WebkitBoxOrient: string;
5
+ overflow: string;
6
+ textOverflow: string;
7
+ };
@@ -24,18 +24,26 @@ export interface SessionState {
24
24
  currentSessionId?: string;
25
25
  error?: Error;
26
26
  reset: () => void;
27
- load: () => Promise<void>;
27
+ load: (args?: {
28
+ autoSetCurrentSessionId?: boolean;
29
+ }) => Promise<void>;
30
+ reload: () => Promise<void>;
28
31
  setCurrentSessionId: (sessionId: string) => void;
29
- createSession: () => Promise<Session>;
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;
@@ -26,3 +26,4 @@ export declare function useComponent({ instanceId, componentId, properties, loca
26
26
  [key: string]: any;
27
27
  };
28
28
  } | null;
29
+ export declare function transpileAndLoadScript(script: string): Promise<any>;