@flowgram.ai/form-materials 0.1.0-alpha.11 → 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 (121) hide show
  1. package/bin/index.ts +11 -5
  2. package/bin/materials.ts +10 -1
  3. package/dist/esm/index.js +1917 -1371
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/index.d.mts +320 -113
  6. package/dist/index.d.ts +320 -113
  7. package/dist/index.js +2023 -1484
  8. package/dist/index.js.map +1 -1
  9. package/package.json +5 -4
  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/index.tsx +7 -0
  21. package/src/components/code-editor/language-features.ts +22 -1
  22. package/src/components/code-editor/theme/light.ts +1 -1
  23. package/src/components/code-editor-mini/config.json +7 -0
  24. package/src/components/code-editor-mini/index.tsx +31 -0
  25. package/src/components/condition-row/config.json +10 -2
  26. package/src/components/condition-row/constants.ts +6 -8
  27. package/src/components/condition-row/hooks/useOp.tsx +3 -1
  28. package/src/components/condition-row/hooks/useRule.ts +2 -2
  29. package/src/components/condition-row/index.tsx +2 -1
  30. package/src/components/condition-row/types.ts +3 -1
  31. package/src/components/constant-input/config.json +6 -3
  32. package/src/components/constant-input/index.tsx +18 -62
  33. package/src/components/constant-input/types.ts +6 -9
  34. package/src/components/display-flow-value/config.json +8 -0
  35. package/src/components/display-flow-value/index.tsx +59 -0
  36. package/src/components/display-inputs-values/config.json +9 -0
  37. package/src/components/display-inputs-values/index.tsx +27 -0
  38. package/src/components/display-inputs-values/styles.ts +12 -0
  39. package/src/components/display-outputs/config.json +10 -0
  40. package/src/components/display-outputs/index.tsx +64 -0
  41. package/src/components/display-outputs/styles.ts +12 -0
  42. package/src/components/display-schema-tag/config.json +10 -0
  43. package/src/components/display-schema-tag/index.tsx +44 -0
  44. package/src/components/display-schema-tag/styles.ts +28 -0
  45. package/src/components/display-schema-tree/config.json +11 -0
  46. package/src/components/display-schema-tree/index.tsx +74 -0
  47. package/src/components/display-schema-tree/styles.tsx +90 -0
  48. package/src/components/dynamic-value-input/config.json +11 -2
  49. package/src/components/dynamic-value-input/hooks.ts +53 -0
  50. package/src/components/dynamic-value-input/index.tsx +64 -13
  51. package/src/components/dynamic-value-input/styles.tsx +28 -2
  52. package/src/components/index.ts +9 -0
  53. package/src/components/inputs-values/components/blur-input.tsx +27 -0
  54. package/src/components/inputs-values/config.json +13 -0
  55. package/src/components/inputs-values/index.tsx +73 -0
  56. package/src/components/inputs-values/styles.tsx +19 -0
  57. package/src/components/inputs-values/types.ts +22 -0
  58. package/src/components/json-schema-editor/config.json +2 -2
  59. package/src/components/json-schema-editor/default-value.tsx +1 -1
  60. package/src/components/json-schema-editor/hooks.tsx +1 -1
  61. package/src/components/json-schema-editor/index.tsx +15 -2
  62. package/src/components/json-schema-editor/types.ts +1 -1
  63. package/src/components/prompt-editor-with-inputs/inputs-picker.tsx +1 -1
  64. package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +6 -3
  65. package/src/components/type-selector/config.json +6 -2
  66. package/src/components/type-selector/index.tsx +55 -12
  67. package/src/components/variable-selector/config.json +6 -2
  68. package/src/components/variable-selector/index.tsx +34 -13
  69. package/src/components/variable-selector/styles.tsx +18 -8
  70. package/src/components/variable-selector/use-variable-tree.tsx +19 -22
  71. package/src/effects/index.ts +3 -1
  72. package/src/effects/listen-ref-schema-change/config.json +10 -0
  73. package/src/effects/listen-ref-schema-change/index.ts +56 -0
  74. package/src/effects/listen-ref-value-change/config.json +9 -0
  75. package/src/effects/listen-ref-value-change/index.ts +53 -0
  76. package/src/effects/provide-json-schema-outputs/config.json +4 -5
  77. package/src/effects/provide-json-schema-outputs/index.ts +1 -3
  78. package/src/effects/sync-variable-title/index.ts +1 -0
  79. package/src/effects/validate-when-variable-sync/config.json +5 -0
  80. package/src/effects/validate-when-variable-sync/index.ts +35 -0
  81. package/src/form-plugins/index.ts +3 -1
  82. package/src/form-plugins/infer-assign-plugin/config.json +7 -0
  83. package/src/form-plugins/infer-assign-plugin/index.ts +90 -0
  84. package/src/form-plugins/infer-inputs-plugin/config.json +9 -0
  85. package/src/form-plugins/infer-inputs-plugin/index.ts +108 -0
  86. package/src/hooks/index.tsx +6 -0
  87. package/src/hooks/use-object-list/config.json +8 -0
  88. package/src/hooks/use-object-list/index.tsx +136 -0
  89. package/src/index.ts +3 -1
  90. package/src/{typings/json-schema → plugins/disable-declaration-plugin}/config.json +1 -1
  91. package/src/plugins/disable-declaration-plugin/create-disable-declaration-plugin.ts +31 -0
  92. package/src/plugins/disable-declaration-plugin/index.tsx +6 -0
  93. package/src/plugins/index.ts +7 -0
  94. package/src/plugins/json-schema-preset/config.json +9 -0
  95. package/src/plugins/json-schema-preset/create-type-preset-plugin.tsx +28 -0
  96. package/src/plugins/json-schema-preset/index.tsx +41 -0
  97. package/src/plugins/json-schema-preset/manager.ts +18 -0
  98. package/src/plugins/json-schema-preset/type-definition/array.tsx +24 -0
  99. package/src/plugins/json-schema-preset/type-definition/boolean.tsx +32 -0
  100. package/src/plugins/json-schema-preset/type-definition/index.tsx +24 -0
  101. package/src/plugins/json-schema-preset/type-definition/integer.tsx +24 -0
  102. package/src/plugins/json-schema-preset/type-definition/number.tsx +24 -0
  103. package/src/plugins/json-schema-preset/type-definition/object.tsx +24 -0
  104. package/src/plugins/json-schema-preset/type-definition/string.tsx +18 -0
  105. package/src/{utils → shared}/index.ts +0 -1
  106. package/src/typings/flow-value/config.json +3 -1
  107. package/src/typings/flow-value/index.ts +11 -0
  108. package/src/typings/index.ts +0 -1
  109. package/src/validate/index.tsx +6 -0
  110. package/src/validate/validate-flow-value/config.json +7 -0
  111. package/src/validate/validate-flow-value/index.tsx +73 -0
  112. package/src/components/batch-outputs/use-list.ts +0 -86
  113. package/src/components/type-selector/constants.tsx +0 -364
  114. package/src/effects/provide-batch-outputs/config.json +0 -5
  115. package/src/effects/provide-batch-outputs/index.ts +0 -38
  116. package/src/typings/json-schema/index.ts +0 -36
  117. package/src/utils/json-schema/config.json +0 -5
  118. package/src/utils/json-schema/index.ts +0 -180
  119. /package/src/{utils → shared}/format-legacy-refs/config.json +0 -0
  120. /package/src/{utils → shared}/format-legacy-refs/index.ts +0 -0
  121. /package/src/{utils → shared}/format-legacy-refs/readme.md +0 -0
