@flowgram.ai/form-materials 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/materials.ts +10 -1
- package/dist/esm/index.js +388 -98
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +173 -90
- package/dist/index.d.ts +173 -90
- package/dist/index.js +453 -171
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/assign-row/components/blur-input.tsx +27 -0
- package/src/components/assign-row/config.json +11 -0
- package/src/components/assign-row/index.tsx +84 -0
- package/src/components/assign-row/types.ts +25 -0
- package/src/components/assign-rows/config.json +11 -0
- package/src/components/assign-rows/index.tsx +59 -0
- package/src/components/condition-row/constants.ts +4 -0
- package/src/components/constant-input/config.json +1 -1
- package/src/components/constant-input/index.tsx +1 -1
- package/src/components/constant-input/types.ts +1 -1
- package/src/components/display-outputs/index.tsx +7 -1
- package/src/components/display-schema-tag/index.tsx +1 -1
- package/src/components/display-schema-tree/config.json +1 -1
- package/src/components/display-schema-tree/index.tsx +1 -1
- package/src/components/index.ts +2 -0
- package/src/components/json-schema-editor/config.json +1 -1
- package/src/components/type-selector/index.tsx +1 -1
- package/src/components/variable-selector/index.tsx +1 -1
- package/src/components/variable-selector/use-variable-tree.tsx +1 -1
- package/src/effects/index.ts +1 -0
- package/src/effects/validate-when-variable-sync/config.json +5 -0
- package/src/effects/validate-when-variable-sync/index.ts +35 -0
- package/src/form-plugins/index.ts +1 -0
- package/src/form-plugins/infer-assign-plugin/config.json +7 -0
- package/src/form-plugins/infer-assign-plugin/index.ts +90 -0
- package/src/index.ts +2 -0
- package/src/plugins/disable-declaration-plugin/config.json +5 -0
- package/src/plugins/disable-declaration-plugin/create-disable-declaration-plugin.ts +31 -0
- package/src/plugins/disable-declaration-plugin/index.tsx +6 -0
- package/src/plugins/index.ts +7 -0
- package/src/{shared → plugins}/json-schema-preset/create-type-preset-plugin.tsx +4 -2
- package/src/{shared → plugins}/json-schema-preset/type-definition/array.tsx +2 -1
- package/src/{shared → plugins}/json-schema-preset/type-definition/object.tsx +2 -1
- package/src/shared/index.ts +0 -1
- package/src/validate/index.tsx +6 -0
- package/src/validate/validate-flow-value/config.json +7 -0
- package/src/validate/validate-flow-value/index.tsx +73 -0
- /package/src/{shared → plugins}/json-schema-preset/config.json +0 -0
- /package/src/{shared → plugins}/json-schema-preset/index.tsx +0 -0
- /package/src/{shared → plugins}/json-schema-preset/manager.ts +0 -0
- /package/src/{shared → plugins}/json-schema-preset/type-definition/boolean.tsx +0 -0
- /package/src/{shared → plugins}/json-schema-preset/type-definition/index.tsx +0 -0
- /package/src/{shared → plugins}/json-schema-preset/type-definition/integer.tsx +0 -0
- /package/src/{shared → plugins}/json-schema-preset/type-definition/number.tsx +0 -0
- /package/src/{shared → plugins}/json-schema-preset/type-definition/string.tsx +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -4,10 +4,10 @@ export { IJsonSchema, JsonSchemaUtils } from '@flowgram.ai/json-schema';
|
|
|
4
4
|
import { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
|
|
5
5
|
import { InferValues } from '@coze-editor/editor/react';
|
|
6
6
|
import preset from '@coze-editor/editor/preset-code';
|
|
7
|
-
import { BaseVariableField, EffectOptions, FormPluginCreator } from '@flowgram.ai/editor';
|
|
7
|
+
import { BaseVariableField, EffectOptions, FormPluginCreator, FeedbackLevel, FlowNodeEntity } from '@flowgram.ai/editor';
|
|
8
8
|
import * as _flowgram_ai_node from '@flowgram.ai/node';
|
|
9
|
-
import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
10
9
|
import * as _flowgram_ai_core from '@flowgram.ai/core';
|
|
10
|
+
import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -102,90 +102,6 @@ declare function JsonSchemaEditor(props: {
|
|
|
102
102
|
|
|
103
103
|
declare function BatchVariableSelector(props: VariableSelectorProps): React$1.JSX.Element;
|
|
104
104
|
|
|
105
|
-
/**
|
|
106
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
107
|
-
* SPDX-License-Identifier: MIT
|
|
108
|
-
*/
|
|
109
|
-
interface LegacyFlowRefValueSchema {
|
|
110
|
-
type: 'ref';
|
|
111
|
-
content: string;
|
|
112
|
-
}
|
|
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
105
|
/**
|
|
190
106
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
191
107
|
* SPDX-License-Identifier: MIT
|
|
@@ -204,7 +120,8 @@ interface JsonSchemaTypeRegistry<Value = any> extends JsonSchemaTypeRegistry$1 {
|
|
|
204
120
|
}
|
|
205
121
|
|
|
206
122
|
declare const createTypePresetPlugin: _flowgram_ai_core.PluginCreator<{
|
|
207
|
-
types
|
|
123
|
+
types?: Partial<JsonSchemaTypeRegistry> & Pick<JsonSchemaTypeRegistry, "type">[];
|
|
124
|
+
unregisterTypes?: string[];
|
|
208
125
|
}>;
|
|
209
126
|
|
|
210
127
|
/**
|
|
@@ -217,6 +134,12 @@ declare const JsonSchemaTypePresetProvider: ({ types, children, }: React$1.Props
|
|
|
217
134
|
types: JsonSchemaTypeRegistry[];
|
|
218
135
|
}>) => React$1.JSX.Element;
|
|
219
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
|
+
|
|
220
143
|
/**
|
|
221
144
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
222
145
|
* SPDX-License-Identifier: MIT
|
|
@@ -517,6 +440,45 @@ interface PropsType {
|
|
|
517
440
|
}
|
|
518
441
|
declare function DisplayInputsValues({ value, showIconInTree }: PropsType): React$1.JSX.Element;
|
|
519
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
|
+
|
|
520
482
|
/**
|
|
521
483
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
522
484
|
* SPDX-License-Identifier: MIT
|
|
@@ -556,6 +518,99 @@ declare const provideJsonSchemaOutputs: EffectOptions[];
|
|
|
556
518
|
|
|
557
519
|
declare const syncVariableTitle: EffectOptions[];
|
|
558
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
|
+
interface LegacyFlowRefValueSchema {
|
|
535
|
+
type: 'ref';
|
|
536
|
+
content: string;
|
|
537
|
+
}
|
|
538
|
+
interface NewFlowRefValueSchema {
|
|
539
|
+
type: 'ref';
|
|
540
|
+
content: string[];
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* In flowgram 0.2.0, for introducing Loop variable functionality,
|
|
544
|
+
* the FlowRefValueSchema type definition is updated:
|
|
545
|
+
*
|
|
546
|
+
* interface LegacyFlowRefValueSchema {
|
|
547
|
+
* type: 'ref';
|
|
548
|
+
* content: string;
|
|
549
|
+
* }
|
|
550
|
+
*
|
|
551
|
+
* interface NewFlowRefValueSchema {
|
|
552
|
+
* type: 'ref';
|
|
553
|
+
* content: string[];
|
|
554
|
+
* }
|
|
555
|
+
*
|
|
556
|
+
*
|
|
557
|
+
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
558
|
+
*
|
|
559
|
+
* How to use:
|
|
560
|
+
*
|
|
561
|
+
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
562
|
+
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
563
|
+
*
|
|
564
|
+
* Example:
|
|
565
|
+
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
566
|
+
* formMeta: {
|
|
567
|
+
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
568
|
+
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
569
|
+
* }
|
|
570
|
+
*/
|
|
571
|
+
declare function formatLegacyRefOnSubmit(value: any): any;
|
|
572
|
+
/**
|
|
573
|
+
* In flowgram 0.2.0, for introducing Loop variable functionality,
|
|
574
|
+
* the FlowRefValueSchema type definition is updated:
|
|
575
|
+
*
|
|
576
|
+
* interface LegacyFlowRefValueSchema {
|
|
577
|
+
* type: 'ref';
|
|
578
|
+
* content: string;
|
|
579
|
+
* }
|
|
580
|
+
*
|
|
581
|
+
* interface NewFlowRefValueSchema {
|
|
582
|
+
* type: 'ref';
|
|
583
|
+
* content: string[];
|
|
584
|
+
* }
|
|
585
|
+
*
|
|
586
|
+
*
|
|
587
|
+
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
588
|
+
*
|
|
589
|
+
* How to use:
|
|
590
|
+
*
|
|
591
|
+
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
592
|
+
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
593
|
+
*
|
|
594
|
+
* Example:
|
|
595
|
+
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
596
|
+
*
|
|
597
|
+
* formMeta: {
|
|
598
|
+
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
599
|
+
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
600
|
+
* }
|
|
601
|
+
*/
|
|
602
|
+
declare function formatLegacyRefOnInit(value: any): any;
|
|
603
|
+
declare function isLegacyFlowRefValueSchema(value: any): value is LegacyFlowRefValueSchema;
|
|
604
|
+
declare function isNewFlowRefValueSchema(value: any): value is NewFlowRefValueSchema;
|
|
605
|
+
declare function formatLegacyRefToNewRef(value: LegacyFlowRefValueSchema): {
|
|
606
|
+
type: string;
|
|
607
|
+
content: string[];
|
|
608
|
+
};
|
|
609
|
+
declare function formatNewRefToLegacyRef(value: NewFlowRefValueSchema): {
|
|
610
|
+
type: string;
|
|
611
|
+
content: string;
|
|
612
|
+
};
|
|
613
|
+
|
|
559
614
|
/**
|
|
560
615
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
561
616
|
* SPDX-License-Identifier: MIT
|
|
@@ -573,11 +628,39 @@ declare const createBatchOutputsFormPlugin: FormPluginCreator<{
|
|
|
573
628
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
574
629
|
* SPDX-License-Identifier: MIT
|
|
575
630
|
*/
|
|
576
|
-
interface InputConfig {
|
|
631
|
+
interface InputConfig$1 {
|
|
577
632
|
sourceKey: string;
|
|
578
633
|
targetKey: string;
|
|
579
634
|
scope?: 'private' | 'public';
|
|
580
635
|
}
|
|
581
|
-
declare const createInferInputsPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig>;
|
|
636
|
+
declare const createInferInputsPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig$1>;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
640
|
+
* SPDX-License-Identifier: MIT
|
|
641
|
+
*/
|
|
642
|
+
interface InputConfig {
|
|
643
|
+
assignKey: string;
|
|
644
|
+
outputKey: string;
|
|
645
|
+
}
|
|
646
|
+
declare const createInferAssignPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig>;
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
650
|
+
* SPDX-License-Identifier: MIT
|
|
651
|
+
*/
|
|
652
|
+
|
|
653
|
+
interface Context {
|
|
654
|
+
node: FlowNodeEntity;
|
|
655
|
+
required?: boolean;
|
|
656
|
+
errorMessages?: {
|
|
657
|
+
required?: string;
|
|
658
|
+
unknownVariable?: string;
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
declare function validateFlowValue(value: IFlowValue | undefined, ctx: Context): {
|
|
662
|
+
level: FeedbackLevel;
|
|
663
|
+
message: string;
|
|
664
|
+
} | undefined;
|
|
582
665
|
|
|
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 };
|
|
666
|
+
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, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export { IJsonSchema, JsonSchemaUtils } from '@flowgram.ai/json-schema';
|
|
|
4
4
|
import { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
|
|
5
5
|
import { InferValues } from '@coze-editor/editor/react';
|
|
6
6
|
import preset from '@coze-editor/editor/preset-code';
|
|
7
|
-
import { BaseVariableField, EffectOptions, FormPluginCreator } from '@flowgram.ai/editor';
|
|
7
|
+
import { BaseVariableField, EffectOptions, FormPluginCreator, FeedbackLevel, FlowNodeEntity } from '@flowgram.ai/editor';
|
|
8
8
|
import * as _flowgram_ai_node from '@flowgram.ai/node';
|
|
9
|
-
import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
10
9
|
import * as _flowgram_ai_core from '@flowgram.ai/core';
|
|
10
|
+
import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -102,90 +102,6 @@ declare function JsonSchemaEditor(props: {
|
|
|
102
102
|
|
|
103
103
|
declare function BatchVariableSelector(props: VariableSelectorProps): React$1.JSX.Element;
|
|
104
104
|
|
|
105
|
-
/**
|
|
106
|
-
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
107
|
-
* SPDX-License-Identifier: MIT
|
|
108
|
-
*/
|
|
109
|
-
interface LegacyFlowRefValueSchema {
|
|
110
|
-
type: 'ref';
|
|
111
|
-
content: string;
|
|
112
|
-
}
|
|
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
105
|
/**
|
|
190
106
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
191
107
|
* SPDX-License-Identifier: MIT
|
|
@@ -204,7 +120,8 @@ interface JsonSchemaTypeRegistry<Value = any> extends JsonSchemaTypeRegistry$1 {
|
|
|
204
120
|
}
|
|
205
121
|
|
|
206
122
|
declare const createTypePresetPlugin: _flowgram_ai_core.PluginCreator<{
|
|
207
|
-
types
|
|
123
|
+
types?: Partial<JsonSchemaTypeRegistry> & Pick<JsonSchemaTypeRegistry, "type">[];
|
|
124
|
+
unregisterTypes?: string[];
|
|
208
125
|
}>;
|
|
209
126
|
|
|
210
127
|
/**
|
|
@@ -217,6 +134,12 @@ declare const JsonSchemaTypePresetProvider: ({ types, children, }: React$1.Props
|
|
|
217
134
|
types: JsonSchemaTypeRegistry[];
|
|
218
135
|
}>) => React$1.JSX.Element;
|
|
219
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
|
+
|
|
220
143
|
/**
|
|
221
144
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
222
145
|
* SPDX-License-Identifier: MIT
|
|
@@ -517,6 +440,45 @@ interface PropsType {
|
|
|
517
440
|
}
|
|
518
441
|
declare function DisplayInputsValues({ value, showIconInTree }: PropsType): React$1.JSX.Element;
|
|
519
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
|
+
|
|
520
482
|
/**
|
|
521
483
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
522
484
|
* SPDX-License-Identifier: MIT
|
|
@@ -556,6 +518,99 @@ declare const provideJsonSchemaOutputs: EffectOptions[];
|
|
|
556
518
|
|
|
557
519
|
declare const syncVariableTitle: EffectOptions[];
|
|
558
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
|
+
interface LegacyFlowRefValueSchema {
|
|
535
|
+
type: 'ref';
|
|
536
|
+
content: string;
|
|
537
|
+
}
|
|
538
|
+
interface NewFlowRefValueSchema {
|
|
539
|
+
type: 'ref';
|
|
540
|
+
content: string[];
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* In flowgram 0.2.0, for introducing Loop variable functionality,
|
|
544
|
+
* the FlowRefValueSchema type definition is updated:
|
|
545
|
+
*
|
|
546
|
+
* interface LegacyFlowRefValueSchema {
|
|
547
|
+
* type: 'ref';
|
|
548
|
+
* content: string;
|
|
549
|
+
* }
|
|
550
|
+
*
|
|
551
|
+
* interface NewFlowRefValueSchema {
|
|
552
|
+
* type: 'ref';
|
|
553
|
+
* content: string[];
|
|
554
|
+
* }
|
|
555
|
+
*
|
|
556
|
+
*
|
|
557
|
+
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
558
|
+
*
|
|
559
|
+
* How to use:
|
|
560
|
+
*
|
|
561
|
+
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
562
|
+
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
563
|
+
*
|
|
564
|
+
* Example:
|
|
565
|
+
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
566
|
+
* formMeta: {
|
|
567
|
+
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
568
|
+
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
569
|
+
* }
|
|
570
|
+
*/
|
|
571
|
+
declare function formatLegacyRefOnSubmit(value: any): any;
|
|
572
|
+
/**
|
|
573
|
+
* In flowgram 0.2.0, for introducing Loop variable functionality,
|
|
574
|
+
* the FlowRefValueSchema type definition is updated:
|
|
575
|
+
*
|
|
576
|
+
* interface LegacyFlowRefValueSchema {
|
|
577
|
+
* type: 'ref';
|
|
578
|
+
* content: string;
|
|
579
|
+
* }
|
|
580
|
+
*
|
|
581
|
+
* interface NewFlowRefValueSchema {
|
|
582
|
+
* type: 'ref';
|
|
583
|
+
* content: string[];
|
|
584
|
+
* }
|
|
585
|
+
*
|
|
586
|
+
*
|
|
587
|
+
* For making sure backend json will not be changed, we provide format legacy ref utils for updating the formData
|
|
588
|
+
*
|
|
589
|
+
* How to use:
|
|
590
|
+
*
|
|
591
|
+
* 1. Call formatLegacyRefOnSubmit on the formData before submitting
|
|
592
|
+
* 2. Call formatLegacyRefOnInit on the formData after submitting
|
|
593
|
+
*
|
|
594
|
+
* Example:
|
|
595
|
+
* import { formatLegacyRefOnSubmit, formatLegacyRefOnInit } from '@flowgram.ai/form-materials';
|
|
596
|
+
*
|
|
597
|
+
* formMeta: {
|
|
598
|
+
* formatOnSubmit: (data) => formatLegacyRefOnSubmit(data),
|
|
599
|
+
* formatOnInit: (data) => formatLegacyRefOnInit(data),
|
|
600
|
+
* }
|
|
601
|
+
*/
|
|
602
|
+
declare function formatLegacyRefOnInit(value: any): any;
|
|
603
|
+
declare function isLegacyFlowRefValueSchema(value: any): value is LegacyFlowRefValueSchema;
|
|
604
|
+
declare function isNewFlowRefValueSchema(value: any): value is NewFlowRefValueSchema;
|
|
605
|
+
declare function formatLegacyRefToNewRef(value: LegacyFlowRefValueSchema): {
|
|
606
|
+
type: string;
|
|
607
|
+
content: string[];
|
|
608
|
+
};
|
|
609
|
+
declare function formatNewRefToLegacyRef(value: NewFlowRefValueSchema): {
|
|
610
|
+
type: string;
|
|
611
|
+
content: string;
|
|
612
|
+
};
|
|
613
|
+
|
|
559
614
|
/**
|
|
560
615
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
561
616
|
* SPDX-License-Identifier: MIT
|
|
@@ -573,11 +628,39 @@ declare const createBatchOutputsFormPlugin: FormPluginCreator<{
|
|
|
573
628
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
574
629
|
* SPDX-License-Identifier: MIT
|
|
575
630
|
*/
|
|
576
|
-
interface InputConfig {
|
|
631
|
+
interface InputConfig$1 {
|
|
577
632
|
sourceKey: string;
|
|
578
633
|
targetKey: string;
|
|
579
634
|
scope?: 'private' | 'public';
|
|
580
635
|
}
|
|
581
|
-
declare const createInferInputsPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig>;
|
|
636
|
+
declare const createInferInputsPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig$1>;
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
640
|
+
* SPDX-License-Identifier: MIT
|
|
641
|
+
*/
|
|
642
|
+
interface InputConfig {
|
|
643
|
+
assignKey: string;
|
|
644
|
+
outputKey: string;
|
|
645
|
+
}
|
|
646
|
+
declare const createInferAssignPlugin: _flowgram_ai_node.FormPluginCreator<InputConfig>;
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
650
|
+
* SPDX-License-Identifier: MIT
|
|
651
|
+
*/
|
|
652
|
+
|
|
653
|
+
interface Context {
|
|
654
|
+
node: FlowNodeEntity;
|
|
655
|
+
required?: boolean;
|
|
656
|
+
errorMessages?: {
|
|
657
|
+
required?: string;
|
|
658
|
+
unknownVariable?: string;
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
declare function validateFlowValue(value: IFlowValue | undefined, ctx: Context): {
|
|
662
|
+
level: FeedbackLevel;
|
|
663
|
+
message: string;
|
|
664
|
+
} | undefined;
|
|
582
665
|
|
|
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 };
|
|
666
|
+
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, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
|