@hlang-tech/editor-ui

中文文档
0.1.1发布于 2026/11/01MITTypeScriptESM + CJS

Lumen design system for hlang: node, edge, panel, and shell components for a React Flow node editor, built on @hlang-org/editor-react.

原始使用文档
文档目录7 节
  1. Install
  2. Usage
  3. Components
  4. Keyboard shortcuts
  5. Live execution
  6. Theming
  7. License

hlang editor-ui

@hlang-tech/editor-ui

The Lumen design system for hlang: React components for a node editor built on React Flow and @hlang-tech/editor-react. Black and silver surfaces, image and intent nodes, live edges, and the panels around the canvas.

npm license

Status: 0.x, in active development. The API can change in any minor release.

The Lumen editor built with editor-ui

Install

npm install @hlang-tech/editor-ui @hlang-tech/editor-react @hlang-tech/editor-core @xyflow/react react react-dom

The same build is published as @hlang-org/editor-ui. Import the stylesheet once:

import '@xyflow/react/dist/style.css';
import '@hlang-tech/editor-ui/styles.css';

Usage

import { ReactFlow, ReactFlowProvider } from '@xyflow/react';
import { useHlangFlow } from '@hlang-tech/editor-react';
import { createHlangFlowTypes } from '@hlang-tech/editor-ui';

const { nodeTypes, edgeTypes } = createHlangFlowTypes();

function Canvas({ core }) {
  const flow = useHlangFlow(core);
  return <ReactFlow {...flow} nodeTypes={nodeTypes} edgeTypes={edgeTypes} colorMode="dark" fitView />;
}

createHlangFlowTypes registers the node and edge components for the three node kinds. A node renders as a framed image when its imageUrl parameter is set, and as a pill otherwise. An edge shows the source node's role parameter as a label. The runtime contract does not change: every node is still a Readable, Transform, or Writable node with ports.

See the playground for a complete editor.

Components

AreaExports
Nodes and edgesHlangNode, AssetNodeChrome, PillNodeChrome, NodeChrome, PortRow, SignalBar, NodeBodySlot, FlowEdge, createHlangFlowTypes
Shell and toolbarEditorShell, Toolbar, UndoRedo, RunButton, ToolbarStat, ToolbarGhostButton, ToolCluster
CanvasCanvasChrome, CanvasDock, EmptyState
PanelsOutlineTree, RailTabs, AssetGrid, InspectorPanel, ParamForm, PositionPanel, PreviewPanel, DiagnosticBadge
Creating nodesNodeSearch, useNodeSearch, useNodeSearchTriggers (double-click the canvas, or drop a connection on empty space)
InteractionuseEditorHotkeys, NodeContextMenu, useNodeContextMenu, NodeInteractionProvider, Cheatsheet, ToastProvider
Live executionLiveSignalProvider, LiveSignalStore, useLiveSignals, useNodeLiveState, useEdgeFlowing
ThemeTOKEN_NAMES, tokenVar, createTheme, EditorUIThemeProvider

Keyboard shortcuts

useEditorHotkeys(core) binds undo (⌘Z), redo (⇧⌘Z or ⌘Y), copy, cut, paste, duplicate (⌘D), select all (⌘A), and delete (Delete or Backspace). Ctrl replaces ⌘ on Windows and Linux. Shortcuts are ignored while a text field has focus.

Live execution

useLiveSignals(core, handle) feeds a run's activity and errors into a LiveSignalStore. Nodes and edges subscribe by id, so only the elements whose state changes re-render.

Theming

All colors, fonts, and radii are CSS custom properties (--hl-*). Override them with createTheme({ 'hl-silver': '#d8dce4' }) passed as a style, or with EditorUIThemeProvider.

Source and documentation: github.com/hlang-tech/hlang.

License

MIT

版本与发布记录

@hlang-tech/editor-ui 共发布 3 个版本,首次发布于 2026/11/01;过去 12 个月发布了 3 个版本。

版本发布日期距今
0.1.1latest2026/11/012 天前
0.1.02026/11/012 天前
0.0.0-stage2026/11/012 天前

关于 @hlang-tech/editor-ui 的常见问题

@hlang-tech/editor-ui 是什么?

为React Flow节点编辑器的hlang: node, edge, panel和shell组件的Lumen设计系统,构建在@hlang-org/editor- React上。

如何安装 @hlang-tech/editor-ui?

在项目目录运行 npm install @hlang-tech/editor-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18)、react-dom(>=18)、@xyflow/react(^12.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@hlang-tech/editor-ui 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@hlang-tech/editor-ui 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@hlang-tech/editor-ui 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@hlang-tech/editor-ui 可以商用吗?

@hlang-tech/editor-ui 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@hlang-tech/editor-ui 还在维护吗?

最新版本 0.1.1 发布于 2026/11/01(2 天前);至今共发布 3 个版本,其中过去 12 个月发布了 3 个;首次发布于 2026/11/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。