@opentiny/genui-sdk-vue 1.3.0 → 1.3.1-alpha.2
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/README.md +11 -2
- package/dist/ConfigProvider-B_1dX_dv.js +131 -0
- package/dist/ConfigProvider-B_1dX_dv.js.map +1 -0
- package/dist/{GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-CxcSUrjG.js → GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-zsZgFWJw.js} +3 -3
- package/dist/{GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-CxcSUrjG.js.map → GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-zsZgFWJw.js.map} +1 -1
- package/dist/GenuiRenderer-f2_6u1TA.js +141 -0
- package/dist/GenuiRenderer-f2_6u1TA.js.map +1 -0
- package/dist/{GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-o5SS6BG6.js → GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-CMjFQe5i.js} +3 -3
- package/dist/{GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-o5SS6BG6.js.map → GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-CMjFQe5i.js.map} +1 -1
- package/dist/chat.d.ts +6 -0
- package/dist/chat.js +17 -15
- package/dist/chat.js.map +1 -1
- package/dist/chat.types-DEDNSs5o.js +1817 -0
- package/dist/chat.types-DEDNSs5o.js.map +1 -0
- package/dist/code-generator.d.ts +139 -0
- package/dist/code-generator.js +6 -0
- package/dist/code-generator.js.map +1 -0
- package/dist/config-provider.d.ts +24 -12
- package/dist/config-provider.js +2 -2
- package/dist/index.d.ts +168 -16
- package/dist/index.js +37 -31
- package/dist/index.js.map +1 -1
- package/dist/injection-tokens-DDgspg4x.js +9067 -0
- package/dist/injection-tokens-DDgspg4x.js.map +1 -0
- package/dist/legacy-chat.d.ts +9 -1
- package/dist/legacy-chat.js +3 -3
- package/dist/legacy-renderer.js +2 -2
- package/dist/picocolors.browser-nFqgZww8.js +50 -0
- package/dist/picocolors.browser-nFqgZww8.js.map +1 -0
- package/dist/renderer.d.ts +2 -2
- package/dist/renderer.js +1 -1
- package/dist/transform-jsx.d.ts +2 -3
- package/dist/transform-jsx.js +147312 -66873
- package/dist/transform-jsx.js.map +1 -1
- package/dist/vue-code-generator-CwPQ3GDh.js +573 -0
- package/dist/vue-code-generator-CwPQ3GDh.js.map +1 -0
- package/package.json +12 -5
- package/dist/ConfigProvider-BzxW9L3f.js +0 -95
- package/dist/ConfigProvider-BzxW9L3f.js.map +0 -1
- package/dist/GenuiRenderer-BVwM5pRp.js +0 -15163
- package/dist/GenuiRenderer-BVwM5pRp.js.map +0 -1
- package/dist/___vite-browser-external_commonjs-proxy-4gYZYw55.js +0 -57
- package/dist/___vite-browser-external_commonjs-proxy-4gYZYw55.js.map +0 -1
- package/dist/chat.types-DsoAmslj.js +0 -1794
- package/dist/chat.types-DsoAmslj.js.map +0 -1
- package/dist/injection-tokens-CuDQs1ne.js +0 -114
- package/dist/injection-tokens-CuDQs1ne.js.map +0 -1
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
3
4
|
import { DefineComponent } from 'vue';
|
|
4
5
|
import { IMaterials } from '@opentiny/genui-sdk-core';
|
|
5
6
|
import { InjectionKey } from 'vue';
|
|
7
|
+
import { MergedMaterials } from '@opentiny/genui-sdk-core';
|
|
6
8
|
import { PublicProps } from 'vue';
|
|
7
9
|
import { Ref } from 'vue';
|
|
10
|
+
import { ThemeColorScheme } from '@opentiny/genui-sdk-core';
|
|
8
11
|
|
|
9
12
|
declare const __VLS_component: DefineComponent<ConfigProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ConfigProviderProps> & Readonly<{}>, {
|
|
10
13
|
id: string;
|
|
11
14
|
locale: string;
|
|
12
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
13
|
-
providerRef: unknown;
|
|
14
|
-
}, any>;
|
|
15
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
15
16
|
|
|
16
17
|
declare function __VLS_template(): {
|
|
17
18
|
attrs: Partial<{}>;
|
|
18
19
|
slots: {
|
|
19
20
|
default?(_: {}): any;
|
|
20
21
|
};
|
|
21
|
-
refs: {
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
rootEl: any;
|
|
22
|
+
refs: {};
|
|
23
|
+
rootEl: HTMLDivElement;
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -32,15 +31,16 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
33
|
|
|
35
|
-
declare interface ConfigProviderProps {
|
|
36
|
-
theme?:
|
|
34
|
+
export declare interface ConfigProviderProps {
|
|
35
|
+
theme?: string;
|
|
37
36
|
id?: string;
|
|
38
37
|
locale?: string;
|
|
39
38
|
i18n?: I18nMessages;
|
|
40
|
-
materials?:
|
|
39
|
+
materials?: MergedMaterials;
|
|
40
|
+
notify?: NotifyHandler;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export declare const GENUI_CONFIG:
|
|
43
|
+
export declare const GENUI_CONFIG: InjectionKey<ComputedRef<GenuiConfigState>>;
|
|
44
44
|
|
|
45
45
|
export declare const GENUI_I18N: unique symbol;
|
|
46
46
|
|
|
@@ -48,6 +48,11 @@ export declare const GENUI_MATERIALS: InjectionKey<IMaterials>;
|
|
|
48
48
|
|
|
49
49
|
export declare const GenuiConfigProvider: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
50
50
|
|
|
51
|
+
export declare interface GenuiConfigState {
|
|
52
|
+
colorScheme: ThemeColorScheme;
|
|
53
|
+
id: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
51
56
|
declare type I18nMessageObject = {
|
|
52
57
|
[key: string]: string | I18nMessageObject;
|
|
53
58
|
};
|
|
@@ -56,8 +61,15 @@ declare type I18nMessages = {
|
|
|
56
61
|
[lang: string]: I18nMessageObject;
|
|
57
62
|
};
|
|
58
63
|
|
|
64
|
+
export declare type NotifyHandler = (options: {
|
|
65
|
+
type?: 'success' | 'warning' | 'error' | 'info';
|
|
66
|
+
title?: string;
|
|
67
|
+
message?: string;
|
|
68
|
+
duration?: number;
|
|
69
|
+
}) => void;
|
|
70
|
+
|
|
59
71
|
export declare const useMediaTheme: () => {
|
|
60
|
-
theme: Readonly<Ref<"
|
|
72
|
+
theme: Readonly<Ref<"light" | "dark", "light" | "dark">>;
|
|
61
73
|
};
|
|
62
74
|
|
|
63
75
|
export { }
|
package/dist/config-provider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as o, u as r } from "./ConfigProvider-
|
|
2
|
-
import { a as G, G as I, b as N } from "./injection-tokens-
|
|
1
|
+
import { C as o, u as r } from "./ConfigProvider-B_1dX_dv.js";
|
|
2
|
+
import { a as G, G as I, b as N } from "./injection-tokens-DDgspg4x.js";
|
|
3
3
|
export {
|
|
4
4
|
G as GENUI_CONFIG,
|
|
5
5
|
I as GENUI_I18N,
|
package/dist/index.d.ts
CHANGED
|
@@ -34,17 +34,19 @@ import { IMaterials } from '@opentiny/genui-sdk-core';
|
|
|
34
34
|
import { InjectionKey } from 'vue';
|
|
35
35
|
import { INotificationPayload } from '@opentiny/genui-sdk-core';
|
|
36
36
|
import { IStreamData } from '@opentiny/genui-sdk-core';
|
|
37
|
+
import { MergedMaterials } from '@opentiny/genui-sdk-core';
|
|
37
38
|
import { MessageState } from '@opentiny/tiny-robot-kit';
|
|
38
39
|
import { nextTick } from 'vue';
|
|
40
|
+
import { NodeSchema } from '@opentiny/genui-sdk-core';
|
|
39
41
|
import { OnCleanup } from '@vue/reactivity';
|
|
40
42
|
import { PublicProps } from 'vue';
|
|
41
43
|
import { Reactive } from 'vue';
|
|
42
44
|
import { Ref } from 'vue';
|
|
43
|
-
import { RENDERER_SETTINGS_KEY } from '../../src/types/tiny-schema-renderer.d.ts';
|
|
44
45
|
import { RendererElement } from 'vue';
|
|
45
46
|
import { RendererNode } from 'vue';
|
|
46
47
|
import { ShallowUnwrapRef } from 'vue';
|
|
47
48
|
import { Slot } from 'vue';
|
|
49
|
+
import { ThemeColorScheme } from '@opentiny/genui-sdk-core';
|
|
48
50
|
import { UnwrapNestedRefs } from 'vue';
|
|
49
51
|
import { UseConversationOptions } from '@opentiny/tiny-robot-kit';
|
|
50
52
|
import { UseMessageReturn as UseMessageReturn_2 } from '@opentiny/tiny-robot-kit';
|
|
@@ -144,15 +146,13 @@ messagesContainer: HTMLDivElement;
|
|
|
144
146
|
declare const __VLS_component_2: DefineComponent<IRendererProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IRendererProps> & Readonly<{}>, {
|
|
145
147
|
isJsonComplete: boolean;
|
|
146
148
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
147
|
-
rendererInstance:
|
|
149
|
+
rendererInstance: unknown;
|
|
148
150
|
}, HTMLDivElement>;
|
|
149
151
|
|
|
150
152
|
declare const __VLS_component_3: DefineComponent<ConfigProviderProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ConfigProviderProps> & Readonly<{}>, {
|
|
151
153
|
id: string;
|
|
152
154
|
locale: string;
|
|
153
|
-
}, {}, {}, {}, string, ComponentProvideOptions, true, {
|
|
154
|
-
providerRef: unknown;
|
|
155
|
-
}, any>;
|
|
155
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
156
156
|
|
|
157
157
|
declare const __VLS_component_4: DefineComponent<IChatProps, {
|
|
158
158
|
$: ComponentInternalInstance;
|
|
@@ -650,7 +650,7 @@ declare function __VLS_template_2(): {
|
|
|
650
650
|
}): any;
|
|
651
651
|
};
|
|
652
652
|
refs: {
|
|
653
|
-
rendererInstance:
|
|
653
|
+
rendererInstance: unknown;
|
|
654
654
|
};
|
|
655
655
|
rootEl: HTMLDivElement;
|
|
656
656
|
};
|
|
@@ -660,10 +660,8 @@ declare function __VLS_template_3(): {
|
|
|
660
660
|
slots: {
|
|
661
661
|
default?(_: {}): any;
|
|
662
662
|
};
|
|
663
|
-
refs: {
|
|
664
|
-
|
|
665
|
-
};
|
|
666
|
-
rootEl: any;
|
|
663
|
+
refs: {};
|
|
664
|
+
rootEl: HTMLDivElement;
|
|
667
665
|
};
|
|
668
666
|
|
|
669
667
|
declare function __VLS_template_4(): {
|
|
@@ -948,12 +946,17 @@ declare type __VLS_WithTemplateSlots_5<T, S> = T & {
|
|
|
948
946
|
};
|
|
949
947
|
};
|
|
950
948
|
|
|
951
|
-
declare
|
|
952
|
-
|
|
949
|
+
export declare const cardIdSymbol: unique symbol;
|
|
950
|
+
|
|
951
|
+
export declare type CodegenFramework = 'vue' | 'react' | 'angular' | (string & {});
|
|
952
|
+
|
|
953
|
+
export declare interface ConfigProviderProps {
|
|
954
|
+
theme?: string;
|
|
953
955
|
id?: string;
|
|
954
956
|
locale?: string;
|
|
955
957
|
i18n?: I18nMessages;
|
|
956
|
-
materials?:
|
|
958
|
+
materials?: MergedMaterials;
|
|
959
|
+
notify?: NotifyHandler;
|
|
957
960
|
}
|
|
958
961
|
|
|
959
962
|
export declare function createI18n(options?: I18nOptions): I18nInstance;
|
|
@@ -986,6 +989,8 @@ export declare class CustomModelProvider extends BaseModelProvider {
|
|
|
986
989
|
}): Promise<void>;
|
|
987
990
|
protected setupStreamContext(context: Record<string, unknown>, _request: ChatCompletionRequest): void;
|
|
988
991
|
handlerChunk(rawData: string, context: any): void;
|
|
992
|
+
handlerBeforeRequest(context: any): void;
|
|
993
|
+
handlerRequestError(context: any, error?: unknown): void;
|
|
989
994
|
handlerStart(context: any, handlers: {
|
|
990
995
|
onData: (data: IChatMessage) => void;
|
|
991
996
|
onDone: () => void;
|
|
@@ -1034,7 +1039,9 @@ declare interface FileMeta {
|
|
|
1034
1039
|
base64: string;
|
|
1035
1040
|
}
|
|
1036
1041
|
|
|
1037
|
-
export declare const
|
|
1042
|
+
export declare const generateCode: (params: ICodeGeneratorParams) => Promise<ICodeGeneratorResult>;
|
|
1043
|
+
|
|
1044
|
+
export declare const GENUI_CONFIG: InjectionKey<ComputedRef<GenuiConfigState>>;
|
|
1038
1045
|
|
|
1039
1046
|
export declare const GENUI_I18N: unique symbol;
|
|
1040
1047
|
|
|
@@ -1044,6 +1051,11 @@ export declare const GenuiChat: __VLS_WithTemplateSlots<typeof __VLS_component,
|
|
|
1044
1051
|
|
|
1045
1052
|
export declare const GenuiConfigProvider: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
1046
1053
|
|
|
1054
|
+
export declare interface GenuiConfigState {
|
|
1055
|
+
colorScheme: ThemeColorScheme;
|
|
1056
|
+
id: string;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1047
1059
|
export declare const GenuiLegacyChat: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
|
|
1048
1060
|
|
|
1049
1061
|
export declare const GenuiLegacyRenderer: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
|
|
@@ -1106,6 +1118,48 @@ export declare interface IChatProps {
|
|
|
1106
1118
|
customFetch?: CustomFetch;
|
|
1107
1119
|
}
|
|
1108
1120
|
|
|
1121
|
+
export declare interface ICodegenDescription {
|
|
1122
|
+
componentSet: Set<string>;
|
|
1123
|
+
iconComponents: {
|
|
1124
|
+
componentNames: string[];
|
|
1125
|
+
exportNames: string[];
|
|
1126
|
+
};
|
|
1127
|
+
internalTypes: Set<string>;
|
|
1128
|
+
stateAccessors: IStateAccessorDefinition[];
|
|
1129
|
+
needsJsx: boolean;
|
|
1130
|
+
needsComputed: boolean;
|
|
1131
|
+
needsCallAction: boolean;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
export declare interface ICodeGeneratorParams {
|
|
1135
|
+
pageInfo: {
|
|
1136
|
+
schema: CardSchema | string;
|
|
1137
|
+
name?: string;
|
|
1138
|
+
};
|
|
1139
|
+
componentsMap?: IComponentMapItem[];
|
|
1140
|
+
formatWithPrettier?: boolean;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
export declare type ICodeGeneratorResult = ICodePanel & {
|
|
1144
|
+
errors: {
|
|
1145
|
+
message: string;
|
|
1146
|
+
}[];
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
export declare interface ICodePanel {
|
|
1150
|
+
panelName: string;
|
|
1151
|
+
panelValue: string;
|
|
1152
|
+
panelType: CodegenFramework;
|
|
1153
|
+
prettierOpts: Record<string, unknown>;
|
|
1154
|
+
type: 'page';
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
export declare interface IComponentMapItem {
|
|
1158
|
+
componentName: string;
|
|
1159
|
+
package: string;
|
|
1160
|
+
exportName?: string;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1109
1163
|
export declare interface ICustomAction extends Partial<IGenPromptAction> {
|
|
1110
1164
|
execute: (params: any, context: Record<string, any>) => any;
|
|
1111
1165
|
}
|
|
@@ -1135,6 +1189,10 @@ export declare interface ICustomModelProviderOptions {
|
|
|
1135
1189
|
getChatOptions: () => ICustomModelChatOptions;
|
|
1136
1190
|
}
|
|
1137
1191
|
|
|
1192
|
+
export declare interface IFrameworkCodeGenerator<TParams, TResult> {
|
|
1193
|
+
generate(params: TParams): Promise<TResult>;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1138
1196
|
export declare interface ImageFeatures {
|
|
1139
1197
|
enabled: boolean;
|
|
1140
1198
|
maxImageSize: number;
|
|
@@ -1204,6 +1262,8 @@ export declare interface IResponseHandler<T> {
|
|
|
1204
1262
|
match: (data: T, context: any) => boolean;
|
|
1205
1263
|
handler: (data: T, context: any) => boolean;
|
|
1206
1264
|
notMatchHandler?: (data: T, context: any) => boolean;
|
|
1265
|
+
beforeRequest?: (context: any) => void;
|
|
1266
|
+
onRequestError?: (context: any, error?: unknown) => void;
|
|
1207
1267
|
start?: (context: any, handlers: {
|
|
1208
1268
|
onData: (data: IChatMessage) => void;
|
|
1209
1269
|
onDone: () => void;
|
|
@@ -1217,14 +1277,37 @@ export declare interface IRolesConfig {
|
|
|
1217
1277
|
assistant: Partial<BubbleRoleConfig>;
|
|
1218
1278
|
}
|
|
1219
1279
|
|
|
1280
|
+
export declare interface IScriptSetupBuildContext {
|
|
1281
|
+
schema: CardSchema;
|
|
1282
|
+
componentsMap: IComponentMapItem[];
|
|
1283
|
+
description: ICodegenDescription;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
export declare interface IScriptSetupSectionDefinition {
|
|
1287
|
+
id: string;
|
|
1288
|
+
group: string;
|
|
1289
|
+
build: (ctx: IScriptSetupBuildContext) => string;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1220
1292
|
declare type ISlotProps = any;
|
|
1221
1293
|
|
|
1294
|
+
export declare interface IStateAccessorDefinition {
|
|
1295
|
+
name: string;
|
|
1296
|
+
getterExpr: string;
|
|
1297
|
+
setterExpr?: string;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1222
1300
|
export declare interface IThinkComponentProps {
|
|
1223
1301
|
emitter: INotificationEventEmitter;
|
|
1224
1302
|
message: IMessage;
|
|
1225
1303
|
showThinkingResult: boolean;
|
|
1226
1304
|
}
|
|
1227
1305
|
|
|
1306
|
+
export declare interface IVueCodeGeneratorOptions {
|
|
1307
|
+
prettierOpts?: Record<string, unknown>;
|
|
1308
|
+
enableCompileValidation?: boolean;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1228
1311
|
export declare class MessageManager {
|
|
1229
1312
|
messageManagerMap: Map<string, UseMessageReturn>;
|
|
1230
1313
|
conversationState: Reactive<ConversationState>;
|
|
@@ -1252,12 +1335,19 @@ export declare interface ModelInfo {
|
|
|
1252
1335
|
features?: ModelFeatures;
|
|
1253
1336
|
}
|
|
1254
1337
|
|
|
1338
|
+
export declare type NotifyHandler = (options: {
|
|
1339
|
+
type?: 'success' | 'warning' | 'error' | 'info';
|
|
1340
|
+
title?: string;
|
|
1341
|
+
message?: string;
|
|
1342
|
+
duration?: number;
|
|
1343
|
+
}) => void;
|
|
1344
|
+
|
|
1255
1345
|
declare interface Props {
|
|
1256
1346
|
templateData?: UserItem[];
|
|
1257
1347
|
attachments?: FileMeta[];
|
|
1258
1348
|
}
|
|
1259
1349
|
|
|
1260
|
-
export
|
|
1350
|
+
export declare const RENDERER_SETTINGS_KEY: symbol;
|
|
1261
1351
|
|
|
1262
1352
|
export declare const requiredCompleteFieldSelectors: string[];
|
|
1263
1353
|
|
|
@@ -1332,7 +1422,7 @@ export declare interface UseConversationReturn {
|
|
|
1332
1422
|
export declare const useI18n: () => I18nInstance;
|
|
1333
1423
|
|
|
1334
1424
|
export declare const useMediaTheme: () => {
|
|
1335
|
-
theme: Readonly<Ref<"
|
|
1425
|
+
theme: Readonly<Ref<"light" | "dark", "light" | "dark">>;
|
|
1336
1426
|
};
|
|
1337
1427
|
|
|
1338
1428
|
export declare function useMessage(options: UseMessageOptions): UseMessageReturn;
|
|
@@ -1388,4 +1478,66 @@ export declare interface UseMessageReturn {
|
|
|
1388
1478
|
retryRequest: (msgIndex: number) => Promise<void>;
|
|
1389
1479
|
}
|
|
1390
1480
|
|
|
1481
|
+
export declare class VueCodeGenerator implements IFrameworkCodeGenerator<ICodeGeneratorParams, ICodeGeneratorResult> {
|
|
1482
|
+
private readonly generatorOptions;
|
|
1483
|
+
private readonly prettierOpts;
|
|
1484
|
+
private readonly enableCompileValidation;
|
|
1485
|
+
constructor(generatorOptions?: IVueCodeGeneratorOptions);
|
|
1486
|
+
protected replaceThis(value: string, inTemplate?: boolean): string;
|
|
1487
|
+
protected buildScriptSetupStateAccessors(ctx: IScriptSetupBuildContext): string;
|
|
1488
|
+
protected buildScriptSetupImports(ctx: IScriptSetupBuildContext): string;
|
|
1489
|
+
protected buildScriptSetupRefs(ctx: IScriptSetupBuildContext): string;
|
|
1490
|
+
protected buildScriptSetupDefineProps(ctx: IScriptSetupBuildContext): string;
|
|
1491
|
+
protected buildScriptSetupDefineEmits(ctx: IScriptSetupBuildContext): string;
|
|
1492
|
+
protected buildScriptSetupIconStatement(ctx: IScriptSetupBuildContext): string;
|
|
1493
|
+
protected buildScriptSetupReactiveState(ctx: IScriptSetupBuildContext): string;
|
|
1494
|
+
protected buildScriptSetupMethods(ctx: IScriptSetupBuildContext): string;
|
|
1495
|
+
protected buildScriptSetupCallAction(ctx: IScriptSetupBuildContext): string;
|
|
1496
|
+
protected buildScriptSetupBody(ctx: IScriptSetupBuildContext, sections: readonly IScriptSetupSectionDefinition[]): string;
|
|
1497
|
+
protected buildSfcTemplateSection(template: string): string;
|
|
1498
|
+
protected buildSfcScriptSetupSection(scriptSetup: string, needsJsx?: boolean): string;
|
|
1499
|
+
protected buildSfcStyleSection(style: string): string;
|
|
1500
|
+
protected getScriptSetupSections(): readonly IScriptSetupSectionDefinition[];
|
|
1501
|
+
protected createCodegenMeta(): ICodegenDescription;
|
|
1502
|
+
protected resolveRefAttr(value: string | undefined, asJsx: boolean): string | null;
|
|
1503
|
+
protected resolvePropValueType(value: unknown): string;
|
|
1504
|
+
protected buildJSFunctionExpression(value: string, inTemplate?: boolean): string;
|
|
1505
|
+
protected hoistPropToState(key: string, item: unknown, attrsArr: string[], state: Record<string, unknown>, asJsx?: boolean): void;
|
|
1506
|
+
protected isOnEventKey(key: string): boolean;
|
|
1507
|
+
protected handleSlotBinding(item: Record<string, unknown> | string): string;
|
|
1508
|
+
protected handleEventBinding(key: string, item: {
|
|
1509
|
+
type?: string;
|
|
1510
|
+
value?: string;
|
|
1511
|
+
params?: string[];
|
|
1512
|
+
}, asJsx?: boolean): string;
|
|
1513
|
+
protected avoidDuplicateString(existings: string[], baseName: string): string;
|
|
1514
|
+
protected handleLiteralBinding(key: string, item: unknown, attrsArr: string[], description: ICodegenDescription, state: Record<string, unknown>, asJsx?: boolean): void;
|
|
1515
|
+
protected handleBinding(props: Record<string, unknown>, attrsArr: string[], description: ICodegenDescription, state: Record<string, unknown>, asJsx?: boolean): void;
|
|
1516
|
+
protected recurseChildren(children: NodeSchema[] | NodeSchema | string | undefined, state: Record<string, unknown>, description: ICodegenDescription, result: string[]): void;
|
|
1517
|
+
protected isEmptySlotNode(componentName: string | undefined, children: unknown): boolean;
|
|
1518
|
+
protected generateTemplate(schema: CardSchema, state: Record<string, any>, description: ICodegenDescription, isRootNode?: boolean): string;
|
|
1519
|
+
protected generateSlotTemplate(item: Record<string, any>, description: ICodegenDescription, state?: Record<string, unknown>): string;
|
|
1520
|
+
protected getFunctionInfo(fnStr: string): {
|
|
1521
|
+
type: string;
|
|
1522
|
+
params: string[];
|
|
1523
|
+
body: string;
|
|
1524
|
+
} | null;
|
|
1525
|
+
protected transformStateType(current: Record<string, any>, prop: string, description: ICodegenDescription, rootState: Record<string, any>): void;
|
|
1526
|
+
protected traverseState(state: Record<string, any>, description: ICodegenDescription, rootState?: Record<string, any>): void;
|
|
1527
|
+
protected buildVueSfcSource({ schema, componentsMap, }: {
|
|
1528
|
+
schema: CardSchema;
|
|
1529
|
+
name?: string;
|
|
1530
|
+
componentsMap: IComponentMapItem[];
|
|
1531
|
+
}): string;
|
|
1532
|
+
protected normalizeIncomingSchema(origin: CardSchema | string | null | undefined): CardSchema;
|
|
1533
|
+
protected generatePageCode({ pageInfo, componentsMap, formatWithPrettier, }: {
|
|
1534
|
+
pageInfo: ICodeGeneratorParams['pageInfo'];
|
|
1535
|
+
componentsMap: IComponentMapItem[];
|
|
1536
|
+
formatWithPrettier?: boolean;
|
|
1537
|
+
}): Promise<ICodeGeneratorResult>;
|
|
1538
|
+
protected normalizeComponentsMap(componentsMap: IComponentMapItem[] | undefined): IComponentMapItem[];
|
|
1539
|
+
protected formatWithPrettier(source: string, prettierOpts: Record<string, unknown>): Promise<string>;
|
|
1540
|
+
generate({ pageInfo, componentsMap, formatWithPrettier, }: ICodeGeneratorParams): Promise<ICodeGeneratorResult>;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1391
1543
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,35 +1,41 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { C as t, D as n, E as d, G as i, I as u, M as E, T as m, d as G, e as I, s as p, b as l, t as C, u as c, a as f } from "./chat.types-DEDNSs5o.js";
|
|
2
|
+
import { G as x, c as T, r as _ } from "./GenuiRenderer-f2_6u1TA.js";
|
|
3
|
+
import { $ as e } from "./injection-tokens-DDgspg4x.js";
|
|
4
|
+
import { a as R, G as S, b as N, c as h, u as A } from "./injection-tokens-DDgspg4x.js";
|
|
5
|
+
import { C as U, u as v } from "./ConfigProvider-B_1dX_dv.js";
|
|
6
|
+
import { V as D, g as L } from "./vue-code-generator-CwPQ3GDh.js";
|
|
7
|
+
import { _ as P } from "./GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-zsZgFWJw.js";
|
|
8
|
+
import { _ as $ } from "./GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-CMjFQe5i.js";
|
|
9
|
+
const s = e;
|
|
7
10
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
t as CustomModelProvider,
|
|
12
|
+
n as DEFAULT_IMAGE_FEATURES,
|
|
13
|
+
d as EventEmitter,
|
|
14
|
+
R as GENUI_CONFIG,
|
|
15
|
+
S as GENUI_I18N,
|
|
16
|
+
N as GENUI_MATERIALS,
|
|
17
|
+
i as GenuiChat,
|
|
18
|
+
U as GenuiConfigProvider,
|
|
19
|
+
P as GenuiLegacyChat,
|
|
20
|
+
$ as GenuiLegacyRenderer,
|
|
21
|
+
x as GenuiRenderer,
|
|
22
|
+
u as IndexedDBStrategy,
|
|
20
23
|
E as MessageManager,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
s as RENDERER_SETTINGS_KEY,
|
|
25
|
+
m as ThinkTagWrapPattern,
|
|
26
|
+
D as VueCodeGenerator,
|
|
27
|
+
T as cardIdSymbol,
|
|
28
|
+
h as createI18n,
|
|
29
|
+
G as defaultResponseHandlers,
|
|
30
|
+
I as emitter,
|
|
31
|
+
L as generateCode,
|
|
32
|
+
_ as requiredCompleteFieldSelectors,
|
|
33
|
+
p as scrollEnd,
|
|
34
|
+
l as throttle,
|
|
35
|
+
C as toSlotFunction,
|
|
36
|
+
c as useConversation,
|
|
37
|
+
A as useI18n,
|
|
38
|
+
v as useMediaTheme,
|
|
39
|
+
f as useMessage
|
|
34
40
|
};
|
|
35
41
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export * from './chat';\nexport * from './renderer';\nexport * from './config-provider';\nexport * from './code-generator';\nexport * from './legacy-chat';\nexport * from './legacy-renderer';\nimport { RENDERER_SETTINGS_KEY as RENDERER_SETTINGS_KEY_IMPL } from '@opentiny/tiny-schema-renderer';\n\nexport const RENDERER_SETTINGS_KEY: symbol = RENDERER_SETTINGS_KEY_IMPL;\n"],"names":["RENDERER_SETTINGS_KEY","RENDERER_SETTINGS_KEY_IMPL"],"mappings":";;;;;;;;AAQO,MAAMA,IAAgCC;"}
|