package/dist/index.d.mts CHANGED
@@ -1,43 +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
5
  import { InferValues } from '@coze-editor/editor/react';
4
6
  import preset from '@coze-editor/editor/preset-code';
5
- import { EffectOptions, ASTNodeJSON, ASTNode, BaseType, FormPluginCreator } from '@flowgram.ai/editor';
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';
6
10
  import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
7
11
 
8
- /**
9
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
10
- * SPDX-License-Identifier: MIT
11
- */
12
- type JsonSchemaBasicType = 'boolean' | 'string' | 'integer' | 'number' | 'object' | 'array' | 'map';
13
- interface IJsonSchema<T = string> {
14
- type?: T;
15
- default?: any;
16
- title?: string;
17
- description?: string;
18
- enum?: (string | number)[];
19
- properties?: Record<string, IJsonSchema<T>>;
20
- additionalProperties?: IJsonSchema<T>;
21
- items?: IJsonSchema<T>;
22
- required?: string[];
23
- $ref?: string;
24
- extra?: {
25
- index?: number;
26
- weak?: boolean;
27
- formComponent?: string;
28
- [key: string]: any;
29
- };
30
- }
31
- type IBasicJsonSchema = IJsonSchema<JsonSchemaBasicType>;
32
-
33
12
  /**
34
13
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
35
14
  * SPDX-License-Identifier: MIT
36
15
  */
37
16
 
17
+ type VariableField = BaseVariableField<{
18
+ icon?: string | JSX.Element;
19
+ title?: string;
20
+ disabled?: boolean;
21
+ }>;
38
22
  declare function useVariableTree(params: {
39
23
  includeSchema?: IJsonSchema | IJsonSchema[];
40
24
  excludeSchema?: IJsonSchema | IJsonSchema[];
25
+ customSkip?: (variable: VariableField) => boolean;
41
26
  }): TreeNodeData[];
42
27
 
