@flowgram.ai/form-materials 0.1.0-alpha.10 → 0.1.0-alpha.12

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.
Files changed (126) hide show
  1. package/bin/index.ts +11 -5
  2. package/bin/materials.ts +10 -1
  3. package/dist/esm/index.js +1996 -1361
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/index.d.mts +328 -114
  6. package/dist/index.d.ts +328 -114
  7. package/dist/index.js +2096 -1472
  8. package/dist/index.js.map +1 -1
  9. package/package.json +7 -5
  10. package/src/components/assign-row/components/blur-input.tsx +27 -0
  11. package/src/components/assign-row/config.json +11 -0
  12. package/src/components/assign-row/index.tsx +84 -0
  13. package/src/components/assign-row/types.ts +25 -0
  14. package/src/components/assign-rows/config.json +11 -0
  15. package/src/components/assign-rows/index.tsx +59 -0
  16. package/src/components/batch-outputs/config.json +2 -1
  17. package/src/components/batch-outputs/index.tsx +4 -12
  18. package/src/components/batch-variable-selector/config.json +6 -2
  19. package/src/components/batch-variable-selector/index.tsx +1 -1
  20. package/src/components/code-editor/config.json +2 -1
  21. package/src/components/code-editor/index.tsx +23 -1
  22. package/src/components/code-editor/language-features.ts +23 -3
  23. package/src/components/code-editor/theme/light.ts +2 -2
  24. package/src/components/code-editor-mini/config.json +7 -0
  25. package/src/components/code-editor-mini/index.tsx +31 -0
  26. package/src/components/condition-row/config.json +10 -2
  27. package/src/components/condition-row/constants.ts +6 -8
  28. package/src/components/condition-row/hooks/useOp.tsx +3 -1
  29. package/src/components/condition-row/hooks/useRule.ts +2 -2
  30. package/src/components/condition-row/index.tsx +2 -1
  31. package/src/components/condition-row/types.ts +3 -1
  32. package/src/components/constant-input/config.json +6 -3
  33. package/src/components/constant-input/index.tsx +18 -62
  34. package/src/components/constant-input/types.ts +6 -9
  35. package/src/components/display-flow-value/config.json +8 -0
  36. package/src/components/display-flow-value/index.tsx +59 -0
  37. package/src/components/display-inputs-values/config.json +9 -0
  38. package/src/components/display-inputs-values/index.tsx +27 -0
  39. package/src/components/display-inputs-values/styles.ts +12 -0
  40. package/src/components/display-outputs/config.json +10 -0
  41. package/src/components/display-outputs/index.tsx +64 -0
  42. package/src/components/display-outputs/styles.ts +12 -0
  43. package/src/components/display-schema-tag/config.json +10 -0
  44. package/src/components/display-schema-tag/index.tsx +44 -0
  45. package/src/components/display-schema-tag/styles.ts +28 -0
  46. package/src/components/display-schema-tree/config.json +11 -0
  47. package/src/components/display-schema-tree/index.tsx +74 -0
  48. package/src/components/display-schema-tree/styles.tsx +90 -0
  49. package/src/components/dynamic-value-input/config.json +11 -2
  50. package/src/components/dynamic-value-input/hooks.ts +53 -0
  51. package/src/components/dynamic-value-input/index.tsx +64 -13
  52. package/src/components/dynamic-value-input/styles.tsx +28 -2
  53. package/src/components/index.ts +9 -0
  54. package/src/components/inputs-values/components/blur-input.tsx +27 -0
  55. package/src/components/inputs-values/config.json +13 -0
  56. package/src/components/inputs-values/index.tsx +73 -0
  57. package/src/components/inputs-values/styles.tsx +19 -0
  58. package/src/components/inputs-values/types.ts +22 -0
  59. package/src/components/json-editor-with-variables/index.tsx +47 -1
  60. package/src/components/json-schema-editor/config.json +2 -2
  61. package/src/components/json-schema-editor/default-value.tsx +1 -1
  62. package/src/components/json-schema-editor/hooks.tsx +4 -2
  63. package/src/components/json-schema-editor/index.tsx +15 -2
  64. package/src/components/json-schema-editor/types.ts +1 -1
  65. package/src/components/prompt-editor/index.tsx +2 -1
  66. package/src/components/prompt-editor/types.tsx +1 -0
  67. package/src/components/prompt-editor-with-inputs/inputs-picker.tsx +1 -1
  68. package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +6 -3
  69. package/src/components/type-selector/config.json +6 -2
  70. package/src/components/type-selector/index.tsx +55 -12
  71. package/src/components/variable-selector/config.json +6 -2
  72. package/src/components/variable-selector/index.tsx +34 -13
  73. package/src/components/variable-selector/styles.tsx +18 -8
  74. package/src/components/variable-selector/use-variable-tree.tsx +19 -22
  75. package/src/effects/auto-rename-ref/index.ts +59 -8
  76. package/src/effects/index.ts +3 -1
  77. package/src/effects/listen-ref-schema-change/config.json +10 -0
  78. package/src/effects/listen-ref-schema-change/index.ts +56 -0
  79. package/src/effects/listen-ref-value-change/config.json +9 -0
  80. package/src/effects/listen-ref-value-change/index.ts +53 -0
  81. package/src/effects/provide-json-schema-outputs/config.json +4 -5
  82. package/src/effects/provide-json-schema-outputs/index.ts +1 -3
  83. package/src/effects/sync-variable-title/index.ts +1 -0
  84. package/src/effects/validate-when-variable-sync/config.json +5 -0
  85. package/src/effects/validate-when-variable-sync/index.ts +35 -0
  86. package/src/form-plugins/index.ts +3 -1
  87. package/src/form-plugins/infer-assign-plugin/config.json +7 -0
  88. package/src/form-plugins/infer-assign-plugin/index.ts +90 -0
  89. package/src/form-plugins/infer-inputs-plugin/config.json +9 -0
  90. package/src/form-plugins/infer-inputs-plugin/index.ts +108 -0
  91. package/src/hooks/index.tsx +6 -0
  92. package/src/hooks/use-object-list/config.json +8 -0
  93. package/src/hooks/use-object-list/index.tsx +136 -0
  94. package/src/index.ts +3 -1
  95. package/src/{typings/json-schema → plugins/disable-declaration-plugin}/config.json +1 -1
  96. package/src/plugins/disable-declaration-plugin/create-disable-declaration-plugin.ts +31 -0
  97. package/src/plugins/disable-declaration-plugin/index.tsx +6 -0
  98. package/src/plugins/index.ts +7 -0
  99. package/src/plugins/json-schema-preset/config.json +9 -0
  100. package/src/plugins/json-schema-preset/create-type-preset-plugin.tsx +28 -0
  101. package/src/plugins/json-schema-preset/index.tsx +41 -0
  102. package/src/plugins/json-schema-preset/manager.ts +18 -0
  103. package/src/plugins/json-schema-preset/type-definition/array.tsx +24 -0
  104. package/src/plugins/json-schema-preset/type-definition/boolean.tsx +32 -0
  105. package/src/plugins/json-schema-preset/type-definition/index.tsx +24 -0
  106. package/src/plugins/json-schema-preset/type-definition/integer.tsx +24 -0
  107. package/src/plugins/json-schema-preset/type-definition/number.tsx +24 -0
  108. package/src/plugins/json-schema-preset/type-definition/object.tsx +24 -0
  109. package/src/plugins/json-schema-preset/type-definition/string.tsx +18 -0
  110. package/src/{utils → shared}/index.ts +0 -1
  111. package/src/typings/flow-value/config.json +3 -1
  112. package/src/typings/flow-value/index.ts +11 -0
  113. package/src/typings/index.ts +0 -1
  114. package/src/validate/index.tsx +6 -0
  115. package/src/validate/validate-flow-value/config.json +7 -0
  116. package/src/validate/validate-flow-value/index.tsx +73 -0
  117. package/src/components/batch-outputs/use-list.ts +0 -86
  118. package/src/components/type-selector/constants.tsx +0 -364
  119. package/src/effects/provide-batch-outputs/config.json +0 -5
  120. package/src/effects/provide-batch-outputs/index.ts +0 -38
  121. package/src/typings/json-schema/index.ts +0 -36
  122. package/src/utils/json-schema/config.json +0 -5
  123. package/src/utils/json-schema/index.ts +0 -180
  124. /package/src/{utils → shared}/format-legacy-refs/config.json +0 -0
  125. /package/src/{utils → shared}/format-legacy-refs/index.ts +0 -0
  126. /package/src/{utils → shared}/format-legacy-refs/readme.md +0 -0
