@flowgram.ai/form-materials 0.2.32 → 0.3.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/bin/index.ts +11 -5
- package/bin/materials.ts +1 -1
- package/dist/esm/index.js +1252 -1361
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +232 -202
- package/dist/index.d.ts +232 -202
- package/dist/index.js +1396 -1506
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/components/batch-variable-selector/config.json +6 -2
- package/src/components/batch-variable-selector/index.tsx +1 -1
- package/src/components/code-editor/theme/light.ts +1 -1
- package/src/components/code-editor-mini/config.json +7 -0
- package/src/components/code-editor-mini/index.tsx +31 -0
- package/src/components/condition-row/config.json +10 -2
- package/src/components/condition-row/hooks/useRule.ts +2 -2
- package/src/components/condition-row/index.tsx +1 -1
- package/src/components/condition-row/types.ts +3 -1
- package/src/components/constant-input/config.json +6 -3
- package/src/components/constant-input/index.tsx +10 -71
- package/src/components/constant-input/types.ts +6 -10
- package/src/components/display-flow-value/config.json +8 -0
- package/src/components/display-flow-value/index.tsx +59 -0
- package/src/components/display-inputs-values/config.json +9 -0
- package/src/components/display-inputs-values/index.tsx +27 -0
- package/src/components/display-inputs-values/styles.ts +12 -0
- package/src/components/display-outputs/config.json +10 -0
- package/src/components/display-outputs/index.tsx +58 -0
- package/src/components/display-outputs/styles.ts +12 -0
- package/src/components/display-schema-tag/config.json +10 -0
- package/src/components/display-schema-tag/index.tsx +44 -0
- package/src/components/display-schema-tag/styles.ts +28 -0
- package/src/components/display-schema-tree/config.json +11 -0
- package/src/components/display-schema-tree/index.tsx +74 -0
- package/src/components/display-schema-tree/styles.tsx +90 -0
- package/src/components/dynamic-value-input/config.json +11 -2
- package/src/components/dynamic-value-input/hooks.ts +53 -0
- package/src/components/dynamic-value-input/index.tsx +30 -28
- package/src/components/index.ts +6 -0
- package/src/components/inputs-values/config.json +2 -1
- package/src/components/inputs-values/types.ts +3 -1
- package/src/components/json-schema-editor/config.json +3 -3
- package/src/components/json-schema-editor/default-value.tsx +1 -1
- package/src/components/json-schema-editor/hooks.tsx +1 -1
- package/src/components/json-schema-editor/index.tsx +1 -1
- package/src/components/json-schema-editor/types.ts +1 -1
- package/src/components/type-selector/config.json +6 -2
- package/src/components/type-selector/index.tsx +47 -11
- package/src/components/variable-selector/config.json +6 -2
- package/src/components/variable-selector/index.tsx +1 -1
- package/src/components/variable-selector/use-variable-tree.tsx +14 -20
- package/src/effects/provide-json-schema-outputs/config.json +4 -5
- package/src/effects/provide-json-schema-outputs/index.ts +1 -3
- package/src/effects/sync-variable-title/index.ts +1 -0
- package/src/form-plugins/infer-inputs-plugin/config.json +3 -1
- package/src/form-plugins/infer-inputs-plugin/index.ts +2 -2
- package/src/index.ts +1 -1
- package/src/{utils → shared}/index.ts +1 -1
- package/src/shared/json-schema-preset/config.json +9 -0
- package/src/shared/json-schema-preset/create-type-preset-plugin.tsx +26 -0
- package/src/shared/json-schema-preset/index.tsx +39 -0
- package/src/shared/json-schema-preset/manager.ts +18 -0
- package/src/shared/json-schema-preset/type-definition/array.tsx +23 -0
- package/src/shared/json-schema-preset/type-definition/boolean.tsx +32 -0
- package/src/shared/json-schema-preset/type-definition/index.tsx +24 -0
- package/src/shared/json-schema-preset/type-definition/integer.tsx +24 -0
- package/src/shared/json-schema-preset/type-definition/number.tsx +24 -0
- package/src/shared/json-schema-preset/type-definition/object.tsx +23 -0
- package/src/shared/json-schema-preset/type-definition/string.tsx +18 -0
- package/src/typings/flow-value/config.json +4 -4
- package/src/typings/flow-value/index.ts +1 -1
- package/src/typings/index.ts +0 -1
- package/src/components/type-selector/constants.tsx +0 -364
- package/src/typings/json-schema/config.json +0 -5
- package/src/typings/json-schema/index.ts +0 -36
- package/src/utils/json-schema/config.json +0 -5
- package/src/utils/json-schema/index.ts +0 -180
- /package/src/{utils → shared}/format-legacy-refs/config.json +0 -0
- /package/src/{utils → shared}/format-legacy-refs/index.ts +0 -0
- /package/src/{utils → shared}/format-legacy-refs/readme.md +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,13 @@
|
|
|
1
1
|
import React$1 from 'react';
|
|
2
|
+
import { IJsonSchema, JsonSchemaTypeRegistry as JsonSchemaTypeRegistry$1, JsonSchemaTypeManager } from '@flowgram.ai/json-schema';
|
|
3
|
+
export { IJsonSchema, JsonSchemaUtils } from '@flowgram.ai/json-schema';
|
|
2
4
|
import { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
|
|
3
5
|
import { InferValues } from '@coze-editor/editor/react';
|
|
4
6
|
import preset from '@coze-editor/editor/preset-code';
|
|
5
|
-
import { BaseVariableField, EffectOptions,
|
|
7
|
+
import { BaseVariableField, EffectOptions, FormPluginCreator } from '@flowgram.ai/editor';
|
|
6
8
|
import * as _flowgram_ai_node from '@flowgram.ai/node';
|
|
7
9
|
import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
11
|
-
* SPDX-License-Identifier: MIT
|
|
12
|
-
*/
|
|
13
|
-
type JsonSchemaBasicType = 'boolean' | 'string' | 'integer' | 'number' | 'object' | 'array' | 'map';
|
|
14
|
-
interface IJsonSchema<T = string> {
|
|
15
|
-
type?: T;
|
|
16
|
-
default?: any;
|
|
17
|
-
title?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
enum?: (string | number)[];
|
|
20
|
-
properties?: Record<string, IJsonSchema<T>>;
|
|
21
|
-
additionalProperties?: IJsonSchema<T>;
|
|
22
|
-
items?: IJsonSchema<T>;
|
|
23
|
-
required?: string[];
|
|
24
|
-
$ref?: string;
|
|
25
|
-
extra?: {
|
|
26
|
-
index?: number;
|
|
27
|
-
weak?: boolean;
|
|
28
|
-
formComponent?: string;
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
type IBasicJsonSchema = IJsonSchema<JsonSchemaBasicType>;
|
|
10
|
+
import * as _flowgram_ai_core from '@flowgram.ai/core';
|
|
33
11
|
|
|
34
12
|
/**
|
|
35
13
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -39,6 +17,7 @@ type IBasicJsonSchema = IJsonSchema<JsonSchemaBasicType>;
|
|
|
39
17
|
type VariableField = BaseVariableField<{
|
|
40
18
|
icon?: string | JSX.Element;
|
|
41
19
|
title?: string;
|
|
20
|
+
disabled?: boolean;
|
|
42
21
|
}>;
|
|
43
22
|
declare function useVariableTree(params: {
|
|
44
23
|
includeSchema?: IJsonSchema | IJsonSchema[];
|
|
@@ -69,51 +48,6 @@ type VariableSelectorProps = PropTypes$2;
|
|
|
69
48
|
|
|
70
49
|
declare const VariableSelector: ({ value, config, onChange, style, readonly, includeSchema, excludeSchema, hasError, triggerRender, }: PropTypes$2) => React$1.JSX.Element;
|
|
71
50
|
|
|
72
|
-
/**
|
|
73
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
74
|
-
* SPDX-License-Identifier: MIT
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
interface IFlowValueExtra {
|
|
78
|
-
index?: number;
|
|
79
|
-
}
|
|
80
|
-
interface IFlowConstantValue {
|
|
81
|
-
type: 'constant';
|
|
82
|
-
content?: string | number | boolean;
|
|
83
|
-
schema?: IJsonSchema;
|
|
84
|
-
extra?: IFlowValueExtra;
|
|
85
|
-
}
|
|
86
|
-
interface IFlowRefValue {
|
|
87
|
-
type: 'ref';
|
|
88
|
-
content?: string[];
|
|
89
|
-
extra?: IFlowValueExtra;
|
|
90
|
-
}
|
|
91
|
-
interface IFlowExpressionValue {
|
|
92
|
-
type: 'expression';
|
|
93
|
-
content?: string;
|
|
94
|
-
extra?: IFlowValueExtra;
|
|
95
|
-
}
|
|
96
|
-
interface IFlowTemplateValue {
|
|
97
|
-
type: 'template';
|
|
98
|
-
content?: string;
|
|
99
|
-
extra?: IFlowValueExtra;
|
|
100
|
-
}
|
|
101
|
-
type IFlowValue = IFlowConstantValue | IFlowRefValue | IFlowExpressionValue | IFlowTemplateValue;
|
|
102
|
-
type IFlowConstantRefValue = IFlowConstantValue | IFlowRefValue;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
106
|
-
* SPDX-License-Identifier: MIT
|
|
107
|
-
*/
|
|
108
|
-
|
|
109
|
-
declare const VariableTypeIcons: {
|
|
110
|
-
[key: string]: React$1.ReactNode;
|
|
111
|
-
};
|
|
112
|
-
declare const ArrayIcons: {
|
|
113
|
-
[key: string]: React$1.ReactNode;
|
|
114
|
-
};
|
|
115
|
-
declare const getSchemaIcon: (value?: Partial<IJsonSchema>) => React$1.ReactNode;
|
|
116
|
-
|
|
117
51
|
/**
|
|
118
52
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
119
53
|
* SPDX-License-Identifier: MIT
|
|
@@ -172,20 +106,130 @@ declare function BatchVariableSelector(props: VariableSelectorProps): React$1.JS
|
|
|
172
106
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
173
107
|
* SPDX-License-Identifier: MIT
|
|
174
108
|
*/
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
Renderer: React.FC<RendererProps<Value>>;
|
|
109
|
+
interface LegacyFlowRefValueSchema {
|
|
110
|
+
type: 'ref';
|
|
111
|
+
content: string;
|
|
179
112
|
}
|
|
180
|
-
interface
|
|
113
|
+
interface NewFlowRefValueSchema {
|
|
114
|
+
type: 'ref';
|
|
115
|
+
content: string[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* In flowgram 0.2.0, for introducing Loop variable functionality,
|
|
119
|
+
* the FlowRefValueSchema type definition is updated:
|
|
120
|
+
*
|
|
121
|
+
* interface LegacyFlowRefValueSchema {
|
|
122
|
+
* type: 'ref';
|
|
123
|
+
* content: string;
|
|
124
|
+
* }
|
|
125
|
+
*
|
|
126
|
+
* interface NewFlowRefValueSchema {
|
|
127
|
+
* type: 'ref';
|
|
128
|
+
* content: string[];
|
|
129
|
+
* }
|
|
130
|
+
*
|
|
131
|
+
*
|
|
132
|
+
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
133
|
+
*
|
|
134
|
+
* How to use:
|
|
135
|
+
*
|
|
136
|
+
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
137
|
+
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
138
|
+
*
|
|
139
|
+
* Example:
|
|
140
|
+
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
141
|
+
* formMeta: {
|
|
142
|
+
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
143
|
+
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
144
|
+
* }
|
|
145
|
+
*/
|
|
146
|
+
declare function formatLegacyRefOnSubmit(value: any): any;
|
|
147
|
+
/**
|
|
148
|
+
* In flowgram 0.2.0, for introducing Loop variable functionality,
|
|
149
|
+
* the FlowRefValueSchema type definition is updated:
|
|
150
|
+
*
|
|
151
|
+
* interface LegacyFlowRefValueSchema {
|
|
152
|
+
* type: 'ref';
|
|
153
|
+
* content: string;
|
|
154
|
+
* }
|
|
155
|
+
*
|
|
156
|
+
* interface NewFlowRefValueSchema {
|
|
157
|
+
* type: 'ref';
|
|
158
|
+
* content: string[];
|
|
159
|
+
* }
|
|
160
|
+
*
|
|
161
|
+
*
|
|
162
|
+
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
163
|
+
*
|
|
164
|
+
* How to use:
|
|
165
|
+
*
|
|
166
|
+
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
167
|
+
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
168
|
+
*
|
|
169
|
+
* Example:
|
|
170
|
+
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
171
|
+
*
|
|
172
|
+
* formMeta: {
|
|
173
|
+
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
174
|
+
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
175
|
+
* }
|
|
176
|
+
*/
|
|
177
|
+
declare function formatLegacyRefOnInit(value: any): any;
|
|
178
|
+
declare function isLegacyFlowRefValueSchema(value: any): value is LegacyFlowRefValueSchema;
|
|
179
|
+
declare function isNewFlowRefValueSchema(value: any): value is NewFlowRefValueSchema;
|
|
180
|
+
declare function formatLegacyRefToNewRef(value: LegacyFlowRefValueSchema): {
|
|
181
|
+
type: string;
|
|
182
|
+
content: string[];
|
|
183
|
+
};
|
|
184
|
+
declare function formatNewRefToLegacyRef(value: NewFlowRefValueSchema): {
|
|
185
|
+
type: string;
|
|
186
|
+
content: string;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
191
|
+
* SPDX-License-Identifier: MIT
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
interface ConstantRendererProps<Value = any> {
|
|
181
195
|
value?: Value;
|
|
182
196
|
onChange?: (value: Value) => void;
|
|
183
197
|
readonly?: boolean;
|
|
184
198
|
}
|
|
185
|
-
interface
|
|
199
|
+
interface JsonSchemaTypeRegistry<Value = any> extends JsonSchemaTypeRegistry$1 {
|
|
200
|
+
/**
|
|
201
|
+
* Render Constant Input
|
|
202
|
+
*/
|
|
203
|
+
ConstantRenderer: React.FC<ConstantRendererProps<Value>>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
declare const createTypePresetPlugin: _flowgram_ai_core.PluginCreator<{
|
|
207
|
+
types: JsonSchemaTypeRegistry[];
|
|
208
|
+
}>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
212
|
+
* SPDX-License-Identifier: MIT
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
declare const useTypeManager: () => JsonSchemaTypeManager<IJsonSchema, JsonSchemaTypeRegistry>;
|
|
216
|
+
declare const JsonSchemaTypePresetProvider: ({ types, children, }: React$1.PropsWithChildren<{
|
|
217
|
+
types: JsonSchemaTypeRegistry[];
|
|
218
|
+
}>) => React$1.JSX.Element;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
222
|
+
* SPDX-License-Identifier: MIT
|
|
223
|
+
*/
|
|
224
|
+
|
|
225
|
+
interface Strategy<Value = any> {
|
|
226
|
+
hit: (schema: IJsonSchema) => boolean;
|
|
227
|
+
Renderer: React.FC<ConstantRendererProps<Value>>;
|
|
228
|
+
}
|
|
229
|
+
interface PropsType$a extends ConstantRendererProps {
|
|
186
230
|
schema: IJsonSchema;
|
|
187
231
|
strategies?: Strategy[];
|
|
188
|
-
fallbackRenderer?: React.FC<
|
|
232
|
+
fallbackRenderer?: React.FC<ConstantRendererProps>;
|
|
189
233
|
[key: string]: any;
|
|
190
234
|
}
|
|
191
235
|
|
|
@@ -194,14 +238,46 @@ interface PropsType$5 extends RendererProps {
|
|
|
194
238
|
* SPDX-License-Identifier: MIT
|
|
195
239
|
*/
|
|
196
240
|
|
|
197
|
-
declare function ConstantInput(props: PropsType$
|
|
241
|
+
declare function ConstantInput(props: PropsType$a): React$1.JSX.Element;
|
|
198
242
|
|
|
199
243
|
/**
|
|
200
244
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
201
245
|
* SPDX-License-Identifier: MIT
|
|
202
246
|
*/
|
|
203
247
|
|
|
204
|
-
interface
|
|
248
|
+
interface IFlowValueExtra {
|
|
249
|
+
index?: number;
|
|
250
|
+
}
|
|
251
|
+
interface IFlowConstantValue {
|
|
252
|
+
type: 'constant';
|
|
253
|
+
content?: string | number | boolean;
|
|
254
|
+
schema?: IJsonSchema;
|
|
255
|
+
extra?: IFlowValueExtra;
|
|
256
|
+
}
|
|
257
|
+
interface IFlowRefValue {
|
|
258
|
+
type: 'ref';
|
|
259
|
+
content?: string[];
|
|
260
|
+
extra?: IFlowValueExtra;
|
|
261
|
+
}
|
|
262
|
+
interface IFlowExpressionValue {
|
|
263
|
+
type: 'expression';
|
|
264
|
+
content?: string;
|
|
265
|
+
extra?: IFlowValueExtra;
|
|
266
|
+
}
|
|
267
|
+
interface IFlowTemplateValue {
|
|
268
|
+
type: 'template';
|
|
269
|
+
content?: string;
|
|
270
|
+
extra?: IFlowValueExtra;
|
|
271
|
+
}
|
|
272
|
+
type IFlowValue = IFlowConstantValue | IFlowRefValue | IFlowExpressionValue | IFlowTemplateValue;
|
|
273
|
+
type IFlowConstantRefValue = IFlowConstantValue | IFlowRefValue;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
277
|
+
* SPDX-License-Identifier: MIT
|
|
278
|
+
*/
|
|
279
|
+
|
|
280
|
+
interface PropsType$9 {
|
|
205
281
|
value?: IFlowConstantRefValue;
|
|
206
282
|
onChange: (value?: IFlowConstantRefValue) => void;
|
|
207
283
|
readonly?: boolean;
|
|
@@ -214,7 +290,7 @@ interface PropsType$4 {
|
|
|
214
290
|
[key: string]: any;
|
|
215
291
|
};
|
|
216
292
|
}
|
|
217
|
-
declare function DynamicValueInput({ value, onChange, readonly, style, schema: schemaFromProps, constantProps, }: PropsType$
|
|
293
|
+
declare function DynamicValueInput({ value, onChange, readonly, style, schema: schemaFromProps, constantProps, }: PropsType$9): React$1.JSX.Element;
|
|
218
294
|
|
|
219
295
|
/**
|
|
220
296
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -262,7 +338,7 @@ declare function ConditionRow({ style, value, onChange, readonly }: PropTypes):
|
|
|
262
338
|
*/
|
|
263
339
|
|
|
264
340
|
type ValueType = Record<string, IFlowRefValue | undefined>;
|
|
265
|
-
interface PropsType$
|
|
341
|
+
interface PropsType$8 {
|
|
266
342
|
value?: ValueType;
|
|
267
343
|
onChange: (value?: ValueType) => void;
|
|
268
344
|
readonly?: boolean;
|
|
@@ -275,14 +351,14 @@ interface PropsType$3 {
|
|
|
275
351
|
* SPDX-License-Identifier: MIT
|
|
276
352
|
*/
|
|
277
353
|
|
|
278
|
-
declare function BatchOutputs(props: PropsType$
|
|
354
|
+
declare function BatchOutputs(props: PropsType$8): React$1.JSX.Element;
|
|
279
355
|
|
|
280
356
|
/**
|
|
281
357
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
282
358
|
* SPDX-License-Identifier: MIT
|
|
283
359
|
*/
|
|
284
360
|
|
|
285
|
-
type PropsType$
|
|
361
|
+
type PropsType$7 = React$1.PropsWithChildren<{
|
|
286
362
|
value?: IFlowTemplateValue;
|
|
287
363
|
onChange: (value?: IFlowTemplateValue) => void;
|
|
288
364
|
readonly?: boolean;
|
|
@@ -298,8 +374,8 @@ type PropsType$2 = React$1.PropsWithChildren<{
|
|
|
298
374
|
* SPDX-License-Identifier: MIT
|
|
299
375
|
*/
|
|
300
376
|
|
|
301
|
-
type PromptEditorPropsType = PropsType$
|
|
302
|
-
declare function PromptEditor(props: PropsType$
|
|
377
|
+
type PromptEditorPropsType = PropsType$7;
|
|
378
|
+
declare function PromptEditor(props: PropsType$7): React$1.JSX.Element;
|
|
303
379
|
|
|
304
380
|
/**
|
|
305
381
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -313,10 +389,10 @@ declare function PromptEditorWithVariables(props: PromptEditorPropsType): React$
|
|
|
313
389
|
* SPDX-License-Identifier: MIT
|
|
314
390
|
*/
|
|
315
391
|
|
|
316
|
-
interface PropsType$
|
|
392
|
+
interface PropsType$6 extends PromptEditorPropsType {
|
|
317
393
|
inputsValues: Record<string, IFlowValue>;
|
|
318
394
|
}
|
|
319
|
-
declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType$
|
|
395
|
+
declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType$6): React$1.JSX.Element;
|
|
320
396
|
|
|
321
397
|
/**
|
|
322
398
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -337,6 +413,13 @@ interface CodeEditorPropsType extends React$1.PropsWithChildren<{}> {
|
|
|
337
413
|
}
|
|
338
414
|
declare function CodeEditor({ value, onChange, languageId, theme, children, placeholder, activeLinePlaceholder, options, readonly, }: CodeEditorPropsType): React$1.JSX.Element;
|
|
339
415
|
|
|
416
|
+
/**
|
|
417
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
418
|
+
* SPDX-License-Identifier: MIT
|
|
419
|
+
*/
|
|
420
|
+
|
|
421
|
+
declare function CodeEditorMini(props: CodeEditorPropsType): React$1.JSX.Element;
|
|
422
|
+
|
|
340
423
|
/**
|
|
341
424
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
342
425
|
* SPDX-License-Identifier: MIT
|
|
@@ -349,7 +432,7 @@ declare function JsonEditorWithVariables(props: Omit<CodeEditorPropsType, 'langu
|
|
|
349
432
|
* SPDX-License-Identifier: MIT
|
|
350
433
|
*/
|
|
351
434
|
|
|
352
|
-
interface PropsType {
|
|
435
|
+
interface PropsType$5 {
|
|
353
436
|
value?: Record<string, IFlowValue | undefined>;
|
|
354
437
|
onChange: (value?: Record<string, IFlowValue | undefined>) => void;
|
|
355
438
|
readonly?: boolean;
|
|
@@ -367,164 +450,111 @@ interface PropsType {
|
|
|
367
450
|
* SPDX-License-Identifier: MIT
|
|
368
451
|
*/
|
|
369
452
|
|
|
370
|
-
declare function InputsValues({ value, onChange, style, readonly, constantProps, schema, hasError, }: PropsType): React$1.JSX.Element;
|
|
453
|
+
declare function InputsValues({ value, onChange, style, readonly, constantProps, schema, hasError, }: PropsType$5): React$1.JSX.Element;
|
|
371
454
|
|
|
372
455
|
/**
|
|
373
456
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
374
457
|
* SPDX-License-Identifier: MIT
|
|
375
458
|
*/
|
|
376
459
|
|
|
377
|
-
|
|
460
|
+
interface PropsType$4 {
|
|
461
|
+
value?: IJsonSchema;
|
|
462
|
+
parentKey?: string;
|
|
463
|
+
depth?: number;
|
|
464
|
+
drilldown?: boolean;
|
|
465
|
+
showIcon?: boolean;
|
|
466
|
+
typeManager?: JsonSchemaTypeManager;
|
|
467
|
+
}
|
|
468
|
+
declare function DisplaySchemaTree(props: Omit<PropsType$4, 'parentKey' | 'depth'>): React$1.JSX.Element;
|
|
378
469
|
|
|
379
470
|
/**
|
|
380
471
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
381
472
|
* SPDX-License-Identifier: MIT
|
|
382
473
|
*/
|
|
383
474
|
|
|
475
|
+
interface PropsType$3 {
|
|
476
|
+
value?: IJsonSchema;
|
|
477
|
+
showIconInTree?: boolean;
|
|
478
|
+
displayFromScope?: boolean;
|
|
479
|
+
typeManager?: JsonSchemaTypeManager;
|
|
480
|
+
}
|
|
481
|
+
declare function DisplayOutputs({ value, showIconInTree, displayFromScope }: PropsType$3): React$1.JSX.Element;
|
|
482
|
+
|
|
384
483
|
/**
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
* Example:
|
|
388
|
-
*
|
|
389
|
-
* formMeta: {
|
|
390
|
-
* effects: {
|
|
391
|
-
* "inputsValues": autoRenameRefEffect,
|
|
392
|
-
* }
|
|
393
|
-
* }
|
|
484
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
485
|
+
* SPDX-License-Identifier: MIT
|
|
394
486
|
*/
|
|
395
|
-
|
|
487
|
+
|
|
488
|
+
interface PropsType$2 {
|
|
489
|
+
title?: JSX.Element | string;
|
|
490
|
+
value?: IJsonSchema;
|
|
491
|
+
showIconInTree?: boolean;
|
|
492
|
+
warning?: boolean;
|
|
493
|
+
}
|
|
494
|
+
declare function DisplaySchemaTag({ value, showIconInTree, title, warning }: PropsType$2): React$1.JSX.Element;
|
|
396
495
|
|
|
397
496
|
/**
|
|
398
497
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
399
498
|
* SPDX-License-Identifier: MIT
|
|
400
499
|
*/
|
|
401
500
|
|
|
402
|
-
|
|
501
|
+
interface PropsType$1 {
|
|
502
|
+
value?: IFlowValue;
|
|
503
|
+
title?: JSX.Element | string;
|
|
504
|
+
showIconInTree?: boolean;
|
|
505
|
+
typeManager?: JsonSchemaTypeManager;
|
|
506
|
+
}
|
|
507
|
+
declare function DisplayFlowValue({ value, title, showIconInTree }: PropsType$1): React$1.JSX.Element;
|
|
403
508
|
|
|
404
509
|
/**
|
|
405
510
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
406
511
|
* SPDX-License-Identifier: MIT
|
|
407
512
|
*/
|
|
408
513
|
|
|
409
|
-
|
|
514
|
+
interface PropsType {
|
|
515
|
+
value?: Record<string, IFlowValue | undefined>;
|
|
516
|
+
showIconInTree?: boolean;
|
|
517
|
+
}
|
|
518
|
+
declare function DisplayInputsValues({ value, showIconInTree }: PropsType): React$1.JSX.Element;
|
|
410
519
|
|
|
411
520
|
/**
|
|
412
521
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
413
522
|
* SPDX-License-Identifier: MIT
|
|
414
523
|
*/
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
interface NewFlowRefValueSchema {
|
|
420
|
-
type: 'ref';
|
|
421
|
-
content: string[];
|
|
422
|
-
}
|
|
524
|
+
|
|
525
|
+
declare const provideBatchInputEffect: EffectOptions[];
|
|
526
|
+
|
|
423
527
|
/**
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
* interface LegacyFlowRefValueSchema {
|
|
428
|
-
* type: 'ref';
|
|
429
|
-
* content: string;
|
|
430
|
-
* }
|
|
431
|
-
*
|
|
432
|
-
* interface NewFlowRefValueSchema {
|
|
433
|
-
* type: 'ref';
|
|
434
|
-
* content: string[];
|
|
435
|
-
* }
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
439
|
-
*
|
|
440
|
-
* How to use:
|
|
441
|
-
*
|
|
442
|
-
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
443
|
-
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
444
|
-
*
|
|
445
|
-
* Example:
|
|
446
|
-
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
447
|
-
* formMeta: {
|
|
448
|
-
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
449
|
-
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
450
|
-
* }
|
|
528
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
529
|
+
* SPDX-License-Identifier: MIT
|
|
451
530
|
*/
|
|
452
|
-
|
|
531
|
+
|
|
453
532
|
/**
|
|
454
|
-
*
|
|
455
|
-
* the FlowRefValueSchema type definition is updated:
|
|
456
|
-
*
|
|
457
|
-
* interface LegacyFlowRefValueSchema {
|
|
458
|
-
* type: 'ref';
|
|
459
|
-
* content: string;
|
|
460
|
-
* }
|
|
461
|
-
*
|
|
462
|
-
* interface NewFlowRefValueSchema {
|
|
463
|
-
* type: 'ref';
|
|
464
|
-
* content: string[];
|
|
465
|
-
* }
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
469
|
-
*
|
|
470
|
-
* How to use:
|
|
471
|
-
*
|
|
472
|
-
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
473
|
-
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
533
|
+
* Auto rename ref when form item's key is renamed
|
|
474
534
|
*
|
|
475
535
|
* Example:
|
|
476
|
-
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
477
536
|
*
|
|
478
537
|
* formMeta: {
|
|
479
|
-
*
|
|
480
|
-
*
|
|
538
|
+
* effects: {
|
|
539
|
+
* "inputsValues": autoRenameRefEffect,
|
|
540
|
+
* }
|
|
481
541
|
* }
|
|
482
542
|
*/
|
|
483
|
-
declare
|
|
484
|
-
declare function isLegacyFlowRefValueSchema(value: any): value is LegacyFlowRefValueSchema;
|
|
485
|
-
declare function isNewFlowRefValueSchema(value: any): value is NewFlowRefValueSchema;
|
|
486
|
-
declare function formatLegacyRefToNewRef(value: LegacyFlowRefValueSchema): {
|
|
487
|
-
type: string;
|
|
488
|
-
content: string[];
|
|
489
|
-
};
|
|
490
|
-
declare function formatNewRefToLegacyRef(value: NewFlowRefValueSchema): {
|
|
491
|
-
type: string;
|
|
492
|
-
content: string;
|
|
493
|
-
};
|
|
543
|
+
declare const autoRenameRefEffect: EffectOptions[];
|
|
494
544
|
|
|
495
545
|
/**
|
|
496
546
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
497
547
|
* SPDX-License-Identifier: MIT
|
|
498
548
|
*/
|
|
499
549
|
|
|
500
|
-
declare
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
* @param jsonSchema - The JSON schema to convert.
|
|
509
|
-
* @returns An AST node representing the JSON schema, or undefined if the schema type is not recognized.
|
|
510
|
-
*/
|
|
511
|
-
function schemaToAST(jsonSchema: IJsonSchema): ASTNodeJSON | undefined;
|
|
512
|
-
/**
|
|
513
|
-
* Convert AST To JSON Schema
|
|
514
|
-
* @param typeAST
|
|
515
|
-
* @returns
|
|
516
|
-
*/
|
|
517
|
-
function astToSchema(typeAST: ASTNode, options?: {
|
|
518
|
-
drilldown?: boolean;
|
|
519
|
-
}): IJsonSchema | undefined;
|
|
520
|
-
/**
|
|
521
|
-
* Check if the AST type is match the JSON Schema
|
|
522
|
-
* @param typeAST
|
|
523
|
-
* @param schema
|
|
524
|
-
* @returns
|
|
525
|
-
*/
|
|
526
|
-
function isASTMatchSchema(typeAST: BaseType, schema: IJsonSchema | IJsonSchema[]): boolean;
|
|
527
|
-
}
|
|
550
|
+
declare const provideJsonSchemaOutputs: EffectOptions[];
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
554
|
+
* SPDX-License-Identifier: MIT
|
|
555
|
+
*/
|
|
556
|
+
|
|
557
|
+
declare const syncVariableTitle: EffectOptions[];
|
|
528
558
|
|
|
529
559
|
/**
|
|
530
560
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -550,4 +580,4 @@ interface InputConfig {
|
|
|
550
580
|
}
|
|
551
581
|
declare const createInferInputsPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig>;
|
|
552
582
|
|
|
553
|
-
export {
|
|
583
|
+
export { BatchOutputs, BatchVariableSelector, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type ConstantRendererProps, DisplayFlowValue, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, InputsValues, JsonEditorWithVariables, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createInferInputsPlugin, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useTypeManager, useVariableTree };
|