@huanban/rulego-editor-core 1.3.18 → 1.4.0
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 +153 -2
- package/assets/images/discovery-dark.svg +1 -0
- package/assets/images/discovery.svg +1 -0
- package/assets/images/nacos-dark.svg +1 -0
- package/assets/images/nacos.svg +1 -0
- package/assets/theme-icons/ant-blue/discovery-dark.svg +1 -0
- package/assets/theme-icons/ant-blue/discovery.svg +1 -0
- package/assets/theme-icons/ant-blue/nacos-dark.svg +1 -0
- package/assets/theme-icons/ant-blue/nacos.svg +1 -0
- package/assets/theme-icons/apple/discovery-dark.svg +1 -0
- package/assets/theme-icons/apple/discovery.svg +1 -0
- package/assets/theme-icons/apple/nacos-dark.svg +1 -0
- package/assets/theme-icons/apple/nacos.svg +1 -0
- package/assets/theme-icons/colorful/discovery-dark.svg +1 -0
- package/assets/theme-icons/colorful/discovery.svg +1 -0
- package/assets/theme-icons/colorful/nacos-dark.svg +1 -0
- package/assets/theme-icons/colorful/nacos.svg +1 -0
- package/assets/theme-icons/dark/discovery-dark.svg +1 -0
- package/assets/theme-icons/dark/discovery.svg +1 -0
- package/assets/theme-icons/dark/nacos-dark.svg +1 -0
- package/assets/theme-icons/dark/nacos.svg +1 -0
- package/assets/theme-icons/default/discovery-dark.svg +1 -0
- package/assets/theme-icons/default/discovery.svg +1 -0
- package/assets/theme-icons/default/nacos-dark.svg +1 -0
- package/assets/theme-icons/default/nacos.svg +1 -0
- package/assets/theme-icons/elegant/discovery-dark.svg +1 -0
- package/assets/theme-icons/elegant/discovery.svg +1 -0
- package/assets/theme-icons/elegant/nacos-dark.svg +1 -0
- package/assets/theme-icons/elegant/nacos.svg +1 -0
- package/assets/theme-icons/github/discovery-dark.svg +1 -0
- package/assets/theme-icons/github/discovery.svg +1 -0
- package/assets/theme-icons/github/nacos-dark.svg +1 -0
- package/assets/theme-icons/github/nacos.svg +1 -0
- package/assets/theme-icons/icon-theme-manifest.json +30 -14
- package/assets/theme-icons/icon-theme-overview.svg +1599 -1287
- package/assets/theme-icons/material/discovery-dark.svg +1 -0
- package/assets/theme-icons/material/discovery.svg +1 -0
- package/assets/theme-icons/material/nacos-dark.svg +1 -0
- package/assets/theme-icons/material/nacos.svg +1 -0
- package/assets/theme-icons/modern/discovery-dark.svg +1 -0
- package/assets/theme-icons/modern/discovery.svg +1 -0
- package/assets/theme-icons/modern/nacos-dark.svg +1 -0
- package/assets/theme-icons/modern/nacos.svg +1 -0
- package/assets/theme-icons/nature/discovery-dark.svg +1 -0
- package/assets/theme-icons/nature/discovery.svg +1 -0
- package/assets/theme-icons/nature/nacos-dark.svg +1 -0
- package/assets/theme-icons/nature/nacos.svg +1 -0
- package/assets/theme-icons/tailwind/discovery-dark.svg +1 -0
- package/assets/theme-icons/tailwind/discovery.svg +1 -0
- package/assets/theme-icons/tailwind/nacos-dark.svg +1 -0
- package/assets/theme-icons/tailwind/nacos.svg +1 -0
- package/assets/theme-icons/tech/discovery-dark.svg +1 -0
- package/assets/theme-icons/tech/discovery.svg +1 -0
- package/assets/theme-icons/tech/nacos-dark.svg +1 -0
- package/assets/theme-icons/tech/nacos.svg +1 -0
- package/assets/theme-icons/vscode/discovery-dark.svg +1 -0
- package/assets/theme-icons/vscode/discovery.svg +1 -0
- package/assets/theme-icons/vscode/nacos-dark.svg +1 -0
- package/assets/theme-icons/vscode/nacos.svg +1 -0
- package/dist/ai/copilot-markdown.d.ts +40 -0
- package/dist/ai/copilot-transport.d.ts +39 -0
- package/dist/api/AIManager.d.ts +5 -4
- package/dist/api/ApiProvider.d.ts +17 -69
- package/dist/api/ComponentCatalogCache.d.ts +27 -0
- package/dist/api/DebugSocketClient.d.ts +18 -25
- package/dist/api/RuleChainAPI.d.ts +24 -145
- package/dist/api/StreamParser.d.ts +0 -10
- package/dist/api/index.d.ts +4 -14
- package/dist/api/response-utils.d.ts +4 -22
- package/dist/api/types.d.ts +44 -179
- package/dist/chunks/editor-core-code-editor-CRki2wA_.js +512 -0
- package/dist/chunks/editor-core-default-components-BjF65lar.js +9448 -0
- package/dist/chunks/editor-core-dialogs-CkFLaC8Q.js +17176 -0
- package/dist/chunks/editor-core-icons-BqeFofNA.js +668 -0
- package/dist/chunks/editor-core-json-diff-RHsPeX-w.js +199 -0
- package/dist/chunks/editor-core-locales-i6o28vm2.js +4159 -0
- package/dist/chunks/editor-core-node-patches-BJTT3TuX.js +8060 -0
- package/dist/chunks/editor-core-node-views-BOaPVdmN.js +1288 -0
- package/dist/chunks/editor-core-property-drawers-lLsBIoCa.js +8035 -0
- package/dist/chunks/editor-core-standalone-CHXk3ukc.js +11270 -0
- package/dist/chunks/editor-core-styles-C1TbLgCK.js +8841 -0
- package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +217 -0
- package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +4 -0
- package/dist/chunks/xlsx-BopDBbWb.js +24176 -0
- package/dist/core/ActionRegistry.d.ts +47 -0
- package/dist/core/AutoLayout.d.ts +1 -48
- package/dist/core/ComponentDocService.d.ts +28 -0
- package/dist/core/ComponentRegistry.d.ts +1 -125
- package/dist/core/DataAdapter.d.ts +4 -89
- package/dist/core/DiagnosticService.d.ts +15 -0
- package/dist/core/EditorCore.d.ts +22 -212
- package/dist/core/EditorWorkspace.d.ts +111 -0
- package/dist/core/EventBus.d.ts +0 -86
- package/dist/core/ExplorerTreeStore.d.ts +43 -0
- package/dist/core/FieldCapabilityRegistry.d.ts +16 -0
- package/dist/core/FieldChangeRegistry.d.ts +48 -0
- package/dist/core/HistoryManager.d.ts +0 -123
- package/dist/core/I18nManager.d.ts +0 -120
- package/dist/core/Optimizations.d.ts +0 -14
- package/dist/core/OptionSourceRegistry.d.ts +38 -0
- package/dist/core/RuleChainChatManager.d.ts +0 -37
- package/dist/core/RuleChainValidator.d.ts +0 -79
- package/dist/core/StateStore.d.ts +4 -140
- package/dist/core/ThemeManager.d.ts +0 -141
- package/dist/core/ValidationEngine.d.ts +0 -103
- package/dist/core/component-palette.d.ts +20 -0
- package/dist/core/component-payload.d.ts +0 -9
- package/dist/core/connection-status.d.ts +77 -0
- package/dist/core/context-menu-position.d.ts +27 -0
- package/dist/core/cron-schedule.d.ts +85 -0
- package/dist/core/debug-panel.d.ts +6 -0
- package/dist/core/editor-capabilities.d.ts +95 -0
- package/dist/core/editor-dock.d.ts +100 -0
- package/dist/core/editor-panel.d.ts +68 -0
- package/dist/core/explorer-tree.d.ts +27 -0
- package/dist/core/field-protocol.d.ts +32 -0
- package/dist/core/foundation-tokens.d.ts +38 -0
- package/dist/core/graph-operations.d.ts +34 -0
- package/dist/core/hover-tools.d.ts +26 -0
- package/dist/core/index.d.ts +68 -16
- package/dist/core/infer-run-input.d.ts +11 -0
- package/dist/core/key-value-editor.d.ts +6 -0
- package/dist/core/overlay-layers.d.ts +28 -0
- package/dist/core/recent-components.d.ts +51 -0
- package/dist/core/run-guard.d.ts +7 -0
- package/dist/core/runtime-field-dictionary.d.ts +68 -0
- package/dist/core/runtime-limits.d.ts +0 -5
- package/dist/core/save-conflict.d.ts +4 -0
- package/dist/core/server-status.d.ts +34 -0
- package/dist/core/simple-array.d.ts +4 -0
- package/dist/core/table-protocol.d.ts +36 -0
- package/dist/core/table-spreadsheet.d.ts +3 -0
- package/dist/core/test-cases.d.ts +54 -0
- package/dist/core/toolbar-icons.d.ts +4 -0
- package/dist/core/topology-rules.d.ts +17 -0
- package/dist/core/virtual-window.d.ts +20 -0
- package/dist/core/workspace-tab-actions.d.ts +13 -0
- package/dist/defaults/components.d.ts +0 -9
- package/dist/defaults/index.d.ts +0 -15
- package/dist/defaults/locale-en-US.d.ts +0 -24
- package/dist/defaults/locale-zh-CN.d.ts +0 -39
- package/dist/defaults/official-component-fallbacks.d.ts +0 -8
- package/dist/extensions/ClipboardExtension.d.ts +0 -23
- package/dist/extensions/KeyboardExtension.d.ts +0 -17
- package/dist/extensions/MenuExtension.d.ts +0 -23
- package/dist/iconRegistry.d.ts +0 -22
- package/dist/index.cjs +11320 -0
- package/dist/index.d.ts +25 -47
- package/dist/index.esm.js +1123 -99614
- package/dist/index.umd.js +3380 -1471
- package/dist/models/BaseNodeModel.d.ts +0 -32
- package/dist/models/index.d.ts +0 -1
- package/dist/nodes/AgentOrchestrationNode.d.ts +0 -24
- package/dist/nodes/GroupNode.d.ts +0 -38
- package/dist/nodes/HeadlessHtmlNode.d.ts +0 -16
- package/dist/nodes/SwitchNode.d.ts +0 -22
- package/dist/nodes/UnknownNodeModel.d.ts +0 -19
- package/dist/standalone/HuanbanRulegoEditor.d.ts +202 -401
- package/dist/standalone/ai-model-policy.d.ts +0 -1
- package/dist/standalone/ai-providers.d.ts +0 -1
- package/dist/standalone/auth-fetch.d.ts +2 -46
- package/dist/standalone/browser-assets.d.ts +0 -8
- package/dist/standalone/canvas-view.d.ts +6 -0
- package/dist/standalone/code-editor-language-loaders.d.ts +2 -0
- package/dist/standalone/code-editor-language-loaders.legacy.d.ts +7 -0
- package/dist/standalone/code-editor.d.ts +3 -87
- package/dist/standalone/connection-status-binding.d.ts +8 -0
- package/dist/standalone/custom-nodes.d.ts +0 -26
- package/dist/standalone/drawer-unsaved-guard.d.ts +2 -9
- package/dist/standalone/edge-label-quick-editor.d.ts +2 -0
- package/dist/standalone/editor-actions.d.ts +4 -0
- package/dist/standalone/editor-chain-info.d.ts +5 -38
- package/dist/standalone/editor-context-menu.d.ts +0 -21
- package/dist/standalone/editor-debug-ws.d.ts +37 -145
- package/dist/standalone/editor-delete.d.ts +0 -1
- package/dist/standalone/editor-dialogs.d.ts +16 -66
- package/dist/standalone/editor-events.d.ts +0 -27
- package/dist/standalone/editor-overlays.d.ts +14 -0
- package/dist/standalone/editor-property-drawers.d.ts +13 -71
- package/dist/standalone/editor-route-settings.d.ts +7 -55
- package/dist/standalone/editor-sidebar.d.ts +0 -18
- package/dist/standalone/editor-styles.d.ts +0 -11
- package/dist/standalone/editor-toast.d.ts +1 -2
- package/dist/standalone/editor-toolbar.d.ts +5 -80
- package/dist/standalone/editor-tour.d.ts +7 -0
- package/dist/standalone/editor-trace-overlay.d.ts +0 -5
- package/dist/standalone/full-json-dialog.d.ts +5 -1
- package/dist/standalone/group-node.d.ts +1 -51
- package/dist/standalone/icon-utils.d.ts +0 -20
- package/dist/standalone/index.d.ts +10 -7
- package/dist/standalone/json-diff.d.ts +0 -1
- package/dist/standalone/keyboard-events.d.ts +0 -1
- package/dist/standalone/layout-scheduler.d.ts +0 -6
- package/dist/standalone/lifecycle.d.ts +0 -5
- package/dist/standalone/logger.d.ts +0 -32
- package/dist/standalone/models-dev-catalog.d.ts +0 -1
- package/dist/standalone/node-copy.d.ts +7 -4
- package/dist/standalone/node-definitions.d.ts +0 -63
- package/dist/standalone/node-identity.d.ts +0 -1
- package/dist/standalone/node-theme.d.ts +8 -0
- package/dist/standalone/node-views-data.d.ts +0 -20
- package/dist/standalone/official-node-view-patches.d.ts +1 -14
- package/dist/standalone/outline-style.d.ts +7 -0
- package/dist/standalone/run-history-format.d.ts +0 -1
- package/dist/standalone/security-utils.d.ts +1 -5
- package/dist/standalone/shared-node-manager.d.ts +31 -0
- package/dist/standalone/themes.d.ts +0 -48
- package/dist/tools/tool-editor.d.ts +0 -1
- package/dist/types/component.d.ts +105 -87
- package/dist/types/editor.d.ts +16 -169
- package/dist/types/events.d.ts +30 -107
- package/dist/types/index.d.ts +3 -10
- package/dist/types/rule-chain.d.ts +0 -90
- package/dist/utils/GraphUtils.d.ts +0 -10
- package/dist/utils/helpers.d.ts +0 -80
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/pinyin-search.d.ts +0 -57
- package/dist/utils/relation-utils.d.ts +0 -1
- package/dist/utils/textUtils.d.ts +0 -12
- package/dist/version.d.ts +2 -3
- package/dist/xlsx-qn1xoUuv.cjs +105 -0
- package/package.json +19 -5
- package/vite-chunks.d.ts +11 -0
- package/vite-chunks.mjs +120 -0
- package/dist/index.cjs.js +0 -9515
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type ServerStatus = 'unknown' | 'checking' | 'online' | 'unauthorized' | 'forbidden' | 'offline' | 'error';
|
|
2
|
+
export type ServerApiStatus = 'unknown' | 'checking' | 'online' | 'unauthorized' | 'forbidden' | 'offline' | 'error';
|
|
3
|
+
export type ServerWsStatus = 'idle' | 'connecting' | 'connected' | 'reconnecting' | 'closed' | 'error';
|
|
4
|
+
export type ServerWsEventStatus = ServerWsStatus | 'live' | 'disconnected';
|
|
5
|
+
export interface ServerStatusState extends Record<string, unknown> {
|
|
6
|
+
api: ServerApiStatus;
|
|
7
|
+
ws: ServerWsStatus;
|
|
8
|
+
status: ServerStatus;
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
wsUrl: string;
|
|
11
|
+
httpStatus: number | null;
|
|
12
|
+
wsCloseCode: number | null;
|
|
13
|
+
reconnectAttempt: number;
|
|
14
|
+
lastChangedAt: number | null;
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ServerStatusOptions {
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
wsUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function deriveWsUrl(baseUrl: string, path?: string): string;
|
|
22
|
+
export declare class ServerStatusStore {
|
|
23
|
+
private readonly store;
|
|
24
|
+
private destroyed;
|
|
25
|
+
constructor(options?: ServerStatusOptions);
|
|
26
|
+
getState(): Readonly<ServerStatusState>;
|
|
27
|
+
subscribe(listener: (state: Readonly<ServerStatusState>, previousState: Readonly<ServerStatusState>) => void): () => void;
|
|
28
|
+
setServerUrl(baseUrl: string, wsUrl?: string): void;
|
|
29
|
+
setServerStatus(status: ServerStatus, details?: Partial<ServerStatusState>): void;
|
|
30
|
+
recordHttpStatus(statusCode: number, message?: string): ServerStatus;
|
|
31
|
+
recordWebSocketStatus(eventStatus: ServerWsEventStatus, closeCode?: number | null, message?: string): ServerStatus;
|
|
32
|
+
setReconnectAttempt(attempt: number): void;
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const SIMPLE_ARRAY_DELIMITER: RegExp;
|
|
2
|
+
export declare function parseSimpleArrayInput(value: string): string[];
|
|
3
|
+
export declare function normalizeSimpleArrayValues(value: unknown): string[];
|
|
4
|
+
export declare function mergeSimpleArrayValues(existing: unknown, input: string): string[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ComponentField } from '../types/component';
|
|
2
|
+
export type TableRow = Record<string, unknown>;
|
|
3
|
+
export interface TablePage<T = TableRow> {
|
|
4
|
+
items: T[];
|
|
5
|
+
page: number;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
total: number;
|
|
8
|
+
totalPages: number;
|
|
9
|
+
}
|
|
10
|
+
export interface PointGenerationOptions {
|
|
11
|
+
prefix?: string;
|
|
12
|
+
start: number;
|
|
13
|
+
count: number;
|
|
14
|
+
step?: number;
|
|
15
|
+
type?: unknown;
|
|
16
|
+
namePrefix?: string;
|
|
17
|
+
existing?: TableRow[];
|
|
18
|
+
}
|
|
19
|
+
export declare function coerceTableCellValue(field: Pick<ComponentField, 'type' | 'component'> | undefined, value: unknown): unknown;
|
|
20
|
+
export interface PointTableImportDecision {
|
|
21
|
+
mode: 'replace';
|
|
22
|
+
requiresConfirmation: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function isPointTableFields(fields: ComponentField[] | null | undefined): boolean;
|
|
25
|
+
export declare function normalizeTableRows(value: unknown): TableRow[];
|
|
26
|
+
export declare function decodeTableRowsForEditing(fields: ComponentField[] | null | undefined, value: unknown): TableRow[];
|
|
27
|
+
export declare function encodeTableRowsForStorage(fields: ComponentField[] | null | undefined, value: unknown): TableRow[];
|
|
28
|
+
export declare function getTableColumns(fields: ComponentField[] | null | undefined, rows?: TableRow[]): string[];
|
|
29
|
+
export declare function getTableDetailFields(fields: ComponentField[] | null | undefined): ComponentField[];
|
|
30
|
+
export declare function createEmptyTableRow(fields: ComponentField[] | null | undefined, columns?: string[]): TableRow;
|
|
31
|
+
export declare function paginateTableRows<T>(rows: T[], page?: number, pageSize?: number): TablePage<T>;
|
|
32
|
+
export declare function findDuplicateRowValues(rows: TableRow[], field?: string): Set<string>;
|
|
33
|
+
export declare function getPointTableImportDecision(existingRows: TableRow[] | null | undefined, incomingRows: TableRow[] | null | undefined): PointTableImportDecision;
|
|
34
|
+
export declare function generatePointRows(options: PointGenerationOptions): TableRow[];
|
|
35
|
+
export declare function parseCsvTable(text: string): TableRow[];
|
|
36
|
+
export declare function serializeCsvTable(rows: TableRow[], columns?: string[]): string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type EditorPersistenceAdapter, type EditorPersistenceNamespace } from './editor-dock';
|
|
2
|
+
export interface EditorTestCasePayload {
|
|
3
|
+
msgType: string;
|
|
4
|
+
dataType?: string;
|
|
5
|
+
body: string;
|
|
6
|
+
metadata: string;
|
|
7
|
+
headers: string;
|
|
8
|
+
fromNodeId: string;
|
|
9
|
+
onlyThisNode: boolean;
|
|
10
|
+
waitResult: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface EditorTestCaseEntry {
|
|
13
|
+
name: string;
|
|
14
|
+
payload: EditorTestCasePayload;
|
|
15
|
+
updatedAt: number;
|
|
16
|
+
}
|
|
17
|
+
export interface EditorTestCasesPersistenceOptions {
|
|
18
|
+
adapter: EditorPersistenceAdapter;
|
|
19
|
+
namespace: EditorPersistenceNamespace;
|
|
20
|
+
}
|
|
21
|
+
export interface EditorTestCasesOptions {
|
|
22
|
+
persistence?: EditorTestCasesPersistenceOptions;
|
|
23
|
+
maxEntries?: number;
|
|
24
|
+
now?: () => number;
|
|
25
|
+
}
|
|
26
|
+
export interface EditorTestCasesResult {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
persisted: boolean;
|
|
29
|
+
entries: EditorTestCaseEntry[];
|
|
30
|
+
}
|
|
31
|
+
export declare class EditorTestCasesStore {
|
|
32
|
+
private readonly adapter?;
|
|
33
|
+
private readonly storageKey;
|
|
34
|
+
private readonly persistenceIdentity;
|
|
35
|
+
private readonly maxEntries;
|
|
36
|
+
private readonly now;
|
|
37
|
+
private state;
|
|
38
|
+
private activeChainId;
|
|
39
|
+
private destroyed;
|
|
40
|
+
private readonly listeners;
|
|
41
|
+
constructor(options?: EditorTestCasesOptions);
|
|
42
|
+
setChainId(chainId: string): void;
|
|
43
|
+
getChainId(): string;
|
|
44
|
+
list(chainId?: string): EditorTestCaseEntry[];
|
|
45
|
+
save(name: string, payload: EditorTestCasePayload, chainId?: string): EditorTestCasesResult;
|
|
46
|
+
remove(name: string, chainId?: string): EditorTestCasesResult;
|
|
47
|
+
clear(chainId?: string): EditorTestCasesResult;
|
|
48
|
+
subscribe(listener: (entries: EditorTestCaseEntry[]) => void): () => void;
|
|
49
|
+
destroy(): void;
|
|
50
|
+
private removeAll;
|
|
51
|
+
private notify;
|
|
52
|
+
private readState;
|
|
53
|
+
private writeState;
|
|
54
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type EditorToolbarIconName = 'file-plus' | 'add' | 'edit' | 'copy' | 'cut' | 'paste' | 'package' | 'store' | 'save' | 'import' | 'export' | 'undo' | 'redo' | 'delete' | 'delete-reconnect' | 'disconnect' | 'play' | 'play-single' | 'select-all' | 'arrange' | 'link' | 'docs' | 'command' | 'grid' | 'reset-zoom' | 'zoom-in' | 'zoom-out' | 'fit' | 'auto-layout' | 'expand-all' | 'collapse-all' | 'validate' | 'search' | 'refresh' | 'stop' | 'key' | 'send' | 'error' | 'warning' | 'debug' | 'data' | 'bot' | 'terminal' | 'pin' | 'inbox' | 'map' | 'image' | 'format' | 'settings' | 'fullscreen' | 'fullscreen-exit';
|
|
2
|
+
export declare function getEditorToolbarIconSvg(name: string): string | null;
|
|
3
|
+
export declare function isEditorToolbarIconName(name: string): name is EditorToolbarIconName;
|
|
4
|
+
export declare function renderEditorToolbarIcon(name: string): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LFGraphData } from './DataAdapter';
|
|
2
|
+
import type { ComponentDefinition } from '../types/component';
|
|
3
|
+
export interface DiagnosticItem {
|
|
4
|
+
id: string;
|
|
5
|
+
rule: string;
|
|
6
|
+
severity: 'error' | 'warning' | 'info';
|
|
7
|
+
message: string;
|
|
8
|
+
elementId?: string;
|
|
9
|
+
elementType?: 'node' | 'edge' | 'chain';
|
|
10
|
+
blocking: boolean;
|
|
11
|
+
details?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface TopologyContext {
|
|
14
|
+
nodeComponents?: Record<string, ComponentDefinition>;
|
|
15
|
+
}
|
|
16
|
+
export declare function validateTopology(graphData: LFGraphData, context?: TopologyContext): DiagnosticItem[];
|
|
17
|
+
export declare function groupDiagnosticsByElement(items: DiagnosticItem[]): Map<string, DiagnosticItem[]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface VirtualWindowOptions {
|
|
2
|
+
total: number;
|
|
3
|
+
itemHeight: number;
|
|
4
|
+
viewportHeight: number;
|
|
5
|
+
scrollTop?: number;
|
|
6
|
+
overscan?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface VirtualWindow {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
offsetTop: number;
|
|
12
|
+
totalHeight: number;
|
|
13
|
+
viewportHeight: number;
|
|
14
|
+
scrollTop: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const DEFAULT_VIRTUAL_WINDOW_ITEM_HEIGHT = 38;
|
|
17
|
+
export declare const DEFAULT_VIRTUAL_WINDOW_VIEWPORT_HEIGHT = 320;
|
|
18
|
+
export declare const DEFAULT_VIRTUAL_WINDOW_OVERSCAN = 4;
|
|
19
|
+
export declare const DEFAULT_VIRTUAL_WINDOW_THRESHOLD = 80;
|
|
20
|
+
export declare function calculateVirtualWindow(options: VirtualWindowOptions): VirtualWindow;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EditorWorkspaceTab } from './EditorWorkspace';
|
|
2
|
+
export type EditorWorkspaceTabAction = 'close' | 'close-others' | 'close-right' | 'rename' | 'toggle-pinned' | 'edit-info' | 'run-history' | 'debug' | 'toggle-disabled';
|
|
3
|
+
export type EditorWorkspaceTabLifecycleState = 'undeployed' | 'stopped' | 'running';
|
|
4
|
+
export interface EditorWorkspaceTabActionDescriptor {
|
|
5
|
+
id: EditorWorkspaceTabAction;
|
|
6
|
+
labelKey: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
dividerBefore?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function isWorkspaceTabDisabled(tab: EditorWorkspaceTab): boolean;
|
|
11
|
+
export declare function isWorkspaceTabPinned(tab: EditorWorkspaceTab): boolean;
|
|
12
|
+
export declare function getWorkspaceTabLifecycleState(tab: EditorWorkspaceTab): EditorWorkspaceTabLifecycleState;
|
|
13
|
+
export declare function getEditorWorkspaceTabActions(tab: EditorWorkspaceTab): readonly EditorWorkspaceTabActionDescriptor[];
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file defaults/components.ts
|
|
3
|
-
* @description 官方 RuleGo 默认组件定义。
|
|
4
|
-
*
|
|
5
|
-
* 该文件由参考项目 src/components/utils/default.js 机械同步,保持内置组件列表
|
|
6
|
-
* 与官方默认节点协议一致。真实运行时仍优先使用 /api/v1/components 返回的后端组件定义。
|
|
7
|
-
*/
|
|
8
1
|
import type { ComponentDefinition } from '../types/component';
|
|
9
|
-
/** 官方默认内置组件列表: endpoints + nodes */
|
|
10
2
|
export declare const defaultComponents: ComponentDefinition[];
|
|
11
|
-
//# sourceMappingURL=components.d.ts.map
|
package/dist/defaults/index.d.ts
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file defaults/index.ts
|
|
3
|
-
* @description 默认数据统一导出入口
|
|
4
|
-
*
|
|
5
|
-
* 导出项:
|
|
6
|
-
* - defaultComponents: 内置组件定义列表
|
|
7
|
-
* - localeZhCN: 中文语言包
|
|
8
|
-
* - localeEnUS: 英文语言包
|
|
9
|
-
*
|
|
10
|
-
* 使用方式:
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import { defaultComponents, localeZhCN, localeEnUS } from '@huanban/rulego-editor-core'
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
1
|
export { defaultComponents } from './components';
|
|
16
2
|
export { localeZhCN } from './locale-zh-CN';
|
|
17
3
|
export { localeEnUS } from './locale-en-US';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file defaults/locale-en-US.ts
|
|
3
|
-
* @description 英文语言包 — 编辑器所有 UI 文本的英文翻译
|
|
4
|
-
*
|
|
5
|
-
* 与 locale-zh-CN.ts 结构完全对应, 提供英文版本。
|
|
6
|
-
* 作为默认的 fallback 语言使用。
|
|
7
|
-
*
|
|
8
|
-
* 使用方式:
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { localeEnUS, I18nManager } from '@huanban/rulego-editor-core'
|
|
11
|
-
*
|
|
12
|
-
* const i18n = new I18nManager({ locale: 'en-US', fallback: 'en-US' })
|
|
13
|
-
* i18n.register('en-US', localeEnUS)
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @see locale-zh-CN.ts 中文对照版本
|
|
17
|
-
* @see I18nManager 国际化管理器
|
|
18
|
-
*/
|
|
19
1
|
import type { LocaleMessages } from '../core/I18nManager';
|
|
20
|
-
/**
|
|
21
|
-
* 英文语言包
|
|
22
|
-
*
|
|
23
|
-
* 结构与 localeZhCN 完全相同, 所有 key 一一对应
|
|
24
|
-
*/
|
|
25
2
|
export declare const localeEnUS: LocaleMessages;
|
|
26
|
-
//# sourceMappingURL=locale-en-US.d.ts.map
|
|
@@ -1,41 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file defaults/locale-zh-CN.ts
|
|
3
|
-
* @description 中文语言包 — 编辑器所有 UI 文本的中文翻译
|
|
4
|
-
*
|
|
5
|
-
* 移植自原版 local_zh.js, 并扩展了编辑器 UI 层所需的所有文本。
|
|
6
|
-
* 原版仅包含组件名称和字段标签的映射, 这里增加了:
|
|
7
|
-
* - 编辑器 UI 文本 (工具栏、侧边栏、对话框等)
|
|
8
|
-
* - 验证消息
|
|
9
|
-
* - 操作提示
|
|
10
|
-
* - HuanbanRulegoEditor 弹窗/面板/状态栏文本
|
|
11
|
-
*
|
|
12
|
-
* 使用方式:
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import { localeZhCN } from '@huanban/rulego-editor-core'
|
|
15
|
-
* import { I18nManager } from '@huanban/rulego-editor-core'
|
|
16
|
-
*
|
|
17
|
-
* const i18n = new I18nManager({ locale: 'zh-CN' })
|
|
18
|
-
* i18n.register('zh-CN', localeZhCN)
|
|
19
|
-
*
|
|
20
|
-
* // 使用翻译
|
|
21
|
-
* i18n.t('editor.toolbar.save') // => '保存'
|
|
22
|
-
* i18n.t('components.jsFilter') // => 'JS过滤器'
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* @see 原版: src/components/utils/local_zh.js
|
|
26
|
-
* @see I18nManager 用于加载和查询翻译
|
|
27
|
-
*/
|
|
28
1
|
import type { LocaleMessages } from '../core/I18nManager';
|
|
29
|
-
/**
|
|
30
|
-
* 中文语言包
|
|
31
|
-
*
|
|
32
|
-
* 结构说明:
|
|
33
|
-
* - editor.* : 编辑器 UI 层文本 (工具栏、侧边栏、对话框、面板、状态栏)
|
|
34
|
-
* - components.* : 组件类型的中文名称 (type => 中文标签)
|
|
35
|
-
* - fields.* : 组件字段的中文标签 (fieldName => 中文标签)
|
|
36
|
-
* - category.* : 分类名称
|
|
37
|
-
* - validation.* : 验证提示消息
|
|
38
|
-
* - action.* : 操作相关提示 (保存、删除、创建等)
|
|
39
|
-
*/
|
|
40
2
|
export declare const localeZhCN: LocaleMessages;
|
|
41
|
-
//# sourceMappingURL=locale-zh-CN.d.ts.map
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Official component fallbacks that exist in the upstream locale/view protocol
|
|
3
|
-
* but are not always returned by older /api/v1/components backends.
|
|
4
|
-
*
|
|
5
|
-
* These entries are appended only when a backend/default component list does not
|
|
6
|
-
* already contain the type, so live backend definitions remain authoritative.
|
|
7
|
-
*/
|
|
8
1
|
import type { ComponentDefinition } from '../types/component';
|
|
9
2
|
export declare const OFFICIAL_COMPONENT_FALLBACK_TYPES: readonly ["endpoint/beanstalkdTubeset", "iterator", "ci/exec", "x/beanstalkdTube", "x/beanstalkdWorker", "ai/transform/documentLoader", "ai/transform/textChunker", "ai/embedding/openai", "ai/indexer/milvus", "ai/indexer/redis", "ai/retriever/milvus", "ai/retriever/redis"];
|
|
10
3
|
export declare function createOfficialComponentFallback(type: string): ComponentDefinition | null;
|
|
11
4
|
export declare function appendOfficialComponentFallbacks<T extends ComponentDefinition>(components: T[]): ComponentDefinition[];
|
|
12
|
-
//# sourceMappingURL=official-component-fallbacks.d.ts.map
|
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file ClipboardExtension.ts
|
|
3
|
-
* @description 画布剪贴板拦截与 ID 净化增强
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 画布剪贴板扩展插件 (RuleGoClipboard)
|
|
7
|
-
*
|
|
8
|
-
* @class RuleGoClipboard
|
|
9
|
-
* @description 拦截 LogicFlow 原生的复制粘贴行为。
|
|
10
|
-
* 官方原生 LogicFlow 在复制时,直接使用内置的数据模型进行全量克隆。
|
|
11
|
-
* 在我们的业务场景下,复制一个包含算子的 Group (编排子组) 时,其内部节点的 `groupId` 与新组的 ID 会发生断裂。
|
|
12
|
-
* 该插件的职责是作为中间件,拦截粘贴流,并自动向所有被粘贴的节点派发新的唯一序列化 ID(基于 getNodeSeq)。
|
|
13
|
-
*/
|
|
14
1
|
export declare class RuleGoClipboard {
|
|
15
|
-
/** 暴露给 LogicFlow 的插件识别名 */
|
|
16
2
|
static pluginName: string;
|
|
17
|
-
/**
|
|
18
|
-
* 构造函数
|
|
19
|
-
* @param options 注入的上下文参数,包含 eventCenter 等
|
|
20
|
-
*/
|
|
21
3
|
constructor(_options: any);
|
|
22
|
-
/**
|
|
23
|
-
* 插件装载时的生命周期钩子
|
|
24
|
-
* @param lf LogicFlow 实例对象
|
|
25
|
-
*/
|
|
26
4
|
install(lf: any): void;
|
|
27
5
|
}
|
|
28
|
-
//# sourceMappingURL=ClipboardExtension.d.ts.map
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file KeyboardExtension.ts
|
|
3
|
-
* @description 全局快捷键注册机制
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 全局快捷键注册器
|
|
7
|
-
*
|
|
8
|
-
* @function registerKeyboard
|
|
9
|
-
* @description 将原生的键盘按键事件转化为框架内的通用语义事件。
|
|
10
|
-
* 由于我们在外部使用的是 Vue 或 React,不能直接依赖原生事件绑定。
|
|
11
|
-
* 此注册器剥离了 LogicFlow 与浏览器的耦合,拦截常见快捷键。
|
|
12
|
-
*
|
|
13
|
-
* @param {any} lf - LogicFlow 实例对象,必须开启 keyboard 插件
|
|
14
|
-
* @param {any} eventCenter - 全局事件总线,负责向外透传 ui 级别的交互事件
|
|
15
|
-
* @returns {void} 无返回值
|
|
16
|
-
*/
|
|
17
1
|
export declare const registerKeyboard: (lf: any, eventCenter: any) => void;
|
|
18
|
-
//# sourceMappingURL=KeyboardExtension.d.ts.map
|
|
@@ -1,29 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file MenuExtension.ts
|
|
3
|
-
* @description 无头右键菜单 (Headless Context Menu) 抛出器
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 无头右键菜单扩展插件 (RuleGoMenu)
|
|
7
|
-
*
|
|
8
|
-
* @class RuleGoMenu
|
|
9
|
-
* @description 传统基于 DOM 的插件在画布移动和缩放时,往往存在严重的错位和 DOM 节点堆积问题。
|
|
10
|
-
* 本插件实施“无头化 (Headless)”策略:
|
|
11
|
-
* 阻止默认事件发生,计算出画布内元素的精确屏幕绝对坐标 (e.clientX, e.clientY),
|
|
12
|
-
* 并携带目标业务数据 (node/edge) 向外层 UI 框架广播。
|
|
13
|
-
*/
|
|
14
1
|
export declare class RuleGoMenu {
|
|
15
2
|
private options;
|
|
16
|
-
/** 暴露给 LogicFlow 的插件识别名 */
|
|
17
3
|
static pluginName: string;
|
|
18
|
-
/**
|
|
19
|
-
* 构造函数
|
|
20
|
-
* @param options 注入的上下文参数,包含 eventCenter 等
|
|
21
|
-
*/
|
|
22
4
|
constructor(options: any);
|
|
23
|
-
/**
|
|
24
|
-
* 插件装载时的生命周期钩子
|
|
25
|
-
* @param lf LogicFlow 实例对象
|
|
26
|
-
*/
|
|
27
5
|
install(lf: any): void;
|
|
28
6
|
}
|
|
29
|
-
//# sourceMappingURL=MenuExtension.d.ts.map
|
package/dist/iconRegistry.d.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 自动生成的图标注册表 — 使用紧凑 SVG 模板并按主题延迟生成 data URL
|
|
3
|
-
* 来源: packages/editor-core/src/icons
|
|
4
|
-
* 图标数量: 123
|
|
5
|
-
* 主题数量: 13
|
|
6
|
-
*
|
|
7
|
-
* 用法: import { ICON_REGISTRY } from './iconRegistry'
|
|
8
|
-
* const url = ICON_REGISTRY['delay'] // => data:image/svg+xml,...
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* 默认图标 — 用于缺少图标的新开发组件(白色问号 SVG)
|
|
12
|
-
* 当组件没有注册图标或图标加载失败时,自动使用此图标替代
|
|
13
|
-
* 注意: 使用预编码的 base64 字符串,避免运行时 btoa 对 Unicode 字符报错
|
|
14
|
-
*/
|
|
15
1
|
export declare const DEFAULT_ICON_URL = "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48dGV4dCB4PSI1MTIiIHk9IjU2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZG9taW5hbnQtYmFzZWxpbmU9ImNlbnRyYWwiIGZvbnQtZmFtaWx5PSJBcmlhbCxzYW5zLXNlcmlmIiBmb250LXdlaWdodD0iYm9sZCIgZm9udC1zaXplPSI0MDAiIGZpbGw9IiNmZmZmZmYiPj88L3RleHQ+PC9zdmc+";
|
|
16
2
|
export declare const ICON_REGISTRY: Record<string, string>;
|
|
17
3
|
export declare const ICON_THEME_NAMES: readonly ["default", "dark", "nature", "elegant", "tech", "modern", "colorful", "ant-blue", "material", "tailwind", "github", "vscode", "apple"];
|
|
@@ -19,12 +5,4 @@ export type IconThemeName = typeof ICON_THEME_NAMES[number];
|
|
|
19
5
|
export declare const ICON_THEME_REGISTRY: Record<IconThemeName, Record<string, string>>;
|
|
20
6
|
export declare function normalizeIconTheme(theme?: string | null): IconThemeName;
|
|
21
7
|
export declare function getThemedIconUrl(name: string, theme?: string | null, fallbackPath?: string): string;
|
|
22
|
-
/**
|
|
23
|
-
* 根据图标名称获取图标 URL
|
|
24
|
-
* @param name - 图标名称(不含 .svg 扩展名),如 'delay', 'action'
|
|
25
|
-
* @param fallbackPath - 找不到时的降级路径,如 'images/delay.svg'
|
|
26
|
-
* @param theme - 主题名称,如 default/dark/nature/elegant/tech/modern/colorful/ant-blue/material/tailwind/github/vscode/apple
|
|
27
|
-
* @returns data URL 或降级路径
|
|
28
|
-
*/
|
|
29
8
|
export declare function getIconUrl(name: string, fallbackPath?: string, theme?: string | null): string;
|
|
30
|
-
//# sourceMappingURL=iconRegistry.d.ts.map
|