@flowgram.ai/form-materials 0.3.4 → 0.3.5

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 (95) hide show
  1. package/bin/index.ts +5 -19
  2. package/bin/materials.ts +31 -89
  3. package/bin/project.ts +4 -0
  4. package/bin/utils/import.ts +127 -0
  5. package/bin/utils/traverse-file.ts +60 -0
  6. package/dist/esm/index.js +383 -488
  7. package/dist/esm/index.js.map +1 -1
  8. package/dist/index.d.mts +64 -6
  9. package/dist/index.d.ts +64 -6
  10. package/dist/index.js +625 -730
  11. package/dist/index.js.map +1 -1
  12. package/package.json +5 -5
  13. package/src/components/assign-row/index.tsx +4 -4
  14. package/src/components/assign-rows/index.tsx +1 -1
  15. package/src/components/batch-outputs/index.tsx +4 -3
  16. package/src/components/batch-outputs/types.ts +1 -1
  17. package/src/components/batch-variable-selector/index.tsx +1 -1
  18. package/src/components/code-editor-mini/index.tsx +1 -1
  19. package/src/components/condition-row/hooks/useRule.ts +2 -1
  20. package/src/components/condition-row/index.tsx +5 -4
  21. package/src/components/condition-row/types.ts +1 -1
  22. package/src/components/constant-input/index.tsx +5 -2
  23. package/src/components/constant-input/types.ts +1 -1
  24. package/src/components/display-flow-value/index.tsx +2 -2
  25. package/src/components/display-inputs-values/index.tsx +3 -2
  26. package/src/components/display-outputs/index.tsx +2 -1
  27. package/src/components/display-schema-tag/index.tsx +3 -2
  28. package/src/components/display-schema-tree/index.tsx +2 -1
  29. package/src/components/dynamic-value-input/hooks.ts +1 -1
  30. package/src/components/dynamic-value-input/index.tsx +13 -9
  31. package/src/components/inputs-values/index.tsx +7 -5
  32. package/src/components/inputs-values/types.ts +3 -3
  33. package/src/components/json-editor-with-variables/extensions/variable-tree.tsx +1 -1
  34. package/src/components/json-editor-with-variables/index.tsx +2 -1
  35. package/src/components/json-schema-editor/default-value.tsx +11 -105
  36. package/src/components/json-schema-editor/hooks.tsx +53 -94
  37. package/src/components/json-schema-editor/index.tsx +11 -8
  38. package/src/components/json-schema-editor/styles.tsx +0 -29
  39. package/src/components/prompt-editor/types.tsx +1 -1
  40. package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +2 -1
  41. package/src/components/prompt-editor-with-inputs/index.tsx +3 -2
  42. package/src/components/prompt-editor-with-inputs/inputs-picker.tsx +1 -1
  43. package/src/components/prompt-editor-with-variables/extensions/variable-tree.tsx +1 -1
  44. package/src/components/prompt-editor-with-variables/index.tsx +2 -1
  45. package/src/components/type-selector/index.tsx +7 -3
  46. package/src/components/variable-selector/index.tsx +7 -4
  47. package/src/components/variable-selector/use-variable-tree.tsx +1 -1
  48. package/src/effects/auto-rename-ref/index.ts +1 -1
  49. package/src/effects/listen-ref-schema-change/index.ts +1 -1
  50. package/src/effects/listen-ref-value-change/index.ts +1 -1
  51. package/src/effects/provide-batch-input/index.ts +1 -1
  52. package/src/form-plugins/batch-outputs-plugin/index.ts +1 -1
  53. package/src/form-plugins/infer-assign-plugin/index.ts +1 -1
  54. package/src/form-plugins/infer-inputs-plugin/index.ts +1 -1
  55. package/src/shared/index.ts +1 -0
  56. package/src/shared/inject-material/README.md +170 -0
  57. package/src/shared/inject-material/README.zh.md +174 -0
  58. package/src/shared/inject-material/index.tsx +87 -0
  59. package/src/components/assign-row/config.json +0 -11
  60. package/src/components/assign-rows/config.json +0 -11
  61. package/src/components/batch-outputs/config.json +0 -13
  62. package/src/components/batch-variable-selector/config.json +0 -9
  63. package/src/components/code-editor/config.json +0 -10
  64. package/src/components/code-editor-mini/config.json +0 -7
  65. package/src/components/condition-row/config.json +0 -13
  66. package/src/components/constant-input/config.json +0 -9
  67. package/src/components/display-flow-value/config.json +0 -8
  68. package/src/components/display-inputs-values/config.json +0 -9
  69. package/src/components/display-outputs/config.json +0 -10
  70. package/src/components/display-schema-tag/config.json +0 -10
  71. package/src/components/display-schema-tree/config.json +0 -11
  72. package/src/components/dynamic-value-input/config.json +0 -14
  73. package/src/components/inputs-values/config.json +0 -13
  74. package/src/components/json-editor-with-variables/config.json +0 -13
  75. package/src/components/json-schema-editor/config.json +0 -13
  76. package/src/components/json-schema-editor/utils.ts +0 -29
  77. package/src/components/prompt-editor/config.json +0 -9
  78. package/src/components/prompt-editor-with-inputs/config.json +0 -13
  79. package/src/components/prompt-editor-with-variables/config.json +0 -13
  80. package/src/components/type-selector/config.json +0 -9
  81. package/src/components/variable-selector/config.json +0 -9
  82. package/src/effects/auto-rename-ref/config.json +0 -5
  83. package/src/effects/listen-ref-schema-change/config.json +0 -10
  84. package/src/effects/listen-ref-value-change/config.json +0 -9
  85. package/src/effects/provide-batch-input/config.json +0 -5
  86. package/src/effects/provide-json-schema-outputs/config.json +0 -7
  87. package/src/effects/sync-variable-title/config.json +0 -5
  88. package/src/effects/validate-when-variable-sync/config.json +0 -5
  89. package/src/form-plugins/batch-outputs-plugin/config.json +0 -7
  90. package/src/form-plugins/infer-assign-plugin/config.json +0 -7
  91. package/src/form-plugins/infer-inputs-plugin/config.json +0 -9
  92. package/src/hooks/use-object-list/config.json +0 -8
  93. package/src/shared/format-legacy-refs/config.json +0 -5
  94. package/src/typings/flow-value/config.json +0 -7
  95. package/src/validate/validate-flow-value/config.json +0 -7
