@flowgram.ai/form-materials 0.4.1 → 0.4.3
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/dist/esm/index.js +198 -87
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +29 -4
- package/dist/index.d.ts +29 -4
- package/dist/index.js +249 -139
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/components/display-flow-value/index.tsx +2 -12
- package/src/components/display-inputs-values/index.tsx +44 -6
- package/src/components/dynamic-value-input/hooks.ts +23 -2
- package/src/components/dynamic-value-input/index.tsx +21 -12
- package/src/components/inputs-values/index.tsx +12 -1
- package/src/components/inputs-values-tree/hooks/use-child-list.tsx +8 -3
- package/src/components/inputs-values-tree/index.tsx +7 -1
- package/src/components/inputs-values-tree/row.tsx +23 -9
- package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +1 -1
- package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +11 -0
- package/src/components/prompt-editor-with-inputs/index.tsx +1 -2
- package/src/components/prompt-editor-with-inputs/inputs-picker.tsx +34 -17
- package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +1 -1
- package/src/components/prompt-editor-with-variables/extensions/variable-tree.tsx +13 -1
- package/src/components/type-selector/index.tsx +12 -2
- package/src/index.ts +1 -0
- package/src/shared/flow-value/schema.ts +1 -1
- package/src/shared/flow-value/utils.ts +1 -1
- package/src/typings/flow-value/index.ts +1 -1
- package/src/validate/validate-flow-value/index.tsx +4 -16
package/dist/index.d.mts
CHANGED
|
@@ -183,7 +183,7 @@ interface IFlowValueExtra {
|
|
|
183
183
|
type FlowValueType = 'constant' | 'ref' | 'expression' | 'template';
|
|
184
184
|
interface IFlowConstantValue {
|
|
185
185
|
type: 'constant';
|
|
186
|
-
content?:
|
|
186
|
+
content?: any;
|
|
187
187
|
schema?: IJsonSchema;
|
|
188
188
|
extra?: IFlowValueExtra;
|
|
189
189
|
}
|
|
@@ -327,7 +327,7 @@ declare function PromptEditorWithVariables(props: PromptEditorPropsType): React$
|
|
|
327
327
|
*/
|
|
328
328
|
|
|
329
329
|
interface PropsType$7 extends PromptEditorPropsType {
|
|
330
|
-
inputsValues:
|
|
330
|
+
inputsValues: any;
|
|
331
331
|
}
|
|
332
332
|
declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType$7): React$1.JSX.Element;
|
|
333
333
|
|
|
@@ -449,10 +449,13 @@ declare function DisplayFlowValue({ value, title, showIconInTree }: PropsType$2)
|
|
|
449
449
|
*/
|
|
450
450
|
|
|
451
451
|
interface PropsType$1 {
|
|
452
|
-
value?:
|
|
452
|
+
value?: any;
|
|
453
453
|
showIconInTree?: boolean;
|
|
454
454
|
}
|
|
455
455
|
declare function DisplayInputsValues({ value, showIconInTree }: PropsType$1): React$1.JSX.Element;
|
|
456
|
+
declare function DisplayInputsValueAllInTag({ value, title, showIconInTree, }: PropsType$1 & {
|
|
457
|
+
title: string;
|
|
458
|
+
}): React$1.JSX.Element;
|
|
456
459
|
|
|
457
460
|
/**
|
|
458
461
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -863,4 +866,26 @@ declare function validateFlowValue(value: IFlowValue | undefined, ctx: Context):
|
|
|
863
866
|
message: string;
|
|
864
867
|
} | undefined;
|
|
865
868
|
|
|
866
|
-
|
|
869
|
+
/**
|
|
870
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
871
|
+
* SPDX-License-Identifier: MIT
|
|
872
|
+
*/
|
|
873
|
+
interface ListItem<ValueType> {
|
|
874
|
+
id: string;
|
|
875
|
+
key?: string;
|
|
876
|
+
value?: ValueType;
|
|
877
|
+
}
|
|
878
|
+
type ObjectType<ValueType> = Record<string, ValueType | undefined>;
|
|
879
|
+
declare function useObjectList<ValueType>({ value, onChange, sortIndexKey, }: {
|
|
880
|
+
value?: ObjectType<ValueType>;
|
|
881
|
+
onChange: (value?: ObjectType<ValueType>) => void;
|
|
882
|
+
sortIndexKey?: string | ((item: ValueType | undefined) => string);
|
|
883
|
+
}): {
|
|
884
|
+
list: ListItem<ValueType>[];
|
|
885
|
+
add: (defaultValue?: ValueType) => void;
|
|
886
|
+
updateKey: (itemId: string, key: string) => void;
|
|
887
|
+
updateValue: (itemId: string, value: ValueType) => void;
|
|
888
|
+
remove: (itemId: string) => void;
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
|
package/dist/index.d.ts
CHANGED
|
@@ -183,7 +183,7 @@ interface IFlowValueExtra {
|
|
|
183
183
|
type FlowValueType = 'constant' | 'ref' | 'expression' | 'template';
|
|
184
184
|
interface IFlowConstantValue {
|
|
185
185
|
type: 'constant';
|
|
186
|
-
content?:
|
|
186
|
+
content?: any;
|
|
187
187
|
schema?: IJsonSchema;
|
|
188
188
|
extra?: IFlowValueExtra;
|
|
189
189
|
}
|
|
@@ -327,7 +327,7 @@ declare function PromptEditorWithVariables(props: PromptEditorPropsType): React$
|
|
|
327
327
|
*/
|
|
328
328
|
|
|
329
329
|
interface PropsType$7 extends PromptEditorPropsType {
|
|
330
|
-
inputsValues:
|
|
330
|
+
inputsValues: any;
|
|
331
331
|
}
|
|
332
332
|
declare function PromptEditorWithInputs({ inputsValues, ...restProps }: PropsType$7): React$1.JSX.Element;
|
|
333
333
|
|
|
@@ -449,10 +449,13 @@ declare function DisplayFlowValue({ value, title, showIconInTree }: PropsType$2)
|
|
|
449
449
|
*/
|
|
450
450
|
|
|
451
451
|
interface PropsType$1 {
|
|
452
|
-
value?:
|
|
452
|
+
value?: any;
|
|
453
453
|
showIconInTree?: boolean;
|
|
454
454
|
}
|
|
455
455
|
declare function DisplayInputsValues({ value, showIconInTree }: PropsType$1): React$1.JSX.Element;
|
|
456
|
+
declare function DisplayInputsValueAllInTag({ value, title, showIconInTree, }: PropsType$1 & {
|
|
457
|
+
title: string;
|
|
458
|
+
}): React$1.JSX.Element;
|
|
456
459
|
|
|
457
460
|
/**
|
|
458
461
|
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
@@ -863,4 +866,26 @@ declare function validateFlowValue(value: IFlowValue | undefined, ctx: Context):
|
|
|
863
866
|
message: string;
|
|
864
867
|
} | undefined;
|
|
865
868
|
|
|
866
|
-
|
|
869
|
+
/**
|
|
870
|
+
* Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
|
|
871
|
+
* SPDX-License-Identifier: MIT
|
|
872
|
+
*/
|
|
873
|
+
interface ListItem<ValueType> {
|
|
874
|
+
id: string;
|
|
875
|
+
key?: string;
|
|
876
|
+
value?: ValueType;
|
|
877
|
+
}
|
|
878
|
+
type ObjectType<ValueType> = Record<string, ValueType | undefined>;
|
|
879
|
+
declare function useObjectList<ValueType>({ value, onChange, sortIndexKey, }: {
|
|
880
|
+
value?: ObjectType<ValueType>;
|
|
881
|
+
onChange: (value?: ObjectType<ValueType>) => void;
|
|
882
|
+
sortIndexKey?: string | ((item: ValueType | undefined) => string);
|
|
883
|
+
}): {
|
|
884
|
+
list: ListItem<ValueType>[];
|
|
885
|
+
add: (defaultValue?: ValueType) => void;
|
|
886
|
+
updateKey: (itemId: string, key: string) => void;
|
|
887
|
+
updateValue: (itemId: string, value: ValueType) => void;
|
|
888
|
+
remove: (itemId: string) => void;
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, PromptEditorWithVariables, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
|