@huanban/rulego-editor-react 1.0.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.
Files changed (49) hide show
  1. package/README.md +311 -0
  2. package/dist/components/ComponentSidebar.d.ts +77 -0
  3. package/dist/components/ComponentSidebar.d.ts.map +1 -0
  4. package/dist/components/ContextMenu.d.ts +102 -0
  5. package/dist/components/ContextMenu.d.ts.map +1 -0
  6. package/dist/components/DataViewDialog.d.ts +41 -0
  7. package/dist/components/DataViewDialog.d.ts.map +1 -0
  8. package/dist/components/DebugPanel.d.ts +92 -0
  9. package/dist/components/DebugPanel.d.ts.map +1 -0
  10. package/dist/components/EdgePropertyDrawer.d.ts +48 -0
  11. package/dist/components/EdgePropertyDrawer.d.ts.map +1 -0
  12. package/dist/components/EditorToolbar.d.ts +99 -0
  13. package/dist/components/EditorToolbar.d.ts.map +1 -0
  14. package/dist/components/ImportExportDialog.d.ts +45 -0
  15. package/dist/components/ImportExportDialog.d.ts.map +1 -0
  16. package/dist/components/MiniMap.d.ts +75 -0
  17. package/dist/components/MiniMap.d.ts.map +1 -0
  18. package/dist/components/NodePropertyDrawer.d.ts +83 -0
  19. package/dist/components/NodePropertyDrawer.d.ts.map +1 -0
  20. package/dist/components/RuleChainSettings.d.ts +74 -0
  21. package/dist/components/RuleChainSettings.d.ts.map +1 -0
  22. package/dist/components/RuleGoEditor.d.ts +168 -0
  23. package/dist/components/RuleGoEditor.d.ts.map +1 -0
  24. package/dist/components/SearchPanel.d.ts +52 -0
  25. package/dist/components/SearchPanel.d.ts.map +1 -0
  26. package/dist/components/ValidationPanel.d.ts +57 -0
  27. package/dist/components/ValidationPanel.d.ts.map +1 -0
  28. package/dist/components/WorkflowInfoPanel.d.ts +57 -0
  29. package/dist/components/WorkflowInfoPanel.d.ts.map +1 -0
  30. package/dist/components/WorkflowList.d.ts +91 -0
  31. package/dist/components/WorkflowList.d.ts.map +1 -0
  32. package/dist/hooks/useClipboard.d.ts +89 -0
  33. package/dist/hooks/useClipboard.d.ts.map +1 -0
  34. package/dist/hooks/useEditorCore.d.ts +102 -0
  35. package/dist/hooks/useEditorCore.d.ts.map +1 -0
  36. package/dist/hooks/useEditorI18n.d.ts +33 -0
  37. package/dist/hooks/useEditorI18n.d.ts.map +1 -0
  38. package/dist/hooks/useEditorTheme.d.ts +37 -0
  39. package/dist/hooks/useEditorTheme.d.ts.map +1 -0
  40. package/dist/hooks/useKeyboardShortcuts.d.ts +73 -0
  41. package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  42. package/dist/index.cjs.js +2494 -0
  43. package/dist/index.cjs.js.map +1 -0
  44. package/dist/index.d.ts +104 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.esm.js +62356 -0
  47. package/dist/index.esm.js.map +1 -0
  48. package/dist/style.css +1 -0
  49. package/package.json +69 -0
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @file index.ts
3
+ * @description @huanban/rulego-editor-react 包入口 — React 适配层
4
+ *
5
+ * 提供:
6
+ * - RuleGoEditor 主组件 (开箱即用)
7
+ * - useEditorCore hook (自定义 UI 场景)
8
+ * - useEditorTheme hook (主题管理)
9
+ * - useEditorI18n hook (国际化)
10
+ *
11
+ * 兼容性:
12
+ * - React 16.8+ (hooks 引入版本)
13
+ * - React 17.x / 18.x / 19.x
14
+ * - Next.js Pages Router (使用 dynamic import + ssr: false)
15
+ * - Next.js App Router (使用 'use client' 指令)
16
+ *
17
+ * 使用方式 1 — 快速上手:
18
+ * ```tsx
19
+ * import { RuleGoEditor } from '@huanban/rulego-editor-react'
20
+ * import '@huanban/rulego-editor-react/style.css'
21
+ *
22
+ * function App() {
23
+ * return <RuleGoEditor data={chainData} onSave={handleSave} />
24
+ * }
25
+ * ```
26
+ *
27
+ * 使用方式 2 — Hooks (自定义 UI):
28
+ * ```tsx
29
+ * import { useEditorCore, useEditorTheme } from '@huanban/rulego-editor-react'
30
+ *
31
+ * function MyEditor() {
32
+ * const { core, isReady, componentGroups } = useEditorCore({ url: '...' })
33
+ * const { setTheme } = useEditorTheme(core)
34
+ * // ...
35
+ * }
36
+ * ```
37
+ *
38
+ * Next.js Pages Router:
39
+ * ```tsx
40
+ * import dynamic from 'next/dynamic'
41
+ * const Editor = dynamic(
42
+ * () => import('@huanban/rulego-editor-react').then(m => ({ default: m.RuleGoEditor })),
43
+ * { ssr: false }
44
+ * )
45
+ * ```
46
+ *
47
+ * Next.js App Router:
48
+ * ```tsx
49
+ * 'use client'
50
+ * import { RuleGoEditor } from '@huanban/rulego-editor-react'
51
+ * ```
52
+ *
53
+ * @see RuleGoEditor — 主编辑器组件
54
+ * @see useEditorCore — 核心 Hook
55
+ * @see useEditorTheme — 主题管理 Hook
56
+ * @see useEditorI18n — 国际化 Hook
57
+ */
58
+ import '@logicflow/core/dist/index.css';
59
+ import '@logicflow/extension/dist/index.css';
60
+ import './styles/components.css';
61
+ export { default as RuleGoEditor } from './components/RuleGoEditor';
62
+ export type { RuleGoEditorProps, RuleGoEditorRef } from './components/RuleGoEditor';
63
+ export { default as ComponentSidebar } from './components/ComponentSidebar';
64
+ export type { ComponentSidebarProps, RuleGoComponent, ComponentField as RuleGoComponentField, } from './components/ComponentSidebar';
65
+ export { default as NodePropertyDrawer } from './components/NodePropertyDrawer';
66
+ export type { NodePropertyDrawerProps, NodeModel, NodeView, FieldDef, } from './components/NodePropertyDrawer';
67
+ export { default as EdgePropertyDrawer } from './components/EdgePropertyDrawer';
68
+ export type { EdgePropertyDrawerProps, EdgeModel, } from './components/EdgePropertyDrawer';
69
+ export { default as DebugPanel } from './components/DebugPanel';
70
+ export type { DebugPanelProps, DebugLogItem, SendMessageResult, } from './components/DebugPanel';
71
+ export { default as DataViewDialog } from './components/DataViewDialog';
72
+ export type { DataViewDialogProps } from './components/DataViewDialog';
73
+ export { default as EditorToolbar } from './components/EditorToolbar';
74
+ export type { EditorToolbarProps, ToolbarButton, } from './components/EditorToolbar';
75
+ export { default as ContextMenu } from './components/ContextMenu';
76
+ export { getNodeContextMenuItems, getEdgeContextMenuItems, getCanvasContextMenuItems, } from './components/ContextMenu';
77
+ export type { ContextMenuProps, ContextMenuItem, ContextMenuTarget, } from './components/ContextMenu';
78
+ export { default as MiniMap } from './components/MiniMap';
79
+ export type { MiniMapProps, MiniMapNode, MiniMapViewport, } from './components/MiniMap';
80
+ export { default as ValidationPanel } from './components/ValidationPanel';
81
+ export type { ValidationPanelProps, ValidationItem, } from './components/ValidationPanel';
82
+ export { default as RuleChainSettings } from './components/RuleChainSettings';
83
+ export type { RuleChainSettingsProps, RuleChainSettingsData, } from './components/RuleChainSettings';
84
+ export { default as ImportExportDialog } from './components/ImportExportDialog';
85
+ export type { ImportExportDialogProps, ImportExportMode, } from './components/ImportExportDialog';
86
+ export { default as SearchPanel } from './components/SearchPanel';
87
+ export type { SearchPanelProps, SearchResultItem, } from './components/SearchPanel';
88
+ export { WorkflowList } from './components/WorkflowList';
89
+ export type { WorkflowListProps } from './components/WorkflowList';
90
+ export { WorkflowInfoPanel } from './components/WorkflowInfoPanel';
91
+ export type { WorkflowInfoPanelProps, ExtraTab } from './components/WorkflowInfoPanel';
92
+ export { useEditorCore } from './hooks/useEditorCore';
93
+ export type { UseEditorCoreReturn } from './hooks/useEditorCore';
94
+ export { useEditorTheme } from './hooks/useEditorTheme';
95
+ export type { UseEditorThemeReturn } from './hooks/useEditorTheme';
96
+ export { useEditorI18n } from './hooks/useEditorI18n';
97
+ export type { UseEditorI18nReturn } from './hooks/useEditorI18n';
98
+ export { useKeyboardShortcuts, getShortcutLabel, getDefaultEditorShortcuts, } from './hooks/useKeyboardShortcuts';
99
+ export type { ShortcutConfig, UseKeyboardShortcutsOptions, } from './hooks/useKeyboardShortcuts';
100
+ export { useClipboard } from './hooks/useClipboard';
101
+ export type { ClipboardNode, ClipboardCallbacks, ClipboardManager, } from './hooks/useClipboard';
102
+ export type { EditorOptions, RuleChainData, RuleChainConfig, RuleNodeConfig, RuleConnectionConfig, RuleEndpointConfig, ComponentDefinition, ComponentGroup, ComponentField, EditorEventMap, EditorEventName, WorkflowItem, PagedResponse, ApiResult, WorkflowFetcher, RuleChainAPIOptions, RuleChainRoutes, WorkflowListIcons, WorkflowInfoIcons, WorkflowTheme, } from '@huanban/rulego-editor-core';
103
+ export { RuleChainAPI, DEFAULT_ROUTES } from '@huanban/rulego-editor-core';
104
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAQH,OAAO,gCAAgC,CAAA;AACvC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,yBAAyB,CAAA;AAMhC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACnE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAMnF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAC3E,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,cAAc,IAAI,oBAAoB,GACvC,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAC/E,YAAY,EACV,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAC/E,YAAY,EACV,uBAAuB,EACvB,SAAS,GACV,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAC/D,YAAY,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,GAClB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,OAAO,IAAI,c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