@flowgram.ai/renderer 0.1.13 → 0.1.15
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/dist/esm/index.js +11 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/esm/index.js
CHANGED
|
@@ -628,8 +628,14 @@ import { Disposable } from "@flowgram.ai/utils";
|
|
|
628
628
|
// src/utils/element.ts
|
|
629
629
|
import { isNil } from "lodash";
|
|
630
630
|
var isHidden = (dom) => {
|
|
631
|
+
if (!dom || isNil(dom?.offsetParent)) {
|
|
632
|
+
return true;
|
|
633
|
+
}
|
|
631
634
|
const style = window.getComputedStyle(dom);
|
|
632
|
-
|
|
635
|
+
if (style?.display === "none") {
|
|
636
|
+
return true;
|
|
637
|
+
}
|
|
638
|
+
return false;
|
|
633
639
|
};
|
|
634
640
|
var isRectInit = (rect) => {
|
|
635
641
|
if (!rect) {
|
|
@@ -2659,11 +2665,8 @@ FlowSelectorBoxLayer = __decorateClass([
|
|
|
2659
2665
|
// src/layers/flow-selector-bounds-layer.tsx
|
|
2660
2666
|
import React16 from "react";
|
|
2661
2667
|
import { inject as inject10, injectable as injectable11 } from "inversify";
|
|
2662
|
-
import {
|
|
2663
|
-
|
|
2664
|
-
FlowNodeRenderData as FlowNodeRenderData6,
|
|
2665
|
-
FlowNodeTransformData as FlowNodeTransformData9
|
|
2666
|
-
} from "@flowgram.ai/document";
|
|
2668
|
+
import { domUtils as domUtils8 } from "@flowgram.ai/utils";
|
|
2669
|
+
import { FlowNodeEntity as FlowNodeEntity8, FlowNodeRenderData as FlowNodeRenderData6, FlowNodeTransformData as FlowNodeTransformData9 } from "@flowgram.ai/document";
|
|
2667
2670
|
import {
|
|
2668
2671
|
CommandRegistry,
|
|
2669
2672
|
EditorState as EditorState3,
|
|
@@ -2672,7 +2675,6 @@ import {
|
|
|
2672
2675
|
observeEntity as observeEntity9,
|
|
2673
2676
|
observeEntityDatas as observeEntityDatas7
|
|
2674
2677
|
} from "@flowgram.ai/core";
|
|
2675
|
-
import { domUtils as domUtils8 } from "@flowgram.ai/utils";
|
|
2676
2678
|
var FlowSelectorBoundsLayer = class extends Layer9 {
|
|
2677
2679
|
constructor() {
|
|
2678
2680
|
super(...arguments);
|
|
@@ -2729,6 +2731,7 @@ var FlowSelectorBoundsLayer = class extends Layer9 {
|
|
|
2729
2731
|
render() {
|
|
2730
2732
|
const {
|
|
2731
2733
|
ignoreOneSelect,
|
|
2734
|
+
ignoreChildrenLength,
|
|
2732
2735
|
SelectorBoxPopover: SelectorBoxPopoverFromOpts,
|
|
2733
2736
|
disableBackground,
|
|
2734
2737
|
CustomBoundsRenderer
|
|
@@ -2739,7 +2742,7 @@ var FlowSelectorBoundsLayer = class extends Layer9 {
|
|
|
2739
2742
|
const isDragging = !this.selectorBoxConfigEntity.isStart;
|
|
2740
2743
|
if (bounds.width === 0 || bounds.height === 0 || // 选中单个的时候不显示
|
|
2741
2744
|
ignoreOneSelect && selectedNodes.length === 1 && // 选中的节点不包含多个子节点
|
|
2742
|
-
selectedNodes[0].childrenLength <= 1) {
|
|
2745
|
+
(ignoreChildrenLength || selectedNodes[0].childrenLength <= 1)) {
|
|
2743
2746
|
domUtils8.setStyle(bg, {
|
|
2744
2747
|
display: "none"
|
|
2745
2748
|
});
|