@flowgram.ai/form-materials 0.2.31 → 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.
Files changed (81) hide show
  1. package/bin/index.ts +11 -5
  2. package/bin/materials.ts +1 -1
  3. package/dist/esm/index.js +1256 -1363
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/index.d.mts +232 -202
  6. package/dist/index.d.ts +232 -202
  7. package/dist/index.js +1399 -1507
  8. package/dist/index.js.map +1 -1
  9. package/package.json +5 -4
  10. package/src/components/batch-variable-selector/config.json +6 -2
  11. package/src/components/batch-variable-selector/index.tsx +1 -1
  12. package/src/components/code-editor/theme/light.ts +1 -1
  13. package/src/components/code-editor-mini/config.json +7 -0
  14. package/src/components/code-editor-mini/index.tsx +31 -0
  15. package/src/components/condition-row/config.json +10 -2
  16. package/src/components/condition-row/hooks/useOp.tsx +3 -1
  17. package/src/components/condition-row/hooks/useRule.ts +2 -2
  18. package/src/components/condition-row/index.tsx +2 -1
  19. package/src/components/condition-row/types.ts +3 -1
  20. package/src/components/constant-input/config.json +6 -3
  21. package/src/components/constant-input/index.tsx +10 -71
  22. package/src/components/constant-input/types.ts +6 -10
  23. package/src/components/display-flow-value/config.json +8 -0
  24. package/src/components/display-flow-value/index.tsx +59 -0
  25. package/src/components/display-inputs-values/config.json +9 -0
  26. package/src/components/display-inputs-values/index.tsx +27 -0
  27. package/src/components/display-inputs-values/styles.ts +12 -0
  28. package/src/components/display-outputs/config.json +10 -0
  29. package/src/components/display-outputs/index.tsx +58 -0
  30. package/src/components/display-outputs/styles.ts +12 -0
  31. package/src/components/display-schema-tag/config.json +10 -0
  32. package/src/components/display-schema-tag/index.tsx +44 -0
  33. package/src/components/display-schema-tag/styles.ts +28 -0
  34. package/src/components/display-schema-tree/config.json +11 -0
  35. package/src/components/display-schema-tree/index.tsx +74 -0
  36. package/src/components/display-schema-tree/styles.tsx +90 -0
  37. package/src/components/dynamic-value-input/config.json +11 -2
  38. package/src/components/dynamic-value-input/hooks.ts +53 -0
  39. package/src/components/dynamic-value-input/index.tsx +30 -28
  40. package/src/components/index.ts +6 -0
  41. package/src/components/inputs-values/config.json +2 -1
  42. package/src/components/inputs-values/types.ts +3 -1
  43. package/src/components/json-schema-editor/config.json +3 -3
  44. package/src/components/json-schema-editor/default-value.tsx +1 -1
  45. package/src/components/json-schema-editor/hooks.tsx +1 -1
  46. package/src/components/json-schema-editor/index.tsx +1 -1
  47. package/src/components/json-schema-editor/types.ts +1 -1
  48. package/src/components/type-selector/config.json +6 -2
  49. package/src/components/type-selector/index.tsx +47 -11
  50. package/src/components/variable-selector/config.json +6 -2
  51. package/src/components/variable-selector/index.tsx +1 -1
  52. package/src/components/variable-selector/use-variable-tree.tsx +14 -20
  53. package/src/effects/provide-json-schema-outputs/config.json +4 -5
  54. package/src/effects/provide-json-schema-outputs/index.ts +1 -3
  55. package/src/effects/sync-variable-title/index.ts +1 -0
  56. package/src/form-plugins/infer-inputs-plugin/config.json +3 -1
  57. package/src/form-plugins/infer-inputs-plugin/index.ts +2 -2
  58. package/src/index.ts +1 -1
  59. package/src/{utils → shared}/index.ts +1 -1
  60. package/src/shared/json-schema-preset/config.json +9 -0
  61. package/src/shared/json-schema-preset/create-type-preset-plugin.tsx +26 -0
  62. package/src/shared/json-schema-preset/index.tsx +39 -0
  63. package/src/shared/json-schema-preset/manager.ts +18 -0
  64. package/src/shared/json-schema-preset/type-definition/array.tsx +23 -0
  65. package/src/shared/json-schema-preset/type-definition/boolean.tsx +32 -0
  66. package/src/shared/json-schema-preset/type-definition/index.tsx +24 -0
  67. package/src/shared/json-schema-preset/type-definition/integer.tsx +24 -0
  68. package/src/shared/json-schema-preset/type-definition/number.tsx +24 -0
  69. package/src/shared/json-schema-preset/type-definition/object.tsx +23 -0
  70. package/src/shared/json-schema-preset/type-definition/string.tsx +18 -0
  71. package/src/typings/flow-value/config.json +4 -4
  72. package/src/typings/flow-value/index.ts +1 -1
  73. package/src/typings/index.ts +0 -1
  74. package/src/components/type-selector/constants.tsx +0 -364
  75. package/src/typings/json-schema/config.json +0 -5
  76. package/src/typings/json-schema/index.ts +0 -36
  77. package/src/utils/json-schema/config.json +0 -5
  78. package/src/utils/json-schema/index.ts +0 -180
  79. /package/src/{utils → shared}/format-legacy-refs/config.json +0 -0
  80. /package/src/{utils → shared}/format-legacy-refs/index.ts +0 -0
  81. /package/src/{utils → shared}/format-legacy-refs/readme.md +0 -0
