wechen-agent-editor-v1 1.3.7 → 1.3.8
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 +31 -0
- package/dist/index.js +2351 -2316
- package/dist/index.js.map +1 -1
- package/dist/panels/ComponentLibraryPanel.d.ts.map +1 -1
- package/dist/panels/LibraryGroupSection.d.ts.map +1 -1
- package/dist/panels/libraryItemRow.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -626,6 +626,37 @@ import { Button, List } from "antd";
|
|
|
626
626
|
/>
|
|
627
627
|
```
|
|
628
628
|
|
|
629
|
+
**样式类名(宿主可覆盖)**:组件库 DOM 使用 `wechen-agent-editor__*` 前缀,可在宿主全局/模块样式中按需覆盖(例如修复宿主 `button { min-height }` 导致分组标题过高、或折叠后分组间距过大):
|
|
630
|
+
|
|
631
|
+
| 类名 | 说明 |
|
|
632
|
+
| --- | --- |
|
|
633
|
+
| `wechen-agent-editor__library-panel` | 组件库根容器(搜索 + 列表) |
|
|
634
|
+
| `wechen-agent-editor__library-search` | 搜索框 |
|
|
635
|
+
| `wechen-agent-editor__library-groups` | 可滚动分组列表容器 |
|
|
636
|
+
| `wechen-agent-editor__library-group` | 单个分组外壳 |
|
|
637
|
+
| `wechen-agent-editor__library-group--expanded` / `--collapsed` | 展开 / 收起状态 |
|
|
638
|
+
| `wechen-agent-editor__library-group--flat` | 未启用折叠时的平铺分组 |
|
|
639
|
+
| `wechen-agent-editor__library-group-header` | 可点击分组标题(`<button>`) |
|
|
640
|
+
| `wechen-agent-editor__library-group-body` | 分组内容区(条目列表) |
|
|
641
|
+
| `wechen-agent-editor__library-group-title` / `--static` | 标题文字 / 不可折叠标题 |
|
|
642
|
+
| `wechen-agent-editor__library-group-chevron` / `__library-group-count` | chevron / 条目数 |
|
|
643
|
+
| `wechen-agent-editor__library-group-list` / `__library-list` | 条目 `List` 外层 / antd `List` |
|
|
644
|
+
| `wechen-agent-editor__library-item` | 可拖拽条目外壳 |
|
|
645
|
+
| `wechen-agent-editor__library-item-row` / `__library-item-meta` | antd `List.Item` / `Meta` |
|
|
646
|
+
|
|
647
|
+
分组元素还带 **`data-library-group-key`**;条目带 **`data-library-item-key`**、**`data-library-group-key`**,便于按 key 精确定位。
|
|
648
|
+
|
|
649
|
+
```less
|
|
650
|
+
/* 示例:宿主 AgentEditor 中修复折叠标题高度 */
|
|
651
|
+
.wechen-agent-editor__library-group-header {
|
|
652
|
+
min-height: unset;
|
|
653
|
+
padding: 0;
|
|
654
|
+
}
|
|
655
|
+
.wechen-agent-editor__library-group--collapsed {
|
|
656
|
+
margin-bottom: 4px;
|
|
657
|
+
}
|
|
658
|
+
```
|
|
659
|
+
|
|
629
660
|
**`renderFlowNode(props, context)`**:**`props.type`** = 落盘 **`item.type`**(**不是** `item.key`);**`context`** 含 **`selected`**、可选 **`libraryGroupKey`** / **`libraryItemKey`**、**`editorRef`**(编辑器内部命令式 API;**不依赖** 宿主是否写 `<WechenAgentEditor ref={...} />`,在点击等事件内读 `current`)。宿主侧自动化/保存等 **仍建议** 挂 `ref`。四边感应与接线桩仍由包渲染,**勿** 在返回值内放置 **`Handle`**。类型见 **`WechenAgentRenderFlowNodeContext`**、**`resolveLibraryItemNodeType`**、**`findComponentLibraryItem`** 等导出。
|
|
630
661
|
|
|
631
662
|
### Monaco Worker
|