Browse Source

feat(material): form-material tree shake optimize + @flowgram.ai/coze-editor (#774)

* feat(material): name export

feat: flowgram form-material index name export

* feat: convert form-materials to rslib

* feat: coze-editor package

feat: coze-editor package

feat: remove worker logic

* fix: fs strict
Yiwei Mao 4 months ago
parent
commit
1d049a9fa6
79 changed files with 1475 additions and 209 deletions
  1. 5 0
      apps/demo-vite/vite.config.js
  2. 374 21
      common/config/rush/pnpm-lock.yaml
  3. 16 0
      packages/materials/coze-editor/.eslintrc.js
  4. 128 0
      packages/materials/coze-editor/package.json
  5. 56 0
      packages/materials/coze-editor/rslib.config.ts
  6. 113 0
      packages/materials/coze-editor/scripts/gen.js
  7. 1 1
      packages/materials/coze-editor/src/index.ts
  8. 6 0
      packages/materials/coze-editor/src/language-json.ts
  9. 6 0
      packages/materials/coze-editor/src/language-python.ts
  10. 6 0
      packages/materials/coze-editor/src/language-shell.ts
  11. 6 0
      packages/materials/coze-editor/src/language-typescript.ts
  12. 11 0
      packages/materials/coze-editor/src/language-typescript/worker.ts
  13. 7 0
      packages/materials/coze-editor/src/preset-code.ts
  14. 7 0
      packages/materials/coze-editor/src/preset-expression.ts
  15. 7 0
      packages/materials/coze-editor/src/preset-none.ts
  16. 7 0
      packages/materials/coze-editor/src/preset-prompt.ts
  17. 7 0
      packages/materials/coze-editor/src/preset-universal.ts
  18. 7 0
      packages/materials/coze-editor/src/preset-variable.ts
  19. 6 0
      packages/materials/coze-editor/src/react-merge.ts
  20. 1 1
      packages/materials/coze-editor/src/react.ts
  21. 6 0
      packages/materials/coze-editor/src/vscode.ts
  22. 15 0
      packages/materials/coze-editor/tsconfig.json
  23. 31 0
      packages/materials/coze-editor/vitest.config.ts
  24. 1 1
      packages/materials/coze-editor/vitest.setup.ts
  25. 14 13
      packages/materials/form-materials/package.json
  26. 62 0
      packages/materials/form-materials/rslib.config.ts
  27. 239 0
      packages/materials/form-materials/scripts/name-export.js
  28. 0 27
      packages/materials/form-materials/src/components/assign-row/components/blur-input.tsx
  29. 3 3
      packages/materials/form-materials/src/components/assign-row/index.tsx
  30. 1 1
      packages/materials/form-materials/src/components/assign-row/types.ts
  31. 1 1
      packages/materials/form-materials/src/components/batch-outputs/types.ts
  32. 10 9
      packages/materials/form-materials/src/components/code-editor/editor.tsx
  33. 27 0
      packages/materials/form-materials/src/components/code-editor/init-worker.ts
  34. 6 27
      packages/materials/form-materials/src/components/code-editor/language-features.ts
  35. 1 1
      packages/materials/form-materials/src/components/code-editor/theme/dark.ts
  36. 1 1
      packages/materials/form-materials/src/components/code-editor/theme/index.ts
  37. 1 1
      packages/materials/form-materials/src/components/code-editor/theme/light.ts
  38. 1 1
      packages/materials/form-materials/src/components/condition-row/hooks/useRule.ts
  39. 1 1
      packages/materials/form-materials/src/components/condition-row/types.ts
  40. 1 1
      packages/materials/form-materials/src/components/constant-input/index.tsx
  41. 1 1
      packages/materials/form-materials/src/components/db-condition-row/types.ts
  42. 1 1
      packages/materials/form-materials/src/components/display-flow-value/index.tsx
  43. 1 1
      packages/materials/form-materials/src/components/dynamic-value-input/hooks.ts
  44. 1 1
      packages/materials/form-materials/src/components/dynamic-value-input/index.tsx
  45. 50 25
      packages/materials/form-materials/src/components/index.ts
  46. 1 1
      packages/materials/form-materials/src/components/inputs-values-tree/row.tsx
  47. 1 1
      packages/materials/form-materials/src/components/inputs-values/index.tsx
  48. 1 1
      packages/materials/form-materials/src/components/inputs-values/types.ts
  49. 2 2
      packages/materials/form-materials/src/components/json-editor-with-variables/editor.tsx
  50. 1 1
      packages/materials/form-materials/src/components/json-editor-with-variables/extensions/variable-tag.tsx
  51. 3 3
      packages/materials/form-materials/src/components/json-editor-with-variables/extensions/variable-tree.tsx
  52. 4 4
      packages/materials/form-materials/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx
  53. 1 1
      packages/materials/form-materials/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx
  54. 3 3
      packages/materials/form-materials/src/components/prompt-editor-with-variables/extensions/variable-tree.tsx
  55. 2 2
      packages/materials/form-materials/src/components/prompt-editor/editor.tsx
  56. 2 2
      packages/materials/form-materials/src/components/prompt-editor/extensions/jinja.tsx
  57. 2 2
      packages/materials/form-materials/src/components/prompt-editor/extensions/language-support.tsx
  58. 2 2
      packages/materials/form-materials/src/components/prompt-editor/extensions/markdown.tsx
  59. 1 1
      packages/materials/form-materials/src/components/prompt-editor/types.tsx
  60. 1 1
      packages/materials/form-materials/src/effects/auto-rename-ref/index.ts
  61. 7 7
      packages/materials/form-materials/src/effects/index.ts
  62. 1 1
      packages/materials/form-materials/src/effects/listen-ref-schema-change/index.ts
  63. 1 1
      packages/materials/form-materials/src/effects/listen-ref-value-change/index.ts
  64. 1 1
      packages/materials/form-materials/src/effects/provide-batch-input/index.ts
  65. 1 1
      packages/materials/form-materials/src/form-plugins/batch-outputs-plugin/index.ts
  66. 3 3
      packages/materials/form-materials/src/form-plugins/index.ts
  67. 1 1
      packages/materials/form-materials/src/form-plugins/infer-assign-plugin/index.ts
  68. 6 0
      packages/materials/form-materials/src/hooks/index.ts
  69. 98 8
      packages/materials/form-materials/src/index.ts
  70. 11 2
      packages/materials/form-materials/src/plugins/index.ts
  71. 4 4
      packages/materials/form-materials/src/plugins/json-schema-preset/index.tsx
  72. 11 1
      packages/materials/form-materials/src/shared/flow-value/index.ts
  73. 0 0
      packages/materials/form-materials/src/shared/flow-value/types.ts
  74. 1 2
      packages/materials/form-materials/src/shared/flow-value/utils.ts
  75. 26 5
      packages/materials/form-materials/src/shared/index.ts
  76. 6 0
      packages/materials/form-materials/src/validate/index.ts
  77. 1 1
      packages/materials/form-materials/src/validate/validate-flow-value/index.tsx
  78. 7 4
      packages/materials/form-materials/tsconfig.json
  79. 9 0
      rush.json

+ 5 - 0
apps/demo-vite/vite.config.js

@@ -9,4 +9,9 @@ import react from '@vitejs/plugin-react';
 // https://vite.dev/config/
 export default defineConfig({
   plugins: [react()],
+  server: {
+    fs: {
+      strict: false,
+    },
+  },
 });

+ 374 - 21
common/config/rush/pnpm-lock.yaml

@@ -879,7 +879,7 @@ importers:
         version: 4.6.0(monaco-editor@0.52.2)(react-dom@18.3.1)(react@18.3.1)
       '@rsbuild/plugin-less':
         specifier: ^1.1.1
-        version: 1.1.1(@rsbuild/core@1.4.14)
+        version: 1.1.1(@rsbuild/core@1.5.3)
       '@rspress/core':
         specifier: 2.0.0-beta.24
         version: 2.0.0-beta.24(@types/react@18.3.16)(acorn@8.14.0)
@@ -2043,6 +2043,52 @@ importers:
         specifier: ^0.34.6
         version: 0.34.6(jsdom@22.1.0)
 
+  ../../packages/materials/coze-editor:
+    dependencies:
+      '@coze-editor/code-language-typescript':
+        specifier: 0.1.0-alpha.5a549c
+        version: 0.1.0-alpha.5a549c(@codemirror/language@6.10.7)(@codemirror/state@6.5.2)(@codemirror/view@6.38.0)(@coze-editor/code-language-shared@0.1.0-alpha.5a549c)(typescript@5.8.3)
+      '@coze-editor/editor':
+        specifier: 0.1.0-alpha.5a549c
+        version: 0.1.0-alpha.5a549c(@codemirror/autocomplete@6.18.4)(@codemirror/language@6.10.7)(@codemirror/merge@6.10.2)(@codemirror/state@6.5.2)(@codemirror/view@6.38.0)(@lezer/common@1.2.3)(@types/react@18.3.16)(react-dom@18.3.1)(react@18.3.1)(typescript@5.8.3)(vue@3.5.17)
+      styled-components:
+        specifier: '>=4'
+        version: 5.3.11(@babel/core@7.26.10)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)
+      typescript:
+        specifier: ^5.8.3
+        version: 5.8.3
+    devDependencies:
+      '@flowgram.ai/eslint-config':
+        specifier: workspace:*
+        version: link:../../../config/eslint-config
+      '@flowgram.ai/ts-config':
+        specifier: workspace:*
+        version: link:../../../config/ts-config
+      '@rslib/core':
+        specifier: ~0.12.4
+        version: 0.12.4(typescript@5.8.3)
+      '@types/react':
+        specifier: ^18
+        version: 18.3.16
+      '@types/react-dom':
+        specifier: ^18
+        version: 18.3.5(@types/react@18.3.16)
+      eslint:
+        specifier: ^8.54.0
+        version: 8.57.1
+      react:
+        specifier: ^18
+        version: 18.3.1
+      react-dom:
+        specifier: ^18
+        version: 18.3.1(react@18.3.1)
+      tsup:
+        specifier: ^8.0.1
+        version: 8.3.5(typescript@5.8.3)
+      vitest:
+        specifier: ^0.34.6
+        version: 0.34.6(jsdom@22.1.0)
+
   ../../packages/materials/fixed-semi-materials:
     dependencies:
       '@douyinfe/semi-icons':
@@ -2176,9 +2222,6 @@ importers:
       '@codemirror/view':
         specifier: ~6.38.0
         version: 6.38.0
-      '@coze-editor/editor':
-        specifier: 0.1.0-alpha.5a549c
-        version: 0.1.0-alpha.5a549c(@codemirror/autocomplete@6.18.4)(@codemirror/language@6.10.7)(@codemirror/merge@6.10.2)(@codemirror/state@6.5.2)(@codemirror/view@6.38.0)(@lezer/common@1.2.3)(@types/react@18.3.16)(react-dom@18.3.1)(react@18.3.1)(typescript@5.8.3)(vue@3.5.17)
       '@douyinfe/semi-icons':
         specifier: ^2.80.0
         version: 2.80.0(react@18.3.1)
@@ -2188,6 +2231,9 @@ importers:
       '@douyinfe/semi-ui':
         specifier: ^2.80.0
         version: 2.80.0(acorn@8.14.0)(react-dom@18.3.1)(react@18.3.1)
+      '@flowgram.ai/coze-editor':
+        specifier: workspace:*
+        version: link:../coze-editor
       '@flowgram.ai/editor':
         specifier: workspace:*
         version: link:../../client/editor
@@ -2203,9 +2249,6 @@ importers:
       nanoid:
         specifier: ^4.0.2
         version: 4.0.2
-      typescript:
-        specifier: ^5.8.3
-        version: 5.8.3
       zod:
         specifier: ^3.24.4
         version: 3.25.56
@@ -2216,6 +2259,12 @@ importers:
       '@flowgram.ai/ts-config':
         specifier: workspace:*
         version: link:../../../config/ts-config
+      '@rsbuild/plugin-react':
+        specifier: ^1.1.1
+        version: 1.3.5(@rsbuild/core@1.5.3)
+      '@rslib/core':
+        specifier: ~0.12.4
+        version: 0.12.4(typescript@5.8.3)
       '@types/inquirer':
         specifier: 9.0.7
         version: 9.0.7
@@ -2246,9 +2295,9 @@ importers:
       styled-components:
         specifier: ^5
         version: 5.3.11(@babel/core@7.26.10)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)
-      tsup:
-        specifier: ^8.0.1
-        version: 8.3.5(typescript@5.8.3)
+      typescript:
+        specifier: ^5.8.3
+        version: 5.8.3
       vitest:
         specifier: ^0.34.6
         version: 0.34.6(jsdom@22.1.0)
@@ -4464,6 +4513,102 @@ packages:
       throttle-debounce: 5.0.2
     dev: false
 
