plugin-build-guide-block 1.0.11 → 1.1.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/dist/client/components/SpaceSelect.d.ts +2 -0
- package/dist/client/index.js +9 -1
- package/dist/client/locale.d.ts +3 -0
- package/dist/client/models/UserGuideBlockModel.d.ts +3 -3
- package/dist/client/schemaSettings.d.ts +2 -0
- package/dist/client/schemas/spacesSchema.d.ts +118 -0
- package/dist/externalVersion.js +8 -8
- package/dist/locale/en-US.json +12 -1
- package/dist/locale/namespace.d.ts +6 -0
- package/dist/locale/namespace.js +36 -0
- package/dist/locale/vi-VN.json +3 -0
- package/dist/locale/zh-CN.json +3 -0
- package/dist/node_modules/marked/bin/main.js +279 -0
- package/dist/node_modules/marked/bin/marked.js +15 -0
- package/dist/node_modules/marked/lib/marked.cjs +1 -0
- package/dist/node_modules/marked/lib/marked.d.cts +657 -0
- package/dist/node_modules/marked/lib/marked.d.ts +657 -0
- package/dist/node_modules/marked/lib/marked.esm.js +2432 -0
- package/dist/node_modules/marked/lib/marked.umd.js +2456 -0
- package/dist/node_modules/marked/man/marked.1 +111 -0
- package/dist/node_modules/marked/marked.min.js +6 -0
- package/dist/node_modules/marked/package.json +1 -0
- package/dist/server/actions/build.js +383 -101
- package/dist/server/actions/getMarkdown.d.ts +2 -0
- package/dist/server/actions/getMarkdown.js +53 -0
- package/dist/server/collections/ai-build-guide-pages.d.ts +2 -0
- package/dist/server/collections/ai-build-guide-pages.js +90 -0
- package/dist/server/collections/ai-build-guide-spaces.js +42 -0
- package/dist/server/plugin.d.ts +3 -0
- package/dist/server/plugin.js +58 -13
- package/package.json +51 -31
- package/src/client/UserGuideBlock.tsx +368 -53
- package/src/client/UserGuideBlockProvider.tsx +9 -8
- package/src/client/components/SpaceSelect.tsx +37 -0
- package/src/client/locale.ts +18 -0
- package/src/client/models/UserGuideBlockModel.ts +19 -29
- package/src/client/plugin.tsx +53 -30
- package/src/client/schemaSettings.ts +65 -0
- package/src/client/schemas/spacesSchema.ts +434 -316
- package/src/locale/en-US.json +12 -1
- package/src/locale/namespace.ts +6 -0
- package/src/locale/vi-VN.json +3 -0
- package/src/locale/zh-CN.json +3 -0
- package/src/server/actions/build.ts +497 -176
- package/src/server/actions/getMarkdown.ts +26 -0
- package/src/server/collections/ai-build-guide-pages.ts +60 -0
- package/src/server/collections/ai-build-guide-spaces.ts +57 -15
- package/src/server/plugin.ts +130 -76
- package/src/server/collections/.gitkeep +0 -0
|
@@ -1,316 +1,434 @@
|
|
|
1
|
-
export const spacesSchema = {
|
|
2
|
-
type: 'void',
|
|
3
|
-
name: 'ai-build-guide-spaces',
|
|
4
|
-
properties: {
|
|
5
|
-
card: {
|
|
6
|
-
type: 'void',
|
|
7
|
-
'x-component': 'CardItem',
|
|
8
|
-
'x-decorator': 'TableBlockProvider',
|
|
9
|
-
'x-decorator-props': {
|
|
10
|
-
collection: 'aiBuildGuideSpaces',
|
|
11
|
-
action: 'list',
|
|
12
|
-
rowKey: 'id',
|
|
13
|
-
params: {
|
|
14
|
-
appends: ['documents'],
|
|
15
|
-
sort: ['-createdAt'],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
properties: {
|
|
19
|
-
actions: {
|
|
20
|
-
type: 'void',
|
|
21
|
-
'x-component': 'ActionBar',
|
|
22
|
-
'x-component-props': {
|
|
23
|
-
style: {
|
|
24
|
-
marginBottom: 16,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
properties: {
|
|
28
|
-
create: {
|
|
29
|
-
type: 'void',
|
|
30
|
-
'x-component': 'Action',
|
|
31
|
-
'x-component-props': {
|
|
32
|
-
type: 'primary',
|
|
33
|
-
title: '{{t("Create space")}}',
|
|
34
|
-
icon: 'PlusOutlined',
|
|
35
|
-
},
|
|
36
|
-
properties: {
|
|
37
|
-
drawer: {
|
|
38
|
-
type: 'void',
|
|
39
|
-
'x-component': 'Action.Drawer',
|
|
40
|
-
'x-component-props': {
|
|
41
|
-
title: '{{t("Create space")}}',
|
|
42
|
-
},
|
|
43
|
-
properties: {
|
|
44
|
-
form: {
|
|
45
|
-
type: 'void',
|
|
46
|
-
'x-component': 'FormV2',
|
|
47
|
-
'x-use-component-props': 'useCreateFormProps',
|
|
48
|
-
properties: {
|
|
49
|
-
title: {
|
|
50
|
-
type: 'string',
|
|
51
|
-
title: '{{t("Title")}}',
|
|
52
|
-
required: true,
|
|
53
|
-
'x-decorator': 'FormItem',
|
|
54
|
-
'x-component': 'Input',
|
|
55
|
-
},
|
|
56
|
-
llmService: {
|
|
57
|
-
type: 'string',
|
|
58
|
-
title: '{{t("LLM Service")}}',
|
|
59
|
-
required: true,
|
|
60
|
-
'x-decorator': 'FormItem',
|
|
61
|
-
'x-component': 'LLMServiceSelect',
|
|
62
|
-
},
|
|
63
|
-
model: {
|
|
64
|
-
type: 'string',
|
|
65
|
-
title: '{{t("Model")}}',
|
|
66
|
-
required: true,
|
|
67
|
-
'x-decorator': 'FormItem',
|
|
68
|
-
'x-component': 'ModelSelect',
|
|
69
|
-
'x-reactions': {
|
|
70
|
-
dependencies: ['llmService'],
|
|
71
|
-
fulfill: {
|
|
72
|
-
state: {
|
|
73
|
-
value: '{{$deps[0] ? $self.value : undefined}}',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
type: 'string',
|
|
80
|
-
title: '{{t("
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
'x-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
'x-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
'x-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
1
|
+
export const spacesSchema = {
|
|
2
|
+
type: 'void',
|
|
3
|
+
name: 'ai-build-guide-spaces',
|
|
4
|
+
properties: {
|
|
5
|
+
card: {
|
|
6
|
+
type: 'void',
|
|
7
|
+
'x-component': 'CardItem',
|
|
8
|
+
'x-decorator': 'TableBlockProvider',
|
|
9
|
+
'x-decorator-props': {
|
|
10
|
+
collection: 'aiBuildGuideSpaces',
|
|
11
|
+
action: 'list',
|
|
12
|
+
rowKey: 'id',
|
|
13
|
+
params: {
|
|
14
|
+
appends: ['documents'],
|
|
15
|
+
sort: ['-createdAt'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
properties: {
|
|
19
|
+
actions: {
|
|
20
|
+
type: 'void',
|
|
21
|
+
'x-component': 'ActionBar',
|
|
22
|
+
'x-component-props': {
|
|
23
|
+
style: {
|
|
24
|
+
marginBottom: 16,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
properties: {
|
|
28
|
+
create: {
|
|
29
|
+
type: 'void',
|
|
30
|
+
'x-component': 'Action',
|
|
31
|
+
'x-component-props': {
|
|
32
|
+
type: 'primary',
|
|
33
|
+
title: '{{t("Create space")}}',
|
|
34
|
+
icon: 'PlusOutlined',
|
|
35
|
+
},
|
|
36
|
+
properties: {
|
|
37
|
+
drawer: {
|
|
38
|
+
type: 'void',
|
|
39
|
+
'x-component': 'Action.Drawer',
|
|
40
|
+
'x-component-props': {
|
|
41
|
+
title: '{{t("Create space")}}',
|
|
42
|
+
},
|
|
43
|
+
properties: {
|
|
44
|
+
form: {
|
|
45
|
+
type: 'void',
|
|
46
|
+
'x-component': 'FormV2',
|
|
47
|
+
'x-use-component-props': 'useCreateFormProps',
|
|
48
|
+
properties: {
|
|
49
|
+
title: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
title: '{{t("Title")}}',
|
|
52
|
+
required: true,
|
|
53
|
+
'x-decorator': 'FormItem',
|
|
54
|
+
'x-component': 'Input',
|
|
55
|
+
},
|
|
56
|
+
llmService: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
title: '{{t("LLM Service")}}',
|
|
59
|
+
required: true,
|
|
60
|
+
'x-decorator': 'FormItem',
|
|
61
|
+
'x-component': 'LLMServiceSelect',
|
|
62
|
+
},
|
|
63
|
+
model: {
|
|
64
|
+
type: 'string',
|
|
65
|
+
title: '{{t("Model")}}',
|
|
66
|
+
required: true,
|
|
67
|
+
'x-decorator': 'FormItem',
|
|
68
|
+
'x-component': 'ModelSelect',
|
|
69
|
+
'x-reactions': {
|
|
70
|
+
dependencies: ['llmService'],
|
|
71
|
+
fulfill: {
|
|
72
|
+
state: {
|
|
73
|
+
value: '{{$deps[0] ? $self.value : undefined}}',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
outputFormat: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
title: '{{t("Output format")}}',
|
|
81
|
+
required: true,
|
|
82
|
+
default: 'html',
|
|
83
|
+
'x-decorator': 'FormItem',
|
|
84
|
+
'x-component': 'Select',
|
|
85
|
+
enum: [
|
|
86
|
+
{ label: 'HTML', value: 'html' },
|
|
87
|
+
{ label: 'Markdown', value: 'markdown' },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
targetChapterCount: {
|
|
91
|
+
type: 'number',
|
|
92
|
+
title: '{{t("Target chapters")}}',
|
|
93
|
+
required: true,
|
|
94
|
+
default: 5,
|
|
95
|
+
'x-decorator': 'FormItem',
|
|
96
|
+
'x-component': 'InputNumber',
|
|
97
|
+
'x-component-props': {
|
|
98
|
+
min: 3,
|
|
99
|
+
max: 12,
|
|
100
|
+
precision: 0,
|
|
101
|
+
style: {
|
|
102
|
+
width: '100%',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
chapterGuidance: {
|
|
107
|
+
type: 'string',
|
|
108
|
+
title: '{{t("Chapter guidance")}}',
|
|
109
|
+
'x-decorator': 'FormItem',
|
|
110
|
+
'x-component': 'Input.TextArea',
|
|
111
|
+
'x-component-props': {
|
|
112
|
+
rows: 3,
|
|
113
|
+
placeholder: '{{t("Describe how the guide should be split into chapters")}}',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
systemPrompt: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
title: '{{t("System Prompt")}}',
|
|
119
|
+
'x-decorator': 'FormItem',
|
|
120
|
+
'x-component': 'Input.TextArea',
|
|
121
|
+
'x-component-props': {
|
|
122
|
+
rows: 4,
|
|
123
|
+
},
|
|
124
|
+
default:
|
|
125
|
+
'You are an expert technical writer. Generate a comprehensive user guide based on the provided documents.',
|
|
126
|
+
},
|
|
127
|
+
documents: {
|
|
128
|
+
type: 'array',
|
|
129
|
+
title: '{{t("Documents")}}',
|
|
130
|
+
'x-decorator': 'FormItem',
|
|
131
|
+
'x-component': 'Upload.Attachment',
|
|
132
|
+
'x-component-props': {
|
|
133
|
+
multiple: true,
|
|
134
|
+
action: 'attachments:create',
|
|
135
|
+
maxCount: 10,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
footer: {
|
|
139
|
+
type: 'void',
|
|
140
|
+
'x-component': 'Action.Drawer.Footer',
|
|
141
|
+
properties: {
|
|
142
|
+
cancel: {
|
|
143
|
+
type: 'void',
|
|
144
|
+
title: '{{t("Cancel")}}',
|
|
145
|
+
'x-component': 'Action',
|
|
146
|
+
'x-use-component-props': 'useCancelActionProps',
|
|
147
|
+
},
|
|
148
|
+
submit: {
|
|
149
|
+
type: 'void',
|
|
150
|
+
title: '{{t("Submit")}}',
|
|
151
|
+
'x-component': 'Action',
|
|
152
|
+
'x-use-component-props': 'useCreateActionProps',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
table: {
|
|
165
|
+
type: 'array',
|
|
166
|
+
'x-component': 'TableV2',
|
|
167
|
+
'x-use-component-props': 'useTableBlockProps',
|
|
168
|
+
'x-component-props': {
|
|
169
|
+
rowKey: 'id',
|
|
170
|
+
rowSelection: {
|
|
171
|
+
type: 'checkbox',
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
properties: {
|
|
175
|
+
title: {
|
|
176
|
+
type: 'void',
|
|
177
|
+
title: '{{t("Title")}}',
|
|
178
|
+
'x-decorator': 'TableV2.Column.Decorator',
|
|
179
|
+
'x-component': 'TableV2.Column',
|
|
180
|
+
properties: {
|
|
181
|
+
title: {
|
|
182
|
+
type: 'string',
|
|
183
|
+
'x-component': 'Input',
|
|
184
|
+
'x-read-pretty': true,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
status: {
|
|
189
|
+
type: 'void',
|
|
190
|
+
title: '{{t("Status")}}',
|
|
191
|
+
'x-decorator': 'TableV2.Column.Decorator',
|
|
192
|
+
'x-component': 'TableV2.Column',
|
|
193
|
+
properties: {
|
|
194
|
+
status: {
|
|
195
|
+
type: 'string',
|
|
196
|
+
'x-component': 'StatusTag',
|
|
197
|
+
'x-read-pretty': true,
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
buildPhase: {
|
|
202
|
+
type: 'void',
|
|
203
|
+
title: '{{t("Build Phase")}}',
|
|
204
|
+
'x-decorator': 'TableV2.Column.Decorator',
|
|
205
|
+
'x-component': 'TableV2.Column',
|
|
206
|
+
properties: {
|
|
207
|
+
buildPhase: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
'x-component': 'Input',
|
|
210
|
+
'x-read-pretty': true,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
pageCount: {
|
|
215
|
+
type: 'void',
|
|
216
|
+
title: '{{t("Chapters")}}',
|
|
217
|
+
'x-decorator': 'TableV2.Column.Decorator',
|
|
218
|
+
'x-component': 'TableV2.Column',
|
|
219
|
+
properties: {
|
|
220
|
+
pageCount: {
|
|
221
|
+
type: 'integer',
|
|
222
|
+
'x-component': 'InputNumber',
|
|
223
|
+
'x-read-pretty': true,
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
buildLog: {
|
|
228
|
+
type: 'void',
|
|
229
|
+
title: '{{t("Build Log")}}',
|
|
230
|
+
'x-decorator': 'TableV2.Column.Decorator',
|
|
231
|
+
'x-component': 'TableV2.Column',
|
|
232
|
+
properties: {
|
|
233
|
+
buildLog: {
|
|
234
|
+
type: 'string',
|
|
235
|
+
'x-component': 'Input.TextArea',
|
|
236
|
+
'x-read-pretty': true,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
actions: {
|
|
241
|
+
type: 'void',
|
|
242
|
+
title: '{{t("Actions")}}',
|
|
243
|
+
'x-decorator': 'TableV2.Column.Decorator',
|
|
244
|
+
'x-component': 'TableV2.Column',
|
|
245
|
+
properties: {
|
|
246
|
+
actions: {
|
|
247
|
+
type: 'void',
|
|
248
|
+
'x-component': 'Space',
|
|
249
|
+
'x-component-props': {
|
|
250
|
+
split: '|',
|
|
251
|
+
},
|
|
252
|
+
properties: {
|
|
253
|
+
build: {
|
|
254
|
+
type: 'void',
|
|
255
|
+
'x-component': 'BuildButton',
|
|
256
|
+
},
|
|
257
|
+
update: {
|
|
258
|
+
type: 'void',
|
|
259
|
+
title: '{{t("Edit")}}',
|
|
260
|
+
'x-component': 'Action.Link',
|
|
261
|
+
'x-component-props': {
|
|
262
|
+
type: 'primary',
|
|
263
|
+
},
|
|
264
|
+
properties: {
|
|
265
|
+
drawer: {
|
|
266
|
+
type: 'void',
|
|
267
|
+
'x-component': 'Action.Drawer',
|
|
268
|
+
'x-component-props': {
|
|
269
|
+
title: '{{t("Edit space")}}',
|
|
270
|
+
},
|
|
271
|
+
properties: {
|
|
272
|
+
form: {
|
|
273
|
+
type: 'void',
|
|
274
|
+
'x-component': 'FormV2',
|
|
275
|
+
'x-use-component-props': 'useEditFormProps',
|
|
276
|
+
properties: {
|
|
277
|
+
title: {
|
|
278
|
+
type: 'string',
|
|
279
|
+
title: '{{t("Title")}}',
|
|
280
|
+
required: true,
|
|
281
|
+
'x-decorator': 'FormItem',
|
|
282
|
+
'x-component': 'Input',
|
|
283
|
+
},
|
|
284
|
+
llmService: {
|
|
285
|
+
type: 'string',
|
|
286
|
+
title: '{{t("LLM Service")}}',
|
|
287
|
+
required: true,
|
|
288
|
+
'x-decorator': 'FormItem',
|
|
289
|
+
'x-component': 'LLMServiceSelect',
|
|
290
|
+
},
|
|
291
|
+
model: {
|
|
292
|
+
type: 'string',
|
|
293
|
+
title: '{{t("Model")}}',
|
|
294
|
+
required: true,
|
|
295
|
+
'x-decorator': 'FormItem',
|
|
296
|
+
'x-component': 'ModelSelect',
|
|
297
|
+
},
|
|
298
|
+
outputFormat: {
|
|
299
|
+
type: 'string',
|
|
300
|
+
title: '{{t("Output format")}}',
|
|
301
|
+
required: true,
|
|
302
|
+
'x-decorator': 'FormItem',
|
|
303
|
+
'x-component': 'Select',
|
|
304
|
+
enum: [
|
|
305
|
+
{ label: 'HTML', value: 'html' },
|
|
306
|
+
{ label: 'Markdown', value: 'markdown' },
|
|
307
|
+
],
|
|
308
|
+
},
|
|
309
|
+
targetChapterCount: {
|
|
310
|
+
type: 'number',
|
|
311
|
+
title: '{{t("Target chapters")}}',
|
|
312
|
+
required: true,
|
|
313
|
+
'x-decorator': 'FormItem',
|
|
314
|
+
'x-component': 'InputNumber',
|
|
315
|
+
'x-component-props': {
|
|
316
|
+
min: 3,
|
|
317
|
+
max: 12,
|
|
318
|
+
precision: 0,
|
|
319
|
+
style: {
|
|
320
|
+
width: '100%',
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
chapterGuidance: {
|
|
325
|
+
type: 'string',
|
|
326
|
+
title: '{{t("Chapter guidance")}}',
|
|
327
|
+
'x-decorator': 'FormItem',
|
|
328
|
+
'x-component': 'Input.TextArea',
|
|
329
|
+
'x-component-props': {
|
|
330
|
+
rows: 3,
|
|
331
|
+
placeholder: '{{t("Describe how the guide should be split into chapters")}}',
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
systemPrompt: {
|
|
335
|
+
type: 'string',
|
|
336
|
+
title: '{{t("System Prompt")}}',
|
|
337
|
+
'x-decorator': 'FormItem',
|
|
338
|
+
'x-component': 'Input.TextArea',
|
|
339
|
+
'x-component-props': {
|
|
340
|
+
rows: 4,
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
documents: {
|
|
344
|
+
type: 'array',
|
|
345
|
+
title: '{{t("Documents")}}',
|
|
346
|
+
'x-decorator': 'FormItem',
|
|
347
|
+
'x-component': 'Upload.Attachment',
|
|
348
|
+
'x-component-props': {
|
|
349
|
+
multiple: true,
|
|
350
|
+
action: 'attachments:create',
|
|
351
|
+
maxCount: 10,
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
generatedHtml: {
|
|
355
|
+
type: 'string',
|
|
356
|
+
title: '{{t("Generated HTML")}}',
|
|
357
|
+
'x-decorator': 'FormItem',
|
|
358
|
+
'x-component': 'Input.TextArea',
|
|
359
|
+
'x-component-props': {
|
|
360
|
+
rows: 6,
|
|
361
|
+
},
|
|
362
|
+
'x-read-pretty': true,
|
|
363
|
+
},
|
|
364
|
+
generatedMarkdown: {
|
|
365
|
+
type: 'string',
|
|
366
|
+
title: '{{t("Generated Markdown")}}',
|
|
367
|
+
'x-decorator': 'FormItem',
|
|
368
|
+
'x-component': 'Input.TextArea',
|
|
369
|
+
'x-component-props': {
|
|
370
|
+
rows: 6,
|
|
371
|
+
},
|
|
372
|
+
'x-read-pretty': true,
|
|
373
|
+
'x-reactions': {
|
|
374
|
+
dependencies: ['outputFormat'],
|
|
375
|
+
fulfill: {
|
|
376
|
+
state: {
|
|
377
|
+
visible: '{{$deps[0] === "markdown"}}',
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
buildLog: {
|
|
383
|
+
type: 'string',
|
|
384
|
+
title: '{{t("Build Log")}}',
|
|
385
|
+
'x-decorator': 'FormItem',
|
|
386
|
+
'x-component': 'Input.TextArea',
|
|
387
|
+
'x-read-pretty': true,
|
|
388
|
+
},
|
|
389
|
+
footer: {
|
|
390
|
+
type: 'void',
|
|
391
|
+
'x-component': 'Action.Drawer.Footer',
|
|
392
|
+
properties: {
|
|
393
|
+
cancel: {
|
|
394
|
+
type: 'void',
|
|
395
|
+
title: '{{t("Cancel")}}',
|
|
396
|
+
'x-component': 'Action',
|
|
397
|
+
'x-use-component-props': 'useCancelActionProps',
|
|
398
|
+
},
|
|
399
|
+
submit: {
|
|
400
|
+
type: 'void',
|
|
401
|
+
title: '{{t("Submit")}}',
|
|
402
|
+
'x-component': 'Action',
|
|
403
|
+
'x-use-component-props': 'useUpdateActionProps',
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
delete: {
|
|
414
|
+
type: 'void',
|
|
415
|
+
title: '{{t("Delete")}}',
|
|
416
|
+
'x-component': 'Action.Link',
|
|
417
|
+
'x-use-component-props': 'useDestroyActionProps',
|
|
418
|
+
'x-component-props': {
|
|
419
|
+
confirm: {
|
|
420
|
+
title: '{{t("Delete")}}',
|
|
421
|
+
content: '{{t("Are you sure you want to delete this space?")}}',
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
};
|