v0.3.0

bytedance/flowgram.aiv0.3.0Jul 30, 2025by xiamidaxia

AI Summary

This major release (v0.3.0) introduces a significant architectural refactoring with the TypeManager system to centrally manage type-related logic, replacing the previous approach that required modifying multiple materials when adding new types. The release also adds a new @flowgram.ai/json-schema package, improves JSON input for Object and Array types, and provides DisplayInputsValues and DisplayOutputs components for auto-refreshing variable types in node cards.

Key Highlights

  • Introduced TypeManager for unified type management through plugins instead of modifying multiple materials
  • New @flowgram.ai/json-schema package for JSON schema materials
  • Added createTypePresetPlugin for plugin-based type definitions
  • Improved Constant JSON Input for Object and Array types
  • New DisplayInputsValues and DisplayOutputs components for auto-refreshing variable types in node cards

Breaking Changes

  • Type management architecture has been refactored - types are now managed through TypeManager plugins rather than direct material modifications

New Features

  • TypeManager system for centralized type logic management
  • @flowgram.ai/json-schema package
  • createTypePresetPlugin for defining custom types via plugins
  • Enhanced JSON Input component for Object and Array types
  • DisplayInputsValues component for displaying input values with auto type refresh
  • DisplayOutputs component with displayFromScope for fetching variables from variable engine

Full Release Notes

## What's Changed
* feat(variable): add @flowgram.ai/json-schema and adjust json schema's materials by @sanmaopep in https://github.com/bytedance/flowgram.ai/pull/602

### Introduce TypeManager to manage type-related logics
We refactored the materials related to types. 
All type logic is converged through `typeManager` to prevent changes to types from spreading to a huge amout of materials.
- In version 0.2, when we added a new type, we needed to modify multiple materials such as `ConstantInput` and `TypeSelector`, causing a domino effect. 
- In version 0.3, unified management can be achieved through plugins:

```typescript
import { createTypePresetPlugin  } from '@flowgram.ai/form-materials'

createTypePresetPlugin({
  types: [
    {
      type: 'file',
      label: 'File',
      icon: <svg>xxxx</svg>,
      ConstantRenderer: () => {
        // ...
      },
    },
  ],
});
```

### Constant Json Input for Object and Array Type

We update Json Input for Object and Array Type

<img width="481" height="126" alt="image" src="https://github.com/user-attachments/assets/9aabc4c6-7303-4ebd-aed5-724f8c41d965" />

### `DisplayInputsValues` and  `DisplayOutputs`

We provide `DisplayInputsValues` and `DisplayOutputs`, which will auto refresh variable type in node card

```typescript
// variable ref type will auto refreshed with this material
<Field<Record<string, IFlowValue | undefined> | undefined> name="inputsValues">
  {({ field }) => <DisplayInputsValues value={field.value} />}
</Field>

// displayFromScope will auto fetch variables information from variable engine in current scope
<DisplayOutputs displayFromScope />
```
Here is the demo:
![iShot_2025-07-30_16 34 22](https://github.com/user-attachments/assets/a7fe3748-e678-4597-b95b-0252080030bc)





**Full Changelog**: https://github.com/bytedance/flowgram.ai/compare/v0.2.32...v0.3.0