@vtj/designer 0.11.15 → 0.12.0-alpha.0
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/dist/Editor-DN_yRaGC.js +4 -0
- package/dist/index-BW1rPE3i.js +17483 -0
- package/dist/index.mjs +69 -13054
- package/dist/style.css +1 -1
- package/package.json +10 -8
- package/types/components/hooks/index.d.ts +1 -0
- package/types/components/hooks/useAI.d.ts +188 -0
- package/types/components/hooks/useOpenApi.d.ts +15 -25
- package/types/components/hooks/useTemplates.d.ts +1 -1
- package/types/components/regions/apps.d.ts +32 -3
- package/types/components/regions/index.d.ts +31 -1
- package/types/components/regions/workspace.d.ts +1 -0
- package/types/components/shared/binder.d.ts +10 -10
- package/types/components/shared/item.d.ts +2 -0
- package/types/components/shared/panel.d.ts +1129 -5
- package/types/components/widgets/ai/avatar.d.ts +3 -0
- package/types/components/widgets/ai/bubble.d.ts +22 -0
- package/types/components/widgets/ai/chat-input.d.ts +27 -0
- package/types/components/widgets/ai/detail.d.ts +98 -0
- package/types/components/widgets/ai/index.d.ts +671 -0
- package/types/components/widgets/ai/invite-tip.d.ts +8 -0
- package/types/components/widgets/ai/login-tip.d.ts +3 -0
- package/types/components/widgets/ai/new-topic.d.ts +19 -0
- package/types/components/widgets/ai/no-file-tip.d.ts +3 -0
- package/types/components/widgets/ai/pay-tip.d.ts +11 -0
- package/types/components/widgets/ai/records.d.ts +18 -0
- package/types/components/widgets/ai/stream-markdown.d.ts +13 -0
- package/types/components/widgets/apis/form.d.ts +8 -8
- package/types/components/widgets/docs/index.d.ts +574 -5
- package/types/components/widgets/index.d.ts +1811 -7
- package/types/components/widgets/market/index.d.ts +574 -5
- package/types/framework/engine.d.ts +50 -1
- package/types/framework/index.d.ts +1 -0
- package/types/framework/openapi.d.ts +100 -0
- package/types/framework/renderer.d.ts +1 -0
- package/types/framework/report.d.ts +1 -1
- package/types/framework/types.d.ts +4 -0
- package/types/managers/widget.d.ts +11 -0
- package/types/utils.d.ts +2 -2
- package/types/version.d.ts +2 -2
- package/dist/Editor-7SLplEph.js +0 -67
@@ -1,22 +1,56 @@
|
|
1
1
|
import { ShallowReactive, InjectionKey, MaybeRef, App, Ref } from 'vue';
|
2
|
-
import { Base, ProjectModel, BlockModel, HistoryModel, Service, Emitter, ProjectSchema, ProjectModelEvent } from '@vtj/core';
|
2
|
+
import { Base, ProjectModel, BlockModel, HistoryModel, Service, Emitter, ProjectSchema, ProjectModelEvent, BlockSchema } from '@vtj/core';
|
3
3
|
import { Context, Provider, Access, ProvideAdapter } from '@vtj/renderer';
|
4
4
|
import { SkeletonWrapperInstance } from '../wrappers';
|
5
5
|
import { Simulator } from './simulator';
|
6
6
|
import { Assets } from './assets';
|
7
7
|
import { Report } from './report';
|
8
|
+
import { OpenApi } from './openapi';
|
8
9
|
export declare const engineKey: InjectionKey<ShallowReactive<Engine>>;
|
9
10
|
export interface EngineOptions {
|
11
|
+
/**
|
12
|
+
* 设计器渲染容器
|
13
|
+
*/
|
10
14
|
container: MaybeRef<HTMLElement | undefined>;
|
15
|
+
/**
|
16
|
+
* 设计器文件服务
|
17
|
+
*/
|
11
18
|
service: Service;
|
19
|
+
/**
|
20
|
+
* 当前加载的项目信息
|
21
|
+
*/
|
12
22
|
project?: Partial<ProjectSchema>;
|
23
|
+
/**
|
24
|
+
* 项目依赖,优先于 project 的 dependencies
|
25
|
+
*/
|
13
26
|
dependencies?: Record<string, () => Promise<any>>;
|
27
|
+
/**
|
28
|
+
* 项目物料,优先于 project 的 dependencies
|
29
|
+
*/
|
14
30
|
materials?: Record<string, () => Promise<any>>;
|
31
|
+
/**
|
32
|
+
* 内置物料路径 BasePath
|
33
|
+
*/
|
15
34
|
materialPath?: string;
|
35
|
+
/**
|
36
|
+
* 全局变量
|
37
|
+
*/
|
16
38
|
globals?: Record<string, any>;
|
39
|
+
/**
|
40
|
+
* 设计器画布适配
|
41
|
+
*/
|
17
42
|
adapter?: Partial<ProvideAdapter>;
|
43
|
+
/**
|
44
|
+
* 设计器初始化后执行的回调
|
45
|
+
*/
|
18
46
|
install?: (app: App, engine?: Engine) => void;
|
47
|
+
/**
|
48
|
+
* 页面路由 base
|
49
|
+
*/
|
19
50
|
pageBasePath?: string;
|
51
|
+
/**
|
52
|
+
* 页面路由名称
|
53
|
+
*/
|
20
54
|
pageRouteName?: string;
|
21
55
|
/**
|
22
56
|
* 这个是引擎自己的Access,不是业务应用,应用的在 adapter 中设置
|
@@ -26,6 +60,18 @@ export interface EngineOptions {
|
|
26
60
|
* 远程服务host
|
27
61
|
*/
|
28
62
|
remote?: string;
|
63
|
+
/**
|
64
|
+
* 授权登录
|
65
|
+
*/
|
66
|
+
auth?: string | (() => Promise<any>);
|
67
|
+
/**
|
68
|
+
* 开启版本检查
|
69
|
+
*/
|
70
|
+
checkVersion?: boolean;
|
71
|
+
/**
|
72
|
+
* 适配远程接口
|
73
|
+
*/
|
74
|
+
openApi?: OpenApi;
|
29
75
|
}
|
30
76
|
export declare const SAVE_BLOCK_FILE_FINISH = "SAVE_BLOCK_FILE_FINISH";
|
31
77
|
export declare class Engine extends Base {
|
@@ -51,6 +97,8 @@ export declare class Engine extends Base {
|
|
51
97
|
access?: Access;
|
52
98
|
remote: string;
|
53
99
|
report: Report;
|
100
|
+
checkVersion: boolean;
|
101
|
+
openApi?: OpenApi;
|
54
102
|
constructor(options: EngineOptions);
|
55
103
|
private init;
|
56
104
|
private render;
|
@@ -69,6 +117,7 @@ export declare class Engine extends Base {
|
|
69
117
|
private loadHistory;
|
70
118
|
private publish;
|
71
119
|
genSource(): Promise<string | undefined>;
|
120
|
+
applyAI(dsl: BlockSchema): Promise<void>;
|
72
121
|
private publishCurrent;
|
73
122
|
dispose(): void;
|
74
123
|
openFile(fileId?: string): Promise<void>;
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import { Access } from '@vtj/renderer';
|
2
|
+
import { PlatformType, BlockSchema } from '@vtj/core';
|
3
|
+
export interface TemplateDto {
|
4
|
+
id: string;
|
5
|
+
name: string;
|
6
|
+
label: string;
|
7
|
+
vip: boolean;
|
8
|
+
share: boolean;
|
9
|
+
cover: string;
|
10
|
+
author: string;
|
11
|
+
userId: string;
|
12
|
+
category: string;
|
13
|
+
latest: string;
|
14
|
+
platform: string;
|
15
|
+
}
|
16
|
+
export interface DictOption {
|
17
|
+
label: string;
|
18
|
+
value: string;
|
19
|
+
}
|
20
|
+
export interface PublishTemplateDto {
|
21
|
+
name: string;
|
22
|
+
label: string;
|
23
|
+
category: string;
|
24
|
+
cover: Blob;
|
25
|
+
share: boolean;
|
26
|
+
version: string;
|
27
|
+
platform: string;
|
28
|
+
latest?: string;
|
29
|
+
dsl: string;
|
30
|
+
id?: string;
|
31
|
+
}
|
32
|
+
export interface TopicDto {
|
33
|
+
model: string;
|
34
|
+
project: string;
|
35
|
+
dsl: string;
|
36
|
+
source: string;
|
37
|
+
prompt: string;
|
38
|
+
}
|
39
|
+
export interface AITopic {
|
40
|
+
id: string;
|
41
|
+
appId: string;
|
42
|
+
createAt: string;
|
43
|
+
fileId: string;
|
44
|
+
isHot: boolean;
|
45
|
+
model: string;
|
46
|
+
platform: string;
|
47
|
+
projectId: string;
|
48
|
+
title: string;
|
49
|
+
prompt: string;
|
50
|
+
dependencies: string;
|
51
|
+
dsl: any;
|
52
|
+
}
|
53
|
+
export interface AIChat {
|
54
|
+
id: string;
|
55
|
+
content: string;
|
56
|
+
createdAt: string;
|
57
|
+
dsl: any;
|
58
|
+
message: string;
|
59
|
+
prompt: string;
|
60
|
+
reasoning: string;
|
61
|
+
status: string;
|
62
|
+
tokens: number;
|
63
|
+
topicId: string;
|
64
|
+
userId: string;
|
65
|
+
userName: string;
|
66
|
+
thinking: number;
|
67
|
+
vue: string;
|
68
|
+
collapsed?: boolean;
|
69
|
+
}
|
70
|
+
export interface ChatDto {
|
71
|
+
topicId: string;
|
72
|
+
prompt: string;
|
73
|
+
}
|
74
|
+
export interface ResponseWrapper<T = any> {
|
75
|
+
code: number;
|
76
|
+
success: boolean;
|
77
|
+
message?: string;
|
78
|
+
data: T;
|
79
|
+
}
|
80
|
+
export declare abstract class OpenApi {
|
81
|
+
abstract access: Access;
|
82
|
+
abstract loginBySign: () => Promise<string[]>;
|
83
|
+
abstract isLogined: () => Promise<boolean>;
|
84
|
+
abstract getTemplates: (platform: PlatformType) => Promise<TemplateDto[]>;
|
85
|
+
abstract getTemplateById: (id: string) => Promise<TemplateDto>;
|
86
|
+
abstract removeTemplate: (id: string) => Promise<boolean>;
|
87
|
+
abstract getTemplateDsl: (id: string) => Promise<BlockSchema>;
|
88
|
+
abstract getDictOptions: (code: string) => Promise<DictOption[]>;
|
89
|
+
abstract publishTemplate: (dto: PublishTemplateDto) => Promise<boolean>;
|
90
|
+
abstract postTopic: (dto: TopicDto) => Promise<ResponseWrapper<{
|
91
|
+
topic: AITopic;
|
92
|
+
chat: AIChat;
|
93
|
+
}>>;
|
94
|
+
abstract getChats: (topicId: string) => Promise<ResponseWrapper<AIChat[]>>;
|
95
|
+
abstract getTopics: (fileId: string) => Promise<ResponseWrapper<AITopic[]>>;
|
96
|
+
abstract postChat: (dto: ChatDto) => Promise<ResponseWrapper<AIChat>>;
|
97
|
+
abstract saveChat: (chat: AIChat) => Promise<ResponseWrapper<boolean>>;
|
98
|
+
abstract removeTopic: (topicId: string) => Promise<ResponseWrapper<boolean>>;
|
99
|
+
abstract getHotTopics: () => Promise<ResponseWrapper<AITopic[]>>;
|
100
|
+
}
|
@@ -20,10 +20,10 @@ export interface ReportData {
|
|
20
20
|
source?: string;
|
21
21
|
}
|
22
22
|
export declare class Report {
|
23
|
-
private remote;
|
24
23
|
private access;
|
25
24
|
private service?;
|
26
25
|
private api;
|
26
|
+
private remote;
|
27
27
|
private debounceSend;
|
28
28
|
constructor(remote: string, access: Access, service?: Service | undefined);
|
29
29
|
private isVtjUrl;
|
@@ -24,6 +24,11 @@ declare class WidgetManager {
|
|
24
24
|
* @returns
|
25
25
|
*/
|
26
26
|
set(name: string, widget: Partial<Widget>): void;
|
27
|
+
/**
|
28
|
+
* 删除器件
|
29
|
+
* @param name
|
30
|
+
*/
|
31
|
+
unregister(name: string): void;
|
27
32
|
/**
|
28
33
|
* 根据区域名称获取区域内的器件配置
|
29
34
|
* @param region
|
@@ -31,6 +36,12 @@ declare class WidgetManager {
|
|
31
36
|
* @returns
|
32
37
|
*/
|
33
38
|
getWidgets(region?: keyof typeof RegionType, group?: string): Widget[];
|
39
|
+
/**
|
40
|
+
* 获取支持Remote器件
|
41
|
+
* @returns
|
42
|
+
*/
|
43
|
+
getRemoteWidgets(): Widget[];
|
44
|
+
removeRemoteWidgets(): void;
|
34
45
|
}
|
35
46
|
export declare const widgetManager: WidgetManager;
|
36
47
|
export {};
|
package/types/utils.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { JSExpression, JSFunction } from '@vtj/core';
|
2
2
|
import { MessageBoxData, NotificationHandle, MessageHandler } from 'element-plus';
|
3
|
-
export declare function alert(message: string): Promise< MessageBoxData>;
|
3
|
+
export declare function alert(message: string, options?: any): Promise< MessageBoxData>;
|
4
4
|
export declare function notify(message: string, title?: string): NotificationHandle;
|
5
|
-
export declare function confirm(message: string): Promise<boolean | MessageBoxData>;
|
5
|
+
export declare function confirm(message: string, options?: any): Promise<boolean | MessageBoxData>;
|
6
6
|
export declare function message(message: string, type?: 'success' | 'warning'): MessageHandler;
|
7
7
|
export declare function proxyContext(context: any): any;
|
8
8
|
export declare function expressionValidate(str: JSExpression | JSFunction, self: any, thisRequired?: boolean): boolean;
|
package/types/version.d.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
3
3
|
* @name @vtj/designer
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
5
|
-
* @version 0.11.
|
5
|
+
* @version 0.11.16
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
7
7
|
*/
|
8
|
-
export declare const version = "0.11.
|
8
|
+
export declare const version = "0.11.16";
|
package/dist/Editor-7SLplEph.js
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
import { defineComponent as p, ref as f, onMounted as y, nextTick as g, onUnmounted as h, watch as w, createElementBlock as v, openBlock as V, normalizeStyle as k, withKeys as B, normalizeClass as E, withModifiers as x } from "vue";
|
2
|
-
import { editor as _ } from "monaco-editor";
|
3
|
-
const T = /* @__PURE__ */ p({
|
4
|
-
__name: "Editor",
|
5
|
-
props: {
|
6
|
-
lang: { default: "typescript" },
|
7
|
-
modelValue: { default: "" },
|
8
|
-
options: { default: () => ({}) },
|
9
|
-
height: { default: "300px" },
|
10
|
-
readonly: { type: Boolean, default: !1 },
|
11
|
-
dark: { type: Boolean, default: !1 },
|
12
|
-
border: { type: Boolean },
|
13
|
-
minimap: { type: Boolean, default: !1 }
|
14
|
-
},
|
15
|
-
emits: ["change", "blur", "update:modelValue"],
|
16
|
-
setup(l, { expose: s, emit: d }) {
|
17
|
-
const t = l;
|
18
|
-
self.MonacoEnvironment = {
|
19
|
-
createTrustedTypesPolicy: void 0,
|
20
|
-
async getWorker(o, a) {
|
21
|
-
let n;
|
22
|
-
return a === "json" && (n = await import("./json.worker-DCDqLFYI.js")), ["css", "scss", "less"].includes(a) && (n = await import("./css.worker-DhE07keG.js")), ["html", "handlebars", "razor", "vue"].includes(a) && (n = await import("./html.worker-C5hxLCyX.js")), ["typescript", "javascript"].includes(a) && (n = await import("./ts.worker-Bjq4oI3m.js")), n = n || await import("./editor.worker-DKpUct5n.js"), new n.default();
|
23
|
-
}
|
24
|
-
};
|
25
|
-
const r = d, i = f();
|
26
|
-
let e = null;
|
27
|
-
const u = async () => {
|
28
|
-
e && (await e.getAction("editor.action.formatDocument")?.run(), e.setValue(e.getValue()));
|
29
|
-
}, c = async () => {
|
30
|
-
await u();
|
31
|
-
const o = e?.getValue();
|
32
|
-
r("update:modelValue", o), r("blur", o);
|
33
|
-
}, m = () => {
|
34
|
-
e = _.create(i.value, {
|
35
|
-
value: t.modelValue,
|
36
|
-
language: t.lang,
|
37
|
-
readOnly: t.readonly,
|
38
|
-
theme: t.dark ? "vs-dark" : "vs",
|
39
|
-
automaticLayout: !0,
|
40
|
-
minimap: { enabled: t.minimap },
|
41
|
-
...t.options
|
42
|
-
}), e.onDidChangeModelContent((o) => {
|
43
|
-
r("change", e?.getValue(), o);
|
44
|
-
}), e.onDidBlurEditorText(c);
|
45
|
-
};
|
46
|
-
return y(() => {
|
47
|
-
g(m);
|
48
|
-
}), h(() => {
|
49
|
-
e && e.dispose();
|
50
|
-
}), w(
|
51
|
-
() => t.modelValue,
|
52
|
-
(o) => {
|
53
|
-
e && e.setValue(o);
|
54
|
-
}
|
55
|
-
), s({ getEditor: () => e }), (o, a) => (V(), v("div", {
|
56
|
-
class: E(["v-code-editor", { "is-border": t.border }]),
|
57
|
-
ref_key: "container",
|
58
|
-
ref: i,
|
59
|
-
onKeyup: a[0] || (a[0] = B(x(() => {
|
60
|
-
}, ["stop"]), ["enter"])),
|
61
|
-
style: k({ height: t.height })
|
62
|
-
}, null, 38));
|
63
|
-
}
|
64
|
-
});
|
65
|
-
export {
|
66
|
-
T as default
|
67
|
-
};
|