@babylonjs/node-editor 5.45.2 → 5.46.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.
@@ -48759,11 +48759,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
48759
48759
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
48760
48760
|
const Null_Value = Number.MAX_SAFE_INTEGER;
|
48761
48761
|
class OptionsLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
|
48762
|
-
constructor(props) {
|
48763
|
-
super(props);
|
48764
|
-
this._localChange = false;
|
48765
|
-
this.state = { value: this._remapValueIn(this._getValue(props)) };
|
48766
|
-
}
|
48767
48762
|
_remapValueIn(value) {
|
48768
48763
|
return this.props.allowNullValue && value === null ? Null_Value : value;
|
48769
48764
|
}
|
@@ -48776,6 +48771,11 @@ class OptionsLineComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
|
|
48776
48771
|
}
|
48777
48772
|
return props.target && props.propertyName ? props.target[props.propertyName] : props.options[props.defaultIfNull || 0];
|
48778
48773
|
}
|
48774
|
+
constructor(props) {
|
48775
|
+
super(props);
|
48776
|
+
this._localChange = false;
|
48777
|
+
this.state = { value: this._remapValueIn(this._getValue(props)) };
|
48778
|
+
}
|
48779
48779
|
shouldComponentUpdate(nextProps, nextState) {
|
48780
48780
|
if (this._localChange) {
|
48781
48781
|
this._localChange = false;
|
@@ -49544,25 +49544,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
49544
49544
|
|
49545
49545
|
|
49546
49546
|
class FrameNodePort extends _nodePort__WEBPACK_IMPORTED_MODULE_1__.NodePort {
|
49547
|
-
constructor(portContainer, portData, node, stateManager, isInput, framePortId, parentFrameId) {
|
49548
|
-
super(portContainer, portData, node, stateManager);
|
49549
|
-
this.portData = portData;
|
49550
|
-
this.node = node;
|
49551
|
-
this._onFramePortPositionChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
|
49552
|
-
this._parentFrameId = parentFrameId;
|
49553
|
-
this._isInput = isInput;
|
49554
|
-
this._framePortId = framePortId;
|
49555
|
-
this._onSelectionChangedObserver = stateManager.onSelectionChangedObservable.add((options) => {
|
49556
|
-
const { selection } = options || {};
|
49557
|
-
if ((0,_tools__WEBPACK_IMPORTED_MODULE_2__.IsFramePortData)(selection) && selection.port === this) {
|
49558
|
-
this._img.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
49559
|
-
}
|
49560
|
-
else {
|
49561
|
-
this._img.classList.remove(_common_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
49562
|
-
}
|
49563
|
-
});
|
49564
|
-
this.refresh();
|
49565
|
-
}
|
49566
49547
|
get parentFrameId() {
|
49567
49548
|
return this._parentFrameId;
|
49568
49549
|
}
|
@@ -49582,6 +49563,25 @@ class FrameNodePort extends _nodePort__WEBPACK_IMPORTED_MODULE_1__.NodePort {
|
|
49582
49563
|
this._framePortPosition = position;
|
49583
49564
|
this.onFramePortPositionChangedObservable.notifyObservers(this);
|
49584
49565
|
}
|
49566
|
+
constructor(portContainer, portData, node, stateManager, isInput, framePortId, parentFrameId) {
|
49567
|
+
super(portContainer, portData, node, stateManager);
|
49568
|
+
this.portData = portData;
|
49569
|
+
this.node = node;
|
49570
|
+
this._onFramePortPositionChangedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
|
49571
|
+
this._parentFrameId = parentFrameId;
|
49572
|
+
this._isInput = isInput;
|
49573
|
+
this._framePortId = framePortId;
|
49574
|
+
this._onSelectionChangedObserver = stateManager.onSelectionChangedObservable.add((options) => {
|
49575
|
+
const { selection } = options || {};
|
49576
|
+
if ((0,_tools__WEBPACK_IMPORTED_MODULE_2__.IsFramePortData)(selection) && selection.port === this) {
|
49577
|
+
this._img.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
49578
|
+
}
|
49579
|
+
else {
|
49580
|
+
this._img.classList.remove(_common_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
49581
|
+
}
|
49582
|
+
});
|
49583
|
+
this.refresh();
|
49584
|
+
}
|
49585
49585
|
static CreateFrameNodePortElement(portData, node, root, displayManager, stateManager, isInput, framePortId, parentFrameId) {
|
49586
49586
|
const portContainer = root.ownerDocument.createElement("div");
|
49587
49587
|
portContainer.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].portLine);
|
@@ -49647,6 +49647,87 @@ __webpack_require__.r(__webpack_exports__);
|
|
49647
49647
|
|
49648
49648
|
|
49649
49649
|
class GraphCanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
|
49650
|
+
get gridSize() {
|
49651
|
+
return this._gridSize;
|
49652
|
+
}
|
49653
|
+
set gridSize(value) {
|
49654
|
+
this._gridSize = value;
|
49655
|
+
this.updateTransform();
|
49656
|
+
}
|
49657
|
+
get stateManager() {
|
49658
|
+
return this.props.stateManager;
|
49659
|
+
}
|
49660
|
+
get nodes() {
|
49661
|
+
return this._nodes;
|
49662
|
+
}
|
49663
|
+
get links() {
|
49664
|
+
return this._links;
|
49665
|
+
}
|
49666
|
+
get frames() {
|
49667
|
+
return this._frames;
|
49668
|
+
}
|
49669
|
+
get zoom() {
|
49670
|
+
return this._zoom;
|
49671
|
+
}
|
49672
|
+
set zoom(value) {
|
49673
|
+
if (this._zoom === value) {
|
49674
|
+
return;
|
49675
|
+
}
|
49676
|
+
this._zoom = value;
|
49677
|
+
this.updateTransform();
|
49678
|
+
}
|
49679
|
+
get x() {
|
49680
|
+
return this._x;
|
49681
|
+
}
|
49682
|
+
set x(value) {
|
49683
|
+
this._x = value;
|
49684
|
+
this.updateTransform();
|
49685
|
+
}
|
49686
|
+
get y() {
|
49687
|
+
return this._y;
|
49688
|
+
}
|
49689
|
+
set y(value) {
|
49690
|
+
this._y = value;
|
49691
|
+
this.updateTransform();
|
49692
|
+
}
|
49693
|
+
get selectedNodes() {
|
49694
|
+
return this._selectedNodes;
|
49695
|
+
}
|
49696
|
+
get selectedLink() {
|
49697
|
+
return this._selectedLink;
|
49698
|
+
}
|
49699
|
+
get selectedFrames() {
|
49700
|
+
return this._selectedFrames;
|
49701
|
+
}
|
49702
|
+
get selectedPort() {
|
49703
|
+
return this._selectedPort;
|
49704
|
+
}
|
49705
|
+
get canvasContainer() {
|
49706
|
+
return this._graphCanvas;
|
49707
|
+
}
|
49708
|
+
get hostCanvas() {
|
49709
|
+
return this._hostCanvas;
|
49710
|
+
}
|
49711
|
+
get svgCanvas() {
|
49712
|
+
return this._svgCanvas;
|
49713
|
+
}
|
49714
|
+
get selectionContainer() {
|
49715
|
+
return this._selectionContainer;
|
49716
|
+
}
|
49717
|
+
get frameContainer() {
|
49718
|
+
return this._frameContainer;
|
49719
|
+
}
|
49720
|
+
// There is a selection conflict between nodes and frames if any selected node is inside any selected frame
|
49721
|
+
_selectedFrameAndNodesConflict(frameSelection, nodeSelection) {
|
49722
|
+
for (const frame of frameSelection) {
|
49723
|
+
for (const node of nodeSelection) {
|
49724
|
+
if (frame.nodes.includes(node)) {
|
49725
|
+
return true;
|
49726
|
+
}
|
49727
|
+
}
|
49728
|
+
}
|
49729
|
+
return false;
|
49730
|
+
}
|
49650
49731
|
constructor(props) {
|
49651
49732
|
super(props);
|
49652
49733
|
this._minZoom = 0.1;
|
@@ -49799,87 +49880,6 @@ class GraphCanvasComponent extends react__WEBPACK_IMPORTED_MODULE_1__.Component
|
|
49799
49880
|
}
|
49800
49881
|
};
|
49801
49882
|
}
|
49802
|
-
get gridSize() {
|
49803
|
-
return this._gridSize;
|
49804
|
-
}
|
49805
|
-
set gridSize(value) {
|
49806
|
-
this._gridSize = value;
|
49807
|
-
this.updateTransform();
|
49808
|
-
}
|
49809
|
-
get stateManager() {
|
49810
|
-
return this.props.stateManager;
|
49811
|
-
}
|
49812
|
-
get nodes() {
|
49813
|
-
return this._nodes;
|
49814
|
-
}
|
49815
|
-
get links() {
|
49816
|
-
return this._links;
|
49817
|
-
}
|
49818
|
-
get frames() {
|
49819
|
-
return this._frames;
|
49820
|
-
}
|
49821
|
-
get zoom() {
|
49822
|
-
return this._zoom;
|
49823
|
-
}
|
49824
|
-
set zoom(value) {
|
49825
|
-
if (this._zoom === value) {
|
49826
|
-
return;
|
49827
|
-
}
|
49828
|
-
this._zoom = value;
|
49829
|
-
this.updateTransform();
|
49830
|
-
}
|
49831
|
-
get x() {
|
49832
|
-
return this._x;
|
49833
|
-
}
|
49834
|
-
set x(value) {
|
49835
|
-
this._x = value;
|
49836
|
-
this.updateTransform();
|
49837
|
-
}
|
49838
|
-
get y() {
|
49839
|
-
return this._y;
|
49840
|
-
}
|
49841
|
-
set y(value) {
|
49842
|
-
this._y = value;
|
49843
|
-
this.updateTransform();
|
49844
|
-
}
|
49845
|
-
get selectedNodes() {
|
49846
|
-
return this._selectedNodes;
|
49847
|
-
}
|
49848
|
-
get selectedLink() {
|
49849
|
-
return this._selectedLink;
|
49850
|
-
}
|
49851
|
-
get selectedFrames() {
|
49852
|
-
return this._selectedFrames;
|
49853
|
-
}
|
49854
|
-
get selectedPort() {
|
49855
|
-
return this._selectedPort;
|
49856
|
-
}
|
49857
|
-
get canvasContainer() {
|
49858
|
-
return this._graphCanvas;
|
49859
|
-
}
|
49860
|
-
get hostCanvas() {
|
49861
|
-
return this._hostCanvas;
|
49862
|
-
}
|
49863
|
-
get svgCanvas() {
|
49864
|
-
return this._svgCanvas;
|
49865
|
-
}
|
49866
|
-
get selectionContainer() {
|
49867
|
-
return this._selectionContainer;
|
49868
|
-
}
|
49869
|
-
get frameContainer() {
|
49870
|
-
return this._frameContainer;
|
49871
|
-
}
|
49872
|
-
// There is a selection conflict between nodes and frames if any selected node is inside any selected frame
|
49873
|
-
_selectedFrameAndNodesConflict(frameSelection, nodeSelection) {
|
49874
|
-
for (const frame of frameSelection) {
|
49875
|
-
for (const node of nodeSelection) {
|
49876
|
-
if (frame.nodes.includes(node)) {
|
49877
|
-
return true;
|
49878
|
-
}
|
49879
|
-
}
|
49880
|
-
}
|
49881
|
-
return false;
|
49882
|
-
}
|
49883
49883
|
populateConnectedEntriesBeforeRemoval(item, items, inputs, outputs) {
|
49884
49884
|
inputs.push(...item.content.inputs.filter((i) => i.isConnected && items.every((selected) => selected.content.data !== i.connectedPort?.ownerData)).map((i) => i.connectedPort));
|
49885
49885
|
outputs.push(...item.content.outputs
|
@@ -50876,945 +50876,945 @@ var FramePortPosition;
|
|
50876
50876
|
FramePortPosition[FramePortPosition["Bottom"] = 2] = "Bottom";
|
50877
50877
|
})(FramePortPosition || (FramePortPosition = {}));
|
50878
50878
|
class GraphFrame {
|
50879
|
-
|
50880
|
-
this.
|
50881
|
-
|
50882
|
-
|
50883
|
-
this.
|
50884
|
-
|
50885
|
-
|
50886
|
-
this.
|
50887
|
-
this.
|
50888
|
-
|
50889
|
-
this.
|
50890
|
-
|
50891
|
-
|
50892
|
-
|
50893
|
-
|
50894
|
-
|
50895
|
-
|
50896
|
-
|
50897
|
-
|
50898
|
-
|
50899
|
-
this.
|
50900
|
-
|
50901
|
-
|
50902
|
-
|
50903
|
-
|
50904
|
-
|
50905
|
-
|
50906
|
-
|
50907
|
-
|
50908
|
-
evt.stopPropagation();
|
50909
|
-
this._frameIsResizing = false;
|
50910
|
-
this._resizingDirection = null;
|
50911
|
-
this._mouseStartPointX = null;
|
50912
|
-
this._mouseStartPointY = null;
|
50913
|
-
this._mouseXLimit = null;
|
50914
|
-
this.refresh();
|
50915
|
-
};
|
50916
|
-
this._updateMinHeightWithComments = () => {
|
50917
|
-
if (this.comments && this.comments.length > 0) {
|
50918
|
-
const minFrameHeightWithComments = this._commentsElement.offsetHeight + 40;
|
50919
|
-
this._minFrameHeight = minFrameHeightWithComments;
|
50920
|
-
}
|
50921
|
-
};
|
50922
|
-
this._onRightHandlePointerDown = (evt) => {
|
50923
|
-
if (this.isCollapsed) {
|
50924
|
-
return;
|
50925
|
-
}
|
50926
|
-
this._initResizing(evt);
|
50927
|
-
this._resizingDirection = ResizingDirection.Right;
|
50928
|
-
this._mouseXLimit = evt.clientX - (this.width - this._minFrameWidth);
|
50929
|
-
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onRightHandlePointerUp);
|
50930
|
-
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onRightHandlePointerMove);
|
50931
|
-
};
|
50932
|
-
this._onRightHandlePointerMove = (evt) => {
|
50933
|
-
const slack = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom;
|
50934
|
-
const xLimit = this._mouseStartPointX - slack;
|
50935
|
-
this._moveRightHandle(evt, xLimit);
|
50936
|
-
};
|
50937
|
-
this._moveRightHandle = (evt, xLimit) => {
|
50938
|
-
// tslint:disable-next-line: no-this-assignment
|
50939
|
-
if (this._mouseXLimit) {
|
50940
|
-
if (!this._isResizingRight() || this._mouseStartPointX === null || this._mouseStartPointY === null || evt.clientX < xLimit) {
|
50941
|
-
return;
|
50879
|
+
get id() {
|
50880
|
+
return this._id;
|
50881
|
+
}
|
50882
|
+
get isCollapsed() {
|
50883
|
+
return this._isCollapsed;
|
50884
|
+
}
|
50885
|
+
_createInputPort(port, node) {
|
50886
|
+
const localPort = _frameNodePort__WEBPACK_IMPORTED_MODULE_1__.FrameNodePort.CreateFrameNodePortElement(port.portData, node, this._inputPortContainer, null, this._ownerCanvas.stateManager, true, GraphFrame._FramePortCounter++, this.id);
|
50887
|
+
this._frameInPorts.push(localPort);
|
50888
|
+
port.delegatedPort = localPort;
|
50889
|
+
this._controlledPorts.push(port);
|
50890
|
+
port.exposedPortPosition = this._exposedInPorts.findIndex((nodePort) => nodePort === port);
|
50891
|
+
if (port.exposedPortPosition < 0) {
|
50892
|
+
this._exposedInPorts.push(port);
|
50893
|
+
port.exposedPortPosition = this._exposedInPorts.length - 1;
|
50894
|
+
}
|
50895
|
+
}
|
50896
|
+
// Mark ports with FramePortPosition for re-arrangement support
|
50897
|
+
_markFramePortPositions() {
|
50898
|
+
// mark FrameInPorts
|
50899
|
+
if (this._frameInPorts.length == 2) {
|
50900
|
+
this._frameInPorts[0].framePortPosition = FramePortPosition.Top;
|
50901
|
+
this._frameInPorts[1].framePortPosition = FramePortPosition.Bottom;
|
50902
|
+
}
|
50903
|
+
else {
|
50904
|
+
for (let i = 0; i < this._frameInPorts.length; i++) {
|
50905
|
+
const port = this._frameInPorts[i];
|
50906
|
+
if (i === 0) {
|
50907
|
+
port.framePortPosition = FramePortPosition.Top;
|
50942
50908
|
}
|
50943
|
-
if (this.
|
50944
|
-
|
50945
|
-
|
50946
|
-
|
50947
|
-
|
50909
|
+
else if (i === this._frameInPorts.length - 1) {
|
50910
|
+
port.framePortPosition = FramePortPosition.Bottom;
|
50911
|
+
}
|
50912
|
+
else {
|
50913
|
+
port.framePortPosition = FramePortPosition.Middle;
|
50948
50914
|
}
|
50949
50915
|
}
|
50950
|
-
}
|
50951
|
-
|
50952
|
-
|
50953
|
-
|
50954
|
-
|
50955
|
-
|
50956
|
-
|
50957
|
-
|
50958
|
-
|
50959
|
-
|
50960
|
-
|
50961
|
-
|
50962
|
-
|
50963
|
-
|
50964
|
-
|
50965
|
-
|
50966
|
-
|
50967
|
-
|
50968
|
-
this._onBottomHandlePointerMove = (evt) => {
|
50969
|
-
const slack = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom;
|
50970
|
-
const yLimit = this._mouseStartPointY - slack;
|
50971
|
-
this._moveBottomHandle(evt, yLimit);
|
50972
|
-
};
|
50973
|
-
this._moveBottomHandle = (evt, yLimit) => {
|
50974
|
-
if (this._resizingDirection !== ResizingDirection.Bottom || this._mouseStartPointX === null || this._mouseStartPointY === null || evt.clientY < yLimit) {
|
50975
|
-
return;
|
50976
|
-
}
|
50977
|
-
if (this._resizingDirection === ResizingDirection.Bottom) {
|
50978
|
-
evt.stopPropagation();
|
50979
|
-
const distanceMouseMoved = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
50980
|
-
this._expandBottom(distanceMouseMoved);
|
50981
|
-
this._mouseStartPointY = evt.clientY;
|
50982
|
-
}
|
50983
|
-
};
|
50984
|
-
this._onBottomHandlePointerUp = (evt) => {
|
50985
|
-
if (this._resizingDirection === ResizingDirection.Bottom) {
|
50986
|
-
this.height = parseFloat(this.element.style.height.replace("px", ""));
|
50987
|
-
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onBottomHandlePointerMove);
|
50988
|
-
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onBottomHandlePointerUp);
|
50989
|
-
this._cleanUpResizing(evt);
|
50990
|
-
}
|
50991
|
-
};
|
50992
|
-
this._onLeftHandlePointerDown = (evt) => {
|
50993
|
-
if (this.isCollapsed) {
|
50994
|
-
return;
|
50916
|
+
}
|
50917
|
+
// mark FrameOutPorts
|
50918
|
+
if (this._frameOutPorts.length == 2) {
|
50919
|
+
this._frameOutPorts[0].framePortPosition = FramePortPosition.Top;
|
50920
|
+
this._frameOutPorts[1].framePortPosition = FramePortPosition.Bottom;
|
50921
|
+
}
|
50922
|
+
else {
|
50923
|
+
for (let i = 0; i < this._frameOutPorts.length; i++) {
|
50924
|
+
const port = this._frameOutPorts[i];
|
50925
|
+
if (i === 0) {
|
50926
|
+
port.framePortPosition = FramePortPosition.Top;
|
50927
|
+
}
|
50928
|
+
else if (i === this._frameInPorts.length - 1) {
|
50929
|
+
port.framePortPosition = FramePortPosition.Bottom;
|
50930
|
+
}
|
50931
|
+
else {
|
50932
|
+
port.framePortPosition = FramePortPosition.Middle;
|
50933
|
+
}
|
50995
50934
|
}
|
50996
|
-
|
50997
|
-
|
50998
|
-
|
50999
|
-
|
51000
|
-
|
51001
|
-
}
|
51002
|
-
|
51003
|
-
|
51004
|
-
const
|
51005
|
-
|
51006
|
-
|
51007
|
-
|
51008
|
-
|
51009
|
-
if (this._resizingDirection !== ResizingDirection.Left || this._mouseStartPointX === null || this._mouseStartPointY === null || evt.clientX > xLimit) {
|
51010
|
-
return;
|
50935
|
+
}
|
50936
|
+
}
|
50937
|
+
_createFramePorts() {
|
50938
|
+
for (const node of this._nodes) {
|
50939
|
+
node.isVisible = false;
|
50940
|
+
}
|
50941
|
+
for (let i = 0; i < this._exposedOutPorts.length;) {
|
50942
|
+
// Output
|
50943
|
+
const port = this._exposedOutPorts[i];
|
50944
|
+
if (port) {
|
50945
|
+
if (port.node === null || port.node.enclosingFrameId != this.id) {
|
50946
|
+
if (this._removePortFromExposedWithNode(port, this._exposedOutPorts))
|
50947
|
+
continue;
|
51011
50948
|
}
|
51012
|
-
|
51013
|
-
|
51014
|
-
|
51015
|
-
|
51016
|
-
this._mouseStartPointX = evt.clientX;
|
50949
|
+
else {
|
50950
|
+
if (!this._createOutputPorts(port, port.node) && this._removePortFromExposedWithNode(port, this._exposedOutPorts)) {
|
50951
|
+
continue;
|
50952
|
+
}
|
51017
50953
|
}
|
51018
50954
|
}
|
51019
|
-
|
51020
|
-
|
51021
|
-
|
51022
|
-
|
51023
|
-
|
51024
|
-
|
51025
|
-
this.
|
51026
|
-
|
50955
|
+
++i;
|
50956
|
+
}
|
50957
|
+
for (let i = 0; i < this._exposedInPorts.length;) {
|
50958
|
+
// Input
|
50959
|
+
const port = this._exposedInPorts[i];
|
50960
|
+
if (!port || port.node === null || port.node.enclosingFrameId != this.id) {
|
50961
|
+
if (this._removePortFromExposedWithNode(port, this._exposedInPorts)) {
|
50962
|
+
continue;
|
50963
|
+
}
|
51027
50964
|
}
|
51028
|
-
|
51029
|
-
|
51030
|
-
|
51031
|
-
|
50965
|
+
else {
|
50966
|
+
if (!this._createInputPorts(port, port.node) && this._removePortFromExposedWithNode(port, this._exposedInPorts)) {
|
50967
|
+
continue;
|
50968
|
+
}
|
51032
50969
|
}
|
51033
|
-
|
51034
|
-
|
51035
|
-
|
51036
|
-
|
51037
|
-
|
51038
|
-
|
51039
|
-
|
51040
|
-
|
51041
|
-
|
51042
|
-
|
51043
|
-
|
51044
|
-
|
51045
|
-
|
50970
|
+
++i;
|
50971
|
+
}
|
50972
|
+
for (const node of this._nodes) {
|
50973
|
+
for (const port of node.outputPorts) {
|
50974
|
+
// Output
|
50975
|
+
port.exposedPortPosition = this._exposedOutPorts.findIndex((nodePort) => nodePort === port);
|
50976
|
+
if (port.exposedPortPosition < 0) {
|
50977
|
+
if (this._createOutputPorts(port, node)) {
|
50978
|
+
port.node.enclosingFrameId = this.id;
|
50979
|
+
this._exposedOutPorts.push(port);
|
50980
|
+
port.exposedPortPosition = this._exposedOutPorts.length - 1;
|
50981
|
+
}
|
50982
|
+
}
|
51046
50983
|
}
|
51047
|
-
|
51048
|
-
|
51049
|
-
|
51050
|
-
|
51051
|
-
|
50984
|
+
for (const port of node.inputPorts) {
|
50985
|
+
// Input
|
50986
|
+
port.exposedPortPosition = this._exposedInPorts.findIndex((nodePort) => nodePort === port);
|
50987
|
+
if (port.exposedPortPosition < 0) {
|
50988
|
+
this._createInputPorts(port, node);
|
50989
|
+
}
|
51052
50990
|
}
|
51053
|
-
}
|
51054
|
-
|
51055
|
-
|
51056
|
-
|
51057
|
-
|
51058
|
-
|
51059
|
-
|
51060
|
-
|
50991
|
+
}
|
50992
|
+
}
|
50993
|
+
_removePortFromExposedWithNode(port, exposedPorts) {
|
50994
|
+
const index = exposedPorts.findIndex((nodePort) => nodePort === port);
|
50995
|
+
if (index >= 0) {
|
50996
|
+
exposedPorts.splice(index, 1);
|
50997
|
+
if (port) {
|
50998
|
+
port.exposedPortPosition = -1;
|
51061
50999
|
}
|
51062
|
-
|
51063
|
-
|
51064
|
-
|
51065
|
-
|
51000
|
+
return true;
|
51001
|
+
}
|
51002
|
+
return false;
|
51003
|
+
}
|
51004
|
+
_removePortFromExposedWithLink(nodeLink, exposedPorts) {
|
51005
|
+
const aPort = exposedPorts.findIndex((nodePort) => nodePort === nodeLink.portA);
|
51006
|
+
const bPort = exposedPorts.findIndex((nodePort) => nodePort === nodeLink.portB);
|
51007
|
+
if (aPort >= 0) {
|
51008
|
+
if (!nodeLink.portA.exposedOnFrame) {
|
51009
|
+
exposedPorts.splice(aPort, 1);
|
51010
|
+
nodeLink.portA.exposedPortPosition = -1;
|
51011
|
+
return true;
|
51066
51012
|
}
|
51067
|
-
|
51068
|
-
|
51069
|
-
|
51070
|
-
|
51071
|
-
|
51072
|
-
|
51073
|
-
const topSlack = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom;
|
51074
|
-
const yLimit = this._mouseStartPointY + topSlack;
|
51075
|
-
const rightSlack = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom;
|
51076
|
-
const xLimit = this._mouseStartPointX - rightSlack;
|
51077
|
-
this._moveTopRightHandle(evt, xLimit, yLimit);
|
51078
|
-
};
|
51079
|
-
this._moveTopRightHandle = (evt, xLimit, yLimit) => {
|
51080
|
-
if (!(this._isResizingTop() && this._isResizingRight()) || this._mouseStartPointX === null || this._mouseStartPointY === null) {
|
51081
|
-
return;
|
51013
|
+
}
|
51014
|
+
else if (bPort >= 0) {
|
51015
|
+
if (nodeLink.portB && !nodeLink.portB.exposedOnFrame) {
|
51016
|
+
exposedPorts.splice(bPort, 1);
|
51017
|
+
nodeLink.portB.exposedPortPosition = -1;
|
51018
|
+
return true;
|
51082
51019
|
}
|
51083
|
-
|
51084
|
-
|
51085
|
-
|
51086
|
-
|
51087
|
-
|
51088
|
-
|
51089
|
-
|
51090
|
-
|
51091
|
-
this.
|
51092
|
-
|
51093
|
-
|
51094
|
-
|
51095
|
-
|
51096
|
-
|
51097
|
-
|
51098
|
-
|
51099
|
-
|
51100
|
-
else if (evt.clientY < yLimit && evt.clientX < xLimit) {
|
51101
|
-
// able to move in Y but not X
|
51102
|
-
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51103
|
-
this._expandTop(distanceMouseMovedY);
|
51104
|
-
this._mouseStartPointY = evt.clientY;
|
51020
|
+
}
|
51021
|
+
return false;
|
51022
|
+
}
|
51023
|
+
_createInputPorts(port, node) {
|
51024
|
+
if (port.portData.isConnected) {
|
51025
|
+
let portAdded = false;
|
51026
|
+
for (const link of node.links) {
|
51027
|
+
if (link.portB === port && this.nodes.indexOf(link.nodeA) === -1) {
|
51028
|
+
this._createInputPort(port, node);
|
51029
|
+
link.isVisible = true;
|
51030
|
+
portAdded = true;
|
51031
|
+
const onLinkDisposedObserver = link.onDisposedObservable.add((nodeLink) => {
|
51032
|
+
if (this._removePortFromExposedWithLink(nodeLink, this._exposedInPorts)) {
|
51033
|
+
this.redrawFramePorts();
|
51034
|
+
}
|
51035
|
+
});
|
51036
|
+
this._onNodeLinkDisposedObservers.push(onLinkDisposedObserver);
|
51105
51037
|
}
|
51106
51038
|
}
|
51107
|
-
|
51108
|
-
|
51109
|
-
|
51110
|
-
|
51111
|
-
|
51112
|
-
|
51113
|
-
|
51114
|
-
|
51115
|
-
|
51116
|
-
|
51117
|
-
|
51118
|
-
|
51119
|
-
|
51120
|
-
|
51121
|
-
|
51122
|
-
|
51123
|
-
|
51124
|
-
|
51125
|
-
|
51126
|
-
|
51127
|
-
|
51128
|
-
|
51129
|
-
|
51130
|
-
|
51131
|
-
|
51132
|
-
|
51133
|
-
|
51134
|
-
|
51135
|
-
|
51136
|
-
|
51137
|
-
|
51138
|
-
|
51139
|
-
|
51140
|
-
|
51141
|
-
|
51142
|
-
|
51143
|
-
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51144
|
-
this._expandRight(distanceMouseMovedX, evt.clientX);
|
51145
|
-
this._mouseStartPointX = evt.clientX;
|
51146
|
-
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51147
|
-
this._expandBottom(distanceMouseMovedY);
|
51148
|
-
this._mouseStartPointY = evt.clientY;
|
51149
|
-
}
|
51150
|
-
else if (evt.clientY < yLimit && evt.clientX > xLimit) {
|
51151
|
-
// able to move in X but not Y
|
51152
|
-
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51153
|
-
this._expandRight(distanceMouseMovedX, evt.clientX);
|
51154
|
-
this._mouseStartPointX = evt.clientX;
|
51039
|
+
if (portAdded)
|
51040
|
+
return true;
|
51041
|
+
}
|
51042
|
+
else if (port.exposedOnFrame) {
|
51043
|
+
this._createInputPort(port, node);
|
51044
|
+
return true;
|
51045
|
+
}
|
51046
|
+
return false;
|
51047
|
+
}
|
51048
|
+
_createOutputPorts(port, node) {
|
51049
|
+
if (port.portData.hasEndpoints) {
|
51050
|
+
let portAdded = false;
|
51051
|
+
for (const link of node.links) {
|
51052
|
+
if (link.portA === port && this.nodes.indexOf(link.nodeB) === -1) {
|
51053
|
+
let localPort;
|
51054
|
+
if (!portAdded) {
|
51055
|
+
portAdded = true;
|
51056
|
+
localPort = _frameNodePort__WEBPACK_IMPORTED_MODULE_1__.FrameNodePort.CreateFrameNodePortElement(port.portData, link.nodeA, this._outputPortContainer, null, this._ownerCanvas.stateManager, false, GraphFrame._FramePortCounter++, this.id);
|
51057
|
+
this._frameOutPorts.push(localPort);
|
51058
|
+
link.isVisible = true;
|
51059
|
+
const onLinkDisposedObserver = link.onDisposedObservable.add((nodeLink) => {
|
51060
|
+
if (this._removePortFromExposedWithLink(nodeLink, this._exposedOutPorts)) {
|
51061
|
+
this.redrawFramePorts();
|
51062
|
+
}
|
51063
|
+
});
|
51064
|
+
this._onNodeLinkDisposedObservers.push(onLinkDisposedObserver);
|
51065
|
+
}
|
51066
|
+
else if (this.nodes.indexOf(link.nodeB) === -1) {
|
51067
|
+
link.isVisible = true;
|
51068
|
+
localPort = this.ports.filter((p) => p.portData === port.portData)[0];
|
51069
|
+
}
|
51070
|
+
else {
|
51071
|
+
localPort = this.ports.filter((p) => p.portData === port.portData)[0];
|
51072
|
+
}
|
51073
|
+
port.delegatedPort = localPort;
|
51074
|
+
this._controlledPorts.push(port);
|
51155
51075
|
}
|
51156
|
-
else if (
|
51157
|
-
|
51158
|
-
|
51159
|
-
|
51160
|
-
this.
|
51076
|
+
else if (port.exposedPortPosition >= 0 && !portAdded) {
|
51077
|
+
const localPort = _frameNodePort__WEBPACK_IMPORTED_MODULE_1__.FrameNodePort.CreateFrameNodePortElement(port.portData, node, this._outputPortContainer, null, this._ownerCanvas.stateManager, false, GraphFrame._FramePortCounter++, this.id);
|
51078
|
+
this._frameOutPorts.push(localPort);
|
51079
|
+
port.delegatedPort = localPort;
|
51080
|
+
this._controlledPorts.push(port);
|
51081
|
+
portAdded = true;
|
51161
51082
|
}
|
51162
51083
|
}
|
51163
|
-
|
51164
|
-
|
51165
|
-
|
51166
|
-
|
51167
|
-
|
51168
|
-
|
51169
|
-
|
51170
|
-
|
51171
|
-
|
51172
|
-
}
|
51173
|
-
|
51174
|
-
|
51175
|
-
|
51176
|
-
|
51177
|
-
|
51178
|
-
|
51179
|
-
|
51180
|
-
|
51181
|
-
|
51182
|
-
|
51183
|
-
};
|
51184
|
-
this.
|
51185
|
-
|
51186
|
-
|
51187
|
-
|
51188
|
-
|
51189
|
-
|
51190
|
-
|
51191
|
-
this.
|
51192
|
-
|
51193
|
-
|
51084
|
+
if (portAdded)
|
51085
|
+
return true;
|
51086
|
+
}
|
51087
|
+
else if (port.exposedOnFrame) {
|
51088
|
+
const localPort = _frameNodePort__WEBPACK_IMPORTED_MODULE_1__.FrameNodePort.CreateFrameNodePortElement(port.portData, node, this._outputPortContainer, null, this._ownerCanvas.stateManager, false, GraphFrame._FramePortCounter++, this.id);
|
51089
|
+
this._frameOutPorts.push(localPort);
|
51090
|
+
port.delegatedPort = localPort;
|
51091
|
+
this._controlledPorts.push(port);
|
51092
|
+
return true;
|
51093
|
+
}
|
51094
|
+
return false;
|
51095
|
+
}
|
51096
|
+
redrawFramePorts() {
|
51097
|
+
if (!this.isCollapsed) {
|
51098
|
+
return;
|
51099
|
+
}
|
51100
|
+
this._outputPortContainer.innerHTML = "";
|
51101
|
+
this._inputPortContainer.innerHTML = "";
|
51102
|
+
this.ports.forEach((framePort) => {
|
51103
|
+
framePort.dispose();
|
51104
|
+
});
|
51105
|
+
this._controlledPorts.forEach((port) => {
|
51106
|
+
port.delegatedPort = null;
|
51107
|
+
port.refresh();
|
51108
|
+
});
|
51109
|
+
this._frameInPorts = [];
|
51110
|
+
this._frameOutPorts = [];
|
51111
|
+
this._controlledPorts = [];
|
51112
|
+
this._createFramePorts();
|
51113
|
+
this._markFramePortPositions();
|
51114
|
+
this.ports.forEach((framePort) => framePort.node._refreshLinks());
|
51115
|
+
}
|
51116
|
+
set isCollapsed(value) {
|
51117
|
+
if (this._isCollapsed === value) {
|
51118
|
+
return;
|
51119
|
+
}
|
51120
|
+
this._isCollapsed = value;
|
51121
|
+
this._ownerCanvas._frameIsMoving = true;
|
51122
|
+
// Need to delegate the outside ports to the frame
|
51123
|
+
if (value) {
|
51124
|
+
this.element.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].collapsed);
|
51125
|
+
this.element.classList.remove(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].expanded);
|
51126
|
+
this._headerElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].collapsedHeader);
|
51127
|
+
this._moveFrame((this.width - this._collapsedWidth) / 2, 0);
|
51128
|
+
this._createFramePorts();
|
51129
|
+
this._markFramePortPositions();
|
51130
|
+
}
|
51131
|
+
else {
|
51132
|
+
this.element.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].expanded);
|
51133
|
+
this.element.classList.remove(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].collapsed);
|
51134
|
+
this._headerElement.classList.remove(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].collapsedHeader);
|
51135
|
+
this._outputPortContainer.innerHTML = "";
|
51136
|
+
this._inputPortContainer.innerHTML = "";
|
51137
|
+
this._frameInPorts.forEach((p) => {
|
51138
|
+
p.dispose();
|
51139
|
+
});
|
51140
|
+
this._frameOutPorts.forEach((p) => {
|
51141
|
+
p.dispose();
|
51142
|
+
});
|
51143
|
+
this._controlledPorts.forEach((port) => {
|
51144
|
+
port.delegatedPort = null;
|
51145
|
+
port.refresh();
|
51146
|
+
});
|
51147
|
+
this._frameInPorts = [];
|
51148
|
+
this._frameOutPorts = [];
|
51149
|
+
this._controlledPorts = [];
|
51150
|
+
this._onNodeLinkDisposedObservers = [];
|
51151
|
+
for (const node of this._nodes) {
|
51152
|
+
node.isVisible = true;
|
51194
51153
|
}
|
51195
|
-
|
51196
|
-
|
51197
|
-
|
51198
|
-
|
51199
|
-
|
51200
|
-
|
51201
|
-
|
51202
|
-
|
51203
|
-
|
51204
|
-
|
51154
|
+
this._moveFrame(-(this.width - this._collapsedWidth) / 2, 0);
|
51155
|
+
}
|
51156
|
+
this.cleanAccumulation();
|
51157
|
+
this._ownerCanvas._frameIsMoving = false;
|
51158
|
+
// UI
|
51159
|
+
if (this._isCollapsed) {
|
51160
|
+
this._headerCollapseElement.innerHTML = this._expandSVG;
|
51161
|
+
this._headerCollapseElement.title = "Expand";
|
51162
|
+
}
|
51163
|
+
else {
|
51164
|
+
this._headerCollapseElement.innerHTML = this._collapseSVG;
|
51165
|
+
this._headerCollapseElement.title = "Collapse";
|
51166
|
+
}
|
51167
|
+
this.onExpandStateChanged.notifyObservers(this);
|
51168
|
+
}
|
51169
|
+
get nodes() {
|
51170
|
+
return this._nodes;
|
51171
|
+
}
|
51172
|
+
get ports() {
|
51173
|
+
return this._frameInPorts.concat(this._frameOutPorts);
|
51174
|
+
}
|
51175
|
+
get name() {
|
51176
|
+
return this._name;
|
51177
|
+
}
|
51178
|
+
set name(value) {
|
51179
|
+
this._name = value;
|
51180
|
+
this._headerTextElement.innerHTML = value;
|
51181
|
+
}
|
51182
|
+
get color() {
|
51183
|
+
return this._color;
|
51184
|
+
}
|
51185
|
+
set color(value) {
|
51186
|
+
this._color = value;
|
51187
|
+
this._headerElement.style.background = `rgba(${value.r * 255}, ${value.g * 255}, ${value.b * 255}, 1)`;
|
51188
|
+
this._headerElement.style.borderColor = `rgba(${value.r * 255}, ${value.g * 255}, ${value.b * 255}, 1)`;
|
51189
|
+
this.element.style.background = `rgba(${value.r * 255}, ${value.g * 255}, ${value.b * 255}, 0.7)`;
|
51190
|
+
}
|
51191
|
+
get x() {
|
51192
|
+
return this._x;
|
51193
|
+
}
|
51194
|
+
set x(value) {
|
51195
|
+
if (this._x === value) {
|
51196
|
+
return;
|
51197
|
+
}
|
51198
|
+
this._x = value;
|
51199
|
+
this._gridAlignedX = this._ownerCanvas.getGridPosition(value);
|
51200
|
+
this.element.style.left = `${this._gridAlignedX}px`;
|
51201
|
+
}
|
51202
|
+
get y() {
|
51203
|
+
return this._y;
|
51204
|
+
}
|
51205
|
+
set y(value) {
|
51206
|
+
if (this._y === value) {
|
51207
|
+
return;
|
51208
|
+
}
|
51209
|
+
this._y = value;
|
51210
|
+
this._gridAlignedY = this._ownerCanvas.getGridPosition(value);
|
51211
|
+
this.element.style.top = `${this._gridAlignedY}px`;
|
51212
|
+
}
|
51213
|
+
get width() {
|
51214
|
+
return this._width;
|
51215
|
+
}
|
51216
|
+
set width(value) {
|
51217
|
+
if (this._width === value) {
|
51218
|
+
return;
|
51219
|
+
}
|
51220
|
+
const viableWidth = value > this._minFrameWidth ? value : this._minFrameWidth;
|
51221
|
+
this._width = viableWidth;
|
51222
|
+
const gridAlignedRight = this._ownerCanvas.getGridPositionCeil(viableWidth + this._gridAlignedX);
|
51223
|
+
this.element.style.width = `${gridAlignedRight - this._gridAlignedX}px`;
|
51224
|
+
}
|
51225
|
+
get height() {
|
51226
|
+
return this._height;
|
51227
|
+
}
|
51228
|
+
set height(value) {
|
51229
|
+
if (this._height === value) {
|
51230
|
+
return;
|
51231
|
+
}
|
51232
|
+
this._height = value;
|
51233
|
+
const gridAlignedBottom = this._ownerCanvas.getGridPositionCeil(value + this._gridAlignedY);
|
51234
|
+
this.element.style.height = `${gridAlignedBottom - this._gridAlignedY}px`;
|
51235
|
+
}
|
51236
|
+
get comments() {
|
51237
|
+
return this._comments;
|
51238
|
+
}
|
51239
|
+
set comments(comments) {
|
51240
|
+
if (comments && !this._comments && comments.length > 0) {
|
51241
|
+
this.element.style.gridTemplateRows = "40px min-content 1fr";
|
51242
|
+
this._borderElement.style.gridRow = "1 / span 3";
|
51243
|
+
this._portContainer.style.gridRow = "3";
|
51244
|
+
this._commentsElement.classList.add("has-comments");
|
51245
|
+
}
|
51246
|
+
else if (!comments) {
|
51247
|
+
this.element.style.gridTemplateRows = "40px calc(100% - 40px)";
|
51248
|
+
this._borderElement.style.gridRow = "1 / span 2";
|
51249
|
+
this._portContainer.style.gridRow = "2";
|
51250
|
+
this._commentsElement.classList.remove("has-comments");
|
51251
|
+
}
|
51252
|
+
if (comments === "" || (comments && comments.length >= 0)) {
|
51253
|
+
this._commentsElement.children[0].innerText = comments;
|
51254
|
+
}
|
51255
|
+
this.height = this._borderElement.offsetHeight;
|
51256
|
+
this._comments = comments;
|
51257
|
+
this._updateMinHeightWithComments();
|
51258
|
+
}
|
51259
|
+
constructor(candidate, canvas, doNotCaptureNodes = false) {
|
51260
|
+
this._collapsedWidth = 200;
|
51261
|
+
this._x = 0;
|
51262
|
+
this._y = 0;
|
51263
|
+
this._gridAlignedX = 0;
|
51264
|
+
this._gridAlignedY = 0;
|
51265
|
+
this._nodes = [];
|
51266
|
+
this._mouseStartPointX = null;
|
51267
|
+
this._mouseStartPointY = null;
|
51268
|
+
this._onNodeLinkDisposedObservers = [];
|
51269
|
+
this._isCollapsed = false;
|
51270
|
+
this._frameInPorts = [];
|
51271
|
+
this._frameOutPorts = [];
|
51272
|
+
this._controlledPorts = []; // Ports on Nodes that are shown on outside of frame
|
51273
|
+
this._exposedInPorts = [];
|
51274
|
+
this._exposedOutPorts = [];
|
51275
|
+
this._minFrameHeight = 40;
|
51276
|
+
this._minFrameWidth = 220;
|
51277
|
+
this.onExpandStateChanged = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
|
51278
|
+
this._closeSVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><g id="Layer_2" data-name="Layer 2"><path d="M16,15l5.85,5.84-1,1L15,15.93,9.15,21.78l-1-1L14,15,8.19,9.12l1-1L15,14l5.84-5.84,1,1Z"/></g></svg>`;
|
51279
|
+
this._expandSVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><g id="Layer_2" data-name="Layer 2"><path d="M22.31,7.69V22.31H7.69V7.69ZM21.19,8.81H8.81V21.19H21.19Zm-6.75,6.75H11.06V14.44h3.38V11.06h1.12v3.38h3.38v1.12H15.56v3.38H14.44Z"/></g></svg>`;
|
51280
|
+
this._collapseSVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><g id="Layer_2" data-name="Layer 2"><path d="M22.31,7.69V22.31H7.69V7.69ZM21.19,8.81H8.81V21.19H21.19Zm-2.25,6.75H11.06V14.44h7.88Z"/></g></svg>`;
|
51281
|
+
this._initResizing = (evt) => {
|
51282
|
+
evt.stopPropagation();
|
51283
|
+
this._mouseStartPointX = evt.clientX;
|
51284
|
+
this._mouseStartPointY = evt.clientY;
|
51285
|
+
this._frameIsResizing = true;
|
51286
|
+
};
|
51287
|
+
this._cleanUpResizing = (evt) => {
|
51288
|
+
evt.stopPropagation();
|
51289
|
+
this._frameIsResizing = false;
|
51290
|
+
this._resizingDirection = null;
|
51291
|
+
this._mouseStartPointX = null;
|
51292
|
+
this._mouseStartPointY = null;
|
51293
|
+
this._mouseXLimit = null;
|
51294
|
+
this.refresh();
|
51295
|
+
};
|
51296
|
+
this._updateMinHeightWithComments = () => {
|
51297
|
+
if (this.comments && this.comments.length > 0) {
|
51298
|
+
const minFrameHeightWithComments = this._commentsElement.offsetHeight + 40;
|
51299
|
+
this._minFrameHeight = minFrameHeightWithComments;
|
51300
|
+
}
|
51301
|
+
};
|
51302
|
+
this._onRightHandlePointerDown = (evt) => {
|
51303
|
+
if (this.isCollapsed) {
|
51304
|
+
return;
|
51305
|
+
}
|
51306
|
+
this._initResizing(evt);
|
51307
|
+
this._resizingDirection = ResizingDirection.Right;
|
51308
|
+
this._mouseXLimit = evt.clientX - (this.width - this._minFrameWidth);
|
51309
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onRightHandlePointerUp);
|
51310
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onRightHandlePointerMove);
|
51311
|
+
};
|
51312
|
+
this._onRightHandlePointerMove = (evt) => {
|
51313
|
+
const slack = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom;
|
51314
|
+
const xLimit = this._mouseStartPointX - slack;
|
51315
|
+
this._moveRightHandle(evt, xLimit);
|
51316
|
+
};
|
51317
|
+
this._moveRightHandle = (evt, xLimit) => {
|
51318
|
+
// tslint:disable-next-line: no-this-assignment
|
51319
|
+
if (this._mouseXLimit) {
|
51320
|
+
if (!this._isResizingRight() || this._mouseStartPointX === null || this._mouseStartPointY === null || evt.clientX < xLimit) {
|
51321
|
+
return;
|
51205
51322
|
}
|
51206
|
-
|
51207
|
-
|
51208
|
-
const
|
51209
|
-
this.
|
51323
|
+
if (this._isResizingRight()) {
|
51324
|
+
evt.stopPropagation();
|
51325
|
+
const distanceMouseMoved = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51326
|
+
this._expandRight(distanceMouseMoved, evt.clientX);
|
51210
51327
|
this._mouseStartPointX = evt.clientX;
|
51211
51328
|
}
|
51212
|
-
else if (evt.clientY > yLimit && evt.clientX > xLimit) {
|
51213
|
-
// able to move in Y but not X
|
51214
|
-
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51215
|
-
this._expandBottom(distanceMouseMovedY);
|
51216
|
-
this._mouseStartPointY = evt.clientY;
|
51217
|
-
}
|
51218
51329
|
}
|
51219
51330
|
};
|
51220
|
-
this.
|
51221
|
-
|
51222
|
-
if (this._resizingDirection === ResizingDirection.BottomLeft) {
|
51223
|
-
this.height = parseFloat(this.element.style.height.replace("px", ""));
|
51224
|
-
this.x = parseFloat(this.element.style.left.replace("px", ""));
|
51331
|
+
this._onRightHandlePointerUp = (evt) => {
|
51332
|
+
if (this._isResizingRight()) {
|
51225
51333
|
this.width = parseFloat(this.element.style.width.replace("px", ""));
|
51226
|
-
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this.
|
51227
|
-
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this.
|
51334
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onRightHandlePointerUp);
|
51335
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onRightHandlePointerMove);
|
51228
51336
|
this._cleanUpResizing(evt);
|
51229
51337
|
}
|
51230
51338
|
};
|
51231
|
-
|
51232
|
-
this._onTopLeftHandlePointerDown = (evt) => {
|
51339
|
+
this._onBottomHandlePointerDown = (evt) => {
|
51233
51340
|
if (this.isCollapsed) {
|
51234
51341
|
return;
|
51235
51342
|
}
|
51236
51343
|
this._initResizing(evt);
|
51237
|
-
this._resizingDirection = ResizingDirection.
|
51238
|
-
this.
|
51239
|
-
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this.
|
51240
|
-
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onTopLeftHandlePointerMove);
|
51344
|
+
this._resizingDirection = ResizingDirection.Bottom;
|
51345
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onBottomHandlePointerMove);
|
51346
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onBottomHandlePointerUp);
|
51241
51347
|
};
|
51242
|
-
this.
|
51243
|
-
const
|
51244
|
-
const yLimit = this._mouseStartPointY
|
51245
|
-
|
51246
|
-
const xLimit = this._mouseStartPointX + leftSlack;
|
51247
|
-
this._moveTopLeftHandle(evt, xLimit, yLimit);
|
51348
|
+
this._onBottomHandlePointerMove = (evt) => {
|
51349
|
+
const slack = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom;
|
51350
|
+
const yLimit = this._mouseStartPointY - slack;
|
51351
|
+
this._moveBottomHandle(evt, yLimit);
|
51248
51352
|
};
|
51249
|
-
this.
|
51250
|
-
if (
|
51353
|
+
this._moveBottomHandle = (evt, yLimit) => {
|
51354
|
+
if (this._resizingDirection !== ResizingDirection.Bottom || this._mouseStartPointX === null || this._mouseStartPointY === null || evt.clientY < yLimit) {
|
51251
51355
|
return;
|
51252
51356
|
}
|
51253
|
-
if (this.
|
51357
|
+
if (this._resizingDirection === ResizingDirection.Bottom) {
|
51254
51358
|
evt.stopPropagation();
|
51255
|
-
|
51256
|
-
|
51257
|
-
|
51258
|
-
this._expandLeft(distanceMouseMovedX);
|
51259
|
-
this._mouseStartPointX = evt.clientX;
|
51260
|
-
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51261
|
-
this._expandTop(distanceMouseMovedY);
|
51262
|
-
this._mouseStartPointY = evt.clientY;
|
51263
|
-
}
|
51264
|
-
else if (evt.clientY > yLimit && evt.clientX < xLimit) {
|
51265
|
-
// able to move in X but not Y
|
51266
|
-
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51267
|
-
this._expandLeft(distanceMouseMovedX);
|
51268
|
-
this._mouseStartPointX = evt.clientX;
|
51269
|
-
}
|
51270
|
-
else if (evt.clientY < yLimit && evt.clientX > xLimit) {
|
51271
|
-
// able to move in Y but not X
|
51272
|
-
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51273
|
-
this._expandTop(distanceMouseMovedY);
|
51274
|
-
this._mouseStartPointY = evt.clientY;
|
51275
|
-
}
|
51359
|
+
const distanceMouseMoved = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51360
|
+
this._expandBottom(distanceMouseMoved);
|
51361
|
+
this._mouseStartPointY = evt.clientY;
|
51276
51362
|
}
|
51277
51363
|
};
|
51278
|
-
this.
|
51279
|
-
|
51280
|
-
if (this._resizingDirection === ResizingDirection.TopLeft) {
|
51281
|
-
this.y = parseFloat(this.element.style.top.replace("px", ""));
|
51364
|
+
this._onBottomHandlePointerUp = (evt) => {
|
51365
|
+
if (this._resizingDirection === ResizingDirection.Bottom) {
|
51282
51366
|
this.height = parseFloat(this.element.style.height.replace("px", ""));
|
51283
|
-
this.
|
51284
|
-
this.
|
51285
|
-
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onTopLeftHandlePointerUp);
|
51286
|
-
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onTopLeftHandlePointerMove);
|
51367
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onBottomHandlePointerMove);
|
51368
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onBottomHandlePointerUp);
|
51287
51369
|
this._cleanUpResizing(evt);
|
51288
51370
|
}
|
51289
51371
|
};
|
51290
|
-
this.
|
51291
|
-
|
51292
|
-
|
51293
|
-
this.element = root.ownerDocument.createElement("div");
|
51294
|
-
this.element.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"]["frame-box"]);
|
51295
|
-
root.appendChild(this.element);
|
51296
|
-
this._headerElement = root.ownerDocument.createElement("div");
|
51297
|
-
this._headerElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header"]);
|
51298
|
-
this._headerElement.addEventListener("dblclick", () => {
|
51299
|
-
this.isCollapsed = !this.isCollapsed;
|
51300
|
-
});
|
51301
|
-
this.element.appendChild(this._headerElement);
|
51302
|
-
this._borderElement = root.ownerDocument.createElement("div");
|
51303
|
-
this._borderElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-border"]);
|
51304
|
-
this.element.appendChild(this._borderElement);
|
51305
|
-
this.element.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].expanded);
|
51306
|
-
// add resizing side handles
|
51307
|
-
const rightHandle = root.ownerDocument.createElement("div");
|
51308
|
-
rightHandle.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["right-handle"];
|
51309
|
-
this.element.appendChild(rightHandle);
|
51310
|
-
rightHandle.addEventListener("pointerdown", this._onRightHandlePointerDown);
|
51311
|
-
const leftHandle = root.ownerDocument.createElement("div");
|
51312
|
-
leftHandle.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["left-handle"];
|
51313
|
-
this.element.appendChild(leftHandle);
|
51314
|
-
leftHandle.addEventListener("pointerdown", this._onLeftHandlePointerDown);
|
51315
|
-
const bottomHandle = root.ownerDocument.createElement("div");
|
51316
|
-
bottomHandle.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["bottom-handle"];
|
51317
|
-
this.element.appendChild(bottomHandle);
|
51318
|
-
bottomHandle.addEventListener("pointerdown", this._onBottomHandlePointerDown);
|
51319
|
-
const topHandle = root.ownerDocument.createElement("div");
|
51320
|
-
topHandle.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["top-handle"];
|
51321
|
-
this.element.appendChild(topHandle);
|
51322
|
-
topHandle.addEventListener("pointerdown", this._onTopHandlePointerDown);
|
51323
|
-
const topRightCornerHandle = root.ownerDocument.createElement("div");
|
51324
|
-
topRightCornerHandle.className = (0,_components_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ "right-handle": true, "top-right-corner-handle": true }, _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]);
|
51325
|
-
this.element.appendChild(topRightCornerHandle);
|
51326
|
-
topRightCornerHandle.addEventListener("pointerdown", this._onTopRightHandlePointerDown);
|
51327
|
-
const bottomRightCornerHandle = root.ownerDocument.createElement("div");
|
51328
|
-
bottomRightCornerHandle.className = (0,_components_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ "right-handle": true, "bottom-right-corner-handle": true }, _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]);
|
51329
|
-
this.element.appendChild(bottomRightCornerHandle);
|
51330
|
-
bottomRightCornerHandle.addEventListener("pointerdown", this._onBottomRightHandlePointerDown);
|
51331
|
-
const topLeftCornerHandle = root.ownerDocument.createElement("div");
|
51332
|
-
topLeftCornerHandle.className = (0,_components_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ "left-handle": true, "top-left-corner-handle": true }, _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]);
|
51333
|
-
this.element.appendChild(topLeftCornerHandle);
|
51334
|
-
topLeftCornerHandle.addEventListener("pointerdown", this._onTopLeftHandlePointerDown);
|
51335
|
-
const bottomLeftCornerHandle = root.ownerDocument.createElement("div");
|
51336
|
-
bottomLeftCornerHandle.className = (0,_components_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ "left-handle": true, "bottom-left-corner-handle": true }, _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]);
|
51337
|
-
this.element.appendChild(bottomLeftCornerHandle);
|
51338
|
-
bottomLeftCornerHandle.addEventListener("pointerdown", this._onBottomLeftHandlePointerDown);
|
51339
|
-
// add header elements
|
51340
|
-
this._headerTextElement = root.ownerDocument.createElement("div");
|
51341
|
-
this._headerTextElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-title"]);
|
51342
|
-
this._headerElement.appendChild(this._headerTextElement);
|
51343
|
-
this._headerCollapseElement = root.ownerDocument.createElement("div");
|
51344
|
-
this._headerCollapseElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-collapse"]);
|
51345
|
-
this._headerCollapseElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-button"]);
|
51346
|
-
this._headerCollapseElement.title = "Collapse";
|
51347
|
-
this._headerCollapseElement.ondragstart = () => false;
|
51348
|
-
this._headerCollapseElement.addEventListener("pointerdown", (evt) => {
|
51349
|
-
this._headerCollapseElement.classList.add("down");
|
51350
|
-
evt.stopPropagation();
|
51351
|
-
});
|
51352
|
-
this._headerCollapseElement.addEventListener("pointerup", (evt) => {
|
51353
|
-
evt.stopPropagation();
|
51354
|
-
this._headerCollapseElement.classList.remove("down");
|
51355
|
-
this.isCollapsed = !this.isCollapsed;
|
51356
|
-
});
|
51357
|
-
this._headerCollapseElement.innerHTML = this._collapseSVG;
|
51358
|
-
this._headerElement.appendChild(this._headerCollapseElement);
|
51359
|
-
this._headerCloseElement = root.ownerDocument.createElement("div");
|
51360
|
-
this._headerCloseElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-close"]);
|
51361
|
-
this._headerCloseElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-button"]);
|
51362
|
-
this._headerCloseElement.title = "Close";
|
51363
|
-
this._headerCloseElement.ondragstart = () => false;
|
51364
|
-
this._headerCloseElement.addEventListener("pointerdown", (evt) => {
|
51365
|
-
evt.stopPropagation();
|
51366
|
-
});
|
51367
|
-
this._headerCloseElement.addEventListener("pointerup", (evt) => {
|
51368
|
-
evt.stopPropagation();
|
51369
|
-
this.dispose();
|
51370
|
-
});
|
51371
|
-
this._headerCloseElement.innerHTML = this._closeSVG;
|
51372
|
-
this._headerElement.appendChild(this._headerCloseElement);
|
51373
|
-
this._portContainer = root.ownerDocument.createElement("div");
|
51374
|
-
this._portContainer.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["port-container"]);
|
51375
|
-
this.element.appendChild(this._portContainer);
|
51376
|
-
this._outputPortContainer = root.ownerDocument.createElement("div");
|
51377
|
-
this._outputPortContainer.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].outputsContainer);
|
51378
|
-
this._portContainer.appendChild(this._outputPortContainer);
|
51379
|
-
this._inputPortContainer = root.ownerDocument.createElement("div");
|
51380
|
-
this._inputPortContainer.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].inputsContainer);
|
51381
|
-
this._portContainer.appendChild(this._inputPortContainer);
|
51382
|
-
this.name = "Frame";
|
51383
|
-
this.color = core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Color3.FromInts(72, 72, 72);
|
51384
|
-
if (candidate) {
|
51385
|
-
this.x = parseFloat(candidate.style.left.replace("px", ""));
|
51386
|
-
this.y = parseFloat(candidate.style.top.replace("px", ""));
|
51387
|
-
this.width = parseFloat(candidate.style.width.replace("px", ""));
|
51388
|
-
this.height = parseFloat(candidate.style.height.replace("px", ""));
|
51389
|
-
this.cleanAccumulation();
|
51390
|
-
}
|
51391
|
-
this._headerTextElement.addEventListener("pointerdown", (evt) => this._onDown(evt));
|
51392
|
-
this._headerTextElement.addEventListener("pointerup", (evt) => this._onUp(evt));
|
51393
|
-
this._headerTextElement.addEventListener("pointermove", (evt) => this._onMove(evt));
|
51394
|
-
this._onSelectionChangedObserver = canvas.stateManager.onSelectionChangedObservable.add(() => {
|
51395
|
-
if (this._ownerCanvas.selectedFrames.indexOf(this) !== -1) {
|
51396
|
-
this._borderElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
51372
|
+
this._onLeftHandlePointerDown = (evt) => {
|
51373
|
+
if (this.isCollapsed) {
|
51374
|
+
return;
|
51397
51375
|
}
|
51398
|
-
|
51399
|
-
|
51376
|
+
this._initResizing(evt);
|
51377
|
+
this._resizingDirection = ResizingDirection.Left;
|
51378
|
+
this._mouseXLimit = evt.clientX + this.width - this._minFrameWidth;
|
51379
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onLeftHandlePointerUp);
|
51380
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onLeftHandlePointerMove);
|
51381
|
+
};
|
51382
|
+
this._onLeftHandlePointerMove = (evt) => {
|
51383
|
+
const slack = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom;
|
51384
|
+
const xLimit = this._mouseStartPointX + slack;
|
51385
|
+
this._moveLeftHandle(evt, xLimit);
|
51386
|
+
};
|
51387
|
+
this._moveLeftHandle = (evt, xLimit) => {
|
51388
|
+
if (this._mouseXLimit) {
|
51389
|
+
if (this._resizingDirection !== ResizingDirection.Left || this._mouseStartPointX === null || this._mouseStartPointY === null || evt.clientX > xLimit) {
|
51390
|
+
return;
|
51391
|
+
}
|
51392
|
+
if (this._resizingDirection === ResizingDirection.Left) {
|
51393
|
+
evt.stopPropagation();
|
51394
|
+
const distanceMouseMoved = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51395
|
+
this._expandLeft(distanceMouseMoved);
|
51396
|
+
this._mouseStartPointX = evt.clientX;
|
51397
|
+
}
|
51400
51398
|
}
|
51401
|
-
}
|
51402
|
-
|
51403
|
-
|
51404
|
-
|
51405
|
-
|
51406
|
-
|
51399
|
+
};
|
51400
|
+
this._onLeftHandlePointerUp = (evt) => {
|
51401
|
+
if (this._resizingDirection === ResizingDirection.Left) {
|
51402
|
+
this.x = parseFloat(this.element.style.left.replace("px", ""));
|
51403
|
+
this.width = parseFloat(this.element.style.width.replace("px", ""));
|
51404
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onLeftHandlePointerUp);
|
51405
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onLeftHandlePointerMove);
|
51406
|
+
this._cleanUpResizing(evt);
|
51407
51407
|
}
|
51408
|
-
}
|
51409
|
-
this.
|
51410
|
-
|
51411
|
-
const index = this._nodes.indexOf(node);
|
51412
|
-
if (index === -1) {
|
51408
|
+
};
|
51409
|
+
this._onTopHandlePointerDown = (evt) => {
|
51410
|
+
if (this.isCollapsed) {
|
51413
51411
|
return;
|
51414
51412
|
}
|
51415
|
-
|
51416
|
-
|
51417
|
-
|
51418
|
-
|
51419
|
-
}
|
51420
|
-
this.
|
51421
|
-
|
51413
|
+
this._initResizing(evt);
|
51414
|
+
this._resizingDirection = ResizingDirection.Top;
|
51415
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onTopHandlePointerUp);
|
51416
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onTopHandlePointerMove);
|
51417
|
+
};
|
51418
|
+
this._onTopHandlePointerMove = (evt) => {
|
51419
|
+
const slack = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom;
|
51420
|
+
const yLimit = this._mouseStartPointY + slack;
|
51421
|
+
this._moveTopHandle(evt, yLimit);
|
51422
|
+
};
|
51423
|
+
this._moveTopHandle = (evt, yLimit) => {
|
51424
|
+
if (!this._isResizingTop() || this._mouseStartPointX === null || this._mouseStartPointY === null || evt.clientY > yLimit) {
|
51422
51425
|
return;
|
51423
51426
|
}
|
51424
|
-
this.
|
51425
|
-
|
51426
|
-
|
51427
|
-
|
51428
|
-
|
51429
|
-
this._commentsElement.style.fontSize = "16px";
|
51430
|
-
const commentSpan = document.createElement("span");
|
51431
|
-
commentSpan.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-comment-span"];
|
51432
|
-
this._commentsElement.appendChild(commentSpan);
|
51433
|
-
this.element.appendChild(this._commentsElement);
|
51434
|
-
// Get nodes
|
51435
|
-
if (!doNotCaptureNodes) {
|
51436
|
-
this.refresh();
|
51437
|
-
}
|
51438
|
-
}
|
51439
|
-
get id() {
|
51440
|
-
return this._id;
|
51441
|
-
}
|
51442
|
-
get isCollapsed() {
|
51443
|
-
return this._isCollapsed;
|
51444
|
-
}
|
51445
|
-
_createInputPort(port, node) {
|
51446
|
-
const localPort = _frameNodePort__WEBPACK_IMPORTED_MODULE_1__.FrameNodePort.CreateFrameNodePortElement(port.portData, node, this._inputPortContainer, null, this._ownerCanvas.stateManager, true, GraphFrame._FramePortCounter++, this.id);
|
51447
|
-
this._frameInPorts.push(localPort);
|
51448
|
-
port.delegatedPort = localPort;
|
51449
|
-
this._controlledPorts.push(port);
|
51450
|
-
port.exposedPortPosition = this._exposedInPorts.findIndex((nodePort) => nodePort === port);
|
51451
|
-
if (port.exposedPortPosition < 0) {
|
51452
|
-
this._exposedInPorts.push(port);
|
51453
|
-
port.exposedPortPosition = this._exposedInPorts.length - 1;
|
51454
|
-
}
|
51455
|
-
}
|
51456
|
-
// Mark ports with FramePortPosition for re-arrangement support
|
51457
|
-
_markFramePortPositions() {
|
51458
|
-
// mark FrameInPorts
|
51459
|
-
if (this._frameInPorts.length == 2) {
|
51460
|
-
this._frameInPorts[0].framePortPosition = FramePortPosition.Top;
|
51461
|
-
this._frameInPorts[1].framePortPosition = FramePortPosition.Bottom;
|
51462
|
-
}
|
51463
|
-
else {
|
51464
|
-
for (let i = 0; i < this._frameInPorts.length; i++) {
|
51465
|
-
const port = this._frameInPorts[i];
|
51466
|
-
if (i === 0) {
|
51467
|
-
port.framePortPosition = FramePortPosition.Top;
|
51468
|
-
}
|
51469
|
-
else if (i === this._frameInPorts.length - 1) {
|
51470
|
-
port.framePortPosition = FramePortPosition.Bottom;
|
51471
|
-
}
|
51472
|
-
else {
|
51473
|
-
port.framePortPosition = FramePortPosition.Middle;
|
51474
|
-
}
|
51475
|
-
}
|
51476
|
-
}
|
51477
|
-
// mark FrameOutPorts
|
51478
|
-
if (this._frameOutPorts.length == 2) {
|
51479
|
-
this._frameOutPorts[0].framePortPosition = FramePortPosition.Top;
|
51480
|
-
this._frameOutPorts[1].framePortPosition = FramePortPosition.Bottom;
|
51481
|
-
}
|
51482
|
-
else {
|
51483
|
-
for (let i = 0; i < this._frameOutPorts.length; i++) {
|
51484
|
-
const port = this._frameOutPorts[i];
|
51485
|
-
if (i === 0) {
|
51486
|
-
port.framePortPosition = FramePortPosition.Top;
|
51487
|
-
}
|
51488
|
-
else if (i === this._frameInPorts.length - 1) {
|
51489
|
-
port.framePortPosition = FramePortPosition.Bottom;
|
51490
|
-
}
|
51491
|
-
else {
|
51492
|
-
port.framePortPosition = FramePortPosition.Middle;
|
51493
|
-
}
|
51427
|
+
if (this._isResizingTop()) {
|
51428
|
+
evt.stopPropagation();
|
51429
|
+
const distanceMouseMoved = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51430
|
+
this._expandTop(distanceMouseMoved);
|
51431
|
+
this._mouseStartPointY = evt.clientY;
|
51494
51432
|
}
|
51495
|
-
}
|
51496
|
-
|
51497
|
-
|
51498
|
-
|
51499
|
-
|
51500
|
-
|
51501
|
-
|
51502
|
-
|
51503
|
-
const port = this._exposedOutPorts[i];
|
51504
|
-
if (port) {
|
51505
|
-
if (port.node === null || port.node.enclosingFrameId != this.id) {
|
51506
|
-
if (this._removePortFromExposedWithNode(port, this._exposedOutPorts))
|
51507
|
-
continue;
|
51508
|
-
}
|
51509
|
-
else {
|
51510
|
-
if (!this._createOutputPorts(port, port.node) && this._removePortFromExposedWithNode(port, this._exposedOutPorts)) {
|
51511
|
-
continue;
|
51512
|
-
}
|
51513
|
-
}
|
51433
|
+
};
|
51434
|
+
this._onTopHandlePointerUp = (evt) => {
|
51435
|
+
if (this._isResizingTop()) {
|
51436
|
+
this.y = parseFloat(this.element.style.top.replace("px", ""));
|
51437
|
+
this.height = parseFloat(this.element.style.height.replace("px", ""));
|
51438
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onTopHandlePointerUp);
|
51439
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onTopHandlePointerMove);
|
51440
|
+
this._cleanUpResizing(evt);
|
51514
51441
|
}
|
51515
|
-
|
51516
|
-
|
51517
|
-
|
51518
|
-
|
51519
|
-
const port = this._exposedInPorts[i];
|
51520
|
-
if (!port || port.node === null || port.node.enclosingFrameId != this.id) {
|
51521
|
-
if (this._removePortFromExposedWithNode(port, this._exposedInPorts)) {
|
51522
|
-
continue;
|
51523
|
-
}
|
51442
|
+
};
|
51443
|
+
this._onTopRightHandlePointerDown = (evt) => {
|
51444
|
+
if (this.isCollapsed) {
|
51445
|
+
return;
|
51524
51446
|
}
|
51525
|
-
|
51526
|
-
|
51527
|
-
|
51528
|
-
|
51447
|
+
this._initResizing(evt);
|
51448
|
+
this._resizingDirection = ResizingDirection.TopRight;
|
51449
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onTopRightHandlePointerUp);
|
51450
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onTopRightHandlePointerMove);
|
51451
|
+
};
|
51452
|
+
this._onTopRightHandlePointerMove = (evt) => {
|
51453
|
+
const topSlack = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom;
|
51454
|
+
const yLimit = this._mouseStartPointY + topSlack;
|
51455
|
+
const rightSlack = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom;
|
51456
|
+
const xLimit = this._mouseStartPointX - rightSlack;
|
51457
|
+
this._moveTopRightHandle(evt, xLimit, yLimit);
|
51458
|
+
};
|
51459
|
+
this._moveTopRightHandle = (evt, xLimit, yLimit) => {
|
51460
|
+
if (!(this._isResizingTop() && this._isResizingRight()) || this._mouseStartPointX === null || this._mouseStartPointY === null) {
|
51461
|
+
return;
|
51529
51462
|
}
|
51530
|
-
|
51531
|
-
|
51532
|
-
|
51533
|
-
|
51534
|
-
|
51535
|
-
|
51536
|
-
|
51537
|
-
|
51538
|
-
|
51539
|
-
|
51540
|
-
port.exposedPortPosition = this._exposedOutPorts.length - 1;
|
51541
|
-
}
|
51463
|
+
if (this._isResizingRight() && this._isResizingTop()) {
|
51464
|
+
evt.stopPropagation();
|
51465
|
+
if (evt.clientY < yLimit && evt.clientX > xLimit) {
|
51466
|
+
// able to move in X and Y
|
51467
|
+
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51468
|
+
this._expandRight(distanceMouseMovedX, evt.clientX);
|
51469
|
+
this._mouseStartPointX = evt.clientX;
|
51470
|
+
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51471
|
+
this._expandTop(distanceMouseMovedY);
|
51472
|
+
this._mouseStartPointY = evt.clientY;
|
51542
51473
|
}
|
51543
|
-
|
51544
|
-
|
51545
|
-
|
51546
|
-
|
51547
|
-
|
51548
|
-
|
51474
|
+
else if (evt.clientY > yLimit && evt.clientX > xLimit) {
|
51475
|
+
// able to move in X but not Y
|
51476
|
+
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51477
|
+
this._expandRight(distanceMouseMovedX, evt.clientX);
|
51478
|
+
this._mouseStartPointX = evt.clientX;
|
51479
|
+
}
|
51480
|
+
else if (evt.clientY < yLimit && evt.clientX < xLimit) {
|
51481
|
+
// able to move in Y but not X
|
51482
|
+
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51483
|
+
this._expandTop(distanceMouseMovedY);
|
51484
|
+
this._mouseStartPointY = evt.clientY;
|
51549
51485
|
}
|
51550
51486
|
}
|
51551
|
-
}
|
51552
|
-
|
51553
|
-
|
51554
|
-
|
51555
|
-
|
51556
|
-
|
51557
|
-
|
51558
|
-
|
51487
|
+
};
|
51488
|
+
this._onTopRightHandlePointerUp = (evt) => {
|
51489
|
+
evt.stopPropagation();
|
51490
|
+
if (this._resizingDirection === ResizingDirection.TopRight) {
|
51491
|
+
this.y = parseFloat(this.element.style.top.replace("px", ""));
|
51492
|
+
this.height = parseFloat(this.element.style.height.replace("px", ""));
|
51493
|
+
this.width = parseFloat(this.element.style.width.replace("px", ""));
|
51494
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onTopRightHandlePointerUp);
|
51495
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onTopRightHandlePointerMove);
|
51496
|
+
this._cleanUpResizing(evt);
|
51559
51497
|
}
|
51560
|
-
|
51561
|
-
|
51562
|
-
|
51563
|
-
|
51564
|
-
_removePortFromExposedWithLink(nodeLink, exposedPorts) {
|
51565
|
-
const aPort = exposedPorts.findIndex((nodePort) => nodePort === nodeLink.portA);
|
51566
|
-
const bPort = exposedPorts.findIndex((nodePort) => nodePort === nodeLink.portB);
|
51567
|
-
if (aPort >= 0) {
|
51568
|
-
if (!nodeLink.portA.exposedOnFrame) {
|
51569
|
-
exposedPorts.splice(aPort, 1);
|
51570
|
-
nodeLink.portA.exposedPortPosition = -1;
|
51571
|
-
return true;
|
51498
|
+
};
|
51499
|
+
this._onBottomRightHandlePointerDown = (evt) => {
|
51500
|
+
if (this.isCollapsed) {
|
51501
|
+
return;
|
51572
51502
|
}
|
51573
|
-
|
51574
|
-
|
51575
|
-
|
51576
|
-
|
51577
|
-
|
51578
|
-
|
51503
|
+
this._initResizing(evt);
|
51504
|
+
this._resizingDirection = ResizingDirection.BottomRight;
|
51505
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onBottomRightHandlePointerUp);
|
51506
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onBottomRightHandlePointerMove);
|
51507
|
+
};
|
51508
|
+
this._onBottomRightHandlePointerMove = (evt) => {
|
51509
|
+
const bottomSlack = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom;
|
51510
|
+
const yLimit = this._mouseStartPointY - bottomSlack;
|
51511
|
+
const rightSlack = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom;
|
51512
|
+
const xLimit = this._mouseStartPointX - rightSlack;
|
51513
|
+
this._moveBottomRightHandle(evt, xLimit, yLimit);
|
51514
|
+
};
|
51515
|
+
this._moveBottomRightHandle = (evt, xLimit, yLimit) => {
|
51516
|
+
if (!(this._isResizingBottom() && this._isResizingRight()) || this._mouseStartPointX === null || this._mouseStartPointY === null) {
|
51517
|
+
return;
|
51579
51518
|
}
|
51580
|
-
|
51581
|
-
|
51582
|
-
|
51583
|
-
|
51584
|
-
|
51585
|
-
|
51586
|
-
|
51587
|
-
|
51588
|
-
this.
|
51589
|
-
|
51590
|
-
portAdded = true;
|
51591
|
-
const onLinkDisposedObserver = link.onDisposedObservable.add((nodeLink) => {
|
51592
|
-
if (this._removePortFromExposedWithLink(nodeLink, this._exposedInPorts)) {
|
51593
|
-
this.redrawFramePorts();
|
51594
|
-
}
|
51595
|
-
});
|
51596
|
-
this._onNodeLinkDisposedObservers.push(onLinkDisposedObserver);
|
51519
|
+
if (this._isResizingRight() && this._isResizingBottom()) {
|
51520
|
+
evt.stopPropagation();
|
51521
|
+
if (evt.clientY > yLimit && evt.clientX > xLimit) {
|
51522
|
+
// able to move in X and Y
|
51523
|
+
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51524
|
+
this._expandRight(distanceMouseMovedX, evt.clientX);
|
51525
|
+
this._mouseStartPointX = evt.clientX;
|
51526
|
+
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51527
|
+
this._expandBottom(distanceMouseMovedY);
|
51528
|
+
this._mouseStartPointY = evt.clientY;
|
51597
51529
|
}
|
51598
|
-
|
51599
|
-
|
51600
|
-
|
51601
|
-
|
51602
|
-
|
51603
|
-
this._createInputPort(port, node);
|
51604
|
-
return true;
|
51605
|
-
}
|
51606
|
-
return false;
|
51607
|
-
}
|
51608
|
-
_createOutputPorts(port, node) {
|
51609
|
-
if (port.portData.hasEndpoints) {
|
51610
|
-
let portAdded = false;
|
51611
|
-
for (const link of node.links) {
|
51612
|
-
if (link.portA === port && this.nodes.indexOf(link.nodeB) === -1) {
|
51613
|
-
let localPort;
|
51614
|
-
if (!portAdded) {
|
51615
|
-
portAdded = true;
|
51616
|
-
localPort = _frameNodePort__WEBPACK_IMPORTED_MODULE_1__.FrameNodePort.CreateFrameNodePortElement(port.portData, link.nodeA, this._outputPortContainer, null, this._ownerCanvas.stateManager, false, GraphFrame._FramePortCounter++, this.id);
|
51617
|
-
this._frameOutPorts.push(localPort);
|
51618
|
-
link.isVisible = true;
|
51619
|
-
const onLinkDisposedObserver = link.onDisposedObservable.add((nodeLink) => {
|
51620
|
-
if (this._removePortFromExposedWithLink(nodeLink, this._exposedOutPorts)) {
|
51621
|
-
this.redrawFramePorts();
|
51622
|
-
}
|
51623
|
-
});
|
51624
|
-
this._onNodeLinkDisposedObservers.push(onLinkDisposedObserver);
|
51625
|
-
}
|
51626
|
-
else if (this.nodes.indexOf(link.nodeB) === -1) {
|
51627
|
-
link.isVisible = true;
|
51628
|
-
localPort = this.ports.filter((p) => p.portData === port.portData)[0];
|
51629
|
-
}
|
51630
|
-
else {
|
51631
|
-
localPort = this.ports.filter((p) => p.portData === port.portData)[0];
|
51632
|
-
}
|
51633
|
-
port.delegatedPort = localPort;
|
51634
|
-
this._controlledPorts.push(port);
|
51530
|
+
else if (evt.clientY < yLimit && evt.clientX > xLimit) {
|
51531
|
+
// able to move in X but not Y
|
51532
|
+
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51533
|
+
this._expandRight(distanceMouseMovedX, evt.clientX);
|
51534
|
+
this._mouseStartPointX = evt.clientX;
|
51635
51535
|
}
|
51636
|
-
else if (
|
51637
|
-
|
51638
|
-
this.
|
51639
|
-
|
51640
|
-
this.
|
51641
|
-
portAdded = true;
|
51536
|
+
else if (evt.clientY > yLimit && evt.clientX < xLimit) {
|
51537
|
+
// able to move in Y but not X
|
51538
|
+
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51539
|
+
this._expandBottom(distanceMouseMovedY);
|
51540
|
+
this._mouseStartPointY = evt.clientY;
|
51642
51541
|
}
|
51643
51542
|
}
|
51644
|
-
|
51645
|
-
|
51646
|
-
|
51647
|
-
|
51648
|
-
|
51649
|
-
|
51650
|
-
|
51651
|
-
|
51652
|
-
return true;
|
51653
|
-
}
|
51654
|
-
return false;
|
51655
|
-
}
|
51656
|
-
redrawFramePorts() {
|
51657
|
-
if (!this.isCollapsed) {
|
51658
|
-
return;
|
51659
|
-
}
|
51660
|
-
this._outputPortContainer.innerHTML = "";
|
51661
|
-
this._inputPortContainer.innerHTML = "";
|
51662
|
-
this.ports.forEach((framePort) => {
|
51663
|
-
framePort.dispose();
|
51664
|
-
});
|
51665
|
-
this._controlledPorts.forEach((port) => {
|
51666
|
-
port.delegatedPort = null;
|
51667
|
-
port.refresh();
|
51668
|
-
});
|
51669
|
-
this._frameInPorts = [];
|
51670
|
-
this._frameOutPorts = [];
|
51671
|
-
this._controlledPorts = [];
|
51672
|
-
this._createFramePorts();
|
51673
|
-
this._markFramePortPositions();
|
51674
|
-
this.ports.forEach((framePort) => framePort.node._refreshLinks());
|
51675
|
-
}
|
51676
|
-
set isCollapsed(value) {
|
51677
|
-
if (this._isCollapsed === value) {
|
51678
|
-
return;
|
51679
|
-
}
|
51680
|
-
this._isCollapsed = value;
|
51681
|
-
this._ownerCanvas._frameIsMoving = true;
|
51682
|
-
// Need to delegate the outside ports to the frame
|
51683
|
-
if (value) {
|
51684
|
-
this.element.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].collapsed);
|
51685
|
-
this.element.classList.remove(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].expanded);
|
51686
|
-
this._headerElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].collapsedHeader);
|
51687
|
-
this._moveFrame((this.width - this._collapsedWidth) / 2, 0);
|
51688
|
-
this._createFramePorts();
|
51689
|
-
this._markFramePortPositions();
|
51690
|
-
}
|
51691
|
-
else {
|
51692
|
-
this.element.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].expanded);
|
51693
|
-
this.element.classList.remove(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].collapsed);
|
51694
|
-
this._headerElement.classList.remove(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].collapsedHeader);
|
51695
|
-
this._outputPortContainer.innerHTML = "";
|
51696
|
-
this._inputPortContainer.innerHTML = "";
|
51697
|
-
this._frameInPorts.forEach((p) => {
|
51698
|
-
p.dispose();
|
51699
|
-
});
|
51700
|
-
this._frameOutPorts.forEach((p) => {
|
51701
|
-
p.dispose();
|
51702
|
-
});
|
51703
|
-
this._controlledPorts.forEach((port) => {
|
51704
|
-
port.delegatedPort = null;
|
51705
|
-
port.refresh();
|
51706
|
-
});
|
51707
|
-
this._frameInPorts = [];
|
51708
|
-
this._frameOutPorts = [];
|
51709
|
-
this._controlledPorts = [];
|
51710
|
-
this._onNodeLinkDisposedObservers = [];
|
51711
|
-
for (const node of this._nodes) {
|
51712
|
-
node.isVisible = true;
|
51543
|
+
};
|
51544
|
+
this._onBottomRightHandlePointerUp = (evt) => {
|
51545
|
+
if (this._resizingDirection === ResizingDirection.BottomRight) {
|
51546
|
+
this.height = parseFloat(this.element.style.height.replace("px", ""));
|
51547
|
+
this.width = parseFloat(this.element.style.width.replace("px", ""));
|
51548
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onBottomRightHandlePointerUp);
|
51549
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onBottomRightHandlePointerMove);
|
51550
|
+
this._cleanUpResizing(evt);
|
51713
51551
|
}
|
51714
|
-
|
51715
|
-
|
51716
|
-
this.
|
51717
|
-
|
51718
|
-
|
51719
|
-
|
51720
|
-
this.
|
51721
|
-
this.
|
51722
|
-
|
51723
|
-
|
51724
|
-
this.
|
51725
|
-
|
51726
|
-
|
51727
|
-
|
51728
|
-
|
51729
|
-
|
51730
|
-
|
51731
|
-
|
51732
|
-
|
51733
|
-
|
51734
|
-
|
51735
|
-
|
51736
|
-
|
51737
|
-
|
51738
|
-
|
51739
|
-
|
51740
|
-
|
51741
|
-
|
51742
|
-
|
51743
|
-
|
51744
|
-
|
51745
|
-
|
51746
|
-
|
51747
|
-
|
51748
|
-
|
51749
|
-
|
51750
|
-
|
51751
|
-
|
51752
|
-
|
51753
|
-
|
51754
|
-
|
51755
|
-
|
51756
|
-
|
51757
|
-
|
51758
|
-
|
51759
|
-
|
51760
|
-
|
51761
|
-
|
51762
|
-
|
51763
|
-
|
51764
|
-
|
51765
|
-
|
51766
|
-
|
51767
|
-
|
51768
|
-
|
51769
|
-
|
51770
|
-
|
51771
|
-
|
51772
|
-
|
51773
|
-
|
51774
|
-
|
51775
|
-
|
51776
|
-
|
51777
|
-
|
51778
|
-
|
51779
|
-
|
51780
|
-
|
51781
|
-
|
51782
|
-
|
51783
|
-
|
51784
|
-
|
51785
|
-
|
51786
|
-
|
51787
|
-
|
51788
|
-
|
51789
|
-
|
51790
|
-
|
51791
|
-
|
51792
|
-
|
51793
|
-
|
51794
|
-
|
51795
|
-
|
51796
|
-
|
51797
|
-
|
51798
|
-
|
51799
|
-
|
51800
|
-
|
51801
|
-
|
51802
|
-
|
51803
|
-
|
51804
|
-
|
51805
|
-
|
51806
|
-
|
51807
|
-
|
51808
|
-
|
51809
|
-
|
51810
|
-
|
51552
|
+
};
|
51553
|
+
//@ts-ignore
|
51554
|
+
this._onBottomLeftHandlePointerDown = (evt) => {
|
51555
|
+
if (this.isCollapsed) {
|
51556
|
+
return;
|
51557
|
+
}
|
51558
|
+
this._initResizing(evt);
|
51559
|
+
this._resizingDirection = ResizingDirection.BottomLeft;
|
51560
|
+
this._mouseXLimit = evt.clientX + this.width - this._minFrameWidth;
|
51561
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onBottomLeftHandlePointerUp);
|
51562
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onBottomLeftHandlePointerMove);
|
51563
|
+
};
|
51564
|
+
this._onBottomLeftHandlePointerMove = (evt) => {
|
51565
|
+
const bottomSlack = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom;
|
51566
|
+
const yLimit = this._mouseStartPointY - bottomSlack;
|
51567
|
+
const leftSlack = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom;
|
51568
|
+
const xLimit = this._mouseStartPointX + leftSlack;
|
51569
|
+
this._moveBottomLeftHandle(evt, xLimit, yLimit);
|
51570
|
+
};
|
51571
|
+
this._moveBottomLeftHandle = (evt, xLimit, yLimit) => {
|
51572
|
+
if (!(this._isResizingBottom() && this._isResizingLeft()) || this._mouseStartPointX === null || this._mouseStartPointY === null) {
|
51573
|
+
return;
|
51574
|
+
}
|
51575
|
+
if (this._isResizingLeft() && this._isResizingBottom()) {
|
51576
|
+
evt.stopPropagation();
|
51577
|
+
if (evt.clientY > yLimit && evt.clientX < xLimit) {
|
51578
|
+
// able to move in X and Y
|
51579
|
+
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51580
|
+
this._expandLeft(distanceMouseMovedX);
|
51581
|
+
this._mouseStartPointX = evt.clientX;
|
51582
|
+
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51583
|
+
this._expandBottom(distanceMouseMovedY);
|
51584
|
+
this._mouseStartPointY = evt.clientY;
|
51585
|
+
}
|
51586
|
+
else if (evt.clientY < yLimit && evt.clientX < xLimit) {
|
51587
|
+
// able to move in X but not Y
|
51588
|
+
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51589
|
+
this._expandLeft(distanceMouseMovedX);
|
51590
|
+
this._mouseStartPointX = evt.clientX;
|
51591
|
+
}
|
51592
|
+
else if (evt.clientY > yLimit && evt.clientX > xLimit) {
|
51593
|
+
// able to move in Y but not X
|
51594
|
+
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51595
|
+
this._expandBottom(distanceMouseMovedY);
|
51596
|
+
this._mouseStartPointY = evt.clientY;
|
51597
|
+
}
|
51598
|
+
}
|
51599
|
+
};
|
51600
|
+
this._onBottomLeftHandlePointerUp = (evt) => {
|
51601
|
+
evt.stopPropagation();
|
51602
|
+
if (this._resizingDirection === ResizingDirection.BottomLeft) {
|
51603
|
+
this.height = parseFloat(this.element.style.height.replace("px", ""));
|
51604
|
+
this.x = parseFloat(this.element.style.left.replace("px", ""));
|
51605
|
+
this.width = parseFloat(this.element.style.width.replace("px", ""));
|
51606
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onBottomLeftHandlePointerUp);
|
51607
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onBottomLeftHandlePointerMove);
|
51608
|
+
this._cleanUpResizing(evt);
|
51609
|
+
}
|
51610
|
+
};
|
51611
|
+
//@ts-ignore
|
51612
|
+
this._onTopLeftHandlePointerDown = (evt) => {
|
51613
|
+
if (this.isCollapsed) {
|
51614
|
+
return;
|
51615
|
+
}
|
51616
|
+
this._initResizing(evt);
|
51617
|
+
this._resizingDirection = ResizingDirection.TopLeft;
|
51618
|
+
this._mouseXLimit = evt.clientX + this.width - this._minFrameWidth;
|
51619
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointerup", this._onTopLeftHandlePointerUp);
|
51620
|
+
this._ownerCanvas.hostCanvas.addEventListener("pointermove", this._onTopLeftHandlePointerMove);
|
51621
|
+
};
|
51622
|
+
this._onTopLeftHandlePointerMove = (evt) => {
|
51623
|
+
const topSlack = (this.element.offsetHeight - this._minFrameHeight) * this._ownerCanvas.zoom;
|
51624
|
+
const yLimit = this._mouseStartPointY + topSlack;
|
51625
|
+
const leftSlack = (this.element.offsetWidth - this._minFrameWidth) * this._ownerCanvas.zoom;
|
51626
|
+
const xLimit = this._mouseStartPointX + leftSlack;
|
51627
|
+
this._moveTopLeftHandle(evt, xLimit, yLimit);
|
51628
|
+
};
|
51629
|
+
this._moveTopLeftHandle = (evt, xLimit, yLimit) => {
|
51630
|
+
if (!(this._isResizingTop() && this._isResizingLeft()) || this._mouseStartPointX === null || this._mouseStartPointY === null) {
|
51631
|
+
return;
|
51632
|
+
}
|
51633
|
+
if (this._isResizingLeft() && this._isResizingTop()) {
|
51634
|
+
evt.stopPropagation();
|
51635
|
+
if (evt.clientY < yLimit && evt.clientX < xLimit) {
|
51636
|
+
// able to move in X and Y
|
51637
|
+
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51638
|
+
this._expandLeft(distanceMouseMovedX);
|
51639
|
+
this._mouseStartPointX = evt.clientX;
|
51640
|
+
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51641
|
+
this._expandTop(distanceMouseMovedY);
|
51642
|
+
this._mouseStartPointY = evt.clientY;
|
51643
|
+
}
|
51644
|
+
else if (evt.clientY > yLimit && evt.clientX < xLimit) {
|
51645
|
+
// able to move in X but not Y
|
51646
|
+
const distanceMouseMovedX = (evt.clientX - this._mouseStartPointX) / this._ownerCanvas.zoom;
|
51647
|
+
this._expandLeft(distanceMouseMovedX);
|
51648
|
+
this._mouseStartPointX = evt.clientX;
|
51649
|
+
}
|
51650
|
+
else if (evt.clientY < yLimit && evt.clientX > xLimit) {
|
51651
|
+
// able to move in Y but not X
|
51652
|
+
const distanceMouseMovedY = (evt.clientY - this._mouseStartPointY) / this._ownerCanvas.zoom;
|
51653
|
+
this._expandTop(distanceMouseMovedY);
|
51654
|
+
this._mouseStartPointY = evt.clientY;
|
51655
|
+
}
|
51656
|
+
}
|
51657
|
+
};
|
51658
|
+
this._onTopLeftHandlePointerUp = (evt) => {
|
51659
|
+
evt.stopPropagation();
|
51660
|
+
if (this._resizingDirection === ResizingDirection.TopLeft) {
|
51661
|
+
this.y = parseFloat(this.element.style.top.replace("px", ""));
|
51662
|
+
this.height = parseFloat(this.element.style.height.replace("px", ""));
|
51663
|
+
this.x = parseFloat(this.element.style.left.replace("px", ""));
|
51664
|
+
this.width = parseFloat(this.element.style.width.replace("px", ""));
|
51665
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointerup", this._onTopLeftHandlePointerUp);
|
51666
|
+
this._ownerCanvas.hostCanvas.removeEventListener("pointermove", this._onTopLeftHandlePointerMove);
|
51667
|
+
this._cleanUpResizing(evt);
|
51668
|
+
}
|
51669
|
+
};
|
51670
|
+
this._id = GraphFrame._FrameCounter++;
|
51671
|
+
this._ownerCanvas = canvas;
|
51672
|
+
const root = canvas.frameContainer;
|
51673
|
+
this.element = root.ownerDocument.createElement("div");
|
51674
|
+
this.element.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"]["frame-box"]);
|
51675
|
+
root.appendChild(this.element);
|
51676
|
+
this._headerElement = root.ownerDocument.createElement("div");
|
51677
|
+
this._headerElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header"]);
|
51678
|
+
this._headerElement.addEventListener("dblclick", () => {
|
51679
|
+
this.isCollapsed = !this.isCollapsed;
|
51680
|
+
});
|
51681
|
+
this.element.appendChild(this._headerElement);
|
51682
|
+
this._borderElement = root.ownerDocument.createElement("div");
|
51683
|
+
this._borderElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-border"]);
|
51684
|
+
this.element.appendChild(this._borderElement);
|
51685
|
+
this.element.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].expanded);
|
51686
|
+
// add resizing side handles
|
51687
|
+
const rightHandle = root.ownerDocument.createElement("div");
|
51688
|
+
rightHandle.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["right-handle"];
|
51689
|
+
this.element.appendChild(rightHandle);
|
51690
|
+
rightHandle.addEventListener("pointerdown", this._onRightHandlePointerDown);
|
51691
|
+
const leftHandle = root.ownerDocument.createElement("div");
|
51692
|
+
leftHandle.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["left-handle"];
|
51693
|
+
this.element.appendChild(leftHandle);
|
51694
|
+
leftHandle.addEventListener("pointerdown", this._onLeftHandlePointerDown);
|
51695
|
+
const bottomHandle = root.ownerDocument.createElement("div");
|
51696
|
+
bottomHandle.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["bottom-handle"];
|
51697
|
+
this.element.appendChild(bottomHandle);
|
51698
|
+
bottomHandle.addEventListener("pointerdown", this._onBottomHandlePointerDown);
|
51699
|
+
const topHandle = root.ownerDocument.createElement("div");
|
51700
|
+
topHandle.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["top-handle"];
|
51701
|
+
this.element.appendChild(topHandle);
|
51702
|
+
topHandle.addEventListener("pointerdown", this._onTopHandlePointerDown);
|
51703
|
+
const topRightCornerHandle = root.ownerDocument.createElement("div");
|
51704
|
+
topRightCornerHandle.className = (0,_components_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ "right-handle": true, "top-right-corner-handle": true }, _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]);
|
51705
|
+
this.element.appendChild(topRightCornerHandle);
|
51706
|
+
topRightCornerHandle.addEventListener("pointerdown", this._onTopRightHandlePointerDown);
|
51707
|
+
const bottomRightCornerHandle = root.ownerDocument.createElement("div");
|
51708
|
+
bottomRightCornerHandle.className = (0,_components_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ "right-handle": true, "bottom-right-corner-handle": true }, _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]);
|
51709
|
+
this.element.appendChild(bottomRightCornerHandle);
|
51710
|
+
bottomRightCornerHandle.addEventListener("pointerdown", this._onBottomRightHandlePointerDown);
|
51711
|
+
const topLeftCornerHandle = root.ownerDocument.createElement("div");
|
51712
|
+
topLeftCornerHandle.className = (0,_components_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ "left-handle": true, "top-left-corner-handle": true }, _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]);
|
51713
|
+
this.element.appendChild(topLeftCornerHandle);
|
51714
|
+
topLeftCornerHandle.addEventListener("pointerdown", this._onTopLeftHandlePointerDown);
|
51715
|
+
const bottomLeftCornerHandle = root.ownerDocument.createElement("div");
|
51716
|
+
bottomLeftCornerHandle.className = (0,_components_classNames__WEBPACK_IMPORTED_MODULE_5__.ClassNames)({ "left-handle": true, "bottom-left-corner-handle": true }, _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]);
|
51717
|
+
this.element.appendChild(bottomLeftCornerHandle);
|
51718
|
+
bottomLeftCornerHandle.addEventListener("pointerdown", this._onBottomLeftHandlePointerDown);
|
51719
|
+
// add header elements
|
51720
|
+
this._headerTextElement = root.ownerDocument.createElement("div");
|
51721
|
+
this._headerTextElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-title"]);
|
51722
|
+
this._headerElement.appendChild(this._headerTextElement);
|
51723
|
+
this._headerCollapseElement = root.ownerDocument.createElement("div");
|
51724
|
+
this._headerCollapseElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-collapse"]);
|
51725
|
+
this._headerCollapseElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-button"]);
|
51726
|
+
this._headerCollapseElement.title = "Collapse";
|
51727
|
+
this._headerCollapseElement.ondragstart = () => false;
|
51728
|
+
this._headerCollapseElement.addEventListener("pointerdown", (evt) => {
|
51729
|
+
this._headerCollapseElement.classList.add("down");
|
51730
|
+
evt.stopPropagation();
|
51731
|
+
});
|
51732
|
+
this._headerCollapseElement.addEventListener("pointerup", (evt) => {
|
51733
|
+
evt.stopPropagation();
|
51734
|
+
this._headerCollapseElement.classList.remove("down");
|
51735
|
+
this.isCollapsed = !this.isCollapsed;
|
51736
|
+
});
|
51737
|
+
this._headerCollapseElement.innerHTML = this._collapseSVG;
|
51738
|
+
this._headerElement.appendChild(this._headerCollapseElement);
|
51739
|
+
this._headerCloseElement = root.ownerDocument.createElement("div");
|
51740
|
+
this._headerCloseElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-close"]);
|
51741
|
+
this._headerCloseElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-box-header-button"]);
|
51742
|
+
this._headerCloseElement.title = "Close";
|
51743
|
+
this._headerCloseElement.ondragstart = () => false;
|
51744
|
+
this._headerCloseElement.addEventListener("pointerdown", (evt) => {
|
51745
|
+
evt.stopPropagation();
|
51746
|
+
});
|
51747
|
+
this._headerCloseElement.addEventListener("pointerup", (evt) => {
|
51748
|
+
evt.stopPropagation();
|
51749
|
+
this.dispose();
|
51750
|
+
});
|
51751
|
+
this._headerCloseElement.innerHTML = this._closeSVG;
|
51752
|
+
this._headerElement.appendChild(this._headerCloseElement);
|
51753
|
+
this._portContainer = root.ownerDocument.createElement("div");
|
51754
|
+
this._portContainer.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["port-container"]);
|
51755
|
+
this.element.appendChild(this._portContainer);
|
51756
|
+
this._outputPortContainer = root.ownerDocument.createElement("div");
|
51757
|
+
this._outputPortContainer.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].outputsContainer);
|
51758
|
+
this._portContainer.appendChild(this._outputPortContainer);
|
51759
|
+
this._inputPortContainer = root.ownerDocument.createElement("div");
|
51760
|
+
this._inputPortContainer.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].inputsContainer);
|
51761
|
+
this._portContainer.appendChild(this._inputPortContainer);
|
51762
|
+
this.name = "Frame";
|
51763
|
+
this.color = core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Color3.FromInts(72, 72, 72);
|
51764
|
+
if (candidate) {
|
51765
|
+
this.x = parseFloat(candidate.style.left.replace("px", ""));
|
51766
|
+
this.y = parseFloat(candidate.style.top.replace("px", ""));
|
51767
|
+
this.width = parseFloat(candidate.style.width.replace("px", ""));
|
51768
|
+
this.height = parseFloat(candidate.style.height.replace("px", ""));
|
51769
|
+
this.cleanAccumulation();
|
51811
51770
|
}
|
51812
|
-
|
51813
|
-
|
51771
|
+
this._headerTextElement.addEventListener("pointerdown", (evt) => this._onDown(evt));
|
51772
|
+
this._headerTextElement.addEventListener("pointerup", (evt) => this._onUp(evt));
|
51773
|
+
this._headerTextElement.addEventListener("pointermove", (evt) => this._onMove(evt));
|
51774
|
+
this._onSelectionChangedObserver = canvas.stateManager.onSelectionChangedObservable.add(() => {
|
51775
|
+
if (this._ownerCanvas.selectedFrames.indexOf(this) !== -1) {
|
51776
|
+
this._borderElement.classList.add(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
51777
|
+
}
|
51778
|
+
else {
|
51779
|
+
this._borderElement.classList.remove(_graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
51780
|
+
}
|
51781
|
+
});
|
51782
|
+
canvas.stateManager.onSelectionBoxMoved.add((rect1) => {
|
51783
|
+
const rect2 = this.element.getBoundingClientRect();
|
51784
|
+
const overlap = !(rect1.right < rect2.left || rect1.left > rect2.right || rect1.bottom < rect2.top || rect1.top > rect2.bottom);
|
51785
|
+
if (overlap) {
|
51786
|
+
canvas.stateManager.onSelectionChangedObservable.notifyObservers({ selection: this, forceKeepSelection: true, marqueeSelection: true });
|
51787
|
+
}
|
51788
|
+
});
|
51789
|
+
this._onGraphNodeRemovalObserver = canvas.stateManager.onGraphNodeRemovalObservable.add((node) => {
|
51790
|
+
// remove node from this._nodes
|
51791
|
+
const index = this._nodes.indexOf(node);
|
51792
|
+
if (index === -1) {
|
51793
|
+
return;
|
51794
|
+
}
|
51795
|
+
else {
|
51796
|
+
node.enclosingFrameId = -1;
|
51797
|
+
this._nodes.splice(index, 1);
|
51798
|
+
}
|
51799
|
+
});
|
51800
|
+
this._onExposePortOnFrameObserver = canvas.stateManager.onExposePortOnFrameObservable.add((node) => {
|
51801
|
+
if (this.nodes.indexOf(node) === -1) {
|
51802
|
+
return;
|
51803
|
+
}
|
51804
|
+
this.redrawFramePorts();
|
51805
|
+
});
|
51806
|
+
this._commentsElement = document.createElement("div");
|
51807
|
+
this._commentsElement.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-comments"];
|
51808
|
+
this._commentsElement.style.color = "white";
|
51809
|
+
this._commentsElement.style.fontSize = "16px";
|
51810
|
+
const commentSpan = document.createElement("span");
|
51811
|
+
commentSpan.className = _graphFrame_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["frame-comment-span"];
|
51812
|
+
this._commentsElement.appendChild(commentSpan);
|
51813
|
+
this.element.appendChild(this._commentsElement);
|
51814
|
+
// Get nodes
|
51815
|
+
if (!doNotCaptureNodes) {
|
51816
|
+
this.refresh();
|
51814
51817
|
}
|
51815
|
-
this.height = this._borderElement.offsetHeight;
|
51816
|
-
this._comments = comments;
|
51817
|
-
this._updateMinHeightWithComments();
|
51818
51818
|
}
|
51819
51819
|
refresh() {
|
51820
51820
|
this._nodes = [];
|
@@ -52204,54 +52204,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
52204
52204
|
|
52205
52205
|
|
52206
52206
|
class GraphNode {
|
52207
|
-
constructor(content, stateManager) {
|
52208
|
-
this.content = content;
|
52209
|
-
this._inputPorts = [];
|
52210
|
-
this._outputPorts = [];
|
52211
|
-
this._links = [];
|
52212
|
-
this._x = 0;
|
52213
|
-
this._y = 0;
|
52214
|
-
this._gridAlignedX = 0;
|
52215
|
-
this._gridAlignedY = 0;
|
52216
|
-
this._mouseStartPointX = null;
|
52217
|
-
this._mouseStartPointY = null;
|
52218
|
-
this._displayManager = null;
|
52219
|
-
this._isVisible = true;
|
52220
|
-
this._enclosingFrameId = -1;
|
52221
|
-
this._stateManager = stateManager;
|
52222
|
-
this._onSelectionChangedObserver = this._stateManager.onSelectionChangedObservable.add((options) => {
|
52223
|
-
const { selection: node } = options || {};
|
52224
|
-
if (node === this) {
|
52225
|
-
this._visual.classList.add(_graphNode_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].selected);
|
52226
|
-
}
|
52227
|
-
else {
|
52228
|
-
setTimeout(() => {
|
52229
|
-
if (this._ownerCanvas.selectedNodes.indexOf(this) === -1) {
|
52230
|
-
this._visual.classList.remove(_graphNode_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].selected);
|
52231
|
-
}
|
52232
|
-
});
|
52233
|
-
}
|
52234
|
-
});
|
52235
|
-
this._onUpdateRequiredObserver = this._stateManager.onUpdateRequiredObservable.add((data) => {
|
52236
|
-
if (data !== this.content.data) {
|
52237
|
-
return;
|
52238
|
-
}
|
52239
|
-
this.refresh();
|
52240
|
-
});
|
52241
|
-
this._onSelectionBoxMovedObserver = this._stateManager.onSelectionBoxMoved.add((rect1) => {
|
52242
|
-
const rect2 = this._visual.getBoundingClientRect();
|
52243
|
-
const overlap = !(rect1.right < rect2.left || rect1.left > rect2.right || rect1.bottom < rect2.top || rect1.top > rect2.bottom);
|
52244
|
-
this.setIsSelected(overlap, true);
|
52245
|
-
});
|
52246
|
-
this._onFrameCreatedObserver = this._stateManager.onFrameCreatedObservable.add((frame) => {
|
52247
|
-
if (this._ownerCanvas.frames.some((f) => f.nodes.indexOf(this) !== -1)) {
|
52248
|
-
return;
|
52249
|
-
}
|
52250
|
-
if (this.isOverlappingFrame(frame)) {
|
52251
|
-
frame.nodes.push(this);
|
52252
|
-
}
|
52253
|
-
});
|
52254
|
-
}
|
52255
52207
|
addClassToVisual(className) {
|
52256
52208
|
this._visual.classList.add(className);
|
52257
52209
|
}
|
@@ -52363,6 +52315,54 @@ class GraphNode {
|
|
52363
52315
|
this._stateManager.onSelectionChangedObservable.notifyObservers({ selection: this, marqueeSelection });
|
52364
52316
|
}
|
52365
52317
|
}
|
52318
|
+
constructor(content, stateManager) {
|
52319
|
+
this.content = content;
|
52320
|
+
this._inputPorts = [];
|
52321
|
+
this._outputPorts = [];
|
52322
|
+
this._links = [];
|
52323
|
+
this._x = 0;
|
52324
|
+
this._y = 0;
|
52325
|
+
this._gridAlignedX = 0;
|
52326
|
+
this._gridAlignedY = 0;
|
52327
|
+
this._mouseStartPointX = null;
|
52328
|
+
this._mouseStartPointY = null;
|
52329
|
+
this._displayManager = null;
|
52330
|
+
this._isVisible = true;
|
52331
|
+
this._enclosingFrameId = -1;
|
52332
|
+
this._stateManager = stateManager;
|
52333
|
+
this._onSelectionChangedObserver = this._stateManager.onSelectionChangedObservable.add((options) => {
|
52334
|
+
const { selection: node } = options || {};
|
52335
|
+
if (node === this) {
|
52336
|
+
this._visual.classList.add(_graphNode_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].selected);
|
52337
|
+
}
|
52338
|
+
else {
|
52339
|
+
setTimeout(() => {
|
52340
|
+
if (this._ownerCanvas.selectedNodes.indexOf(this) === -1) {
|
52341
|
+
this._visual.classList.remove(_graphNode_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].selected);
|
52342
|
+
}
|
52343
|
+
});
|
52344
|
+
}
|
52345
|
+
});
|
52346
|
+
this._onUpdateRequiredObserver = this._stateManager.onUpdateRequiredObservable.add((data) => {
|
52347
|
+
if (data !== this.content.data) {
|
52348
|
+
return;
|
52349
|
+
}
|
52350
|
+
this.refresh();
|
52351
|
+
});
|
52352
|
+
this._onSelectionBoxMovedObserver = this._stateManager.onSelectionBoxMoved.add((rect1) => {
|
52353
|
+
const rect2 = this._visual.getBoundingClientRect();
|
52354
|
+
const overlap = !(rect1.right < rect2.left || rect1.left > rect2.right || rect1.bottom < rect2.top || rect1.top > rect2.bottom);
|
52355
|
+
this.setIsSelected(overlap, true);
|
52356
|
+
});
|
52357
|
+
this._onFrameCreatedObserver = this._stateManager.onFrameCreatedObservable.add((frame) => {
|
52358
|
+
if (this._ownerCanvas.frames.some((f) => f.nodes.indexOf(this) !== -1)) {
|
52359
|
+
return;
|
52360
|
+
}
|
52361
|
+
if (this.isOverlappingFrame(frame)) {
|
52362
|
+
frame.nodes.push(this);
|
52363
|
+
}
|
52364
|
+
});
|
52365
|
+
}
|
52366
52366
|
isOverlappingFrame(frame) {
|
52367
52367
|
const rect2 = this._visual.getBoundingClientRect();
|
52368
52368
|
const rect1 = frame.element.getBoundingClientRect();
|
@@ -52728,43 +52728,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
52728
52728
|
|
52729
52729
|
|
52730
52730
|
class NodeLink {
|
52731
|
-
constructor(graphCanvas, portA, nodeA, portB, nodeB) {
|
52732
|
-
this._isVisible = true;
|
52733
|
-
this._isTargetCandidate = false;
|
52734
|
-
this.onDisposedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
|
52735
|
-
this._portA = portA;
|
52736
|
-
this._portB = portB;
|
52737
|
-
this._nodeA = nodeA;
|
52738
|
-
this._nodeB = nodeB;
|
52739
|
-
this._graphCanvas = graphCanvas;
|
52740
|
-
const document = portA.element.ownerDocument;
|
52741
|
-
const svg = graphCanvas.svgCanvas;
|
52742
|
-
// Create path
|
52743
|
-
this._path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
52744
|
-
this._path.setAttribute("fill", "none");
|
52745
|
-
this._path.classList.add(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].link);
|
52746
|
-
svg.appendChild(this._path);
|
52747
|
-
this._selectionPath = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
52748
|
-
this._selectionPath.setAttribute("fill", "none");
|
52749
|
-
this._selectionPath.classList.add(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["selection-link"]);
|
52750
|
-
svg.appendChild(this._selectionPath);
|
52751
|
-
this._selectionPath.onmousedown = (evt) => this.onClick(evt);
|
52752
|
-
if (this._portB) {
|
52753
|
-
// Update
|
52754
|
-
this.update();
|
52755
|
-
}
|
52756
|
-
this._onSelectionChangedObserver = this._graphCanvas.stateManager.onSelectionChangedObservable.add((options) => {
|
52757
|
-
const { selection } = options || {};
|
52758
|
-
if (selection === this) {
|
52759
|
-
this._path.classList.add(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
52760
|
-
this._selectionPath.classList.add(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
52761
|
-
}
|
52762
|
-
else {
|
52763
|
-
this._path.classList.remove(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
52764
|
-
this._selectionPath.classList.remove(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
52765
|
-
}
|
52766
|
-
});
|
52767
|
-
}
|
52768
52731
|
get isTargetCandidate() {
|
52769
52732
|
return this._isTargetCandidate;
|
52770
52733
|
}
|
@@ -52855,6 +52818,43 @@ class NodeLink {
|
|
52855
52818
|
}
|
52856
52819
|
this._path.setAttribute("stroke", this._portA.element.style.backgroundColor);
|
52857
52820
|
}
|
52821
|
+
constructor(graphCanvas, portA, nodeA, portB, nodeB) {
|
52822
|
+
this._isVisible = true;
|
52823
|
+
this._isTargetCandidate = false;
|
52824
|
+
this.onDisposedObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
|
52825
|
+
this._portA = portA;
|
52826
|
+
this._portB = portB;
|
52827
|
+
this._nodeA = nodeA;
|
52828
|
+
this._nodeB = nodeB;
|
52829
|
+
this._graphCanvas = graphCanvas;
|
52830
|
+
const document = portA.element.ownerDocument;
|
52831
|
+
const svg = graphCanvas.svgCanvas;
|
52832
|
+
// Create path
|
52833
|
+
this._path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
52834
|
+
this._path.setAttribute("fill", "none");
|
52835
|
+
this._path.classList.add(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].link);
|
52836
|
+
svg.appendChild(this._path);
|
52837
|
+
this._selectionPath = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
52838
|
+
this._selectionPath.setAttribute("fill", "none");
|
52839
|
+
this._selectionPath.classList.add(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"]["selection-link"]);
|
52840
|
+
svg.appendChild(this._selectionPath);
|
52841
|
+
this._selectionPath.onmousedown = (evt) => this.onClick(evt);
|
52842
|
+
if (this._portB) {
|
52843
|
+
// Update
|
52844
|
+
this.update();
|
52845
|
+
}
|
52846
|
+
this._onSelectionChangedObserver = this._graphCanvas.stateManager.onSelectionChangedObservable.add((options) => {
|
52847
|
+
const { selection } = options || {};
|
52848
|
+
if (selection === this) {
|
52849
|
+
this._path.classList.add(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
52850
|
+
this._selectionPath.classList.add(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
52851
|
+
}
|
52852
|
+
else {
|
52853
|
+
this._path.classList.remove(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
52854
|
+
this._selectionPath.classList.remove(_nodeLink_modules_scss__WEBPACK_IMPORTED_MODULE_3__["default"].selected);
|
52855
|
+
}
|
52856
|
+
});
|
52857
|
+
}
|
52858
52858
|
onClick(evt) {
|
52859
52859
|
const stateManager = this._graphCanvas.stateManager;
|
52860
52860
|
if (evt.altKey) {
|
@@ -52915,54 +52915,17 @@ class NodeLink {
|
|
52915
52915
|
!*** ../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.js ***!
|
52916
52916
|
\************************************************************************/
|
52917
52917
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
52918
|
-
|
52919
|
-
"use strict";
|
52920
|
-
__webpack_require__.r(__webpack_exports__);
|
52921
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
52922
|
-
/* harmony export */ "NodePort": () => (/* binding */ NodePort)
|
52923
|
-
/* harmony export */ });
|
52924
|
-
/* harmony import */ var _common_modules_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.modules.scss */ "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss");
|
52925
|
-
/* harmony import */ var _nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodePort.modules.scss */ "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss");
|
52926
|
-
|
52927
|
-
|
52928
|
-
class NodePort {
|
52929
|
-
constructor(portContainer, portData, node, stateManager) {
|
52930
|
-
this.portData = portData;
|
52931
|
-
this.node = node;
|
52932
|
-
this.delegatedPort = null;
|
52933
|
-
this._element = portContainer.ownerDocument.createElement("div");
|
52934
|
-
this._element.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_0__["default"].port);
|
52935
|
-
portContainer.appendChild(this._element);
|
52936
|
-
this._stateManager = stateManager;
|
52937
|
-
this._img = portContainer.ownerDocument.createElement("img");
|
52938
|
-
this._element.appendChild(this._img);
|
52939
|
-
// determine if node name is editable
|
52940
|
-
if (portContainer.children[0].className === _common_modules_scss__WEBPACK_IMPORTED_MODULE_0__["default"]["port-label"]) {
|
52941
|
-
this._portLabelElement = portContainer.children[0];
|
52942
|
-
}
|
52943
|
-
this._element.port = this;
|
52944
|
-
// Drag support
|
52945
|
-
this._element.ondragstart = () => false;
|
52946
|
-
this._onCandidateLinkMovedObserver = stateManager.onCandidateLinkMoved.add((coords) => {
|
52947
|
-
const rect = this._element.getBoundingClientRect();
|
52948
|
-
if (!coords || rect.left > coords.x || rect.right < coords.x || rect.top > coords.y || rect.bottom < coords.y) {
|
52949
|
-
this._element.classList.remove(_nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__["default"].selected);
|
52950
|
-
return;
|
52951
|
-
}
|
52952
|
-
this._element.classList.add(_nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__["default"].selected);
|
52953
|
-
this._stateManager.onCandidatePortSelectedObservable.notifyObservers(this);
|
52954
|
-
});
|
52955
|
-
this._onSelectionChangedObserver = this._stateManager.onSelectionChangedObservable.add((options) => {
|
52956
|
-
const { selection } = options || {};
|
52957
|
-
if (selection === this) {
|
52958
|
-
this._img.classList.add(_nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__["default"].selected);
|
52959
|
-
}
|
52960
|
-
else {
|
52961
|
-
this._img.classList.remove(_nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__["default"].selected);
|
52962
|
-
}
|
52963
|
-
});
|
52964
|
-
this.refresh();
|
52965
|
-
}
|
52918
|
+
|
52919
|
+
"use strict";
|
52920
|
+
__webpack_require__.r(__webpack_exports__);
|
52921
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
52922
|
+
/* harmony export */ "NodePort": () => (/* binding */ NodePort)
|
52923
|
+
/* harmony export */ });
|
52924
|
+
/* harmony import */ var _common_modules_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.modules.scss */ "../../../dev/sharedUiComponents/dist/nodeGraphSystem/common.modules.scss");
|
52925
|
+
/* harmony import */ var _nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodePort.modules.scss */ "../../../dev/sharedUiComponents/dist/nodeGraphSystem/nodePort.modules.scss");
|
52926
|
+
|
52927
|
+
|
52928
|
+
class NodePort {
|
52966
52929
|
get element() {
|
52967
52930
|
if (this.delegatedPort) {
|
52968
52931
|
return this.delegatedPort.element;
|
@@ -53032,6 +52995,43 @@ class NodePort {
|
|
53032
52995
|
refresh() {
|
53033
52996
|
this._stateManager.applyNodePortDesign(this.portData, this._element, this._img);
|
53034
52997
|
}
|
52998
|
+
constructor(portContainer, portData, node, stateManager) {
|
52999
|
+
this.portData = portData;
|
53000
|
+
this.node = node;
|
53001
|
+
this.delegatedPort = null;
|
53002
|
+
this._element = portContainer.ownerDocument.createElement("div");
|
53003
|
+
this._element.classList.add(_common_modules_scss__WEBPACK_IMPORTED_MODULE_0__["default"].port);
|
53004
|
+
portContainer.appendChild(this._element);
|
53005
|
+
this._stateManager = stateManager;
|
53006
|
+
this._img = portContainer.ownerDocument.createElement("img");
|
53007
|
+
this._element.appendChild(this._img);
|
53008
|
+
// determine if node name is editable
|
53009
|
+
if (portContainer.children[0].className === _common_modules_scss__WEBPACK_IMPORTED_MODULE_0__["default"]["port-label"]) {
|
53010
|
+
this._portLabelElement = portContainer.children[0];
|
53011
|
+
}
|
53012
|
+
this._element.port = this;
|
53013
|
+
// Drag support
|
53014
|
+
this._element.ondragstart = () => false;
|
53015
|
+
this._onCandidateLinkMovedObserver = stateManager.onCandidateLinkMoved.add((coords) => {
|
53016
|
+
const rect = this._element.getBoundingClientRect();
|
53017
|
+
if (!coords || rect.left > coords.x || rect.right < coords.x || rect.top > coords.y || rect.bottom < coords.y) {
|
53018
|
+
this._element.classList.remove(_nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__["default"].selected);
|
53019
|
+
return;
|
53020
|
+
}
|
53021
|
+
this._element.classList.add(_nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__["default"].selected);
|
53022
|
+
this._stateManager.onCandidatePortSelectedObservable.notifyObservers(this);
|
53023
|
+
});
|
53024
|
+
this._onSelectionChangedObserver = this._stateManager.onSelectionChangedObservable.add((options) => {
|
53025
|
+
const { selection } = options || {};
|
53026
|
+
if (selection === this) {
|
53027
|
+
this._img.classList.add(_nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__["default"].selected);
|
53028
|
+
}
|
53029
|
+
else {
|
53030
|
+
this._img.classList.remove(_nodePort_modules_scss__WEBPACK_IMPORTED_MODULE_1__["default"].selected);
|
53031
|
+
}
|
53032
|
+
});
|
53033
|
+
this.refresh();
|
53034
|
+
}
|
53035
53035
|
dispose() {
|
53036
53036
|
this._stateManager.onCandidateLinkMoved.remove(this._onCandidateLinkMovedObserver);
|
53037
53037
|
if (this._onSelectionChangedObserver) {
|
@@ -54817,6 +54817,39 @@ __webpack_require__.r(__webpack_exports__);
|
|
54817
54817
|
|
54818
54818
|
const dontSerializeTextureContent = true;
|
54819
54819
|
class PreviewManager {
|
54820
|
+
_serializeMaterial() {
|
54821
|
+
const nodeMaterial = this._nodeMaterial;
|
54822
|
+
let fullSerialization = false;
|
54823
|
+
if (dontSerializeTextureContent) {
|
54824
|
+
const textureBlocks = nodeMaterial.getAllTextureBlocks();
|
54825
|
+
for (const block of textureBlocks) {
|
54826
|
+
const texture = block.texture;
|
54827
|
+
if (!texture || block.hasImageSource) {
|
54828
|
+
continue;
|
54829
|
+
}
|
54830
|
+
let found = false;
|
54831
|
+
for (const localTexture of this._engine.getLoadedTexturesCache()) {
|
54832
|
+
if (localTexture.uniqueId === texture._texture?.uniqueId) {
|
54833
|
+
found = true;
|
54834
|
+
break;
|
54835
|
+
}
|
54836
|
+
}
|
54837
|
+
if (!found) {
|
54838
|
+
fullSerialization = true;
|
54839
|
+
break;
|
54840
|
+
}
|
54841
|
+
}
|
54842
|
+
}
|
54843
|
+
const bufferSerializationState = core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture.SerializeBuffers;
|
54844
|
+
if (dontSerializeTextureContent) {
|
54845
|
+
core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture.SerializeBuffers = fullSerialization;
|
54846
|
+
core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture._SerializeInternalTextureUniqueId = true;
|
54847
|
+
}
|
54848
|
+
const serializationObject = nodeMaterial.serialize();
|
54849
|
+
core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture.SerializeBuffers = bufferSerializationState;
|
54850
|
+
core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture._SerializeInternalTextureUniqueId = false;
|
54851
|
+
return serializationObject;
|
54852
|
+
}
|
54820
54853
|
constructor(targetCanvas, globalState) {
|
54821
54854
|
this._nodeMaterial = globalState.nodeMaterial;
|
54822
54855
|
this._globalState = globalState;
|
@@ -54885,39 +54918,6 @@ class PreviewManager {
|
|
54885
54918
|
lastOffsetX = evt.event.offsetX;
|
54886
54919
|
});
|
54887
54920
|
}
|
54888
|
-
_serializeMaterial() {
|
54889
|
-
const nodeMaterial = this._nodeMaterial;
|
54890
|
-
let fullSerialization = false;
|
54891
|
-
if (dontSerializeTextureContent) {
|
54892
|
-
const textureBlocks = nodeMaterial.getAllTextureBlocks();
|
54893
|
-
for (const block of textureBlocks) {
|
54894
|
-
const texture = block.texture;
|
54895
|
-
if (!texture || block.hasImageSource) {
|
54896
|
-
continue;
|
54897
|
-
}
|
54898
|
-
let found = false;
|
54899
|
-
for (const localTexture of this._engine.getLoadedTexturesCache()) {
|
54900
|
-
if (localTexture.uniqueId === texture._texture?.uniqueId) {
|
54901
|
-
found = true;
|
54902
|
-
break;
|
54903
|
-
}
|
54904
|
-
}
|
54905
|
-
if (!found) {
|
54906
|
-
fullSerialization = true;
|
54907
|
-
break;
|
54908
|
-
}
|
54909
|
-
}
|
54910
|
-
}
|
54911
|
-
const bufferSerializationState = core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture.SerializeBuffers;
|
54912
|
-
if (dontSerializeTextureContent) {
|
54913
|
-
core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture.SerializeBuffers = fullSerialization;
|
54914
|
-
core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture._SerializeInternalTextureUniqueId = true;
|
54915
|
-
}
|
54916
|
-
const serializationObject = nodeMaterial.serialize();
|
54917
|
-
core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture.SerializeBuffers = bufferSerializationState;
|
54918
|
-
core_Materials_Node_nodeMaterial__WEBPACK_IMPORTED_MODULE_0__.Texture._SerializeInternalTextureUniqueId = false;
|
54919
|
-
return serializationObject;
|
54920
|
-
}
|
54921
54921
|
_handleAnimations() {
|
54922
54922
|
this._scene.stopAllAnimations();
|
54923
54923
|
if (this._globalState.rotatePreview) {
|
@@ -56123,6 +56123,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
56123
56123
|
|
56124
56124
|
|
56125
56125
|
class GlobalState {
|
56126
|
+
/** Gets the mode */
|
56127
|
+
get mode() {
|
56128
|
+
return this._mode;
|
56129
|
+
}
|
56130
|
+
/** Sets the mode */
|
56131
|
+
set mode(m) {
|
56132
|
+
core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.WriteNumber("Mode", m);
|
56133
|
+
this._mode = m;
|
56134
|
+
this.onPreviewCommandActivated.notifyObservers(true);
|
56135
|
+
}
|
56126
56136
|
constructor() {
|
56127
56137
|
this.onBuiltObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
|
56128
56138
|
this.onResetRequiredObservable = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Observable();
|
@@ -56162,16 +56172,6 @@ class GlobalState {
|
|
56162
56172
|
const b = core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.ReadNumber("BackgroundColorB", 0.25098039215686274);
|
56163
56173
|
this.backgroundColor = new core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.Color4(r, g, b, 1.0);
|
56164
56174
|
}
|
56165
|
-
/** Gets the mode */
|
56166
|
-
get mode() {
|
56167
|
-
return this._mode;
|
56168
|
-
}
|
56169
|
-
/** Sets the mode */
|
56170
|
-
set mode(m) {
|
56171
|
-
core_Misc_observable__WEBPACK_IMPORTED_MODULE_0__.DataStorage.WriteNumber("Mode", m);
|
56172
|
-
this._mode = m;
|
56173
|
-
this.onPreviewCommandActivated.notifyObservers(true);
|
56174
|
-
}
|
56175
56175
|
storeEditorData(serializationObject, frame) {
|
56176
56176
|
this.stateManager.storeEditorData(serializationObject, frame);
|
56177
56177
|
}
|
@@ -56232,6 +56232,47 @@ __webpack_require__.r(__webpack_exports__);
|
|
56232
56232
|
|
56233
56233
|
|
56234
56234
|
class GraphEditor extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
|
56235
|
+
appendBlock(dataToAppend, recursion = true) {
|
56236
|
+
return this._graphCanvas.createNodeFromObject(dataToAppend instanceof core_Materials_Node_nodeMaterialBlock__WEBPACK_IMPORTED_MODULE_2__.NodeMaterialBlock ? shared_ui_components_nodeGraphSystem_typeLedger__WEBPACK_IMPORTED_MODULE_17__.TypeLedger.NodeDataBuilder(dataToAppend, this._graphCanvas) : dataToAppend, (block) => {
|
56237
|
+
if (this.props.globalState.nodeMaterial.attachedBlocks.indexOf(block) === -1) {
|
56238
|
+
this.props.globalState.nodeMaterial.attachedBlocks.push(block);
|
56239
|
+
}
|
56240
|
+
if (block.isFinalMerger) {
|
56241
|
+
this.props.globalState.nodeMaterial.addOutputNode(block);
|
56242
|
+
}
|
56243
|
+
}, recursion);
|
56244
|
+
}
|
56245
|
+
addValueNode(type) {
|
56246
|
+
const nodeType = _blockTools__WEBPACK_IMPORTED_MODULE_8__.BlockTools.GetConnectionNodeTypeFromString(type);
|
56247
|
+
const newInputBlock = new core_Materials_Node_nodeMaterialBlock__WEBPACK_IMPORTED_MODULE_2__.InputBlock(type, undefined, nodeType);
|
56248
|
+
return this.appendBlock(newInputBlock);
|
56249
|
+
}
|
56250
|
+
componentDidMount() {
|
56251
|
+
window.addEventListener("wheel", this.onWheel, { passive: false });
|
56252
|
+
if (this.props.globalState.hostDocument) {
|
56253
|
+
this._graphCanvas = this._graphCanvasRef.current;
|
56254
|
+
this._diagramContainer = this._diagramContainerRef.current;
|
56255
|
+
this._previewManager = new _components_preview_previewManager__WEBPACK_IMPORTED_MODULE_9__.PreviewManager(this.props.globalState.hostDocument.getElementById("preview-canvas"), this.props.globalState);
|
56256
|
+
this.props.globalState._previewManager = this._previewManager;
|
56257
|
+
}
|
56258
|
+
if (navigator.userAgent.indexOf("Mobile") !== -1) {
|
56259
|
+
(this.props.globalState.hostDocument || document).querySelector(".blocker").style.visibility = "visible";
|
56260
|
+
}
|
56261
|
+
this.props.globalState.onPopupClosedObservable.addOnce(() => {
|
56262
|
+
this.componentWillUnmount();
|
56263
|
+
});
|
56264
|
+
this.build();
|
56265
|
+
}
|
56266
|
+
componentWillUnmount() {
|
56267
|
+
window.removeEventListener("wheel", this.onWheel);
|
56268
|
+
if (this.props.globalState.hostDocument) {
|
56269
|
+
this.props.globalState.hostDocument.removeEventListener("keyup", this._onWidgetKeyUpPointer, false);
|
56270
|
+
}
|
56271
|
+
if (this._previewManager) {
|
56272
|
+
this._previewManager.dispose();
|
56273
|
+
this._previewManager = null;
|
56274
|
+
}
|
56275
|
+
}
|
56235
56276
|
constructor(props) {
|
56236
56277
|
super(props);
|
56237
56278
|
this._leftWidth = core_Materials_Node_nodeMaterialBlock__WEBPACK_IMPORTED_MODULE_2__.DataStorage.ReadNumber("LeftWidth", 200);
|
@@ -56472,47 +56513,6 @@ class GraphEditor extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
|
|
56472
56513
|
this.setState({ message: message, isError: true });
|
56473
56514
|
});
|
56474
56515
|
}
|
56475
|
-
appendBlock(dataToAppend, recursion = true) {
|
56476
|
-
return this._graphCanvas.createNodeFromObject(dataToAppend instanceof core_Materials_Node_nodeMaterialBlock__WEBPACK_IMPORTED_MODULE_2__.NodeMaterialBlock ? shared_ui_components_nodeGraphSystem_typeLedger__WEBPACK_IMPORTED_MODULE_17__.TypeLedger.NodeDataBuilder(dataToAppend, this._graphCanvas) : dataToAppend, (block) => {
|
56477
|
-
if (this.props.globalState.nodeMaterial.attachedBlocks.indexOf(block) === -1) {
|
56478
|
-
this.props.globalState.nodeMaterial.attachedBlocks.push(block);
|
56479
|
-
}
|
56480
|
-
if (block.isFinalMerger) {
|
56481
|
-
this.props.globalState.nodeMaterial.addOutputNode(block);
|
56482
|
-
}
|
56483
|
-
}, recursion);
|
56484
|
-
}
|
56485
|
-
addValueNode(type) {
|
56486
|
-
const nodeType = _blockTools__WEBPACK_IMPORTED_MODULE_8__.BlockTools.GetConnectionNodeTypeFromString(type);
|
56487
|
-
const newInputBlock = new core_Materials_Node_nodeMaterialBlock__WEBPACK_IMPORTED_MODULE_2__.InputBlock(type, undefined, nodeType);
|
56488
|
-
return this.appendBlock(newInputBlock);
|
56489
|
-
}
|
56490
|
-
componentDidMount() {
|
56491
|
-
window.addEventListener("wheel", this.onWheel, { passive: false });
|
56492
|
-
if (this.props.globalState.hostDocument) {
|
56493
|
-
this._graphCanvas = this._graphCanvasRef.current;
|
56494
|
-
this._diagramContainer = this._diagramContainerRef.current;
|
56495
|
-
this._previewManager = new _components_preview_previewManager__WEBPACK_IMPORTED_MODULE_9__.PreviewManager(this.props.globalState.hostDocument.getElementById("preview-canvas"), this.props.globalState);
|
56496
|
-
this.props.globalState._previewManager = this._previewManager;
|
56497
|
-
}
|
56498
|
-
if (navigator.userAgent.indexOf("Mobile") !== -1) {
|
56499
|
-
(this.props.globalState.hostDocument || document).querySelector(".blocker").style.visibility = "visible";
|
56500
|
-
}
|
56501
|
-
this.props.globalState.onPopupClosedObservable.addOnce(() => {
|
56502
|
-
this.componentWillUnmount();
|
56503
|
-
});
|
56504
|
-
this.build();
|
56505
|
-
}
|
56506
|
-
componentWillUnmount() {
|
56507
|
-
window.removeEventListener("wheel", this.onWheel);
|
56508
|
-
if (this.props.globalState.hostDocument) {
|
56509
|
-
this.props.globalState.hostDocument.removeEventListener("keyup", this._onWidgetKeyUpPointer, false);
|
56510
|
-
}
|
56511
|
-
if (this._previewManager) {
|
56512
|
-
this._previewManager.dispose();
|
56513
|
-
this._previewManager = null;
|
56514
|
-
}
|
56515
|
-
}
|
56516
56516
|
zoomToFit() {
|
56517
56517
|
this._graphCanvas.zoomToFit();
|
56518
56518
|
}
|
@@ -56740,21 +56740,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
56740
56740
|
|
56741
56741
|
|
56742
56742
|
class BlockNodeData {
|
56743
|
-
constructor(data, nodeContainer) {
|
56744
|
-
this.data = data;
|
56745
|
-
this._inputs = [];
|
56746
|
-
this._outputs = [];
|
56747
|
-
if (data.inputs) {
|
56748
|
-
this.data.inputs.forEach((input) => {
|
56749
|
-
this._inputs.push(new _connectionPointPortData__WEBPACK_IMPORTED_MODULE_1__.ConnectionPointPortData(input, nodeContainer));
|
56750
|
-
});
|
56751
|
-
}
|
56752
|
-
if (data.outputs) {
|
56753
|
-
this.data.outputs.forEach((output) => {
|
56754
|
-
this._outputs.push(new _connectionPointPortData__WEBPACK_IMPORTED_MODULE_1__.ConnectionPointPortData(output, nodeContainer));
|
56755
|
-
});
|
56756
|
-
}
|
56757
|
-
}
|
56758
56743
|
get uniqueId() {
|
56759
56744
|
return this.data.uniqueId;
|
56760
56745
|
}
|
@@ -56812,6 +56797,21 @@ class BlockNodeData {
|
|
56812
56797
|
}
|
56813
56798
|
iconDiv.classList.add(_blockNodeData_modules_scss__WEBPACK_IMPORTED_MODULE_4__["default"].hidden);
|
56814
56799
|
}
|
56800
|
+
constructor(data, nodeContainer) {
|
56801
|
+
this.data = data;
|
56802
|
+
this._inputs = [];
|
56803
|
+
this._outputs = [];
|
56804
|
+
if (data.inputs) {
|
56805
|
+
this.data.inputs.forEach((input) => {
|
56806
|
+
this._inputs.push(new _connectionPointPortData__WEBPACK_IMPORTED_MODULE_1__.ConnectionPointPortData(input, nodeContainer));
|
56807
|
+
});
|
56808
|
+
}
|
56809
|
+
if (data.outputs) {
|
56810
|
+
this.data.outputs.forEach((output) => {
|
56811
|
+
this._outputs.push(new _connectionPointPortData__WEBPACK_IMPORTED_MODULE_1__.ConnectionPointPortData(output, nodeContainer));
|
56812
|
+
});
|
56813
|
+
}
|
56814
|
+
}
|
56815
56815
|
}
|
56816
56816
|
|
56817
56817
|
|
@@ -56836,11 +56836,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
56836
56836
|
|
56837
56837
|
|
56838
56838
|
class ConnectionPointPortData {
|
56839
|
-
constructor(connectionPoint, nodeContainer) {
|
56840
|
-
this._connectedPort = null;
|
56841
|
-
this.data = connectionPoint;
|
56842
|
-
this._nodeContainer = nodeContainer;
|
56843
|
-
}
|
56844
56839
|
get name() {
|
56845
56840
|
const block = this.data.ownerBlock;
|
56846
56841
|
let portName = this.data.displayName || this.data.name;
|
@@ -56910,6 +56905,11 @@ class ConnectionPointPortData {
|
|
56910
56905
|
});
|
56911
56906
|
return endpoints;
|
56912
56907
|
}
|
56908
|
+
constructor(connectionPoint, nodeContainer) {
|
56909
|
+
this._connectedPort = null;
|
56910
|
+
this.data = connectionPoint;
|
56911
|
+
this._nodeContainer = nodeContainer;
|
56912
|
+
}
|
56913
56913
|
updateDisplayName(newName) {
|
56914
56914
|
this.data.displayName = newName;
|
56915
56915
|
}
|