@flowgram.ai/form-materials 0.4.6 → 0.4.8

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 (52) hide show
  1. package/dist/esm/{chunk-6OZSB6PD.js → chunk-727SU246.js} +6 -3
  2. package/dist/esm/chunk-727SU246.js.map +1 -0
  3. package/dist/esm/{chunk-QIJ4QVB2.js → chunk-DEZUEMUM.js} +17 -4
  4. package/dist/esm/chunk-DEZUEMUM.js.map +1 -0
  5. package/dist/esm/{chunk-G4HQ7OSI.js → chunk-IHOHRV5V.js} +67 -30
  6. package/dist/esm/chunk-IHOHRV5V.js.map +1 -0
  7. package/dist/esm/{editor-H2R7JJLO.js → editor-4X7K477H.js} +4 -4
  8. package/dist/esm/editor-4X7K477H.js.map +1 -0
  9. package/dist/esm/{editor-YMNCDGUR.js → editor-OXPGKPF5.js} +4 -4
  10. package/dist/esm/editor-OXPGKPF5.js.map +1 -0
  11. package/dist/esm/{editor-JX42GFAZ.js → editor-Z24WLBPO.js} +5 -5
  12. package/dist/esm/editor-Z24WLBPO.js.map +1 -0
  13. package/dist/esm/index.js +34 -23
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/index.d.mts +21 -3
  16. package/dist/index.d.ts +21 -3
  17. package/dist/index.js +532 -446
  18. package/dist/index.js.map +1 -1
  19. package/package.json +7 -7
  20. package/src/components/code-editor/index.tsx +2 -2
  21. package/src/components/condition-row/constants.ts +8 -0
  22. package/src/components/display-inputs-values/index.tsx +1 -1
  23. package/src/components/dynamic-value-input/hooks.ts +1 -1
  24. package/src/components/inputs-values-tree/hooks/use-child-list.tsx +1 -1
  25. package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +1 -1
  26. package/src/components/json-editor-with-variables/index.tsx +2 -2
  27. package/src/components/json-schema-editor/hooks.tsx +1 -1
  28. package/src/components/prompt-editor/index.tsx +2 -2
  29. package/src/components/prompt-editor-with-inputs/index.tsx +2 -2
  30. package/src/components/prompt-editor-with-inputs/inputs-picker.tsx +1 -1
  31. package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +1 -1
  32. package/src/components/prompt-editor-with-variables/index.tsx +2 -2
  33. package/src/components/variable-selector/context.tsx +28 -0
  34. package/src/components/variable-selector/index.tsx +10 -1
  35. package/src/components/variable-selector/use-variable-tree.tsx +3 -3
  36. package/src/effects/validate-when-variable-sync/index.ts +1 -1
  37. package/src/form-plugins/infer-assign-plugin/index.ts +1 -1
  38. package/src/form-plugins/infer-inputs-plugin/index.ts +1 -1
  39. package/src/hooks/use-object-list/index.tsx +1 -1
  40. package/src/plugins/json-schema-preset/type-definition/date-time.tsx +25 -0
  41. package/src/plugins/json-schema-preset/type-definition/index.tsx +2 -0
  42. package/src/shared/flow-value/utils.ts +1 -1
  43. package/src/shared/format-legacy-refs/index.ts +1 -1
  44. package/src/shared/index.ts +1 -0
  45. package/src/shared/lazy-suspense/index.tsx +28 -0
  46. package/src/validate/validate-flow-value/index.tsx +1 -1
  47. package/dist/esm/chunk-6OZSB6PD.js.map +0 -1
  48. package/dist/esm/chunk-G4HQ7OSI.js.map +0 -1
  49. package/dist/esm/chunk-QIJ4QVB2.js.map +0 -1
  50. package/dist/esm/editor-H2R7JJLO.js.map +0 -1
  51. package/dist/esm/editor-JX42GFAZ.js.map +0 -1
  52. package/dist/esm/editor-YMNCDGUR.js.map +0 -1
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default from 'react';
2
+ import React__default, { ComponentType, lazy } from 'react';
3
3
  import { IJsonSchema, JsonSchemaTypeRegistry as JsonSchemaTypeRegistry$1, JsonSchemaTypeManager } from '@flowgram.ai/json-schema';
