Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Chore]: Technical: Isolate components (#1967)
* Components imports fixed Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * Moved some icont to constants Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * test imports fixed Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * Exports fixed Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * components isolated Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * Imports updated Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * Some import fixes Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * Review corrections Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * Build fix Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * Build fix Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> * Icons moved back to components Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com> Signed-off-by: Daria Terekhova <daria.terekhova@actionengine.com>
- Loading branch information
1 parent
9024832
commit db39b49
Showing
368 changed files
with
1,016 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// Copyright (c) 2022 Uber Technologies, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
import React, {Component, CSSProperties} from 'react'; | ||
|
||
const getStyleClassFromColor = (totalColor: number, colors: string[]) => | ||
new Array(totalColor) | ||
.fill(1) | ||
.reduce((accu, c, i) => `${accu}.cr${i + 1} {fill:${colors[i % colors.length]};}`, ''); | ||
|
||
const nop = () => {}; | ||
|
||
export type BaseProps = { | ||
/** Set the height of the icon, ex. '16px' */ | ||
height?: string; | ||
/** Set the width of the icon, ex. '16px' */ | ||
width?: string; | ||
/** Set the viewbox of the svg */ | ||
viewBox?: string; | ||
/** Path element */ | ||
|
||
predefinedClassName?: string; | ||
className?: string; | ||
style?: CSSProperties; | ||
colors?: string[]; | ||
totalColor?: number; | ||
} & React.SVGAttributes<SVGSVGElement> & | ||
React.DOMAttributes<SVGSVGElement>; | ||
|
||
export class Base extends Component<BaseProps> { | ||
static displayName = 'Base Icon'; | ||
|
||
static defaultProps = { | ||
height: null, | ||
width: null, | ||
viewBox: '0 0 64 64', | ||
predefinedClassName: '', | ||
className: '', | ||
style: { | ||
fill: 'currentColor' | ||
} | ||
}; | ||
|
||
render() { | ||
const { | ||
height, | ||
width, | ||
viewBox, | ||
style, | ||
children, | ||
predefinedClassName, | ||
className, | ||
colors, | ||
totalColor, | ||
...props | ||
} = this.props; | ||
const svgHeight = height; | ||
const svgWidth = width || svgHeight; | ||
|
||
const fillStyle = | ||
Array.isArray(colors) && totalColor && getStyleClassFromColor(totalColor, colors); | ||
|
||
return ( | ||
<svg | ||
viewBox={viewBox} | ||
width={svgWidth} | ||
height={svgHeight} | ||
style={style} | ||
className={`${predefinedClassName} ${className}`} | ||
onClick={nop} | ||
{...props} | ||
> | ||
{fillStyle ? <style type="text/css">{fillStyle}</style> : null} | ||
{children} | ||
</svg> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright (c) 2022 Uber Technologies, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
const KeplerPackage = require('./package'); | ||
|
||
const PRESETS = ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript']; | ||
const PLUGINS = [ | ||
['@babel/plugin-transform-typescript', {isTSX: true, allowDeclareFields: true}], | ||
'@babel/plugin-transform-modules-commonjs', | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-proposal-optional-chaining', | ||
[ | ||
'@babel/transform-runtime', | ||
{ | ||
regenerator: true | ||
} | ||
], | ||
[ | ||
'search-and-replace', | ||
{ | ||
rules: [ | ||
{ | ||
search: '__PACKAGE_VERSION__', | ||
replace: KeplerPackage.version | ||
} | ||
] | ||
} | ||
] | ||
]; | ||
const ENV = { | ||
test: { | ||
plugins: ['istanbul'] | ||
}, | ||
debug: { | ||
sourceMaps: 'inline', | ||
retainLines: true | ||
} | ||
}; | ||
|
||
module.exports = function babel(api) { | ||
api.cache(true); | ||
|
||
return { | ||
presets: PRESETS, | ||
plugins: PLUGINS, | ||
env: ENV | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "@kepler.gl/components", | ||
"author": "Shan He <shan@uber.com>", | ||
"version": "2.5.5", | ||
"description": "kepler.gl constants used by kepler.gl components, actions and reducers", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"keywords": [ | ||
"babel", | ||
"es6", | ||
"react", | ||
"webgl", | ||
"visualization", | ||
"deck.gl" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/keplergl/kepler.gl.git" | ||
}, | ||
"scripts": { | ||
"build": "rm -fr dist && babel src --out-dir dist --source-maps inline --extensions '.ts,.tsx,.js,.jsx' --ignore '**/*.d.ts'", | ||
"build:umd": "webpack --config ./webpack/umd.js --progress --env.prod", | ||
"build:types": "tsc --project ./tsconfig.production.json", | ||
"prepublish": "uber-licence && yarn build && yarn build:types", | ||
"stab": "mkdir -p dist && touch dist/index.js" | ||
}, | ||
"files": [ | ||
"dist", | ||
"umd" | ||
], | ||
"nyc": { | ||
"sourceMap": false, | ||
"instrument": false | ||
}, | ||
"engines": { | ||
"node": ">=12.0.0" | ||
}, | ||
"maintainers": [ | ||
"Shan He <heshan0131@gmail.com>", | ||
"Giuseppe Macri <gmacri@uber.com>" | ||
], | ||
"volta": { | ||
"node": "12.22.0", | ||
"yarn": "1.22.17" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...tion-control/animation-window-control.tsx → ...tion-control/animation-window-control.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...common/animation-control/play-control.tsx → ...common/animation-control/play-control.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ommon/animation-control/reset-control.tsx → ...ommon/animation-control/reset-control.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...imation-control/window-action-control.tsx → ...imation-control/window-action-control.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.