form-meta.tsx 952 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import { FormMeta, FormRenderProps } from '@flowgram.ai/free-layout-editor';
  6. import { createInferInputsPlugin } from '@flowgram.ai/form-materials';
  7. import { FormHeader, FormContent } from '../../form-components';
  8. import { CodeNodeJSON } from './types';
  9. import { Outputs } from './components/outputs';
  10. import { Inputs } from './components/inputs';
  11. import { Code } from './components/code';
  12. import { defaultFormMeta } from '../default-form-meta';
  13. export const FormRender = ({ form }: FormRenderProps<CodeNodeJSON>) => (
  14. <>
  15. <FormHeader />
  16. <FormContent>
  17. <Inputs />
  18. <Code />
  19. <Outputs />
  20. </FormContent>
  21. </>
  22. );
  23. export const formMeta: FormMeta = {
  24. render: (props) => <FormRender {...props} />,
  25. effect: defaultFormMeta.effect,
  26. plugins: [createInferInputsPlugin({ sourceKey: 'inputsValues', targetKey: 'inputs' })],
  27. };