mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-10 17:33:24 +01:00
Mindplot: README.md was updated and the webpack
This commit is contained in:
parent
646b861771
commit
43db369942
@ -1,11 +1,43 @@
|
||||
# `mindplot`
|
||||
# `Mindplot`
|
||||
|
||||
> TODO: description
|
||||
The Mindplot is manager all **Wisemapping**. In it is implemented the packages of `core-js` and `web2d`.
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. Clone repository with the next command:
|
||||
|
||||
```
|
||||
git clone https://[username]@bitbucket.org/wisemapping/wisemapping-frontend.git
|
||||
```
|
||||
|
||||
where the variable _username_ is you username of Bitbucket.
|
||||
|
||||
_Note:The project is configured to use the yarn dependency manager_
|
||||
|
||||
2. Move to folder mindplot
|
||||
|
||||
```
|
||||
cd packages/mindplot
|
||||
```
|
||||
|
||||
3. Now you need install all dependence, this is done with command `yarn install`
|
||||
|
||||
4. To start the development enviroment you have to use command `yarn start`.
|
||||
|
||||
## Production
|
||||
|
||||
To build up the package mindplot and use in production, you have to use command `yarn build`
|
||||
|
||||
## Testing
|
||||
|
||||
For the testings of mindplot you need use command `yarn test` for run this enviroment.
|
||||
once this is done, it will open the explorer where you can see a menu with the tests carried out.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
const mindplot = require('mindplot');
|
||||
To start using mindplot it has to be required as a module and then intanciarce as a function
|
||||
|
||||
// TODO: DEMONSTRATE API
|
||||
```
|
||||
const mindplot = require('@wisemapping/mindplot');
|
||||
mindplot();
|
||||
```
|
||||
|
@ -31,7 +31,7 @@ const Messages = new Class({
|
||||
},
|
||||
});
|
||||
|
||||
const $msg = function (key) {
|
||||
global.$msg = function (key) {
|
||||
if (!Messages.__bundle) {
|
||||
Messages.init('en');
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
import LocalStorageManager from './LocalStorageManager';
|
||||
|
||||
const actionDispatcher = require('./ActionDispatcher').default;
|
||||
const actionIcon = require('./ActionIcon').default;
|
||||
const centralTopic = require('./CentralTopic').default;
|
||||
@ -32,15 +30,19 @@ const multilineTextEditor = require('./MultilineTextEditor').default;
|
||||
const nodeGraph = require('./NodeGraph').default;
|
||||
const noteIcon = require('./NoteIcon').default;
|
||||
const options = require('./Options').default;
|
||||
|
||||
const persistenceManager = require('./PersistenceManager').default;
|
||||
const relationship = require('./Relationship').default;
|
||||
const relationshipPivot = require('./RelationshipPivot').default;
|
||||
const resetPersistenceManager = require('./RestPersistenceManager').default;
|
||||
|
||||
const screenManager = require('./ScreenManager').default;
|
||||
const shrinkConnector = require('./ShrinkConnector').default;
|
||||
const standaloneActionDispatcher = require('./StandaloneActionDispatcher').default;
|
||||
const textEditor = require('./TextEditor').default;
|
||||
|
||||
const textEditorFactory = require('./TextEditorFactory').default;
|
||||
|
||||
const topic = require('./Topic').default;
|
||||
const topicEventDispatcher = require('./TopicEventDispatcher').default;
|
||||
const topicFeature = require('./TopicFeature').default;
|
||||
@ -49,16 +51,19 @@ const workspace = require('./Workspace').default;
|
||||
|
||||
export const Components = {
|
||||
ActionDispatcher: actionDispatcher,
|
||||
|
||||
ActionIcon: actionIcon,
|
||||
CentralTopic: centralTopic,
|
||||
Command: command,
|
||||
ConnectionLine: connectionLine,
|
||||
ControlPoint: controlPoint,
|
||||
Designer: designer,
|
||||
|
||||
DesignerActionRunner: designerActionRunner,
|
||||
DesignerKeyboard: designerKeyboard,
|
||||
DesignerModel: designerModal,
|
||||
DesignerUndoManager: designerUndoManager,
|
||||
|
||||
DragConnector: dragConnector,
|
||||
DragManager: dragManager,
|
||||
DragPivot: dragPivot,
|
||||
@ -66,8 +71,10 @@ export const Components = {
|
||||
EditorOptions: editorOptions,
|
||||
EditorProperties: editorProperties,
|
||||
Events: events,
|
||||
|
||||
footer: footer,
|
||||
header: header,
|
||||
|
||||
Icon: icon,
|
||||
IconGroup: iconGroup,
|
||||
ImageIcon: imageIcon,
|
||||
@ -76,11 +83,13 @@ export const Components = {
|
||||
|
||||
localSorageManager: localSorageManager,
|
||||
MainTopic: mainTopic,
|
||||
|
||||
Messages: messages,
|
||||
MultilineTextEditor: multilineTextEditor,
|
||||
NodeGraph: nodeGraph,
|
||||
NoteIcon: noteIcon,
|
||||
Options: options,
|
||||
|
||||
PersistenceManager: persistenceManager,
|
||||
Relationship: relationship,
|
||||
RelationshipPivot: relationshipPivot,
|
||||
@ -90,6 +99,7 @@ export const Components = {
|
||||
StandaloneActionDispatcher: standaloneActionDispatcher,
|
||||
TextEditor: textEditor,
|
||||
TextEditorFactory: textEditorFactory,
|
||||
|
||||
Topic: topic,
|
||||
TopicEventDispatcher: topicEventDispatcher,
|
||||
TopicFeature: topicFeature,
|
||||
|
@ -49,7 +49,6 @@ const ModalDialogNotifier = new Class({
|
||||
|
||||
var dialogNotifier = new ModalDialogNotifier();
|
||||
const $notifyModal = dialogNotifier.show.bind(dialogNotifier);
|
||||
$notifyModal;
|
||||
|
||||
export { $notifyModal };
|
||||
export default ModalDialogNotifier;
|
||||
|
@ -2,6 +2,31 @@
|
||||
module.exports = mindplot; //eslint-disable-line
|
||||
|
||||
function mindplot() {
|
||||
// Jquery for mindplot and bootstrap
|
||||
global.$ = require('jquery');
|
||||
global.jQuery = require('jquery');
|
||||
|
||||
// Mootools for the classes of Mindplot
|
||||
require('mootools');
|
||||
|
||||
// Underscore handling common tasks
|
||||
global._ = require('underscore');
|
||||
|
||||
// Core-js packages of Wisemapping
|
||||
global.core = require('@wismapping/core-js');
|
||||
|
||||
define(['raphael'], (Raphael) => {
|
||||
global.Raphael = Raphael;
|
||||
});
|
||||
require('../test/javascript/static/test/raphael-plugins');
|
||||
|
||||
// Bootsrap for styles
|
||||
require('./components/libraries/bootstrap/js/bootstrap.min');
|
||||
|
||||
/* * * * * * * *
|
||||
* MINDPLOT *
|
||||
* * * * * * * */
|
||||
|
||||
// Commands
|
||||
const { Commands } = require('./components/commands');
|
||||
|
||||
@ -9,14 +34,12 @@ function mindplot() {
|
||||
const { Layout } = require('./components/layout');
|
||||
|
||||
// Model
|
||||
|
||||
const { Model } = require('./components/model');
|
||||
|
||||
// Persistence
|
||||
const { Persistence } = require('./components/persistence');
|
||||
|
||||
// Utils
|
||||
const { Utils } = require('./components/util');
|
||||
|
||||
// Widgets
|
||||
const { Widgets } = require('./components/widget');
|
||||
|
||||
@ -25,11 +48,10 @@ function mindplot() {
|
||||
|
||||
return {
|
||||
commands: Commands,
|
||||
layouts: Layout,
|
||||
layout: Layout,
|
||||
models: Model,
|
||||
persistence: Persistence,
|
||||
utils: Utils,
|
||||
widgets: Widgets,
|
||||
components: Components,
|
||||
widget: Widgets,
|
||||
component: Components,
|
||||
};
|
||||
}
|
||||
|
@ -20,19 +20,24 @@
|
||||
"url": "git+https://ezequielVega@bitbucket.org/lilabyus/wisemapping-frontend.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn mindplot:build && yarn test:build",
|
||||
"test:build": "webpack --config webpack.test.js",
|
||||
"mindplot:build": "webpack --config webpack.prod.js",
|
||||
"build": "yarn build:dev && yarn build:test",
|
||||
"build:dev": "webpack --config webpack.prod.js",
|
||||
"test": "webpack serve --config webpack.test.js",
|
||||
"start": "webpack serve --config webpack.dev.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wismapping/core-js": "^0.0.1",
|
||||
"@wismapping/web2d": "^0.0.1"
|
||||
"@wismapping/web2d": "^0.0.1",
|
||||
"jquery": "2.1.0",
|
||||
"mootools": "1.4.5",
|
||||
"raphael": "^2.3.0",
|
||||
"underscore": "^1.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.6",
|
||||
"babel-loader": "^8.2.2",
|
||||
"clean-webpack-plugin": "^4.0.0-alpha.0",
|
||||
"html-webpack-plugin": "^5.3.2",
|
||||
"webpack": "^5.44.0",
|
||||
"webpack-cli": "^4.7.2",
|
||||
"webpack-dev-server": "^3.11.2",
|
||||
|
17
packages/mindplot/test/javascript/static/index.html
Normal file
17
packages/mindplot/test/javascript/static/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<h1>Testing</h1>
|
||||
<ul>
|
||||
<li><a href="/layout">layout</a></li>
|
||||
<li><a href="/palette">Palette</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,19 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<script src="../../../lib/components/libraries/jquery/jquery-2.1.0.min.js"></script>
|
||||
<script type='text/javascript' src='../../../lib/components/libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js'></script>
|
||||
<script src="../../../lib/components/libraries/underscorejs/underscore-min.js"></script>
|
||||
<script type='text/javascript' src='../../../../core-js/dist/core.js'></script>
|
||||
<script src="../../../dist/main.js"></script>
|
||||
|
||||
<script type="text/javascript" src="test/raphael-min.js"></script>
|
||||
<script type="text/javascript" src="test/raphael-plugins.js"></script>
|
||||
|
||||
<script src="../../../dist/test/layout.test.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
div.col {
|
||||
float: left;
|
||||
@ -23,12 +11,9 @@
|
||||
float: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div id="basicTest" style="display: none;">
|
||||
<div id="basicTest" style="display: none">
|
||||
<h1>Basic Tests</h1>
|
||||
|
||||
<h3>testAligned:</h3>
|
||||
@ -74,7 +59,7 @@
|
||||
<div id="testReconnectSingleNode2" class="col"></div>
|
||||
</div>
|
||||
|
||||
<div id="balancedTest" style="display: none;">
|
||||
<div id="balancedTest" style="display: none">
|
||||
<h1>Balanced Sorter Tests</h1>
|
||||
|
||||
<h3>testBalanced:</h3>
|
||||
@ -105,7 +90,7 @@
|
||||
<div id="testBalancedNodeDragPredict3"></div>
|
||||
</div>
|
||||
|
||||
<div id="symmetricTest" style="display: none;">
|
||||
<div id="symmetricTest" style="display: none">
|
||||
<h1>Symmetric Sorter Tests</h1>
|
||||
<h3>testSymmetry:</h3>
|
||||
<div id="testSymmetry"></div>
|
||||
@ -121,7 +106,7 @@
|
||||
<div id="testSymmetricDragPredict1"></div>
|
||||
</div>
|
||||
|
||||
<div id="freeTest" style="display: none;">
|
||||
<div id="freeTest" style="display: none">
|
||||
<h1>Free Positioning Tests</h1>
|
||||
|
||||
<h3>testFreePosition:</h3>
|
||||
@ -169,6 +154,5 @@
|
||||
<div id="testFreeOverlap1" class="col"></div>
|
||||
<div id="testFreeOverlap2" class="col"></div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -4,26 +4,6 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Document</title>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="../../../lib/components/libraries/jquery/jquery-2.1.0.js"
|
||||
></script>
|
||||
<script type="text/javascript" src="../../../../core-js/dist/core.js"></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="../../../lib/components/libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js"
|
||||
></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="../../../lib/components/libraries/underscorejs/underscore-min.js"
|
||||
></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="../../../lib/components/libraries/bootstrap/js/bootstrap.min.js"
|
||||
></script>
|
||||
|
||||
<script type="text/javascript" src="../../../dist/main.js"></script>
|
||||
<script type="text/javascript" src="../../../dist/test/palette.test.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
|
@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Document</title>
|
||||
<script src="../../../lib/components/libraries/jquery/jquery-2.1.0.min.js"></script>
|
||||
<script src="../../../lib/components/libraries/mootools/mootools-core-1.6.0.js"></script>
|
||||
<script src="../../../../core-js/dist/core.js"></script>
|
||||
<script src="../../../dist/main.js"></script>
|
||||
<script src="../../../dist/24.js"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
@ -1,14 +1,18 @@
|
||||
const { HotModuleReplacementPlugin } = require("webpack");
|
||||
const { merge } = require("webpack-merge");
|
||||
const common = require("./webpack.common");
|
||||
const { HotModuleReplacementPlugin } = require('webpack');
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.common');
|
||||
|
||||
/** @type {import('webpack').Configuration} */
|
||||
const devConfig = {
|
||||
mode: "development",
|
||||
target: "web2d",
|
||||
mode: 'development',
|
||||
devServer: {
|
||||
historyApiFallback: true,
|
||||
port: 8080,
|
||||
open: true,
|
||||
},
|
||||
target: 'web',
|
||||
plugins: [new HotModuleReplacementPlugin()],
|
||||
devtool: "eval-source-map"
|
||||
devtool: 'eval-source-map',
|
||||
};
|
||||
|
||||
module.exports = merge(common, devConfig)
|
||||
|
||||
module.exports = merge(common, devConfig);
|
||||
|
@ -1,17 +1,19 @@
|
||||
const path = require('path');
|
||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
/** @type {import('webpack').Configuration} */
|
||||
module.exports = {
|
||||
entry: {
|
||||
testingLayout: './test/javascript/static/test/testingLayout',
|
||||
testingPallete: './test/javascript/static/test/testingPalette',
|
||||
palette: path.resolve(__dirname, './test/javascript/static/test/testPalette'),
|
||||
layout: path.resolve(__dirname, './test/javascript/static/test/testLayout'),
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist', 'tests'),
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'dist', 'test'),
|
||||
filename: '[name].test.js',
|
||||
publicPath: '',
|
||||
},
|
||||
mode: 'production',
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
@ -35,5 +37,20 @@ module.exports = {
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json'],
|
||||
},
|
||||
plugins: [new CleanWebpackPlugin()],
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(),
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'test/javascript/static/index.html',
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
chunks: ['palette'],
|
||||
filename: 'palette',
|
||||
template: 'test/javascript/static/palette.html',
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
chunks: ['layout'],
|
||||
filename: 'layout',
|
||||
template: 'test/javascript/static/layout.html',
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
17
yarn.lock
17
yarn.lock
@ -5304,6 +5304,11 @@ etag@~1.8.1:
|
||||
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
|
||||
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
|
||||
|
||||
eve-raphael@0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/eve-raphael/-/eve-raphael-0.5.0.tgz#17c754b792beef3fa6684d79cf5a47c63c4cda30"
|
||||
integrity sha1-F8dUt5K+7z+maE15z1pHxjxM2jA=
|
||||
|
||||
event-emitter@~0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.2.2.tgz#c81e3724eb55407c5a0d5ee3299411f700f54291"
|
||||
@ -9717,6 +9722,13 @@ range-parser@~1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.0.3.tgz#6872823535c692e2c2a0103826afd82c2e0ff175"
|
||||
integrity sha1-aHKCNTXGkuLCoBA4Jq/YLC4P8XU=
|
||||
|
||||
raphael@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/raphael/-/raphael-2.3.0.tgz#eabeb09dba861a1d4cee077eaafb8c53f3131f89"
|
||||
integrity sha512-w2yIenZAQnp257XUWGni4bLMVxpUpcIl7qgxEgDIXtmSypYtlNxfXWpOBxs7LBTps5sDwhRnrToJrMUrivqNTQ==
|
||||
dependencies:
|
||||
eve-raphael "0.5.0"
|
||||
|
||||
raw-body@1.1.4:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-1.1.4.tgz#f0b5624388d031f63da07f870c86cb9ccadcb67d"
|
||||
@ -11796,6 +11808,11 @@ undefsafe@^2.0.3:
|
||||
dependencies:
|
||||
debug "^2.2.0"
|
||||
|
||||
underscore@^1.13.1:
|
||||
version "1.13.1"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.1.tgz#0c1c6bd2df54b6b69f2314066d65b6cde6fcf9d1"
|
||||
integrity sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==
|
||||
|
||||
unicode-canonical-property-names-ecmascript@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc"
|
||||
|
Loading…
Reference in New Issue
Block a user