+  /@ast-grep/napi-darwin-arm64@0.37.0:
+    resolution: {integrity: sha512-QAiIiaAbLvMEg/yBbyKn+p1gX2/FuaC0SMf7D7capm/oG4xGMzdeaQIcSosF4TCxxV+hIH4Bz9e4/u7w6Bnk3Q==}
+    engines: {node: '>= 10'}
+    cpu: [arm64]
+    os: [darwin]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi-darwin-x64@0.37.0:
+    resolution: {integrity: sha512-zvcvdgekd4ySV3zUbUp8HF5nk5zqwiMXTuVzTUdl/w08O7JjM6XPOIVT+d2o/MqwM9rsXdzdergY5oY2RdhSPA==}
+    engines: {node: '>= 10'}
+    cpu: [x64]
+    os: [darwin]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi-linux-arm64-gnu@0.37.0:
+    resolution: {integrity: sha512-L7Sj0lXy8X+BqSMgr1LB8cCoWk0rericdeu+dC8/c8zpsav5Oo2IQKY1PmiZ7H8IHoFBbURLf8iklY9wsD+cyA==}
+    engines: {node: '>= 10'}
+    cpu: [arm64]
+    os: [linux]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi-linux-arm64-musl@0.37.0:
+    resolution: {integrity: sha512-LF9sAvYy6es/OdyJDO3RwkX3I82Vkfsng1sqUBcoWC1jVb1wX5YVzHtpQox9JrEhGl+bNp7FYxB4Qba9OdA5GA==}
+    engines: {node: '>= 10'}
+    cpu: [arm64]
+    os: [linux]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi-linux-x64-gnu@0.37.0:
+    resolution: {integrity: sha512-TViz5/klqre6aSmJzswEIjApnGjJzstG/SE8VDWsrftMBMYt2PTu3MeluZVwzSqDao8doT/P+6U11dU05UOgxw==}
+    engines: {node: '>= 10'}
+    cpu: [x64]
+    os: [linux]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi-linux-x64-musl@0.37.0:
+    resolution: {integrity: sha512-/BcCH33S9E3ovOAEoxYngUNXgb+JLg991sdyiNP2bSoYd30a9RHrG7CYwW6fMgua3ijQ474eV6cq9yZO1bCpXg==}
+    engines: {node: '>= 10'}
+    cpu: [x64]
+    os: [linux]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi-win32-arm64-msvc@0.37.0:
+    resolution: {integrity: sha512-TjQA4cFoIEW2bgjLkaL9yqT4XWuuLa5MCNd0VCDhGRDMNQ9+rhwi9eLOWRaap3xzT7g+nlbcEHL3AkVCD2+b3A==}
+    engines: {node: '>= 10'}
+    cpu: [arm64]
+    os: [win32]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi-win32-ia32-msvc@0.37.0:
+    resolution: {integrity: sha512-uNmVka8fJCdYsyOlF9aZqQMLTatEYBynjChVTzUfFMDfmZ0bihs/YTqJVbkSm8TZM7CUX82apvn50z/dX5iWRA==}
+    engines: {node: '>= 10'}
+    cpu: [ia32]
+    os: [win32]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi-win32-x64-msvc@0.37.0:
+    resolution: {integrity: sha512-vCiFOT3hSCQuHHfZ933GAwnPzmL0G04JxQEsBRfqONywyT8bSdDc/ECpAfr3S9VcS4JZ9/F6tkePKW/Om2Dq2g==}
+    engines: {node: '>= 10'}
+    cpu: [x64]
+    os: [win32]
+    requiresBuild: true
+    dev: true
+    optional: true
+
+  /@ast-grep/napi@0.37.0:
+    resolution: {integrity: sha512-Hb4o6h1Pf6yRUAX07DR4JVY7dmQw+RVQMW5/m55GoiAT/VRoKCWBtIUPPOnqDVhbx1Cjfil9b6EDrgJsUAujEQ==}
+    engines: {node: '>= 10'}
+    optionalDependencies:
+      '@ast-grep/napi-darwin-arm64': 0.37.0
+      '@ast-grep/napi-darwin-x64': 0.37.0
+      '@ast-grep/napi-linux-arm64-gnu': 0.37.0
+      '@ast-grep/napi-linux-arm64-musl': 0.37.0
+      '@ast-grep/napi-linux-x64-gnu': 0.37.0
+      '@ast-grep/napi-linux-x64-musl': 0.37.0
+      '@ast-grep/napi-win32-arm64-msvc': 0.37.0
+      '@ast-grep/napi-win32-ia32-msvc': 0.37.0
+      '@ast-grep/napi-win32-x64-msvc': 0.37.0
+    dev: true
+
   /@babel/code-frame@7.26.2:
     resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==}
     engines: {node: '>=6.9.0'}
@@ -6804,7 +6949,6 @@ packages:
     dependencies:
       '@emnapi/wasi-threads': 1.0.4
       tslib: 2.8.1
-    dev: false
     optional: true
 
   /@emnapi/runtime@1.4.5:
@@ -6819,7 +6963,6 @@ packages:
     requiresBuild: true
     dependencies:
       tslib: 2.8.1
-    dev: false
     optional: true
 
   /@emotion/hash@0.8.0:
@@ -7907,6 +8050,9 @@ packages:
   /@jridgewell/sourcemap-codec@1.5.0:
     resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==}
 
+  /@jridgewell/sourcemap-codec@1.5.5:
+    resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}
+
   /@jridgewell/trace-mapping@0.3.25:
     resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
     dependencies:
@@ -8125,6 +8271,9 @@ packages:
     resolution: {integrity: sha512-n6Elm4qKSjwAPxLUGtwnl7qt4y1dxB8OpSgVvXBIzqI9p27a3ZXshLPLnumlpPg1Qudaj8sLnSnFtt9yGpt5yQ==}
     dev: false
 
+  /@module-federation/error-codes@0.18.0:
+    resolution: {integrity: sha512-Woonm8ehyVIUPXChmbu80Zj6uJkC0dD9SJUZ/wOPtO8iiz/m+dkrOugAuKgoiR6qH4F+yorWila954tBz4uKsQ==}
+
   /@module-federation/error-codes@0.8.4:
     resolution: {integrity: sha512-55LYmrDdKb4jt+qr8qE8U3al62ZANp3FhfVaNPOaAmdTh0jHdD8M3yf5HKFlr5xVkVO4eV/F/J2NCfpbh+pEXQ==}
     dev: true
@@ -8136,6 +8285,12 @@ packages:
       '@module-federation/sdk': 0.17.1
     dev: false
 