package/dist/index.d.mts 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, ASTNodeJSON, ASTNode, BaseType, FormPluginCreator } from '@flowgram.ai/editor';
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
- interface Strategy<Value = any> {
177
- hit: (schema: IJsonSchema) => boolean;
178
- Renderer: React.FC<RendererProps<Value>>;
109
+ interface LegacyFlowRefValueSchema {
110
+ type: 'ref';
111
+ content: string;
179
112
  }
180
- interface RendererProps<Value = any> {
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 PropsType$5 extends RendererProps {
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<RendererProps>;
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$5): React$1.JSX.Element;
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 PropsType$4 {
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$4): React$1.JSX.Element;
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$3 {
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$3): React$1.JSX.Element;
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$2 = React$1.PropsWithChildren<{
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$2;
302
- declare function PromptEditor(props: PropsType$2): React$1.JSX.Element;
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$1 extends PromptEditorPropsType {
392
+ interface PropsType$6 extends PromptEditorPropsType {
317
393
  inputsValues: Record<string, IFlowValue>;
318
394
  }
319
- declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType$1): React$1.JSX.Element;
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
- declare const provideBatchInputEffect: EffectOptions[];
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
- * Auto rename ref when form item's key is renamed
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
- declare const autoRenameRefEffect: EffectOptions[];
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
- declare const provideJsonSchemaOutputs: EffectOptions[];
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
- declare const syncVariableTitle: EffectOptions[];
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
- interface LegacyFlowRefValueSchema {
416
- type: 'ref';
417
- content: string;
418
- }
419
- interface NewFlowRefValueSchema {
420
- type: 'ref';
421
- content: string[];
422
- }
524
+
525
+ declare const provideBatchInputEffect: EffectOptions[];
526
+
423
527
  /**
424
- * In flowgram 0.2.0, for introducing Loop variable functionality,
425
- * the FlowRefValueSchema type definition is updated:
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
- declare function formatLegacyRefOnSubmit(value: any): any;
531
+
453
532
  /**
454
- * In flowgram 0.2.0, for introducing Loop variable functionality,
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
- * formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
480
- * formatOnInit: (data) => formatLegacyRefOnInit(data),
538
+ * effects: {
539
+ * "inputsValues": autoRenameRefEffect,
540
+ * }
481
541
  * }
482
542
  */
483
- declare function formatLegacyRefOnInit(value: any): any;
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 namespace JsonSchemaUtils {
501
- /**
502
- * Converts a JSON schema to an Abstract Syntax Tree (AST) representation.
503
- * This function recursively processes the JSON schema and creates corresponding AST nodes.
504
- *
505
- * For more information on JSON Schema, refer to the official documentation:
506
- * https://json-schema.org/
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 { 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 IFlowValueExtra, type IJsonSchema, InputsValues, JsonEditorWithVariables, type JsonSchemaBasicType, JsonSchemaEditor, JsonSchemaUtils, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, VariableSelector, type VariableSelectorProps, VariableTypeIcons, autoRenameRefEffect, createBatchOutputsFormPlugin, createInferInputsPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getSchemaIcon, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useVariableTree };
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 };