@@ -3,10 +3,11 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import { useEffect, useMemo, useRef, useState } from 'react';
6
+ import { useEffect, useState } from 'react';
7
7
 
8
- import { omit } from 'lodash';
9
- import { IJsonSchema } from '@flowgram.ai/json-schema';
8
+ import { difference, omit } from 'lodash';
9
+ import { produce } from 'immer';
10
+ import { IJsonSchema, type JsonSchemaTypeManager, useTypeManager } from '@flowgram.ai/json-schema';
10
11
 
11
12
  import { PropertyValueType } from './types';
12
13
 
@@ -15,92 +16,46 @@ function genId() {
15
16
  return _id++;
16
17
  }
17
18
 
18
- function getDrilldownSchema(
19
- value?: PropertyValueType,
20
- path?: (keyof PropertyValueType)[]
21
- ): { schema?: PropertyValueType | null; path?: (keyof PropertyValueType)[] } {
22
- if (!value) {
23
- return {};
24
- }
25
-
26
- if (value.type === 'array' && value.items) {
27
- return getDrilldownSchema(value.items, [...(path || []), 'items']);
28
- }
29
-
30
- return { schema: value, path };
31
- }
32
-
33
19
  export function usePropertiesEdit(
34
20
  value?: PropertyValueType,
35
21
  onChange?: (value: PropertyValueType) => void
36
22
  ) {
37
- // Get drilldown (array.items.items...)
38
- const drilldown = useMemo(() => getDrilldownSchema(value), [value, value?.type, value?.items]);
39
-
40
- const isDrilldownObject = drilldown.schema?.type === 'object';
41
-
42
- // Generate Init Property List
43
- const initPropertyList = useMemo(
44
- () =>
45
- isDrilldownObject
46
- ? Object.entries(drilldown.schema?.properties || {})
47
- .sort(([, a], [, b]) => (a.extra?.index ?? 0) - (b.extra?.index ?? 0))
48
- .map(
49
- ([name, _value], index) =>
50
- ({
51
- key: genId(),
52
- name,
53
- isPropertyRequired: drilldown.schema?.required?.includes(name) || false,
54
- ..._value,
55
- extra: {
56
- ...(_value.extra || {}),
57
- index,
58
- },
59
- } as PropertyValueType)
60
- )
61
- : [],
62
- [isDrilldownObject]
63
- );
64
-
65
- const [propertyList, setPropertyList] = useState<PropertyValueType[]>(initPropertyList);
66
-
67
- const mountRef = useRef(false);
23
+ const typeManager = useTypeManager() as JsonSchemaTypeManager;
24
+
25
+ // Get drilldown properties (array.items.items.properties...)
26
+ const drilldownSchema = typeManager.getPropertiesParent(value || {});
27
+ const canAddField = typeManager.canAddField(value || {});
28
+
29
+ const [propertyList, setPropertyList] = useState<PropertyValueType[]>([]);
68
30
 
69
31
  useEffect(() => {
70
- // If initRef is true, it means the component has been mounted
71
- if (mountRef.current) {
72
- // If the value is changed, update the property list
73
- setPropertyList((_list) => {
74
- const nameMap = new Map<string, PropertyValueType>();
75
-
76
- for (const _property of _list) {
77
- if (_property.name) {
78
- nameMap.set(_property.name, _property);
79
- }
80
- }
81
- return Object.entries(drilldown.schema?.properties || {})
82
- .sort(([, a], [, b]) => (a.extra?.index ?? 0) - (b.extra?.index ?? 0))
83
- .map(([name, _value]) => {
84
- const _property = nameMap.get(name);
85
- if (_property) {
86
- return {
87
- key: _property.key,
88
- name,
89
- isPropertyRequired: drilldown.schema?.required?.includes(name) || false,
90
- ..._value,
91
- };
92
- }
93
- return {
94
- key: genId(),
95
- name,
96
- isPropertyRequired: drilldown.schema?.required?.includes(name) || false,
97
- ..._value,
98
- };
99
- });
100
- });
101
- }
102
- mountRef.current = true;
103
- }, [drilldown.schema]);
32
+ // If the value is changed, update the property list
33
+ setPropertyList((_list) => {
34
+ const newNames = Object.entries(drilldownSchema?.properties || {})
35
+ .sort(([, a], [, b]) => (a.extra?.index ?? 0) - (b.extra?.index ?? 0))
36
+ .map(([key]) => key);
37
+
38
+ const oldNames = _list.map((item) => item.name).filter(Boolean) as string[];
39
+ const addNames = difference(newNames, oldNames);
40
+
41
+ return _list
42
+ .filter((item) => !item.name || newNames.includes(item.name))
43
+ .map((item) => ({
44
+ key: item.key,
45
+ name: item.name,
46
+ isPropertyRequired: drilldownSchema?.required?.includes(item.name || '') || false,
47
+ ...item,
48
+ }))
49
+ .concat(
50
+ addNames.map((_name) => ({
51
+ key: genId(),
52
+ name: _name,
53
+ isPropertyRequired: drilldownSchema?.required?.includes(_name) || false,
54
+ ...(drilldownSchema?.properties?.[_name] || {}),
55
+ }))
56
+ );
57
+ });
58
+ }, [drilldownSchema]);
104
59
 
