@flowgram.ai/form-materials 0.1.0-alpha.13 → 0.1.0-alpha.15

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 (477) hide show
  1. package/bin/run.sh +6 -0
  2. package/dist/cjs/components/assign-row/index.js +112 -0
  3. package/dist/cjs/components/assign-row/types.js +18 -0
  4. package/dist/cjs/components/assign-rows/index.js +85 -0
  5. package/dist/cjs/components/batch-outputs/index.js +91 -0
  6. package/dist/cjs/components/batch-outputs/styles.js +60 -0
  7. package/dist/cjs/components/batch-outputs/types.js +18 -0
  8. package/dist/cjs/components/batch-variable-selector/index.js +53 -0
  9. package/dist/cjs/components/blur-input/index.js +64 -0
  10. package/dist/cjs/components/code-editor/editor.js +117 -0
  11. package/dist/cjs/components/code-editor/index.js +57 -0
  12. package/dist/cjs/components/code-editor/init-worker.js +56 -0
  13. package/dist/cjs/components/code-editor/language-features.js +21 -0
  14. package/dist/cjs/components/code-editor/theme/dark.js +188 -0
  15. package/dist/cjs/components/code-editor/theme/index.js +11 -0
  16. package/dist/cjs/components/code-editor/theme/light.js +195 -0
  17. package/dist/cjs/components/code-editor/utils.js +42 -0
  18. package/dist/cjs/components/code-editor-mini/index.js +66 -0
  19. package/dist/cjs/components/condition-row/constants.js +165 -0
  20. package/dist/cjs/components/condition-row/hooks/useOp.js +78 -0
  21. package/dist/cjs/components/condition-row/hooks/useRule.js +68 -0
  22. package/dist/cjs/components/condition-row/index.js +123 -0
  23. package/dist/cjs/components/condition-row/styles.js +77 -0
  24. package/dist/cjs/components/condition-row/types.js +52 -0
  25. package/dist/cjs/components/constant-input/index.js +80 -0
  26. package/dist/cjs/components/constant-input/types.js +18 -0
  27. package/dist/cjs/components/db-condition-row/hooks/use-left.js +86 -0
  28. package/dist/cjs/components/db-condition-row/hooks/use-op.js +79 -0
  29. package/dist/cjs/components/db-condition-row/index.js +115 -0
  30. package/dist/cjs/components/db-condition-row/styles.js +94 -0
  31. package/dist/cjs/components/db-condition-row/types.js +18 -0
  32. package/dist/cjs/components/display-flow-value/index.js +64 -0
  33. package/dist/cjs/components/display-inputs-values/index.js +76 -0
  34. package/dist/cjs/components/display-inputs-values/styles.js +51 -0
  35. package/dist/cjs/components/display-outputs/index.js +72 -0
  36. package/dist/cjs/components/display-outputs/styles.js +51 -0
  37. package/dist/cjs/components/display-schema-tag/index.js +77 -0
  38. package/dist/cjs/components/display-schema-tag/styles.js +71 -0
  39. package/dist/cjs/components/display-schema-tree/index.js +93 -0
  40. package/dist/cjs/components/display-schema-tree/styles.js +135 -0
  41. package/dist/cjs/components/dynamic-value-input/hooks.js +99 -0
  42. package/dist/cjs/components/dynamic-value-input/index.js +174 -0
  43. package/dist/cjs/components/dynamic-value-input/styles.js +107 -0
  44. package/dist/cjs/components/index.js +156 -0
  45. package/dist/cjs/components/inputs-values/index.js +112 -0
  46. package/dist/cjs/components/inputs-values/styles.js +60 -0
  47. package/dist/cjs/components/inputs-values/types.js +18 -0
  48. package/dist/cjs/components/inputs-values-tree/hooks/use-child-list.js +77 -0
  49. package/dist/cjs/components/inputs-values-tree/index.js +87 -0
  50. package/dist/cjs/components/inputs-values-tree/row.js +183 -0
  51. package/dist/cjs/components/inputs-values-tree/styles.js +177 -0
  52. package/dist/cjs/components/inputs-values-tree/types.js +18 -0
  53. package/dist/cjs/components/json-editor-with-variables/editor.js +81 -0
  54. package/dist/cjs/components/json-editor-with-variables/extensions/variable-tag.js +151 -0
  55. package/dist/cjs/components/json-editor-with-variables/extensions/variable-tree.js +97 -0
  56. package/dist/cjs/components/json-editor-with-variables/index.js +57 -0
  57. package/dist/cjs/components/json-editor-with-variables/styles.js +89 -0
  58. package/dist/cjs/components/json-schema-editor/default-value.js +54 -0
  59. package/dist/cjs/components/json-schema-editor/hooks.js +130 -0
  60. package/dist/cjs/components/json-schema-editor/index.js +246 -0
  61. package/dist/cjs/components/json-schema-editor/styles.js +231 -0
  62. package/dist/cjs/components/json-schema-editor/types.js +18 -0
  63. package/dist/cjs/components/prompt-editor/editor.js +99 -0
  64. package/dist/cjs/components/prompt-editor/extensions/jinja.js +73 -0
  65. package/dist/cjs/components/prompt-editor/extensions/language-support.js +48 -0
  66. package/dist/cjs/components/prompt-editor/extensions/markdown.js +81 -0
  67. package/dist/cjs/components/prompt-editor/index.js +57 -0
  68. package/dist/cjs/components/prompt-editor/styles.js +55 -0
  69. package/dist/cjs/components/prompt-editor/types.js +7 -0
  70. package/dist/cjs/components/prompt-editor-with-inputs/editor.js +47 -0
  71. package/dist/cjs/components/prompt-editor-with-inputs/extensions/inputs-tree.js +101 -0
  72. package/dist/cjs/components/prompt-editor-with-inputs/index.js +57 -0
  73. package/dist/cjs/components/prompt-editor-with-inputs/inputs-picker.js +104 -0
  74. package/dist/cjs/components/prompt-editor-with-variables/editor.js +49 -0
  75. package/dist/cjs/components/prompt-editor-with-variables/extensions/variable-tag.js +151 -0
  76. package/dist/cjs/components/prompt-editor-with-variables/extensions/variable-tree.js +103 -0
  77. package/dist/cjs/components/prompt-editor-with-variables/index.js +57 -0
  78. package/dist/cjs/components/prompt-editor-with-variables/styles.js +89 -0
  79. package/dist/cjs/components/type-selector/index.js +139 -0
  80. package/dist/cjs/components/variable-selector/context.js +56 -0
  81. package/dist/cjs/components/variable-selector/index.js +143 -0
  82. package/dist/cjs/components/variable-selector/styles.js +114 -0
  83. package/dist/cjs/components/variable-selector/use-variable-tree.js +100 -0
  84. package/dist/cjs/effects/auto-rename-ref/index.js +98 -0
  85. package/dist/cjs/effects/index.js +60 -0
  86. package/dist/cjs/effects/listen-ref-schema-change/index.js +57 -0
  87. package/dist/cjs/effects/listen-ref-value-change/index.js +54 -0
  88. package/dist/cjs/effects/provide-batch-input/index.js +64 -0
  89. package/dist/cjs/effects/provide-json-schema-outputs/index.js +49 -0
  90. package/dist/cjs/effects/sync-variable-title/index.js +52 -0
  91. package/dist/cjs/effects/validate-when-variable-sync/index.js +49 -0
  92. package/dist/cjs/form-plugins/batch-outputs-plugin/index.js +97 -0
  93. package/dist/cjs/form-plugins/index.js +47 -0
  94. package/dist/cjs/form-plugins/infer-assign-plugin/index.js +72 -0
  95. package/dist/cjs/form-plugins/infer-inputs-plugin/index.js +47 -0
  96. package/dist/cjs/hooks/index.js +36 -0
  97. package/dist/cjs/hooks/use-object-list/index.js +136 -0
  98. package/dist/cjs/index.js +228 -0
  99. package/dist/cjs/plugins/disable-declaration-plugin/create-disable-declaration-plugin.js +51 -0
  100. package/dist/cjs/plugins/disable-declaration-plugin/index.js +36 -0
  101. package/dist/cjs/plugins/index.js +49 -0
  102. package/dist/cjs/plugins/json-schema-preset/create-type-preset-plugin.js +49 -0
  103. package/dist/cjs/plugins/json-schema-preset/index.js +57 -0
  104. package/dist/cjs/plugins/json-schema-preset/manager.js +18 -0
  105. package/dist/cjs/plugins/json-schema-preset/type-definition/array.js +49 -0
  106. package/dist/cjs/plugins/json-schema-preset/type-definition/boolean.js +63 -0
  107. package/dist/cjs/plugins/json-schema-preset/type-definition/date-time.js +52 -0
  108. package/dist/cjs/plugins/json-schema-preset/type-definition/index.js +53 -0
  109. package/dist/cjs/plugins/json-schema-preset/type-definition/integer.js +49 -0
  110. package/dist/cjs/plugins/json-schema-preset/type-definition/number.js +49 -0
  111. package/dist/cjs/plugins/json-schema-preset/type-definition/object.js +49 -0
  112. package/dist/cjs/plugins/json-schema-preset/type-definition/string.js +54 -0
  113. package/dist/cjs/shared/flow-value/index.js +36 -0
  114. package/dist/cjs/shared/flow-value/schema.js +82 -0
  115. package/dist/cjs/shared/flow-value/types.js +18 -0
  116. package/dist/cjs/shared/flow-value/utils.js +142 -0
  117. package/dist/cjs/shared/format-legacy-refs/index.js +99 -0
  118. package/dist/cjs/shared/index.js +73 -0
  119. package/dist/cjs/shared/inject-material/index.js +65 -0
  120. package/dist/cjs/shared/lazy-suspense/index.js +58 -0
  121. package/dist/cjs/shared/polyfill-create-root/index.js +53 -0
  122. package/dist/cjs/validate/index.js +36 -0
  123. package/dist/cjs/validate/validate-flow-value/index.js +63 -0
  124. package/dist/esm/components/assign-row/index.mjs +78 -0
  125. package/dist/esm/components/assign-row/types.mjs +0 -0
  126. package/dist/esm/components/assign-rows/index.mjs +51 -0
  127. package/dist/esm/components/batch-outputs/index.mjs +57 -0
  128. package/dist/esm/components/batch-outputs/styles.mjs +13 -0
  129. package/dist/esm/components/batch-outputs/types.mjs +0 -0
  130. package/dist/esm/components/batch-variable-selector/index.mjs +19 -0
  131. package/dist/esm/components/blur-input/index.mjs +20 -0
  132. package/dist/esm/components/code-editor/editor.mjs +55 -0
  133. package/dist/esm/components/code-editor/index.mjs +5 -0
  134. package/dist/esm/components/code-editor/init-worker.mjs +19 -0
  135. package/dist/esm/components/code-editor/language-features.mjs +15 -0
  136. package/dist/esm/components/code-editor/theme/dark.mjs +154 -0
  137. package/dist/esm/components/code-editor/theme/index.mjs +5 -0
  138. package/dist/esm/components/code-editor/theme/light.mjs +161 -0
  139. package/dist/esm/components/code-editor/utils.mjs +8 -0
  140. package/dist/esm/components/code-editor-mini/index.mjs +22 -0
  141. package/dist/esm/components/condition-row/constants.mjs +128 -0
  142. package/dist/esm/components/condition-row/hooks/useOp.mjs +44 -0
  143. package/dist/esm/components/condition-row/hooks/useRule.mjs +34 -0
  144. package/dist/esm/components/condition-row/index.mjs +89 -0
  145. package/dist/esm/components/condition-row/styles.mjs +21 -0
  146. package/dist/esm/components/condition-row/types.mjs +18 -0
  147. package/dist/esm/components/constant-input/index.mjs +36 -0
  148. package/dist/esm/components/constant-input/types.mjs +0 -0
  149. package/dist/esm/components/db-condition-row/hooks/use-left.mjs +52 -0
  150. package/dist/esm/components/db-condition-row/hooks/use-op.mjs +45 -0
  151. package/dist/esm/components/db-condition-row/index.mjs +81 -0
  152. package/dist/esm/components/db-condition-row/styles.mjs +32 -0
  153. package/dist/esm/components/db-condition-row/types.mjs +0 -0
  154. package/dist/esm/components/display-flow-value/index.mjs +30 -0
  155. package/dist/esm/components/display-inputs-values/index.mjs +39 -0
  156. package/dist/esm/components/display-inputs-values/styles.mjs +7 -0
  157. package/dist/esm/components/display-outputs/index.mjs +38 -0
  158. package/dist/esm/components/display-outputs/styles.mjs +7 -0
  159. package/dist/esm/components/display-schema-tag/index.mjs +33 -0
  160. package/dist/esm/components/display-schema-tag/styles.mjs +21 -0
  161. package/dist/esm/components/display-schema-tree/index.mjs +49 -0
  162. package/dist/esm/components/display-schema-tree/styles.mjs +79 -0
  163. package/dist/esm/components/dynamic-value-input/hooks.mjs +59 -0
  164. package/dist/esm/components/dynamic-value-input/index.mjs +137 -0
  165. package/dist/esm/components/dynamic-value-input/styles.mjs +54 -0
  166. package/dist/esm/components/index.mjs +26 -0
  167. package/dist/esm/components/inputs-values/index.mjs +78 -0
  168. package/dist/esm/components/inputs-values/styles.mjs +13 -0
  169. package/dist/esm/components/inputs-values/types.mjs +0 -0
  170. package/dist/esm/components/inputs-values-tree/hooks/use-child-list.mjs +43 -0
  171. package/dist/esm/components/inputs-values-tree/index.mjs +53 -0
  172. package/dist/esm/components/inputs-values-tree/row.mjs +149 -0
  173. package/dist/esm/components/inputs-values-tree/styles.mjs +105 -0
  174. package/dist/esm/components/inputs-values-tree/types.mjs +0 -0
  175. package/dist/esm/components/json-editor-with-variables/editor.mjs +47 -0
  176. package/dist/esm/components/json-editor-with-variables/extensions/variable-tag.mjs +117 -0
  177. package/dist/esm/components/json-editor-with-variables/extensions/variable-tree.mjs +63 -0
  178. package/dist/esm/components/json-editor-with-variables/index.mjs +5 -0
  179. package/dist/esm/components/json-editor-with-variables/styles.mjs +36 -0
  180. package/dist/esm/components/json-schema-editor/default-value.mjs +20 -0
  181. package/dist/esm/components/json-schema-editor/hooks.mjs +96 -0
  182. package/dist/esm/components/json-schema-editor/index.mjs +212 -0
  183. package/dist/esm/components/json-schema-editor/styles.mjs +138 -0
  184. package/dist/esm/components/json-schema-editor/types.mjs +0 -0
  185. package/dist/esm/components/prompt-editor/editor.mjs +52 -0
  186. package/dist/esm/components/prompt-editor/extensions/jinja.mjs +39 -0
  187. package/dist/esm/components/prompt-editor/extensions/language-support.mjs +14 -0
  188. package/dist/esm/components/prompt-editor/extensions/markdown.mjs +47 -0
  189. package/dist/esm/components/prompt-editor/index.mjs +5 -0
  190. package/dist/esm/components/prompt-editor/styles.mjs +11 -0
  191. package/dist/esm/components/prompt-editor/types.mjs +1 -0
  192. package/dist/esm/components/prompt-editor-with-inputs/editor.mjs +13 -0
  193. package/dist/esm/components/prompt-editor-with-inputs/extensions/inputs-tree.mjs +67 -0
  194. package/dist/esm/components/prompt-editor-with-inputs/index.mjs +5 -0
  195. package/dist/esm/components/prompt-editor-with-inputs/inputs-picker.mjs +70 -0
  196. package/dist/esm/components/prompt-editor-with-variables/editor.mjs +15 -0
  197. package/dist/esm/components/prompt-editor-with-variables/extensions/variable-tag.mjs +117 -0
  198. package/dist/esm/components/prompt-editor-with-variables/extensions/variable-tree.mjs +69 -0
  199. package/dist/esm/components/prompt-editor-with-variables/index.mjs +5 -0
  200. package/dist/esm/components/prompt-editor-with-variables/styles.mjs +36 -0
  201. package/dist/esm/components/type-selector/index.mjs +96 -0
  202. package/dist/esm/components/variable-selector/context.mjs +16 -0
  203. package/dist/esm/components/variable-selector/index.mjs +100 -0
  204. package/dist/esm/components/variable-selector/styles.mjs +58 -0
  205. package/dist/esm/components/variable-selector/use-variable-tree.mjs +66 -0
  206. package/dist/esm/effects/auto-rename-ref/index.mjs +64 -0
  207. package/dist/esm/effects/index.mjs +8 -0
  208. package/dist/esm/effects/listen-ref-schema-change/index.mjs +23 -0
  209. package/dist/esm/effects/listen-ref-value-change/index.mjs +20 -0
  210. package/dist/esm/effects/provide-batch-input/index.mjs +30 -0
  211. package/dist/esm/effects/provide-json-schema-outputs/index.mjs +15 -0
  212. package/dist/esm/effects/sync-variable-title/index.mjs +18 -0
  213. package/dist/esm/effects/validate-when-variable-sync/index.mjs +15 -0
  214. package/dist/esm/form-plugins/batch-outputs-plugin/index.mjs +60 -0
  215. package/dist/esm/form-plugins/index.mjs +4 -0
  216. package/dist/esm/form-plugins/infer-assign-plugin/index.mjs +38 -0
  217. package/dist/esm/form-plugins/infer-inputs-plugin/index.mjs +13 -0
  218. package/dist/esm/hooks/index.mjs +2 -0
  219. package/dist/esm/hooks/use-object-list/index.mjs +102 -0
  220. package/dist/esm/index.mjs +8 -0
  221. package/dist/esm/plugins/disable-declaration-plugin/create-disable-declaration-plugin.mjs +17 -0
  222. package/dist/esm/plugins/disable-declaration-plugin/index.mjs +2 -0
  223. package/dist/esm/plugins/index.mjs +3 -0
  224. package/dist/esm/plugins/json-schema-preset/create-type-preset-plugin.mjs +15 -0
  225. package/dist/esm/plugins/json-schema-preset/index.mjs +14 -0
  226. package/dist/esm/plugins/json-schema-preset/manager.mjs +0 -0
  227. package/dist/esm/plugins/json-schema-preset/type-definition/array.mjs +15 -0
  228. package/dist/esm/plugins/json-schema-preset/type-definition/boolean.mjs +29 -0
  229. package/dist/esm/plugins/json-schema-preset/type-definition/date-time.mjs +18 -0
  230. package/dist/esm/plugins/json-schema-preset/type-definition/index.mjs +19 -0
  231. package/dist/esm/plugins/json-schema-preset/type-definition/integer.mjs +15 -0
  232. package/dist/esm/plugins/json-schema-preset/type-definition/number.mjs +15 -0
  233. package/dist/esm/plugins/json-schema-preset/type-definition/object.mjs +15 -0
  234. package/dist/esm/plugins/json-schema-preset/type-definition/string.mjs +20 -0
  235. package/dist/esm/shared/flow-value/index.mjs +2 -0
  236. package/dist/esm/shared/flow-value/schema.mjs +26 -0
  237. package/dist/esm/shared/flow-value/types.mjs +0 -0
  238. package/dist/esm/shared/flow-value/utils.mjs +108 -0
  239. package/dist/esm/shared/format-legacy-refs/index.mjs +50 -0
  240. package/dist/esm/shared/index.mjs +6 -0
  241. package/dist/esm/shared/inject-material/index.mjs +21 -0
  242. package/dist/esm/shared/lazy-suspense/index.mjs +21 -0
  243. package/dist/esm/shared/polyfill-create-root/index.mjs +16 -0
  244. package/dist/esm/validate/index.mjs +2 -0
  245. package/dist/esm/validate/validate-flow-value/index.mjs +29 -0
  246. package/dist/tsconfig.tsbuildinfo +1 -0
  247. package/dist/types/components/assign-row/index.d.ts +8 -0
  248. package/dist/types/components/assign-row/types.d.ts +20 -0
  249. package/dist/types/components/assign-rows/index.d.ts +11 -0
  250. package/dist/types/components/batch-outputs/index.d.ts +7 -0
  251. package/dist/types/components/batch-outputs/styles.d.ts +6 -0
  252. package/dist/types/components/batch-outputs/types.d.ts +18 -0
  253. package/dist/types/components/batch-variable-selector/index.d.ts +7 -0
  254. package/dist/types/components/blur-input/index.d.ts +7 -0
  255. package/dist/types/components/code-editor/editor.d.ts +23 -0
  256. package/dist/types/components/code-editor/index.d.ts +6 -0
  257. package/{src/validate/index.tsx → dist/types/components/code-editor/init-worker.d.ts} +1 -2
  258. package/{src/typings/index.ts → dist/types/components/code-editor/language-features.d.ts} +1 -2
  259. package/dist/types/components/code-editor/theme/dark.d.ts +6 -0
  260. package/{src/hooks/index.tsx → dist/types/components/code-editor/theme/index.d.ts} +1 -2
  261. package/dist/types/components/code-editor/theme/light.d.ts +6 -0
  262. package/dist/types/components/code-editor/utils.d.ts +5 -0
  263. package/dist/types/components/code-editor-mini/index.d.ts +7 -0
  264. package/dist/types/components/condition-row/constants.d.ts +7 -0
  265. package/dist/types/components/condition-row/hooks/useOp.d.ts +18 -0
  266. package/dist/types/components/condition-row/hooks/useRule.d.ts +9 -0
  267. package/dist/types/components/condition-row/index.d.ts +22 -0
  268. package/dist/types/components/condition-row/styles.d.ts +9 -0
  269. package/dist/types/components/condition-row/types.d.ts +34 -0
  270. package/dist/types/components/constant-input/index.d.ts +8 -0
  271. package/dist/types/components/constant-input/types.d.ts +16 -0
  272. package/dist/types/components/db-condition-row/hooks/use-left.d.ts +18 -0
  273. package/dist/types/components/db-condition-row/hooks/use-op.d.ts +18 -0
  274. package/dist/types/components/db-condition-row/index.d.ts +19 -0
  275. package/dist/types/components/db-condition-row/styles.d.ts +12 -0
  276. package/dist/types/components/db-condition-row/types.d.ts +25 -0
  277. package/dist/types/components/display-flow-value/index.d.ts +15 -0
  278. package/dist/types/components/display-inputs-values/index.d.ts +14 -0
  279. package/dist/types/components/display-inputs-values/styles.d.ts +5 -0
  280. package/dist/types/components/display-outputs/index.d.ts +14 -0
  281. package/dist/types/components/display-outputs/styles.d.ts +5 -0
  282. package/dist/types/components/display-schema-tag/index.d.ts +14 -0
  283. package/dist/types/components/display-schema-tag/styles.d.ts +8 -0
  284. package/dist/types/components/display-schema-tree/index.d.ts +16 -0
  285. package/dist/types/components/display-schema-tree/styles.d.ts +11 -0
  286. package/dist/types/components/dynamic-value-input/hooks.d.ts +28 -0
  287. package/dist/types/components/dynamic-value-input/index.d.ts +27 -0
  288. package/dist/types/components/dynamic-value-input/styles.d.ts +8 -0
  289. package/dist/types/components/index.d.ts +29 -0
  290. package/dist/types/components/inputs-values/index.d.ts +7 -0
  291. package/dist/types/components/inputs-values/styles.d.ts +6 -0
  292. package/dist/types/components/inputs-values/types.d.ts +19 -0
  293. package/dist/types/components/inputs-values-tree/hooks/use-child-list.d.ts +19 -0
  294. package/dist/types/components/inputs-values-tree/index.d.ts +7 -0
  295. package/dist/types/components/inputs-values-tree/row.d.ts +15 -0
  296. package/dist/types/components/inputs-values-tree/styles.d.ts +23 -0
  297. package/dist/types/components/inputs-values-tree/types.d.ts +18 -0
  298. package/dist/types/components/json-editor-with-variables/editor.d.ts +9 -0
  299. package/dist/types/components/json-editor-with-variables/extensions/variable-tag.d.ts +5 -0
  300. package/dist/types/components/json-editor-with-variables/extensions/variable-tree.d.ts +6 -0
  301. package/dist/types/components/json-editor-with-variables/index.d.ts +6 -0
  302. package/dist/types/components/json-editor-with-variables/styles.d.ts +9 -0
  303. package/dist/types/components/json-schema-editor/default-value.d.ts +17 -0
  304. package/dist/types/components/json-schema-editor/hooks.d.ts +12 -0
  305. package/dist/types/components/json-schema-editor/index.d.ts +14 -0
  306. package/dist/types/components/json-schema-editor/styles.d.ts +30 -0
  307. package/dist/types/components/json-schema-editor/types.d.ts +20 -0
  308. package/dist/types/components/prompt-editor/editor.d.ts +15 -0
  309. package/dist/types/components/prompt-editor/extensions/jinja.d.ts +6 -0
  310. package/dist/types/components/prompt-editor/extensions/language-support.d.ts +6 -0
  311. package/dist/types/components/prompt-editor/extensions/markdown.d.ts +6 -0
  312. package/dist/types/components/prompt-editor/index.d.ts +6 -0
  313. package/dist/types/components/prompt-editor/styles.d.ts +7 -0
  314. package/dist/types/components/prompt-editor/types.d.ts +16 -0
  315. package/dist/types/components/prompt-editor-with-inputs/editor.d.ts +10 -0
  316. package/dist/types/components/prompt-editor-with-inputs/extensions/inputs-tree.d.ts +9 -0
  317. package/dist/types/components/prompt-editor-with-inputs/index.d.ts +6 -0
  318. package/dist/types/components/prompt-editor-with-inputs/inputs-picker.d.ts +9 -0
  319. package/dist/types/components/prompt-editor-with-variables/editor.d.ts +9 -0
  320. package/dist/types/components/prompt-editor-with-variables/extensions/variable-tag.d.ts +5 -0
  321. package/dist/types/components/prompt-editor-with-variables/extensions/variable-tree.d.ts +6 -0
  322. package/dist/types/components/prompt-editor-with-variables/index.d.ts +6 -0
  323. package/dist/types/components/prompt-editor-with-variables/styles.d.ts +9 -0
  324. package/dist/types/components/type-selector/index.d.ts +23 -0
  325. package/dist/types/components/variable-selector/context.d.ts +16 -0
  326. package/dist/types/components/variable-selector/index.d.ts +29 -0
  327. package/dist/types/components/variable-selector/styles.d.ts +14 -0
  328. package/dist/types/components/variable-selector/use-variable-tree.d.ts +18 -0
  329. package/dist/types/effects/auto-rename-ref/index.d.ts +17 -0
  330. package/dist/types/effects/index.d.ts +11 -0
  331. package/dist/types/effects/listen-ref-schema-change/index.d.ts +22 -0
  332. package/dist/types/effects/listen-ref-value-change/index.d.ts +22 -0
  333. package/dist/types/effects/provide-batch-input/index.d.ts +6 -0
  334. package/dist/types/effects/provide-json-schema-outputs/index.d.ts +6 -0
  335. package/dist/types/effects/sync-variable-title/index.d.ts +6 -0
  336. package/dist/types/effects/validate-when-variable-sync/index.d.ts +8 -0
  337. package/dist/types/form-plugins/batch-outputs-plugin/index.d.ts +12 -0
  338. package/dist/types/form-plugins/index.d.ts +7 -0
  339. package/dist/types/form-plugins/infer-assign-plugin/index.d.ts +10 -0
  340. package/dist/types/form-plugins/infer-inputs-plugin/index.d.ts +11 -0
  341. package/dist/types/hooks/index.d.ts +5 -0
  342. package/dist/types/hooks/use-object-list/index.d.ts +22 -0
  343. package/dist/types/index.d.ts +11 -0
  344. package/dist/types/plugins/disable-declaration-plugin/create-disable-declaration-plugin.d.ts +5 -0
  345. package/dist/types/plugins/disable-declaration-plugin/index.d.ts +5 -0
  346. package/dist/types/plugins/index.d.ts +6 -0
  347. package/dist/types/plugins/json-schema-preset/create-type-preset-plugin.d.ts +9 -0
  348. package/dist/types/plugins/json-schema-preset/index.d.ts +13 -0
  349. package/dist/types/plugins/json-schema-preset/manager.d.ts +17 -0
  350. package/dist/types/plugins/json-schema-preset/type-definition/array.d.ts +6 -0
  351. package/dist/types/plugins/json-schema-preset/type-definition/boolean.d.ts +6 -0
  352. package/dist/types/plugins/json-schema-preset/type-definition/date-time.d.ts +6 -0
  353. package/dist/types/plugins/json-schema-preset/type-definition/index.d.ts +5 -0
  354. package/dist/types/plugins/json-schema-preset/type-definition/integer.d.ts +6 -0
  355. package/dist/types/plugins/json-schema-preset/type-definition/number.d.ts +6 -0
  356. package/dist/types/plugins/json-schema-preset/type-definition/object.d.ts +6 -0
  357. package/dist/types/plugins/json-schema-preset/type-definition/string.d.ts +6 -0
  358. package/dist/types/shared/flow-value/index.d.ts +6 -0
  359. package/dist/types/shared/flow-value/schema.d.ts +107 -0
  360. package/dist/types/shared/flow-value/types.d.ts +32 -0
  361. package/dist/types/shared/flow-value/utils.d.ts +65 -0
  362. package/dist/types/shared/format-legacy-refs/index.d.ts +84 -0
  363. package/dist/types/shared/index.d.ts +9 -0
  364. package/dist/types/shared/inject-material/index.d.ts +46 -0
  365. package/dist/types/shared/lazy-suspense/index.d.ts +7 -0
  366. package/dist/types/shared/polyfill-create-root/index.d.ts +10 -0
  367. package/dist/types/validate/index.d.ts +5 -0
  368. package/dist/types/validate/validate-flow-value/index.d.ts +19 -0
  369. package/package.json +22 -23
  370. package/src/components/assign-row/index.tsx +3 -3
  371. package/src/components/assign-row/types.ts +1 -1
  372. package/src/components/batch-outputs/index.tsx +3 -2
  373. package/src/components/batch-outputs/types.ts +1 -1
  374. package/src/components/code-editor/editor.tsx +97 -0
  375. package/src/components/code-editor/index.tsx +5 -89
  376. package/src/components/code-editor/init-worker.ts +27 -0
  377. package/src/components/code-editor/language-features.ts +6 -27
  378. package/src/components/code-editor/theme/dark.ts +50 -31
  379. package/src/components/code-editor/theme/index.ts +1 -1
  380. package/src/components/code-editor/theme/light.ts +57 -33
  381. package/src/components/code-editor-mini/index.tsx +2 -2
  382. package/src/components/condition-row/constants.ts +8 -0
  383. package/src/components/condition-row/hooks/useRule.ts +1 -1
  384. package/src/components/condition-row/index.tsx +4 -0
  385. package/src/components/condition-row/types.ts +1 -1
  386. package/src/components/constant-input/index.tsx +1 -1
  387. package/src/components/db-condition-row/hooks/use-left.tsx +66 -0
  388. package/src/components/db-condition-row/hooks/use-op.tsx +59 -0
  389. package/src/components/db-condition-row/index.tsx +93 -0
  390. package/src/components/db-condition-row/styles.tsx +43 -0
  391. package/src/components/db-condition-row/types.ts +34 -0
  392. package/src/components/display-flow-value/index.tsx +3 -13
  393. package/src/components/display-inputs-values/index.tsx +44 -6
  394. package/src/components/dynamic-value-input/hooks.ts +25 -4
  395. package/src/components/dynamic-value-input/index.tsx +21 -12
  396. package/src/components/dynamic-value-input/styles.tsx +14 -4
  397. package/src/components/index.ts +50 -22
  398. package/src/components/inputs-values/index.tsx +15 -4
  399. package/src/components/inputs-values/styles.tsx +1 -1
  400. package/src/components/inputs-values/types.ts +1 -1
  401. package/src/components/inputs-values-tree/hooks/use-child-list.tsx +76 -0
  402. package/src/components/inputs-values-tree/index.tsx +62 -0
  403. package/src/components/inputs-values-tree/row.tsx +177 -0
  404. package/src/components/inputs-values-tree/styles.tsx +128 -0
  405. package/src/components/inputs-values-tree/types.ts +21 -0
  406. package/src/components/json-editor-with-variables/editor.tsx +69 -0
  407. package/src/components/json-editor-with-variables/extensions/variable-tag.tsx +7 -6
  408. package/src/components/json-editor-with-variables/extensions/variable-tree.tsx +3 -3
  409. package/src/components/json-editor-with-variables/index.tsx +5 -59
  410. package/src/components/json-schema-editor/default-value.tsx +1 -3
  411. package/src/components/json-schema-editor/hooks.tsx +14 -3
  412. package/src/components/json-schema-editor/index.tsx +18 -58
  413. package/src/components/json-schema-editor/styles.tsx +12 -55
  414. package/src/components/json-schema-editor/types.ts +0 -1
  415. package/src/components/prompt-editor/editor.tsx +81 -0
  416. package/src/components/prompt-editor/extensions/jinja.tsx +2 -2
  417. package/src/components/prompt-editor/extensions/language-support.tsx +2 -2
  418. package/src/components/prompt-editor/extensions/markdown.tsx +2 -2
  419. package/src/components/prompt-editor/index.tsx +5 -62
  420. package/src/components/prompt-editor/types.tsx +1 -1
  421. package/src/components/prompt-editor-with-inputs/editor.tsx +25 -0
  422. package/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx +15 -4
  423. package/src/components/prompt-editor-with-inputs/index.tsx +5 -16
  424. package/src/components/prompt-editor-with-inputs/inputs-picker.tsx +34 -17
  425. package/src/components/prompt-editor-with-variables/editor.tsx +22 -0
  426. package/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx +13 -21
  427. package/src/components/prompt-editor-with-variables/extensions/variable-tree.tsx +16 -4
  428. package/src/components/prompt-editor-with-variables/index.tsx +5 -13
  429. package/src/components/type-selector/index.tsx +12 -2
  430. package/src/components/variable-selector/context.tsx +28 -0
  431. package/src/components/variable-selector/index.tsx +10 -1
  432. package/src/components/variable-selector/use-variable-tree.tsx +3 -3
  433. package/src/effects/auto-rename-ref/index.ts +8 -55
  434. package/src/effects/index.ts +7 -7
  435. package/src/effects/listen-ref-schema-change/index.ts +1 -1
  436. package/src/effects/listen-ref-value-change/index.ts +1 -1
  437. package/src/effects/provide-batch-input/index.ts +1 -1
  438. package/src/effects/validate-when-variable-sync/index.ts +1 -1
  439. package/src/form-plugins/batch-outputs-plugin/index.ts +1 -1
  440. package/src/form-plugins/index.ts +3 -3
  441. package/src/form-plugins/infer-assign-plugin/index.ts +2 -2
  442. package/src/form-plugins/infer-inputs-plugin/index.ts +4 -76
  443. package/src/hooks/index.ts +6 -0
  444. package/src/hooks/use-object-list/index.tsx +35 -7
  445. package/src/index.ts +98 -7
  446. package/src/plugins/index.ts +11 -2
  447. package/src/plugins/json-schema-preset/index.tsx +4 -4
  448. package/src/plugins/json-schema-preset/manager.ts +1 -0
  449. package/src/plugins/json-schema-preset/type-definition/date-time.tsx +25 -0
  450. package/src/plugins/json-schema-preset/type-definition/index.tsx +2 -0
  451. package/src/plugins/json-schema-preset/type-definition/string.tsx +18 -9
  452. package/src/shared/flow-value/index.ts +16 -0
  453. package/src/shared/flow-value/schema.ts +38 -0
  454. package/src/{typings/flow-value/index.ts → shared/flow-value/types.ts} +3 -1
  455. package/src/shared/flow-value/utils.ts +200 -0
  456. package/src/shared/format-legacy-refs/index.ts +1 -1
  457. package/src/shared/index.ts +26 -2
  458. package/src/shared/lazy-suspense/index.tsx +28 -0
  459. package/src/shared/polyfill-create-root/index.tsx +33 -0
  460. package/src/validate/index.ts +6 -0
  461. package/src/validate/validate-flow-value/index.tsx +4 -16
  462. package/bin/index.ts +0 -91
  463. package/bin/materials.ts +0 -107
  464. package/bin/project.ts +0 -95
  465. package/bin/utils/import.ts +0 -127
  466. package/bin/utils/traverse-file.ts +0 -60
  467. package/dist/esm/index.js +0 -3864
  468. package/dist/esm/index.js.map +0 -1
  469. package/dist/index.d.mts +0 -763
  470. package/dist/index.d.ts +0 -763
  471. package/dist/index.js +0 -3849
  472. package/dist/index.js.map +0 -1
  473. package/src/components/inputs-values/components/blur-input.tsx +0 -27
  474. package/src/components/json-schema-editor/components/blur-input.tsx +0 -27
  475. package/src/plugins/disable-declaration-plugin/config.json +0 -5
  476. package/src/plugins/json-schema-preset/config.json +0 -9
  477. /package/src/components/{assign-row/components/blur-input.tsx → blur-input/index.tsx} +0 -0