43
28
  /**
@@ -63,42 +48,6 @@ type VariableSelectorProps = PropTypes$2;
63
48
 
64
49
  declare const VariableSelector: ({ value, config, onChange, style, readonly, includeSchema, excludeSchema, hasError, triggerRender, }: PropTypes$2) => React$1.JSX.Element;
65
50
 
66
- /**
67
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
68
- * SPDX-License-Identifier: MIT
69
- */
70
- interface IFlowConstantValue {
71
- type: 'constant';
72
- content?: string | number | boolean;
73
- }
74
- interface IFlowRefValue {
75
- type: 'ref';
76
- content?: string[];
77
- }
78
- interface IFlowExpressionValue {
79
- type: 'expression';
80
- content?: string;
81
- }
82
- interface IFlowTemplateValue {
83
- type: 'template';
84
- content?: string;
85
- }
86
- type IFlowValue = IFlowConstantValue | IFlowRefValue | IFlowExpressionValue | IFlowTemplateValue;
87
- type IFlowConstantRefValue = IFlowConstantValue | IFlowRefValue;
88
-
89
- /**
90
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
91
- * SPDX-License-Identifier: MIT
92
- */
93
-
94
- declare const VariableTypeIcons: {
95
- [key: string]: React$1.ReactNode;
96
- };
97
- declare const ArrayIcons: {
98
- [key: string]: React$1.ReactNode;
99
- };
100
- declare const getSchemaIcon: (value?: Partial<IJsonSchema>) => React$1.ReactNode;
101
-
102
51
  /**
103
52
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
104
53
  * SPDX-License-Identifier: MIT
@@ -106,7 +55,11 @@ declare const getSchemaIcon: (value?: Partial<IJsonSchema>) => React$1.ReactNode
106
55
 
107
56
  interface PropTypes$1 {
108
57
  value?: Partial<IJsonSchema>;
109
- onChange: (value?: Partial<IJsonSchema>) => void;
58
+ onChange?: (value?: Partial<IJsonSchema>) => void;
59
+ readonly?: boolean;
60
+ /**
61
+ * @deprecated use readonly instead
62
+ */
110
63
  disabled?: boolean;
111
64
  style?: React$1.CSSProperties;
112
65
  }
@@ -139,6 +92,7 @@ declare function JsonSchemaEditor(props: {
139
92
  onChange?: (value: IJsonSchema) => void;
140
93
  config?: ConfigType;
141
94
  className?: string;
95
+ readonly?: boolean;
142
96
  }): React$1.JSX.Element;
143
97
 
144
98
  /**
@@ -153,18 +107,52 @@ declare function BatchVariableSelector(props: VariableSelectorProps): React$1.JS
153
107
  * SPDX-License-Identifier: MIT
154
108
  */
155
109
 
