Explorar el Código

Merge pull request #7657 from sebavan/master

Fix Build
sebavan hace 5 años
padre
commit
768c2b07c9

+ 0 - 4
inspector/custom.d.ts

@@ -1,4 +0,0 @@
-declare module "*.svg" {
-    const content: string;
-    export default content;
-}

+ 2 - 2
inspector/src/components/actionTabs/lines/color3LineComponent.tsx

@@ -5,8 +5,8 @@ import { PropertyChangedEvent } from "../../propertyChangedEvent";
 import { NumericInputComponent } from "./numericInputComponent";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";
-import CopyIcon from "./copy.svg";
 
+const copyIcon: string = require("./copy.svg");
 
 export interface IColor3LineComponentProps {
     label: string;
@@ -137,7 +137,7 @@ export class Color3LineComponent extends React.Component<IColor3LineComponentPro
                         <input type="color" value={colorAsColor3.toHexString()} onChange={(evt) => this.onChange(evt.target.value)} />
                     </div>
                     <div className="copy hoverIcon" onClick={() => this.copyToClipboard()} title="Copy to clipboard">
-                        <img src={CopyIcon} alt=""/>
+                        <img src={copyIcon} alt=""/>
                     </div>
                     <div className="expand hoverIcon" onClick={() => this.switchExpandState()} title="Expand">
                         {chevron}

+ 3 - 2
inspector/src/components/actionTabs/lines/color4LineComponent.tsx

@@ -5,7 +5,8 @@ import { NumericInputComponent } from "./numericInputComponent";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";
 import { PropertyChangedEvent } from '../../propertyChangedEvent';
-import CopyIcon from "./copy.svg";
+
+const copyIcon: string = require("./copy.svg");
 
 export interface IColor4LineComponentProps {
     label: string;
@@ -155,7 +156,7 @@ export class Color4LineComponent extends React.Component<IColor4LineComponentPro
                         <input type="color" value={colorAsColor3.toHexString()} onChange={(evt) => this.onChange(evt.target.value)} />
                     </div>
                     <div className="copy hoverIcon" onClick={() => this.copyToClipboard()} title="Copy to clipboard">
-                        <img src={CopyIcon} alt=""/>
+                        <img src={copyIcon} alt=""/>
                     </div>
                     <div className="expand hoverIcon" onClick={() => this.switchExpandState()} title="Expand">
                         {chevron}

+ 1 - 4
inspector/tsconfig.json

@@ -24,8 +24,5 @@
                 "../../dist/preview release/babylon.module.d.ts"
             ]
         }
-    },
-    "files": [ 
-        "./custom.d.ts" 
-      ]  
+    }
 }

+ 0 - 4
nodeEditor/custom.d.ts

@@ -1,4 +0,0 @@
-declare module "*.svg" {
-    const content: string;
-    export default content;
-}

+ 11 - 10
nodeEditor/src/components/preview/previewAreaComponent.tsx

@@ -2,11 +2,12 @@
 import * as React from "react";
 import { GlobalState } from '../../globalState';
 import { DataStorage } from '../../dataStorage';
-import DoubleSided from './svgs/doubleSided.svg'
-import DepthPass from './svgs/depthPass.svg'
-import Omni from './svgs/omni.svg'
-import DirectionalRight from './svgs/directionalRight.svg'
-import DirectionalLeft from './svgs/directionalLeft.svg'
+
+const doubleSided: string = require("./svgs/doubleSided.svg");
+const depthPass: string = require("./svgs/depthPass.svg");
+const omni: string = require("./svgs/omni.svg");
+const directionalRight: string = require("./svgs/directionalRight.svg");
+const directionalLeft: string = require("./svgs/directionalLeft.svg");
 
 interface IPreviewAreaComponentProps {
     globalState: GlobalState;
@@ -52,12 +53,12 @@ export class PreviewAreaComponent extends React.Component<IPreviewAreaComponentP
                     <div
                         title="Render without back face culling"
                         onClick={() => this.changeBackFaceCulling(!this.props.globalState.backFaceCulling)} className={"button back-face" + (!this.props.globalState.backFaceCulling ? " selected" : "")}>
-                        <img src={DoubleSided} alt=""/>
+                        <img src={doubleSided} alt=""/>
                     </div>
                     <div
                         title="Render with depth pre-pass"
                         onClick={() => this.changeDepthPrePass(!this.props.globalState.depthPrePass)} className={"button depth-pass" + (this.props.globalState.depthPrePass ? " selected" : "")}>
-                            <img src={DepthPass} alt=""/>
+                            <img src={depthPass} alt=""/>
                     </div>
                     <div
                         title="Turn on/off hemispheric light"  
@@ -67,7 +68,7 @@ export class PreviewAreaComponent extends React.Component<IPreviewAreaComponentP
                             this.props.globalState.onLightUpdated.notifyObservers();
                             this.forceUpdate();
                         }} className={"button hemispheric-light" + (this.props.globalState.hemisphericLight ? " selected" : "")}>
-                        <img src={Omni} alt=""/>
+                        <img src={omni} alt=""/>
                     </div>
                     <div
                         title="Turn on/off direction light #1"  
@@ -77,7 +78,7 @@ export class PreviewAreaComponent extends React.Component<IPreviewAreaComponentP
                             this.props.globalState.onLightUpdated.notifyObservers();
                             this.forceUpdate();
                         }} className={"button direction-light-1" + (this.props.globalState.directionalLight1 ? " selected" : "")}>
