@rxflow/base 0.0.1-alpha.0 → 0.0.1-alpha.2

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/cjs/Flow.js CHANGED
@@ -13,7 +13,7 @@ var _lodash = require("lodash");
13
13
  var _react2 = _interopRequireWildcard(require("react"));
14
14
  var _Controls = _interopRequireDefault(require("./components/Controls"));
15
15
  var _DebugInfo = require("./components/DebugInfo");
16
- var _SmartEdge = require("./edges/SmartEdge");
16
+ var _manhattan = require("./edges/manhattan");
17
17
  var _useGetEdgesChangeHandlers = require("./hooks/edges/useGetEdgesChangeHandlers");
18
18
  var _useSetNodeDragging = require("./hooks/node/useSetNodeDragging");
19
19
  var _useForceUpdateTimes = require("./hooks/render/useForceUpdateTimes");
@@ -136,7 +136,7 @@ function Flow(props) {
136
136
  onlyRenderVisibleElements,
137
137
  ...(0, _lodash.omit)(props, ['flowInstanceRef', 'width', 'height', 'nodes', 'edges', 'fitViewOptions', 'theme', 'background', 'nodeTypes', 'showControls', 'showMiniMap', 'autoCenter', 'rootStyle', 'layout', 'onNodesChange', 'omitProps', 'forceLayout', 'controlsPosition', 'getMiniMapNodeColor', 'markers', 'onBeforeLayout', 'onLayout', 'onAfterLayout', 'plugins', 'readOnly', 'showFitView', 'showFullscreen', 'showInteractive', 'showZoom', 'showForceLayout', 'onInteractiveChange', 'onZoomOut', 'onZoomIn', 'onFitView', 'customControls', ...omitProps]),
138
138
  edgeTypes: {
139
- smart: _SmartEdge.SmartEdge,
139
+ manhattan: _manhattan.ManhattanEdge,
140
140
  ...(props.edgeTypes || {})
141
141
  }
142
142
  };
@@ -1,5 +1,5 @@
1
1
  export declare const symbols: {
2
- arrowclosed: ({ color, strokeWidth, }: import("./types").SymbolProps) => import("react/jsx-runtime").JSX.Element;
3
- arrow: ({ color, strokeWidth }: import("./types").SymbolProps) => import("react/jsx-runtime").JSX.Element;
2
+ arrowclosed: ({ color, strokeWidth, }: import("packages/base/src/components/MarkerDefinitions/types").SymbolProps) => import("react/jsx-runtime").JSX.Element;
3
+ arrow: ({ color, strokeWidth }: import("packages/base/src/components/MarkerDefinitions/types").SymbolProps) => import("react/jsx-runtime").JSX.Element;
4
4
  };
5
5
  //# sourceMappingURL=symbols.d.ts.map
@@ -8,8 +8,5 @@
8
8
  */
9
9
  import { type EdgeProps } from '@xyflow/react';
10
10
  import { ComponentType } from "react";
11
- export declare const SmartEdge: ComponentType<EdgeProps & {
12
- data: any;
13
- type: any;
14
- }>;
15
- //# sourceMappingURL=index.d.ts.map
11
+ export declare const ManhattanEdge: ComponentType<EdgeProps>;
12
+ //# sourceMappingURL=manhattan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manhattan.d.ts","sourceRoot":"","sources":["manhattan.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAW,KAAK,SAAS,EAAc,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,aAAa,EAAO,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,SAAS,CAyCjD,CAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SmartEdge = void 0;
6
+ exports.ManhattanEdge = void 0;
7
7
  var _react = require("@xyflow/react");
8
8
  var _react2 = require("react");
9
9
  var _manhattan = require("@rxflow/manhattan");
@@ -17,15 +17,15 @@ var _jsxRuntime = require("react/jsx-runtime");
17
17
  * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
18
18
  */
19
19
 
