refactor: support lerna, include @wisemapping/login into webapp

This commit is contained in:
Ezequiel Bergamaschi
2020-12-05 02:47:02 -05:00
parent 76fca84366
commit 937f5ff9cb
52 changed files with 20309 additions and 280 deletions

View File

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wisemapping</title>
</head>
<body>
<!-- React app root element -->
<div id="root"></div>
</body>
</html>

View File

@ -0,0 +1,30 @@
{
"name": "@wisemapping/editor",
"version": "1.0.0",
"main": "src/index.tsx",
"scripts": {
"lint": "eslint src"
},
"repository": "http://www.wisemapping.com",
"author": "Paulo Veiga <pveiga@gmail.com>, Ezequiel Bergamaschi <ezequielbergamaschi@gmail.com>",
"license": "MIT",
"private": false,
"devDependencies": {
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint": "^7.14.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"ts-loader": "^8.0.11",
"ts-node": "^9.0.0",
"typescript": "^4.1.2"
},
"dependencies": {
"@types/styled-components": "^5.1.4",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"styled-components": "^5.2.1"
}
}

View File

@ -0,0 +1,8 @@
import React from 'react';
import { StyledCanvas } from './styled';
const Canvas = () => (
<StyledCanvas>canvas</StyledCanvas>
);
export default Canvas;

View File

@ -0,0 +1,8 @@
import styled from 'styled-components';
export const StyledCanvas = styled.div`
height: 100%
width: 100%;
flex: 1;
`;

View File

@ -0,0 +1,8 @@
import React from 'react';
import { StyledFooter } from './styled';
const Footer = () => (
<StyledFooter>footer</StyledFooter>
);
export default Footer;

View File

@ -0,0 +1,8 @@
import styled from 'styled-components';
import { times } from '../../size';
export const StyledFooter = styled.div`
height: ${times(10)};
width: 100%;
border: 1px solid black;
`;

View File

@ -0,0 +1,15 @@
import React from 'react';
import Footer from '../footer';
import TopBar from '../top-bar';
import Canvas from '../canvas';
import { StyledFrame } from './styled';
const Frame = () => (
<StyledFrame>
<TopBar />
<Canvas />
<Footer />
</StyledFrame>
);
export default Frame;

View File

@ -0,0 +1,8 @@
import styled from 'styled-components';
export const StyledFrame = styled.div`
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
`;

View File

@ -0,0 +1,8 @@
import React from 'react';
import { StyledTopBar } from './styled'
const TopBar = () => (
<StyledTopBar>top bar</StyledTopBar>
);
export default TopBar;

View File

@ -0,0 +1,8 @@
import styled from 'styled-components';
import { times } from '../../size';
export const StyledTopBar = styled.div`
height: ${times(10)};
width: 100%;
border: 1px solid black;
`;

View File

@ -0,0 +1,3 @@
import Editor from './components/frame';
export default Editor;

View File

@ -0,0 +1,9 @@
const unit = 4; // pixels
export const XS = '4px';
export const S = '8px';
export const M = '16px';
export const L = '24px';
export const XL = '24px';
export const times = (n: number) => `${unit * n}px`;

View File

@ -0,0 +1,12 @@
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"allowJs": true,
"esModuleInterop": true
}
}

View File

@ -0,0 +1,44 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'eval-source-map',
entry: {
app: path.join(__dirname, 'src', 'index.tsx')
},
target: 'web',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: '/node_modules/'
}
],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'index.html')
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
],
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000,
hot: true,
}
}

4699
packages/editor/yarn.lock Normal file

File diff suppressed because it is too large Load Diff