wechen-agent-editor-v1 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -20
- package/dist/index.d.ts +0 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +1 -0
- package/package.json +16 -6
package/README.md
CHANGED
|
@@ -5,27 +5,34 @@
|
|
|
5
5
|
> **npm 包名**:安装与 `import` 路径均以仓库根目录 **`package.json` 的 `name`** 为准(当前为 **`wechen-agent-editor-v1`**)。历史文档或内部示例若出现 **`@li/wechen-agent`**,请视为**曾用别名**,以 `package.json` 为准。
|
|
6
6
|
|
|
7
7
|
> **BREAKING(包名)**:若你曾使用旧包名 `my-react-antd-widget`,请改为安装本包并更新 import。
|
|
8
|
-
> **BREAKING(
|
|
8
|
+
> **BREAKING(peer 依赖)**:自 **1.0.3** 起,`react`、`react-dom`、`antd`、`@xyflow/react`、`monaco-editor`、`@monaco-editor/react` 改为 **`peerDependencies`**,避免与宿主 **重复安装多份 React / xyflow** 导致连线、拖拽、样式异常。请见下文「依赖(安装)」与「排查」。
|
|
9
|
+
> **BREAKING(Monaco)**:需在宿主入口配置 **Monaco worker**(见下文)。
|
|
9
10
|
> **BREAKING(initialFlow)**:未传 `initialFlow` 时为 **空画布**(无内置示例节点)。若依赖旧版「零配置即出现示例图」,请显式传入 `initialFlow={cloneWechenAgentFlow(defaultInitialFlow)}`(需同时 import `cloneWechenAgentFlow` 与 `defaultInitialFlow`)。
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
## 依赖(安装)
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
本包将 **`react`、`react-dom`、`antd`、`@xyflow/react`、`monaco-editor`、`@monaco-editor/react`** 声明为 **`peerDependencies`**(与常见 React 组件库一致),**请保证宿主只解析到一份** 上述依赖,否则易出现 **Hooks 异常、React Flow 连线/拖拽失灵、样式错乱**。
|
|
15
16
|
|
|
16
17
|
```bash
|
|
17
18
|
npm install wechen-agent-editor-v1
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
21
|
+
- **npm 7+** 安装本包时,一般会 **自动安装缺失的 peer**;仍建议在宿主 `package.json` 中 **显式列出** 上述依赖及版本,便于与业务线对齐并避免重复副本。
|
|
22
|
+
- 版本范围以 **`peerDependencies`** 为准;建议 **React 18+**、**antd 5+**、**@xyflow/react 12+**。
|
|
23
|
+
|
|
24
|
+
### 排查:第一次从组件库拖入正常,之后无法连线 / 无法再拖 / 样式怪
|
|
25
|
+
|
|
26
|
+
1. **多份 React / 多份 @xyflow**(最常见):在宿主项目根目录执行 **`npm ls react`**、**`npm ls @xyflow/react`**,若出现 **多个版本** 或嵌套在 **`wechen-agent-editor-v1/node_modules` 下又一份**,请删除锁文件后重装,或在 **Vite** 中配置 **`resolve.dedupe: ['react', 'react-dom', '@xyflow/react']`**,或调整 **pnpm overrides / npm overrides** 强制单版本。
|
|
27
|
+
2. **样式未进生产包**:若打包后 **完全无 Flow 样式**,可兜底增加一行:
|
|
28
|
+
`import "wechen-agent-editor-v1/style.css"`(本包 **`exports`** 已导出 **`./style.css` → `dist/style.css`**)。
|
|
29
|
+
3. **Monaco**:未配 worker 时编辑区异常,一般 **不影响** 画布连线;请先排除 1、2。
|
|
22
30
|
|
|
23
31
|
### 从包导入(ESM)
|
|
24
32
|
|
|
25
|
-
本包以 **ESM** 发布(`package.json` 的 `exports["."].import
|
|
33
|
+
本包以 **ESM** 发布(`package.json` 的 `exports["."].import`)。构建会把 **React Flow 全局样式**打进 **`dist/style.css`**,并由 **`dist/index.js`** 自动 `import`;宿主 **只 import 本包即可**,无需再写 `@xyflow/react/dist/style.css`。典型写法:
|
|
26
34
|
|
|
27
35
|
```ts
|
|
28
|
-
import "@xyflow/react/dist/style.css";
|
|
29
36
|
import {
|
|
30
37
|
WechenAgentEditor,
|
|
31
38
|
cloneWechenAgentFlow,
|
|
@@ -49,9 +56,8 @@ import {
|
|
|
49
56
|
|
|
50
57
|
### 样式
|
|
51
58
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
59
|
+
- **React Flow**:样式在 **`dist/style.css`**,随 **`import "…/wechen-agent-editor-v1"`**(或包名根路径)一并生效。若生产环境仍无样式,请确认宿主打包器 **会处理依赖包里的 `import "./style.css"`**;仍不行时使用兜底:**`import "wechen-agent-editor-v1/style.css"`**。
|
|
60
|
+
- **Ant Design**:antd 5 为 **CSS-in-JS**,随组件在运行时注入;请使用 **`ConfigProvider`** 包裹(与官方用法一致),并避免 **重复多份 `antd`** 导致样式异常。
|
|
55
61
|
|
|
56
62
|
Monaco 由 `@monaco-editor/react` 加载;**worker 需在宿主侧配置**,否则编辑器无法初始化。可选方式:
|
|
57
63
|
|
|
@@ -61,7 +67,6 @@ Monaco 由 `@monaco-editor/react` 加载;**worker 需在宿主侧配置**,
|
|
|
61
67
|
## 使用示例
|
|
62
68
|
|
|
63
69
|
```tsx
|
|
64
|
-
import "@xyflow/react/dist/style.css";
|
|
65
70
|
import { ConfigProvider } from "antd";
|
|
66
71
|
import {
|
|
67
72
|
WechenAgentEditor,
|
|
@@ -169,11 +174,11 @@ npm run pack:check
|
|
|
169
174
|
import { WechenAgentEditor } from "wechen-agent-editor-v1";
|
|
170
175
|
```
|
|
171
176
|
|
|
172
|
-
**构建产物**为 **`dist/index.js
|
|
177
|
+
**构建产物**为 **`dist/index.js`**、**`dist/style.css`**(React Flow 全局样式,由入口 JS 自动引用)与类型 **`dist/index.d.ts`**,由 **`src/index.ts`** 聚合导出;请勿依赖未文档化的深层路径。**公开 API** 概览见上文「主要导出一览」,完整符号以 `src/index.ts` 分组为准。
|
|
173
178
|
|
|
174
179
|
### 发布流程与生命周期
|
|
175
180
|
|
|
176
|
-
执行 **`npm publish`** 或 **`npm run release`** 时,npm 会先运行 **`prepublishOnly`**(已设为 `npm run build
|
|
181
|
+
执行 **`npm publish`** 或 **`npm run release`** 时,npm 会先运行 **`prepublishOnly`**(已设为 `npm run build`),再上传。项目脚本 **`release` / `release:cn` 已对 `npm publish` 固定加上 `--registry https://registry.npmjs.org/`**,避免本机默认 registry 仍是 **npmmirror** 时发布误连镜像站并报 **ENEEDAUTH**。
|
|
177
182
|
|
|
178
183
|
- **请勿**在 `package.json` 中新增名为 **`publish`** 的脚本并在其中调用 `npm publish`:发版完成后 npm 会再次执行同名生命周期脚本,可能导致**同一版本被发布两次**并报 **E403**。
|
|
179
184
|
- **`README`** 等会按 npm 默认规则一并打入包; tarball 不含 `monaco-editor` 源码树与 `playground`。
|
|
@@ -189,21 +194,21 @@ npm whoami
|
|
|
189
194
|
|
|
190
195
|
若将来包名改为 **`@scope/pkg`**(scoped),需对该 **scope** 拥有发布权限,必要时使用 `npm login --scope=@scope`,且 **scoped 包首次**发布到公共注册表通常需要 `npm publish --access public`。
|
|
191
196
|
|
|
192
|
-
|
|
197
|
+
**发布**(请先在 **npm 官方** 完成登录:`npm login --registry https://registry.npmjs.org/`):
|
|
193
198
|
|
|
194
199
|
```bash
|
|
195
|
-
npm publish
|
|
196
|
-
#
|
|
200
|
+
npm publish --access public --registry https://registry.npmjs.org/
|
|
201
|
+
# 或(项目脚本,已含上述 registry)
|
|
197
202
|
npm run release
|
|
198
203
|
```
|
|
199
204
|
|
|
200
|
-
**国内网络(可选)**:日常可使用 **npmmirror** 加速 `npm install
|
|
205
|
+
**国内网络(可选)**:日常可使用 **npmmirror** 加速 `npm install`;**发版**请用上面的 **`--registry`** 或脚本(勿依赖「先 npm config set registry」——用户级 `.npmrc` 里若仍指向镜像,`npm publish` 可能仍连镜像并报错)。发版成功后若希望把 **默认 registry** 切回镜像,可执行:
|
|
201
206
|
|
|
202
207
|
```bash
|
|
203
208
|
npm run registry:show # 查看当前默认 registry
|
|
204
|
-
npm run registry:npmjs #
|
|
205
|
-
npm run registry:npmmirror
|
|
206
|
-
npm run release:cn #
|
|
209
|
+
npm run registry:npmjs # 手动切到 npm 官方(仅改默认 registry,可选)
|
|
210
|
+
npm run registry:npmmirror # 切回 npmmirror(装依赖常用)
|
|
211
|
+
npm run release:cn # 发布到官方(脚本内已固定 registry)→ 成功后再切回 npmmirror
|
|
207
212
|
```
|
|
208
213
|
|
|
209
214
|
**发后验证**(将包名换成与 `package.json` `name` 一致):
|
|
@@ -224,7 +229,8 @@ npm install wechen-agent-editor-v1
|
|
|
224
229
|
|
|
225
230
|
## 技术说明
|
|
226
231
|
|
|
227
|
-
- 构建:Vite `build.lib`,`react`、`react-dom`、`antd`、`@xyflow/react`、`monaco-editor`、`@monaco-editor/react` 均为 **external**(**不打进 `dist
|
|
232
|
+
- 构建:Vite `build.lib`,`react`、`react-dom`、`antd`、`@xyflow/react`、`monaco-editor`、`@monaco-editor/react` 均为 **external**(**不打进 `dist`**),由宿主 **`peerDependencies`** 在运行时解析;**请勿**让本包与宿主各装一份 React。
|
|
233
|
+
- **`sideEffects`**:`package.json` 声明 **`./dist/index.js`** 与 **`./dist/style.css`**,避免宿主误摇树掉 **入口 JS 对同目录 CSS 的 `import`**,导致 **生产包样式丢失**。
|
|
228
234
|
- 组件库条目拖入画布时,使用 MIME `application/reactflow` 与载荷前缀 `scope:"wechen-agent"`;宿主可 import `WECHEN_AGENT_FLOW_DRAG_MIME` 与编解码函数以对齐自定义侧栏。
|
|
229
235
|
- 顶栏 **保存** / **测试运行** 通过 `onSave`、`onTestRun` 传出 `WechenAgentSnapshot`:`flow` 为与 `initialFlow` 同形的 **完整对象**(推荐);`flowJson` 为兼容用字符串。
|
|
230
236
|
- 画布 **Controls** 使用 `showInteractive={false}` 时隐藏「锁定交互」开关,**缩放 / 适应视图** 仍可用。
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* wechen-agent-editor-v1 — 可执行 AI 流程编排编辑器(节点=模块,连线=顺序/控制流;非仅关系图)。
|
|
4
|
-
*
|
|
5
|
-
* **宿主必做**
|
|
6
|
-
* - 安装下方 **peer** 依赖,并在入口引入 `@xyflow/react/dist/style.css`。
|
|
7
|
-
* - 配置 **Monaco worker**(见 README),否则代码编辑区无法初始化。
|
|
8
|
-
*
|
|
9
|
-
* **最小示例**
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import "@xyflow/react/dist/style.css";
|
|
12
|
-
* import { WechenAgentEditor } from "wechen-agent-editor-v1";
|
|
13
|
-
* <WechenAgentEditor onSave={(s) => api.save(s.flow)} />
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
1
|
export { WechenAgentEditor } from './WechenAgentEditor';
|
|
17
2
|
export type { WechenAgentEditorProps } from './WechenAgentEditor';
|
|
18
3
|
export { WechenAgentEditorRenderContext, useWechenAgentEditorRender, } from './WechenAgentEditorContext';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,8BAA8B,CAAC;AAGtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAG9E,YAAY,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EACV,6BAA6B,EAC7B,iCAAiC,EACjC,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EACV,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,uCAAuC,EACvC,sCAAsC,EACtC,+BAA+B,GAChC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,8BAA8B,EAC9B,mCAAmC,EACnC,gCAAgC,EAChC,gBAAgB,EAChB,mBAAmB,EACnB,iCAAiC,GAClC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,kCAAkC,CAAC;AAG1C,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,qCAAqC,EACrC,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,YAAY,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wechen-agent-editor-v1",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Wechen Agent:可执行的 AI 流程编排编辑器(React Flow),节点即模块、边即执行顺序;Monaco + Ant Design,面向 npm",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,10 @@
|
|
|
29
29
|
"dist",
|
|
30
30
|
"LICENSE"
|
|
31
31
|
],
|
|
32
|
-
"sideEffects":
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"./dist/index.js",
|
|
34
|
+
"./dist/style.css"
|
|
35
|
+
],
|
|
33
36
|
"main": "./dist/index.js",
|
|
34
37
|
"module": "./dist/index.js",
|
|
35
38
|
"types": "./dist/index.d.ts",
|
|
@@ -38,7 +41,8 @@
|
|
|
38
41
|
"types": "./dist/index.d.ts",
|
|
39
42
|
"import": "./dist/index.js",
|
|
40
43
|
"default": "./dist/index.js"
|
|
41
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"./style.css": "./dist/style.css"
|
|
42
46
|
},
|
|
43
47
|
"scripts": {
|
|
44
48
|
"test": "vitest run",
|
|
@@ -46,13 +50,13 @@
|
|
|
46
50
|
"prepublishOnly": "npm run build",
|
|
47
51
|
"dev": "npm --prefix playground run dev",
|
|
48
52
|
"pack:check": "npm pack --dry-run",
|
|
49
|
-
"release": "npm publish --access public",
|
|
50
|
-
"release:cn": "npm
|
|
53
|
+
"release": "npm publish --access public --registry https://registry.npmjs.org/",
|
|
54
|
+
"release:cn": "npm publish --access public --registry https://registry.npmjs.org/ && npm run registry:npmmirror",
|
|
51
55
|
"registry:show": "npm config get registry",
|
|
52
56
|
"registry:npmjs": "npm config set registry https://registry.npmjs.org/",
|
|
53
57
|
"registry:npmmirror": "npm config set registry https://registry.npmmirror.com/"
|
|
54
58
|
},
|
|
55
|
-
"
|
|
59
|
+
"peerDependencies": {
|
|
56
60
|
"@monaco-editor/react": "^4.6.0",
|
|
57
61
|
"@xyflow/react": ">=12.0.0",
|
|
58
62
|
"antd": ">=5.0.0",
|
|
@@ -61,10 +65,16 @@
|
|
|
61
65
|
"react-dom": ">=18.0.0"
|
|
62
66
|
},
|
|
63
67
|
"devDependencies": {
|
|
68
|
+
"@monaco-editor/react": "^4.6.0",
|
|
64
69
|
"@types/node": "^20.14.0",
|
|
65
70
|
"@types/react": "^18.3.12",
|
|
66
71
|
"@types/react-dom": "^18.3.1",
|
|
67
72
|
"@vitejs/plugin-react": "^4.3.4",
|
|
73
|
+
"@xyflow/react": "^12.3.6",
|
|
74
|
+
"antd": "^5.22.1",
|
|
75
|
+
"monaco-editor": "^0.45.0",
|
|
76
|
+
"react": "^18.3.1",
|
|
77
|
+
"react-dom": "^18.3.1",
|
|
68
78
|
"typescript": "~5.6.3",
|
|
69
79
|
"vite": "^5.4.11",
|
|
70
80
|
"vite-plugin-dts": "^4.3.0",
|