@blocklet/pages-kit 0.2.291 → 0.2.293
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/api/assistant.js +2 -1
- package/lib/cjs/builtin/async/ai-runtime/api/message.js +14 -1
- package/lib/cjs/builtin/async/ai-runtime/api/request.js +5 -3
- package/lib/cjs/builtin/async/ai-runtime/api/session.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/components/PoweredBy.js +1 -9
- package/lib/cjs/builtin/async/ai-runtime/components/RuntimeProvider.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/ThemeProvider.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/form/ParameterForm.js +4 -4
- package/lib/cjs/builtin/async/ai-runtime/components/form/ParameterFormFields.js +5 -1
- package/lib/cjs/builtin/async/ai-runtime/components/form/QuestionField.js +2 -2
- package/lib/cjs/builtin/async/ai-runtime/components/form/SettingButton.js +16 -9
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageErrorView.js +14 -3
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageItemView.js +65 -29
- package/lib/cjs/builtin/async/ai-runtime/components/message/MessageListView.js +6 -5
- package/lib/cjs/builtin/async/ai-runtime/components/parameters/RadioField.js +39 -0
- package/lib/cjs/builtin/async/ai-runtime/components/parameters/SelectField.js +1 -1
- package/lib/cjs/builtin/async/ai-runtime/components/parameters/index.js +5 -1
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/AutoForm/index.js +153 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/ChatOutput/MessageErrorView.js +19 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/ChatOutput/MessageItemView.js +179 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/ChatOutput/index.js +13 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/PhotoGallery/index.js +129 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.js +117 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/SimpleChat/index.js +109 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/SimpleOutput/index.js +17 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/components/SimplePage/index.js +87 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/contexts/CurrentAgent.js +27 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/contexts/CurrentMessage.js +19 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/index.js +42 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/state/assistant.js +61 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/state/runtime.js +56 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/state/session.js +213 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime/utils/map-right.js +10 -0
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/InitialForm.js +42 -20
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatSession.js +12 -5
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/RuntimeFormForms.js +5 -6
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/RuntimeFormResult.js +3 -6
- package/lib/cjs/builtin/async/ai-runtime/components/runtime-form/index.js +4 -0
- package/lib/cjs/builtin/async/ai-runtime/components/session/CheckSession.js +16 -7
- package/lib/cjs/builtin/async/ai-runtime/hooks/auth.js +31 -0
- package/lib/cjs/builtin/async/ai-runtime/hooks/header.js +29 -19
- package/lib/cjs/builtin/async/ai-runtime/hooks/subscribe.js +6 -4
- package/lib/cjs/builtin/async/ai-runtime/index.js +38 -30
- package/lib/cjs/builtin/async/ai-runtime/locales/index.js +28 -0
- package/lib/cjs/builtin/async/ai-runtime/state/session.js +15 -18
- package/lib/cjs/builtin/async/ai-runtime/state/subscription.js +4 -4
- package/lib/cjs/components/CustomComponentRenderer/index.js +0 -1
- package/lib/cjs/components/CustomComponentRenderer/state.js +64 -57
- package/lib/cjs/components/index.js +1 -0
- package/lib/esm/builtin/async/ai-runtime/api/assistant.js +2 -1
- package/lib/esm/builtin/async/ai-runtime/api/message.js +14 -1
- package/lib/esm/builtin/async/ai-runtime/api/request.js +5 -3
- package/lib/esm/builtin/async/ai-runtime/api/session.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/components/PoweredBy.js +2 -10
- package/lib/esm/builtin/async/ai-runtime/components/RuntimeProvider.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/ThemeProvider.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/components/form/ParameterForm.js +4 -4
- package/lib/esm/builtin/async/ai-runtime/components/form/ParameterFormFields.js +5 -1
- package/lib/esm/builtin/async/ai-runtime/components/form/QuestionField.js +2 -2
- package/lib/esm/builtin/async/ai-runtime/components/form/SettingButton.js +16 -9
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageErrorView.js +14 -3
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageItemView.js +65 -31
- package/lib/esm/builtin/async/ai-runtime/components/message/MessageListView.js +6 -5
- package/lib/esm/builtin/async/ai-runtime/components/parameters/RadioField.js +37 -0
- package/lib/esm/builtin/async/ai-runtime/components/parameters/SelectField.js +1 -1
- package/lib/esm/builtin/async/ai-runtime/components/parameters/index.js +5 -1
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/AutoForm/index.js +146 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/ChatOutput/MessageErrorView.js +13 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/ChatOutput/MessageItemView.js +149 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/ChatOutput/index.js +7 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/PhotoGallery/index.js +100 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.js +114 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/SimpleChat/index.js +80 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/SimpleOutput/index.js +11 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/components/SimplePage/index.js +58 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/contexts/CurrentAgent.js +22 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/contexts/CurrentMessage.js +14 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/index.js +36 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/state/assistant.js +56 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/state/runtime.js +52 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/state/session.js +209 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime/utils/map-right.js +7 -0
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/InitialForm.js +21 -22
- package/lib/esm/builtin/async/ai-runtime/components/runtime-chat/RuntimeChatSession.js +13 -6
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormForms.js +5 -6
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/RuntimeFormResult.js +3 -6
- package/lib/esm/builtin/async/ai-runtime/components/runtime-form/index.js +4 -0
- package/lib/esm/builtin/async/ai-runtime/components/session/CheckSession.js +9 -0
- package/lib/esm/builtin/async/ai-runtime/hooks/auth.js +27 -0
- package/lib/esm/builtin/async/ai-runtime/hooks/header.js +30 -20
- package/lib/esm/builtin/async/ai-runtime/hooks/subscribe.js +6 -4
- package/lib/esm/builtin/async/ai-runtime/index.js +15 -29
- package/lib/esm/builtin/async/ai-runtime/locales/index.js +28 -0
- package/lib/esm/builtin/async/ai-runtime/state/session.js +17 -20
- package/lib/esm/builtin/async/ai-runtime/state/subscription.js +2 -2
- package/lib/esm/components/CustomComponentRenderer/index.js +0 -1
- package/lib/esm/components/CustomComponentRenderer/state.js +63 -57
- package/lib/esm/components/index.js +1 -0
- package/lib/types/builtin/async/ai-runtime/api/assistant.d.ts +4 -2
- package/lib/types/builtin/async/ai-runtime/api/message.d.ts +9 -2
- package/lib/types/builtin/async/ai-runtime/api/request.d.ts +4 -1
- package/lib/types/builtin/async/ai-runtime/api/session.d.ts +2 -1
- package/lib/types/builtin/async/ai-runtime/components/form/ParameterForm.d.ts +3 -2
- package/lib/types/builtin/async/ai-runtime/components/form/QuestionField.d.ts +3 -2
- package/lib/types/builtin/async/ai-runtime/components/form/SettingButton.d.ts +5 -2
- package/lib/types/builtin/async/ai-runtime/components/message/MessageErrorView.d.ts +4 -5
- package/lib/types/builtin/async/ai-runtime/components/message/MessageItemView.d.ts +11 -4
- package/lib/types/builtin/async/ai-runtime/components/message/MessageListView.d.ts +5 -3
- package/lib/types/builtin/async/ai-runtime/components/parameters/RadioField.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/AutoForm/index.d.ts +9 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/ChatOutput/MessageErrorView.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/ChatOutput/MessageItemView.d.ts +12 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/ChatOutput/index.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/PhotoGallery/index.d.ts +5 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/PhotoGalleryItem/index.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/SimpleChat/index.d.ts +3 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/SimpleOutput/index.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/components/SimplePage/index.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/contexts/CurrentAgent.d.ts +12 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/contexts/CurrentMessage.d.ts +10 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/index.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/state/assistant.d.ts +17 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/state/runtime.d.ts +14 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/state/session.d.ts +29 -0
- package/lib/types/builtin/async/ai-runtime/components/runtime/utils/map-right.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/hooks/auth.d.ts +4 -0
- package/lib/types/builtin/async/ai-runtime/hooks/subscribe.d.ts +1 -0
- package/lib/types/builtin/async/ai-runtime/index.d.ts +15 -8
- package/lib/types/builtin/async/ai-runtime/locales/index.d.ts +22 -0
- package/lib/types/builtin/async/ai-runtime/state/assistant.d.ts +0 -2
- package/lib/types/builtin/async/ai-runtime/state/session.d.ts +0 -3
- package/lib/types/builtin/async/ai-runtime/state/subscription.d.ts +1 -1
- package/lib/types/components/CustomComponentRenderer/index.d.ts +0 -1
- package/lib/types/components/CustomComponentRenderer/state.d.ts +2 -3
- package/lib/types/components/index.d.ts +1 -0
- package/lib/types/types/core.d.ts +1 -0
- package/package.json +9 -7
package/lib/types/builtin/async/ai-runtime/components/runtime/components/SimpleOutput/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BaseOutputs(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface CurrentAgentState {
|
|
3
|
+
aid: string;
|
|
4
|
+
}
|
|
5
|
+
export default function CurrentAgentProvider({ agentId, children }: {
|
|
6
|
+
agentId: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function useCurrentAgent(): {
|
|
10
|
+
agent: import("../../../api/assistant").Assistant;
|
|
11
|
+
aid: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MessageItem } from '../state/session';
|
|
3
|
+
export interface CurrentMessageState {
|
|
4
|
+
message: MessageItem;
|
|
5
|
+
}
|
|
6
|
+
export default function CurrentMessageProvider({ message, children }: {
|
|
7
|
+
message: MessageItem;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function useCurrentMessage(): CurrentMessageState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Runtime(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
import { Assistant } from '../../../api/assistant';
|
|
3
|
+
export interface AssistantState {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
assistant?: Assistant;
|
|
6
|
+
error?: Error;
|
|
7
|
+
load: () => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare const createAssistantState: ({ aid, working, assistant, }: {
|
|
10
|
+
aid: string;
|
|
11
|
+
working?: boolean;
|
|
12
|
+
assistant?: Assistant;
|
|
13
|
+
}) => UseBoundStore<StoreApi<AssistantState>>;
|
|
14
|
+
export declare function useAssistantState({ aid, working }: {
|
|
15
|
+
aid: string;
|
|
16
|
+
working?: boolean;
|
|
17
|
+
}): readonly [Assistant, AssistantState];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RuntimeOutputAppearancePage } from '@blocklet/ai-runtime/types';
|
|
2
|
+
export declare function useRuntimeState(): {
|
|
3
|
+
aid: string;
|
|
4
|
+
working: boolean;
|
|
5
|
+
agent: import("../../../api/assistant").Assistant;
|
|
6
|
+
appearancePage: RuntimeOutputAppearancePage | undefined;
|
|
7
|
+
sessionState: import("./session").SessionState;
|
|
8
|
+
execute: (options: {
|
|
9
|
+
aid: string;
|
|
10
|
+
working?: boolean | undefined;
|
|
11
|
+
parameters: any;
|
|
12
|
+
onResponseStart?: (() => void) | undefined;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
import { Message } from '../../../api/message';
|
|
3
|
+
import { Session } from '../../../api/session';
|
|
4
|
+
export interface MessageItem extends Omit<Message, 'id'> {
|
|
5
|
+
id?: string;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SessionState {
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
loaded?: boolean;
|
|
11
|
+
running?: boolean;
|
|
12
|
+
session?: Session;
|
|
13
|
+
messages?: MessageItem[];
|
|
14
|
+
noMoreMessage?: boolean;
|
|
15
|
+
messageLoading?: boolean;
|
|
16
|
+
error?: Error;
|
|
17
|
+
reset: () => void;
|
|
18
|
+
load: () => Promise<void>;
|
|
19
|
+
loadMoreMessages: () => Promise<void>;
|
|
20
|
+
execute: (options: {
|
|
21
|
+
aid: string;
|
|
22
|
+
working?: boolean;
|
|
23
|
+
parameters: any;
|
|
24
|
+
onResponseStart?: () => void;
|
|
25
|
+
}) => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export declare const createSessionState: ({ aid }: {
|
|
28
|
+
aid: string;
|
|
29
|
+
}) => UseBoundStore<StoreApi<SessionState>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function mapRight<T, R>(array: T[], fn: (value: T, index: number, arr: T[]) => R): R[];
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { Assistant } from './api/assistant';
|
|
2
2
|
import type { ChatBotProps } from './components/common/ChatBot';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
3
|
+
export * from './components/runtime/contexts/CurrentAgent';
|
|
4
|
+
export * from './components/runtime/contexts/CurrentMessage';
|
|
5
|
+
export * from './components/runtime/state/runtime';
|
|
6
|
+
export * from './components/runtime/state/session';
|
|
7
|
+
export { default as Runtime } from './components/runtime';
|
|
8
|
+
export { default as SimplePage } from './components/runtime/components/SimplePage';
|
|
9
|
+
export { default as SimpleChat } from './components/runtime/components/SimpleChat';
|
|
10
|
+
export { default as PhotoGallery } from './components/runtime/components/PhotoGallery';
|
|
11
|
+
export { default as AutoForm } from './components/runtime/components/AutoForm';
|
|
12
|
+
export { default as BaseOutputs } from './components/runtime/components/SimpleOutput';
|
|
13
|
+
export { default as ChatOutput } from './components/runtime/components/ChatOutput';
|
|
14
|
+
export { default as PhotoGalleryItem } from './components/runtime/components/PhotoGalleryItem';
|
|
11
15
|
export default function App(props: {
|
|
12
16
|
preload?: {
|
|
13
17
|
assistantId: string;
|
|
14
18
|
assistant: Assistant;
|
|
15
19
|
};
|
|
16
20
|
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function AIRuntime({ cacheId }: {
|
|
22
|
+
cacheId: string;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
24
|
export declare function ChatBot(props: ChatBotProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,6 +11,12 @@ export declare const translations: {
|
|
|
11
11
|
shareToLinkedin: string;
|
|
12
12
|
copyLink: string;
|
|
13
13
|
};
|
|
14
|
+
photoWall: {
|
|
15
|
+
dialog: {
|
|
16
|
+
title: string;
|
|
17
|
+
prompt: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
14
20
|
questionPlaceholder: string;
|
|
15
21
|
parameters: string;
|
|
16
22
|
parametersTitle: string;
|
|
@@ -41,6 +47,9 @@ export declare const translations: {
|
|
|
41
47
|
requireNewSubscription: string;
|
|
42
48
|
requireNewSubscriptionFooter: string;
|
|
43
49
|
thanksForSubscription: string;
|
|
50
|
+
requireLogin: string;
|
|
51
|
+
thanksForLogin: string;
|
|
52
|
+
loginNow: string;
|
|
44
53
|
clickTheButton: string;
|
|
45
54
|
cleanSessionTip: string;
|
|
46
55
|
poweredBy: string;
|
|
@@ -65,6 +74,8 @@ export declare const translations: {
|
|
|
65
74
|
uploadFile: string;
|
|
66
75
|
submit: string;
|
|
67
76
|
send: string;
|
|
77
|
+
session: string;
|
|
78
|
+
loadMore: string;
|
|
68
79
|
};
|
|
69
80
|
zh: {
|
|
70
81
|
by: string;
|
|
@@ -78,6 +89,12 @@ export declare const translations: {
|
|
|
78
89
|
shareToLinkedin: string;
|
|
79
90
|
copyLink: string;
|
|
80
91
|
};
|
|
92
|
+
photoWall: {
|
|
93
|
+
dialog: {
|
|
94
|
+
title: string;
|
|
95
|
+
prompt: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
81
98
|
questionPlaceholder: string;
|
|
82
99
|
parameters: string;
|
|
83
100
|
parametersTitle: string;
|
|
@@ -108,6 +125,9 @@ export declare const translations: {
|
|
|
108
125
|
requireNewSubscription: string;
|
|
109
126
|
requireNewSubscriptionFooter: string;
|
|
110
127
|
thanksForSubscription: string;
|
|
128
|
+
requireLogin: string;
|
|
129
|
+
thanksForLogin: string;
|
|
130
|
+
loginNow: string;
|
|
111
131
|
clickTheButton: string;
|
|
112
132
|
cleanSessionTip: string;
|
|
113
133
|
poweredBy: string;
|
|
@@ -132,5 +152,7 @@ export declare const translations: {
|
|
|
132
152
|
uploadFile: string;
|
|
133
153
|
submit: string;
|
|
134
154
|
send: string;
|
|
155
|
+
session: string;
|
|
156
|
+
loadMore: string;
|
|
135
157
|
};
|
|
136
158
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
2
|
import { Assistant } from '../api/assistant';
|
|
3
|
-
import { Subscription } from '../api/subscription';
|
|
4
3
|
export interface AssistantState {
|
|
5
4
|
loading?: boolean;
|
|
6
5
|
assistant?: Assistant;
|
|
7
6
|
error?: Error;
|
|
8
|
-
subscription?: Subscription;
|
|
9
7
|
load: () => Promise<void>;
|
|
10
8
|
}
|
|
11
9
|
export declare const createAssistantState: ({ assistantId, assistant }: {
|
|
@@ -15,9 +15,6 @@ export interface SessionState {
|
|
|
15
15
|
updateSession: ({ parameters }: {
|
|
16
16
|
parameters: any;
|
|
17
17
|
}) => Promise<void>;
|
|
18
|
-
clearSession: ({ sessionId }: {
|
|
19
|
-
sessionId: string;
|
|
20
|
-
}) => Promise<void>;
|
|
21
18
|
load: () => Promise<void>;
|
|
22
19
|
execute: (options: {
|
|
23
20
|
assistantId: string;
|
|
@@ -7,7 +7,7 @@ export interface SubscriptionState {
|
|
|
7
7
|
release?: Release;
|
|
8
8
|
load: () => Promise<void>;
|
|
9
9
|
}
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const createSubscriptionState: ({ aid }: {
|
|
11
11
|
aid: string;
|
|
12
12
|
}) => UseBoundStore<StoreApi<SubscriptionState>>;
|
|
13
13
|
export declare function useSubscriptionState({ aid }: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
3
|
import { CustomComponent, PreloadComponentsInput } from '../../types';
|
|
3
4
|
import { PreloadComponentsState } from '../../types/preload';
|
|
4
5
|
import type { CustomComponentRendererProps } from '.';
|
|
@@ -17,9 +18,7 @@ export interface CustomComponentStates {
|
|
|
17
18
|
} | null;
|
|
18
19
|
loadComponents(input: Pick<PreloadComponentsInput, 'mode' | 'locale' | 'instances'>): Promise<void>;
|
|
19
20
|
}
|
|
20
|
-
export declare const customComponentStates:
|
|
21
|
-
setState(nextStateOrUpdater: CustomComponentStates | Partial<CustomComponentStates> | ((state: import("immer").WritableDraft<CustomComponentStates>) => void), shouldReplace?: boolean | undefined): void;
|
|
22
|
-
}>;
|
|
21
|
+
export declare const customComponentStates: () => UseBoundStore<StoreApi<CustomComponentStates>>;
|
|
23
22
|
export declare function useComponent({ instanceId, componentId, properties, locale, dev }: CustomComponentRendererProps): {
|
|
24
23
|
error?: Error;
|
|
25
24
|
Component?: ComponentType<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.293",
|
|
4
4
|
"description": "Pages Kit components and utils",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"@arcblock/did-connect": "^2.9.76",
|
|
85
|
-
"@blocklet/ai-kit": "^0.1.
|
|
86
|
-
"@blocklet/ai-runtime": "^0.1.
|
|
87
|
-
"@blocklet/js-sdk": "
|
|
85
|
+
"@blocklet/ai-kit": "^0.1.29",
|
|
86
|
+
"@blocklet/ai-runtime": "^0.1.365",
|
|
87
|
+
"@blocklet/js-sdk": "1.16.26",
|
|
88
88
|
"@blocklet/sdk": "^1.16.26",
|
|
89
89
|
"@iconify/react": "^4.1.1",
|
|
90
90
|
"@lottiefiles/lottie-player": "^1.7.1",
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
"node-fetch": "^2.7.0",
|
|
99
99
|
"react-error-boundary": "^4.0.13",
|
|
100
100
|
"react-frame-component": "^5.2.6",
|
|
101
|
+
"react-helmet": "^6.1.0",
|
|
101
102
|
"react-hook-form": "^7.51.3",
|
|
102
103
|
"react-markdown": "^9.0.1",
|
|
103
104
|
"react-scroll-to-bottom": "^4.2.0",
|
|
@@ -126,15 +127,16 @@
|
|
|
126
127
|
"@emotion/cache": "^11.11.0",
|
|
127
128
|
"@emotion/css": "^11.11.2",
|
|
128
129
|
"@emotion/react": "^11.11.4",
|
|
129
|
-
"@mui/icons-material": "^5.15.
|
|
130
|
+
"@mui/icons-material": "^5.15.16",
|
|
130
131
|
"@mui/lab": "^5.0.0-alpha.170",
|
|
131
|
-
"@mui/material": "^5.15.
|
|
132
|
+
"@mui/material": "^5.15.16",
|
|
132
133
|
"@types/lodash": "^4.17.0",
|
|
133
134
|
"@types/mustache": "^4.2.5",
|
|
134
135
|
"@types/node-fetch": "^2.6.11",
|
|
135
136
|
"@types/react": "^18.3.1",
|
|
137
|
+
"@types/react-helmet": "^6.1.11",
|
|
136
138
|
"@types/react-scroll-to-bottom": "^4.2.5",
|
|
137
|
-
"@types/react-syntax-highlighter": "^15.5.
|
|
139
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
138
140
|
"axios": "^1.6.8",
|
|
139
141
|
"npm-run-all": "^4.1.5",
|
|
140
142
|
"react": "^18.3.1",
|