feat: 新增泳道插件#2382
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new PoolElements swimlane plugin for @logicflow/extension, built on top of the existing DynamicGroup mechanism. It registers pool and lane node types with dedicated models and views, providing interactive swimlane/pool canvas elements with support for drag-and-drop lane assignment, insert/delete lane interactions, and directional layout (horizontal/vertical).
Changes:
- New
PoolElementsplugin withPoolModel,LaneModel,PoolView,LaneView, and utility files underpackages/extension/src/pool/ - Documentation pages (
pool.zh.md/pool.en.md) and a tutorial demo component for the docs site - Feature example app page and route for interactive development/testing
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
packages/extension/src/pool/index.ts |
Core plugin class: registers nodes, manages node-lane mappings, wires event handlers |
packages/extension/src/pool/PoolModel.ts |
Pool node model: layout logic, lane management, resize coordination |
packages/extension/src/pool/LaneModel.ts |
Lane node model: child node tracking, pool traversal, text positioning |
packages/extension/src/pool/LaneView.ts |
Lane view: shape rendering and interactive icons for inserting/deleting lanes |
packages/extension/src/pool/PoolView.ts |
Pool view: title/content area rendering, default lane creation on mount |
packages/extension/src/pool/constant.ts |
Shared size constants for pool and lane rendering |
packages/extension/src/pool/utils.ts |
Boundary helper functions for move/drop constraint logic |
packages/extension/src/index.ts |
Exports the new pool module |
packages/extension/src/dynamic-group/index.ts |
Minor whitespace removal (blank line) |
packages/core/src/view/shape/Text.tsx |
Minor whitespace removal (blank line) |
packages/core/src/model/GraphModel.ts |
Minor whitespace removal (blank line) |
sites/docs/docs/tutorial/extension/pool.zh.md |
Chinese documentation for pool plugin |
sites/docs/docs/tutorial/extension/pool.en.md |
English documentation for pool plugin |
sites/docs/src/tutorial/extension/pool/index.tsx |
Interactive documentation demo component |
sites/docs/src/tutorial/extension/pool/index.module.less |
Viewport styles for the demo |
examples/feature-examples/src/pages/nodes/custom/pool/index.tsx |
Feature example app page with debug tooling |
examples/feature-examples/src/pages/nodes/custom/pool/newData.ts |
Test graph data for the feature example |
examples/feature-examples/src/pages/nodes/custom/pool/data.ts |
Empty placeholder data file |
examples/feature-examples/src/pages/nodes/custom/rect/index.tsx |
Adds allowResize: true to rect example config |
examples/feature-examples/src/pages/graph/index.tsx |
Comments out unused import |
examples/feature-examples/.umirc.ts |
Adds route for the new pool example page |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.