package/dist/index.d.ts CHANGED
@@ -1,41 +1,28 @@
1
1
  import React$1 from 'react';
2
+ import { IJsonSchema, JsonSchemaTypeRegistry as JsonSchemaTypeRegistry$1, JsonSchemaTypeManager } from '@flowgram.ai/json-schema';
3
+ export { IJsonSchema, JsonSchemaBasicType, JsonSchemaUtils } from '@flowgram.ai/json-schema';
2
4
  import { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
3
- import { EffectOptions, ASTNodeJSON, ASTNode, BaseType, FormPluginCreator } from '@flowgram.ai/editor';
5
+ import { InferValues } from '@coze-editor/editor/react';
6
+ import preset from '@coze-editor/editor/preset-code';
7
+ import { BaseVariableField, EffectOptions, EffectFuncProps, FormPluginCreator, FeedbackLevel, FlowNodeEntity } from '@flowgram.ai/editor';
8
+ import * as _flowgram_ai_node from '@flowgram.ai/node';
9
+ import * as _flowgram_ai_core from '@flowgram.ai/core';
4
10
  import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
5
11
 
6
- /**
7
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
8
- * SPDX-License-Identifier: MIT
9
- */
10
- type JsonSchemaBasicType = 'boolean' | 'string' | 'integer' | 'number' | 'object' | 'array' | 'map';
11
- interface IJsonSchema<T = string> {
12
- type?: T;
13
- default?: any;
14
- title?: string;
15
- description?: string;
16
- enum?: (string | number)[];
17
- properties?: Record<string, IJsonSchema<T>>;
18
- additionalProperties?: IJsonSchema<T>;
19
- items?: IJsonSchema<T>;
20
- required?: string[];
21
- $ref?: string;
22
- extra?: {
23
- index?: number;
24
- weak?: boolean;
25
- formComponent?: string;
26
- [key: string]: any;
27
- };
28
- }
29
- type IBasicJsonSchema = IJsonSchema<JsonSchemaBasicType>;
30
-
31
12
  /**
32
13
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
33
14
  * SPDX-License-Identifier: MIT
34
15
  */
35
16
 
17
+ type VariableField = BaseVariableField<{
18
+ icon?: string | JSX.Element;
19
+ title?: string;
20
+ disabled?: boolean;
21
+ }>;
36
22
  declare function useVariableTree(params: {
37
23
  includeSchema?: IJsonSchema | IJsonSchema[];
38
24
  excludeSchema?: IJsonSchema | IJsonSchema[];
25
+ customSkip?: (variable: VariableField) => boolean;
39
26
  }): TreeNodeData[];
40
27
 
41
28
  /**
@@ -61,42 +48,6 @@ type VariableSelectorProps = PropTypes$2;
61
48
 
62
49
  declare const VariableSelector: ({ value, config, onChange, style, readonly, includeSchema, excludeSchema, hasError, triggerRender, }: PropTypes$2) => React$1.JSX.Element;
63
50
 
64
- /**
65
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
66
- * SPDX-License-Identifier: MIT
67
- */
68
- interface IFlowConstantValue {
69
- type: 'constant';
70
- content?: string | number | boolean;
71
- }
72
- interface IFlowRefValue {
73
- type: 'ref';
74
- content?: string[];
75
- }
76
- interface IFlowExpressionValue {
77
- type: 'expression';
78
- content?: string;
79
- }
80
- interface IFlowTemplateValue {
81
- type: 'template';
82
- content?: string;
83
- }
84
- type IFlowValue = IFlowConstantValue | IFlowRefValue | IFlowExpressionValue | IFlowTemplateValue;
85
- type IFlowConstantRefValue = IFlowConstantValue | IFlowRefValue;
86
-
87
- /**
88
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
89
- * SPDX-License-Identifier: MIT
90
- */
91
-
92
- declare const VariableTypeIcons: {
93
- [key: string]: React$1.ReactNode;
94
- };
95
- declare const ArrayIcons: {
96
- [key: string]: React$1.ReactNode;
97
- };
98
- declare const getSchemaIcon: (value?: Partial<IJsonSchema>) => React$1.ReactNode;
99
-
100
51
  /**
101
52
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
102
53
  * SPDX-License-Identifier: MIT
@@ -104,7 +55,11 @@ declare const getSchemaIcon: (value?: Partial<IJsonSchema>) => React$1.ReactNode
104
55
 
105
56
  interface PropTypes$1 {
106
57
  value?: Partial<IJsonSchema>;
107
- onChange: (value?: Partial<IJsonSchema>) => void;
58
+ onChange?: (value?: Partial<IJsonSchema>) => void;
59
+ readonly?: boolean;
60
+ /**
61
+ * @deprecated use readonly instead
62
+ */
108
63
  disabled?: boolean;
109
64
  style?: React$1.CSSProperties;
110
65
  }