+  /@module-federation/runtime-core@0.18.0:
+    resolution: {integrity: sha512-ZyYhrDyVAhUzriOsVfgL6vwd+5ebYm595Y13KeMf6TKDRoUHBMTLGQ8WM4TDj8JNsy7LigncK8C03fn97of0QQ==}
+    dependencies:
+      '@module-federation/error-codes': 0.18.0
+      '@module-federation/sdk': 0.18.0
+
   /@module-federation/runtime-tools@0.17.1:
     resolution: {integrity: sha512-4kr6zTFFwGywJx6whBtxsc84V+COAuuBpEdEbPZN//YLXhNB0iz2IGsy9r9wDl+06h84bD+3dQ05l9euRLgXzQ==}
     dependencies:
@@ -8143,6 +8298,12 @@ packages:
       '@module-federation/webpack-bundler-runtime': 0.17.1
     dev: false
 
+  /@module-federation/runtime-tools@0.18.0:
+    resolution: {integrity: sha512-fSga9o4t1UfXNV/Kh6qFvRyZpPp3EHSPRISNeyT8ZoTpzDNiYzhtw0BPUSSD8m6C6XQh2s/11rI4g80UY+d+hA==}
+    dependencies:
+      '@module-federation/runtime': 0.18.0
+      '@module-federation/webpack-bundler-runtime': 0.18.0
+
   /@module-federation/runtime-tools@0.8.4:
     resolution: {integrity: sha512-fjVOsItJ1u5YY6E9FnS56UDwZgqEQUrWFnouRiPtK123LUuqUI9FH4redZoKWlE1PB0ir1Z3tnqy8eFYzPO38Q==}
     dependencies:
@@ -8158,6 +8319,13 @@ packages:
       '@module-federation/sdk': 0.17.1
     dev: false
 
+  /@module-federation/runtime@0.18.0:
+    resolution: {integrity: sha512-+C4YtoSztM7nHwNyZl6dQKGUVJdsPrUdaf3HIKReg/GQbrt9uvOlUWo2NXMZ8vDAnf/QRrpSYAwXHmWDn9Obaw==}
+    dependencies:
+      '@module-federation/error-codes': 0.18.0
+      '@module-federation/runtime-core': 0.18.0
+      '@module-federation/sdk': 0.18.0
+
   /@module-federation/runtime@0.8.4:
     resolution: {integrity: sha512-yZeZ7z2Rx4gv/0E97oLTF3V6N25vglmwXGgoeju/W2YjsFvWzVtCDI7zRRb0mJhU6+jmSM8jP1DeQGbea/AiZQ==}
     dependencies:
@@ -8169,6 +8337,9 @@ packages:
     resolution: {integrity: sha512-nlUcN6UTEi+3HWF+k8wPy7gH0yUOmCT+xNatihkIVR9REAnr7BUvHFGlPJmx7WEbLPL46+zJUbtQHvLzXwFhng==}
     dev: false
 
+  /@module-federation/sdk@0.18.0:
+    resolution: {integrity: sha512-Lo/Feq73tO2unjmpRfyyoUkTVoejhItXOk/h5C+4cistnHbTV8XHrW/13fD5e1Iu60heVdAhhelJd6F898Ve9A==}
+
   /@module-federation/sdk@0.8.4:
     resolution: {integrity: sha512-waABomIjg/5m1rPDBWYG4KUhS5r7OUUY7S+avpaVIY/tkPWB3ibRDKy2dNLLAMaLKq0u+B1qIdEp4NIWkqhqpg==}
     dependencies:
@@ -8182,6 +8353,12 @@ packages:
       '@module-federation/sdk': 0.17.1
     dev: false
 
+  /@module-federation/webpack-bundler-runtime@0.18.0:
+    resolution: {integrity: sha512-TEvErbF+YQ+6IFimhUYKK3a5wapD90d90sLsNpcu2kB3QGT7t4nIluE25duXuZDVUKLz86tEPrza/oaaCWTpvQ==}
+    dependencies:
+      '@module-federation/runtime': 0.18.0
+      '@module-federation/sdk': 0.18.0
+
   /@module-federation/webpack-bundler-runtime@0.8.4:
     resolution: {integrity: sha512-HggROJhvHPUX7uqBD/XlajGygMNM1DG0+4OAkk8MBQe4a18QzrRNzZt6XQbRTSG4OaEoyRWhQHvYD3Yps405tQ==}
     dependencies:
@@ -8218,7 +8395,6 @@ packages:
       '@emnapi/core': 1.4.5
       '@emnapi/runtime': 1.4.5
       '@tybys/wasm-util': 0.10.0
-    dev: false
     optional: true
 
   /@next/env@15.2.4:
@@ -8830,6 +9006,17 @@ packages:
       jiti: 2.5.1
     dev: false
 
+  /@rsbuild/core@1.5.3:
+    resolution: {integrity: sha512-asJYYmpMmYVEPgqR2hoPlW5pFtMYf7+dq9/u8vP0uY+Xbi9aUoguskc783qSi1yu9KvZwDbwpbfCuoBAt8anIA==}
+    engines: {node: '>=18.12.0'}
+    hasBin: true
+    dependencies:
+      '@rspack/core': 1.5.2(@swc/helpers@0.5.17)
+      '@rspack/lite-tapable': 1.0.1
+      '@swc/helpers': 0.5.17
+      core-js: 3.45.1
+      jiti: 2.5.1
+
   /@rsbuild/plugin-less@1.1.1(@rsbuild/core@1.2.19):
     resolution: {integrity: sha512-Gkp73c9p4CQs2dB4BVCmw/cJ6JpIaWbsKcmZqyr+tlsKqZvZn9aYU+Zx4qWSqPR8I5zatiV2Lh15ObL9CCnlXw==}
     peerDependencies:
@@ -8840,12 +9027,12 @@ packages:
       reduce-configs: 1.1.0
     dev: true
 
-  /@rsbuild/plugin-less@1.1.1(@rsbuild/core@1.4.14):
+  /@rsbuild/plugin-less@1.1.1(@rsbuild/core@1.5.3):
     resolution: {integrity: sha512-Gkp73c9p4CQs2dB4BVCmw/cJ6JpIaWbsKcmZqyr+tlsKqZvZn9aYU+Zx4qWSqPR8I5zatiV2Lh15ObL9CCnlXw==}
     peerDependencies:
       '@rsbuild/core': 1.x
     dependencies:
-      '@rsbuild/core': 1.4.14
+      '@rsbuild/core': 1.5.3
       deepmerge: 4.3.1
       reduce-configs: 1.1.0
     dev: false
@@ -8872,6 +9059,37 @@ packages:
       - webpack-hot-middleware
     dev: false
 
+  /@rsbuild/plugin-react@1.3.5(@rsbuild/core@1.5.3):
+    resolution: {integrity: sha512-L/GoHgJV4j+EQbI4KOhe5EscM0OHgnSat1eR0Nt5P3JZxpJV2ryO5Yfx5jElPWOkYZZCuk+EWhHWDQ4CkeC5BQ==}
+    peerDependencies:
+      '@rsbuild/core': 1.x
+    dependencies:
+      '@rsbuild/core': 1.5.3
+      '@rspack/plugin-react-refresh': 1.4.3(react-refresh@0.17.0)
+      react-refresh: 0.17.0
+    transitivePeerDependencies:
+      - webpack-hot-middleware
+    dev: true
+
+  /@rslib/core@0.12.4(typescript@5.8.3):
+    resolution: {integrity: sha512-GF+TIacQgtfvKK5r5g08IO795DnorpiHqcERsBua38iB0KsePpOGPAO+/E5YJncZ5regc72y1CByIELEeikgQA==}
+    engines: {node: '>=18.12.0'}
+    hasBin: true
+    peerDependencies:
+      '@microsoft/api-extractor': ^7
+      typescript: ^5
+    peerDependenciesMeta:
+      '@microsoft/api-extractor':
+        optional: true
+      typescript:
+        optional: true
+    dependencies:
+      '@rsbuild/core': 1.5.3
+      rsbuild-plugin-dts: 0.12.4(@rsbuild/core@1.5.3)(typescript@5.8.3)
+      tinyglobby: 0.2.14
+      typescript: 5.8.3
+    dev: true
+
   /@rspack/binding-darwin-arm64@1.2.8:
     resolution: {integrity: sha512-bDlrlroY3iMlzna/3i1gD6eRmhJW2zRyC3Ov6aR1micshVQ9RteigYZWkjZuQfyC5Z8dCcLUQJVojz+pqp0JXg==}
     cpu: [arm64]
@@ -8888,6 +9106,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-darwin-arm64@1.5.2:
+    resolution: {integrity: sha512-aO76T6VQvAFt1LJNRA5aPOJ+szeTLlzC5wubsnxgWWjG53goP+Te35kFjDIDe+9VhKE/XqRId6iNAymaEsN+Uw==}
+    cpu: [arm64]
+    os: [darwin]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding-darwin-x64@1.2.8:
     resolution: {integrity: sha512-0/qOVbMuzZ+WbtDa4TbH46R4vph/W6MHcXbrXDO+vpdTMFDVJ64DnZXT7aqvGcY+7vTCIGm0GT+6ooR4KaIX8A==}
     cpu: [x64]
@@ -8904,6 +9129,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-darwin-x64@1.5.2:
+    resolution: {integrity: sha512-XNSmUOwdGs2PEdCKTFCC0/vu/7U9nMhAlbHJKlmdt0V4iPvFyaNWxkNdFqzLc05jlJOfgDdwbwRb91y9IcIIFQ==}
+    cpu: [x64]
+    os: [darwin]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding-linux-arm64-gnu@1.2.8:
     resolution: {integrity: sha512-En/SMl45s19iUVb1/ZDFQvFDxIjnlfk7yqV3drMWWAL5HSgksNejaTIFTO52aoohIBbmwuk5wSGcbU0G0IFiPg==}
     cpu: [arm64]
@@ -8921,6 +9153,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-linux-arm64-gnu@1.5.2:
+    resolution: {integrity: sha512-rNxRfgC5khlrhyEP6y93+45uQ4TI7CdtWqh5PKsaR6lPepG1rH4L8VE+etejSdhzXH6wQ76Rw4wzb96Hx+5vuQ==}
+    cpu: [arm64]
+    os: [linux]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding-linux-arm64-musl@1.2.8:
     resolution: {integrity: sha512-N1oZsXfJ9VLLcK7p1PS65cxLYQCZ7iqHW2OP6Ew2+hlz/d1hzngxgzrtZMCXFOHXDvTzVu5ff6jGS2v7+zv2tA==}
     cpu: [arm64]
@@ -8938,6 +9177,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-linux-arm64-musl@1.5.2:
+    resolution: {integrity: sha512-kTFX+KsGgArWC5q+jJWz0K/8rfVqZOn1ojv1xpCCcz/ogWRC/qhDGSOva6Wandh157BiR93Vfoe1gMvgjpLe5g==}
+    cpu: [arm64]
+    os: [linux]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding-linux-x64-gnu@1.2.8:
     resolution: {integrity: sha512-BdPaepoLKuaVwip4QK/nGqNi1xpbCWSxiycPbKRrGqKgt/QGihxxFgiqr4EpWQVIJNIMy4nCsg4arO0+H1KWGQ==}
     cpu: [x64]
@@ -8955,6 +9201,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-linux-x64-gnu@1.5.2:
+    resolution: {integrity: sha512-Lh/6WZGq30lDV6RteQQu7Phw0RH2Z1f4kGR+MsplJ6X4JpnziDow+9oxKdu6FvFHWxHByncpveVeInusQPmL7Q==}
+    cpu: [x64]
+    os: [linux]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding-linux-x64-musl@1.2.8:
     resolution: {integrity: sha512-GFv0Bod268OcXIcjeLoPlK0oz8rClEIxIRFkz+ejhbvfCwRJ+Fd+EKaaKQTBfZQujPqc0h2GctIF25nN5pFTmA==}
     cpu: [x64]
@@ -8972,6 +9225,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-linux-x64-musl@1.5.2:
+    resolution: {integrity: sha512-CsLC/SIOIFs6CBmusSAF0FECB62+J36alMdwl7j6TgN6nX3UQQapnL1aVWuQaxU6un/1Vpim0V/EZbUYIdJQ4g==}
+    cpu: [x64]
+    os: [linux]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding-wasm32-wasi@1.4.11:
     resolution: {integrity: sha512-hiYxHZjaZ17wQtXyLCK0IdtOvMWreGVTiGsaHCxyeT+SldDG+r16bXNjmlqfZsjlfl1mkAqKz1dg+mMX28OTqw==}
     cpu: [wasm32]
@@ -8981,6 +9241,14 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-wasm32-wasi@1.5.2:
+    resolution: {integrity: sha512-cuVbGr1b4q0Z6AtEraI3becZraPMMgZtZPRaIsVLeDXCmxup/maSAR3T6UaGf4Q2SNcFfjw4neGz5UJxPK8uvA==}
+    cpu: [wasm32]
+    requiresBuild: true
+    dependencies:
+      '@napi-rs/wasm-runtime': 1.0.1
+    optional: true
+
   /@rspack/binding-win32-arm64-msvc@1.2.8:
     resolution: {integrity: sha512-aEU+uJdbvJJGrzzAsjbjrPeNbG/bcG8JoXK2kSsUB+/sWHTIkHX0AQ3oX3aV/lcLKgZWrUxLAfLoCXEnIHMEyQ==}
     cpu: [arm64]
@@ -8997,6 +9265,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-win32-arm64-msvc@1.5.2:
+    resolution: {integrity: sha512-4vJQdzRTSuvmvL3vrOPuiA7f9v9frNc2RFWDxqg+GYt0YAjDStssp+lkVbRYyXnTYVJkARSuO6N+BOiI+kLdsQ==}
+    cpu: [arm64]
+    os: [win32]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding-win32-ia32-msvc@1.2.8:
     resolution: {integrity: sha512-GHYzNOSoiLyG9elLTmMqADJMQzjll+co4irp5AgZ+KHG9EVq0qEHxDqDIJxZnUA15U8JDvCgo6YAo3T0BFEL0Q==}
     cpu: [ia32]
@@ -9013,6 +9288,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-win32-ia32-msvc@1.5.2:
+    resolution: {integrity: sha512-zPbu3lx/NrNxdjZzTIjwD0mILUOpfhuPdUdXIFiOAO8RiWSeQpYOvyI061s/+bNOmr4A+Z0uM0dEoOClfkhUFg==}
+    cpu: [ia32]
+    os: [win32]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding-win32-x64-msvc@1.2.8:
     resolution: {integrity: sha512-EigKLhKLH1kfv1e/ZgXuSKlIjkbyneJtiLbNDz7EeEVFGV1XMM6bsCea1sb2WOxsPYiOX4Q5JmR1j1KGrZS/LA==}
     cpu: [x64]
@@ -9029,6 +9311,13 @@ packages:
     dev: false
     optional: true
 
+  /@rspack/binding-win32-x64-msvc@1.5.2:
+    resolution: {integrity: sha512-duLNUTshX38xhC10/W9tpkPca7rOifP2begZjdb1ikw7C4AI0I7VnBnYt8qPSxGISoclmhOBxU/LuAhS8jMMlg==}
+    cpu: [x64]
+    os: [win32]
+    requiresBuild: true
+    optional: true
+
   /@rspack/binding@1.2.8:
     resolution: {integrity: sha512-T3FMB3N9P1AbSAryfkSRJkPtmeSYs/Gj9zUZoPz1ckPEIcWZmpUOQbJylldjbw5waxtCL1haHNbi0pcSvxiaJw==}
     optionalDependencies:
@@ -9058,6 +9347,20 @@ packages:
       '@rspack/binding-win32-x64-msvc': 1.4.11
     dev: false
 
+  /@rspack/binding@1.5.2:
+    resolution: {integrity: sha512-NKiBcsxmAzFDYRnK2ZHWbTtDFVT5/704eK4OfpgsDXPMkaMnBKijMKNgP5pbe18X4rUlz+8HnGm4+Xllo9EESw==}
+    optionalDependencies:
+      '@rspack/binding-darwin-arm64': 1.5.2
+      '@rspack/binding-darwin-x64': 1.5.2
+      '@rspack/binding-linux-arm64-gnu': 1.5.2
+      '@rspack/binding-linux-arm64-musl': 1.5.2
+      '@rspack/binding-linux-x64-gnu': 1.5.2
+      '@rspack/binding-linux-x64-musl': 1.5.2
+      '@rspack/binding-wasm32-wasi': 1.5.2
+      '@rspack/binding-win32-arm64-msvc': 1.5.2
+      '@rspack/binding-win32-ia32-msvc': 1.5.2
+      '@rspack/binding-win32-x64-msvc': 1.5.2
+
   /@rspack/core@1.2.8(@swc/helpers@0.5.15):
     resolution: {integrity: sha512-ppj3uQQtkhgrYDLrUqb33YbpNEZCpAudpfVuOHGsvUrAnu1PijbfJJymoA5ZvUhM+HNMvPI5D1ie97TXyb0UVg==}
     engines: {node: '>=16.0.0'}
@@ -9092,6 +9395,20 @@ packages:
       '@swc/helpers': 0.5.17
     dev: false
 
+  /@rspack/core@1.5.2(@swc/helpers@0.5.17):
+    resolution: {integrity: sha512-ifjHqLczC81d1xjXPXCzxTFKNOFsEzuuLN44cMnyzQ/GWi4B48fyX7JHndWE7Lxd54cW1O9Ik7AdBN3Gq891EA==}
+    engines: {node: '>=18.12.0'}
+    peerDependencies:
+      '@swc/helpers': '>=0.5.1'
+    peerDependenciesMeta:
+      '@swc/helpers':
+        optional: true
+    dependencies:
+      '@module-federation/runtime-tools': 0.18.0
+      '@rspack/binding': 1.5.2
+      '@rspack/lite-tapable': 1.0.1
+      '@swc/helpers': 0.5.17
+
   /@rspack/lite-tapable@1.0.1:
     resolution: {integrity: sha512-VynGOEsVw2s8TAlLf/uESfrgfrq2+rcXB1muPJYBWbsm1Oa6r5qVQhjA5ggM6z/coYPrsVMgovl3Ff7Q7OCp1w==}
     engines: {node: '>=16.0.0'}
@@ -9121,7 +9438,6 @@ packages:
       error-stack-parser: 2.1.4
       html-entities: 2.6.0
       react-refresh: 0.17.0
-    dev: false
 
   /@rspress/core@2.0.0-beta.24(@types/react@18.3.16)(acorn@8.14.0):
     resolution: {integrity: sha512-I+ZlnOGyA91u2U/wz136KYi8G215GX+rJGKVGFs7ch5OuJmUkv/8uzj7fqoP9tOe1ASXmtkWP5rRnF3whjQluw==}
@@ -9506,7 +9822,6 @@ packages:
     resolution: {integrity: sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==}
     dependencies:
       tslib: 2.8.1
-    dev: false
 
   /@tailwindcss/node@4.1.0:
     resolution: {integrity: sha512-mfgxGxFaxbsUbaGwKIAQXUSm7Qoojw53FftpoKwo4ANwr9wnDaByz4vi1gMti/xfJvmQ5lzA1DvPiX5yCHtBkQ==}
@@ -9769,7 +10084,6 @@ packages:
     requiresBuild: true
     dependencies:
       tslib: 2.8.1
-    dev: false
     optional: true
 
   /@types/acorn@4.0.6:
@@ -10583,7 +10897,7 @@ packages:
       '@vue/compiler-ssr': 3.5.17
       '@vue/shared': 3.5.17
       estree-walker: 2.0.2
-      magic-string: 0.30.17
+      magic-string: 0.30.18
       postcss: 8.5.6
       source-map-js: 1.2.1
     dev: false
@@ -11706,6 +12020,10 @@ packages:
     requiresBuild: true
     dev: false
 
+  /core-js@3.45.1:
+    resolution: {integrity: sha512-L4NPsJlCfZsPeXukyzHFlg/i7IIVwHSItR0wg0FLNqYClJ4MQYTYLbC7EkjKYRLZF2iof2MUgN0EGy7MdQFChg==}
+    requiresBuild: true
+
   /core-util-is@1.0.3:
     resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
     dev: false
@@ -13876,7 +14194,6 @@ packages:
 
   /html-entities@2.6.0:
     resolution: {integrity: sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==}
-    dev: false
 
   /html-escaper@2.0.2:
     resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
@@ -14434,7 +14751,6 @@ packages:
   /jiti@2.5.1:
     resolution: {integrity: sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==}
     hasBin: true
-    dev: false
 
   /jju@1.4.0:
     resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==}
