@flowgram.ai/form-materials 0.1.0-alpha.12 → 0.1.0-alpha.14

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 (164) hide show
  1. package/bin/index.ts +4 -29
  2. package/bin/materials.ts +56 -87
  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/chunk-727SU246.js +13 -0
  7. package/dist/esm/chunk-727SU246.js.map +1 -0
  8. package/dist/esm/chunk-DEZUEMUM.js +284 -0
  9. package/dist/esm/chunk-DEZUEMUM.js.map +1 -0
  10. package/dist/esm/chunk-DUOXDOUE.js +477 -0
  11. package/dist/esm/chunk-DUOXDOUE.js.map +1 -0
  12. package/dist/esm/editor-6UMULJYB.js +180 -0
  13. package/dist/esm/editor-6UMULJYB.js.map +1 -0
  14. package/dist/esm/editor-EYOQTGMT.js +282 -0
  15. package/dist/esm/editor-EYOQTGMT.js.map +1 -0
  16. package/dist/esm/editor-OXPGKPF5.js +167 -0
  17. package/dist/esm/editor-OXPGKPF5.js.map +1 -0
  18. package/dist/esm/editor-VO6YAXRC.js +249 -0
  19. package/dist/esm/editor-VO6YAXRC.js.map +1 -0
  20. package/dist/esm/editor-XYLKTB6L.js +365 -0
  21. package/dist/esm/editor-XYLKTB6L.js.map +1 -0
  22. package/dist/esm/index.js +1186 -2456
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/index.d.mts +363 -70
  25. package/dist/index.d.ts +363 -70
  26. package/dist/index.js +4064 -2887
  27. package/dist/index.js.map +1 -1
  28. package/package.json +9 -8
  29. package/src/components/assign-row/index.tsx +4 -4
  30. package/src/components/assign-rows/index.tsx +1 -1
  31. package/src/components/batch-outputs/index.tsx +7 -5
  32. package/src/components/batch-outputs/types.ts +1 -1
  33. package/src/components/batch-variable-selector/index.tsx +1 -1
  34. package/src/components/code-editor/editor.tsx +89 -0
  35. package/src/components/code-editor/index.tsx +5 -89
  36. package/src/components/code-editor/language-features.ts +18 -18
  37. package/src/components/code-editor/theme/dark.ts +49 -30
  38. package/src/components/code-editor/theme/light.ts +56 -32
  39. package/src/components/code-editor-mini/index.tsx +2 -2
  40. package/src/components/condition-row/constants.ts +10 -2
  41. package/src/components/condition-row/hooks/useOp.tsx +13 -9
  42. package/src/components/condition-row/hooks/useRule.ts +8 -4
  43. package/src/components/condition-row/index.tsx +31 -10
  44. package/src/components/condition-row/types.ts +5 -7
  45. package/src/components/constant-input/index.tsx +5 -2
  46. package/src/components/constant-input/types.ts +1 -1
  47. package/src/components/db-condition-row/hooks/use-left.tsx +66 -0
  48. package/src/components/db-condition-row/hooks/use-op.tsx +59 -0
  49. package/src/components/db-condition-row/index.tsx +93 -0
  50. package/src/components/db-condition-row/styles.tsx +43 -0
  51. package/src/components/db-condition-row/types.ts +34 -0
  52. package/src/components/display-flow-value/index.tsx +4 -14
  53. package/src/components/display-inputs-values/index.tsx +46 -7
  54. package/src/components/display-outputs/index.tsx +2 -1
  55. package/src/components/display-schema-tag/index.tsx +3 -2
  56. package/src/components/display-schema-tree/index.tsx +2 -1
  57. package/src/components/dynamic-value-input/hooks.ts +25 -4
  58. package/src/components/dynamic-value-input/index.tsx +33 -20
  59. package/src/components/dynamic-value-input/styles.tsx +14 -4
  60. package/src/components/index.ts +3 -0
  61. package/src/components/inputs-values/index.tsx +21 -8
  62. package/src/components/inputs-values/styles.tsx +1 -1
  63. package/src/components/inputs-values/types.ts +3 -3
  64. package/src/components/inputs-values-tree/hooks/use-child-list.tsx +76 -0
  65. package/src/components/inputs-values-tree/index.tsx +62 -0
  66. package/src/components/inputs-values-tree/row.tsx +177 -0
  67. package/src/components/inputs-values-tree/styles.tsx +128 -0
  68. package/src/components/inputs-values-tree/types.ts +21 -0
  69. package/src/components/json-editor-with-variables/editor.tsx +69 -0
  70. package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +6 -5
  71. package/src/components/json-editor-with-variables/extensions/variable-tree.tsx +1 -1
  72. package/src/components/json-editor-with-variables/index.tsx +5 -58
  73. package/src/components/json-schema-editor/default-value.tsx +12 -108
  74. package/src/components/json-schema-editor/hooks.tsx +63 -93
  75. package/src/components/json-schema-editor/index.tsx +36 -70
  76. package/src/components/json-schema-editor/styles.tsx +12 -84
  77. package/src/components/json-schema-editor/types.ts +0 -1
  78. package/src/components/prompt-editor/editor.tsx +81 -0
  79. package/src/components/prompt-editor/index.tsx +5 -62
  80. package/src/components/prompt-editor/types.tsx +1 -1
  81. package/src/components/prompt-editor-with-inputs/editor.tsx +25 -0
  82. package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +13 -1
  83. package/src/components/prompt-editor-with-inputs/index.tsx +5 -15
  84. package/src/components/prompt-editor-with-inputs/inputs-picker.tsx +34 -17
  85. package/src/components/prompt-editor-with-variables/editor.tsx +22 -0
  86. package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +12 -20
  87. package/src/components/prompt-editor-with-variables/extensions/variable-tree.tsx +14 -2
  88. package/src/components/prompt-editor-with-variables/index.tsx +5 -12
  89. package/src/components/type-selector/index.tsx +21 -9
  90. package/src/components/variable-selector/context.tsx +28 -0
  91. package/src/components/variable-selector/index.tsx +19 -6
  92. package/src/components/variable-selector/use-variable-tree.tsx +4 -4
  93. package/src/effects/auto-rename-ref/index.ts +8 -55
  94. package/src/effects/listen-ref-schema-change/index.ts +1 -1
  95. package/src/effects/listen-ref-value-change/index.ts +1 -1
  96. package/src/effects/provide-batch-input/index.ts +1 -1
  97. package/src/effects/validate-when-variable-sync/index.ts +1 -1
  98. package/src/form-plugins/batch-outputs-plugin/index.ts +1 -1
  99. package/src/form-plugins/infer-assign-plugin/index.ts +2 -2
  100. package/src/form-plugins/infer-inputs-plugin/index.ts +4 -76
  101. package/src/hooks/use-object-list/index.tsx +35 -7
  102. package/src/index.ts +1 -0
  103. package/src/plugins/json-schema-preset/manager.ts +1 -0
  104. package/src/plugins/json-schema-preset/type-definition/array.tsx +3 -1
  105. package/src/plugins/json-schema-preset/type-definition/boolean.tsx +4 -3
  106. package/src/plugins/json-schema-preset/type-definition/date-time.tsx +25 -0
  107. package/src/plugins/json-schema-preset/type-definition/index.tsx +2 -0
  108. package/src/plugins/json-schema-preset/type-definition/integer.tsx +2 -1
  109. package/src/plugins/json-schema-preset/type-definition/number.tsx +2 -1
  110. package/src/plugins/json-schema-preset/type-definition/object.tsx +3 -1
  111. package/src/plugins/json-schema-preset/type-definition/string.tsx +19 -4
  112. package/src/shared/flow-value/index.ts +6 -0
  113. package/src/shared/flow-value/schema.ts +38 -0
  114. package/src/shared/flow-value/utils.ts +201 -0
  115. package/src/shared/format-legacy-refs/index.ts +1 -1
  116. package/src/shared/index.ts +4 -0
  117. package/src/shared/inject-material/README.md +170 -0
  118. package/src/shared/inject-material/README.zh.md +174 -0
  119. package/src/shared/inject-material/index.tsx +87 -0
  120. package/src/shared/lazy-suspense/index.tsx +28 -0
  121. package/src/shared/polyfill-create-root/index.tsx +33 -0
  122. package/src/typings/flow-value/index.ts +3 -1
  123. package/src/validate/validate-flow-value/index.tsx +4 -16
  124. package/src/components/assign-row/config.json +0 -11
  125. package/src/components/assign-rows/config.json +0 -11
  126. package/src/components/batch-outputs/config.json +0 -13
  127. package/src/components/batch-variable-selector/config.json +0 -9
  128. package/src/components/code-editor/config.json +0 -10
  129. package/src/components/code-editor-mini/config.json +0 -7
  130. package/src/components/condition-row/config.json +0 -13
  131. package/src/components/constant-input/config.json +0 -9
  132. package/src/components/display-flow-value/config.json +0 -8
  133. package/src/components/display-inputs-values/config.json +0 -9
  134. package/src/components/display-outputs/config.json +0 -10
  135. package/src/components/display-schema-tag/config.json +0 -10
  136. package/src/components/display-schema-tree/config.json +0 -11
  137. package/src/components/dynamic-value-input/config.json +0 -14
  138. package/src/components/inputs-values/config.json +0 -13
  139. package/src/components/json-editor-with-variables/config.json +0 -13
  140. package/src/components/json-schema-editor/components/blur-input.tsx +0 -27
  141. package/src/components/json-schema-editor/config.json +0 -13
  142. package/src/components/json-schema-editor/utils.ts +0 -29
  143. package/src/components/prompt-editor/config.json +0 -9
  144. package/src/components/prompt-editor-with-inputs/config.json +0 -13
  145. package/src/components/prompt-editor-with-variables/config.json +0 -13
  146. package/src/components/type-selector/config.json +0 -9
  147. package/src/components/variable-selector/config.json +0 -9
  148. package/src/effects/auto-rename-ref/config.json +0 -5
  149. package/src/effects/listen-ref-schema-change/config.json +0 -10
  150. package/src/effects/listen-ref-value-change/config.json +0 -9
  151. package/src/effects/provide-batch-input/config.json +0 -5
  152. package/src/effects/provide-json-schema-outputs/config.json +0 -7
  153. package/src/effects/sync-variable-title/config.json +0 -5
  154. package/src/effects/validate-when-variable-sync/config.json +0 -5
  155. package/src/form-plugins/batch-outputs-plugin/config.json +0 -7
  156. package/src/form-plugins/infer-assign-plugin/config.json +0 -7
  157. package/src/form-plugins/infer-inputs-plugin/config.json +0 -9
  158. package/src/hooks/use-object-list/config.json +0 -8
  159. package/src/plugins/disable-declaration-plugin/config.json +0 -5
  160. package/src/plugins/json-schema-preset/config.json +0 -9
  161. package/src/shared/format-legacy-refs/config.json +0 -5
  162. package/src/typings/flow-value/config.json +0 -7
  163. package/src/validate/validate-flow-value/config.json +0 -7
  164. /package/src/components/{inputs-values/components/blur-input.tsx → blur-input/index.tsx} +0 -0