105
60
  const updatePropertyList = (updater: (list: PropertyValueType[]) => PropertyValueType[]) => {
106
61
  setPropertyList((_list) => {
@@ -122,21 +77,25 @@ export function usePropertiesEdit(
122
77
  }
123
78
  }
124
79
 
125
- let drilldownSchema = value || {};
126
- if (drilldown.path) {
127
- drilldownSchema = drilldown.path.reduce((acc, key) => acc[key], value || {});
128
- }
129
- drilldownSchema.properties = nextProperties;
130
- drilldownSchema.required = nextRequired;
80
+ onChange?.(
81
+ produce(value || {}, (draft) => {
82
+ const propertiesParent = typeManager.getPropertiesParent(draft);
131
83
 
132
- onChange?.(value || {});
84
+ if (propertiesParent) {
85
+ propertiesParent.properties = nextProperties;
86
+ propertiesParent.required = nextRequired;
87
+ return;
88
+ }
89
+ })
90
+ );
133
91
 
134
92
  return next;
135
93
  });
136
94
  };
137
95
 
138
96
  const onAddProperty = () => {
139
- updatePropertyList((_list) => [
97
+ // set property list only, not trigger updatePropertyList
98
+ setPropertyList((_list) => [
140
99
  ..._list,
141
100
  { key: genId(), name: '', type: 'string', extra: { index: _list.length + 1 } },
142
101
  ]);
@@ -153,14 +112,14 @@ export function usePropertiesEdit(
153
112
  };
154
113
 
155
114
  useEffect(() => {
156
- if (!isDrilldownObject) {
115
+ if (!canAddField) {
157
116
  setPropertyList([]);
158
117
  }
159
- }, [isDrilldownObject]);
118
+ }, [canAddField]);
160
119
 
161
120
  return {
162
121
  propertyList,
163
- isDrilldownObject,
122
+ canAddField,
164
123
  onAddProperty,
165
124
  onRemoveProperty,
166
125
  onEditProperty,
@@ -17,7 +17,8 @@ import {
17
17
  IconMinus,
18
18
  } from '@douyinfe/semi-icons';
19
19
 
20
- import { TypeSelector } from '../type-selector';
20
+ import { InjectTypeSelector } from '@/components/type-selector';
21
+
21
22
  import { ConfigType, PropertyValueType } from './types';
22
23
  import {
23
24
  IconAddChildren,
@@ -40,6 +41,8 @@ import { usePropertiesEdit } from './hooks';
40
41
  import { DefaultValue } from './default-value';
41
42
  import { BlurInput } from './components/blur-input';
42
43
 
44
+ const DEFAULT = { type: 'object' };
45
+
43
46
  export function JsonSchemaEditor(props: {
44
47
  value?: IJsonSchema;
45
48
  onChange?: (value: IJsonSchema) => void;
@@ -47,7 +50,7 @@ export function JsonSchemaEditor(props: {
47
50
  className?: string;
48
51
  readonly?: boolean;
49
52
  }) {
50
- const { value = { type: 'object' }, config = {}, onChange: onChangeProps, readonly } = props;
53
+ const { value = DEFAULT, config = {}, onChange: onChangeProps, readonly } = props;
51
54
  const { propertyList, onAddProperty, onRemoveProperty, onEditProperty } = usePropertiesEdit(
52
55
  value,
53
56
  onChangeProps
@@ -79,7 +82,7 @@ export function JsonSchemaEditor(props: {
79
82
  icon={<IconPlus />}
80
83
  onClick={onAddProperty}
81
84
  >
82
- {config?.addButtonText ?? 'Add'}
85
+ {config?.addButtonText ?? I18n.t('Add')}
83
86
  </Button>
84
87
  </UIContainer>
85
88
  );
@@ -121,7 +124,7 @@ function PropertyEdit(props: {
121
124
 
122
125
  const typeSelectorValue = useMemo(() => ({ type, items }), [type, items]);
123
126
 
124
- const { propertyList, isDrilldownObject, onAddProperty, onRemoveProperty, onEditProperty } =
127
+ const { propertyList, canAddField, onAddProperty, onRemoveProperty, onEditProperty } =
125
128
  usePropertiesEdit(value, onChangeProps);
126
129
 
127
130
  const onChange = (key: string, _value: any) => {
@@ -131,7 +134,7 @@ function PropertyEdit(props: {
131
134
  });
132
135
  };
133
136
 
134
- const showCollapse = isDrilldownObject && propertyList.length > 0;
137
+ const showCollapse = canAddField && propertyList.length > 0;
135
138
 
136
139
  return (
137
140
  <>
@@ -169,7 +172,7 @@ function PropertyEdit(props: {
169
172
  />
170
173
  </UIName>
171
174
  <UIType>
172
- <TypeSelector
175
+ <InjectTypeSelector
173
176
  value={typeSelectorValue}
174
177
  readonly={readonly}
175
178
  onChange={(_value) => {
@@ -197,7 +200,7 @@ function PropertyEdit(props: {
197
200
  setExpand((_expand) => !_expand);
198
201
  }}
199
202
  />
200
- {isDrilldownObject && (
203
+ {canAddField && (
201
204
  <IconButton
202
205
  disabled={readonly}
203
206
  size="small"
@@ -230,7 +233,7 @@ function PropertyEdit(props: {
230
233
  config?.descPlaceholder ?? I18n.t('Help LLM to understand the property')
231
234
  }
232
235
  />
233
- {$level === 0 && type && type !== 'array' && (
236
+ {$level === 0 && (
234
237
  <>
235
238
  <UILabel style={{ marginTop: 10 }}>
236
239
  {config?.defaultValueTitle ?? I18n.t('Default Value')}
@@ -200,35 +200,6 @@ export const DefaultValueWrapper = styled.div`
200
200
  margin: 0;
201
201
  `;
202
202
 
203
- export const JSONViewerWrapper = styled.div`
204
- padding: 0 0 24px;
205
- &:first-child {
206
- margin-top: 0px;
207
- }
208
- `;
209
-
210
- export const JSONHeader = styled.div`
211
- display: flex;
212
- justify-content: space-between;
213
- align-items: center;
214
- background-color: var(--semi-color-fill-0);
215
- border-radius: 6px 6px 0 0;
216
- height: 36px;
217
- padding: 0 8px 0 12px;
218
- `;
219
-
220
- export const JSONHeaderLeft = styled.div`
221
- display: flex;
222
- align-items: center;
223
- gap: 10px;
224
- `;
225
-
226
- export const JSONHeaderRight = styled.div`
227
- display: flex;
228
- align-items: center;
229
- gap: 10px;
230
- `;
231
-
232
203
  export const ConstantInputWrapper = styled.div`
233
204
  flex-grow: 1;
234
205
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import React from 'react';
7
7
 
8
- import { IFlowTemplateValue } from '../../typings';
8
+ import { IFlowTemplateValue } from '@/typings';
9
9
 
10
10
  export type PropsType = React.PropsWithChildren<{
11
11
  value?: IFlowTemplateValue;
@@ -15,8 +15,9 @@ import {
15
15
  } from '@coze-editor/editor/react';
16
16
  import { EditorAPI } from '@coze-editor/editor/preset-prompt';
17
17
 
18
+ import { IFlowValue } from '@/typings';
19
+
18
20
  import { InputsPicker } from '../inputs-picker';
19
- import { IFlowValue } from '../../../typings';
20
21
 
21
22
  export function InputsTree({ inputsValues }: { inputsValues: Record<string, IFlowValue> }) {
22
23
  const [posKey, setPosKey] = useState('');
@@ -5,9 +5,10 @@
5
5
 
6
6
  import React from 'react';
7
7
 
8
+ import { IFlowValue } from '@/typings';
9
+ import { PromptEditor, PromptEditorPropsType } from '@/components/prompt-editor';
10
+
8
11
  import { InputsTree } from './extensions/inputs-tree';
9
- import { PromptEditor, PromptEditorPropsType } from '../prompt-editor';
10
- import { IFlowValue } from '../../typings';
11
12
 
12
13
  interface PropsType extends PromptEditorPropsType {
13
14
  inputsValues: Record<string, IFlowValue>;
@@ -16,7 +16,7 @@ import {
16
16
  import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
17
17
  import { Tree } from '@douyinfe/semi-ui';
18
18
 
19
- import { IFlowValue } from '../../typings';
19
+ import { IFlowValue } from '@/typings';
20
20
 
21
21
  type VariableField = BaseVariableField<{ icon?: string | JSX.Element; title?: string }>;
22
22
 
@@ -15,7 +15,7 @@ import {
15
15
  } from '@coze-editor/editor/react';
16
16
  import { EditorAPI } from '@coze-editor/editor/preset-prompt';
17
17
 
18
- import { useVariableTree } from '../../variable-selector';
18
+ import { useVariableTree } from '@/components/variable-selector';
19
19
 
20
20
  export function VariableTree() {
21
21
  const [posKey, setPosKey] = useState('');
@@ -5,9 +5,10 @@
5
5
 
6
6
  import React from 'react';
7
7
 
8
+ import { PromptEditor, PromptEditorPropsType } from '@/components/prompt-editor';
9
+
8
10
  import { VariableTree } from './extensions/variable-tree';
9
11
  import { VariableTagInject } from './extensions/variable-tag';
10
- import { PromptEditor, PromptEditorPropsType } from '../prompt-editor';
11
12
 
12
13
  export function PromptEditorWithVariables(props: PromptEditorPropsType) {
13
14
  return (
@@ -8,9 +8,10 @@ import React, { useMemo } from 'react';
8
8
  import { IJsonSchema } from '@flowgram.ai/json-schema';
9
9
  import { Cascader, Icon, IconButton } from '@douyinfe/semi-ui';
10
10
 
11
- import { useTypeManager } from '../../plugins';
11
+ import { createInjectMaterial } from '@/shared/inject-material';
12
+ import { useTypeManager } from '@/plugins';
12
13
 
13
- interface PropTypes {
14
+ export interface TypeSelectorProps {
14
15
  value?: Partial<IJsonSchema>;
15
16
  onChange?: (value?: Partial<IJsonSchema>) => void;
16
17
  readonly?: boolean;
@@ -41,7 +42,7 @@ export const parseTypeSelectValue = (value?: string[]): Partial<IJsonSchema> | u
41
42
  return { type };
42
43
  };
43
44
 
44
- export function TypeSelector(props: PropTypes) {
45
+ export function TypeSelector(props: TypeSelectorProps) {
45
46
  const { value, onChange, readonly, disabled, style } = props;
46
47
 
47
48
  const selectValue = useMemo(() => getTypeSelectValue(value), [value]);
@@ -101,3 +102,6 @@ export function TypeSelector(props: PropTypes) {
101
102
  />
102
103
  );
103
104
  }
105
+
106
+ TypeSelector.renderKey = 'type-selector-render-key';
107
+ export const InjectTypeSelector = createInjectMaterial(TypeSelector);
@@ -12,10 +12,12 @@ import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
12
12
  import { Popover } from '@douyinfe/semi-ui';
13
13
  import { IconChevronDownStroked, IconIssueStroked } from '@douyinfe/semi-icons';
14
14
 
15
+ import { createInjectMaterial } from '@/shared';
16
+
15
17
  import { useVariableTree } from './use-variable-tree';
16
18
  import { UIPopoverContent, UIRootTitle, UITag, UITreeSelect, UIVarName } from './styles';
17
19
 
18
- interface PropTypes {
20
+ export interface VariableSelectorProps {
19
21
  value?: string[];
20
22
  config?: {
21
23
  placeholder?: string;
@@ -30,8 +32,6 @@ interface PropTypes {
30
32
  triggerRender?: (props: TriggerRenderProps) => React.ReactNode;
31
33
  }
32
34
 
33
- export type VariableSelectorProps = PropTypes;
34
-
35
35
  export { useVariableTree };
36
36
 
37
37
  export const VariableSelector = ({
@@ -44,7 +44,7 @@ export const VariableSelector = ({
44
44
  excludeSchema,
45
45
  hasError,
46
46
  triggerRender,
47
- }: PropTypes) => {
47
+ }: VariableSelectorProps) => {
48
48
  const treeData = useVariableTree({ includeSchema, excludeSchema });
49
49
 
50
50
  const treeValue = useMemo(() => {
@@ -136,3 +136,6 @@ export const VariableSelector = ({
136
136
  </>
137
137
  );
138
138
  };
139
+
140
+ VariableSelector.renderKey = 'variable-selector-render-key';
141
+ export const InjectVariableSelector = createInjectMaterial(VariableSelector);
@@ -10,7 +10,7 @@ import { ASTMatch, BaseVariableField, useAvailableVariables } from '@flowgram.ai
10
10
  import { TreeNodeData } from '@douyinfe/semi-ui/lib/es/tree';
11
11
  import { Icon } from '@douyinfe/semi-ui';
12
12
 
13
- import { useTypeManager } from '../../plugins';
13
+ import { useTypeManager } from '@/plugins';
14
14
 
15
15
  type VariableField = BaseVariableField<{
16
16
  icon?: string | JSX.Element;
@@ -11,7 +11,7 @@ import {
11
11
  VariableFieldKeyRenameService,
12
12
  } from '@flowgram.ai/editor';
13
13
 
14
- import { IFlowRefValue, IFlowTemplateValue } from '../../typings';
14
+ import { IFlowRefValue, IFlowTemplateValue } from '@/typings';
15
15
 
16
16
  /**
17
17
  * Auto rename ref when form item's key is renamed
@@ -13,7 +13,7 @@ import {
13
13
  getNodeScope,
14
14
  } from '@flowgram.ai/editor';
15
15
 
16
- import { IFlowRefValue } from '../../typings';
16
+ import { IFlowRefValue } from '@/typings';
17
17
 
18
18
  /**
19
19
  * Example:
@@ -12,7 +12,7 @@ import {
12
12
  getNodeScope,
13
13
  } from '@flowgram.ai/editor';
14
14
 
15
- import { IFlowRefValue } from '../../typings';
15
+ import { IFlowRefValue } from '@/typings';
16
16
 
17
17
  /**
18
18
  * Example:
@@ -11,7 +11,7 @@ import {
11
11
  getNodeForm,
12
12
  } from '@flowgram.ai/editor';
13
13
 
14
- import { IFlowRefValue } from '../../typings';
14
+ import { IFlowRefValue } from '@/typings';
15
15
 
16
16
  export const provideBatchInputEffect: EffectOptions[] = createEffectFromVariableProvider({
17
17
  private: true,
@@ -17,7 +17,7 @@ import {
17
17
  FlowNodeScopeType,
18
18
  } from '@flowgram.ai/editor';
19
19
 
20
- import { IFlowRefValue } from '../../typings';
20
+ import { IFlowRefValue } from '@/typings';
21
21
 
22
22
  export const provideBatchOutputsEffect: EffectOptions[] = createEffectFromVariableProvider({
23
23
  parse: (value: Record<string, IFlowRefValue>, ctx) => [
@@ -14,7 +14,7 @@ import {
14
14
  getNodeScope,
15
15
  } from '@flowgram.ai/editor';
16
16
 
17
- import { IFlowRefValue, IFlowValue } from '../../typings';
17
+ import { IFlowRefValue, IFlowValue } from '@/typings';
18
18
 
19
19
  type AssignValueType =
20
20
  | {
@@ -12,7 +12,7 @@ import {
12
12
  Scope,
13
13
  } from '@flowgram.ai/editor';
14
14
 
15
- import { IFlowConstantValue, IFlowRefValue, IFlowTemplateValue } from '../../typings';
15
+ import { IFlowConstantValue, IFlowRefValue, IFlowTemplateValue } from '@/typings';
16
16
 
17
17
  interface InputConfig {
18
18
  sourceKey: string;
@@ -4,3 +4,4 @@
4
4
  */
5
5
 
6
6
  export * from './format-legacy-refs';
7
+ export * from './inject-material';