Skip to content

Commit

Permalink
Update dependencies (Re-Resizable and others) (#15301)
Browse files Browse the repository at this point in the history
* Update dependencies (Re-Resizable and others)

* Fix formatting
  • Loading branch information
RaananW authored Jul 18, 2024
1 parent 17b4c6f commit b0b8e72
Show file tree
Hide file tree
Showing 22 changed files with 10,321 additions and 12,953 deletions.
23,146 changes: 10,254 additions & 12,892 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/dev/core/src/Compute/computeEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export class ComputeEffect {
* Gets the compute shader source code of this effect
*/
public get computeSourceCode(): string {
return this._computeSourceCodeOverride ? this._computeSourceCodeOverride : this._pipelineContext?._getComputeShaderCode() ?? this._computeSourceCode;
return this._computeSourceCodeOverride ? this._computeSourceCodeOverride : (this._pipelineContext?._getComputeShaderCode() ?? this._computeSourceCode);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/core/src/Engines/nativeEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ export class NativeEngine extends Engine {
this._commandBufferEncoder.encodeCommandArgAsUInt32(culling ? 1 : 0);
this._commandBufferEncoder.encodeCommandArgAsFloat32(zOffset);
this._commandBufferEncoder.encodeCommandArgAsFloat32(zOffsetUnits);
this._commandBufferEncoder.encodeCommandArgAsUInt32(this.cullBackFaces ?? cullBackFaces ?? true ? 1 : 0);
this._commandBufferEncoder.encodeCommandArgAsUInt32((this.cullBackFaces ?? cullBackFaces ?? true) ? 1 : 0);
this._commandBufferEncoder.encodeCommandArgAsUInt32(reverseSide ? 1 : 0);
this._commandBufferEncoder.finishEncodingCommand();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/core/src/Engines/thinEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ export class ThinEngine extends AbstractEngine {
}

// Cull face
const cullFace = this.cullBackFaces ?? cullBackFaces ?? true ? this._gl.BACK : this._gl.FRONT;
const cullFace = (this.cullBackFaces ?? cullBackFaces ?? true) ? this._gl.BACK : this._gl.FRONT;
if (this._depthCullingState.cullFace !== cullFace || force) {
this._depthCullingState.cullFace = cullFace;
}
Expand Down Expand Up @@ -3407,7 +3407,7 @@ export class ThinEngine extends AbstractEngine {
texture.isReady = true;
texture.type = texture.type !== -1 ? texture.type : Constants.TEXTURETYPE_UNSIGNED_BYTE;
texture.format =
texture.format !== -1 ? texture.format : format ?? (extension === ".jpg" && !texture._useSRGBBuffer ? Constants.TEXTUREFORMAT_RGB : Constants.TEXTUREFORMAT_RGBA);
texture.format !== -1 ? texture.format : (format ?? (extension === ".jpg" && !texture._useSRGBBuffer ? Constants.TEXTUREFORMAT_RGB : Constants.TEXTUREFORMAT_RGBA));

if (
processFunction(potWidth, potHeight, img, extension, texture, () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/core/src/Engines/webgpuEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,7 @@ export class WebGPUEngine extends AbstractEngine {
texture.baseHeight = imageBitmap.height;
texture.width = imageBitmap.width;
texture.height = imageBitmap.height;
texture.format = texture.format !== -1 ? texture.format : format ?? Constants.TEXTUREFORMAT_RGBA;
texture.format = texture.format !== -1 ? texture.format : (format ?? Constants.TEXTUREFORMAT_RGBA);
texture.type = texture.type !== -1 ? texture.type : Constants.TEXTURETYPE_UNSIGNED_BYTE;
texture._creationFlags = creationFlags ?? 0;

Expand Down Expand Up @@ -3632,7 +3632,7 @@ export class WebGPUEngine extends AbstractEngine {
}

// Cull face
const cullFace = this.cullBackFaces ?? cullBackFaces ?? true ? 1 : 2;
const cullFace = (this.cullBackFaces ?? cullBackFaces ?? true) ? 1 : 2;
if (this._depthCullingState.cullFace !== cullFace || force) {
this._depthCullingState.cullFace = cullFace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ export class ClipPlanesBlock extends NodeMaterialBlock {
public override prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines) {
const scene = mesh.getScene();

const useClipPlane1 = nodeMaterial.clipPlane ?? scene.clipPlane ? true : false;
const useClipPlane2 = nodeMaterial.clipPlane2 ?? scene.clipPlane2 ? true : false;
const useClipPlane3 = nodeMaterial.clipPlane3 ?? scene.clipPlane3 ? true : false;
const useClipPlane4 = nodeMaterial.clipPlane4 ?? scene.clipPlane4 ? true : false;
const useClipPlane5 = nodeMaterial.clipPlane5 ?? scene.clipPlane5 ? true : false;
const useClipPlane6 = nodeMaterial.clipPlane6 ?? scene.clipPlane6 ? true : false;
const useClipPlane1 = (nodeMaterial.clipPlane ?? scene.clipPlane) ? true : false;
const useClipPlane2 = (nodeMaterial.clipPlane2 ?? scene.clipPlane2) ? true : false;
const useClipPlane3 = (nodeMaterial.clipPlane3 ?? scene.clipPlane3) ? true : false;
const useClipPlane4 = (nodeMaterial.clipPlane4 ?? scene.clipPlane4) ? true : false;
const useClipPlane5 = (nodeMaterial.clipPlane5 ?? scene.clipPlane5) ? true : false;
const useClipPlane6 = (nodeMaterial.clipPlane6 ?? scene.clipPlane6) ? true : false;

defines.setValue("CLIPPLANE", useClipPlane1, true);
defines.setValue("CLIPPLANE2", useClipPlane2, true);
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/core/src/Materials/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ export class Effect implements IDisposable {
public get vertexSourceCode(): string {
return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride
? this._vertexSourceCodeOverride
: this._pipelineContext?._getVertexShaderCode() ?? this._vertexSourceCode;
: (this._pipelineContext?._getVertexShaderCode() ?? this._vertexSourceCode);
}

/**
Expand All @@ -604,7 +604,7 @@ export class Effect implements IDisposable {
public get fragmentSourceCode(): string {
return this._vertexSourceCodeOverride && this._fragmentSourceCodeOverride
? this._fragmentSourceCodeOverride
: this._pipelineContext?._getFragmentShaderCode() ?? this._fragmentSourceCode;
: (this._pipelineContext?._getFragmentShaderCode() ?? this._fragmentSourceCode);
}

/**
Expand Down
24 changes: 12 additions & 12 deletions packages/dev/core/src/Meshes/Builders/decalBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,21 +201,21 @@ export function CreateDecal(
weights[3] /= sumw;
}

const v0LocalPositionX = v0.localPositionOverride ? v0.localPositionOverride[0] : localPositions?.[v0.vertexIdx] ?? 0;
const v0LocalPositionY = v0.localPositionOverride ? v0.localPositionOverride[1] : localPositions?.[v0.vertexIdx + 1] ?? 0;
const v0LocalPositionZ = v0.localPositionOverride ? v0.localPositionOverride[2] : localPositions?.[v0.vertexIdx + 2] ?? 0;
const v0LocalPositionX = v0.localPositionOverride ? v0.localPositionOverride[0] : (localPositions?.[v0.vertexIdx] ?? 0);
const v0LocalPositionY = v0.localPositionOverride ? v0.localPositionOverride[1] : (localPositions?.[v0.vertexIdx + 1] ?? 0);
const v0LocalPositionZ = v0.localPositionOverride ? v0.localPositionOverride[2] : (localPositions?.[v0.vertexIdx + 2] ?? 0);

const v1LocalPositionX = v1.localPositionOverride ? v1.localPositionOverride[0] : localPositions?.[v1.vertexIdx] ?? 0;
const v1LocalPositionY = v1.localPositionOverride ? v1.localPositionOverride[1] : localPositions?.[v1.vertexIdx + 1] ?? 0;
const v1LocalPositionZ = v1.localPositionOverride ? v1.localPositionOverride[2] : localPositions?.[v1.vertexIdx + 2] ?? 0;
const v1LocalPositionX = v1.localPositionOverride ? v1.localPositionOverride[0] : (localPositions?.[v1.vertexIdx] ?? 0);
const v1LocalPositionY = v1.localPositionOverride ? v1.localPositionOverride[1] : (localPositions?.[v1.vertexIdx + 1] ?? 0);
const v1LocalPositionZ = v1.localPositionOverride ? v1.localPositionOverride[2] : (localPositions?.[v1.vertexIdx + 2] ?? 0);

const v0LocalNormalX = v0.localNormalOverride ? v0.localNormalOverride[0] : localNormals?.[v0.vertexIdx] ?? 0;
const v0LocalNormalY = v0.localNormalOverride ? v0.localNormalOverride[1] : localNormals?.[v0.vertexIdx + 1] ?? 0;
const v0LocalNormalZ = v0.localNormalOverride ? v0.localNormalOverride[2] : localNormals?.[v0.vertexIdx + 2] ?? 0;
const v0LocalNormalX = v0.localNormalOverride ? v0.localNormalOverride[0] : (localNormals?.[v0.vertexIdx] ?? 0);
const v0LocalNormalY = v0.localNormalOverride ? v0.localNormalOverride[1] : (localNormals?.[v0.vertexIdx + 1] ?? 0);
const v0LocalNormalZ = v0.localNormalOverride ? v0.localNormalOverride[2] : (localNormals?.[v0.vertexIdx + 2] ?? 0);

const v1LocalNormalX = v1.localNormalOverride ? v1.localNormalOverride[0] : localNormals?.[v1.vertexIdx] ?? 0;
const v1LocalNormalY = v1.localNormalOverride ? v1.localNormalOverride[1] : localNormals?.[v1.vertexIdx + 1] ?? 0;
const v1LocalNormalZ = v1.localNormalOverride ? v1.localNormalOverride[2] : localNormals?.[v1.vertexIdx + 2] ?? 0;
const v1LocalNormalX = v1.localNormalOverride ? v1.localNormalOverride[0] : (localNormals?.[v1.vertexIdx] ?? 0);
const v1LocalNormalY = v1.localNormalOverride ? v1.localNormalOverride[1] : (localNormals?.[v1.vertexIdx + 1] ?? 0);
const v1LocalNormalZ = v1.localNormalOverride ? v1.localNormalOverride[2] : (localNormals?.[v1.vertexIdx + 2] ?? 0);

const interpNormalX = v0LocalNormalX + (v1LocalNormalX - v0LocalNormalX) * clipFactor;
const interpNormalY = v0LocalNormalY + (v1LocalNormalY - v0LocalNormalY) * clipFactor;
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/core/src/Meshes/subMesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class SubMesh implements ICullable {
* Gets associated (main) effect (possibly the effect override if defined)
*/
public get effect(): Nullable<Effect> {
return this._mainDrawWrapperOverride ? this._mainDrawWrapperOverride.effect : this._getDrawWrapper()?.effect ?? null;
return this._mainDrawWrapperOverride ? this._mainDrawWrapperOverride.effect : (this._getDrawWrapper()?.effect ?? null);
}

/** @internal */
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/core/src/Misc/khronosTextureContainer2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export class KhronosTextureContainer2 {
} else if (typeof KTX2DECODER !== "undefined") {
KhronosTextureContainer2._KTX2DecoderModule = KTX2DECODER;
}
const numberOfWorkers = typeof numWorkersOrOptions === "number" ? numWorkersOrOptions : numWorkersOrOptions.numWorkers ?? KhronosTextureContainer2.DefaultNumWorkers;
const numberOfWorkers = typeof numWorkersOrOptions === "number" ? numWorkersOrOptions : (numWorkersOrOptions.numWorkers ?? KhronosTextureContainer2.DefaultNumWorkers);
KhronosTextureContainer2._Initialize(numberOfWorkers);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export class GIRSMManager {
const rtws = this._countersRTW[i];
for (let t = 0; t < rtws.length; ++t) {
if (t === 0) {
this._counters[i].value = this.pause ? 0 : (rtws[t] as WebGPURenderTargetWrapper).gpuTimeInFrame?.counter.lastSecAverage ?? 0;
this._counters[i].value = this.pause ? 0 : ((rtws[t] as WebGPURenderTargetWrapper).gpuTimeInFrame?.counter.lastSecAverage ?? 0);
} else if (!this.pause) {
this._counters[i].value += (rtws[t] as WebGPURenderTargetWrapper).gpuTimeInFrame?.counter.lastSecAverage ?? 0;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/core/src/Rendering/edgesRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ export class EdgesRenderer implements IEdgesRenderer {
* Find all vertices that are at the same location (with an epsilon) and remapp them on the same vertex
*/
const useFastVertexMerger = this._options?.useFastVertexMerger ?? true;
const epsVertexMerge = useFastVertexMerger ? Math.round(-Math.log(this._options?.epsilonVertexMerge ?? 1e-6) / Math.log(10)) : this._options?.epsilonVertexMerge ?? 1e-6;
const epsVertexMerge = useFastVertexMerger ? Math.round(-Math.log(this._options?.epsilonVertexMerge ?? 1e-6) / Math.log(10)) : (this._options?.epsilonVertexMerge ?? 1e-6);
const remapVertexIndices: Array<number> = [];
const uniquePositions: Array<number> = []; // list of unique index of vertices - needed for tessellation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ export class FluidRenderingTargetRenderer {
texture = this._thicknessRenderTarget?.texture ?? null;
break;
case FluidRenderingDebug.ThicknessBlurredTexture:
texture = this._thicknessRenderTarget?.enableBlur ? this._thicknessRenderTarget?.textureBlur ?? null : this._thicknessRenderTarget?.texture ?? null;
texture = this._thicknessRenderTarget?.enableBlur ? (this._thicknessRenderTarget?.textureBlur ?? null) : (this._thicknessRenderTarget?.texture ?? null);
break;
case FluidRenderingDebug.DiffuseTexture:
if (this._diffuseRenderTarget) {
Expand Down
2 changes: 1 addition & 1 deletion packages/dev/inspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/react-dom": "^17.0.10",
"gif.js.optimized": "^1.0.1",
"sass": "^1.62.1",
"re-resizable": "^4.9.1",
"re-resizable": "^6.9.1",
"react": "^17.0.2",
"react-contextmenu": "RaananW/react-contextmenu",
"react-dom": "^17.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TabsComponent } from "./tabsComponent";
import { faFileAlt, faWrench, faBug, faChartBar, faCog } from "@fortawesome/free-solid-svg-icons";
import { StatisticsTabComponent } from "./tabs/statisticsTabComponent";
import { DebugTabComponent } from "./tabs/debugTabComponent";
import Resizable from "re-resizable";
import { Resizable } from "re-resizable";
import { PropertyGridTabComponent } from "./tabs/propertyGridTabComponent";
import { HeaderComponent } from "../headerComponent";
import { ToolsTabComponent } from "./tabs/toolsTabComponent";
Expand All @@ -16,6 +16,8 @@ import { SettingsTabComponent } from "./tabs/settingsTabComponent";

import "./actionTabs.scss";

const ResizableCasted = Resizable as any as React.ComponentClass<any>;

interface IActionTabsComponentProps {
scene?: Scene;
noCommands?: boolean;
Expand Down Expand Up @@ -153,7 +155,7 @@ export class ActionTabsComponent extends React.Component<IActionTabsComponentPro
}

return (
<Resizable
<ResizableCasted
id="actionTabs"
minWidth={300}
maxWidth={600}
Expand All @@ -174,7 +176,7 @@ export class ActionTabsComponent extends React.Component<IActionTabsComponentPro
/>
)}
{this.renderContent()}
</Resizable>
</ResizableCasted>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
width: 100%;
height: 100%;
pointer-events: none;
z-index: 1;

&:focus {
outline: none;
}
z-index: 1;
}

#svg-graph-horizontal {
Expand All @@ -37,11 +37,11 @@
width: calc(100% - 40px);
height: 100%;
pointer-events: none;
z-index: 1;

&:focus {
outline: none;
}
z-index: 1;
}

#dark-rectangle {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@
}

.pixel-data {
width: 45px;
color: #afafaf;
display: flex;
justify-content: space-between;
font-size: 15px;
&:first-of-type {
margin-left: 15px;
}
&:last-of-type {
padding-right: 15px;
}
width: 45px;
color: #afafaf;
display: flex;
justify-content: space-between;
.value {
display: inline-block;
width: 30px;
color: white;
}
font-size: 15px;
}
}

Expand Down Expand Up @@ -206,6 +206,7 @@
right: 0;
width: 80px;
background: #666666;
user-select: none;
.channel {
color: white;
border-bottom: 2px solid #232323;
Expand All @@ -227,7 +228,6 @@
border-bottom: none;
}
}
user-select: none;
}

#canvas-ui {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { HeaderComponent } from "../headerComponent";
import Resizable from "re-resizable";
import { Resizable } from "re-resizable";
import { SceneExplorerComponent } from "../sceneExplorer/sceneExplorerComponent";
import { ActionTabsComponent } from "../actionTabs/actionTabsComponent";
import type { Scene } from "core/scene";
Expand All @@ -9,6 +9,8 @@ import type { IExplorerExtensibilityGroup, DebugLayerTab, IExplorerAdditionalNod

const Split = require("split.js").default;

const ResizableCasted = Resizable as any as React.ComponentClass<any>;

import "./embedHost.scss";

interface IEmbedHostComponentProps {
Expand Down Expand Up @@ -124,7 +126,7 @@ export class EmbedHostComponent extends React.Component<IEmbedHostComponentProps
}

return (
<Resizable
<ResizableCasted
id="embed"
minWidth={300}
maxWidth={600}
Expand All @@ -142,7 +144,7 @@ export class EmbedHostComponent extends React.Component<IEmbedHostComponentProps
onSelectionChangedObservable={this.props.globalState.onSelectionChangedObservable}
/>
{this.renderContent()}
</Resizable>
</ResizableCasted>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Scene } from "core/scene";
import { EngineStore } from "core/Engines/engineStore";

import { TreeItemComponent } from "./treeItemComponent";
import Resizable from "re-resizable";
import { Resizable } from "re-resizable";
import { HeaderComponent } from "../headerComponent";
import { SceneTreeItemComponent } from "./entities/sceneTreeItemComponent";
import { Tools } from "../../tools";
Expand Down Expand Up @@ -42,6 +42,8 @@ interface ISceneExplorerFilterComponentProps {
onFilter: (filter: string) => void;
}

const ResizableCasted = Resizable as any as React.ComponentClass<any>;

export class SceneExplorerFilterComponent extends React.Component<ISceneExplorerFilterComponentProps> {
constructor(props: ISceneExplorerFilterComponentProps) {
super(props);
Expand Down Expand Up @@ -732,16 +734,16 @@ export class SceneExplorerComponent extends React.Component<ISceneExplorerCompon
}

return (
<Resizable
<ResizableCasted
tabIndex={-1}
id="sceneExplorer"
ref={this._sceneExplorerRef}
size={{ height: "100%" }}
ref={this._sceneExplorerRef}
minWidth={300}
maxWidth={600}
minHeight="100%"
enable={{ top: false, right: true, bottom: false, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }}
onKeyDown={(keyEvent) => this.processKeys(keyEvent, allNodes)}
onKeyDown={(keyEvent: React.KeyboardEvent<HTMLDivElement>) => this.processKeys(keyEvent, allNodes)}
>
{!this.props.noHeader && (
<HeaderComponent
Expand All @@ -754,7 +756,7 @@ export class SceneExplorerComponent extends React.Component<ISceneExplorerCompon
/>
)}
{this.renderContent(allNodes)}
</Resizable>
</ResizableCasted>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
}

.highlighted {
animation: glow 0.5s infinite alternate;
@keyframes glow {
to {
border-color: white;
}
}
animation: glow 0.5s infinite alternate;
}

.header-container {
Expand Down
Loading

0 comments on commit b0b8e72

Please sign in to comment.