@@ -3,59 +3,60 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import { createTheme, tags as t } from '@coze-editor/editor/preset-code';
6
+ import { createTheme, tags as t } from '@flowgram.ai/coze-editor/preset-code';
7
7
  import { type Extension } from '@codemirror/state';
8
8
 
9
9
  const colors = {
10
- background: '#F7F7FC',
11
- // syntax
12
- comment: '#000A298A',
13
- key: '#00818C',
14
- string: '#D1009D',
15
- number: '#C74200',
16
- boolean: '#2B57D9',
17
- null: '#2B57D9',
18
- separator: '#0F1529D1',
10
+ background: '#FFFFFF',
11
+ comment: '#6B7280',
12
+ key: '#2563EB',
13
+ variable: '#DC2626',
14
+ string: '#059669',
15
+ number: '#EA580C',
16
+ boolean: '#7C3AED',
17
+ null: '#7C3AED',
18
+ separator: '#374151',
19
19
  };
20
20
 
21
21
  export const lightTheme: Extension = createTheme({
22
22
  variant: 'light',
23
23
  settings: {
24
- background: '#fff',
25
- foreground: '#000',
26
- caret: '#000',
27
- selection: '#d9d9d9',
28
- gutterBackground: '#f0f0f0',
29
- gutterForeground: '#666',
24
+ background: '#FFFFFF',
25
+ foreground: '#1F2937',
26
+ caret: '#2563EB',
27
+ selection: '#E5E7EB',
28
+ gutterBackground: '#F9FAFB',
29
+ gutterForeground: '#6B7280',
30
30
  gutterBorderColor: 'transparent',
31
31
  gutterBorderWidth: 0,
32
- lineHighlight: '#e1e1e180',
33
- bracketColors: ['#FFD700', '#DD99FF', '#78B0FF'],
32
+ lineHighlight: '#F3F4F680',
33
+ bracketColors: ['#F59E0B', '#8B5CF6', '#06B6D4'],
34
34
  tooltip: {
35
- backgroundColor: '#f0f0f0',
36
- color: '#000',
37
- border: '1px solid #ccc',
35
+ backgroundColor: '#FFFFFF',
36
+ color: '#1F2937',
37
+ border: '1px solid #E5E7EB',
38
+ boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
38
39
  },
39
40
  link: {
40
- color: '#007bff',
41
+ color: '#2563EB',
41
42
  },
42
43
  completionItemHover: {
43
- backgroundColor: '#f0f0f0',
44
+ backgroundColor: '#F3F4F6',
44
45
  },
45
46
  completionItemSelected: {
46
- backgroundColor: '#e0e0e0',
47
+ backgroundColor: '#E5E7EB',
47
48
  },
48
49
  completionItemIcon: {
49
- color: '#333',
50
+ color: '#4B5563',
50
51
  },
51
52
  completionItemLabel: {
52
- color: '#333',
53
+ color: '#1F2937',
53
54
  },
54
55
  completionItemInfo: {
55
- color: '#333',
56
+ color: '#4B5563',
56
57
  },
57
58
  completionItemDetail: {
58
- color: '#666',
59
+ color: '#6B7280',
59
60
  },
60
61
  },
61
62
  styles: [
@@ -68,6 +69,11 @@ export const lightTheme: Extension = createTheme({
68
69
  tag: [t.propertyName],
69
70
  color: colors.key,
70
71
  },
72
+ {
73
+ tag: [t.variableName],
74
+ color: colors.variable,
75
+ },
76
+
71
77
  {
72
78
  tag: [t.string],
73
79
  color: colors.string,
@@ -92,28 +98,46 @@ export const lightTheme: Extension = createTheme({
92
98
  // markdown
93
99
  {
94
100
  tag: [t.heading],
95
- color: '#3e76ef',
101
+ color: '#2563EB',
96
102
  },
97
103
  {
98
104
  tag: [t.processingInstruction],
99
- color: '#3e76ef',
105
+ color: '#2563EB',
106
+ },
107
+
108
+ // js
109
+ {
110
+ tag: [t.definitionKeyword],
111
+ color: '#9333EA',
112
+ },
113
+ {
114
+ tag: [t.modifier],
115
+ color: '#9333EA',
116
+ },
117
+ {
118
+ tag: [t.controlKeyword],
119
+ color: '#9333EA',
120
+ },
121
+ {
122
+ tag: [t.operatorKeyword],
123
+ color: '#9333EA',
100
124
  },
101
125
 
102
126
  // shell
103
127
  // curl
104
128
  {
105
129
  tag: [t.standard(t.variableName)],
106
- color: '#00804A',
130
+ color: '#059669',
107
131
  },
108
132
  // -X
109
133
  {
110
134
  tag: [t.attributeName],
111
- color: '#C74200',
135
+ color: '#EA580C',
112
136
  },
113
137
  // url in string (includes quotes), e.g. "https://..."
114
138
  {
115
139
  tag: [t.special(t.string)],
116
- color: '#2B57D9',
140
+ color: '#2563EB',
117
141
  },
118
142
  ],
119
143
  });
@@ -7,11 +7,10 @@ import React from 'react';
7
7
 
8
8
  import styled from 'styled-components';
9
9
 
10
- import { CodeEditor, CodeEditorPropsType } from '@/components/code-editor';
10
+ import { CodeEditor, type CodeEditorPropsType } from '@/components/code-editor';
11
11
 
12
12
  const UIMini = styled.div`
13
13
  .ͼ1 .cm-content {
14
- padding: 0;
15
14
  }
16
15
  `;
17
16
 
@@ -23,6 +22,7 @@ export function CodeEditorMini(props: CodeEditorPropsType) {
23
22
  options={{
24
23
  lineNumbersGutter: false,
25
24
  foldGutter: false,
25
+ minHeight: 24,
26
26
  ...(props.options || {}),
27
27
  }}
28
28
  />
@@ -60,6 +60,14 @@ export const defaultRules: IRules = {
60
60
  [Op.IS_EMPTY]: null,
61
61
  [Op.IS_NOT_EMPTY]: null,
62
62
  },
63
+ ['date-time']: {
64
+ [Op.EQ]: 'date-time',
65
+ [Op.NEQ]: 'date-time',
66
+ [Op.GT]: 'date-time',
67
+ [Op.GTE]: 'date-time',
68
+ [Op.LT]: 'date-time',
69
+ [Op.LTE]: 'date-time',
70
+ },
63
71
  };
64
72
 
65
73
  export const defaultOpConfigs: OpConfigs = {
@@ -8,7 +8,7 @@ import { useMemo } from 'react';
8
8
  import { JsonSchemaUtils, JsonSchemaBasicType } from '@flowgram.ai/json-schema';
9
9
  import { useScopeAvailable } from '@flowgram.ai/editor';
10
10
 
11
- import { IFlowRefValue } from '@/typings';
11
+ import { IFlowRefValue } from '@/shared';
12
12
 
13
13
  import { IRules } from '../types';
14
14
  import { defaultRules } from '../constants';
@@ -15,6 +15,7 @@ import { ConditionRowValueType, IRules, OpConfigs } from './types';
15
15
  import { UIContainer, UILeft, UIOperator, UIRight, UIValues } from './styles';
16
16
  import { useRule } from './hooks/useRule';
17
17
  import { useOp } from './hooks/useOp';
18
+ import { defaultOpConfigs, defaultRules } from './constants';
18
19
 
19
20
  interface PropTypes {
20
21
  value?: ConditionRowValueType;
@@ -96,4 +97,7 @@ export function ConditionRow({
96
97
  );
97
98
  }
98
99
 
100
+ ConditionRow.defaultRules = defaultRules;
101
+ ConditionRow.defaultOpConfigs = defaultOpConfigs;
102
+
99
103
  export { type ConditionRowValueType };
@@ -3,7 +3,7 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import { IFlowConstantRefValue, IFlowRefValue } from '@/typings';
6
+ import { IFlowConstantRefValue, IFlowRefValue } from '@/shared';
7
7
 
8
8
  export enum Op {
9
9
  EQ = 'eq',
@@ -12,7 +12,7 @@ import { useTypeManager } from '@/plugins';
12
12
 
13
13
  import { PropsType, Strategy as ConstantInputStrategy } from './types';
14
14
 
15
- export { ConstantInputStrategy };
15
+ export { type ConstantInputStrategy };
16
16
 
17
17
  export function ConstantInput(props: PropsType) {
18
18
  const { value, onChange, schema, strategies, fallbackRenderer, readonly, ...rest } = props;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { useMemo } from 'react';
7
+ import React from 'react';
8
+
9
+ import { JsonSchemaTypeManager, useTypeManager } from '@flowgram.ai/json-schema';
10
+ import { Icon } from '@douyinfe/semi-ui';
11
+
12
+ import { ConditionRow } from '@/components';
13
+
14
+ import { DBConditionOptionType, IRules } from '../types';
15
+ import { UIOptionLabel, UISelect } from '../styles';
16
+
17
+ const defaultRules = ConditionRow.defaultRules;
18
+
19
+ interface HookParams {
20
+ left?: string;
21
+ options?: DBConditionOptionType[];
22
+ userRules?: IRules;
23
+ readonly?: boolean;
24
+ onChange: (leftKey: string) => void;
25
+ }
26
+
27
+ export function useLeft({ left, options, userRules, readonly, onChange }: HookParams) {
28
+ const rules = useMemo(() => ({ ...defaultRules, ...(userRules || {}) }), [userRules]);
29
+
30
+ const typeManager = useTypeManager() as JsonSchemaTypeManager;
31
+
32
+ const rule = useMemo(() => {
33
+ if (!left) return undefined;
34
+
35
+ const option = options?.find((item) => item.value === left);
36
+
37
+ if (!option?.schema?.type) {
38
+ return undefined;
39
+ }
40
+
41
+ return rules[option.schema.type];
42
+ }, [left, options, rules]);
43
+
44
+ const renderDBOptionSelect = () => (
45
+ <UISelect
46
+ disabled={readonly}
47
+ size="small"
48
+ style={{ width: '100%' }}
49
+ value={left}
50
+ onChange={(v) => onChange(v as string)}
51
+ optionList={
52
+ options?.map((item) => ({
53
+ label: (
54
+ <UIOptionLabel>
55
+ <Icon size="small" svg={typeManager.getDisplayIcon(item.schema)} />
56
+ {item.label}
57
+ </UIOptionLabel>
58
+ ),
59
+ value: item.value,
60
+ })) || []
61
+ }
62
+ />
63
+ );
64
+
65
+ return { rule, renderDBOptionSelect };
66
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import React, { useMemo } from 'react';
7
+
8
+ import { I18n } from '@flowgram.ai/editor';
9
+ import { Button, Select } from '@douyinfe/semi-ui';
10
+ import { IconChevronDownStroked } from '@douyinfe/semi-icons';
11
+
12
+ import { ConditionRow } from '@/components';
13
+
14
+ import { IRule, OpConfigs } from '../types';
15
+
16
+ const defaultOpConfigs = ConditionRow.defaultOpConfigs;
17
+
18
+ interface HookParams {
19
+ rule?: IRule;
20
+ op?: string;
21
+ onChange: (op: string) => void;
22
+ readonly?: boolean;
23
+ userOps?: OpConfigs;
24
+ }
25
+
26
+ export function useOp({ rule, op, onChange, readonly, userOps }: HookParams) {
27
+ const options = useMemo(
28
+ () =>
29
+ Object.keys(rule || {}).map((_op) => ({
30
+ ...(defaultOpConfigs[_op] || {}),
31
+ ...(userOps?.[_op] || {}),
32
+ value: _op,
33
+ label: I18n.t(userOps?.[_op]?.label || defaultOpConfigs[_op]?.label),
34
+ })),
35
+ [rule, userOps]
36
+ );
37
+
38
+ const opConfig = useMemo(() => defaultOpConfigs[op as string], [op]);
39
+
40
+ const renderOpSelect = () => (
41
+ <Select
42
+ style={{ height: 22 }}
43
+ disabled={readonly}
44
+ size="small"
45
+ value={op}
46
+ optionList={options}
47
+ onChange={(v) => {
48
+ onChange(v as string);
49
+ }}
50
+ triggerRender={({ value }) => (
51
+ <Button size="small" disabled={!rule}>
52
+ {opConfig?.abbreviation || <IconChevronDownStroked size="small" />}
53
+ </Button>
54
+ )}
55
+ />
56
+ );
57
+
58
+ return { renderOpSelect, opConfig };
59
+ }
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import React, { useMemo } from 'react';
7
+
8
+ import { I18n } from '@flowgram.ai/editor';
9
+ import { Input } from '@douyinfe/semi-ui';
10
+
11
+ import { InjectDynamicValueInput } from '@/components/dynamic-value-input';
12
+
13
+ import { DBConditionOptionType, DBConditionRowValueType, IRules, OpConfigs } from './types';
14
+ import { UIContainer, UILeft, UIOperator, UIRight, UIValues } from './styles';
15
+ import { useOp } from './hooks/use-op';
16
+ import { useLeft } from './hooks/use-left';
17
+
18
+ interface PropTypes {
19
+ value?: DBConditionRowValueType;
20
+ onChange: (value?: DBConditionRowValueType) => void;
21
+ style?: React.CSSProperties;
22
+ options?: DBConditionOptionType[];
23
+ readonly?: boolean;
24
+ ruleConfig?: {
25
+ ops?: OpConfigs;
26
+ rules?: IRules;
27
+ };
28
+ }
29
+
30
+ const defaultRuleConfig = {
31
+ ops: {},
32
+ rules: {},
33
+ };
34
+
35
+ export function DBConditionRow({
36
+ style,
37
+ value,
38
+ onChange,
39
+ readonly,
40
+ options,
41
+ ruleConfig = defaultRuleConfig,
42
+ }: PropTypes) {
43
+ const { left, operator, right } = value || {};
44
+
45
+ const { rule, renderDBOptionSelect } = useLeft({
46
+ left,
47
+ options,
48
+ onChange: (leftKey) => onChange({ ...value, left: leftKey }),
49
+ readonly,
50
+ userRules: ruleConfig.rules,
51
+ });
52
+
53
+ const { renderOpSelect, opConfig } = useOp({
54
+ rule,
55
+ op: operator,
56
+ onChange: (v) => onChange({ ...value, operator: v }),
57
+ readonly,
58
+ userOps: ruleConfig.ops,
59
+ });
60
+
61
+ const targetSchema = useMemo(() => {
62
+ const targetType: string | null = rule?.[operator || ''] || null;
63
+ return targetType ? { type: targetType, extra: { weak: true } } : null;
64
+ }, [rule, opConfig]);
65
+
66
+ return (
67
+ <UIContainer style={style}>
68
+ <UIOperator>{renderOpSelect()}</UIOperator>
69
+ <UIValues>
70
+ <UILeft>{renderDBOptionSelect()}</UILeft>
71
+ <UIRight>
72
+ {targetSchema ? (
73
+ <InjectDynamicValueInput
74
+ readonly={readonly || !rule}
75
+ value={right}
76
+ schema={targetSchema}
77
+ onChange={(v) => onChange({ ...value, right: v })}
78
+ />
79
+ ) : (
80
+ <Input
81
+ size="small"
82
+ disabled
83
+ style={{ pointerEvents: 'none' }}
84
+ value={opConfig?.rightDisplay || I18n.t('Empty')}
85
+ />
86
+ )}
87
+ </UIRight>
88
+ </UIValues>
89
+ </UIContainer>
90
+ );
91
+ }
92
+
93
+ export { type DBConditionRowValueType, type DBConditionOptionType };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import styled from 'styled-components';
7
+ import { Select } from '@douyinfe/semi-ui';
8
+
9
+ export const UIContainer = styled.div`
10
+ display: flex;
11
+ align-items: center;
12
+ gap: 4px;
13
+ `;
14
+
15
+ export const UIOperator = styled.div``;
16
+
17
+ export const UILeft = styled.div`
18
+ width: 100%;
19
+ `;
20
+
21
+ export const UIRight = styled.div`
22
+ width: 100%;
23
+ `;
24
+
25
+ export const UIValues = styled.div`
26
+ flex-grow: 1;
27
+ display: flex;
28
+ flex-direction: column;
29
+ align-items: center;
30
+ gap: 4px;
31
+ `;
32
+
33
+ export const UIOptionLabel = styled.div`
34
+ display: flex;
35
+ align-items: center;
36
+ gap: 10px;
37
+ `;
38
+
39
+ export const UISelect = styled(Select)`
40
+ & .semi-select-selection {
41
+ margin-left: 5px;
42
+ }
43
+ `;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import { IJsonSchema } from '@flowgram.ai/json-schema';
7
+
8
+ import { IFlowConstantRefValue } from '@/shared';
9
+
10
+ export interface OpConfig {
11
+ label: string;
12
+ abbreviation: string;
13
+ // When right is not a value, display this text
14
+ rightDisplay?: string;
15
+ }
16
+
17
+ export type OpConfigs = Record<string, OpConfig>;
18
+
19
+ export type IRule = Partial<Record<string, string | null>>;
20
+
21
+ export type IRules = Record<string, IRule>;
22
+
23
+ export interface DBConditionRowValueType {
24
+ left?: string;
25
+ schema?: IJsonSchema;
26
+ operator?: string;
27
+ right?: IFlowConstantRefValue;
28
+ }
29
+
30
+ export interface DBConditionOptionType {
31
+ label: string | JSX.Element;
32
+ value: string;
33
+ schema: IJsonSchema;
34
+ }
@@ -8,7 +8,8 @@ import React, { useMemo } from 'react';
8
8
  import { JsonSchemaTypeManager, JsonSchemaUtils } from '@flowgram.ai/json-schema';
9
9
  import { useScopeAvailable } from '@flowgram.ai/editor';
10
10
 
11
- import { IFlowValue } from '@/typings';
11
+ import { IFlowValue } from '@/shared';
12
+ import { FlowValueUtils } from '@/shared';
12
13
  import { DisplaySchemaTag } from '@/components/display-schema-tag';
13
14
 
14
15
  interface PropsType {
@@ -31,18 +32,7 @@ export function DisplayFlowValue({ value, title, showIconInTree }: PropsType) {
31
32
  return { type: 'string' };
32
33
  }
33
34
  if (value?.type === 'constant') {
34
- if (value?.schema) {
35
- return value?.schema;
36
- }
37
- if (typeof value?.content === 'string') {
38
- return { type: 'string' };
39
- }
40
- if (typeof value?.content === 'number') {
41
- return { type: 'number' };
42
- }
43
- if (typeof value?.content === 'boolean') {
44
- return { type: 'boolean' };
45
- }
35
+ return FlowValueUtils.inferConstantJsonSchema(value);
46
36
  }
47
37
 
48
38
  return { type: 'unknown' };
@@ -3,15 +3,19 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import React from 'react';
6
+ import React, { useMemo } from 'react';
7
7
 
8
- import { IFlowValue } from '@/typings';
8
+ import { isPlainObject } from 'lodash-es';
9
+ import { useScopeAvailable } from '@flowgram.ai/editor';
10
+
11
+ import { FlowValueUtils } from '@/shared';
9
12
  import { DisplayFlowValue } from '@/components/display-flow-value';
10
13
 
11
14
  import { DisplayInputsWrapper } from './styles';
15
+ import { DisplaySchemaTag } from '../display-schema-tag';
12
16
 
13
17
  interface PropsType {
14
- value?: Record<string, IFlowValue | undefined>;
18
+ value?: any;
15
19
  showIconInTree?: boolean;
16
20
  }
17
21
 
@@ -20,9 +24,43 @@ export function DisplayInputsValues({ value, showIconInTree }: PropsType) {
20
24
 
21
25
  return (
22
26
  <DisplayInputsWrapper>
23
- {childEntries.map(([key, value]) => (
24
- <DisplayFlowValue key={key} title={key} value={value} showIconInTree={showIconInTree} />
25
- ))}
27
+ {childEntries.map(([key, value]) => {
28
+ if (FlowValueUtils.isFlowValue(value)) {
29
+ return (
30
+ <DisplayFlowValue key={key} title={key} value={value} showIconInTree={showIconInTree} />
31
+ );
32
+ }
33
+
34
+ if (isPlainObject(value)) {
35
+ return (
36
+ <DisplayInputsValueAllInTag
37
+ key={key}
38
+ title={key}
39
+ value={value}
40
+ showIconInTree={showIconInTree}
41
+ />
42
+ );
43
+ }
44
+
45
+ return null;
46
+ })}
26
47
  </DisplayInputsWrapper>
27
48
  );
28
49
  }
50
+
51
+ export function DisplayInputsValueAllInTag({
52
+ value,
53
+ title,
54
+ showIconInTree,
55
+ }: PropsType & {
56
+ title: string;
57
+ }) {
58
+ const available = useScopeAvailable();
59
+
60
+ const schema = useMemo(
61
+ () => FlowValueUtils.inferJsonSchema(value, available.scope),
62
+ [available.version, value]
63
+ );
64
+
65
+ return <DisplaySchemaTag title={title} value={schema} showIconInTree={showIconInTree} />;
66
+ }
@@ -3,12 +3,12 @@
3
3
  * SPDX-License-Identifier: MIT
4
4
  */
5
5
 
6
- import { useMemo, useState } from 'react';
6
+ import { useEffect, useMemo, useRef, useState } from 'react';
7
7
 
8
8
  import { IJsonSchema } from '@flowgram.ai/json-schema';
9
9
  import { useScopeAvailable } from '@flowgram.ai/editor';
10
10
 
11
- import { IFlowConstantRefValue } from '@/typings/flow-value';
11
+ import { IFlowConstantRefValue } from '@/shared';
12
12
 
13
13
  export function useRefVariable(value?: IFlowConstantRefValue) {
14
14
  const available = useScopeAvailable();
@@ -33,9 +33,30 @@ export function useSelectSchema(
33
33
  defaultSelectSchema = value?.schema || defaultSelectSchema;
34
34
  }
35
35
 
36
+ const changeVersion = useRef(0);
37
+ const effectVersion = useRef(0);
38
+
36
39
  const [selectSchema, setSelectSchema] = useState(defaultSelectSchema);
37
40
 
38
- return [selectSchema, setSelectSchema] as const;
41
+ useEffect(() => {
42
+ effectVersion.current += 1;
43
+ if (changeVersion.current === effectVersion.current) {
44
+ return;
45
+ }
46
+ effectVersion.current = changeVersion.current;
47
+
48
+ if (value?.type === 'constant' && value?.schema) {
49
+ setSelectSchema(value?.schema);
50
+ return;
51
+ }
52
+ }, [value]);
53
+
54
+ const setSelectSchemaWithVersionUpdate = (schema: IJsonSchema) => {
55
+ setSelectSchema(schema);
56
+ changeVersion.current += 1;
57
+ };
58
+
59
+ return [selectSchema, setSelectSchemaWithVersionUpdate] as const;
39
60
  }
40
61
 
41
62
  export function useIncludeSchema(schemaFromProps?: IJsonSchema) {
@@ -46,7 +67,7 @@ export function useIncludeSchema(schemaFromProps?: IJsonSchema) {
46
67
  if (schemaFromProps?.type === 'number') {
47
68
  return [schemaFromProps, { type: 'integer' }];
48
69
  }
49
- return { ...schemaFromProps, extra: { ...schemaFromProps?.extra, weak: true } };
70
+ return { ...schemaFromProps, extra: { weak: true, ...schemaFromProps?.extra } };
50
71
  }, [schemaFromProps]);
51
72
 
52
73
  return includeSchema;