diff --git a/packages/mindplot/README.md b/packages/mindplot/README.md index 507d5675..debb11a1 100644 --- a/packages/mindplot/README.md +++ b/packages/mindplot/README.md @@ -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(); ``` diff --git a/packages/mindplot/lib/components/Messages.js b/packages/mindplot/lib/components/Messages.js index 2c80a3a2..93a16a42 100644 --- a/packages/mindplot/lib/components/Messages.js +++ b/packages/mindplot/lib/components/Messages.js @@ -31,7 +31,7 @@ const Messages = new Class({ }, }); -const $msg = function (key) { +global.$msg = function (key) { if (!Messages.__bundle) { Messages.init('en'); } diff --git a/packages/mindplot/lib/components/index.js b/packages/mindplot/lib/components/index.js index 0bbb5052..099534b8 100644 --- a/packages/mindplot/lib/components/index.js +++ b/packages/mindplot/lib/components/index.js @@ -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, diff --git a/packages/mindplot/lib/components/widget/ModalDialogNotifier.js b/packages/mindplot/lib/components/widget/ModalDialogNotifier.js index a053b973..659c7aaa 100644 --- a/packages/mindplot/lib/components/widget/ModalDialogNotifier.js +++ b/packages/mindplot/lib/components/widget/ModalDialogNotifier.js @@ -49,7 +49,6 @@ const ModalDialogNotifier = new Class({ var dialogNotifier = new ModalDialogNotifier(); const $notifyModal = dialogNotifier.show.bind(dialogNotifier); -$notifyModal; export { $notifyModal }; export default ModalDialogNotifier; diff --git a/packages/mindplot/lib/mindplot.js b/packages/mindplot/lib/mindplot.js index 4aae2738..8f590380 100644 --- a/packages/mindplot/lib/mindplot.js +++ b/packages/mindplot/lib/mindplot.js @@ -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, }; } diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index 1b904886..6aa393dc 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -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", diff --git a/packages/mindplot/test/javascript/static/index.html b/packages/mindplot/test/javascript/static/index.html new file mode 100644 index 00000000..9102a66b --- /dev/null +++ b/packages/mindplot/test/javascript/static/index.html @@ -0,0 +1,17 @@ + + +
+ + +