@@ -14981,6 +15297,12 @@ packages:
     resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==}
     dependencies:
       '@jridgewell/sourcemap-codec': 1.5.0
+    dev: true
+
+  /magic-string@0.30.18:
+    resolution: {integrity: sha512-yi8swmWbO17qHhwIBNeeZxTceJMeBvWJaId6dyvTSOwTipqeHhMhOrz6513r1sOKnpvQ7zkhlG8tPrpilwTxHQ==}
+    dependencies:
+      '@jridgewell/sourcemap-codec': 1.5.5
 
   /make-dir@1.3.0:
     resolution: {integrity: sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==}
@@ -17735,6 +18057,28 @@ packages:
     resolution: {integrity: sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==}
     dev: true
 
+  /rsbuild-plugin-dts@0.12.4(@rsbuild/core@1.5.3)(typescript@5.8.3):
+    resolution: {integrity: sha512-+T8/jVMneNZgHG7Mw4fjuL5lqa5+sDDKKY5cxNLxD9erYpNGIpVlU31MNE94lvjMmhlK4u5hW/g10u72Fl/FVw==}
+    engines: {node: '>=18.12.0'}
+    peerDependencies:
+      '@microsoft/api-extractor': ^7
+      '@rsbuild/core': 1.x
+      typescript: ^5
+    peerDependenciesMeta:
+      '@microsoft/api-extractor':
+        optional: true
+      typescript:
+        optional: true
+    dependencies:
+      '@ast-grep/napi': 0.37.0
+      '@rsbuild/core': 1.5.3
+      magic-string: 0.30.18
+      picocolors: 1.1.1
+      tinyglobby: 0.2.14
+      tsconfig-paths: 4.2.0
+      typescript: 5.8.3
+    dev: true
+
   /rspack-plugin-virtual-module@1.0.1:
     resolution: {integrity: sha512-NQJ3fXa1v0WayvfHMWbyqLUA3JIqgCkhIcIOnZscuisinxorQyIAo+bqcU5pCusMKSyPqVIWO3caQyl0s9VDAg==}
     dependencies:
@@ -18871,6 +19215,15 @@ packages:
       minimist: 1.2.8
       strip-bom: 3.0.0
 
+  /tsconfig-paths@4.2.0:
+    resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==}
+    engines: {node: '>=6'}
+    dependencies:
+      json5: 2.2.3
+      minimist: 1.2.8
+      strip-bom: 3.0.0
+    dev: true
+
   /tslib@1.14.1:
     resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
 

+ 16 - 0
packages/materials/coze-editor/.eslintrc.js

@@ -0,0 +1,16 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+const { defineConfig } = require('@flowgram.ai/eslint-config');
+
+module.exports = defineConfig({
+  preset: 'web',
+  packageRoot: __dirname,
+  rules: {
+    'no-console': 'off',
+    'react/no-deprecated': 'off',
+    '@flowgram.ai/e2e-data-testid': 'off',
+  },
+});

+ 128 - 0
packages/materials/coze-editor/package.json

@@ -0,0 +1,128 @@
+{
+  "name": "@flowgram.ai/coze-editor",
+  "version": "0.1.8",
+  "homepage": "https://flowgram.ai/",
+  "repository": "https://github.com/bytedance/flowgram.ai",
+  "license": "MIT",
+  "exports": {
+    ".": {
+      "types": "./dist/types/index.d.ts",
+      "require": "./dist/cjs/index.js",
+      "import": "./dist/esm/index.mjs"
+    },
+    "./react": {
+      "types": "./dist/types/react.d.ts",
+      "require": "./dist/cjs/react.js",
+      "import": "./dist/esm/react.mjs"
+    },
+    "./react-merge": {
+      "types": "./dist/types/react-merge.d.ts",
+      "require": "./dist/cjs/react-merge.js",
+      "import": "./dist/esm/react-merge.mjs"
+    },
+    "./vscode": {
+      "types": "./dist/types/vscode.d.ts",
+      "require": "./dist/cjs/vscode.js",
+      "import": "./dist/esm/vscode.mjs"
+    },
+    "./language-typescript": {
+      "types": "./dist/types/language-typescript.d.ts",
+      "require": "./dist/cjs/language-typescript.js",
+      "import": "./dist/esm/language-typescript.mjs"
+    },
+    "./language-typescript/worker": {
+      "types": "./dist/types/language-typescript/worker.d.ts",
+      "require": "./dist/cjs/language-typescript/worker.js",
+      "import": "./dist/esm/language-typescript/worker.mjs"
+    },
+    "./language-json": {
+      "types": "./dist/types/language-json.d.ts",
+      "require": "./dist/cjs/language-json.js",
+      "import": "./dist/esm/language-json.mjs"
+    },
+    "./language-shell": {
+      "types": "./dist/types/language-shell.d.ts",
+      "require": "./dist/cjs/language-shell.js",
+      "import": "./dist/esm/language-shell.mjs"
+    },
+    "./language-python": {
+      "types": "./dist/types/language-python.d.ts",
+      "require": "./dist/cjs/language-python.js",
+      "import": "./dist/esm/language-python.mjs"
+    },
+    "./preset-universal": {
+      "types": "./dist/types/preset-universal.d.ts",
+      "require": "./dist/cjs/preset-universal.js",
+      "import": "./dist/esm/preset-universal.mjs"
+    },
+    "./preset-none": {
+      "types": "./dist/types/preset-none.d.ts",
+      "require": "./dist/cjs/preset-none.js",
+      "import": "./dist/esm/preset-none.mjs"
+    },
+    "./preset-expression": {
+      "types": "./dist/types/preset-expression.d.ts",
+      "require": "./dist/cjs/preset-expression.js",
+      "import": "./dist/esm/preset-expression.mjs"
+    },
+    "./preset-prompt": {
+      "types": "./dist/types/preset-prompt.d.ts",
+      "require": "./dist/cjs/preset-prompt.js",
+      "import": "./dist/esm/preset-prompt.mjs"
+    },
+    "./preset-variable": {
+      "types": "./dist/types/preset-variable.d.ts",
+      "require": "./dist/cjs/preset-variable.js",
+      "import": "./dist/esm/preset-variable.mjs"
+    },
+    "./preset-code": {
+      "types": "./dist/types/preset-code.d.ts",
+      "require": "./dist/cjs/preset-code.js",
+      "import": "./dist/esm/preset-code.mjs"
+    }
+  },
+  "main": "./dist/esm/index.js",
+  "module": "./dist/esm/index.js",
+  "types": "./dist/index.d.ts",
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "build": "rslib build",
+    "build:fast": "rslib build",
+    "build:watch": "rslib build",
+    "clean": "rimraf dist",
+    "gen": "node scripts/gen.js",
+    "test": "exit 0",
+    "test:cov": "exit 0",
+    "ts-check": "tsc --noEmit",
+    "watch": "npm run build:fast -- --dts-resolve --watch --ignore-watch dist"
+  },
+  "dependencies": {
+    "@coze-editor/editor": "0.1.0-alpha.5a549c",
+    "@coze-editor/code-language-typescript": "0.1.0-alpha.5a549c",
+    "typescript": "^5.8.3"
+  },
+  "devDependencies": {
+    "@flowgram.ai/eslint-config": "workspace:*",
+    "@flowgram.ai/ts-config": "workspace:*",
+    "@types/react": "^18",
+    "@types/react-dom": "^18",
+    "eslint": "^8.54.0",
+    "react": "^18",
+    "react-dom": "^18",
+    "tsup": "^8.0.1",
+    "typescript": "^5.8.3",
+    "vitest": "^0.34.6",
+    "@rslib/core": "~0.12.4"
+  },
+  "peerDependencies": {
+    "react": ">=16.8",
+    "react-dom": ">=16.8",
+    "styled-components": ">=4"
+  },
+  "publishConfig": {
+    "access": "public",
+    "registry": "https://registry.npmjs.org/"
+  }
+}

+ 56 - 0
packages/materials/coze-editor/rslib.config.ts

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+//  Copyright (c) 2025 coze-dev
+//  SPDX-License-Identifier: MIT
+
+import path from 'path';
+
+import { defineConfig } from '@rslib/core';
+
+type RsbuildConfig = Parameters<typeof defineConfig>[0];
+
+const commonConfig: Partial<RsbuildConfig> = {
+  source: {
+    entry: {
+      index: ['./src/**/*.{ts,tsx}'],
+    },
+    exclude: [],
+    decorators: {
+      version: 'legacy',
+    },
+  },
+  bundle: false,
+  dts: {
+    distPath: path.resolve(__dirname, './dist/types'),
+    bundle: false,
+    build: true,
+  },
+  tools: {},
+};
+
+const formats: Partial<RsbuildConfig>[] = [
+  {
+    format: 'esm',
+    output: {
+      distPath: {
+        root: path.resolve(__dirname, './dist/esm'),
+      },
+    },
+  },
+  {
+    dts: false,
+    format: 'cjs',
+    output: {
+      distPath: {
+        root: path.resolve(__dirname, './dist/cjs'),
+      },
+    },
+  },
+].map((r) => ({ ...commonConfig, ...r }));
+
+export default defineConfig({
+  lib: formats,
+});

+ 113 - 0
packages/materials/coze-editor/scripts/gen.js