-                        <img src={DirectionalRight} alt=""/>
+                        <img src={directionalRight} alt=""/>
 
                     </div>
                     <div
@@ -88,7 +89,7 @@ export class PreviewAreaComponent extends React.Component<IPreviewAreaComponentP
                             this.props.globalState.onLightUpdated.notifyObservers();
                             this.forceUpdate();
                         }} className={"button direction-light-0" + (this.props.globalState.directionalLight0 ? " selected" : "")}>
-                        <img src={DirectionalLeft} alt=""/>
+                        <img src={directionalLeft} alt=""/>
                     </div>
                 </div>
             </>

+ 8 - 7
nodeEditor/src/components/preview/previewMeshControlComponent.tsx

@@ -6,10 +6,11 @@ import { PreviewMeshType } from './previewMeshType';
 import { DataStorage } from '../../dataStorage';
 import { OptionsLineComponent } from '../../sharedComponents/optionsLineComponent';
 import * as ReactDOM from 'react-dom';
-import PopUpIcon from './svgs/popOut.svg';
-import ColorPicker from './svgs/colorPicker.svg';
-import PauseIcon from './svgs/pauseIcon.svg';
-import PlayIcon from './svgs/playIcon.svg';
+
+const popUpIcon: string = require("./svgs/popOut.svg");
+const colorPicker: string = require("./svgs/colorPicker.svg");
+const pauseIcon: string = require("./svgs/pauseIcon.svg");
+const playIcon: string = require("./svgs/playIcon.svg");
 
 interface IPreviewMeshControlComponent {
     globalState: GlobalState;
@@ -113,7 +114,7 @@ export class PreviewMeshControlComponent extends React.Component<IPreviewMeshCon
                 <div
                     title="Turn-table animation"
                     onClick={() => this.changeAnimation()} className="button" id="play-button">
-                    {this.props.globalState.rotatePreview ? <img src={PauseIcon} alt=""/> : <img src={PlayIcon} alt=""/>}
+                    {this.props.globalState.rotatePreview ? <img src={pauseIcon} alt=""/> : <img src={playIcon} alt=""/>}
                 </div>
                 <div 
                 id="color-picker-button"
@@ -121,7 +122,7 @@ export class PreviewMeshControlComponent extends React.Component<IPreviewMeshCon
                     className={"button align"}
                     onClick={_ => this.changeBackgroundClick()}
                     >
-                    <img src={ColorPicker} alt=""/>
+                    <img src={colorPicker} alt=""/>
                     <label htmlFor="color-picker" id="color-picker-label">
                     </label>
                     <input ref={this.colorInputRef} id="color-picker" type="color" onChange={evt => this.changeBackground(evt.target.value)} />
@@ -129,7 +130,7 @@ export class PreviewMeshControlComponent extends React.Component<IPreviewMeshCon
                 <div
                     title="Open preview in new window" id="preview-new-window"
                     onClick={() => this.onPopUp()} className="button">
-                    <img src={PopUpIcon} alt=""/>
+                    <img src={popUpIcon} alt=""/>
                 </div>
             </div>
         );

+ 3 - 2
nodeEditor/src/sharedComponents/color3LineComponent.tsx

@@ -6,7 +6,8 @@ import { NumericInputComponent } from "./numericInputComponent";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";
 import { GlobalState } from '../globalState';
-import CopyIcon from "./copy.svg";
+
+const copyIcon: string = require("./copy.svg");
 
 export interface IColor3LineComponentProps {
     label: string;
@@ -150,7 +151,7 @@ export class Color3LineComponent extends React.Component<IColor3LineComponentPro
                         <input type="color" value={colorAsColor3.toHexString()} onChange={(evt) => this.onChange(evt.target.value)} />
                     </div>
                     <div className="copy hoverIcon" onClick={() => this.copyToClipboard()} title="Copy to clipboard">
-                        <img src={CopyIcon} alt=""/>
+                        <img src={copyIcon} alt=""/>
                     </div>
                     <div className="expand hoverIcon" onClick={() => this.switchExpandState()} title="Expand">
                         {chevron}

+ 2 - 2
nodeEditor/src/sharedComponents/color4LineComponent.tsx

@@ -6,8 +6,8 @@ import { NumericInputComponent } from "./numericInputComponent";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";
 import { GlobalState } from '../globalState';
-import CopyIcon from "./copy.svg";
 
+const copyIcon: string = require("./copy.svg");
 
 export interface IColor4LineComponentProps {
     label: string;
@@ -162,7 +162,7 @@ export class Color4LineComponent extends React.Component<IColor4LineComponentPro
                         <input type="color" value={colorAsColor3.toHexString()} onChange={(evt) => this.onChange(evt.target.value)} />
                     </div>
                     <div className="copy hoverIcon" onClick={() => this.copyToClipboard()} title="Copy to clipboard">
-                        <img src={CopyIcon} alt=""/>
+                        <img src={copyIcon} alt=""/>
                     </div>
                     <div className="expand hoverIcon" onClick={() => this.switchExpandState()} title="Expand">
                         {chevron}

+ 1 - 4
nodeEditor/tsconfig.json

@@ -24,8 +24,5 @@
     },
     "exclude": [
         "../../inspector"
-    ],
-    "files": [ 
-        "./custom.d.ts" 
-      ]  
+    ]
 }