@flowgram.ai/test-run-plugin 0.1.0-alpha.21 → 0.1.0-alpha.22

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.
@@ -9,13 +9,13 @@
9
9
  {"kind":"O","text":"\u001b[34mCLI\u001b[39m Target: es2020\n"}
10
10
  {"kind":"O","text":"\u001b[34mCJS\u001b[39m Build start\n"}
11
11
  {"kind":"O","text":"\u001b[34mESM\u001b[39m Build start\n"}
12
+ {"kind":"O","text":"\u001b[32mCJS\u001b[39m \u001b[1mdist/index.js \u001b[22m\u001b[32m22.70 KB\u001b[39m\n"}
13
+ {"kind":"O","text":"\u001b[32mCJS\u001b[39m \u001b[1mdist/index.js.map \u001b[22m\u001b[32m45.04 KB\u001b[39m\n"}
14
+ {"kind":"O","text":"\u001b[32mCJS\u001b[39m ⚡️ Build success in 151ms\n"}
12
15
  {"kind":"O","text":"\u001b[32mESM\u001b[39m \u001b[1mdist/esm/index.js \u001b[22m\u001b[32m19.95 KB\u001b[39m\n"}
13
16
  {"kind":"O","text":"\u001b[32mESM\u001b[39m \u001b[1mdist/esm/index.js.map \u001b[22m\u001b[32m44.65 KB\u001b[39m\n"}
14
- {"kind":"O","text":"\u001b[32mESM\u001b[39m ⚡️ Build success in 150ms\n"}
15
- {"kind":"O","text":"\u001b[32mCJS\u001b[39m \u001b[1mdist/index.js \u001b[22m\u001b[32m22.70 KB\u001b[39m\n"}
16
- {"kind":"O","text":"\u001b[32mCJS\u001b[39m \u001b[1mdist/index.js.map \u001b[22m\u001b[32m45.02 KB\u001b[39m\n"}
17
- {"kind":"O","text":"\u001b[32mCJS\u001b[39m ⚡️ Build success in 153ms\n"}
17
+ {"kind":"O","text":"\u001b[32mESM\u001b[39m ⚡️ Build success in 152ms\n"}
18
18
  {"kind":"O","text":"\u001b[34mDTS\u001b[39m Build start\n"}
19
- {"kind":"O","text":"\u001b[32mDTS\u001b[39m ⚡️ Build success in 3859ms\n"}
20
- {"kind":"O","text":"\u001b[32mDTS\u001b[39m \u001b[1mdist/index.d.ts \u001b[22m\u001b[32m9.95 KB\u001b[39m\n"}
21
- {"kind":"O","text":"\u001b[32mDTS\u001b[39m \u001b[1mdist/index.d.mts \u001b[22m\u001b[32m9.95 KB\u001b[39m\n"}
19
+ {"kind":"O","text":"\u001b[32mDTS\u001b[39m ⚡️ Build success in 3709ms\n"}
20
+ {"kind":"O","text":"\u001b[32mDTS\u001b[39m \u001b[1mdist/index.d.ts \u001b[22m\u001b[32m9.96 KB\u001b[39m\n"}
21
+ {"kind":"O","text":"\u001b[32mDTS\u001b[39m \u001b[1mdist/index.d.mts \u001b[22m\u001b[32m9.96 KB\u001b[39m\n"}
@@ -22,7 +22,7 @@
22
22
  "packages/plugins/test-run-plugin/src/form-engine/model/index.ts": "92b45894959a33683d01a381a6d374cafb93224d",
23
23
  "packages/plugins/test-run-plugin/src/form-engine/types.ts": "9764f90938b877711c91e6821e4e19d8d58c8c07",
24
24
  "packages/plugins/test-run-plugin/src/form-engine/utils.ts": "8967e8cfb279c6a22cd0e66c639088f692a2894d",
25
- "packages/plugins/test-run-plugin/src/index.ts": "0a42f0a99fd71f38e256ea271290d1b28752bfe5",
25
+ "packages/plugins/test-run-plugin/src/index.ts": "789c95cf278351dbd9407c7a4641404fce011454",
26
26
  "packages/plugins/test-run-plugin/src/reactive/hooks/index.ts": "7e5716c6fe1e3f3020385a2fbb4548f68fd1d47c",
27
27
  "packages/plugins/test-run-plugin/src/reactive/hooks/use-create-form.ts": "7a95b5eacf80e497044c8f2460b8d315ec2002d2",
28
28
  "packages/plugins/test-run-plugin/src/reactive/hooks/use-test-run-service.ts": "18b0b44f57b1c7ea14d187f05c9e0d78ea6c74b2",