@@ -0,0 +1,113 @@
+#!/usr/bin/env node
+
+const fs = require('fs');
+const path = require('path');
+
+async function main() {
+  try {
+    console.log('🚀 Starting to generate export files...');
+
+    // 1. Get the package.json path of @coze-editor/editor package
+    const packagePath = path.resolve(__dirname, '../node_modules/@coze-editor/editor/package.json');
+
+    if (!fs.existsSync(packagePath)) {
+      console.error('❌ @coze-editor/editor package not found, please run npm install first');
+      process.exit(1);
+    }
+
+    // 2. Read package.json content
+    const packageContent = fs.readFileSync(packagePath, 'utf8');
+    const packageJson = JSON.parse(packageContent);
+
+    if (!packageJson.exports) {
+      console.error('❌ No exports field found in @coze-editor/editor package.json');
+      process.exit(1);
+    }
+
+    console.log(`📦 Found ${Object.keys(packageJson.exports).length} export items`);
+
+    // 3. Process each export item
+    const exports = packageJson.exports;
+    const srcDir = path.resolve(__dirname, '../src');
+
+    // Ensure src directory exists
+    if (!fs.existsSync(srcDir)) {
+      fs.mkdirSync(srcDir, { recursive: true });
+    }
+
+    // Read current package.json
+    const currentPackagePath = path.resolve(__dirname, '../package.json');
+    const currentPackageContent = fs.readFileSync(currentPackagePath, 'utf8');
+    const currentPackageJson = JSON.parse(currentPackageContent);
+
+    let newExportsAdded = 0;
+
+    for (const [exportPath, exportConfig] of Object.entries(exports)) {
+      // Get export name (remove leading ./, root directory uses index)
+      const exportName = exportPath === '.' ? 'index' : exportPath.replace(/^\.\//, '');
+
+      // 3.1 Create corresponding .ts file
+      const filePath = path.join(srcDir, `${exportName}.ts`);
+
+      const contentParts = [];
+
+      const baseImportPath =
+        exportPath === '.' ? '@coze-editor/editor' : `@coze-editor/editor/${exportName}`;
+      contentParts.push(`export * from '${baseImportPath}';`);
+
+      // if is preset, add default export
+      if (exportName.startsWith('preset')) {
+        contentParts.push(`export { default } from '@coze-editor/editor/${exportName}';`);
+      }
+
+      const fileContent = contentParts.join('\n') + '\n';
+
+      // Ensure directory exists (handle subdirectory case)
+      const fileDir = path.dirname(filePath);
+      if (!fs.existsSync(fileDir)) {
+        fs.mkdirSync(fileDir, { recursive: true });
+      }
+
+      // Only create file when it doesn't exist
+      if (!fs.existsSync(filePath)) {
+        fs.writeFileSync(filePath, fileContent);
+        console.log(`✅ Created file: ${path.relative(process.cwd(), filePath)}`);
+      } else {
+        console.log(`⏭️  File already exists: ${path.relative(process.cwd(), filePath)}`);
+      }
+
+      // 3.2 Update exports field in package.json
+      const exportKey = exportName === 'index' ? '.' : `./${exportName}`;
+
+      if (!currentPackageJson.exports[exportKey]) {
+        currentPackageJson.exports[exportKey] = {
+          types: `./dist/types/${exportName}.d.ts`,
+          require: `./dist/cjs/${exportName}.js`,
+          import: `./dist/esm/${exportName}.mjs`,
+        };
+        newExportsAdded++;
+        console.log(`📝 Added export configuration: ${exportKey}`);
+      } else {
+        console.log(`⏭️  Export configuration already exists: ${exportKey}`);
+      }
+    }
+
+    // Save updated package.json
+    fs.writeFileSync(currentPackagePath, JSON.stringify(currentPackageJson, null, 2) + '\n');
+
+    console.log(`\n🎉 Completed!`);
+    console.log(`📁 Created ${Object.keys(exports).length} export files`);
+    console.log(`📦 Added ${newExportsAdded} new export configurations`);
+    console.log(`💡 Remember to run npm run build to build new exports`);
+  } catch (error) {
+    console.error('❌ Error occurred:', error.message);
+    process.exit(1);
+  }
+}
+
+// Run this script directly
+if (require.main === module) {
+  main();
+}
+
+module.exports = { main };

+ 1 - 1
packages/materials/form-materials/src/hooks/index.tsx → packages/materials/coze-editor/src/index.ts

@@ -3,4 +3,4 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './use-object-list';
+export * from '@coze-editor/editor';

+ 6 - 0
packages/materials/coze-editor/src/language-json.ts

@@ -0,0 +1,6 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/language-json';

+ 6 - 0
packages/materials/coze-editor/src/language-python.ts

@@ -0,0 +1,6 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/language-python';

+ 6 - 0
packages/materials/coze-editor/src/language-shell.ts

@@ -0,0 +1,6 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/language-shell';

+ 6 - 0
packages/materials/coze-editor/src/language-typescript.ts

@@ -0,0 +1,6 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/language-typescript';

+ 11 - 0
packages/materials/coze-editor/src/language-typescript/worker.ts

@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+/* eslint-disable import/no-unresolved */
+//  Copyright (c) 2025 coze-dev
+//  SPDX-License-Identifier: MIT
+
+// @ts-expect-error no members are exported from this path
+export * from '@coze-editor/code-language-typescript/dist/esm/worker.js';

+ 7 - 0
packages/materials/coze-editor/src/preset-code.ts

@@ -0,0 +1,7 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/preset-code';
+export { default } from '@coze-editor/editor/preset-code';

+ 7 - 0
packages/materials/coze-editor/src/preset-expression.ts

@@ -0,0 +1,7 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/preset-expression';
+export { default } from '@coze-editor/editor/preset-expression';

+ 7 - 0
packages/materials/coze-editor/src/preset-none.ts

@@ -0,0 +1,7 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/preset-none';
+export { default } from '@coze-editor/editor/preset-none';

+ 7 - 0
packages/materials/coze-editor/src/preset-prompt.ts

@@ -0,0 +1,7 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/preset-prompt';
+export { default } from '@coze-editor/editor/preset-prompt';

+ 7 - 0
packages/materials/coze-editor/src/preset-universal.ts

@@ -0,0 +1,7 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/preset-universal';
+export { default } from '@coze-editor/editor/preset-universal';

+ 7 - 0
packages/materials/coze-editor/src/preset-variable.ts

@@ -0,0 +1,7 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/preset-variable';
+export { default } from '@coze-editor/editor/preset-variable';

+ 6 - 0
packages/materials/coze-editor/src/react-merge.ts

@@ -0,0 +1,6 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/react-merge';

+ 1 - 1
packages/materials/form-materials/src/validate/index.tsx → packages/materials/coze-editor/src/react.ts

@@ -3,4 +3,4 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './validate-flow-value';
+export * from '@coze-editor/editor/react';

+ 6 - 0
packages/materials/coze-editor/src/vscode.ts

@@ -0,0 +1,6 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export * from '@coze-editor/editor/vscode';

+ 15 - 0
packages/materials/coze-editor/tsconfig.json

@@ -0,0 +1,15 @@
+{
+  "extends": "@flowgram.ai/ts-config/tsconfig.flow.path.json",
+  "compilerOptions": {
+    "jsx": "react",
+    "moduleResolution": "bundler",
+    "rootDir": "./src",
+    "outDir": "./dist/types",
+  },
+  "include": [
+    "./src"
+  ],
+  "exclude": [
+    "node_modules"
+  ]
+}

+ 31 - 0
packages/materials/coze-editor/vitest.config.ts

@@ -0,0 +1,31 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+const path = require('path');
+import { defineConfig } from 'vitest/config';
+
+export default defineConfig({
+  build: {
+    commonjsOptions: {
+      transformMixedEsModules: true,
+    },
+  },
+  test: {
+    globals: true,
+    mockReset: false,
+    environment: 'jsdom',
+    setupFiles: [path.resolve(__dirname, './vitest.setup.ts')],
+    include: ['**/?(*.){test,spec}.?(c|m)[jt]s?(x)'],
+    exclude: [
+      '**/__mocks__**',
+      '**/node_modules/**',
+      '**/dist/**',
+      '**/lib/**', // lib 编译结果忽略掉
+      '**/cypress/**',
+      '**/.{idea,git,cache,output,temp}/**',
+      '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
+    ],
+  },
+});

+ 1 - 1
packages/materials/form-materials/src/typings/index.ts → packages/materials/coze-editor/vitest.setup.ts

@@ -3,4 +3,4 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './flow-value';
+import 'reflect-metadata';

+ 14 - 13
packages/materials/form-materials/package.json

@@ -5,13 +5,13 @@
   "repository": "https://github.com/bytedance/flowgram.ai",
   "license": "MIT",
   "exports": {
-    "types": "./dist/index.d.ts",
-    "import": "./dist/esm/index.js",
-    "require": "./dist/index.js"
+    "types": "./dist/types/index.d.ts",
+    "import": "./dist/esm/index.mjs",
+    "require": "./dist/cjs/index.js"
   },
-  "main": "./dist/index.js",
-  "module": "./dist/esm/index.js",
-  "types": "./dist/index.d.ts",
+  "main": "./dist/cjs/index.js",
+  "module": "./dist/esm/index.mjs",
+  "types": "./dist/types/index.d.ts",
   "bin": {
     "flowgram-form-materials": "./bin/run.sh"
   },
@@ -21,9 +21,10 @@
     "src"
   ],
   "scripts": {
-    "build": "npm run build:fast -- --dts-resolve",
-    "build:fast": "tsup src/index.ts --format cjs,esm --sourcemap --legacy-output",
-    "build:watch": "npm run build:fast -- --dts-resolve",
+    "build": "rslib build",
+    "build:fast": "rslib build",
+    "build:watch": "rslib build",
+    "name-export": "node scripts/name-export.js",
     "clean": "rimraf dist",
     "test": "exit 0",
     "test:cov": "exit 0",
@@ -37,13 +38,12 @@
     "@douyinfe/semi-ui": "^2.80.0",
     "@flowgram.ai/editor": "workspace:*",
     "@flowgram.ai/json-schema": "workspace:*",
+    "@flowgram.ai/coze-editor": "workspace:*",
     "lodash-es": "^4.17.21",
     "nanoid": "^4.0.2",
     "immer": "~10.1.1",
-    "@coze-editor/editor": "0.1.0-alpha.5a549c",
     "@codemirror/view": "~6.38.0",
     "@codemirror/state": "~6.5.2",
-    "typescript": "^5.8.3",
     "zod": "^3.24.4"
   },
   "devDependencies": {
@@ -59,9 +59,10 @@
     "react": "^18",
     "react-dom": "^18",
     "styled-components": "^5",
-    "tsup": "^8.0.1",
     "typescript": "^5.8.3",
-    "vitest": "^0.34.6"
+    "vitest": "^0.34.6",
+    "@rslib/core": "~0.12.4",
+    "@rsbuild/plugin-react": "^1.1.1"
   },
   "peerDependencies": {
     "react": ">=16.8",

+ 62 - 0
packages/materials/form-materials/rslib.config.ts

@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+//  Copyright (c) 2025 coze-dev
+//  SPDX-License-Identifier: MIT
+
+import path from 'path';
+
+import { defineConfig } from '@rslib/core';
+import { pluginReact } from '@rsbuild/plugin-react';
+
+type RsbuildConfig = Parameters<typeof defineConfig>[0];
+
+const commonConfig: Partial<RsbuildConfig> = {
+  source: {
+    entry: {
+      index: ['./src/**/*.{ts,tsx}'],
+    },
+    exclude: [],
+    decorators: {
+      version: 'legacy',
+    },
+  },
+  bundle: false,
+  dts: {
+    distPath: path.resolve(__dirname, './dist/types'),
+    bundle: false,
+    build: true,
+  },
+  tools: {},
+};
+
+const formats: Partial<RsbuildConfig>[] = [
+  {
+    format: 'esm',
+    output: {
+      distPath: {
+        root: path.resolve(__dirname, './dist/esm'),
+      },
+    },
+  },
+  {
+    dts: false,
+    format: 'cjs',
+    output: {
+      distPath: {
+        root: path.resolve(__dirname, './dist/cjs'),
+      },
+    },
+  },
+].map((r) => ({ ...commonConfig, ...r }));
+
+export default defineConfig({
+  lib: formats,
+  output: {
+    target: 'web',
+    cleanDistPath: true,
+  },
+  plugins: [pluginReact({ swcReactOptions: {} })],
+});

+ 239 - 0
packages/materials/form-materials/scripts/name-export.js

@@ -0,0 +1,239 @@
+#!/usr/bin/env node
+
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+const fs = require('fs');
+const path = require('path');
+
+/**
+ * Convert wildcard exports to named exports in index.ts files across multiple folders
+ * This script analyzes each exported file and extracts their named exports
+ */
+
+const folders = ['components', 'hooks', 'plugins', 'shared', 'validate', 'form-plugins', 'effects'];
+const SRC_DIR = path.join(__dirname, '..', 'src');
+
+/**
+ * Extract all named exports from a file, distinguishing between values and types
+ * @param {string} filePath - Path of the file to analyze
+ * @returns {{values: string[], types: string[]}} - Object containing value exports and type exports
+ */
+function extractNamedExports(filePath) {
+  try {
+    const content = fs.readFileSync(filePath, 'utf-8');
+    const valueExports = [];
+    const typeExports = [];
+
+    // Collect all type definition names
+    const typeDefinitions = new Set();
+    const typePatterns = [
+      /\b(?:type|interface)\s+(\w+)/g,
+      /\bexport\s+(?:type|interface)\s+(\w+)/g,
+    ];
+
+    let match;
+    for (const pattern of typePatterns) {
+      while ((match = pattern.exec(content)) !== null) {
+        typeDefinitions.add(match[1]);
+      }
+    }
+
+    // Match various export patterns
+    const exportPatterns = [
+      // export const/var/let/function/class/type/interface
+      /\bexport\s+(const|var|let|function|class|type|interface)\s+(\w+)/g,
+      // export { name1, name2 }
+      /\bexport\s*\{([^}]+)\}/g,
+      // export { name as alias }
+      /\bexport\s*\{[^}]*\b(\w+)\s+as\s+(\w+)[^}]*\}/g,
+      // export default function name()
+      /\bexport\s+default\s+(?:function|class)\s+(\w+)/g,
+      // export type { Type1, Type2 }
+      /\bexport\s+type\s*\{([^}]+)\}/g,
+      // export type { Original as Alias }
+      /\bexport\s+type\s*\{[^}]*\b(\w+)\s+as\s+(\w+)[^}]*\}/g,
+    ];
+
+    // Handle first pattern: export const/var/let/function/class/type/interface
+    exportPatterns[0].lastIndex = 0;
+    while ((match = exportPatterns[0].exec(content)) !== null) {
+      const [, kind, name] = match;
+      if (kind === 'type' || kind === 'interface' || typeDefinitions.has(name)) {
+        typeExports.push(name);
+      } else {
+        valueExports.push(name);
+      }
+    }
+
+    // Handle second pattern: export { name1, name2 }
+    exportPatterns[1].lastIndex = 0;
+    while ((match = exportPatterns[1].exec(content)) !== null) {
+      const exportsList = match[1]
+        .split(',')
+        .map((item) => item.trim())
+        .filter((item) => item && !item.includes(' as '));
+
+      for (const name of exportsList) {
+        if (typeDefinitions.has(name)) {
+          typeExports.push(name);
+        } else {
+          valueExports.push(name);
+        }
+      }
+    }
+
+    // Handle third pattern: export { name as alias }
+    exportPatterns[2].lastIndex = 0;
+    while ((match = exportPatterns[2].exec(content)) !== null) {
+      const [, original, alias] = match;
+      if (typeDefinitions.has(original)) {
+        typeExports.push(alias);
+      } else {
+        valueExports.push(alias);
+      }
+    }
+
+    // Handle fourth pattern: export default function name()
+    exportPatterns[3].lastIndex = 0;
+    while ((match = exportPatterns[3].exec(content)) !== null) {
+      const name = match[1];
+      if (typeDefinitions.has(name)) {
+        typeExports.push(name);
+      } else {
+        valueExports.push(name);
+      }
+    }
+
+    // Handle fifth pattern: export type { Type1, Type2 }
+    exportPatterns[4].lastIndex = 0;
+    while ((match = exportPatterns[4].exec(content)) !== null) {
+      const exportsList = match[1]
+        .split(',')
+        .map((item) => item.trim())
+        .filter((item) => item && !item.includes(' as '));
+
+      for (const name of exportsList) {
+        typeExports.push(name);
+      }
+    }
+
+    // Handle sixth pattern: export type { Original as Alias }
+    exportPatterns[5].lastIndex = 0;
+    while ((match = exportPatterns[5].exec(content)) !== null) {
+      const [, original, alias] = match;
+      typeExports.push(alias);
+    }
+
+    // Deduplicate and sort
+    return {
+      values: [...new Set(valueExports)].sort(),
+      types: [...new Set(typeExports)].sort(),
+    };
+  } catch (error) {
+    console.error(`Failed to read file: ${filePath}`, error.message);
+    return { values: [], types: [] };
+  }
+}
+
+/**
+ * Process named export conversion for a single folder
+ * @param {string} folderName - Folder name
+ * @param {string} baseDir - Base directory
+ */
+function processFolder(folderName, baseDir = SRC_DIR) {
+  const folderPath = path.join(baseDir, folderName);
+  const indexFile = path.join(folderPath, 'index.ts');
+
+  console.log(`🔍 Processing folder: ${folderName}`);
+
+  try {
+    // Check if folder exists
+    if (!fs.existsSync(folderPath) || !fs.statSync(folderPath).isDirectory()) {
+      console.warn(`⚠️  Folder does not exist: ${folderName}`);
+      return;
+    }
+
+    // Generate new named export content
+    let newContent = '';
+
+    // Collect all subdirectory exports
+    const subDirs = fs
+      .readdirSync(folderPath, { withFileTypes: true })
+      .filter((item) => item.isDirectory() && !item.name.startsWith('.'))
+      .map((item) => item.name);
+
+    const namedExportsList = [];
+
+    // Process all subdirectories
+    for (const subDir of subDirs) {
+      const subDirPath = path.join(folderPath, subDir);
+      const subPossiblePaths = [
+        path.join(subDirPath, 'index.ts'),
+        path.join(subDirPath, 'index.tsx'),
+        path.join(subDirPath, `${subDir}.ts`),
+        path.join(subDirPath, `${subDir}.tsx`),
+      ];
+
+      const subFullPath = subPossiblePaths.find(fs.existsSync);
+      if (!subFullPath) continue;
+
+      const { values: subValues, types: subTypes } = extractNamedExports(subFullPath);
+      if (subValues.length === 0 && subTypes.length === 0) continue;
+
+      namedExportsList.push({ importPath: `./${subDir}`, values: subValues, types: subTypes });
+      console.log(
+        `✅ Found exports in ${folderName}/${subDir}:\n (${subValues.length} values and ${subTypes.length} types)`
+      );
+    }
+
+    // Generate import statements
+    for (const { importPath, values, types } of namedExportsList) {
+      const imports = [];
+      if (values.length > 0) {
+        imports.push(...values);
+      }
+      if (types.length > 0) {
+        imports.push(...types.map((type) => `type ${type}`));
+      }
+
+      if (imports.length > 0) {
+        newContent += `export { ${imports.join(', ')} } from '${importPath}';
+`;
+      }
+    }
+
+    // Write new content
+    fs.writeFileSync(indexFile, newContent);
+    console.log(`✅ Successfully updated ${folderName}/index.ts\n\n`);
+  } catch (error) {
+    console.error(`❌ Failed to process ${folderName}:`, error.message);
+    console.error(error.stack);
+  }
+}
+
+/**
+ * Main function: Process all configured folders
+ */
+function convertAllFolders() {
+  console.log('🚀 Starting to process all configured folders...\n');
+
+  for (const folder of folders) {
+    processFolder(folder);
+  }
+
+  console.log('\n🎉 All folders processed successfully!');
+
+  processFolder('.');
+
+  console.log('\n🎉 Index of form materials is updated!');
+}
+
+// If this script is run directly
+if (require.main === module) {
+  convertAllFolders();
+}
+
+module.exports = { convertAllFolders, extractNamedExports };

