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

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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAmC,MAAM,OAAO,CAAC;AAKxD,wBAAgB,OAAO,CACrB,KAAK,EAAE,YAAY,GAAG;IACpB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC3B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;KAC1D,CAAC,CAAC;CACJ,2CAsFF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAmC,MAAM,OAAO,CAAC;AAKxD,wBAAgB,OAAO,CACrB,KAAK,EAAE,YAAY,GAAG;IACpB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC3B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;KAC1D,CAAC,CAAC;CACJ,2CA4FF"}
@@ -68,10 +68,15 @@ function Popover(props) {
68
68
  y
69
69
  } = (0, _react.useViewport)();
70
70
  (0, _react2.useEffect)(() => {
71
- if (open) {
72
- tooltipRef.current?.forceAlign(); // 跟随 viewport 移动
71
+ if (triggerActions.hover) {
72
+ setOpen(false); // viewport 移动, 自动关闭,fix
73
73
  }
74
74
  }, [x, y]);
75
+ (0, _react2.useEffect)(() => {
76
+ if (open) {
77
+ setOpen(false);
78
+ }
79
+ }, [isNodeDragging]);
75
80
  const cloneChildren = (0, _react2.useMemo)(() => {
76
81
  return /*#__PURE__*/_react2.default.cloneElement(children, {
77
82
  ...children.props,
@@ -91,7 +96,7 @@ function Popover(props) {
91
96
  getPopupContainer: _getPopupContainer.getPopupContainer,
92
97
  ...rest,
93
98
  trigger: trigger,
94
- open: open && !isNodeDragging,
99
+ open: open,
95
100
  onOpenChange: setOpen,
96
101
  children: children
97
102
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,YAAY,EAAa,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAmC,MAAM,OAAO,CAAC;AAIxD,wBAAgB,OAAO,CACrB,EACE,QAAQ,EACR,cAAc,EACd,KAAK,EACL,OAAiB,EACjB,GAAG,IAAI,EACR,EAAE,YAAY,GAAG;IAChB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC3B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAA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AAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;CAC5D,2CAmGF"}
@@ -77,10 +77,15 @@ function Tooltip({
77
77
  y
78
78
  } = (0, _react.useViewport)();
79
79
  (0, _react2.useEffect)(() => {
80
- if (open) {
81
- tooltipRef.current?.forceAlign(); // 跟随 viewport 移动
80
+ if (triggerActions.hover) {
81
+ setOpen(false); // viewport 移动, 自动关闭,fix
82
82
  }
83
83
  }, [x, y]);
84
+ (0, _react2.useEffect)(() => {
85
+ if (open) {
86
+ setOpen(false);
87
+ }
88
+ }, [isNodeDragging]);
84
89
  const cloneChildren = (0, _react2.useMemo)(() => {
85
90
  return /*#__PURE__*/_react2.default.cloneElement(children, {
86
91
  ...children.props,
@@ -101,7 +106,7 @@ function Tooltip({
101
106
  getPopupContainer: _getPopupContainer.getPopupContainer,
102
107
  ...rest,
103
108
  trigger: trigger,
104
- open: open && !isNodeDragging,
109
+ open: open,
105
110
  onOpenChange: setOpen,
106
111
  children: children
107
112
  });
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAmC,MAAM,OAAO,CAAC;AAKxD,wBAAgB,OAAO,CACrB,KAAK,EAAE,YAAY,GAAG;IACpB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC3B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;KAC1D,CAAC,CAAC;CACJ,2CAsFF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAmC,MAAM,OAAO,CAAC;AAKxD,wBAAgB,OAAO,CACrB,KAAK,EAAE,YAAY,GAAG;IACpB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;QAC3B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAC9D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;QAChE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;KAC1D,CAAC,CAAC;CACJ,2CA4FF"}
@@ -80,11 +80,15 @@ export function Popover(props) {
80
80
  x = _useViewport.x,
81
81
  y = _useViewport.y;
82
82
  useEffect(function () {
83
- if (open) {
84
- var _tooltipRef$current;
85
- (_tooltipRef$current = tooltipRef.current) === null || _tooltipRef$current === void 0 || _tooltipRef$current.forceAlign(); // 跟随 viewport 移动
83
+ if (triggerActions.hover) {
84
+ setOpen(false); // viewport 移动, 自动关闭,fix
86
85
  }
87
86
  }, [x, y]);
87
+ useEffect(function () {
88
+ if (open) {
89
+ setOpen(false);
90
+ }
91
+ }, [isNodeDragging]);
88
92
  var cloneChildren = useMemo(function () {
89
93
  return /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), triggerActions.hover ? {
90
94
  onMouseEnter: _onMouseEnter,
@@ -100,7 +104,7 @@ export function Popover(props) {
100
104
  getPopupContainer: getPopupContainer
101
105
  }, rest), {}, {
102
106
  trigger: trigger,
103
- open: open && !isNodeDragging,
107
+ open: open,
104
108
  onOpenChange: setOpen,
105
109
  children: children
106
110
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAC,YAAY,EAAa,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAmC,MAAM,OAAO,CAAC;AAIxD,wBAAgB,OAAO,CACrB,EACE,QAAQ,EACR,cAAc,EACd,KAAK,EACL,OAAiB,EACjB,GAAG,IAAI,EACR,EAAE,YAAY,GAAG;IAChB,QAAQ,EAAE,KAAK,CAAC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AC1D,CAAC,CAAC;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;CAC5D,2CAmGF"}
@@ -91,11 +91,15 @@ export function Tooltip(_ref) {
91
91
  x = _useViewport.x,
92
92
  y = _useViewport.y;
93
93
  useEffect(function () {
94
- if (open) {
95
- var _tooltipRef$current;
96
- (_tooltipRef$current = tooltipRef.current) === null || _tooltipRef$current === void 0 || _tooltipRef$current.forceAlign(); // 跟随 viewport 移动
94
+ if (triggerActions.hover) {
95
+ setOpen(false); // viewport 移动, 自动关闭,fix
97
96
  }
98
97
  }, [x, y]);
98
+ useEffect(function () {
99
+ if (open) {
100
+ setOpen(false);
101
+ }
102
+ }, [isNodeDragging]);
99
103
  var cloneChildren = useMemo(function () {
100
104
  return /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), triggerActions.hover ? {
101
105
  onMouseEnter: _onMouseEnter,
@@ -112,7 +116,7 @@ export function Tooltip(_ref) {
112
116
  getPopupContainer: getPopupContainer
113
117
  }, rest), {}, {
114
118
  trigger: trigger,
115
- open: open && !isNodeDragging,
119
+ open: open,
116
120
  onOpenChange: setOpen,
117
121
  children: children
118
122
  }));
@@ -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.10",
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.10",
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"}