@rxflow/base 0.0.1-alpha.8 → 0.0.1

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.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["Flow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAQvC,OAAO,EAGL,IAAI,EAGJ,IAAI,EAOL,MAAM,eAAe,CAAC;AAavB,OAAO,cAAc,CAAC;AAMtB,wBAAgB,IAAI,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,2CAoPzH"}
1
+ {"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["Flow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAQvC,OAAO,EAGL,IAAI,EAGJ,IAAI,EAOL,MAAM,eAAe,CAAC;AAavB,OAAO,cAAc,CAAC;AAMtB,wBAAgB,IAAI,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,2CAsPzH"}
package/cjs/Flow.js CHANGED
@@ -46,6 +46,7 @@ function Flow(props) {
46
46
  showControls = true,
47
47
  // 默认开启
48
48
  controlsPosition = 'top-right',
49
+ controlsOrientation,
49
50
  showMiniMap,
50
51
  showLegend,
51
52
  background = '#F2F7FAFF',
@@ -227,7 +228,8 @@ function Flow(props) {
227
228
  onZoomOut: onZoomOut,
228
229
  onZoomIn: onZoomIn,
229
230
  onInteractiveChange: onInteractiveChange,
230
- children: customControls
231
+ children: customControls,
232
+ orientation: controlsOrientation
231
233
  }), showLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Legend, {
232
234
  showLegend: showLegend
233
235
  }), children]
@@ -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,CAAC,UAAU,CAAC,WAAW,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W,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
  });
package/esm/Flow.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["Flow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAQvC,OAAO,EAGL,IAAI,EAGJ,IAAI,EAOL,MAAM,eAAe,CAAC;AAavB,OAAO,cAAc,CAAC;AAMtB,wBAAgB,IAAI,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,2CAoPzH"}
1
+ {"version":3,"file":"Flow.d.ts","sourceRoot":"","sources":["Flow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAQvC,OAAO,EAGL,IAAI,EAGJ,IAAI,EAOL,MAAM,eAAe,CAAC;AAavB,OAAO,cAAc,CAAC;AAMtB,wBAAgB,IAAI,CAAC,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,SAAS,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,2CAsPzH"}
package/esm/Flow.js CHANGED
@@ -58,6 +58,7 @@ export function Flow(props) {
58
58
  showControls = _props$showControls === void 0 ? true : _props$showControls,
59
59
  _props$controlsPositi = props.controlsPosition,
60
60
  controlsPosition = _props$controlsPositi === void 0 ? 'top-right' : _props$controlsPositi,
61
+ controlsOrientation = props.controlsOrientation,
61
62
  showMiniMap = props.showMiniMap,
62
63
  showLegend = props.showLegend,
63
64
  _props$background = props.background,
@@ -242,7 +243,8 @@ export function Flow(props) {
242
243
  onZoomOut: onZoomOut,
243
244
  onZoomIn: onZoomIn,
244
245
  onInteractiveChange: onInteractiveChange,
245
- children: customControls
246
+ children: customControls,
247
+ orientation: controlsOrientation
246
248
  }), showLegend && /*#__PURE__*/_jsx(Legend, {
247
249
  showLegend: showLegend
248
250
  }), children]
@@ -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,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;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;CAC5D,2CA6FF"}
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,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;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
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxflow/base",
3
- "version": "0.0.1-alpha.8",
3
+ "version": "0.0.1",
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.8",
45
+ "@rxflow/manhattan": "^0.0.1",
46
46
  "@xyflow/react": "^12.8.6",
47
47
  "@xyflow/system": "^0.0.70",
48
48
  "@zumer/snapdom": "^1.9.9",