+ 0 - 27
packages/materials/form-materials/src/components/assign-row/components/blur-input.tsx

@@ -1,27 +0,0 @@
-/**
- * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
- * SPDX-License-Identifier: MIT
- */
-
-import React, { useEffect, useState } from 'react';
-
-import Input, { InputProps } from '@douyinfe/semi-ui/lib/es/input';
-
-export function BlurInput(props: InputProps) {
-  const [value, setValue] = useState('');
-
-  useEffect(() => {
-    setValue(props.value as string);
-  }, [props.value]);
-
-  return (
-    <Input
-      {...props}
-      value={value}
-      onChange={(value) => {
-        setValue(value);
-      }}
-      onBlur={(e) => props.onChange?.(value, e)}
-    />
-  );
-}

+ 3 - 3
packages/materials/form-materials/src/components/assign-row/index.tsx

@@ -8,12 +8,12 @@ import React from 'react';
 import { IconButton } from '@douyinfe/semi-ui';
 import { IconMinus } from '@douyinfe/semi-icons';
 
-import { IFlowConstantRefValue } from '@/typings';
+import { IFlowConstantRefValue } from '@/shared';
 import { InjectVariableSelector } from '@/components/variable-selector';
 import { InjectDynamicValueInput } from '@/components/dynamic-value-input';
+import { BlurInput } from '@/components/blur-input';
 
 import { AssignRowProps } from './types';
