v0.2.0

bytedance/flowgram.aiv0.2.0May 22, 2025by xiamidaxia

AI Summary

v0.2.0 is a feature, fix, and performance release from ByteDance for their flowgram.ai project, dated 2025-05-22. This release includes bug fixes for freeLayout shortcuts, new loop batch variable materials with updated ref value typings, and significant breaking changes to the value schema and VariableSelector API.

Key Highlights

  • Fixed freeLayout delete shortcuts (PR #251)
  • Added loop batch variable materials with updated ref value typings (PR #253)
  • Added publish minor pipeline for easier releases (PR #254)
  • Major breaking change: VariableSelector value type changed from string to string[]
  • Breaking change: Value schema restructured with new interface types (IFlowConstantValue, IFlowRefValue, etc.)

Breaking Changes

  • VariableSelector value changed from `string` to `string[]` in @flowgram.ai/form-materials
  • Value schema updated in layout editors - ref content changed from `string` to `string[]`, and interfaces restructured (IFlowConstantValue, IFlowRefValue, IFlowExpressionValue, IFlowTemplateValue)
  • Output variable key format changed from `${node.id}.outputs` to `${node.id}` in demo's sync-variable-plugin.ts

New Features

  • Loop batch variable materials support
  • Updated ref value typings (string[] for ref content)
  • New IFlowConstantValue, IFlowRefValue, IFlowExpressionValue, and IFlowTemplateValue interfaces
  • Publish minor pipeline for automated releases

Full Release Notes

🚀 v0.2.0 - Feature | Fix | Performance
📅 date:2025-05-22

## What's Changed
* fix(demo): freeLayout delete shortcuts fixed by @xiamidaxia in https://github.com/bytedance/flowgram.ai/pull/251
* feat(variable): loop batch variable materials + update ref value typings by @sanmaopep in https://github.com/bytedance/flowgram.ai/pull/253
* chore: add publish minor pipeline by @sanmaopep in https://github.com/bytedance/flowgram.ai/pull/254

![image](https://github.com/user-attachments/assets/83318b83-006e-49f5-aac7-63f11e919f7e)


## ⚠️ Breaking Change
* In @flowgram.ai/form-materials: Value of `VariableSelector` is changed from `string` to `string[]`
```typescript
// 0.1.x
interface VariableSelectorPropsType {
 value: string;
 // ...more
}
// 0.2.x
interface VariableSelectorPropsType {
 value: string[];
 // ...more
}
```
* In `@flowgram.ai/free-layout-editor` or `@flowgram.ai/fixed-layout-editor`: Value schema is updated
```typescript
// 0.1.x
export type FlowLiteralValueSchema = string | number | boolean;
export type FlowRefValueSchema =
  | { type: 'ref'; content?: string }
  | { type: 'expression'; content?: string }
  | { type: 'template'; content?: string };
export type FlowValueSchema = FlowLiteralValueSchema | FlowRefValueSchema;

// 0.2.x
export interface IFlowConstantValue {
  type: 'constant';
  content?: string | number | boolean;
}
export interface IFlowRefValue {
  type: 'ref';
  content?: string[];
}
export interface IFlowExpressionValue {
  type: 'expression';
  content?: string;
}
export interface IFlowTemplateValue {
  type: 'template';
  content?: string;
}

export type IFlowValue =
  | IFlowConstantValue
  | IFlowRefValue
  | IFlowExpressionValue
  | IFlowTemplateValue;
```
* outputs variable key in demo is updated
```typescript
// 0.1.x sync-variable-plugin.ts
 variableData.setVar(
  ASTFactory.createVariableDeclaration({
    meta: {
      title: `${title}`,
      icon: node.getNodeRegistry()?.info?.icon,
      // NOTICE: You can add more metadata here as needed
    },
    key: `${node.id}.outputs`,
    type: typeAST,
  })
);
// 0.2.x sync-variable-plugin.ts
 variableData.setVar(
  ASTFactory.createVariableDeclaration({
    meta: {
      title: `${title}`,
      icon: node.getNodeRegistry()?.info?.icon,
      // NOTICE: You can add more metadata here as needed
    },
    key: `${node.id}`,
    type: typeAST,
  })
);
```

**Full Changelog**: https://github.com/bytedance/flowgram.ai/compare/v0.1.31...v0.2.0