package/dist/index.d.mts CHANGED
@@ -311,4 +311,4 @@ declare const useCreateForm: ({ node, loadingRenderer, emptyRenderer, defaultVal
311
311
 
312
312
  declare const useTestRunService: () => TestRunService;
313
313
 
314
- export { type FormComponentProps, FormEngine, type FormEngineProps, type FormInstance, type FormSchema, TestRunPipelineEntity, type TestRunPipelineEntityCtx, type TestRunPipelinePlugin, connect, createTestRunPlugin, useCreateForm, useTestRunService };
314
+ export { type FormComponentProps, FormEngine, type FormEngineProps, type FormInstance, type FormSchema, TestRunConfig, TestRunPipelineEntity, type TestRunPipelineEntityCtx, type TestRunPipelinePlugin, connect, createTestRunPlugin, useCreateForm, useTestRunService };
package/dist/index.d.ts CHANGED
@@ -311,4 +311,4 @@ declare const useCreateForm: ({ node, loadingRenderer, emptyRenderer, defaultVal
311
311
 
312
312
  declare const useTestRunService: () => TestRunService;
313
313
 
314
- export { type FormComponentProps, FormEngine, type FormEngineProps, type FormInstance, type FormSchema, TestRunPipelineEntity, type TestRunPipelineEntityCtx, type TestRunPipelinePlugin, connect, createTestRunPlugin, useCreateForm, useTestRunService };
314
+ export { type FormComponentProps, FormEngine, type FormEngineProps, type FormInstance, type FormSchema, TestRunConfig, TestRunPipelineEntity, type TestRunPipelineEntityCtx, type TestRunPipelinePlugin, connect, createTestRunPlugin, useCreateForm, useTestRunService };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/create-test-run-plugin.ts","../src/services/form/form.ts","../src/services/config.ts","../src/form-engine/form/form.tsx","../src/form-engine/hooks/use-create-form.ts","../src/form-engine/utils.ts","../src/form-engine/model/index.ts","../src/form-engine/hooks/use-field.ts","../src/form-engine/contexts.ts","../src/form-engine/hooks/use-form.ts","../src/form-engine/fields/schema-field.tsx","../src/form-engine/fields/recursion-field.tsx","../src/form-engine/fields/reactive-field.tsx","../src/form-engine/fields/object-field.tsx","../src/form-engine/fields/general-field.tsx","../src/form-engine/fields/create-field.tsx","../src/services/form/factory.ts","../src/services/form/manager.ts","../src/services/test-run.ts","../src/services/pipeline/factory.ts","../src/services/pipeline/pipeline.ts","../src/services/pipeline/tap.ts","../src/services/store.ts","../src/reactive/hooks/use-create-form.ts","../src/reactive/hooks/use-test-run-service.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport { createTestRunPlugin } from './create-test-run-plugin';\nexport { useCreateForm, useTestRunService } from './reactive';\n\nexport {\n FormEngine,\n connect,\n type FormInstance,\n type FormEngineProps,\n type FormSchema,\n type FormComponentProps,\n} from './form-engine';\n\nexport {\n type TestRunPipelinePlugin,\n TestRunPipelineEntity,\n type TestRunPipelineEntityCtx,\n} from './services';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { TestRunFormEntity, TestRunFormFactory, TestRunFormManager } from './services/form';\nimport {\n TestRunService,\n TestRunPipelineEntity,\n TestRunPipelineFactory,\n TestRunConfig,\n defineConfig,\n} from './services';\n\nexport const createTestRunPlugin = definePluginCreator<Partial<TestRunConfig>>({\n onBind: ({ bind }, opt) => {\n /** service */\n bind(TestRunService).toSelf().inSingletonScope();\n /** config */\n bind(TestRunConfig).toConstantValue(defineConfig(opt));\n /** form manager */\n bind(TestRunFormManager).toSelf().inSingletonScope();\n /** form entity */\n bind<TestRunFormFactory>(TestRunFormFactory).toFactory<TestRunFormEntity>((context) => () => {\n const e = context.container.resolve(TestRunFormEntity);\n return e;\n });\n /** pipeline entity */\n bind<TestRunPipelineFactory>(TestRunPipelineFactory).toFactory<TestRunPipelineEntity>(\n (context) => () => {\n const e = context.container.resolve(TestRunPipelineEntity);\n e.container = context.container.createChild();\n return e;\n }\n );\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createElement, type ReactNode } from 'react';\n\nimport { nanoid } from 'nanoid';\nimport { injectable, inject } from 'inversify';\nimport { Emitter } from '@flowgram.ai/utils';\n\nimport { TestRunConfig } from '../config';\nimport { FormSchema, FormEngine, type FormInstance, type FormEngineProps } from '../../form-engine';\n\nexport type FormRenderProps = Omit<\n FormEngineProps,\n 'schema' | 'components' | 'onMounted' | 'onUnmounted'\n>;\n\n@injectable()\nexport class TestRunFormEntity {\n @inject(TestRunConfig) private readonly config: TestRunConfig;\n\n private _schema: FormSchema;\n\n private initialized = false;\n\n id = nanoid();\n\n form: FormInstance | null = null;\n\n onFormMountedEmitter = new Emitter<FormInstance>();\n\n onFormMounted = this.onFormMountedEmitter.event;\n\n onFormUnmountedEmitter = new Emitter<void>();\n\n onFormUnmounted = this.onFormUnmountedEmitter.event;\n\n get schema() {\n return this._schema;\n }\n\n init(options: { schema: FormSchema }) {\n if (this.initialized) return;\n\n this._schema = options.schema;\n this.initialized = true;\n }\n\n render(props?: FormRenderProps): ReactNode {\n if (!this.initialized) {\n return null;\n }\n const { children, ...restProps } = props || {};\n return createElement(\n FormEngine,\n {\n schema: this.schema,\n components: this.config.components,\n onMounted: (instance) => {\n this.form = instance;\n this.onFormMountedEmitter.fire(instance);\n },\n onUnmounted: this.onFormUnmountedEmitter.fire.bind(this.onFormUnmountedEmitter),\n ...restProps,\n },\n children\n );\n }\n\n dispose() {\n this._schema = {};\n this.form = null;\n this.onFormMountedEmitter.dispose();\n this.onFormUnmountedEmitter.dispose();\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { FlowNodeType, FlowNodeEntity } from '@flowgram.ai/document';\n\nimport type { MaybePromise } from '../types';\nimport type { FormSchema, FormComponents } from '../form-engine';\nimport type { TestRunPipelinePlugin } from './pipeline';\n\ntype PropertiesFunctionParams = {\n node: FlowNodeEntity;\n};\nexport type NodeMap = Record<FlowNodeType, NodeTestConfig>;\nexport interface NodeTestConfig {\n /** Enable node TestRun */\n enabled?: boolean;\n /** Input schema properties */\n properties?:\n | Record<string, FormSchema>\n | ((params: PropertiesFunctionParams) => MaybePromise<Record<string, FormSchema>>);\n}\n\nexport interface TestRunConfig {\n components: FormComponents;\n nodes: NodeMap;\n plugins: (new () => TestRunPipelinePlugin)[];\n}\n\nexport const TestRunConfig = Symbol('TestRunConfig');\nexport const defineConfig = (config: Partial<TestRunConfig>) => {\n const defaultConfig: TestRunConfig = {\n components: {},\n nodes: {},\n plugins: [],\n };\n return {\n ...defaultConfig,\n ...config,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Form } from '@flowgram.ai/form';\n\nimport { FormSchema, FormComponents } from '../types';\nimport { useCreateForm, type UseCreateFormOptions } from '../hooks';\nimport { createSchemaField } from '../fields';\n\nconst SchemaField = createSchemaField({});\n\nexport type FormEngineProps = React.PropsWithChildren<\n {\n /** Form schema */\n schema: FormSchema;\n /** form material map */\n components?: FormComponents;\n } & UseCreateFormOptions\n>;\n\nexport const FormEngine: React.FC<FormEngineProps> = ({\n schema,\n components,\n children,\n ...props\n}) => {\n const { model, control } = useCreateForm(schema, props);\n\n return (\n <Form control={control}>\n <SchemaField model={model} components={components}>\n {children}\n </SchemaField>\n </Form>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useEffect, useMemo } from 'react';\n\nimport type { OnFormValuesChangePayload } from '@flowgram.ai/form-core';\nimport { createForm, ValidateTrigger, type IForm } from '@flowgram.ai/form';\n\nimport { createValidate } from '../utils';\nimport { FormSchema, FormSchemaValidate } from '../types';\nimport { FormSchemaModel } from '../model';\n\nexport interface FormInstance {\n model: FormSchemaModel;\n form: IForm;\n}\nexport interface UseCreateFormOptions {\n defaultValues?: any;\n validate?: Record<string, FormSchemaValidate>;\n validateTrigger?: ValidateTrigger;\n onMounted?: (form: FormInstance) => void;\n onFormValuesChange?: (payload: OnFormValuesChangePayload) => void;\n onUnmounted?: () => void;\n}\n\nexport const useCreateForm = (schema: FormSchema, options: UseCreateFormOptions = {}) => {\n const { form, control } = useMemo(\n () =>\n createForm({\n validate: {\n ...createValidate(schema),\n ...options.validate,\n },\n validateTrigger: options.validateTrigger ?? ValidateTrigger.onBlur,\n }),\n [schema]\n );\n\n const model = useMemo(\n () => new FormSchemaModel({ type: 'object', ...schema, defaultValue: options.defaultValues }),\n [schema]\n );\n\n /** Lifecycle and event binding */\n useEffect(() => {\n if (options.onMounted) {\n options.onMounted({ model, form });\n }\n const disposable = control._formModel.onFormValuesChange((payload) => {\n if (options.onFormValuesChange) {\n options.onFormValuesChange(payload);\n }\n });\n return () => {\n disposable.dispose();\n if (options.onUnmounted) {\n options.onUnmounted();\n }\n };\n }, [control]);\n\n return {\n form,\n control,\n model,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createElement } from 'react';\n\nimport type { FormSchema, FormSchemaValidate, FormComponentProps } from './types';\n\n/** Splice form item unique name */\nexport const getUniqueFieldName = (...args: (string | undefined)[]) =>\n args.filter((path) => path).join('.');\n\nexport const mergeFieldPath = (path?: string[], name?: string) =>\n [...(path || []), name].filter((i): i is string => Boolean(i));\n\n/** Create validation rules */\nexport const createValidate = (schema: FormSchema) => {\n const rules: Record<string, FormSchemaValidate> = {};\n\n visit(schema);\n\n return rules;\n\n function visit(current: FormSchema, name?: string) {\n if (name && current['x-validator']) {\n rules[name] = current['x-validator'];\n }\n if (current.type === 'object' && current.properties) {\n Object.entries(current.properties).forEach(([key, value]) => {\n visit(value, getUniqueFieldName(name, key));\n });\n }\n }\n};\n\nexport const connect = <T = any>(\n Component: React.FunctionComponent<any>,\n mapProps: (p: FormComponentProps) => T\n) => {\n const Connected = (props: FormComponentProps) => {\n const mappedProps = mapProps(props);\n return createElement(Component, mappedProps, (mappedProps as any).children);\n };\n\n return Connected;\n};\n\nexport const isFormEmpty = (schema: FormSchema) => {\n /** is not general field and not has children */\n const isEmpty = (s: FormSchema): boolean => {\n if (!s.type || s.type === 'object' || !s.name) {\n return Object.entries(schema.properties || {})\n .map(([key, value]) => ({\n name: key,\n ...value,\n }))\n .every(isFormEmpty);\n }\n return false;\n };\n\n return isEmpty(schema);\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ReactiveState } from '@flowgram.ai/reactive';\n\nimport { getUniqueFieldName, mergeFieldPath } from '../utils';\nimport { FormSchema, FormSchemaType, FormSchemaModelState } from '../types';\n\nexport class FormSchemaModel implements FormSchema {\n name?: string;\n\n type?: FormSchemaType;\n\n defaultValue?: any;\n\n properties?: Record<string, FormSchema>;\n\n ['x-index']?: number;\n\n ['x-component']?: string;\n\n ['x-component-props']?: Record<string, unknown>;\n\n ['x-decorator']?: string;\n\n ['x-decorator-props']?: Record<string, unknown>;\n\n [key: string]: any;\n\n path: string[] = [];\n\n state = new ReactiveState<FormSchemaModelState>({ disabled: false });\n\n get componentType() {\n return this['x-component'];\n }\n\n get componentProps() {\n return this['x-component-props'];\n }\n\n get decoratorType() {\n return this['x-decorator'];\n }\n\n get decoratorProps() {\n return this['x-decorator-props'];\n }\n\n get uniqueName() {\n return getUniqueFieldName(...this.path);\n }\n\n constructor(json: FormSchema, path: string[] = []) {\n this.fromJSON(json);\n this.path = path;\n }\n\n private fromJSON(json: FormSchema) {\n Object.entries(json).forEach(([key, value]) => {\n this[key] = value;\n });\n }\n\n getPropertyList() {\n const orderProperties: FormSchemaModel[] = [];\n const unOrderProperties: FormSchemaModel[] = [];\n Object.entries(this.properties || {}).forEach(([key, item]) => {\n const index = item['x-index'];\n const defaultValues = this.defaultValue;\n /**\n * The upper layer's default value has a higher priority than its own default value,\n * because the upper layer's default value ultimately comes from the outside world.\n */\n if (typeof defaultValues === 'object' && defaultValues !== null && key in defaultValues) {\n item.defaultValue = defaultValues[key];\n }\n const current = new FormSchemaModel(item, mergeFieldPath(this.path, key));\n if (index !== undefined && !isNaN(index)) {\n orderProperties[index] = current;\n } else {\n unOrderProperties.push(current);\n }\n });\n return orderProperties.concat(unOrderProperties).filter((item) => !!item);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useContext } from 'react';\n\nimport { useObserve } from '@flowgram.ai/reactive';\n\nimport { FieldModelContext } from '../contexts';\n\nexport const useFieldModel = () => useContext(FieldModelContext);\nexport const useFieldState = () => useObserve(useFieldModel().state.value);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createContext } from 'react';\n\nimport type { FormComponents } from './types';\nimport type { FormSchemaModel } from './model';\n\n/** Model context for each form item */\nexport const FieldModelContext = createContext<FormSchemaModel>({} as any);\n/** The form's model context */\nexport const FormModelContext = createContext<FormSchemaModel>({} as any);\n/** Context of material component map */\nexport const ComponentsContext = createContext<FormComponents>({});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useContext } from 'react';\n\nimport { useObserve } from '@flowgram.ai/reactive';\n\nimport { FormModelContext } from '../contexts';\n\nexport const useFormModel = () => useContext(FormModelContext);\nexport const useFormState = () => useObserve(useFormModel().state.value);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useState } from 'react';\n\nimport type { FormComponents } from '../types';\nimport { FormSchemaModel } from '../model';\nimport { ComponentsContext, FormModelContext } from '../contexts';\nimport { RecursionField } from './recursion-field';\n\nexport interface SchemaFieldProps {\n model: FormSchemaModel;\n components: FormComponents;\n}\nexport const SchemaField: React.FC<React.PropsWithChildren<SchemaFieldProps>> = ({\n components,\n model,\n children,\n}) => {\n /** Only initialized once, dynamic is not supported */\n const [innerComponents] = useState(() => components);\n return (\n <ComponentsContext.Provider value={innerComponents}>\n <FormModelContext.Provider value={model}>\n <RecursionField model={model} />\n {children}\n </FormModelContext.Provider>\n </ComponentsContext.Provider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useMemo } from 'react';\n\nimport { FormSchemaModel } from '../model';\nimport { ObjectField } from './object-field';\nimport { GeneralField } from './general-field';\n\ninterface RecursionFieldProps {\n model: FormSchemaModel;\n}\n\nexport const RecursionField: React.FC<RecursionFieldProps> = ({ model }) => {\n const properties = useMemo(() => model.getPropertyList(), [model]);\n\n /** general field has no children */\n if (model.type !== 'object') {\n return <GeneralField model={model} />;\n }\n\n return (\n <ObjectField model={model}>\n {properties.map((item) => (\n <RecursionField key={item.uniqueName} model={item} />\n ))}\n </ObjectField>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useContext } from 'react';\nimport React from 'react';\n\nimport { useFormState } from '../hooks/use-form';\nimport { useFieldModel, useFieldState } from '../hooks/use-field';\nimport { ComponentsContext } from '../contexts';\n\ninterface ReactiveFieldProps {\n componentProps?: Record<string, unknown>;\n decoratorProps?: Record<string, unknown>;\n}\n\nexport const ReactiveField: React.FC<React.PropsWithChildren<ReactiveFieldProps>> = (props) => {\n const formState = useFormState();\n const model = useFieldModel();\n const modelState = useFieldState();\n const components = useContext(ComponentsContext);\n\n const disabled = modelState.disabled || formState.disabled;\n const componentRender = () => {\n if (!model.componentType || !components[model.componentType]) {\n return props.children;\n }\n return React.createElement(\n components[model.componentType],\n {\n disabled,\n ...model.componentProps,\n ...props.componentProps,\n },\n props.children\n );\n };\n\n const decoratorRender = (children: React.ReactNode) => {\n if (!model.decoratorType || !components[model.decoratorType]) {\n return <>{children}</>;\n }\n return React.createElement(\n components[model.decoratorType],\n {\n type: model.type,\n required: model.required,\n ...model.decoratorProps,\n ...props.decoratorProps,\n },\n children\n );\n };\n\n return decoratorRender(componentRender());\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { FormSchemaModel } from '../model';\nimport { FieldModelContext } from '../contexts';\nimport { ReactiveField } from './reactive-field';\n\nexport interface ObjectFieldProps {\n model: FormSchemaModel;\n}\n\nexport const ObjectField: React.FC<React.PropsWithChildren<ObjectFieldProps>> = ({\n model,\n children,\n}) => (\n <FieldModelContext.Provider value={model}>\n <ReactiveField>{children}</ReactiveField>\n </FieldModelContext.Provider>\n);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Field } from '@flowgram.ai/form';\n\nimport { ReactiveField } from './reactive-field';\nimport type { FormSchemaModel } from '../model';\nimport { FieldModelContext } from '../contexts';\n\nexport interface GeneralFieldProps {\n model: FormSchemaModel;\n}\n\nexport const GeneralField: React.FC<GeneralFieldProps> = ({ model }) => (\n <FieldModelContext.Provider value={model}>\n <Field\n name={model.uniqueName}\n defaultValue={model.defaultValue}\n render={({ field, fieldState }) => (\n <ReactiveField\n componentProps={{\n value: field.value,\n onChange: field.onChange,\n onFocus: field.onFocus,\n onBlur: field.onBlur,\n ...fieldState,\n }}\n decoratorProps={fieldState}\n />\n )}\n />\n </FieldModelContext.Provider>\n);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { PropsWithChildren } from 'react';\n\nimport { SchemaField, type SchemaFieldProps } from './schema-field';\nimport { FormComponents } from '../types';\n\ntype InnerSchemaFieldProps = Omit<SchemaFieldProps, 'components'> &\n Pick<Partial<SchemaFieldProps>, 'components'>;\n\nexport interface CreateSchemaFieldOptions {\n components?: FormComponents;\n}\nexport const createSchemaField = (options: CreateSchemaFieldOptions) => {\n const InnerSchemaField: React.FC<PropsWithChildren<InnerSchemaFieldProps>> = ({\n components,\n ...props\n }) => (\n <SchemaField\n components={{\n ...options.components,\n ...components,\n }}\n {...props}\n />\n );\n\n return InnerSchemaField;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { TestRunFormEntity } from './form';\n\nexport const TestRunFormFactory = Symbol('TestRunFormFactory');\nexport type TestRunFormFactory = () => TestRunFormEntity;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, injectable } from 'inversify';\n\nimport type { TestRunFormEntity } from './form';\nimport { TestRunFormFactory } from './factory';\n\n@injectable()\nexport class TestRunFormManager {\n @inject(TestRunFormFactory) private readonly factory: TestRunFormFactory;\n\n private entities = new Map<string, TestRunFormEntity>();\n\n createForm() {\n return this.factory();\n }\n\n getForm(id: string) {\n return this.entities.get(id);\n }\n\n getAllForm() {\n return Array.from(this.entities);\n }\n\n disposeForm(id: string) {\n const form = this.entities.get(id);\n if (!form) {\n return;\n }\n form.dispose();\n this.entities.delete(id);\n }\n\n disposeAllForm() {\n for (const id of this.entities.keys()) {\n this.disposeForm(id);\n }\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, injectable } from 'inversify';\nimport { Disposable, DisposableCollection, Emitter } from '@flowgram.ai/utils';\nimport type { FlowNodeEntity, FlowNodeType } from '@flowgram.ai/document';\n\nimport { TestRunPipelineFactory } from './pipeline/factory';\nimport { TestRunFormManager } from './form';\nimport { FormSchema } from '../form-engine';\nimport { TestRunPipelineEntity, type TestRunPipelineEntityOptions } from './pipeline';\nimport { TestRunConfig } from './config';\n\n@injectable()\nexport class TestRunService {\n @inject(TestRunConfig) private readonly config: TestRunConfig;\n\n @inject(TestRunPipelineFactory) private readonly pipelineFactory: TestRunPipelineFactory;\n\n @inject(TestRunFormManager) readonly formManager: TestRunFormManager;\n\n pipelineEntities = new Map<string, TestRunPipelineEntity>();\n\n pipelineBindings = new Map<string, Disposable>();\n\n onPipelineProgressEmitter = new Emitter();\n\n onPipelineProgress = this.onPipelineProgressEmitter.event;\n\n onPipelineFinishedEmitter = new Emitter();\n\n onPipelineFinished = this.onPipelineFinishedEmitter.event;\n\n public isEnabled(nodeType: FlowNodeType) {\n const config = this.config.nodes[nodeType];\n return config && config?.enabled !== false;\n }\n\n async toSchema(node: FlowNodeEntity) {\n const nodeType = node.flowNodeType;\n const config = this.config.nodes[nodeType];\n if (!this.isEnabled(nodeType)) {\n return {};\n }\n const properties =\n typeof config.properties === 'function'\n ? await config.properties({ node })\n : config.properties;\n\n return {\n type: 'object',\n properties,\n };\n }\n\n createFormWithSchema(schema: FormSchema) {\n const form = this.formManager.createForm();\n form.init({ schema });\n return form;\n }\n\n async createForm(node: FlowNodeEntity) {\n const schema = await this.toSchema(node);\n return this.createFormWithSchema(schema);\n }\n\n createPipeline(options: TestRunPipelineEntityOptions) {\n const pipeline = this.pipelineFactory();\n this.pipelineEntities.set(pipeline.id, pipeline);\n pipeline.init(options);\n return pipeline;\n }\n\n connectPipeline(pipeline: TestRunPipelineEntity) {\n if (this.pipelineBindings.get(pipeline.id)) {\n return;\n }\n const disposable = new DisposableCollection(\n pipeline.onProgress(this.onPipelineProgressEmitter.fire.bind(this.onPipelineProgressEmitter)),\n pipeline.onFinished(this.onPipelineFinishedEmitter.fire.bind(this.onPipelineFinishedEmitter))\n );\n this.pipelineBindings.set(pipeline.id, disposable);\n }\n\n disconnectPipeline(id: string) {\n if (this.pipelineBindings.has(id)) {\n const disposable = this.pipelineBindings.get(id);\n disposable?.dispose();\n this.pipelineBindings.delete(id);\n }\n }\n\n disconnectAllPipeline() {\n for (const id of this.pipelineBindings.keys()) {\n this.disconnectPipeline(id);\n }\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { TestRunPipelineEntity } from './pipeline';\n\nexport const TestRunPipelineFactory = Symbol('TestRunPipelineFactory');\nexport type TestRunPipelineFactory = () => TestRunPipelineEntity;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { StoreApi } from 'zustand';\nimport { nanoid } from 'nanoid';\nimport { injectable, interfaces } from 'inversify';\nimport { Emitter } from '@flowgram.ai/utils';\n\nimport { Tap } from './tap';\nimport type { TestRunPipelinePlugin } from './plugin';\nimport { StoreService } from '../store';\nexport interface TestRunPipelineEntityOptions {\n plugins: (new () => TestRunPipelinePlugin)[];\n}\n\ninterface TestRunPipelineEntityState<T = any> {\n status: 'idle' | 'preparing' | 'executing' | 'canceled' | 'finished';\n data?: T;\n result?: any;\n getData: () => T;\n setData: (next: any) => void;\n}\n\nexport interface TestRunPipelineEntityCtx<T = any> {\n id: string;\n store: StoreApi<TestRunPipelineEntityState<T>>;\n operate: {\n update: (data: any) => void;\n cancel: () => void;\n };\n}\n\nconst initialState: Omit<TestRunPipelineEntityState, 'getData' | 'setData'> = {\n status: 'idle',\n data: {},\n};\n\n@injectable()\nexport class TestRunPipelineEntity extends StoreService<TestRunPipelineEntityState> {\n container: interfaces.Container | undefined;\n\n id = nanoid();\n\n prepare = new Tap<TestRunPipelineEntityCtx>();\n\n private execute?: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void;\n\n private progress?: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void;\n\n get status() {\n return this.getState().status;\n }\n\n set status(next: TestRunPipelineEntityState['status']) {\n this.setState({ status: next });\n }\n\n onProgressEmitter = new Emitter<any>();\n\n onProgress = this.onProgressEmitter.event;\n\n onFinishedEmitter = new Emitter();\n\n onFinished = this.onFinishedEmitter.event;\n\n constructor() {\n super((set, get) => ({\n ...initialState,\n getData: () => get().data || {},\n setData: (next: any) => set((state) => ({ ...state, data: { ...state.data, ...next } })),\n }));\n }\n\n public init(options: TestRunPipelineEntityOptions) {\n if (!this.container) {\n return;\n }\n const { plugins } = options;\n for (const PluginClass of plugins) {\n const plugin = this.container.resolve<TestRunPipelinePlugin>(PluginClass);\n plugin.apply(this);\n }\n }\n\n public registerExecute(fn: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void) {\n this.execute = fn;\n }\n\n public registerProgress(fn: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void) {\n this.progress = fn;\n }\n\n async start<T>(options?: { data: T }) {\n const { data } = options || {};\n if (this.status !== 'idle') {\n return;\n }\n /** initialization data */\n this.setState({ data });\n const ctx: TestRunPipelineEntityCtx = {\n id: this.id,\n store: this.store,\n operate: {\n update: this.update.bind(this),\n cancel: this.cancel.bind(this),\n },\n };\n\n this.status = 'preparing';\n await this.prepare.call(ctx);\n if (this.status !== 'preparing') {\n return;\n }\n\n this.status = 'executing';\n if (this.execute) {\n await this.execute(ctx);\n }\n if (this.progress) {\n await this.progress(ctx);\n }\n if (this.status === 'executing') {\n this.status = 'finished';\n this.onFinishedEmitter.fire(this.getState().result);\n }\n }\n\n update(result: any) {\n this.setState({ result });\n this.onProgressEmitter.fire(result);\n }\n\n cancel() {\n if ((this.status = 'preparing')) {\n this.prepare.freeze();\n }\n this.status = 'canceled';\n }\n\n dispose() {}\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { MaybePromise } from '../../types';\n\ninterface TapValue<T> {\n name: string;\n fn: (arg: T) => MaybePromise<void>;\n}\n\nexport class Tap<T> {\n private taps: TapValue<T>[] = [];\n\n private frozen = false;\n\n tap(name: string, fn: TapValue<T>['fn']) {\n this.taps.push({ name, fn });\n }\n\n async call(ctx: T) {\n for (const tap of this.taps) {\n if (this.frozen) {\n return;\n }\n await tap.fn(ctx);\n }\n }\n\n freeze() {\n this.frozen = true;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createStore } from 'zustand/vanilla';\nimport type { StoreApi, StateCreator } from 'zustand';\nimport { injectable, unmanaged } from 'inversify';\n/**\n * 包含 Store 的 Service\n */\n@injectable()\nexport class StoreService<State> {\n store: StoreApi<State>;\n\n get getState() {\n return this.store.getState.bind(this.store);\n }\n\n get setState() {\n return this.store.setState.bind(this.store);\n }\n\n constructor(@unmanaged() stateCreator: StateCreator<State>) {\n this.store = createStore(stateCreator);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useEffect, useMemo, useState } from 'react';\n\nimport { DisposableCollection } from '@flowgram.ai/utils';\nimport type { FlowNodeEntity } from '@flowgram.ai/document';\n\nimport { TestRunFormEntity } from '../../services/form/form';\nimport { FormEngineProps, isFormEmpty } from '../../form-engine';\nimport { useTestRunService } from './use-test-run-service';\n\ninterface UseFormOptions {\n node?: FlowNodeEntity;\n /** form loading */\n loadingRenderer?: React.ReactNode;\n /** form empty */\n emptyRenderer?: React.ReactNode;\n defaultValues?: FormEngineProps['defaultValues'];\n onMounted?: FormEngineProps['onMounted'];\n onUnmounted?: FormEngineProps['onUnmounted'];\n onFormValuesChange?: FormEngineProps['onFormValuesChange'];\n}\n\nexport const useCreateForm = ({\n node,\n loadingRenderer,\n emptyRenderer,\n defaultValues,\n onMounted,\n onUnmounted,\n onFormValuesChange,\n}: UseFormOptions) => {\n const testRun = useTestRunService();\n const [loading, setLoading] = useState(false);\n const [form, setForm] = useState<TestRunFormEntity | null>(null);\n const renderer = useMemo(() => {\n if (loading || !form) {\n return loadingRenderer;\n }\n\n const isEmpty = isFormEmpty(form.schema);\n\n return form.render({\n defaultValues,\n onFormValuesChange,\n children: isEmpty ? emptyRenderer : null,\n });\n }, [form, loading]);\n\n const compute = async () => {\n if (!node) {\n return;\n }\n try {\n setLoading(true);\n const formEntity = await testRun.createForm(node);\n setForm(formEntity);\n } finally {\n setLoading(false);\n }\n };\n\n useEffect(() => {\n compute();\n }, [node]);\n\n useEffect(() => {\n if (!form) {\n return;\n }\n const disposable = new DisposableCollection(\n form.onFormMounted((data) => {\n onMounted?.(data);\n }),\n form.onFormUnmounted(() => {\n onUnmounted?.();\n })\n );\n return () => disposable.dispose();\n }, [form]);\n\n return {\n renderer,\n loading,\n form,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useService } from '@flowgram.ai/core';\n\nimport { TestRunService } from '../../services/test-run';\n\nexport const useTestRunService = () => useService<TestRunService>(TestRunService);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACKA,kBAAoC;;;ACApC,IAAAC,iBAA8C;AAE9C,oBAAuB;AACvB,uBAAmC;AACnC,IAAAC,gBAAwB;;;ACqBjB,IAAM,gBAAgB,OAAO,eAAe;AAC5C,IAAM,eAAe,CAAC,WAAmC;AAC9D,QAAM,gBAA+B;AAAA,IACnC,YAAY,CAAC;AAAA,IACb,OAAO,CAAC;AAAA,IACR,SAAS,CAAC;AAAA,EACZ;AACA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACF;;;ACpCA,IAAAC,eAAqB;;;ACArB,IAAAC,gBAAmC;AAGnC,kBAAwD;;;ACHxD,mBAA8B;AAKvB,IAAM,qBAAqB,IAAI,SACpC,KAAK,OAAO,CAAC,SAAS,IAAI,EAAE,KAAK,GAAG;AAE/B,IAAM,iBAAiB,CAAC,MAAiB,SAC9C,CAAC,GAAI,QAAQ,CAAC,GAAI,IAAI,EAAE,OAAO,CAAC,MAAmB,QAAQ,CAAC,CAAC;AAGxD,IAAM,iBAAiB,CAAC,WAAuB;AACpD,QAAM,QAA4C,CAAC;AAEnD,QAAM,MAAM;AAEZ,SAAO;AAEP,WAAS,MAAM,SAAqB,MAAe;AACjD,QAAI,QAAQ,QAAQ,aAAa,GAAG;AAClC,YAAM,IAAI,IAAI,QAAQ,aAAa;AAAA,IACrC;AACA,QAAI,QAAQ,SAAS,YAAY,QAAQ,YAAY;AACnD,aAAO,QAAQ,QAAQ,UAAU,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC3D,cAAM,OAAO,mBAAmB,MAAM,GAAG,CAAC;AAAA,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AAI;AAC/D,QAAM,eAAW,wBAAQ,MAAM;AAC7B,QAAI,WAAW,CAAC,MAAM;AACpB,aAAO;AAAA,IACT;AAEA,UAAM,UAAU,YAAY,KAAK,MAAM;AAEvC,WAAO,KAAK,OAAO;AAAA,MACjB;AAAA,MACA;AAAA,MACA,UAAU,UAAU,gBAAgB;AAAA,IACtC,CAAC;AAAA,EACH,GAAG,CAAC,MAAM,OAAO,CAAC;AAElB,QAAM,UAAU,YAAY;AAC1B,QAAI,CAAC,MAAM;AACT;AAAA,IACF;AACA,QAAI;AACF,iBAAW,IAAI;AACf,YAAM,aAAa,MAAM,QAAQ,WAAW,IAAI;AAChD,cAAQ,UAAU;AAAA,IACpB,UAAE;AACA,iBAAW,KAAK;AAAA,IAClB;AAAA,EACF;AAEA,gCAAU,MAAM;AACd,YAAQ;AAAA,EACV,GAAG,CAAC,IAAI,CAAC;AAET,gCAAU,MAAM;AACd,QAAI,CAAC,MAAM;AACT;AAAA,IACF;AACA,UAAM,aAAa,IAAI;AAAA,MACrB,KAAK,cAAc,CAAC,SAAS;AAC3B,oBAAY,IAAI;AAAA,MAClB,CAAC;AAAA,MACD,KAAK,gBAAgB,MAAM;AACzB,sBAAc;AAAA,MAChB,CAAC;AAAA,IACH;AACA,WAAO,MAAM,WAAW,QAAQ;AAAA,EAClC,GAAG,CAAC,IAAI,CAAC;AAET,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["useCreateForm","import_react","import_utils","import_form","import_react","import_react","import_reactive","import_react","import_react","import_reactive","import_react","import_react","import_react","React","import_jsx_runtime","import_form","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","SchemaField","import_inversify","import_inversify","import_utils","import_nanoid","import_inversify","import_utils","import_inversify","import_react","import_utils","import_core","useCreateForm"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/create-test-run-plugin.ts","../src/services/form/form.ts","../src/services/config.ts","../src/form-engine/form/form.tsx","../src/form-engine/hooks/use-create-form.ts","../src/form-engine/utils.ts","../src/form-engine/model/index.ts","../src/form-engine/hooks/use-field.ts","../src/form-engine/contexts.ts","../src/form-engine/hooks/use-form.ts","../src/form-engine/fields/schema-field.tsx","../src/form-engine/fields/recursion-field.tsx","../src/form-engine/fields/reactive-field.tsx","../src/form-engine/fields/object-field.tsx","../src/form-engine/fields/general-field.tsx","../src/form-engine/fields/create-field.tsx","../src/services/form/factory.ts","../src/services/form/manager.ts","../src/services/test-run.ts","../src/services/pipeline/factory.ts","../src/services/pipeline/pipeline.ts","../src/services/pipeline/tap.ts","../src/services/store.ts","../src/reactive/hooks/use-create-form.ts","../src/reactive/hooks/use-test-run-service.ts"],"sourcesContent":["/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nexport { createTestRunPlugin } from './create-test-run-plugin';\nexport { useCreateForm, useTestRunService } from './reactive';\n\nexport {\n FormEngine,\n connect,\n type FormInstance,\n type FormEngineProps,\n type FormSchema,\n type FormComponentProps,\n} from './form-engine';\n\nexport {\n type TestRunPipelinePlugin,\n TestRunPipelineEntity,\n type TestRunPipelineEntityCtx,\n type TestRunConfig,\n} from './services';\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { definePluginCreator } from '@flowgram.ai/core';\n\nimport { TestRunFormEntity, TestRunFormFactory, TestRunFormManager } from './services/form';\nimport {\n TestRunService,\n TestRunPipelineEntity,\n TestRunPipelineFactory,\n TestRunConfig,\n defineConfig,\n} from './services';\n\nexport const createTestRunPlugin = definePluginCreator<Partial<TestRunConfig>>({\n onBind: ({ bind }, opt) => {\n /** service */\n bind(TestRunService).toSelf().inSingletonScope();\n /** config */\n bind(TestRunConfig).toConstantValue(defineConfig(opt));\n /** form manager */\n bind(TestRunFormManager).toSelf().inSingletonScope();\n /** form entity */\n bind<TestRunFormFactory>(TestRunFormFactory).toFactory<TestRunFormEntity>((context) => () => {\n const e = context.container.resolve(TestRunFormEntity);\n return e;\n });\n /** pipeline entity */\n bind<TestRunPipelineFactory>(TestRunPipelineFactory).toFactory<TestRunPipelineEntity>(\n (context) => () => {\n const e = context.container.resolve(TestRunPipelineEntity);\n e.container = context.container.createChild();\n return e;\n }\n );\n },\n});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createElement, type ReactNode } from 'react';\n\nimport { nanoid } from 'nanoid';\nimport { injectable, inject } from 'inversify';\nimport { Emitter } from '@flowgram.ai/utils';\n\nimport { TestRunConfig } from '../config';\nimport { FormSchema, FormEngine, type FormInstance, type FormEngineProps } from '../../form-engine';\n\nexport type FormRenderProps = Omit<\n FormEngineProps,\n 'schema' | 'components' | 'onMounted' | 'onUnmounted'\n>;\n\n@injectable()\nexport class TestRunFormEntity {\n @inject(TestRunConfig) private readonly config: TestRunConfig;\n\n private _schema: FormSchema;\n\n private initialized = false;\n\n id = nanoid();\n\n form: FormInstance | null = null;\n\n onFormMountedEmitter = new Emitter<FormInstance>();\n\n onFormMounted = this.onFormMountedEmitter.event;\n\n onFormUnmountedEmitter = new Emitter<void>();\n\n onFormUnmounted = this.onFormUnmountedEmitter.event;\n\n get schema() {\n return this._schema;\n }\n\n init(options: { schema: FormSchema }) {\n if (this.initialized) return;\n\n this._schema = options.schema;\n this.initialized = true;\n }\n\n render(props?: FormRenderProps): ReactNode {\n if (!this.initialized) {\n return null;\n }\n const { children, ...restProps } = props || {};\n return createElement(\n FormEngine,\n {\n schema: this.schema,\n components: this.config.components,\n onMounted: (instance) => {\n this.form = instance;\n this.onFormMountedEmitter.fire(instance);\n },\n onUnmounted: this.onFormUnmountedEmitter.fire.bind(this.onFormUnmountedEmitter),\n ...restProps,\n },\n children\n );\n }\n\n dispose() {\n this._schema = {};\n this.form = null;\n this.onFormMountedEmitter.dispose();\n this.onFormUnmountedEmitter.dispose();\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { FlowNodeType, FlowNodeEntity } from '@flowgram.ai/document';\n\nimport type { MaybePromise } from '../types';\nimport type { FormSchema, FormComponents } from '../form-engine';\nimport type { TestRunPipelinePlugin } from './pipeline';\n\ntype PropertiesFunctionParams = {\n node: FlowNodeEntity;\n};\nexport type NodeMap = Record<FlowNodeType, NodeTestConfig>;\nexport interface NodeTestConfig {\n /** Enable node TestRun */\n enabled?: boolean;\n /** Input schema properties */\n properties?:\n | Record<string, FormSchema>\n | ((params: PropertiesFunctionParams) => MaybePromise<Record<string, FormSchema>>);\n}\n\nexport interface TestRunConfig {\n components: FormComponents;\n nodes: NodeMap;\n plugins: (new () => TestRunPipelinePlugin)[];\n}\n\nexport const TestRunConfig = Symbol('TestRunConfig');\nexport const defineConfig = (config: Partial<TestRunConfig>) => {\n const defaultConfig: TestRunConfig = {\n components: {},\n nodes: {},\n plugins: [],\n };\n return {\n ...defaultConfig,\n ...config,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Form } from '@flowgram.ai/form';\n\nimport { FormSchema, FormComponents } from '../types';\nimport { useCreateForm, type UseCreateFormOptions } from '../hooks';\nimport { createSchemaField } from '../fields';\n\nconst SchemaField = createSchemaField({});\n\nexport type FormEngineProps = React.PropsWithChildren<\n {\n /** Form schema */\n schema: FormSchema;\n /** form material map */\n components?: FormComponents;\n } & UseCreateFormOptions\n>;\n\nexport const FormEngine: React.FC<FormEngineProps> = ({\n schema,\n components,\n children,\n ...props\n}) => {\n const { model, control } = useCreateForm(schema, props);\n\n return (\n <Form control={control}>\n <SchemaField model={model} components={components}>\n {children}\n </SchemaField>\n </Form>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useEffect, useMemo } from 'react';\n\nimport type { OnFormValuesChangePayload } from '@flowgram.ai/form-core';\nimport { createForm, ValidateTrigger, type IForm } from '@flowgram.ai/form';\n\nimport { createValidate } from '../utils';\nimport { FormSchema, FormSchemaValidate } from '../types';\nimport { FormSchemaModel } from '../model';\n\nexport interface FormInstance {\n model: FormSchemaModel;\n form: IForm;\n}\nexport interface UseCreateFormOptions {\n defaultValues?: any;\n validate?: Record<string, FormSchemaValidate>;\n validateTrigger?: ValidateTrigger;\n onMounted?: (form: FormInstance) => void;\n onFormValuesChange?: (payload: OnFormValuesChangePayload) => void;\n onUnmounted?: () => void;\n}\n\nexport const useCreateForm = (schema: FormSchema, options: UseCreateFormOptions = {}) => {\n const { form, control } = useMemo(\n () =>\n createForm({\n validate: {\n ...createValidate(schema),\n ...options.validate,\n },\n validateTrigger: options.validateTrigger ?? ValidateTrigger.onBlur,\n }),\n [schema]\n );\n\n const model = useMemo(\n () => new FormSchemaModel({ type: 'object', ...schema, defaultValue: options.defaultValues }),\n [schema]\n );\n\n /** Lifecycle and event binding */\n useEffect(() => {\n if (options.onMounted) {\n options.onMounted({ model, form });\n }\n const disposable = control._formModel.onFormValuesChange((payload) => {\n if (options.onFormValuesChange) {\n options.onFormValuesChange(payload);\n }\n });\n return () => {\n disposable.dispose();\n if (options.onUnmounted) {\n options.onUnmounted();\n }\n };\n }, [control]);\n\n return {\n form,\n control,\n model,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createElement } from 'react';\n\nimport type { FormSchema, FormSchemaValidate, FormComponentProps } from './types';\n\n/** Splice form item unique name */\nexport const getUniqueFieldName = (...args: (string | undefined)[]) =>\n args.filter((path) => path).join('.');\n\nexport const mergeFieldPath = (path?: string[], name?: string) =>\n [...(path || []), name].filter((i): i is string => Boolean(i));\n\n/** Create validation rules */\nexport const createValidate = (schema: FormSchema) => {\n const rules: Record<string, FormSchemaValidate> = {};\n\n visit(schema);\n\n return rules;\n\n function visit(current: FormSchema, name?: string) {\n if (name && current['x-validator']) {\n rules[name] = current['x-validator'];\n }\n if (current.type === 'object' && current.properties) {\n Object.entries(current.properties).forEach(([key, value]) => {\n visit(value, getUniqueFieldName(name, key));\n });\n }\n }\n};\n\nexport const connect = <T = any>(\n Component: React.FunctionComponent<any>,\n mapProps: (p: FormComponentProps) => T\n) => {\n const Connected = (props: FormComponentProps) => {\n const mappedProps = mapProps(props);\n return createElement(Component, mappedProps, (mappedProps as any).children);\n };\n\n return Connected;\n};\n\nexport const isFormEmpty = (schema: FormSchema) => {\n /** is not general field and not has children */\n const isEmpty = (s: FormSchema): boolean => {\n if (!s.type || s.type === 'object' || !s.name) {\n return Object.entries(schema.properties || {})\n .map(([key, value]) => ({\n name: key,\n ...value,\n }))\n .every(isFormEmpty);\n }\n return false;\n };\n\n return isEmpty(schema);\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { ReactiveState } from '@flowgram.ai/reactive';\n\nimport { getUniqueFieldName, mergeFieldPath } from '../utils';\nimport { FormSchema, FormSchemaType, FormSchemaModelState } from '../types';\n\nexport class FormSchemaModel implements FormSchema {\n name?: string;\n\n type?: FormSchemaType;\n\n defaultValue?: any;\n\n properties?: Record<string, FormSchema>;\n\n ['x-index']?: number;\n\n ['x-component']?: string;\n\n ['x-component-props']?: Record<string, unknown>;\n\n ['x-decorator']?: string;\n\n ['x-decorator-props']?: Record<string, unknown>;\n\n [key: string]: any;\n\n path: string[] = [];\n\n state = new ReactiveState<FormSchemaModelState>({ disabled: false });\n\n get componentType() {\n return this['x-component'];\n }\n\n get componentProps() {\n return this['x-component-props'];\n }\n\n get decoratorType() {\n return this['x-decorator'];\n }\n\n get decoratorProps() {\n return this['x-decorator-props'];\n }\n\n get uniqueName() {\n return getUniqueFieldName(...this.path);\n }\n\n constructor(json: FormSchema, path: string[] = []) {\n this.fromJSON(json);\n this.path = path;\n }\n\n private fromJSON(json: FormSchema) {\n Object.entries(json).forEach(([key, value]) => {\n this[key] = value;\n });\n }\n\n getPropertyList() {\n const orderProperties: FormSchemaModel[] = [];\n const unOrderProperties: FormSchemaModel[] = [];\n Object.entries(this.properties || {}).forEach(([key, item]) => {\n const index = item['x-index'];\n const defaultValues = this.defaultValue;\n /**\n * The upper layer's default value has a higher priority than its own default value,\n * because the upper layer's default value ultimately comes from the outside world.\n */\n if (typeof defaultValues === 'object' && defaultValues !== null && key in defaultValues) {\n item.defaultValue = defaultValues[key];\n }\n const current = new FormSchemaModel(item, mergeFieldPath(this.path, key));\n if (index !== undefined && !isNaN(index)) {\n orderProperties[index] = current;\n } else {\n unOrderProperties.push(current);\n }\n });\n return orderProperties.concat(unOrderProperties).filter((item) => !!item);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useContext } from 'react';\n\nimport { useObserve } from '@flowgram.ai/reactive';\n\nimport { FieldModelContext } from '../contexts';\n\nexport const useFieldModel = () => useContext(FieldModelContext);\nexport const useFieldState = () => useObserve(useFieldModel().state.value);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createContext } from 'react';\n\nimport type { FormComponents } from './types';\nimport type { FormSchemaModel } from './model';\n\n/** Model context for each form item */\nexport const FieldModelContext = createContext<FormSchemaModel>({} as any);\n/** The form's model context */\nexport const FormModelContext = createContext<FormSchemaModel>({} as any);\n/** Context of material component map */\nexport const ComponentsContext = createContext<FormComponents>({});\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useContext } from 'react';\n\nimport { useObserve } from '@flowgram.ai/reactive';\n\nimport { FormModelContext } from '../contexts';\n\nexport const useFormModel = () => useContext(FormModelContext);\nexport const useFormState = () => useObserve(useFormModel().state.value);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useState } from 'react';\n\nimport type { FormComponents } from '../types';\nimport { FormSchemaModel } from '../model';\nimport { ComponentsContext, FormModelContext } from '../contexts';\nimport { RecursionField } from './recursion-field';\n\nexport interface SchemaFieldProps {\n model: FormSchemaModel;\n components: FormComponents;\n}\nexport const SchemaField: React.FC<React.PropsWithChildren<SchemaFieldProps>> = ({\n components,\n model,\n children,\n}) => {\n /** Only initialized once, dynamic is not supported */\n const [innerComponents] = useState(() => components);\n return (\n <ComponentsContext.Provider value={innerComponents}>\n <FormModelContext.Provider value={model}>\n <RecursionField model={model} />\n {children}\n </FormModelContext.Provider>\n </ComponentsContext.Provider>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useMemo } from 'react';\n\nimport { FormSchemaModel } from '../model';\nimport { ObjectField } from './object-field';\nimport { GeneralField } from './general-field';\n\ninterface RecursionFieldProps {\n model: FormSchemaModel;\n}\n\nexport const RecursionField: React.FC<RecursionFieldProps> = ({ model }) => {\n const properties = useMemo(() => model.getPropertyList(), [model]);\n\n /** general field has no children */\n if (model.type !== 'object') {\n return <GeneralField model={model} />;\n }\n\n return (\n <ObjectField model={model}>\n {properties.map((item) => (\n <RecursionField key={item.uniqueName} model={item} />\n ))}\n </ObjectField>\n );\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useContext } from 'react';\nimport React from 'react';\n\nimport { useFormState } from '../hooks/use-form';\nimport { useFieldModel, useFieldState } from '../hooks/use-field';\nimport { ComponentsContext } from '../contexts';\n\ninterface ReactiveFieldProps {\n componentProps?: Record<string, unknown>;\n decoratorProps?: Record<string, unknown>;\n}\n\nexport const ReactiveField: React.FC<React.PropsWithChildren<ReactiveFieldProps>> = (props) => {\n const formState = useFormState();\n const model = useFieldModel();\n const modelState = useFieldState();\n const components = useContext(ComponentsContext);\n\n const disabled = modelState.disabled || formState.disabled;\n const componentRender = () => {\n if (!model.componentType || !components[model.componentType]) {\n return props.children;\n }\n return React.createElement(\n components[model.componentType],\n {\n disabled,\n ...model.componentProps,\n ...props.componentProps,\n },\n props.children\n );\n };\n\n const decoratorRender = (children: React.ReactNode) => {\n if (!model.decoratorType || !components[model.decoratorType]) {\n return <>{children}</>;\n }\n return React.createElement(\n components[model.decoratorType],\n {\n type: model.type,\n required: model.required,\n ...model.decoratorProps,\n ...props.decoratorProps,\n },\n children\n );\n };\n\n return decoratorRender(componentRender());\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { FormSchemaModel } from '../model';\nimport { FieldModelContext } from '../contexts';\nimport { ReactiveField } from './reactive-field';\n\nexport interface ObjectFieldProps {\n model: FormSchemaModel;\n}\n\nexport const ObjectField: React.FC<React.PropsWithChildren<ObjectFieldProps>> = ({\n model,\n children,\n}) => (\n <FieldModelContext.Provider value={model}>\n <ReactiveField>{children}</ReactiveField>\n </FieldModelContext.Provider>\n);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { Field } from '@flowgram.ai/form';\n\nimport { ReactiveField } from './reactive-field';\nimport type { FormSchemaModel } from '../model';\nimport { FieldModelContext } from '../contexts';\n\nexport interface GeneralFieldProps {\n model: FormSchemaModel;\n}\n\nexport const GeneralField: React.FC<GeneralFieldProps> = ({ model }) => (\n <FieldModelContext.Provider value={model}>\n <Field\n name={model.uniqueName}\n defaultValue={model.defaultValue}\n render={({ field, fieldState }) => (\n <ReactiveField\n componentProps={{\n value: field.value,\n onChange: field.onChange,\n onFocus: field.onFocus,\n onBlur: field.onBlur,\n ...fieldState,\n }}\n decoratorProps={fieldState}\n />\n )}\n />\n </FieldModelContext.Provider>\n);\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { PropsWithChildren } from 'react';\n\nimport { SchemaField, type SchemaFieldProps } from './schema-field';\nimport { FormComponents } from '../types';\n\ntype InnerSchemaFieldProps = Omit<SchemaFieldProps, 'components'> &\n Pick<Partial<SchemaFieldProps>, 'components'>;\n\nexport interface CreateSchemaFieldOptions {\n components?: FormComponents;\n}\nexport const createSchemaField = (options: CreateSchemaFieldOptions) => {\n const InnerSchemaField: React.FC<PropsWithChildren<InnerSchemaFieldProps>> = ({\n components,\n ...props\n }) => (\n <SchemaField\n components={{\n ...options.components,\n ...components,\n }}\n {...props}\n />\n );\n\n return InnerSchemaField;\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { TestRunFormEntity } from './form';\n\nexport const TestRunFormFactory = Symbol('TestRunFormFactory');\nexport type TestRunFormFactory = () => TestRunFormEntity;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, injectable } from 'inversify';\n\nimport type { TestRunFormEntity } from './form';\nimport { TestRunFormFactory } from './factory';\n\n@injectable()\nexport class TestRunFormManager {\n @inject(TestRunFormFactory) private readonly factory: TestRunFormFactory;\n\n private entities = new Map<string, TestRunFormEntity>();\n\n createForm() {\n return this.factory();\n }\n\n getForm(id: string) {\n return this.entities.get(id);\n }\n\n getAllForm() {\n return Array.from(this.entities);\n }\n\n disposeForm(id: string) {\n const form = this.entities.get(id);\n if (!form) {\n return;\n }\n form.dispose();\n this.entities.delete(id);\n }\n\n disposeAllForm() {\n for (const id of this.entities.keys()) {\n this.disposeForm(id);\n }\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { inject, injectable } from 'inversify';\nimport { Disposable, DisposableCollection, Emitter } from '@flowgram.ai/utils';\nimport type { FlowNodeEntity, FlowNodeType } from '@flowgram.ai/document';\n\nimport { TestRunPipelineFactory } from './pipeline/factory';\nimport { TestRunFormManager } from './form';\nimport { FormSchema } from '../form-engine';\nimport { TestRunPipelineEntity, type TestRunPipelineEntityOptions } from './pipeline';\nimport { TestRunConfig } from './config';\n\n@injectable()\nexport class TestRunService {\n @inject(TestRunConfig) private readonly config: TestRunConfig;\n\n @inject(TestRunPipelineFactory) private readonly pipelineFactory: TestRunPipelineFactory;\n\n @inject(TestRunFormManager) readonly formManager: TestRunFormManager;\n\n pipelineEntities = new Map<string, TestRunPipelineEntity>();\n\n pipelineBindings = new Map<string, Disposable>();\n\n onPipelineProgressEmitter = new Emitter();\n\n onPipelineProgress = this.onPipelineProgressEmitter.event;\n\n onPipelineFinishedEmitter = new Emitter();\n\n onPipelineFinished = this.onPipelineFinishedEmitter.event;\n\n public isEnabled(nodeType: FlowNodeType) {\n const config = this.config.nodes[nodeType];\n return config && config?.enabled !== false;\n }\n\n async toSchema(node: FlowNodeEntity) {\n const nodeType = node.flowNodeType;\n const config = this.config.nodes[nodeType];\n if (!this.isEnabled(nodeType)) {\n return {};\n }\n const properties =\n typeof config.properties === 'function'\n ? await config.properties({ node })\n : config.properties;\n\n return {\n type: 'object',\n properties,\n };\n }\n\n createFormWithSchema(schema: FormSchema) {\n const form = this.formManager.createForm();\n form.init({ schema });\n return form;\n }\n\n async createForm(node: FlowNodeEntity) {\n const schema = await this.toSchema(node);\n return this.createFormWithSchema(schema);\n }\n\n createPipeline(options: TestRunPipelineEntityOptions) {\n const pipeline = this.pipelineFactory();\n this.pipelineEntities.set(pipeline.id, pipeline);\n pipeline.init(options);\n return pipeline;\n }\n\n connectPipeline(pipeline: TestRunPipelineEntity) {\n if (this.pipelineBindings.get(pipeline.id)) {\n return;\n }\n const disposable = new DisposableCollection(\n pipeline.onProgress(this.onPipelineProgressEmitter.fire.bind(this.onPipelineProgressEmitter)),\n pipeline.onFinished(this.onPipelineFinishedEmitter.fire.bind(this.onPipelineFinishedEmitter))\n );\n this.pipelineBindings.set(pipeline.id, disposable);\n }\n\n disconnectPipeline(id: string) {\n if (this.pipelineBindings.has(id)) {\n const disposable = this.pipelineBindings.get(id);\n disposable?.dispose();\n this.pipelineBindings.delete(id);\n }\n }\n\n disconnectAllPipeline() {\n for (const id of this.pipelineBindings.keys()) {\n this.disconnectPipeline(id);\n }\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { TestRunPipelineEntity } from './pipeline';\n\nexport const TestRunPipelineFactory = Symbol('TestRunPipelineFactory');\nexport type TestRunPipelineFactory = () => TestRunPipelineEntity;\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport type { StoreApi } from 'zustand';\nimport { nanoid } from 'nanoid';\nimport { injectable, interfaces } from 'inversify';\nimport { Emitter } from '@flowgram.ai/utils';\n\nimport { Tap } from './tap';\nimport type { TestRunPipelinePlugin } from './plugin';\nimport { StoreService } from '../store';\nexport interface TestRunPipelineEntityOptions {\n plugins: (new () => TestRunPipelinePlugin)[];\n}\n\ninterface TestRunPipelineEntityState<T = any> {\n status: 'idle' | 'preparing' | 'executing' | 'canceled' | 'finished';\n data?: T;\n result?: any;\n getData: () => T;\n setData: (next: any) => void;\n}\n\nexport interface TestRunPipelineEntityCtx<T = any> {\n id: string;\n store: StoreApi<TestRunPipelineEntityState<T>>;\n operate: {\n update: (data: any) => void;\n cancel: () => void;\n };\n}\n\nconst initialState: Omit<TestRunPipelineEntityState, 'getData' | 'setData'> = {\n status: 'idle',\n data: {},\n};\n\n@injectable()\nexport class TestRunPipelineEntity extends StoreService<TestRunPipelineEntityState> {\n container: interfaces.Container | undefined;\n\n id = nanoid();\n\n prepare = new Tap<TestRunPipelineEntityCtx>();\n\n private execute?: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void;\n\n private progress?: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void;\n\n get status() {\n return this.getState().status;\n }\n\n set status(next: TestRunPipelineEntityState['status']) {\n this.setState({ status: next });\n }\n\n onProgressEmitter = new Emitter<any>();\n\n onProgress = this.onProgressEmitter.event;\n\n onFinishedEmitter = new Emitter();\n\n onFinished = this.onFinishedEmitter.event;\n\n constructor() {\n super((set, get) => ({\n ...initialState,\n getData: () => get().data || {},\n setData: (next: any) => set((state) => ({ ...state, data: { ...state.data, ...next } })),\n }));\n }\n\n public init(options: TestRunPipelineEntityOptions) {\n if (!this.container) {\n return;\n }\n const { plugins } = options;\n for (const PluginClass of plugins) {\n const plugin = this.container.resolve<TestRunPipelinePlugin>(PluginClass);\n plugin.apply(this);\n }\n }\n\n public registerExecute(fn: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void) {\n this.execute = fn;\n }\n\n public registerProgress(fn: (ctx: TestRunPipelineEntityCtx) => Promise<void> | void) {\n this.progress = fn;\n }\n\n async start<T>(options?: { data: T }) {\n const { data } = options || {};\n if (this.status !== 'idle') {\n return;\n }\n /** initialization data */\n this.setState({ data });\n const ctx: TestRunPipelineEntityCtx = {\n id: this.id,\n store: this.store,\n operate: {\n update: this.update.bind(this),\n cancel: this.cancel.bind(this),\n },\n };\n\n this.status = 'preparing';\n await this.prepare.call(ctx);\n if (this.status !== 'preparing') {\n return;\n }\n\n this.status = 'executing';\n if (this.execute) {\n await this.execute(ctx);\n }\n if (this.progress) {\n await this.progress(ctx);\n }\n if (this.status === 'executing') {\n this.status = 'finished';\n this.onFinishedEmitter.fire(this.getState().result);\n }\n }\n\n update(result: any) {\n this.setState({ result });\n this.onProgressEmitter.fire(result);\n }\n\n cancel() {\n if ((this.status = 'preparing')) {\n this.prepare.freeze();\n }\n this.status = 'canceled';\n }\n\n dispose() {}\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { MaybePromise } from '../../types';\n\ninterface TapValue<T> {\n name: string;\n fn: (arg: T) => MaybePromise<void>;\n}\n\nexport class Tap<T> {\n private taps: TapValue<T>[] = [];\n\n private frozen = false;\n\n tap(name: string, fn: TapValue<T>['fn']) {\n this.taps.push({ name, fn });\n }\n\n async call(ctx: T) {\n for (const tap of this.taps) {\n if (this.frozen) {\n return;\n }\n await tap.fn(ctx);\n }\n }\n\n freeze() {\n this.frozen = true;\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { createStore } from 'zustand/vanilla';\nimport type { StoreApi, StateCreator } from 'zustand';\nimport { injectable, unmanaged } from 'inversify';\n/**\n * 包含 Store 的 Service\n */\n@injectable()\nexport class StoreService<State> {\n store: StoreApi<State>;\n\n get getState() {\n return this.store.getState.bind(this.store);\n }\n\n get setState() {\n return this.store.setState.bind(this.store);\n }\n\n constructor(@unmanaged() stateCreator: StateCreator<State>) {\n this.store = createStore(stateCreator);\n }\n}\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useEffect, useMemo, useState } from 'react';\n\nimport { DisposableCollection } from '@flowgram.ai/utils';\nimport type { FlowNodeEntity } from '@flowgram.ai/document';\n\nimport { TestRunFormEntity } from '../../services/form/form';\nimport { FormEngineProps, isFormEmpty } from '../../form-engine';\nimport { useTestRunService } from './use-test-run-service';\n\ninterface UseFormOptions {\n node?: FlowNodeEntity;\n /** form loading */\n loadingRenderer?: React.ReactNode;\n /** form empty */\n emptyRenderer?: React.ReactNode;\n defaultValues?: FormEngineProps['defaultValues'];\n onMounted?: FormEngineProps['onMounted'];\n onUnmounted?: FormEngineProps['onUnmounted'];\n onFormValuesChange?: FormEngineProps['onFormValuesChange'];\n}\n\nexport const useCreateForm = ({\n node,\n loadingRenderer,\n emptyRenderer,\n defaultValues,\n onMounted,\n onUnmounted,\n onFormValuesChange,\n}: UseFormOptions) => {\n const testRun = useTestRunService();\n const [loading, setLoading] = useState(false);\n const [form, setForm] = useState<TestRunFormEntity | null>(null);\n const renderer = useMemo(() => {\n if (loading || !form) {\n return loadingRenderer;\n }\n\n const isEmpty = isFormEmpty(form.schema);\n\n return form.render({\n defaultValues,\n onFormValuesChange,\n children: isEmpty ? emptyRenderer : null,\n });\n }, [form, loading]);\n\n const compute = async () => {\n if (!node) {\n return;\n }\n try {\n setLoading(true);\n const formEntity = await testRun.createForm(node);\n setForm(formEntity);\n } finally {\n setLoading(false);\n }\n };\n\n useEffect(() => {\n compute();\n }, [node]);\n\n useEffect(() => {\n if (!form) {\n return;\n }\n const disposable = new DisposableCollection(\n form.onFormMounted((data) => {\n onMounted?.(data);\n }),\n form.onFormUnmounted(() => {\n onUnmounted?.();\n })\n );\n return () => disposable.dispose();\n }, [form]);\n\n return {\n renderer,\n loading,\n form,\n };\n};\n","/**\n * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates\n * SPDX-License-Identifier: MIT\n */\n\nimport { useService } from '@flowgram.ai/core';\n\nimport { TestRunService } from '../../services/test-run';\n\nexport const useTestRunService = () => useService<TestRunService>(TestRunService);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA;AAAA;AAAA;;;ACKA,kBAAoC;;;ACApC,IAAAC,iBAA8C;AAE9C,oBAAuB;AACvB,uBAAmC;AACnC,IAAAC,gBAAwB;;;ACqBjB,IAAM,gBAAgB,OAAO,eAAe;AAC5C,IAAM,eAAe,CAAC,WAAmC;AAC9D,QAAM,gBAA+B;AAAA,IACnC,YAAY,CAAC;AAAA,IACb,OAAO,CAAC;AAAA,IACR,SAAS,CAAC;AAAA,EACZ;AACA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACF;;;ACpCA,IAAAC,eAAqB;;;ACArB,IAAAC,gBAAmC;AAGnC,kBAAwD;;;ACHxD,mBAA8B;AAKvB,IAAM,qBAAqB,IAAI,SACpC,KAAK,OAAO,CAAC,SAAS,IAAI,EAAE,KAAK,GAAG;AAE/B,IAAM,iBAAiB,CAAC,MAAiB,SAC9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AAA,IACH;AACA,WAAO,MAAM,WAAW,QAAQ;AAAA,EAClC,GAAG,CAAC,IAAI,CAAC;AAET,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["useCreateForm","import_react","import_utils","import_form","import_react","import_react","import_reactive","import_react","import_react","import_reactive","import_react","import_react","import_react","React","import_jsx_runtime","import_form","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","SchemaField","import_inversify","import_inversify","import_utils","import_nanoid","import_inversify","import_utils","import_inversify","import_react","import_utils","import_core","useCreateForm"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowgram.ai/test-run-plugin",
3
- "version": "0.1.0-alpha.21",
3
+ "version": "0.1.0-alpha.22",
4
4
  "homepage": "https://flowgram.ai/",
5
5
  "repository": "https://github.com/bytedance/flowgram.ai",
6
6
  "license": "MIT",
@@ -16,20 +16,20 @@
16
16
  "inversify": "^6.0.1",
17
17
  "nanoid": "^5.0.9",
18
18
  "zustand": "^5.0.8",
19
- "@flowgram.ai/form-core": "0.1.0-alpha.21",
20
- "@flowgram.ai/core": "0.1.0-alpha.21",
21
- "@flowgram.ai/utils": "0.1.0-alpha.21",
22
- "@flowgram.ai/document": "0.1.0-alpha.21",
23
- "@flowgram.ai/reactive": "0.1.0-alpha.21",
24
- "@flowgram.ai/form": "0.1.0-alpha.21"
19
+ "@flowgram.ai/form-core": "0.1.0-alpha.22",
20
+ "@flowgram.ai/utils": "0.1.0-alpha.22",
21
+ "@flowgram.ai/document": "0.1.0-alpha.22",
22
+ "@flowgram.ai/form": "0.1.0-alpha.22",
23
+ "@flowgram.ai/core": "0.1.0-alpha.22",
24
+ "@flowgram.ai/reactive": "0.1.0-alpha.22"
25
25
  },
26
26
  "devDependencies": {
27
27
  "react": "^18",
28
28
  "@types/react": "^18",
29
29
  "tsup": "^8.0.1",
30
30
  "typescript": "^5.8.3",
31
- "@flowgram.ai/eslint-config": "0.1.0-alpha.21",
32
- "@flowgram.ai/ts-config": "0.1.0-alpha.21"
31
+ "@flowgram.ai/eslint-config": "0.1.0-alpha.22",
32
+ "@flowgram.ai/ts-config": "0.1.0-alpha.22"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": ">=16.8"
@@ -9,13 +9,13 @@ CLI tsup v8.5.0
9
9
  CLI Target: es2020
10
10
  CJS Build start
11
11
  ESM Build start
12
+ CJS dist/index.js 22.70 KB
13
+ CJS dist/index.js.map 45.04 KB
14
+ CJS ⚡️ Build success in 151ms
12
15
  ESM dist/esm/index.js 19.95 KB
13
16
  ESM dist/esm/index.js.map 44.65 KB
14
- ESM ⚡️ Build success in 150ms
15
- CJS dist/index.js 22.70 KB
16
- CJS dist/index.js.map 45.02 KB
17
- CJS ⚡️ Build success in 153ms
17
+ ESM ⚡️ Build success in 152ms
18
18
  DTS Build start
19
- DTS ⚡️ Build success in 3859ms
20
- DTS dist/index.d.ts 9.95 KB
21
- DTS dist/index.d.mts 9.95 KB
19
+ DTS ⚡️ Build success in 3709ms
20
+ DTS dist/index.d.ts 9.96 KB
21
+ DTS dist/index.d.mts 9.96 KB
package/src/index.ts CHANGED
@@ -19,4 +19,5 @@ export {
19
19
  type TestRunPipelinePlugin,
20
20
  TestRunPipelineEntity,
21
21
  type TestRunPipelineEntityCtx,
22
+ type TestRunConfig,
22
23
  } from './services';