@@ -1,11 +0,0 @@
1
- {
2
- "name": "display-schema-tree",
3
- "depMaterials": [
4
- "plugins/json-schema-preset"
5
- ],
6
- "depPackages": [
7
- "@douyinfe/semi-ui",
8
- "styled-components",
9
- "@flowgram.ai/json-schema"
10
- ]
11
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "dynamic-value-input",
3
- "depMaterials": [
4
- "flow-value",
5
- "constant-input",
6
- "variable-selector"
7
- ],
8
- "depPackages": [
9
- "@douyinfe/semi-ui",
10
- "@douyinfe/semi-icons",
11
- "styled-components",
12
- "@flowgram.ai/json-schema"
13
- ]
14
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "inputs-values",
3
- "depMaterials": [
4
- "flow-value",
5
- "dynamic-value-input"
6
- ],
7
- "depPackages": [
8
- "@douyinfe/semi-ui",
9
- "@douyinfe/semi-icons",
10
- "styled-components",
11
- "@flowgram.ai/json-schema"
12
- ]
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "json-editor-with-variables",
3
- "depMaterials": [
4
- "variable-selector",
5
- "code-editor"
6
- ],
7
- "depPackages": [
8
- "@coze-editor/editor@0.1.0-alpha.879fbb",
9
- "@codemirror/view",
10
- "styled-components",
11
- "@douyinfe/semi-ui"
12
- ]
13
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
- * SPDX-License-Identifier: MIT
4
- */
5
-
6
- import React, { useEffect, useState } from 'react';
7
-
8
- import Input, { InputProps } from '@douyinfe/semi-ui/lib/es/input';
9
-
10
- export function BlurInput(props: InputProps) {
11
- const [value, setValue] = useState('');
12
-
13
- useEffect(() => {
14
- setValue(props.value as string);
15
- }, [props.value]);
16
-
17
- return (
18
- <Input
19
- {...props}
20
- value={value}
21
- onChange={(value) => {
22
- setValue(value);
23
- }}
24
- onBlur={(e) => props.onChange?.(value, e)}
25
- />
26
- );
27
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "json-schema-editor",
3
- "depMaterials": [
4
- "type-selector",
5
- "constant-inputs"
6
- ],
7
- "depPackages": [
8
- "@douyinfe/semi-ui",
9
- "@douyinfe/semi-icons",
10
- "styled-components",
11
- "@flowgram.ai/json-schema"
12
- ]
13
- }
@@ -1,29 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
- * SPDX-License-Identifier: MIT
4
- */
5
-
6
- /**
7
- * Return the corresponding string description according to the type of the input value.根据输入值的类型返回对应的字符串描述。
8
- * @param value - 需要判断类型的值。The value whose type needs to be judged.
9
- * @returns 返回值的类型字符串 The type string of the return value('string', 'integer', 'number', 'boolean', 'object', 'array', 'other')。
10
- */
11
- export function getValueType(value: any): string {
12
- const type = typeof value;
13
-
14
- if (type === 'string') {
15
- return 'string';
16
- } else if (type === 'number') {
17
- return Number.isInteger(value) ? 'integer' : 'number';
18
- } else if (type === 'boolean') {
19
- return 'boolean';
20
- } else if (type === 'object') {
21
- if (value === null) {
22
- return 'other';
23
- }
24
- return Array.isArray(value) ? 'array' : 'object';
25
- } else {
26
- // undefined, function, symbol, bigint etc.
27
- return 'other';
28
- }
29
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "prompt-editor",
3
- "depMaterials": [],
4
- "depPackages": [
5
- "@coze-editor/editor@0.1.0-alpha.879fbb",
6
- "@codemirror/view",
7
- "styled-components"
8
- ]
9
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "prompt-editor-with-inputs",
3
- "depMaterials": [
4
- "prompt-editor",
5
- "flow-value"
6
- ],
7
- "depPackages": [
8
- "@coze-editor/editor@0.1.0-alpha.879fbb",
9
- "@codemirror/view",
10
- "styled-components",
11
- "@douyinfe/semi-ui"
12
- ]
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "prompt-editor-with-variables",
3
- "depMaterials": [
4
- "variable-selector",
5
- "prompt-editor"
6
- ],
7
- "depPackages": [
8
- "@coze-editor/editor@0.1.0-alpha.879fbb",
9
- "@codemirror/view",
10
- "styled-components",
11
- "@douyinfe/semi-ui"
12
- ]
13
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "type-selector",
3
- "depMaterials": [],
4
- "depPackages": [
5
- "@douyinfe/semi-ui",
6
- "@douyinfe/semi-icons",
7
- "@flowgram.ai/json-schema"
8
- ]
9
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "variable-selector",
3
- "depMaterials": [],
4
- "depPackages": [
5
- "@douyinfe/semi-ui",
6
- "styled-components",
7
- "@flowgram.ai/json-schema"
8
- ]
9
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "auto-rename-ref",
3
- "depMaterials": ["flow-value"],
4
- "depPackages": ["lodash"]
5
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "listen-ref-schema-change",
3
- "depMaterials": [
4
- "flow-value"
5
- ],
6
- "depPackages": [
7
- "lodash",
8
- "@flowgram.ai/json-schema"
9
- ]
10
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "listen-ref-value-change",
3
- "depMaterials": [
4
- "flow-value"
5
- ],
6
- "depPackages": [
7
- "lodash"
8
- ]
9
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "provide-batch-input",
3
- "depMaterials": ["flow-value"],
4
- "depPackages": []
5
- }
@@ -1,7 +0,0 @@
1
- {
2
- "name": "provide-json-schema-outputs",
3
- "depMaterials": [],
4
- "depPackages": [
5
- "@flowgram.ai/json-schema"
6
- ]
7
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "sync-variable-title",
3
- "depMaterials": [],
4
- "depPackages": []
5
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "validate-when-variable-sync",
3
- "depMaterials": [],
4
- "depPackages": []
5
- }
@@ -1,7 +0,0 @@
1
- {
2
- "name": "batch-outputs-plugin",
3
- "depMaterials": [
4
- "flow-value"
5
- ],
6
- "depPackages": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "name": "infer-assign-plugin",
3
- "depMaterials": [
4
- "flow-value"
5
- ],
6
- "depPackages": []
7
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "infer-inputs-plugin",
3
- "depMaterials": [
4
- "flow-value"
5
- ],
6
- "depPackages": [
7
- "@flowgram.ai/json-schema"
8
- ]
9
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "use-object-list",
3
- "depMaterials": [],
4
- "depPackages": [
5
- "lodash",
6
- "nanoid"
7
- ]
8
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "disable-declaration-plugin",
3
- "depMaterials": [],
4
- "depPackages": []
5
- }
@@ -1,9 +0,0 @@
1
- {
2
- "name": "json-schema-preset",
3
- "depMaterials": [
4
- "components/code-editor-mini"
5
- ],
6
- "depPackages": [
7
- "@flowgram.ai/json-schema"
8
- ]
9
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "format-legacy-ref",
3
- "depMaterials": [],
4
- "depPackages": []
5
- }
@@ -1,7 +0,0 @@
1
- {
2
- "name": "flow-value",
3
- "depMaterials": [],
4
- "depPackages": [
5
- "@flowgram.ai/json-schema"
6
- ]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "name": "validate-flow-value",
3
- "depMaterials": [
4
- "flow-value"
5
- ],
6
- "depPackages": []
7
- }