@@ -137,6 +92,7 @@ declare function JsonSchemaEditor(props: {
137
92
  onChange?: (value: IJsonSchema) => void;
138
93
  config?: ConfigType;
139
94
  className?: string;
95
+ readonly?: boolean;
140
96
  }): React$1.JSX.Element;
141
97
 
142
98
  /**
@@ -151,18 +107,52 @@ declare function BatchVariableSelector(props: VariableSelectorProps): React$1.JS
151
107
  * SPDX-License-Identifier: MIT
152
108
  */
153
109
 
154
- interface Strategy<Value = any> {
155
- hit: (schema: IJsonSchema) => boolean;
156
- Renderer: React.FC<RendererProps<Value>>;
157
- }
158
- interface RendererProps<Value = any> {
110
+ interface ConstantRendererProps<Value = any> {
159
111
  value?: Value;
160
112
  onChange?: (value: Value) => void;
161
113
  readonly?: boolean;
162
114
  }
163
- interface PropsType$4 extends RendererProps {
115
+ interface JsonSchemaTypeRegistry<Value = any> extends JsonSchemaTypeRegistry$1 {
116
+ /**
117
+ * Render Constant Input
118
+ */
119
+ ConstantRenderer: React.FC<ConstantRendererProps<Value>>;
120
+ }
121
+
122
+ declare const createTypePresetPlugin: _flowgram_ai_core.PluginCreator<{
123
+ types?: Partial<JsonSchemaTypeRegistry> & Pick<JsonSchemaTypeRegistry, "type">[];
124
+ unregisterTypes?: string[];
125
+ }>;
126
+
127
+ /**
128
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
129
+ * SPDX-License-Identifier: MIT
130
+ */
131
+
132
+ declare const useTypeManager: () => JsonSchemaTypeManager<IJsonSchema, JsonSchemaTypeRegistry>;
133
+ declare const JsonSchemaTypePresetProvider: ({ types, children, }: React$1.PropsWithChildren<{
134
+ types: JsonSchemaTypeRegistry[];
135
+ }>) => React$1.JSX.Element;
136
+
137
+ /**
138
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
139
+ * SPDX-License-Identifier: MIT
140
+ */
141
+ declare const createDisableDeclarationPlugin: _flowgram_ai_core.PluginCreator<void>;
142
+
143
+ /**
144
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
145
+ * SPDX-License-Identifier: MIT
146
+ */
147
+
148
+ interface Strategy<Value = any> {
149
+ hit: (schema: IJsonSchema) => boolean;
150
+ Renderer: React.FC<ConstantRendererProps<Value>>;
151
+ }
152
+ interface PropsType$a extends ConstantRendererProps {
164
153
  schema: IJsonSchema;
165
154
  strategies?: Strategy[];
155
+ fallbackRenderer?: React.FC<ConstantRendererProps>;
166
156
  [key: string]: any;
167
157
  }
168
158
 
@@ -171,14 +161,46 @@ interface PropsType$4 extends RendererProps {
171
161
  * SPDX-License-Identifier: MIT
172
162
  */
173
163
 
174
- declare function ConstantInput(props: PropsType$4): React$1.JSX.Element;
164
+ declare function ConstantInput(props: PropsType$a): React$1.JSX.Element;
175
165
 
176
166
  /**
177
167
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
178
168
  * SPDX-License-Identifier: MIT
179
169
  */
180
170
 
181
- interface PropsType$3 {
171
+ interface IFlowValueExtra {
172
+ index?: number;
173
+ }
174
+ interface IFlowConstantValue {
175
+ type: 'constant';
176
+ content?: string | number | boolean;
177
+ schema?: IJsonSchema;
178
+ extra?: IFlowValueExtra;
179
+ }
180
+ interface IFlowRefValue {
181
+ type: 'ref';
182
+ content?: string[];
183
+ extra?: IFlowValueExtra;
184
+ }
185
+ interface IFlowExpressionValue {
186
+ type: 'expression';
187
+ content?: string;
188
+ extra?: IFlowValueExtra;
189
+ }
190
+ interface IFlowTemplateValue {
191
+ type: 'template';
192
+ content?: string;
193
+ extra?: IFlowValueExtra;
194
+ }
195
+ type IFlowValue = IFlowConstantValue | IFlowRefValue | IFlowExpressionValue | IFlowTemplateValue;
196
+ type IFlowConstantRefValue = IFlowConstantValue | IFlowRefValue;
197
+
198
+ /**
199
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
200
+ * SPDX-License-Identifier: MIT
201
+ */
202
+
203
+ interface PropsType$9 {
182
204
  value?: IFlowConstantRefValue;
183
205
  onChange: (value?: IFlowConstantRefValue) => void;
184
206
  readonly?: boolean;
@@ -191,7 +213,7 @@ interface PropsType$3 {
191
213
  [key: string]: any;
192
214
  };
193
215
  }
194
- declare function DynamicValueInput({ value, onChange, readonly, style, schema, constantProps, }: PropsType$3): React$1.JSX.Element;
216
+ declare function DynamicValueInput({ value, onChange, readonly, style, schema: schemaFromProps, constantProps, }: PropsType$9): React$1.JSX.Element;
195
217
 
196
218
  /**
197
219
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -239,7 +261,7 @@ declare function ConditionRow({ style, value, onChange, readonly }: PropTypes):
239
261
  */
240
262
 
241
263
  type ValueType = Record<string, IFlowRefValue | undefined>;
242
- interface PropsType$2 {
264
+ interface PropsType$8 {
243
265
  value?: ValueType;
244
266
  onChange: (value?: ValueType) => void;
245
267
  readonly?: boolean;
@@ -252,20 +274,21 @@ interface PropsType$2 {
252
274
  * SPDX-License-Identifier: MIT
253
275
  */
254
276
 
255
- declare function BatchOutputs(props: PropsType$2): React$1.JSX.Element;
277
+ declare function BatchOutputs(props: PropsType$8): React$1.JSX.Element;
256
278
 
257
279
  /**
258
280
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
259
281
  * SPDX-License-Identifier: MIT
260
282
  */
261
283
 
262
- type PropsType$1 = React$1.PropsWithChildren<{
284
+ type PropsType$7 = React$1.PropsWithChildren<{
263
285
  value?: IFlowTemplateValue;
264
286
  onChange: (value?: IFlowTemplateValue) => void;
265
287
  readonly?: boolean;
266
288
  hasError?: boolean;
267
289
  placeholder?: string;
268
290
  activeLinePlaceholder?: string;
291
+ disableMarkdownHighlight?: boolean;
269
292
  style?: React$1.CSSProperties;
270
293
  }>;
271
294
 
@@ -274,8 +297,8 @@ type PropsType$1 = React$1.PropsWithChildren<{
274
297
  * SPDX-License-Identifier: MIT
275
298
  */
276
299
 
277
- type PromptEditorPropsType = PropsType$1;
278
- declare function PromptEditor(props: PropsType$1): React$1.JSX.Element;
300
+ type PromptEditorPropsType = PropsType$7;
301
+ declare function PromptEditor(props: PropsType$7): React$1.JSX.Element;
279
302
 
280
303
  /**
281
304
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -289,16 +312,18 @@ declare function PromptEditorWithVariables(props: PromptEditorPropsType): React$
289
312
  * SPDX-License-Identifier: MIT
290
313
  */
291
314
 
292
- interface PropsType extends PromptEditorPropsType {
315
+ interface PropsType$6 extends PromptEditorPropsType {
293
316
  inputsValues: Record<string, IFlowValue>;
294
317
  }
295
- declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType): React$1.JSX.Element;
318
+ declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType$6): React$1.JSX.Element;
296
319
 
297
320
  /**
298
321
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
299
322
  * SPDX-License-Identifier: MIT
300
323
  */
301
324
 
325
+ type Preset = typeof preset;
326
+ type Options = Partial<InferValues<Preset[number]>>;
302
327
  interface CodeEditorPropsType extends React$1.PropsWithChildren<{}> {
303
328
  value?: string;
304
329
  onChange?: (value: string) => void;
@@ -306,8 +331,17 @@ interface CodeEditorPropsType extends React$1.PropsWithChildren<{}> {
306
331
  theme?: 'dark' | 'light';
307
332
  placeholder?: string;
308
333
  activeLinePlaceholder?: string;
334
+ readonly?: boolean;
335
+ options?: Options;
309
336
  }
310
- declare function CodeEditor({ value, onChange, languageId, theme, children, placeholder, activeLinePlaceholder, }: CodeEditorPropsType): React$1.JSX.Element;
337
+ declare function CodeEditor({ value, onChange, languageId, theme, children, placeholder, activeLinePlaceholder, options, readonly, }: CodeEditorPropsType): React$1.JSX.Element;
338
+
339
+ /**
340
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
341
+ * SPDX-License-Identifier: MIT
342
+ */
343
+
344
+ declare function CodeEditorMini(props: CodeEditorPropsType): React$1.JSX.Element;
311
345
 
312
346
  /**
313
347
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -321,14 +355,136 @@ declare function JsonEditorWithVariables(props: Omit<CodeEditorPropsType, 'langu
321
355
  * SPDX-License-Identifier: MIT
322
356
  */
323
357
 
324
- declare const provideBatchInputEffect: EffectOptions[];
358
+ interface PropsType$5 {
359
+ value?: Record<string, IFlowValue | undefined>;
360
+ onChange: (value?: Record<string, IFlowValue | undefined>) => void;
361
+ readonly?: boolean;
362
+ hasError?: boolean;
363
+ schema?: IJsonSchema;
364
+ style?: React.CSSProperties;
365
+ constantProps?: {
366
+ strategies?: Strategy[];
367
+ [key: string]: any;
368
+ };
369
+ }
325
370
 
326
371
  /**
327
372
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
328
373
  * SPDX-License-Identifier: MIT
329
374
  */
330
375
 
331
- declare const provideBatchOutputsEffect: EffectOptions[];
376
+ declare function InputsValues({ value, onChange, style, readonly, constantProps, schema, hasError, }: PropsType$5): React$1.JSX.Element;
377
+
378
+ /**
379
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
380
+ * SPDX-License-Identifier: MIT
381
+ */
382
+
383
+ interface PropsType$4 {
384
+ value?: IJsonSchema;
385
+ parentKey?: string;
386
+ depth?: number;
387
+ drilldown?: boolean;
388
+ showIcon?: boolean;
389
+ typeManager?: JsonSchemaTypeManager;
390
+ }
391
+ declare function DisplaySchemaTree(props: Omit<PropsType$4, 'parentKey' | 'depth'>): React$1.JSX.Element;
392
+
393
+ /**
394
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
395
+ * SPDX-License-Identifier: MIT
396
+ */
397
+
398
+ interface PropsType$3 {
399
+ value?: IJsonSchema;
400
+ showIconInTree?: boolean;
401
+ displayFromScope?: boolean;
402
+ typeManager?: JsonSchemaTypeManager;
403
+ }
404
+ declare function DisplayOutputs({ value, showIconInTree, displayFromScope }: PropsType$3): React$1.JSX.Element;
405
+
406
+ /**
407
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
408
+ * SPDX-License-Identifier: MIT
409
+ */
410
+
411
+ interface PropsType$2 {
412
+ title?: JSX.Element | string;
413
+ value?: IJsonSchema;
414
+ showIconInTree?: boolean;
415
+ warning?: boolean;
416
+ }
417
+ declare function DisplaySchemaTag({ value, showIconInTree, title, warning }: PropsType$2): React$1.JSX.Element;
418
+
419
+ /**
420
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
421
+ * SPDX-License-Identifier: MIT
422
+ */
423
+
424
+ interface PropsType$1 {
425
+ value?: IFlowValue;
426
+ title?: JSX.Element | string;
427
+ showIconInTree?: boolean;
428
+ typeManager?: JsonSchemaTypeManager;
429
+ }
430
+ declare function DisplayFlowValue({ value, title, showIconInTree }: PropsType$1): React$1.JSX.Element;
431
+
432
+ /**
433
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
434
+ * SPDX-License-Identifier: MIT
435
+ */
436
+
437
+ interface PropsType {
438
+ value?: Record<string, IFlowValue | undefined>;
439
+ showIconInTree?: boolean;
440
+ }
441
+ declare function DisplayInputsValues({ value, showIconInTree }: PropsType): React$1.JSX.Element;
442
+
443
+ /**
444
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
445
+ * SPDX-License-Identifier: MIT
446
+ */
447
+
448
+ interface AssignRowsProps {
449
+ name: string;
450
+ readonly?: boolean;
451
+ }
452
+ declare function AssignRows(props: AssignRowsProps): React$1.JSX.Element;
453
+
454
+ /**
455
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
456
+ * SPDX-License-Identifier: MIT
457
+ */
458
+
459
+ type AssignValueType = {
460
+ operator: 'assign';
461
+ left?: IFlowRefValue;
462
+ right?: IFlowValue;
463
+ } | {
464
+ operator: 'declare';
465
+ left?: string;
466
+ right?: IFlowValue;
467
+ };
468
+ interface AssignRowProps {
469
+ value?: AssignValueType;
470
+ onChange?: (value?: AssignValueType) => void;
471
+ onDelete?: () => void;
472
+ readonly?: boolean;
473
+ }
474
+
475
+ /**
476
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
477
+ * SPDX-License-Identifier: MIT
478
+ */
479
+
480
+ declare function AssignRow(props: AssignRowProps): React$1.JSX.Element;
481
+
482
+ /**
483
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
484
+ * SPDX-License-Identifier: MIT
485
+ */
486
+
487
+ declare const provideBatchInputEffect: EffectOptions[];
332
488
 
333
489
  /**
334
490
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -362,6 +518,58 @@ declare const provideJsonSchemaOutputs: EffectOptions[];
362
518
 
363
519
  declare const syncVariableTitle: EffectOptions[];
364
520
 
521
+ /**
522
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
523
+ * SPDX-License-Identifier: MIT
524
+ */
525
+
526
+ declare const validateWhenVariableSync: ({ scope, }?: {
527
+ scope?: "private" | "public";
528
+ }) => EffectOptions[];
529
+
530
+ /**
531
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
532
+ * SPDX-License-Identifier: MIT
533
+ */
534
+
535
+ /**
536
+ * Example:
537
+ * const formMeta = {
538
+ * effect: {
539
+ * 'inputsValues.*': listenRefValueChange(({ name, variable, form }) => {
540
+ * const schema = JsonSchemaUtils.astToSchema(variable?.type);
541
+ * form.setValueIn(`${name}.schema`, schema);
542
+ * })
543
+ * }
544
+ * }
545
+ * @param cb
546
+ * @returns
547
+ */
548
+ declare const listenRefValueChange: (cb: (props: EffectFuncProps<IFlowRefValue> & {
549
+ variable?: BaseVariableField;
550
+ }) => void) => EffectOptions[];
551
+
552
+ /**
553
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
554
+ * SPDX-License-Identifier: MIT
555
+ */
556
+
557
+ /**
558
+ * Example:
559
+ * const formMeta = {
560
+ * effect: {
561
+ * 'inputsValues.*': listenRefSchemaChange(({ name, schema, form }) => {
562
+ * form.setValueIn(`${name}.schema`, schema);
563
+ * })
564
+ * }
565
+ * }
566
+ * @param cb
567
+ * @returns
568
+ */
569
+ declare const listenRefSchemaChange: (cb: (props: EffectFuncProps<IFlowRefValue> & {
570
+ schema?: IJsonSchema;
571
+ }) => void) => EffectOptions[];
572
+
365
573
  /**
366
574
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
367
575
  * SPDX-License-Identifier: MIT
@@ -451,45 +659,51 @@ declare function formatNewRefToLegacyRef(value: NewFlowRefValueSchema): {
451
659
  * SPDX-License-Identifier: MIT
452
660
  */
453
661
 
454
- declare namespace JsonSchemaUtils {
455
- /**
456
- * Converts a JSON schema to an Abstract Syntax Tree (AST) representation.
457
- * This function recursively processes the JSON schema and creates corresponding AST nodes.
458
- *
459
- * For more information on JSON Schema, refer to the official documentation:
460
- * https://json-schema.org/
461
- *
462
- * @param jsonSchema - The JSON schema to convert.
463
- * @returns An AST node representing the JSON schema, or undefined if the schema type is not recognized.
464
- */
465
- function schemaToAST(jsonSchema: IJsonSchema): ASTNodeJSON | undefined;
466
- /**
467
- * Convert AST To JSON Schema
468
- * @param typeAST
469
- * @returns
470
- */
471
- function astToSchema(typeAST: ASTNode, options?: {
472
- drilldown?: boolean;
473
- }): IJsonSchema | undefined;
474
- /**
475
- * Check if the AST type is match the JSON Schema
476
- * @param typeAST
477
- * @param schema
478
- * @returns
479
- */
480
- function isASTMatchSchema(typeAST: BaseType, schema: IJsonSchema | IJsonSchema[]): boolean;
481
- }
662
+ declare const provideBatchOutputsEffect: EffectOptions[];
663
+ /**
664
+ * Free Layout only right now
665
+ */
666
+ declare const createBatchOutputsFormPlugin: FormPluginCreator<{
667
+ outputKey: string;
668
+ }>;
482
669
 
483
670
  /**
484
671
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
485
672
  * SPDX-License-Identifier: MIT
486
673
  */
674
+ interface InputConfig$1 {
675
+ sourceKey: string;
676
+ targetKey: string;
677
+ scope?: 'private' | 'public';
678
+ }
679
+ declare const createInferInputsPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig$1>;
487
680
 
488
681
  /**
489
- * Free Layout only right now
682
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
683
+ * SPDX-License-Identifier: MIT
490
684
  */
491
- declare const createBatchOutputsFormPlugin: FormPluginCreator<{
685
+ interface InputConfig {
686
+ assignKey: string;
492
687
  outputKey: string;
493
- }>;
688
+ }
689
+ declare const createInferAssignPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig>;
690
+
691
+ /**
692
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
693
+ * SPDX-License-Identifier: MIT
694
+ */
695
+
696
+ interface Context {
697
+ node: FlowNodeEntity;
698
+ required?: boolean;
699
+ errorMessages?: {
700
+ required?: string;
701
+ unknownVariable?: string;
702
+ };
703
+ }
704
+ declare function validateFlowValue(value: IFlowValue | undefined, ctx: Context): {
705
+ level: FeedbackLevel;
706
+ message: string;
707
+ } | undefined;
494
708
 
495
- export { ArrayIcons, BatchOutputs, BatchVariableSelector, CodeEditor, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, DynamicValueInput, type IBasicJsonSchema, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IJsonSchema, JsonEditorWithVariables, type JsonSchemaBasicType, JsonSchemaEditor, JsonSchemaUtils, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, VariableSelector, type VariableSelectorProps, VariableTypeIcons, autoRenameRefEffect, createBatchOutputsFormPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getSchemaIcon, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useVariableTree };
709
+ export { AssignRow, AssignRows, type AssignValueType, 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, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };