mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2025-06-11 18:43:22 +02:00
refactor: support lerna, include @wisemapping/login into webapp
This commit is contained in:
13
packages/editor/index.html
Normal file
13
packages/editor/index.html
Normal 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>
|
30
packages/editor/package.json
Normal file
30
packages/editor/package.json
Normal 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"
|
||||
}
|
||||
}
|
8
packages/editor/src/components/canvas/index.tsx
Normal file
8
packages/editor/src/components/canvas/index.tsx
Normal file
@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import { StyledCanvas } from './styled';
|
||||
|
||||
const Canvas = () => (
|
||||
<StyledCanvas>canvas</StyledCanvas>
|
||||
);
|
||||
|
||||
export default Canvas;
|
8
packages/editor/src/components/canvas/styled.ts
Normal file
8
packages/editor/src/components/canvas/styled.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import styled from 'styled-components';
|
||||
|
||||
export const StyledCanvas = styled.div`
|
||||
height: 100%
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
|
||||
`;
|
8
packages/editor/src/components/footer/index.tsx
Normal file
8
packages/editor/src/components/footer/index.tsx
Normal file
@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import { StyledFooter } from './styled';
|
||||
|
||||
const Footer = () => (
|
||||
<StyledFooter>footer</StyledFooter>
|
||||
);
|
||||
|
||||
export default Footer;
|
8
packages/editor/src/components/footer/styled.ts
Normal file
8
packages/editor/src/components/footer/styled.ts
Normal 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;
|
||||
`;
|
15
packages/editor/src/components/frame/index.tsx
Normal file
15
packages/editor/src/components/frame/index.tsx
Normal 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;
|
8
packages/editor/src/components/frame/styled.ts
Normal file
8
packages/editor/src/components/frame/styled.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import styled from 'styled-components';
|
||||
|
||||
export const StyledFrame = styled.div`
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
`;
|
8
packages/editor/src/components/top-bar/index.tsx
Normal file
8
packages/editor/src/components/top-bar/index.tsx
Normal file
@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import { StyledTopBar } from './styled'
|
||||
|
||||
const TopBar = () => (
|
||||
<StyledTopBar>top bar</StyledTopBar>
|
||||
);
|
||||
|
||||
export default TopBar;
|
8
packages/editor/src/components/top-bar/styled.ts
Normal file
8
packages/editor/src/components/top-bar/styled.ts
Normal 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;
|
||||
`;
|
3
packages/editor/src/index.tsx
Normal file
3
packages/editor/src/index.tsx
Normal file
@ -0,0 +1,3 @@
|
||||
import Editor from './components/frame';
|
||||
|
||||
export default Editor;
|
9
packages/editor/src/size.ts
Normal file
9
packages/editor/src/size.ts
Normal 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`;
|
12
packages/editor/tsconfig.json
Normal file
12
packages/editor/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"sourceMap": true,
|
||||
"noImplicitAny": true,
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"jsx": "react",
|
||||
"allowJs": true,
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
44
packages/editor/webpack.config.js
Normal file
44
packages/editor/webpack.config.js
Normal 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
4699
packages/editor/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user