20
- const SmartEdge = exports.SmartEdge = /*#__PURE__*/(0, _react2.memo)(({
21
- id,
22
- selected,
20
+ const ManhattanEdge = exports.ManhattanEdge = /*#__PURE__*/(0, _react2.memo)(({
23
21
  source,
24
22
  target,
25
23
  sourceX,
26
24
  sourceY,
27
25
  targetX,
28
- targetY
26
+ targetY,
27
+ sourcePosition,
28
+ targetPosition
29
29
  }) => {
30
30
  const {
31
31
  getState
@@ -34,14 +34,21 @@ const SmartEdge = exports.SmartEdge = /*#__PURE__*/(0, _react2.memo)(({
34
34
  const path = (0, _manhattan.getManHattanPath)({
35
35
  sourceNodeId: source,
36
36
  targetNodeId: target,
37
- sourcePosition: {
38
- x: sourceX,
39
- y: sourceY
40
- },
41
- targetPosition: {
42
- x: targetX,
43
- y: targetY
44
- },
37
+ sourceX,
38
+ sourceY,
39
+ sourcePosition,
40
+ targetX,
41
+ targetY,
42
+ targetPosition,
43
+ //
44
+ // sourcePosition: {
45
+ // x: sourceX,
46
+ // y: sourceY
47
+ // },
48
+ // targetPosition: {
49
+ // x: targetX,
50
+ // y: targetY
51
+ // },
45
52
  nodeLookup: nodeLookup
46
53
  // options: {
47
54
  // padding: 10
@@ -51,4 +58,4 @@ const SmartEdge = exports.SmartEdge = /*#__PURE__*/(0, _react2.memo)(({
51
58
  path: path
52
59
  });
53
60
  });
54
- SmartEdge.displayName = 'SmartEdge';
61
+ ManhattanEdge.displayName = 'manhattan';
@@ -2,7 +2,7 @@ export declare const useTheme: () => {
2
2
  fontSize: number;
3
3
  fontFamily: string;
4
4
  primaryColor: string;
5
- collapseButtonShape?: "circle" | "rect" | undefined;
5
+ collapseButtonShape?: "rect" | "circle" | undefined;
6
6
  autoHideCountWhenExpanded?: boolean | undefined;
7
7
  showCount?: boolean | undefined;
8
8
  };
package/esm/Flow.js CHANGED
@@ -36,7 +36,7 @@ import { omit } from "lodash";
36
36
  import React, { useEffect, useMemo, useRef, useState } from "react";
37
37
  import Controls from "./components/Controls";
38
38
  import { DebugInfo } from "./components/DebugInfo";
39
- import { SmartEdge } from "./edges/SmartEdge";
39
+ import { ManhattanEdge } from "./edges/manhattan";
40
40
  import { useGetEdgesChangeHandlers } from "./hooks/edges/useGetEdgesChangeHandlers";
41
41
  import { useSetNodeDragging } from "./hooks/node/useSetNodeDragging";
42
42
  import { useForceUpdateTimes } from "./hooks/render/useForceUpdateTimes";
@@ -148,7 +148,7 @@ export function Flow(props) {
148
148
  onlyRenderVisibleElements: onlyRenderVisibleElements
149
149
  }, omit(props, ['flowInstanceRef', 'width', 'height', 'nodes', 'edges', 'fitViewOptions', 'theme', 'background', 'nodeTypes', 'showControls', 'showMiniMap', 'autoCenter', 'rootStyle', 'layout', 'onNodesChange', 'omitProps', 'forceLayout', 'controlsPosition', 'getMiniMapNodeColor', 'markers', 'onBeforeLayout', 'onLayout', 'onAfterLayout', 'plugins', 'readOnly', 'showFitView', 'showFullscreen', 'showInteractive', 'showZoom', 'showForceLayout', 'onInteractiveChange', 'onZoomOut', 'onZoomIn', 'onFitView', 'customControls'].concat(_toConsumableArray(omitProps)))), {}, {
150
150
  edgeTypes: _objectSpread({
151
- smart: SmartEdge
151
+ manhattan: ManhattanEdge
152
152
  }, props.edgeTypes || {})
153
153
  });
154
154
  if (plugins !== null && plugins !== void 0 && plugins.scroller) {
@@ -1,5 +1,5 @@
1
1
  export declare const symbols: {
2
- arrowclosed: ({ color, strokeWidth, }: import("./types").SymbolProps) => import("react/jsx-runtime").JSX.Element;
3
- arrow: ({ color, strokeWidth }: import("./types").SymbolProps) => import("react/jsx-runtime").JSX.Element;
2
+ arrowclosed: ({ color, strokeWidth, }: import("packages/base/src/components/MarkerDefinitions/types").SymbolProps) => import("react/jsx-runtime").JSX.Element;
3
+ arrow: ({ color, strokeWidth }: import("packages/base/src/components/MarkerDefinitions/types").SymbolProps) => import("react/jsx-runtime").JSX.Element;
4
4
  };
5
5
  //# sourceMappingURL=symbols.d.ts.map
@@ -8,8 +8,5 @@
8
8
  */
9
9
  import { type EdgeProps } from '@xyflow/react';
10
10
  import { ComponentType } from "react";
11
- export declare const SmartEdge: ComponentType<EdgeProps & {
12
- data: any;
13
- type: any;
14
- }>;
15
- //# sourceMappingURL=index.d.ts.map
11
+ export declare const ManhattanEdge: ComponentType<EdgeProps>;
12
+ //# sourceMappingURL=manhattan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manhattan.d.ts","sourceRoot":"","sources":["manhattan.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAW,KAAK,SAAS,EAAc,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,aAAa,EAAO,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,SAAS,CAyCjD,CAAA"}
@@ -10,29 +10,36 @@ import { BaseEdge, useStoreApi } from '@xyflow/react';
10
10
  import { memo } from "react";
11
11
  import { getManHattanPath } from '@rxflow/manhattan';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- export var SmartEdge = /*#__PURE__*/memo(function (_ref) {
14
- var id = _ref.id,
15
- selected = _ref.selected,
16
- source = _ref.source,
13
+ export var ManhattanEdge = /*#__PURE__*/memo(function (_ref) {
14
+ var source = _ref.source,
17
15
  target = _ref.target,
18
16
  sourceX = _ref.sourceX,
19
17
  sourceY = _ref.sourceY,
20
18
  targetX = _ref.targetX,
21
- targetY = _ref.targetY;
19
+ targetY = _ref.targetY,
20
+ sourcePosition = _ref.sourcePosition,
21
+ targetPosition = _ref.targetPosition;
22
22
  var _useStoreApi = useStoreApi(),
23
23
  getState = _useStoreApi.getState;
24
24
  var nodeLookup = getState().nodeLookup;
25
25
  var path = getManHattanPath({
26
26
  sourceNodeId: source,
27
27
  targetNodeId: target,
28
- sourcePosition: {
29
- x: sourceX,
30
- y: sourceY
31
- },
32
- targetPosition: {
33
- x: targetX,
34
- y: targetY
35
- },
28
+ sourceX: sourceX,
29
+ sourceY: sourceY,
30
+ sourcePosition: sourcePosition,
31
+ targetX: targetX,
32
+ targetY: targetY,
33
+ targetPosition: targetPosition,
34
+ //
35
+ // sourcePosition: {
36
+ // x: sourceX,
37
+ // y: sourceY
38
+ // },
39
+ // targetPosition: {
40
+ // x: targetX,
41
+ // y: targetY
42
+ // },
36
43
  nodeLookup: nodeLookup
37
44
  // options: {
38
45
  // padding: 10
@@ -42,4 +49,4 @@ export var SmartEdge = /*#__PURE__*/memo(function (_ref) {
42
49
  path: path
43
50
  });
44
51
  });
45
- SmartEdge.displayName = 'SmartEdge';
52
+ ManhattanEdge.displayName = 'manhattan';
@@ -2,7 +2,7 @@ export declare const useTheme: () => {
2
2
  fontSize: number;
3
3
  fontFamily: string;
4
4
  primaryColor: string;
5
- collapseButtonShape?: "circle" | "rect" | undefined;
5
+ collapseButtonShape?: "rect" | "circle" | undefined;
6
6
  autoHideCountWhenExpanded?: boolean | undefined;
7
7
  showCount?: boolean | undefined;
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxflow/base",
3
- "version": "0.0.1-alpha.0",
3
+ "version": "0.0.1-alpha.2",
4
4
  "description": "BaseFlow - 核心 Flow 组件库",
5
5
  "keywords": [
6
6
  "reactflow",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@ant-design/icons": "^6.0.0",
44
44
  "@antv/hierarchy": "0.6.14",
45
- "@rxflow/manhattan": "^0.0.1-alpha.0",
45
+ "@rxflow/manhattan": "^0.0.1-alpha.2",
46
46
  "@xyflow/react": "^12.8.6",
47
47
  "@xyflow/system": "^0.0.70",
48
48
  "@zumer/snapdom": "^1.9.9",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAW,KAAK,SAAS,EAAc,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,aAAa,EAAO,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,SAAS,GAAG;IAChD,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;CACX,CAsCC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAW,KAAK,SAAS,EAAc,MAAM,eAAe,CAAC;AACpE,OAAO,EAAC,aAAa,EAAO,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,SAAS,GAAG;IAChD,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;CACX,CAsCC,CAAA"}