-import { BlurInput } from './components/blur-input';
 
 export function AssignRow(props: AssignRowProps) {
   const {
@@ -81,4 +81,4 @@ export function AssignRow(props: AssignRowProps) {
   );
 }
 
-export { AssignValueType } from './types';
+export { type AssignValueType } from './types';

+ 1 - 1
packages/materials/form-materials/src/components/assign-row/types.ts

@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-import { IFlowRefValue, IFlowValue } from '@/typings';
+import { IFlowRefValue, IFlowValue } from '@/shared';
 
 export type AssignValueType =
   | {

+ 1 - 1
packages/materials/form-materials/src/components/batch-outputs/types.ts

@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-import { IFlowRefValue } from '@/typings';
+import { IFlowRefValue } from '@/shared';
 
 export type ValueType = Record<string, IFlowRefValue | undefined>;
 

+ 10 - 9
packages/materials/form-materials/src/components/code-editor/editor.tsx

@@ -10,12 +10,11 @@ import {
   createRenderer,
   EditorProvider,
   InferValues,
-} from '@coze-editor/editor/react';
-import preset, { type EditorAPI } from '@coze-editor/editor/preset-code';
+} from '@flowgram.ai/coze-editor/react';
+import preset, { type EditorAPI } from '@flowgram.ai/coze-editor/preset-code';
 import { EditorView } from '@codemirror/view';
 
 import { getSuffixByLanguageId } from './utils';
-import { initTsWorker } from './language-features';
 
 import './theme';
 import './language-features';
@@ -55,12 +54,6 @@ export function CodeEditor({
 }: CodeEditorPropsType) {
   const editorRef = useRef<EditorAPI | null>(null);
 
-  useEffect(() => {
-    if (languageId === 'typescript') {
-      initTsWorker();
-    }
-  }, [languageId]);
-
   useEffect(() => {
     // listen to value change
     if (editorRef.current?.getValue() !== value) {
@@ -68,6 +61,14 @@ export function CodeEditor({
     }
   }, [value]);
 
+  useEffect(() => {
+    if (languageId === 'typescript') {
+      import('./init-worker').then((module) => {
+        module.initTsWorker();
+      });
+    }
+  }, [languageId]);
+
   return (
     <EditorProvider>
       <OriginCodeEditor

+ 27 - 0
packages/materials/form-materials/src/components/code-editor/init-worker.ts

@@ -0,0 +1,27 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+import { typescript } from '@flowgram.ai/coze-editor/language-typescript';
+
+let tsWorkerInit = false;
+
+export const initTsWorker = () => {
+  if (tsWorkerInit) {
+    return;
+  }
+  tsWorkerInit = true;
+
+  const tsWorker = new Worker(
+    new URL(`@flowgram.ai/coze-editor/language-typescript/worker`, import.meta.url),
+    { type: 'module' }
+  );
+  typescript.languageService.initialize(tsWorker, {
+    compilerOptions: {
+      // eliminate Promise error
+      lib: ['es2015', 'dom'],
+      noImplicitAny: false,
+    },
+  });
+};

+ 6 - 27
packages/materials/form-materials/src/components/code-editor/language-features.ts

@@ -3,12 +3,12 @@
  * SPDX-License-Identifier: MIT
  */
 
-import { languages } from '@coze-editor/editor/preset-code';
-import { typescript } from '@coze-editor/editor/language-typescript';
-import { shell } from '@coze-editor/editor/language-shell';
-import { python } from '@coze-editor/editor/language-python';
-import { json } from '@coze-editor/editor/language-json';
-import { mixLanguages } from '@coze-editor/editor';
+import { languages } from '@flowgram.ai/coze-editor/preset-code';
+import { typescript } from '@flowgram.ai/coze-editor/language-typescript';
+import { shell } from '@flowgram.ai/coze-editor/language-shell';
+import { python } from '@flowgram.ai/coze-editor/language-python';
+import { json } from '@flowgram.ai/coze-editor/language-json';
+import { mixLanguages } from '@flowgram.ai/coze-editor';
 
 languages.register('python', python);
 languages.register('shell', shell);
@@ -21,24 +21,3 @@ languages.register('json', {
   }),
   languageService: json.languageService,
 });
-
-let tsWorkerInit = false;
-
-export const initTsWorker = () => {
-  if (tsWorkerInit) {
-    return;
-  }
-  tsWorkerInit = true;
-
-  const tsWorker = new Worker(
-    new URL(`@coze-editor/editor/language-typescript/worker`, import.meta.url),
-    { type: 'module' }
-  );
-  typescript.languageService.initialize(tsWorker, {
-    compilerOptions: {
-      // eliminate Promise error
-      lib: ['es2015', 'dom'],
-      noImplicitAny: false,
-    },
-  });
-};

+ 1 - 1
packages/materials/form-materials/src/components/code-editor/theme/dark.ts

@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-import { createTheme, tags as t } from '@coze-editor/editor/preset-code';
+import { createTheme, tags as t } from '@flowgram.ai/coze-editor/preset-code';
 import { type Extension } from '@codemirror/state';
 
 const colors = {

+ 1 - 1
packages/materials/form-materials/src/components/code-editor/theme/index.ts

@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-import { themes } from '@coze-editor/editor/preset-code';
+import { themes } from '@flowgram.ai/coze-editor/preset-code';
 
 import { lightTheme } from './light';
 import { darkTheme } from './dark';

+ 1 - 1
packages/materials/form-materials/src/components/code-editor/theme/light.ts

@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-import { createTheme, tags as t } from '@coze-editor/editor/preset-code';
+import { createTheme, tags as t } from '@flowgram.ai/coze-editor/preset-code';
 import { type Extension } from '@codemirror/state';
 
 const colors = {

+ 1 - 1
packages/materials/form-materials/src/components/condition-row/hooks/useRule.ts

@@ -8,7 +8,7 @@ import { useMemo } from 'react';
 import { JsonSchemaUtils, JsonSchemaBasicType } from '@flowgram.ai/json-schema';
 import { useScopeAvailable } from '@flowgram.ai/editor';
 
-import { IFlowRefValue } from '@/typings';
+import { IFlowRefValue } from '@/shared';
 
 import { IRules } from '../types';
 import { defaultRules } from '../constants';

+ 1 - 1
packages/materials/form-materials/src/components/condition-row/types.ts

@@ -3,7 +3,7 @@
  * SPDX-License-Identifier: MIT
  */
 
-import { IFlowConstantRefValue, IFlowRefValue } from '@/typings';
+import { IFlowConstantRefValue, IFlowRefValue } from '@/shared';
 
 export enum Op {
   EQ = 'eq',

+ 1 - 1
packages/materials/form-materials/src/components/constant-input/index.tsx

@@ -12,7 +12,7 @@ import { useTypeManager } from '@/plugins';
 
 import { PropsType, Strategy as ConstantInputStrategy } from './types';
 
-export { ConstantInputStrategy };
+export { type ConstantInputStrategy };
 
 export function ConstantInput(props: PropsType) {
   const { value, onChange, schema, strategies, fallbackRenderer, readonly, ...rest } = props;

+ 1 - 1
packages/materials/form-materials/src/components/db-condition-row/types.ts

@@ -5,7 +5,7 @@
 
 import { IJsonSchema } from '@flowgram.ai/json-schema';
 
-import { IFlowConstantRefValue } from '@/typings';
+import { IFlowConstantRefValue } from '@/shared';
 
 export interface OpConfig {
   label: string;

+ 1 - 1
packages/materials/form-materials/src/components/display-flow-value/index.tsx

@@ -8,7 +8,7 @@ import React, { useMemo } from 'react';
 import { JsonSchemaTypeManager, JsonSchemaUtils } from '@flowgram.ai/json-schema';
 import { useScopeAvailable } from '@flowgram.ai/editor';
 
-import { IFlowValue } from '@/typings';
+import { IFlowValue } from '@/shared';
 import { FlowValueUtils } from '@/shared';
 import { DisplaySchemaTag } from '@/components/display-schema-tag';
 

+ 1 - 1
packages/materials/form-materials/src/components/dynamic-value-input/hooks.ts

@@ -8,7 +8,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
 import { IJsonSchema } from '@flowgram.ai/json-schema';
 import { useScopeAvailable } from '@flowgram.ai/editor';
 
-import { IFlowConstantRefValue } from '@/typings';
+import { IFlowConstantRefValue } from '@/shared';
 
 export function useRefVariable(value?: IFlowConstantRefValue) {
   const available = useScopeAvailable();

+ 1 - 1
packages/materials/form-materials/src/components/dynamic-value-input/index.tsx

@@ -14,7 +14,7 @@ import {
 import { IconButton } from '@douyinfe/semi-ui';
 import { IconSetting } from '@douyinfe/semi-icons';
 
-import { IFlowConstantRefValue, IFlowConstantValue } from '@/typings';
+import { IFlowConstantRefValue, IFlowConstantValue } from '@/shared';
 import { createInjectMaterial } from '@/shared';
 import { InjectVariableSelector } from '@/components/variable-selector';
 import { TypeSelector } from '@/components/type-selector';

+ 50 - 25
packages/materials/form-materials/src/components/index.ts

@@ -3,28 +3,53 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './variable-selector';
-export * from './type-selector';
-export * from './json-schema-editor';
-export * from './batch-variable-selector';
-export * from './constant-input';
-export * from './dynamic-value-input';
-export * from './condition-row';
-export * from './db-condition-row';
-export * from './batch-outputs';
-export * from './prompt-editor';
-export * from './prompt-editor-with-variables';
-export * from './prompt-editor-with-inputs';
-export * from './code-editor';
-export * from './code-editor-mini';
-export * from './json-editor-with-variables';
-export * from './inputs-values';
-export * from './display-schema-tree';
-export * from './display-outputs';
-export * from './display-schema-tag';
-export * from './display-flow-value';
-export * from './display-inputs-values';
-export * from './assign-rows';
-export * from './assign-row';
-export * from './blur-input';
-export * from './inputs-values-tree';
+export { AssignRow, type AssignValueType } from './assign-row';
+export { AssignRows } from './assign-rows';
+export { BatchOutputs } from './batch-outputs';
+export { BatchVariableSelector } from './batch-variable-selector';
+export { BlurInput } from './blur-input';
+export { CodeEditor, type CodeEditorPropsType } from './code-editor';
+export { CodeEditorMini } from './code-editor-mini';
+export { ConditionRow, type ConditionRowValueType } from './condition-row';
+export { ConstantInput, type ConstantInputStrategy } from './constant-input';
+export {
+  DBConditionRow,
+  type DBConditionOptionType,
+  type DBConditionRowValueType,
+} from './db-condition-row';
+export { DisplayFlowValue } from './display-flow-value';
+export { DisplayInputsValueAllInTag, DisplayInputsValues } from './display-inputs-values';
+export { DisplayOutputs } from './display-outputs';
+export { DisplaySchemaTag } from './display-schema-tag';
+export { DisplaySchemaTree } from './display-schema-tree';
+export { DynamicValueInput, InjectDynamicValueInput } from './dynamic-value-input';
+export { InputsValues } from './inputs-values';
+export { InputsValuesTree } from './inputs-values-tree';
+export {
+  JsonEditorWithVariables,
+  type JsonEditorWithVariablesProps,
+} from './json-editor-with-variables';
+export { JsonSchemaEditor } from './json-schema-editor';
+export { PromptEditor, type PromptEditorPropsType } from './prompt-editor';
+export {
+  PromptEditorWithInputs,
+  type PromptEditorWithInputsProps,
+} from './prompt-editor-with-inputs';
+export {
+  PromptEditorWithVariables,
+  type PromptEditorWithVariablesProps,
+} from './prompt-editor-with-variables';
+export {
+  InjectTypeSelector,
+  TypeSelector,
+  getTypeSelectValue,
+  parseTypeSelectValue,
+  type TypeSelectorProps,
+} from './type-selector';
+export {
+  InjectVariableSelector,
+  VariableSelector,
+  VariableSelectorProvider,
+  useVariableTree,
+  type VariableSelectorProps,
+} from './variable-selector';

+ 1 - 1
packages/materials/form-materials/src/components/inputs-values-tree/row.tsx

@@ -9,7 +9,7 @@ import { I18n } from '@flowgram.ai/editor';
 import { IconButton, Input } from '@douyinfe/semi-ui';
 import { IconChevronDown, IconChevronRight, IconDelete } from '@douyinfe/semi-icons';
 
-import { IFlowConstantValue } from '@/typings';
+import { IFlowConstantValue } from '@/shared';
 import { ConstantInputStrategy } from '@/components/constant-input';
 
 import { PropsType } from './types';

+ 1 - 1
packages/materials/form-materials/src/components/inputs-values/index.tsx

@@ -9,7 +9,7 @@ import { I18n } from '@flowgram.ai/editor';
 import { Button, IconButton } from '@douyinfe/semi-ui';
 import { IconDelete, IconPlus } from '@douyinfe/semi-icons';
 
-import { IFlowConstantRefValue, IFlowValue } from '@/typings';
+import { IFlowConstantRefValue, IFlowValue } from '@/shared';
 import { useObjectList } from '@/hooks';
 import { InjectDynamicValueInput } from '@/components/dynamic-value-input';
 import { BlurInput } from '@/components/blur-input';

+ 1 - 1
packages/materials/form-materials/src/components/inputs-values/types.ts

@@ -5,7 +5,7 @@
 
 import { IJsonSchema } from '@flowgram.ai/json-schema';
 
-import { IFlowValue } from '@/typings';
+import { IFlowValue } from '@/shared';
 import { ConstantInputStrategy } from '@/components/constant-input';
 
 export interface PropsType {

+ 2 - 2
packages/materials/form-materials/src/components/json-editor-with-variables/editor.tsx

@@ -6,8 +6,8 @@
 import React from 'react';
 
 import { I18n } from '@flowgram.ai/editor';
-import { transformerCreator } from '@coze-editor/editor/preset-code';
-import { Text } from '@coze-editor/editor/language-json';
+import { transformerCreator } from '@flowgram.ai/coze-editor/preset-code';
+import { Text } from '@flowgram.ai/coze-editor/language-json';
 
 import { CodeEditor, type CodeEditorPropsType } from '@/components/code-editor';
 

+ 1 - 1
packages/materials/form-materials/src/components/json-editor-with-variables/extensions/variable-tag.tsx

@@ -13,9 +13,9 @@ import {
   Scope,
   useCurrentScope,
 } from '@flowgram.ai/editor';
+import { useInjector } from '@flowgram.ai/coze-editor/react';
 import { Popover } from '@douyinfe/semi-ui';
 import { IconIssueStroked } from '@douyinfe/semi-icons';
-import { useInjector } from '@coze-editor/editor/react';
 import {
   Decoration,
   DecorationSet,

+ 3 - 3
packages/materials/form-materials/src/components/json-editor-with-variables/extensions/variable-tree.tsx

@@ -5,15 +5,15 @@
 
 import React, { useEffect, useState } from 'react';
 
-import { Popover, Tree } from '@douyinfe/semi-ui';
 import {
   Mention,
   MentionOpenChangeEvent,
   getCurrentMentionReplaceRange,
   useEditor,
   PositionMirror,
-} from '@coze-editor/editor/react';
-import { EditorAPI } from '@coze-editor/editor/preset-prompt';
+} from '@flowgram.ai/coze-editor/react';
+import { EditorAPI } from '@flowgram.ai/coze-editor/preset-prompt';
+import { Popover, Tree } from '@douyinfe/semi-ui';
 
 import { useVariableTree } from '@/components/variable-selector';
 

+ 4 - 4
packages/materials/form-materials/src/components/prompt-editor-with-inputs/extensions/inputs-tree.tsx

@@ -5,17 +5,17 @@
 
 import React, { useEffect, useState } from 'react';
 
-import { Popover } from '@douyinfe/semi-ui';
 import {
   Mention,
   MentionOpenChangeEvent,
   getCurrentMentionReplaceRange,
   useEditor,
   PositionMirror,
-} from '@coze-editor/editor/react';
-import { EditorAPI } from '@coze-editor/editor/preset-prompt';
+} from '@flowgram.ai/coze-editor/react';
+import { EditorAPI } from '@flowgram.ai/coze-editor/preset-prompt';
+import { Popover } from '@douyinfe/semi-ui';
 
-import { IFlowValue } from '@/typings';
+import { IFlowValue } from '@/shared';
 
 import { InputsPicker } from '../inputs-picker';
 

+ 1 - 1
packages/materials/form-materials/src/components/prompt-editor-with-variables/extensions/variable-tag.tsx

@@ -13,9 +13,9 @@ import {
   Scope,
   useCurrentScope,
 } from '@flowgram.ai/editor';
+import { useInjector } from '@flowgram.ai/coze-editor/react';
 import { Popover } from '@douyinfe/semi-ui';
 import { IconIssueStroked } from '@douyinfe/semi-icons';
-import { useInjector } from '@coze-editor/editor/react';
 import {
   Decoration,
   DecorationSet,

+ 3 - 3
packages/materials/form-materials/src/components/prompt-editor-with-variables/extensions/variable-tree.tsx

@@ -5,15 +5,15 @@
 
 import React, { useEffect, useState } from 'react';
 
-import { Popover, Tree } from '@douyinfe/semi-ui';
 import {
   Mention,
   MentionOpenChangeEvent,
   getCurrentMentionReplaceRange,
   useEditor,
   PositionMirror,
-} from '@coze-editor/editor/react';
-import { EditorAPI } from '@coze-editor/editor/preset-prompt';
+} from '@flowgram.ai/coze-editor/react';
+import { EditorAPI } from '@flowgram.ai/coze-editor/preset-prompt';
+import { Popover, Tree } from '@douyinfe/semi-ui';
 
 import { useVariableTree } from '@/components/variable-selector';
 

+ 2 - 2
packages/materials/form-materials/src/components/prompt-editor/editor.tsx

@@ -10,8 +10,8 @@ import {
   EditorProvider,
   ActiveLinePlaceholder,
   InferValues,
-} from '@coze-editor/editor/react';
-import preset, { EditorAPI } from '@coze-editor/editor/preset-prompt';
+} from '@flowgram.ai/coze-editor/react';
+import preset, { EditorAPI } from '@flowgram.ai/coze-editor/preset-prompt';
 
 import { PropsType } from './types';
 import { UIContainer } from './styles';

+ 2 - 2
packages/materials/form-materials/src/components/prompt-editor/extensions/jinja.tsx

@@ -5,8 +5,8 @@
 
 import { useLayoutEffect } from 'react';
 
-import { useInjector } from '@coze-editor/editor/react';
-import { astDecorator } from '@coze-editor/editor';
+import { useInjector } from '@flowgram.ai/coze-editor/react';
+import { astDecorator } from '@flowgram.ai/coze-editor';
 import { EditorView } from '@codemirror/view';
 
 function JinjaHighlight() {

+ 2 - 2
packages/materials/form-materials/src/components/prompt-editor/extensions/language-support.tsx

@@ -5,8 +5,8 @@
 
 import { useLayoutEffect } from 'react';
 
-import { useInjector } from '@coze-editor/editor/react';
-import { languageSupport } from '@coze-editor/editor/preset-prompt';
+import { useInjector } from '@flowgram.ai/coze-editor/react';
+import { languageSupport } from '@flowgram.ai/coze-editor/preset-prompt';
 
 function LanguageSupport() {
   const injector = useInjector();

+ 2 - 2
packages/materials/form-materials/src/components/prompt-editor/extensions/markdown.tsx

@@ -5,8 +5,8 @@
 
 import { useLayoutEffect } from 'react';
 
-import { useInjector } from '@coze-editor/editor/react';
-import { astDecorator } from '@coze-editor/editor';
+import { useInjector } from '@flowgram.ai/coze-editor/react';
+import { astDecorator } from '@flowgram.ai/coze-editor';
 import { EditorView } from '@codemirror/view';
 
 function MarkdownHighlight() {

+ 1 - 1
packages/materials/form-materials/src/components/prompt-editor/types.tsx

@@ -5,7 +5,7 @@
 
 import React from 'react';
 
-import { IFlowTemplateValue } from '@/typings';
+import { IFlowTemplateValue } from '@/shared';
 
 export type PropsType = React.PropsWithChildren<{
   value?: IFlowTemplateValue;

+ 1 - 1
packages/materials/form-materials/src/effects/auto-rename-ref/index.ts

@@ -10,7 +10,7 @@ import {
   VariableFieldKeyRenameService,
 } from '@flowgram.ai/editor';
 
-import { IFlowRefValue, IFlowTemplateValue } from '@/typings';
+import { IFlowRefValue, IFlowTemplateValue } from '@/shared';
 import { FlowValueUtils } from '@/shared';
 
 /**

+ 7 - 7
packages/materials/form-materials/src/effects/index.ts

@@ -3,10 +3,10 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './provide-batch-input';
-export * from './auto-rename-ref';
-export * from './provide-json-schema-outputs';
-export * from './sync-variable-title';
-export * from './validate-when-variable-sync';
-export * from './listen-ref-value-change';
-export * from './listen-ref-schema-change';
+export { autoRenameRefEffect } from './auto-rename-ref';
+export { listenRefSchemaChange } from './listen-ref-schema-change';
+export { listenRefValueChange } from './listen-ref-value-change';
+export { provideBatchInputEffect } from './provide-batch-input';
+export { provideJsonSchemaOutputs } from './provide-json-schema-outputs';
+export { syncVariableTitle } from './sync-variable-title';
+export { validateWhenVariableSync } from './validate-when-variable-sync';

+ 1 - 1
packages/materials/form-materials/src/effects/listen-ref-schema-change/index.ts

@@ -13,7 +13,7 @@ import {
   getNodeScope,
 } from '@flowgram.ai/editor';
 
-import { IFlowRefValue } from '@/typings';
+import { IFlowRefValue } from '@/shared';
 
 /**
  * Example:

+ 1 - 1
packages/materials/form-materials/src/effects/listen-ref-value-change/index.ts

@@ -12,7 +12,7 @@ import {
   getNodeScope,
 } from '@flowgram.ai/editor';
 
-import { IFlowRefValue } from '@/typings';
+import { IFlowRefValue } from '@/shared';
 
 /**
  * Example:

+ 1 - 1
packages/materials/form-materials/src/effects/provide-batch-input/index.ts

@@ -11,7 +11,7 @@ import {
   getNodeForm,
 } from '@flowgram.ai/editor';
 
-import { IFlowRefValue } from '@/typings';
+import { IFlowRefValue } from '@/shared';
 
 export const provideBatchInputEffect: EffectOptions[] = createEffectFromVariableProvider({
   private: true,

+ 1 - 1
packages/materials/form-materials/src/form-plugins/batch-outputs-plugin/index.ts

@@ -17,7 +17,7 @@ import {
   FlowNodeScopeType,
 } from '@flowgram.ai/editor';
 
-import { IFlowRefValue } from '@/typings';
+import { IFlowRefValue } from '@/shared';
 
 export const provideBatchOutputsEffect: EffectOptions[] = createEffectFromVariableProvider({
   parse: (value: Record<string, IFlowRefValue>, ctx) => [

+ 3 - 3
packages/materials/form-materials/src/form-plugins/index.ts

@@ -3,6 +3,6 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './batch-outputs-plugin';
-export * from './infer-inputs-plugin';
-export * from './infer-assign-plugin';
+export { createBatchOutputsFormPlugin, provideBatchOutputsEffect } from './batch-outputs-plugin';
+export { createInferAssignPlugin } from './infer-assign-plugin';
+export { createInferInputsPlugin } from './infer-inputs-plugin';

+ 1 - 1
packages/materials/form-materials/src/form-plugins/infer-assign-plugin/index.ts

@@ -14,7 +14,7 @@ import {
   getNodeScope,
 } from '@flowgram.ai/editor';
 
-import { IFlowRefValue, IFlowValue } from '@/typings';
+import { IFlowRefValue, IFlowValue } from '@/shared';
 
 type AssignValueType =
   | {

+ 6 - 0
packages/materials/form-materials/src/hooks/index.ts

@@ -0,0 +1,6 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export { useObjectList } from './use-object-list';

+ 98 - 8
packages/materials/form-materials/src/index.ts

@@ -3,11 +3,101 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './components';
-export * from './effects';
-export * from './shared';
-export * from './typings';
-export * from './form-plugins';
-export * from './plugins';
-export * from './validate';
-export * from './hooks';
+export {
+  AssignRow,
+  AssignRows,
+  BatchOutputs,
+  BatchVariableSelector,
+  BlurInput,
+  CodeEditor,
+  CodeEditorMini,
+  ConditionRow,
+  ConstantInput,
+  DBConditionRow,
+  DisplayFlowValue,
+  DisplayInputsValueAllInTag,
+  DisplayInputsValues,
+  DisplayOutputs,
+  DisplaySchemaTag,
+  DisplaySchemaTree,
+  DynamicValueInput,
+  InjectDynamicValueInput,
+  InjectTypeSelector,
+  InjectVariableSelector,
+  InputsValues,
+  InputsValuesTree,
+  JsonEditorWithVariables,
+  JsonSchemaEditor,
+  PromptEditor,
+  PromptEditorWithInputs,
+  PromptEditorWithVariables,
+  TypeSelector,
+  VariableSelector,
+  VariableSelectorProvider,
+  getTypeSelectValue,
+  parseTypeSelectValue,
+  type AssignValueType,
+  type CodeEditorPropsType,
+  type ConditionRowValueType,
+  type ConstantInputStrategy,
+  type DBConditionOptionType,
+  type DBConditionRowValueType,
+  type JsonEditorWithVariablesProps,
+  type PromptEditorPropsType,
+  type PromptEditorWithInputsProps,
+  type PromptEditorWithVariablesProps,
+  type TypeSelectorProps,
+  type VariableSelectorProps,
+  useVariableTree,
+} from './components';
+export {
+  autoRenameRefEffect,
+  listenRefSchemaChange,
+  listenRefValueChange,
+  provideBatchInputEffect,
+  provideJsonSchemaOutputs,
+  syncVariableTitle,
+  validateWhenVariableSync,
+} from './effects';
+export {
+  createBatchOutputsFormPlugin,
+  createInferAssignPlugin,
+  createInferInputsPlugin,
+  provideBatchOutputsEffect,
+} from './form-plugins';
+export { useObjectList } from './hooks';
+export {
+  JsonSchemaTypePresetProvider,
+  JsonSchemaUtils,
+  createDisableDeclarationPlugin,
+  createTypePresetPlugin,
+  type ConstantRendererProps,
+  type IJsonSchema,
+  type JsonSchemaBasicType,
+  type JsonSchemaTypeRegistry,
+  useTypeManager,
+} from './plugins';
+export {
+  FlowValueUtils,
+  createInjectMaterial,
+  formatLegacyRefOnInit,
+  formatLegacyRefOnSubmit,
+  formatLegacyRefToNewRef,
+  formatNewRefToLegacyRef,
+  isLegacyFlowRefValueSchema,
+  isNewFlowRefValueSchema,
+  lazySuspense,
+  polyfillCreateRoot,
+  type FlowValueType,
+  type IFlowConstantRefValue,
+  type IFlowConstantValue,
+  type IFlowExpressionValue,
+  type IFlowRefValue,
+  type IFlowTemplateValue,
+  type IFlowValue,
+  type IFlowValueExtra,
+  type IPolyfillRoot,
+  unstableSetCreateRoot,
+  withSuspense,
+} from './shared';
+export { validateFlowValue } from './validate';

+ 11 - 2
packages/materials/form-materials/src/plugins/index.ts

@@ -3,5 +3,14 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './json-schema-preset';
-export * from './disable-declaration-plugin';
+export { createDisableDeclarationPlugin } from './disable-declaration-plugin';
+export {
+  JsonSchemaTypePresetProvider,
+  JsonSchemaUtils,
+  createTypePresetPlugin,
+  type ConstantRendererProps,
+  type IJsonSchema,
+  type JsonSchemaBasicType,
+  type JsonSchemaTypeRegistry,
+  useTypeManager,
+} from './json-schema-preset';

+ 4 - 4
packages/materials/form-materials/src/plugins/json-schema-preset/index.tsx

@@ -33,9 +33,9 @@ export {
   createTypePresetPlugin,
   useTypeManager,
   JsonSchemaTypePresetProvider,
-  IJsonSchema,
   JsonSchemaUtils,
-  JsonSchemaTypeRegistry,
-  ConstantRendererProps,
-  JsonSchemaBasicType,
+  type IJsonSchema,
+  type JsonSchemaTypeRegistry,
+  type ConstantRendererProps,
+  type JsonSchemaBasicType,
 };

+ 11 - 1
packages/materials/form-materials/src/shared/flow-value/index.ts

@@ -3,4 +3,14 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './utils';
+export { FlowValueUtils } from './utils';
+export {
+  type IFlowValueExtra,
+  type FlowValueType,
+  type IFlowValue,
+  type IFlowConstantValue,
+  type IFlowRefValue,
+  type IFlowExpressionValue,
+  type IFlowTemplateValue,
+  type IFlowConstantRefValue,
+} from './types';

+ 0 - 0
packages/materials/form-materials/src/typings/flow-value/index.ts → packages/materials/form-materials/src/shared/flow-value/types.ts


+ 1 - 2
packages/materials/form-materials/src/shared/flow-value/utils.ts

@@ -15,8 +15,7 @@ import {
   IFlowValue,
   IFlowConstantRefValue,
   FlowValueType,
-} from '@/typings';
-
+} from './types';
 import { constantSchema, refSchema, expressionSchema, templateSchema } from './schema';
 
 export namespace FlowValueUtils {

+ 26 - 5
packages/materials/form-materials/src/shared/index.ts

@@ -3,8 +3,29 @@
  * SPDX-License-Identifier: MIT
  */
 
-export * from './format-legacy-refs';
-export * from './inject-material';
-export * from './flow-value';
-export * from './polyfill-create-root';
-export * from './lazy-suspense';
+export {
+  FlowValueUtils,
+  type FlowValueType,
+  type IFlowConstantRefValue,
+  type IFlowConstantValue,
+  type IFlowExpressionValue,
+  type IFlowRefValue,
+  type IFlowTemplateValue,
+  type IFlowValue,
+  type IFlowValueExtra,
+} from './flow-value';
+export {
+  formatLegacyRefOnInit,
+  formatLegacyRefOnSubmit,
+  formatLegacyRefToNewRef,
+  formatNewRefToLegacyRef,
+  isLegacyFlowRefValueSchema,
+  isNewFlowRefValueSchema,
+} from './format-legacy-refs';
+export { createInjectMaterial } from './inject-material';
+export { lazySuspense, withSuspense } from './lazy-suspense';
+export {
+  polyfillCreateRoot,
+  unstableSetCreateRoot,
+  type IPolyfillRoot,
+} from './polyfill-create-root';

+ 6 - 0
packages/materials/form-materials/src/validate/index.ts

@@ -0,0 +1,6 @@
+/**
+ * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
+ * SPDX-License-Identifier: MIT
+ */
+
+export { validateFlowValue } from './validate-flow-value';

+ 1 - 1
packages/materials/form-materials/src/validate/validate-flow-value/index.tsx

@@ -6,7 +6,7 @@
 import { isNil } from 'lodash-es';
 import { FeedbackLevel, FlowNodeEntity, getNodeScope } from '@flowgram.ai/editor';
 
-import { IFlowValue } from '@/typings';
+import { IFlowValue } from '@/shared';
 import { FlowValueUtils } from '@/shared';
 
 interface Context {

+ 7 - 4
packages/materials/form-materials/tsconfig.json

@@ -3,18 +3,21 @@
   "compilerOptions": {
     "jsx": "react",
     "moduleResolution": "bundler",
+    "isolatedModules": true,
     "baseUrl": ".",
+    "types": [],
     "paths": {
       "@/*": [
         "./src/*"
       ]
-    }
+    },
+    "rootDir": "./src",
+    "outDir": "./dist/types",
   },
   "include": [
-    "./src",
-    "./bin/**/*.ts"
+    "src"
   ],
   "exclude": [
-    "node_modules"
+    "node_modules",
   ]
 }

+ 9 - 0
rush.json

@@ -877,6 +877,15 @@
                 "team-flow"
             ]
         },
+        {
+            "packageName": "@flowgram.ai/coze-editor",
+            "projectFolder": "packages/materials/coze-editor",
+            "versionPolicyName": "publishPolicy",
+            "tags": [
+                "level-1",
+                "team-flow"
+            ]
+        },
         {
             "packageName": "@flowgram.ai/free-auto-layout-plugin",
             "projectFolder": "packages/plugins/free-auto-layout-plugin",