4
4
  export { IJsonSchema, JsonSchemaBasicType, JsonSchemaUtils } from '@flowgram.ai/json-schema';
5
5
  import { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
@@ -25,9 +25,19 @@ type VariableField = BaseVariableField<{
25
25
  declare function useVariableTree(params: {
26
26
  includeSchema?: IJsonSchema | IJsonSchema[];
27
27
  excludeSchema?: IJsonSchema | IJsonSchema[];
28
- customSkip?: (variable: VariableField) => boolean;
28
+ skipVariable?: (variable: VariableField) => boolean;
29
29
  }): TreeNodeData[];
30
30
 
31
+ /**
32
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
33
+ * SPDX-License-Identifier: MIT
34
+ */
35
+
36
+ declare const VariableSelectorProvider: ({ children, skipVariable, }: {
37
+ skipVariable?: (variable?: BaseVariableField) => boolean;
38
+ children: React__default.ReactNode;
39
+ }) => React__default.JSX.Element;
40
+
31
41
  /**
32
42
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
33
43
  * SPDX-License-Identifier: MIT
@@ -907,6 +917,14 @@ interface IPolyfillRoot {
907
917
  declare function polyfillCreateRoot(dom: HTMLElement): IPolyfillRoot;
908
918
  declare function unstableSetCreateRoot(createRoot: (dom: HTMLElement) => IPolyfillRoot): void;
909
919
 
920
+ /**
921
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
922
+ * SPDX-License-Identifier: MIT
923
+ */
924
+
925
+ declare function withSuspense<T extends ComponentType<any>>(Component: T, fallback?: React__default.ReactNode): T;
926
+ declare function lazySuspense<T extends ComponentType<any>>(params: Parameters<typeof lazy<T>>[0], fallback?: React__default.ReactNode): React__default.LazyExoticComponent<T>;
927
+
910
928
  /**
911
929
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
912
930
  * SPDX-License-Identifier: MIT
@@ -981,4 +999,4 @@ declare function useObjectList<ValueType>({ value, onChange, sortIndexKey, }: {
981
999
  remove: (itemId: string) => void;
982
1000
  };
983
1001
 
984
- export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, type DBConditionOptionType, DBConditionRow, type DBConditionRowValueType, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, type IPolyfillRoot, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, type JsonEditorWithVariablesProps, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, type PromptEditorWithInputsProps, PromptEditorWithVariables, type PromptEditorWithVariablesProps, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, polyfillCreateRoot, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, unstableSetCreateRoot, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
1002
+ export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, type DBConditionOptionType, DBConditionRow, type DBConditionRowValueType, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, type IPolyfillRoot, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, type JsonEditorWithVariablesProps, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, type PromptEditorWithInputsProps, PromptEditorWithVariables, type PromptEditorWithVariablesProps, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, VariableSelectorProvider, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, lazySuspense, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, polyfillCreateRoot, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, unstableSetCreateRoot, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync, withSuspense };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from 'react';
2
- import React__default from 'react';
2
+ import React__default, { ComponentType, lazy } from 'react';
3
3
  import { IJsonSchema, JsonSchemaTypeRegistry as JsonSchemaTypeRegistry$1, JsonSchemaTypeManager } from '@flowgram.ai/json-schema';
4
4
  export { IJsonSchema, JsonSchemaBasicType, JsonSchemaUtils } from '@flowgram.ai/json-schema';
5
5
  import { TriggerRenderProps } from '@douyinfe/semi-ui/lib/es/treeSelect';
@@ -25,9 +25,19 @@ type VariableField = BaseVariableField<{
25
25
  declare function useVariableTree(params: {
26
26
  includeSchema?: IJsonSchema | IJsonSchema[];
27
27
  excludeSchema?: IJsonSchema | IJsonSchema[];
28
- customSkip?: (variable: VariableField) => boolean;
28
+ skipVariable?: (variable: VariableField) => boolean;
29
29
  }): TreeNodeData[];
30
30
 
31
+ /**
32
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
33
+ * SPDX-License-Identifier: MIT
34
+ */
35
+
36
+ declare const VariableSelectorProvider: ({ children, skipVariable, }: {
37
+ skipVariable?: (variable?: BaseVariableField) => boolean;
38
+ children: React__default.ReactNode;
39
+ }) => React__default.JSX.Element;
40
+
31
41
  /**
32
42
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
33
43
  * SPDX-License-Identifier: MIT
@@ -907,6 +917,14 @@ interface IPolyfillRoot {
907
917
  declare function polyfillCreateRoot(dom: HTMLElement): IPolyfillRoot;
908
918
  declare function unstableSetCreateRoot(createRoot: (dom: HTMLElement) => IPolyfillRoot): void;
909
919
 
920
+ /**
921
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
922
+ * SPDX-License-Identifier: MIT
923
+ */
924
+
925
+ declare function withSuspense<T extends ComponentType<any>>(Component: T, fallback?: React__default.ReactNode): T;
926
+ declare function lazySuspense<T extends ComponentType<any>>(params: Parameters<typeof lazy<T>>[0], fallback?: React__default.ReactNode): React__default.LazyExoticComponent<T>;
927
+
910
928
  /**
911
929
  * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
912
930
  * SPDX-License-Identifier: MIT
@@ -981,4 +999,4 @@ declare function useObjectList<ValueType>({ value, onChange, sortIndexKey, }: {
981
999
  remove: (itemId: string) => void;
982
1000
  };
983
1001
 
984
- export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, type DBConditionOptionType, DBConditionRow, type DBConditionRowValueType, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, type IPolyfillRoot, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, type JsonEditorWithVariablesProps, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, type PromptEditorWithInputsProps, PromptEditorWithVariables, type PromptEditorWithVariablesProps, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, polyfillCreateRoot, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, unstableSetCreateRoot, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync };
1002
+ export { AssignRow, AssignRows, type AssignValueType, BatchOutputs, BatchVariableSelector, BlurInput, CodeEditor, CodeEditorMini, type CodeEditorPropsType, ConditionRow, type ConditionRowValueType, ConstantInput, type Strategy as ConstantInputStrategy, type ConstantRendererProps, type DBConditionOptionType, DBConditionRow, type DBConditionRowValueType, DisplayFlowValue, DisplayInputsValueAllInTag, DisplayInputsValues, DisplayOutputs, DisplaySchemaTag, DisplaySchemaTree, DynamicValueInput, type FlowValueType, FlowValueUtils, type IFlowConstantRefValue, type IFlowConstantValue, type IFlowExpressionValue, type IFlowRefValue, type IFlowTemplateValue, type IFlowValue, type IFlowValueExtra, type IPolyfillRoot, InjectDynamicValueInput, InjectTypeSelector, InjectVariableSelector, InputsValues, InputsValuesTree, JsonEditorWithVariables, type JsonEditorWithVariablesProps, JsonSchemaEditor, JsonSchemaTypePresetProvider, type JsonSchemaTypeRegistry, PromptEditor, type PromptEditorPropsType, PromptEditorWithInputs, type PromptEditorWithInputsProps, PromptEditorWithVariables, type PromptEditorWithVariablesProps, TypeSelector, type TypeSelectorProps, VariableSelector, type VariableSelectorProps, VariableSelectorProvider, autoRenameRefEffect, createBatchOutputsFormPlugin, createDisableDeclarationPlugin, createInferAssignPlugin, createInferInputsPlugin, createInjectMaterial, createTypePresetPlugin, formatLegacyRefOnInit, formatLegacyRefOnSubmit, formatLegacyRefToNewRef, formatNewRefToLegacyRef, getTypeSelectValue, isLegacyFlowRefValueSchema, isNewFlowRefValueSchema, lazySuspense, listenRefSchemaChange, listenRefValueChange, parseTypeSelectValue, polyfillCreateRoot, provideBatchInputEffect, provideBatchOutputsEffect, provideJsonSchemaOutputs, syncVariableTitle, unstableSetCreateRoot, useObjectList, useTypeManager, useVariableTree, validateFlowValue, validateWhenVariableSync, withSuspense };