mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
feat(materials): set form-materials to esm (#279)
This commit is contained in:
parent
46dda28464
commit
83221a61b6
@ -9,7 +9,7 @@ export function MaterialDisplay(props: any) {
|
||||
command={{
|
||||
'By Import': `import { ${props.exportName} } from '@flowgram.ai/materials'`,
|
||||
// components/type-selector/index.tsx -> components/type-selector
|
||||
'By CLI': `npx @flowgram.ai/form-materials ${props.filePath
|
||||
'By CLI': `npx @flowgram.ai/form-materials@latest ${props.filePath
|
||||
.split('/')
|
||||
.slice(0, -1)
|
||||
.join('/')}`,
|
||||
|
||||
@ -21,7 +21,7 @@ import { JsonSchemaEditor } from '@flowgram.ai/form-materials'
|
||||
If customization of components is required (e.g., changing text, styles, or business logic), it is recommended to **add the material source code to the project for customization via CLI**:
|
||||
|
||||
```bash
|
||||
npx @flowgram.ai/form-materials
|
||||
npx @flowgram.ai/form-materials@latest
|
||||
```
|
||||
|
||||
After running, the CLI will prompt the user to select the material to add to the project:
|
||||
@ -36,7 +36,7 @@ After running, the CLI will prompt the user to select the material to add to the
|
||||
Users can also directly add the source code of a specified material via CLI:
|
||||
|
||||
```bash
|
||||
npx @flowgram.ai/form-materials components/json-schema-editor
|
||||
npx @flowgram.ai/form-materials@latest components/json-schema-editor
|
||||
```
|
||||
|
||||
After the CLI runs successfully, the relevant materials will be automatically added to the `src/form-materials` directory in the current project.
|
||||
|
||||
@ -22,7 +22,7 @@ import { JsonSchemaEditor } from '@flowgram.ai/form-materials'
|
||||
如果业务对组件有定制诉求(如:更改文案、样式、业务逻辑),推荐 **通过 CLI 将物料源代码添加到项目中进行定制**:
|
||||
|
||||
```bash
|
||||
npx @flowgram.ai/form-materials
|
||||
npx @flowgram.ai/form-materials@latest
|
||||
```
|
||||
|
||||
运行后 CLI 会提示用户选择要添加到项目中的物料:
|
||||
@ -37,7 +37,7 @@ npx @flowgram.ai/form-materials
|
||||
使用者也可以直接在 CLI 中添加指定物料的源代码:
|
||||
|
||||
```bash
|
||||
npx @flowgram.ai/form-materials components/json-schema-editor
|
||||
npx @flowgram.ai/form-materials@latest components/json-schema-editor
|
||||
```
|
||||
|
||||
CLI 运行成功后,相关物料会自动添加到当前项目下的 `src/form-materials` 目录下
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
"homepage": "https://flowgram.ai/",
|
||||
"repository": "https://github.com/bytedance/flowgram.ai",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/esm/index.js",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user