@babylonjs/inspector 5.0.0-rc.3 → 5.0.0-rc.4
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.
@@ -65310,28 +65310,19 @@ var ColorLineComponent = /** @class */ (function (_super) {
|
|
65310
65310
|
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ColorLineComponent, _super);
|
65311
65311
|
function ColorLineComponent(props) {
|
65312
65312
|
var _this = _super.call(this, props) || this;
|
65313
|
-
|
65314
|
-
var color = _this.getValue();
|
65315
|
-
_this.state = { isExpanded: false, color: color, colorString: colorString };
|
65316
|
-
if (props.isLinear) {
|
65317
|
-
_this.state.color.toGammaSpaceToRef(_this.state.color);
|
65318
|
-
}
|
65313
|
+
_this.state = { isExpanded: false, color: _this.getValue() };
|
65319
65314
|
var target = _this.props.target;
|
65320
65315
|
target._isLinearColor = props.isLinear; // so that replayRecorder can append toLinearSpace() as appropriate
|
65321
65316
|
return _this;
|
65322
65317
|
}
|
65323
65318
|
ColorLineComponent.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
65324
|
-
var stateString = nextState.colorString;
|
65325
65319
|
var stateColor = nextState.color;
|
65326
|
-
var propsString = this.getValueAsString(nextProps);
|
65327
65320
|
var propsColor = this.getValue(nextProps);
|
65328
|
-
if (
|
65329
|
-
nextState.colorString = stateString;
|
65321
|
+
if (stateColor !== this.state.color) {
|
65330
65322
|
nextState.color = stateColor;
|
65331
65323
|
return true;
|
65332
65324
|
}
|
65333
|
-
if (
|
65334
|
-
nextState.colorString = propsString;
|
65325
|
+
if (propsColor !== this.state.color) {
|
65335
65326
|
nextState.color = propsColor;
|
65336
65327
|
return true;
|
65337
65328
|
}
|
@@ -65353,41 +65344,21 @@ var ColorLineComponent = /** @class */ (function (_super) {
|
|
65353
65344
|
return this.convertToColor(property);
|
65354
65345
|
}
|
65355
65346
|
else {
|
65347
|
+
if (props.isLinear) {
|
65348
|
+
return property.toGammaSpace();
|
65349
|
+
}
|
65356
65350
|
return property.clone();
|
65357
65351
|
}
|
65358
65352
|
};
|
65359
|
-
ColorLineComponent.prototype.getValueAsString = function (props) {
|
65360
|
-
if (props === void 0) { props = this.props; }
|
65361
|
-
var target = props.target;
|
65362
|
-
var property = target[props.propertyName];
|
65363
|
-
if (!property)
|
65364
|
-
return "";
|
65365
|
-
if (typeof property === "string") {
|
65366
|
-
return property;
|
65367
|
-
}
|
65368
|
-
else {
|
65369
|
-
return property.toHexString();
|
65370
|
-
}
|
65371
|
-
};
|
65372
65353
|
ColorLineComponent.prototype.setColorFromString = function (colorString) {
|
65373
|
-
if (colorString === _targetsProxy__WEBPACK_IMPORTED_MODULE_8__["conflictingValuesPlaceholder"])
|
65374
|
-
return;
|
65375
65354
|
var color = this.convertToColor(colorString);
|
65376
|
-
|
65377
|
-
color = color.toLinearSpace();
|
65378
|
-
}
|
65379
|
-
this.updateColor(color);
|
65380
|
-
this.setState({ color: color, colorString: colorString });
|
65355
|
+
this.setColor(color);
|
65381
65356
|
};
|
65382
|
-
ColorLineComponent.prototype.setColor = function (
|
65357
|
+
ColorLineComponent.prototype.setColor = function (newColor) {
|
65358
|
+
this.setState({ color: newColor.clone() });
|
65383
65359
|
if (this.props.isLinear) {
|
65384
|
-
|
65360
|
+
newColor.toLinearSpaceToRef(newColor);
|
65385
65361
|
}
|
65386
|
-
this.updateColor(color);
|
65387
|
-
var colorString = this.props.disableAlpha ? this.toColor3(color).toHexString() : color.toHexString();
|
65388
|
-
this.setState({ color: color, colorString: colorString });
|
65389
|
-
};
|
65390
|
-
ColorLineComponent.prototype.updateColor = function (newColor) {
|
65391
65362
|
// whether to set properties to color3 or color4
|
65392
65363
|
var setColor = this.props.disableAlpha ? this.toColor3(newColor) : newColor;
|
65393
65364
|
var target = this.props.target;
|
@@ -65439,14 +65410,6 @@ var ColorLineComponent = /** @class */ (function (_super) {
|
|
65439
65410
|
document.execCommand("copy");
|
65440
65411
|
element.remove();
|
65441
65412
|
};
|
65442
|
-
Object.defineProperty(ColorLineComponent.prototype, "colorString", {
|
65443
|
-
get: function () {
|
65444
|
-
return this.state.colorString;
|
65445
|
-
},
|
65446
|
-
set: function (_) { },
|
65447
|
-
enumerable: false,
|
65448
|
-
configurable: true
|
65449
|
-
});
|
65450
65413
|
ColorLineComponent.prototype.convertToColor = function (color) {
|
65451
65414
|
if (color === "" || color === "transparent") {
|
65452
65415
|
return emptyColor;
|
@@ -65481,10 +65444,10 @@ var ColorLineComponent = /** @class */ (function (_super) {
|
|
65481
65444
|
this.props.icon && react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }),
|
65482
65445
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "label", title: this.props.label }, this.props.label),
|
65483
65446
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "color3" },
|
65484
|
-
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_colorPickerComponent__WEBPACK_IMPORTED_MODULE_6__["ColorPickerLineComponent"], { linearHint: this.props.isLinear, value: this.props.disableAlpha ? this.toColor3(this.state.color) : this.state.color, onColorChanged: function (
|
65485
|
-
_this.
|
65447
|
+
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_colorPickerComponent__WEBPACK_IMPORTED_MODULE_6__["ColorPickerLineComponent"], { linearHint: this.props.isLinear, value: this.props.disableAlpha ? this.toColor3(this.state.color) : this.state.color, onColorChanged: function (colorString) {
|
65448
|
+
_this.setColorFromString(colorString);
|
65486
65449
|
} })),
|
65487
|
-
this.props.lockObject && (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__["TextInputLineComponent"], { lockObject: this.props.lockObject, label: "",
|
65450
|
+
this.props.lockObject && (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_textInputLineComponent__WEBPACK_IMPORTED_MODULE_7__["TextInputLineComponent"], { lockObject: this.props.lockObject, label: "", value: this.state.color.toHexString(), onChange: function (newValue) {
|
65488
65451
|
_this.setColorFromString(newValue);
|
65489
65452
|
}, onPropertyChangedObservable: this.props.onPropertyChangedObservable })),
|
65490
65453
|
react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", { className: "copy hoverIcon", onClick: function () { return _this.copyToClipboard(); }, title: "Copy to clipboard" },
|