156
- interface Strategy<Value = any> {
157
- hit: (schema: IJsonSchema) => boolean;
158
- Renderer: React.FC<RendererProps<Value>>;
159
- }
160
- interface RendererProps<Value = any> {
110
+ interface ConstantRendererProps<Value = any> {
161
111
  value?: Value;
162
112
  onChange?: (value: Value) => void;
163
113
  readonly?: boolean;
164
114
  }
165
- 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 {
166
153
  schema: IJsonSchema;
167
154
  strategies?: Strategy[];
155
+ fallbackRenderer?: React.FC<ConstantRendererProps>;
168
156
  [key: string]: any;
169
157
  }
170
158
 
@@ -173,14 +161,46 @@ interface PropsType$4 extends RendererProps {
173
161
  * SPDX-License-Identifier: MIT
174
162
  */
175
163
 
176
- declare function ConstantInput(props: PropsType$4): React$1.JSX.Element;
164
+ declare function ConstantInput(props: PropsType$a): React$1.JSX.Element;
177
165
 
178
166
  /**
179
167
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
180
168
  * SPDX-License-Identifier: MIT
181
169
  */
182
170
 
183
- 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 {
184
204
  value?: IFlowConstantRefValue;
185
205
  onChange: (value?: IFlowConstantRefValue) => void;
186
206
  readonly?: boolean;
@@ -193,7 +213,7 @@ interface PropsType$3 {
193
213
  [key: string]: any;
194
214
  };
195
215
  }
196
- 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;
197
217
 
198
218
  /**
199
219
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -241,7 +261,7 @@ declare function ConditionRow({ style, value, onChange, readonly }: PropTypes):
241
261
  */
242
262
 
243
263
  type ValueType = Record<string, IFlowRefValue | undefined>;
244
- interface PropsType$2 {
264
+ interface PropsType$8 {
245
265
  value?: ValueType;
246
266
  onChange: (value?: ValueType) => void;
247
267
  readonly?: boolean;
@@ -254,14 +274,14 @@ interface PropsType$2 {
254
274
  * SPDX-License-Identifier: MIT
255
275
  */
256
276
 
257
- declare function BatchOutputs(props: PropsType$2): React$1.JSX.Element;
277
+ declare function BatchOutputs(props: PropsType$8): React$1.JSX.Element;
258
278
 
259
279
  /**
260
280
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
261
281
  * SPDX-License-Identifier: MIT
262
282
  */
263
283
 
264
- type PropsType$1 = React$1.PropsWithChildren<{
284
+ type PropsType$7 = React$1.PropsWithChildren<{
265
285
  value?: IFlowTemplateValue;
266
286
  onChange: (value?: IFlowTemplateValue) => void;
267
287
  readonly?: boolean;
@@ -277,8 +297,8 @@ type PropsType$1 = React$1.PropsWithChildren<{
277
297
  * SPDX-License-Identifier: MIT
278
298
  */
279
299
 
280
- type PromptEditorPropsType = PropsType$1;
281
- 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;
282
302
 
283
303
  /**
284
304
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -292,10 +312,10 @@ declare function PromptEditorWithVariables(props: PromptEditorPropsType): React$
292
312
  * SPDX-License-Identifier: MIT
293
313
  */
294
314
 
295
- interface PropsType extends PromptEditorPropsType {
315
+ interface PropsType$6 extends PromptEditorPropsType {
296
316
  inputsValues: Record<string, IFlowValue>;
297
317
  }
298
- declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType): React$1.JSX.Element;
318
+ declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType$6): React$1.JSX.Element;
299
319
 
300
320
  /**
301
321
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -316,6 +336,13 @@ interface CodeEditorPropsType extends React$1.PropsWithChildren<{}> {
316
336
  }
317
337
  declare function CodeEditor({ value, onChange, languageId, theme, children, placeholder, activeLinePlaceholder, options, readonly, }: CodeEditorPropsType): React$1.JSX.Element;
318
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;
345
+
319
346
  /**
320
347
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
321
348
  * SPDX-License-Identifier: MIT
@@ -328,14 +355,136 @@ declare function JsonEditorWithVariables(props: Omit<CodeEditorPropsType, 'langu
328
355
  * SPDX-License-Identifier: MIT
329
356
  */
330
357
 
331
- 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
+ }
332
370
 
333
371
  /**
334
372
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
335
373
  * SPDX-License-Identifier: MIT
336
374
  */
337
375
 
338
- 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[];
339
488
 
340
489
  /**
341
490
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
@@ -369,6 +518,58 @@ declare const provideJsonSchemaOutputs: EffectOptions[];
369
518
 
370
519
  declare const syncVariableTitle: EffectOptions[];
371
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
+
372
573
  /**
373
574
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
374
575
  * SPDX-License-Identifier: MIT
@@ -458,45 +659,51 @@ declare function formatNewRefToLegacyRef(value: NewFlowRefValueSchema): {
458
659
  * SPDX-License-Identifier: MIT
459
660
  */
460
661
 
461
- declare namespace JsonSchemaUtils {
462
- /**
463
- * Converts a JSON schema to an Abstract Syntax Tree (AST) representation.
464
- * This function recursively processes the JSON schema and creates corresponding AST nodes.
465
- *
466
- * For more information on JSON Schema, refer to the official documentation:
467
- * https://json-schema.org/
468
- *
469
- * @param jsonSchema - The JSON schema to convert.
470
- * @returns An AST node representing the JSON schema, or undefined if the schema type is not recognized.
471
- */
472
- function schemaToAST(jsonSchema: IJsonSchema): ASTNodeJSON | undefined;
473
- /**
474
- * Convert AST To JSON Schema
475
- * @param typeAST
476
- * @returns
477
- */
478
- function astToSchema(typeAST: ASTNode, options?: {
479
- drilldown?: boolean;
480
- }): IJsonSchema | undefined;
481
- /**
482
- * Check if the AST type is match the JSON Schema
483
- * @param typeAST
484
- * @param schema
485
- * @returns
486
- */
487
- function isASTMatchSchema(typeAST: BaseType, schema: IJsonSchema | IJsonSchema[]): boolean;
488
- }
662
+ declare const provideBatchOutputsEffect: EffectOptions[];
663
+ /**
664
+ * Free Layout only right now
665
+ */
666
+ declare const createBatchOutputsFormPlugin: FormPluginCreator<{
667
+ outputKey: string;
668
+ }>;
489
669
 
490
670
  /**
491
671
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
492
672
  * SPDX-License-Identifier: MIT
493
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>;
494
680
 
495
681
  /**
496
- * Free Layout only right now
682
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
683
+ * SPDX-License-Identifier: MIT
497
684
  */
498
- declare const createBatchOutputsFormPlugin: FormPluginCreator<{
685
+ interface InputConfig {
686
+ assignKey: string;
499
687
  outputKey: string;
500
- }>;
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;
501
708
 
502
- 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 };