diff --git a/README.md b/README.md index 5be5b197..3ff39cc9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -# wisemapping-frontend +# WiseMapping Frond End -This is a WIP migration from [legacy wisemapping](https://bitbucket.org/wisemapping/wisemapping-open-source/) into a modern web development project with multiple improvements. +WiseMapping Frond End is part of the [MindMap Open Source Project](http://www.wisemapping.org). The first release of WiseMapping was in 2010 and there was not mayor update on the architecture. In 2021, a major change started with the goal to provide a visual and technology refresh of the project. -This monorepo uses lerna and contains all the packages that compose the wisemapping frontend. +WiseMapping Front extracts all the UI related aspects in this repository. You will find three major modules: + +* Web2d: Lighway abstraction over SVG for chart renderding. +* Mindplot: Pure vanilla ES6 classes responsible for providing mindmap rendering and edition capabilities. +* Webapp: REACT application that encompass the whole midnmap adminitraction experience. ## Getting started diff --git a/docker-compose.snapshots.update.yml b/docker-compose.snapshots.update.yml index 13ff636a..1f975791 100644 --- a/docker-compose.snapshots.update.yml +++ b/docker-compose.snapshots.update.yml @@ -16,7 +16,6 @@ services: - node-modules-mindplot:/e2e/packages/mindplot/node_modules - node-modules-web2d:/e2e/packages/web2d/node_modules - node-modules-webapp:/e2e/packages/webapp/node_modules - - node-modules-webcomponent:/e2e/packages/webcomponent/node_modules - cypress-binary-cache:/root/.cache/Cypress volumes: node-modules: {} @@ -25,5 +24,4 @@ volumes: node-modules-mindplot: {} node-modules-web2d: {} node-modules-webapp: {} - node-modules-webcomponent: {} cypress-binary-cache: {} diff --git a/docker-compose.snapshots.yml b/docker-compose.snapshots.yml index 76af0667..7e8517c6 100644 --- a/docker-compose.snapshots.yml +++ b/docker-compose.snapshots.yml @@ -15,7 +15,6 @@ services: - node-modules-mindplot:/e2e/packages/mindplot/node_modules - node-modules-web2d:/e2e/packages/web2d/node_modules - node-modules-webapp:/e2e/packages/webapp/node_modules - - node-modules-webcomponent:/e2e/packages/webcomponent/node_modules - cypress-binary-cache:/root/.cache/Cypress volumes: node-modules: {} @@ -24,5 +23,4 @@ volumes: node-modules-mindplot: {} node-modules-web2d: {} node-modules-webapp: {} - node-modules-webcomponent: {} cypress-binary-cache: {} diff --git a/package.json b/package.json index a016a9e0..dfb3648d 100644 --- a/package.json +++ b/package.json @@ -44,5 +44,6 @@ }, "homepage": "http://localhost:8080/react", "license": "https://wisemapping.atlassian.net/wiki/spaces/WS/pages/524357/WiseMapping+Public+License+Version+1.0+WPL", - "version": "0.4.0" + "version": "0.4.0", + "dependencies": {} } diff --git a/packages/mindplot/README.md b/packages/mindplot/README.md index b556f501..28f360cb 100644 --- a/packages/mindplot/README.md +++ b/packages/mindplot/README.md @@ -1,6 +1,6 @@ -# `Mindplot` +# WiseMapping Mindplot -> Mindplot is the mindmap designer core +WiseMapping Mindplot module is the core mind map rerendering of WiseMapping. This lighway library allows eithe edition and visualization of saves mindmaps. ## Usage diff --git a/packages/mindplot/cypress.json b/packages/mindplot/cypress.json index 6cbb036b..d7b072d5 100644 --- a/packages/mindplot/cypress.json +++ b/packages/mindplot/cypress.json @@ -1,5 +1,6 @@ { - "video": false, - "videoUploadOnPasses": false, - "baseUrl": "http://localhost:8081" -} \ No newline at end of file + "video": false, + "videoUploadOnPasses": false, + "baseUrl": "http://localhost:8081", + "projectId": "it9g7s" +} diff --git a/packages/mindplot/cypress/integration/playground.test.js b/packages/mindplot/cypress/integration/playground.test.js index 4f784102..7119ffdb 100644 --- a/packages/mindplot/cypress/integration/playground.test.js +++ b/packages/mindplot/cypress/integration/playground.test.js @@ -8,10 +8,12 @@ context('Playground', () => { cy.visit('/layout.html'); cy.matchImageSnapshot('layout'); }); - it('the playground viewmode.html page should match its snapshot', () => { - cy.visit('/viewmode.html'); - cy.get('#mindplot.ready').should('exist'); - cy.matchImageSnapshot('viewmode'); + it('viewmode page should match its snapshot', () => { + ['welcome', 'sample1', 'sample2', 'sample3', 'sample4', 'sample5', 'sample6', 'complex', 'img-support'].forEach((mapId) => { + cy.visit(`/viewmode.html?id=${mapId}`); + cy.get('#mindplot.ready').should('exist'); + cy.matchImageSnapshot(`viewmode-${mapId}`); + }); }); it('the playground container.html page should match its snapshot', () => { cy.visit('/container.html'); diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/__diff_output__/layout.diff.png b/packages/mindplot/cypress/snapshots/playground.test.js/__diff_output__/layout.diff.png deleted file mode 100644 index 4a2d3236..00000000 Binary files a/packages/mindplot/cypress/snapshots/playground.test.js/__diff_output__/layout.diff.png and /dev/null differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/container.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/container.snap.png index ca5ce98e..93f8968c 100644 Binary files a/packages/mindplot/cypress/snapshots/playground.test.js/container.snap.png and b/packages/mindplot/cypress/snapshots/playground.test.js/container.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/editor.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/editor.snap.png index af97f33b..39a15edf 100644 Binary files a/packages/mindplot/cypress/snapshots/playground.test.js/editor.snap.png and b/packages/mindplot/cypress/snapshots/playground.test.js/editor.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/layout.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/layout.snap.png index dff2a26b..6f0445df 100644 Binary files a/packages/mindplot/cypress/snapshots/playground.test.js/layout.snap.png and b/packages/mindplot/cypress/snapshots/playground.test.js/layout.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-complex.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-complex.snap.png new file mode 100644 index 00000000..a7826c8c Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-complex.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-img-support.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-img-support.snap.png new file mode 100644 index 00000000..591270d8 Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-img-support.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample1.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample1.snap.png new file mode 100644 index 00000000..6d52fc10 Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample1.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png new file mode 100644 index 00000000..4a88354e Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample2.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample3.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample3.snap.png new file mode 100644 index 00000000..8db6f22d Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample3.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample4.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample4.snap.png new file mode 100644 index 00000000..cdd55f14 Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample4.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png new file mode 100644 index 00000000..94d9df69 Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample5.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample6.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample6.snap.png new file mode 100644 index 00000000..2401e809 Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-sample6.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-welcome.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-welcome.snap.png new file mode 100644 index 00000000..bdaa77d3 Binary files /dev/null and b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode-welcome.snap.png differ diff --git a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode.snap.png b/packages/mindplot/cypress/snapshots/playground.test.js/viewmode.snap.png deleted file mode 100644 index a58c473d..00000000 Binary files a/packages/mindplot/cypress/snapshots/playground.test.js/viewmode.snap.png and /dev/null differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Arrow.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Arrow.snap.png index be29c7f7..fc4c8b49 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Arrow.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Arrow.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Curved Line.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Curved Line.snap.png index 544c59a6..7a0840ef 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Curved Line.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Curved Line.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Events.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Events.snap.png index 8e516e2c..ff50685d 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Events.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Events.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Font.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Font.snap.png index 01991ef1..555544fc 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Font.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Font.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Group.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Group.snap.png index 809f9c4a..be7e7154 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Group.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Group.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Line.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Line.snap.png index d58730c4..50f4d324 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Line.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Line.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Poly Line.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Poly Line.snap.png index 79d3b438..19787b4e 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Poly Line.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Poly Line.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Prototype.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Prototype.snap.png index 998ed81c..7663f137 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Prototype.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Prototype.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Rect.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Rect.snap.png index 4f4141ac..1deb6e2e 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Rect.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Rect.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Shapes.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Shapes.snap.png index 1737da5d..e6c08f35 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Shapes.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Shapes.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Text.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Text.snap.png index 9974f930..27abebf0 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Text.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Text.snap.png differ diff --git a/packages/web2d/cypress/snapshots/playground.test.js/Workspace.snap.png b/packages/web2d/cypress/snapshots/playground.test.js/Workspace.snap.png index 784db25e..0eca6425 100644 Binary files a/packages/web2d/cypress/snapshots/playground.test.js/Workspace.snap.png and b/packages/web2d/cypress/snapshots/playground.test.js/Workspace.snap.png differ diff --git a/packages/web2d/webpack.dev.js b/packages/web2d/webpack.dev.js new file mode 100644 index 00000000..40eef61e --- /dev/null +++ b/packages/web2d/webpack.dev.js @@ -0,0 +1,10 @@ +const { merge } = require('webpack-merge'); +const common = require('./webpack.common'); + +/** @type {import('webpack').Configuration} */ +const prodConfig = { + mode: 'development', + devtool: 'source-map', +}; + +module.exports = merge(common, prodConfig); diff --git a/packages/web2d/webpack.prod.js b/packages/web2d/webpack.prod.js index 313d11f3..32c619f0 100644 --- a/packages/web2d/webpack.prod.js +++ b/packages/web2d/webpack.prod.js @@ -5,11 +5,6 @@ const common = require('./webpack.common'); const prodConfig = { mode: 'production', devtool: 'source-map', - optimization: { - /* splitChunks: { - chunks: "all", - }, */ - }, }; module.exports = merge(common, prodConfig); diff --git a/packages/webapp/cypress/snapshots/maps.test.ts/maps-create.snap.png b/packages/webapp/cypress/snapshots/maps.test.ts/maps-create.snap.png index fb9d4daf..4415fa05 100644 Binary files a/packages/webapp/cypress/snapshots/maps.test.ts/maps-create.snap.png and b/packages/webapp/cypress/snapshots/maps.test.ts/maps-create.snap.png differ diff --git a/packages/webapp/cypress/snapshots/maps.test.ts/maps.snap.png b/packages/webapp/cypress/snapshots/maps.test.ts/maps.snap.png index 9d53dd43..822096d6 100644 Binary files a/packages/webapp/cypress/snapshots/maps.test.ts/maps.snap.png and b/packages/webapp/cypress/snapshots/maps.test.ts/maps.snap.png differ diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 5830dca9..8d10bd45 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -5,7 +5,7 @@ "scripts": { "start": "webpack serve --config webpack.dev.js ", "build": "webpack --config webpack.prod.js", - "build-dev": "webpack --config webpack.dev.js", + "dev": "webpack --config webpack.dev.js", "lint": "eslint src", "cy:run": "cypress run", "test:integration": "start-server-and-test start http-get://localhost:3000 cy:run", diff --git a/yarn.lock b/yarn.lock index 8fa735a7..f6ad5189 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4059,9 +4059,9 @@ camelize@^1.0.0: integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs= caniuse-lite@^1.0.30001280: - version "1.0.30001286" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001286.tgz#3e9debad420419618cfdf52dc9b6572b28a8fff6" - integrity sha512-zaEMRH6xg8ESMi2eQ3R4eZ5qw/hJiVsO/HlLwniIwErij0JDr9P+8V4dtx1l+kLq6j3yy8l8W4fst1lBnat5wQ== + version "1.0.30001292" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001292.tgz" + integrity sha512-jnT4Tq0Q4ma+6nncYQVe7d73kmDmE9C3OGTx3MvW7lBM/eY1S1DZTMBON7dqV481RhNiS5OxD7k9JQvmDOTirw== caseless@~0.12.0: version "0.12.0"