@babylonjs/shared-ui-components 5.28.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.
- package/colorPicker/colorComponentEntry.d.ts +18 -0
- package/colorPicker/colorComponentEntry.js +37 -0
- package/colorPicker/colorComponentEntry.js.map +1 -0
- package/colorPicker/colorPicker.d.ts +43 -0
- package/colorPicker/colorPicker.js +137 -0
- package/colorPicker/colorPicker.js.map +1 -0
- package/colorPicker/hexColor.d.ts +20 -0
- package/colorPicker/hexColor.js +43 -0
- package/colorPicker/hexColor.js.map +1 -0
- package/components/Button.d.ts +10 -0
- package/components/Button.js +7 -0
- package/components/Button.js.map +1 -0
- package/components/Icon.d.ts +6 -0
- package/components/Icon.js +7 -0
- package/components/Icon.js.map +1 -0
- package/components/Label.d.ts +7 -0
- package/components/Label.js +7 -0
- package/components/Label.js.map +1 -0
- package/components/MessageDialog.d.ts +7 -0
- package/components/MessageDialog.js +23 -0
- package/components/MessageDialog.js.map +1 -0
- package/components/Toggle.d.ts +8 -0
- package/components/Toggle.js +16 -0
- package/components/Toggle.js.map +1 -0
- package/components/bars/CommandBarComponent.d.ts +16 -0
- package/components/bars/CommandBarComponent.js +69 -0
- package/components/bars/CommandBarComponent.js.map +1 -0
- package/components/bars/CommandButtonComponent.d.ts +11 -0
- package/components/bars/CommandButtonComponent.js +7 -0
- package/components/bars/CommandButtonComponent.js.map +1 -0
- package/components/bars/CommandDropdownComponent.d.ts +26 -0
- package/components/bars/CommandDropdownComponent.js +49 -0
- package/components/bars/CommandDropdownComponent.js.map +1 -0
- package/components/classNames.d.ts +2 -0
- package/components/classNames.js +19 -0
- package/components/classNames.js.map +1 -0
- package/components/colorPicker/ColorComponentEntry.d.ts +18 -0
- package/components/colorPicker/ColorComponentEntry.js +38 -0
- package/components/colorPicker/ColorComponentEntry.js.map +1 -0
- package/components/colorPicker/ColorPicker.d.ts +43 -0
- package/components/colorPicker/ColorPicker.js +138 -0
- package/components/colorPicker/ColorPicker.js.map +1 -0
- package/components/colorPicker/HexColor.d.ts +20 -0
- package/components/colorPicker/HexColor.js +46 -0
- package/components/colorPicker/HexColor.js.map +1 -0
- package/components/lines/ColorLineComponent.d.ts +40 -0
- package/components/lines/ColorLineComponent.js +146 -0
- package/components/lines/ColorLineComponent.js.map +1 -0
- package/components/lines/ColorPickerLineComponent.d.ts +33 -0
- package/components/lines/ColorPickerLineComponent.js +62 -0
- package/components/lines/ColorPickerLineComponent.js.map +1 -0
- package/components/lines/FileButtonLineComponent.d.ts +16 -0
- package/components/lines/FileButtonLineComponent.js +22 -0
- package/components/lines/FileButtonLineComponent.js.map +1 -0
- package/components/lines/NumericInputComponent.d.ts +31 -0
- package/components/lines/NumericInputComponent.js +87 -0
- package/components/lines/NumericInputComponent.js.map +1 -0
- package/license.md +71 -0
- package/lines/booleanLineComponent.d.ts +11 -0
- package/lines/booleanLineComponent.js +15 -0
- package/lines/booleanLineComponent.js.map +1 -0
- package/lines/buttonLineComponent.d.ts +12 -0
- package/lines/buttonLineComponent.js +11 -0
- package/lines/buttonLineComponent.js.map +1 -0
- package/lines/checkBoxLineComponent.d.ts +36 -0
- package/lines/checkBoxLineComponent.js +89 -0
- package/lines/checkBoxLineComponent.js.map +1 -0
- package/lines/color3LineComponent.d.ts +18 -0
- package/lines/color3LineComponent.js +10 -0
- package/lines/color3LineComponent.js.map +1 -0
- package/lines/color4LineComponent.d.ts +18 -0
- package/lines/color4LineComponent.js +10 -0
- package/lines/color4LineComponent.js.map +1 -0
- package/lines/colorLineComponent.d.ts +40 -0
- package/lines/colorLineComponent.js +145 -0
- package/lines/colorLineComponent.js.map +1 -0
- package/lines/colorPickerComponent.d.ts +31 -0
- package/lines/colorPickerComponent.js +61 -0
- package/lines/colorPickerComponent.js.map +1 -0
- package/lines/draggableLineComponent.d.ts +9 -0
- package/lines/draggableLineComponent.js +13 -0
- package/lines/draggableLineComponent.js.map +1 -0
- package/lines/fileButtonLineComponent.d.ts +17 -0
- package/lines/fileButtonLineComponent.js +21 -0
- package/lines/fileButtonLineComponent.js.map +1 -0
- package/lines/fileMultipleButtonLineComponent.d.ts +17 -0
- package/lines/fileMultipleButtonLineComponent.js +21 -0
- package/lines/fileMultipleButtonLineComponent.js.map +1 -0
- package/lines/floatLineComponent.d.ts +50 -0
- package/lines/floatLineComponent.js +176 -0
- package/lines/floatLineComponent.js.map +1 -0
- package/lines/hexLineComponent.d.ts +40 -0
- package/lines/hexLineComponent.js +122 -0
- package/lines/hexLineComponent.js.map +1 -0
- package/lines/iSelectedLineContainer.d.ts +4 -0
- package/lines/iSelectedLineContainer.js +2 -0
- package/lines/iSelectedLineContainer.js.map +1 -0
- package/lines/iconButtonLineComponent.d.ts +11 -0
- package/lines/iconButtonLineComponent.js +11 -0
- package/lines/iconButtonLineComponent.js.map +1 -0
- package/lines/iconComponent.d.ts +9 -0
- package/lines/iconComponent.js +8 -0
- package/lines/iconComponent.js.map +1 -0
- package/lines/indentedTextLineComponent.d.ts +16 -0
- package/lines/indentedTextLineComponent.js +27 -0
- package/lines/indentedTextLineComponent.js.map +1 -0
- package/lines/inputArrowsComponent.d.ts +13 -0
- package/lines/inputArrowsComponent.js +38 -0
- package/lines/inputArrowsComponent.js.map +1 -0
- package/lines/lineContainerComponent.d.ts +19 -0
- package/lines/lineContainerComponent.js +50 -0
- package/lines/lineContainerComponent.js.map +1 -0
- package/lines/linkButtonComponent.d.ts +16 -0
- package/lines/linkButtonComponent.js +21 -0
- package/lines/linkButtonComponent.js.map +1 -0
- package/lines/matrixLineComponent.d.ts +36 -0
- package/lines/matrixLineComponent.js +103 -0
- package/lines/matrixLineComponent.js.map +1 -0
- package/lines/messageLineComponent.d.ts +12 -0
- package/lines/messageLineComponent.js +15 -0
- package/lines/messageLineComponent.js.map +1 -0
- package/lines/numericInputComponent.d.ts +31 -0
- package/lines/numericInputComponent.js +86 -0
- package/lines/numericInputComponent.js.map +1 -0
- package/lines/optionsLineComponent.d.ts +48 -0
- package/lines/optionsLineComponent.js +119 -0
- package/lines/optionsLineComponent.js.map +1 -0
- package/lines/popup.d.ts +4 -0
- package/lines/popup.js +68 -0
- package/lines/popup.js.map +1 -0
- package/lines/radioLineComponent.d.ts +21 -0
- package/lines/radioLineComponent.js +27 -0
- package/lines/radioLineComponent.js.map +1 -0
- package/lines/sliderLineComponent.d.ts +37 -0
- package/lines/sliderLineComponent.js +90 -0
- package/lines/sliderLineComponent.js.map +1 -0
- package/lines/targetsProxy.d.ts +11 -0
- package/lines/targetsProxy.js +43 -0
- package/lines/targetsProxy.js.map +1 -0
- package/lines/textInputLineComponent.d.ts +47 -0
- package/lines/textInputLineComponent.js +155 -0
- package/lines/textInputLineComponent.js.map +1 -0
- package/lines/textLineComponent.d.ts +21 -0
- package/lines/textLineComponent.js +31 -0
- package/lines/textLineComponent.js.map +1 -0
- package/lines/unitButton.d.ts +8 -0
- package/lines/unitButton.js +8 -0
- package/lines/unitButton.js.map +1 -0
- package/lines/valueLineComponent.d.ts +15 -0
- package/lines/valueLineComponent.js +13 -0
- package/lines/valueLineComponent.js.map +1 -0
- package/lines/vector2LineComponent.d.ts +36 -0
- package/lines/vector2LineComponent.js +64 -0
- package/lines/vector2LineComponent.js.map +1 -0
- package/lines/vector3LineComponent.d.ts +41 -0
- package/lines/vector3LineComponent.js +75 -0
- package/lines/vector3LineComponent.js.map +1 -0
- package/lines/vector4LineComponent.d.ts +42 -0
- package/lines/vector4LineComponent.js +82 -0
- package/lines/vector4LineComponent.js.map +1 -0
- package/nodeGraphSystem/displayLedger.d.ts +5 -0
- package/nodeGraphSystem/displayLedger.js +4 -0
- package/nodeGraphSystem/displayLedger.js.map +1 -0
- package/nodeGraphSystem/frameNodePort.d.ts +25 -0
- package/nodeGraphSystem/frameNodePort.js +60 -0
- package/nodeGraphSystem/frameNodePort.js.map +1 -0
- package/nodeGraphSystem/graphCanvas.d.ts +111 -0
- package/nodeGraphSystem/graphCanvas.js +1132 -0
- package/nodeGraphSystem/graphCanvas.js.map +1 -0
- package/nodeGraphSystem/graphFrame.d.ts +153 -0
- package/nodeGraphSystem/graphFrame.js +1329 -0
- package/nodeGraphSystem/graphFrame.js.map +1 -0
- package/nodeGraphSystem/graphNode.d.ts +79 -0
- package/nodeGraphSystem/graphNode.js +460 -0
- package/nodeGraphSystem/graphNode.js.map +1 -0
- package/nodeGraphSystem/interfaces/displayManager.d.ts +13 -0
- package/nodeGraphSystem/interfaces/displayManager.js +2 -0
- package/nodeGraphSystem/interfaces/displayManager.js.map +1 -0
- package/nodeGraphSystem/interfaces/nodeContainer.d.ts +6 -0
- package/nodeGraphSystem/interfaces/nodeContainer.js +2 -0
- package/nodeGraphSystem/interfaces/nodeContainer.js.map +1 -0
- package/nodeGraphSystem/interfaces/nodeData.d.ts +15 -0
- package/nodeGraphSystem/interfaces/nodeData.js +2 -0
- package/nodeGraphSystem/interfaces/nodeData.js.map +1 -0
- package/nodeGraphSystem/interfaces/nodeLocationInfo.d.ts +26 -0
- package/nodeGraphSystem/interfaces/nodeLocationInfo.js +2 -0
- package/nodeGraphSystem/interfaces/nodeLocationInfo.js.map +1 -0
- package/nodeGraphSystem/interfaces/portData.d.ts +28 -0
- package/nodeGraphSystem/interfaces/portData.js +8 -0
- package/nodeGraphSystem/interfaces/portData.js.map +1 -0
- package/nodeGraphSystem/interfaces/propertyComponentProps.d.ts +6 -0
- package/nodeGraphSystem/interfaces/propertyComponentProps.js +2 -0
- package/nodeGraphSystem/interfaces/propertyComponentProps.js.map +1 -0
- package/nodeGraphSystem/interfaces/selectionChangedOptions.d.ts +11 -0
- package/nodeGraphSystem/interfaces/selectionChangedOptions.js +2 -0
- package/nodeGraphSystem/interfaces/selectionChangedOptions.js.map +1 -0
- package/nodeGraphSystem/nodeLink.d.ts +31 -0
- package/nodeGraphSystem/nodeLink.js +183 -0
- package/nodeGraphSystem/nodeLink.js.map +1 -0
- package/nodeGraphSystem/nodePort.d.ts +35 -0
- package/nodeGraphSystem/nodePort.js +129 -0
- package/nodeGraphSystem/nodePort.js.map +1 -0
- package/nodeGraphSystem/propertyLedger.d.ts +8 -0
- package/nodeGraphSystem/propertyLedger.js +4 -0
- package/nodeGraphSystem/propertyLedger.js.map +1 -0
- package/nodeGraphSystem/stateManager.d.ts +45 -0
- package/nodeGraphSystem/stateManager.js +19 -0
- package/nodeGraphSystem/stateManager.js.map +1 -0
- package/nodeGraphSystem/tools.d.ts +5 -0
- package/nodeGraphSystem/tools.js +37 -0
- package/nodeGraphSystem/tools.js.map +1 -0
- package/nodeGraphSystem/typeLedger.d.ts +8 -0
- package/nodeGraphSystem/typeLedger.js +3 -0
- package/nodeGraphSystem/typeLedger.js.map +1 -0
- package/nodeGraphSystem/types/framePortData.d.ts +7 -0
- package/nodeGraphSystem/types/framePortData.js +2 -0
- package/nodeGraphSystem/types/framePortData.js.map +1 -0
- package/package.json +55 -0
- package/propertyChangedEvent.d.ts +7 -0
- package/propertyChangedEvent.js +3 -0
- package/propertyChangedEvent.js.map +1 -0
- package/readme.md +6 -0
- package/stories/Button.stories.d.ts +10 -0
- package/stories/Button.stories.js +20 -0
- package/stories/Button.stories.js.map +1 -0
- package/stories/Icon.stories.d.ts +9 -0
- package/stories/Icon.stories.js +17 -0
- package/stories/Icon.stories.js.map +1 -0
- package/stories/Label.stories.d.ts +8 -0
- package/stories/Label.stories.js +11 -0
- package/stories/Label.stories.js.map +1 -0
- package/stories/MessageDialog.stories.d.ts +9 -0
- package/stories/MessageDialog.stories.js +20 -0
- package/stories/MessageDialog.stories.js.map +1 -0
- package/stories/Toggle.stories.d.ts +9 -0
- package/stories/Toggle.stories.js +18 -0
- package/stories/Toggle.stories.js.map +1 -0
- package/stories/bars/CommandBarComponent.stories.d.ts +11 -0
- package/stories/bars/CommandBarComponent.stories.js +13 -0
- package/stories/bars/CommandBarComponent.stories.js.map +1 -0
- package/stories/bars/CommandButtonComponent.stories.d.ts +6 -0
- package/stories/bars/CommandButtonComponent.stories.js +7 -0
- package/stories/bars/CommandButtonComponent.stories.js.map +1 -0
- package/stories/colorPicker/ColorPicker.stories.d.ts +11 -0
- package/stories/colorPicker/ColorPicker.stories.js +5 -0
- package/stories/colorPicker/ColorPicker.stories.js.map +1 -0
- package/stories/lines/ColorLineComponent.stories.d.ts +21 -0
- package/stories/lines/ColorLineComponent.stories.js +10 -0
- package/stories/lines/ColorLineComponent.stories.js.map +1 -0
- package/stories/lines/ColorPickerLineComponent.stories.d.ts +14 -0
- package/stories/lines/ColorPickerLineComponent.stories.js +11 -0
- package/stories/lines/ColorPickerLineComponent.stories.js.map +1 -0
- package/stories/lines/FileButtonLineComponent.stories.d.ts +6 -0
- package/stories/lines/FileButtonLineComponent.stories.js +6 -0
- package/stories/lines/FileButtonLineComponent.stories.js.map +1 -0
- package/stories/lines/NumericInputComponent.stories.d.ts +11 -0
- package/stories/lines/NumericInputComponent.stories.js +6 -0
- package/stories/lines/NumericInputComponent.stories.js.map +1 -0
- package/stringTools.d.ts +11 -0
- package/stringTools.js +89 -0
- package/stringTools.js.map +1 -0
- package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js +16 -0
- package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js +15 -0
- package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.d.ts +17 -0
- package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js +56 -0
- package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/controlPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/controlPropertyGridComponent.js +13 -0
- package/tabs/propertyGrids/gui/controlPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js +16 -0
- package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/gridPropertyGridComponent.d.ts +17 -0
- package/tabs/propertyGrids/gui/gridPropertyGridComponent.js +39 -0
- package/tabs/propertyGrids/gui/gridPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js +17 -0
- package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/imagePropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/imagePropertyGridComponent.js +26 -0
- package/tabs/propertyGrids/gui/imagePropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js +18 -0
- package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/linePropertyGridComponent.d.ts +16 -0
- package/tabs/propertyGrids/gui/linePropertyGridComponent.js +28 -0
- package/tabs/propertyGrids/gui/linePropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js +18 -0
- package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js +16 -0
- package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js +16 -0
- package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/sliderPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/sliderPropertyGridComponent.js +17 -0
- package/tabs/propertyGrids/gui/sliderPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js +15 -0
- package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.d.ts +15 -0
- package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js +35 -0
- package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js.map +1 -0
- package/tabs/propertyGrids/lockObject.d.ts +9 -0
- package/tabs/propertyGrids/lockObject.js +12 -0
- package/tabs/propertyGrids/lockObject.js.map +1 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import type { Vector4 } from "@babylonjs/core/Maths/math.vector.js";
|
3
|
+
import type { Observable } from "@babylonjs/core/Misc/observable.js";
|
4
|
+
import type { PropertyChangedEvent } from "../propertyChangedEvent";
|
5
|
+
import type { LockObject } from "../tabs/propertyGrids/lockObject";
|
6
|
+
interface IVector4LineComponentProps {
|
7
|
+
label: string;
|
8
|
+
target?: any;
|
9
|
+
propertyName?: string;
|
10
|
+
step?: number;
|
11
|
+
onChange?: (newvalue: Vector4) => void;
|
12
|
+
useEuler?: boolean;
|
13
|
+
onPropertyChangedObservable?: Observable<PropertyChangedEvent>;
|
14
|
+
icon?: string;
|
15
|
+
iconLabel?: string;
|
16
|
+
value?: Vector4;
|
17
|
+
lockObject: LockObject;
|
18
|
+
}
|
19
|
+
export declare class Vector4LineComponent extends React.Component<IVector4LineComponentProps, {
|
20
|
+
isExpanded: boolean;
|
21
|
+
value: Vector4;
|
22
|
+
}> {
|
23
|
+
static defaultProps: {
|
24
|
+
step: number;
|
25
|
+
};
|
26
|
+
private _localChange;
|
27
|
+
constructor(props: IVector4LineComponentProps);
|
28
|
+
getCurrentValue(): any;
|
29
|
+
shouldComponentUpdate(nextProps: IVector4LineComponentProps, nextState: {
|
30
|
+
isExpanded: boolean;
|
31
|
+
value: Vector4;
|
32
|
+
}): boolean;
|
33
|
+
switchExpandState(): void;
|
34
|
+
raiseOnPropertyChanged(previousValue: Vector4): void;
|
35
|
+
updateVector4(): void;
|
36
|
+
updateStateX(value: number): void;
|
37
|
+
updateStateY(value: number): void;
|
38
|
+
updateStateZ(value: number): void;
|
39
|
+
updateStateW(value: number): void;
|
40
|
+
render(): JSX.Element;
|
41
|
+
}
|
42
|
+
export {};
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import * as React from "react";
|
3
|
+
import { NumericInputComponent } from "./numericInputComponent.js";
|
4
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
5
|
+
import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";
|
6
|
+
export class Vector4LineComponent extends React.Component {
|
7
|
+
constructor(props) {
|
8
|
+
super(props);
|
9
|
+
this._localChange = false;
|
10
|
+
this.state = { isExpanded: false, value: this.getCurrentValue().clone() };
|
11
|
+
}
|
12
|
+
getCurrentValue() {
|
13
|
+
return this.props.value || this.props.target[this.props.propertyName];
|
14
|
+
}
|
15
|
+
shouldComponentUpdate(nextProps, nextState) {
|
16
|
+
const nextPropsValue = this.getCurrentValue();
|
17
|
+
if (!nextPropsValue.equals(nextState.value) || this._localChange) {
|
18
|
+
nextState.value = nextPropsValue.clone();
|
19
|
+
this._localChange = false;
|
20
|
+
return true;
|
21
|
+
}
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
switchExpandState() {
|
25
|
+
this._localChange = true;
|
26
|
+
this.setState({ isExpanded: !this.state.isExpanded });
|
27
|
+
}
|
28
|
+
raiseOnPropertyChanged(previousValue) {
|
29
|
+
if (this.props.onChange) {
|
30
|
+
this.props.onChange(this.state.value);
|
31
|
+
}
|
32
|
+
if (!this.props.onPropertyChangedObservable) {
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
this.props.onPropertyChangedObservable.notifyObservers({
|
36
|
+
object: this.props.target,
|
37
|
+
property: this.props.propertyName || "",
|
38
|
+
value: this.state.value,
|
39
|
+
initialValue: previousValue,
|
40
|
+
});
|
41
|
+
}
|
42
|
+
updateVector4() {
|
43
|
+
const store = this.getCurrentValue().clone();
|
44
|
+
if (this.props.value) {
|
45
|
+
this.props.value.copyFrom(this.state.value);
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
this.props.target[this.props.propertyName] = this.state.value;
|
49
|
+
}
|
50
|
+
this.setState({ value: store });
|
51
|
+
this.raiseOnPropertyChanged(store);
|
52
|
+
}
|
53
|
+
updateStateX(value) {
|
54
|
+
this._localChange = true;
|
55
|
+
this.state.value.x = value;
|
56
|
+
this.updateVector4();
|
57
|
+
}
|
58
|
+
updateStateY(value) {
|
59
|
+
this._localChange = true;
|
60
|
+
this.state.value.y = value;
|
61
|
+
this.updateVector4();
|
62
|
+
}
|
63
|
+
updateStateZ(value) {
|
64
|
+
this._localChange = true;
|
65
|
+
this.state.value.z = value;
|
66
|
+
this.updateVector4();
|
67
|
+
}
|
68
|
+
updateStateW(value) {
|
69
|
+
this._localChange = true;
|
70
|
+
this.state.value.w = value;
|
71
|
+
this.updateVector4();
|
72
|
+
}
|
73
|
+
render() {
|
74
|
+
const chevron = this.state.isExpanded ? _jsx(FontAwesomeIcon, { icon: faMinus }) : _jsx(FontAwesomeIcon, { icon: faPlus });
|
75
|
+
return (_jsxs("div", { className: "vector3Line", children: [_jsxs("div", { className: "firstLine", children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), _jsx("div", { className: "label", title: this.props.label, children: this.props.label }), _jsx("div", { className: "vector", children: `X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}, W: ${this.state.value.w.toFixed(2)}` }), _jsx("div", { className: "expand hoverIcon", onClick: () => this.switchExpandState(), title: "Expand", children: chevron })] }), _jsxs("div", { className: "secondLine", children: [_jsx(NumericInputComponent, { lockObject: this.props.lockObject, label: "x", step: this.props.step, value: this.state.value.x, onChange: (value) => this.updateStateX(value) }), _jsx(NumericInputComponent, { lockObject: this.props.lockObject, label: "y", step: this.props.step, value: this.state.value.y, onChange: (value) => this.updateStateY(value) }), _jsx(NumericInputComponent, { lockObject: this.props.lockObject, label: "z", step: this.props.step, value: this.state.value.z, onChange: (value) => this.updateStateZ(value) }), _jsx(NumericInputComponent, { lockObject: this.props.lockObject, label: "w", step: this.props.step, value: this.state.value.w, onChange: (value) => this.updateStateW(value) })] })] }));
|
76
|
+
}
|
77
|
+
}
|
78
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
79
|
+
Vector4LineComponent.defaultProps = {
|
80
|
+
step: 0.001, // cm
|
81
|
+
};
|
82
|
+
//# sourceMappingURL=vector4LineComponent.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"vector4LineComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/lines/vector4LineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAkBpE,MAAM,OAAO,oBAAqB,SAAQ,KAAK,CAAC,SAA8E;IAQ1H,YAAY,KAAiC;QACzC,KAAK,CAAC,KAAK,CAAC,CAAC;QAHT,iBAAY,GAAG,KAAK,CAAC;QAKzB,IAAI,CAAC,KAAK,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,K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\r\nimport type { Observable } from \"core/Misc/observable\";\r\n\r\nimport { NumericInputComponent } from \"./numericInputComponent\";\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faMinus, faPlus } from \"@fortawesome/free-solid-svg-icons\";\r\nimport type { PropertyChangedEvent } from \"../propertyChangedEvent\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\ninterface IVector4LineComponentProps {\r\n label: string;\r\n target?: any;\r\n propertyName?: string;\r\n step?: number;\r\n onChange?: (newvalue: Vector4) => void;\r\n useEuler?: boolean;\r\n onPropertyChangedObservable?: Observable<PropertyChangedEvent>;\r\n icon?: string;\r\n iconLabel?: string;\r\n value?: Vector4;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class Vector4LineComponent extends React.Component<IVector4LineComponentProps, { isExpanded: boolean; value: Vector4 }> {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n static defaultProps = {\r\n step: 0.001, // cm\r\n };\r\n\r\n private _localChange = false;\r\n\r\n constructor(props: IVector4LineComponentProps) {\r\n super(props);\r\n\r\n this.state = { isExpanded: false, value: this.getCurrentValue().clone() };\r\n }\r\n\r\n getCurrentValue() {\r\n return this.props.value || this.props.target[this.props.propertyName!];\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IVector4LineComponentProps, nextState: { isExpanded: boolean; value: Vector4 }) {\r\n const nextPropsValue = this.getCurrentValue();\r\n\r\n if (!nextPropsValue.equals(nextState.value) || this._localChange) {\r\n nextState.value = nextPropsValue.clone();\r\n this._localChange = false;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n switchExpandState() {\r\n this._localChange = true;\r\n this.setState({ isExpanded: !this.state.isExpanded });\r\n }\r\n\r\n raiseOnPropertyChanged(previousValue: Vector4) {\r\n if (this.props.onChange) {\r\n this.props.onChange(this.state.value);\r\n }\r\n\r\n if (!this.props.onPropertyChangedObservable) {\r\n return;\r\n }\r\n this.props.onPropertyChangedObservable.notifyObservers({\r\n object: this.props.target,\r\n property: this.props.propertyName || \"\",\r\n value: this.state.value,\r\n initialValue: previousValue,\r\n });\r\n }\r\n\r\n updateVector4() {\r\n const store = this.getCurrentValue().clone();\r\n\r\n if (this.props.value) {\r\n this.props.value.copyFrom(this.state.value);\r\n } else {\r\n this.props.target[this.props.propertyName!] = this.state.value;\r\n }\r\n\r\n this.setState({ value: store });\r\n\r\n this.raiseOnPropertyChanged(store);\r\n }\r\n\r\n updateStateX(value: number) {\r\n this._localChange = true;\r\n\r\n this.state.value.x = value;\r\n this.updateVector4();\r\n }\r\n\r\n updateStateY(value: number) {\r\n this._localChange = true;\r\n\r\n this.state.value.y = value;\r\n this.updateVector4();\r\n }\r\n\r\n updateStateZ(value: number) {\r\n this._localChange = true;\r\n\r\n this.state.value.z = value;\r\n this.updateVector4();\r\n }\r\n\r\n updateStateW(value: number) {\r\n this._localChange = true;\r\n\r\n this.state.value.w = value;\r\n this.updateVector4();\r\n }\r\n\r\n render() {\r\n const chevron = this.state.isExpanded ? <FontAwesomeIcon icon={faMinus} /> : <FontAwesomeIcon icon={faPlus} />;\r\n\r\n return (\r\n <div className=\"vector3Line\">\r\n <div className=\"firstLine\">\r\n {this.props.icon && <img src={this.props.icon} title={this.props.iconLabel} alt={this.props.iconLabel} className=\"icon\" />}\r\n <div className=\"label\" title={this.props.label}>\r\n {this.props.label}\r\n </div>\r\n <div className=\"vector\">\r\n {`X: ${this.state.value.x.toFixed(2)}, Y: ${this.state.value.y.toFixed(2)}, Z: ${this.state.value.z.toFixed(2)}, W: ${this.state.value.w.toFixed(2)}`}\r\n </div>\r\n <div className=\"expand hoverIcon\" onClick={() => this.switchExpandState()} title=\"Expand\">\r\n {chevron}\r\n </div>\r\n </div>\r\n {\r\n <div className=\"secondLine\">\r\n <NumericInputComponent\r\n lockObject={this.props.lockObject}\r\n label=\"x\"\r\n step={this.props.step}\r\n value={this.state.value.x}\r\n onChange={(value) => this.updateStateX(value)}\r\n />\r\n <NumericInputComponent\r\n lockObject={this.props.lockObject}\r\n label=\"y\"\r\n step={this.props.step}\r\n value={this.state.value.y}\r\n onChange={(value) => this.updateStateY(value)}\r\n />\r\n <NumericInputComponent\r\n lockObject={this.props.lockObject}\r\n label=\"z\"\r\n step={this.props.step}\r\n value={this.state.value.z}\r\n onChange={(value) => this.updateStateZ(value)}\r\n />\r\n <NumericInputComponent\r\n lockObject={this.props.lockObject}\r\n label=\"w\"\r\n step={this.props.step}\r\n value={this.state.value.w}\r\n onChange={(value) => this.updateStateW(value)}\r\n />\r\n </div>\r\n }\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"displayLedger.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/nodeGraphSystem/displayLedger.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAa;;AACR,gCAAkB,GAA2B,EAAE,CAAC","sourcesContent":["export class DisplayLedger {\r\n public static RegisteredControls: { [key: string]: any } = {};\r\n}\r\n"]}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { IDisplayManager } from "./interfaces/displayManager";
|
2
|
+
import { Observable } from "@babylonjs/core/Misc/observable.js";
|
3
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
4
|
+
import type { IPortData } from "./interfaces/portData";
|
5
|
+
import { NodePort } from "./nodePort";
|
6
|
+
import type { GraphNode } from "./graphNode";
|
7
|
+
import type { FramePortPosition } from "./graphFrame";
|
8
|
+
import type { StateManager } from "./stateManager";
|
9
|
+
export declare class FrameNodePort extends NodePort {
|
10
|
+
portData: IPortData;
|
11
|
+
node: GraphNode;
|
12
|
+
private _parentFrameId;
|
13
|
+
private _isInput;
|
14
|
+
private _framePortPosition;
|
15
|
+
private _framePortId;
|
16
|
+
private _onFramePortPositionChangedObservable;
|
17
|
+
get parentFrameId(): number;
|
18
|
+
get onFramePortPositionChangedObservable(): Observable<FrameNodePort>;
|
19
|
+
get isInput(): boolean;
|
20
|
+
get framePortId(): number;
|
21
|
+
get framePortPosition(): FramePortPosition;
|
22
|
+
set framePortPosition(position: FramePortPosition);
|
23
|
+
constructor(portContainer: HTMLElement, portData: IPortData, node: GraphNode, stateManager: StateManager, isInput: boolean, framePortId: number, parentFrameId: number);
|
24
|
+
static CreateFrameNodePortElement(portData: IPortData, node: GraphNode, root: HTMLElement, displayManager: Nullable<IDisplayManager>, stateManager: StateManager, isInput: boolean, framePortId: number, parentFrameId: number): FrameNodePort;
|
25
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { Observable } from "@babylonjs/core/Misc/observable.js";
|
2
|
+
import { NodePort } from "./nodePort.js";
|
3
|
+
import { IsFramePortData } from "./tools.js";
|
4
|
+
import commonStyles from "./common.modules.scss";
|
5
|
+
export class FrameNodePort extends NodePort {
|
6
|
+
constructor(portContainer, portData, node, stateManager, isInput, framePortId, parentFrameId) {
|
7
|
+
super(portContainer, portData, node, stateManager);
|
8
|
+
this.portData = portData;
|
9
|
+
this.node = node;
|
10
|
+
this._onFramePortPositionChangedObservable = new Observable();
|
11
|
+
this._parentFrameId = parentFrameId;
|
12
|
+
this._isInput = isInput;
|
13
|
+
this._framePortId = framePortId;
|
14
|
+
this._onSelectionChangedObserver = stateManager.onSelectionChangedObservable.add((options) => {
|
15
|
+
const { selection } = options || {};
|
16
|
+
if (IsFramePortData(selection) && selection.port === this) {
|
17
|
+
this._img.classList.add(commonStyles["selected"]);
|
18
|
+
}
|
19
|
+
else {
|
20
|
+
this._img.classList.remove(commonStyles["selected"]);
|
21
|
+
}
|
22
|
+
});
|
23
|
+
this.refresh();
|
24
|
+
}
|
25
|
+
get parentFrameId() {
|
26
|
+
return this._parentFrameId;
|
27
|
+
}
|
28
|
+
get onFramePortPositionChangedObservable() {
|
29
|
+
return this._onFramePortPositionChangedObservable;
|
30
|
+
}
|
31
|
+
get isInput() {
|
32
|
+
return this._isInput;
|
33
|
+
}
|
34
|
+
get framePortId() {
|
35
|
+
return this._framePortId;
|
36
|
+
}
|
37
|
+
get framePortPosition() {
|
38
|
+
return this._framePortPosition;
|
39
|
+
}
|
40
|
+
set framePortPosition(position) {
|
41
|
+
this._framePortPosition = position;
|
42
|
+
this.onFramePortPositionChangedObservable.notifyObservers(this);
|
43
|
+
}
|
44
|
+
static CreateFrameNodePortElement(portData, node, root, displayManager, stateManager, isInput, framePortId, parentFrameId) {
|
45
|
+
const portContainer = root.ownerDocument.createElement("div");
|
46
|
+
portContainer.classList.add(commonStyles["portLine"]);
|
47
|
+
if (framePortId !== null) {
|
48
|
+
portContainer.dataset.framePortId = `${framePortId}`;
|
49
|
+
}
|
50
|
+
root.appendChild(portContainer);
|
51
|
+
if (!displayManager || displayManager.shouldDisplayPortLabels(portData)) {
|
52
|
+
const portLabel = root.ownerDocument.createElement("div");
|
53
|
+
portLabel.classList.add(commonStyles["port-label"]);
|
54
|
+
portLabel.innerHTML = portData.name;
|
55
|
+
portContainer.appendChild(portLabel);
|
56
|
+
}
|
57
|
+
return new FrameNodePort(portContainer, portData, node, stateManager, isInput, framePortId, parentFrameId);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
//# sourceMappingURL=frameNodePort.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"frameNodePort.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/nodeGraphSystem/frameNodePort.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI1C,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAEjD,MAAM,OAAO,aAAc,SAAQ,QAAQ;IAgCvC,YACI,aAA0B,EACnB,QAAmB,EACnB,IAAe,EACtB,YAA0B,EAC1B,OAAgB,EAChB,WAAmB,EACnB,aAAqB;QAErB,KAAK,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;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;IACpE,CAAC;IA6BM,MAAM,CAAC,0BAA0B,CACpC,QAAmB,EACnB,IAAe,EACf,IAAiB,EACjB,cAAyC,EACzC,YAA0B,EAC1B,OAAgB,EAChB,WAAmB,EACnB,aAAqB;QAErB,MAAM,aAAa,GAAG,IAAI,CAAC,aAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE/D,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;QACtD,IAAI,WAAW,KAAK,IAAI,EAAE;YACtB,aAAa,CAAC,OAAO,CAAC,WAAW,GAAG,GAAG,WAAW,EAAE,CAAC;SACxD;QACD,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAEhC,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE;YACrE,MAAM,SAAS,GAAG,IAAI,CAAC,aAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC3D,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;YAEpD,SAAS,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC;YACpC,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;SACxC;QAED,OAAO,IAAI,aAAa,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAC/G,CAAC;CACJ","sourcesContent":["import type { IDisplayManager } from \"./interfaces/displayManager\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { IPortData } from \"./interfaces/portData\";\r\nimport { NodePort } from \"./nodePort\";\r\nimport type { GraphNode } from \"./graphNode\";\r\nimport { IsFramePortData } from \"./tools\";\r\nimport type { FramePortPosition } from \"./graphFrame\";\r\nimport type { StateManager } from \"./stateManager\";\r\nimport type { FramePortData } from \"./types/framePortData\";\r\nimport commonStyles from \"./common.modules.scss\";\r\n\r\nexport class FrameNodePort extends NodePort {\r\n private _parentFrameId: number;\r\n private _isInput: boolean;\r\n private _framePortPosition: FramePortPosition;\r\n private _framePortId: number;\r\n private _onFramePortPositionChangedObservable = new Observable<FrameNodePort>();\r\n\r\n public get parentFrameId() {\r\n return this._parentFrameId;\r\n }\r\n\r\n public get onFramePortPositionChangedObservable() {\r\n return this._onFramePortPositionChangedObservable;\r\n }\r\n\r\n public get isInput() {\r\n return this._isInput;\r\n }\r\n\r\n public get framePortId() {\r\n return this._framePortId;\r\n }\r\n\r\n public get framePortPosition() {\r\n return this._framePortPosition;\r\n }\r\n\r\n public set framePortPosition(position: FramePortPosition) {\r\n this._framePortPosition = position;\r\n this.onFramePortPositionChangedObservable.notifyObservers(this);\r\n }\r\n\r\n public constructor(\r\n portContainer: HTMLElement,\r\n public portData: IPortData,\r\n public node: GraphNode,\r\n stateManager: StateManager,\r\n isInput: boolean,\r\n framePortId: number,\r\n parentFrameId: number\r\n ) {\r\n super(portContainer, portData, node, stateManager);\r\n\r\n this._parentFrameId = parentFrameId;\r\n this._isInput = isInput;\r\n this._framePortId = framePortId;\r\n\r\n this._onSelectionChangedObserver = stateManager.onSelectionChangedObservable.add((options) => {\r\n const { selection } = options || {};\r\n if (IsFramePortData(selection) && (selection as FramePortData).port === this) {\r\n this._img.classList.add(commonStyles[\"selected\"]);\r\n } else {\r\n this._img.classList.remove(commonStyles[\"selected\"]);\r\n }\r\n });\r\n\r\n this.refresh();\r\n }\r\n\r\n public static CreateFrameNodePortElement(\r\n portData: IPortData,\r\n node: GraphNode,\r\n root: HTMLElement,\r\n displayManager: Nullable<IDisplayManager>,\r\n stateManager: StateManager,\r\n isInput: boolean,\r\n framePortId: number,\r\n parentFrameId: number\r\n ) {\r\n const portContainer = root.ownerDocument!.createElement(\"div\");\r\n\r\n portContainer.classList.add(commonStyles[\"portLine\"]);\r\n if (framePortId !== null) {\r\n portContainer.dataset.framePortId = `${framePortId}`;\r\n }\r\n root.appendChild(portContainer);\r\n\r\n if (!displayManager || displayManager.shouldDisplayPortLabels(portData)) {\r\n const portLabel = root.ownerDocument!.createElement(\"div\");\r\n portLabel.classList.add(commonStyles[\"port-label\"]);\r\n\r\n portLabel.innerHTML = portData.name;\r\n portContainer.appendChild(portLabel);\r\n }\r\n\r\n return new FrameNodePort(portContainer, portData, node, stateManager, isInput, framePortId, parentFrameId);\r\n }\r\n}\r\n"]}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
import { GraphNode } from "./graphNode";
|
3
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
4
|
+
import { NodeLink } from "./nodeLink";
|
5
|
+
import { NodePort } from "./nodePort";
|
6
|
+
import { GraphFrame } from "./graphFrame";
|
7
|
+
import type { IEditorData, IFrameData } from "./interfaces/nodeLocationInfo";
|
8
|
+
import type { StateManager } from "./stateManager";
|
9
|
+
import type { INodeData } from "./interfaces/nodeData";
|
10
|
+
import type { IPortData } from "./interfaces/portData";
|
11
|
+
import type { INodeContainer } from "./interfaces/nodeContainer";
|
12
|
+
export interface IGraphCanvasComponentProps {
|
13
|
+
stateManager: StateManager;
|
14
|
+
onEmitNewNode: (nodeData: INodeData) => GraphNode;
|
15
|
+
}
|
16
|
+
export declare class GraphCanvasComponent extends React.Component<IGraphCanvasComponentProps> implements INodeContainer {
|
17
|
+
static readonly NodeWidth = 100;
|
18
|
+
private readonly _minZoom;
|
19
|
+
private readonly _maxZoom;
|
20
|
+
private _hostCanvas;
|
21
|
+
private _graphCanvas;
|
22
|
+
private _selectionContainer;
|
23
|
+
private _frameContainer;
|
24
|
+
private _svgCanvas;
|
25
|
+
private _rootContainer;
|
26
|
+
private _nodes;
|
27
|
+
private _links;
|
28
|
+
private _mouseStartPointX;
|
29
|
+
private _mouseStartPointY;
|
30
|
+
private _dropPointX;
|
31
|
+
private _dropPointY;
|
32
|
+
private _selectionStartX;
|
33
|
+
private _selectionStartY;
|
34
|
+
private _candidateLinkedHasMoved;
|
35
|
+
private _x;
|
36
|
+
private _y;
|
37
|
+
private _zoom;
|
38
|
+
private _selectedNodes;
|
39
|
+
private _selectedLink;
|
40
|
+
private _selectedPort;
|
41
|
+
private _candidateLink;
|
42
|
+
private _candidatePort;
|
43
|
+
private _gridSize;
|
44
|
+
private _selectionBox;
|
45
|
+
private _selectedFrames;
|
46
|
+
private _frameCandidate;
|
47
|
+
private _frames;
|
48
|
+
private _nodeDataContentList;
|
49
|
+
private _altKeyIsPressed;
|
50
|
+
private _multiKeyIsPressed;
|
51
|
+
private _oldY;
|
52
|
+
_frameIsMoving: boolean;
|
53
|
+
_isLoading: boolean;
|
54
|
+
_targetLinkCandidate: Nullable<NodeLink>;
|
55
|
+
private _copiedNodes;
|
56
|
+
private _copiedFrames;
|
57
|
+
get gridSize(): number;
|
58
|
+
set gridSize(value: number);
|
59
|
+
get stateManager(): StateManager;
|
60
|
+
get nodes(): GraphNode[];
|
61
|
+
get links(): NodeLink[];
|
62
|
+
get frames(): GraphFrame[];
|
63
|
+
get zoom(): number;
|
64
|
+
set zoom(value: number);
|
65
|
+
get x(): number;
|
66
|
+
set x(value: number);
|
67
|
+
get y(): number;
|
68
|
+
set y(value: number);
|
69
|
+
get selectedNodes(): GraphNode[];
|
70
|
+
get selectedLink(): Nullable<NodeLink>;
|
71
|
+
get selectedFrames(): GraphFrame[];
|
72
|
+
get selectedPort(): Nullable<NodePort>;
|
73
|
+
get canvasContainer(): HTMLDivElement;
|
74
|
+
get hostCanvas(): HTMLDivElement;
|
75
|
+
get svgCanvas(): HTMLElement;
|
76
|
+
get selectionContainer(): HTMLDivElement;
|
77
|
+
get frameContainer(): HTMLDivElement;
|
78
|
+
private _selectedFrameAndNodesConflict;
|
79
|
+
constructor(props: IGraphCanvasComponentProps);
|
80
|
+
populateConnectedEntriesBeforeRemoval(item: GraphNode, items: GraphNode[], inputs: Nullable<IPortData>[], outputs: Nullable<IPortData>[]): void;
|
81
|
+
automaticRewire(inputs: Nullable<IPortData>[], outputs: Nullable<IPortData>[], firstOnly?: boolean): void;
|
82
|
+
handleKeyDown(evt: KeyboardEvent, onRemove: (nodeData: INodeData) => void, mouseLocationX: number, mouseLocationY: number, dataGenerator: (nodeData: INodeData) => any, rootElement: HTMLDivElement): void;
|
83
|
+
pasteSelection(copiedNodes: GraphNode[], currentX: number, currentY: number, dataGenerator: (nodeData: INodeData) => any, selectNew?: boolean): GraphNode[];
|
84
|
+
reconnectNewNodes(nodeIndex: number, newNodes: GraphNode[], sourceNodes: GraphNode[], done: boolean[]): void;
|
85
|
+
getCachedData(): any[];
|
86
|
+
removeDataFromCache(data: any): void;
|
87
|
+
createNodeFromObject(nodeData: INodeData, onNodeCreated: (data: any) => void, recursion?: boolean): GraphNode;
|
88
|
+
getGridPosition(position: number, useCeil?: boolean): number;
|
89
|
+
getGridPositionCeil(position: number): number;
|
90
|
+
updateTransform(): void;
|
91
|
+
onKeyUp(): void;
|
92
|
+
findNodeFromData(data: any): GraphNode;
|
93
|
+
reset(): void;
|
94
|
+
connectPorts(pointA: IPortData, pointB: IPortData): void;
|
95
|
+
removeLink(link: NodeLink): void;
|
96
|
+
appendNode(nodeData: INodeData): GraphNode;
|
97
|
+
distributeGraph(): void;
|
98
|
+
componentDidMount(): void;
|
99
|
+
onMove(evt: React.PointerEvent): void;
|
100
|
+
onDown(evt: React.PointerEvent<HTMLElement>): void;
|
101
|
+
onUp(evt: React.PointerEvent): void;
|
102
|
+
onWheel(evt: React.WheelEvent): void;
|
103
|
+
zoomToFit(): void;
|
104
|
+
processCandidatePort(): void;
|
105
|
+
connectNodes(nodeA: GraphNode, pointA: IPortData, nodeB: GraphNode, pointB: IPortData): void;
|
106
|
+
drop(newNode: GraphNode, targetX: number, targetY: number, offsetX: number, offsetY: number): void;
|
107
|
+
processEditorData(editorData: IEditorData): void;
|
108
|
+
reOrganize(editorData?: Nullable<IEditorData>, isImportingAFrame?: boolean): void;
|
109
|
+
addFrame(frameData: IFrameData): void;
|
110
|
+
render(): JSX.Element;
|
111
|
+
}
|